	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_ioctl_create_bo
_panfrost_ioctl_create_bo:              ## @panfrost_ioctl_create_bo
	.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	%rsi, %rbx
	movl	12(%rsi), %eax
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	cmpq	$0, 16(%rbx)
	jne	LBB0_3
## %bb.2:
	movq	%rdi, %rsi
	movl	(%rbx), %ecx
	movq	_PANFROST_BO_NOEXEC@GOTPCREL(%rip), %rdi
	movl	(%rdi), %r8d
	movq	_PANFROST_BO_HEAP@GOTPCREL(%rip), %rdi
	movl	(%rdi), %r9d
	movl	%r9d, %edi
	orl	%r8d, %edi
	notl	%edi
	testl	%edi, %ecx
	jne	LBB0_3
## %bb.4:
	testl	%ecx, %r9d
	je	LBB0_6
## %bb.5:
	andl	%ecx, %r8d
	jne	LBB0_6
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	leaq	8(%rbx), %r8
	movq	%rdx, %rdi
	movl	%eax, %edx
	callq	_panfrost_gem_create_with_handle
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_7:
	movl	(%r14), %eax
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %eax
	movl	%eax, 4(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_PANFROST_BO_NOEXEC,4,2         ## @PANFROST_BO_NOEXEC
	.comm	_PANFROST_BO_HEAP,4,2           ## @PANFROST_BO_HEAP
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.no_dead_strip	_panfrost_ioctl_create_bo
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function panfrost_ioctl_create_bo
_panfrost_ioctl_create_bo:              ; @panfrost_ioctl_create_bo
	.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
	mov	x19, x1
	ldr	w8, [x1, #12]
	cbz	w8, LBB0_6
; %bb.1:
	ldr	x9, [x19, #16]
	cbnz	x9, LBB0_6
; %bb.2:
	ldr	w3, [x19]
Lloh0:
	adrp	x9, _PANFROST_BO_NOEXEC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PANFROST_BO_NOEXEC@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _PANFROST_BO_HEAP@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PANFROST_BO_HEAP@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w11, w10, w9
	bics	wzr, w3, w11
	b.ne	LBB0_6
; %bb.3:
	and	w10, w10, w3
	and	w9, w9, w3
	cmp	w10, #0
	ccmp	w9, #0, #0, ne
	b.eq	LBB0_6
; %bb.4:
	mov	x1, x0
	add	x4, x19, #8
	mov	x0, x2
	mov	x2, x8
	bl	_panfrost_gem_create_with_handle
	mov	x20, x0
	bl	_IS_ERR
	cbz	x0, LBB0_8
; %bb.5:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_6:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldr	w8, [x20]
Lloh9:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	lsl	w8, w8, w9
	str	w8, [x19, #4]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PANFROST_BO_NOEXEC,4,2         ; @PANFROST_BO_NOEXEC
	.comm	_PANFROST_BO_HEAP,4,2           ; @PANFROST_BO_HEAP
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.no_dead_strip	_panfrost_ioctl_create_bo
.subsections_via_symbols
