	.file	"extr_wd33c93.c_reset_wd33c93.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	reset_wd33c93, @function
reset_wd33c93:
.LFB0:
	.cfi_startproc
	endbr64
	mov	esi, DWORD PTR WD_OWN_ID[rip]
	mov	edx, DWORD PTR OWNID_EAF[rip]
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	or	edx, DWORD PTR OWNID_RAF[rip]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, QWORD PTR 16[rdi]
	or	edx, DWORD PTR 8[rdi]
	mov	ebp, DWORD PTR 36[rbx]
	or	edx, DWORD PTR [rbx]
	mov	edi, ebp
	call	write_wd33c93@PLT
	mov	esi, DWORD PTR WD_CONTROL[rip]
	mov	edx, DWORD PTR CTRL_IDI[rip]
	mov	edi, ebp
	or	edx, DWORD PTR CTRL_EDI[rip]
	or	edx, DWORD PTR CTRL_POLLED[rip]
	call	write_wd33c93@PLT
	mov	eax, DWORD PTR 4[rbx]
	mov	ecx, DWORD PTR 32[rbx]
	mov	esi, DWORD PTR DEFAULT_SX_OFF[rip]
	test	eax, eax
	lea	edi, 3[rax]
	cmovns	edi, eax
	xor	edx, edx
	sar	edi, 2
	call	calc_sync_xfer@PLT
	mov	esi, DWORD PTR WD_SYNCHRONOUS_TRANSFER[rip]
	mov	edi, ebp
	mov	edx, eax
	call	write_wd33c93@PLT
	mov	edx, DWORD PTR WD_CMD_RESET[rip]
	mov	esi, DWORD PTR WD_COMMAND[rip]
	mov	edi, ebp
	call	write_wd33c93@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	mov	edi, ebp
	call	read_aux_stat@PLT
	test	DWORD PTR ASR_INT[rip], eax
	je	.L2
	mov	esi, DWORD PTR WD_SCSI_STATUS[rip]
	mov	edi, ebp
	call	read_wd33c93@PLT
	mov	esi, DWORD PTR WD_CDB_1[rip]
	mov	edi, ebp
	mov	r12, rax
	call	read_wd33c93@PLT
	mov	QWORD PTR 24[rbx], rax
	test	r12d, r12d
	jne	.L3
	mov	rax, QWORD PTR C_WD33C93[rip]
	mov	QWORD PTR 8[rbx], rax
.L4:
	cmp	QWORD PTR C_WD33C93B[rip], rax
	je	.L7
	mov	QWORD PTR 16[rbx], 0
.L7:
	mov	edx, DWORD PTR TIMEOUT_PERIOD_VALUE[rip]
	mov	esi, DWORD PTR WD_TIMEOUT_PERIOD[rip]
	mov	edi, ebp
	call	write_wd33c93@PLT
	mov	esi, DWORD PTR WD_CONTROL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	edi, ebp
	mov	edx, DWORD PTR CTRL_IDI[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	or	edx, DWORD PTR CTRL_EDI[rip]
	pop	r12
	.cfi_def_cfa_offset 8
	or	edx, DWORD PTR CTRL_POLLED[rip]
	jmp	write_wd33c93@PLT
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	cmp	r12d, 1
	je	.L12
	mov	rax, QWORD PTR C_UNKNOWN_CHIP[rip]
	mov	QWORD PTR 8[rbx], rax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	mov	esi, DWORD PTR WD_QUEUE_TAG[rip]
	mov	edi, ebp
	mov	edx, 165
	call	write_wd33c93@PLT
	mov	esi, DWORD PTR WD_QUEUE_TAG[rip]
	mov	edi, ebp
	call	read_wd33c93@PLT
	cmp	eax, 165
	je	.L13
	mov	rax, QWORD PTR C_WD33C93A[rip]
	mov	QWORD PTR 8[rbx], rax
	jmp	.L4
.L13:
	mov	rax, QWORD PTR C_WD33C93B[rip]
	mov	esi, DWORD PTR WD_QUEUE_TAG[rip]
	xor	edx, edx
	mov	edi, ebp
	mov	QWORD PTR 8[rbx], rax
	call	write_wd33c93@PLT
	mov	rax, QWORD PTR 8[rbx]
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	reset_wd33c93, .-reset_wd33c93
	.comm	WD_TIMEOUT_PERIOD,4,4
	.comm	WD_SYNCHRONOUS_TRANSFER,4,4
	.comm	WD_SCSI_STATUS,4,4
	.comm	WD_QUEUE_TAG,4,4
	.comm	WD_OWN_ID,4,4
	.comm	WD_CONTROL,4,4
	.comm	WD_COMMAND,4,4
	.comm	WD_CMD_RESET,4,4
	.comm	WD_CDB_1,4,4
	.comm	TIMEOUT_PERIOD_VALUE,4,4
	.comm	OWNID_RAF,4,4
	.comm	OWNID_EAF,4,4
	.comm	DEFAULT_SX_OFF,4,4
	.comm	C_WD33C93B,8,8
	.comm	C_WD33C93A,8,8
	.comm	C_WD33C93,8,8
	.comm	C_UNKNOWN_CHIP,8,8
	.comm	CTRL_POLLED,4,4
	.comm	CTRL_IDI,4,4
	.comm	CTRL_EDI,4,4
	.comm	ASR_INT,4,4
	.comm	ASR_BSY,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_wd33c93.c_reset_wd33c93.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	reset_wd33c93, %function
reset_wd33c93:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r2, .L15
	ldr	r3, .L15+4
	ldr	r5, [r0, #8]
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r0, [r0, #4]
	ldr	r4, [r5, #24]
	orr	r3, r3, r2
	ldr	r1, .L15+8
	ldr	r2, [r5]
	orr	r3, r3, r0
	ldr	r9, .L15+12
	ldr	r8, .L15+16
	orr	r2, r3, r2
	ldr	r1, [r1]
	mov	r0, r4
	ldr	r7, .L15+20
	bl	write_wd33c93
	ldr	r1, [r8]
	ldr	r3, [r9]
	ldr	r2, [r7]
	ldr	r6, .L15+24
	orr	r3, r3, r1
	orr	r2, r3, r2
	ldr	r1, [r6]
	mov	r0, r4
	bl	write_wd33c93
	ldr	r0, [r5, #4]
	ldr	r1, .L15+28
	cmp	r0, #0
	add	r3, r0, #3
	movlt	r0, r3
	ldr	r2, .L15+32
	ldr	r10, [r1]
	ldr	r3, [r5, #20]
	ldr	r1, [r2]
	asr	r0, r0, #2
	mov	r2, #0
	bl	calc_sync_xfer
	mov	r1, r10
	mov	r2, r0
	mov	r0, r4
	bl	write_wd33c93
	ldr	r3, .L15+36
	ldr	r2, .L15+40
	mov	r0, r4
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	write_wd33c93
	ldr	r10, .L15+44
.L2:
	mov	r0, r4
	bl	read_aux_stat
	ldr	r3, [r10]
	tst	r0, r3
	beq	.L2
	ldr	r3, .L15+48
	mov	r0, r4
	ldr	r1, [r3]
	bl	read_wd33c93
	ldr	r3, .L15+52
	mov	r10, r0
	ldr	r1, [r3]
	mov	r0, r4
	bl	read_wd33c93
	cmp	r10, #0
	str	r0, [r5, #16]
	beq	.L12
	cmp	r10, #1
	beq	.L13
	ldr	r3, .L15+56
	ldr	r10, .L15+60
	ldr	r3, [r3]
	str	r3, [r5, #8]
.L4:
	ldr	r2, [r10]
	mov	r0, r4
	cmp	r2, r3
	movne	r3, #0
	ldr	r2, .L15+64
	strne	r3, [r5, #12]
	ldr	r3, .L15+68
	ldr	r2, [r2]
	ldr	r1, [r3]
	bl	write_wd33c93
	ldr	r1, [r8]
	ldr	r3, [r9]
	ldr	r2, [r7]
	orr	r3, r3, r1
	mov	r0, r4
	ldr	r1, [r6]
	orr	r2, r3, r2
	pop	{r3, r4, r5, r6, r7, r8, r9, r10, fp, lr}
	b	write_wd33c93
.L12:
	ldr	r3, .L15+72
	ldr	r10, .L15+60
	ldr	r3, [r3]
	str	r3, [r5, #8]
	b	.L4
.L13:
	ldr	fp, .L15+76
	mov	r2, #165
	ldr	r1, [fp]
	mov	r0, r4
	bl	write_wd33c93
	mov	r0, r4
	ldr	r1, [fp]
	bl	read_wd33c93
	cmp	r0, #165
	beq	.L14
	ldr	r3, .L15+80
	ldr	r10, .L15+60
	ldr	r3, [r3]
	str	r3, [r5, #8]
	b	.L4
.L14:
	ldr	r10, .L15+60
	mov	r2, #0
	ldr	r3, [r10]
	mov	r0, r4
	str	r3, [r5, #8]
	ldr	r1, [fp]
	bl	write_wd33c93
	ldr	r3, [r5, #8]
	b	.L4
.L16:
	.align	2
.L15:
	.word	OWNID_RAF
	.word	OWNID_EAF
	.word	WD_OWN_ID
	.word	CTRL_IDI
	.word	CTRL_EDI
	.word	CTRL_POLLED
	.word	WD_CONTROL
	.word	WD_SYNCHRONOUS_TRANSFER
	.word	DEFAULT_SX_OFF
	.word	WD_COMMAND
	.word	WD_CMD_RESET
	.word	ASR_INT
	.word	WD_SCSI_STATUS
	.word	WD_CDB_1
	.word	C_UNKNOWN_CHIP
	.word	C_WD33C93B
	.word	TIMEOUT_PERIOD_VALUE
	.word	WD_TIMEOUT_PERIOD
	.word	C_WD33C93
	.word	WD_QUEUE_TAG
	.word	C_WD33C93A
	.size	reset_wd33c93, .-reset_wd33c93
	.comm	WD_TIMEOUT_PERIOD,4,4
	.comm	WD_SYNCHRONOUS_TRANSFER,4,4
	.comm	WD_SCSI_STATUS,4,4
	.comm	WD_QUEUE_TAG,4,4
	.comm	WD_OWN_ID,4,4
	.comm	WD_CONTROL,4,4
	.comm	WD_COMMAND,4,4
	.comm	WD_CMD_RESET,4,4
	.comm	WD_CDB_1,4,4
	.comm	TIMEOUT_PERIOD_VALUE,4,4
	.comm	OWNID_RAF,4,4
	.comm	OWNID_EAF,4,4
	.comm	DEFAULT_SX_OFF,4,4
	.comm	C_WD33C93B,4,4
	.comm	C_WD33C93A,4,4
	.comm	C_WD33C93,4,4
	.comm	C_UNKNOWN_CHIP,4,4
	.comm	CTRL_POLLED,4,4
	.comm	CTRL_IDI,4,4
	.comm	CTRL_EDI,4,4
	.comm	ASR_INT,4,4
	.comm	ASR_BSY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
