	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alloc_axlon_memory
_alloc_axlon_memory:                    ## @alloc_axlon_memory
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_MEMORY_axlon_num_banks@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_7
## %bb.1:
	movq	_Atari800_machine_type@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_Atari800_MACHINE_800@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_7
## %bb.2:
	movl	%eax, %ebx
	shll	$14, %ebx
	movq	_axlon_ram@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.4:
	movq	_axlon_current_bankmask@GOTPCREL(%rip), %rcx
	decl	%eax
	cmpl	%eax, (%rcx)
	jne	LBB0_5
	jmp	LBB0_6
LBB0_7:
	movq	_axlon_ram@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	callq	_free
	movq	$0, (%rbx)
	movq	_axlon_current_bankmask@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_3:
	decl	%eax
LBB0_5:
	movq	_axlon_current_bankmask@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	%ebx, %esi
	callq	_Util_realloc
	movq	%rax, %rdi
	movq	%rax, (%r14)
LBB0_6:
	xorl	%esi, %esi
	movl	%ebx, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_memset                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MEMORY_axlon_num_banks,4,2     ## @MEMORY_axlon_num_banks
	.comm	_Atari800_machine_type,8,3      ## @Atari800_machine_type
	.comm	_Atari800_MACHINE_800,8,3       ## @Atari800_MACHINE_800
	.comm	_axlon_ram,8,3                  ## @axlon_ram
	.comm	_axlon_current_bankmask,4,2     ## @axlon_current_bankmask
	.no_dead_strip	_alloc_axlon_memory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alloc_axlon_memory
_alloc_axlon_memory:                    ; @alloc_axlon_memory
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _MEMORY_axlon_num_banks@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MEMORY_axlon_num_banks@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x8]
	subs	w8, w9, #1
	b.lt	LBB0_6
; %bb.1:
Lloh3:
	adrp	x10, _Atari800_machine_type@GOTPAGE
Lloh4:
	ldr	x10, [x10, _Atari800_machine_type@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _Atari800_MACHINE_800@GOTPAGE
Lloh7:
	ldr	x11, [x11, _Atari800_MACHINE_800@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
	cmp	x10, x11
	b.ne	LBB0_6
; %bb.2:
	lsl	w19, w9, #14
Lloh9:
	adrp	x20, _axlon_ram@GOTPAGE
Lloh10:
	ldr	x20, [x20, _axlon_ram@GOTPAGEOFF]
	ldr	x0, [x20]
	cbz	x0, LBB0_4
; %bb.3:
Lloh11:
	adrp	x9, _axlon_current_bankmask@GOTPAGE
Lloh12:
	ldr	x9, [x9, _axlon_current_bankmask@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	cmp	w9, w8
	b.eq	LBB0_5
LBB0_4:
Lloh14:
	adrp	x9, _axlon_current_bankmask@GOTPAGE
Lloh15:
	ldr	x9, [x9, _axlon_current_bankmask@GOTPAGEOFF]
Lloh16:
	str	w8, [x9]
	mov	x1, x19
	bl	_Util_realloc
	str	x0, [x20]
LBB0_5:
	mov	w1, #0
	mov	x2, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_memset
LBB0_6:
Lloh17:
	adrp	x19, _axlon_ram@GOTPAGE
Lloh18:
	ldr	x19, [x19, _axlon_ram@GOTPAGEOFF]
	ldr	x0, [x19]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_free
	str	xzr, [x19]
Lloh19:
	adrp	x8, _axlon_current_bankmask@GOTPAGE
Lloh20:
	ldr	x8, [x8, _axlon_current_bankmask@GOTPAGEOFF]
Lloh21:
	str	wzr, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotStr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_MEMORY_axlon_num_banks,4,2     ; @MEMORY_axlon_num_banks
	.comm	_Atari800_machine_type,8,3      ; @Atari800_machine_type
	.comm	_Atari800_MACHINE_800,8,3       ; @Atari800_MACHINE_800
	.comm	_axlon_ram,8,3                  ; @axlon_ram
	.comm	_axlon_current_bankmask,4,2     ; @axlon_current_bankmask
	.no_dead_strip	_alloc_axlon_memory
.subsections_via_symbols
