	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7343_setoutput
_adv7343_setoutput:                     ## @adv7343_setoutput
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r15
	callq	_to_state
	movq	%rax, %r14
	movq	_ADV7343_SVIDEO_ID@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	jge	LBB0_2
## %bb.1:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r15, %rdx
	movq	%rbx, %r8
	callq	_v4l2_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_21
LBB0_2:
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movl	12(%rax), %ecx
	addl	%ecx, %ecx
	orl	8(%rax), %ecx
	movq	16(%rax), %rax
	movl	8(%rax), %edx
	shll	$2, %edx
	orl	%ecx, %edx
	movl	(%rax), %ecx
	movl	4(%rax), %esi
	shll	$3, %esi
	shll	$4, %ecx
	orl	%esi, %ecx
	orl	%edx, %ecx
	movl	20(%rax), %edx
	shll	$5, %edx
	movl	16(%rax), %esi
	shll	$6, %esi
	orl	%edx, %esi
	movl	12(%rax), %eax
	shll	$7, %eax
	orl	%esi, %eax
	orl	%ecx, %eax
	jmp	LBB0_10
LBB0_4:
	movb	(%r14), %al
	andb	$3, %al
	movq	_ADV7343_COMPOSITE_ID@GOTPCREL(%rip), %rcx
	cmpq	%rbx, (%rcx)
	jne	LBB0_6
## %bb.5:
	movq	_ADV7343_COMPOSITE_POWER_VALUE@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_6:
	movq	_ADV7343_COMPONENT_ID@GOTPCREL(%rip), %rcx
	cmpq	%rbx, (%rcx)
	jne	LBB0_8
## %bb.7:
	movq	_ADV7343_COMPONENT_POWER_VALUE@GOTPCREL(%rip), %rcx
	jmp	LBB0_9
LBB0_8:
	movq	_ADV7343_SVIDEO_POWER_VALUE@GOTPCREL(%rip), %rcx
LBB0_9:
	orb	(%rcx), %al
LBB0_10:
	movq	_ADV7343_POWER_MODE_REG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movzbl	%al, %r12d
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_adv7343_write
	testl	%eax, %eax
	js	LBB0_19
## %bb.11:
	movl	%r12d, (%r14)
	movq	_YUV_OUTPUT_SELECT@GOTPCREL(%rip), %rax
	movb	(%rax), %r12b
	orb	4(%r14), %r12b
	movq	_ADV7343_MODE_REG0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%r12b, %edx
	movq	%r15, %rdi
	callq	_adv7343_write
	testl	%eax, %eax
	js	LBB0_19
## %bb.12:
	movb	%r12b, 4(%r14)
	movq	_SD_DAC_1_DI@GOTPCREL(%rip), %rax
	movb	(%rax), %r12b
	movq	_SD_DAC_2_DI@GOTPCREL(%rip), %rax
	andb	5(%r14), %r12b
	andb	(%rax), %r12b
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	(%rax), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %eax
	leal	(%rcx,%rcx), %edx
	testl	%ecx, %ecx
	movzbl	%dl, %edx
	cmovel	%ecx, %edx
	orb	%dl, %r12b
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	shlb	$2, %al
	orb	%r12b, %al
	movl	%eax, %r12d
LBB0_15:
	movq	_ADV7343_SD_MODE_REG2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%r12b, %edx
	movq	%r15, %rdi
	callq	_adv7343_write
	testl	%eax, %eax
	js	LBB0_19
## %bb.16:
	movb	%r12b, 5(%r14)
	movq	_HD_RGB_INPUT_DI@GOTPCREL(%rip), %rax
	movb	(%rax), %r12b
	movq	_HD_DAC_SWAP_DI@GOTPCREL(%rip), %rax
	andb	6(%r14), %r12b
	andb	(%rax), %r12b
	movq	_ADV7343_HD_MODE_REG6@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%r12b, %edx
	movq	%r15, %rdi
	callq	_adv7343_write
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_20
## %bb.17:
	movb	%r12b, 6(%r14)
	jne	LBB0_20
## %bb.18:
	xorl	%ebx, %ebx
	jmp	LBB0_21
LBB0_19:
	movl	%eax, %ebx
LBB0_20:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_v4l2_err
LBB0_21:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ADV7343_SVIDEO_ID,8,3          ## @ADV7343_SVIDEO_ID
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid output type or output type not supported:%d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ADV7343_COMPOSITE_ID,8,3       ## @ADV7343_COMPOSITE_ID
	.comm	_ADV7343_COMPOSITE_POWER_VALUE,1,0 ## @ADV7343_COMPOSITE_POWER_VALUE
	.comm	_ADV7343_COMPONENT_ID,8,3       ## @ADV7343_COMPONENT_ID
	.comm	_ADV7343_COMPONENT_POWER_VALUE,1,0 ## @ADV7343_COMPONENT_POWER_VALUE
	.comm	_ADV7343_SVIDEO_POWER_VALUE,1,0 ## @ADV7343_SVIDEO_POWER_VALUE
	.comm	_ADV7343_POWER_MODE_REG,4,2     ## @ADV7343_POWER_MODE_REG
	.comm	_YUV_OUTPUT_SELECT,1,0          ## @YUV_OUTPUT_SELECT
	.comm	_ADV7343_MODE_REG0,4,2          ## @ADV7343_MODE_REG0
	.comm	_SD_DAC_1_DI,1,0                ## @SD_DAC_1_DI
	.comm	_SD_DAC_2_DI,1,0                ## @SD_DAC_2_DI
	.comm	_ADV7343_SD_MODE_REG2,4,2       ## @ADV7343_SD_MODE_REG2
	.comm	_HD_RGB_INPUT_DI,1,0            ## @HD_RGB_INPUT_DI
	.comm	_HD_DAC_SWAP_DI,1,0             ## @HD_DAC_SWAP_DI
	.comm	_ADV7343_HD_MODE_REG6,4,2       ## @ADV7343_HD_MODE_REG6
L_.str.1:                               ## @.str.1
	.asciz	"Error setting output, write failed\n"

	.no_dead_strip	_adv7343_setoutput
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7343_setoutput
_adv7343_setoutput:                     ; @adv7343_setoutput
	.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
	mov	x19, x0
	bl	_to_state
Lloh0:
	adrp	x8, _ADV7343_SVIDEO_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ADV7343_SVIDEO_ID@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x21
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _debug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	mov	x4, x21
	bl	_v4l2_dbg
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_19
LBB0_2:
	mov	x20, x0
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_4
; %bb.3:
	ldp	w9, w10, [x8, #8]
	orr	w9, w9, w10, lsl #1
	ldr	x8, [x8, #16]
	ldp	w10, w11, [x8, #8]
	orr	w9, w9, w10, lsl #2
	ldp	w12, w10, [x8]
	orr	w9, w9, w10, lsl #3
	orr	w9, w9, w12, lsl #4
	ldp	w8, w10, [x8, #16]
	orr	w9, w9, w10, lsl #5
	orr	w8, w9, w8, lsl #6
	orr	w8, w8, w11, lsl #7
	b	LBB0_10
LBB0_4:
	ldrb	w8, [x20]
	and	w8, w8, #0x3
Lloh11:
	adrp	x9, _ADV7343_COMPOSITE_ID@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ADV7343_COMPOSITE_ID@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x21
	b.ne	LBB0_6
; %bb.5:
Lloh14:
	adrp	x9, _ADV7343_COMPOSITE_POWER_VALUE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ADV7343_COMPOSITE_POWER_VALUE@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
Lloh16:
	adrp	x9, _ADV7343_COMPONENT_ID@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ADV7343_COMPONENT_ID@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x21
	b.ne	LBB0_8
; %bb.7:
Lloh19:
	adrp	x9, _ADV7343_COMPONENT_POWER_VALUE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _ADV7343_COMPONENT_POWER_VALUE@GOTPAGEOFF]
	b	LBB0_9
LBB0_8:
Lloh21:
	adrp	x9, _ADV7343_SVIDEO_POWER_VALUE@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ADV7343_SVIDEO_POWER_VALUE@GOTPAGEOFF]
LBB0_9:
	ldrb	w9, [x9]
	orr	w8, w9, w8
LBB0_10:
Lloh23:
	adrp	x9, _ADV7343_POWER_MODE_REG@GOTPAGE
Lloh24:
	ldr	x9, [x9, _ADV7343_POWER_MODE_REG@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x9]
	and	w22, w8, #0xff
	mov	x0, x19
	mov	x2, x22
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_17
; %bb.11:
	str	w22, [x20]
	ldrb	w8, [x20, #4]
Lloh26:
	adrp	x9, _YUV_OUTPUT_SELECT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _YUV_OUTPUT_SELECT@GOTPAGEOFF]
	ldrb	w9, [x9]
	orr	w22, w9, w8
Lloh28:
	adrp	x8, _ADV7343_MODE_REG0@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ADV7343_MODE_REG0@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	and	w2, w22, #0xff
	mov	x0, x19
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_17
; %bb.12:
	strb	w22, [x20, #4]
	ldrb	w8, [x20, #5]
Lloh31:
	adrp	x9, _SD_DAC_1_DI@GOTPAGE
Lloh32:
	ldr	x9, [x9, _SD_DAC_1_DI@GOTPAGEOFF]
	ldrb	w9, [x9]
Lloh33:
	adrp	x10, _SD_DAC_2_DI@GOTPAGE
Lloh34:
	ldr	x10, [x10, _SD_DAC_2_DI@GOTPAGEOFF]
	ldrb	w10, [x10]
	and	w8, w9, w8
	and	w22, w8, w10
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_14
; %bb.13:
	ldr	x8, [x8]
	ldp	w9, w8, [x8]
	lsl	w10, w9, #1
	cmp	w9, #0
	csel	w9, wzr, w10, eq
	orr	w9, w9, w22
	orr	w10, w9, w8, lsl #2
	cmp	w8, #0
	csel	w22, w9, w10, eq
LBB0_14:
Lloh35:
	adrp	x8, _ADV7343_SD_MODE_REG2@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ADV7343_SD_MODE_REG2@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	and	w2, w22, #0xff
	mov	x0, x19
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_17
; %bb.15:
	strb	w22, [x20, #5]
	ldrb	w8, [x20, #6]
Lloh38:
	adrp	x9, _HD_RGB_INPUT_DI@GOTPAGE
Lloh39:
	ldr	x9, [x9, _HD_RGB_INPUT_DI@GOTPAGEOFF]
	ldrb	w9, [x9]
Lloh40:
	adrp	x10, _HD_DAC_SWAP_DI@GOTPAGE
Lloh41:
	ldr	x10, [x10, _HD_DAC_SWAP_DI@GOTPAGEOFF]
	ldrb	w10, [x10]
	and	w8, w9, w8
	and	w22, w8, w10
Lloh42:
	adrp	x8, _ADV7343_HD_MODE_REG6@GOTPAGE
Lloh43:
	ldr	x8, [x8, _ADV7343_HD_MODE_REG6@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	and	w2, w22, #0xff
	mov	x0, x19
	bl	_adv7343_write
	mov	x21, x0
	tbnz	w0, #31, LBB0_18
; %bb.16:
	strb	w22, [x20, #6]
	cbnz	w21, LBB0_18
	b	LBB0_19
LBB0_17:
	mov	x21, x0
LBB0_18:
Lloh45:
	adrp	x1, l_.str.1@PAGE
Lloh46:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
LBB0_19:
	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
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_ADV7343_SVIDEO_ID,8,3          ; @ADV7343_SVIDEO_ID
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid output type or output type not supported:%d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ADV7343_COMPOSITE_ID,8,3       ; @ADV7343_COMPOSITE_ID
	.comm	_ADV7343_COMPOSITE_POWER_VALUE,1,0 ; @ADV7343_COMPOSITE_POWER_VALUE
	.comm	_ADV7343_COMPONENT_ID,8,3       ; @ADV7343_COMPONENT_ID
	.comm	_ADV7343_COMPONENT_POWER_VALUE,1,0 ; @ADV7343_COMPONENT_POWER_VALUE
	.comm	_ADV7343_SVIDEO_POWER_VALUE,1,0 ; @ADV7343_SVIDEO_POWER_VALUE
	.comm	_ADV7343_POWER_MODE_REG,4,2     ; @ADV7343_POWER_MODE_REG
	.comm	_YUV_OUTPUT_SELECT,1,0          ; @YUV_OUTPUT_SELECT
	.comm	_ADV7343_MODE_REG0,4,2          ; @ADV7343_MODE_REG0
	.comm	_SD_DAC_1_DI,1,0                ; @SD_DAC_1_DI
	.comm	_SD_DAC_2_DI,1,0                ; @SD_DAC_2_DI
	.comm	_ADV7343_SD_MODE_REG2,4,2       ; @ADV7343_SD_MODE_REG2
	.comm	_HD_RGB_INPUT_DI,1,0            ; @HD_RGB_INPUT_DI
	.comm	_HD_DAC_SWAP_DI,1,0             ; @HD_DAC_SWAP_DI
	.comm	_ADV7343_HD_MODE_REG6,4,2       ; @ADV7343_HD_MODE_REG6
l_.str.1:                               ; @.str.1
	.asciz	"Error setting output, write failed\n"

	.no_dead_strip	_adv7343_setoutput
.subsections_via_symbols
