	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_sdma_7220_gethead
_qib_sdma_7220_gethead:                 ## @qib_sdma_7220_gethead
	.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
	movq	%rdi, %r14
	movq	32(%rdi), %r15
	callq	___qib_sdma_running
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_QIB_HAS_SDMA_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_3
## %bb.2:
	movq	24(%r14), %rax
	movl	(%rax), %edi
	callq	_le64_to_cpu
	movq	%rax, %rbx
	xorl	%r13d, %r13d
	jmp	LBB0_4
LBB0_3:
	movq	_kr_senddmahead@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_qib_read_kreg32
	movq	%rax, %rbx
	movb	$1, %r13b
LBB0_4:
	movq	(%r14), %r12
	movq	8(%r14), %rax
	cmpq	%rax, %r12
	jge	LBB0_5
## %bb.8:
	cmpq	%r12, %rbx
	setge	%cl
	cmpq	%rax, %rbx
	setle	%al
	andb	%cl, %al
	jmp	LBB0_9
LBB0_5:
	jle	LBB0_6
## %bb.7:
	cmpq	%r12, %rbx
	setge	%cl
	cmpq	16(%r14), %rbx
	setl	%dl
	andb	%cl, %dl
	cmpq	%rax, %rbx
	setle	%al
	orb	%dl, %al
	jmp	LBB0_9
LBB0_6:
	cmpq	%r12, %rbx
	sete	%al
LBB0_9:
	xorb	$1, %al
	movzbl	%al, %edi
	callq	_unlikely
	testq	%rax, %rax
	sete	%al
	orb	%al, %r13b
	jne	LBB0_16
## %bb.10:
	movq	_kr_senddmahead@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_qib_read_kreg32
	movq	%rax, %rbx
	movq	(%r14), %r12
	movq	8(%r14), %rax
	cmpq	%rax, %r12
	jge	LBB0_12
## %bb.11:
	cmpq	%r12, %rbx
	setge	%cl
	cmpq	%rax, %rbx
	setle	%al
	andb	%cl, %al
	jmp	LBB0_15
LBB0_12:
	jle	LBB0_14
## %bb.13:
	cmpq	%r12, %rbx
	setge	%cl
	cmpq	16(%r14), %rbx
	setl	%dl
	andb	%cl, %dl
	cmpq	%rax, %rbx
	setle	%al
	orb	%dl, %al
	jmp	LBB0_15
LBB0_14:
	cmpq	%r12, %rbx
	sete	%al
LBB0_15:
	xorb	$1, %al
	movzbl	%al, %edi
	callq	_unlikely
	testq	%rax, %rax
	sete	%al
LBB0_16:
	testb	%al, %al
	cmoveq	%r12, %rbx
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_HAS_SDMA_TIMEOUT,4,2       ## @QIB_HAS_SDMA_TIMEOUT
	.comm	_kr_senddmahead,4,2             ## @kr_senddmahead
	.no_dead_strip	_qib_sdma_7220_gethead
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_sdma_7220_gethead
_qib_sdma_7220_gethead:                 ; @qib_sdma_7220_gethead
	.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	x19, x0
	ldr	x21, [x0, #32]
	bl	___qib_sdma_running
Lloh0:
	adrp	x22, _kr_senddmahead@GOTPAGE
Lloh1:
	ldr	x22, [x22, _kr_senddmahead@GOTPAGEOFF]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	w8, [x21]
Lloh2:
	adrp	x9, _QIB_HAS_SDMA_TIMEOUT@GOTPAGE
Lloh3:
	ldr	x9, [x9, _QIB_HAS_SDMA_TIMEOUT@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	ldr	x8, [x19, #24]
	ldr	w0, [x8]
	bl	_le64_to_cpu
	mov	x20, x0
	mov	w24, #0
	b	LBB0_4
LBB0_3:
	ldr	w1, [x22]
	mov	x0, x21
	bl	_qib_read_kreg32
	mov	x20, x0
	mov	w24, #1
LBB0_4:
	ldp	x23, x8, [x19]
	ldr	x9, [x19, #16]
	cmp	x20, x23
	ccmp	x20, x8, #0, ge
	cset	w10, le
	cmp	x20, x23
	ccmp	x20, x9, #0, ge
	ccmp	x20, x8, #4, ge
	cset	w9, le
	cmp	x20, x23
	cset	w11, eq
	cmp	x23, x8
	csel	w8, w9, w11, gt
	csel	w8, w10, w8, lt
	eor	w0, w8, #0x1
	bl	_unlikely
	cmp	x0, #0
	cset	w8, eq
	orr	w9, w8, w24
	tbnz	w9, #0, LBB0_6
; %bb.5:
	ldr	w1, [x22]
	mov	x0, x21
	bl	_qib_read_kreg32
	mov	x20, x0
	ldp	x23, x8, [x19]
	ldr	x9, [x19, #16]
	cmp	x0, x23
	cset	w10, eq
	ccmp	x0, x9, #0, ge
	ccmp	x0, x8, #4, ge
	cset	w9, le
	cmp	x23, x8
	csel	w9, w10, w9, le
	cmp	x0, x23
	ccmp	x0, x8, #0, ge
	cset	w10, le
	cmp	x23, x8
	csel	w8, w9, w10, ge
	eor	w0, w8, #0x1
	bl	_unlikely
	cmp	x0, #0
	cset	w8, eq
LBB0_6:
	cmp	w8, #0
	csel	x0, x20, x23, ne
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_HAS_SDMA_TIMEOUT,4,2       ; @QIB_HAS_SDMA_TIMEOUT
	.comm	_kr_senddmahead,4,2             ; @kr_senddmahead
	.no_dead_strip	_qib_sdma_7220_gethead
.subsections_via_symbols
