	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_gem_create                 ## -- Begin function psb_gem_create
	.p2align	4, 0x90
_psb_gem_create:                        ## @psb_gem_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	%edx, %edi
	callq	_roundup
	movl	%eax, %r15d
	movl	(%rbx), %r8d
	leaq	L_.str(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movl	%eax, %esi
	xorl	%ecx, %ecx
	callq	_psb_gtt_alloc_range
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	movq	%r14, %rdi
	movq	%rax, %rsi
	movl	%r15d, %edx
	callq	_drm_gem_object_init
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_psb_gtt_free_range
	movl	(%r14), %edi
	movslq	%r15d, %rdx
	leaq	L_.str.2(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_1:
	movl	(%r14), %edi
	movslq	%r15d, %rdx
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_4:
	movq	(%r13), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movq	___GFP_DMA32@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_mapping_set_gfp_mask
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_drm_gem_handle_create
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_dev_err
	movq	%r13, %rdi
	callq	_drm_gem_object_release
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_psb_gtt_free_range
	jmp	LBB0_7
LBB0_6:
	movq	%r13, %rdi
	callq	_drm_gem_object_put_unlocked
	movl	-44(%rbp), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, (%rcx)
	xorl	%ebx, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %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	"gem"

L_.str.1:                               ## @.str.1
	.asciz	"no memory for %lld byte GEM object\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.2:                               ## @.str.2
	.asciz	"GEM init failed for %lld\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_DMA32,4,2                ## @__GFP_DMA32
L_.str.3:                               ## @.str.3
	.asciz	"GEM handle failed for %p, %lld\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_psb_gem_create                 ; -- Begin function psb_gem_create
	.p2align	2
_psb_gem_create:                        ; @psb_gem_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x3
	mov	x19, x1
	mov	x23, x0
Lloh0:
	adrp	x22, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x2
	bl	_roundup
	mov	x21, x0
	ldr	w4, [x22]
Lloh2:
	adrp	x2, l_.str@PAGE
Lloh3:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x1, x21
	mov	w3, #0
	bl	_psb_gtt_alloc_range
	cbz	x0, LBB0_3
; %bb.1:
	mov	x22, x0
	mov	x0, x19
	mov	x1, x22
	mov	x2, x21
	bl	_drm_gem_object_init
	cbz	x0, LBB0_6
; %bb.2:
	mov	x0, x19
	mov	x1, x22
	bl	_psb_gtt_free_range
	ldr	w0, [x19]
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	sxtw	x2, w21
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
	ldr	w0, [x19]
	sxtw	x2, w21
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
Lloh10:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
	ldr	x8, [x22]
Lloh12:
	adrp	x9, _GFP_KERNEL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w0, [x8]
Lloh14:
	ldr	w8, [x9]
Lloh15:
	adrp	x9, ___GFP_DMA32@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___GFP_DMA32@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_mapping_set_gfp_mask
	add	x2, sp, #12
	mov	x0, x23
	mov	x1, x22
	bl	_drm_gem_handle_create
	mov	x23, x0
	cbz	w0, LBB0_8
; %bb.7:
	ldr	w0, [x19]
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	str	x21, [sp]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	mov	x0, x22
	bl	_drm_gem_object_release
	mov	x0, x19
	mov	x1, x22
	bl	_psb_gtt_free_range
	b	LBB0_5
LBB0_8:
	mov	x0, x22
	bl	_drm_gem_object_put_unlocked
	ldr	w8, [sp, #12]
	str	w8, [x20]
	b	LBB0_5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"gem"

l_.str.1:                               ; @.str.1
	.asciz	"no memory for %lld byte GEM object\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.2:                               ; @.str.2
	.asciz	"GEM init failed for %lld\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_DMA32,4,2                ; @__GFP_DMA32
l_.str.3:                               ; @.str.3
	.asciz	"GEM handle failed for %p, %lld\n"

.subsections_via_symbols
