	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function loadfile
LCPI0_0:
	.long	1024                            ## 0x400
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_loadfile:                              ## @loadfile
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_loadedfile_create
	movq	%rax, %r12
	testq	%r14, %r14
	jne	LBB0_2
## %bb.1:
	xorl	%edi, %edi
	cmpl	$-1, %r15d
	sete	%dil
	callq	_assert
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_2:
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [1024,0,0,0]
	movups	%xmm0, (%r12)
	movl	$1024, %edi                     ## imm = 0x400
	callq	_bmake_malloc
	movq	%rax, 16(%r12)
	xorl	%ecx, %ecx
	movq	_SIZE_MAX@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rcx, %rbx
	xorl	%edi, %edi
	cmpq	(%r12), %rcx
	setbe	%dil
	callq	_assert
	movq	(%r12), %rax
	cmpq	%rax, %rbx
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r13), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movslq	%ecx, %rax
	cmpq	%rax, %rbx
	jg	LBB0_15
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%rbx,%rbx), %rsi
	movq	%rsi, (%r12)
	movq	16(%r12), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_bmake_realloc
	movq	%rax, 16(%r12)
	movq	(%r12), %rax
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	xorl	%edi, %edi
	cmpq	%rax, %rbx
	setb	%dil
	callq	_assert
	movq	16(%r12), %rsi
	addq	%rbx, %rsi
	movq	(%r12), %rdx
	subq	%rbx, %rdx
	movl	%r15d, %edi
	callq	_read
	testq	%rax, %rax
	js	LBB0_16
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%rax,%rbx), %rcx
	testq	%rax, %rax
	jne	LBB0_3
## %bb.8:
	xorl	%edi, %edi
	cmpq	(%r12), %rbx
	setbe	%dil
	callq	_assert
	movq	%rbx, (%r12)
	testq	%rbx, %rbx
	jle	LBB0_12
## %bb.9:
	movq	16(%r12), %rdi
	cmpb	$10, -1(%rbx,%rdi)
	je	LBB0_11
## %bb.10:
	incq	%rbx
	movq	%rbx, (%r12)
LBB0_11:
	movl	%ebx, %esi
	callq	_bmake_realloc
	movq	%rax, 16(%r12)
	movq	(%r12), %rcx
	movb	$10, -1(%rcx,%rax)
LBB0_12:
	testq	%r14, %r14
	je	LBB0_14
## %bb.13:
	movl	%r15d, %edi
	callq	_close
LBB0_14:
	movq	%r12, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_Error
	movl	$1, %edi
	callq	_exit
LBB0_15:
	movq	_EFBIG@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_Error
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.comm	_SIZE_MAX,4,2                   ## @SIZE_MAX
	.comm	_EFBIG,4,2                      ## @EFBIG
	.comm	_errno,4,2                      ## @errno
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: file too large"

L_.str.1:                               ## @.str.1
	.asciz	"%s: read error: %s"

	.comm	_MAP_COPY,4,2                   ## @MAP_COPY
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	_MAP_FILE,4,2                   ## @MAP_FILE
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_SUCCESS,8,3                    ## @SUCCESS
	.comm	__SC_PAGESIZE,4,2               ## @_SC_PAGESIZE
	.no_dead_strip	_loadfile
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function loadfile
lCPI0_0:
	.quad	1024                            ; 0x400
	.quad	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_loadfile:                              ; @loadfile
	.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
	mov	x21, x1
	mov	x19, x0
	bl	_loadedfile_create
	mov	x20, x0
	cbnz	x19, LBB0_2
; %bb.1:
	cmn	w21, #1
	cset	w0, eq
	bl	_assert
Lloh0:
	adrp	x8, _STDIN_FILENO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STDIN_FILENO@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
LBB0_2:
Lloh3:
	adrp	x8, lCPI0_0@PAGE
Lloh4:
	ldr	q0, [x8, lCPI0_0@PAGEOFF]
	str	q0, [x20]
	mov	w0, #1024
	bl	_bmake_malloc
	mov	x8, #0
	str	x0, [x20, #16]
Lloh5:
	adrp	x23, _SIZE_MAX@GOTPAGE
Lloh6:
	ldr	x23, [x23, _SIZE_MAX@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x22, x8
	ldr	x8, [x20]
	cmp	x22, x8
	cset	w0, ls
	bl	_assert
	ldr	x8, [x20]
	cmp	x22, x8
	b.ne	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x23]
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
	cmp	x22, w8, sxtw
	b.gt	LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	lsl	x1, x22, #1
	str	x1, [x20]
	ldr	x0, [x20, #16]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_bmake_realloc
	str	x0, [x20, #16]
	ldr	x8, [x20]
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	x22, x8
	cset	w0, lo
	bl	_assert
	ldr	x8, [x20, #16]
	add	x1, x8, x22
	ldr	x8, [x20]
	sub	x2, x8, x22
	mov	x0, x21
	bl	_read
	tbnz	x0, #63, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x8, x0, x22
	cbnz	x0, LBB0_3
; %bb.8:
	ldr	x8, [x20]
	cmp	x22, x8
	cset	w0, ls
	bl	_assert
	str	x22, [x20]
	cmp	x22, #1
	b.lt	LBB0_12
; %bb.9:
	ldr	x0, [x20, #16]
	add	x8, x22, x0
	ldurb	w8, [x8, #-1]
	cmp	w8, #10
	b.eq	LBB0_11
; %bb.10:
	add	x22, x22, #1
	str	x22, [x20]
LBB0_11:
	mov	x1, x22
	bl	_bmake_realloc
	str	x0, [x20, #16]
	ldr	x8, [x20]
	add	x8, x8, x0
	mov	w9, #10
	sturb	w9, [x8, #-1]
LBB0_12:
	cbz	x19, LBB0_14
; %bb.13:
	mov	x0, x21
	bl	_close
LBB0_14:
	mov	x0, x20
	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
LBB0_15:
Lloh7:
	adrp	x8, _errno@GOTPAGE
Lloh8:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh12:
	adrp	x8, _EFBIG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EFBIG@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _errno@GOTPAGE
Lloh16:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh17:
	str	w8, [x9]
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
LBB0_17:
	mov	x1, x19
	bl	_Error
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.comm	_SIZE_MAX,4,2                   ; @SIZE_MAX
	.comm	_EFBIG,4,2                      ; @EFBIG
	.comm	_errno,4,2                      ; @errno
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: file too large"

l_.str.1:                               ; @.str.1
	.asciz	"%s: read error: %s"

	.comm	_MAP_COPY,4,2                   ; @MAP_COPY
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	_MAP_FILE,4,2                   ; @MAP_FILE
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_SUCCESS,8,3                    ; @SUCCESS
	.comm	__SC_PAGESIZE,4,2               ; @_SC_PAGESIZE
	.no_dead_strip	_loadfile
.subsections_via_symbols
