	.file	"extr_mr97310a.c_setgain.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	setgain, @function
setgain:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	edx, esi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	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
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR [rdi]
	cmp	rax, QWORD PTR CAM_TYPE_CIF[rip]
	je	.L11
.L2:
	cmp	rax, QWORD PTR CAM_TYPE_VGA[rip]
	jne	.L3
	cmp	DWORD PTR 8[rbp], 2
	je	.L12
.L3:
	mov	esi, 16
.L9:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	rdi, rbp
	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	sensor_write1@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	cmp	DWORD PTR 8[rdi], 1
	mov	esi, 14
	jne	.L2
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L12:
	mov	r13d, edx
	movzx	ebx, dl
	mov	r12d, 10
	sar	r13d, 8
.L4:
	mov	esi, r12d
	mov	edx, r13d
	mov	rdi, rbp
	call	sensor_write1@PLT
	lea	esi, 1[r12]
	mov	edx, ebx
	mov	rdi, rbp
	call	sensor_write1@PLT
	add	r12d, 2
	cmp	r12d, 18
	jne	.L4
	add	rsp, 8
	.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
	ret
	.cfi_endproc
.LFE0:
	.size	setgain, .-setgain
	.comm	CAM_TYPE_VGA,8,8
	.comm	CAM_TYPE_CIF,8,8
	.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_mr97310a.c_setgain.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	setgain, %function
setgain:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r2, .L13
	ldr	r3, [r0]
	ldr	ip, [r2]
	push	{r4, r5, r6, r7, r8, lr}
	cmp	r3, ip
	mov	r4, r0
	mov	r2, r1
	beq	.L11
.L2:
	ldr	r1, .L13+4
	ldr	r1, [r1]
	cmp	r3, r1
	bne	.L3
	ldr	r3, [r4, #4]
	cmp	r3, #2
	beq	.L12
.L3:
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #16
	b	sensor_write1
.L11:
	ldr	r1, [r0, #4]
	cmp	r1, #1
	bne	.L2
	pop	{r4, r5, r6, r7, r8, lr}
	mov	r1, #14
	b	sensor_write1
.L12:
	mov	r6, #10
	asr	r7, r2, #8
	and	r5, r2, #255
.L4:
	mov	r1, r6
	mov	r2, r7
	mov	r0, r4
	bl	sensor_write1
	add	r1, r6, #1
	mov	r2, r5
	mov	r0, r4
	add	r6, r6, #2
	bl	sensor_write1
	cmp	r6, #18
	bne	.L4
	pop	{r4, r5, r6, r7, r8, pc}
.L14:
	.align	2
.L13:
	.word	CAM_TYPE_CIF
	.word	CAM_TYPE_VGA
	.size	setgain, .-setgain
	.comm	CAM_TYPE_VGA,4,4
	.comm	CAM_TYPE_CIF,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
