	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_start
_sd_start:                              ## @sd_start
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	%rax, 24(%rdi)
	movl	(%rdi), %eax
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_6
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_3:
	movq	%rbx, %rdi
	callq	_ov518_mode_init_regs
	jmp	LBB0_6
LBB0_2:
	movq	%rbx, %rdi
	callq	_ov511_mode_init_regs
	jmp	LBB0_6
LBB0_5:
	movq	%rbx, %rdi
	callq	_w9968cf_mode_init_regs
	jmp	LBB0_6
LBB0_4:
	movq	%rbx, %rdi
	callq	_ov519_mode_init_regs
LBB0_6:
	movq	%rbx, %rdi
	callq	_set_ov_sensor_window
	movl	12(%rbx), %eax
	movq	_CONTRAST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jb	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_setcontrast
	movl	12(%rbx), %eax
LBB0_8:
	movq	_BRIGHTNESS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jb	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_setbrightness
	movl	12(%rbx), %eax
LBB0_10:
	movq	_COLORS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jb	LBB0_12
## %bb.11:
	movq	%rbx, %rdi
	callq	_setcolors
	movl	12(%rbx), %eax
LBB0_12:
	movq	_VFLIP@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edx
	shll	%cl, %edx
	movq	_HFLIP@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	btsl	%ecx, %edx
	testl	%eax, %edx
	jne	LBB0_14
## %bb.13:
	movq	%rbx, %rdi
	callq	_sethvflip
	movl	12(%rbx), %eax
LBB0_14:
	movq	_AUTOBRIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jb	LBB0_16
## %bb.15:
	movq	%rbx, %rdi
	callq	_setautobright
	movl	12(%rbx), %eax
LBB0_16:
	movq	_FREQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	btl	%ecx, %eax
	jb	LBB0_18
## %bb.17:
	movq	%rbx, %rdi
	callq	_setfreq_i
LBB0_18:
	movl	$1, 4(%rbx)
	movq	%rbx, %rdi
	callq	_sd_reset_snapshot
	movl	$3, 8(%rbx)
	movq	%rbx, %rdi
	callq	_ov51x_restart
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_ov51x_led_control
	movl	(%rbx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_5
	.long	L0_0_set_4
	.long	L0_0_set_3
	.long	L0_0_set_3
	.long	L0_0_set_2
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_CONTRAST,4,2                   ## @CONTRAST
	.comm	_BRIGHTNESS,4,2                 ## @BRIGHTNESS
	.comm	_COLORS,4,2                     ## @COLORS
	.comm	_HFLIP,4,2                      ## @HFLIP
	.comm	_VFLIP,4,2                      ## @VFLIP
	.comm	_AUTOBRIGHT,4,2                 ## @AUTOBRIGHT
	.comm	_FREQ,4,2                       ## @FREQ
	.no_dead_strip	_sd_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_start
_sd_start:                              ; @sd_start
	.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
	ldr	d0, [x0, #16]
	str	d0, [x0, #24]
	ldr	w8, [x0]
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_6
; %bb.1:
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	mov	x0, x19
	bl	_ov518_mode_init_regs
	b	LBB0_6
LBB0_3:
	mov	x0, x19
	bl	_ov511_mode_init_regs
	b	LBB0_6
LBB0_4:
	mov	x0, x19
	bl	_w9968cf_mode_init_regs
	b	LBB0_6
LBB0_5:
	mov	x0, x19
	bl	_ov519_mode_init_regs
LBB0_6:
	mov	x0, x19
	bl	_set_ov_sensor_window
	ldr	w8, [x19, #12]
Lloh2:
	adrp	x9, _CONTRAST@GOTPAGE
Lloh3:
	ldr	x9, [x9, _CONTRAST@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	lsr	w9, w8, w9
	tbnz	w9, #0, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_setcontrast
	ldr	w8, [x19, #12]
LBB0_8:
Lloh5:
	adrp	x9, _BRIGHTNESS@GOTPAGE
Lloh6:
	ldr	x9, [x9, _BRIGHTNESS@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	lsr	w9, w8, w9
	tbnz	w9, #0, LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_setbrightness
	ldr	w8, [x19, #12]
LBB0_10:
Lloh8:
	adrp	x9, _COLORS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _COLORS@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	lsr	w9, w8, w9
	tbnz	w9, #0, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_setcolors
	ldr	w8, [x19, #12]
LBB0_12:
Lloh11:
	adrp	x9, _HFLIP@GOTPAGE
Lloh12:
	ldr	x9, [x9, _HFLIP@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	mov	w10, #1
	lsl	w9, w10, w9
Lloh14:
	adrp	x11, _VFLIP@GOTPAGE
Lloh15:
	ldr	x11, [x11, _VFLIP@GOTPAGEOFF]
Lloh16:
	ldr	w11, [x11]
	lsl	w10, w10, w11
	orr	w9, w10, w9
	tst	w9, w8
	b.ne	LBB0_14
; %bb.13:
	mov	x0, x19
	bl	_sethvflip
	ldr	w8, [x19, #12]
LBB0_14:
Lloh17:
	adrp	x9, _AUTOBRIGHT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _AUTOBRIGHT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	lsr	w9, w8, w9
	tbnz	w9, #0, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_setautobright
	ldr	w8, [x19, #12]
LBB0_16:
Lloh20:
	adrp	x9, _FREQ@GOTPAGE
Lloh21:
	ldr	x9, [x9, _FREQ@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	lsr	w8, w8, w9
	tbnz	w8, #0, LBB0_18
; %bb.17:
	mov	x0, x19
	bl	_setfreq_i
LBB0_18:
	mov	w8, #1
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_sd_reset_snapshot
	mov	w8, #3
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_ov51x_restart
	mov	x0, x19
	mov	w1, #1
	bl	_ov51x_led_control
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
                                        ; -- End function
	.comm	_CONTRAST,4,2                   ; @CONTRAST
	.comm	_BRIGHTNESS,4,2                 ; @BRIGHTNESS
	.comm	_COLORS,4,2                     ; @COLORS
	.comm	_HFLIP,4,2                      ; @HFLIP
	.comm	_VFLIP,4,2                      ; @VFLIP
	.comm	_AUTOBRIGHT,4,2                 ; @AUTOBRIGHT
	.comm	_FREQ,4,2                       ; @FREQ
	.no_dead_strip	_sd_start
.subsections_via_symbols
