// File: /workspace/github_c_makefile_star2_O0/rakitzis[P]rc/heredoc.c
// Function: readheredoc
static char *readheredoc(char *eof) {
	int c;
	char *t, *buf, *bufend;
	unsigned char *s;
	size_t bufsize;
	t = buf = nalloc(bufsize = 512);
	bufend = &buf[bufsize];
	dead = FALSE;
#define	RESIZE(extra) { \
		char *nbuf; \
		bufsize = bufsize * 2 + extra; \
		nbuf = nalloc(bufsize); \
		memcpy(nbuf, buf, (size_t) (t - buf)); \
		t = nbuf + (t - buf); \
		buf = nbuf; \
		bufend = &buf[bufsize]; \
	}
	for (;;) {
		nextline();
		for (s = (unsigned char *) eof; (c = gchar()) == *s; s++)
			;
		if (*s == '\0' && (c == '\n' || c == EOF)) {
			*t++ = '\0';
			return buf;
		}
		if (s != (unsigned char *) eof) {
			size_t len = s - (unsigned char *) eof;
			if (t + len >= bufend)
				RESIZE(len);
			memcpy(t, eof, len);
			t += len;
		}
		for (;; c = gchar()) {
			if (c == EOF) {
				yyerror("heredoc incomplete");
				dead = TRUE;
				return NULL;
			}
			if (t + 1 >= bufend)
				RESIZE(0);
			*t++ = c;
			if (c == '\n')
				break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq $0x200, -0x40(%rbp)     # imm = 0x200
movl $0x200, %edi            # imm = 0x200
callq 0xd4c0
movq %rax, -0x28(%rbp)
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movl $0x0, 0x1526c(%rip)     # 0x1fbb8
callq 0xb580
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0xae50
movl %eax, -0x14(%rbp)
movq -0x38(%rbp), %rcx
movzbl (%rcx), %ecx
cmpl %ecx, %eax
jne 0xa97c
jmp 0xa96e
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0xa959
movq -0x38(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x0, %eax
jne 0xa9b3
cmpl $0xa, -0x14(%rbp)
je 0xa994
cmpl $-0x1, -0x14(%rbp)
jne 0xa9b3
movq -0x20(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x20(%rbp)
movb $0x0, (%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xab22
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0xaa59
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rax
addq -0x48(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0xaa3c
movq -0x40(%rbp), %rax
shlq %rax
addq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0xd4c0
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rax
subq %rax, %rdx
callq 0x3220
movq -0x50(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rdx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x48(%rbp), %rdx
callq 0x3220
movq -0x48(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0xaa5b
cmpl $-0x1, -0x14(%rbp)
jne 0xaa84
leaq 0xae7a(%rip), %rdi      # 0x158e2
callq 0xc750
movl $0x1, 0x15141(%rip)     # 0x1fbb8
movq $0x0, -0x8(%rbp)
jmp 0xab22
movq -0x20(%rbp), %rax
addq $0x1, %rax
cmpq -0x30(%rbp), %rax
jb 0xaaf0
movq -0x40(%rbp), %rax
shlq %rax
addq $0x0, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0xd4c0
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rax
subq %rax, %rdx
callq 0x3220
movq -0x58(%rbp), %rax
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rdx
subq %rdx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
addq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movl -0x14(%rbp), %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x20(%rbp)
movb %cl, (%rax)
cmpl $0xa, -0x14(%rbp)
jne 0xab0e
jmp 0xab1d
jmp 0xab10
callq 0xae50
movl %eax, -0x14(%rbp)
jmp 0xaa5b
jmp 0xa94c
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)