	.file	"extr_aic7xxx.c_ahc_set_syncrate.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	" DT"
.LC1:
	.string	""
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"%s: target %d synchronous at %sMHz%s, offset = 0x%x\n"
	.align 8
.LC3:
	.string	"%s: target %d using asynchronous transfers\n"
	.text
	.p2align 4
	.globl	ahc_set_syncrate
	.type	ahc_set_syncrate, @function
ahc_set_syncrate:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, r9
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rcx
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, r8
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	ecx, DWORD PTR 0[rbp]
	mov	QWORD PTR 8[rsp], r9
	lea	r8, 32[rsp]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR AHC_TRANS_ACTIVE[rip]
	mov	QWORD PTR 16[rsp], rdx
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	test	rdx, rdx
	mov	edx, DWORD PTR 12[rsi]
	mov	esi, DWORD PTR 8[rsi]
	cmove	rbx, rax
	cmove	r13, rax
	call	ahc_fetch_transinfo@PLT
	mov	r9, QWORD PTR 112[rsp]
	mov	r11, QWORD PTR 16[rsp]
	test	QWORD PTR AHC_TRANS_USER[rip], r9
	mov	r12, rax
	je	.L3
	mov	QWORD PTR 72[rax], r13
	mov	QWORD PTR 64[rax], rbx
	mov	QWORD PTR 56[rax], r15
.L3:
	test	QWORD PTR AHC_TRANS_GOAL[rip], r9
	je	.L4
	mov	rax, QWORD PTR 8[rsp]
	mov	QWORD PTR 48[r12], r13
	mov	QWORD PTR 40[r12], rbx
	mov	QWORD PTR 32[r12], rax
.L4:
	xor	r15d, r15d
	test	QWORD PTR AHC_TRANS_CUR[rip], r9
	je	.L5
	cmp	QWORD PTR 8[r12], r13
	setne	dl
	cmp	QWORD PTR 16[r12], rbx
	setne	al
	or	dl, al
	jne	.L24
	mov	rax, QWORD PTR 8[rsp]
	cmp	QWORD PTR 24[r12], rax
	je	.L5
.L24:
	mov	rax, QWORD PTR 24[rsp]
	mov	r15, QWORD PTR [r12]
	mov	edx, DWORD PTR [r14]
	and	rax, r9
	test	DWORD PTR AHC_ULTRA2[rip], edx
	je	.L7
	mov	rsi, QWORD PTR SINGLE_EDGE[rip]
	mov	rdx, QWORD PTR SXFR_ULTRA2[rip]
	mov	rcx, QWORD PTR ENABLE_CRC[rip]
	or	rdx, rsi
	or	rdx, rcx
	not	rdx
	and	r15, rdx
	test	r11, r11
	je	.L8
	or	r15, QWORD PTR [r11]
	mov	rdi, QWORD PTR 8[rsp]
	or	rcx, r15
	or	rsi, r15
	test	QWORD PTR MSG_EXT_PPR_DT_REQ[rip], rdi
	cmove	rcx, rsi
	mov	r15, rcx
.L8:
	cmp	QWORD PTR 24[rsp], rax
	je	.L15
.L12:
	mov	rax, QWORD PTR 8[rsp]
	mov	QWORD PTR [r12], r15
	xor	r9d, r9d
	mov	rdi, r14
	mov	QWORD PTR 8[r12], r13
	mov	esi, DWORD PTR 8[rbp]
	mov	r15d, 1
	mov	r8d, DWORD PTR AC_TRANSFER_NEG[rip]
	mov	edx, DWORD PTR 0[rbp]
	mov	QWORD PTR 16[r12], rbx
	mov	QWORD PTR 24[r12], rax
	mov	ecx, DWORD PTR CAM_LUN_WILDCARD[rip]
	mov	QWORD PTR 16[rsp], r11
	call	ahc_send_async@PLT
	cmp	QWORD PTR bootverbose[rip], 0
	je	.L5
	mov	r13d, DWORD PTR 0[rbp]
	test	rbx, rbx
	je	.L16
	mov	r11, QWORD PTR 16[rsp]
	mov	rax, QWORD PTR 8[rsp]
	lea	r8, .LC1[rip]
	mov	rdi, r14
	test	QWORD PTR MSG_EXT_PPR_DT_REQ[rip], rax
	lea	rax, .LC0[rip]
	cmovne	r8, rax
	mov	rcx, QWORD PTR 16[r11]
	mov	QWORD PTR 24[rsp], r8
	mov	QWORD PTR 8[rsp], rcx
	call	ahc_name@PLT
	mov	r8, QWORD PTR 24[rsp]
	mov	r9, rbx
	mov	edx, r13d
	mov	rcx, QWORD PTR 8[rsp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	printf@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	mov	r8d, DWORD PTR AHC_NEG_TO_GOAL[rip]
	mov	rcx, r12
	mov	rsi, rbp
	mov	rdi, r14
	mov	rdx, QWORD PTR 32[rsp]
	call	ahc_update_neg_request@PLT
	add	r15d, eax
	jne	.L50
.L1:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L51
	add	rsp, 56
	.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
.L50:
	.cfi_restore_state
	mov	rdi, r14
	call	ahc_update_pending_scbs@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L7:
	mov	r8, QWORD PTR SXFR[rip]
	mov	rcx, QWORD PTR SOFS[rip]
	mov	rsi, QWORD PTR 32[rsp]
	mov	r9d, DWORD PTR 4[rbp]
	mov	rdx, r8
	or	rdx, rcx
	mov	edi, DWORD PTR [rsi]
	not	rdx
	and	r15, rdx
	mov	edx, r9d
	not	edx
	and	edx, edi
	mov	DWORD PTR [rsi], edx
	test	r11, r11
	je	.L10
	movsx	rdx, DWORD PTR 8[r11]
	test	DWORD PTR ULTRA_SXFR[rip], edx
	je	.L11
	or	edi, r9d
	mov	DWORD PTR [rsi], edi
.L11:
	and	r8, rdx
	and	rcx, rbx
	or	rcx, r8
	or	r15, rcx
.L10:
	cmp	QWORD PTR 24[rsp], rax
	jne	.L12
	mov	esi, DWORD PTR SXFRCTL0[rip]
	mov	rdi, r14
	mov	QWORD PTR 16[rsp], r11
	call	ahc_inb@PLT
	mov	rdx, QWORD PTR FAST20[rip]
	mov	rcx, QWORD PTR 32[rsp]
	mov	rdi, r14
	mov	esi, DWORD PTR [rcx]
	mov	rcx, rdx
	or	rdx, rax
	not	rcx
	and	rcx, rax
	test	DWORD PTR 4[rbp], esi
	mov	esi, DWORD PTR SXFRCTL0[rip]
	cmove	rdx, rcx
	call	ahc_outb@PLT
	mov	r11, QWORD PTR 16[rsp]
.L15:
	mov	esi, DWORD PTR SCSIRATE[rip]
	mov	rdx, r15
	mov	rdi, r14
	mov	QWORD PTR 16[rsp], r11
	call	ahc_outb@PLT
	mov	eax, DWORD PTR [r14]
	test	DWORD PTR AHC_ULTRA2[rip], eax
	mov	r11, QWORD PTR 16[rsp]
	je	.L12
	mov	esi, DWORD PTR SCSIOFFSET[rip]
	mov	rdx, rbx
	mov	rdi, r14
	call	ahc_outb@PLT
	mov	r11, QWORD PTR 16[rsp]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L16:
	mov	rdi, r14
	call	ahc_name@PLT
	mov	edx, r13d
	lea	rdi, .LC3[rip]
	mov	rsi, rax
	xor	eax, eax
	call	printf@PLT
	jmp	.L5
.L51:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ahc_set_syncrate, .-ahc_set_syncrate
	.comm	bootverbose,8,8
	.comm	ULTRA_SXFR,4,4
	.comm	SXFR_ULTRA2,8,8
	.comm	SXFRCTL0,4,4
	.comm	SXFR,8,8
	.comm	SOFS,8,8
	.comm	SINGLE_EDGE,8,8
	.comm	SCSIRATE,4,4
	.comm	SCSIOFFSET,4,4
	.comm	MSG_EXT_PPR_DT_REQ,8,8
	.comm	FAST20,8,8
	.comm	ENABLE_CRC,8,8
	.comm	CAM_LUN_WILDCARD,4,4
	.comm	AHC_ULTRA2,4,4
	.comm	AHC_TRANS_USER,8,8
	.comm	AHC_TRANS_GOAL,8,8
	.comm	AHC_TRANS_CUR,8,8
	.comm	AHC_TRANS_ACTIVE,8,8
	.comm	AHC_NEG_TO_GOAL,4,4
	.comm	AC_TRANSFER_NEG,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_aic7xxx.c_ahc_set_syncrate.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	" DT\000"
	.align	2
.LC1:
	.ascii	"\000"
	.align	2
.LC2:
	.ascii	"%s: target %d synchronous at %sMHz%s, offset = 0x%x"
	.ascii	"\012\000"
	.align	2
.LC3:
	.ascii	"%s: target %d using asynchronous transfers\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	ahc_set_syncrate
	.syntax unified
	.arm
	.fpu softvfp
	.type	ahc_set_syncrate, %function
ahc_set_syncrate:
	@ args = 16, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #28
	add	lr, sp, #16
	ldr	ip, .L50
	subs	r6, r2, #0
	mov	r5, r3
	ldr	r2, [r1, #12]
	ldr	r3, [r1]
	mov	r8, r1
	ldr	r1, [r1, #8]
	str	lr, [sp]
	ldr	ip, [ip]
	ldr	lr, .L50+4
	moveq	r5, r6
	ldr	r9, [sp, #64]
	ldr	fp, [sp, #72]
	moveq	r9, r6
	ldr	lr, [lr]
	str	lr, [sp, #20]
	mov	lr,#0
	mov	r10, r0
	str	ip, [sp, #8]
	bl	ahc_fetch_transinfo
	ldr	r3, .L50+8
	mov	r4, r0
	ldr	r3, [r3]
	tst	fp, r3
	ldrne	r3, [sp, #68]
	strne	r5, [r0, #36]
	strne	r3, [r0, #28]
	ldr	r3, .L50+12
	strne	r9, [r0, #32]
	ldr	r3, [r3]
	tst	fp, r3
	ldrne	r3, [sp, #68]
	strne	r5, [r0, #24]
	strne	r3, [r0, #16]
	ldr	r3, .L50+16
	strne	r9, [r0, #20]
	ldr	r7, [r3]
	ands	r7, fp, r7
	beq	.L5
	ldr	r7, [r0, #4]
	ldr	r2, [r0, #8]
	ldr	r3, [r0, #12]
	cmp	r2, r9
	cmpeq	r7, r5
	movne	r7, #1
	moveq	r7, #0
	ldr	r2, [sp, #68]
	cmp	r3, r2
	orrne	r7, r7, #1
	cmp	r7, #0
	beq	.L5
	ldr	r3, .L50+20
	ldr	r1, [r10]
	ldr	r2, [r3]
	ldr	r3, [sp, #8]
	tst	r1, r2
	and	r3, r3, fp
	ldr	fp, [r0]
	beq	.L6
	ldr	r2, .L50+24
	ldr	r0, .L50+28
	ldr	r1, .L50+32
	ldr	r2, [r2]
	ldr	r0, [r0]
	ldr	r1, [r1]
	orr	r0, r2, r0
	orr	r0, r0, r1
	cmp	r6, #0
	bic	fp, fp, r0
	beq	.L7
	ldr	ip, [r6]
	ldr	r0, .L50+36
	orr	fp, fp, ip
	ldr	r0, [r0]
	ldr	ip, [sp, #68]
	tst	ip, r0
	orrne	fp, r1, fp
	orreq	fp, r2, fp
.L7:
	ldr	r2, [sp, #8]
	cmp	r2, r3
	beq	.L14
.L11:
	mov	r2, #0
	ldr	r1, .L50+40
	ldr	r0, [sp, #68]
	ldr	r1, [r1]
	ldr	r3, .L50+44
	str	r0, [r4, #12]
	ldr	r3, [r3]
	stmib	r4, {r5, r9}
	str	fp, [r4]
	stm	sp, {r1, r2}
	mov	r0, r10
	ldr	r2, [r8]
	ldr	r1, [r8, #8]
	bl	ahc_send_async
	ldr	r3, .L50+48
	ldr	r3, [r3]
	cmp	r3, #0
	moveq	r7, #1
	beq	.L5
	cmp	r9, #0
	mov	r0, r10
	beq	.L15
	bl	ahc_name
	ldr	r3, .L50+36
	ldr	r2, [sp, #68]
	ldr	r3, [r3]
	mov	r1, r0
	tst	r2, r3
	ldr	r2, .L50+52
	ldr	r0, .L50+56
	moveq	r0, r2
	str	r9, [sp, #4]
	ldr	r3, [r6, #8]
	ldr	r2, [r8]
	str	r0, [sp]
	ldr	r0, .L50+60
	bl	printf
	mov	r7, #1
.L5:
	ldr	r2, .L50+64
	mov	r3, r4
	ldr	r2, [r2]
	mov	r1, r8
	str	r2, [sp]
	mov	r0, r10
	ldr	r2, [sp, #16]
	bl	ahc_update_neg_request
	cmn	r7, r0
	bne	.L48
.L1:
	ldr	r3, .L50+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L49
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L48:
	mov	r0, r10
	bl	ahc_update_pending_scbs
	b	.L1
.L6:
	ldr	r0, .L50+68
	ldr	r1, .L50+72
	ldr	ip, [r0]
	ldr	r0, [r8, #4]
	ldr	r2, [sp, #16]
	mov	r7, r0
	ldr	lr, [r1]
	ldr	r1, [r2]
	orr	r0, ip, lr
	str	r1, [sp, #12]
	cmp	r6, #0
	bic	r1, r1, r7
	bic	fp, fp, r0
	str	r1, [r2]
	beq	.L9
	ldr	r1, .L50+76
	ldr	r0, [r6, #4]
	ldr	r1, [r1]
	and	lr, lr, r9
	tst	r0, r1
	ldrne	r1, [sp, #12]
	and	r0, r0, ip
	orrne	r1, r1, r7
	orr	r0, r0, lr
	strne	r1, [r2]
	orr	fp, fp, r0
.L9:
	ldr	r2, [sp, #8]
	cmp	r2, r3
	bne	.L11
	ldr	r3, .L50+80
	mov	r0, r10
	ldr	r1, [r3]
	bl	ahc_inb
	ldr	r2, [sp, #16]
	ldr	r1, [r8, #4]
	ldr	ip, [r2]
	ldr	r2, .L50+84
	ldr	r3, .L50+80
	ldr	r2, [r2]
	tst	ip, r1
	biceq	r2, r0, r2
	orrne	r2, r2, r0
	ldr	r1, [r3]
	mov	r0, r10
	bl	ahc_outb
.L14:
	ldr	r3, .L50+88
	mov	r2, fp
	ldr	r1, [r3]
	mov	r0, r10
	bl	ahc_outb
	ldr	r3, .L50+20
	ldr	r2, [r10]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L11
	ldr	r3, .L50+92
	mov	r2, r9
	mov	r0, r10
	ldr	r1, [r3]
	bl	ahc_outb
	b	.L11
.L15:
	bl	ahc_name
	ldr	r2, [r8]
	mov	r1, r0
	ldr	r0, .L50+96
	bl	printf
	mov	r7, #1
	b	.L5
.L49:
	bl	__stack_chk_fail
.L51:
	.align	2
.L50:
	.word	AHC_TRANS_ACTIVE
	.word	.LC4
	.word	AHC_TRANS_USER
	.word	AHC_TRANS_GOAL
	.word	AHC_TRANS_CUR
	.word	AHC_ULTRA2
	.word	SINGLE_EDGE
	.word	SXFR_ULTRA2
	.word	ENABLE_CRC
	.word	MSG_EXT_PPR_DT_REQ
	.word	AC_TRANSFER_NEG
	.word	CAM_LUN_WILDCARD
	.word	bootverbose
	.word	.LC1
	.word	.LC0
	.word	.LC2
	.word	AHC_NEG_TO_GOAL
	.word	SXFR
	.word	SOFS
	.word	ULTRA_SXFR
	.word	SXFRCTL0
	.word	FAST20
	.word	SCSIRATE
	.word	SCSIOFFSET
	.word	.LC3
	.size	ahc_set_syncrate, .-ahc_set_syncrate
	.comm	bootverbose,4,4
	.comm	ULTRA_SXFR,4,4
	.comm	SXFR_ULTRA2,4,4
	.comm	SXFRCTL0,4,4
	.comm	SXFR,4,4
	.comm	SOFS,4,4
	.comm	SINGLE_EDGE,4,4
	.comm	SCSIRATE,4,4
	.comm	SCSIOFFSET,4,4
	.comm	MSG_EXT_PPR_DT_REQ,4,4
	.comm	FAST20,4,4
	.comm	ENABLE_CRC,4,4
	.comm	CAM_LUN_WILDCARD,4,4
	.comm	AHC_ULTRA2,4,4
	.comm	AHC_TRANS_USER,4,4
	.comm	AHC_TRANS_GOAL,4,4
	.comm	AHC_TRANS_CUR,4,4
	.comm	AHC_TRANS_ACTIVE,4,4
	.comm	AHC_NEG_TO_GOAL,4,4
	.comm	AC_TRANSFER_NEG,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
