	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_complete
_sdma_complete:                         ## @sdma_complete
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	16(%rdi), %rbx
	movl	48(%rbx), %edi
	callq	_to_idev
	movq	%rax, %r15
	movq	_IPATH_SDMA_TXREQ_S_OK@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_1
## %bb.2:
	movq	_IB_WC_SUCCESS@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_IB_WC_WR_FLUSH_ERR@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %r13d
	leaq	44(%rbx), %rdi
	callq	_atomic_dec_and_test
	testq	%rax, %rax
	je	LBB0_11
## %bb.4:
	leaq	36(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rsi
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_ipath_send_complete
LBB0_6:
	movq	_ib_ipath_state_ops@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rbx), %rcx
	movq	_IPATH_FLUSH_SEND@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	testl	%edx, (%rax,%rcx,4)
	je	LBB0_8
## %bb.7:
	movq	8(%rbx), %rax
	cmpq	16(%rbx), %rax
	jne	LBB0_9
LBB0_8:
	movq	_IPATH_S_WAIT_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 24(%rbx)
	je	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
	callq	_ipath_schedule_send
LBB0_10:
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	leaq	40(%rbx), %rdi
	callq	_wake_up
	jmp	LBB0_13
LBB0_11:
	cmpq	$0, 8(%r14)
	je	LBB0_13
## %bb.12:
	leaq	36(%rbx), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	8(%r14), %rsi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_ipath_send_complete
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
LBB0_13:
	movq	_IPATH_SDMA_TXREQ_F_FREEBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_15
## %bb.14:
	movl	4(%r14), %edi
	callq	_kfree
LBB0_15:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_put_txreq
	leaq	32(%rbx), %rdi
	callq	_atomic_dec_and_test
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:
	addq	$28, %rbx
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wake_up                        ## TAILCALL
LBB0_16:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IPATH_SDMA_TXREQ_S_OK,4,2      ## @IPATH_SDMA_TXREQ_S_OK
	.comm	_IB_WC_SUCCESS,4,2              ## @IB_WC_SUCCESS
	.comm	_IB_WC_WR_FLUSH_ERR,4,2         ## @IB_WC_WR_FLUSH_ERR
	.comm	_ib_ipath_state_ops,8,3         ## @ib_ipath_state_ops
	.comm	_IPATH_FLUSH_SEND,4,2           ## @IPATH_FLUSH_SEND
	.comm	_IPATH_S_WAIT_DMA,4,2           ## @IPATH_S_WAIT_DMA
	.comm	_IPATH_SDMA_TXREQ_F_FREEBUF,4,2 ## @IPATH_SDMA_TXREQ_F_FREEBUF
	.no_dead_strip	_sdma_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_complete
_sdma_complete:                         ; @sdma_complete
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x1
	mov	x20, x0
	ldr	x19, [x0, #16]
	ldr	w0, [x19, #48]
	bl	_to_idev
	mov	x21, x0
Lloh0:
	adrp	x8, _IPATH_SDMA_TXREQ_S_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IPATH_SDMA_TXREQ_S_OK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _IB_WC_SUCCESS@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IB_WC_SUCCESS@GOTPAGEOFF]
Lloh5:
	adrp	x10, _IB_WC_WR_FLUSH_ERR@GOTPAGE
Lloh6:
	ldr	x10, [x10, _IB_WC_WR_FLUSH_ERR@GOTPAGEOFF]
	cmp	w8, w22
	csel	x8, x9, x10, eq
	ldr	w23, [x8]
	add	x0, x19, #44
	bl	_atomic_dec_and_test
	cbz	x0, LBB0_8
; %bb.1:
	add	x22, x19, #36
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldr	x1, [x20, #8]
	cbz	x1, LBB0_3
; %bb.2:
	mov	x0, x19
	mov	x2, x23
	bl	_ipath_send_complete
LBB0_3:
Lloh7:
	adrp	x8, _ib_ipath_state_ops@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ib_ipath_state_ops@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x9, [x19]
	ldr	w8, [x8, x9, lsl #2]
Lloh10:
	adrp	x9, _IPATH_FLUSH_SEND@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IPATH_FLUSH_SEND@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	ldp	x8, x9, [x19, #8]
	cmp	x8, x9
	b.ne	LBB0_6
LBB0_5:
	ldr	w8, [x19, #24]
Lloh13:
	adrp	x9, _IPATH_S_WAIT_DMA@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IPATH_S_WAIT_DMA@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_ipath_schedule_send
LBB0_7:
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	add	x0, x19, #40
	bl	_wake_up
	b	LBB0_10
LBB0_8:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_10
; %bb.9:
	add	x22, x19, #36
	mov	x0, x22
	bl	_spin_lock_irqsave
	ldr	x1, [x20, #8]
	mov	x0, x19
	mov	x2, x23
	bl	_ipath_send_complete
	mov	x0, x22
	bl	_spin_unlock_irqrestore
LBB0_10:
	ldr	w8, [x20]
Lloh16:
	adrp	x9, _IPATH_SDMA_TXREQ_F_FREEBUF@GOTPAGE
Lloh17:
	ldr	x9, [x9, _IPATH_SDMA_TXREQ_F_FREEBUF@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	ldr	w0, [x20, #4]
	bl	_kfree
LBB0_12:
	mov	x0, x21
	mov	x1, x20
	bl	_put_txreq
	add	x0, x19, #32
	bl	_atomic_dec_and_test
	cbz	x0, LBB0_14
; %bb.13:
	add	x0, x19, #28
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_wake_up
LBB0_14:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_IPATH_SDMA_TXREQ_S_OK,4,2      ; @IPATH_SDMA_TXREQ_S_OK
	.comm	_IB_WC_SUCCESS,4,2              ; @IB_WC_SUCCESS
	.comm	_IB_WC_WR_FLUSH_ERR,4,2         ; @IB_WC_WR_FLUSH_ERR
	.comm	_ib_ipath_state_ops,8,3         ; @ib_ipath_state_ops
	.comm	_IPATH_FLUSH_SEND,4,2           ; @IPATH_FLUSH_SEND
	.comm	_IPATH_S_WAIT_DMA,4,2           ; @IPATH_S_WAIT_DMA
	.comm	_IPATH_SDMA_TXREQ_F_FREEBUF,4,2 ; @IPATH_SDMA_TXREQ_F_FREEBUF
	.no_dead_strip	_sdma_complete
.subsections_via_symbols
