// File: /workspace/github_c_makefile_star2_O1/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 $0x18, %rsp
movq %rdi, %r14
movl 0xe52a(%rip), %edx      # 0x132a4
movq %rsp, %r15
leaq 0xf(,%rdx,2), %r13
andq $-0x10, %r13
movq %r15, %rax
subq %r13, %rax
movq %rax, -0x38(%rbp)
movq %rax, %rsp
negq %r13
movq %rsp, %rbx
leaq 0xf(%rdx), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2160
leaq 0xfad5(%rip), %r12      # 0x14890
subq %r12, %r14
sarq $0x4, %r14
movabsq $0x6db6db6db6db6db7, %rax # imm = 0x6DB6DB6DB6DB6DB7
imulq %rax, %r14
movb $0x1, (%r14,%rbx)
movw %r14w, (%r15,%r13)
movl $0x1, %ecx
decl %ecx
movq -0x38(%rbp), %rax
movq %rcx, -0x30(%rbp)
movzwl (%rax,%rcx,2), %eax
imulq $0x70, %rax, %r15
cmpl $0x0, 0x48(%r15,%r12)
jle 0x4ee8
addq %r12, %r15
xorl %r13d, %r13d
leaq (,%r13,2), %r14
addq %r13, %r14
shlq $0x2, %r14
addq 0x40(%r15), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x4b4e
testq %rax, %rax
je 0x4e55
subq %r12, %rax
cmpq $-0x6f, %rax
jl 0x4f75
sarq $0x4, %rax
movabsq $0x6db6db6db6db6db7, %rcx # imm = 0x6DB6DB6DB6DB6DB7
imulq %rcx, %rax
movslq 0xe459(%rip), %rcx      # 0x132a4
cmpq %rcx, %rax
jl 0x4e5a
jmp 0x4f75
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x4eab
movl %eax, %ecx
cmpb $0x0, (%rbx,%rcx)
jne 0x4eab
imulq $0x70, %rcx, %rsi
movl (%r14), %edx
cmpl 0x8(%rsi,%r12), %edx
jne 0x4f94
addq %r12, %rsi
movslq 0x48(%rsi), %rdx
testq %rdx, %rdx
jle 0x4eab
movq 0x40(%rsi), %rsi
movl (%rsi), %edi
cmpl 0x8(%r15), %edi
jne 0x4ea2
movl 0x4(%rsi), %edi
cmpl 0x8(%r14), %edi
jne 0x4ea2
movl 0x8(%rsi), %edi
cmpl 0x4(%r14), %edi
je 0x4ebd
addq $0xc, %rsi
decq %rdx
jne 0x4e88
incq %r13
movslq 0x48(%r15), %rax
cmpq %rax, %r13
jl 0x4e03
jmp 0x4ee8
movl 0xe3e1(%rip), %edx      # 0x132a4
decl %edx
movq -0x30(%rbp), %rsi
cmpl %edx, %esi
jge 0x4fb3
movb $0x1, (%rbx,%rcx)
movslq %esi, %rcx
incl %esi
movq %rsi, -0x30(%rbp)
movq -0x38(%rbp), %rdx
movw %ax, (%rdx,%rcx,2)
jmp 0x4eab
movq -0x30(%rbp), %rcx
testl %ecx, %ecx
jg 0x4ddf
movslq 0xe3a9(%rip), %r14      # 0x132a4
testq %r14, %r14
jle 0x4f34
leaq 0x1(%r14), %r13
imulq $0x70, %r14, %rax
addq %rax, %r12
addq $-0x70, %r12
xorl %r15d, %r15d
cmpb $0x0, -0x2(%rbx,%r13)
jne 0x4f25
movq %r12, %rdi
callq 0x4c4a
incl %r15d
decq %r13
addq $-0x70, %r12
cmpq $0x1, %r13
jg 0x4f12
jmp 0x4f37
xorl %r15d, %r15d
leaq 0xe31a(%rip), %rax      # 0x13258
cmpl $0x2, (%rax)
jge 0x4f5a
xorl %eax, %eax
testl %r15d, %r15d
setne %al
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8624(%rip), %rsi      # 0xd585
movl $0x2, %edi
movl %r15d, %edx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x319e
jmp 0x4f43
leaq 0x8645(%rip), %rdi      # 0xd5c1
leaq 0x856b(%rip), %rsi      # 0xd4ee
leaq 0x8664(%rip), %rcx      # 0xd5ee
movl $0xca, %edx
callq 0x2150
leaq 0x8679(%rip), %rdi      # 0xd614
leaq 0x854c(%rip), %rsi      # 0xd4ee
leaq 0x8687(%rip), %rcx      # 0xd630
movl $0xd5, %edx
callq 0x2150
leaq 0x859b(%rip), %rdi      # 0xd555
leaq 0x852d(%rip), %rsi      # 0xd4ee
leaq 0x859f(%rip), %rcx      # 0xd567
movl $0xf5, %edx
callq 0x2150