	.file	"extr_aha1542.c_setup_mailboxes.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"failed setting up mailboxes\n"
	.text
	.p2align 4
	.type	setup_mailboxes, @function
setup_mailboxes:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 40
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	shost_priv@PLT
	mov	DWORD PTR 16[rsp], 0
	mov	QWORD PTR 8[rsp], 0
	mov	r12, rax
	mov	eax, DWORD PTR CMD_MBINIT[rip]
	mov	DWORD PTR [rsp], eax
	mov	eax, DWORD PTR AHA1542_MAILBOXES[rip]
	mov	DWORD PTR 4[rsp], eax
	test	eax, eax
	jle	.L6
	mov	rax, QWORD PTR 8[r12]
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rdx, rbx
	sal	rdx, 4
	add	rax, rdx
	mov	rdx, QWORD PTR 16[r12]
	mov	QWORD PTR 8[rax], 0
	mov	rdi, QWORD PTR [rax]
	lea	rsi, [rdx+rbx*4]
	call	any2scsi@PLT
	mov	ecx, DWORD PTR AHA1542_MAILBOXES[rip]
	mov	rax, QWORD PTR 8[r12]
	lea	edx, [rcx+rbx]
	add	rbx, 1
	movsx	rdx, edx
	sal	rdx, 4
	mov	QWORD PTR 8[rax+rdx], 0
	cmp	ecx, ebx
	jg	.L5
.L6:
	mov	edi, DWORD PTR 0[rbp]
	mov	r13, rsp
	call	aha1542_intr_reset@PLT
	mov	rsi, QWORD PTR [r12]
	lea	rdi, 8[rsp]
	call	any2scsi@PLT
	mov	edi, DWORD PTR 0[rbp]
	mov	edx, 5
	mov	rsi, r13
	call	aha1542_out@PLT
	test	rax, rax
	jne	.L11
.L4:
	mov	edi, DWORD PTR 0[rbp]
	call	aha1542_intr_reset@PLT
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L12
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	edi, DWORD PTR KERN_ERR[rip]
	lea	rdx, .LC0[rip]
	mov	rsi, rbp
	call	shost_printk@PLT
	jmp	.L4
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	setup_mailboxes, .-setup_mailboxes
	.comm	KERN_ERR,4,4
	.comm	CMD_MBINIT,4,4
	.comm	AHA1542_MAILBOXES,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_aha1542.c_setup_mailboxes.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"failed setting up mailboxes\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	setup_mailboxes, %function
setup_mailboxes:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L13
	mov	r4, #0
	sub	sp, sp, #24
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	mov	r7, r0
	bl	shost_priv
	ldr	r8, .L13+4
	ldr	r2, .L13+8
	ldr	r3, [r8]
	ldr	r2, [r2]
	cmp	r3, r4
	stm	sp, {r2, r3, r4}
	mov	r5, r0
	movgt	r6, r4
	ldrgt	r3, [r0, #4]
	str	r4, [sp, #12]
	str	r4, [sp, #16]
	ble	.L6
.L5:
	ldr	r1, [r5, #8]
	add	r2, r3, r4, lsl #3
	ldr	r0, [r3, r4, lsl #3]
	add	r1, r1, r4, lsl #2
	str	r6, [r2, #4]
	bl	any2scsi
	ldr	r1, [r8]
	ldr	r3, [r5, #4]
	add	r2, r1, r4
	add	r4, r4, #1
	add	r2, r3, r2, lsl #3
	cmp	r1, r4
	str	r6, [r2, #4]
	bgt	.L5
.L6:
	ldr	r0, [r7]
	bl	aha1542_intr_reset
	ldr	r1, [r5]
	add	r0, sp, #8
	bl	any2scsi
	mov	r1, sp
	mov	r2, #5
	ldr	r0, [r7]
	bl	aha1542_out
	cmp	r0, #0
	bne	.L11
.L4:
	ldr	r0, [r7]
	bl	aha1542_intr_reset
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L11:
	ldr	r3, .L13+12
	mov	r1, r7
	ldr	r2, .L13+16
	ldr	r0, [r3]
	bl	shost_printk
	b	.L4
.L12:
	bl	__stack_chk_fail
.L14:
	.align	2
.L13:
	.word	.LC1
	.word	AHA1542_MAILBOXES
	.word	CMD_MBINIT
	.word	KERN_ERR
	.word	.LC0
	.size	setup_mailboxes, .-setup_mailboxes
	.comm	KERN_ERR,4,4
	.comm	CMD_MBINIT,4,4
	.comm	AHA1542_MAILBOXES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
