	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stk_initialise
_stk_initialise:                        ## @stk_initialise
	.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
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_is_present
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r14, %rdi
	callq	_is_initialised
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_9
## %bb.3:
	movq	_stk1125_initvals@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	(%rbx), %esi
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	je	LBB0_7
## %bb.4:
	addq	$8, %rbx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	-4(%rbx), %edx
	movq	%r14, %rdi
	callq	_stk_camera_write_reg
	testl	%eax, %eax
	jne	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	(%rbx), %esi
	addq	$8, %rbx
	cmpl	$65535, %esi                    ## imm = 0xFFFF
	jne	LBB0_6
LBB0_7:
	movq	%r14, %rdi
	callq	_stk_sensor_init
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	jne	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	callq	_set_initialised
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_stk1125_initvals,8,3           ## @stk1125_initvals
	.no_dead_strip	_stk_initialise
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stk_initialise
_stk_initialise:                        ; @stk_initialise
	.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
	bl	_is_present
	cbz	w0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_is_initialised
	cbz	x0, LBB0_4
LBB0_2:
	mov	w0, #0
	b	LBB0_10
LBB0_3:
Lloh0:
	adrp	x8, _ENODEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_4:
Lloh3:
	adrp	x8, _stk1125_initvals@GOTPAGE
Lloh4:
	ldr	x8, [x8, _stk1125_initvals@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w1, [x8]
	mov	w20, #65535
	cmp	w1, w20
	b.eq	LBB0_8
; %bb.5:
	add	x21, x8, #8
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w2, [x21, #-4]
	mov	x0, x19
	bl	_stk_camera_write_reg
	cbnz	w0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w1, [x21], #8
	cmp	w1, w20
	b.ne	LBB0_6
LBB0_8:
	mov	x0, x19
	bl	_stk_sensor_init
	cbz	x0, LBB0_11
; %bb.9:
	mov	w0, #-1
LBB0_10:
	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_11:
	mov	x0, x19
	bl	_set_initialised
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_stk1125_initvals,8,3           ; @stk1125_initvals
	.no_dead_strip	_stk_initialise
.subsections_via_symbols
