	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_to_buf                    ## -- Begin function read_to_buf
	.p2align	4, 0x90
_read_to_buf:                           ## @read_to_buf
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movl	4(%r15), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	movq	%rax, %rcx
	callq	_fread
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	_ferror
	cmpq	$1, %r12
	jne	LBB0_4
## %bb.3:
	testq	%rax, %rax
	jne	LBB0_4
## %bb.5:
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_6
LBB0_1:
	movl	(%r15), %esi
	leaq	L_.str.1(%rip), %rdi
	callq	_ERRS
	jmp	LBB0_7
LBB0_4:
	movl	(%r15), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_ERRS
LBB0_6:
	movq	%rbx, %rdi
	callq	_fclose
LBB0_7:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"r"

L_.str.1:                               ## @.str.1
	.asciz	"could not open \"%s\" for reading"

L_.str.2:                               ## @.str.2
	.asciz	"unable to read from file \"%s\""

	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_to_buf                    ; -- Begin function read_to_buf
	.p2align	2
_read_to_buf:                           ; @read_to_buf
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
	ldr	w0, [x0]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	w1, [x21, #4]
	mov	x0, x22
	mov	w2, #1
	mov	x3, x20
	bl	_fread
	mov	x22, x0
	mov	x0, x20
	bl	_ferror
	cmp	x22, #1
	ccmp	x0, #0, #0, eq
	b.eq	LBB0_4
; %bb.2:
	ldr	w1, [x21]
Lloh5:
	adrp	x0, l_.str.2@PAGE
Lloh6:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_ERRS
	b	LBB0_5
LBB0_3:
	ldr	w1, [x21]
Lloh7:
	adrp	x0, l_.str.1@PAGE
Lloh8:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_ERRS
	b	LBB0_6
LBB0_4:
Lloh9:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh11:
	ldr	w19, [x8]
LBB0_5:
	mov	x0, x20
	bl	_fclose
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"r"

l_.str.1:                               ; @.str.1
	.asciz	"could not open \"%s\" for reading"

l_.str.2:                               ; @.str.2
	.asciz	"unable to read from file \"%s\""

	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
.subsections_via_symbols
