// File: /workspace/github_c_makefile_star2_O0/rakitzis[P]rc/glom.c
// Function: glom
extern List *glom(Node *n) {
	List *v, *head, *tail;
	Node *words;
	if (n == NULL)
		return NULL;
	switch (n->type) {
	case nArgs:
	case nLappend:
		words = n->u[0].p;
		tail = NULL;
		while (words != NULL && (words->type == nArgs || words->type == nLappend)) {
			if (words->u[1].p != NULL && words->u[1].p->type != nWord)
				break;
			head = glom(words->u[1].p);
			if (head != NULL) {
				head->n = tail;
				tail = head;
			}
			words = words->u[0].p;
		}
		v = append(glom(words), tail); /* force left to right evaluation */
		return append(v, glom(n->u[1].p));
	case nBackq:
		return backq(n->u[0].p, n->u[1].p);
	case nConcat:
		head = glom(n->u[0].p); /* force left-to-right evaluation */
		return concat(head, glom(n->u[1].p));
	case nDup:
	case nRedir:
		qredir(n);
		return NULL;
	case nWord:
		return word(n->u[0].s, n->u[1].s);
	case nNmpipe:
		return mkcmdarg(n);
	default:
		/*
		   The next four operations depend on the left-child of glom
		   to be a variable name. Therefore the variable is looked up
		   here.
		*/
		if ((v = glom(n->u[0].p)) == NULL)
			rc_error("null variable name");
		if (v->n != NULL)
			rc_error("multi-word variable name");
		if (*v->w == '\0')
			rc_error("zero-length variable name");
		v = (*v->w == '*' && v->w[1] == '\0') ? varlookup(v->w)->n : varlookup(v->w);
		switch (n->type) {
		default:
			panic("unexpected node in glom");
			exit(1);
			/* NOTREACHED */
		case nCount:
			return count(v);
		case nFlat:
			return flatten(v);
		case nVar:
			return v;
		case nVarsub:
			return varsub(v, glom(n->u[1].p));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8b10
movq $0x0, -0x8(%rbp)
jmp 0x8dec
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x38(%rbp)
subl $0x1e, %eax
ja 0x8cbf
movq -0x38(%rbp), %rax
leaq 0xcbf9(%rip), %rcx      # 0x1572c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x39(%rbp)
je 0x8b7d
movq -0x30(%rbp), %rcx
movb $0x1, %al
cmpl $0x16, (%rcx)
movb %al, -0x3a(%rbp)
je 0x8b77
movq -0x30(%rbp), %rax
cmpl $0x1f, (%rax)
sete %al
movb %al, -0x3a(%rbp)
movb -0x3a(%rbp), %al
movb %al, -0x39(%rbp)
movb -0x39(%rbp), %al
testb $0x1, %al
jne 0x8b86
jmp 0x8bdd
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x8ba0
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x1e, (%rax)
je 0x8ba0
jmp 0x8bdd
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x8af0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x8bcc
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x8b50
movq -0x30(%rbp), %rdi
callq 0x8af0
movq %rax, %rdi
movq -0x28(%rbp), %rsi
callq 0x83b0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x8af0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0x83b0
movq %rax, -0x8(%rbp)
jmp 0x8dec
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x8e00
movq %rax, -0x8(%rbp)
jmp 0x8dec
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8af0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x8af0
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0x8470
movq %rax, -0x8(%rbp)
jmp 0x8dec
movq -0x10(%rbp), %rdi
callq 0x8a50
movq $0x0, -0x8(%rbp)
jmp 0x8dec
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x8350
movq %rax, -0x8(%rbp)
jmp 0x8dec
movq -0x10(%rbp), %rdi
callq 0x8f50
movq %rax, -0x8(%rbp)
jmp 0x8dec
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8af0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x8ce2
leaq 0xcb3b(%rip), %rdi      # 0x15818
callq 0x50d0
movq -0x18(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x8cf9
leaq 0xcb37(%rip), %rdi      # 0x1582b
callq 0x50d0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x8d14
leaq 0xcb35(%rip), %rdi      # 0x15844
callq 0x50d0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x2a, %eax
jne 0x8d49
movq -0x18(%rbp), %rax
movq (%rax), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x8d49
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x12110
movq 0x10(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x8d59
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x12110
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
addl $-0x9, %eax
movl %eax, %ecx
movq %rcx, -0x60(%rbp)
subl $0x13, %eax
ja 0x8d89
movq -0x60(%rbp), %rax
leaq 0xca28(%rip), %rcx      # 0x157a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xcaf9(%rip), %rdi      # 0x15889
callq 0x11c80
movl $0x1, %edi
callq 0x3320
movq -0x18(%rbp), %rdi
callq 0x90e0
movq %rax, -0x8(%rbp)
jmp 0x8dec
movq -0x18(%rbp), %rdi
callq 0x87c0
movq %rax, -0x8(%rbp)
jmp 0x8dec
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x8dec
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x8af0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x86b0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)