	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5k5baf_set_power
_s5k5baf_set_power:                     ## @s5k5baf_set_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	callq	_to_s5k5baf
	movq	%rax, %r12
	leaq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	xorl	%eax, %eax
	testl	%ebx, %ebx
	sete	%al
	cmpl	%eax, (%r12)
	jne	LBB0_8
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.2:
	cmpq	$0, 16(%r12)
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	callq	_s5k5baf_load_setfile
LBB0_4:
	movq	%r12, %rdi
	callq	_s5k5baf_initialize_data
	movq	%r12, %rdi
	callq	_s5k5baf_power_on
	testl	%eax, %eax
	js	LBB0_13
## %bb.5:
	movq	%r12, %rdi
	callq	_s5k5baf_hw_init
	movq	%r12, %rdi
	callq	_s5k5baf_hw_patch
	movq	_REG_SET_HOST_INT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_s5k5baf_i2c_write
	movq	%r12, %rdi
	callq	_s5k5baf_hw_set_clocks
	movq	%r12, %rdi
	callq	_s5k5baf_hw_set_video_bus
	testl	%eax, %eax
	js	LBB0_13
## %bb.6:
	movq	%r12, %rdi
	callq	_s5k5baf_hw_set_cis
	movq	%r12, %rdi
	callq	_s5k5baf_hw_set_ccm
	movq	%r12, %rdi
	callq	_s5k5baf_clear_error
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.7:
	incl	(%r12)
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_9
LBB0_8:
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%ebx, %ebx
	je	LBB0_11
LBB0_9:
	addq	$4, %r12
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_v4l2_ctrl_handler_setup        ## TAILCALL
LBB0_10:
	movq	%r12, %rdi
	callq	_s5k5baf_power_off
	decl	(%r12)
	xorl	%r15d, %r15d
	jmp	LBB0_14
LBB0_13:
	movl	%eax, %r15d
LBB0_14:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_15
LBB0_11:
	xorl	%r15d, %r15d
LBB0_15:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REG_SET_HOST_INT,4,2           ## @REG_SET_HOST_INT
	.no_dead_strip	_s5k5baf_set_power
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5k5baf_set_power
_s5k5baf_set_power:                     ; @s5k5baf_set_power
	.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	x21, x1
	bl	_to_s5k5baf
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
	cmp	w21, #0
	cset	w9, eq
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.1:
	cbz	w21, LBB0_10
; %bb.2:
	ldr	x8, [x20, #16]
	cbnz	x8, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_s5k5baf_load_setfile
LBB0_4:
	mov	x0, x20
	bl	_s5k5baf_initialize_data
	mov	x0, x20
	bl	_s5k5baf_power_on
	tbnz	w0, #31, LBB0_11
; %bb.5:
	mov	x0, x20
	bl	_s5k5baf_hw_init
	mov	x0, x20
	bl	_s5k5baf_hw_patch
Lloh0:
	adrp	x8, _REG_SET_HOST_INT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_SET_HOST_INT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_s5k5baf_i2c_write
	mov	x0, x20
	bl	_s5k5baf_hw_set_clocks
	mov	x0, x20
	bl	_s5k5baf_hw_set_video_bus
	tbnz	w0, #31, LBB0_11
; %bb.6:
	mov	x0, x20
	bl	_s5k5baf_hw_set_cis
	mov	x0, x20
	bl	_s5k5baf_hw_set_ccm
	mov	x0, x20
	bl	_s5k5baf_clear_error
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.7:
	ldr	w8, [x20]
	add	w8, w8, #1
	str	w8, [x20]
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
	cbz	w21, LBB0_13
LBB0_9:
	add	x0, x20, #4
	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
	b	_v4l2_ctrl_handler_setup
LBB0_10:
	mov	x0, x20
	bl	_s5k5baf_power_off
	ldr	w8, [x20]
	sub	w8, w8, #1
	str	w8, [x20]
	b	LBB0_12
LBB0_11:
	mov	x21, x0
LBB0_12:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_13:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_REG_SET_HOST_INT,4,2           ; @REG_SET_HOST_INT
	.no_dead_strip	_s5k5baf_set_power
.subsections_via_symbols
