	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_driver_load_kms         ## -- Begin function amdgpu_driver_load_kms
	.p2align	4, 0x90
_amdgpu_driver_load_kms:                ## @amdgpu_driver_load_kms
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%rax, 16(%r14)
	movq	_amdgpu_runtime_pm@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_9
## %bb.3:
	xorl	%eax, %eax
	callq	_amdgpu_has_atpx
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	xorl	%eax, %eax
	callq	_amdgpu_is_atpx_hybrid
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	callq	_amdgpu_has_atpx_dgpu_power_cntl
	testq	%rax, %rax
	je	LBB0_9
LBB0_6:
	movq	_AMD_IS_APU@GOTPCREL(%rip), %rax
	testq	%r15, (%rax)
	jne	LBB0_9
## %bb.7:
	movq	8(%r14), %rdi
	callq	_pci_is_thunderbolt_attached
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	_AMD_IS_PX@GOTPCREL(%rip), %rax
	orq	(%rax), %r15
LBB0_9:
	movq	8(%r14), %rdx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rcx
	callq	_amdgpu_device_init
	testl	%eax, %eax
	je	LBB0_10
## %bb.14:
	movl	%eax, %r15d
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	cmpq	$0, (%rbx)
	je	LBB0_17
## %bb.15:
	movq	%r14, %rdi
	callq	_amdgpu_device_is_px
	testq	%rax, %rax
	je	LBB0_17
## %bb.16:
	movl	(%r14), %edi
	callq	_pm_runtime_put_noidle
LBB0_17:
	movq	%r14, %rdi
	callq	_amdgpu_driver_unload_kms
	jmp	LBB0_18
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_18
LBB0_10:
	movq	%rbx, %rdi
	callq	_amdgpu_acpi_init
	testl	%eax, %eax
	je	LBB0_12
## %bb.11:
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
LBB0_12:
	movq	%r14, %rdi
	callq	_amdgpu_device_is_px
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_18
## %bb.13:
	movl	(%r14), %edi
	movq	_DPM_FLAG_NEVER_SKIP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_dev_pm_set_driver_flags
	movl	(%r14), %edi
	callq	_pm_runtime_use_autosuspend
	movl	(%r14), %edi
	movl	$5000, %esi                     ## imm = 0x1388
	callq	_pm_runtime_set_autosuspend_delay
	movl	(%r14), %edi
	callq	_pm_runtime_set_active
	movl	(%r14), %edi
	callq	_pm_runtime_allow
	movl	(%r14), %edi
	callq	_pm_runtime_mark_last_busy
	movl	(%r14), %edi
	callq	_pm_runtime_put_autosuspend
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_amdgpu_runtime_pm,8,3          ## @amdgpu_runtime_pm
	.comm	_AMD_IS_APU,8,3                 ## @AMD_IS_APU
	.comm	_AMD_IS_PX,8,3                  ## @AMD_IS_PX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Fatal error during GPU init\n"

L_.str.1:                               ## @.str.1
	.asciz	"Error during ACPI methods call\n"

	.comm	_DPM_FLAG_NEVER_SKIP,4,2        ## @DPM_FLAG_NEVER_SKIP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_driver_load_kms         ; -- Begin function amdgpu_driver_load_kms
	.p2align	2
_amdgpu_driver_load_kms:                ; @amdgpu_driver_load_kms
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_13
; %bb.1:
	mov	x20, x0
	str	x0, [x19, #16]
Lloh3:
	adrp	x8, _amdgpu_runtime_pm@GOTPAGE
Lloh4:
	ldr	x8, [x8, _amdgpu_runtime_pm@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cbz	x8, LBB0_8
; %bb.2:
	bl	_amdgpu_has_atpx
	cbz	x0, LBB0_8
; %bb.3:
	bl	_amdgpu_is_atpx_hybrid
	cbnz	x0, LBB0_5
; %bb.4:
	bl	_amdgpu_has_atpx_dgpu_power_cntl
	cbz	x0, LBB0_8
LBB0_5:
Lloh6:
	adrp	x8, _AMD_IS_APU@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AMD_IS_APU@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	tst	x8, x21
	b.ne	LBB0_8
; %bb.6:
	ldr	x0, [x19, #8]
	bl	_pci_is_thunderbolt_attached
	cbnz	w0, LBB0_8
; %bb.7:
Lloh9:
	adrp	x8, _AMD_IS_PX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AMD_IS_PX@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	orr	x21, x8, x21
LBB0_8:
	ldr	x2, [x19, #8]
	mov	x0, x20
	mov	x1, x19
	mov	x3, x21
	bl	_amdgpu_device_init
	cbz	w0, LBB0_14
; %bb.9:
	mov	x21, x0
	ldr	x0, [x19, #8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x8, [x20]
	cbz	x8, LBB0_12
; %bb.10:
	mov	x0, x19
	bl	_amdgpu_device_is_px
	cbz	x0, LBB0_12
; %bb.11:
	ldr	w0, [x19]
	bl	_pm_runtime_put_noidle
LBB0_12:
	mov	x0, x19
	bl	_amdgpu_driver_unload_kms
	b	LBB0_19
LBB0_13:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_19
LBB0_14:
	mov	x0, x20
	bl	_amdgpu_acpi_init
	cbz	w0, LBB0_16
; %bb.15:
	ldr	x0, [x19, #8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
LBB0_16:
	mov	x0, x19
	bl	_amdgpu_device_is_px
	cbz	x0, LBB0_18
; %bb.17:
	ldr	w0, [x19]
Lloh19:
	adrp	x8, _DPM_FLAG_NEVER_SKIP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _DPM_FLAG_NEVER_SKIP@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	bl	_dev_pm_set_driver_flags
	ldr	w0, [x19]
	bl	_pm_runtime_use_autosuspend
	ldr	w0, [x19]
	mov	w1, #5000
	bl	_pm_runtime_set_autosuspend_delay
	ldr	w0, [x19]
	bl	_pm_runtime_set_active
	ldr	w0, [x19]
	bl	_pm_runtime_allow
	ldr	w0, [x19]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x19]
	bl	_pm_runtime_put_autosuspend
LBB0_18:
	mov	w21, #0
LBB0_19:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_amdgpu_runtime_pm,8,3          ; @amdgpu_runtime_pm
	.comm	_AMD_IS_APU,8,3                 ; @AMD_IS_APU
	.comm	_AMD_IS_PX,8,3                  ; @AMD_IS_PX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Fatal error during GPU init\n"

l_.str.1:                               ; @.str.1
	.asciz	"Error during ACPI methods call\n"

	.comm	_DPM_FLAG_NEVER_SKIP,4,2        ; @DPM_FLAG_NEVER_SKIP
.subsections_via_symbols
