	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7343_s_ctrl
_adv7343_s_ctrl:                        ## @adv7343_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	_to_state
	movl	(%rbx), %ecx
	cmpl	$128, %ecx
	je	LBB0_8
## %bb.1:
	cmpl	$129, %ecx
	je	LBB0_12
## %bb.2:
	cmpl	$130, %ecx
	jne	LBB0_19
## %bb.3:
	movl	4(%rbx), %r8d
	movq	_ADV7343_BRIGHTNESS_MIN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jl	LBB0_5
## %bb.4:
	movq	_ADV7343_BRIGHTNESS_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jg	LBB0_5
## %bb.20:
	movl	%r8d, 8(%rax)
	movq	_ADV7343_SD_BRIGHTNESS_WSS@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_12:
	movl	4(%rbx), %r8d
	movq	_ADV7343_GAIN_MIN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jl	LBB0_14
## %bb.13:
	movq	_ADV7343_GAIN_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jg	LBB0_14
## %bb.15:
	movq	_POSITIVE_GAIN_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jle	LBB0_18
## %bb.16:
	movq	_NEGATIVE_GAIN_MIN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jge	LBB0_18
## %bb.17:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rcx
	xorl	%ebx, %ebx
	movl	$1, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
	jmp	LBB0_7
LBB0_8:
	movl	4(%rbx), %r8d
	movq	_ADV7343_HUE_MIN@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jl	LBB0_10
## %bb.9:
	movq	_ADV7343_HUE_MAX@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r8d
	jg	LBB0_10
## %bb.11:
	movl	%r8d, 4(%rax)
	movq	_ADV7343_SD_HUE_REG@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_14:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rcx
	jmp	LBB0_6
LBB0_10:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rcx
	jmp	LBB0_6
LBB0_5:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
LBB0_6:
	xorl	%ebx, %ebx
	movl	$1, %edi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
LBB0_7:
	movq	_ERANGE@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_23
LBB0_18:
	movl	%r8d, (%rax)
	movq	_ADV7343_DAC2_OUTPUT_LEVEL@GOTPCREL(%rip), %rax
LBB0_21:
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r8d, %edx
	callq	_adv7343_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_23
## %bb.22:
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	callq	_v4l2_err
LBB0_23:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADV7343_BRIGHTNESS_MIN,4,2     ## @ADV7343_BRIGHTNESS_MIN
	.comm	_ADV7343_BRIGHTNESS_MAX,4,2     ## @ADV7343_BRIGHTNESS_MAX
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"invalid brightness settings %d\n"

	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_ADV7343_SD_BRIGHTNESS_WSS,4,2  ## @ADV7343_SD_BRIGHTNESS_WSS
	.comm	_ADV7343_HUE_MIN,4,2            ## @ADV7343_HUE_MIN
	.comm	_ADV7343_HUE_MAX,4,2            ## @ADV7343_HUE_MAX
L_.str.1:                               ## @.str.1
	.asciz	"invalid hue settings %d\n"

	.comm	_ADV7343_SD_HUE_REG,4,2         ## @ADV7343_SD_HUE_REG
	.comm	_ADV7343_GAIN_MIN,4,2           ## @ADV7343_GAIN_MIN
	.comm	_ADV7343_GAIN_MAX,4,2           ## @ADV7343_GAIN_MAX
L_.str.2:                               ## @.str.2
	.asciz	"invalid gain settings %d\n"

	.comm	_POSITIVE_GAIN_MAX,4,2          ## @POSITIVE_GAIN_MAX
	.comm	_NEGATIVE_GAIN_MIN,4,2          ## @NEGATIVE_GAIN_MIN
L_.str.3:                               ## @.str.3
	.asciz	"gain settings not within the specified range\n"

	.comm	_ADV7343_DAC2_OUTPUT_LEVEL,4,2  ## @ADV7343_DAC2_OUTPUT_LEVEL
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.4:                               ## @.str.4
	.asciz	"Failed to set the encoder controls\n"

	.no_dead_strip	_adv7343_s_ctrl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7343_s_ctrl
_adv7343_s_ctrl:                        ; @adv7343_s_ctrl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x1
	mov	x19, x0
	bl	_to_state
	ldr	w8, [x20]
	cmp	w8, #128
	b.eq	LBB0_5
; %bb.1:
	cmp	w8, #129
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #130
	b.ne	LBB0_9
; %bb.3:
	ldr	w2, [x20, #4]
Lloh0:
	adrp	x8, _ADV7343_BRIGHTNESS_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ADV7343_BRIGHTNESS_MIN@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _ADV7343_BRIGHTNESS_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ADV7343_BRIGHTNESS_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w2, w8
	ccmp	w2, w9, #0, ge
	b.le	LBB0_10
; %bb.4:
Lloh6:
	adrp	x8, _debug@GOTPAGE
Lloh7:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	str	x2, [sp]
Lloh9:
	adrp	x3, l_.str@PAGE
Lloh10:
	add	x3, x3, l_.str@PAGEOFF
	b	LBB0_18
LBB0_5:
	ldr	w2, [x20, #4]
Lloh11:
	adrp	x8, _ADV7343_HUE_MIN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ADV7343_HUE_MIN@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _ADV7343_HUE_MAX@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ADV7343_HUE_MAX@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w2, w8
	ccmp	w2, w9, #0, ge
	b.le	LBB0_11
; %bb.6:
Lloh17:
	adrp	x8, _debug@GOTPAGE
Lloh18:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	str	x2, [sp]
Lloh20:
	adrp	x3, l_.str.1@PAGE
Lloh21:
	add	x3, x3, l_.str.1@PAGEOFF
	b	LBB0_18
LBB0_7:
	ldr	w2, [x20, #4]
Lloh22:
	adrp	x8, _ADV7343_GAIN_MIN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ADV7343_GAIN_MIN@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _ADV7343_GAIN_MAX@GOTPAGE
Lloh26:
	ldr	x9, [x9, _ADV7343_GAIN_MAX@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	cmp	w2, w8
	ccmp	w2, w9, #0, ge
	b.le	LBB0_12
; %bb.8:
Lloh28:
	adrp	x8, _debug@GOTPAGE
Lloh29:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	str	x2, [sp]
Lloh31:
	adrp	x3, l_.str.2@PAGE
Lloh32:
	add	x3, x3, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_9:
Lloh33:
	adrp	x8, _EINVAL@GOTPAGE
Lloh34:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_19
LBB0_10:
	str	w2, [x0, #8]
Lloh35:
	adrp	x8, _ADV7343_SD_BRIGHTNESS_WSS@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ADV7343_SD_BRIGHTNESS_WSS@GOTPAGEOFF]
	b	LBB0_15
LBB0_11:
	str	w2, [x0, #4]
Lloh37:
	adrp	x8, _ADV7343_SD_HUE_REG@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ADV7343_SD_HUE_REG@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
Lloh39:
	adrp	x8, _POSITIVE_GAIN_MAX@GOTPAGE
Lloh40:
	ldr	x8, [x8, _POSITIVE_GAIN_MAX@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
Lloh42:
	adrp	x9, _NEGATIVE_GAIN_MIN@GOTPAGE
Lloh43:
	ldr	x9, [x9, _NEGATIVE_GAIN_MIN@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	cmp	w2, w8
	ccmp	w2, w9, #0, gt
	b.lt	LBB0_17
; %bb.13:
	str	w2, [x0]
Lloh45:
	adrp	x8, _ADV7343_DAC2_OUTPUT_LEVEL@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ADV7343_DAC2_OUTPUT_LEVEL@GOTPAGEOFF]
LBB0_14:
                                        ; kill: def $w2 killed $w2 killed $x2 def $x2
LBB0_15:
	ldr	w1, [x8]
	mov	x0, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_adv7343_write
	mov	x20, x0
	tbz	w0, #31, LBB0_20
; %bb.16:
Lloh47:
	adrp	x1, l_.str.4@PAGE
Lloh48:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
	b	LBB0_20
LBB0_17:
Lloh49:
	adrp	x8, _debug@GOTPAGE
Lloh50:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh51:
	ldr	w1, [x8]
Lloh52:
	adrp	x3, l_.str.3@PAGE
Lloh53:
	add	x3, x3, l_.str.3@PAGEOFF
LBB0_18:
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
Lloh54:
	adrp	x8, _ERANGE@GOTPAGE
Lloh55:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
LBB0_19:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_20:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
	.comm	_ADV7343_BRIGHTNESS_MIN,4,2     ; @ADV7343_BRIGHTNESS_MIN
	.comm	_ADV7343_BRIGHTNESS_MAX,4,2     ; @ADV7343_BRIGHTNESS_MAX
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"invalid brightness settings %d\n"

	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_ADV7343_SD_BRIGHTNESS_WSS,4,2  ; @ADV7343_SD_BRIGHTNESS_WSS
	.comm	_ADV7343_HUE_MIN,4,2            ; @ADV7343_HUE_MIN
	.comm	_ADV7343_HUE_MAX,4,2            ; @ADV7343_HUE_MAX
l_.str.1:                               ; @.str.1
	.asciz	"invalid hue settings %d\n"

	.comm	_ADV7343_SD_HUE_REG,4,2         ; @ADV7343_SD_HUE_REG
	.comm	_ADV7343_GAIN_MIN,4,2           ; @ADV7343_GAIN_MIN
	.comm	_ADV7343_GAIN_MAX,4,2           ; @ADV7343_GAIN_MAX
l_.str.2:                               ; @.str.2
	.asciz	"invalid gain settings %d\n"

	.comm	_POSITIVE_GAIN_MAX,4,2          ; @POSITIVE_GAIN_MAX
	.comm	_NEGATIVE_GAIN_MIN,4,2          ; @NEGATIVE_GAIN_MIN
l_.str.3:                               ; @.str.3
	.asciz	"gain settings not within the specified range\n"

	.comm	_ADV7343_DAC2_OUTPUT_LEVEL,4,2  ; @ADV7343_DAC2_OUTPUT_LEVEL
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.4:                               ; @.str.4
	.asciz	"Failed to set the encoder controls\n"

	.no_dead_strip	_adv7343_s_ctrl
.subsections_via_symbols
