	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function init_sdma_7322_regs
_init_sdma_7322_regs:                   ## @init_sdma_7322_regs
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	32(%rdi), %rbx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movq	$0, -48(%rbp)
	movq	_krp_senddmabase@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%rdi), %rdx
	callq	_qib_write_kreg_port
	movq	%r12, %rdi
	callq	_qib_sdma_7322_setlengen
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_qib_sdma_update_7322_tail
	movq	_krp_senddmareloadcnt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_sdma_idle_cnt@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	%r12, %rdi
	callq	_qib_write_kreg_port
	movq	_krp_senddmadesccnt@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_qib_write_kreg_port
	movq	_krp_senddmaheadaddr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	8(%r12), %rdx
	movq	%r12, %rdi
	callq	_qib_write_kreg_port
	movl	(%rbx), %edi
	movq	16(%rbx), %rax
	movl	(%rax), %ecx
	testl	%edi, %edi
	je	LBB0_1
## %bb.2:
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%eax, %r8d
	movl	8(%rbx), %esi
	addl	4(%rbx), %esi
	cmpl	$1, %edi
	jne	LBB0_3
	jmp	LBB0_4
LBB0_1:
	movl	8(%rbx), %esi
	addl	4(%rbx), %esi
	movl	%ecx, %r8d
LBB0_3:
	cmpl	$2, 16(%r12)
	cmovel	%r8d, %ecx
	movl	%ecx, %eax
LBB0_4:
	subl	%eax, %esi
	leal	(%rsi,%r8), %r9d
	movl	%esi, 20(%r12)
	movl	%r9d, 24(%r12)
	cmpl	%r9d, %esi
	jae	LBB0_5
## %bb.6:
	movq	_BITS_PER_LONG@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	leal	-1(%r10), %edi
	testb	$1, %r8b
	je	LBB0_8
## %bb.7:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%r10d
                                        ## kill: def $eax killed $eax def $rax
	movl	%edi, %ecx
	andl	%esi, %ecx
	movl	$1, %edx
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rdx
	orq	%rdx, -64(%rbp,%rax,8)
	incl	%esi
LBB0_8:
	cmpl	$1, %r8d
	je	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	%edi, %ecx
	andl	%esi, %ecx
	movl	$1, %ebx
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rbx
	xorl	%edx, %edx
	movl	%esi, %eax
	divl	%r10d
                                        ## kill: def $eax killed $eax def $rax
	orq	%rbx, -64(%rbp,%rax,8)
	leal	1(%rsi), %ecx
	movl	$1, %ebx
	movl	%ecx, %eax
	andl	%edi, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rbx
	xorl	%edx, %edx
	divl	%r10d
                                        ## kill: def $eax killed $eax def $rax
	orq	%rbx, -64(%rbp,%rax,8)
	addl	$2, %esi
	cmpl	%r9d, %esi
	jne	LBB0_9
LBB0_10:
	movq	-64(%rbp), %rdx
	movq	-56(%rbp), %r15
	movq	-48(%rbp), %r14
	jmp	LBB0_11
LBB0_5:
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
	xorl	%edx, %edx
LBB0_11:
	movq	_krp_senddmabufmask0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_qib_write_kreg_port
	movq	_krp_senddmabufmask1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%r15, %rdx
	callq	_qib_write_kreg_port
	movq	_krp_senddmabufmask2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_qib_write_kreg_port
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_13
## %bb.12:
	xorl	%eax, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_krp_senddmabase,4,2            ## @krp_senddmabase
	.comm	_krp_senddmareloadcnt,4,2       ## @krp_senddmareloadcnt
	.comm	_sdma_idle_cnt,8,3              ## @sdma_idle_cnt
	.comm	_krp_senddmadesccnt,4,2         ## @krp_senddmadesccnt
	.comm	_krp_senddmaheadaddr,4,2        ## @krp_senddmaheadaddr
	.comm	_BITS_PER_LONG,4,2              ## @BITS_PER_LONG
	.comm	_krp_senddmabufmask0,4,2        ## @krp_senddmabufmask0
	.comm	_krp_senddmabufmask1,4,2        ## @krp_senddmabufmask1
	.comm	_krp_senddmabufmask2,4,2        ## @krp_senddmabufmask2
	.no_dead_strip	_init_sdma_7322_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function init_sdma_7322_regs
_init_sdma_7322_regs:                   ; @init_sdma_7322_regs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x20, [x0, #32]
	stp	xzr, xzr, [sp]
	str	xzr, [sp, #16]
Lloh3:
	adrp	x8, _krp_senddmabase@GOTPAGE
Lloh4:
	ldr	x8, [x8, _krp_senddmabase@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	ldr	x2, [x0]
	bl	_qib_write_kreg_port
	mov	x0, x19
	bl	_qib_sdma_7322_setlengen
	mov	x0, x19
	mov	w1, #0
	bl	_qib_sdma_update_7322_tail
Lloh6:
	adrp	x8, _krp_senddmareloadcnt@GOTPAGE
Lloh7:
	ldr	x8, [x8, _krp_senddmareloadcnt@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _sdma_idle_cnt@GOTPAGE
Lloh10:
	ldr	x8, [x8, _sdma_idle_cnt@GOTPAGEOFF]
Lloh11:
	ldr	x2, [x8]
	mov	x0, x19
	bl	_qib_write_kreg_port
Lloh12:
	adrp	x8, _krp_senddmadesccnt@GOTPAGE
Lloh13:
	ldr	x8, [x8, _krp_senddmadesccnt@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, #0
	bl	_qib_write_kreg_port
Lloh15:
	adrp	x8, _krp_senddmaheadaddr@GOTPAGE
Lloh16:
	ldr	x8, [x8, _krp_senddmaheadaddr@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	ldr	x2, [x19, #8]
	mov	x0, x19
	bl	_qib_write_kreg_port
	ldr	w11, [x20]
	ldr	x8, [x20, #16]
	ldr	w9, [x8]
	cbz	w11, LBB0_2
; %bb.1:
	sdiv	w8, w9, w11
	ldp	w10, w12, [x20, #4]
	add	w10, w12, w10
	mov	x12, x8
	cmp	w11, #1
	b.ne	LBB0_3
	b	LBB0_4
LBB0_2:
	ldp	w8, w10, [x20, #4]
	add	w10, w10, w8
	mov	x8, x9
LBB0_3:
	ldr	w11, [x19, #16]
	cmp	w11, #2
	csel	w12, w8, w9, eq
LBB0_4:
	sub	w9, w10, w12
	add	w10, w9, w8
	stp	w9, w10, [x19, #20]
	cmp	w9, w10
	b.hs	LBB0_8
; %bb.5:
Lloh18:
	adrp	x10, _BITS_PER_LONG@GOTPAGE
Lloh19:
	ldr	x10, [x10, _BITS_PER_LONG@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	sub	w11, w10, #1
	mov	w12, #1
	mov	x13, sp
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	udiv	w14, w9, w10
	and	w15, w11, w9
	lsl	x14, x14, #3
	ldr	x16, [x13, x14]
	lsl	x15, x12, x15
	orr	x15, x15, x16
	str	x15, [x13, x14]
	add	w9, w9, #1
	subs	w8, w8, #1
	b.ne	LBB0_6
; %bb.7:
	ldp	x2, x21, [sp]
	ldr	x20, [sp, #16]
	b	LBB0_9
LBB0_8:
	mov	x20, #0
	mov	x21, #0
	mov	x2, #0
LBB0_9:
Lloh21:
	adrp	x8, _krp_senddmabufmask0@GOTPAGE
Lloh22:
	ldr	x8, [x8, _krp_senddmabufmask0@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_qib_write_kreg_port
Lloh24:
	adrp	x8, _krp_senddmabufmask1@GOTPAGE
Lloh25:
	ldr	x8, [x8, _krp_senddmabufmask1@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_qib_write_kreg_port
Lloh27:
	adrp	x8, _krp_senddmabufmask2@GOTPAGE
Lloh28:
	ldr	x8, [x8, _krp_senddmabufmask2@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_qib_write_kreg_port
	ldr	x8, [sp, #24]
Lloh30:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh31:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	mov	w0, #0
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_krp_senddmabase,4,2            ; @krp_senddmabase
	.comm	_krp_senddmareloadcnt,4,2       ; @krp_senddmareloadcnt
	.comm	_sdma_idle_cnt,8,3              ; @sdma_idle_cnt
	.comm	_krp_senddmadesccnt,4,2         ; @krp_senddmadesccnt
	.comm	_krp_senddmaheadaddr,4,2        ; @krp_senddmaheadaddr
	.comm	_BITS_PER_LONG,4,2              ; @BITS_PER_LONG
	.comm	_krp_senddmabufmask0,4,2        ; @krp_senddmabufmask0
	.comm	_krp_senddmabufmask1,4,2        ; @krp_senddmabufmask1
	.comm	_krp_senddmabufmask2,4,2        ; @krp_senddmabufmask2
	.no_dead_strip	_init_sdma_7322_regs
.subsections_via_symbols
