	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_gem_create_with_handle ## -- Begin function panfrost_gem_create_with_handle
	.p2align	4, 0x90
_panfrost_gem_create_with_handle:       ## @panfrost_gem_create_with_handle
	.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	%r8, %r13
	movl	%ecx, %r12d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_PANFROST_BO_HEAP@GOTPCREL(%rip), %r14
	testl	%ecx, (%r14)
	je	LBB0_2
## %bb.1:
	movq	_SZ_2M@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdx, %rdi
	callq	_roundup
	movq	%rax, %rdx
LBB0_2:
	movq	%rbx, %rdi
	movq	%rdx, %rsi
	callq	_drm_gem_shmem_create
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_CAST                       ## TAILCALL
LBB0_3:
	movq	%rbx, %rdi
	callq	_to_panfrost_bo
	movq	%r13, %rdx
	movq	%rax, %r13
	movq	_PANFROST_BO_NOEXEC@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	movl	(%rax), %eax
	andl	%r12d, %eax
	setne	%cl
	movl	%ecx, (%r13)
	xorl	%eax, %eax
	andl	(%r14), %r12d
	setne	%al
	movl	%eax, 4(%r13)
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_drm_gem_handle_create
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_drm_gem_object_put_unlocked
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.6:
	movl	%r14d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PANFROST_BO_HEAP,4,2           ## @PANFROST_BO_HEAP
	.comm	_SZ_2M,4,2                      ## @SZ_2M
	.comm	_PANFROST_BO_NOEXEC,4,2         ## @PANFROST_BO_NOEXEC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_panfrost_gem_create_with_handle ; -- Begin function panfrost_gem_create_with_handle
	.p2align	2
_panfrost_gem_create_with_handle:       ; @panfrost_gem_create_with_handle
	.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	x19, x4
	mov	x21, x3
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x24, _PANFROST_BO_HEAP@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PANFROST_BO_HEAP@GOTPAGEOFF]
	ldr	w8, [x24]
	tst	w8, w3
	b.eq	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _SZ_2M@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SZ_2M@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x2
	bl	_roundup
	mov	x2, x0
LBB0_2:
	mov	x0, x22
	mov	x1, x2
	bl	_drm_gem_shmem_create
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x22
	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
	b	_ERR_CAST
LBB0_4:
	mov	x0, x22
	bl	_to_panfrost_bo
	mov	x23, x0
Lloh5:
	adrp	x8, _PANFROST_BO_NOEXEC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PANFROST_BO_NOEXEC@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w21
	cset	w8, ne
	str	w8, [x0]
	ldr	w8, [x24]
	tst	w8, w21
	cset	w8, ne
	str	w8, [x0, #4]
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	bl	_drm_gem_handle_create
	mov	x19, x0
	mov	x0, x22
	bl	_drm_gem_object_put_unlocked
	cbz	w19, LBB0_6
; %bb.5:
	mov	x0, x19
	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
	b	_ERR_PTR
LBB0_6:
	mov	x0, x23
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PANFROST_BO_HEAP,4,2           ; @PANFROST_BO_HEAP
	.comm	_SZ_2M,4,2                      ; @SZ_2M
	.comm	_PANFROST_BO_NOEXEC,4,2         ; @PANFROST_BO_NOEXEC
.subsections_via_symbols
