	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_mem_alloc               ## -- Begin function radeon_mem_alloc
	.p2align	4, 0x90
_radeon_mem_alloc:                      ## @radeon_mem_alloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movl	12(%rsi), %esi
	callq	_get_heap
	testq	%rax, %rax
	je	LBB0_11
## %bb.3:
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.4:
	movl	(%rbx), %edx
	cmpl	$11, %edx
	jg	LBB0_6
## %bb.5:
	movl	$12, (%rbx)
	movl	$12, %edx
LBB0_6:
	movl	8(%rbx), %esi
	movq	%r14, %rcx
	callq	_alloc_block
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movl	4(%rbx), %edi
	movq	%rax, %rsi
	movl	$4, %edx
	callq	_DRM_COPY_TO_USER
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_ERROR
LBB0_11:
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_12:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_9:
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"called with no initialization\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"copy_to_user\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_mem_alloc               ; -- Begin function radeon_mem_alloc
	.p2align	2
_radeon_mem_alloc:                      ; @radeon_mem_alloc
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x0, [x0]
	cbz	x0, LBB0_9
; %bb.1:
	mov	x20, x2
	mov	x19, x1
	ldr	w1, [x1, #12]
	bl	_get_heap
	cbz	x0, LBB0_8
; %bb.2:
	ldr	x0, [x0]
	cbz	x0, LBB0_8
; %bb.3:
	ldr	w2, [x19]
	cmp	w2, #11
	b.gt	LBB0_5
; %bb.4:
	mov	w2, #12
	str	w2, [x19]
LBB0_5:
	ldr	w1, [x19, #8]
	mov	x3, x20
	bl	_alloc_block
	cbz	x0, LBB0_10
; %bb.6:
	mov	x1, x0
	ldr	w0, [x19, #4]
	mov	w2, #4
	bl	_DRM_COPY_TO_USER
	cbz	x0, LBB0_12
; %bb.7:
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
LBB0_8:
Lloh2:
	adrp	x8, _EFAULT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"called with no initialization\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"copy_to_user\n"

.subsections_via_symbols
