	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function load_graphics_driver
_load_graphics_driver:                  ## @load_graphics_driver
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsp, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAX_PATH@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	%r12, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	leaq	_load_graphics_driver.key_pathW(%rip), %rdi
	callq	_ARRAY_SIZE
	movq	%rax, %rbx
	leaq	_load_graphics_driver.displayW(%rip), %rdi
	callq	_ARRAY_SIZE
	addq	%rbx, %rax
	addq	$40, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_GetDesktopWindow
	leaq	_load_graphics_driver.display_device_guid_propW(%rip), %rsi
	movl	%eax, %edi
	callq	_GetPropW
	movl	%eax, %edi
	callq	_HandleToULong
	testl	%eax, %eax
	je	LBB0_6
## %bb.1:
	movl	%eax, %ebx
	leaq	_load_graphics_driver.key_pathW(%rip), %rsi
	movq	%r13, %rdi
	movl	$41, %edx
	callq	_memcpy
	movq	%r13, %rdi
	callq	_lstrlenW
	movslq	%eax, %rsi
	addq	%r13, %rsi
	movl	%ebx, %edi
	movl	$40, %edx
	callq	_GlobalGetAtomNameW
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	leaq	_load_graphics_driver.displayW(%rip), %rsi
	movq	%r13, %rdi
	callq	_lstrcatW
	movq	_HKEY_LOCAL_MACHINE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-52(%rbp), %rdx
	movq	%r13, %rsi
	callq	_RegOpenKeyW
	testq	%rax, %rax
	jne	LBB0_6
## %bb.3:
	movl	%r12d, -56(%rbp)
	movl	-52(%rbp), %edi
	leaq	_load_graphics_driver.driverW(%rip), %rsi
	xorl	%r15d, %r15d
	leaq	-56(%rbp), %r9
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %r8
	callq	_RegQueryValueExW
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	%rbx, %rdi
	callq	_LoadLibraryW
	movl	%eax, %r15d
LBB0_5:
	movl	-52(%rbp), %edi
	callq	_RegCloseKey
	movq	%rbx, %rdi
	callq	_debugstr_w
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	movl	%r15d, %edx
	callq	_TRACE
LBB0_6:
	movq	%r14, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r15d, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @load_graphics_driver.display_device_guid_propW
_load_graphics_driver.display_device_guid_propW:
	.asciz	"__wine_display_device_guid"

	.p2align	4                               ## @load_graphics_driver.key_pathW
_load_graphics_driver.key_pathW:
	.asciz	"System\\CurrentControlSet\\Control\\Video\\{"

_load_graphics_driver.displayW:         ## @load_graphics_driver.displayW
	.asciz	"}\\0000"

_load_graphics_driver.driverW:          ## @load_graphics_driver.driverW
	.asciz	"GraphicsDriver"

	.comm	_MAX_PATH,4,2                   ## @MAX_PATH
	.comm	_HKEY_LOCAL_MACHINE,4,2         ## @HKEY_LOCAL_MACHINE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s %p\n"

	.no_dead_strip	_load_graphics_driver
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function load_graphics_driver
_load_graphics_driver:                  ; @load_graphics_driver
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	sub	sp, sp, #16
	mov	x23, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _MAX_PATH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAX_PATH@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	mov	x9, x20
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x20, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
Lloh8:
	adrp	x0, _load_graphics_driver.key_pathW@PAGE
Lloh9:
	add	x0, x0, _load_graphics_driver.key_pathW@PAGEOFF
	bl	_ARRAY_SIZE
	mov	x21, x0
Lloh10:
	adrp	x0, _load_graphics_driver.displayW@PAGE
Lloh11:
	add	x0, x0, _load_graphics_driver.displayW@PAGEOFF
	bl	_ARRAY_SIZE
	add	x8, x21, x0
	add	x9, x8, #40
	add	x8, x8, #55
	and	x8, x8, #0xfffffffffffffff0
Lloh12:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh13:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	sub	x21, x9, x8
	mov	sp, x21
	bl	_GetDesktopWindow
Lloh14:
	adrp	x1, _load_graphics_driver.display_device_guid_propW@PAGE
Lloh15:
	add	x1, x1, _load_graphics_driver.display_device_guid_propW@PAGEOFF
	bl	_GetPropW
	bl	_HandleToULong
	cbz	w0, LBB0_3
; %bb.1:
	mov	x22, x0
Lloh16:
	adrp	x1, _load_graphics_driver.key_pathW@PAGE
Lloh17:
	add	x1, x1, _load_graphics_driver.key_pathW@PAGEOFF
	mov	x0, x21
	mov	w2, #41
	bl	_memcpy
	mov	x0, x21
	bl	_lstrlenW
	add	x1, x21, w0, sxtw
	mov	x0, x22
	mov	w2, #40
	bl	_GlobalGetAtomNameW
	cbz	w0, LBB0_3
; %bb.2:
Lloh18:
	adrp	x1, _load_graphics_driver.displayW@PAGE
Lloh19:
	add	x1, x1, _load_graphics_driver.displayW@PAGEOFF
	mov	x0, x21
	bl	_lstrcatW
Lloh20:
	adrp	x8, _HKEY_LOCAL_MACHINE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _HKEY_LOCAL_MACHINE@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	sub	x2, x29, #60
	mov	x1, x21
	bl	_RegOpenKeyW
	cbz	x0, LBB0_6
LBB0_3:
	mov	w20, #0
LBB0_4:
	mov	sp, x23
	ldur	x8, [x29, #-56]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.5:
	mov	x0, x20
	sub	sp, x29, #48
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	stur	w20, [x29, #-64]
	ldur	w0, [x29, #-60]
Lloh26:
	adrp	x1, _load_graphics_driver.driverW@PAGE
Lloh27:
	add	x1, x1, _load_graphics_driver.driverW@PAGEOFF
	sub	x5, x29, #64
	mov	x2, #0
	mov	x3, #0
	mov	x4, x19
	bl	_RegQueryValueExW
	cbz	w0, LBB0_8
; %bb.7:
	mov	w20, #0
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_LoadLibraryW
	mov	x20, x0
LBB0_9:
	ldur	w0, [x29, #-60]
	bl	_RegCloseKey
	mov	x0, x19
	bl	_debugstr_w
	mov	x1, x0
Lloh28:
	adrp	x0, l_.str@PAGE
Lloh29:
	add	x0, x0, l_.str@PAGEOFF
	mov	x2, x20
	bl	_TRACE
	b	LBB0_4
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
_load_graphics_driver.display_device_guid_propW: ; @load_graphics_driver.display_device_guid_propW
	.asciz	"__wine_display_device_guid"

_load_graphics_driver.key_pathW:        ; @load_graphics_driver.key_pathW
	.asciz	"System\\CurrentControlSet\\Control\\Video\\{"

_load_graphics_driver.displayW:         ; @load_graphics_driver.displayW
	.asciz	"}\\0000"

_load_graphics_driver.driverW:          ; @load_graphics_driver.driverW
	.asciz	"GraphicsDriver"

	.comm	_MAX_PATH,4,2                   ; @MAX_PATH
	.comm	_HKEY_LOCAL_MACHINE,4,2         ; @HKEY_LOCAL_MACHINE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s %p\n"

	.no_dead_strip	_load_graphics_driver
.subsections_via_symbols
