	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_syncobj_fd_to_handle
_drm_syncobj_fd_to_handle:              ## @drm_syncobj_fd_to_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	%rdx, %r14
	movq	%rdi, %r15
	movl	%esi, %edi
	callq	_fdget
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	8(%rax), %rax
	cmpq	_drm_syncobj_file_fops@GOTPCREL(%rip), %rax
	je	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_fdput
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_4:
	movq	(%r12), %r13
	movq	%r13, %rdi
	callq	_drm_syncobj_get
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_idr_preload
	movq	%r15, %rdi
	callq	_spin_lock
	leaq	4(%r15), %rdi
	movq	_GFP_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%ebx, %ebx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %rsi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_idr_alloc
	movl	%eax, %r13d
	movq	%r15, %rdi
	callq	_spin_unlock
	xorl	%eax, %eax
	callq	_idr_preload_end
	testl	%r13d, %r13d
	jle	LBB0_6
## %bb.5:
	movl	%r13d, (%r14)
	jmp	LBB0_7
LBB0_6:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_syncobj_put
	movl	%r13d, %ebx
LBB0_7:
	movq	%r12, %rdi
	callq	_fdput
LBB0_8:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_drm_syncobj_file_fops,4,2      ## @drm_syncobj_file_fops
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_GFP_NOWAIT,4,2                 ## @GFP_NOWAIT
	.no_dead_strip	_drm_syncobj_fd_to_handle
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drm_syncobj_fd_to_handle
_drm_syncobj_fd_to_handle:              ; @drm_syncobj_fd_to_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	x20, x2
	mov	x21, x0
	mov	x0, x1
	bl	_fdget
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh0:
	adrp	x9, _drm_syncobj_file_fops@GOTPAGE
Lloh1:
	ldr	x9, [x9, _drm_syncobj_file_fops@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_fdput
LBB0_3:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_8
LBB0_4:
	ldr	x22, [x19]
	mov	x0, x22
	bl	_drm_syncobj_get
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_idr_preload
	mov	x0, x21
	bl	_spin_lock
	add	x0, x21, #4
Lloh8:
	adrp	x8, _GFP_NOWAIT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_NOWAIT@GOTPAGEOFF]
Lloh10:
	ldr	w4, [x8]
	mov	x1, x22
	mov	w2, #1
	mov	w3, #0
	bl	_idr_alloc
	mov	x23, x0
	mov	x0, x21
	bl	_spin_unlock
	bl	_idr_preload_end
	cmp	w23, #1
	b.lt	LBB0_6
; %bb.5:
	str	w23, [x20]
	mov	w23, #0
	b	LBB0_7
LBB0_6:
	mov	x0, x22
	bl	_drm_syncobj_put
LBB0_7:
	mov	x0, x19
	bl	_fdput
LBB0_8:
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_drm_syncobj_file_fops,4,2      ; @drm_syncobj_file_fops
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_GFP_NOWAIT,4,2                 ; @GFP_NOWAIT
	.no_dead_strip	_drm_syncobj_fd_to_handle
.subsections_via_symbols
