	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stk_sensor_configure           ## -- Begin function stk_sensor_configure
	.p2align	4, 0x90
_stk_sensor_configure:                  ## @stk_sensor_configure
	.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
	movl	(%rdi), %esi
	leal	-133(%rsi), %eax
	cmpl	$5, %eax
	jae	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movl	4(%rdi), %ecx
	addl	$-128, %ecx
	cmpl	$5, %ecx
	jae	LBB0_3
## %bb.5:
	movslq	%eax, %r15
	leaq	l_switch.table.stk_sensor_configure(%rip), %rax
	movq	(%rax,%r15,8), %rax
	movslq	%ecx, %rcx
	leaq	l_switch.table.stk_sensor_configure.4(%rip), %rdx
	movq	(%rdx,%rcx,8), %rdx
	leaq	l_switch.table.stk_sensor_configure.5(%rip), %rsi
	movq	(%rsi,%rcx,8), %rcx
	movq	(%rcx), %r14
	movl	(%rdx), %edx
	orl	(%rax), %edx
	movq	_REG_COM7@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stk_sensor_outb
	movl	$50, %edi
	callq	_msleep
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_stk_sensor_write_regvals
	xorl	%edx, %edx
	cmpq	$0, 8(%rbx)
	movl	$0, %eax
	je	LBB0_7
## %bb.6:
	movq	_MVFP_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	leaq	l_switch.table.stk_sensor_configure.3(%rip), %rcx
	cmpq	$0, 16(%rbx)
	je	LBB0_9
## %bb.8:
	movq	_MVFP_MIRROR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_9:
	orl	%eax, %edx
	movl	(%rcx,%r15,4), %r14d
	movq	_REG_MVFP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stk_sensor_outb
	cmpl	$130, 4(%rbx)
	jne	LBB0_12
## %bb.10:
	cmpq	$0, 8(%rbx)
	jne	LBB0_12
## %bb.11:
	movq	_REG_TSLB@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$8, %edx
	callq	_stk_sensor_outb
LBB0_12:
	movq	_REG_ADVFH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	shrl	$8, %edx
	movq	%rbx, %rdi
	callq	_stk_sensor_outb
	movq	_REG_ADVFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	$223, %r14d
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_stk_sensor_outb
	movl	$50, %edi
	callq	_msleep
	cmpl	$133, (%rbx)
	jne	LBB0_15
## %bb.13:
	movq	%rbx, %rdi
	movl	$302, %esi                      ## imm = 0x12E
	movl	$1582, %edx                     ## imm = 0x62E
	movl	$6, %ecx
	movl	$486, %r8d                      ## imm = 0x1E6
	callq	_stk_sensor_set_hw
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
LBB0_15:
	movl	$10, %edi
	callq	_msleep
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_pr_err
LBB0_4:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COM7_FMT_QCIF,4,2              ## @COM7_FMT_QCIF
	.comm	_COM7_FMT_QVGA,4,2              ## @COM7_FMT_QVGA
	.comm	_COM7_FMT_CIF,4,2               ## @COM7_FMT_CIF
	.comm	_COM7_FMT_VGA,4,2               ## @COM7_FMT_VGA
	.comm	_COM7_FMT_SXGA,4,2              ## @COM7_FMT_SXGA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported mode %d\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_COM7_YUV,4,2                   ## @COM7_YUV
	.comm	_ov_fmt_uyvy,8,3                ## @ov_fmt_uyvy
	.comm	_ov_fmt_yuyv,8,3                ## @ov_fmt_yuyv
	.comm	_COM7_RGB,4,2                   ## @COM7_RGB
	.comm	_ov_fmt_rgbp,8,3                ## @ov_fmt_rgbp
	.comm	_ov_fmt_rgbr,8,3                ## @ov_fmt_rgbr
	.comm	_COM7_PBAYER,4,2                ## @COM7_PBAYER
	.comm	_ov_fmt_bayer,8,3               ## @ov_fmt_bayer
L_.str.1:                               ## @.str.1
	.asciz	"Unsupported colorspace\n"

	.comm	_REG_COM7,4,2                   ## @REG_COM7
	.comm	_MVFP_FLIP,4,2                  ## @MVFP_FLIP
	.comm	_MVFP_MIRROR,4,2                ## @MVFP_MIRROR
	.comm	_REG_MVFP,4,2                   ## @REG_MVFP
	.comm	_REG_TSLB,4,2                   ## @REG_TSLB
	.comm	_REG_ADVFH,4,2                  ## @REG_ADVFH
	.comm	_REG_ADVFL,4,2                  ## @REG_ADVFL
L_.str.2:                               ## @.str.2
	.asciz	"stk_sensor_set_hw failed (VGA)\n"

	.section	__DATA,__const
	.p2align	3                               ## @switch.table.stk_sensor_configure
l_switch.table.stk_sensor_configure:
	.quad	_COM7_FMT_VGA
	.quad	_COM7_FMT_SXGA
	.quad	_COM7_FMT_QVGA
	.quad	_COM7_FMT_QCIF
	.quad	_COM7_FMT_CIF

	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.stk_sensor_configure.3
l_switch.table.stk_sensor_configure.3:
	.long	11                              ## 0xb
	.long	0                               ## 0x0
	.long	267                             ## 0x10b
	.long	604                             ## 0x25c
	.long	412                             ## 0x19c

	.section	__DATA,__const
	.p2align	3                               ## @switch.table.stk_sensor_configure.4
l_switch.table.stk_sensor_configure.4:
	.quad	_COM7_YUV
	.quad	_COM7_YUV
	.quad	_COM7_PBAYER
	.quad	_COM7_RGB
	.quad	_COM7_RGB

	.p2align	3                               ## @switch.table.stk_sensor_configure.5
l_switch.table.stk_sensor_configure.5:
	.quad	_ov_fmt_yuyv
	.quad	_ov_fmt_uyvy
	.quad	_ov_fmt_bayer
	.quad	_ov_fmt_rgbr
	.quad	_ov_fmt_rgbp

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stk_sensor_configure           ; -- Begin function stk_sensor_configure
	.p2align	2
_stk_sensor_configure:                  ; @stk_sensor_configure
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	w9, [x0]
	sub	w8, w9, #133
	cmp	w8, #5
	b.hs	LBB0_9
; %bb.1:
	mov	x19, x0
	ldr	w9, [x0, #4]
	sub	w9, w9, #128
	cmp	w9, #5
	b.hs	LBB0_10
; %bb.2:
	sxtw	x10, w8
Lloh0:
	adrp	x11, l_switch.table.stk_sensor_configure.3@PAGE
Lloh1:
	add	x11, x11, l_switch.table.stk_sensor_configure.3@PAGEOFF
	ldr	w21, [x11, w8, sxtw #2]
Lloh2:
	adrp	x8, l_switch.table.stk_sensor_configure@PAGE
Lloh3:
	add	x8, x8, l_switch.table.stk_sensor_configure@PAGEOFF
	ldr	x8, [x8, x10, lsl #3]
	ldr	w8, [x8]
	sbfiz	x9, x9, #3, #32
Lloh4:
	adrp	x10, l_switch.table.stk_sensor_configure.4@PAGE
Lloh5:
	add	x10, x10, l_switch.table.stk_sensor_configure.4@PAGEOFF
	ldr	x10, [x10, x9]
Lloh6:
	adrp	x11, l_switch.table.stk_sensor_configure.5@PAGE
Lloh7:
	add	x11, x11, l_switch.table.stk_sensor_configure.5@PAGEOFF
	ldr	x9, [x11, x9]
	ldr	x20, [x9]
	ldr	w9, [x10]
	orr	w2, w9, w8
Lloh8:
	adrp	x8, _REG_COM7@GOTPAGE
Lloh9:
	ldr	x8, [x8, _REG_COM7@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stk_sensor_outb
	mov	w0, #50
	bl	_msleep
	mov	x0, x19
	mov	x1, x20
	bl	_stk_sensor_write_regvals
Lloh11:
	adrp	x8, _MVFP_FLIP@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MVFP_FLIP@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldp	x9, x10, [x19, #8]
	cmp	x9, #0
	csel	w8, wzr, w8, eq
Lloh14:
	adrp	x9, _MVFP_MIRROR@GOTPAGE
Lloh15:
	ldr	x9, [x9, _MVFP_MIRROR@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	x10, #0
	csel	w9, wzr, w9, eq
	orr	w2, w9, w8
Lloh17:
	adrp	x8, _REG_MVFP@GOTPAGE
Lloh18:
	ldr	x8, [x8, _REG_MVFP@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stk_sensor_outb
	ldr	w8, [x19, #4]
	cmp	w8, #130
	b.ne	LBB0_5
; %bb.3:
	ldr	x8, [x19, #8]
	cbnz	x8, LBB0_5
; %bb.4:
Lloh20:
	adrp	x8, _REG_TSLB@GOTPAGE
Lloh21:
	ldr	x8, [x8, _REG_TSLB@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #8
	bl	_stk_sensor_outb
LBB0_5:
Lloh23:
	adrp	x8, _REG_ADVFH@GOTPAGE
Lloh24:
	ldr	x8, [x8, _REG_ADVFH@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	lsr	w2, w21, #8
	mov	x0, x19
	bl	_stk_sensor_outb
Lloh26:
	adrp	x8, _REG_ADVFL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _REG_ADVFL@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	w8, #223
	and	w2, w21, w8
	mov	x0, x19
	bl	_stk_sensor_outb
	mov	w0, #50
	bl	_msleep
	ldr	w8, [x19]
	cmp	w8, #133
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x19
	mov	w1, #302
	mov	w2, #1582
	mov	w3, #6
	mov	w4, #486
	bl	_stk_sensor_set_hw
	cbz	w0, LBB0_8
; %bb.7:
Lloh29:
	adrp	x0, l_.str.2@PAGE
Lloh30:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_err
LBB0_8:
	mov	w0, #10
	bl	_msleep
	mov	w0, #0
	b	LBB0_12
LBB0_9:
	str	x9, [sp]
Lloh31:
	adrp	x0, l_.str@PAGE
Lloh32:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh33:
	adrp	x0, l_.str.1@PAGE
Lloh34:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_11:
	bl	_pr_err
Lloh35:
	adrp	x8, _EFAULT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_COM7_FMT_QCIF,4,2              ; @COM7_FMT_QCIF
	.comm	_COM7_FMT_QVGA,4,2              ; @COM7_FMT_QVGA
	.comm	_COM7_FMT_CIF,4,2               ; @COM7_FMT_CIF
	.comm	_COM7_FMT_VGA,4,2               ; @COM7_FMT_VGA
	.comm	_COM7_FMT_SXGA,4,2              ; @COM7_FMT_SXGA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported mode %d\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_COM7_YUV,4,2                   ; @COM7_YUV
	.comm	_ov_fmt_uyvy,8,3                ; @ov_fmt_uyvy
	.comm	_ov_fmt_yuyv,8,3                ; @ov_fmt_yuyv
	.comm	_COM7_RGB,4,2                   ; @COM7_RGB
	.comm	_ov_fmt_rgbp,8,3                ; @ov_fmt_rgbp
	.comm	_ov_fmt_rgbr,8,3                ; @ov_fmt_rgbr
	.comm	_COM7_PBAYER,4,2                ; @COM7_PBAYER
	.comm	_ov_fmt_bayer,8,3               ; @ov_fmt_bayer
l_.str.1:                               ; @.str.1
	.asciz	"Unsupported colorspace\n"

	.comm	_REG_COM7,4,2                   ; @REG_COM7
	.comm	_MVFP_FLIP,4,2                  ; @MVFP_FLIP
	.comm	_MVFP_MIRROR,4,2                ; @MVFP_MIRROR
	.comm	_REG_MVFP,4,2                   ; @REG_MVFP
	.comm	_REG_TSLB,4,2                   ; @REG_TSLB
	.comm	_REG_ADVFH,4,2                  ; @REG_ADVFH
	.comm	_REG_ADVFL,4,2                  ; @REG_ADVFL
l_.str.2:                               ; @.str.2
	.asciz	"stk_sensor_set_hw failed (VGA)\n"

	.section	__DATA,__const
	.p2align	3                               ; @switch.table.stk_sensor_configure
l_switch.table.stk_sensor_configure:
	.quad	_COM7_FMT_VGA
	.quad	_COM7_FMT_SXGA
	.quad	_COM7_FMT_QVGA
	.quad	_COM7_FMT_QCIF
	.quad	_COM7_FMT_CIF

	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.stk_sensor_configure.3
l_switch.table.stk_sensor_configure.3:
	.long	11                              ; 0xb
	.long	0                               ; 0x0
	.long	267                             ; 0x10b
	.long	604                             ; 0x25c
	.long	412                             ; 0x19c

	.section	__DATA,__const
	.p2align	3                               ; @switch.table.stk_sensor_configure.4
l_switch.table.stk_sensor_configure.4:
	.quad	_COM7_YUV
	.quad	_COM7_YUV
	.quad	_COM7_PBAYER
	.quad	_COM7_RGB
	.quad	_COM7_RGB

	.p2align	3                               ; @switch.table.stk_sensor_configure.5
l_switch.table.stk_sensor_configure.5:
	.quad	_ov_fmt_yuyv
	.quad	_ov_fmt_uyvy
	.quad	_ov_fmt_bayer
	.quad	_ov_fmt_rgbr
	.quad	_ov_fmt_rgbp

.subsections_via_symbols
