	.file	"extr_nsp32.c_nsp32_busfree_occur.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"enter execph=0x%x"
.LC1:
	.string	"MsgIn02_Valid"
.LC2:
	.string	"command complete"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC3:
	.string	"normal end stat=0x%x resid=0x%x\n"
	.section	.rodata.str1.1
.LC4:
	.string	"disconnect"
.LC5:
	.string	"unexpected bus free occurred"
	.text
	.p2align 4
	.type	nsp32_busfree_occur, @function
nsp32_busfree_occur:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	movzx	r14d, si
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	edx, r14d
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rax, QWORD PTR 16[rdi]
	mov	ebx, esi
	lea	rsi, .LC0[rip]
	mov	edi, DWORD PTR NSP32_DEBUG_BUSFREE[rip]
	mov	rax, QWORD PTR [rax]
	mov	r12d, DWORD PTR [rax]
	mov	r13, QWORD PTR 8[rax]
	xor	eax, eax
	call	nsp32_dbg@PLT
	mov	edi, r14d
	call	show_autophase@PLT
	mov	esi, DWORD PTR BM_CNT[rip]
	xor	edx, edx
	mov	edi, r12d
	call	nsp32_write4@PLT
	mov	esi, DWORD PTR TRANSFER_CONTROL[rip]
	xor	edx, edx
	mov	edi, r12d
	call	nsp32_write2@PLT
	test	WORD PTR MSGIN_02_VALID[rip], bx
	jne	.L24
.L3:
	mov	rsi, QWORD PTR 0[r13]
	mov	edx, DWORD PTR [rsi]
	test	DWORD PTR SDTR_INITIATOR[rip], edx
	jne	.L25
	mov	eax, DWORD PTR SDTR_TARGET[rip]
	movzx	ecx, WORD PTR MSGIN_00_VALID[rip]
	test	edx, eax
	je	.L8
	movzx	edi, WORD PTR MSGIN_04_VALID[rip]
	or	edi, ecx
	test	di, bx
	je	.L26
.L9:
	not	eax
	and	eax, edx
	mov	DWORD PTR [rsi], eax
	or	eax, DWORD PTR SDTR_DONE[rip]
	mov	DWORD PTR [rsi], eax
.L8:
	test	cx, bx
	jne	.L27
.L10:
	test	WORD PTR MSGIN_04_VALID[rip], bx
	jne	.L28
	mov	edi, DWORD PTR KERN_WARNING[rip]
	lea	rsi, .LC5[rip]
	call	nsp32_msg@PLT
	mov	eax, DWORD PTR DID_ERROR[rip]
	mov	rdi, rbp
	sal	eax, 16
	mov	DWORD PTR 0[rbp], eax
	call	nsp32_scsi_done@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR TRUE[rip]
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	mov	esi, DWORD PTR SCSI_CSB_IN[rip]
	mov	edi, r12d
	call	nsp32_read1@PLT
	mov	DWORD PTR 8[rbp], 4
	mov	edi, DWORD PTR NSP32_DEBUG_BUSFREE[rip]
	lea	rsi, .LC4[rip]
	mov	DWORD PTR 4[rbp], eax
	xor	eax, eax
	call	nsp32_dbg@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR TRUE[rip]
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L25:
	.cfi_restore_state
	mov	rdi, r13
	call	nsp32_set_async@PLT
	mov	rdx, QWORD PTR 0[r13]
	mov	eax, DWORD PTR SDTR_INITIATOR[rip]
	movzx	ecx, WORD PTR MSGIN_00_VALID[rip]
	not	eax
	and	eax, DWORD PTR [rdx]
	mov	DWORD PTR [rdx], eax
	or	eax, DWORD PTR SDTR_DONE[rip]
	mov	DWORD PTR [rdx], eax
	test	cx, bx
	je	.L10
.L27:
	mov	edi, DWORD PTR NSP32_DEBUG_BUSFREE[rip]
	lea	rsi, .LC2[rip]
	xor	eax, eax
	call	nsp32_dbg@PLT
	mov	esi, DWORD PTR SCSI_CSB_IN[rip]
	mov	edi, r12d
	call	nsp32_read1@PLT
	mov	DWORD PTR 8[rbp], 0
	mov	rdi, rbp
	mov	DWORD PTR 4[rbp], eax
	call	scsi_get_resid@PLT
	mov	edx, DWORD PTR 4[rbp]
	mov	edi, DWORD PTR NSP32_DEBUG_BUSFREE[rip]
	lea	rsi, .LC3[rip]
	mov	ecx, eax
	xor	eax, eax
	call	nsp32_dbg@PLT
	mov	eax, DWORD PTR DID_OK[rip]
	mov	edx, DWORD PTR 8[rbp]
	mov	rdi, rbp
	sal	edx, 8
	sal	eax, 16
	or	eax, DWORD PTR 4[rbp]
	or	eax, edx
	mov	DWORD PTR 0[rbp], eax
	call	nsp32_scsi_done@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, DWORD PTR TRUE[rip]
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	mov	edi, DWORD PTR NSP32_DEBUG_BUSFREE[rip]
	xor	eax, eax
	lea	rsi, .LC1[rip]
	call	nsp32_dbg@PLT
	test	WORD PTR MSGIN_00_VALID[rip], bx
	jne	.L3
	movzx	eax, WORD PTR DATA_IN_PHASE[rip]
	or	ax, WORD PTR DATA_OUT_PHASE[rip]
	test	ax, bx
	je	.L3
	mov	esi, DWORD PTR SACK_CNT[rip]
	mov	edi, r12d
	call	nsp32_read4@PLT
	mov	esi, DWORD PTR SAVED_SACK_CNT[rip]
	mov	edi, r12d
	mov	r14d, eax
	call	nsp32_read4@PLT
	mov	esi, eax
	test	eax, eax
	je	.L3
	mov	rax, QWORD PTR 8[r13]
	cmp	r14d, esi
	je	.L5
	mov	edx, DWORD PTR FALSE[rip]
	mov	DWORD PTR [rax], edx
.L6:
	mov	rdi, rbp
	call	nsp32_adjust_busfree@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L26:
	mov	rdi, r13
	call	nsp32_set_async@PLT
	mov	rsi, QWORD PTR 0[r13]
	mov	eax, DWORD PTR SDTR_TARGET[rip]
	movzx	ecx, WORD PTR MSGIN_00_VALID[rip]
	mov	edx, DWORD PTR [rsi]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edx, DWORD PTR TRUE[rip]
	mov	DWORD PTR [rax], edx
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	nsp32_busfree_occur, .-nsp32_busfree_occur
	.comm	TRUE,4,4
	.comm	TRANSFER_CONTROL,4,4
	.comm	SDTR_TARGET,4,4
	.comm	SDTR_INITIATOR,4,4
	.comm	SDTR_DONE,4,4
	.comm	SCSI_CSB_IN,4,4
	.comm	SAVED_SACK_CNT,4,4
	.comm	SACK_CNT,4,4
	.comm	NSP32_DEBUG_BUSFREE,4,4
	.comm	MSGIN_04_VALID,2,2
	.comm	MSGIN_03_VALID,2,2
	.comm	MSGIN_02_VALID,2,2
	.comm	MSGIN_00_VALID,2,2
	.comm	KERN_WARNING,4,4
	.comm	FALSE,4,4
	.comm	DID_OK,4,4
	.comm	DID_ERROR,4,4
	.comm	DATA_OUT_PHASE,2,2
	.comm	DATA_IN_PHASE,2,2
	.comm	BM_CNT,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_nsp32.c_nsp32_busfree_occur.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"enter execph=0x%x\000"
	.align	2
.LC1:
	.ascii	"MsgIn02_Valid\000"
	.align	2
.LC2:
	.ascii	"command complete\000"
	.align	2
.LC3:
	.ascii	"normal end stat=0x%x resid=0x%x\012\000"
	.align	2
.LC4:
	.ascii	"disconnect\000"
	.align	2
.LC5:
	.ascii	"unexpected bus free occurred\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nsp32_busfree_occur, %function
nsp32_busfree_occur:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r1
	ldr	r3, [r0, #12]
	ldr	r7, .L30
	ldr	r3, [r3]
	mov	r2, r1
	ldm	r3, {r6, r9}
	ldr	r1, .L30+4
	mov	r5, r0
	ldr	r0, [r7]
	bl	nsp32_dbg
	mov	r0, r4
	bl	show_autophase
	ldr	r3, .L30+8
	mov	r2, #0
	ldr	r1, [r3]
	mov	r0, r6
	bl	nsp32_write4
	ldr	r3, .L30+12
	mov	r0, r6
	ldr	r1, [r3]
	mov	r2, #0
	bl	nsp32_write2
	ldr	r3, .L30+16
	ldr	r10, .L30+20
	ldrh	r3, [r3]
	tst	r4, r3
	bne	.L2
.L25:
	ldr	r8, .L30+24
.L3:
	ldr	r1, [r9]
	ldr	fp, .L30+28
	ldr	r3, [r1]
	ldr	r2, [fp]
	tst	r3, r2
	bne	.L27
	ldr	fp, .L30+32
	ldrh	r2, [r10]
	ldr	r0, [fp]
	tst	r3, r0
	beq	.L8
	ldr	ip, .L30+36
	ldrh	ip, [ip]
	orr	ip, r2, ip
	tst	r4, ip
	beq	.L28
.L9:
	bic	r3, r3, r0
	ldr	r0, .L30+40
	str	r3, [r1]
	ldr	r0, [r0]
	orr	r3, r0, r3
	str	r3, [r1]
.L8:
	tst	r4, r2
	bne	.L29
.L10:
	ldr	r3, .L30+36
	ldrh	r3, [r3]
	tst	r4, r3
	beq	.L12
	ldr	r3, .L30+44
	mov	r0, r6
	ldr	r1, [r3]
	bl	nsp32_read1
	mov	r3, #4
	str	r0, [r5, #4]
	ldr	r1, .L30+48
	ldr	r0, [r7]
	str	r3, [r5, #8]
	bl	nsp32_dbg
	ldr	r0, [r8]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	ldr	r3, .L30+52
	ldr	r1, .L30+56
	ldr	r0, [r3]
	bl	nsp32_msg
	ldr	r3, .L30+60
	mov	r0, r5
	ldr	r3, [r3]
	lsl	r3, r3, #16
	str	r3, [r5]
	bl	nsp32_scsi_done
	ldr	r0, [r8]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L27:
	mov	r0, r9
	bl	nsp32_set_async
	ldr	r1, [r9]
	ldr	r0, [fp]
	ldr	r3, [r1]
	ldr	r2, .L30+40
	bic	r3, r3, r0
	str	r3, [r1]
	ldr	r0, [r2]
	ldrh	r2, [r10]
	orr	r3, r0, r3
	tst	r4, r2
	str	r3, [r1]
	beq	.L10
.L29:
	ldr	r1, .L30+64
	ldr	r0, [r7]
	bl	nsp32_dbg
	ldr	r3, .L30+44
	mov	r0, r6
	ldr	r1, [r3]
	bl	nsp32_read1
	mov	r3, #0
	mov	r4, r0
	str	r0, [r5, #4]
	str	r3, [r5, #8]
	mov	r0, r5
	ldr	r6, [r7]
	bl	scsi_get_resid
	mov	r2, r4
	mov	r3, r0
	ldr	r1, .L30+68
	mov	r0, r6
	bl	nsp32_dbg
	ldr	r2, .L30+72
	ldr	r3, [r5, #4]
	ldr	r1, [r2]
	ldr	r2, [r5, #8]
	orr	r3, r3, r1, lsl #16
	orr	r3, r3, r2, lsl #8
	mov	r0, r5
	str	r3, [r5]
	bl	nsp32_scsi_done
	ldr	r0, [r8]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r1, .L30+76
	ldr	r0, [r7]
	bl	nsp32_dbg
	ldrh	r3, [r10]
	tst	r4, r3
	bne	.L25
	ldr	r3, .L30+80
	ldr	r2, .L30+84
	ldrh	r3, [r3]
	ldrh	r2, [r2]
	orr	r3, r3, r2
	tst	r4, r3
	beq	.L25
	ldr	r3, .L30+88
	mov	r0, r6
	ldr	r1, [r3]
	bl	nsp32_read4
	ldr	r3, .L30+92
	mov	r8, r0
	ldr	r1, [r3]
	mov	r0, r6
	bl	nsp32_read4
	subs	r1, r0, #0
	beq	.L25
	cmp	r8, r1
	ldrne	r2, .L30+96
	ldreq	r8, .L30+24
	ldr	r3, [r9, #4]
	ldrne	r2, [r2]
	ldreq	r2, [r8]
	mov	r0, r5
	str	r2, [r3]
	ldrne	r8, .L30+24
	bl	nsp32_adjust_busfree
	b	.L3
.L28:
	mov	r0, r9
	bl	nsp32_set_async
	ldr	r1, [r9]
	ldr	r0, [fp]
	ldrh	r2, [r10]
	ldr	r3, [r1]
	b	.L9
.L31:
	.align	2
.L30:
	.word	NSP32_DEBUG_BUSFREE
	.word	.LC0
	.word	BM_CNT
	.word	TRANSFER_CONTROL
	.word	MSGIN_02_VALID
	.word	MSGIN_00_VALID
	.word	TRUE
	.word	SDTR_INITIATOR
	.word	SDTR_TARGET
	.word	MSGIN_04_VALID
	.word	SDTR_DONE
	.word	SCSI_CSB_IN
	.word	.LC4
	.word	KERN_WARNING
	.word	.LC5
	.word	DID_ERROR
	.word	.LC2
	.word	.LC3
	.word	DID_OK
	.word	.LC1
	.word	DATA_IN_PHASE
	.word	DATA_OUT_PHASE
	.word	SACK_CNT
	.word	SAVED_SACK_CNT
	.word	FALSE
	.size	nsp32_busfree_occur, .-nsp32_busfree_occur
	.comm	TRUE,4,4
	.comm	TRANSFER_CONTROL,4,4
	.comm	SDTR_TARGET,4,4
	.comm	SDTR_INITIATOR,4,4
	.comm	SDTR_DONE,4,4
	.comm	SCSI_CSB_IN,4,4
	.comm	SAVED_SACK_CNT,4,4
	.comm	SACK_CNT,4,4
	.comm	NSP32_DEBUG_BUSFREE,4,4
	.comm	MSGIN_04_VALID,2,2
	.comm	MSGIN_03_VALID,2,2
	.comm	MSGIN_02_VALID,2,2
	.comm	MSGIN_00_VALID,2,2
	.comm	KERN_WARNING,4,4
	.comm	FALSE,4,4
	.comm	DID_OK,4,4
	.comm	DID_ERROR,4,4
	.comm	DATA_OUT_PHASE,2,2
	.comm	DATA_IN_PHASE,2,2
	.comm	BM_CNT,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
