	.file	"extr_nsp32.c_nsp32_adjust_busfree.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"old resid=0x%x"
.LC1:
	.string	"resid underflow"
.LC2:
	.string	"new resid=0x%x"
	.text
	.p2align 4
	.type	nsp32_adjust_busfree, @function
nsp32_adjust_busfree:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, esi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR [rdi]
	mov	QWORD PTR 24[rsp], rdi
	mov	rax, QWORD PTR [rax]
	mov	DWORD PTR 20[rsp], esi
	mov	rax, QWORD PTR [rax]
	movsx	rbx, DWORD PTR [rax]
	mov	QWORD PTR 8[rsp], rax
	mov	rax, QWORD PTR 8[rax]
	mov	r15, rbx
	sal	rbx, 4
	mov	ebp, DWORD PTR [rax]
	mov	rax, QWORD PTR 8[rax]
	mov	r12, QWORD PTR [rax]
	call	scsi_get_resid@PLT
	mov	edi, DWORD PTR NSP32_DEBUG_SGLIST[rip]
	lea	rsi, .LC0[rip]
	mov	edx, eax
	add	rbx, r12
	call	nsp32_dbg@PLT
	mov	rdi, QWORD PTR 8[rbx]
	call	le32_to_cpu@PLT
	and	eax, 3
	mov	DWORD PTR 16[rsp], eax
	sub	r14d, eax
	cmp	r15d, ebp
	jge	.L2
	mov	r12d, r14d
	mov	r13, rbx
	xor	r14d, r14d
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L14:
	add	r15d, 1
	add	r13, 16
	cmp	ebp, r15d
	je	.L13
.L4:
	mov	rdi, QWORD PTR 0[r13]
	mov	rbx, r13
	call	le32_to_cpu@PLT
	mov	r9d, eax
	mov	eax, DWORD PTR SGTEND[rip]
	not	eax
	and	eax, r9d
	add	r14d, eax
	cmp	r12d, r14d
	jnb	.L14
.L3:
	mov	rdi, QWORD PTR [rbx]
	mov	eax, DWORD PTR 16[rsp]
	sub	eax, DWORD PTR 20[rsp]
	add	r14d, eax
	call	le32_to_cpu@PLT
	mov	rdi, QWORD PTR 8[rbx]
	mov	ebp, eax
	call	le32_to_cpu@PLT
	lea	edi, 0[rbp+rax]
	sub	edi, r14d
	call	cpu_to_le32@PLT
	mov	edi, r14d
	mov	QWORD PTR 8[rbx], rax
	call	cpu_to_le32@PLT
	mov	QWORD PTR [rbx], rax
	mov	rax, QWORD PTR 8[rsp]
	mov	DWORD PTR [rax], r15d
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L13:
	.cfi_restore_state
	mov	rdi, QWORD PTR 24[rsp]
	call	scsi_get_resid@PLT
	cmp	eax, r14d
	jb	.L15
.L6:
	mov	rbx, QWORD PTR 24[rsp]
	mov	rdi, rbx
	call	scsi_get_resid@PLT
	mov	rdi, rbx
	sub	eax, r14d
	mov	esi, eax
	call	scsi_set_resid@PLT
	mov	rdi, rbx
	call	scsi_get_resid@PLT
	mov	edi, DWORD PTR NSP32_DEBUG_SGLIST[rip]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	lea	rsi, .LC2[rip]
	pop	rbx
	.cfi_def_cfa_offset 48
	mov	edx, eax
	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
	jmp	nsp32_dbg@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	mov	edi, DWORD PTR KERN_ERR[rip]
	lea	rsi, .LC1[rip]
	call	nsp32_msg@PLT
	jmp	.L6
.L2:
	je	.L8
	xor	r14d, r14d
	jmp	.L3
.L8:
	mov	rdi, QWORD PTR 24[rsp]
	xor	r14d, r14d
	call	scsi_get_resid@PLT
	jmp	.L6
	.cfi_endproc
.LFE0:
	.size	nsp32_adjust_busfree, .-nsp32_adjust_busfree
	.comm	SGTEND,4,4
	.comm	NSP32_DEBUG_SGLIST,4,4
	.comm	KERN_ERR,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_adjust_busfree.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"old resid=0x%x\000"
	.align	2
.LC1:
	.ascii	"resid underflow\000"
	.align	2
.LC2:
	.ascii	"new resid=0x%x\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	nsp32_adjust_busfree, %function
nsp32_adjust_busfree:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, [r0]
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, [r3]
	ldr	r2, .L17
	sub	sp, sp, #20
	ldr	r8, [r2]
	ldr	r2, [r3]
	mov	r5, r1
	ldr	r3, [r2, #4]
	ldr	r4, [r2]
	str	r2, [sp]
	ldr	r2, [r3, #4]
	ldr	r7, [r3]
	ldr	r6, [r2]
	str	r1, [sp, #8]
	str	r0, [sp, #12]
	bl	scsi_get_resid
	add	r9, r6, r4, lsl #3
	mov	r2, r0
	ldr	r1, .L17+4
	mov	r0, r8
	bl	nsp32_dbg
	ldr	r0, [r9, #4]
	bl	le32_to_cpu
	cmp	r4, r7
	and	r3, r0, #3
	str	r3, [sp, #4]
	sub	r8, r5, r3
	bge	.L2
	mov	r5, #0
	ldr	fp, .L17+8
	lsl	r10, r4, #3
	b	.L4
.L15:
	add	r4, r4, #1
	cmp	r7, r4
	beq	.L10
	lsl	r10, r4, #3
.L4:
	ldr	r0, [r6, r4, lsl #3]
	bl	le32_to_cpu
	ldr	r3, [fp]
	add	r10, r6, r10
	bic	r0, r0, r3
	add	r5, r5, r0
	cmp	r8, r5
	bcs	.L15
	mov	r9, r10
.L3:
	ldr	r2, [sp, #8]
	ldr	r3, [sp, #4]
	ldr	r0, [r9]
	sub	r3, r3, r2
	add	r5, r3, r5
	bl	le32_to_cpu
	mov	r6, r0
	ldr	r0, [r9, #4]
	bl	le32_to_cpu
	add	r0, r6, r0
	sub	r0, r0, r5
	bl	cpu_to_le32
	mov	r2, r0
	mov	r0, r5
	str	r2, [r9, #4]
	bl	cpu_to_le32
	ldr	r3, [sp]
	str	r0, [r9]
	str	r4, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	ldr	r0, [sp, #12]
	bl	scsi_get_resid
	cmp	r0, r5
	bcc	.L16
.L6:
	ldr	r6, [sp, #12]
	mov	r0, r6
	bl	scsi_get_resid
	mov	r1, r0
	mov	r0, r6
	sub	r1, r1, r5
	bl	scsi_set_resid
	ldr	r3, .L17
	mov	r0, r6
	ldr	r4, [r3]
	bl	scsi_get_resid
	mov	r2, r0
	mov	r0, r4
	ldr	r1, .L17+12
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	nsp32_dbg
.L16:
	ldr	r3, .L17+16
	ldr	r1, .L17+20
	ldr	r0, [r3]
	bl	nsp32_msg
	b	.L6
.L2:
	movne	r5, #0
	bne	.L3
	ldr	r0, [sp, #12]
	bl	scsi_get_resid
	mov	r5, #0
	b	.L6
.L18:
	.align	2
.L17:
	.word	NSP32_DEBUG_SGLIST
	.word	.LC0
	.word	SGTEND
	.word	.LC2
	.word	KERN_ERR
	.word	.LC1
	.size	nsp32_adjust_busfree, .-nsp32_adjust_busfree
	.comm	SGTEND,4,4
	.comm	NSP32_DEBUG_SGLIST,4,4
	.comm	KERN_ERR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
