// File: /workspace/github_c_makefile_star2_O2/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 $0x178, %rsp            # imm = 0x178
testq %rdi, %rdi
je 0x69f6
movq %rdi, %r14
movl (%rdi), %eax
cmpl $0x2, %eax
je 0x6b9b
cmpl $0x8, %eax
je 0x6abe
cmpl $0xc, %eax
je 0x69ee
cmpl $0x14, %eax
je 0x69ee
cmpl $0x16, %eax
je 0x6977
cmpl $0x1e, %eax
je 0x6aa0
cmpl $0x20, %eax
je 0x6a0d
cmpl $0x1f, %eax
jne 0x6aef
xorl %ebx, %ebx
movq %r14, %r15
movq 0x8(%r15), %r15
testq %r15, %r15
je 0x69b3
movl (%r15), %eax
cmpl $0x1f, %eax
je 0x6992
cmpl $0x16, %eax
jne 0x69b3
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x69a0
cmpl $0x1e, (%rdi)
jne 0x69b3
callq 0x6914
testq %rax, %rax
je 0x697c
movq %rbx, 0x10(%rax)
movq %rax, %rbx
jmp 0x697c
movq %r15, %rdi
callq 0x6914
movq %rax, %rdi
movq %rbx, %rsi
callq 0x642e
movq %rax, %rbx
movq 0x10(%r14), %rdi
callq 0x6914
movq %rbx, %rdi
movq %rax, %rsi
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x642e
movq %r14, %rdi
callq 0x68cd
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x18
popq %r15
movq %r15, %rdi
callq 0x9928
movq %rax, %rbx
movq %r15, %rdi
callq 0x9928
movq %rax, %r15
leaq 0x30(%rsp), %rdi
callq 0x3180
testl %eax, %eax
js 0x6d8d
callq 0xc5b0
testl %eax, %eax
je 0x6ee0
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
movl 0x30(%rsp,%rax,4), %esi
leaq 0x7d32(%rip), %rdi      # 0xe78d
xorl %eax, %eax
callq 0xaaee
movq %rax, %r12
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
movl 0x30(%rsp,%rax,4), %esi
pushq $0x6
popq %rdi
movq %r15, %rdx
callq 0x43bc
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
sete %al
movl 0x30(%rsp,%rax,4), %edi
callq 0x3170
movq %r12, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rbx)
jmp 0x69f8
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rsi
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6400
movq 0x8(%r14), %rdi
callq 0x6914
movq %rax, %rbx
movq 0x10(%r14), %rdi
callq 0x6914
movq %rbx, %rdi
movq %rax, %rsi
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6492
movq 0x8(%r14), %rdi
callq 0x6914
movq %rax, %rbx
testq %rax, %rax
jne 0x6b0c
leaq 0x7be5(%rip), %rdi      # 0xe6ec
callq 0x45b7
cmpq $0x0, 0x10(%rbx)
je 0x6b1f
leaq 0x7be5(%rip), %rdi      # 0xe6ff
callq 0x45b7
movq (%rbx), %rdi
movb (%rdi), %al
testb %al, %al
jne 0x6b39
leaq 0x7be9(%rip), %rdi      # 0xe718
callq 0x45b7
movq (%rbx), %rdi
movb (%rdi), %al
cmpb $0x2a, %al
jne 0x6b47
cmpb $0x0, 0x1(%rdi)
je 0x6e25
callq 0xc16d
movq %rax, %rbx
movl (%r14), %eax
cmpl $0x9, %eax
je 0x6dd6
cmpl $0xb, %eax
je 0x6e0c
cmpl $0x1b, %eax
je 0x69f8
cmpl $0x1c, %eax
jne 0x6f4f
movq 0x10(%r14), %rdi
callq 0x6914
movq %rbx, %rdi
movq %rax, %rsi
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6626
movq 0x10(%r14), %rbx
testq %rbx, %rbx
je 0x69f6
movq 0x8(%r14), %r14
leaq 0x10(%rsp), %rdi
callq 0x3180
testl %eax, %eax
jns 0x6bcd
leaq 0xc1e4(%rip), %rdi      # 0x12da5
callq 0xbe9d
xorl %edi, %edi
callq 0x45b7
leaq 0x13000(%rip), %rax     # 0x19bd4
cmpl $0x0, (%rax)
je 0x6be8
leaq 0x13c(%rsp), %rsi
xorl %edi, %edi
callq 0x32c0
callq 0xc5b0
movl 0x14(%rsp), %edi
testl %eax, %eax
je 0x6f20
movl %eax, %ebp
callq 0x3170
movq %r14, %rdi
callq 0x6914
movq %rax, %rbx
movl 0x10(%rsp), %r14d
leaq 0x30(%rsp), %r15
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x3150
movb $0x1, (%r15)
testq %rbx, %rbx
je 0x6c48
movq (%rbx), %rax
movzbl (%rax), %ecx
testq %rcx, %rcx
je 0x6c42
movb $0x1, 0x30(%rsp,%rcx)
incq %rax
jmp 0x6c30
movq 0x10(%rbx), %rbx
jmp 0x6c28
movl %ebp, 0x8(%rsp)
pushq $0x18
popq %rdi
callq 0x9928
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x9928
movq %rax, %r12
movq %rax, (%rbx)
andq $0x0, 0x8(%rbx)
movl $0x3e8, %edx            # imm = 0x3E8
movq %rbx, 0x18(%rsp)
xorl %ecx, %ecx
movl $0x3e8, %r15d           # imm = 0x3E8
xorl %ebp, %ebp
movl %r14d, 0xc(%rsp)
testq %rdx, %rdx
movq %rcx, 0x20(%rsp)
jne 0x6cd6
subq (%rbx), %r12
leaq 0x3e8(%r12), %rax
movq %r15, %r14
addq %r15, %r15
cmpq %rax, %r14
jb 0x6c9a
leaq 0x1(%r14), %rdi
callq 0x9928
movq %rax, %r13
movq (%rbx), %rsi
movq %rax, %rdi
movq %r12, %rdx
callq 0x3230
movq %r13, (%rbx)
addq %r12, %r13
movq %r14, %rdx
subq %r12, %rdx
movq %r14, %r15
movq %r13, %r12
movl 0xc(%rsp), %r14d
movl %r14d, %edi
movq %r12, %rsi
movq %rdx, 0x28(%rsp)
callq 0x31c0
movq %rax, %r13
testl %r13d, %r13d
jg 0x6d15
je 0x6d9e
callq 0x3040
cmpl $0x4, (%rax)
je 0x6dc4
leaq 0x7a75(%rip), %rdi      # 0xe77e
callq 0xbe9d
xorl %edi, %edi
callq 0x45b7
movslq %r13d, %rax
movq %rax, %r14
leaq (%r12,%rax), %r13
movq 0x20(%rsp), %rcx
cmpq %r13, %r12
jae 0x6d7b
movzbl (%r12), %eax
movb 0x30(%rsp,%rax), %al
testl %ebp, %ebp
je 0x6d5d
testb %al, %al
je 0x6d73
movb $0x0, (%r12)
pushq $0x18
popq %rdi
callq 0x9928
movq %rax, 0x10(%rbx)
leaq 0x1(%r12), %rcx
movq %rcx, (%rax)
xorl %ebp, %ebp
movq %rbx, %rcx
movq %rax, %rbx
jmp 0x6d6c
xorl %ebp, %ebp
testb %al, %al
jne 0x6d76
movq %r12, (%rbx)
movq %rbx, %rax
pushq $0x1
popq %rbp
andq $0x0, 0x8(%rax)
jmp 0x6d76
pushq $0x1
popq %rbp
incq %r12
jmp 0x6d24
movq 0x28(%rsp), %rdx
subq %r14, %rdx
movl 0xc(%rsp), %r14d
jmp 0x6c85
leaq 0xc011(%rip), %rdi      # 0x12da5
callq 0xbe9d
jmp 0x69f6
cmpl $0x1, %ebp
jne 0x6e33
movb $0x0, (%r12)
movq %rbx, %rax
movq 0x18(%rsp), %rbx
leaq 0x12e19(%rip), %r15     # 0x19bd4
movl 0x8(%rsp), %ebp
jmp 0x6e51
xorl %ebx, %ebx
leaq 0x12e07(%rip), %r15     # 0x19bd4
movl 0x8(%rsp), %ebp
jmp 0x6e56
pushq $0x18
popq %rdi
callq 0x9928
movq %rax, %r14
movq %rbx, %rdi
callq 0x922f
leaq 0x79a5(%rip), %rdi      # 0xe795
movl %eax, %esi
xorl %eax, %eax
callq 0xaaee
movq %rax, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%r14)
movq %r14, %rbx
jmp 0x69f8
movq %rbx, %rdi
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x66e1
callq 0xc16d
movq 0x10(%rax), %rbx
jmp 0x6b4f
movq 0x20(%rsp), %rax
testq %rax, %rax
movq 0x18(%rsp), %rbx
leaq 0x12d8d(%rip), %r15     # 0x19bd4
movl 0x8(%rsp), %ebp
je 0x6ed9
andq $0x0, 0x10(%rax)
movl 0x10(%rsp), %edi
callq 0x3170
leaq 0x30(%rsp), %r14
pushq $0x1
popq %rdx
movl %ebp, %edi
movq %r14, %rsi
callq 0xc644
cmpl $0x0, (%r15)
movl (%r14), %esi
je 0x6ea3
movl %esi, %eax
andl $0x7f, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x6ea3
leaq 0x13c(%rsp), %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x32f0
movl 0x30(%rsp), %esi
pushq $-0x1
popq %rdi
callq 0xb44d
movl 0x30(%rsp), %edi
callq 0xb5f7
movq %rax, %rdi
xorl %esi, %esi
callq 0x6400
leaq 0x78b0(%rip), %rdi      # 0xe775
movq %rax, %rsi
xorl %edx, %edx
callq 0xbfac
callq 0xb266
jmp 0x69f8
xorl %ebx, %ebx
jmp 0x6e56
xorl %edi, %edi
callq 0x4c71
xorl %esi, %esi
cmpl $0x0, 0x8(%r14)
sete %sil
movl 0x30(%rsp,%rsi,4), %edi
callq 0xbf88
testl %eax, %eax
js 0x6f5b
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
movl 0x30(%rsp,%rax,4), %edi
callq 0x3170
andq $0x0, 0x12bae(%rip)     # 0x19ac8
movq 0x18(%r14), %rdi
jmp 0x6f3c
pushq $0x1
popq %rsi
callq 0xbf88
movl 0x10(%rsp), %edi
callq 0x3170
andq $0x0, 0x12b8f(%rip)     # 0x19ac8
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc950
callq 0xb3ff
movl %eax, %edi
callq 0x3330
leaq 0x7807(%rip), %rdi      # 0xe75d
callq 0xbeea
pushq $0x1
popq %rdi
callq 0x3330
nop