	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_std
_set_std:                               ## @set_std
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_POSEIDON_TVNORMS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movq	%rdi, %r14
	movl	(%rsi), %edx
	movq	_poseidon_tvnorms@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	testl	%edx, (%rcx,%rbx)
	jne	LBB0_3
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	$24, %rbx
	decq	%rax
	jne	LBB0_2
LBB0_8:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_9
LBB0_3:
	movq	8(%rcx,%rbx), %r12
	movl	16(%rcx,%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_log
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_VIDEO_STD_SEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rcx
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_send_set_req
	movq	%rax, %r12
	orq	-40(%rbp), %rax
	jne	LBB0_6
## %bb.4:
	movq	(%r15), %rax
	movl	(%rax,%rbx), %eax
	movl	%eax, 8(%r14)
	movq	_V4L2_STD_525_60@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	$576, %ecx                      ## imm = 0x240
	movl	$480, %eax                      ## imm = 0x1E0
	cmovel	%ecx, %eax
	movq	_V4L_NTSC_VBI_FRAMESIZE@GOTPCREL(%rip), %rcx
	cmoveq	_V4L_PAL_VBI_FRAMESIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%r14)
	cmpl	%eax, 12(%r14)
	je	LBB0_6
## %bb.5:
	movl	%eax, 12(%r14)
	imull	20(%r14), %eax
	addl	%eax, %eax
	movl	%eax, 16(%r14)
LBB0_6:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_9:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_POSEIDON_TVNORMS,8,3           ## @POSEIDON_TVNORMS
	.comm	_poseidon_tvnorms,8,3           ## @poseidon_tvnorms
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"name : %s"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VIDEO_STD_SEL,4,2              ## @VIDEO_STD_SEL
	.comm	_V4L2_STD_525_60,4,2            ## @V4L2_STD_525_60
	.comm	_V4L_NTSC_VBI_FRAMESIZE,4,2     ## @V4L_NTSC_VBI_FRAMESIZE
	.comm	_V4L_PAL_VBI_FRAMESIZE,4,2      ## @V4L_PAL_VBI_FRAMESIZE
	.no_dead_strip	_set_std
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_std
_set_std:                               ; @set_std
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x8, _POSEIDON_TVNORMS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POSEIDON_TVNORMS@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.1:
	mov	x19, x0
	mov	x21, #0
	ldr	w9, [x1]
Lloh3:
	adrp	x22, _poseidon_tvnorms@GOTPAGE
Lloh4:
	ldr	x22, [x22, _poseidon_tvnorms@GOTPAGEOFF]
	ldr	x10, [x22]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10, x21]
	tst	w11, w9
	b.ne	LBB0_5
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x21, x21, #24
	subs	x8, x8, #1
	b.ne	LBB0_2
LBB0_4:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_9
LBB0_5:
	add	x8, x10, x21
	ldr	x20, [x8, #8]
	ldr	w1, [x8, #16]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_log
	mov	x0, x19
	bl	_mutex_lock
Lloh10:
	adrp	x8, _VIDEO_STD_SEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _VIDEO_STD_SEL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x3, sp, #8
	mov	x0, x19
	mov	x2, x20
	bl	_send_set_req
	mov	x20, x0
	ldr	x8, [sp, #8]
	orr	x8, x0, x8
	cbnz	x8, LBB0_8
; %bb.6:
	ldr	x8, [x22]
	ldr	w8, [x8, x21]
	str	w8, [x19, #8]
Lloh13:
	adrp	x9, _V4L2_STD_525_60@GOTPAGE
Lloh14:
	ldr	x9, [x9, _V4L2_STD_525_60@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w8
	mov	w8, #480
	mov	w9, #576
Lloh16:
	adrp	x10, _V4L_PAL_VBI_FRAMESIZE@GOTPAGE
Lloh17:
	ldr	x10, [x10, _V4L_PAL_VBI_FRAMESIZE@GOTPAGEOFF]
Lloh18:
	adrp	x11, _V4L_NTSC_VBI_FRAMESIZE@GOTPAGE
Lloh19:
	ldr	x11, [x11, _V4L_NTSC_VBI_FRAMESIZE@GOTPAGEOFF]
	csel	w8, w9, w8, eq
	csel	x9, x10, x11, eq
	ldr	w9, [x9]
	str	w9, [x19, #4]
	ldr	w9, [x19, #12]
	cmp	w9, w8
	b.eq	LBB0_8
; %bb.7:
	ldr	w9, [x19, #20]
	mul	w9, w8, w9
	lsl	w9, w9, #1
	stp	w8, w9, [x19, #12]
LBB0_8:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_9:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_POSEIDON_TVNORMS,8,3           ; @POSEIDON_TVNORMS
	.comm	_poseidon_tvnorms,8,3           ; @poseidon_tvnorms
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"name : %s"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VIDEO_STD_SEL,4,2              ; @VIDEO_STD_SEL
	.comm	_V4L2_STD_525_60,4,2            ; @V4L2_STD_525_60
	.comm	_V4L_NTSC_VBI_FRAMESIZE,4,2     ; @V4L_NTSC_VBI_FRAMESIZE
	.comm	_V4L_PAL_VBI_FRAMESIZE,4,2      ; @V4L_PAL_VBI_FRAMESIZE
	.no_dead_strip	_set_std
.subsections_via_symbols
