// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x168, %rsp            # imm = 0x168
testq %rdi, %rdi
je 0x6d2b
movq %rdi, %r14
movl (%rdi), %eax
cmpl $0x15, %eax
jg 0x6cd7
cmpl $0xb, %eax
jg 0x6d15
cmpl $0x2, %eax
je 0x6dcd
cmpl $0x8, %eax
jne 0x6f21
movq 0x8(%r14), %rdi
callq 0x6c67
movq %rax, %rbx
movq 0x10(%r14), %rdi
callq 0x6c67
movq %rbx, %rdi
movq %rax, %rsi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x67cf
cmpl $0x1e, %eax
jg 0x6d43
cmpl $0x16, %eax
je 0x6d55
cmpl $0x1e, %eax
jne 0x6f21
movq 0x8(%r14), %rbx
testq %rbx, %rbx
je 0x6d2b
movq 0x10(%r14), %r14
movl $0x18, %edi
callq 0x9f28
movq %rax, %r12
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
movq $0x0, 0x10(%rax)
jmp 0x6d2e
cmpl $0xc, %eax
je 0x6d23
cmpl $0x14, %eax
jne 0x6f21
movq %r14, %rdi
callq 0x6c1b
xorl %r12d, %r12d
movq %r12, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x20, %eax
je 0x6e89
cmpl $0x1f, %eax
jne 0x6f21
movq 0x8(%r14), %rbx
xorl %r15d, %r15d
testq %rbx, %rbx
je 0x6d92
movl (%rbx), %eax
cmpl $0x1f, %eax
je 0x6d6d
cmpl $0x16, %eax
jne 0x6d92
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x6d7b
cmpl $0x1e, (%rdi)
jne 0x6d92
callq 0x6c67
testq %rax, %rax
je 0x6d8c
movq %r15, 0x10(%rax)
movq %rax, %r15
movq 0x8(%rbx), %rbx
jmp 0x6d5c
movq %rbx, %rdi
callq 0x6c67
movq %rax, %rdi
movq %r15, %rsi
callq 0x6747
movq %rax, %rbx
movq 0x10(%r14), %rdi
callq 0x6c67
movq %rbx, %rdi
movq %rax, %rsi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6747
movq 0x10(%r14), %rbx
testq %rbx, %rbx
je 0x6d2b
movq 0x8(%r14), %r14
leaq 0x8(%rsp), %rdi
callq 0x3180
testl %eax, %eax
jns 0x6dff
leaq 0xcf62(%rip), %rdi      # 0x13d55
callq 0xc7ed
xorl %edi, %edi
callq 0x47be
leaq 0x12dce(%rip), %rax     # 0x19bd4
cmpl $0x0, (%rax)
je 0x6e1a
leaq 0x12c(%rsp), %rsi
xorl %edi, %edi
callq 0x32c0
callq 0xcfb8
movl 0xc(%rsp), %edi
testl %eax, %eax
je 0x7253
movl %eax, %ebp
callq 0x3170
movq %r14, %rdi
callq 0x6c67
movq %rax, %rbx
movl 0x8(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x20(%rsp), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x3150
movb $0x1, (%r15)
testq %rbx, %rbx
je 0x6fb6
movq (%rbx), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x6e83
incq %rax
movzbl %cl, %ecx
movb $0x1, 0x20(%rsp,%rcx)
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x6e72
movq 0x10(%rbx), %rbx
jmp 0x6e5d
movl $0x18, %edi
callq 0x9f28
movq %rax, %r12
movl $0x18, %edi
callq 0x9f28
movq %rax, %r15
leaq 0x20(%rsp), %rdi
callq 0x3180
testl %eax, %eax
js 0x7137
callq 0xcfb8
testl %eax, %eax
je 0x7276
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
movl 0x20(%rsp,%rax,4), %esi
leaq 0x88c6(%rip), %rdi      # 0xf79d
xorl %eax, %eax
callq 0xb274
movq %rax, %rbx
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
movl 0x20(%rsp,%rax,4), %esi
movl $0x6, %edi
movq %r15, %rdx
callq 0x459c
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
sete %al
movl 0x20(%rsp,%rax,4), %edi
callq 0x3170
movq %rbx, (%r12)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r12)
jmp 0x6d2e
movq 0x8(%r14), %rdi
callq 0x6c67
movq %rax, %rbx
testq %rax, %rax
jne 0x6f3e
leaq 0x87c3(%rip), %rdi      # 0xf6fc
callq 0x47be
cmpq $0x0, 0x10(%rbx)
je 0x6f51
leaq 0x87c3(%rip), %rdi      # 0xf70f
callq 0x47be
movq (%rbx), %rax
cmpb $0x0, (%rax)
jne 0x6f65
leaq 0x87c8(%rip), %rdi      # 0xf728
callq 0x47be
movq (%rbx), %rdi
cmpb $0x2a, (%rdi)
jne 0x6f77
cmpb $0x0, 0x1(%rdi)
je 0x7180
callq 0xcaf4
movq %rax, %r12
movl (%r14), %eax
cmpl $0x1a, %eax
jg 0x7100
cmpl $0x9, %eax
je 0x7167
cmpl $0xb, %eax
jne 0x72ca
movq %r12, %rdi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6a31
movl %ebp, (%rsp)
movl $0x18, %edi
callq 0x9f28
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x9f28
movq %rax, %r15
movq %rax, (%rbx)
movq $0x0, 0x8(%rbx)
movl $0x3e8, %edx            # imm = 0x3E8
movq %rbx, 0x10(%rsp)
xorl %ecx, %ecx
movl $0x3e8, %r12d           # imm = 0x3E8
xorl %r13d, %r13d
testq %rdx, %rdx
movq %rcx, 0x18(%rsp)
jne 0x703e
subq (%rbx), %r15
leaq 0x3e8(%r15), %rax
movq %r12, %r14
addq %r12, %r12
cmpq %rax, %r14
jb 0x7007
leaq 0x1(%r14), %rdi
callq 0x9f28
movq %rax, %rbp
movq (%rbx), %rsi
movq %rax, %rdi
movq %r15, %rdx
callq 0x3230
movq %rbp, (%rbx)
addq %r15, %rbp
movq %r14, %rdx
subq %r15, %rdx
movq %r14, %r12
movq %rbp, %r15
movl 0x4(%rsp), %edi
movq %r15, %rsi
movq %rdx, %r14
callq 0x31c0
movq %rax, %rbp
testl %ebp, %ebp
jg 0x707b
je 0x7148
callq 0x3040
cmpl $0x4, (%rax)
je 0x715f
leaq 0x871f(%rip), %rdi      # 0xf78e
callq 0xc7ed
xorl %edi, %edi
callq 0x47be
movslq %ebp, %rbp
subq %rbp, %r14
testq %rbp, %rbp
movq 0x18(%rsp), %rcx
movq %r14, %rdx
jle 0x6ff3
movq %rdx, %r14
addq %r15, %rbp
movzbl (%r15), %eax
movb 0x20(%rsp,%rax), %al
testl %r13d, %r13d
je 0x70cd
testb %al, %al
je 0x70ea
movb $0x0, (%r15)
movl $0x18, %edi
callq 0x9f28
movq %rax, 0x10(%rbx)
leaq 0x1(%r15), %rcx
movq %rcx, (%rax)
xorl %r13d, %r13d
movq %rbx, %rcx
movq %rax, %rbx
jmp 0x70e0
xorl %r13d, %r13d
testb %al, %al
jne 0x70f0
movq %r15, (%rbx)
movl $0x1, %r13d
movq %rbx, %rax
movq $0x0, 0x8(%rax)
jmp 0x70f0
movl $0x1, %r13d
incq %r15
cmpq %rbp, %r15
jb 0x7098
movq %r14, %rdx
jmp 0x6ff3
cmpl $0x1b, %eax
je 0x6d2e
cmpl $0x1c, %eax
jne 0x72ca
movq 0x10(%r14), %rdi
callq 0x6c67
movq %r12, %rdi
movq %rax, %rsi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x696c
leaq 0xcc17(%rip), %rdi      # 0x13d55
callq 0xc7ed
jmp 0x6d2b
cmpl $0x1, %r13d
jne 0x718e
movb $0x0, (%r15)
movq %rbx, %rax
movq 0x10(%rsp), %r12
movl (%rsp), %ebx
jmp 0x71a4
xorl %r12d, %r12d
movl (%rsp), %ebx
jmp 0x71ac
movq %r12, %rdi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x72e0
callq 0xcaf4
movq 0x10(%rax), %r12
jmp 0x6f7f
movq 0x18(%rsp), %rax
testq %rax, %rax
movq 0x10(%rsp), %r12
movl (%rsp), %ebx
je 0x724b
movq $0x0, 0x10(%rax)
movl 0x8(%rsp), %edi
callq 0x3170
leaq 0x20(%rsp), %rsi
movl %ebx, %edi
movl $0x1, %edx
callq 0xd068
leaq 0x12a07(%rip), %rax     # 0x19bd4
cmpl $0x0, (%rax)
je 0x71f9
movl 0x20(%rsp), %eax
andl $0x7f, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x71f9
leaq 0x12c(%rsp), %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x32f0
movl 0x20(%rsp), %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xbcfe
movl 0x20(%rsp), %edi
callq 0xbebd
testq %rax, %rax
je 0x7231
movq %rax, %r14
movl $0x18, %edi
callq 0x9f28
movq %rax, %rsi
movq %r14, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
jmp 0x7233
xorl %esi, %esi
leaq 0x854b(%rip), %rdi      # 0xf785
xorl %edx, %edx
callq 0xc918
callq 0xbae1
jmp 0x6d2e
xorl %r12d, %r12d
jmp 0x71ac
movl $0x1, %esi
callq 0xc8f5
movl 0x8(%rsp), %edi
callq 0x3170
movq $0x0, 0x12857(%rip) # 0x19ac8
movq %rbx, %rdi
jmp 0x72b7
xorl %edi, %edi
callq 0x4eba
xorl %esi, %esi
cmpl $0x0, 0x8(%r14)
sete %sil
movl 0x20(%rsp,%rsi,4), %edi
callq 0xc8f5
testl %eax, %eax
js 0x72d6
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
movl 0x20(%rsp,%rax,4), %edi
callq 0x3170
movq $0x0, 0x12815(%rip) # 0x19ac8
movq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0xd3c0
callq 0xbc85
movl %eax, %edi
callq 0x3330
leaq 0x849c(%rip), %rdi      # 0xf76d
callq 0xc83e
movl $0x1, %edi
callq 0x3330