	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drm_syncobj_export_sync_file
_drm_syncobj_export_sync_file:          ## @drm_syncobj_export_sync_file
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r12
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_unused_fd_flags
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	leaq	-40(%rbp), %r8
	movq	%r12, %rdi
	movl	%r15d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_drm_syncobj_find_fence
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_2
LBB0_4:
	movl	%ebx, %edi
	callq	_put_unused_fd
	movl	%r15d, %ebx
	jmp	LBB0_5
LBB0_2:
	movq	-40(%rbp), %rdi
	callq	_sync_file_create
	movq	%rax, %r15
	movq	-40(%rbp), %rdi
	callq	_dma_fence_put
	testq	%r15, %r15
	je	LBB0_3
## %bb.6:
	movl	(%r15), %esi
	movl	%ebx, %edi
	callq	_fd_install
	movl	%ebx, (%r14)
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_drm_syncobj_export_sync_file
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drm_syncobj_export_sync_file
_drm_syncobj_export_sync_file:          ; @drm_syncobj_export_sync_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _O_CLOEXEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_CLOEXEC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_get_unused_fd_flags
	mov	x19, x0
	tbnz	w0, #31, LBB0_5
; %bb.1:
	add	x4, sp, #8
	mov	x0, x22
	mov	x1, x21
	mov	w2, #0
	mov	w3, #0
	bl	_drm_syncobj_find_fence
	mov	x21, x0
	cbz	w0, LBB0_3
LBB0_2:
	mov	x0, x19
	bl	_put_unused_fd
	mov	x19, x21
	b	LBB0_5
LBB0_3:
	ldr	x0, [sp, #8]
	bl	_sync_file_create
	mov	x21, x0
	ldr	x0, [sp, #8]
	bl	_dma_fence_put
	cbz	x21, LBB0_6
; %bb.4:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_fd_install
	str	w19, [x20]
	mov	w19, #0
LBB0_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
	add	sp, sp, #64
	ret
LBB0_6:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_drm_syncobj_export_sync_file
.subsections_via_symbols
