	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function radeon_gem_object_create
LCPI0_0:
	.space	16
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_radeon_gem_object_create
	.p2align	4, 0x90
_radeon_gem_object_create:              ## @radeon_gem_object_create
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r12d
	movq	%rsi, %r15
	movq	16(%rbp), %rax
	movq	$0, (%rax)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%edx, %eax
	cmovgl	%eax, %r12d
	movq	16(%rdi), %rdx
	subq	(%rdi), %rdx
	cmpq	%rsi, %rdx
	jae	LBB0_1
## %bb.8:
	shrq	$20, %r15
	shrq	$20, %rdx
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	callq	_DRM_DEBUG
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_7
LBB0_1:
	movl	%r8d, %r10d
	movl	%ecx, %ebx
	movq	%rdi, %r14
	leaq	-48(%rbp), %rax
	movq	%rax, 16(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	%r9d, -56(%rbp)                 ## 4-byte Spill
	movl	%r9d, %ecx
	movl	%ebx, %r8d
	movl	%r10d, -52(%rbp)                ## 4-byte Spill
	movl	%r10d, %r9d
	callq	_radeon_bo_create
	testl	%eax, %eax
	je	LBB0_6
## %bb.2:
	movl	%eax, %r13d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_RADEON_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	_RADEON_GEM_DOMAIN_GTT@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	leaq	-48(%rbp), %rax
	movq	%rax, 16(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rsp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movl	%r12d, %edx
	movl	-56(%rbp), %ecx                 ## 4-byte Reload
	movl	%ebx, %r8d
	movl	-52(%rbp), %r9d                 ## 4-byte Reload
	callq	_radeon_bo_create
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_3
LBB0_6:
	movq	-48(%rbp), %rax
	addq	$8, %rax
	movq	16(%rbp), %rcx
	movq	%rax, (%rcx)
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_task_pid_nr
	movq	-48(%rbp), %rcx
	movl	%eax, 4(%rcx)
	leaq	8(%r14), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	-48(%rbp), %rdi
	addq	$12, %r14
	movq	%r14, %rsi
	callq	_list_add_tail
	movq	%rbx, %rdi
	callq	_mutex_unlock
	xorl	%r13d, %r13d
	jmp	LBB0_7
LBB0_9:
	leaq	L_.str.1(%rip), %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	movl	%r12d, %ecx
	movl	%r13d, %r8d
	callq	_DRM_ERROR
LBB0_7:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Allocation size %ldMb bigger than %ldMb limit\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_RADEON_GEM_DOMAIN_VRAM,4,2     ## @RADEON_GEM_DOMAIN_VRAM
	.comm	_RADEON_GEM_DOMAIN_GTT,4,2      ## @RADEON_GEM_DOMAIN_GTT
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate GEM object (%ld, %d, %u, %d)\n"

	.comm	_current,4,2                    ## @current
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_gem_object_create       ; -- Begin function radeon_gem_object_create
	.p2align	2
_radeon_gem_object_create:              ; @radeon_gem_object_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x1
	str	xzr, [x6]
Lloh0:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w2
	csel	w25, w8, w2, gt
	ldr	x8, [x0, #16]
	ldr	x9, [x0]
	sub	x8, x8, x9
	cmp	x8, x1
	b.hs	LBB0_2
; %bb.1:
	lsr	x1, x22, #20
	lsr	x2, x8, #20
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w26, w8
	b	LBB0_9
LBB0_2:
	mov	x23, x5
	mov	x24, x4
	mov	x21, x3
	mov	x19, x0
	str	x6, [sp, #16]                   ; 8-byte Folded Spill
	add	x8, sp, #24
	str	x8, [sp]
	mov	x1, x22
	mov	x2, x25
	mov	x3, x5
	mov	x4, x21
	mov	x5, x24
	mov	x6, #0
	mov	x7, #0
	bl	_radeon_bo_create
	cbz	w0, LBB0_7
; %bb.3:
	mov	x26, x0
Lloh8:
	adrp	x28, _ERESTARTSYS@GOTPAGE
Lloh9:
	ldr	x28, [x28, _ERESTARTSYS@GOTPAGEOFF]
Lloh10:
	adrp	x20, _RADEON_GEM_DOMAIN_VRAM@GOTPAGE
Lloh11:
	ldr	x20, [x20, _RADEON_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh12:
	adrp	x27, _RADEON_GEM_DOMAIN_GTT@GOTPAGE
Lloh13:
	ldr	x27, [x27, _RADEON_GEM_DOMAIN_GTT@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x28]
	cmn	w26, w8
	b.eq	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20]
	cmp	w21, w8
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x27]
	orr	w21, w8, w21
	add	x8, sp, #24
	str	x8, [sp]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x25
	mov	x3, x23
	mov	x4, x21
	mov	x5, x24
	mov	x6, #0
	mov	x7, #0
	bl	_radeon_bo_create
	mov	x26, x0
	cbnz	w0, LBB0_4
LBB0_7:
	ldp	x9, x8, [sp, #16]               ; 8-byte Folded Reload
	add	x8, x8, #8
	str	x8, [x9]
Lloh14:
	adrp	x8, _current@GOTPAGE
Lloh15:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_task_pid_nr
	ldr	x8, [sp, #24]
	str	w0, [x8, #4]
	add	x20, x19, #8
	mov	x0, x20
	bl	_mutex_lock
	ldr	x0, [sp, #24]
	add	x1, x19, #12
	bl	_list_add_tail
	mov	x0, x20
	bl	_mutex_unlock
	mov	w26, #0
	b	LBB0_9
LBB0_8:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	mov	x2, x21
	mov	x3, x25
	mov	x4, x26
	bl	_DRM_ERROR
LBB0_9:
	mov	x0, x26
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Allocation size %ldMb bigger than %ldMb limit\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_RADEON_GEM_DOMAIN_VRAM,4,2     ; @RADEON_GEM_DOMAIN_VRAM
	.comm	_RADEON_GEM_DOMAIN_GTT,4,2      ; @RADEON_GEM_DOMAIN_GTT
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate GEM object (%ld, %d, %u, %d)\n"

	.comm	_current,4,2                    ; @current
.subsections_via_symbols
