	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AF80_Initialise                ## -- Begin function AF80_Initialise
	.p2align	4, 0x90
_AF80_Initialise:                       ## @AF80_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
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	$1, %r13d
	cmpl	$2, (%rdi)
	jl	LBB0_8
## %bb.1:
	movq	%rsi, %rbx
	movl	$1, %r13d
	movl	$1, %r12d
	leaq	L_.str(%rip), %r15
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx,%r12,8), %rax
	movslq	%r13d, %rcx
	incl	%r13d
	movq	%rax, (%rbx,%rcx,8)
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r12
	movslq	(%r14), %rax
	cmpq	%rax, %r12
	jge	LBB0_8
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx,%r12,8), %rdi
	movq	%r15, %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%rbx,%r12,8), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	L_.str.2(%rip), %rdi
	callq	_Log_print
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_AF80_enabled@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_7
LBB0_8:
	movl	%r13d, (%r14)
	movq	_TRUE@GOTPCREL(%rip), %r14
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_17
## %bb.9:
	movq	_AF80_enabled@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	je	LBB0_17
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	callq	_Log_print
	movl	$4096, %edi                     ## imm = 0x1000
	callq	_Util_malloc
	movq	_af80_rom@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	_af80_rom_filename@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	%rax, %rsi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_Atari800_LoadImage
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	leaq	L_.str.5(%rip), %rdi
	callq	_Log_print
	movl	$4096, %edi                     ## imm = 0x1000
	callq	_Util_malloc
	movq	_af80_charset@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	movq	_af80_charset_filename@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	%rax, %rsi
	movl	$4096, %edx                     ## imm = 0x1000
	callq	_Atari800_LoadImage
	testl	%eax, %eax
	je	LBB0_13
## %bb.15:
	leaq	L_.str.7(%rip), %rdi
	callq	_Log_print
	movl	$2048, %edi                     ## imm = 0x800
	callq	_Util_malloc
	movq	_af80_screen@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movl	$2048, %edi                     ## imm = 0x800
	callq	_Util_malloc
	movq	_af80_attrib@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_AF80_Reset
	movq	_rgbi_palette@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_AF80_palette@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edx
	andl	$10, %edx
	movl	%ebx, %esi
	shrl	$2, %esi
	andl	$1, %esi
	orq	%rdx, %rsi
	movl	(%rax,%rsi,4), %edx
	movl	%edx, (%rcx,%rbx,4)
	movl	16(%rax,%rsi,4), %edx
	movl	%edx, 4(%rcx,%rbx,4)
	addq	$2, %rbx
	cmpq	$16, %rbx
	jne	LBB0_16
	jmp	LBB0_17
LBB0_11:
	movq	(%rbx), %rdi
	callq	_free
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_14
LBB0_13:
	movq	(%r12), %rdi
	callq	_free
	movq	(%rbx), %rdi
	callq	_free
	movq	$0, (%rbx)
	leaq	L_.str.6(%rip), %rdi
	movq	%r12, %rbx
LBB0_14:
	movq	$0, (%rbx)
	movq	_FALSE@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movl	%eax, (%r15)
	callq	_Log_print
LBB0_17:
	movl	(%r14), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-af80"

	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_AF80_enabled,4,2               ## @AF80_enabled
L_.str.1:                               ## @.str.1
	.asciz	"-help"

L_.str.2:                               ## @.str.2
	.asciz	"\t-af80            Emulate the Austin Franklin 80 column board"

L_.str.3:                               ## @.str.3
	.asciz	"Austin Franklin 80 enabled"

	.comm	_af80_rom,8,3                   ## @af80_rom
	.comm	_af80_rom_filename,4,2          ## @af80_rom_filename
L_.str.4:                               ## @.str.4
	.asciz	"Couldn't load Austin Franklin ROM image"

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

	.comm	_af80_charset,8,3               ## @af80_charset
	.comm	_af80_charset_filename,4,2      ## @af80_charset_filename
L_.str.6:                               ## @.str.6
	.asciz	"Couldn't load Austin Franklin charset image"

L_.str.7:                               ## @.str.7
	.asciz	"loaded Austin Franklin charset image"

	.comm	_af80_screen,8,3                ## @af80_screen
	.comm	_af80_attrib,8,3                ## @af80_attrib
	.comm	_rgbi_palette,8,3               ## @rgbi_palette
	.comm	_AF80_palette,8,3               ## @AF80_palette
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AF80_Initialise                ; -- Begin function AF80_Initialise
	.p2align	2
_AF80_Initialise:                       ; @AF80_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
Lloh0:
	adrp	x8, _FALSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh2:
	ldr	w26, [x8]
	ldr	w8, [x0]
Lloh3:
	adrp	x25, _AF80_enabled@GOTPAGE
Lloh4:
	ldr	x25, [x25, _AF80_enabled@GOTPAGEOFF]
	cmp	w8, #2
	b.lt	LBB0_8
; %bb.1:
	mov	x20, x1
Lloh5:
	adrp	x27, _TRUE@GOTPAGE
Lloh6:
	ldr	x27, [x27, _TRUE@GOTPAGEOFF]
Lloh7:
	adrp	x21, l_.str@PAGE
Lloh8:
	add	x21, x21, l_.str@PAGEOFF
	mov	w24, #1
Lloh9:
	adrp	x22, l_.str.1@PAGE
Lloh10:
	add	x22, x22, l_.str.1@PAGEOFF
	mov	w28, #1
Lloh11:
	adrp	x23, l_.str.2@PAGE
Lloh12:
	add	x23, x23, l_.str.2@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20, x24, lsl #3]
	str	x8, [x20, w28, sxtw #3]
	add	w28, w28, #1
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x24, x24, #1
	ldrsw	x8, [x19]
	cmp	x24, x8
	b.ge	LBB0_9
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20, x24, lsl #3]
	mov	x1, x21
	bl	_strcmp
	cbz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x20, x24, lsl #3]
	mov	x1, x22
	bl	_strcmp
	cbnz	x0, LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w26, [x27]
	mov	x0, x23
	bl	_Log_print
	b	LBB0_2
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x27]
	str	w8, [x25]
	b	LBB0_3
LBB0_8:
	mov	w28, #1
LBB0_9:
	str	w28, [x19]
	ldr	w8, [x25]
	cmp	w26, #0
	ccmp	w8, #0, #4, eq
	b.ne	LBB0_11
; %bb.10:
Lloh13:
	adrp	x19, _TRUE@GOTPAGE
Lloh14:
	ldr	x19, [x19, _TRUE@GOTPAGEOFF]
	b	LBB0_18
LBB0_11:
Lloh15:
	adrp	x0, l_.str.3@PAGE
Lloh16:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Log_print
	mov	w0, #4096
	bl	_Util_malloc
	mov	x1, x0
Lloh17:
	adrp	x19, _af80_rom@GOTPAGE
Lloh18:
	ldr	x19, [x19, _af80_rom@GOTPAGEOFF]
	str	x0, [x19]
Lloh19:
	adrp	x8, _af80_rom_filename@GOTPAGE
Lloh20:
	ldr	x8, [x8, _af80_rom_filename@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	w2, #4096
	bl	_Atari800_LoadImage
	cbz	w0, LBB0_15
; %bb.12:
Lloh22:
	adrp	x0, l_.str.5@PAGE
Lloh23:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_Log_print
	mov	w0, #4096
	bl	_Util_malloc
	mov	x1, x0
Lloh24:
	adrp	x20, _af80_charset@GOTPAGE
Lloh25:
	ldr	x20, [x20, _af80_charset@GOTPAGEOFF]
	str	x0, [x20]
Lloh26:
	adrp	x8, _af80_charset_filename@GOTPAGE
Lloh27:
	ldr	x8, [x8, _af80_charset_filename@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	mov	w2, #4096
	bl	_Atari800_LoadImage
	cbz	w0, LBB0_16
; %bb.13:
Lloh29:
	adrp	x0, l_.str.7@PAGE
Lloh30:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_Log_print
	mov	w0, #2048
	bl	_Util_malloc
Lloh31:
	adrp	x8, _af80_screen@GOTPAGE
Lloh32:
	ldr	x8, [x8, _af80_screen@GOTPAGEOFF]
Lloh33:
	str	x0, [x8]
	mov	w0, #2048
	bl	_Util_malloc
Lloh34:
	adrp	x8, _af80_attrib@GOTPAGE
Lloh35:
	ldr	x8, [x8, _af80_attrib@GOTPAGEOFF]
Lloh36:
	str	x0, [x8]
	bl	_AF80_Reset
	mov	x8, #0
Lloh37:
	adrp	x9, _rgbi_palette@GOTPAGE
Lloh38:
	ldr	x9, [x9, _rgbi_palette@GOTPAGEOFF]
Lloh39:
	adrp	x10, _AF80_palette@GOTPAGE
Lloh40:
	ldr	x10, [x10, _AF80_palette@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
Lloh42:
	ldr	x10, [x10]
	mov	x11, #-16
	mov	w12, #10
Lloh43:
	adrp	x19, _TRUE@GOTPAGE
Lloh44:
	ldr	x19, [x19, _TRUE@GOTPAGEOFF]
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	add	x13, x11, #16
	and	x14, x13, x12
	and	x15, x8, #0x4
	orr	x14, x15, x14
	bfxil	x14, x13, #2, #1
	ldr	w13, [x9, x14, lsl #2]
	str	w13, [x10, x8]
	add	x8, x8, #4
	adds	x11, x11, #1
	b.lo	LBB0_14
	b	LBB0_18
LBB0_15:
	ldr	x0, [x19]
	bl	_free
Lloh45:
	adrp	x0, l_.str.4@PAGE
Lloh46:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_16:
	ldr	x0, [x20]
	bl	_free
	ldr	x0, [x19]
	bl	_free
	str	xzr, [x19]
Lloh47:
	adrp	x0, l_.str.6@PAGE
Lloh48:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x19, x20
LBB0_17:
	str	xzr, [x19]
Lloh49:
	adrp	x19, _FALSE@GOTPAGE
Lloh50:
	ldr	x19, [x19, _FALSE@GOTPAGEOFF]
	ldr	w8, [x19]
	str	w8, [x25]
	bl	_Log_print
LBB0_18:
	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	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh41
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotStr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-af80"

	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_AF80_enabled,4,2               ; @AF80_enabled
l_.str.1:                               ; @.str.1
	.asciz	"-help"

l_.str.2:                               ; @.str.2
	.asciz	"\t-af80            Emulate the Austin Franklin 80 column board"

l_.str.3:                               ; @.str.3
	.asciz	"Austin Franklin 80 enabled"

	.comm	_af80_rom,8,3                   ; @af80_rom
	.comm	_af80_rom_filename,4,2          ; @af80_rom_filename
l_.str.4:                               ; @.str.4
	.asciz	"Couldn't load Austin Franklin ROM image"

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

	.comm	_af80_charset,8,3               ; @af80_charset
	.comm	_af80_charset_filename,4,2      ; @af80_charset_filename
l_.str.6:                               ; @.str.6
	.asciz	"Couldn't load Austin Franklin charset image"

l_.str.7:                               ; @.str.7
	.asciz	"loaded Austin Franklin charset image"

	.comm	_af80_screen,8,3                ; @af80_screen
	.comm	_af80_attrib,8,3                ; @af80_attrib
	.comm	_rgbi_palette,8,3               ; @rgbi_palette
	.comm	_AF80_palette,8,3               ; @AF80_palette
.subsections_via_symbols
