	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ahb_mod
_ahb_mod:                               ## @ahb_mod
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_KR_AHB_ACC@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_qib_read_kreg64
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	leal	(%rbx,%rbx), %edx
	incl	%edx
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_qib_write_kreg
	movq	_AHB_TRANS_TRIES@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	$1, %ebx
	cmpl	$2, %edx
	jl	LBB0_5
## %bb.1:
	movl	$1, %ebx
	movq	_KR_AHB_TRANS@GOTPCREL(%rip), %r15
	movq	_AHB_TRANS_RDY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_qib_read_kreg64
	testl	%eax, (%r13)
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	movl	(%r12), %edx
	cmpl	%edx, %ebx
	jl	LBB0_2
LBB0_5:
	cmpl	%edx, %ebx
	jge	LBB0_6
LBB0_8:
	xorl	%eax, %eax
	cmpl	$1, -72(%rbp)                   ## 4-byte Folded Reload
	setne	%al
	shll	$16, %eax
	decl	%eax
	movl	%eax, %edx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	andl	%ecx, %edx
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	andl	%edx, %r13d
	notl	%ecx
	andl	%eax, %ecx
	je	LBB0_17
## %bb.9:
	movl	%edx, -72(%rbp)                 ## 4-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	shll	$6, %edx
	orl	-56(%rbp), %edx                 ## 4-byte Folded Reload
	movq	_AHB_ADDR_LSB@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	incb	%cl
	shll	%cl, %edx
	movq	_KR_AHB_TRANS@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_qib_write_kreg
	movl	(%r12), %edx
	movl	$1, %ebx
	cmpl	$2, %edx
	jl	LBB0_14
## %bb.10:
	movl	$1, %ebx
	movq	_AHB_TRANS_RDY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_qib_read_kreg64
	testl	%eax, (%r13)
	jne	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	incl	%ebx
	movl	(%r12), %edx
	cmpl	%edx, %ebx
	jl	LBB0_11
LBB0_14:
	cmpl	%edx, %ebx
	jge	LBB0_15
LBB0_16:
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_qib_read_kreg64
	movq	_AHB_DATA_LSB@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	andl	%eax, %ecx
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	orl	%ecx, %r13d
	movl	-72(%rbp), %edx                 ## 4-byte Reload
LBB0_17:
	testl	%edx, %edx
	je	LBB0_18
## %bb.19:
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	shll	$6, %esi
	orl	-56(%rbp), %esi                 ## 4-byte Folded Reload
	movq	_AHB_ADDR_LSB@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	incb	%cl
	shll	%cl, %esi
	movq	_AHB_DATA_LSB@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	shll	%cl, %r13d
	orl	%esi, %r13d
	movq	_AHB_WR@GOTPCREL(%rip), %rax
	orl	(%rax), %r13d
	movq	_KR_AHB_TRANS@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_qib_write_kreg
	movl	(%r12), %edx
	movl	$1, %ebx
	cmpl	$2, %edx
	jl	LBB0_24
## %bb.20:
	movl	$1, %ebx
	movq	_AHB_TRANS_RDY@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_21:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_qib_read_kreg64
	testl	%eax, (%r13)
	jne	LBB0_22
## %bb.23:                              ##   in Loop: Header=BB0_21 Depth=1
	incl	%ebx
	movl	(%r12), %edx
	cmpl	%edx, %ebx
	jl	LBB0_21
	jmp	LBB0_24
LBB0_3:
	movl	(%r12), %edx
	cmpl	%edx, %ebx
	jl	LBB0_8
LBB0_6:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_12:
	movl	(%r12), %edx
	cmpl	%edx, %ebx
	jl	LBB0_16
LBB0_15:
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movq	%r14, %rdi
	callq	_qib_dev_err
	movl	$195890093, %r13d               ## imm = 0xBAD0BAD
LBB0_18:
	movq	_KR_AHB_ACC@GOTPCREL(%rip), %rbx
	movl	-48(%rbp), %r15d                ## 4-byte Reload
LBB0_26:
	movl	(%rbx), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_qib_write_kreg
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	movl	(%r12), %edx
LBB0_24:
	cmpl	%edx, %ebx
	movq	_KR_AHB_ACC@GOTPCREL(%rip), %rbx
	movl	-48(%rbp), %r15d                ## 4-byte Reload
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jl	LBB0_26
## %bb.25:
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	callq	_qib_dev_err
	movl	$195890093, %r13d               ## imm = 0xBAD0BAD
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_KR_AHB_ACC,4,2                 ## @KR_AHB_ACC
	.comm	_AHB_TRANS_TRIES,4,2            ## @AHB_TRANS_TRIES
	.comm	_KR_AHB_TRANS,4,2               ## @KR_AHB_TRANS
	.comm	_AHB_TRANS_RDY,4,2              ## @AHB_TRANS_RDY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No ahb_rdy in %d tries\n"

	.comm	_AHB_ADDR_LSB,4,2               ## @AHB_ADDR_LSB
L_.str.1:                               ## @.str.1
	.asciz	"No Rd ahb_rdy in %d tries\n"

	.comm	_AHB_DATA_LSB,4,2               ## @AHB_DATA_LSB
	.comm	_AHB_WR,4,2                     ## @AHB_WR
L_.str.2:                               ## @.str.2
	.asciz	"No Wr ahb_rdy in %d tries\n"

	.no_dead_strip	_ahb_mod
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ahb_mod
_ahb_mod:                               ; @ahb_mod
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x5
	mov	x21, x4
	mov	x23, x3
	mov	x24, x2
	mov	x25, x1
	mov	x19, x0
Lloh0:
	adrp	x20, _KR_AHB_ACC@GOTPAGE
Lloh1:
	ldr	x20, [x20, _KR_AHB_ACC@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_qib_read_kreg64
	str	w0, [sp, #12]                   ; 4-byte Folded Spill
	mov	w26, #1
	mov	w2, #1
	bfi	w2, w25, #1, #31
	ldr	w1, [x20]
	mov	x0, x19
	bl	_qib_write_kreg
Lloh2:
	adrp	x27, _AHB_TRANS_TRIES@GOTPAGE
Lloh3:
	ldr	x27, [x27, _AHB_TRANS_TRIES@GOTPAGEOFF]
	ldr	w2, [x27]
Lloh4:
	adrp	x28, _KR_AHB_TRANS@GOTPAGE
Lloh5:
	ldr	x28, [x28, _KR_AHB_TRANS@GOTPAGEOFF]
	cmp	w2, #2
	b.lt	LBB0_6
; %bb.1:
	mov	w26, #1
Lloh6:
	adrp	x20, _AHB_TRANS_RDY@GOTPAGE
Lloh7:
	ldr	x20, [x20, _AHB_TRANS_RDY@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x28]
	mov	x0, x19
	bl	_qib_read_kreg64
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w26, w26, #1
	ldr	w2, [x27]
	cmp	w26, w2
	b.lt	LBB0_2
	b	LBB0_5
LBB0_4:
	ldr	w2, [x27]
LBB0_5:
Lloh8:
	adrp	x20, _KR_AHB_ACC@GOTPAGE
Lloh9:
	ldr	x20, [x20, _KR_AHB_ACC@GOTPAGEOFF]
LBB0_6:
	cmp	w26, w2
	b.ge	LBB0_12
; %bb.7:
	cmp	w25, #1
	mov	w8, #65535
	csinv	w8, w8, wzr, ne
	and	w25, w8, w22
	and	w21, w25, w21
	orr	w23, w23, w24, lsl #6
Lloh10:
	adrp	x24, _AHB_ADDR_LSB@GOTPAGE
Lloh11:
	ldr	x24, [x24, _AHB_ADDR_LSB@GOTPAGEOFF]
	bics	w22, w8, w22
	b.eq	LBB0_21
; %bb.8:
	ldr	w8, [x24]
	add	w8, w8, #1
	lsl	w2, w23, w8
	ldr	w1, [x28]
	mov	x0, x19
	bl	_qib_write_kreg
	ldr	w2, [x27]
	cmp	w2, #2
	b.lt	LBB0_13
; %bb.9:
	mov	x24, x20
	mov	w26, #1
Lloh12:
	adrp	x20, _AHB_TRANS_RDY@GOTPAGE
Lloh13:
	ldr	x20, [x20, _AHB_TRANS_RDY@GOTPAGEOFF]
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x28]
	mov	x0, x19
	bl	_qib_read_kreg64
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_18
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	add	w26, w26, #1
	ldr	w2, [x27]
	cmp	w26, w2
	b.lt	LBB0_10
	b	LBB0_19
LBB0_12:
	mov	w21, #2989
	movk	w21, #2989, lsl #16
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_15
LBB0_13:
	mov	w26, #1
	cmp	w26, w2
	b.lt	LBB0_20
LBB0_14:
	mov	w21, #2989
	movk	w21, #2989, lsl #16
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_15:
	mov	x0, x19
	bl	_qib_dev_err
LBB0_16:
	ldr	w23, [sp, #12]                  ; 4-byte Folded Reload
LBB0_17:
	ldr	w1, [x20]
	mov	x0, x19
	mov	x2, x23
	bl	_qib_write_kreg
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_18:
	ldr	w2, [x27]
LBB0_19:
	mov	x20, x24
Lloh18:
	adrp	x24, _AHB_ADDR_LSB@GOTPAGE
Lloh19:
	ldr	x24, [x24, _AHB_ADDR_LSB@GOTPAGEOFF]
	cmp	w26, w2
	b.ge	LBB0_14
LBB0_20:
	ldr	w1, [x28]
	mov	x0, x19
	bl	_qib_read_kreg64
Lloh20:
	adrp	x8, _AHB_DATA_LSB@GOTPAGE
Lloh21:
	ldr	x8, [x8, _AHB_DATA_LSB@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	asr	w8, w0, w8
	and	w8, w22, w8
	orr	w21, w8, w21
LBB0_21:
	cbz	w25, LBB0_16
; %bb.22:
	ldr	w8, [x24]
	add	w8, w8, #1
	lsl	w8, w23, w8
Lloh23:
	adrp	x9, _AHB_DATA_LSB@GOTPAGE
Lloh24:
	ldr	x9, [x9, _AHB_DATA_LSB@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	lsl	w9, w21, w9
	orr	w8, w8, w9
Lloh26:
	adrp	x9, _AHB_WR@GOTPAGE
Lloh27:
	ldr	x9, [x9, _AHB_WR@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w2, w8, w9
	ldr	w1, [x28]
	mov	x0, x19
	bl	_qib_write_kreg
	ldr	w2, [x27]
	cmp	w2, #2
	b.lt	LBB0_26
; %bb.23:
	mov	x23, x20
	mov	w22, #1
Lloh29:
	adrp	x20, _AHB_TRANS_RDY@GOTPAGE
Lloh30:
	ldr	x20, [x20, _AHB_TRANS_RDY@GOTPAGEOFF]
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x28]
	mov	x0, x19
	bl	_qib_read_kreg64
	ldr	w8, [x20]
	tst	w8, w0
	b.ne	LBB0_27
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	add	w22, w22, #1
	ldr	w2, [x27]
	cmp	w22, w2
	b.lt	LBB0_24
	b	LBB0_28
LBB0_26:
	mov	w22, #1
	b	LBB0_29
LBB0_27:
	ldr	w2, [x27]
LBB0_28:
	mov	x20, x23
LBB0_29:
	ldr	w23, [sp, #12]                  ; 4-byte Folded Reload
	cmp	w22, w2
	b.lt	LBB0_17
; %bb.30:
	mov	w21, #2989
	movk	w21, #2989, lsl #16
Lloh31:
	adrp	x1, l_.str.2@PAGE
Lloh32:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_qib_dev_err
	b	LBB0_17
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_KR_AHB_ACC,4,2                 ; @KR_AHB_ACC
	.comm	_AHB_TRANS_TRIES,4,2            ; @AHB_TRANS_TRIES
	.comm	_KR_AHB_TRANS,4,2               ; @KR_AHB_TRANS
	.comm	_AHB_TRANS_RDY,4,2              ; @AHB_TRANS_RDY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No ahb_rdy in %d tries\n"

	.comm	_AHB_ADDR_LSB,4,2               ; @AHB_ADDR_LSB
l_.str.1:                               ; @.str.1
	.asciz	"No Rd ahb_rdy in %d tries\n"

	.comm	_AHB_DATA_LSB,4,2               ; @AHB_DATA_LSB
	.comm	_AHB_WR,4,2                     ; @AHB_WR
l_.str.2:                               ; @.str.2
	.asciz	"No Wr ahb_rdy in %d tries\n"

	.no_dead_strip	_ahb_mod
.subsections_via_symbols
