	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ddraw_init                     ## -- Begin function ddraw_init
	.p2align	4, 0x90
_ddraw_init:                            ## @ddraw_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	_ddraw7_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 104(%rdi)
	movq	_ddraw1_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 96(%rdi)
	movq	_ddraw2_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 88(%rdi)
	movq	_ddraw4_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 80(%rdi)
	movq	_d3d1_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 72(%rdi)
	movq	_d3d2_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 64(%rdi)
	movq	_d3d3_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 56(%rdi)
	movq	_d3d7_vtbl@GOTPCREL(%rip), %rax
	movq	%rax, 48(%rdi)
	movq	_ddraw_wined3d_device_parent_ops@GOTPCREL(%rip), %rax
	movq	%rax, 32(%rdi)
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%rdi)
	movq	_DDRAW_WINED3D_FLAGS@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movl	%r15d, %edi
	callq	_wined3d_create
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movq	_WINED3D_NO3D@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movl	%r15d, %edi
	callq	_wined3d_create
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_2
LBB0_4:
	movq	_WINED3DADAPTER_DEFAULT@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-40(%rbp), %rcx
	movq	%rax, %rdi
	movl	%r14d, %edx
	callq	_wined3d_get_device_caps
	movl	%eax, %r15d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	movl	%r15d, %esi
	callq	_ERR
	movq	16(%rbx), %rdi
	callq	_wined3d_decref
	movq	_E_FAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_6:
	leaq	32(%rbx), %r15
	movq	_WINEDDCAPS_3D@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -40(%rbp)
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_WARN
	movq	_DDRAW_NO3D@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 40(%rbx)
LBB0_8:
	movq	16(%rbx), %rdi
	movl	(%r12), %esi
	movq	_DDRAW_STRIDE_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	24(%rbx), %rax
	movl	%r14d, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	pushq	%rax
	pushq	%r15
	callq	_wined3d_device_create
	addq	$16, %rsp
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_WARN
	movq	16(%rbx), %rdi
	callq	_wined3d_decref
	jmp	LBB0_12
LBB0_2:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_WARN
	movq	_E_FAIL@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_10:
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_list_init
	movq	_DD_OK@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ddraw7_vtbl,4,2                ## @ddraw7_vtbl
	.comm	_ddraw1_vtbl,4,2                ## @ddraw1_vtbl
	.comm	_ddraw2_vtbl,4,2                ## @ddraw2_vtbl
	.comm	_ddraw4_vtbl,4,2                ## @ddraw4_vtbl
	.comm	_d3d1_vtbl,4,2                  ## @d3d1_vtbl
	.comm	_d3d2_vtbl,4,2                  ## @d3d2_vtbl
	.comm	_d3d3_vtbl,4,2                  ## @d3d3_vtbl
	.comm	_d3d7_vtbl,4,2                  ## @d3d7_vtbl
	.comm	_ddraw_wined3d_device_parent_ops,4,2 ## @ddraw_wined3d_device_parent_ops
	.comm	_DDRAW_WINED3D_FLAGS,4,2        ## @DDRAW_WINED3D_FLAGS
	.comm	_WINED3D_NO3D,4,2               ## @WINED3D_NO3D
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to create a wined3d object.\n"

	.comm	_E_FAIL,4,2                     ## @E_FAIL
	.comm	_WINED3DADAPTER_DEFAULT,4,2     ## @WINED3DADAPTER_DEFAULT
L_.str.1:                               ## @.str.1
	.asciz	"Failed to get device caps, hr %#x.\n"

	.comm	_WINEDDCAPS_3D,4,2              ## @WINEDDCAPS_3D
L_.str.2:                               ## @.str.2
	.asciz	"Created a wined3d object without 3D support.\n"

	.comm	_DDRAW_NO3D,4,2                 ## @DDRAW_NO3D
	.comm	_DDRAW_STRIDE_ALIGNMENT,4,2     ## @DDRAW_STRIDE_ALIGNMENT
L_.str.3:                               ## @.str.3
	.asciz	"Failed to create a wined3d device, hr %#x.\n"

	.comm	_DD_OK,4,2                      ## @DD_OK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ddraw_init                     ; -- Begin function ddraw_init
	.p2align	2
_ddraw_init:                            ; @ddraw_init
	.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	x20, x2
	mov	x19, x0
Lloh0:
	adrp	x8, _ddraw7_vtbl@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ddraw7_vtbl@GOTPAGEOFF]
Lloh2:
	adrp	x9, _ddraw1_vtbl@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ddraw1_vtbl@GOTPAGEOFF]
	stp	x9, x8, [x0, #96]
Lloh4:
	adrp	x8, _ddraw2_vtbl@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ddraw2_vtbl@GOTPAGEOFF]
Lloh6:
	adrp	x9, _ddraw4_vtbl@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ddraw4_vtbl@GOTPAGEOFF]
	stp	x9, x8, [x0, #80]
Lloh8:
	adrp	x8, _d3d1_vtbl@GOTPAGE
Lloh9:
	ldr	x8, [x8, _d3d1_vtbl@GOTPAGEOFF]
Lloh10:
	adrp	x9, _d3d2_vtbl@GOTPAGE
Lloh11:
	ldr	x9, [x9, _d3d2_vtbl@GOTPAGEOFF]
	stp	x9, x8, [x0, #64]
Lloh12:
	adrp	x8, _d3d3_vtbl@GOTPAGE
Lloh13:
	ldr	x8, [x8, _d3d3_vtbl@GOTPAGEOFF]
Lloh14:
	adrp	x9, _d3d7_vtbl@GOTPAGE
Lloh15:
	ldr	x9, [x9, _d3d7_vtbl@GOTPAGEOFF]
	stp	x9, x8, [x0, #48]
Lloh16:
	adrp	x8, _ddraw_wined3d_device_parent_ops@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ddraw_wined3d_device_parent_ops@GOTPAGEOFF]
	movi.2s	v0, #1
Lloh18:
	adrp	x9, _DDRAW_WINED3D_FLAGS@GOTPAGE
Lloh19:
	ldr	x9, [x9, _DDRAW_WINED3D_FLAGS@GOTPAGEOFF]
	str	d0, [x0]
Lloh20:
	ldr	w9, [x9]
	orr	w22, w9, w1
	mov	x21, x0
	str	x8, [x21, #32]!
	mov	x0, x22
	bl	_wined3d_create
	str	x0, [x19, #16]
	cbnz	x0, LBB0_2
; %bb.1:
Lloh21:
	adrp	x8, _WINED3D_NO3D@GOTPAGE
Lloh22:
	ldr	x8, [x8, _WINED3D_NO3D@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	orr	w0, w8, w22
	bl	_wined3d_create
	str	x0, [x19, #16]
	cbz	x0, LBB0_8
LBB0_2:
Lloh24:
	adrp	x23, _WINED3DADAPTER_DEFAULT@GOTPAGE
Lloh25:
	ldr	x23, [x23, _WINED3DADAPTER_DEFAULT@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x3, sp, #8
	mov	x2, x20
	bl	_wined3d_get_device_caps
	mov	x22, x0
	bl	_FAILED
	cbz	x0, LBB0_4
; %bb.3:
Lloh26:
	adrp	x0, l_.str.1@PAGE
Lloh27:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_ERR
	ldr	x0, [x19, #16]
	bl	_wined3d_decref
	b	LBB0_9
LBB0_4:
	ldr	w8, [sp, #8]
Lloh28:
	adrp	x9, _WINEDDCAPS_3D@GOTPAGE
Lloh29:
	ldr	x9, [x9, _WINEDDCAPS_3D@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.5:
Lloh31:
	adrp	x0, l_.str.2@PAGE
Lloh32:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_WARN
Lloh33:
	adrp	x8, _DDRAW_NO3D@GOTPAGE
Lloh34:
	ldr	x8, [x8, _DDRAW_NO3D@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	ldr	w9, [x19, #40]
	orr	w8, w9, w8
	str	w8, [x19, #40]
LBB0_6:
	ldr	x0, [x19, #16]
	ldr	w1, [x23]
Lloh36:
	adrp	x8, _DDRAW_STRIDE_ALIGNMENT@GOTPAGE
Lloh37:
	ldr	x8, [x8, _DDRAW_STRIDE_ALIGNMENT@GOTPAGEOFF]
Lloh38:
	ldr	w5, [x8]
	add	x7, x19, #24
	mov	x2, x20
	mov	x3, #0
	mov	w4, #0
	mov	x6, x21
	bl	_wined3d_device_create
	mov	x20, x0
	bl	_FAILED
	cbz	x0, LBB0_12
; %bb.7:
	str	x20, [sp]
Lloh39:
	adrp	x0, l_.str.3@PAGE
Lloh40:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_WARN
	ldr	x0, [x19, #16]
	bl	_wined3d_decref
	b	LBB0_11
LBB0_8:
Lloh41:
	adrp	x0, l_.str@PAGE
Lloh42:
	add	x0, x0, l_.str@PAGEOFF
	bl	_WARN
LBB0_9:
Lloh43:
	adrp	x8, _E_FAIL@GOTPAGE
Lloh44:
	ldr	x8, [x8, _E_FAIL@GOTPAGEOFF]
LBB0_10:
	ldr	w20, [x8]
LBB0_11:
	mov	x0, x20
	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
LBB0_12:
	add	x0, x19, #8
	bl	_list_init
Lloh45:
	adrp	x8, _DD_OK@GOTPAGE
Lloh46:
	ldr	x8, [x8, _DD_OK@GOTPAGEOFF]
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_ddraw7_vtbl,4,2                ; @ddraw7_vtbl
	.comm	_ddraw1_vtbl,4,2                ; @ddraw1_vtbl
	.comm	_ddraw2_vtbl,4,2                ; @ddraw2_vtbl
	.comm	_ddraw4_vtbl,4,2                ; @ddraw4_vtbl
	.comm	_d3d1_vtbl,4,2                  ; @d3d1_vtbl
	.comm	_d3d2_vtbl,4,2                  ; @d3d2_vtbl
	.comm	_d3d3_vtbl,4,2                  ; @d3d3_vtbl
	.comm	_d3d7_vtbl,4,2                  ; @d3d7_vtbl
	.comm	_ddraw_wined3d_device_parent_ops,4,2 ; @ddraw_wined3d_device_parent_ops
	.comm	_DDRAW_WINED3D_FLAGS,4,2        ; @DDRAW_WINED3D_FLAGS
	.comm	_WINED3D_NO3D,4,2               ; @WINED3D_NO3D
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to create a wined3d object.\n"

	.comm	_E_FAIL,4,2                     ; @E_FAIL
	.comm	_WINED3DADAPTER_DEFAULT,4,2     ; @WINED3DADAPTER_DEFAULT
l_.str.1:                               ; @.str.1
	.asciz	"Failed to get device caps, hr %#x.\n"

	.comm	_WINEDDCAPS_3D,4,2              ; @WINEDDCAPS_3D
l_.str.2:                               ; @.str.2
	.asciz	"Created a wined3d object without 3D support.\n"

	.comm	_DDRAW_NO3D,4,2                 ; @DDRAW_NO3D
	.comm	_DDRAW_STRIDE_ALIGNMENT,4,2     ; @DDRAW_STRIDE_ALIGNMENT
l_.str.3:                               ; @.str.3
	.asciz	"Failed to create a wined3d device, hr %#x.\n"

	.comm	_DD_OK,4,2                      ; @DD_OK
.subsections_via_symbols
