// File: /workspace/github_c_makefile_star2_O3/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 0x6f0b
movq %rdi, %r14
movl (%rdi), %eax
cmpl $0x15, %eax
jg 0x6bf8
cmpl $0xb, %eax
jg 0x6c41
cmpl $0x2, %eax
je 0x6d01
cmpl $0x8, %eax
jne 0x6e55
movq 0x8(%r14), %rdi
callq 0x6b88
movq %rax, %rbx
movq 0x10(%r14), %rdi
callq 0x6b88
movq %rbx, %rdi
movq %rax, %rsi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x66ee
cmpl $0x1e, %eax
jg 0x6c74
cmpl $0x16, %eax
je 0x6c86
cmpl $0x1e, %eax
jne 0x6e55
movq 0x8(%r14), %rbx
testq %rbx, %rbx
je 0x6f0b
movq 0x10(%r14), %r14
movl $0x18, %edi
callq 0x9e80
movq %rax, %r12
movq %rbx, (%rax)
movq %r14, 0x8(%rax)
movq $0x0, 0x10(%rax)
jmp 0x6f0e
cmpl $0xc, %eax
je 0x6c4f
cmpl $0x14, %eax
jne 0x6e55
movq 0x12e72(%rip), %rax     # 0x19ac8
testq %rax, %rax
je 0x6eec
movq %rax, %rbx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x6c5f
addq $0x8, %rbx
jmp 0x6ef3
cmpl $0x20, %eax
je 0x6dbd
cmpl $0x1f, %eax
jne 0x6e55
movq 0x8(%r14), %r15
xorl %ebx, %ebx
testq %r15, %r15
je 0x6cc3
movl (%r15), %eax
cmpl $0x1f, %eax
je 0x6c9e
cmpl $0x16, %eax
jne 0x6cc6
movq 0x10(%r15), %rdi
testq %rdi, %rdi
je 0x6cac
cmpl $0x1e, (%rdi)
jne 0x6cc6
callq 0x6b88
testq %rax, %rax
je 0x6cbd
movq %rbx, 0x10(%rax)
movq %rax, %rbx
movq 0x8(%r15), %r15
jmp 0x6c8c
xorl %r15d, %r15d
movq %r15, %rdi
callq 0x6b88
movq %rax, %rdi
movq %rbx, %rsi
callq 0x6677
movq %rax, %rbx
movq 0x10(%r14), %rdi
callq 0x6b88
movq %rbx, %rdi
movq %rax, %rsi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6677
movq 0x10(%r14), %rbx
testq %rbx, %rbx
je 0x6f0b
movq 0x8(%r14), %r14
leaq 0x8(%rsp), %rdi
callq 0x3180
testl %eax, %eax
jns 0x6d33
leaq 0xd0b1(%rip), %rdi      # 0x13dd8
callq 0xc6dd
xorl %edi, %edi
callq 0x46c0
leaq 0x12e9a(%rip), %rax     # 0x19bd4
cmpl $0x0, (%rax)
je 0x6d4e
leaq 0x12c(%rsp), %rsi
xorl %edi, %edi
callq 0x32c0
callq 0xce78
movl 0xc(%rsp), %edi
testl %eax, %eax
je 0x71c4
movl %eax, %ebp
callq 0x3170
movq %r14, %rdi
callq 0x6b88
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 0x6f23
movq (%rbx), %rax
movb (%rax), %cl
testb %cl, %cl
je 0x6db7
incq %rax
movzbl %cl, %ecx
movb $0x1, 0x20(%rsp,%rcx)
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x6da6
movq 0x10(%rbx), %rbx
jmp 0x6d91
movl $0x18, %edi
callq 0x9e80
movq %rax, %r12
movl $0x18, %edi
callq 0x9e80
movq %rax, %r15
leaq 0x20(%rsp), %rdi
callq 0x3180
testl %eax, %eax
js 0x70a4
callq 0xce78
testl %eax, %eax
je 0x71e7
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
movl 0x20(%rsp,%rax,4), %esi
leaq 0x8982(%rip), %rdi      # 0xf78d
xorl %eax, %eax
callq 0xb191
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 0x44b0
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 0x6f0e
movq 0x8(%r14), %rdi
callq 0x6b88
movq %rax, %rbx
testq %rax, %rax
jne 0x6e72
leaq 0x887f(%rip), %rdi      # 0xf6ec
callq 0x46c0
cmpq $0x0, 0x10(%rbx)
je 0x6e85
leaq 0x887f(%rip), %rdi      # 0xf6ff
callq 0x46c0
movq (%rbx), %rdi
movb (%rdi), %al
testb %al, %al
jne 0x6e9f
leaq 0x8883(%rip), %rdi      # 0xf718
callq 0x46c0
movq (%rbx), %rdi
movb (%rdi), %al
cmpb $0x2a, %al
jne 0x6ead
cmpb $0x0, 0x1(%rdi)
je 0x70ed
callq 0xc9da
movq %rax, %r12
movl (%r14), %eax
cmpl $0x1a, %eax
jg 0x706d
cmpl $0x9, %eax
je 0x70d4
cmpl $0xb, %eax
jne 0x723b
movq %r12, %rdi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6946
leaq 0x12bd5(%rip), %rbx     # 0x19ac8
movl $0x10, %edi
callq 0x9e80
movq %rax, (%rbx)
movq %r14, (%rax)
movq $0x0, 0x8(%rax)
xorl %r12d, %r12d
movq %r12, %rax
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %ebp, (%rsp)
movl $0x18, %edi
callq 0x9e80
movq %rax, %rbx
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x9e80
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 0x6fab
subq (%rbx), %r15
leaq 0x3e8(%r15), %rax
movq %r12, %r14
addq %r12, %r12
cmpq %rax, %r14
jb 0x6f74
leaq 0x1(%r14), %rdi
callq 0x9e80
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 0x6fe8
je 0x70b5
callq 0x3040
cmpl $0x4, (%rax)
je 0x70cc
leaq 0x87a2(%rip), %rdi      # 0xf77e
callq 0xc6dd
xorl %edi, %edi
callq 0x46c0
movslq %ebp, %rbp
subq %rbp, %r14
testq %rbp, %rbp
movq 0x18(%rsp), %rcx
movq %r14, %rdx
jle 0x6f60
movq %rdx, %r14
addq %r15, %rbp
movzbl (%r15), %eax
movb 0x20(%rsp,%rax), %al
testl %r13d, %r13d
je 0x703a
testb %al, %al
je 0x7057
movb $0x0, (%r15)
movl $0x18, %edi
callq 0x9e80
movq %rax, 0x10(%rbx)
leaq 0x1(%r15), %rcx
movq %rcx, (%rax)
xorl %r13d, %r13d
movq %rbx, %rcx
movq %rax, %rbx
jmp 0x704d
xorl %r13d, %r13d
testb %al, %al
jne 0x705d
movq %r15, (%rbx)
movl $0x1, %r13d
movq %rbx, %rax
movq $0x0, 0x8(%rax)
jmp 0x705d
movl $0x1, %r13d
incq %r15
cmpq %rbp, %r15
jb 0x7005
movq %r14, %rdx
jmp 0x6f60
cmpl $0x1b, %eax
je 0x6f0e
cmpl $0x1c, %eax
jne 0x723b
movq 0x10(%r14), %rdi
callq 0x6b88
movq %r12, %rdi
movq %rax, %rsi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x688e
leaq 0xcd2d(%rip), %rdi      # 0x13dd8
callq 0xc6dd
jmp 0x6f0b
cmpl $0x1, %r13d
jne 0x70fb
movb $0x0, (%r15)
movq %rbx, %rax
movq 0x10(%rsp), %r12
movl (%rsp), %ebx
jmp 0x7111
xorl %r12d, %r12d
movl (%rsp), %ebx
jmp 0x7119
movq %r12, %rdi
addq $0x168, %rsp            # imm = 0x168
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7251
callq 0xc9da
movq 0x10(%rax), %r12
jmp 0x6eb5
movq 0x18(%rsp), %rax
testq %rax, %rax
movq 0x10(%rsp), %r12
movl (%rsp), %ebx
je 0x71bc
movq $0x0, 0x10(%rax)
movl 0x8(%rsp), %edi
callq 0x3170
leaq 0x20(%rsp), %r14
movl %ebx, %edi
movq %r14, %rsi
movl $0x1, %edx
callq 0xcf0f
leaq 0x12a97(%rip), %rax     # 0x19bd4
cmpl $0x0, (%rax)
movl (%r14), %esi
je 0x716e
movl %esi, %eax
andl $0x7f, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x716e
leaq 0x12c(%rsp), %rdx
xorl %edi, %edi
xorl %esi, %esi
callq 0x32f0
movl 0x20(%rsp), %esi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0xbc0e
movl 0x20(%rsp), %edi
callq 0xbde4
testq %rax, %rax
je 0x71a2
movq %rax, %r14
movl $0x18, %edi
callq 0x9e80
movq %rax, %rsi
movq %r14, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
jmp 0x71a4
xorl %esi, %esi
leaq 0x85ca(%rip), %rdi      # 0xf775
xorl %edx, %edx
callq 0xc808
callq 0xb9f9
jmp 0x6f0e
xorl %r12d, %r12d
jmp 0x7119
movl $0x1, %esi
callq 0xc7e5
movl 0x8(%rsp), %edi
callq 0x3170
movq $0x0, 0x128e6(%rip) # 0x19ac8
movq %rbx, %rdi
jmp 0x7228
xorl %edi, %edi
callq 0x4dba
xorl %esi, %esi
cmpl $0x0, 0x8(%r14)
sete %sil
movl 0x20(%rsp,%rsi,4), %edi
callq 0xc7e5
testl %eax, %eax
js 0x7247
xorl %eax, %eax
cmpl $0x0, 0x8(%r14)
setne %al
movl 0x20(%rsp,%rax,4), %edi
callq 0x3170
movq $0x0, 0x128a4(%rip) # 0x19ac8
movq 0x18(%r14), %rdi
xorl %esi, %esi
callq 0xd284
callq 0xbb95
movl %eax, %edi
callq 0x3330
leaq 0x851b(%rip), %rdi      # 0xf75d
callq 0xc72e
movl $0x1, %edi
callq 0x3330