	.file	"extr_target_core_sbc.c_sbc_setup_write_same.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"WRITE_SAME PBDATA and LBDATA bits not supported for Block Discard Emulation\n"
	.align 8
.LC1:
	.string	"WRITE_SAME sectors: %u exceeds max_write_same_len: %u\n"
	.align 8
.LC2:
	.string	"WRITE_SAME exceeds last lba %llu (lba %llu, sectors %u)\n"
	.align 8
.LC3:
	.string	"WRITE SAME with ANCHOR not supported\n"
	.align 8
.LC4:
	.string	"Got WRITE_SAME w/ UNMAP=1, but backend device has emulate_tpws disabled\n"
	.text
	.p2align 4
	.type	sbc_setup_write_same, @function
sbc_setup_write_same:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	mov	r13, rdx
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	r14, QWORD PTR 24[rdi]
	mov	rbx, rdi
	mov	rax, QWORD PTR 8[r14]
	mov	rdi, r14
	call	[QWORD PTR [rax]]
	mov	rdi, rbx
	mov	rbp, rax
	call	sbc_get_write_same_sectors@PLT
	mov	ecx, eax
	movzx	eax, BYTE PTR [r12]
	test	al, 6
	jne	.L14
	mov	rdx, QWORD PTR 24[rbx]
	mov	edx, DWORD PTR [rdx]
	cmp	edx, ecx
	jb	.L15
	mov	r8, QWORD PTR [rbx]
	mov	edx, ecx
	lea	rsi, 1[rbp]
	add	rdx, r8
	cmp	rdx, rsi
	jg	.L16
	test	al, 16
	jne	.L17
	test	al, 8
	je	.L7
	mov	edx, DWORD PTR 8[r13]
	test	edx, edx
	je	.L12
	mov	eax, DWORD PTR 4[r14]
	test	eax, eax
	je	.L18
	mov	rax, QWORD PTR sbc_execute_write_same_unmap[rip]
	mov	QWORD PTR 8[rbx], rax
	xor	eax, eax
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	pr_err@PLT
.L12:
	mov	rax, QWORD PTR TCM_UNSUPPORTED_SCSI_OPCODE[rip]
.L1:
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	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
.L7:
	.cfi_restore_state
	cmp	QWORD PTR 0[r13], 0
	je	.L12
	mov	rdx, QWORD PTR 16[rbx]
	mov	r8d, 1
	mov	rsi, rbx
	mov	rdi, r14
	call	sbc_check_prot@PLT
	test	rax, rax
	jne	.L1
	mov	rdx, QWORD PTR 0[r13]
	mov	QWORD PTR 8[rbx], rdx
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	pr_err@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, QWORD PTR TCM_UNSUPPORTED_SCSI_OPCODE[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
.L17:
	.cfi_restore_state
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	pr_warn@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, QWORD PTR TCM_INVALID_CDB_FIELD[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
.L15:
	.cfi_restore_state
	mov	esi, ecx
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	pr_warn@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rax, QWORD PTR TCM_INVALID_CDB_FIELD[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
.L16:
	.cfi_restore_state
	mov	rdx, r8
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	pr_err@PLT
	pop	rbx
	.cfi_def_cfa_offset 40
	mov	rax, QWORD PTR TCM_ADDRESS_OUT_OF_RANGE[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
	.cfi_endproc
.LFE0:
	.size	sbc_setup_write_same, .-sbc_setup_write_same
	.comm	sbc_execute_write_same_unmap,8,8
	.comm	TCM_UNSUPPORTED_SCSI_OPCODE,8,8
	.comm	TCM_INVALID_CDB_FIELD,8,8
	.comm	TCM_ADDRESS_OUT_OF_RANGE,8,8
	.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_target_core_sbc.c_sbc_setup_write_same.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"WRITE_SAME PBDATA and LBDATA bits not supported for"
	.ascii	" Block Discard Emulation\012\000"
	.align	2
.LC1:
	.ascii	"WRITE_SAME sectors: %u exceeds max_write_same_len: "
	.ascii	"%u\012\000"
	.align	2
.LC2:
	.ascii	"WRITE_SAME exceeds last lba %llu (lba %llu, sectors"
	.ascii	" %u)\012\000"
	.align	2
.LC3:
	.ascii	"WRITE SAME with ANCHOR not supported\012\000"
	.align	2
.LC4:
	.ascii	"Got WRITE_SAME w/ UNMAP=1, but backend device has e"
	.ascii	"mulate_tpws disabled\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sbc_setup_write_same, %function
sbc_setup_write_same:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r8, [r0, #12]
	mov	r4, r0
	ldr	r3, [r8, #8]
	sub	sp, sp, #8
	ldr	r3, [r3]
	mov	r0, r8
	mov	r6, r1
	mov	r7, r2
	blx	r3
	mov	r5, r0
	mov	r0, r4
	bl	sbc_get_write_same_sectors
	ldrb	ip, [r6]	@ zero_extendqisi2
	tst	ip, #6
	bne	.L20
	ldr	r3, [r4, #12]
	mov	r1, r0
	ldr	r2, [r3]
	cmp	r2, r0
	bcc	.L21
	ldr	r3, [r4]
	add	r5, r5, #1
	adds	r2, r3, r0
	bcs	.L7
	cmp	r2, r5
	bhi	.L7
	ands	r0, ip, #16
	bne	.L22
	tst	ip, #8
	beq	.L10
	ldr	r3, [r7, #4]
	cmp	r3, #0
	beq	.L18
	ldr	r3, [r8, #4]
	cmp	r3, #0
	beq	.L23
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [r4, #4]
	b	.L1
.L7:
	str	r3, [sp]
	mov	r2, r5
	asr	r3, r5, #31
	ldr	r0, .L24+4
	str	r1, [sp, #4]
	bl	pr_err
	ldr	r3, .L24+8
	ldr	r0, [r3]
.L1:
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L20:
	ldr	r0, .L24+12
	bl	pr_err
	ldr	r3, .L24+16
	ldr	r0, [r3]
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L10:
	ldr	r3, [r7]
	cmp	r3, #0
	beq	.L18
	mov	r2, #1
	str	r2, [sp]
	mov	r3, r1
	mov	r0, r8
	mov	r1, r4
	ldr	r2, [r4, #8]
	bl	sbc_check_prot
	cmp	r0, #0
	ldreq	r3, [r7]
	streq	r3, [r4, #4]
	b	.L1
.L21:
	ldr	r0, .L24+20
	bl	pr_warn
	ldr	r3, .L24+24
	ldr	r0, [r3]
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L23:
	ldr	r0, .L24+28
	bl	pr_err
.L18:
	ldr	r3, .L24+16
	ldr	r0, [r3]
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L22:
	ldr	r0, .L24+32
	bl	pr_warn
	ldr	r3, .L24+24
	ldr	r0, [r3]
	b	.L1
.L25:
	.align	2
.L24:
	.word	sbc_execute_write_same_unmap
	.word	.LC2
	.word	TCM_ADDRESS_OUT_OF_RANGE
	.word	.LC0
	.word	TCM_UNSUPPORTED_SCSI_OPCODE
	.word	.LC1
	.word	TCM_INVALID_CDB_FIELD
	.word	.LC4
	.word	.LC3
	.size	sbc_setup_write_same, .-sbc_setup_write_same
	.comm	sbc_execute_write_same_unmap,4,4
	.comm	TCM_UNSUPPORTED_SCSI_OPCODE,4,4
	.comm	TCM_INVALID_CDB_FIELD,4,4
	.comm	TCM_ADDRESS_OUT_OF_RANGE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
