	.file	"extr_scic_sds_stp_packet_request.c_scu_stp_packet_request_command_phase_construct_task_context.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	scu_stp_packet_request_command_phase_construct_task_context
	.type	scu_stp_packet_request_command_phase_construct_task_context, @function
scu_stp_packet_request_command_phase_construct_task_context:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	edi, DWORD PTR [rdi]
	call	scic_cb_io_request_get_data_direction@PLT
	cmp	rax, QWORD PTR SCI_IO_REQUEST_DATA_OUT[rip]
	je	.L11
	mov	eax, DWORD PTR SCU_TASK_TYPE_PACKET_DMA_IN[rip]
	mov	DWORD PTR [rbx], 1
	mov	DWORD PTR 36[rbx], eax
.L3:
	lea	rdi, 32[rbx]
	mov	edx, 4
	xor	esi, esi
	call	memset@PLT
	mov	rdi, QWORD PTR 8[rbp]
	mov	edx, 4
	xor	esi, esi
	mov	eax, DWORD PTR SATA_FIS_TYPE_DATA[rip]
	mov	DWORD PTR 32[rbx], eax
	call	memset@PLT
	mov	edi, DWORD PTR 0[rbp]
	call	scic_cb_stp_packet_io_request_get_cdb_address@PLT
	mov	edi, DWORD PTR 0[rbp]
	mov	r13, rax
	call	scic_cb_stp_packet_io_request_get_cdb_length@PLT
	mov	rsi, r13
	mov	r12d, eax
	mov	rax, QWORD PTR 8[rbp]
	mov	edx, r12d
	lea	rdi, 16[rax]
	call	memcpy@PLT
	mov	esi, DWORD PTR 0[rbp]
	mov	edi, r12d
	call	MAX@PLT
	lea	edx, 3[rax]
	test	al, 3
	jne	.L4
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 2
.L5:
	mov	DWORD PTR 4[rbx], eax
	mov	edi, DWORD PTR 0[rbp]
	mov	DWORD PTR 8[rbx], 1
	mov	QWORD PTR 24[rbx], 0
	call	scic_cb_request_is_initial_construction@PLT
	test	rax, rax
	je	.L6
	mov	edi, DWORD PTR 0[rbp]
	call	scic_cb_io_request_get_transfer_length@PLT
	mov	QWORD PTR 16[rbx], rax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 2
	add	eax, 1
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L6:
	mov	rax, QWORD PTR SCSI_FIXED_SENSE_DATA_BASE_LENGTH[rip]
	mov	rdi, rbp
	add	rax, 2
	mov	QWORD PTR 16[rbx], rax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	jmp	scic_sds_stp_packet_internal_request_sense_build_sgl@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	eax, DWORD PTR SCU_TASK_TYPE_PACKET_DMA_OUT[rip]
	mov	DWORD PTR [rbx], 0
	mov	DWORD PTR 36[rbx], eax
	jmp	.L3
	.cfi_endproc
.LFE0:
	.size	scu_stp_packet_request_command_phase_construct_task_context, .-scu_stp_packet_request_command_phase_construct_task_context
	.comm	SCU_TASK_TYPE_PACKET_DMA_OUT,4,4
	.comm	SCU_TASK_TYPE_PACKET_DMA_IN,4,4
	.comm	SCSI_FIXED_SENSE_DATA_BASE_LENGTH,8,8
	.comm	SCI_IO_REQUEST_DATA_OUT,8,8
	.comm	SATA_FIS_TYPE_DATA,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_scic_sds_stp_packet_request.c_scu_stp_packet_request_command_phase_construct_task_context.c"
	.text
	.align	2
	.global	scu_stp_packet_request_command_phase_construct_task_context
	.syntax unified
	.arm
	.fpu softvfp
	.type	scu_stp_packet_request_command_phase_construct_task_context, %function
scu_stp_packet_request_command_phase_construct_task_context:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	ldr	r0, [r0]
	mov	r5, r1
	bl	scic_cb_io_request_get_data_direction
	ldr	r3, .L11
	ldr	r1, .L11+4
	ldr	r3, [r3]
	ldr	r1, [r1]
	cmp	r0, r3
	moveq	r2, #0
	movne	r2, #1
	ldreq	r3, .L11+8
	ldrne	r3, .L11+12
	ldr	r3, [r3]
	str	r2, [r5]
	mov	r2, #0
	str	r3, [r5, #24]
	ldr	r3, [r4, #4]
	str	r1, [r5, #20]
	strb	r2, [r3]
	strb	r2, [r3, #1]
	strb	r2, [r3, #2]
	strb	r2, [r3, #3]
	ldr	r0, [r4]
	bl	scic_cb_stp_packet_io_request_get_cdb_address
	mov	r7, r0
	ldr	r0, [r4]
	bl	scic_cb_stp_packet_io_request_get_cdb_length
	mov	r6, r0
	ldr	r0, [r4, #4]
	mov	r2, r6
	mov	r1, r7
	add	r0, r0, #16
	bl	memcpy
	ldr	r1, [r4]
	mov	r0, r6
	bl	MAX
	cmp	r0, #0
	add	r3, r0, #3
	movge	r3, r0
	mov	r1, #1
	mov	r2, #0
	tst	r0, #3
	asr	r3, r3, #2
	addne	r3, r3, #1
	ldr	r0, [r4]
	str	r3, [r5, #4]
	str	r1, [r5, #8]
	str	r2, [r5, #16]
	bl	scic_cb_request_is_initial_construction
	cmp	r0, #0
	beq	.L6
	ldr	r0, [r4]
	bl	scic_cb_io_request_get_transfer_length
	str	r0, [r5, #12]
	pop	{r4, r5, r6, r7, r8, pc}
.L6:
	ldr	r3, .L11+16
	mov	r0, r4
	ldr	r3, [r3]
	add	r3, r3, #2
	str	r3, [r5, #12]
	pop	{r4, r5, r6, r7, r8, lr}
	b	scic_sds_stp_packet_internal_request_sense_build_sgl
.L12:
	.align	2
.L11:
	.word	SCI_IO_REQUEST_DATA_OUT
	.word	SATA_FIS_TYPE_DATA
	.word	SCU_TASK_TYPE_PACKET_DMA_OUT
	.word	SCU_TASK_TYPE_PACKET_DMA_IN
	.word	SCSI_FIXED_SENSE_DATA_BASE_LENGTH
	.size	scu_stp_packet_request_command_phase_construct_task_context, .-scu_stp_packet_request_command_phase_construct_task_context
	.comm	SCU_TASK_TYPE_PACKET_DMA_OUT,4,4
	.comm	SCU_TASK_TYPE_PACKET_DMA_IN,4,4
	.comm	SCSI_FIXED_SENSE_DATA_BASE_LENGTH,4,4
	.comm	SCI_IO_REQUEST_DATA_OUT,4,4
	.comm	SATA_FIS_TYPE_DATA,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
