	.file	"extr_cpia.c_restart_flicker.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	restart_flicker, @function
restart_flicker:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	esi, 2
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	mov	edi, 1
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	FIRMWARE_VERSION@PLT
	test	eax, eax
	jne	.L15
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	lea	rbp, 12[rbx]
	mov	rdi, rbp
	call	mutex_lock@PLT
	cmp	QWORD PTR 40[rbx], 0
	je	.L7
	mov	rax, QWORD PTR [rbx]
	mov	eax, DWORD PTR 156[rax]
	test	eax, eax
	je	.L7
	mov	edx, DWORD PTR 52[rbx]
	mov	edi, DWORD PTR 24[rbx]
	mov	esi, DWORD PTR 28[rbx]
	mov	ecx, DWORD PTR 48[rbx]
	test	edx, edx
	jne	.L5
	add	eax, eax
	lea	r8d, -2[rcx]
	cdq
	idiv	ecx
	cmp	r8d, edx
	jle	.L7
	mov	DWORD PTR 52[rbx], 1
.L5:
	sal	esi, 8
	add	ecx, DWORD PTR ROUND_UP_EXP_FOR_FLICKER[rip]
	add	esi, edi
	cmp	ecx, esi
	jl	.L16
.L7:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	rdi, rbp
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	jmp	mutex_unlock@PLT
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	lea	rsi, 8[rbx]
	lea	rdi, 24[rbx]
	mov	edx, 1
	call	set_flicker@PLT
	mov	eax, DWORD PTR 8[rbx]
	test	DWORD PTR COMMAND_SETEXPOSURE[rip], eax
	je	.L7
	cmp	DWORD PTR 32[rbx], 2
	jne	.L7
	mov	eax, DWORD PTR EXPOSURE_NORMAL[rip]
	mov	DWORD PTR 16[rbx], eax
	jmp	.L7
	.cfi_endproc
.LFE0:
	.size	restart_flicker, .-restart_flicker
	.comm	ROUND_UP_EXP_FOR_FLICKER,4,4
	.comm	EXPOSURE_NORMAL,4,4
	.comm	COMMAND_SETEXPOSURE,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_cpia.c_restart_flicker.c"
	.text
	.global	__aeabi_idivmod
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	restart_flicker, %function
restart_flicker:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r1, #2
	mov	r4, r0
	mov	r0, #1
	bl	FIRMWARE_VERSION
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, pc}
	add	r5, r4, #8
	mov	r0, r5
	bl	mutex_lock
	ldr	r3, [r4, #28]
	cmp	r3, #0
	beq	.L7
	ldr	r3, [r4]
	ldr	r0, [r3, #156]
	cmp	r0, #0
	beq	.L7
	ldr	r3, [r4, #36]
	ldr	r7, [r4, #16]
	cmp	r3, #0
	ldr	r8, [r4, #20]
	ldr	r6, [r4, #32]
	bne	.L5
	mov	r1, r6
	lsl	r0, r0, #1
	bl	__aeabi_idivmod
	sub	r3, r6, #2
	cmp	r3, r1
	movgt	r3, #1
	strgt	r3, [r4, #36]
	bgt	.L5
.L7:
	mov	r0, r5
	pop	{r4, r5, r6, r7, r8, lr}
	b	mutex_unlock
.L5:
	ldr	r3, .L18
	add	r7, r7, r8, lsl #8
	ldr	r3, [r3]
	add	r6, r6, r3
	cmp	r6, r7
	bge	.L7
	mov	r2, #1
	add	r1, r4, #4
	add	r0, r4, #16
	bl	set_flicker
	ldr	r3, .L18+4
	ldr	r2, [r4, #4]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L7
	ldr	r3, [r4, #24]
	cmp	r3, #2
	ldreq	r3, .L18+8
	ldreq	r3, [r3]
	streq	r3, [r4, #12]
	b	.L7
.L19:
	.align	2
.L18:
	.word	ROUND_UP_EXP_FOR_FLICKER
	.word	COMMAND_SETEXPOSURE
	.word	EXPOSURE_NORMAL
	.size	restart_flicker, .-restart_flicker
	.comm	ROUND_UP_EXP_FOR_FLICKER,4,4
	.comm	EXPOSURE_NORMAL,4,4
	.comm	COMMAND_SETEXPOSURE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
