	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_ioctl_mmap_bo
_panfrost_ioctl_mmap_bo:                ## @panfrost_ioctl_mmap_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	(%rsi), %rsi
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_INFO
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	12(%r14), %esi
	movq	%rdx, %rdi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_to_panfrost_bo
	cmpq	$0, (%rax)
	jne	LBB0_5
## %bb.7:
	movq	%r15, %rdi
	callq	_drm_gem_create_mmap_offset
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	callq	_drm_vma_node_offset_addr
	movl	%eax, 8(%r14)
LBB0_9:
	movq	%r15, %rdi
	callq	_drm_gem_object_put_unlocked
	jmp	LBB0_10
LBB0_3:
	movl	12(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_6
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unknown mmap_bo flags: %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Failed to look up GEM BO %d\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.no_dead_strip	_panfrost_ioctl_mmap_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_mmap_bo
_panfrost_ioctl_mmap_bo:                ; @panfrost_ioctl_mmap_bo
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	ldr	x1, [x1]
	cbz	x1, LBB0_5
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_INFO
LBB0_2:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_3:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_4:
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	w1, [x19, #12]
	mov	x0, x2
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_10
; %bb.6:
	mov	x20, x0
	bl	_to_panfrost_bo
	ldr	x8, [x0]
	cbnz	x8, LBB0_2
; %bb.7:
	mov	x0, x20
	bl	_drm_gem_create_mmap_offset
	mov	x21, x0
	cbnz	w0, LBB0_9
; %bb.8:
	mov	x0, x20
	bl	_drm_vma_node_offset_addr
	str	w0, [x19, #8]
LBB0_9:
	mov	x0, x20
	bl	_drm_gem_object_put_unlocked
	b	LBB0_4
LBB0_10:
	ldr	w1, [x19, #12]
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG
Lloh6:
	adrp	x8, _ENOENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unknown mmap_bo flags: %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Failed to look up GEM BO %d\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.no_dead_strip	_panfrost_ioctl_mmap_bo
.subsections_via_symbols
