	.file	"extr_i2c.c_i2c_do_wait.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"after sending slave address"
.LC1:
	.string	"no ack %s"
.LC2:
	.string	"arbitration lost"
.LC3:
	.string	"transfer unfinished"
	.text
	.p2align 4
	.type	i2c_do_wait, @function
i2c_do_wait:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12d, ecx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rsi
	mov	esi, DWORD PTR I2C_STATUS_REG[rip]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rdi, rbp
	mov	ebx, edx
	call	i2c_read_reg@PLT
	test	DWORD PTR I2CSR_MIF[rip], eax
	je	.L2
	test	ebx, ebx
	je	.L3
	test	r12d, r12d
	je	.L3
	test	DWORD PTR I2CSR_RXAK[rip], eax
	jne	.L20
	test	DWORD PTR I2CSR_MAL[rip], eax
	jne	.L8
.L2:
	mov	r12d, DWORD PTR IIC_NOERR[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	mov	eax, r12d
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	test	DWORD PTR I2CSR_MAL[rip], eax
	jne	.L8
	and	eax, DWORD PTR I2CSR_MCF[rip]
	or	eax, ebx
	jne	.L2
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	debugf@PLT
	mov	r12d, DWORD PTR IIC_EBUSERR[rip]
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L8:
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	debugf@PLT
	mov	r12d, DWORD PTR IIC_EBUSERR[rip]
.L5:
	mov	esi, DWORD PTR I2C_STATUS_REG[rip]
	mov	rdi, rbp
	xor	edx, edx
	call	i2c_write_reg@PLT
	mov	esi, DWORD PTR I2C_CONTROL_REG[rip]
	mov	edx, DWORD PTR I2CCR_MEN[rip]
	mov	rdi, rbp
	or	edx, DWORD PTR I2CCR_TXAK[rip]
	call	i2c_write_reg@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L20:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	debugf@PLT
	mov	r12d, DWORD PTR IIC_ENOACK[rip]
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	i2c_do_wait, .-i2c_do_wait
	.comm	IIC_NOERR,4,4
	.comm	IIC_ENOACK,4,4
	.comm	IIC_EBUSERR,4,4
	.comm	I2C_STATUS_REG,4,4
	.comm	I2C_CONTROL_REG,4,4
	.comm	I2CSR_RXAK,4,4
	.comm	I2CSR_MIF,4,4
	.comm	I2CSR_MCF,4,4
	.comm	I2CSR_MAL,4,4
	.comm	I2CCR_TXAK,4,4
	.comm	I2CCR_MEN,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_i2c.c_i2c_do_wait.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"after sending slave address\000"
	.align	2
.LC1:
	.ascii	"no ack %s\000"
	.align	2
.LC2:
	.ascii	"arbitration lost\000"
	.align	2
.LC3:
	.ascii	"transfer unfinished\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	i2c_do_wait, %function
i2c_do_wait:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r7, .L15
	mov	r0, r1
	mov	r4, r1
	ldr	r1, [r7]
	mov	r6, r3
	mov	r5, r2
	bl	i2c_read_reg
	ldr	r3, .L15+4
	ldr	r3, [r3]
	tst	r0, r3
	beq	.L2
	cmp	r5, #0
	cmpne	r6, #0
	beq	.L3
	ldr	r3, .L15+8
	ldr	r3, [r3]
	tst	r0, r3
	bne	.L14
	ldr	r3, .L15+12
	ldr	r3, [r3]
	tst	r0, r3
	bne	.L8
.L2:
	ldr	r3, .L15+16
	ldr	r5, [r3]
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L3:
	ldr	r3, .L15+12
	ldr	r3, [r3]
	tst	r0, r3
	bne	.L8
	ldr	r3, .L15+20
	ldr	r3, [r3]
	and	r0, r0, r3
	orrs	r3, r0, r5
	bne	.L2
	ldr	r0, .L15+24
	bl	debugf
	ldr	r3, .L15+28
	ldr	r5, [r3]
	b	.L5
.L8:
	ldr	r0, .L15+32
	bl	debugf
	ldr	r3, .L15+28
	ldr	r5, [r3]
.L5:
	ldr	r1, [r7]
	mov	r2, #0
	mov	r0, r4
	bl	i2c_write_reg
	ldr	r2, .L15+36
	ldr	r3, .L15+40
	ldr	r1, [r2]
	ldr	r2, [r3]
	ldr	r3, .L15+44
	orr	r2, r1, r2
	mov	r0, r4
	ldr	r1, [r3]
	bl	i2c_write_reg
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, pc}
.L14:
	ldr	r1, .L15+48
	ldr	r0, .L15+52
	bl	debugf
	ldr	r3, .L15+56
	ldr	r5, [r3]
	b	.L5
.L16:
	.align	2
.L15:
	.word	I2C_STATUS_REG
	.word	I2CSR_MIF
	.word	I2CSR_RXAK
	.word	I2CSR_MAL
	.word	IIC_NOERR
	.word	I2CSR_MCF
	.word	.LC3
	.word	IIC_EBUSERR
	.word	.LC2
	.word	I2CCR_MEN
	.word	I2CCR_TXAK
	.word	I2C_CONTROL_REG
	.word	.LC0
	.word	.LC1
	.word	IIC_ENOACK
	.size	i2c_do_wait, .-i2c_do_wait
	.comm	IIC_NOERR,4,4
	.comm	IIC_ENOACK,4,4
	.comm	IIC_EBUSERR,4,4
	.comm	I2C_STATUS_REG,4,4
	.comm	I2C_CONTROL_REG,4,4
	.comm	I2CSR_RXAK,4,4
	.comm	I2CSR_MIF,4,4
	.comm	I2CSR_MCF,4,4
	.comm	I2CSR_MAL,4,4
	.comm	I2CCR_TXAK,4,4
	.comm	I2CCR_MEN,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
