	.file	"extr_trm.c_trm_StartSCSI.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	trm_StartSCSI, @function
trm_StartSCSI:
.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
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	esi, DWORD PTR TRMREG_SCSI_HOSTID[rip]
	mov	edi, DWORD PTR [rdi]
	mov	rbx, QWORD PTR 32[rdx]
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_TARGETID[rip]
	mov	edi, DWORD PTR [r12]
	call	trm_reg_write8@PLT
	mov	edi, DWORD PTR 4[r12]
	mov	esi, DWORD PTR TRMREG_SCSI_SYNC[rip]
	call	trm_reg_write8@PLT
	mov	edi, DWORD PTR 8[r12]
	mov	esi, DWORD PTR TRMREG_SCSI_OFFSET[rip]
	call	trm_reg_write8@PLT
	mov	eax, DWORD PTR PH_BUS_FREE[rip]
	mov	edi, DWORD PTR DO_CLRFIFO[rip]
	mov	esi, DWORD PTR TRMREG_SCSI_CONTROL[rip]
	mov	DWORD PTR 20[rbp], eax
	call	trm_reg_write16@PLT
	mov	rax, QWORD PTR 0[rbp]
	mov	edi, DWORD PTR 12[r12]
	mov	rcx, QWORD PTR INQUIRY[rip]
	mov	rdx, QWORD PTR [rax]
	cmp	rdx, rcx
	je	.L2
	movsx	rax, DWORD PTR REQUEST_SENSE[rip]
	cmp	rdx, rax
	je	.L2
	mov	eax, DWORD PTR 8[rbp]
	test	DWORD PTR AUTO_REQSENSE[rip], eax
	je	.L3
.L2:
	mov	eax, DWORD PTR 16[r12]
	test	DWORD PTR WIDE_NEGO_ENABLE[rip], eax
	je	.L4
	test	DWORD PTR WIDE_NEGO_DONE[rip], eax
	jne	.L4
.L5:
	test	dil, 7
	je	.L15
	cmp	rdx, rcx
	je	.L6
.L15:
	mov	rax, QWORD PTR SRB_MSGOUT[rip]
	mov	r14d, DWORD PTR SCMD_SEL_ATNSTOP[rip]
	mov	QWORD PTR 24[rbp], rax
	mov	eax, DWORD PTR 8[rbp]
	test	DWORD PTR AUTO_REQSENSE[rip], eax
	je	.L9
.L35:
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, DWORD PTR REQUEST_SENSE[rip]
	call	trm_reg_write8@PLT
	mov	edi, DWORD PTR 12[r12]
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	sal	edi, 5
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	xor	edi, edi
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	xor	edi, edi
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, DWORD PTR [rbx]
	call	trm_reg_write8@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	xor	edi, edi
	call	trm_reg_write8@PLT
.L10:
	mov	edi, DWORD PTR TRMREG_SCSI_STATUS[rip]
	call	trm_reg_read16@PLT
	and	eax, DWORD PTR SCSIINTERRUPT[rip]
	mov	r15d, eax
	je	.L13
	mov	rax, QWORD PTR SRB_READY[rip]
	mov	r15d, 1
	mov	QWORD PTR 24[rbp], rax
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r15d
	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
.L4:
	.cfi_restore_state
	test	DWORD PTR SYNC_NEGO_ENABLE[rip], eax
	jne	.L34
.L6:
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	and	edi, 191
	call	trm_reg_write8@PLT
	mov	rax, QWORD PTR SRB_START_[rip]
	mov	r14d, DWORD PTR SCMD_SEL_ATN[rip]
	mov	QWORD PTR 24[rbp], rax
.L8:
	mov	eax, DWORD PTR 8[rbp]
	test	DWORD PTR AUTO_REQSENSE[rip], eax
	jne	.L35
.L9:
	mov	eax, DWORD PTR 16[rbp]
	mov	r15, QWORD PTR 0[rbp]
	test	eax, eax
	jle	.L10
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L12:
	mov	edi, DWORD PTR [r15+rbx*4]
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	add	rbx, 1
	call	trm_reg_write8@PLT
	cmp	DWORD PTR 16[rbp], ebx
	jg	.L12
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L34:
	test	DWORD PTR SYNC_NEGO_DONE[rip], eax
	jne	.L6
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L13:
	mov	eax, DWORD PTR SCSI_NOP1[rip]
	mov	esi, DWORD PTR TRMREG_SCSI_CONTROL[rip]
	mov	edi, DWORD PTR DO_DATALATCH[rip]
	or	edi, DWORD PTR DO_HWRESELECT[rip]
	mov	DWORD PTR 20[rbp], eax
	mov	QWORD PTR 8[r13], r12
	mov	QWORD PTR 24[r12], rbp
	call	trm_reg_write16@PLT
	mov	esi, DWORD PTR TRMREG_SCSI_COMMAND[rip]
	mov	edi, r14d
	call	trm_reg_write8@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L3:
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	call	trm_reg_write8@PLT
	mov	rax, QWORD PTR SRB_START_[rip]
	mov	r14d, DWORD PTR SCMD_SEL_ATN[rip]
	mov	QWORD PTR 24[rbp], rax
	mov	eax, DWORD PTR 16[r12]
	test	DWORD PTR EN_TAG_QUEUING[rip], eax
	je	.L8
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	mov	edi, DWORD PTR MSG_SIMPLE_QTAG[rip]
	call	trm_reg_write8@PLT
	mov	edi, DWORD PTR 12[rbp]
	mov	esi, DWORD PTR TRMREG_SCSI_FIFO[rip]
	call	trm_reg_write8@PLT
	mov	r14d, DWORD PTR SCMD_SEL_ATN3[rip]
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	trm_StartSCSI, .-trm_StartSCSI
	.comm	WIDE_NEGO_ENABLE,4,4
	.comm	WIDE_NEGO_DONE,4,4
	.comm	TRMREG_SCSI_TARGETID,4,4
	.comm	TRMREG_SCSI_SYNC,4,4
	.comm	TRMREG_SCSI_STATUS,4,4
	.comm	TRMREG_SCSI_OFFSET,4,4
	.comm	TRMREG_SCSI_HOSTID,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_START_,8,8
	.comm	SRB_READY,8,8
	.comm	SRB_MSGOUT,8,8
	.comm	SCSI_NOP1,4,4
	.comm	SCSIINTERRUPT,4,4
	.comm	SCMD_SEL_ATNSTOP,4,4
	.comm	SCMD_SEL_ATN3,4,4
	.comm	SCMD_SEL_ATN,4,4
	.comm	REQUEST_SENSE,4,4
	.comm	PH_BUS_FREE,4,4
	.comm	MSG_SIMPLE_QTAG,4,4
	.comm	INQUIRY,8,8
	.comm	EN_TAG_QUEUING,4,4
	.comm	DO_HWRESELECT,4,4
	.comm	DO_DATALATCH,4,4
	.comm	DO_CLRFIFO,4,4
	.comm	AUTO_REQSENSE,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_StartSCSI.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	trm_StartSCSI, %function
trm_StartSCSI:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r7, r1
	mov	r5, r2
	ldr	r3, .L38
	mov	r9, r0
	ldr	r1, [r3]
	ldr	r0, [r0]
	ldr	r6, [r2, #24]
	bl	trm_reg_write8
	ldr	r3, .L38+4
	ldr	r0, [r7]
	ldr	r1, [r3]
	bl	trm_reg_write8
	ldr	r3, .L38+8
	ldr	r0, [r7, #4]
	ldr	r1, [r3]
	bl	trm_reg_write8
	ldr	r3, .L38+12
	ldr	r0, [r7, #8]
	ldr	r1, [r3]
	bl	trm_reg_write8
	ldr	r3, .L38+16
	ldr	r10, .L38+20
	ldr	r2, [r3]
	ldr	r3, .L38+24
	ldr	r1, [r10]
	ldr	r0, [r3]
	str	r2, [r5, #16]
	bl	trm_reg_write16
	ldr	r2, [r5]
	ldr	r3, .L38+28
	ldr	r2, [r2]
	ldr	r1, [r3]
	ldr	r0, [r7, #12]
	cmp	r2, r1
	ldreq	r4, .L38+32
	beq	.L2
	ldr	r3, .L38+36
	ldr	r4, .L38+32
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L2
	ldr	ip, [r5, #4]
	ldr	r3, [r4]
	tst	ip, r3
	beq	.L3
.L2:
	ldr	ip, .L38+40
	ldr	r3, [r7, #16]
	ldr	ip, [ip]
	tst	r3, ip
	beq	.L4
	ldr	ip, .L38+44
	ldr	ip, [ip]
	tst	r3, ip
	bne	.L4
.L5:
	tst	r0, #7
	moveq	r3, #1
	movne	r3, #0
	cmp	r2, r1
	moveq	r2, r3
	orrne	r2, r3, #1
	cmp	r2, #0
	beq	.L6
	ldr	r3, .L38+48
	ldr	r2, .L38+52
	ldr	r3, [r3]
	ldr	fp, [r2]
	str	r3, [r5, #20]
	ldr	r3, [r4]
	ldr	r4, [r5, #4]
	ands	r4, r4, r3
	beq	.L8
.L37:
	ldr	r4, .L38+56
	ldr	r3, .L38+36
	ldr	r1, [r4]
	ldr	r0, [r3]
	bl	trm_reg_write8
	ldr	r0, [r7, #12]
	ldr	r1, [r4]
	lsl	r0, r0, #5
	bl	trm_reg_write8
	ldr	r1, [r4]
	mov	r0, #0
	bl	trm_reg_write8
	ldr	r1, [r4]
	mov	r0, #0
	bl	trm_reg_write8
	ldr	r1, [r4]
	ldr	r0, [r6]
	bl	trm_reg_write8
	mov	r0, #0
	ldr	r1, [r4]
	bl	trm_reg_write8
.L9:
	ldr	r3, .L38+60
	ldr	r0, [r3]
	bl	trm_reg_read16
	ldr	r3, .L38+64
	ldr	r3, [r3]
	ands	r4, r0, r3
	beq	.L12
	mov	r4, #1
	ldr	r3, .L38+68
	mov	r0, r4
	ldr	r3, [r3]
	str	r3, [r5, #20]
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L4:
	ldr	ip, .L38+72
	ldr	ip, [ip]
	tst	r3, ip
	bne	.L36
.L6:
	ldr	r8, .L38+56
	and	r0, r0, #191
	ldr	r1, [r8]
	bl	trm_reg_write8
	ldr	r3, .L38+76
	ldr	r2, .L38+80
	ldr	r3, [r3]
	ldr	fp, [r2]
	str	r3, [r5, #20]
.L7:
	ldr	r3, [r4]
	ldr	r4, [r5, #4]
	ands	r4, r4, r3
	bne	.L37
.L8:
	ldr	r3, [r5, #12]
	ldr	r6, [r5]
	cmp	r3, #0
	ble	.L9
	ldr	r8, .L38+56
.L11:
	ldr	r1, [r8]
	ldr	r0, [r6], #4
	bl	trm_reg_write8
	ldr	r3, [r5, #12]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L11
	b	.L9
.L36:
	ldr	ip, .L38+84
	ldr	ip, [ip]
	tst	r3, ip
	bne	.L6
	b	.L5
.L12:
	ldr	r1, .L38+88
	ldr	r2, .L38+92
	ldr	r3, .L38+96
	ldr	r2, [r2]
	ldr	r0, [r1]
	ldr	r3, [r3]
	str	r2, [r5, #16]
	ldr	r1, [r10]
	str	r7, [r9, #4]
	orr	r0, r0, r3
	str	r5, [r7, #20]
	bl	trm_reg_write16
	ldr	r3, .L38+100
	mov	r0, fp
	ldr	r1, [r3]
	bl	trm_reg_write8
	mov	r0, r4
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	ldr	r8, .L38+56
	ldr	r1, [r8]
	bl	trm_reg_write8
	ldr	r3, .L38+104
	ldr	r1, [r7, #16]
	ldr	r3, [r3]
	ldr	r2, .L38+76
	tst	r1, r3
	ldr	r2, [r2]
	ldr	r3, .L38+80
	str	r2, [r5, #20]
	ldr	fp, [r3]
	beq	.L7
	ldr	r3, .L38+108
	ldr	r1, [r8]
	ldr	r0, [r3]
	bl	trm_reg_write8
	ldr	r1, [r8]
	ldr	r0, [r5, #8]
	bl	trm_reg_write8
	ldr	r3, .L38+112
	ldr	fp, [r3]
	b	.L7
.L39:
	.align	2
.L38:
	.word	TRMREG_SCSI_HOSTID
	.word	TRMREG_SCSI_TARGETID
	.word	TRMREG_SCSI_SYNC
	.word	TRMREG_SCSI_OFFSET
	.word	PH_BUS_FREE
	.word	TRMREG_SCSI_CONTROL
	.word	DO_CLRFIFO
	.word	INQUIRY
	.word	AUTO_REQSENSE
	.word	REQUEST_SENSE
	.word	WIDE_NEGO_ENABLE
	.word	WIDE_NEGO_DONE
	.word	SRB_MSGOUT
	.word	SCMD_SEL_ATNSTOP
	.word	TRMREG_SCSI_FIFO
	.word	TRMREG_SCSI_STATUS
	.word	SCSIINTERRUPT
	.word	SRB_READY
	.word	SYNC_NEGO_ENABLE
	.word	SRB_START_
	.word	SCMD_SEL_ATN
	.word	SYNC_NEGO_DONE
	.word	DO_DATALATCH
	.word	SCSI_NOP1
	.word	DO_HWRESELECT
	.word	TRMREG_SCSI_COMMAND
	.word	EN_TAG_QUEUING
	.word	MSG_SIMPLE_QTAG
	.word	SCMD_SEL_ATN3
	.size	trm_StartSCSI, .-trm_StartSCSI
	.comm	WIDE_NEGO_ENABLE,4,4
	.comm	WIDE_NEGO_DONE,4,4
	.comm	TRMREG_SCSI_TARGETID,4,4
	.comm	TRMREG_SCSI_SYNC,4,4
	.comm	TRMREG_SCSI_STATUS,4,4
	.comm	TRMREG_SCSI_OFFSET,4,4
	.comm	TRMREG_SCSI_HOSTID,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_START_,4,4
	.comm	SRB_READY,4,4
	.comm	SRB_MSGOUT,4,4
	.comm	SCSI_NOP1,4,4
	.comm	SCSIINTERRUPT,4,4
	.comm	SCMD_SEL_ATNSTOP,4,4
	.comm	SCMD_SEL_ATN3,4,4
	.comm	SCMD_SEL_ATN,4,4
	.comm	REQUEST_SENSE,4,4
	.comm	PH_BUS_FREE,4,4
	.comm	MSG_SIMPLE_QTAG,4,4
	.comm	INQUIRY,4,4
	.comm	EN_TAG_QUEUING,4,4
	.comm	DO_HWRESELECT,4,4
	.comm	DO_DATALATCH,4,4
	.comm	DO_CLRFIFO,4,4
	.comm	AUTO_REQSENSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
