	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bsg_complete_all_commands
_bsg_complete_all_commands:             ## @bsg_complete_all_commands
	.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, %r14
	movl	8(%rdi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
	movq	_ENODATA@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_bsg_io_schedule
	addl	(%rbx), %eax
	jne	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_spin_lock_irq
	cmpl	$0, 4(%r14)
	je	LBB0_3
## %bb.6:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movq	%r14, %rdi
	callq	_bsg_get_done_cmd
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_5
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	12(%r12), %edi
	movq	%r12, %rsi
	addq	$8, %rsi
	movl	(%r12), %ecx
	movl	4(%r12), %edx
	callq	_blk_complete_sgv4_hdr_rq
	movl	%eax, %ebx
	testl	%r15d, %r15d
	cmovnel	%r15d, %ebx
	movq	%r12, %rdi
	callq	_bsg_free_command
	movq	%r14, %rdi
	callq	_spin_lock_irq
	cmpl	$0, 4(%r14)
	movl	%ebx, %r15d
	jne	LBB0_7
	jmp	LBB0_4
LBB0_3:
	xorl	%ebx, %ebx
LBB0_4:
	movq	%r14, %rdi
	callq	_spin_unlock_irq
	movl	%ebx, %r15d
LBB0_5:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: entered\n"

	.comm	_ENODATA,4,2                    ## @ENODATA
	.no_dead_strip	_bsg_complete_all_commands
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bsg_complete_all_commands
_bsg_complete_all_commands:             ; @bsg_complete_all_commands
	.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
	ldr	w1, [x0, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
Lloh2:
	adrp	x20, _ENODATA@GOTPAGE
Lloh3:
	ldr	x20, [x20, _ENODATA@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_bsg_io_schedule
	ldr	w8, [x20]
	cmn	w0, w8
	b.ne	LBB0_1
; %bb.2:
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_6
; %bb.3:
	mov	w20, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_spin_unlock_irq
	mov	x0, x19
	bl	_bsg_get_done_cmd
	mov	x21, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x21, #12]
	add	x1, x21, #8
	ldp	w3, w2, [x21]
	bl	_blk_complete_sgv4_hdr_rq
	cmp	w20, #0
	csel	w20, w0, w20, eq
	mov	x0, x21
	bl	_bsg_free_command
	mov	x0, x19
	bl	_spin_lock_irq
	ldr	w8, [x19, #4]
	cbnz	w8, LBB0_4
	b	LBB0_7
LBB0_6:
	mov	w20, #0
LBB0_7:
	mov	x0, x19
	bl	_spin_unlock_irq
LBB0_8:
	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	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: entered\n"

	.comm	_ENODATA,4,2                    ; @ENODATA
	.no_dead_strip	_bsg_complete_all_commands
.subsections_via_symbols
