// File: /workspace/github_c_makefile_star2_O2/jech[P]shncpd/state.c
// Function: silly_walk
int
silly_walk(struct node *root)
{
    int sp = 0;
    unsigned short stack[numnodes];
    unsigned char seen[numnodes];
    int i, flushed, num;

    memset(seen, 0, sizeof(seen));
    seen[root - nodes] = 1;
    stack[sp++] = root - nodes;

    while(sp > 0) {
        int n = stack[--sp];
        for(i = 0; i < nodes[n].numneighs; i++) {
            struct node_neighbour *neigh = &nodes[n].neighs[i];
            int m = node_index(neigh->neigh);
            if(m < 0) {
                /* Neighbour link to a node we don't know about. */
                continue;
            }
            if(!seen[m] && neigh_symmetric(&nodes[n], &nodes[m], neigh)) {
                assert(sp < numnodes - 1);
                seen[m] = 1;
                stack[sp++] = m;
            }
        }
    }
    /* Flushing a node only moves the nodes *after* the one being flushed.
       Yes, it's a hack. */
    num = numnodes; flushed = 0;
    for(i = numnodes - 1; i >= 0; i--) {
        if(!seen[i]) {
            flush_node(&nodes[i]);
            flushed++;
        }
    }
    debugf("Silly walk flushed %d/%d nodes.\n", flushed, num);
    return !!flushed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rdi, %r14
movl 0xd359(%rip), %edx      # 0x112a4
movq %rsp, %rbx
leaq 0xf(,%rdx,2), %r15
andq $-0x10, %r15
movq %rbx, %rax
subq %r15, %rax
movq %rax, -0x50(%rbp)
movq %rax, %rsp
negq %r15
movq %rsp, %r12
leaq 0xf(%rdx), %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
movq %r12, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0xe904(%rip), %r13      # 0x12890
subq %r13, %r14
pushq $0x70
popq %rcx
movq %r14, %rax
movq %rcx, %r14
cqto
idivq %rcx
movb $0x1, (%rax,%r12)
movw %ax, (%rbx,%r15)
pushq $0x1
popq %rax
movq %r12, -0x58(%rbp)
testl %eax, %eax
jle 0x413b
decl %eax
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, -0x40(%rbp)
movzwl (%rax,%rcx,2), %eax
imulq $0x70, %rax, %rax
leaq (%rax,%r13), %rcx
addq %r13, %rax
addq $0x8, %rax
movq %rax, -0x70(%rbp)
xorl %edx, %edx
movq %rcx, -0x30(%rbp)
movslq 0x48(%rcx), %rax
cmpq %rax, %rdx
jge 0x4132
movq %rdx, -0x38(%rbp)
imulq $0xc, %rdx, %r15
addq 0x40(%rcx), %r15
movq %r15, %rdi
xorl %esi, %esi
callq 0x3d24
testq %rax, %rax
je 0x40d7
movq %rax, %rcx
subq %r13, %rcx
movq %rcx, %rax
cqto
idivq %r14
cmpq $-0x6f, %rcx
jl 0x41af
movq %rax, %rbx
movl 0xd277(%rip), %edx      # 0x112a4
movslq %edx, %rax
cmpq %rax, %rbx
jge 0x41af
testq %rcx, %rcx
js 0x40d7
movl %ebx, %eax
cmpb $0x0, (%r12,%rax)
movq -0x30(%rbp), %rcx
jne 0x40db
movl %edx, -0x44(%rbp)
movq %rax, -0x68(%rbp)
imulq $0x70, %rax, %r14
leaq (%r14,%r13), %rsi
addq $0x8, %rsi
movq %r15, %rdi
callq 0x3b13
testl %eax, %eax
je 0x41ce
movq %rbx, -0x60(%rbp)
addq %r13, %r14
movl 0x48(%r14), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
imulq $0xc, %rax, %r13
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x40c8
movq 0x40(%r14), %rbx
leaq (%rbx,%r12), %rdi
movq -0x70(%rbp), %rsi
callq 0x3b13
testl %eax, %eax
je 0x40c2
movl 0x4(%rbx,%r12), %eax
cmpl 0x8(%r15), %eax
jne 0x40c2
movl 0x8(%rbx,%r12), %eax
cmpl 0x4(%r15), %eax
je 0x40e7
addq $0xc, %r12
jmp 0x4092
movq -0x58(%rbp), %r12
leaq 0xe7bd(%rip), %r13      # 0x12890
pushq $0x70
popq %r14
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdx
incq %rdx
jmp 0x3fe0
movl -0x44(%rbp), %ecx
decl %ecx
movq -0x40(%rbp), %rax
cmpl %ecx, %eax
leaq 0xe797(%rip), %r13      # 0x12890
pushq $0x70
popq %r14
movq -0x38(%rbp), %rdx
jge 0x41ed
movq -0x58(%rbp), %r12
movq -0x68(%rbp), %rcx
movb $0x1, (%r12,%rcx)
movq %rax, %rcx
movslq %ecx, %rax
incl %ecx
movq %rcx, -0x40(%rbp)
movq -0x50(%rbp), %rcx
movq -0x60(%rbp), %rsi
movw %si, (%rcx,%rax,2)
movq -0x30(%rbp), %rcx
jmp 0x40df
movq -0x40(%rbp), %rax
jmp 0x3fae
movl 0xd162(%rip), %r15d     # 0x112a4
xorl %r14d, %r14d
movq %r15, %rbx
imulq $0x70, %rbx, %rdi
addq %r13, %rdi
movq %rbx, %rax
testl %eax, %eax
jle 0x4173
leaq -0x1(%rax), %rbx
addq $-0x70, %rdi
cmpb $0x0, -0x1(%r12,%rax)
movq %rbx, %rax
jne 0x4152
callq 0x3e33
incl %r14d
jmp 0x4148
leaq 0xd0de(%rip), %rax      # 0x11258
cmpl $0x2, (%rax)
jge 0x4196
xorl %eax, %eax
testl %r14d, %r14d
setne %al
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x83e8(%rip), %rsi      # 0xc585
pushq $0x2
popq %rdi
movl %r14d, %edx
movl %r15d, %ecx
xorl %eax, %eax
callq 0x23c0
jmp 0x417f
leaq 0x840b(%rip), %rdi      # 0xc5c1
leaq 0x8331(%rip), %rsi      # 0xc4ee
leaq 0x842a(%rip), %rcx      # 0xc5ee
movl $0xca, %edx
callq 0x2150
leaq 0x843f(%rip), %rdi      # 0xc614
leaq 0x8312(%rip), %rsi      # 0xc4ee
leaq 0x844d(%rip), %rcx      # 0xc630
movl $0xd5, %edx
callq 0x2150
leaq 0x8361(%rip), %rdi      # 0xc555
leaq 0x82f3(%rip), %rsi      # 0xc4ee
leaq 0x8365(%rip), %rcx      # 0xc567
movl $0xf5, %edx
callq 0x2150