	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PBI_PROTO80_Initialise         ## -- Begin function PBI_PROTO80_Initialise
	.p2align	4, 0x90
_PBI_PROTO80_Initialise:                ## @PBI_PROTO80_Initialise
	.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	%rdi, %r14
	movl	$1, %r12d
	cmpl	$2, (%rdi)
	jl	LBB0_8
## %bb.1:
	movq	%rsi, %rbx
	movl	$1, %r12d
	movl	$1, %r13d
	leaq	L_.str(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx,%r13,8), %rax
	movslq	%r12d, %rcx
	incl	%r12d
	movq	%rax, (%rbx,%rcx,8)
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movslq	(%r14), %rax
	cmpq	%rax, %r13
	jge	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r13,8), %rdi
	movq	%r15, %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx,%r13,8), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.3(%rip), %rdi
	callq	_Log_print
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_Log_print
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_PBI_PROTO80_enabled@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_7
LBB0_8:
	movl	%r12d, (%r14)
	movq	_PBI_PROTO80_enabled@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	je	LBB0_9
## %bb.10:
	movl	$2048, %edi                     ## imm = 0x800
	callq	_Util_malloc
	movq	_proto80rom@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	_proto80_rom_filename@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	%rax, %rsi
	movl	$2048, %edx                     ## imm = 0x800
	callq	_Atari800_LoadImage
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	leaq	L_.str.5(%rip), %rdi
	callq	_Log_print
	movq	_TRUE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movq	_PBI_D6D7ram@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_13
LBB0_9:
	movq	_TRUE@GOTPCREL(%rip), %rbx
	jmp	LBB0_13
LBB0_11:
	movq	(%rbx), %rdi
	callq	_free
	movq	_FALSE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	%eax, (%r14)
	leaq	L_.str.4(%rip), %rdi
	callq	_Log_print
LBB0_13:
	movl	(%rbx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-proto80"

L_.str.1:                               ## @.str.1
	.asciz	"proto80 enabled"

	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_PBI_PROTO80_enabled,4,2        ## @PBI_PROTO80_enabled
L_.str.2:                               ## @.str.2
	.asciz	"-help"

L_.str.3:                               ## @.str.3
	.asciz	"\t-proto80         Emulate a prototype 80 column board for the 1090"

	.comm	_proto80rom,8,3                 ## @proto80rom
	.comm	_proto80_rom_filename,4,2       ## @proto80_rom_filename
	.comm	_FALSE,4,2                      ## @FALSE
L_.str.4:                               ## @.str.4
	.asciz	"Couldn't load proto80 rom image"

L_.str.5:                               ## @.str.5
	.asciz	"loaded proto80 rom image"

	.comm	_PBI_D6D7ram,4,2                ## @PBI_D6D7ram
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PBI_PROTO80_Initialise         ; -- Begin function PBI_PROTO80_Initialise
	.p2align	2
_PBI_PROTO80_Initialise:                ; @PBI_PROTO80_Initialise
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x25, _PBI_PROTO80_enabled@GOTPAGE
Lloh1:
	ldr	x25, [x25, _PBI_PROTO80_enabled@GOTPAGEOFF]
	cmp	w8, #2
	b.lt	LBB0_8
; %bb.1:
	mov	x20, x1
Lloh2:
	adrp	x26, _TRUE@GOTPAGE
Lloh3:
	ldr	x26, [x26, _TRUE@GOTPAGEOFF]
Lloh4:
	adrp	x21, l_.str@PAGE
Lloh5:
	add	x21, x21, l_.str@PAGEOFF
Lloh6:
	adrp	x22, l_.str.1@PAGE
Lloh7:
	add	x22, x22, l_.str.1@PAGEOFF
	mov	w28, #1
Lloh8:
	adrp	x23, l_.str.2@PAGE
Lloh9:
	add	x23, x23, l_.str.2@PAGEOFF
	mov	w27, #1
Lloh10:
	adrp	x24, l_.str.3@PAGE
Lloh11:
	add	x24, x24, l_.str.3@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, x28, lsl #3]
	str	x8, [x20, w27, sxtw #3]
	add	w27, w27, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x28, x28, #1
	ldrsw	x8, [x19]
	cmp	x28, x8
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20, x28, lsl #3]
	mov	x1, x21
	bl	_strcmp
	cbz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x20, x28, lsl #3]
	mov	x1, x23
	bl	_strcmp
	cbnz	x0, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_Log_print
	b	LBB0_2
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x22
	bl	_Log_print
	ldr	w8, [x26]
	str	w8, [x25]
	b	LBB0_3
LBB0_8:
	mov	w27, #1
LBB0_9:
	str	w27, [x19]
	ldr	w8, [x25]
Lloh12:
	adrp	x19, _TRUE@GOTPAGE
Lloh13:
	ldr	x19, [x19, _TRUE@GOTPAGEOFF]
	cbz	w8, LBB0_13
; %bb.10:
	mov	w0, #2048
	bl	_Util_malloc
	mov	x1, x0
Lloh14:
	adrp	x20, _proto80rom@GOTPAGE
Lloh15:
	ldr	x20, [x20, _proto80rom@GOTPAGEOFF]
	str	x0, [x20]
Lloh16:
	adrp	x8, _proto80_rom_filename@GOTPAGE
Lloh17:
	ldr	x8, [x8, _proto80_rom_filename@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	w2, #2048
	bl	_Atari800_LoadImage
	cbz	w0, LBB0_12
; %bb.11:
Lloh19:
	adrp	x0, l_.str.5@PAGE
Lloh20:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_Log_print
	ldr	w8, [x19]
Lloh21:
	adrp	x9, _PBI_D6D7ram@GOTPAGE
Lloh22:
	ldr	x9, [x9, _PBI_D6D7ram@GOTPAGEOFF]
Lloh23:
	str	w8, [x9]
	b	LBB0_13
LBB0_12:
	ldr	x0, [x20]
	bl	_free
Lloh24:
	adrp	x19, _FALSE@GOTPAGE
Lloh25:
	ldr	x19, [x19, _FALSE@GOTPAGEOFF]
	ldr	w8, [x19]
	str	w8, [x25]
Lloh26:
	adrp	x0, l_.str.4@PAGE
Lloh27:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_Log_print
LBB0_13:
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-proto80"

l_.str.1:                               ; @.str.1
	.asciz	"proto80 enabled"

	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_PBI_PROTO80_enabled,4,2        ; @PBI_PROTO80_enabled
l_.str.2:                               ; @.str.2
	.asciz	"-help"

l_.str.3:                               ; @.str.3
	.asciz	"\t-proto80         Emulate a prototype 80 column board for the 1090"

	.comm	_proto80rom,8,3                 ; @proto80rom
	.comm	_proto80_rom_filename,4,2       ; @proto80_rom_filename
	.comm	_FALSE,4,2                      ; @FALSE
l_.str.4:                               ; @.str.4
	.asciz	"Couldn't load proto80 rom image"

l_.str.5:                               ; @.str.5
	.asciz	"loaded proto80 rom image"

	.comm	_PBI_D6D7ram,4,2                ; @PBI_D6D7ram
.subsections_via_symbols
