	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_cs_fence_to_handle_ioctl ## -- Begin function amdgpu_cs_fence_to_handle_ioctl
	.p2align	4, 0x90
_amdgpu_cs_fence_to_handle_ioctl:       ## @amdgpu_cs_fence_to_handle_ioctl
	.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, %r12
	movq	%rsi, %r15
	movq	(%rdi), %rdi
	leaq	4(%rsi), %rdx
	movq	%r12, %rsi
	callq	_amdgpu_cs_get_fence
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_1
## %bb.19:
	movq	%rbx, %rdi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	testq	%rbx, %rbx
	jne	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_dma_fence_get_stub
	movq	%rax, %rbx
LBB0_3:
	movl	(%r15), %eax
	cmpl	$128, %eax
	je	LBB0_11
## %bb.4:
	cmpl	$129, %eax
	je	LBB0_8
## %bb.5:
	cmpl	$130, %eax
	jne	LBB0_16
## %bb.6:
	leaq	-40(%rbp), %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_drm_syncobj_create
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_dma_fence_put
	testl	%r14d, %r14d
	jne	LBB0_18
## %bb.7:
	movq	-40(%rbp), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_drm_syncobj_get_handle
	jmp	LBB0_10
LBB0_11:
	movq	_O_CLOEXEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_get_unused_fd_flags
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_12
## %bb.13:
	movq	%rbx, %rdi
	callq	_sync_file_create
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_dma_fence_put
	testq	%r12, %r12
	je	LBB0_14
## %bb.15:
	movl	(%r12), %esi
	movl	%r14d, %edi
	callq	_fd_install
	movl	%r14d, (%r15)
	xorl	%r14d, %r14d
	jmp	LBB0_18
LBB0_8:
	leaq	-40(%rbp), %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_drm_syncobj_create
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_dma_fence_put
	testl	%r14d, %r14d
	jne	LBB0_18
## %bb.9:
	movq	-40(%rbp), %rdi
	movq	%r15, %rsi
	callq	_drm_syncobj_get_fd
LBB0_10:
	movl	%eax, %r14d
	movq	-40(%rbp), %rdi
	callq	_drm_syncobj_put
	jmp	LBB0_18
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_12:
	movq	%rbx, %rdi
	callq	_dma_fence_put
	jmp	LBB0_18
LBB0_14:
	movl	%r14d, %edi
	callq	_put_unused_fd
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_17:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_18:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CLOEXEC,4,2                  ## @O_CLOEXEC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_cs_fence_to_handle_ioctl ; -- Begin function amdgpu_cs_fence_to_handle_ioctl
	.p2align	2
_amdgpu_cs_fence_to_handle_ioctl:       ; @amdgpu_cs_fence_to_handle_ioctl
	.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	x22, x2
	mov	x19, x1
	ldr	x0, [x0]
	add	x2, x1, #4
	mov	x1, x22
	bl	_amdgpu_cs_get_fence
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x21
	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
	b	_PTR_ERR
LBB0_2:
	cbnz	x21, LBB0_4
; %bb.3:
	bl	_dma_fence_get_stub
	mov	x21, x0
LBB0_4:
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_9
; %bb.5:
	cmp	w8, #129
	b.eq	LBB0_12
; %bb.6:
	cmp	w8, #130
	b.ne	LBB0_15
; %bb.7:
	add	x0, sp, #8
	mov	w1, #0
	mov	x2, x21
	bl	_drm_syncobj_create
	mov	x20, x0
	mov	x0, x21
	bl	_dma_fence_put
	cbnz	w20, LBB0_19
; %bb.8:
	ldr	x1, [sp, #8]
	mov	x0, x22
	mov	x2, x19
	bl	_drm_syncobj_get_handle
	b	LBB0_14
LBB0_9:
Lloh0:
	adrp	x8, _O_CLOEXEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_CLOEXEC@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_get_unused_fd_flags
	mov	x20, x0
	tbnz	w0, #31, LBB0_16
; %bb.10:
	mov	x0, x21
	bl	_sync_file_create
	mov	x22, x0
	mov	x0, x21
	bl	_dma_fence_put
	cbz	x22, LBB0_17
; %bb.11:
	ldr	w1, [x22]
	mov	x0, x20
	bl	_fd_install
	str	w20, [x19]
	mov	w20, #0
	b	LBB0_19
LBB0_12:
	add	x0, sp, #8
	mov	w1, #0
	mov	x2, x21
	bl	_drm_syncobj_create
	mov	x20, x0
	mov	x0, x21
	bl	_dma_fence_put
	cbnz	w20, LBB0_19
; %bb.13:
	ldr	x0, [sp, #8]
	mov	x1, x19
	bl	_drm_syncobj_get_fd
LBB0_14:
	mov	x20, x0
	ldr	x0, [sp, #8]
	bl	_drm_syncobj_put
	b	LBB0_19
LBB0_15:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_18
LBB0_16:
	mov	x0, x21
	bl	_dma_fence_put
	b	LBB0_19
LBB0_17:
	mov	x0, x20
	bl	_put_unused_fd
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_18:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_19:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CLOEXEC,4,2                  ; @O_CLOEXEC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
