	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reset_camera
_reset_camera:                          ## @reset_camera
	.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
	movq	%rdi, %r14
	callq	_goto_low_power
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	(%r14), %rax
	movq	_WARM_BOOT_STATE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.2:
	movq	%r14, %rdi
	callq	_goto_high_power
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.3:
	movq	_CPIA_COMMAND_DiscardFrame@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_do_command
	movq	%r14, %rdi
	callq	_goto_low_power
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_5:
	movl	$0, 32(%r14)
	movq	%r14, %rdi
	callq	_get_version_information
	cmpl	$1, 32(%r14)
	jne	LBB0_14
## %bb.6:
	cmpl	$2, 36(%r14)
	jg	LBB0_9
## %bb.7:
	cmpl	$3, 28(%r14)
	jl	LBB0_9
## %bb.8:
	movl	$2, 28(%r14)
LBB0_9:
	xorl	%eax, %eax
	cmpl	$2067, 16(%r14)                 ## imm = 0x813
	jne	LBB0_11
## %bb.10:
	xorl	%eax, %eax
	cmpl	$1, 20(%r14)
	sete	%al
LBB0_11:
	movl	%eax, 24(%r14)
	movq	_CPIA_COMMAND_ModifyCameraStatus@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_STREAMSTATE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_STREAM_NOT_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_do_command
	movq	%r14, %rdi
	callq	_goto_high_power
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_17
## %bb.12:
	movq	_CPIA_COMMAND_GetCameraStatus@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_do_command
	testq	%rax, %rax
	je	LBB0_18
## %bb.13:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_14:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_15:
	xorl	%ebx, %ebx
LBB0_16:
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movl	8(%r14), %esi
	testl	%esi, %esi
	je	LBB0_24
## %bb.19:
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movl	12(%r14), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_DBG
	movl	8(%r14), %eax
	movq	_COM_FLAG@GOTPCREL(%rip), %rcx
	movq	_CPIA_FLAG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%edx, %ecx
	notl	%ecx
	testl	%ecx, %eax
	jne	LBB0_23
## %bb.20:
	testl	%eax, %edx
	je	LBB0_22
## %bb.21:
	movl	(%r15), %esi
	movq	_FATALERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_do_command
	movl	8(%r14), %eax
LBB0_22:
	testl	%eax, %eax
	je	LBB0_24
LBB0_23:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_24:
	movq	_CPIA_COMMAND_GetVPVersion@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_do_command
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_camera_state               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_WARM_BOOT_STATE,8,3            ## @WARM_BOOT_STATE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_CPIA_COMMAND_DiscardFrame,4,2  ## @CPIA_COMMAND_DiscardFrame
	.comm	_CPIA_COMMAND_ModifyCameraStatus,4,2 ## @CPIA_COMMAND_ModifyCameraStatus
	.comm	_STREAMSTATE,4,2                ## @STREAMSTATE
	.comm	_STREAM_NOT_READY,4,2           ## @STREAM_NOT_READY
	.comm	_CPIA_COMMAND_GetCameraStatus,4,2 ## @CPIA_COMMAND_GetCameraStatus
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fatal_error:              %#04x\n"

L_.str.1:                               ## @.str.1
	.asciz	"vp_status:                %#04x\n"

	.comm	_COM_FLAG,4,2                   ## @COM_FLAG
	.comm	_CPIA_FLAG,4,2                  ## @CPIA_FLAG
	.comm	_FATALERROR,4,2                 ## @FATALERROR
	.comm	_CPIA_COMMAND_GetVPVersion,4,2  ## @CPIA_COMMAND_GetVPVersion
	.no_dead_strip	_reset_camera
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reset_camera
_reset_camera:                          ; @reset_camera
	.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
	bl	_goto_low_power
	cbz	x0, LBB0_4
; %bb.1:
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _WARM_BOOT_STATE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _WARM_BOOT_STATE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.2:
	mov	x0, x19
	bl	_goto_high_power
	cbnz	w0, LBB0_12
; %bb.3:
Lloh3:
	adrp	x8, _CPIA_COMMAND_DiscardFrame@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CPIA_COMMAND_DiscardFrame@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_do_command
	mov	x0, x19
	bl	_goto_low_power
	cbnz	x0, LBB0_10
LBB0_4:
	str	wzr, [x19, #32]
	mov	x0, x19
	bl	_get_version_information
	ldr	w8, [x19, #32]
	cmp	w8, #1
	b.ne	LBB0_10
; %bb.5:
	ldr	w8, [x19, #36]
	cmp	w8, #2
	b.gt	LBB0_8
; %bb.6:
	ldr	w8, [x19, #28]
	cmp	w8, #3
	b.lt	LBB0_8
; %bb.7:
	mov	w8, #2
	str	w8, [x19, #28]
LBB0_8:
	ldr	w8, [x19, #16]
	cmp	w8, #2067
	b.ne	LBB0_13
; %bb.9:
	ldr	w8, [x19, #20]
	cmp	w8, #1
	cset	w8, eq
	b	LBB0_14
LBB0_10:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_13:
	mov	w8, #0
LBB0_14:
	str	w8, [x19, #24]
Lloh8:
	adrp	x20, _CPIA_COMMAND_ModifyCameraStatus@GOTPAGE
Lloh9:
	ldr	x20, [x20, _CPIA_COMMAND_ModifyCameraStatus@GOTPAGEOFF]
	ldr	w1, [x20]
Lloh10:
	adrp	x8, _STREAMSTATE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _STREAMSTATE@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
Lloh13:
	adrp	x8, _STREAM_NOT_READY@GOTPAGE
Lloh14:
	ldr	x8, [x8, _STREAM_NOT_READY@GOTPAGEOFF]
Lloh15:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w3, #0
	mov	w5, #0
	bl	_do_command
	mov	x0, x19
	bl	_goto_high_power
	cbnz	w0, LBB0_12
; %bb.15:
Lloh16:
	adrp	x8, _CPIA_COMMAND_GetCameraStatus@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CPIA_COMMAND_GetCameraStatus@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_do_command
	cbz	x0, LBB0_17
LBB0_16:
Lloh19:
	adrp	x8, _EIO@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_17:
	ldr	w1, [x19, #8]
	cbz	w1, LBB0_22
; %bb.18:
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	ldr	w1, [x19, #12]
Lloh23:
	adrp	x0, l_.str.1@PAGE
Lloh24:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DBG
	ldr	w8, [x19, #8]
Lloh25:
	adrp	x9, _COM_FLAG@GOTPAGE
Lloh26:
	ldr	x9, [x9, _COM_FLAG@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
Lloh28:
	adrp	x10, _CPIA_FLAG@GOTPAGE
Lloh29:
	ldr	x10, [x10, _CPIA_FLAG@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	orr	w9, w10, w9
	bics	wzr, w8, w9
	b.ne	LBB0_16
; %bb.19:
	tst	w9, w8
	b.eq	LBB0_21
; %bb.20:
	mvn	w3, w9
	ldr	w1, [x20]
Lloh31:
	adrp	x8, _FATALERROR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _FATALERROR@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w4, #0
	mov	w5, #0
	bl	_do_command
	ldr	w8, [x19, #8]
LBB0_21:
	cbnz	w8, LBB0_16
LBB0_22:
Lloh34:
	adrp	x8, _CPIA_COMMAND_GetVPVersion@GOTPAGE
Lloh35:
	ldr	x8, [x8, _CPIA_COMMAND_GetVPVersion@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	bl	_do_command
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_set_camera_state
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_WARM_BOOT_STATE,8,3            ; @WARM_BOOT_STATE
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_CPIA_COMMAND_DiscardFrame,4,2  ; @CPIA_COMMAND_DiscardFrame
	.comm	_CPIA_COMMAND_ModifyCameraStatus,4,2 ; @CPIA_COMMAND_ModifyCameraStatus
	.comm	_STREAMSTATE,4,2                ; @STREAMSTATE
	.comm	_STREAM_NOT_READY,4,2           ; @STREAM_NOT_READY
	.comm	_CPIA_COMMAND_GetCameraStatus,4,2 ; @CPIA_COMMAND_GetCameraStatus
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fatal_error:              %#04x\n"

l_.str.1:                               ; @.str.1
	.asciz	"vp_status:                %#04x\n"

	.comm	_COM_FLAG,4,2                   ; @COM_FLAG
	.comm	_CPIA_FLAG,4,2                  ; @CPIA_FLAG
	.comm	_FATALERROR,4,2                 ; @FATALERROR
	.comm	_CPIA_COMMAND_GetVPVersion,4,2  ; @CPIA_COMMAND_GetVPVersion
	.no_dead_strip	_reset_camera
.subsections_via_symbols
