	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adv7343_setstd
_adv7343_setstd:                        ## @adv7343_setstd
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	callq	_to_state
	movq	%rax, %r13
	movq	_stdinfo@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_4
## %bb.1:
	movl	%eax, %edx
	xorl	%ecx, %ecx
	movq	%r12, %rsi
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ebx, (%rsi)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	incq	%rcx
	addq	$12, %rsi
	cmpq	%rcx, %rdx
	jne	LBB0_2
	jmp	LBB0_6
LBB0_4:
	xorl	%ecx, %ecx
LBB0_5:
	cmpl	%eax, %ecx
	jne	LBB0_7
LBB0_6:
	movq	_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	%ebx, %r8
	leaq	L_.str(%rip), %rcx
	movl	$1, %edi
	movq	%r15, %rdx
	callq	_v4l2_dbg
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_25
LBB0_7:
	movq	_SD_STD_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	notl	%r14d
	andl	(%r13), %r14d
	movl	%ecx, %eax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	orl	4(%r12,%rax,4), %r14d
	movq	_ADV7343_SD_MODE_REG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_adv7343_write
	movq	%r15, %rdi
	testl	%eax, %eax
	js	LBB0_15
## %bb.8:
	movq	%r13, %r15
	movl	%r14d, (%r13)
	movq	_INPUT_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	notl	%r14d
	andl	4(%r13), %r14d
	movq	_SD_INPUT_MODE@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movq	_ADV7343_MODE_SELECT_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edx
	callq	_adv7343_write
	testl	%eax, %eax
	js	LBB0_16
## %bb.9:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movl	%r14d, 4(%r15)
	movq	_ADV7343_FSC_REG0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movsbl	8(%r12,%r14,4), %edx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_adv7343_write
	testl	%eax, %eax
	js	LBB0_17
## %bb.10:
	leaq	(%r12,%r14,4), %r14
	addq	$8, %r14
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	leal	1(%r12), %esi
	movsbl	1(%r14), %edx
	movq	%r15, %rdi
	callq	_adv7343_write
	testl	%eax, %eax
	js	LBB0_17
## %bb.11:
	leal	2(%r12), %esi
	movsbl	2(%r14), %edx
	movq	%r15, %rdi
	callq	_adv7343_write
	testl	%eax, %eax
	js	LBB0_17
## %bb.12:
	addl	$3, %r12d
	movsbl	3(%r14), %edx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_adv7343_write
	testl	%eax, %eax
	js	LBB0_17
## %bb.13:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r12d
	movq	_V4L2_STD_NTSC@GOTPCREL(%rip), %rax
	movq	_V4L2_STD_NTSC_443@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ebx, %ecx
	je	LBB0_21
## %bb.14:
	andl	$3, %r12d
	jmp	LBB0_22
LBB0_15:
	movl	%eax, %r13d
	movq	%rdi, %r15
	jmp	LBB0_24
LBB0_17:
	movl	%eax, %r13d
	jmp	LBB0_24
LBB0_16:
	movl	%eax, %r13d
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_24:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_v4l2_err
LBB0_25:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	_V4L2_STD_SECAM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	movl	%r12d, %ecx
	orl	$4, %ecx
	testl	%ebx, %eax
	cmovnel	%ecx, %r12d
LBB0_22:
	movq	_ADV7343_SD_MODE_REG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r12d, %edx
	callq	_adv7343_write
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_24
## %bb.23:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	%r12d, (%rax)
	jne	LBB0_24
## %bb.26:
	xorl	%r13d, %r13d
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_stdinfo,8,3                    ## @stdinfo
	.comm	_debug,4,2                      ## @debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid std or std is not supported: %llx\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SD_STD_MASK,4,2                ## @SD_STD_MASK
	.comm	_ADV7343_SD_MODE_REG1,4,2       ## @ADV7343_SD_MODE_REG1
	.comm	_INPUT_MODE_MASK,8,3            ## @INPUT_MODE_MASK
	.comm	_SD_INPUT_MODE,4,2              ## @SD_INPUT_MODE
	.comm	_ADV7343_MODE_SELECT_REG,4,2    ## @ADV7343_MODE_SELECT_REG
	.comm	_ADV7343_FSC_REG0,4,2           ## @ADV7343_FSC_REG0
	.comm	_V4L2_STD_NTSC,4,2              ## @V4L2_STD_NTSC
	.comm	_V4L2_STD_NTSC_443,4,2          ## @V4L2_STD_NTSC_443
	.comm	_V4L2_STD_SECAM,4,2             ## @V4L2_STD_SECAM
L_.str.1:                               ## @.str.1
	.asciz	"Error setting std, write failed\n"

	.no_dead_strip	_adv7343_setstd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adv7343_setstd
_adv7343_setstd:                        ; @adv7343_setstd
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x1
	mov	x19, x0
	bl	_to_state
	mov	x20, x0
Lloh0:
	adrp	x8, _stdinfo@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stdinfo@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
	mov	x0, x22
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x26, #0
	mov	w8, w0
	mov	x9, x22
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9]
	tst	w10, w21
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x26, x26, #1
	add	x9, x9, #12
	cmp	x8, x26
	b.ne	LBB0_2
	b	LBB0_6
LBB0_4:
	mov	w26, #0
LBB0_5:
	cmp	w26, w0
	b.ne	LBB0_7
LBB0_6:
Lloh3:
	adrp	x8, _debug@GOTPAGE
Lloh4:
	ldr	x8, [x8, _debug@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	sxtw	x4, w21
Lloh6:
	adrp	x3, l_.str@PAGE
Lloh7:
	add	x3, x3, l_.str@PAGEOFF
	mov	w0, #1
	mov	x2, x19
	bl	_v4l2_dbg
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_17
LBB0_7:
	ldr	w8, [x20]
Lloh11:
	adrp	x9, _SD_STD_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SD_STD_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	bic	w8, w8, w9
	mov	w9, #12
	umaddl	x9, w26, w9, x22
	ldr	w9, [x9, #4]
	orr	w24, w8, w9
Lloh14:
	adrp	x25, _ADV7343_SD_MODE_REG1@GOTPAGE
Lloh15:
	ldr	x25, [x25, _ADV7343_SD_MODE_REG1@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x19
	mov	x2, x24
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_15
; %bb.8:
	str	w24, [x20]
	ldr	w8, [x20, #4]
Lloh16:
	adrp	x9, _INPUT_MODE_MASK@GOTPAGE
Lloh17:
	ldr	x9, [x9, _INPUT_MODE_MASK@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _SD_INPUT_MODE@GOTPAGE
Lloh20:
	ldr	x10, [x10, _SD_INPUT_MODE@GOTPAGEOFF]
	bic	w8, w8, w9
Lloh21:
	ldr	w9, [x10]
	orr	w24, w8, w9
Lloh22:
	adrp	x8, _ADV7343_MODE_SELECT_REG@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ADV7343_MODE_SELECT_REG@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x24
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_15
; %bb.9:
	mov	w8, w26
	str	w24, [x20, #4]
	mov	w9, #12
	madd	x24, x8, x9, x22
	ldrsb	w2, [x24, #8]!
Lloh25:
	adrp	x8, _ADV7343_FSC_REG0@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ADV7343_FSC_REG0@GOTPAGEOFF]
Lloh27:
	ldr	w22, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_15
; %bb.10:
	add	w1, w22, #1
	ldrsb	w2, [x24, #1]
	mov	x0, x19
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_15
; %bb.11:
	add	w1, w22, #2
	ldrsb	w2, [x24, #2]
	mov	x0, x19
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_15
; %bb.12:
	add	w1, w22, #3
	ldrsb	w2, [x24, #3]
	mov	x0, x19
	bl	_adv7343_write
	tbnz	w0, #31, LBB0_15
; %bb.13:
	ldr	w8, [x20]
Lloh28:
	adrp	x9, _V4L2_STD_NTSC@GOTPAGE
Lloh29:
	ldr	x9, [x9, _V4L2_STD_NTSC@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
Lloh31:
	adrp	x10, _V4L2_STD_NTSC_443@GOTPAGE
Lloh32:
	ldr	x10, [x10, _V4L2_STD_NTSC_443@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w21
	b.eq	LBB0_18
; %bb.14:
	and	w21, w8, #0x3
	b	LBB0_19
LBB0_15:
	mov	x23, x0
LBB0_16:
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_v4l2_err
LBB0_17:
	mov	x0, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_18:
Lloh36:
	adrp	x9, _V4L2_STD_SECAM@GOTPAGE
Lloh37:
	ldr	x9, [x9, _V4L2_STD_SECAM@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w10, w8, #0x4
	bics	wzr, w21, w9
	csel	w21, w8, w10, eq
LBB0_19:
	ldr	w1, [x25]
	mov	x0, x19
	mov	x2, x21
	bl	_adv7343_write
	mov	x23, x0
	tbnz	w0, #31, LBB0_16
; %bb.20:
	str	w21, [x20]
	cbnz	w23, LBB0_16
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_stdinfo,8,3                    ; @stdinfo
	.comm	_debug,4,2                      ; @debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid std or std is not supported: %llx\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SD_STD_MASK,4,2                ; @SD_STD_MASK
	.comm	_ADV7343_SD_MODE_REG1,4,2       ; @ADV7343_SD_MODE_REG1
	.comm	_INPUT_MODE_MASK,8,3            ; @INPUT_MODE_MASK
	.comm	_SD_INPUT_MODE,4,2              ; @SD_INPUT_MODE
	.comm	_ADV7343_MODE_SELECT_REG,4,2    ; @ADV7343_MODE_SELECT_REG
	.comm	_ADV7343_FSC_REG0,4,2           ; @ADV7343_FSC_REG0
	.comm	_V4L2_STD_NTSC,4,2              ; @V4L2_STD_NTSC
	.comm	_V4L2_STD_NTSC_443,4,2          ; @V4L2_STD_NTSC_443
	.comm	_V4L2_STD_SECAM,4,2             ; @V4L2_STD_SECAM
l_.str.1:                               ; @.str.1
	.asciz	"Error setting std, write failed\n"

	.no_dead_strip	_adv7343_setstd
.subsections_via_symbols
