	.file	"extr_ene_ub6250.c_ms_scsi_read.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Load MPS RW pattern Fail !!\n"
.LC1:
	.string	"Load MS RW pattern Fail !!\n"
.LC2:
	.string	"MS_SCSI_Read --- result = %x\n"
	.text
	.p2align 4
	.type	ms_scsi_read, @function
ms_scsi_read:
.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
	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 [rsi]
	mov	r14, QWORD PTR [rdi]
	mov	QWORD PTR 16[rsp], rsi
	mov	edx, DWORD PTR 2[rax]
	bswap	edx
	cmp	DWORD PTR [r14], edx
	jl	.L13
	movzx	r8d, WORD PTR 7[rax]
	mov	rbp, QWORD PTR 8[rdi]
	mov	r12, rdi
	mov	r15d, edx
	rol	r8w, 8
	movzx	r13d, r8w
	mov	eax, r13d
	sal	eax, 9
	cmp	QWORD PTR 8[r14], 0
	mov	DWORD PTR 28[rsp], eax
	jne	.L15
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	edi, DWORD PTR 28[rsp]
	call	kmalloc@PLT
	mov	QWORD PTR 8[rsp], rax
	test	rax, rax
	je	.L13
	mov	esi, DWORD PTR MS_RW_PATTERN[rip]
	mov	rdi, r12
	call	ene_load_bincode@PLT
	cmp	DWORD PTR USB_STOR_XFER_GOOD[rip], eax
	jne	.L16
	mov	eax, r15d
	mov	ebx, DWORD PTR 4[r14]
	mov	DWORD PTR 4[rsp], 0
	cdq
	idiv	ebx
	mov	r15d, eax
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L9:
	sub	r13d, ebx
	test	r13d, r13d
	jle	.L10
	imul	ebx, DWORD PTR MS_BYTES_PER_PAGE[rip]
	add	DWORD PTR 4[rsp], ebx
	add	r15d, 1
	xor	edx, edx
	mov	ebx, DWORD PTR 4[r14]
.L11:
	sub	ebx, edx
	mov	esi, r15d
	mov	rdi, r14
	mov	DWORD PTR 24[rsp], edx
	cmp	ebx, r13d
	cmovg	ebx, r13d
	call	ms_libconv_to_physical@PLT
	mov	edx, DWORD PTR 24[rsp]
	xor	esi, esi
	mov	rdi, rbp
	sal	eax, 5
	lea	ecx, [rax+rdx]
	mov	edx, 32
	mov	DWORD PTR 24[rsp], ecx
	call	memset@PLT
	mov	edi, DWORD PTR US_BULK_CB_SIGN[rip]
	call	cpu_to_le32@PLT
	mov	ecx, DWORD PTR 24[rsp]
	mov	rdi, r12
	movabs	rsi, 8589934833
	mov	QWORD PTR 24[rbp], rax
	mov	eax, ebx
	sal	eax, 9
	movzx	edx, cl
	mov	DWORD PTR 0[rbp], eax
	mov	rax, QWORD PTR US_BULK_FLAG_IN[rip]
	mov	QWORD PTR 16[rbp], rax
	mov	rax, QWORD PTR 8[rbp]
	mov	DWORD PTR 20[rax], edx
	movzx	edx, ch
	mov	DWORD PTR 16[rax], edx
	mov	edx, ecx
	shr	ecx, 24
	sar	edx, 16
	mov	QWORD PTR [rax], rsi
	mov	esi, DWORD PTR FDIR_READ[rip]
	and	edx, 255
	mov	DWORD PTR 8[rax], ecx
	xor	ecx, ecx
	mov	DWORD PTR 12[rax], edx
	movsx	rdx, DWORD PTR 4[rsp]
	add	rdx, QWORD PTR 8[rsp]
	call	ene_send_scsi_cmd@PLT
	cmp	DWORD PTR USB_STOR_XFER_GOOD[rip], eax
	je	.L9
	mov	esi, eax
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	pr_info@PLT
	mov	r11d, DWORD PTR USB_STOR_TRANSPORT_ERROR[rip]
.L8:
	mov	rdi, QWORD PTR 8[rsp]
	mov	DWORD PTR 4[rsp], r11d
	call	kfree@PLT
	mov	r11d, DWORD PTR 4[rsp]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	mov	esi, DWORD PTR MSP_RW_PATTERN[rip]
	call	ene_load_bincode@PLT
	cmp	DWORD PTR USB_STOR_XFER_GOOD[rip], eax
	je	.L5
	lea	rsi, .LC0[rip]
	mov	rdi, r12
	call	usb_stor_dbg@PLT
.L13:
	mov	r11d, DWORD PTR USB_STOR_TRANSPORT_ERROR[rip]
.L1:
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r11d
	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
.L5:
	.cfi_restore_state
	xor	esi, esi
	mov	edx, 32
	mov	rdi, rbp
	call	memset@PLT
	mov	edi, DWORD PTR US_BULK_CB_SIGN[rip]
	call	cpu_to_le32@PLT
	mov	ecx, r15d
	movzx	edx, r15b
	movabs	rdi, 8589934833
	mov	QWORD PTR 24[rbp], rax
	mov	eax, DWORD PTR 28[rsp]
	mov	DWORD PTR 0[rbp], eax
	mov	rax, QWORD PTR US_BULK_FLAG_IN[rip]
	mov	QWORD PTR 16[rbp], rax
	mov	rax, QWORD PTR 8[rbp]
	mov	DWORD PTR 20[rax], edx
	movzx	edx, ch
	mov	DWORD PTR 16[rax], edx
	mov	edx, r15d
	sar	edx, 16
	mov	QWORD PTR [rax], rdi
	mov	rdi, QWORD PTR 16[rsp]
	and	edx, 255
	mov	DWORD PTR 12[rax], edx
	mov	edx, r15d
	shr	edx, 24
	mov	DWORD PTR 8[rax], edx
	call	scsi_sglist@PLT
	mov	esi, DWORD PTR FDIR_READ[rip]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r12
	pop	rbx
	.cfi_def_cfa_offset 48
	mov	rdx, rax
	pop	rbp
	.cfi_def_cfa_offset 40
	mov	ecx, 1
	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	ene_send_scsi_cmd@PLT
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	pr_info@PLT
	mov	r11d, DWORD PTR USB_STOR_TRANSPORT_ERROR[rip]
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdx, QWORD PTR 16[rsp]
	mov	esi, DWORD PTR 28[rsp]
	mov	DWORD PTR 4[rsp], eax
	mov	rdi, QWORD PTR 8[rsp]
	call	usb_stor_set_xfer_buf@PLT
	mov	r11d, DWORD PTR 4[rsp]
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	ms_scsi_read, .-ms_scsi_read
	.comm	US_BULK_FLAG_IN,8,8
	.comm	US_BULK_CB_SIGN,4,4
	.comm	USB_STOR_XFER_GOOD,4,4
	.comm	USB_STOR_TRANSPORT_ERROR,4,4
	.comm	MS_RW_PATTERN,4,4
	.comm	MS_BYTES_PER_PAGE,4,4
	.comm	MSP_RW_PATTERN,4,4
	.comm	GFP_KERNEL,4,4
	.comm	FDIR_READ,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_ene_ub6250.c_ms_scsi_read.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Load MPS RW pattern Fail !!\012\000"
	.align	2
.LC1:
	.ascii	"Load MS RW pattern Fail !!\012\000"
	.global	__aeabi_idivmod
	.align	2
.LC2:
	.ascii	"MS_SCSI_Read --- result = %x\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ms_scsi_read, %function
ms_scsi_read:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r2, [r1]
	sub	sp, sp, #20
	ldrb	r3, [r2, #3]	@ zero_extendqisi2
	ldrb	r10, [r2, #2]	@ zero_extendqisi2
	str	r1, [sp, #8]
	ldrb	r1, [r2, #4]	@ zero_extendqisi2
	orr	r10, r10, r3, lsl #8
	ldrb	r3, [r2, #5]	@ zero_extendqisi2
	orr	r10, r10, r1, lsl #16
	orr	r3, r10, r3, lsl #24
	ldr	r9, [r0]
	eor	r10, r3, r3, ror #16
	lsr	r10, r10, #8
	ldr	r1, [r9]
	bic	r10, r10, #65280
	eor	r10, r10, r3, ror #8
	cmp	r1, r10
	blt	.L13
	ldrb	r5, [r2, #8]	@ zero_extendqisi2
	ldrb	r3, [r2, #7]	@ zero_extendqisi2
	ldr	r8, [r9, #8]
	orr	r3, r3, r5, lsl #8
	lsr	r5, r3, #8
	orr	r5, r5, r3, lsl #8
	lsl	r5, r5, #16
	lsr	r5, r5, #16
	lsl	r3, r5, #9
	cmp	r8, #0
	mov	r7, r0
	ldr	r6, [r0, #4]
	str	r3, [sp, #12]
	bne	.L15
	ldr	r3, .L17
	lsl	r0, r5, #9
	ldr	r1, [r3]
	bl	kmalloc
	subs	r3, r0, #0
	str	r3, [sp]
	beq	.L13
	ldr	r3, .L17+4
	mov	r0, r7
	ldr	r1, [r3]
	bl	ene_load_bincode
	ldr	fp, .L17+8
	ldr	r3, [fp]
	cmp	r3, r0
	bne	.L16
	ldr	r2, [r9, #4]
	mov	r0, r10
	mov	r1, r2
	str	r2, [sp, #4]
	bl	__aeabi_idivmod
	ldr	r2, [sp, #4]
	mov	r10, r0
	str	r7, [sp, #4]
	mov	r7, r1
	b	.L11
.L9:
	cmp	r5, #0
	ble	.L10
	mov	r7, #0
	ldr	r3, .L17+12
	ldr	r2, [r9, #4]
	ldr	r3, [r3]
	mla	r8, r3, r4, r8
.L11:
	sub	r4, r2, r7
	cmp	r4, r5
	mov	r1, r10
	mov	r0, r9
	movge	r4, r5
	bl	ms_libconv_to_physical
	mov	ip, r0
	mov	r2, #16
	mov	r1, #0
	mov	r0, r6
	add	r7, r7, ip, lsl #5
	bl	memset
	ldr	r3, .L17+16
	sub	r5, r5, r4
	ldr	r0, [r3]
	bl	cpu_to_le32
	mov	r1, #241
	mov	ip, #2
	ldr	r3, .L17+20
	str	r0, [r6, #12]
	ldr	r2, [r3]
	lsl	r0, r4, #9
	str	r2, [r6, #8]
	ldr	r2, [r6, #4]
	str	r0, [r6]
	asr	r0, r7, #8
	str	r1, [r2]
	and	r0, r0, #255
	asr	r1, r7, #16
	str	r0, [r2, #16]
	and	r1, r1, #255
	and	r0, r7, #255
	lsr	r3, r7, #24
	str	r0, [r2, #20]
	str	r1, [r2, #12]
	str	r3, [r2, #8]
	str	ip, [r2, #4]
	ldr	r3, .L17+24
	ldr	r2, [sp]
	ldr	r1, [r3]
	ldr	r0, [sp, #4]
	mov	r3, #0
	add	r2, r2, r8
	bl	ene_send_scsi_cmd
	ldr	r3, [fp]
	add	r10, r10, #1
	cmp	r3, r0
	beq	.L9
	mov	r1, r0
	ldr	r0, .L17+28
	bl	pr_info
	ldr	r3, .L17+32
	ldr	r3, [r3]
.L8:
	ldr	r0, [sp]
	str	r3, [sp, #4]
	bl	kfree
	ldr	r3, [sp, #4]
	mov	r0, r3
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L15:
	ldr	r3, .L17+36
	ldr	r1, [r3]
	bl	ene_load_bincode
	ldr	r3, .L17+8
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L5
	mov	r0, r7
	ldr	r1, .L17+40
	bl	usb_stor_dbg
.L13:
	ldr	r3, .L17+32
	ldr	r3, [r3]
	mov	r0, r3
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	mov	r2, #16
	mov	r1, #0
	mov	r0, r6
	bl	memset
	ldr	r3, .L17+16
	mov	r4, #2
	ldr	r0, [r3]
	bl	cpu_to_le32
	mov	ip, #241
	ldr	r3, .L17+20
	ldr	r1, [sp, #12]
	ldr	r2, [r3]
	ldr	r3, [r6, #4]
	str	r1, [r6]
	str	r2, [r6, #8]
	asr	r1, r10, #8
	asr	r2, r10, #16
	str	r0, [r6, #12]
	and	lr, r10, #255
	str	ip, [r3]
	and	r1, r1, #255
	ldr	ip, .L17+24
	and	r2, r2, #255
	lsr	r10, r10, #24
	str	r4, [r3, #4]
	str	lr, [r3, #20]
	str	r1, [r3, #16]
	str	r2, [r3, #12]
	str	r10, [r3, #8]
	ldr	r0, [sp, #8]
	ldr	r4, [ip]
	bl	scsi_sglist
	mov	r1, r4
	mov	r2, r0
	mov	r3, #1
	mov	r0, r7
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	ene_send_scsi_cmd
.L16:
	ldr	r0, .L17+44
	bl	pr_info
	ldr	r3, .L17+32
	ldr	r3, [r3]
	b	.L8
.L10:
	str	r0, [sp, #4]
	ldr	r2, [sp, #8]
	ldr	r1, [sp, #12]
	ldr	r0, [sp]
	bl	usb_stor_set_xfer_buf
	ldr	r3, [sp, #4]
	b	.L8
.L18:
	.align	2
.L17:
	.word	GFP_KERNEL
	.word	MS_RW_PATTERN
	.word	USB_STOR_XFER_GOOD
	.word	MS_BYTES_PER_PAGE
	.word	US_BULK_CB_SIGN
	.word	US_BULK_FLAG_IN
	.word	FDIR_READ
	.word	.LC2
	.word	USB_STOR_TRANSPORT_ERROR
	.word	MSP_RW_PATTERN
	.word	.LC0
	.word	.LC1
	.size	ms_scsi_read, .-ms_scsi_read
	.comm	US_BULK_FLAG_IN,4,4
	.comm	US_BULK_CB_SIGN,4,4
	.comm	USB_STOR_XFER_GOOD,4,4
	.comm	USB_STOR_TRANSPORT_ERROR,4,4
	.comm	MS_RW_PATTERN,4,4
	.comm	MS_BYTES_PER_PAGE,4,4
	.comm	MSP_RW_PATTERN,4,4
	.comm	GFP_KERNEL,4,4
	.comm	FDIR_READ,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
