	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BlitScreen                     ## -- Begin function BlitScreen
	.p2align	4, 0x90
_BlitScreen:                            ## @BlitScreen
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_screen@GOTPCREL(%rip), %r14
	movq	(%r14), %r13
	testq	%r13, %r13
	je	LBB0_24
## %bb.1:
	movq	%rdi, %r12
	movq	_paletterefresh@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_RedoPalette
	movq	$0, (%rbx)
	movq	(%r14), %r13
LBB0_3:
	movq	_srendline@GOTPCREL(%rip), %rax
	movslq	(%rax), %rbx
	movq	_BlitBuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	cmovneq	%rax, %r13
	movq	%r13, %rdi
	callq	_SDL_MUSTLOCK
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%r13, %rdi
	callq	_SDL_LockSurface
	testq	%rax, %rax
	jne	LBB0_24
LBB0_5:
	shlq	$10, %rbx
	addq	%rbx, %r12
	movq	16(%r13), %rsi
	movq	__fullscreen@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.7:
	movq	_NWIDTH@GOTPCREL(%rip), %rax
	movq	_exs@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	imull	(%rax), %ecx
	movl	(%r13), %eax
	subl	%ecx, %eax
	movl	4(%r13), %ecx
	movl	%eax, %r14d
	shrl	$31, %r14d
	addl	%eax, %r14d
	sarl	%r14d
	movq	_curbpp@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edx
	sarl	$3, %edx
	imull	%r14d, %edx
	movslq	%edx, %rdx
	leaq	(%rsi,%rdx,4), %rsi
	movq	_tlines@GOTPCREL(%rip), %rdx
	movq	_eys@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	imull	(%rdx), %edi
	xorl	%r15d, %r15d
	subl	%edi, %ecx
	jle	LBB0_9
## %bb.8:
	movl	%ecx, %r15d
	shrl	$31, %r15d
	addl	%ecx, %r15d
	sarl	%r15d
	movslq	8(%r13), %rcx
	movslq	%r15d, %rdx
	imulq	%rcx, %rdx
	leaq	(%rsi,%rdx,4), %rsi
	jmp	LBB0_9
LBB0_6:
	movq	_curbpp@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	xorl	%r14d, %r14d
	xorl	%r15d, %r15d
LBB0_9:
	movq	_BlitBuf@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	movq	_NOFFSET@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	leaq	(%r12,%rcx,4), %rdi
	movq	_NWIDTH@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movq	_tlines@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	8(%r13), %r8d
	cmpl	$9, %eax
	jl	LBB0_14
## %bb.10:
	testq	%rbx, %rbx
	je	LBB0_13
## %bb.11:
	subq	$8, %rsp
	movl	$1, %r9d
	pushq	$1
	jmp	LBB0_12
LBB0_14:
	testq	%rbx, %rbx
	je	LBB0_16
## %bb.15:
	movq	_sponge@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subq	$8, %rsp
	movl	$1, %r9d
	pushq	%rax
	pushq	$0
	pushq	$1
	jmp	LBB0_17
LBB0_13:
	movq	_exs@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_eys@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subq	$8, %rsp
	pushq	%rax
LBB0_12:
	callq	_Blit8ToHigh
	addq	$16, %rsp
	jmp	LBB0_18
LBB0_16:
	movq	_exs@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_eys@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	movq	_eefx@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ebx
	movq	_sponge@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subq	$8, %rsp
	pushq	%rax
	pushq	%rbx
	pushq	%r10
LBB0_17:
	callq	_Blit8To8
	addq	$32, %rsp
LBB0_18:
	movq	%r13, %rdi
	callq	_SDL_MUSTLOCK
	testq	%rax, %rax
	je	LBB0_20
## %bb.19:
	movq	%r13, %rdi
	callq	_SDL_UnlockSurface
LBB0_20:
	movq	_BlitBuf@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	movq	_screen@GOTPCREL(%rip), %rbx
	movq	_tlines@GOTPCREL(%rip), %r13
	je	LBB0_22
## %bb.21:
	xorps	%xmm0, %xmm0
	movups	%xmm0, -80(%rbp)
	movl	(%r12), %eax
	movl	%eax, -88(%rbp)
	movl	(%r13), %ecx
	movl	%ecx, -84(%rbp)
	movups	%xmm0, -56(%rbp)
	movq	_exs@GOTPCREL(%rip), %rdx
	imull	(%rdx), %eax
	movl	%eax, -64(%rbp)
	movq	_eys@GOTPCREL(%rip), %rax
	imull	(%rax), %ecx
	movl	%ecx, -60(%rbp)
	movq	(%rbx), %rdx
	leaq	-88(%rbp), %rsi
	leaq	-64(%rbp), %rcx
	callq	_SDL_BlitSurface
LBB0_22:
	movq	(%rbx), %rdi
	movq	_exs@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	imull	(%r12), %ecx
	movq	_eys@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	imull	(%r13), %r8d
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_SDL_UpdateRect
	movq	(%rbx), %rdi
	movq	_SDL_DOUBLEBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 12(%rdi)
	je	LBB0_24
## %bb.23:
	callq	_SDL_Flip
LBB0_24:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_screen,8,3                     ## @screen
	.comm	_paletterefresh,8,3             ## @paletterefresh
	.comm	_srendline,4,2                  ## @srendline
	.comm	_BlitBuf,8,3                    ## @BlitBuf
	.comm	__fullscreen,8,3                ## @_fullscreen
	.comm	_NWIDTH,4,2                     ## @NWIDTH
	.comm	_exs,4,2                        ## @exs
	.comm	_curbpp,4,2                     ## @curbpp
	.comm	_tlines,4,2                     ## @tlines
	.comm	_eys,4,2                        ## @eys
	.comm	_NOFFSET,4,2                    ## @NOFFSET
	.comm	_sponge,4,2                     ## @sponge
	.comm	_eefx,4,2                       ## @eefx
	.comm	_SDL_DOUBLEBUF,4,2              ## @SDL_DOUBLEBUF
	.comm	_usingogl,8,3                   ## @usingogl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BlitScreen                     ; -- Begin function BlitScreen
	.p2align	2
_BlitScreen:                            ; @BlitScreen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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, _screen@GOTPAGE
Lloh1:
	ldr	x22, [x22, _screen@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_24
; %bb.1:
	mov	x20, x0
Lloh2:
	adrp	x19, _paletterefresh@GOTPAGE
Lloh3:
	ldr	x19, [x19, _paletterefresh@GOTPAGEOFF]
	ldr	x9, [x19]
	cbz	x9, LBB0_3
; %bb.2:
	bl	_RedoPalette
	str	xzr, [x19]
	ldr	x8, [x22]
LBB0_3:
Lloh4:
	adrp	x9, _srendline@GOTPAGE
Lloh5:
	ldr	x9, [x9, _srendline@GOTPAGEOFF]
Lloh6:
	ldrsw	x21, [x9]
Lloh7:
	adrp	x27, _BlitBuf@GOTPAGE
Lloh8:
	ldr	x27, [x27, _BlitBuf@GOTPAGEOFF]
	ldr	x9, [x27]
	cmp	x9, #0
	csel	x19, x8, x9, eq
	mov	x0, x19
	bl	_SDL_MUSTLOCK
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_SDL_LockSurface
	cbnz	x0, LBB0_24
LBB0_5:
	add	x8, x20, x21, lsl #10
	ldr	x1, [x19, #16]
Lloh9:
	adrp	x9, __fullscreen@GOTPAGE
Lloh10:
	ldr	x9, [x9, __fullscreen@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
Lloh12:
	adrp	x25, _NWIDTH@GOTPAGE
Lloh13:
	ldr	x25, [x25, _NWIDTH@GOTPAGEOFF]
Lloh14:
	adrp	x23, _tlines@GOTPAGE
Lloh15:
	ldr	x23, [x23, _tlines@GOTPAGEOFF]
Lloh16:
	adrp	x26, _exs@GOTPAGE
Lloh17:
	ldr	x26, [x26, _exs@GOTPAGEOFF]
Lloh18:
	adrp	x24, _eys@GOTPAGE
Lloh19:
	ldr	x24, [x24, _eys@GOTPAGEOFF]
	cbz	x9, LBB0_8
; %bb.6:
	ldr	w9, [x25]
	ldr	w10, [x26]
	ldp	w11, w12, [x19]
	msub	w9, w10, w9, w11
	cmp	w9, #0
	cinc	w9, w9, lt
	asr	w20, w9, #1
Lloh20:
	adrp	x9, _curbpp@GOTPAGE
Lloh21:
	ldr	x9, [x9, _curbpp@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	asr	w10, w9, #3
	mul	w10, w20, w10
	add	x1, x1, w10, sxtw #2
	ldr	w10, [x23]
	ldr	w11, [x24]
	mul	w10, w11, w10
	subs	w10, w12, w10
	b.le	LBB0_9
; %bb.7:
	cmp	w10, #0
	cinc	w10, w10, lt
	asr	w21, w10, #1
	ldr	w10, [x19, #8]
	mul	w10, w10, w21
	add	x1, x1, w10, sxtw #2
	b	LBB0_10
LBB0_8:
	mov	w20, #0
	mov	w21, #0
Lloh23:
	adrp	x9, _curbpp@GOTPAGE
Lloh24:
	ldr	x9, [x9, _curbpp@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	b	LBB0_10
LBB0_9:
	mov	w21, #0
LBB0_10:
	ldr	x10, [x27]
Lloh26:
	adrp	x11, _NOFFSET@GOTPAGE
Lloh27:
	ldr	x11, [x11, _NOFFSET@GOTPAGEOFF]
Lloh28:
	ldrsw	x11, [x11]
	add	x0, x8, x11, lsl #2
	ldr	w2, [x25]
	ldr	w3, [x23]
	ldr	w4, [x19, #8]
	cmp	w9, #9
	b.lt	LBB0_13
; %bb.11:
	cbz	x10, LBB0_15
; %bb.12:
	mov	w5, #1
	mov	w6, #1
	bl	_Blit8ToHigh
	b	LBB0_18
LBB0_13:
	cbz	x10, LBB0_16
; %bb.14:
Lloh29:
	adrp	x8, _sponge@GOTPAGE
Lloh30:
	ldr	x8, [x8, _sponge@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	str	w8, [sp]
	mov	w5, #1
	mov	w6, #1
	mov	w7, #0
	b	LBB0_17
LBB0_15:
	ldr	w5, [x26]
	ldr	w6, [x24]
	bl	_Blit8ToHigh
	b	LBB0_18
LBB0_16:
	ldr	w5, [x26]
	ldr	w6, [x24]
Lloh32:
	adrp	x8, _eefx@GOTPAGE
Lloh33:
	ldr	x8, [x8, _eefx@GOTPAGEOFF]
Lloh34:
	ldr	w7, [x8]
Lloh35:
	adrp	x8, _sponge@GOTPAGE
Lloh36:
	ldr	x8, [x8, _sponge@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	str	w8, [sp]
LBB0_17:
	bl	_Blit8To8
LBB0_18:
	mov	x0, x19
	bl	_SDL_MUSTLOCK
	cbz	x0, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_SDL_UnlockSurface
LBB0_20:
	ldr	x0, [x27]
	cbz	x0, LBB0_22
; %bb.21:
	stp	xzr, xzr, [sp, #48]
	ldr	w8, [x25]
	ldr	w9, [x23]
	stp	w8, w9, [sp, #40]
	stp	xzr, xzr, [sp, #24]
	ldr	w10, [x26]
	mul	w8, w10, w8
	ldr	w10, [x24]
	mul	w9, w10, w9
	stp	w8, w9, [sp, #16]
	ldr	x2, [x22]
	add	x1, sp, #40
	add	x3, sp, #16
	bl	_SDL_BlitSurface
LBB0_22:
	ldr	x0, [x22]
	ldr	w8, [x25]
	ldr	w9, [x26]
	mul	w3, w9, w8
	ldr	w8, [x23]
	ldr	w9, [x24]
	mul	w4, w9, w8
	mov	x1, x20
	mov	x2, x21
	bl	_SDL_UpdateRect
	ldr	x0, [x22]
	ldr	w8, [x0, #12]
Lloh38:
	adrp	x9, _SDL_DOUBLEBUF@GOTPAGE
Lloh39:
	ldr	x9, [x9, _SDL_DOUBLEBUF@GOTPAGEOFF]
Lloh40:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_24
; %bb.23:
	bl	_SDL_Flip
LBB0_24:
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_screen,8,3                     ; @screen
	.comm	_paletterefresh,8,3             ; @paletterefresh
	.comm	_srendline,4,2                  ; @srendline
	.comm	_BlitBuf,8,3                    ; @BlitBuf
	.comm	__fullscreen,8,3                ; @_fullscreen
	.comm	_NWIDTH,4,2                     ; @NWIDTH
	.comm	_exs,4,2                        ; @exs
	.comm	_curbpp,4,2                     ; @curbpp
	.comm	_tlines,4,2                     ; @tlines
	.comm	_eys,4,2                        ; @eys
	.comm	_NOFFSET,4,2                    ; @NOFFSET
	.comm	_sponge,4,2                     ; @sponge
	.comm	_eefx,4,2                       ; @eefx
	.comm	_SDL_DOUBLEBUF,4,2              ; @SDL_DOUBLEBUF
	.comm	_usingogl,8,3                   ; @usingogl
.subsections_via_symbols
