	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_sensor_power_setup
_via_sensor_power_setup:                ## @via_sensor_power_setup
	.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, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_viafb_gpio_lookup
	movq	%rax, 8(%rbx)
	leaq	L_.str.1(%rip), %rdi
	callq	_viafb_gpio_lookup
	movq	%rax, (%rbx)
	movq	8(%rbx), %rdi
	callq	_gpio_is_valid
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	(%rbx), %rdi
	callq	_gpio_is_valid
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movq	8(%rbx), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_gpio_request
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	%eax, %r14d
	movq	16(%rbx), %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_8
LBB0_2:
	movq	16(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_8:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_5:
	movq	(%rbx), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_gpio_request
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r14d
	movq	16(%rbx), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_dev_err
	movq	8(%rbx), %rdi
	callq	_gpio_free
	jmp	LBB0_8
LBB0_7:
	movq	8(%rbx), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_gpio_direction_output
	movq	(%rbx), %rdi
	xorl	%esi, %esi
	callq	_gpio_direction_output
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VGPIO3"

L_.str.1:                               ## @.str.1
	.asciz	"VGPIO2"

L_.str.2:                               ## @.str.2
	.asciz	"Unable to find GPIO lines\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.3:                               ## @.str.3
	.asciz	"viafb-camera"

L_.str.4:                               ## @.str.4
	.asciz	"Unable to request power GPIO\n"

L_.str.5:                               ## @.str.5
	.asciz	"Unable to request reset GPIO\n"

	.no_dead_strip	_via_sensor_power_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_sensor_power_setup
_via_sensor_power_setup:                ; @via_sensor_power_setup
	.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
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_viafb_gpio_lookup
	str	x0, [x19, #8]
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_viafb_gpio_lookup
	str	x0, [x19]
	ldr	x0, [x19, #8]
	bl	_gpio_is_valid
	cbz	w0, LBB0_4
; %bb.1:
	ldr	x0, [x19]
	bl	_gpio_is_valid
	cbz	w0, LBB0_4
; %bb.2:
	ldr	x0, [x19, #8]
Lloh4:
	adrp	x1, l_.str.3@PAGE
Lloh5:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_gpio_request
	cbz	w0, LBB0_6
; %bb.3:
	mov	x20, x0
	ldr	x0, [x19, #16]
Lloh6:
	adrp	x1, l_.str.4@PAGE
Lloh7:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
	b	LBB0_5
LBB0_4:
	ldr	x0, [x19, #16]
Lloh8:
	adrp	x1, l_.str.2@PAGE
Lloh9:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	x0, [x19]
Lloh13:
	adrp	x1, l_.str.3@PAGE
Lloh14:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_gpio_request
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.7:
	ldr	x0, [x19, #16]
Lloh15:
	adrp	x1, l_.str.5@PAGE
Lloh16:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
	ldr	x0, [x19, #8]
	bl	_gpio_free
	b	LBB0_5
LBB0_8:
	ldr	x0, [x19, #8]
	mov	w1, #0
	bl	_gpio_direction_output
	ldr	x0, [x19]
	mov	w1, #0
	bl	_gpio_direction_output
	b	LBB0_5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VGPIO3"

l_.str.1:                               ; @.str.1
	.asciz	"VGPIO2"

l_.str.2:                               ; @.str.2
	.asciz	"Unable to find GPIO lines\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.3:                               ; @.str.3
	.asciz	"viafb-camera"

l_.str.4:                               ; @.str.4
	.asciz	"Unable to request power GPIO\n"

l_.str.5:                               ; @.str.5
	.asciz	"Unable to request reset GPIO\n"

	.no_dead_strip	_via_sensor_power_setup
.subsections_via_symbols
