	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3dx9_copy_data
_d3dx9_copy_data:                       ## @d3dx9_copy_data
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	(%rdi), %r12
	movl	%esi, %ebx
	shlq	$4, %rbx
	leaq	(%r12,%rbx), %r15
	cmpl	$0, (%r12,%rbx)
	jne	LBB0_2
## %bb.1:
	cmpq	$0, 8(%r12,%rbx)
	je	LBB0_6
LBB0_2:
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	callq	_FIXME
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
LBB0_5:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movq	8(%r12,%rbx), %rdx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapFree
	movq	$0, 8(%r12,%rbx)
LBB0_6:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_read_dword
	movl	(%r15), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_TRACE
	movq	_D3D_OK@GOTPCREL(%rip), %r13
	cmpl	$0, (%r15)
	je	LBB0_10
## %bb.7:
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	(%r15), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 8(%r12,%rbx)
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	addq	%r12, %rbx
	addq	$8, %rbx
	movq	(%r14), %rdi
	movl	(%r15), %esi
	callq	_debugstr_an
	leaq	L_.str.4(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_TRACE
	movq	(%rbx), %rdi
	movq	(%r14), %rsi
	movl	(%r15), %edx
	callq	_memcpy
	movslq	(%r15), %rax
	addq	$3, %rax
	andq	$-4, %rax
	addq	%rax, (%r14)
	jmp	LBB0_10
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
	callq	_ERR
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %r13
LBB0_10:
	movl	(%r13), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Overwriting object id %u!\n"

L_.str.1:                               ## @.str.1
	.asciz	"Overwriting object id 0.\n"

L_.str.2:                               ## @.str.2
	.asciz	"Data size: %#x.\n"

	.comm	_D3D_OK,4,2                     ## @D3D_OK
L_.str.3:                               ## @.str.3
	.asciz	"Failed to allocate object memory.\n"

	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
L_.str.4:                               ## @.str.4
	.asciz	"Data: %s.\n"

	.no_dead_strip	_d3dx9_copy_data
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3dx9_copy_data
_d3dx9_copy_data:                       ; @d3dx9_copy_data
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x2
	ldr	x21, [x0]
	mov	w22, w1
	add	x20, x21, w1, uxtw #4
	ldr	w8, [x20]
	cbnz	w8, LBB0_2
; %bb.1:
	add	x8, x21, x22, lsl #4
	ldr	x8, [x8, #8]
	cbz	x8, LBB0_6
LBB0_2:
	cbz	w1, LBB0_4
; %bb.3:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_FIXME
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TRACE
LBB0_5:
	bl	_GetProcessHeap
	add	x23, x21, x22, lsl #4
	ldr	x2, [x23, #8]
	mov	w1, #0
	bl	_HeapFree
	str	xzr, [x23, #8]
LBB0_6:
	mov	x0, x19
	mov	x1, x20
	bl	_read_dword
	ldr	w8, [x20]
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TRACE
	ldr	w8, [x20]
	cbz	w8, LBB0_9
; %bb.7:
	bl	_GetProcessHeap
	ldr	w2, [x20]
	mov	w1, #0
	bl	_HeapAlloc
	add	x21, x21, x22, lsl #4
	str	x0, [x21, #8]!
	cbz	x0, LBB0_10
; %bb.8:
	ldr	x0, [x19]
	ldr	w1, [x20]
	bl	_debugstr_an
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh6:
	adrp	x0, l_.str.4@PAGE
Lloh7:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_TRACE
	ldr	x0, [x21]
	ldr	x1, [x19]
	ldr	w2, [x20]
	bl	_memcpy
	ldrsw	x8, [x20]
	add	x8, x8, #3
	and	x8, x8, #0xfffffffffffffffc
	ldr	x9, [x19]
	add	x8, x9, x8
	str	x8, [x19]
LBB0_9:
Lloh8:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh10:
	adrp	x0, l_.str.3@PAGE
Lloh11:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_ERR
Lloh12:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh13:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Overwriting object id %u!\n"

l_.str.1:                               ; @.str.1
	.asciz	"Overwriting object id 0.\n"

l_.str.2:                               ; @.str.2
	.asciz	"Data size: %#x.\n"

	.comm	_D3D_OK,4,2                     ; @D3D_OK
l_.str.3:                               ; @.str.3
	.asciz	"Failed to allocate object memory.\n"

	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
l_.str.4:                               ; @.str.4
	.asciz	"Data: %s.\n"

	.no_dead_strip	_d3dx9_copy_data
.subsections_via_symbols
