	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function AllocMapRAM
_AllocMapRAM:                           ## @AllocMapRAM
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_MEMORY_enable_mapram@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.1:
	movq	_Atari800_machine_type@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_Atari800_MACHINE_XLXE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.2:
	movq	_MEMORY_ram_size@GOTPCREL(%rip), %rax
	cmpl	$21, (%rax)
	jl	LBB0_5
## %bb.3:
	movq	_mapram_memory@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
LBB0_8:
	popq	%rbp
	retq
LBB0_5:
	movq	_mapram_memory@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.6:
	callq	_free
	xorl	%eax, %eax
	jmp	LBB0_7
LBB0_4:
	movl	$2048, %edi                     ## imm = 0x800
	callq	_Util_malloc
LBB0_7:
	movq	_mapram_memory@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MEMORY_enable_mapram,8,3       ## @MEMORY_enable_mapram
	.comm	_Atari800_machine_type,8,3      ## @Atari800_machine_type
	.comm	_Atari800_MACHINE_XLXE,8,3      ## @Atari800_MACHINE_XLXE
	.comm	_MEMORY_ram_size,4,2            ## @MEMORY_ram_size
	.comm	_mapram_memory,8,3              ## @mapram_memory
	.no_dead_strip	_AllocMapRAM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function AllocMapRAM
_AllocMapRAM:                           ; @AllocMapRAM
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh0:
	adrp	x8, _MEMORY_enable_mapram@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MEMORY_enable_mapram@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _Atari800_machine_type@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Atari800_machine_type@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
Lloh6:
	adrp	x9, _Atari800_MACHINE_XLXE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _Atari800_MACHINE_XLXE@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
Lloh9:
	adrp	x10, _MEMORY_ram_size@GOTPAGE
Lloh10:
	ldr	x10, [x10, _MEMORY_ram_size@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	cmp	x8, x9
	ccmp	w10, #21, #8, eq
	b.ge	LBB0_4
LBB0_2:
Lloh12:
	adrp	x8, _mapram_memory@GOTPAGE
Lloh13:
	ldr	x8, [x8, _mapram_memory@GOTPAGEOFF]
Lloh14:
	ldr	x0, [x8]
	cbz	x0, LBB0_5
; %bb.3:
	bl	_free
	mov	x0, #0
	b	LBB0_7
LBB0_4:
Lloh15:
	adrp	x8, _mapram_memory@GOTPAGE
Lloh16:
	ldr	x8, [x8, _mapram_memory@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
LBB0_5:
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
LBB0_6:
	mov	w0, #2048
	bl	_Util_malloc
LBB0_7:
Lloh18:
	adrp	x8, _mapram_memory@GOTPAGE
Lloh19:
	ldr	x8, [x8, _mapram_memory@GOTPAGEOFF]
Lloh20:
	str	x0, [x8]
	ldp	x29, x30, [sp], #16             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_MEMORY_enable_mapram,8,3       ; @MEMORY_enable_mapram
	.comm	_Atari800_machine_type,8,3      ; @Atari800_machine_type
	.comm	_Atari800_MACHINE_XLXE,8,3      ; @Atari800_MACHINE_XLXE
	.comm	_MEMORY_ram_size,4,2            ; @MEMORY_ram_size
	.comm	_mapram_memory,8,3              ; @mapram_memory
	.no_dead_strip	_AllocMapRAM
.subsections_via_symbols
