	.file	"extr_i2c-synquacer.c_synquacer_i2c_hw_init.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	synquacer_i2c_hw_init, @function
synquacer_i2c_hw_init:
.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
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	r12d, DWORD PTR 16[rdi]
	mov	rsi, QWORD PTR SYNQUACER_I2C_REG_ADR[rip]
	add	rsi, QWORD PTR 8[rdi]
	xor	edi, edi
	call	writeb@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	rbp, QWORD PTR SYNQUACER_I2C_REG_FSR[rip]
	add	rbp, QWORD PTR 8[rbx]
	call	SYNQUACER_I2C_BUS_CLK_FR@PLT
	mov	rsi, rbp
	movzx	edi, al
	call	writeb@PLT
	mov	eax, DWORD PTR [rbx]
	cmp	eax, 128
	je	.L2
	cmp	eax, 129
	jne	.L3
	mov	eax, DWORD PTR SYNQUACER_I2C_CLK_RATE_18M[rip]
	mov	edi, r12d
	cmp	DWORD PTR 16[rbx], eax
	jg	.L4
	call	SYNQUACER_I2C_CCR_CS_FAST_MAX_18M@PLT
	mov	edi, r12d
	mov	r13d, eax
	call	SYNQUACER_I2C_CSR_CS_FAST_MAX_18M@PLT
	mov	ebp, eax
.L5:
	movzx	edi, BYTE PTR SYNQUACER_I2C_CCR_FM[rip]
	or	dil, BYTE PTR SYNQUACER_I2C_CCR_EN[rip]
	or	edi, r13d
	mov	rsi, QWORD PTR SYNQUACER_I2C_REG_CCR[rip]
	add	rsi, QWORD PTR 8[rbx]
	movzx	edi, dil
	call	writeb@PLT
	mov	rsi, QWORD PTR SYNQUACER_I2C_REG_CSR[rip]
	movzx	edi, bpl
	add	rsi, QWORD PTR 8[rbx]
	call	writeb@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L2:
	mov	eax, DWORD PTR SYNQUACER_I2C_CLK_RATE_18M[rip]
	mov	edi, r12d
	cmp	DWORD PTR 16[rbx], eax
	jle	.L11
	call	SYNQUACER_I2C_CCR_CS_STD_MIN_18M@PLT
	mov	edi, r12d
	mov	ebp, eax
	call	SYNQUACER_I2C_CSR_CS_STD_MIN_18M@PLT
	mov	r12d, eax
.L8:
	movzx	edi, BYTE PTR SYNQUACER_I2C_CCR_EN[rip]
	mov	rsi, QWORD PTR SYNQUACER_I2C_REG_CCR[rip]
	add	rsi, QWORD PTR 8[rbx]
	or	edi, ebp
	movzx	edi, dil
	call	writeb@PLT
	mov	rsi, QWORD PTR SYNQUACER_I2C_REG_CSR[rip]
	movzx	edi, r12b
	add	rsi, QWORD PTR 8[rbx]
	call	writeb@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, 1
	call	WARN_ON@PLT
.L6:
	mov	rsi, QWORD PTR SYNQUACER_I2C_REG_BCR[rip]
	xor	edi, edi
	add	rsi, QWORD PTR 8[rbx]
	call	writeb@PLT
	mov	rsi, QWORD PTR SYNQUACER_I2C_REG_BC2R[rip]
	add	rsi, QWORD PTR 8[rbx]
	xor	edi, edi
	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	writeb@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	call	SYNQUACER_I2C_CCR_CS_STD_MAX_18M@PLT
	mov	edi, r12d
	mov	ebp, eax
	call	SYNQUACER_I2C_CSR_CS_STD_MAX_18M@PLT
	mov	r12d, eax
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L4:
	call	SYNQUACER_I2C_CCR_CS_FAST_MIN_18M@PLT
	mov	edi, r12d
	mov	r13d, eax
	call	SYNQUACER_I2C_CSR_CS_FAST_MIN_18M@PLT
	mov	ebp, eax
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	synquacer_i2c_hw_init, .-synquacer_i2c_hw_init
	.comm	SYNQUACER_I2C_REG_FSR,8,8
	.comm	SYNQUACER_I2C_REG_CSR,8,8
	.comm	SYNQUACER_I2C_REG_CCR,8,8
	.comm	SYNQUACER_I2C_REG_BCR,8,8
	.comm	SYNQUACER_I2C_REG_BC2R,8,8
	.comm	SYNQUACER_I2C_REG_ADR,8,8
	.comm	SYNQUACER_I2C_CLK_RATE_18M,4,4
	.comm	SYNQUACER_I2C_CCR_FM,1,1
	.comm	SYNQUACER_I2C_CCR_EN,1,1
	.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_i2c-synquacer.c_synquacer_i2c_hw_init.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	synquacer_i2c_hw_init, %function
synquacer_i2c_hw_init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	ldr	r3, .L13
	ldr	r1, [r0, #4]
	ldr	r3, [r3]
	mov	r0, #0
	add	r1, r1, r3
	ldr	r5, [r4, #8]
	bl	writeb
	ldr	r0, [r4, #8]
	bl	SYNQUACER_I2C_BUS_CLK_FR
	ldr	r3, .L13+4
	ldr	r1, [r4, #4]
	ldr	r3, [r3]
	add	r1, r1, r3
	bl	writeb
	ldr	r3, [r4]
	cmp	r3, #128
	beq	.L2
	cmp	r3, #129
	bne	.L3
	ldr	r3, .L13+8
	ldr	r2, [r4, #8]
	ldr	r3, [r3]
	mov	r0, r5
	cmp	r2, r3
	bgt	.L4
	bl	SYNQUACER_I2C_CCR_CS_FAST_MAX_18M
	mov	r3, r0
	mov	r0, r5
	mov	r5, r3
	bl	SYNQUACER_I2C_CSR_CS_FAST_MAX_18M
	mov	r6, r0
.L5:
	ldr	r2, .L13+12
	ldr	r3, .L13+16
	ldrb	r0, [r2]	@ zero_extendqisi2
	ldrb	r3, [r3]	@ zero_extendqisi2
	ldr	r2, .L13+20
	orr	r3, r3, r0
	b	.L10
.L2:
	ldr	r3, .L13+8
	ldr	r2, [r4, #8]
	ldr	r3, [r3]
	mov	r0, r5
	cmp	r2, r3
	ble	.L12
	bl	SYNQUACER_I2C_CCR_CS_STD_MIN_18M
	mov	r3, r0
	mov	r0, r5
	mov	r5, r3
	bl	SYNQUACER_I2C_CSR_CS_STD_MIN_18M
	mov	r6, r0
.L8:
	ldr	r3, .L13+12
	ldr	r2, .L13+20
	ldrb	r3, [r3]	@ zero_extendqisi2
.L10:
	ldr	r2, [r2]
	ldr	r1, [r4, #4]
	orr	r3, r5, r3
	add	r1, r1, r2
	and	r0, r3, #255
	bl	writeb
	ldr	r3, .L13+24
	ldr	r1, [r4, #4]
	ldr	r3, [r3]
	mov	r0, r6
	add	r1, r1, r3
	bl	writeb
	b	.L6
.L3:
	mov	r0, #1
	bl	WARN_ON
.L6:
	ldr	r3, .L13+28
	ldr	r1, [r4, #4]
	ldr	r3, [r3]
	mov	r0, #0
	add	r1, r1, r3
	bl	writeb
	ldr	r3, .L13+32
	ldr	r1, [r4, #4]
	ldr	r3, [r3]
	mov	r0, #0
	pop	{r4, r5, r6, lr}
	add	r1, r1, r3
	b	writeb
.L12:
	bl	SYNQUACER_I2C_CCR_CS_STD_MAX_18M
	mov	r3, r0
	mov	r0, r5
	mov	r5, r3
	bl	SYNQUACER_I2C_CSR_CS_STD_MAX_18M
	mov	r6, r0
	b	.L8
.L4:
	bl	SYNQUACER_I2C_CCR_CS_FAST_MIN_18M
	mov	r3, r0
	mov	r0, r5
	mov	r5, r3
	bl	SYNQUACER_I2C_CSR_CS_FAST_MIN_18M
	mov	r6, r0
	b	.L5
.L14:
	.align	2
.L13:
	.word	SYNQUACER_I2C_REG_ADR
	.word	SYNQUACER_I2C_REG_FSR
	.word	SYNQUACER_I2C_CLK_RATE_18M
	.word	SYNQUACER_I2C_CCR_EN
	.word	SYNQUACER_I2C_CCR_FM
	.word	SYNQUACER_I2C_REG_CCR
	.word	SYNQUACER_I2C_REG_CSR
	.word	SYNQUACER_I2C_REG_BCR
	.word	SYNQUACER_I2C_REG_BC2R
	.size	synquacer_i2c_hw_init, .-synquacer_i2c_hw_init
	.comm	SYNQUACER_I2C_REG_FSR,4,4
	.comm	SYNQUACER_I2C_REG_CSR,4,4
	.comm	SYNQUACER_I2C_REG_CCR,4,4
	.comm	SYNQUACER_I2C_REG_BCR,4,4
	.comm	SYNQUACER_I2C_REG_BC2R,4,4
	.comm	SYNQUACER_I2C_REG_ADR,4,4
	.comm	SYNQUACER_I2C_CLK_RATE_18M,4,4
	.comm	SYNQUACER_I2C_CCR_FM,1,1
	.comm	SYNQUACER_I2C_CCR_EN,1,1
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
