	.file	"extr_cx231xx-avcore.c_cx231xx_gpio_i2c_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	cx231xx_gpio_i2c_read
	.type	cx231xx_gpio_i2c_read, @function
cx231xx_gpio_i2c_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, ecx
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	mutex_lock@PLT
	mov	rdi, rbp
	call	cx231xx_gpio_i2c_start@PLT
	mov	rdi, rbp
	lea	esi, 1[r13+r13]
	call	cx231xx_gpio_i2c_write_byte@PLT
	mov	rdi, rbp
	call	cx231xx_gpio_i2c_read_ack@PLT
	test	r12d, r12d
	jle	.L2
	lea	eax, -1[r12]
	sal	rax, 2
	lea	r12, [rbx+rax]
	lea	r13, 4[rbx+rax]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rdi, rbp
	add	rbx, 4
	call	cx231xx_gpio_i2c_write_ack@PLT
	cmp	rbx, r13
	je	.L2
.L3:
	mov	DWORD PTR [rbx], 0
	mov	rsi, rbx
	mov	rdi, rbp
	call	cx231xx_gpio_i2c_read_byte@PLT
	cmp	rbx, r12
	jne	.L7
.L2:
	mov	rdi, rbp
	call	cx231xx_gpio_i2c_write_nak@PLT
	mov	rdi, rbp
	call	cx231xx_gpio_i2c_end@PLT
	mov	rdi, rbp
	mov	r12d, eax
	call	mutex_unlock@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	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
	ret
	.cfi_endproc
.LFE0:
	.size	cx231xx_gpio_i2c_read, .-cx231xx_gpio_i2c_read
	.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_cx231xx-avcore.c_cx231xx_gpio_i2c_read.c"
	.text
	.align	2
	.global	cx231xx_gpio_i2c_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	cx231xx_gpio_i2c_read, %function
cx231xx_gpio_i2c_read:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r4, r0
	mov	r6, r1
	mov	r7, r3
	mov	r5, r2
	bl	mutex_lock
	mov	r0, r4
	bl	cx231xx_gpio_i2c_start
	lsl	r1, r6, #1
	add	r1, r1, #1
	mov	r0, r4
	bl	cx231xx_gpio_i2c_write_byte
	mov	r0, r4
	bl	cx231xx_gpio_i2c_read_ack
	cmp	r7, #0
	ble	.L2
	mov	r6, #0
	mov	r8, r6
	b	.L3
.L6:
	mov	r0, r4
	bl	cx231xx_gpio_i2c_write_ack
.L3:
	mov	r1, r5
	mov	r0, r4
	add	r6, r6, #1
	str	r8, [r5], #4
	bl	cx231xx_gpio_i2c_read_byte
	cmp	r6, r7
	bne	.L6
.L2:
	mov	r0, r4
	bl	cx231xx_gpio_i2c_write_nak
	mov	r0, r4
	bl	cx231xx_gpio_i2c_end
	mov	r3, r0
	mov	r0, r4
	mov	r4, r3
	bl	mutex_unlock
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
	.size	cx231xx_gpio_i2c_read, .-cx231xx_gpio_i2c_read
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
