	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_out_format
_set_out_format:                        ## @set_out_format
	.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
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_VIDEO_MODE_NTSC@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	cmpl	%ebx, (%rax)
	setne	%sil
	callq	_initialize_saa7121
	movq	(%r14), %rax
	movl	%ebx, 8(%rax)
	movq	_VIDEO_MODE_PAL@GOTPCREL(%rip), %rax
	movq	_debNormal@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_XILINX_CTL0@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	%ebx, (%rax)
	jne	LBB0_6
## %bb.1:
	movq	%r14, %rdi
	movl	$2056, %ecx                     ## imm = 0x808
	movl	$2, %r8d
	callq	_debiwrite
	movl	$50, %edi
	callq	_mdelay
	movq	_SAA7146_NUM_LINE_BYTE1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$18875072, %edi                 ## imm = 0x12002C0
	callq	_saawrite
	movq	_NewCard@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_2
## %bb.3:
	movl	(%r15), %esi
	movq	_IBM_MP2_DISP_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$57600, %ecx                    ## imm = 0xE100
	movl	$2, %r8d
	callq	_debiwrite
	movl	$50, %edi
	callq	_mdelay
	xorl	%ecx, %ecx
	cmpq	$0, (%rbx)
	setne	%cl
	shll	$15, %ecx
	orl	$25856, %ecx                    ## imm = 0x6500
	jmp	LBB0_4
LBB0_6:
	movq	%r14, %rdi
	movl	$2048, %ecx                     ## imm = 0x800
	movl	$2, %r8d
	callq	_debiwrite
	movl	$50, %edi
	callq	_mdelay
	movq	_SAA7146_NUM_LINE_BYTE1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$15729344, %edi                 ## imm = 0xF002C0
	callq	_saawrite
	movl	(%r15), %esi
	movq	_IBM_MP2_DISP_MODE@GOTPCREL(%rip), %rax
	movq	_NewCard@GOTPCREL(%rip), %rbx
	xorl	%ecx, %ecx
	cmpq	$0, (%rbx)
	movl	(%rax), %edx
	setne	%cl
	shll	$15, %ecx
	orl	$24832, %ecx                    ## imm = 0x6100
	movq	%r14, %rdi
	movl	$2, %r8d
	callq	_debiwrite
	movl	(%r15), %esi
	movq	_IBM_MP2_DISP_DLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_NTSCFirstActive@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	movl	$25856, %ecx                    ## imm = 0x6500
LBB0_4:
	movl	(%r15), %esi
	movq	_IBM_MP2_DISP_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	movl	$2, %r8d
	callq	_debiwrite
	movl	(%r15), %esi
	movq	_IBM_MP2_DISP_DLY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_PALFirstActive@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	leal	-6(%rax), %ecx
	cmpq	$0, (%rbx)
	cmovnel	%eax, %ecx
	orl	$256, %ecx                      ## imm = 0x100
	movq	%r14, %rdi
	movl	$2, %r8d
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_debiwrite                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDEO_MODE_NTSC,4,2            ## @VIDEO_MODE_NTSC
	.comm	_VIDEO_MODE_PAL,4,2             ## @VIDEO_MODE_PAL
	.comm	_debNormal,4,2                  ## @debNormal
	.comm	_XILINX_CTL0,4,2                ## @XILINX_CTL0
	.comm	_SAA7146_NUM_LINE_BYTE1,4,2     ## @SAA7146_NUM_LINE_BYTE1
	.comm	_NewCard,8,3                    ## @NewCard
	.comm	_IBM_MP2_DISP_MODE,4,2          ## @IBM_MP2_DISP_MODE
	.comm	_IBM_MP2_DISP_DLY,4,2           ## @IBM_MP2_DISP_DLY
	.comm	_PALFirstActive,4,2             ## @PALFirstActive
	.comm	_NTSCFirstActive,4,2            ## @NTSCFirstActive
	.no_dead_strip	_set_out_format
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_out_format
_set_out_format:                        ; @set_out_format
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _VIDEO_MODE_NTSC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDEO_MODE_NTSC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	cset	w1, ne
	bl	_initialize_saa7121
	ldr	x8, [x19]
	str	w20, [x8, #8]
Lloh3:
	adrp	x8, _VIDEO_MODE_PAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VIDEO_MODE_PAL@GOTPAGEOFF]
Lloh5:
	adrp	x21, _debNormal@GOTPAGE
Lloh6:
	ldr	x21, [x21, _debNormal@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	ldr	w1, [x21]
Lloh8:
	adrp	x9, _XILINX_CTL0@GOTPAGE
Lloh9:
	ldr	x9, [x9, _XILINX_CTL0@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x9]
	mov	x0, x19
	cmp	w8, w20
	b.ne	LBB0_4
; %bb.1:
	mov	w3, #2056
	mov	w4, #2
	bl	_debiwrite
	mov	w0, #50
	bl	_mdelay
Lloh11:
	adrp	x8, _SAA7146_NUM_LINE_BYTE1@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SAA7146_NUM_LINE_BYTE1@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w8, #704
	movk	w8, #240, lsl #16
	add	w0, w8, #768, lsl #12           ; =3145728
	bl	_saawrite
Lloh14:
	adrp	x22, _NewCard@GOTPAGE
Lloh15:
	ldr	x22, [x22, _NewCard@GOTPAGEOFF]
	ldr	x8, [x22]
	mov	w20, #25856
	cbz	x8, LBB0_3
; %bb.2:
	ldr	w1, [x21]
Lloh16:
	adrp	x8, _IBM_MP2_DISP_MODE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IBM_MP2_DISP_MODE@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #57600
	mov	w4, #2
	bl	_debiwrite
	mov	w0, #50
	bl	_mdelay
	ldr	x8, [x22]
	cmp	x8, #0
	mov	w8, #58624
	csel	w20, w20, w8, eq
LBB0_3:
	ldr	w1, [x21]
Lloh19:
	adrp	x8, _IBM_MP2_DISP_MODE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IBM_MP2_DISP_MODE@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x20
	mov	w4, #2
	bl	_debiwrite
	ldr	w1, [x21]
Lloh22:
	adrp	x8, _IBM_MP2_DISP_DLY@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IBM_MP2_DISP_DLY@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	ldr	x8, [x22]
Lloh25:
	adrp	x9, _PALFirstActive@GOTPAGE
Lloh26:
	ldr	x9, [x9, _PALFirstActive@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
	mov	w3, #2048
	mov	w4, #2
	bl	_debiwrite
	mov	w0, #50
	bl	_mdelay
Lloh27:
	adrp	x8, _SAA7146_NUM_LINE_BYTE1@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SAA7146_NUM_LINE_BYTE1@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	w0, #704
	movk	w0, #240, lsl #16
	bl	_saawrite
	ldr	w1, [x21]
Lloh30:
	adrp	x8, _IBM_MP2_DISP_MODE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _IBM_MP2_DISP_MODE@GOTPAGEOFF]
Lloh32:
	adrp	x20, _NewCard@GOTPAGE
Lloh33:
	ldr	x20, [x20, _NewCard@GOTPAGEOFF]
Lloh34:
	ldr	w2, [x8]
	ldr	x8, [x20]
	cmp	x8, #0
	mov	w8, #57600
	mov	w9, #24832
	csel	w3, w9, w8, eq
	mov	x0, x19
	mov	w4, #2
	bl	_debiwrite
	ldr	w1, [x21]
Lloh35:
	adrp	x8, _IBM_MP2_DISP_DLY@GOTPAGE
Lloh36:
	ldr	x8, [x8, _IBM_MP2_DISP_DLY@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
	ldr	x8, [x20]
Lloh38:
	adrp	x9, _NTSCFirstActive@GOTPAGE
Lloh39:
	ldr	x9, [x9, _NTSCFirstActive@GOTPAGEOFF]
LBB0_5:
	ldr	w9, [x9]
	sub	w10, w9, #6
	cmp	x8, #0
	csel	w8, w10, w9, eq
	orr	w3, w8, #0x100
	mov	x0, x19
	mov	w4, #2
	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
	b	_debiwrite
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh34
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDEO_MODE_NTSC,4,2            ; @VIDEO_MODE_NTSC
	.comm	_VIDEO_MODE_PAL,4,2             ; @VIDEO_MODE_PAL
	.comm	_debNormal,4,2                  ; @debNormal
	.comm	_XILINX_CTL0,4,2                ; @XILINX_CTL0
	.comm	_SAA7146_NUM_LINE_BYTE1,4,2     ; @SAA7146_NUM_LINE_BYTE1
	.comm	_NewCard,8,3                    ; @NewCard
	.comm	_IBM_MP2_DISP_MODE,4,2          ; @IBM_MP2_DISP_MODE
	.comm	_IBM_MP2_DISP_DLY,4,2           ; @IBM_MP2_DISP_DLY
	.comm	_PALFirstActive,4,2             ; @PALFirstActive
	.comm	_NTSCFirstActive,4,2            ; @NTSCFirstActive
	.no_dead_strip	_set_out_format
.subsections_via_symbols
