	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia2_set_high_power
_cpia2_set_high_power:                  ## @cpia2_set_high_power
	.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
	movq	%rdi, %r14
	movl	$51, %ebx
	movq	_TRANSFER_READ@GOTPCREL(%rip), %r12
	movq	_TRANSFER_WRITE@GOTPCREL(%rip), %r13
	movq	_CPIA2_VP_SYSTEMSTATE_HK_ALIVE@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_CPIA2_CMD_GET_SYSTEM_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_cpia2_do_command
	movq	_CPIA2_SYSTEM_CONTROL_V2W_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	je	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_CPIA2_CMD_CLEAR_V2W_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_cpia2_do_command
LBB0_3:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_CPIA2_CMD_SET_SYSTEM_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r13), %edx
	movq	%r14, %rdi
	movl	$1, %ecx
	callq	_cpia2_do_command
	movq	_CPIA2_CMD_GET_VP_SYSTEM_STATE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r12), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_cpia2_do_command
	movl	(%r15), %eax
	testl	%eax, 8(%r14)
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	decl	%ebx
	jne	LBB0_1
## %bb.5:
	movq	_LO_POWER_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	leaq	L_.str(%rip), %rdi
	callq	_ERR
	movq	_EIO@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	callq	_DBG
	movq	_HI_POWER_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CPIA2_CMD_GET_SYSTEM_CTRL,4,2  ## @CPIA2_CMD_GET_SYSTEM_CTRL
	.comm	_TRANSFER_READ,4,2              ## @TRANSFER_READ
	.comm	_CPIA2_SYSTEM_CONTROL_V2W_ERR,4,2 ## @CPIA2_SYSTEM_CONTROL_V2W_ERR
	.comm	_CPIA2_CMD_CLEAR_V2W_ERR,4,2    ## @CPIA2_CMD_CLEAR_V2W_ERR
	.comm	_TRANSFER_WRITE,4,2             ## @TRANSFER_WRITE
	.comm	_CPIA2_CMD_SET_SYSTEM_CTRL,4,2  ## @CPIA2_CMD_SET_SYSTEM_CTRL
	.comm	_CPIA2_CMD_GET_VP_SYSTEM_STATE,4,2 ## @CPIA2_CMD_GET_VP_SYSTEM_STATE
	.comm	_CPIA2_VP_SYSTEMSTATE_HK_ALIVE,4,2 ## @CPIA2_VP_SYSTEMSTATE_HK_ALIVE
	.comm	_LO_POWER_MODE,4,2              ## @LO_POWER_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Camera did not wake up\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.1:                               ## @.str.1
	.asciz	"System now in high power state\n"

	.comm	_HI_POWER_MODE,4,2              ## @HI_POWER_MODE
	.no_dead_strip	_cpia2_set_high_power
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia2_set_high_power
_cpia2_set_high_power:                  ; @cpia2_set_high_power
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	mov	w20, #51
Lloh0:
	adrp	x21, _CPIA2_CMD_GET_SYSTEM_CTRL@GOTPAGE
Lloh1:
	ldr	x21, [x21, _CPIA2_CMD_GET_SYSTEM_CTRL@GOTPAGEOFF]
Lloh2:
	adrp	x22, _TRANSFER_READ@GOTPAGE
Lloh3:
	ldr	x22, [x22, _TRANSFER_READ@GOTPAGEOFF]
Lloh4:
	adrp	x23, _CPIA2_SYSTEM_CONTROL_V2W_ERR@GOTPAGE
Lloh5:
	ldr	x23, [x23, _CPIA2_SYSTEM_CONTROL_V2W_ERR@GOTPAGEOFF]
Lloh6:
	adrp	x24, _CPIA2_CMD_SET_SYSTEM_CTRL@GOTPAGE
Lloh7:
	ldr	x24, [x24, _CPIA2_CMD_SET_SYSTEM_CTRL@GOTPAGEOFF]
Lloh8:
	adrp	x25, _TRANSFER_WRITE@GOTPAGE
Lloh9:
	ldr	x25, [x25, _TRANSFER_WRITE@GOTPAGEOFF]
Lloh10:
	adrp	x26, _CPIA2_CMD_GET_VP_SYSTEM_STATE@GOTPAGE
Lloh11:
	ldr	x26, [x26, _CPIA2_CMD_GET_VP_SYSTEM_STATE@GOTPAGEOFF]
Lloh12:
	adrp	x27, _CPIA2_VP_SYSTEMSTATE_HK_ALIVE@GOTPAGE
Lloh13:
	ldr	x27, [x27, _CPIA2_VP_SYSTEMSTATE_HK_ALIVE@GOTPAGEOFF]
Lloh14:
	adrp	x28, _CPIA2_CMD_CLEAR_V2W_ERR@GOTPAGE
Lloh15:
	ldr	x28, [x28, _CPIA2_CMD_CLEAR_V2W_ERR@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	mov	w3, #0
	bl	_cpia2_do_command
	ldr	w8, [x19]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x28]
	ldr	w2, [x25]
	mov	x0, x19
	mov	w3, #0
	bl	_cpia2_do_command
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w1, [x24]
	ldr	w2, [x25]
	mov	x0, x19
	mov	w3, #1
	bl	_cpia2_do_command
	ldr	w1, [x26]
	ldr	w2, [x22]
	mov	x0, x19
	mov	w3, #0
	bl	_cpia2_do_command
	ldr	w8, [x19, #8]
	ldr	w9, [x27]
	tst	w9, w8
	b.ne	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	subs	w20, w20, #1
	b.ne	LBB0_1
; %bb.5:
Lloh16:
	adrp	x8, _LO_POWER_MODE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _LO_POWER_MODE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	str	w8, [x19, #4]
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	bl	_ERR
Lloh21:
	adrp	x8, _EIO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
Lloh24:
	adrp	x0, l_.str.1@PAGE
Lloh25:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DBG
	mov	w0, #0
Lloh26:
	adrp	x8, _HI_POWER_MODE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _HI_POWER_MODE@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x19, #4]
LBB0_7:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_CPIA2_CMD_GET_SYSTEM_CTRL,4,2  ; @CPIA2_CMD_GET_SYSTEM_CTRL
	.comm	_TRANSFER_READ,4,2              ; @TRANSFER_READ
	.comm	_CPIA2_SYSTEM_CONTROL_V2W_ERR,4,2 ; @CPIA2_SYSTEM_CONTROL_V2W_ERR
	.comm	_CPIA2_CMD_CLEAR_V2W_ERR,4,2    ; @CPIA2_CMD_CLEAR_V2W_ERR
	.comm	_TRANSFER_WRITE,4,2             ; @TRANSFER_WRITE
	.comm	_CPIA2_CMD_SET_SYSTEM_CTRL,4,2  ; @CPIA2_CMD_SET_SYSTEM_CTRL
	.comm	_CPIA2_CMD_GET_VP_SYSTEM_STATE,4,2 ; @CPIA2_CMD_GET_VP_SYSTEM_STATE
	.comm	_CPIA2_VP_SYSTEMSTATE_HK_ALIVE,4,2 ; @CPIA2_VP_SYSTEMSTATE_HK_ALIVE
	.comm	_LO_POWER_MODE,4,2              ; @LO_POWER_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Camera did not wake up\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.1:                               ; @.str.1
	.asciz	"System now in high power state\n"

	.comm	_HI_POWER_MODE,4,2              ; @HI_POWER_MODE
	.no_dead_strip	_cpia2_set_high_power
.subsections_via_symbols
