	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_medusa_set_videostandard       ## -- Begin function medusa_set_videostandard
	.p2align	4, 0x90
_medusa_set_videostandard:              ## @medusa_set_videostandard
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	$0, -28(%rbp)
	movl	(%rdi), %eax
	movq	_V4L2_STD_PAL_BG@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_2
## %bb.1:
	movq	_V4L2_STD_PAL_DK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_3
LBB0_2:
	movq	%rbx, %rdi
	callq	_medusa_initialize_pal
LBB0_4:
	movq	8(%rbx), %rdi
	movq	_DENC_A_REG_4@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	-28(%rbp), %r14
	movq	%r14, %rdx
	callq	_cx25821_i2c_read
	movl	%eax, %edi
	movl	$4, %esi
	callq	_setBitAtPos
	movq	8(%rbx), %rdi
	movl	(%r15), %esi
	movl	%eax, %edx
	callq	_cx25821_i2c_write
	movq	8(%rbx), %rdi
	movq	_DENC_B_REG_4@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdx
	callq	_cx25821_i2c_read
	movl	%eax, %edi
	movl	$4, %esi
	callq	_setBitAtPos
	movq	8(%rbx), %rdi
	movl	(%r15), %esi
	movl	%eax, %edx
	callq	_cx25821_i2c_write
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rbx, %rdi
	callq	_medusa_initialize_ntsc
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_V4L2_STD_PAL_BG,4,2            ## @V4L2_STD_PAL_BG
	.comm	_V4L2_STD_PAL_DK,4,2            ## @V4L2_STD_PAL_DK
	.comm	_DENC_A_REG_4,4,2               ## @DENC_A_REG_4
	.comm	_DENC_B_REG_4,4,2               ## @DENC_B_REG_4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_medusa_set_videostandard       ; -- Begin function medusa_set_videostandard
	.p2align	2
_medusa_set_videostandard:              ; @medusa_set_videostandard
	.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	x19, x0
	str	wzr, [sp, #12]
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _V4L2_STD_PAL_BG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _V4L2_STD_PAL_BG@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x9, _V4L2_STD_PAL_DK@GOTPAGE
Lloh4:
	ldr	x9, [x9, _V4L2_STD_PAL_DK@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
LBB0_2:
	mov	x0, x19
	bl	_medusa_initialize_pal
LBB0_3:
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x20, _DENC_A_REG_4@GOTPAGE
Lloh7:
	ldr	x20, [x20, _DENC_A_REG_4@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	bl	_cx25821_i2c_read
	mov	w1, #4
	bl	_setBitAtPos
	mov	x2, x0
	ldr	x0, [x19, #8]
	ldr	w1, [x20]
	bl	_cx25821_i2c_write
	ldr	x0, [x19, #8]
Lloh8:
	adrp	x20, _DENC_B_REG_4@GOTPAGE
Lloh9:
	ldr	x20, [x20, _DENC_B_REG_4@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #12
	bl	_cx25821_i2c_read
	mov	w1, #4
	bl	_setBitAtPos
	mov	x2, x0
	ldr	x0, [x19, #8]
	ldr	w1, [x20]
	bl	_cx25821_i2c_write
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_4:
	mov	x0, x19
	bl	_medusa_initialize_ntsc
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_V4L2_STD_PAL_BG,4,2            ; @V4L2_STD_PAL_BG
	.comm	_V4L2_STD_PAL_DK,4,2            ; @V4L2_STD_PAL_DK
	.comm	_DENC_A_REG_4,4,2               ; @DENC_A_REG_4
	.comm	_DENC_B_REG_4,4,2               ; @DENC_B_REG_4
.subsections_via_symbols
