	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov5640_restore_mode
_ov5640_restore_mode:                   ## @ov5640_restore_mode
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_ov5640_mode_init_data@GOTPCREL(%rip), %r14
	movq	%r14, %rsi
	callq	_ov5640_load_regs
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movq	%r14, 8(%r15)
	movq	_OV5640_REG_SYS_ROOT_DIVIDER@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_OV5640_SCLK2X_ROOT_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ilog2
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,4), %ebx
	movq	_OV5640_SCLK_ROOT_DIV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ilog2
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	$63, %edx
	movl	%ebx, %ecx
	callq	_ov5640_mod_reg
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r15, %rdi
	callq	_ov5640_set_mode
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	movq	%r15, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ov5640_set_framefmt            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ov5640_mode_init_data,4,2      ## @ov5640_mode_init_data
	.comm	_OV5640_REG_SYS_ROOT_DIVIDER,4,2 ## @OV5640_REG_SYS_ROOT_DIVIDER
	.comm	_OV5640_SCLK2X_ROOT_DIV,4,2     ## @OV5640_SCLK2X_ROOT_DIV
	.comm	_OV5640_SCLK_ROOT_DIV,4,2       ## @OV5640_SCLK_ROOT_DIV
	.no_dead_strip	_ov5640_restore_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov5640_restore_mode
_ov5640_restore_mode:                   ; @ov5640_restore_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
Lloh0:
	adrp	x20, _ov5640_mode_init_data@GOTPAGE
Lloh1:
	ldr	x20, [x20, _ov5640_mode_init_data@GOTPAGEOFF]
	mov	x1, x20
	bl	_ov5640_load_regs
	tbnz	w0, #31, LBB0_2
; %bb.1:
	str	x20, [x19, #8]
Lloh2:
	adrp	x8, _OV5640_REG_SYS_ROOT_DIVIDER@GOTPAGE
Lloh3:
	ldr	x8, [x8, _OV5640_REG_SYS_ROOT_DIVIDER@GOTPAGEOFF]
Lloh4:
	ldr	w20, [x8]
Lloh5:
	adrp	x8, _OV5640_SCLK2X_ROOT_DIV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _OV5640_SCLK2X_ROOT_DIV@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_ilog2
	mov	x21, x0
Lloh8:
	adrp	x8, _OV5640_SCLK_ROOT_DIV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _OV5640_SCLK_ROOT_DIV@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_ilog2
	orr	w3, w0, w21, lsl #2
	mov	x0, x19
	mov	x1, x20
	mov	w2, #63
	bl	_ov5640_mod_reg
	cbz	w0, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x0, x19
	bl	_ov5640_set_mode
	tbnz	w0, #31, LBB0_2
; %bb.4:
	mov	x0, x19
	mov	x1, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_ov5640_set_framefmt
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_ov5640_mode_init_data,4,2      ; @ov5640_mode_init_data
	.comm	_OV5640_REG_SYS_ROOT_DIVIDER,4,2 ; @OV5640_REG_SYS_ROOT_DIVIDER
	.comm	_OV5640_SCLK2X_ROOT_DIV,4,2     ; @OV5640_SCLK2X_ROOT_DIV
	.comm	_OV5640_SCLK_ROOT_DIV,4,2       ; @OV5640_SCLK_ROOT_DIV
	.no_dead_strip	_ov5640_restore_mode
.subsections_via_symbols
