	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3d8_init_base
_d3d8_init_base:                        ## @d3d8_init_base
	.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	%rsi, %r15
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_win32_get_window
	movq	%rax, %r14
	leaq	-44(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	xorl	%eax, %eax
	callq	_d3d8_create
	movq	_g_pD3D8@GOTPCREL(%rip), %r13
	movq	%rax, (%r13)
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_d3d8_make_d3dpp
	movq	(%r13), %rdx
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %r8d
	addq	$4, %rbx
	leaq	-44(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rcx
	callq	_d3d8_create_device
	movl	%eax, %ecx
	movl	$1, %eax
	testl	%ecx, %ecx
	jne	LBB0_5
## %bb.3:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_1:
	leaq	L_.str(%rip), %rdi
LBB0_4:
	callq	_RARCH_ERR
	xorl	%eax, %eax
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_g_pD3D8,8,3                    ## @g_pD3D8
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[D3D8]: Failed to create D3D interface.\n"

L_.str.1:                               ## @.str.1
	.asciz	"[D3D8]: Failed to initialize device.\n"

	.no_dead_strip	_d3d8_init_base
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3d8_init_base
_d3d8_init_base:                        ; @d3d8_init_base
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_win32_get_window
	mov	x20, x0
	add	x0, sp, #12
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	bl	_d3d8_create
Lloh0:
	adrp	x22, _g_pD3D8@GOTPAGE
Lloh1:
	ldr	x22, [x22, _g_pD3D8@GOTPAGEOFF]
	str	x0, [x22]
	add	x2, sp, #12
	mov	x0, x19
	mov	x1, x21
	bl	_d3d8_make_d3dpp
	ldr	x2, [x22]
	cbz	x2, LBB0_3
; %bb.1:
	ldr	w4, [x19], #4
	add	x1, sp, #12
	mov	x0, x19
	mov	x3, x20
	bl	_d3d8_create_device
	cbz	w0, LBB0_4
; %bb.2:
	mov	w0, #1
	b	LBB0_6
LBB0_3:
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_5
LBB0_4:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_5:
	bl	_RARCH_ERR
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_g_pD3D8,8,3                    ; @g_pD3D8
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[D3D8]: Failed to create D3D interface.\n"

l_.str.1:                               ; @.str.1
	.asciz	"[D3D8]: Failed to initialize device.\n"

	.no_dead_strip	_d3d8_init_base
.subsections_via_symbols
