	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_chars
_read_chars:                            ## @read_chars
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r13
	movq	%rsi, %r15
	leaq	-44(%rbp), %r12
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, %rsi
	callq	_luaL_buffinit
	movq	_BUFSIZ@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_luaL_prepbuffer
	cmpq	%r13, %rbx
	cmovaeq	%r13, %rbx
	movq	%rax, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movq	%r15, %rcx
	callq	_fread
	movq	%rax, %r14
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	_luaL_addsize
	subq	%r14, %r13
	cmpq	%rbx, %r14
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	testq	%r13, %r13
	jne	LBB0_1
LBB0_3:
	leaq	-44(%rbp), %rdi
	callq	_luaL_pushresult
	testq	%r13, %r13
	je	LBB0_4
## %bb.5:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	$-1, %esi
	callq	_lua_objlen
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	setg	%al
	jmp	LBB0_6
LBB0_4:
	movl	$1, %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BUFSIZ,8,3                     ## @BUFSIZ
	.no_dead_strip	_read_chars
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_chars
_read_chars:                            ; @read_chars
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	add	x1, sp, #12
	bl	_luaL_buffinit
Lloh0:
	adrp	x8, _BUFSIZ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BUFSIZ@GOTPAGEOFF]
Lloh2:
	ldr	x22, [x8]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #12
	bl	_luaL_prepbuffer
	cmp	x22, x20
	csel	x22, x22, x20, lo
	mov	w1, #1
	mov	x2, x22
	mov	x3, x21
	bl	_fread
	mov	x23, x0
	add	x0, sp, #12
	mov	x1, x23
	bl	_luaL_addsize
	sub	x20, x20, x23
	cmp	x23, x22
	ccmp	x20, #0, #4, eq
	b.ne	LBB0_1
; %bb.2:
	add	x0, sp, #12
	bl	_luaL_pushresult
	cbz	x20, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	w1, #-1
	bl	_lua_objlen
	cmp	x0, #0
	cset	w0, gt
	b	LBB0_5
LBB0_4:
	mov	w0, #1
LBB0_5:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BUFSIZ,8,3                     ; @BUFSIZ
	.no_dead_strip	_read_chars
.subsections_via_symbols
