	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function readin
_readin:                                ## @readin
	.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
	movq	%rsi, %rbx
	movl	%edi, %r12d
	leaq	L_.str(%rip), %rsi
	movl	$4, %edi
	movl	%r12d, %edx
	movq	%rbx, %rcx
	callq	_vkprintf
	movl	$1, %edi
	callq	_assert
	movq	_rptr@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	leaq	(%rax,%rbx), %rcx
	movq	_wptr@GOTPCREL(%rip), %r13
	movq	(%r13), %rdx
	cmpq	%rdx, %rcx
	jbe	LBB0_11
## %bb.1:
	movq	_Buff@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rdi
	movq	_BUFFSIZE@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	addq	%rdi, %rcx
	cmpq	%rcx, %rdx
	jge	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	jmp	LBB0_11
LBB0_3:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	subq	%rax, %rdx
	movq	%rsi, %rbx
	movq	%rax, %rsi
	callq	_memcpy
	movq	(%rbx), %rdx
	movq	%rdx, %rsi
	subq	(%r14), %rsi
	addq	(%r13), %rsi
	movq	%rsi, (%r13)
	movq	%rdx, (%r14)
	subq	%rsi, %rdx
	addq	(%r15), %rdx
	movl	%r12d, %edi
	callq	_read
	movl	%eax, %ecx
	shrl	$31, %ecx
	testl	%eax, %eax
	jns	LBB0_7
## %bb.4:
	movq	_errno@GOTPCREL(%rip), %r14
	movq	_EINTR@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdx
	cmpq	%rdx, (%r14)
	jne	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_wptr@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	(%rbx), %rdx
	subq	%rsi, %rdx
	addq	(%r15), %rdx
	movl	%r12d, %edi
	callq	_read
	movl	%eax, %ecx
	shrl	$31, %ecx
	testl	%eax, %eax
	js	LBB0_5
LBB0_7:
	testb	%cl, %cl
	je	LBB0_9
## %bb.8:
	leaq	L_.str.1(%rip), %rdi
	callq	_kprintf
	movq	_wptr@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	jmp	LBB0_10
LBB0_9:
	movl	%eax, %ecx
	movq	_wptr@GOTPCREL(%rip), %rbx
	addq	(%rbx), %rcx
	movq	%rcx, (%rbx)
LBB0_10:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	_rptr@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	addq	%rdx, %rbx
	xorl	%eax, %eax
	cmpq	%rcx, %rbx
	cmovbeq	%rdx, %rax
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"readin (fd: %d, len: %lld)\n"

	.comm	_rptr,8,3                       ## @rptr
	.comm	_wptr,8,3                       ## @wptr
	.comm	_Buff,8,3                       ## @Buff
	.comm	_BUFFSIZE,8,3                   ## @BUFFSIZE
	.comm	_errno,8,3                      ## @errno
	.comm	_EINTR,8,3                      ## @EINTR
L_.str.1:                               ## @.str.1
	.asciz	"error reading file: %m\n"

	.no_dead_strip	_readin
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function readin
_readin:                                ; @readin
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #4
	mov	x2, x20
	mov	x3, x19
	bl	_vkprintf
	mov	w0, #1
	bl	_assert
Lloh2:
	adrp	x21, _rptr@GOTPAGE
Lloh3:
	ldr	x21, [x21, _rptr@GOTPAGEOFF]
	ldr	x1, [x21]
Lloh4:
	adrp	x22, _wptr@GOTPAGE
Lloh5:
	ldr	x22, [x22, _wptr@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x9, x1, x19
	cmp	x9, x8
	b.ls	LBB0_12
; %bb.1:
Lloh6:
	adrp	x23, _Buff@GOTPAGE
Lloh7:
	ldr	x23, [x23, _Buff@GOTPAGEOFF]
	ldr	x0, [x23]
Lloh8:
	adrp	x24, _BUFFSIZE@GOTPAGE
Lloh9:
	ldr	x24, [x24, _BUFFSIZE@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x9, x9, x0
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.2:
	mov	x1, #0
	b	LBB0_12
LBB0_3:
	sub	x2, x8, x1
	bl	_memcpy
	ldr	x8, [x21]
	ldr	x9, [x23]
	ldr	x10, [x22]
	sub	x8, x9, x8
	add	x1, x8, x10
	str	x1, [x22]
	str	x9, [x21]
	ldr	x8, [x24]
	sub	x9, x9, x1
	add	x2, x9, x8
	mov	x0, x20
	bl	_read
	lsr	w8, w0, #31
	tbz	w0, #31, LBB0_8
; %bb.4:
Lloh10:
	adrp	x25, _errno@GOTPAGE
Lloh11:
	ldr	x25, [x25, _errno@GOTPAGEOFF]
	ldr	x9, [x25]
Lloh12:
	adrp	x26, _EINTR@GOTPAGE
Lloh13:
	ldr	x26, [x26, _EINTR@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x26]
	cmp	x9, x10
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x1, [x22]
	ldr	x8, [x23]
	ldr	x9, [x24]
	sub	x8, x8, x1
	add	x2, x8, x9
	mov	x0, x20
	bl	_read
	lsr	w8, w0, #31
	tbz	w0, #31, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x9, [x25]
	b	LBB0_5
LBB0_8:
	cbz	w8, LBB0_10
; %bb.9:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_kprintf
	ldr	x8, [x22]
	b	LBB0_11
LBB0_10:
	ldr	x8, [x22]
	add	x8, x8, w0, uxtw
	str	x8, [x22]
LBB0_11:
	ldr	x9, [x21]
	add	x10, x9, x19
	cmp	x10, x8
	csel	x1, xzr, x9, hi
LBB0_12:
	mov	x0, x1
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"readin (fd: %d, len: %lld)\n"

	.comm	_rptr,8,3                       ; @rptr
	.comm	_wptr,8,3                       ; @wptr
	.comm	_Buff,8,3                       ; @Buff
	.comm	_BUFFSIZE,8,3                   ; @BUFFSIZE
	.comm	_errno,8,3                      ; @errno
	.comm	_EINTR,8,3                      ; @EINTR
l_.str.1:                               ; @.str.1
	.asciz	"error reading file: %m\n"

	.no_dead_strip	_readin
.subsections_via_symbols
