	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function restart_flicker
_restart_flicker:                       ## @restart_flicker
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	$1, %edi
	movl	$2, %esi
	callq	_FIRMWARE_VERSION
	testl	%eax, %eax
	je	LBB0_12
## %bb.1:
	leaq	12(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpq	$0, 40(%rbx)
	je	LBB0_11
## %bb.2:
	movq	(%rbx), %rax
	movl	156(%rax), %eax
	testl	%eax, %eax
	je	LBB0_11
## %bb.3:
	movl	28(%rbx), %ecx
	shll	$8, %ecx
	addl	24(%rbx), %ecx
	cmpl	$0, 52(%rbx)
	je	LBB0_5
## %bb.4:
	movl	48(%rbx), %esi
	jmp	LBB0_7
LBB0_12:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	addl	%eax, %eax
	movl	48(%rbx), %esi
	cltd
	idivl	%esi
	leal	-3(%rsi), %eax
	cmpl	%eax, %edx
	jg	LBB0_11
## %bb.6:
	movl	$1, 52(%rbx)
LBB0_7:
	movq	_ROUND_UP_EXP_FOR_FLICKER@GOTPCREL(%rip), %rax
	addl	(%rax), %esi
	cmpl	%esi, %ecx
	jle	LBB0_11
## %bb.8:
	leaq	24(%rbx), %rdi
	leaq	8(%rbx), %rsi
	movl	$1, %edx
	callq	_set_flicker
	movq	_COMMAND_SETEXPOSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_11
## %bb.9:
	cmpl	$2, 32(%rbx)
	jne	LBB0_11
## %bb.10:
	movq	_EXPOSURE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 16(%rbx)
LBB0_11:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ROUND_UP_EXP_FOR_FLICKER,4,2   ## @ROUND_UP_EXP_FOR_FLICKER
	.comm	_COMMAND_SETEXPOSURE,4,2        ## @COMMAND_SETEXPOSURE
	.comm	_EXPOSURE_NORMAL,4,2            ## @EXPOSURE_NORMAL
	.no_dead_strip	_restart_flicker
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function restart_flicker
_restart_flicker:                       ; @restart_flicker
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	w0, #1
	mov	w1, #2
	bl	_FIRMWARE_VERSION
	cbz	w0, LBB0_5
; %bb.1:
	add	x20, x19, #12
	mov	x0, x20
	bl	_mutex_lock
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_12
; %bb.2:
	ldr	x8, [x19]
	ldr	w10, [x8, #156]
	cbz	w10, LBB0_12
; %bb.3:
	ldp	w8, w9, [x19, #24]
	ldr	w11, [x19, #52]
	cbz	w11, LBB0_6
; %bb.4:
	ldr	w10, [x19, #48]
	b	LBB0_8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	lsl	w11, w10, #1
	ldr	w10, [x19, #48]
	sdiv	w12, w11, w10
	msub	w11, w12, w10, w11
	sub	w12, w10, #3
	cmp	w11, w12
	b.gt	LBB0_12
; %bb.7:
	mov	w11, #1
	str	w11, [x19, #52]
LBB0_8:
	add	w8, w8, w9, lsl #8
Lloh0:
	adrp	x9, _ROUND_UP_EXP_FOR_FLICKER@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ROUND_UP_EXP_FOR_FLICKER@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w9, w9, w10
	cmp	w8, w9
	b.le	LBB0_12
; %bb.9:
	add	x0, x19, #24
	add	x1, x19, #8
	mov	w2, #1
	bl	_set_flicker
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _COMMAND_SETEXPOSURE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _COMMAND_SETEXPOSURE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.10:
	ldr	w8, [x19, #32]
	cmp	w8, #2
	b.ne	LBB0_12
; %bb.11:
Lloh6:
	adrp	x8, _EXPOSURE_NORMAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EXPOSURE_NORMAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #16]
LBB0_12:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_ROUND_UP_EXP_FOR_FLICKER,4,2   ; @ROUND_UP_EXP_FOR_FLICKER
	.comm	_COMMAND_SETEXPOSURE,4,2        ; @COMMAND_SETEXPOSURE
	.comm	_EXPOSURE_NORMAL,4,2            ; @EXPOSURE_NORMAL
	.no_dead_strip	_restart_flicker
.subsections_via_symbols
