	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stk_sensor_init                ## -- Begin function stk_sensor_init
	.p2align	4, 0x90
_stk_sensor_init:                       ## @stk_sensor_init
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movl	$0, -24(%rbp)
	movl	$0, -20(%rbp)
	movq	_STK_IIC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_STK_IIC_ENABLE_YES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_stk_camera_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	movq	_STK_IIC_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SENSOR_ADDRESS@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	%rbx, %rdi
	callq	_stk_camera_write_reg
	testq	%rax, %rax
	jne	LBB0_3
## %bb.2:
	movq	_REG_COM7@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_COM7_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_stk_sensor_outb
	testq	%rax, %rax
	je	LBB0_5
LBB0_3:
	leaq	L_.str(%rip), %rdi
LBB0_4:
	callq	_pr_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_15:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movl	$10, %edi
	callq	_msleep
	movq	_REG_MIDH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_stk_sensor_inb
	testq	%rax, %rax
	jne	LBB0_7
## %bb.6:
	movq	_REG_MIDL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_stk_sensor_inb
	testq	%rax, %rax
	je	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_4
LBB0_8:
	cmpl	$127, -20(%rbp)
	jne	LBB0_10
## %bb.9:
	cmpl	$162, -24(%rbp)
	jne	LBB0_10
## %bb.11:
	movq	_REG_PID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_stk_sensor_inb
	testq	%rax, %rax
	jne	LBB0_13
## %bb.12:
	movq	_REG_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_stk_sensor_inb
	testq	%rax, %rax
	je	LBB0_14
LBB0_13:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_4
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_14:
	movq	_ov_initvals@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_stk_sensor_write_regvals
	movl	$10, %edi
	callq	_msleep
	movl	-20(%rbp), %esi
	movl	-24(%rbp), %edx
	movl	(%r14), %ecx
	leaq	L_.str.4(%rip), %rdi
	callq	_pr_info
	xorl	%eax, %eax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_STK_IIC_ENABLE,4,2             ## @STK_IIC_ENABLE
	.comm	_STK_IIC_ENABLE_YES,4,2         ## @STK_IIC_ENABLE_YES
	.comm	_STK_IIC_ADDR,4,2               ## @STK_IIC_ADDR
	.comm	_SENSOR_ADDRESS,4,2             ## @SENSOR_ADDRESS
	.comm	_REG_COM7,4,2                   ## @REG_COM7
	.comm	_COM7_RESET,4,2                 ## @COM7_RESET
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Sensor resetting failed\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_REG_MIDH,4,2                   ## @REG_MIDH
	.comm	_REG_MIDL,4,2                   ## @REG_MIDL
L_.str.1:                               ## @.str.1
	.asciz	"Strange error reading sensor ID\n"

L_.str.2:                               ## @.str.2
	.asciz	"Huh? you don't have a sensor from ovt\n"

	.comm	_REG_PID,4,2                    ## @REG_PID
	.comm	_REG_VER,4,2                    ## @REG_VER
L_.str.3:                               ## @.str.3
	.asciz	"Could not read sensor model\n"

	.comm	_ov_initvals,4,2                ## @ov_initvals
L_.str.4:                               ## @.str.4
	.asciz	"OmniVision sensor detected, id %02X%02X at address %x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_stk_sensor_init                ; -- Begin function stk_sensor_init
	.p2align	2
_stk_sensor_init:                       ; @stk_sensor_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _STK_IIC_ENABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STK_IIC_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _STK_IIC_ENABLE_YES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STK_IIC_ENABLE_YES@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_stk_camera_write_reg
	cbnz	x0, LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _STK_IIC_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STK_IIC_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x20, _SENSOR_ADDRESS@GOTPAGE
Lloh10:
	ldr	x20, [x20, _SENSOR_ADDRESS@GOTPAGEOFF]
	ldr	w2, [x20]
	mov	x0, x19
	bl	_stk_camera_write_reg
	cbnz	x0, LBB0_3
; %bb.2:
Lloh11:
	adrp	x8, _REG_COM7@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REG_COM7@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _COM7_RESET@GOTPAGE
Lloh15:
	ldr	x8, [x8, _COM7_RESET@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_stk_sensor_outb
	cbz	x0, LBB0_6
LBB0_3:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
LBB0_4:
	bl	_pr_err
Lloh19:
	adrp	x8, _ENODEV@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_6:
	mov	w0, #10
	bl	_msleep
Lloh22:
	adrp	x8, _REG_MIDH@GOTPAGE
Lloh23:
	ldr	x8, [x8, _REG_MIDH@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_stk_sensor_inb
	cbnz	x0, LBB0_8
; %bb.7:
Lloh25:
	adrp	x8, _REG_MIDL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _REG_MIDL@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_stk_sensor_inb
	cbz	x0, LBB0_9
LBB0_8:
Lloh28:
	adrp	x0, l_.str.1@PAGE
Lloh29:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_4
LBB0_9:
	ldr	w8, [sp, #8]
	cmp	w8, #127
	b.ne	LBB0_14
; %bb.10:
	ldr	w8, [sp, #12]
	cmp	w8, #162
	b.ne	LBB0_14
; %bb.11:
Lloh30:
	adrp	x8, _REG_PID@GOTPAGE
Lloh31:
	ldr	x8, [x8, _REG_PID@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_stk_sensor_inb
	cbnz	x0, LBB0_13
; %bb.12:
Lloh33:
	adrp	x8, _REG_VER@GOTPAGE
Lloh34:
	ldr	x8, [x8, _REG_VER@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_stk_sensor_inb
	cbz	x0, LBB0_15
LBB0_13:
Lloh36:
	adrp	x0, l_.str.3@PAGE
Lloh37:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_14:
Lloh38:
	adrp	x0, l_.str.2@PAGE
Lloh39:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_15:
Lloh40:
	adrp	x8, _ov_initvals@GOTPAGE
Lloh41:
	ldr	x8, [x8, _ov_initvals@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_stk_sensor_write_regvals
	mov	w0, #10
	bl	_msleep
	ldp	w1, w2, [sp, #8]
	ldr	w3, [x20]
Lloh43:
	adrp	x0, l_.str.4@PAGE
Lloh44:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_info
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_STK_IIC_ENABLE,4,2             ; @STK_IIC_ENABLE
	.comm	_STK_IIC_ENABLE_YES,4,2         ; @STK_IIC_ENABLE_YES
	.comm	_STK_IIC_ADDR,4,2               ; @STK_IIC_ADDR
	.comm	_SENSOR_ADDRESS,4,2             ; @SENSOR_ADDRESS
	.comm	_REG_COM7,4,2                   ; @REG_COM7
	.comm	_COM7_RESET,4,2                 ; @COM7_RESET
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Sensor resetting failed\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_REG_MIDH,4,2                   ; @REG_MIDH
	.comm	_REG_MIDL,4,2                   ; @REG_MIDL
l_.str.1:                               ; @.str.1
	.asciz	"Strange error reading sensor ID\n"

l_.str.2:                               ; @.str.2
	.asciz	"Huh? you don't have a sensor from ovt\n"

	.comm	_REG_PID,4,2                    ; @REG_PID
	.comm	_REG_VER,4,2                    ; @REG_VER
l_.str.3:                               ; @.str.3
	.asciz	"Could not read sensor model\n"

	.comm	_ov_initvals,4,2                ; @ov_initvals
l_.str.4:                               ; @.str.4
	.asciz	"OmniVision sensor detected, id %02X%02X at address %x\n"

.subsections_via_symbols
