	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_driver_open_kms         ## -- Begin function radeon_driver_open_kms
	.p2align	4, 0x90
_radeon_driver_open_kms:                ## @radeon_driver_open_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	%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, %r12
	movq	%rdi, %r14
	movq	8(%rdi), %r15
	movq	$0, (%rsi)
	movl	(%rdi), %edi
	callq	_pm_runtime_get_sync
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_13
## %bb.1:
	movq	(%r15), %rax
	movq	_CHIP_CAYMAN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_12
## %bb.2:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	movq	%rax, %r13
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_4:
	cmpq	$0, 16(%r15)
	je	LBB0_11
## %bb.5:
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_radeon_vm_init
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %ebx
	jmp	LBB0_7
LBB0_8:
	movl	8(%r15), %edi
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_radeon_bo_reserve
	testl	%eax, %eax
	jne	LBB0_9
## %bb.10:
	movl	8(%r15), %edx
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_radeon_vm_bo_add
	movl	%eax, (%r13)
	movq	_RADEON_VA_IB_OFFSET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_RADEON_VM_PAGE_READABLE@GOTPCREL(%rip), %rsi
	movq	_RADEON_VM_PAGE_SNOOPED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rsi), %ecx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_radeon_vm_bo_set_addr
	testl	%eax, %eax
	je	LBB0_11
LBB0_9:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movl	%eax, %ebx
	callq	_radeon_vm_fini
LBB0_7:
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_12
LBB0_11:
	movq	%r13, (%r12)
LBB0_12:
	movl	(%r14), %edi
	callq	_pm_runtime_mark_last_busy
	movl	(%r14), %edi
	callq	_pm_runtime_put_autosuspend
LBB0_13:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_CAYMAN,8,3                ## @CHIP_CAYMAN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_RADEON_VA_IB_OFFSET,4,2        ## @RADEON_VA_IB_OFFSET
	.comm	_RADEON_VM_PAGE_READABLE,4,2    ## @RADEON_VM_PAGE_READABLE
	.comm	_RADEON_VM_PAGE_SNOOPED,4,2     ## @RADEON_VM_PAGE_SNOOPED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_driver_open_kms         ; -- Begin function radeon_driver_open_kms
	.p2align	2
_radeon_driver_open_kms:                ; @radeon_driver_open_kms
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
	str	xzr, [x1]
	ldr	w0, [x0]
	bl	_pm_runtime_get_sync
	mov	x20, x0
	tbnz	w0, #31, LBB0_14
; %bb.1:
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _CHIP_CAYMAN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_CAYMAN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.lt	LBB0_13
; %bb.2:
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	mov	x23, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_13
LBB0_4:
	ldr	x8, [x22, #16]
	cbz	x8, LBB0_12
; %bb.5:
	mov	x0, x22
	mov	x1, x23
	bl	_radeon_vm_init
	cbz	w0, LBB0_7
; %bb.6:
	mov	x20, x0
	b	LBB0_11
LBB0_7:
	ldr	w0, [x22, #8]
	mov	w1, #0
	bl	_radeon_bo_reserve
	cbz	w0, LBB0_9
; %bb.8:
	mov	x20, x0
	b	LBB0_10
LBB0_9:
	ldr	w2, [x22, #8]
	mov	x0, x22
	mov	x1, x23
	bl	_radeon_vm_bo_add
	mov	x1, x0
	str	w0, [x23]
Lloh9:
	adrp	x8, _RADEON_VA_IB_OFFSET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _RADEON_VA_IB_OFFSET@GOTPAGEOFF]
Lloh11:
	adrp	x9, _RADEON_VM_PAGE_READABLE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _RADEON_VM_PAGE_READABLE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	ldr	w8, [x9]
Lloh15:
	adrp	x9, _RADEON_VM_PAGE_SNOOPED@GOTPAGE
Lloh16:
	ldr	x9, [x9, _RADEON_VM_PAGE_SNOOPED@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x22
	bl	_radeon_vm_bo_set_addr
	mov	x20, x0
	cbz	w0, LBB0_12
LBB0_10:
	mov	x0, x22
	mov	x1, x23
	bl	_radeon_vm_fini
LBB0_11:
	mov	x0, x23
	bl	_kfree
	b	LBB0_13
LBB0_12:
	str	x23, [x21]
LBB0_13:
	ldr	w0, [x19]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x19]
	bl	_pm_runtime_put_autosuspend
LBB0_14:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_CAYMAN,8,3                ; @CHIP_CAYMAN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_RADEON_VA_IB_OFFSET,4,2        ; @RADEON_VA_IB_OFFSET
	.comm	_RADEON_VM_PAGE_READABLE,4,2    ; @RADEON_VM_PAGE_READABLE
	.comm	_RADEON_VM_PAGE_SNOOPED,4,2     ; @RADEON_VM_PAGE_SNOOPED
.subsections_via_symbols
