	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_cs_wait_ioctl               ## -- Begin function hl_cs_wait_ioctl
	.p2align	4, 0x90
_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	%rsi, %r14
	movq	8(%rdi), %r12
	movl	(%rsi), %edx
	movl	4(%rsi), %r15d
	movl	(%rdi), %esi
	movq	%r12, %rdi
	movl	%r15d, %ecx
	callq	__hl_cs_wait_ioctl
	movq	%rax, %rbx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	testq	%rbx, %rbx
	js	LBB0_1
## %bb.8:
	je	LBB0_9
## %bb.10:
	movq	_HL_WAIT_CS_STATUS_COMPLETED@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_1:
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	movl	%r15d, %ecx
	callq	_dev_err
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%rbx, %rax
	jne	LBB0_3
## %bb.2:
	movq	_HL_WAIT_CS_STATUS_INTERRUPTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
	jmp	LBB0_12
LBB0_9:
	movq	_HL_WAIT_CS_STATUS_BUSY@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
	movl	%eax, (%r14)
	xorl	%ebx, %ebx
LBB0_12:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%rbx, %rax
	jne	LBB0_5
## %bb.4:
	movq	_HL_WAIT_CS_STATUS_TIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_EIO@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	%rbx, %rax
	jne	LBB0_12
## %bb.6:
	movq	_HL_WAIT_CS_STATUS_ABORTED@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
	movl	%eax, (%r14)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error %ld on waiting for CS handle %llu\n"

	.comm	_ERESTARTSYS,8,3                ## @ERESTARTSYS
	.comm	_HL_WAIT_CS_STATUS_INTERRUPTED,4,2 ## @HL_WAIT_CS_STATUS_INTERRUPTED
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_ETIMEDOUT,8,3                  ## @ETIMEDOUT
	.comm	_HL_WAIT_CS_STATUS_TIMEDOUT,4,2 ## @HL_WAIT_CS_STATUS_TIMEDOUT
	.comm	_EIO,8,3                        ## @EIO
	.comm	_HL_WAIT_CS_STATUS_ABORTED,4,2  ## @HL_WAIT_CS_STATUS_ABORTED
	.comm	_HL_WAIT_CS_STATUS_BUSY,4,2     ## @HL_WAIT_CS_STATUS_BUSY
	.comm	_HL_WAIT_CS_STATUS_COMPLETED,4,2 ## @HL_WAIT_CS_STATUS_COMPLETED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_hl_cs_wait_ioctl               ; -- Begin function hl_cs_wait_ioctl
	.p2align	2
_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	x20, x1
	ldr	x22, [x0, #8]
	ldr	w1, [x0]
	ldp	w2, w21, [x20]
	mov	x0, x22
	mov	x3, x21
	bl	__hl_cs_wait_ioctl
	mov	x19, x0
	mov	x0, x20
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	tbnz	x19, #63, LBB0_3
; %bb.1:
	cbz	x19, LBB0_5
; %bb.2:
	mov	w19, #0
Lloh0:
	adrp	x8, _HL_WAIT_CS_STATUS_COMPLETED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HL_WAIT_CS_STATUS_COMPLETED@GOTPAGEOFF]
	b	LBB0_10
LBB0_3:
	ldr	w0, [x22]
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	mov	x3, x21
	bl	_dev_err
Lloh4:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh6:
	ldr	x8, [x8]
	cmn	x19, x8
	b.ne	LBB0_6
; %bb.4:
Lloh7:
	adrp	x8, _HL_WAIT_CS_STATUS_INTERRUPTED@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HL_WAIT_CS_STATUS_INTERRUPTED@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [x20]
Lloh10:
	adrp	x8, _EINTR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	neg	x19, x8
	b	LBB0_11
LBB0_5:
Lloh13:
	adrp	x8, _HL_WAIT_CS_STATUS_BUSY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HL_WAIT_CS_STATUS_BUSY@GOTPAGEOFF]
	b	LBB0_10
LBB0_6:
Lloh15:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cmn	x19, x8
	b.ne	LBB0_8
; %bb.7:
Lloh18:
	adrp	x8, _HL_WAIT_CS_STATUS_TIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HL_WAIT_CS_STATUS_TIMEDOUT@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmn	x19, x8
	b.ne	LBB0_11
; %bb.9:
Lloh23:
	adrp	x8, _HL_WAIT_CS_STATUS_ABORTED@GOTPAGE
Lloh24:
	ldr	x8, [x8, _HL_WAIT_CS_STATUS_ABORTED@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_11:
	mov	x0, x19
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error %ld on waiting for CS handle %llu\n"

	.comm	_ERESTARTSYS,8,3                ; @ERESTARTSYS
	.comm	_HL_WAIT_CS_STATUS_INTERRUPTED,4,2 ; @HL_WAIT_CS_STATUS_INTERRUPTED
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_ETIMEDOUT,8,3                  ; @ETIMEDOUT
	.comm	_HL_WAIT_CS_STATUS_TIMEDOUT,4,2 ; @HL_WAIT_CS_STATUS_TIMEDOUT
	.comm	_EIO,8,3                        ; @EIO
	.comm	_HL_WAIT_CS_STATUS_ABORTED,4,2  ; @HL_WAIT_CS_STATUS_ABORTED
	.comm	_HL_WAIT_CS_STATUS_BUSY,4,2     ; @HL_WAIT_CS_STATUS_BUSY
	.comm	_HL_WAIT_CS_STATUS_COMPLETED,4,2 ; @HL_WAIT_CS_STATUS_COMPLETED
.subsections_via_symbols
