	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_driver_load_kms         ## -- Begin function radeon_driver_load_kms
	.p2align	4, 0x90
_radeon_driver_load_kms:                ## @radeon_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, %rbx
	movq	%rdi, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%rax, 16(%r14)
	movq	8(%r14), %rdi
	movq	_PCI_CAP_ID_AGP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pci_find_capability
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_RADEON_IS_AGP@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_4:
	movq	8(%r14), %rdi
	callq	_pci_is_pcie
	testq	%rax, %rax
	jne	LBB0_5
## %bb.6:
	movq	_RADEON_IS_PCI@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_RADEON_IS_PCIE@GOTPCREL(%rip), %rax
LBB0_7:
	orq	(%rax), %rbx
	movq	_radeon_runtime_pm@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.8:
	xorl	%eax, %eax
	callq	_radeon_has_atpx
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	_RADEON_IS_IGP@GOTPCREL(%rip), %rax
	testq	%rbx, (%rax)
	jne	LBB0_12
## %bb.10:
	movq	8(%r14), %rdi
	callq	_pci_is_thunderbolt_attached
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	movq	_RADEON_IS_PX@GOTPCREL(%rip), %rax
	orq	(%rax), %rbx
LBB0_12:
	movq	8(%r14), %rdx
	movq	%r15, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rcx
	callq	_radeon_device_init
	testl	%eax, %eax
	je	LBB0_15
## %bb.13:
	movl	%eax, %ebx
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_14
LBB0_15:
	movq	%r15, %rdi
	callq	_radeon_modeset_init
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_19
LBB0_17:
	movq	%r15, %rdi
	callq	_radeon_acpi_init
	testl	%eax, %eax
	je	LBB0_19
## %bb.18:
	movq	8(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
LBB0_19:
	movq	%r14, %rdi
	callq	_radeon_is_px
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	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_21:
	testl	%ebx, %ebx
	je	LBB0_22
LBB0_14:
	movq	%r14, %rdi
	callq	_radeon_driver_unload_kms
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	xorl	%ebx, %ebx
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PCI_CAP_ID_AGP,4,2             ## @PCI_CAP_ID_AGP
	.comm	_RADEON_IS_AGP,8,3              ## @RADEON_IS_AGP
	.comm	_RADEON_IS_PCIE,8,3             ## @RADEON_IS_PCIE
	.comm	_RADEON_IS_PCI,8,3              ## @RADEON_IS_PCI
	.comm	_radeon_runtime_pm,8,3          ## @radeon_runtime_pm
	.comm	_RADEON_IS_IGP,8,3              ## @RADEON_IS_IGP
	.comm	_RADEON_IS_PX,8,3               ## @RADEON_IS_PX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Fatal error during GPU init\n"

L_.str.1:                               ## @.str.1
	.asciz	"Fatal error during modeset init\n"

L_.str.2:                               ## @.str.2
	.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	_radeon_driver_load_kms         ; -- Begin function radeon_driver_load_kms
	.p2align	2
_radeon_driver_load_kms:                ; @radeon_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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
	str	x0, [x19, #16]
	ldr	x0, [x19, #8]
Lloh3:
	adrp	x8, _PCI_CAP_ID_AGP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PCI_CAP_ID_AGP@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_pci_find_capability
	cbz	x0, LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _RADEON_IS_AGP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RADEON_IS_AGP@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_20
LBB0_4:
	ldr	x0, [x19, #8]
	bl	_pci_is_pcie
Lloh11:
	adrp	x8, _RADEON_IS_PCIE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RADEON_IS_PCIE@GOTPAGEOFF]
Lloh13:
	adrp	x9, _RADEON_IS_PCI@GOTPAGE
Lloh14:
	ldr	x9, [x9, _RADEON_IS_PCI@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x9, x8, eq
LBB0_5:
	ldr	x8, [x8]
	orr	x20, x8, x20
Lloh15:
	adrp	x8, _radeon_runtime_pm@GOTPAGE
Lloh16:
	ldr	x8, [x8, _radeon_runtime_pm@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.6:
	bl	_radeon_has_atpx
	cbz	x0, LBB0_10
; %bb.7:
Lloh18:
	adrp	x8, _RADEON_IS_IGP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _RADEON_IS_IGP@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	tst	x8, x20
	b.ne	LBB0_10
; %bb.8:
	ldr	x0, [x19, #8]
	bl	_pci_is_thunderbolt_attached
	cbnz	w0, LBB0_10
; %bb.9:
Lloh21:
	adrp	x8, _RADEON_IS_PX@GOTPAGE
Lloh22:
	ldr	x8, [x8, _RADEON_IS_PX@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
	orr	x20, x8, x20
LBB0_10:
	ldr	x2, [x19, #8]
	mov	x0, x21
	mov	x1, x19
	mov	x3, x20
	bl	_radeon_device_init
	cbz	w0, LBB0_12
; %bb.11:
	mov	x20, x0
	ldr	x0, [x19, #8]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_19
LBB0_12:
	mov	x0, x21
	bl	_radeon_modeset_init
	mov	x20, x0
	cbz	w0, LBB0_14
; %bb.13:
	ldr	x0, [x19, #8]
Lloh26:
	adrp	x1, l_.str.1@PAGE
Lloh27:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_16
LBB0_14:
	mov	x0, x21
	bl	_radeon_acpi_init
	cbz	w0, LBB0_16
; %bb.15:
	ldr	x0, [x19, #8]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
LBB0_16:
	mov	x0, x19
	bl	_radeon_is_px
	cbz	x0, LBB0_18
; %bb.17:
	ldr	w0, [x19]
Lloh30:
	adrp	x8, _DPM_FLAG_NEVER_SKIP@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DPM_FLAG_NEVER_SKIP@GOTPAGEOFF]
Lloh32:
	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:
	cbz	w20, LBB0_20
LBB0_19:
	mov	x0, x19
	bl	_radeon_driver_unload_kms
LBB0_20:
	mov	x0, x20
	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 AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PCI_CAP_ID_AGP,4,2             ; @PCI_CAP_ID_AGP
	.comm	_RADEON_IS_AGP,8,3              ; @RADEON_IS_AGP
	.comm	_RADEON_IS_PCIE,8,3             ; @RADEON_IS_PCIE
	.comm	_RADEON_IS_PCI,8,3              ; @RADEON_IS_PCI
	.comm	_radeon_runtime_pm,8,3          ; @radeon_runtime_pm
	.comm	_RADEON_IS_IGP,8,3              ; @RADEON_IS_IGP
	.comm	_RADEON_IS_PX,8,3               ; @RADEON_IS_PX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Fatal error during GPU init\n"

l_.str.1:                               ; @.str.1
	.asciz	"Fatal error during modeset init\n"

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

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