	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dos_update_video               ## -- Begin function dos_update_video
	.p2align	4, 0x90
_dos_update_video:                      ## @dos_update_video
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_bitmap@GOTPCREL(%rip), %r12
	movl	12(%r12), %r14d
	movl	20(%r12), %ebx
	addl	%ebx, %ebx
	addl	16(%r12), %ebx
	addl	%r14d, %r14d
	movq	_interlaced@GOTPCREL(%rip), %rcx
	movq	_SCREEN_W@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	addl	8(%r12), %r14d
	cmpq	$0, (%rcx)
	setne	%cl
	shll	%cl, %ebx
	movq	_SCREEN_H@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_option@GOTPCREL(%rip), %rsi
	xorl	%ecx, %ecx
	cmpq	$0, (%rsi)
	setne	%cl
	addl	%ecx, %ecx
	addl	$2, %ecx
	cltd
	idivl	%ecx
	movl	%eax, %r13d
	movq	%rsi, %r15
	cmpq	$0, 8(%rsi)
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_vsync
LBB0_2:
	cmpq	$0, 24(%r12)
	je	LBB0_6
## %bb.3:
	movq	$0, 24(%r12)
	cmpq	$0, (%r12)
	movq	_screen@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	je	LBB0_5
## %bb.4:
	callq	_clear
	jmp	LBB0_6
LBB0_5:
	movl	$255, %esi
	callq	_clear_to_color
LBB0_6:
	movq	_frame_rate@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rdx
	movl	$2, %edi
	movl	$2, %esi
	callq	_msg_print
	cmpq	$0, (%r15)
	je	LBB0_12
## %bb.7:
	testl	%ebx, %ebx
	jle	LBB0_10
## %bb.8:
	movq	%r14, %r15
	movl	%ebx, %r14d
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	subl	%r15d, %ecx
	movl	%ebx, %eax
	shrl	$31, %eax
	movl	%ecx, %r12d
	shrl	$31, %r12d
	addl	%ebx, %eax
	addl	%ecx, %r12d
	sarl	%eax
	sarl	%r12d
	subl	%eax, %r13d
	addl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	_gen_bmp@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_screen@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	movl	%r12d, %r8d
	movl	%r13d, %r9d
	pushq	$1
	pushq	%r15
	callq	_blit
	addq	$16, %rsp
	incl	%ebx
	addl	$2, %r13d
	cmpl	%ebx, %r14d
	jne	LBB0_9
LBB0_10:
	addq	$8, %rsp
	jmp	LBB0_11
LBB0_12:
	movq	_gen_bmp@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_screen@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SCREEN_W@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	addl	$-352, %ecx                     ## imm = 0xFEA0
	shrl	$31, %ecx
	leal	(%rax,%rcx), %r10d
	addl	$-352, %r10d                    ## imm = 0xFEA0
	sarl	%r10d
	movq	_SCREEN_H@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	addl	$-240, %edx
	shrl	$31, %edx
	leal	(%rcx,%rdx), %r11d
	addl	$-240, %r11d
	sarl	%r11d
	movq	_interlaced@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	setne	%cl
	movl	$240, %eax
	shll	%cl, %eax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	%r14d, %r8d
	movl	%ebx, %r9d
	pushq	%rax
	pushq	$352                            ## imm = 0x160
	pushq	%r11
	pushq	%r10
	callq	_stretch_blit
	addq	$40, %rsp
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bitmap,32,3                    ## @bitmap
	.comm	_interlaced,8,3                 ## @interlaced
	.comm	_SCREEN_W,4,2                   ## @SCREEN_W
	.comm	_SCREEN_H,4,2                   ## @SCREEN_H
	.comm	_option,16,3                    ## @option
	.comm	_screen,4,2                     ## @screen
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d"

	.comm	_frame_rate,4,2                 ## @frame_rate
	.comm	_gen_bmp,4,2                    ## @gen_bmp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dos_update_video               ; -- Begin function dos_update_video
	.p2align	2
_dos_update_video:                      ; @dos_update_video
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x22, _bitmap@GOTPAGE
Lloh1:
	ldr	x22, [x22, _bitmap@GOTPAGEOFF]
	ldp	w8, w9, [x22, #8]
	add	w19, w8, w9, lsl #1
	ldp	w8, w9, [x22, #16]
Lloh2:
	adrp	x10, _interlaced@GOTPAGE
Lloh3:
	ldr	x10, [x10, _interlaced@GOTPAGEOFF]
	add	w8, w8, w9, lsl #1
Lloh4:
	ldr	x9, [x10]
	cmp	x9, #0
	cset	w9, ne
Lloh5:
	adrp	x21, _SCREEN_W@GOTPAGE
Lloh6:
	ldr	x21, [x21, _SCREEN_W@GOTPAGEOFF]
	lsl	w20, w8, w9
	ldr	w8, [x21]
	sub	w8, w8, w19
	cmp	w8, #0
Lloh7:
	adrp	x9, _SCREEN_H@GOTPAGE
Lloh8:
	ldr	x9, [x9, _SCREEN_H@GOTPAGEOFF]
	cinc	w26, w8, lt
Lloh9:
	ldr	w25, [x9]
Lloh10:
	adrp	x28, _option@GOTPAGE
Lloh11:
	ldr	x28, [x28, _option@GOTPAGEOFF]
	ldp	x8, x9, [x28]
	cmp	x8, #0
	mov	w8, #4
	mov	w10, #2
	csel	w23, w10, w8, eq
	cmp	w20, #0
	cinc	w27, w20, lt
	cbz	x9, LBB0_2
; %bb.1:
	bl	_vsync
LBB0_2:
	ldr	x8, [x22, #24]
Lloh12:
	adrp	x24, _screen@GOTPAGE
Lloh13:
	ldr	x24, [x24, _screen@GOTPAGEOFF]
	cbz	x8, LBB0_6
; %bb.3:
	str	xzr, [x22, #24]
	ldr	x8, [x22]
	ldr	w0, [x24]
	cbz	x8, LBB0_5
; %bb.4:
	bl	_clear
	b	LBB0_6
LBB0_5:
	mov	w1, #255
	bl	_clear_to_color
LBB0_6:
Lloh14:
	adrp	x8, _frame_rate@GOTPAGE
Lloh15:
	ldr	x8, [x8, _frame_rate@GOTPAGEOFF]
Lloh16:
	ldr	w3, [x8]
Lloh17:
	adrp	x2, l_.str@PAGE
Lloh18:
	add	x2, x2, l_.str@PAGEOFF
	mov	w0, #2
	mov	w1, #2
	bl	_msg_print
	ldr	x8, [x28]
	cbz	x8, LBB0_10
; %bb.7:
	cmp	w20, #1
	b.lt	LBB0_11
; %bb.8:
	mov	w21, #0
	asr	w22, w26, #1
	sdiv	w8, w25, w23
	sub	w8, w8, w27, asr #1
	lsl	w23, w8, #1
Lloh19:
	adrp	x25, _gen_bmp@GOTPAGE
Lloh20:
	ldr	x25, [x25, _gen_bmp@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x25]
	ldr	w1, [x24]
	mov	w2, #0
	mov	x3, x21
	mov	x4, x22
	mov	x5, x23
	mov	x6, x19
	mov	w7, #1
	bl	_blit
	add	w21, w21, #1
	add	w23, w23, #2
	cmp	w20, w21
	b.ne	LBB0_9
	b	LBB0_11
LBB0_10:
Lloh21:
	adrp	x8, _gen_bmp@GOTPAGE
Lloh22:
	ldr	x8, [x8, _gen_bmp@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	w1, [x24]
	ldr	w8, [x21]
	sub	w9, w8, #352
	sub	w8, w8, #351
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w6, w8, #1
Lloh24:
	adrp	x8, _SCREEN_H@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SCREEN_H@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	sub	w9, w8, #240
	sub	w8, w8, #239
	cmp	w9, #0
	csel	w8, w8, w9, lt
	asr	w7, w8, #1
Lloh27:
	adrp	x8, _interlaced@GOTPAGE
Lloh28:
	ldr	x8, [x8, _interlaced@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w8, ne
	mov	w9, #240
	lsl	w8, w9, w8
	mov	w9, #352
	stp	w9, w8, [sp]
	mov	w2, #0
	mov	w3, #0
	mov	x4, x19
	mov	x5, x20
	bl	_stretch_blit
LBB0_11:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_bitmap,32,3                    ; @bitmap
	.comm	_interlaced,8,3                 ; @interlaced
	.comm	_SCREEN_W,4,2                   ; @SCREEN_W
	.comm	_SCREEN_H,4,2                   ; @SCREEN_H
	.comm	_option,16,3                    ; @option
	.comm	_screen,4,2                     ; @screen
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d"

	.comm	_frame_rate,4,2                 ; @frame_rate
	.comm	_gen_bmp,4,2                    ; @gen_bmp
.subsections_via_symbols
