	.file	"extr_vertexdeclaration.c_convert_to_wined3d_declaration.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"d3d9_elements %p, wined3d_elements %p, element_count %p\n"
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"Memory allocation failed\n"
.LC2:
	.string	"Invalid element type %#x.\n"
	.text
	.p2align 4
	.type	convert_to_wined3d_declaration, @function
convert_to_wined3d_declaration:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	rcx, rdx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	mov	rdx, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	mov	rsi, rdi
	lea	rdi, .LC0[rip]
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	TRACE@PLT
	lea	rdx, 24[r13]
	mov	eax, 1
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L25:
	add	eax, 1
	add	rdx, 32
	cmp	eax, 129
	je	.L24
.L3:
	cmp	DWORD PTR [rdx], 255
	jne	.L25
	cmp	eax, 128
	je	.L22
	lea	r12d, -1[rax]
	lea	edi, [r12+r12*2]
	sal	edi, 4
	call	heap_alloc@PLT
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L7
	test	r12d, r12d
	je	.L9
.L8:
	mov	rdi, QWORD PTR d3d_dtype_lookup[rip]
	xor	r14d, r14d
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdx, QWORD PTR 0[r13]
	mov	rdi, QWORD PTR d3d_dtype_lookup[rip]
	lea	rax, [r14+r14*2]
	add	r14, 1
	sal	rax, 4
	add	rax, QWORD PTR [rbx]
	add	r13, 32
	mov	edx, DWORD PTR [rdi+rdx*4]
	mov	DWORD PTR 40[rax], edx
	mov	edx, DWORD PTR -8[r13]
	mov	DWORD PTR 36[rax], edx
	mov	edx, DWORD PTR -12[r13]
	mov	QWORD PTR 16[rax], 0
	mov	DWORD PTR 32[rax], edx
	mov	edx, DWORD PTR WINED3D_OUTPUT_SLOT_SEMANTIC[rip]
	mov	DWORD PTR 28[rax], edx
	mov	edx, DWORD PTR WINED3D_INPUT_PER_VERTEX_DATA[rip]
	mov	DWORD PTR 24[rax], edx
	mov	edx, DWORD PTR -16[r13]
	mov	DWORD PTR 8[rax], edx
	mov	edx, DWORD PTR -20[r13]
	mov	DWORD PTR 4[rax], edx
	mov	edx, DWORD PTR -24[r13]
	mov	DWORD PTR [rax], edx
	cmp	r12d, r14d
	jle	.L9
.L11:
	mov	r15, QWORD PTR 0[r13]
	call	ARRAY_SIZE@PLT
	cmp	r15, rax
	jb	.L10
	mov	rsi, QWORD PTR 0[r13]
	lea	rdi, .LC2[rip]
	call	WARN@PLT
	mov	rdi, QWORD PTR [rbx]
	call	heap_free@PLT
.L22:
	mov	eax, DWORD PTR E_FAIL[rip]
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	DWORD PTR 0[rbp], r12d
	mov	eax, DWORD PTR D3D_OK[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	call	FIXME@PLT
	mov	eax, DWORD PTR D3DERR_OUTOFVIDEOMEMORY[rip]
	jmp	.L1
.L24:
	mov	edi, 6144
	call	heap_alloc@PLT
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L7
	mov	r12d, 128
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	convert_to_wined3d_declaration, .-convert_to_wined3d_declaration
	.comm	d3d_dtype_lookup,8,8
	.comm	WINED3D_OUTPUT_SLOT_SEMANTIC,4,4
	.comm	WINED3D_INPUT_PER_VERTEX_DATA,4,4
	.comm	E_FAIL,4,4
	.comm	D3D_OK,4,4
	.comm	D3DERR_OUTOFVIDEOMEMORY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_vertexdeclaration.c_convert_to_wined3d_declaration.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"d3d9_elements %p, wined3d_elements %p, element_coun"
	.ascii	"t %p\012\000"
	.align	2
.LC1:
	.ascii	"Memory allocation failed\012\000"
	.align	2
.LC2:
	.ascii	"Invalid element type %#x.\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	convert_to_wined3d_declaration, %function
convert_to_wined3d_declaration:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	sub	sp, sp, #12
	mov	r3, r2
	str	r2, [sp, #4]
	mov	r6, r1
	mov	r2, r1
	mov	r1, r0
	ldr	r0, .L26
	bl	TRACE
	mov	r4, #1
	mov	r3, r5
	b	.L3
.L25:
	add	r4, r4, #1
	cmp	r4, #129
	beq	.L24
.L3:
	ldr	r2, [r3, #20]
	add	r3, r3, #24
	cmp	r2, #255
	bne	.L25
	cmp	r4, #128
	beq	.L22
	sub	r4, r4, #1
	add	r0, r4, r4, lsl #3
	lsl	r0, r0, #2
	bl	heap_alloc
	cmp	r0, #0
	str	r0, [r6]
	beq	.L7
	cmp	r4, #0
	beq	.L9
.L8:
	ldr	r7, .L26+4
	mov	fp, #0
	ldr	r9, .L26+8
	ldr	r0, [r7]
	ldr	r8, .L26+12
	b	.L11
.L10:
	ldr	r3, [r5]
	ldr	r0, [r7]
	ldr	r1, [r6]
	ldr	ip, [r0, r3, lsl #2]
	add	r3, r1, r2, lsl #2
	str	ip, [r3, #32]
	ldr	ip, [r5, #20]
	ldr	lr, [r9]
	str	ip, [r3, #28]
	ldr	ip, [r5, #16]
	str	lr, [r3, #20]
	mov	lr, #0
	str	ip, [r3, #24]
	ldr	ip, [r8]
	cmp	fp, r4
	str	ip, [r3, #16]
	ldr	ip, [r5, #12]
	str	lr, [r3, #12]
	str	ip, [r3, #8]
	ldr	ip, [r5, #8]
	add	r5, r5, #24
	str	ip, [r3, #4]
	ldr	r3, [r5, #-20]
	str	r3, [r1, r2, lsl #2]
	bge	.L9
.L11:
	ldr	r10, [r5]
	bl	ARRAY_SIZE
	cmp	r10, r0
	add	r2, fp, fp, lsl #3
	add	fp, fp, #1
	bcc	.L10
	ldr	r1, [r5]
	ldr	r0, .L26+16
	bl	WARN
	ldr	r0, [r6]
	bl	heap_free
.L22:
	ldr	r3, .L26+20
	ldr	r0, [r3]
.L1:
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L9:
	ldr	r2, [sp, #4]
	ldr	r3, .L26+24
	str	r4, [r2]
	ldr	r0, [r3]
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L7:
	ldr	r0, .L26+28
	bl	FIXME
	ldr	r3, .L26+32
	ldr	r0, [r3]
	b	.L1
.L24:
	mov	r0, #4608
	bl	heap_alloc
	cmp	r0, #0
	str	r0, [r6]
	beq	.L7
	mov	r4, #128
	b	.L8
.L27:
	.align	2
.L26:
	.word	.LC0
	.word	d3d_dtype_lookup
	.word	WINED3D_OUTPUT_SLOT_SEMANTIC
	.word	WINED3D_INPUT_PER_VERTEX_DATA
	.word	.LC2
	.word	E_FAIL
	.word	D3D_OK
	.word	.LC1
	.word	D3DERR_OUTOFVIDEOMEMORY
	.size	convert_to_wined3d_declaration, .-convert_to_wined3d_declaration
	.comm	d3d_dtype_lookup,4,4
	.comm	WINED3D_OUTPUT_SLOT_SEMANTIC,4,4
	.comm	WINED3D_INPUT_PER_VERTEX_DATA,4,4
	.comm	E_FAIL,4,4
	.comm	D3D_OK,4,4
	.comm	D3DERR_OUTOFVIDEOMEMORY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
