	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function _hl_cs_wait_ioctl
__hl_cs_wait_ioctl:                     ## @_hl_cs_wait_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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rax
	cmpq	%rdx, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	_usecs_to_jiffies
	movq	%rax, %r15
LBB0_2:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_hl_ctx_get
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_hl_ctx_get_fence
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_PTR_ERR
	movq	%rax, %rbx
	jmp	LBB0_7
LBB0_4:
	testq	%r12, %r12
	je	LBB0_5
## %bb.6:
	movq	%r12, %rdi
	movl	$1, %esi
	movq	%r15, %rdx
	callq	_dma_fence_wait_timeout
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	subq	(%rcx), %rdx
	xorl	%ebx, %ebx
	movq	_EIO@GOTPCREL(%rip), %rcx
	subq	(%rcx), %rbx
	movq	(%r12), %rcx
	cmpq	%rbx, %rcx
	cmovneq	%rax, %rbx
	cmpq	%rdx, %rcx
	cmoveq	%rdx, %rbx
	movq	%r12, %rdi
	callq	_dma_fence_put
	jmp	LBB0_7
LBB0_5:
	movl	$1, %ebx
LBB0_7:
	movq	%r14, %rdi
	callq	_hl_ctx_put
	movq	%rbx, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_SCHEDULE_TIMEOUT,8,3       ## @MAX_SCHEDULE_TIMEOUT
	.comm	_ETIMEDOUT,8,3                  ## @ETIMEDOUT
	.comm	_EIO,8,3                        ## @EIO
	.no_dead_strip	__hl_cs_wait_ioctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function _hl_cs_wait_ioctl
__hl_cs_wait_ioctl:                     ; @_hl_cs_wait_ioctl
	.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	x21, x3
	mov	x20, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x2
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_usecs_to_jiffies
	mov	x20, x0
LBB0_2:
	mov	x0, x22
	mov	x1, x19
	bl	_hl_ctx_get
	mov	x0, x19
	mov	x1, x21
	bl	_hl_ctx_get_fence
	mov	x21, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_PTR_ERR
	mov	x20, x0
	b	LBB0_7
LBB0_4:
	cbz	x21, LBB0_6
; %bb.5:
	mov	x0, x21
	mov	w1, #1
	mov	x2, x20
	bl	_dma_fence_wait_timeout
	ldr	x8, [x21]
Lloh3:
	adrp	x9, _ETIMEDOUT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ETIMEDOUT@GOTPAGEOFF]
Lloh5:
	adrp	x10, _EIO@GOTPAGE
Lloh6:
	ldr	x10, [x10, _EIO@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	ldr	x10, [x10]
	cmn	x8, x10
	csneg	x10, x0, x10, ne
	cmn	x8, x9
	csneg	x20, x10, x9, ne
	mov	x0, x21
	bl	_dma_fence_put
	b	LBB0_7
LBB0_6:
	mov	w20, #1
LBB0_7:
	mov	x0, x19
	bl	_hl_ctx_put
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_SCHEDULE_TIMEOUT,8,3       ; @MAX_SCHEDULE_TIMEOUT
	.comm	_ETIMEDOUT,8,3                  ; @ETIMEDOUT
	.comm	_EIO,8,3                        ; @EIO
	.no_dead_strip	__hl_cs_wait_ioctl
.subsections_via_symbols
