	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_buffer_read_from_file          ## -- Begin function buffer_read_from_file
	.p2align	4, 0x90
_buffer_read_from_file:                 ## @buffer_read_from_file
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	leaq	-64(%rbp), %rsi
	callq	_platform_stat
	xorl	%r12d, %r12d
	testq	%rax, %rax
	js	LBB0_6
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_platform_fopen
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %r15
	movq	-64(%rbp), %rbx
	leaq	1(%rbx), %rdi
	movq	%r14, %rsi
	callq	_alloc_buf_gc
	movl	%eax, -40(%rbp)
	leaq	-40(%rbp), %rdi
	callq	_BPTR
	movl	%eax, %edi
	movl	$1, %esi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_fread
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	leaq	-40(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_buf_inc_len
	movl	%eax, %edi
	callq	_ASSERT
	movq	%rbx, %rdi
	callq	_buf_null_terminate
	jmp	LBB0_5
LBB0_3:
	leaq	-40(%rbp), %rdi
	movq	%r14, %rsi
	callq	_free_buf_gc
LBB0_5:
	movq	%r15, %rdi
	callq	_fclose
	movl	-40(%rbp), %r12d
LBB0_6:
	movl	%r12d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_buffer_read_from_file          ; -- Begin function buffer_read_from_file
	.p2align	2
_buffer_read_from_file:                 ; @buffer_read_from_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x1
	mov	x19, x0
	stp	xzr, xzr, [sp, #8]
	add	x1, sp, #8
	bl	_platform_stat
	tbnz	x0, #63, LBB0_4
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_platform_fopen
	cbz	x0, LBB0_7
; %bb.2:
	mov	x19, x0
	ldr	x21, [sp, #8]
	add	x0, x21, #1
	mov	x1, x20
	bl	_alloc_buf_gc
	str	w0, [sp, #24]
	add	x0, sp, #24
	bl	_BPTR
	mov	w1, #1
	mov	x2, x21
	mov	x3, x19
	bl	_fread
	tbnz	x0, #63, LBB0_5
; %bb.3:
	mov	x1, x0
	add	x0, sp, #24
	bl	_buf_inc_len
	bl	_ASSERT
	add	x0, sp, #24
	bl	_buf_null_terminate
	b	LBB0_6
LBB0_4:
	mov	w0, #0
	b	LBB0_7
LBB0_5:
	add	x0, sp, #24
	mov	x1, x20
	bl	_free_buf_gc
LBB0_6:
	mov	x0, x19
	bl	_fclose
	ldr	w0, [sp, #24]
LBB0_7:
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r"

.subsections_via_symbols
