	.file	"extr_lpfc_scsi.c_lpfc_bg_scsi_prep_dma_buf_s4.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"9083 Unexpected protection group %i\n"
	.align 8
.LC1:
	.string	"9084 Cannot setup S/G List for HBAIO segs %d/%d SGL %d SCSI %d: %d %d\n"
	.text
	.p2align 4
	.type	lpfc_bg_scsi_prep_dma_buf_s4, @function
lpfc_bg_scsi_prep_dma_buf_s4:
.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	r14, rsi
	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
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	rax, QWORD PTR 32[rsi]
	mov	r12, QWORD PTR 40[rsi]
	mov	rbx, QWORD PTR 24[rsi]
	mov	QWORD PTR [rsp], rax
	mov	rax, QWORD PTR 32[rdi]
	mov	rdi, r12
	mov	r15d, DWORD PTR [r12]
	mov	QWORD PTR 8[rsp], rax
	call	scsi_sg_count@PLT
	test	rax, rax
	je	.L2
	mov	rdi, r12
	call	scsi_sg_count@PLT
	mov	rdi, r12
	mov	r13, rax
	call	scsi_sglist@PLT
	mov	rdi, QWORD PTR 8[rbp]
	mov	rdx, r13
	mov	ecx, r15d
	mov	esi, eax
	call	dma_map_sg@PLT
	xor	edi, edi
	test	eax, eax
	mov	r13d, eax
	sete	dil
	call	unlikely@PLT
	mov	r8, rax
	mov	eax, 1
	test	r8, r8
	je	.L41
.L1:
	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
.L41:
	.cfi_restore_state
	mov	edi, DWORD PTR 4[rbx]
	call	le32_to_cpu@PLT
	mov	edi, DWORD PTR lpfc_sli4_sge_last[rip]
	lea	rsi, 4[rbx]
	xor	edx, edx
	mov	DWORD PTR 4[rbx], eax
	call	bf_set@PLT
	mov	edi, DWORD PTR 4[rbx]
	call	cpu_to_le32@PLT
	mov	DWORD PTR 4[rbx], eax
	lea	rax, 8[rbx]
	mov	QWORD PTR 16[rsp], rax
	mov	DWORD PTR [r14], r13d
	cmp	DWORD PTR 0[rbp], r13d
	jge	.L4
	mov	r8d, DWORD PTR 24[rbp]
	test	r8d, r8d
	je	.L42
.L4:
	mov	rsi, r12
	mov	rdi, rbp
	call	lpfc_prot_group_type@PLT
	mov	ebx, eax
	cmp	eax, 134
	jne	.L43
	mov	eax, DWORD PTR [r14]
	cmp	eax, DWORD PTR 4[rbp]
	jl	.L9
	mov	r8d, DWORD PTR 24[rbp]
	test	r8d, r8d
	je	.L5
.L9:
	mov	rdx, QWORD PTR 16[rsp]
	mov	r8, r14
	mov	ecx, r13d
	mov	rsi, r12
	mov	rdi, rbp
	call	lpfc_bg_setup_sgl@PLT
	mov	r8d, eax
	cmp	eax, 1
	jle	.L39
	.p2align 4,,10
	.p2align 3
.L2:
	mov	rdi, r12
	call	scsi_get_prot_op@PLT
	add	eax, -128
	cmp	eax, 5
	ja	.L13
	lea	rdx, .L15[rip]
	movsx	rax, DWORD PTR [rdx+rax*4]
	add	rax, rdx
	notrack jmp	rax
	.section	.rodata
	.align 4
	.align 4
.L15:
	.long	.L17-.L15
	.long	.L16-.L15
	.long	.L14-.L15
	.long	.L17-.L15
	.long	.L16-.L15
	.long	.L14-.L15
	.text
	.p2align 4,,10
	.p2align 3
.L16:
	mov	eax, DWORD PTR LPFC_IO_DIF_PASS[rip]
	or	DWORD PTR 8[r14], eax
.L13:
	mov	rsi, r14
	mov	rdi, rbp
	call	lpfc_bg_scsi_adjust_dl@PLT
	mov	edi, eax
	mov	ebx, eax
	call	be32_to_cpu@PLT
	mov	rcx, QWORD PTR [rsp]
	mov	DWORD PTR [rcx], eax
	mov	eax, DWORD PTR 16[r14]
	mov	DWORD PTR 12[r14], ebx
	test	eax, eax
	je	.L18
	mov	rax, QWORD PTR 8[rsp]
	cmp	DWORD PTR [rax], ebx
	jle	.L18
	mov	DWORD PTR 16[r14], ebx
.L18:
	xor	eax, eax
	cmp	QWORD PTR 16[rbp], 0
	je	.L1
	mov	rdx, QWORD PTR 8[r12]
	mov	rdx, QWORD PTR [rdx]
	cmp	QWORD PTR [rdx], 0
	je	.L1
	mov	edx, DWORD PTR LPFC_IO_OAS[rip]
	or	edx, DWORD PTR LPFC_IO_FOF[rip]
	or	DWORD PTR 8[r14], edx
	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
.L43:
	.cfi_restore_state
	cmp	eax, 136
	jne	.L44
	mov	rdi, r12
	call	scsi_prot_sg_count@PLT
	mov	rdi, r12
	mov	QWORD PTR 24[rsp], rax
	call	scsi_prot_sglist@PLT
	mov	rdi, QWORD PTR 8[rbp]
	mov	rdx, QWORD PTR 24[rsp]
	mov	ecx, r15d
	mov	esi, eax
	call	dma_map_sg@PLT
	xor	edi, edi
	test	eax, eax
	mov	r15d, eax
	sete	dil
	call	unlikely@PLT
	test	rax, rax
	jne	.L45
	mov	eax, DWORD PTR 4[rbp]
	lea	edx, [r15+r15*2]
	mov	DWORD PTR 4[r14], r15d
	sub	eax, 1
	cmp	eax, edx
	jg	.L11
	mov	r8d, DWORD PTR 24[rbp]
	test	r8d, r8d
	je	.L39
.L11:
	mov	rdx, QWORD PTR 16[rsp]
	mov	r8d, r15d
	mov	r9, r14
	mov	ecx, r13d
	mov	rsi, r12
	mov	rdi, rbp
	call	lpfc_bg_setup_sgl_prot@PLT
	mov	r8d, eax
	cmp	eax, 2
	jle	.L39
	cmp	DWORD PTR 4[rbp], eax
	jge	.L2
	mov	edx, DWORD PTR 24[rbp]
	test	edx, edx
	jne	.L2
	.p2align 4,,10
	.p2align 3
.L39:
	mov	eax, DWORD PTR [r14]
.L5:
	test	eax, eax
	jne	.L46
.L19:
	mov	r9d, DWORD PTR 4[r14]
	test	r9d, r9d
	jne	.L47
.L20:
	mov	eax, DWORD PTR 0[rbp]
	push	r8
	.cfi_def_cfa_offset 104
	lea	rcx, .LC1[rip]
	mov	rdi, rbp
	mov	r8d, DWORD PTR [r14]
	mov	edx, DWORD PTR LOG_FCP[rip]
	push	rbx
	.cfi_def_cfa_offset 112
	push	rax
	.cfi_def_cfa_offset 120
	mov	eax, DWORD PTR 4[rbp]
	mov	esi, DWORD PTR KERN_ERR[rip]
	push	rax
	.cfi_def_cfa_offset 128
	xor	eax, eax
	call	lpfc_printf_log@PLT
	mov	QWORD PTR [r14], 0
	add	rsp, 32
	.cfi_def_cfa_offset 96
	mov	eax, 2
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L14:
	mov	eax, DWORD PTR LPFC_IO_DIF_INSERT[rip]
	or	DWORD PTR 8[r14], eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L17:
	mov	eax, DWORD PTR LPFC_IO_DIF_STRIP[rip]
	or	DWORD PTR 8[r14], eax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L44:
	mov	rdi, r12
	call	scsi_dma_unmap@PLT
	mov	edx, DWORD PTR LOG_FCP[rip]
	mov	r8d, ebx
	xor	eax, eax
	mov	DWORD PTR [r14], 0
	mov	esi, DWORD PTR KERN_ERR[rip]
	lea	rcx, .LC0[rip]
	mov	rdi, rbp
	call	lpfc_printf_log@PLT
	mov	eax, 2
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L47:
	mov	rdi, r12
	mov	DWORD PTR [rsp], r8d
	mov	r15d, DWORD PTR [r12]
	call	scsi_prot_sg_count@PLT
	mov	rdi, r12
	mov	r13, rax
	call	scsi_prot_sglist@PLT
	mov	rdi, QWORD PTR 8[rbp]
	mov	ecx, r15d
	mov	rdx, r13
	mov	esi, eax
	call	dma_unmap_sg@PLT
	mov	r9d, DWORD PTR 4[r14]
	mov	r8d, DWORD PTR [rsp]
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L46:
	mov	rdi, r12
	mov	DWORD PTR [rsp], r8d
	call	scsi_dma_unmap@PLT
	mov	r8d, DWORD PTR [rsp]
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L42:
	mov	edi, 1
	mov	DWORD PTR [rsp], r8d
	xor	ebx, ebx
	call	WARN_ON_ONCE@PLT
	mov	eax, DWORD PTR [r14]
	mov	r8d, DWORD PTR [rsp]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L45:
	mov	rdi, r12
	call	scsi_dma_unmap@PLT
	mov	eax, 1
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	lpfc_bg_scsi_prep_dma_buf_s4, .-lpfc_bg_scsi_prep_dma_buf_s4
	.comm	lpfc_sli4_sge_last,4,4
	.comm	LPFC_IO_OAS,4,4
	.comm	LPFC_IO_FOF,4,4
	.comm	LPFC_IO_DIF_STRIP,4,4
	.comm	LPFC_IO_DIF_PASS,4,4
	.comm	LPFC_IO_DIF_INSERT,4,4
	.comm	LOG_FCP,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_lpfc_scsi.c_lpfc_bg_scsi_prep_dma_buf_s4.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"9083 Unexpected protection group %i\012\000"
	.align	2
.LC1:
	.ascii	"9084 Cannot setup S/G List for HBAIO segs %d/%d SGL"
	.ascii	" %d SCSI %d: %d %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	lpfc_bg_scsi_prep_dma_buf_s4, %function
lpfc_bg_scsi_prep_dma_buf_s4:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r5, r0
	ldr	r6, [r1, #28]
	sub	sp, sp, #44
	mov	r0, r6
	mov	r4, r1
	ldr	r8, [r1, #24]
	ldr	r9, [r6]
	ldr	fp, [r1, #20]
	ldr	r10, [r5, #20]
	bl	scsi_sg_count
	cmp	r0, #0
	beq	.L2
	mov	r0, r6
	ldr	r7, [r5, #8]
	bl	scsi_sglist
	mov	r1, r0
	mov	r0, r6
	str	r1, [sp, #28]
	bl	scsi_sg_count
	mov	r3, r9
	mov	r2, r0
	ldr	r1, [sp, #28]
	mov	r0, r7
	bl	dma_map_sg
	mov	r7, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	unlikely
	subs	r2, r0, #0
	movne	r0, #1
	str	r2, [sp, #28]
	beq	.L48
.L1:
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L48:
	ldr	r0, [fp, #4]
	bl	le32_to_cpu
	mov	r1, fp
	ldr	r3, .L55
	str	r0, [r1, #4]!
	ldr	r2, [sp, #28]
	ldr	r0, [r3]
	bl	bf_set
	ldr	r0, [fp, #4]
	bl	cpu_to_le32
	ldr	r3, [r5]
	str	r0, [fp, #4]
	cmp	r3, r7
	add	r3, fp, #8
	str	r3, [sp, #32]
	str	r7, [r4]
	bge	.L4
	ldr	fp, [r5, #16]
	cmp	fp, #0
	beq	.L49
.L4:
	mov	r1, r6
	mov	r0, r5
	bl	lpfc_prot_group_type
	cmp	r0, #134
	str	r0, [sp, #28]
	bne	.L50
	ldr	r3, [r4]
	ldr	r2, [r5, #4]
	cmp	r3, r2
	blt	.L9
	ldr	fp, [r5, #16]
	cmp	fp, #0
	beq	.L5
.L9:
	mov	r3, r7
	mov	r1, r6
	mov	r0, r5
	ldr	r2, [sp, #32]
	str	r4, [sp]
	bl	lpfc_bg_setup_sgl
	cmp	r0, #1
	mov	fp, r0
	ble	.L46
.L2:
	mov	r0, r6
	bl	scsi_get_prot_op
	sub	r0, r0, #128
	cmp	r0, #5
	ldrls	pc, [pc, r0, asl #2]
	b	.L13
.L15:
	.word	.L17
	.word	.L16
	.word	.L14
	.word	.L17
	.word	.L16
	.word	.L14
.L16:
	ldr	r2, .L55+4
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	orr	r3, r3, r2
	str	r3, [r4, #8]
.L13:
	mov	r1, r4
	mov	r0, r5
	bl	lpfc_bg_scsi_adjust_dl
	mov	r7, r0
	bl	be32_to_cpu
	ldr	r3, [r4, #16]
	str	r0, [r8]
	cmp	r3, #0
	str	r7, [r4, #12]
	beq	.L18
	ldr	r3, [r10]
	cmp	r3, r7
	strgt	r7, [r4, #16]
.L18:
	ldr	r0, [r5, #12]
	cmp	r0, #0
	beq	.L1
	ldr	r3, [r6, #4]
	ldr	r3, [r3]
	ldr	r0, [r3]
	cmp	r0, #0
	beq	.L1
	mov	r0, #0
	ldr	r3, .L55+8
	ldr	r2, .L55+12
	ldr	r1, [r3]
	ldr	r2, [r2]
	ldr	r3, [r4, #8]
	orr	r2, r2, r1
	orr	r3, r3, r2
	str	r3, [r4, #8]
	add	sp, sp, #44
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L50:
	cmp	r0, #136
	bne	.L51
	mov	r0, r6
	ldr	fp, [r5, #8]
	bl	scsi_prot_sglist
	mov	r1, r0
	mov	r0, r6
	str	r1, [sp, #36]
	bl	scsi_prot_sg_count
	mov	r3, r9
	mov	r2, r0
	ldr	r1, [sp, #36]
	mov	r0, fp
	bl	dma_map_sg
	mov	r9, r0
	clz	r0, r0
	lsr	r0, r0, #5
	bl	unlikely
	cmp	r0, #0
	bne	.L52
	ldr	r2, [r5, #4]
	add	r3, r9, r9, lsl #1
	sub	r2, r2, #1
	cmp	r2, r3
	str	r9, [r4, #4]
	bgt	.L11
	ldr	fp, [r5, #16]
	cmp	fp, #0
	beq	.L46
.L11:
	mov	r3, r7
	mov	r1, r6
	mov	r0, r5
	ldr	r2, [sp, #32]
	str	r4, [sp, #4]
	str	r9, [sp]
	bl	lpfc_bg_setup_sgl_prot
	cmp	r0, #2
	mov	fp, r0
	ble	.L46
	ldr	r3, [r5, #4]
	cmp	r3, r0
	bge	.L2
	ldr	r3, [r5, #16]
	cmp	r3, #0
	bne	.L2
.L46:
	ldr	r3, [r4]
.L5:
	cmp	r3, #0
	bne	.L53
.L19:
	ldr	r3, [r4, #4]
	cmp	r3, #0
	bne	.L54
.L20:
	ldr	r0, [sp, #28]
	str	fp, [sp, #20]
	str	r0, [sp, #16]
	ldr	ip, [r5]
	ldr	r2, .L55+16
	ldr	r1, .L55+20
	str	r3, [sp, #4]
	ldr	r0, [r5, #4]
	ldr	r2, [r2]
	ldr	r1, [r1]
	str	ip, [sp, #12]
	ldr	r3, [r4]
	str	r0, [sp, #8]
	str	r3, [sp]
	mov	r0, r5
	ldr	r3, .L55+24
	bl	lpfc_printf_log
	mov	r3, #0
	mov	r0, #2
	str	r3, [r4]
	str	r3, [r4, #4]
	b	.L1
.L17:
	ldr	r2, .L55+28
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	orr	r3, r3, r2
	str	r3, [r4, #8]
	b	.L13
.L14:
	ldr	r2, .L55+32
	ldr	r3, [r4, #8]
	ldr	r2, [r2]
	orr	r3, r3, r2
	str	r3, [r4, #8]
	b	.L13
.L51:
	mov	r0, r6
	bl	scsi_dma_unmap
	mov	r1, #0
	ldr	r0, [sp, #28]
	ldr	r3, .L55+20
	ldr	r2, .L55+16
	str	r0, [sp]
	ldr	r2, [r2]
	str	r1, [r4]
	mov	r0, r5
	ldr	r1, [r3]
	ldr	r3, .L55+36
	bl	lpfc_printf_log
	mov	r0, #2
	b	.L1
.L54:
	mov	r0, r6
	ldr	r8, [r5, #8]
	bl	scsi_prot_sglist
	mov	r7, r0
	mov	r0, r6
	bl	scsi_prot_sg_count
	ldr	r3, [r6]
	mov	r2, r0
	mov	r1, r7
	mov	r0, r8
	bl	dma_unmap_sg
	ldr	r3, [r4, #4]
	b	.L20
.L53:
	mov	r0, r6
	bl	scsi_dma_unmap
	b	.L19
.L49:
	mov	r0, #1
	bl	WARN_ON_ONCE
	ldr	r3, [r4]
	str	fp, [sp, #28]
	b	.L5
.L52:
	mov	r0, r6
	bl	scsi_dma_unmap
	mov	r0, #1
	b	.L1
.L56:
	.align	2
.L55:
	.word	lpfc_sli4_sge_last
	.word	LPFC_IO_DIF_PASS
	.word	LPFC_IO_FOF
	.word	LPFC_IO_OAS
	.word	LOG_FCP
	.word	KERN_ERR
	.word	.LC1
	.word	LPFC_IO_DIF_STRIP
	.word	LPFC_IO_DIF_INSERT
	.word	.LC0
	.size	lpfc_bg_scsi_prep_dma_buf_s4, .-lpfc_bg_scsi_prep_dma_buf_s4
	.comm	lpfc_sli4_sge_last,4,4
	.comm	LPFC_IO_OAS,4,4
	.comm	LPFC_IO_FOF,4,4
	.comm	LPFC_IO_DIF_STRIP,4,4
	.comm	LPFC_IO_DIF_PASS,4,4
	.comm	LPFC_IO_DIF_INSERT,4,4
	.comm	LOG_FCP,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
