	.file	"extr_trm.c_trm_MsgOutPhase1.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	trm_MsgOutPhase1, @function
trm_MsgOutPhase1:
.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
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	mov	esi, DWORD PTR TRMREG_SCSI_CONTROL[rip]
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	mov	edi, DWORD PTR DO_CLRFIFO[rip]
	call	trm_reg_write16@PLT
	mov	r13, QWORD PTR 8[rbx]
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR SRB_MSGOUT[rip], eax
	jne	.L2
	mov	r12, QWORD PTR 8[rbp]
	test	r12, r12
	je	.L3
	mov	r14, QWORD PTR 16[rbp]
	mov	ebx, 0
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR [r14+rbx*4]
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	add	rbx, 1
	call	trm_reg_write8@PLT
	cmp	r12, rbx
	jne	.L4
.L7:
	mov	QWORD PTR 8[rbp], 0
	mov	eax, DWORD PTR 0[r13]
	test	DWORD PTR ABORT_DEV_[rip], eax
	je	.L8
	mov	rax, QWORD PTR 16[rbp]
	mov	rcx, QWORD PTR MSG_ABORT[rip]
	cmp	QWORD PTR [rax], rcx
	je	.L29
.L8:
	mov	esi, DWORD PTR TRMREG_SCSI_CONTROL[rip]
	mov	edi, DWORD PTR DO_DATALATCH[rip]
	call	trm_reg_write16@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_COMMAND[rip]
	mov	edi, DWORD PTR SCMD_FIFO_OUT[rip]
	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
	jmp	trm_reg_write8@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	test	DWORD PTR SRB_DO_WIDE_NEGO[rip], eax
	je	.L30
.L11:
	test	DWORD PTR SRB_DO_SYNC_NEGO[rip], eax
	jne	.L8
	mov	eax, DWORD PTR 4[r13]
	test	DWORD PTR SYNC_NEGO_ENABLE[rip], eax
	je	.L8
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	test	DWORD PTR WIDE_NEGO_DONE[rip], eax
	je	.L31
.L12:
	mov	edi, DWORD PTR MSG_EXTENDED[rip]
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, 3
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, 1
	call	trm_reg_write8@PLT
	mov	edi, DWORD PTR 12[r13]
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	call	trm_reg_write8@PLT
	cmp	DWORD PTR [rbx], 1
	mov	eax, 15
	mov	edi, 31
	cmovne	edi, eax
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	call	trm_reg_write8@PLT
	mov	eax, DWORD PTR SRB_DO_SYNC_NEGO[rip]
	or	DWORD PTR 0[rbp], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L30:
	mov	edx, DWORD PTR 4[r13]
	test	DWORD PTR WIDE_NEGO_ENABLE[rip], edx
	je	.L11
	mov	eax, DWORD PTR SYNC_NEGO_DONE[rip]
	or	eax, DWORD PTR EN_ATN_STOP[rip]
	not	eax
	mov	edi, DWORD PTR 8[r13]
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	and	eax, edx
	mov	DWORD PTR 4[r13], eax
	and	edi, 191
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, DWORD PTR MSG_EXTENDED[rip]
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, 2
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, 3
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, 1
	call	trm_reg_write8@PLT
	mov	eax, DWORD PTR SRB_DO_WIDE_NEGO[rip]
	or	DWORD PTR 0[rbp], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L3:
	mov	rdx, QWORD PTR 24[rbp]
	mov	rdx, QWORD PTR [rdx]
	cmp	rdx, QWORD PTR INQUIRY[rip]
	je	.L9
	cmp	rdx, QWORD PTR REQUEST_SENSE[rip]
	je	.L9
	mov	edx, DWORD PTR 32[rbp]
	test	DWORD PTR AUTO_REQSENSE[rip], edx
	je	.L10
.L9:
	mov	edx, DWORD PTR 4[r13]
	test	DWORD PTR SYNC_NEGO_ENABLE[rip], edx
	jne	.L2
.L10:
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, DWORD PTR MSG_ABORT[rip]
	call	trm_reg_write8@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L29:
	mov	eax, DWORD PTR SRB_ABORT_SENT[rip]
	mov	DWORD PTR 0[rbp], eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L31:
	mov	edi, DWORD PTR 8[r13]
	and	edi, 191
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	jmp	.L12
	.cfi_endproc
.LFE0:
	.size	trm_MsgOutPhase1, .-trm_MsgOutPhase1
	.comm	WIDE_NEGO_ENABLE,4,4
	.comm	WIDE_NEGO_DONE,4,4
	.comm	TRMREG_SCSI_FIFO,4,4
	.comm	TRMREG_SCSI_CONTROL,4,4
	.comm	TRMREG_SCSI_COMMAND,4,4
	.comm	SYNC_NEGO_ENABLE,4,4
	.comm	SYNC_NEGO_DONE,4,4
	.comm	SRB_MSGOUT,4,4
	.comm	SRB_DO_WIDE_NEGO,4,4
	.comm	SRB_DO_SYNC_NEGO,4,4
	.comm	SRB_ABORT_SENT,4,4
	.comm	SCMD_FIFO_OUT,4,4
	.comm	REQUEST_SENSE,8,8
	.comm	MSG_EXTENDED,4,4
	.comm	MSG_ABORT,8,8
	.comm	INQUIRY,8,8
	.comm	EN_ATN_STOP,4,4
	.comm	DO_DATALATCH,4,4
	.comm	DO_CLRFIFO,4,4
	.comm	AUTO_REQSENSE,4,4
	.comm	ABORT_DEV_,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_trm.c_trm_MsgOutPhase1.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	trm_MsgOutPhase1, %function
trm_MsgOutPhase1:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r5, r1
	mov	r6, r0
	ldr	r3, .L32
	ldr	r7, .L32+4
	ldr	r0, [r3]
	ldr	r1, [r7]
	bl	trm_reg_write16
	ldr	r2, .L32+8
	ldr	r3, [r5]
	ldr	r4, [r2]
	ldr	r8, [r6, #4]
	ands	r4, r3, r4
	bne	.L2
	ldr	r9, [r5, #4]
	cmp	r9, #0
	beq	.L3
	ldr	r6, [r5, #8]
	ble	.L7
	ldr	r10, .L32+12
.L4:
	ldr	r1, [r10]
	ldr	r0, [r6], #4
	add	r4, r4, #1
	bl	trm_reg_write8
	cmp	r9, r4
	bne	.L4
.L7:
	mov	r1, #0
	ldr	r3, .L32+16
	ldr	r2, [r8]
	ldr	r3, [r3]
	str	r1, [r5, #4]
	tst	r2, r3
	beq	.L8
	ldr	r2, [r5, #8]
	ldr	r3, .L32+20
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L29
.L8:
	ldr	r3, .L32+24
	ldr	r1, [r7]
	ldr	r0, [r3]
	bl	trm_reg_write16
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r2, .L32+28
	ldr	r3, .L32+32
	ldr	r1, [r2]
	ldr	r0, [r3]
	b	trm_reg_write8
.L2:
	ldr	r4, .L32+36
	ldr	r2, [r4]
	tst	r3, r2
	beq	.L30
.L11:
	ldr	r4, .L32+40
	ldr	r2, [r4]
	tst	r3, r2
	bne	.L8
	ldr	r2, .L32+44
	ldr	r3, [r8, #4]
	ldr	r2, [r2]
	tst	r3, r2
	beq	.L8
	ldr	r2, .L32+48
	ldr	r10, .L32+12
	ldr	r2, [r2]
	ldr	r1, [r10]
	tst	r3, r2
	beq	.L31
.L12:
	ldr	r3, .L32+52
	ldr	r0, [r3]
	bl	trm_reg_write8
	ldr	r1, [r10]
	mov	r0, #3
	bl	trm_reg_write8
	ldr	r1, [r10]
	mov	r0, #1
	bl	trm_reg_write8
	ldr	r1, [r10]
	ldr	r0, [r8, #12]
	bl	trm_reg_write8
	ldr	r3, [r6]
	ldr	r1, [r10]
	cmp	r3, #1
	moveq	r0, #31
	movne	r0, #15
.L27:
	bl	trm_reg_write8
	ldr	r2, [r4]
	ldr	r3, [r5]
	orr	r3, r3, r2
	str	r3, [r5]
	b	.L8
.L30:
	ldr	r1, .L32+56
	ldr	r2, [r8, #4]
	ldr	r1, [r1]
	tst	r2, r1
	beq	.L11
	ldr	r3, .L32+60
	ldr	r1, .L32+64
	ldr	r3, [r3]
	ldr	r1, [r1]
	ldr	r6, .L32+12
	orr	r3, r3, r1
	ldr	r0, [r8, #8]
	bic	r2, r2, r3
	str	r2, [r8, #4]
	ldr	r1, [r6]
	and	r0, r0, #191
	bl	trm_reg_write8
	ldr	r3, .L32+52
	ldr	r1, [r6]
	ldr	r0, [r3]
	bl	trm_reg_write8
	ldr	r1, [r6]
	mov	r0, #2
	bl	trm_reg_write8
	ldr	r1, [r6]
	mov	r0, #3
	bl	trm_reg_write8
	mov	r0, #1
	ldr	r1, [r6]
	b	.L27
.L3:
	ldr	r2, [r5, #12]
	ldr	r1, .L32+68
	ldr	r2, [r2]
	ldr	r1, [r1]
	cmp	r2, r1
	beq	.L9
	ldr	r1, .L32+72
	ldr	r1, [r1]
	cmp	r2, r1
	beq	.L9
	ldr	r2, .L32+76
	ldr	r1, [r5, #16]
	ldr	r2, [r2]
	tst	r1, r2
	beq	.L10
.L9:
	ldr	r2, .L32+44
	ldr	r1, [r8, #4]
	ldr	r2, [r2]
	tst	r1, r2
	bne	.L2
.L10:
	ldr	r2, .L32+12
	ldr	r3, .L32+20
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	trm_reg_write8
	b	.L8
.L29:
	ldr	r3, .L32+80
	ldr	r3, [r3]
	str	r3, [r5]
	b	.L8
.L31:
	ldr	r0, [r8, #8]
	and	r0, r0, #191
	bl	trm_reg_write8
	ldr	r1, [r10]
	b	.L12
.L33:
	.align	2
.L32:
	.word	DO_CLRFIFO
	.word	TRMREG_SCSI_CONTROL
	.word	SRB_MSGOUT
	.word	TRMREG_SCSI_FIFO
	.word	ABORT_DEV_
	.word	MSG_ABORT
	.word	DO_DATALATCH
	.word	TRMREG_SCSI_COMMAND
	.word	SCMD_FIFO_OUT
	.word	SRB_DO_WIDE_NEGO
	.word	SRB_DO_SYNC_NEGO
	.word	SYNC_NEGO_ENABLE
	.word	WIDE_NEGO_DONE
	.word	MSG_EXTENDED
	.word	WIDE_NEGO_ENABLE
	.word	SYNC_NEGO_DONE
	.word	EN_ATN_STOP
	.word	INQUIRY
	.word	REQUEST_SENSE
	.word	AUTO_REQSENSE
	.word	SRB_ABORT_SENT
	.size	trm_MsgOutPhase1, .-trm_MsgOutPhase1
	.comm	WIDE_NEGO_ENABLE,4,4
	.comm	WIDE_NEGO_DONE,4,4
	.comm	TRMREG_SCSI_FIFO,4,4
	.comm	TRMREG_SCSI_CONTROL,4,4
	.comm	TRMREG_SCSI_COMMAND,4,4
	.comm	SYNC_NEGO_ENABLE,4,4
	.comm	SYNC_NEGO_DONE,4,4
	.comm	SRB_MSGOUT,4,4
	.comm	SRB_DO_WIDE_NEGO,4,4
	.comm	SRB_DO_SYNC_NEGO,4,4
	.comm	SRB_ABORT_SENT,4,4
	.comm	SCMD_FIFO_OUT,4,4
	.comm	REQUEST_SENSE,4,4
	.comm	MSG_EXTENDED,4,4
	.comm	MSG_ABORT,4,4
	.comm	INQUIRY,4,4
	.comm	EN_ATN_STOP,4,4
	.comm	DO_DATALATCH,4,4
	.comm	DO_CLRFIFO,4,4
	.comm	AUTO_REQSENSE,4,4
	.comm	ABORT_DEV_,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
