	.file	"extr_qib_iba7322.c_ahb_mod.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"No ahb_rdy in %d tries\n"
.LC1:
	.string	"No Rd ahb_rdy in %d tries\n"
.LC2:
	.string	"No Wr ahb_rdy in %d tries\n"
	.text
	.p2align 4
	.type	ahb_mod, @function
ahb_mod:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15d, ecx
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12d, r9d
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, r8d
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	esi, DWORD PTR KR_AHB_ACC[rip]
	mov	DWORD PTR 12[rsp], edx
	call	qib_read_kreg64@PLT
	mov	esi, DWORD PTR KR_AHB_ACC[rip]
	lea	edx, 1[r13+r13]
	mov	rdi, r14
	mov	DWORD PTR 8[rsp], eax
	call	qib_write_kreg@PLT
	mov	r8d, DWORD PTR AHB_TRANS_TRIES[rip]
	cmp	r8d, 1
	jle	.L19
	mov	ebp, 1
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L29:
	mov	r8d, DWORD PTR AHB_TRANS_TRIES[rip]
	add	ebp, 1
	cmp	r8d, ebp
	jle	.L19
.L4:
	mov	esi, DWORD PTR KR_AHB_TRANS[rip]
	mov	rdi, r14
	call	qib_read_kreg64@PLT
	test	DWORD PTR AHB_TRANS_RDY[rip], eax
	je	.L29
	mov	r8d, DWORD PTR AHB_TRANS_TRIES[rip]
	cmp	r8d, ebp
	jle	.L19
	cmp	r13d, 1
	mov	eax, 65535
	mov	r13d, -1
	cmovne	r13d, eax
	mov	eax, r12d
	not	eax
	test	eax, r13d
	jne	.L8
	and	ebx, r12d
	and	ebx, r13d
	test	r13d, r12d
	jne	.L30
.L6:
	mov	edx, DWORD PTR 8[rsp]
	mov	esi, DWORD PTR KR_AHB_ACC[rip]
	mov	rdi, r14
	call	qib_write_kreg@PLT
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, ebx
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	mov	edx, DWORD PTR 12[rsp]
	mov	eax, DWORD PTR AHB_ADDR_LSB[rip]
	mov	rdi, r14
	mov	esi, DWORD PTR KR_AHB_TRANS[rip]
	sal	edx, 6
	lea	ecx, 1[rax]
	or	edx, r15d
	sal	edx, cl
	call	qib_write_kreg@PLT
	mov	r8d, DWORD PTR AHB_TRANS_TRIES[rip]
	cmp	r8d, 1
	jle	.L18
	mov	ebp, 1
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	mov	r8d, DWORD PTR AHB_TRANS_TRIES[rip]
	add	ebp, 1
	cmp	r8d, ebp
	jle	.L18
.L12:
	mov	esi, DWORD PTR KR_AHB_TRANS[rip]
	mov	rdi, r14
	call	qib_read_kreg64@PLT
	test	DWORD PTR AHB_TRANS_RDY[rip], eax
	je	.L31
	mov	r8d, DWORD PTR AHB_TRANS_TRIES[rip]
	cmp	r8d, ebp
	jle	.L18
	mov	esi, DWORD PTR KR_AHB_TRANS[rip]
	mov	rdi, r14
	call	qib_read_kreg64@PLT
	mov	ecx, DWORD PTR AHB_DATA_LSB[rip]
	sar	eax, cl
	xor	ebx, eax
	and	ebx, r12d
	xor	ebx, eax
	and	ebx, r13d
	test	r13d, r12d
	je	.L6
.L30:
	mov	ebp, DWORD PTR 12[rsp]
	mov	eax, DWORD PTR AHB_ADDR_LSB[rip]
	mov	edx, ebx
	mov	rdi, r14
	mov	esi, DWORD PTR KR_AHB_TRANS[rip]
	sal	ebp, 6
	lea	ecx, 1[rax]
	or	r15d, ebp
	sal	r15d, cl
	mov	ecx, DWORD PTR AHB_DATA_LSB[rip]
	or	r15d, DWORD PTR AHB_WR[rip]
	sal	edx, cl
	or	edx, r15d
	call	qib_write_kreg@PLT
	mov	edx, DWORD PTR AHB_TRANS_TRIES[rip]
	cmp	edx, 1
	jle	.L17
	mov	ebp, 1
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L32:
	mov	edx, DWORD PTR AHB_TRANS_TRIES[rip]
	add	ebp, 1
	cmp	edx, ebp
	jle	.L17
.L16:
	mov	esi, DWORD PTR KR_AHB_TRANS[rip]
	mov	rdi, r14
	call	qib_read_kreg64@PLT
	test	DWORD PTR AHB_TRANS_RDY[rip], eax
	je	.L32
	mov	edx, DWORD PTR AHB_TRANS_TRIES[rip]
	cmp	edx, ebp
	jg	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	lea	rsi, .LC2[rip]
	mov	rdi, r14
	mov	ebx, 195890093
	call	qib_dev_err@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	mov	edx, r8d
	lea	rsi, .LC0[rip]
	mov	rdi, r14
	mov	ebx, 195890093
	call	qib_dev_err@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L18:
	mov	edx, r8d
	lea	rsi, .LC1[rip]
	mov	rdi, r14
	mov	ebx, 195890093
	call	qib_dev_err@PLT
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	ahb_mod, .-ahb_mod
	.comm	KR_AHB_TRANS,4,4
	.comm	KR_AHB_ACC,4,4
	.comm	AHB_WR,4,4
	.comm	AHB_TRANS_TRIES,4,4
	.comm	AHB_TRANS_RDY,4,4
	.comm	AHB_DATA_LSB,4,4
	.comm	AHB_ADDR_LSB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_qib_iba7322.c_ahb_mod.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"No ahb_rdy in %d tries\012\000"
	.align	2
.LC1:
	.ascii	"No Rd ahb_rdy in %d tries\012\000"
	.align	2
.LC2:
	.ascii	"No Wr ahb_rdy in %d tries\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ahb_mod, %function
ahb_mod:
	@ args = 8, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r10, .L33
	sub	sp, sp, #12
	mov	r8, r1
	ldr	r1, [r10]
	stm	sp, {r2, r3}
	mov	r4, r0
	bl	qib_read_kreg64
	ldr	r5, .L33+4
	lsl	r2, r8, #1
	orr	r2, r2, #1
	mov	fp, r0
	ldr	r1, [r10]
	mov	r0, r4
	bl	qib_write_kreg
	ldr	r2, [r5]
	cmp	r2, #1
	ble	.L19
	mov	r9, #1
	ldr	r6, .L33+8
	ldr	r7, .L33+12
	b	.L4
.L29:
	add	r9, r9, #1
	cmp	r2, r9
	ble	.L19
.L4:
	mov	r0, r4
	ldr	r1, [r6]
	bl	qib_read_kreg64
	ldr	r3, [r7]
	ldr	r2, [r5]
	tst	r0, r3
	beq	.L29
	cmp	r2, r9
	ble	.L19
	cmp	r8, #1
	ldr	r9, .L33+16
	mvneq	r9, #0
	ldr	r3, [sp, #52]
	bics	r3, r9, r3
	bne	.L8
	ldr	r3, [sp, #48]
	ldr	r2, [sp, #52]
	and	r8, r3, r2
	ldr	r3, [sp, #52]
	and	r8, r8, r9
	tst	r9, r3
	bne	.L30
.L6:
	mov	r2, fp
	mov	r0, r4
	ldr	r1, [r10]
	bl	qib_write_kreg
	mov	r0, r8
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L8:
	ldr	r3, .L33+20
	ldm	sp, {r1, r2}
	ldr	r3, [r3]
	orr	r2, r2, r1, lsl #6
	add	r3, r3, #1
	lsl	r2, r2, r3
	mov	r0, r4
	ldr	r1, [r6]
	bl	qib_write_kreg
	ldr	r2, [r5]
	cmp	r2, #1
	ble	.L18
	mov	r8, #1
	b	.L12
.L31:
	add	r8, r8, #1
	cmp	r2, r8
	ble	.L18
.L12:
	mov	r0, r4
	ldr	r1, [r6]
	bl	qib_read_kreg64
	ldr	r3, [r7]
	ldr	r2, [r5]
	tst	r0, r3
	beq	.L31
	cmp	r2, r8
	ble	.L18
	mov	r0, r4
	ldr	r1, [r6]
	bl	qib_read_kreg64
	ldr	r3, .L33+24
	ldr	r8, [r3]
	ldr	r3, [sp, #48]
	asr	r0, r0, r8
	eor	r8, r3, r0
	ldr	r3, [sp, #52]
	and	r8, r8, r3
	ldr	r3, [sp, #52]
	eor	r8, r8, r0
	tst	r9, r3
	and	r8, r8, r9
	beq	.L6
.L30:
	ldr	r2, .L33+20
	ldr	r3, .L33+28
	ldr	r0, [r2]
	ldr	r1, [r3]
	ldm	sp, {r2, r3}
	orr	r3, r3, r2, lsl #6
	ldr	r2, .L33+24
	add	r0, r0, #1
	ldr	r2, [r2]
	orr	r3, r1, r3, lsl r0
	orr	r2, r3, r8, lsl r2
	mov	r0, r4
	ldr	r1, [r6]
	bl	qib_write_kreg
	ldr	r2, [r5]
	cmp	r2, #1
	ble	.L17
	mov	r9, #1
	b	.L16
.L32:
	add	r9, r9, #1
	cmp	r2, r9
	ble	.L17
.L16:
	mov	r0, r4
	ldr	r1, [r6]
	bl	qib_read_kreg64
	ldr	r3, [r7]
	ldr	r2, [r5]
	tst	r0, r3
	beq	.L32
	cmp	r2, r9
	bgt	.L6
.L17:
	mov	r0, r4
	ldr	r1, .L33+32
	bl	qib_dev_err
	ldr	r8, .L33+36
	b	.L6
.L19:
	mov	r0, r4
	ldr	r1, .L33+40
	bl	qib_dev_err
	ldr	r8, .L33+36
	b	.L6
.L18:
	mov	r0, r4
	ldr	r1, .L33+44
	bl	qib_dev_err
	ldr	r8, .L33+36
	b	.L6
.L34:
	.align	2
.L33:
	.word	KR_AHB_ACC
	.word	AHB_TRANS_TRIES
	.word	KR_AHB_TRANS
	.word	AHB_TRANS_RDY
	.word	65535
	.word	AHB_ADDR_LSB
	.word	AHB_DATA_LSB
	.word	AHB_WR
	.word	.LC2
	.word	195890093
	.word	.LC0
	.word	.LC1
	.size	ahb_mod, .-ahb_mod
	.comm	KR_AHB_TRANS,4,4
	.comm	KR_AHB_ACC,4,4
	.comm	AHB_WR,4,4
	.comm	AHB_TRANS_TRIES,4,4
	.comm	AHB_TRANS_RDY,4,4
	.comm	AHB_DATA_LSB,4,4
	.comm	AHB_ADDR_LSB,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
