	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function load_roms
_load_roms:                             ## @load_roms
	.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	_Atari800_machine_type@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	movq	_Atari800_MACHINE_5200@GOTPCREL(%rip), %r12
	movq	_emuos_mode@GOTPCREL(%rip), %r13
	cmpq	(%r12), %rdi
	je	LBB0_3
## %bb.1:
	cmpl	$2, (%r13)
	jne	LBB0_3
## %bb.2:
	movq	_Atari800_MACHINE_800@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	movl	$2048, %eax                     ## imm = 0x800
	movl	$8192, %edi                     ## imm = 0x2000
	cmovel	%eax, %edi
	callq	_COPY_EMUOS
	movq	_Atari800_os_version@GOTPCREL(%rip), %rax
	movl	$-1, (%rax)
	jmp	LBB0_17
LBB0_3:
	movq	_MEMORY_ram_size@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_Atari800_tv_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_Atari800_os_version@GOTPCREL(%rip), %r15
	leaq	-48(%rbp), %r8
	leaq	-44(%rbp), %r9
	movq	%r15, %rcx
	callq	_SYSROM_ChooseROMs
	movslq	(%r15), %rax
	cmpq	$-1, %rax
	je	LBB0_5
## %bb.4:
	movq	_SYSROM_roms@GOTPCREL(%rip), %r14
	movq	(%r14), %rcx
	movl	(%rcx,%rax,8), %edx
	movl	4(%rcx,%rax,8), %edi
	movq	_MEMORY_os@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_Atari800_LoadImage
	testq	%rax, %rax
	je	LBB0_5
## %bb.8:
	movq	(%rbx), %rax
	cmpq	(%r12), %rax
	je	LBB0_17
## %bb.9:
	movslq	-48(%rbp), %rax
	cmpq	$-1, %rax
	je	LBB0_11
## %bb.10:
	movq	(%r14), %rcx
	movl	(%rcx,%rax,8), %edx
	movl	4(%rcx,%rax,8), %edi
	movq	_MEMORY_basic@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_Atari800_LoadImage
	xorl	%ecx, %ecx
	testq	%rax, %rax
	setne	%cl
	movq	_MEMORY_have_basic@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	jne	LBB0_13
	jmp	LBB0_12
LBB0_5:
	movl	$-1, (%r15)
	movq	(%rbx), %rax
	cmpq	(%r12), %rax
	je	LBB0_19
## %bb.6:
	cmpl	$1, (%r13)
	jne	LBB0_19
## %bb.7:
	movq	_Atari800_MACHINE_800@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movl	$2048, %eax                     ## imm = 0x800
	movl	$8192, %edi                     ## imm = 0x2000
	cmovel	%eax, %edi
	callq	_COPY_EMUOS
	jmp	LBB0_17
LBB0_19:
	movq	_FALSE@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_11:
	movq	_MEMORY_have_basic@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
LBB0_12:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_Atari800_builtin_basic@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_13:
	movq	_Atari800_builtin_game@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	je	LBB0_17
## %bb.14:
	movslq	-44(%rbp), %rax
	cmpq	$-1, %rax
	je	LBB0_16
## %bb.15:
	movq	(%r14), %rcx
	movl	(%rcx,%rax,8), %edx
	movl	4(%rcx,%rax,8), %edi
	movq	_MEMORY_xegame@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_Atari800_LoadImage
	testq	%rax, %rax
	jne	LBB0_17
LBB0_16:
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_17:
	movq	_MEMORY_xe_bank@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_TRUE@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Atari800_machine_type,8,3      ## @Atari800_machine_type
	.comm	_Atari800_MACHINE_5200,8,3      ## @Atari800_MACHINE_5200
	.comm	_emuos_mode,4,2                 ## @emuos_mode
	.comm	_Atari800_MACHINE_800,8,3       ## @Atari800_MACHINE_800
	.comm	_Atari800_os_version,4,2        ## @Atari800_os_version
	.comm	_MEMORY_ram_size,4,2            ## @MEMORY_ram_size
	.comm	_Atari800_tv_mode,4,2           ## @Atari800_tv_mode
	.comm	_SYSROM_roms,8,3                ## @SYSROM_roms
	.comm	_MEMORY_os,4,2                  ## @MEMORY_os
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_MEMORY_basic,4,2               ## @MEMORY_basic
	.comm	_MEMORY_have_basic,4,2          ## @MEMORY_have_basic
	.comm	_Atari800_builtin_basic,4,2     ## @Atari800_builtin_basic
	.comm	_Atari800_builtin_game,4,2      ## @Atari800_builtin_game
	.comm	_MEMORY_xegame,4,2              ## @MEMORY_xegame
	.comm	_MEMORY_xe_bank,8,3             ## @MEMORY_xe_bank
	.comm	_TRUE,4,2                       ## @TRUE
	.no_dead_strip	_load_roms
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function load_roms
_load_roms:                             ; @load_roms
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x21, _Atari800_machine_type@GOTPAGE
Lloh1:
	ldr	x21, [x21, _Atari800_machine_type@GOTPAGEOFF]
	ldr	x0, [x21]
Lloh2:
	adrp	x22, _Atari800_MACHINE_5200@GOTPAGE
Lloh3:
	ldr	x22, [x22, _Atari800_MACHINE_5200@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh4:
	adrp	x23, _emuos_mode@GOTPAGE
Lloh5:
	ldr	x23, [x23, _emuos_mode@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	x0, x8
	ccmp	w9, #2, #0, ne
	b.eq	LBB0_6
; %bb.1:
Lloh6:
	adrp	x8, _MEMORY_ram_size@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MEMORY_ram_size@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _Atari800_tv_mode@GOTPAGE
Lloh10:
	ldr	x8, [x8, _Atari800_tv_mode@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x19, _Atari800_os_version@GOTPAGE
Lloh13:
	ldr	x19, [x19, _Atari800_os_version@GOTPAGEOFF]
	add	x4, sp, #12
	add	x5, sp, #8
	mov	x3, x19
	bl	_SYSROM_ChooseROMs
	ldrsw	x8, [x19]
	cmn	w8, #1
	b.eq	LBB0_7
; %bb.2:
Lloh14:
	adrp	x20, _SYSROM_roms@GOTPAGE
Lloh15:
	ldr	x20, [x20, _SYSROM_roms@GOTPAGEOFF]
	ldr	x9, [x20]
	add	x8, x9, x8, lsl #3
Lloh16:
	adrp	x9, _MEMORY_os@GOTPAGE
Lloh17:
	ldr	x9, [x9, _MEMORY_os@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x9]
	ldp	w2, w0, [x8]
	bl	_Atari800_LoadImage
	cbz	x0, LBB0_7
; %bb.3:
	ldr	x8, [x21]
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_16
; %bb.4:
	ldrsw	x8, [sp, #12]
	cmn	w8, #1
	b.eq	LBB0_10
; %bb.5:
	ldr	x9, [x20]
	add	x8, x9, x8, lsl #3
Lloh19:
	adrp	x9, _MEMORY_basic@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MEMORY_basic@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x9]
	ldp	w2, w0, [x8]
	bl	_Atari800_LoadImage
	cmp	x0, #0
	cset	w8, ne
Lloh22:
	adrp	x9, _MEMORY_have_basic@GOTPAGE
Lloh23:
	ldr	x9, [x9, _MEMORY_have_basic@GOTPAGEOFF]
Lloh24:
	str	w8, [x9]
	cbnz	x0, LBB0_12
	b	LBB0_11
LBB0_6:
Lloh25:
	adrp	x8, _Atari800_MACHINE_800@GOTPAGE
Lloh26:
	ldr	x8, [x8, _Atari800_MACHINE_800@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	cmp	x0, x8
	mov	w8, #8192
	mov	w9, #2048
	csel	w0, w9, w8, eq
	bl	_COPY_EMUOS
Lloh28:
	adrp	x8, _Atari800_os_version@GOTPAGE
Lloh29:
	ldr	x8, [x8, _Atari800_os_version@GOTPAGEOFF]
	mov	w9, #-1
Lloh30:
	str	w9, [x8]
	b	LBB0_16
LBB0_7:
	mov	w8, #-1
	str	w8, [x19]
	ldr	x8, [x21]
	ldr	x9, [x22]
	ldr	w10, [x23]
	cmp	x8, x9
	ccmp	w10, #1, #0, ne
	b.eq	LBB0_9
; %bb.8:
Lloh31:
	adrp	x8, _FALSE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
	b	LBB0_17
LBB0_9:
Lloh33:
	adrp	x9, _Atari800_MACHINE_800@GOTPAGE
Lloh34:
	ldr	x9, [x9, _Atari800_MACHINE_800@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	cmp	x8, x9
	mov	w8, #8192
	mov	w9, #2048
	csel	w0, w9, w8, eq
	bl	_COPY_EMUOS
	b	LBB0_16
LBB0_10:
Lloh36:
	adrp	x8, _MEMORY_have_basic@GOTPAGE
Lloh37:
	ldr	x8, [x8, _MEMORY_have_basic@GOTPAGEOFF]
Lloh38:
	str	wzr, [x8]
LBB0_11:
Lloh39:
	adrp	x8, _FALSE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
Lloh42:
	adrp	x9, _Atari800_builtin_basic@GOTPAGE
Lloh43:
	ldr	x9, [x9, _Atari800_builtin_basic@GOTPAGEOFF]
Lloh44:
	str	w8, [x9]
LBB0_12:
Lloh45:
	adrp	x19, _Atari800_builtin_game@GOTPAGE
Lloh46:
	ldr	x19, [x19, _Atari800_builtin_game@GOTPAGEOFF]
	ldr	w8, [x19]
	cbz	w8, LBB0_16
; %bb.13:
	ldrsw	x8, [sp, #8]
	cmn	w8, #1
	b.eq	LBB0_15
; %bb.14:
	ldr	x9, [x20]
	add	x8, x9, x8, lsl #3
Lloh47:
	adrp	x9, _MEMORY_xegame@GOTPAGE
Lloh48:
	ldr	x9, [x9, _MEMORY_xegame@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x9]
	ldp	w2, w0, [x8]
	bl	_Atari800_LoadImage
	cbnz	x0, LBB0_16
LBB0_15:
Lloh50:
	adrp	x8, _FALSE@GOTPAGE
Lloh51:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_16:
Lloh53:
	adrp	x8, _MEMORY_xe_bank@GOTPAGE
Lloh54:
	ldr	x8, [x8, _MEMORY_xe_bank@GOTPAGEOFF]
Lloh55:
	str	xzr, [x8]
Lloh56:
	adrp	x8, _TRUE@GOTPAGE
Lloh57:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
LBB0_17:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotStr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotStr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGot	Lloh56, Lloh57
	.loh AdrpLdrGotStr	Lloh53, Lloh54, Lloh55
	.cfi_endproc
                                        ; -- End function
	.comm	_Atari800_machine_type,8,3      ; @Atari800_machine_type
	.comm	_Atari800_MACHINE_5200,8,3      ; @Atari800_MACHINE_5200
	.comm	_emuos_mode,4,2                 ; @emuos_mode
	.comm	_Atari800_MACHINE_800,8,3       ; @Atari800_MACHINE_800
	.comm	_Atari800_os_version,4,2        ; @Atari800_os_version
	.comm	_MEMORY_ram_size,4,2            ; @MEMORY_ram_size
	.comm	_Atari800_tv_mode,4,2           ; @Atari800_tv_mode
	.comm	_SYSROM_roms,8,3                ; @SYSROM_roms
	.comm	_MEMORY_os,4,2                  ; @MEMORY_os
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_MEMORY_basic,4,2               ; @MEMORY_basic
	.comm	_MEMORY_have_basic,4,2          ; @MEMORY_have_basic
	.comm	_Atari800_builtin_basic,4,2     ; @Atari800_builtin_basic
	.comm	_Atari800_builtin_game,4,2      ; @Atari800_builtin_game
	.comm	_MEMORY_xegame,4,2              ; @MEMORY_xegame
	.comm	_MEMORY_xe_bank,8,3             ; @MEMORY_xe_bank
	.comm	_TRUE,4,2                       ; @TRUE
	.no_dead_strip	_load_roms
.subsections_via_symbols
