	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mode_init_regs
_mode_init_regs:                        ## @mode_init_regs
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	cmpl	$0, 40(%rdi)
	je	LBB0_2
## %bb.3:
	movl	%r8d, %r15d
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movl	%esi, %r14d
	movq	(%rdi), %rax
	movq	_BCL_OV518@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	%r12d, %ecx
	jne	LBB0_5
## %bb.4:
	callq	_ov518_mode_init_regs
	jmp	LBB0_6
LBB0_2:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_5:
	callq	_ov511_mode_init_regs
LBB0_6:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FATAL_ERROR
	testq	%rax, %rax
	jne	LBB0_23
## %bb.7:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	8(%rdi), %eax
	leal	-129(%rax), %ecx
	cmpl	$6, %ecx
	jae	LBB0_8
## %bb.11:
	movl	%r14d, %esi
	movl	%r13d, %edx
	movl	%r12d, %ecx
	movl	%r15d, %r8d
	callq	_set_ov_sensor_window
	movl	%eax, %ebx
	jmp	LBB0_15
LBB0_8:
	leal	-135(%rax), %ecx
	cmpl	$2, %ecx
	jae	LBB0_9
## %bb.12:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_14
LBB0_9:
	cmpl	$128, %eax
	jne	LBB0_13
## %bb.10:
	movl	$31, %esi
	callq	_i2c_r
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	callq	_PDEBUG
	jmp	LBB0_15
LBB0_13:
	leaq	L_.str.2(%rip), %rdi
LBB0_14:
	callq	_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %edi
	callq	_FATAL_ERROR
	testq	%rax, %rax
	jne	LBB0_23
## %bb.16:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	36(%rdi), %esi
	callq	_sensor_set_auto_brightness
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FATAL_ERROR
	testq	%rax, %rax
	jne	LBB0_23
## %bb.17:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	32(%rdi), %esi
	callq	_sensor_set_auto_exposure
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FATAL_ERROR
	testq	%rax, %rax
	jne	LBB0_23
## %bb.18:
	movq	_bandingfilter@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_sensor_set_banding_filter
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FATAL_ERROR
	testq	%rax, %rax
	je	LBB0_19
LBB0_23:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	cmpq	$0, 24(%rax)
	je	LBB0_21
## %bb.20:
	movq	_lightfreq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_sensor_set_light_freq
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FATAL_ERROR
	testq	%rax, %rax
	jne	LBB0_23
LBB0_21:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	16(%rdi), %esi
	callq	_sensor_set_backlight
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_FATAL_ERROR
	testq	%rax, %rax
	jne	LBB0_23
## %bb.22:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	12(%rdi), %esi
	callq	_sensor_set_mirror
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_FATAL_ERROR
	xorl	%ebx, %ebx
	testq	%rax, %rax
	cmovnel	%r14d, %ebx
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_BCL_OV518,8,3                  ## @BCL_OV518
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"KS0127-series decoders not supported yet"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"SAA status = 0x%02X"

L_.str.2:                               ## @.str.2
	.asciz	"Unknown sensor"

	.comm	_bandingfilter,4,2              ## @bandingfilter
	.comm	_lightfreq,4,2                  ## @lightfreq
	.no_dead_strip	_mode_init_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mode_init_regs
_mode_init_regs:                        ; @mode_init_regs
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0, #40]
	cbz	w8, LBB0_4
; %bb.2:
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x24, x1
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _BCL_OV518@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BCL_OV518@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	mov	x0, x19
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	bl	_ov518_mode_init_regs
	b	LBB0_6
LBB0_4:
Lloh3:
	adrp	x8, _EFAULT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_19
LBB0_5:
	bl	_ov511_mode_init_regs
LBB0_6:
	mov	x20, x0
	bl	_FATAL_ERROR
	cbnz	x0, LBB0_19
; %bb.7:
	ldr	w8, [x19, #8]
	sub	w9, w8, #129
	cmp	w9, #6
	b.hs	LBB0_9
; %bb.8:
	mov	x0, x19
	mov	x1, x24
	mov	x2, x23
	mov	x3, x22
	mov	x4, x21
	bl	_set_ov_sensor_window
	mov	x20, x0
	b	LBB0_15
LBB0_9:
	sub	w9, w8, #135
	cmp	w9, #2
	b.hs	LBB0_11
; %bb.10:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_11:
	cmp	w8, #128
	b.ne	LBB0_13
; %bb.12:
	mov	x0, x19
	mov	w1, #31
	bl	_i2c_r
	mov	x2, x0
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_PDEBUG
	b	LBB0_15
LBB0_13:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_14:
	bl	_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_15:
	mov	x0, x20
	bl	_FATAL_ERROR
	cbnz	x0, LBB0_19
; %bb.16:
	ldr	w1, [x19, #36]
	mov	x0, x19
	bl	_sensor_set_auto_brightness
	mov	x20, x0
	bl	_FATAL_ERROR
	cbnz	x0, LBB0_19
; %bb.17:
	ldr	w1, [x19, #32]
	mov	x0, x19
	bl	_sensor_set_auto_exposure
	mov	x20, x0
	bl	_FATAL_ERROR
	cbnz	x0, LBB0_19
; %bb.18:
Lloh15:
	adrp	x8, _bandingfilter@GOTPAGE
Lloh16:
	ldr	x8, [x8, _bandingfilter@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sensor_set_banding_filter
	mov	x20, x0
	bl	_FATAL_ERROR
	cbz	x0, LBB0_20
LBB0_19:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_20:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_22
; %bb.21:
Lloh18:
	adrp	x8, _lightfreq@GOTPAGE
Lloh19:
	ldr	x8, [x8, _lightfreq@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_sensor_set_light_freq
	mov	x20, x0
	bl	_FATAL_ERROR
	cbnz	x0, LBB0_19
LBB0_22:
	ldr	w1, [x19, #16]
	mov	x0, x19
	bl	_sensor_set_backlight
	mov	x20, x0
	bl	_FATAL_ERROR
	cbnz	x0, LBB0_19
; %bb.23:
	ldr	w1, [x19, #12]
	mov	x0, x19
	bl	_sensor_set_mirror
	mov	x19, x0
	bl	_FATAL_ERROR
	cmp	x0, #0
	csel	w20, wzr, w19, eq
	b	LBB0_19
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_BCL_OV518,8,3                  ; @BCL_OV518
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"KS0127-series decoders not supported yet"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"SAA status = 0x%02X"

l_.str.2:                               ; @.str.2
	.asciz	"Unknown sensor"

	.comm	_bandingfilter,4,2              ; @bandingfilter
	.comm	_lightfreq,4,2                  ; @lightfreq
	.no_dead_strip	_mode_init_regs
.subsections_via_symbols
