	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function PicoCartAlloc
_PicoCartAlloc:                         ## @PicoCartAlloc
	.cfi_startproc
## %bb.0:
	testl	%esi, %esi
	je	LBB0_5
## %bb.1:
	xorl	%ecx, %ecx
	cmpl	$2, %edi
	jb	LBB0_4
## %bb.2:
	xorl	%ecx, %ecx
	movl	%edi, %eax
	movl	%edi, %edx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	sarl	%edx
	incl	%ecx
	cmpl	$3, %eax
	movl	%edx, %eax
	ja	LBB0_3
LBB0_4:
	movl	$1, %edx
	shll	%cl, %edx
	movl	$1, %esi
	xorl	%eax, %eax
	cmpl	%edi, %edx
	setl	%al
	addl	%ecx, %eax
	movl	%eax, %ecx
	shll	%cl, %esi
	cmpl	$65537, %esi                    ## imm = 0x10001
	movl	$65536, %eax                    ## imm = 0x10000
	cmovgel	%esi, %eax
	jmp	LBB0_6
LBB0_5:
	cmpl	$5, %edi
	movl	$4, %ecx
	cmovael	%edi, %ecx
	leal	524287(%rcx), %eax
	andl	$-524288, %eax                  ## imm = 0xFFF80000
	movl	%ecx, %edi
LBB0_6:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movl	%eax, %ecx
	subl	%edi, %ecx
	leal	4(%rax), %esi
	cmpl	$4, %ecx
	cmovgel	%eax, %esi
	movq	_rom_alloc_size@GOTPCREL(%rip), %rax
	movl	%esi, (%rax)
	movl	$33554432, %edi                 ## imm = 0x2000000
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	popq	%rbp
	jmp	_plat_mmap                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_rom_alloc_size,4,2             ## @rom_alloc_size
	.no_dead_strip	_PicoCartAlloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function PicoCartAlloc
_PicoCartAlloc:                         ; @PicoCartAlloc
	.cfi_startproc
; %bb.0:
	cbz	w1, LBB0_3
; %bb.1:
	cmp	w0, #2
	b.hs	LBB0_4
; %bb.2:
	mov	w8, #0
	b	LBB0_6
LBB0_3:
	mov	w8, #4
	cmp	w0, #4
	csel	w0, w0, w8, hi
	mov	w8, #524287
	add	w8, w0, w8
	and	w8, w8, #0xfff80000
	b	LBB0_7
LBB0_4:
	mov	w8, #0
	mov	x9, x0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	asr	w10, w9, #1
	add	w8, w8, #1
	cmp	w9, #3
	mov	x9, x10
	b.hi	LBB0_5
LBB0_6:
	mov	w9, #1
	lsl	w10, w9, w8
	cmp	w10, w0
	cinc	w8, w8, lt
	lsl	w8, w9, w8
	mov	w9, #65536
	cmp	w8, #16, lsl #12                ; =65536
	csel	w8, w8, w9, gt
LBB0_7:
	sub	w9, w8, w0
	add	w10, w8, #4
Lloh0:
	adrp	x11, _rom_alloc_size@GOTPAGE
Lloh1:
	ldr	x11, [x11, _rom_alloc_size@GOTPAGEOFF]
	cmp	w9, #4
	csel	w1, w10, w8, lt
Lloh2:
	str	w1, [x11]
	mov	w0, #33554432
	mov	w2, #0
	mov	w3, #0
	b	_plat_mmap
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_rom_alloc_size,4,2             ; @rom_alloc_size
	.no_dead_strip	_PicoCartAlloc
.subsections_via_symbols
