// File: /workspace/github_c_makefile_star2_O0/rakitzis[P]rc/heredoc.c
// Function: parseheredoc
static Node *parseheredoc(char *s) {
	int c = *s;
	Node *result = NULL;
	while (TRUE) {
		Node *node;
		switch (c) {
		default: {
			char *begin = s;
			while ((c = *s++) != '\0' && c != '$')
				;
			*--s = '\0';
			node = mk(nWord, begin, NULL);
			break;
		}
		case '$': {
			char *begin = ++s, *var;
			c = *s++;
			if (c == '$') {
				node = mk(nWord, "$", NULL);
				c = *s;
			} else {
				size_t len = 0;
				do
					len++;
				while (!dnw[c = *(unsigned char *) s++]);
				if (c == '^')
					c = *s;
				else
					s--;
				var = nalloc(len + 1);
				var[len] = '\0';
				memcpy(var, begin, len);
				node = mk(nFlat, mk(nWord, var, NULL));
			}
			break;
		}
		case '\0':
			return result;
		}
		result = (result == NULL) ? node : mk(nConcat, result, node);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x44(%rbp)
testl %eax, %eax
je 0xacde
jmp 0xab5e
movl -0x44(%rbp), %eax
subl $0x24, %eax
je 0xabd4
jmp 0xab68
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movsbl (%rax), %ecx
movl %ecx, -0xc(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x45(%rbp)
je 0xab99
cmpl $0x24, -0xc(%rbp)
setne %al
movb %al, -0x45(%rbp)
movb -0x45(%rbp), %al
testb $0x1, %al
jne 0xaba2
jmp 0xaba4
jmp 0xab70
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x8(%rbp)
movb $0x0, -0x1(%rax)
movq -0x28(%rbp), %rsi
movl $0x1e, %edi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x10e30
movq %rax, -0x20(%rbp)
jmp 0xace8
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movsbl (%rax), %eax
movl %eax, -0xc(%rbp)
cmpl $0x24, -0xc(%rbp)
jne 0xac29
movl $0x1e, %edi
leaq 0xad0f(%rip), %rsi      # 0x1591a
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x10e30
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0xc(%rbp)
jmp 0xacdc
movq $0x0, -0x40(%rbp)
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x8(%rbp)
movzbl (%rax), %eax
movl %eax, -0xc(%rbp)
movslq %eax, %rcx
leaq 0xb024(%rip), %rax      # 0x15c80
cmpb $0x0, (%rax,%rcx)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0xac31
cmpl $0x5e, -0xc(%rbp)
jne 0xac7b
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0xc(%rbp)
jmp 0xac87
movq -0x8(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x8(%rbp)
movq -0x40(%rbp), %rdi
addq $0x1, %rdi
callq 0xd4c0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x40(%rbp), %rdx
callq 0x3220
movq -0x38(%rbp), %rsi
movl $0x1e, %edi
xorl %eax, %eax
movl %eax, %edx
movb $0x0, %al
callq 0x10e30
movq %rax, %rsi
movl $0xb, %edi
movb $0x0, %al
callq 0x10e30
movq %rax, -0x20(%rbp)
jmp 0xace8
movq -0x18(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
cmpq $0x0, -0x18(%rbp)
jne 0xacf9
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0xad11
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movl $0x8, %edi
movb $0x0, %al
callq 0x10e30
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x18(%rbp)
jmp 0xab4e
nop