	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function carl9170_usb_flush
_carl9170_usb_flush:                    ## @carl9170_usb_flush
	.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	%rdi, %r15
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_usb_get_from_anchor
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rax, %rbx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %r12
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_carl9170_tx_drop
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_carl9170_tx_callback
	movq	%rbx, %rdi
	callq	_usb_free_urb
	movq	%r14, %rdi
	callq	_usb_get_from_anchor
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_2
LBB0_3:
	leaq	4(%r15), %rdi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usb_wait_anchor_empty_timeout
	movq	_ETIMEDOUT@GOTPCREL(%rip), %r14
	xorl	%ebx, %ebx
	subl	(%r14), %ebx
	xorl	%r12d, %r12d
	testl	%eax, %eax
	cmovnel	%r12d, %ebx
	movq	%r15, %rdi
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usb_wait_anchor_empty_timeout
	subl	(%r14), %r12d
	testl	%eax, %eax
	cmovnel	%ebx, %r12d
	movq	%r15, %rdi
	callq	_usb_kill_anchored_urbs
	movq	%r15, %rdi
	callq	_carl9170_usb_handle_tx_err
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_carl9170_usb_flush
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function carl9170_usb_flush
_carl9170_usb_flush:                    ; @carl9170_usb_flush
	.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	x19, x0
	add	x20, x0, #8
	mov	x0, x20
	bl	_usb_get_from_anchor
	cbz	x0, LBB0_3
; %bb.1:
	mov	x21, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x22, [x21]
	mov	x0, x19
	mov	x1, x22
	bl	_carl9170_tx_drop
	mov	x0, x19
	mov	x1, x22
	bl	_carl9170_tx_callback
	mov	x0, x21
	bl	_usb_free_urb
	mov	x0, x20
	bl	_usb_get_from_anchor
	mov	x21, x0
	cbnz	x0, LBB0_2
LBB0_3:
	add	x0, x19, #4
	mov	w1, #1000
	bl	_usb_wait_anchor_empty_timeout
Lloh0:
	adrp	x20, _ETIMEDOUT@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ETIMEDOUT@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w0, #0
	csneg	w21, wzr, w8, ne
	mov	x0, x19
	mov	w1, #1000
	bl	_usb_wait_anchor_empty_timeout
	ldr	w8, [x20]
	cmp	w0, #0
	csneg	w20, w21, w8, ne
	mov	x0, x19
	bl	_usb_kill_anchored_urbs
	mov	x0, x19
	bl	_carl9170_usb_handle_tx_err
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_carl9170_usb_flush
.subsections_via_symbols
