	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function device_state_init
_device_state_init:                     ## @device_state_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
	leaq	-24(%rbp), %rsi
	callq	_IDirect3DDevice9_GetDeviceCaps
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	jne	LBB0_12
## %bb.1:
	movl	-24(%rbp), %eax
	movl	%eax, (%r14)
	xorl	%eax, %eax
	callq	_GetProcessHeap
	movl	(%r14), %edx
	shll	$3, %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_HeapAlloc
	movq	%rax, 16(%r14)
	testq	%rax, %rax
	je	LBB0_13
## %bb.2:
	movl	(%r14), %esi
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.3:
	movq	$0, (%rax)
	cmpl	$1, %esi
	je	LBB0_10
## %bb.4:
	leaq	-1(%rsi), %rdx
	addq	$-2, %rsi
	movl	%edx, %eax
	andl	$3, %eax
	movl	$1, %ecx
	cmpq	$3, %rsi
	jb	LBB0_8
## %bb.5:
	andq	$-4, %rdx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rsi
	movq	$0, 8(%rsi,%rcx,8)
	movq	16(%r14), %rsi
	movq	$0, 16(%rsi,%rcx,8)
	movq	16(%r14), %rsi
	movq	$0, 24(%rsi,%rcx,8)
	movq	16(%r14), %rsi
	movq	$0, 32(%rsi,%rcx,8)
	addq	$4, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_6
## %bb.7:
	incq	%rcx
LBB0_8:
	testq	%rax, %rax
	je	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rdx
	movq	$0, (%rdx,%rcx,8)
	incq	%rcx
	decq	%rax
	jne	LBB0_9
LBB0_10:
	movq	$0, 8(%r14)
	movq	_D3D_OK@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_13:
	movq	_E_OUTOFMEMORY@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_E_OUTOFMEMORY,4,2              ## @E_OUTOFMEMORY
	.comm	_D3D_OK,4,2                     ## @D3D_OK
	.no_dead_strip	_device_state_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function device_state_init
_device_state_init:                     ; @device_state_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
	add	x1, sp, #8
	bl	_IDirect3DDevice9_GetDeviceCaps
	mov	x20, x0
	bl	_FAILED
	cbnz	x0, LBB0_9
; %bb.1:
	ldr	w8, [sp, #8]
	str	w8, [x19]
	bl	_GetProcessHeap
	ldr	w8, [x19]
	lsl	w2, w8, #3
	mov	w1, #0
	bl	_HeapAlloc
	str	x0, [x19, #16]
	cbz	x0, LBB0_7
; %bb.2:
	ldr	w8, [x19]
	cbz	w8, LBB0_6
; %bb.3:
	str	xzr, [x0]
	cmp	w8, #1
	b.eq	LBB0_6
; %bb.4:
	mov	w9, #1
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x19, #16]
	str	xzr, [x10, x9, lsl #3]
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_5
LBB0_6:
	str	xzr, [x19, #8]
Lloh0:
	adrp	x8, _D3D_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _D3D_OK@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh2:
	adrp	x8, _E_OUTOFMEMORY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _E_OUTOFMEMORY@GOTPAGEOFF]
LBB0_8:
	ldr	w20, [x8]
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_E_OUTOFMEMORY,4,2              ; @E_OUTOFMEMORY
	.comm	_D3D_OK,4,2                     ; @D3D_OK
	.no_dead_strip	_device_state_init
.subsections_via_symbols
