	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function s5k6aa_s_ctrl
_s5k6aa_s_ctrl:                         ## @s5k6aa_s_ctrl
	.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
	callq	_ctrl_to_sd
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_v4l2_get_subdevdata
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_to_s5k6aa
	movq	%rax, %r13
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %r9d
	movl	4(%r14), %r8d
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%rbx, %rdx
	callq	_v4l2_dbg
	leaq	8(%r13), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	xorl	%r12d, %r12d
	cmpq	$0, (%r13)
	je	LBB0_18
## %bb.1:
	movl	4(%r14), %eax
	addl	$-128, %eax
	cmpl	$9, %eax
	ja	LBB0_18
## %bb.2:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_13:
	movq	16(%r13), %rax
	movl	(%rax), %edi
	callq	_REG_P_COLORTEMP
	movl	(%r14), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_s5k6aa_write
	jmp	LBB0_14
LBB0_12:
	movq	_REG_USER_SHARPBLUR@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_11:
	movq	_REG_USER_SATURATION@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_10:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_s5k6aa_set_anti_flicker
	jmp	LBB0_17
LBB0_9:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_s5k6aa_set_mirror
LBB0_14:
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.15:
	movq	_REG_G_PREV_CFG_CHG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	$1, %edx
	jmp	LBB0_16
LBB0_8:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_s5k6aa_set_auto_exposure
	jmp	LBB0_17
LBB0_7:
	movq	_REG_USER_CONTRAST@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_6:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_s5k6aa_set_colorfx
	jmp	LBB0_17
LBB0_4:
	movq	_REG_USER_BRIGHTNESS@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %esi
	movl	(%r14), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_16:
	callq	_s5k6aa_write
LBB0_17:
	movl	%eax, %r12d
LBB0_18:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_s5k6aa_set_awb
	jmp	LBB0_17
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
LJTI0_0:
	.long	L0_0_set_13
	.long	L0_0_set_12
	.long	L0_0_set_11
	.long	L0_0_set_10
	.long	L0_0_set_9
	.long	L0_0_set_8
	.long	L0_0_set_7
	.long	L0_0_set_6
	.long	L0_0_set_4
	.long	L0_0_set_3
	.end_data_region
                                        ## -- End function
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ctrl: 0x%x, value: %d\n"

	.comm	_REG_USER_BRIGHTNESS,4,2        ## @REG_USER_BRIGHTNESS
	.comm	_REG_USER_CONTRAST,4,2          ## @REG_USER_CONTRAST
	.comm	_REG_G_PREV_CFG_CHG,4,2         ## @REG_G_PREV_CFG_CHG
	.comm	_REG_USER_SATURATION,4,2        ## @REG_USER_SATURATION
	.comm	_REG_USER_SHARPBLUR,4,2         ## @REG_USER_SHARPBLUR
	.no_dead_strip	_s5k6aa_s_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function s5k6aa_s_ctrl
_s5k6aa_s_ctrl:                         ; @s5k6aa_s_ctrl
	.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, x0
	bl	_ctrl_to_sd
	mov	x19, x0
	bl	_v4l2_get_subdevdata
	mov	x20, x0
	mov	x0, x19
	bl	_to_s5k6aa
	mov	x22, x0
Lloh0:
	adrp	x8, _debug@GOTPAGE
Lloh1:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldp	w5, w4, [x21]
Lloh3:
	adrp	x3, l_.str@PAGE
Lloh4:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
	add	x19, x22, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x22]
	cbz	x8, LBB0_4
; %bb.1:
	ldr	w8, [x21, #4]
	sub	w8, w8, #128
	cmp	w8, #9
	b.hi	LBB0_4
; %bb.2:
Lloh5:
	adrp	x9, lJTI0_0@PAGE
Lloh6:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_3
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_3:
	ldr	x8, [x22, #16]
	ldr	w0, [x8]
	bl	_REG_P_COLORTEMP
	mov	x1, x0
	ldr	w2, [x21]
	mov	x0, x20
	bl	_s5k6aa_write
	mov	x21, x0
	cbnz	w0, LBB0_17
	b	LBB0_9
LBB0_4:
	mov	w21, #0
	b	LBB0_17
LBB0_5:
Lloh7:
	adrp	x8, _REG_USER_SHARPBLUR@GOTPAGE
Lloh8:
	ldr	x8, [x8, _REG_USER_SHARPBLUR@GOTPAGEOFF]
	b	LBB0_14
LBB0_6:
Lloh9:
	adrp	x8, _REG_USER_SATURATION@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REG_USER_SATURATION@GOTPAGEOFF]
	b	LBB0_14
LBB0_7:
	ldr	w1, [x21]
	mov	x0, x22
	bl	_s5k6aa_set_anti_flicker
	b	LBB0_16
LBB0_8:
	ldr	w1, [x21]
	mov	x0, x22
	bl	_s5k6aa_set_mirror
	mov	x21, x0
	cbnz	w0, LBB0_17
LBB0_9:
Lloh11:
	adrp	x8, _REG_G_PREV_CFG_CHG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _REG_G_PREV_CFG_CHG@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	b	LBB0_15
LBB0_10:
	ldr	w1, [x21]
	mov	x0, x22
	bl	_s5k6aa_set_auto_exposure
	b	LBB0_16
LBB0_11:
Lloh14:
	adrp	x8, _REG_USER_CONTRAST@GOTPAGE
Lloh15:
	ldr	x8, [x8, _REG_USER_CONTRAST@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
	ldr	w1, [x21]
	mov	x0, x22
	bl	_s5k6aa_set_colorfx
	b	LBB0_16
LBB0_13:
Lloh16:
	adrp	x8, _REG_USER_BRIGHTNESS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _REG_USER_BRIGHTNESS@GOTPAGEOFF]
LBB0_14:
	ldr	w1, [x8]
	ldr	w2, [x21]
	mov	x0, x20
LBB0_15:
	bl	_s5k6aa_write
LBB0_16:
	mov	x21, x0
LBB0_17:
	mov	x0, x19
	bl	_mutex_unlock
	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
LBB0_18:
	ldr	w1, [x21]
	mov	x0, x22
	bl	_s5k6aa_set_awb
	b	LBB0_16
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_3-LBB0_3)>>2
	.byte	(LBB0_5-LBB0_3)>>2
	.byte	(LBB0_6-LBB0_3)>>2
	.byte	(LBB0_7-LBB0_3)>>2
	.byte	(LBB0_8-LBB0_3)>>2
	.byte	(LBB0_10-LBB0_3)>>2
	.byte	(LBB0_11-LBB0_3)>>2
	.byte	(LBB0_12-LBB0_3)>>2
	.byte	(LBB0_13-LBB0_3)>>2
	.byte	(LBB0_18-LBB0_3)>>2
                                        ; -- End function
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ctrl: 0x%x, value: %d\n"

	.comm	_REG_USER_BRIGHTNESS,4,2        ; @REG_USER_BRIGHTNESS
	.comm	_REG_USER_CONTRAST,4,2          ; @REG_USER_CONTRAST
	.comm	_REG_G_PREV_CFG_CHG,4,2         ; @REG_G_PREV_CFG_CHG
	.comm	_REG_USER_SATURATION,4,2        ; @REG_USER_SATURATION
	.comm	_REG_USER_SHARPBLUR,4,2         ; @REG_USER_SHARPBLUR
	.no_dead_strip	_s5k6aa_s_ctrl
.subsections_via_symbols
