	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_prime_handle_to_fd     ## -- Begin function drm_gem_prime_handle_to_fd
	.p2align	4, 0x90
_drm_gem_prime_handle_to_fd:            ## @drm_gem_prime_handle_to_fd
	.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	%r8, -64(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movq	%rsi, %r13
	movq	%rdi, %rbx
	movq	%rsi, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_drm_prime_lookup_buf_by_handle
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_get_dma_buf
LBB0_4:
	movq	%r12, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_dma_buf_fd
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_9
## %bb.5:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	%ebx, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_14
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_15
LBB0_6:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_get_dma_buf
	jmp	LBB0_8
LBB0_10:
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:
	callq	_get_dma_buf
	movq	(%r14), %r12
LBB0_8:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_drm_prime_add_buf_handle
	movl	%eax, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_4
LBB0_9:
	movq	%r12, %rdi
	callq	_dma_buf_put
LBB0_14:
	movq	%r14, %rdi
	callq	_drm_gem_object_put_unlocked
LBB0_15:
	movq	%r13, %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_export_and_register_object
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_8
## %bb.13:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movq	%rbx, %rdi
	movl	%eax, %ebx
	callq	_mutex_unlock
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_prime_handle_to_fd     ; -- Begin function drm_gem_prime_handle_to_fd
	.p2align	2
_drm_gem_prime_handle_to_fd:            ; @drm_gem_prime_handle_to_fd
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x4
	mov	x22, x3
	mov	x24, x2
	mov	x19, x1
	mov	x23, x0
	mov	x0, x1
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x24
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	mov	x1, x24
	bl	_drm_prime_lookup_buf_by_handle
	cbz	x0, LBB0_6
; %bb.2:
	mov	x25, x0
	bl	_get_dma_buf
LBB0_3:
	mov	x0, x25
	mov	x1, x22
	bl	_dma_buf_fd
	mov	x24, x0
	tbnz	w0, #31, LBB0_11
; %bb.4:
	str	w24, [x21]
	mov	w24, #0
	b	LBB0_12
LBB0_5:
Lloh0:
	adrp	x8, _ENOENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_13
LBB0_6:
	mov	x0, x23
	bl	_mutex_lock
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_8
; %bb.7:
	ldr	x25, [x8]
	mov	x0, x25
	bl	_get_dma_buf
	b	LBB0_10
LBB0_8:
	ldr	x0, [x20]
	cbz	x0, LBB0_14
; %bb.9:
	bl	_get_dma_buf
	ldr	x25, [x20]
LBB0_10:
	mov	x0, x19
	mov	x1, x25
	mov	x2, x24
	bl	_drm_prime_add_buf_handle
	mov	x24, x0
	mov	x0, x23
	bl	_mutex_unlock
	cbz	w24, LBB0_3
LBB0_11:
	mov	x0, x25
	bl	_dma_buf_put
LBB0_12:
	mov	x0, x20
	bl	_drm_gem_object_put_unlocked
LBB0_13:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x24
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_14:
	mov	x0, x23
	mov	x1, x20
	mov	x2, x22
	bl	_export_and_register_object
	mov	x25, x0
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.15:
	mov	x0, x25
	bl	_PTR_ERR
	mov	x24, x0
	mov	x0, x23
	bl	_mutex_unlock
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
.subsections_via_symbols
