	.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	(%rdi), %rbx
	movq	$0, (%rsi)
	movq	(%rbx), %rax
	movq	_CHIP_CAYMAN@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	cmpq	(%rcx), %rax
	jl	LBB0_6
## %bb.1:
	movq	%rsi, %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	movq	%rax, %r12
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_6
LBB0_3:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_radeon_vm_init
	movl	8(%rbx), %edx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_radeon_vm_bo_add
	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	%rbx, %rdi
	movq	%rax, %rsi
	callq	_radeon_vm_bo_set_addr
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r13d
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_radeon_vm_fini
	movq	%r12, %rdi
	callq	_kfree
	movl	%r13d, %r14d
	jmp	LBB0_6
LBB0_5:
	movq	%r12, (%r15)
LBB0_6:
	movl	%r14d, %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	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
	ldr	x20, [x0]
	str	xzr, [x1]
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _CHIP_CAYMAN@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CHIP_CAYMAN@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_7
LBB0_2:
	mov	x19, x1
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	mov	x21, 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	w22, w8
	b	LBB0_7
LBB0_4:
	mov	x0, x20
	mov	x1, x21
	bl	_radeon_vm_init
	ldr	w2, [x20, #8]
	mov	x0, x20
	mov	x1, x21
	bl	_radeon_vm_bo_add
	mov	x1, x0
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, x20
	bl	_radeon_vm_bo_set_addr
	mov	x22, x0
	cbz	w0, LBB0_6
; %bb.5:
	mov	x0, x20
	mov	x1, x21
	bl	_radeon_vm_fini
	mov	x0, x21
	bl	_kfree
	b	LBB0_7
LBB0_6:
	str	x21, [x19]
LBB0_7:
	mov	x0, x22
	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	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
