	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function Direct3DSwapChain9_Init
LCPI0_0:
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	2                               ## 0x2
	.long	3                               ## 0x3
LCPI0_1:
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
	.long	4                               ## 0x4
LCPI0_2:
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.long	8                               ## 0x8
	.long	8                               ## 0x8
LCPI0_3:
	.long	12                              ## 0xc
	.long	12                              ## 0xc
	.long	12                              ## 0xc
	.long	12                              ## 0xc
LCPI0_4:
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.long	16                              ## 0x10
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_Direct3DSwapChain9_Init
	.p2align	4, 0x90
_Direct3DSwapChain9_Init:               ## @Direct3DSwapChain9_Init
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	48(%rdi), %rax
	movq	32(%rdi), %rcx
	movq	40(%rdi), %rdx
	movq	%rdx, %rsi
	subq	%rax, %rsi
	cmpq	$32, %rsi
	jb	LBB0_5
## %bb.1:
	movq	%rcx, %rsi
	subq	%rax, %rsi
	cmpq	$32, %rsi
	jb	LBB0_5
## %bb.2:
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	cmpq	$32, %rsi
	jb	LBB0_5
## %bb.3:
	movdqa	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,1,2,3]
	xorl	%esi, %esi
	movdqa	LCPI0_1(%rip), %xmm1            ## xmm1 = [4,4,4,4]
	movdqa	LCPI0_2(%rip), %xmm2            ## xmm2 = [8,8,8,8]
	movdqa	LCPI0_3(%rip), %xmm3            ## xmm3 = [12,12,12,12]
	movdqa	LCPI0_4(%rip), %xmm4            ## xmm4 = [16,16,16,16]
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movdqa	%xmm0, %xmm5
	paddd	%xmm1, %xmm5
	movdqu	%xmm0, (%rax,%rsi,4)
	movdqu	%xmm5, 16(%rax,%rsi,4)
	movdqu	%xmm0, (%rdx,%rsi,4)
	movdqu	%xmm5, 16(%rdx,%rsi,4)
	movdqu	%xmm0, (%rcx,%rsi,4)
	movdqu	%xmm5, 16(%rcx,%rsi,4)
	movdqa	%xmm0, %xmm5
	paddd	%xmm2, %xmm5
	movdqa	%xmm0, %xmm6
	paddd	%xmm3, %xmm6
	movdqu	%xmm5, 32(%rax,%rsi,4)
	movdqu	%xmm6, 48(%rax,%rsi,4)
	movdqu	%xmm5, 32(%rdx,%rsi,4)
	movdqu	%xmm6, 48(%rdx,%rsi,4)
	movdqu	%xmm5, 32(%rcx,%rsi,4)
	movdqu	%xmm6, 48(%rcx,%rsi,4)
	addq	$16, %rsi
	paddd	%xmm4, %xmm0
	cmpq	$256, %rsi                      ## imm = 0x100
	jne	LBB0_4
	jmp	LBB0_7
LBB0_5:
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	%esi, (%rax,%rsi,4)
	movl	%esi, (%rdx,%rsi,4)
	movl	%esi, (%rcx,%rsi,4)
	leal	1(%rsi), %edi
	movl	%edi, 4(%rax,%rsi,4)
	movl	%edi, 4(%rdx,%rsi,4)
	movl	%edi, 4(%rcx,%rsi,4)
	addq	$2, %rsi
	cmpq	$256, %rsi                      ## imm = 0x100
	jne	LBB0_6
LBB0_7:
	leaq	20(%rbx), %rsi
	movq	(%rbx), %rax
	movl	(%r14,%rax,4), %eax
	movl	%eax, 20(%rbx)
	movl	(%r14), %eax
	movl	%eax, 24(%rbx)
	movq	%rbx, %rdi
	callq	_Direct3DSwapChain9_SetDisplayMode
	leaq	16(%rbx), %rdi
	leaq	-24(%rbp), %rsi
	callq	_D3D9BaseObject_GetDeviceInt
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rdi
	callq	_DPRINT1
	movq	_DDERR_GENERIC@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_9:
	movq	-24(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_CreateD3D9Cursor
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_Direct3DSwapChain9_Reset
LBB0_13:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	callq	_DPRINT1
	movq	_DDERR_OUTOFMEMORY@GOTPCREL(%rip), %rax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not get the swapchain device"

	.comm	_DDERR_GENERIC,4,2              ## @DDERR_GENERIC
L_.str.1:                               ## @.str.1
	.asciz	"Could not allocate D3D9Cursor"

	.comm	_DDERR_OUTOFMEMORY,4,2          ## @DDERR_OUTOFMEMORY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function Direct3DSwapChain9_Init
lCPI0_0:
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	2                               ; 0x2
	.long	3                               ; 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_Direct3DSwapChain9_Init
	.p2align	2
_Direct3DSwapChain9_Init:               ; @Direct3DSwapChain9_Init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	ldp	x8, x11, [x0, #40]
	ldr	x9, [x0, #32]
	sub	x10, x8, x11
	cmp	x10, #64
	b.lo	LBB0_5
; %bb.1:
	sub	x10, x9, x11
	cmp	x10, #64
	b.lo	LBB0_5
; %bb.2:
	sub	x10, x9, x8
	cmp	x10, #64
	b.lo	LBB0_5
; %bb.3:
	mov	x10, #0
Lloh0:
	adrp	x12, lCPI0_0@PAGE
Lloh1:
	ldr	q0, [x12, lCPI0_0@PAGEOFF]
	add	x11, x11, #32
	movi.4s	v1, #4
	movi.4s	v2, #8
	movi.4s	v3, #12
	movi.4s	v4, #16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add.4s	v5, v0, v1
	add.4s	v6, v0, v2
	add	x12, x11, x10
	stp	q0, q5, [x12, #-32]
	add.4s	v7, v0, v3
	stp	q6, q7, [x12]
	add	x12, x8, x10
	stp	q0, q5, [x12]
	stp	q6, q7, [x12, #32]
	add	x12, x9, x10
	stp	q0, q5, [x12]
	add.4s	v0, v0, v4
	add	x10, x10, #64
	stp	q6, q7, [x12, #32]
	cmp	x10, #1024
	b.ne	LBB0_4
	b	LBB0_7
LBB0_5:
	mov	x10, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x10, #2
	str	w10, [x11, x12]
	str	w10, [x8, x12]
	str	w10, [x9, x12]
	add	x10, x10, #1
	cmp	x10, #256
	b.ne	LBB0_6
LBB0_7:
	ldr	x8, [x20]
	ldr	w8, [x19, x8, lsl #2]
	mov	x1, x20
	str	w8, [x1, #20]!
	ldr	w8, [x19]
	str	w8, [x20, #24]
	mov	x0, x20
	bl	_Direct3DSwapChain9_SetDisplayMode
	add	x0, x20, #16
	add	x1, sp, #8
	bl	_D3D9BaseObject_GetDeviceInt
	bl	_FAILED
	cbz	x0, LBB0_10
; %bb.8:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINT1
Lloh4:
	adrp	x8, _DDERR_GENERIC@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DDERR_GENERIC@GOTPAGEOFF]
LBB0_9:
	ldr	w0, [x8]
	b	LBB0_12
LBB0_10:
	ldr	x0, [sp, #8]
	mov	x1, x20
	bl	_CreateD3D9Cursor
	str	x0, [x20, #8]
	cbz	x0, LBB0_13
; %bb.11:
	mov	x0, x20
	mov	x1, x19
	bl	_Direct3DSwapChain9_Reset
LBB0_12:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_13:
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DPRINT1
Lloh8:
	adrp	x8, _DDERR_OUTOFMEMORY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DDERR_OUTOFMEMORY@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdr	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not get the swapchain device"

	.comm	_DDERR_GENERIC,4,2              ; @DDERR_GENERIC
l_.str.1:                               ; @.str.1
	.asciz	"Could not allocate D3D9Cursor"

	.comm	_DDERR_OUTOFMEMORY,4,2          ; @DDERR_OUTOFMEMORY
.subsections_via_symbols
