LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: reduce_five
static void
reduce_five(EDGE *ref)

/* The reverse of extend_five(). */
{
    EDGE *a,*b,*dummy;

    a=ref->next->next; dummy=ref->invers; b=dummy->prev;
    dummy->prev=b->next=a; a->next=dummy; a->prev=b;
    a->start=a->invers->end=dummy->start;
    (degree[dummy->start])++;

    a=b->invers; b=a->prev->prev;
    a->prev=b; b->next=a; 
    (degree[a->start])--;
    firstedge[a->start]=a;

    a=b->invers->prev->prev->invers; b=a->prev->prev;
    a->prev=ref; ref->next=a; b->next=ref; ref->prev=b;
    ref->start=ref->invers->end=a->start;
    firstedge[a->start]=a;

    a=b->invers; b=a->prev->prev;
    a->prev=b; b->next=a; 
    (degree[a->start])--;
    firstedge[a->start]=a;

    nv--;
    ne-=6;
}

// Assembly:
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
movq 0x18(%rax), %rax
movq 0x10(%rcx), %rdx
movq %rax, 0x18(%rdx)
movq %rax, 0x10(%rcx)
movq %rcx, 0x18(%rax)
movq %rdx, 0x10(%rax)
movslq (%rcx), %rcx
movq 0x20(%rax), %rsi
movl %ecx, 0x4(%rsi)
movl %ecx, (%rax)
leaq 0xd233(%rip), %rax      # 0x25be0
incl (%rax,%rcx,4)
movq 0x20(%rdx), %rcx
movq 0x10(%rcx), %rdx
movq 0x10(%rdx), %rdx
movq %rdx, 0x10(%rcx)
movq %rcx, 0x18(%rdx)
movslq (%rcx), %rsi
decl (%rax,%rsi,4)
movslq (%rcx), %rsi
leaq 0xd00c(%rip), %r8       # 0x259e0
movq %rcx, (%r8,%rsi,8)
movq 0x20(%rdx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x20(%rcx), %rcx
movq 0x10(%rcx), %rdx
movq 0x10(%rdx), %rdx
movq %rdi, 0x10(%rcx)
movq %rcx, 0x18(%rdi)
movq %rdi, 0x18(%rdx)
movq %rdx, 0x10(%rdi)
movslq (%rcx), %rsi
movq 0x20(%rdi), %r9
movl %esi, 0x4(%r9)
movl %esi, (%rdi)
movq %rcx, (%r8,%rsi,8)
movq 0x20(%rdx), %rcx
movq 0x10(%rcx), %rdx
movq 0x10(%rdx), %rdx
movq %rdx, 0x10(%rcx)
movq %rcx, 0x18(%rdx)
movslq (%rcx), %rdx
decl (%rax,%rdx,4)
movslq (%rcx), %rax
decl 0x229bcc(%rip)          # 0x242600
movq %rcx, (%r8,%rax,8)
addl $-0x6, 0x229bc5(%rip)   # 0x242604
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: extend_S
static void
extend_S(EDGE *ref)

/* This routine is the implementation of the S-operation in Batagelj's paper.
   It inserts 3 new vertices in triangular form into a triangle on the right
   hand side of ref */

{
    register EDGE *a,*b,*start;
    int dummy;

    start=S_op(nv);

    a=ref->invers->prev;
    b=a->invers->prev;

    degree[nv]=degree[nv+1]=degree[nv+2]=4;
    
    dummy=ref->start;
    degree[dummy]+=2; 
    (start+10)->start=(start+11)->end=(start+8)->start=(start+9)->end=dummy;

    dummy=ref->end;
    degree[dummy]+=2; 
    (start+12)->start=(start+13)->end=(start+14)->start=(start+15)->end=dummy;

    dummy=a->end;
    degree[dummy]+=2; 
    (start+6)->start=(start+7)->end=(start+16)->start=(start+17)->end=dummy;

    firstedge[nv]=start+1;
    firstedge[nv+1]=start;
    firstedge[nv+2]=start+2;

    ref->next=start+10; (start+10)->prev=ref;
    a->next=start+14; (start+14)->prev=a;
    b->next=start+6; (start+6)->prev=b;

    ref=ref->invers;
    ref->prev=start+12; (start+12)->next=ref;
    a=a->invers;
    a->prev=start+16; (start+16)->next=a;
    b=b->invers;
    b->prev=start+8; (start+8)->next=b;

    nv+=3;
    ne+=18;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movslq 0x229baf(%rip), %rax    # 0x242600
imulq $0x480, %rax, %rsi      # imm = 0x480
movq 0x20(%rdi), %rcx
movq 0x10(%rcx), %rdx
movq 0x20(%rdx), %rcx
movq 0x10(%rcx), %rcx
leaq 0xd171(%rip), %r10      # 0x25be0
movl $0x4, %r8d
movl %r8d, 0x8(%r10,%rax,4)
movl %r8d, 0x4(%r10,%rax,4)
movl %r8d, (%r10,%rax,4)
movslq (%rdi), %r11
addl $0x2, (%r10,%r11,4)
leaq 0x229b7e(%rip), %rbx    # 0x242610
leaq (%rsi,%rbx), %r14
addq $0xc000, %r14           # imm = 0xC000
movl %r11d, 0x244(%r14)
leaq 0xc200(%rsi,%rbx), %r8
movl %r11d, (%r8)
movl %r11d, 0xc4(%r8)
leaq (%rsi,%rbx), %r9
addq $0xc280, %r9            # imm = 0xC280
movl %r11d, (%r9)
movslq 0x4(%rdi), %r11
addl $0x2, (%r10,%r11,4)
movl %r11d, 0x144(%r9)
leaq (%rsi,%rbx), %r15
addq $0xc380, %r15           # imm = 0xC380
movl %r11d, (%r15)
movl %r11d, -0x3c(%r15)
leaq (%rsi,%rbx), %r12
addq $0xc300, %r12           # imm = 0xC300
movl %r11d, (%r12)
movslq 0x4(%rdx), %r11
addl $0x2, (%r10,%r11,4)
movl %r11d, 0x144(%r12)
leaq (%rsi,%rbx), %r10
addq $0xc400, %r10           # imm = 0xC400
movl %r11d, (%r10)
movl %r11d, -0x3c(%r8)
leaq 0xc180(%rsi,%rbx), %r13
movl %r11d, (%r13)
leaq 0xc040(%rsi,%rbx), %r11
leaq 0xcead(%rip), %rbp      # 0x259e0
movq %r11, (%rbp,%rax,8)
movq %r14, 0x8(%rbp,%rax,8)
leaq 0xc080(%rsi,%rbx), %rsi
movq %rsi, 0x10(%rbp,%rax,8)
movq %r9, 0x18(%rdi)
movq %rdi, -0x70(%r12)
movq %r15, 0x18(%rdx)
movq %rdx, -0x70(%r10)
movq %r13, 0x18(%rcx)
movq %rcx, 0x10(%r13)
movq 0x20(%rdi), %rsi
movq %r12, 0x10(%rsi)
movq %rsi, 0x18(%r12)
movq 0x20(%rdx), %rdx
movq %r10, 0x10(%rdx)
movq %rdx, 0x18(%r10)
movq 0x20(%rcx), %rcx
movq %r8, 0x10(%rcx)
movq %rcx, -0x68(%r9)
addl $0x3, %eax
movl %eax, 0x229a6f(%rip)    # 0x242600
addl $0x12, 0x229a6c(%rip)   # 0x242604
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: reduce_S
static void
reduce_S(EDGE *ref)

/* This routine is the implementation of the inverse S-operation in
   Batagelj's paper. It removes the triangle. 
*/
{
    register EDGE *a,*b;

    a=ref->invers->prev->prev->prev;
    b=a->invers->prev->prev->prev;

    firstedge[ref->start]=ref;
    degree[ref->start]-=2;
    firstedge[a->start]=a;
    degree[a->start]-=2;
    firstedge[b->start]=b;
    degree[b->start]-=2;

    ref->next=b->invers; b->invers->prev=ref;
    a->next=ref->invers; ref->invers->prev=a;
    b->next=a->invers; a->invers->prev=b;

    nv-=3;
    ne-=18;
}

// Assembly:
movq 0x20(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rax
movq 0x20(%rax), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
movq 0x10(%rcx), %rcx
movslq (%rdi), %rdx
leaq 0xce0c(%rip), %rsi      # 0x25be0
addl $-0x2, (%rsi,%rdx,4)
leaq 0xcc01(%rip), %r8       # 0x259e0
movq %rdi, (%r8,%rdx,8)
movslq (%rax), %rdx
movq %rax, (%r8,%rdx,8)
addl $-0x2, (%rsi,%rdx,4)
movslq (%rcx), %rdx
movq %rcx, (%r8,%rdx,8)
addl $-0x2, (%rsi,%rdx,4)
movq 0x20(%rcx), %rdx
movq %rdx, 0x18(%rdi)
movq %rdi, 0x10(%rdx)
movq 0x20(%rdi), %rdx
movq %rdx, 0x18(%rax)
movq %rax, 0x10(%rdx)
movq 0x20(%rax), %rax
movq %rax, 0x18(%rcx)
movq %rcx, 0x10(%rax)
addl $-0x3, 0x2297dc(%rip)   # 0x242600
addl $-0x12, 0x2297d9(%rip)  # 0x242604
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: is_min4_four
static int
is_min4_four(EDGE *ref)

/* Test if ref (known to be an edge!) is the reference edge of a
   legal four-reduction in the min4 case. 
   Return 1 if it is, and 0 if it isn't.
*/
{
    int w;
    EDGE *e,*elast;

    if (degree[ref->start] != 4) return 0;
    if (degree[ref->prev->end] == 4 || degree[ref->next->end] == 4) return 0;

    w = ref->next->next->end;
    if (degree[w] == 4) return 1;
    e = ref->invers;
    elast = e->prev;
    for (e = e->next->next; e != elast; e = e->next)
	if (e->end == w) return 0;

    return 1;
}

// Assembly:
movslq (%rdi), %rcx
leaq 0xcdaa(%rip), %rsi      # 0x25be0
xorl %eax, %eax
cmpl $0x4, (%rsi,%rcx,4)
jne 0x18e5a
movq 0x10(%rdi), %rcx
movslq 0x4(%rcx), %rcx
cmpl $0x4, (%rsi,%rcx,4)
je 0x18e5a
movq 0x18(%rdi), %rcx
movslq 0x4(%rcx), %rdx
cmpl $0x4, (%rsi,%rdx,4)
jne 0x18e5b
retq
movq 0x18(%rcx), %rcx
movslq 0x4(%rcx), %rdx
pushq $0x1
popq %rcx
cmpl $0x4, (%rsi,%rdx,4)
jne 0x18e6f
movl %ecx, %eax
retq
movq 0x20(%rdi), %rdi
movq 0x10(%rdi), %rsi
movq 0x18(%rdi), %rdi
movq 0x18(%rdi), %rdi
cmpq %rsi, %rdi
je 0x18e6c
cmpl %edx, 0x4(%rdi)
jne 0x18e7b
jmp 0x18e5a
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: extend3
static void 
extend3(EDGE *e)

/* inserts a vertex with valence 3 in the triangle on the right hand
   side (->next direction) of the edge e */
{
    register EDGE *work1, *work2, *work3;

    work1 = STAR3(nv);
    work2 = work1+1;
    work3 = work2+1;
    firstedge[nv] = work3+1;

/* work1 starts at the beginning of e: */

    work1->start = work1->invers->end = e->start;
    e->next->prev = work1;
    work1->next = e->next;
    work1->prev = e;
    e->next = work1;
    (degree[e->start])++;

/* Now go one edge further around the triangle and the same once more */

    e = e->invers->prev;
    
    work2->start = work2->invers->end = e->start;
    e->next->prev = work2;
    work2->next = e->next;
    work2->prev = e;
    e->next = work2;
    (degree[e->start])++;

    e = e->invers->prev;

    work3->start = work3->invers->end = e->start;
    e->next->prev = work3;
    work3->next = e->next;
    work3->prev = e;
    e->next = work3;
    (degree[e->start])++;

    degree[nv] = 3;

/* Now I have 6 edges and one vertex more */

    ne += 6; 
    nv++;
}

// Assembly:
movslq 0x22976e(%rip), %rax    # 0x242600
leal (,%rax,8), %ecx
movslq %ecx, %r8
shlq $0x6, %r8
leaq 0x229769(%rip), %r9     # 0x242610
leaq (%r8,%r9), %rsi
addq $0x180, %rsi            # imm = 0x180
leaq 0x200(%r8,%r9), %rcx
leaq 0x240(%r8,%r9), %rdx
leaq 0xcb17(%rip), %r10      # 0x259e0
movq %rdx, (%r10,%rax,8)
movslq (%rdi), %r10
movq -0x60(%rcx), %r11
movl %r10d, 0x4(%r11)
movl %r10d, -0x80(%rcx)
movq 0x18(%rdi), %r11
movq %rsi, 0x10(%r11)
movq %r11, -0x68(%rcx)
movq %rdi, -0x70(%rcx)
movq %rsi, 0x18(%rdi)
leaq 0xcce9(%rip), %rsi      # 0x25be0
incl (%rsi,%r10,4)
addq %r9, %r8
addq $0x1c0, %r8             # imm = 0x1C0
movq 0x20(%rdi), %rdi
movq 0x10(%rdi), %rdi
movslq (%rdi), %r9
movq -0x60(%rdx), %r10
movl %r9d, 0x4(%r10)
movl %r9d, -0x80(%rdx)
movq 0x18(%rdi), %r10
movq %r8, 0x10(%r10)
movq %r10, -0x68(%rdx)
movq %rdi, -0x70(%rdx)
movq %r8, 0x18(%rdi)
incl (%rsi,%r9,4)
movq 0x20(%rdi), %rdi
movq 0x10(%rdi), %rdi
movslq (%rdi), %r8
movq -0x20(%rdx), %r9
movl %r8d, 0x4(%r9)
movl %r8d, -0x40(%rdx)
movq 0x18(%rdi), %r9
movq %rcx, 0x10(%r9)
movq %r9, -0x28(%rdx)
movq %rdi, -0x30(%rdx)
movq %rcx, 0x18(%rdi)
incl (%rsi,%r8,4)
addl $0x6, 0x22969a(%rip)    # 0x242604
movl $0x3, (%rsi,%rax,4)
incl %eax
movl %eax, 0x229687(%rip)    # 0x242600
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: valid5edge
static int
valid5edge(EDGE *e)

/* e is an edge leaving a vertex of degree 5.  This function returns
   TRUE if e->end is not adjacent to either e->next->next->end or
   e->next->next->next->end, and FALSE otherwise. */
{
    register EDGE *e1,*ex;
    register int u,v;

    e1 = e->next->next;
    u = e1->end;
    v = e1->next->end;

    ex = e->invers;
    for (e1 = ex->next; e1 != ex; e1 = e1->next)
        if (e1->end == u || e1->end == v) return FALSE;

    return TRUE;
}

// Assembly:
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
movq 0x18(%rax), %rax
movl 0x4(%rax), %edx
movq 0x18(%rax), %rax
movl 0x4(%rax), %edi
pushq $0x1
popq %rsi
movq %rcx, %r8
xorl %eax, %eax
movq 0x18(%r8), %r8
cmpq %rcx, %r8
je 0x198f7
movl 0x4(%r8), %r9d
cmpl %edx, %r9d
je 0x198f6
cmpl %edi, %r9d
jne 0x198df
retq
movl %esi, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: disk_threeconn
static int
disk_threeconn(EDGE *e)

/* Checks whether a triangulation of a disk is 3-connected. This is
   the case if and only if there are no chords (except for K3).
   The edge e must have the triangulation on the right and the outer
   face on the left. 
   Returns TRUE if 3-connected, FALSE otherwise. */
{
    EDGE *run, *run2, *buffer;

    if (nv == 3) return FALSE;   /* K3 has connectivity 2 */

    RESETMARKS_V;

/* It is correct to do the marking and the running and checking in one
   wash, since a chord will be detected when the second of the endpoints 
   is reached */

    MARK_V(e->start); MARK_V(e->end);
 
    for (buffer=e->invers, run=buffer->next; run != e; 
                     buffer=run->invers, run=buffer->next)
      { MARK_V(run->end);
        for (run2=run->next; run2 != buffer; run2=run2->next)
            if (ISMARKED_V(run2->end)) return FALSE;
      }

    return TRUE;
}

// Assembly:
xorl %eax, %eax
cmpl $0x3, 0x228c95(%rip)    # 0x242600
je 0x199f8
movl 0xa709(%rip), %edx      # 0x24080
leal 0x1(%rdx), %ecx
movl %ecx, 0xa700(%rip)      # 0x24080
cmpl $0x7530, %edx           # imm = 0x7530
jl 0x199b1
movl $0x1, 0xa6ee(%rip)      # 0x24080
xorl %edx, %edx
pushq $0x1
popq %rcx
leaq 0x26f282(%rip), %rsi    # 0x288c20
cmpq $0x100, %rdx            # imm = 0x100
je 0x199b1
andl $0x0, (%rdx,%rsi)
addq $0x4, %rdx
jmp 0x1999e
pushq $0x1
popq %rdx
movslq (%rdi), %r8
leaq 0x26f262(%rip), %rsi    # 0x288c20
movl %ecx, (%rsi,%r8,4)
movslq 0x4(%rdi), %r8
movl %ecx, (%rsi,%r8,4)
movq %rdi, %r8
movq 0x20(%r8), %r9
movq 0x18(%r9), %r8
cmpq %rdi, %r8
je 0x199f9
movslq 0x4(%r8), %r10
movl %ecx, (%rsi,%r10,4)
movq %r8, %r10
movq 0x18(%r10), %r10
cmpq %r9, %r10
je 0x199cd
movslq 0x4(%r10), %r11
cmpl %ecx, (%rsi,%r11,4)
jne 0x199e5
retq
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: sortedges
static void
sortedges(EDGE **ed, int ned)

/* Sort an array of edges according to address.
   Good for short arrays only. */
{
    register int i,j;
    EDGE *edi;

    for (i = 1; i < ned; ++i)
    {
        edi = ed[i];
        for (j = i; ed[j-1] > edi; )
        {
            ed[j] = ed[j-1];
            if (--j <= 0) break;
        }
        ed[j] = edi;
    }
}

// Assembly:
movslq %esi, %rax
pushq $0x1
popq %rcx
cmpq %rax, %rcx
jge 0x1a6cb
movq (%rdi,%rcx,8), %rdx
movq %rcx, %rsi
movq -0x8(%rdi,%rsi,8), %r8
cmpq %rdx, %r8
jbe 0x1a6bf
movq %r8, (%rdi,%rsi,8)
leaq -0x1(%rsi), %r8
cmpq $0x1, %rsi
movq %r8, %rsi
jg 0x1a6a2
xorl %esi, %esi
movslq %esi, %rsi
movq %rdx, (%rdi,%rsi,8)
incq %rcx
jmp 0x1a696
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: reduce_bip_P
static void
reduce_bip_P(EDGE *ref)

/* This routine is the implementation of the inverse P-operation in Batagelj's 
   paper. It removes the two new vertices -- nv and nv+1. The reference edge 
   ref is c->e and when c and e are removed becomes x->e

        a
       / \
  x---b---c---e  The edge c-->e is the reference edge
       \ /
        d

*/
{
    EDGE *a, *b, *c, *d;
     /* 4 edges forming the square whose inside is removed (except ref) */

    a=ref->invers->next;
    b=ref->invers->prev;
    c=a->invers->next->next->next->invers;
    d=b->invers->prev->prev->prev->invers;

    degree[a->end]-=2;  degree[b->end]-=2;

    ref->start=ref->invers->end=c->start;
    firstedge[ref->start]=ref;
    ref->next=d; d->prev=ref;
    ref->prev=c; c->next=ref;

    a=a->invers; c=c->invers;
    a->next=c; c->prev=a; firstedge[a->start]=a;

    b=b->invers; d=d->invers;
    b->prev=d; d->next=b; firstedge[b->start]=b;

    nv -= 2;
    ne -= 12;
}

// Assembly:
movq 0x20(%rdi), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rdx
movq 0x20(%rdx), %rsi
movq 0x18(%rsi), %rsi
movq 0x18(%rsi), %rsi
movq 0x18(%rsi), %rsi
movq 0x20(%rsi), %rsi
movq 0x20(%rax), %r8
movq 0x10(%r8), %r8
movq 0x10(%r8), %r8
movq 0x10(%r8), %r8
movq 0x20(%r8), %r8
movslq 0x4(%rdx), %r9
leaq 0xa197(%rip), %r10      # 0x25be0
addl $-0x2, (%r10,%r9,4)
movslq 0x4(%rax), %r9
addl $-0x2, (%r10,%r9,4)
movslq (%rsi), %r9
movl %r9d, 0x4(%rcx)
movl %r9d, (%rdi)
leaq 0x9f78(%rip), %rcx      # 0x259e0
movq %rdi, (%rcx,%r9,8)
movq %r8, 0x18(%rdi)
movq %rdi, 0x10(%r8)
movq %rsi, 0x10(%rdi)
movq %rdi, 0x18(%rsi)
movq 0x20(%rdx), %rdx
movq 0x20(%rsi), %rsi
movq %rsi, 0x18(%rdx)
movq %rdx, 0x10(%rsi)
movslq (%rdx), %rsi
movq %rdx, (%rcx,%rsi,8)
movq 0x20(%rax), %rax
movq 0x20(%r8), %rdx
movq %rdx, 0x10(%rax)
movq %rax, 0x18(%rdx)
movslq (%rax), %rdx
addl $-0x2, 0x226b53(%rip)   # 0x242600
movq %rax, (%rcx,%rdx,8)
addl $-0xc, 0x226b4c(%rip)   # 0x242604
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: update_nft_P
static void
update_nft_P(triangle nft[], int numnft, EDGE *ref,
                triangle newnft[], int *newnumnft)

/* Make new list of non-facial triangles after a P-extension. */
{
    EDGE *refmin,*e,*elast;
    int i,k,w;

    refmin = ref->min;

  /* Remove triangles that include ref */
    k = 0;
    for (i = 0; i < numnft; ++i)
        if (nft[i].e1 != refmin && nft[i].e2 != refmin && nft[i].e3 != refmin)
            newnft[k++] = nft[i];

  /* Add new nfts formed by a shortcut if present.  There must be at
     least two nfts already for this to be possible. */

    if (k >= 2)
    {
        w = ref->next->end;
        elast = ref->invers->next->invers;
        for (e = elast->next->next->next->next; e != elast; e = e->next)
            if (e->end == w) break;
        if (e != elast)
        {
            newnft[k].e1 = e->min;
            newnft[k].e2 = ref->prev->min;
            newnft[k].e3 = ref->next->min;
            newnft[k+1].e1 = e->min;
            newnft[k+1].e2 = ref->next->next->invers->prev->min;
            newnft[k+1].e3 = ref->next->next->invers->next->min;
	    k += 2;
        }
    }
    *newnumnft = k;
}

// Assembly:
pushq %r14
pushq %rbx
movq 0x28(%rdx), %r9
xorl %r10d, %r10d
testl %esi, %esi
cmovlel %r10d, %esi
imulq $0x18, %rsi, %rsi
xorl %eax, %eax
cmpq %r10, %rsi
je 0x1bf13
cmpq %r9, (%rdi,%r10)
je 0x1bf0d
cmpq %r9, 0x8(%rdi,%r10)
je 0x1bf0d
cmpq %r9, 0x10(%rdi,%r10)
je 0x1bf0d
leaq (%rdi,%r10), %r11
movslq %eax, %rbx
incl %eax
imulq $0x18, %rbx, %rbx
movq 0x10(%r11), %r14
movq %r14, 0x10(%rcx,%rbx)
movups (%r11), %xmm0
movups %xmm0, (%rcx,%rbx)
addq $0x18, %r10
jmp 0x1bed6
cmpl $0x2, %eax
jl 0x1bf95
movq 0x18(%rdx), %rsi
movq 0x20(%rdx), %r9
movl 0x4(%rsi), %edi
movq 0x18(%r9), %r9
movq 0x20(%r9), %r9
movq 0x18(%r9), %r10
movq 0x18(%r10), %r10
movq 0x18(%r10), %r10
movq 0x18(%r10), %r10
cmpq %r9, %r10
je 0x1bf95
cmpl %edi, 0x4(%r10)
jne 0x1bf37
movq 0x28(%r10), %rdi
movl %eax, %r9d
imulq $0x18, %r9, %r9
movq %rdi, (%rcx,%r9)
movq 0x10(%rdx), %rdx
movq 0x28(%rdx), %rdx
movq %rdx, 0x8(%rcx,%r9)
movq 0x28(%rsi), %rdx
movq %rdx, 0x10(%rcx,%r9)
movq %rdi, 0x18(%rcx,%r9)
movq 0x18(%rsi), %rdx
movq 0x20(%rdx), %rdx
movq 0x10(%rdx), %rsi
movq 0x28(%rsi), %rsi
movq %rsi, 0x20(%rcx,%r9)
movq 0x18(%rdx), %rdx
movq 0x28(%rdx), %rdx
movq %rdx, 0x28(%rcx,%r9)
addl $0x2, %eax
movl %eax, (%r8)
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: is_bip_P
static int
is_bip_P(EDGE *e)

/* Return 1 if e is the reference edge of a valid P reduction,
   otherwise 0.  It must be that e is an edge of the graph. */
{
    int z;
    EDGE *e1,*ew,*ewlast;

    if (degree[e->start] != 4 || degree[e->end] == 4) return 0;
    if (degree[e->next->end] == 4 || degree[e->prev->end] == 4) return 0;
    e1 = e->next->next;
    if (degree[e1->end] != 4) return 0;
    z = e1->invers->next->next->end;
    if (degree[z] == 4) return 1;
    ew = e->invers;
    ewlast = ew->prev;
    for (ew = ew->next->next; ew != ewlast; ew = ew->next)
        if (ew->end == z) break;
    if (ew != ewlast) return 0;
    else              return 1;
}

// Assembly:
movslq (%rdi), %rdx
leaq 0x9b06(%rip), %rcx      # 0x25be0
xorl %eax, %eax
cmpl $0x4, (%rcx,%rdx,4)
jne 0x1c152
movslq 0x4(%rdi), %rdx
cmpl $0x4, (%rcx,%rdx,4)
je 0x1c152
movq 0x18(%rdi), %rdx
movslq 0x4(%rdx), %rsi
cmpl $0x4, (%rcx,%rsi,4)
je 0x1c152
movq 0x10(%rdi), %rsi
movslq 0x4(%rsi), %rsi
cmpl $0x4, (%rcx,%rsi,4)
je 0x1c152
movq 0x18(%rdx), %rdx
movslq 0x4(%rdx), %rsi
cmpl $0x4, (%rcx,%rsi,4)
jne 0x1c152
movq 0x20(%rdx), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movslq 0x4(%rax), %rax
cmpl $0x4, (%rcx,%rax,4)
jne 0x1c130
pushq $0x1
popq %rax
retq
movq 0x20(%rdi), %rdx
movq 0x10(%rdx), %rcx
movq 0x18(%rdx), %rdx
movq 0x18(%rdx), %rdx
cmpq %rcx, %rdx
je 0x1c14a
cmpl %eax, 0x4(%rdx)
jne 0x1c13c
xorl %eax, %eax
cmpq %rcx, %rdx
sete %al
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: has_bip_P
static EDGE*
has_bip_P(void)

/* If the graph has a legal P-reduction return an example;
   otherwise return NULL. */
{

    int i,j,w,z;
    EDGE *e,*e1,*ez,*ezlast;

    for (i = 0; i < nv; ++i)
    if (degree[i] == 4)
    {
	e = firstedge[i];
	j = 0;
	if (degree[e->end] == 4) {e1 = e; ++j;} e=e->next;
	if (degree[e->end] == 4) {e1 = e; ++j;} e=e->next;
	if (degree[e->end] == 4) {e1 = e; ++j;} e=e->next;
	if (degree[e->end] == 4) {e1 = e; ++j;}
	if (j != 1) continue;

	e = e1->next->next;
        
	w = e->end;
	z = e1->invers->next->next->end;
        
	if (degree[z] != 4)
	{
            ezlast = ez = firstedge[z];
            do
            {
                if (ez->end == w) break;
                ez = ez->next;
            } while (ez != ezlast);
            if (ez->end == w) continue;
	}

	return e;
    }
    return NULL;
}

// Assembly:
movl 0x2264a7(%rip), %ecx    # 0x242600
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
leaq 0x9a79(%rip), %rsi      # 0x25be0
leaq 0x9872(%rip), %rdi      # 0x259e0
cmpq %rcx, %rdx
je 0x1c235
cmpl $0x4, (%rsi,%rdx,4)
jne 0x1c22d
movq (%rdi,%rdx,8), %rax
movslq 0x4(%rax), %r9
xorl %r10d, %r10d
cmpl $0x4, (%rsi,%r9,4)
sete %r10b
cmoveq %rax, %r8
movq 0x18(%rax), %rax
movslq 0x4(%rax), %r9
leal 0x1(%r10), %r11d
cmpl $0x4, (%rsi,%r9,4)
cmovnel %r10d, %r11d
cmoveq %rax, %r8
movq 0x18(%rax), %rax
movslq 0x4(%rax), %r9
xorl %r10d, %r10d
cmpl $0x4, (%rsi,%r9,4)
cmoveq %rax, %r8
sete %r10b
addl %r11d, %r10d
movq 0x18(%rax), %rax
movslq 0x4(%rax), %r9
xorl %r11d, %r11d
cmpl $0x4, (%rsi,%r9,4)
sete %r11b
cmoveq %rax, %r8
addl %r10d, %r11d
cmpl $0x1, %r11d
jne 0x1c22d
movq 0x18(%r8), %rax
movq 0x20(%r8), %r9
movq 0x18(%rax), %rax
movq 0x18(%r9), %r9
movq 0x18(%r9), %r9
movslq 0x4(%r9), %r10
cmpl $0x4, (%rsi,%r10,4)
je 0x1c237
movl 0x4(%rax), %r9d
movq (%rdi,%r10,8), %r11
movq %r11, %r10
cmpl %r9d, 0x4(%r10)
je 0x1c22d
movq 0x18(%r10), %r10
cmpq %r11, %r10
jne 0x1c218
cmpl %r9d, 0x4(%r10)
jne 0x1c237
incq %rdx
jmp 0x1c16e
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: reduce_bip_Q
static void
reduce_bip_Q(EDGE *ref)

/* This routine is the implementation of the inverse Q-operation in
   Batagelj's paper. It removes the new vertex nv. 
*/
{

    EDGE *a,*b,*c,*d,*x;

    x=ref->next;
    a=ref->invers->next->invers;
    b=a->next->next->next;

    c=x->invers->prev->invers;
    d=c->prev->prev->prev;
    
    firstedge[a->start]=a;
    firstedge[c->start]=c;

    ref->start=ref->invers->end=x->start=x->invers->end=b->end;
    (degree[b->end])+=2;
    (degree[a->start])-=2; (degree[c->start])-=2; 
    
    b->prev=a; a->next=b;
    c->prev=d; d->next=c;

    b=b->invers; d=d->invers;

    b->next=ref; ref->prev=b;
    d->prev=x; x->next=d;

    nv--;
    ne-=6;
}

// Assembly:
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
movq 0x18(%rcx), %rcx
movq 0x20(%rcx), %rcx
movq 0x18(%rcx), %rdx
movq 0x18(%rdx), %rdx
movq 0x18(%rdx), %rdx
movq 0x20(%rax), %rsi
movq 0x10(%rsi), %rsi
movq 0x20(%rsi), %rsi
movq 0x10(%rsi), %r8
movq 0x10(%r8), %r8
movq 0x10(%r8), %r8
movslq (%rcx), %r9
leaq 0x954f(%rip), %r10      # 0x259e0
movq %rcx, (%r10,%r9,8)
movslq (%rsi), %r9
movq %rsi, (%r10,%r9,8)
movl 0x4(%rdx), %r9d
movq 0x20(%rax), %r10
movl %r9d, 0x4(%r10)
movl %r9d, (%rax)
movq 0x20(%rdi), %r10
movl %r9d, 0x4(%r10)
movl %r9d, (%rdi)
movslq 0x4(%rdx), %r9
leaq 0x971f(%rip), %r10      # 0x25be0
addl $0x2, (%r10,%r9,4)
movslq (%rcx), %r9
addl $-0x2, (%r10,%r9,4)
movslq (%rsi), %r9
addl $-0x2, (%r10,%r9,4)
movq %rcx, 0x10(%rdx)
movq %rdx, 0x18(%rcx)
movq %r8, 0x10(%rsi)
movq %rsi, 0x18(%r8)
movq 0x20(%rdx), %rcx
movq 0x20(%r8), %rdx
movq %rdi, 0x18(%rcx)
movq %rcx, 0x10(%rdi)
movq %rax, 0x10(%rdx)
movq %rdx, 0x18(%rax)
decl 0x2260fc(%rip)          # 0x242600
addl $-0x6, 0x2260f9(%rip)   # 0x242604
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: legal_P1_reduction_nf4
static int
legal_P1_reduction_nf4(EDGE *e)

/* checks whether the edge e characterizes a legal P1-reduction.
   Version for 3-connected quadrangulations without non-facial 4-cycles.
   Returns 1 if yes, 0 otherwise.

   It is assumed that edge->start has degree 3, and that both the side
   vertices edge->next->end and edge->prev->end have degree at least 4.
*/

{
    EDGE *e1,*e1last,*e2,*e2last;

    if (degree[e->end] == 3) return TRUE;

    RESETMARKS_V;

    e1 = e->invers;
    e1last = e1->prev;
    e1 = e1->next->next;
    do
    {
	MARK_V(e1->end);
	e1 = e1->next;
    } while (e1 != e1last);

    e1 = e->next->invers->prev->invers;
    e1last = e1->prev;
    e1 = e1->next;
    do
    {
	e2last = e1->invers;
	e2 = e2last->next;
	do
	{
	    if (ISMARKED_V(e2->end)) return FALSE;
	    e2 = e2->next;
	} while (e2 != e2last);
        
        e1 = e1->next;
    } while (e1 != e1last);

    return TRUE;
}

// Assembly:
movslq 0x4(%rdi), %rcx
leaq 0x8b54(%rip), %rdx      # 0x25be0
pushq $0x1
popq %rax
cmpl $0x3, (%rdx,%rcx,4)
jne 0x1d096
retq
movl 0x6fe4(%rip), %edx      # 0x24080
leal 0x1(%rdx), %ecx
movl %ecx, 0x6fdb(%rip)      # 0x24080
cmpl $0x7530, %edx           # imm = 0x7530
jl 0x1d0d6
movl $0x1, 0x6fc9(%rip)      # 0x24080
xorl %edx, %edx
pushq $0x1
popq %rcx
leaq 0x26bb5d(%rip), %rsi    # 0x288c20
cmpq $0x100, %rdx            # imm = 0x100
je 0x1d0d6
andl $0x0, (%rdx,%rsi)
addq $0x4, %rdx
jmp 0x1d0c3
movq 0x20(%rdi), %rdx
movq 0x10(%rdx), %rsi
movq 0x18(%rdx), %rdx
movq 0x18(%rdx), %r8
leaq 0x26bb33(%rip), %rdx    # 0x288c20
movslq 0x4(%r8), %r9
movl %ecx, (%rdx,%r9,4)
movq 0x18(%r8), %r8
cmpq %rsi, %r8
jne 0x1d0ed
movq 0x18(%rdi), %rsi
movq 0x20(%rsi), %rsi
movq 0x10(%rsi), %rsi
movq 0x20(%rsi), %rdi
movq 0x10(%rdi), %rsi
movq 0x18(%rdi), %rdi
movq 0x20(%rdi), %r8
movq 0x18(%r8), %r9
movslq 0x4(%r9), %r10
cmpl %ecx, (%rdx,%r10,4)
je 0x1d13f
movq 0x18(%r9), %r9
cmpq %r8, %r9
jne 0x1d11e
movq 0x18(%rdi), %rdi
cmpq %rsi, %rdi
jne 0x1d116
jmp 0x1d095
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/mishun[P]plantri/plantri.c
// Function: update_nft_four
static void
update_nft_four(triangle nft[], int numnft, EDGE *ref,
                triangle newnft[], int *newnumnft)

/* Make new list of non-facial triangles after a four-extension. */
{
    EDGE *refmin,*e,*elast;
    int i,k,w;

    refmin = ref->min;

  /* Remove triangles that include ref */
    k = 0;
    for (i = 0; i < numnft; ++i)
        if (nft[i].e1 != refmin && nft[i].e2 != refmin && nft[i].e3 != refmin)
            newnft[k++] = nft[i];

  /* Add a shortcut if there is one (only possible if there are >= 2 others) */
    if (k >= 2)
    {
        w = ref->next->end;
        elast = ref->invers->next->invers;
        for (e = elast->next->next->next; e != elast; e = e->next)
            if (e->end == w) break;
        if (e != elast)
        {
            newnft[k].e1 = e->min;
            newnft[k].e2 = ref->prev->min;
            newnft[k].e3 = ref->next->min;
            ++k;
        }
    }
    *newnumnft = k;
}

// Assembly:
pushq %r14
pushq %rbx
movq 0x28(%rdx), %r9
xorl %r10d, %r10d
testl %esi, %esi
cmovlel %r10d, %esi
imulq $0x18, %rsi, %rsi
xorl %eax, %eax
cmpq %r10, %rsi
je 0x1ddd5
cmpq %r9, (%rdi,%r10)
je 0x1ddcf
cmpq %r9, 0x8(%rdi,%r10)
je 0x1ddcf
cmpq %r9, 0x10(%rdi,%r10)
je 0x1ddcf
leaq (%rdi,%r10), %r11
movslq %eax, %rbx
incl %eax
imulq $0x18, %rbx, %rbx
movq 0x10(%r11), %r14
movq %r14, 0x10(%rcx,%rbx)
movups (%r11), %xmm0
movups %xmm0, (%rcx,%rbx)
addq $0x18, %r10
jmp 0x1dd98
cmpl $0x2, %eax
jl 0x1de2b
movq 0x18(%rdx), %rsi
movq 0x20(%rdx), %r9
movl 0x4(%rsi), %edi
movq 0x18(%r9), %r9
movq 0x20(%r9), %r9
movq 0x18(%r9), %r10
movq 0x18(%r10), %r10
movq 0x18(%r10), %r10
cmpq %r9, %r10
je 0x1de2b
cmpl %edi, 0x4(%r10)
jne 0x1ddf5
movq 0x28(%r10), %rdi
movl %eax, %r9d
imulq $0x18, %r9, %r9
movq %rdi, (%rcx,%r9)
movq 0x10(%rdx), %rdx
movq 0x28(%rdx), %rdx
movq %rdx, 0x8(%rcx,%r9)
movq 0x28(%rsi), %rdx
movq %rdx, 0x10(%rcx,%r9)
incl %eax
movl %eax, (%r8)
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/soso7885[P]OPCUA_example/demo_src/server_repeated_job.c
// Function: main
int main(int argc, char** argv) {
    signal(SIGINT, stopHandler); /* catches ctrl-c */

    UA_ServerConfig config = UA_ServerConfig_standard;
    UA_ServerNetworkLayer nl = UA_ServerNetworkLayerTCP(UA_ConnectionConfig_standard, 16664);
    config.networkLayers = &nl;
    config.networkLayersSize = 1;
    UA_Server *server = UA_Server_new(config);

    /* add a repeated job to the server */
    UA_Job job = {.type = UA_JOBTYPE_METHODCALL,
                  .job.methodCall = {.method = testCallback, .data = NULL} };
    UA_Server_addRepeatedJob(server, job, 2000, NULL); // call every 2 sec

    UA_StatusCode retval = UA_Server_run(server, &running);
    UA_Server_delete(server);
    nl.deleteMembers(&nl);
    return (int)retval;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x318, %rsp            # imm = 0x318
leaq 0xd4(%rip), %rsi        # 0x1287
pushq $0x2
popq %rdi
callq 0x1070
movq 0x2e1e(%rip), %rsi      # 0x3fe0
leaq -0x1c8(%rbp), %r14
movl $0x160, %edx            # imm = 0x160
movq %r14, %rdi
callq 0x1060
movq 0x2e13(%rip), %rax      # 0x3ff0
movl 0x10(%rax), %ecx
movl %ecx, -0x20(%rbp)
movups (%rax), %xmm0
movaps %xmm0, -0x30(%rbp)
movl -0x20(%rbp), %eax
movl %eax, 0x10(%rsp)
movaps -0x30(%rbp), %xmm0
movups %xmm0, (%rsp)
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
movl $0x4118, %esi           # imm = 0x4118
callq 0x1040
movq %rbx, 0xf8(%r14)
movq $0x1, 0xf0(%r14)
pushq $0x2c
popq %rcx
movq %rsp, %rdi
movq %r14, %rsi
rep  movsq (%rsi), %es:(%rdi)
callq 0x1030
movq %rax, %r14
movups 0x2b91(%rip), %xmm0     # 0x3dc8
movups %xmm0, 0x10(%rsp)
movups 0x2b75(%rip), %xmm0     # 0x3db8
movups %xmm0, (%rsp)
movq %rax, %rdi
movl $0x7d0, %esi            # imm = 0x7D0
xorl %edx, %edx
callq 0x1050
leaq 0x2e03(%rip), %rsi      # 0x4060
movq %r14, %rdi
callq 0x1080
movl %eax, %r15d
movq %r14, %rdi
callq 0x1090
movq %rbx, %rdi
callq *0x30(%rbx)
movl %r15d, %eax
addq $0x318, %rsp            # imm = 0x318
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/main.c
// Function: hash_fun
unsigned int hash_fun(void* key,int hashtable_size)
{
    unsigned int hash = 0;
    char* str = key;
    while(*str)
    {
        hash += (hash << 5) + (*str++);
    }

    return ( hash & 0x7fffffff ) % hashtable_size;
}

// Assembly:
xorl %eax, %eax
movsbl (%rdi), %ecx
testl %ecx, %ecx
je 0x38f0
incq %rdi
imull $0x21, %eax, %eax
addl %ecx, %eax
jmp 0x38df
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
xorl %edx, %edx
divl %esi
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: tcp_srv
int tcp_srv(const char* host,const unsigned short port)
{
    int fd = socket(AF_INET,SOCK_STREAM,0);
    if (-1 == fd)
        ERR_EXIT("socket error");

    int on = 1;
    if (-1 == setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(const char*)&on,sizeof(on)))
        ERR_EXIT("setsockopt error");

    struct sockaddr_in srvaddr;
    memset(&srvaddr,0,sizeof(srvaddr));
    srvaddr.sin_family = AF_INET;
    srvaddr.sin_port = htons(port);
    if (NULL != host)
    {
        if (0 == inet_aton(host,&srvaddr.sin_addr))
            ERR_EXIT("inet_aton");
    }
    else
        srvaddr.sin_addr.s_addr = htonl(INADDR_ANY);

    if (-1 == bind(fd,(struct sockaddr*)&srvaddr,sizeof(srvaddr)))
        ERR_EXIT("bind error");

    if (-1 == listen(fd,10))
        ERR_EXIT("listen error");

    return fd;

}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %r14
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x3550
cmpl $-0x1, %eax
je 0x3a6a
movl %eax, %ebx
leaq 0x1c(%rsp), %rcx
movl $0x1, (%rcx)
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x30d0
cmpl $-0x1, %eax
je 0x3a73
andl $0x0, 0x18(%rsp)
andq $0x0, 0x10(%rsp)
movw $0x2, 0xc(%rsp)
rolw $0x8, %bp
movw %bp, 0xe(%rsp)
testq %r14, %r14
je 0x3a3c
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x3380
testl %eax, %eax
je 0x3a8e
leaq 0xc(%rsp), %rsi
pushq $0x10
popq %rdx
movl %ebx, %edi
callq 0x3410
cmpl $-0x1, %eax
je 0x3a7c
pushq $0xa
popq %rsi
movl %ebx, %edi
callq 0x33c0
cmpl $-0x1, %eax
je 0x3a85
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x3674(%rip), %rdi      # 0x70e5
jmp 0x3a95
leaq 0x3678(%rip), %rdi      # 0x70f2
jmp 0x3a95
leaq 0x368a(%rip), %rdi      # 0x710d
jmp 0x3a95
leaq 0x368c(%rip), %rdi      # 0x7118
jmp 0x3a95
leaq 0x366e(%rip), %rdi      # 0x7103
callq 0x3470
pushq $0x1
popq %rdi
callq 0x34e0
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: tcp_clnt
int tcp_clnt(const char* host,const unsigned short port)
{
    int fd = socket(PF_INET,SOCK_STREAM,0);
    if (-1 == fd)
        ERR_EXIT("socket error");

    int on = 1;
    if (-1 == setsockopt(fd,SOL_SOCKET,SO_REUSEADDR,(const char*)&on,sizeof(on)))
        ERR_EXIT("setsockopt error");
    
    if ( port > 0 )
    {
        struct sockaddr_in srvaddr;
        memset(&srvaddr,0,sizeof(srvaddr));
        srvaddr.sin_family = AF_INET;
        srvaddr.sin_port = htons(port);
        if (0 == inet_aton(host,&srvaddr.sin_addr))
            ERR_EXIT("inet_aton");
        if (-1 == bind(fd,(struct sockaddr*)&srvaddr,sizeof(srvaddr)))
            ERR_EXIT("bind error");
    }

    return fd;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %r14
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x3550
cmpl $-0x1, %eax
je 0x3b2f
movl %eax, %ebx
leaq 0xc(%rsp), %rcx
movl $0x1, (%rcx)
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
pushq $0x4
popq %r8
movl %eax, %edi
callq 0x30d0
cmpl $-0x1, %eax
je 0x3b38
testw %bp, %bp
je 0x3b24
leaq 0x14(%rsp), %rsi
andl $0x0, 0x8(%rsi)
andq $0x0, (%rsi)
movw $0x2, -0x4(%rsi)
rolw $0x8, %bp
movw %bp, -0x2(%rsi)
movq %r14, %rdi
callq 0x3380
testl %eax, %eax
je 0x3b41
leaq 0x10(%rsp), %rsi
pushq $0x10
popq %rdx
movl %ebx, %edi
callq 0x3410
cmpl $-0x1, %eax
je 0x3b4a
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x35af(%rip), %rdi      # 0x70e5
jmp 0x3b51
leaq 0x35b3(%rip), %rdi      # 0x70f2
jmp 0x3b51
leaq 0x35bb(%rip), %rdi      # 0x7103
jmp 0x3b51
leaq 0x35bc(%rip), %rdi      # 0x710d
callq 0x3470
pushq $0x1
popq %rdi
callq 0x34e0
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: getlocalip
int getlocalip(char *ip)
{
    int sockfd; 
    if(-1 == (sockfd = socket(PF_INET, SOCK_STREAM, 0)))
    {
        perror( "socket" );
        return -1;
    }
    struct ifreq req;
    struct sockaddr_in *host;
    bzero(&req, sizeof(struct ifreq));
    strcpy(req.ifr_name, "eth0"); 
    ioctl(sockfd, SIOCGIFADDR, &req);
    host = (struct sockaddr_in*)&req.ifr_addr;
    strcpy(ip, inet_ntoa(host->sin_addr));
    close(sockfd);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
pushq $0x2
popq %rdi
pushq $0x1
popq %rbx
movl %ebx, %esi
xorl %edx, %edx
callq 0x3550
cmpl $-0x1, %eax
je 0x3bdb
movl %eax, %ebp
xorps %xmm0, %xmm0
movq %rsp, %r15
movups %xmm0, 0x15(%r15)
andl $0x0, 0x24(%r15)
movups %xmm0, 0x5(%r15)
movl $0x30687465, (%r15)     # imm = 0x30687465
movb $0x0, 0x4(%r15)
movl $0x8915, %esi           # imm = 0x8915
movl %eax, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x3230
movl 0x14(%r15), %edi
callq 0x3120
movq %r14, %rdi
movq %rax, %rsi
callq 0x3090
movl %ebp, %edi
callq 0x3260
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3543(%rip), %rdi      # 0x7125
callq 0x3470
pushq $-0x1
popq %rbx
jmp 0x3bce
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: activate_nonblock
void activate_nonblock(int fd)
{
    int ret;
    int flags = fcntl(fd, F_GETFL);
    if (flags == -1)
        ERR_EXIT("fcntl");

    flags |= O_NONBLOCK;
    ret = fcntl(fd, F_SETFL, flags);
    if (ret == -1)
        ERR_EXIT("fcntl");
}

// Assembly:
pushq %rbx
movl %edi, %ebx
pushq $0x3
popq %rsi
xorl %eax, %eax
callq 0x30f0
cmpl $-0x1, %eax
je 0x3c18
orl $0x800, %eax            # imm = 0x800
pushq $0x4
popq %rsi
movl %ebx, %edi
movl %eax, %edx
xorl %eax, %eax
callq 0x30f0
cmpl $-0x1, %eax
je 0x3c18
popq %rbx
retq
leaq 0x3512(%rip), %rdi      # 0x7131
callq 0x3470
pushq $0x1
popq %rdi
callq 0x34e0
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: read_timeout
int read_timeout(int fd, unsigned int wait_seconds)
{
    int ret = 0;
    if (wait_seconds > 0)
    {
        fd_set read_fdset;
        struct timeval timeout;

        FD_ZERO(&read_fdset);
        FD_SET(fd, &read_fdset);

        timeout.tv_sec = wait_seconds;
        timeout.tv_usec = 0;
        do
        {
            ret = select(fd + 1, &read_fdset, NULL, NULL, &timeout);
        } while (ret < 0 && errno == EINTR);

        if (ret == 0)
        {
            ret = -1;
            errno = ETIMEDOUT;
        }
        else if (ret == 1)
            ret = 0;
    }

    return ret;
}

// Assembly:
testl %esi, %esi
je 0x3ce8
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edi, %ebx
xorl %eax, %eax
cmpq $0x10, %rax
je 0x3c92
andq $0x0, 0x18(%rsp,%rax,8)
incq %rax
jmp 0x3c81
pushq $0x40
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %ebx, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, 0x18(%rsp,%rdx,8)
movl %esi, %eax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
andq $0x0, 0x8(%r14)
incl %ebx
leaq 0x18(%rsp), %r15
movl %ebx, %edi
movq %r15, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r14, %r8
callq 0x3370
movl %eax, %ebp
testl %eax, %eax
jns 0x3ceb
callq 0x3060
cmpl $0x4, (%rax)
je 0x3cc5
jmp 0x3ced
xorl %eax, %eax
retq
je 0x3d03
xorl %eax, %eax
cmpl $0x1, %ebp
cmovnel %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl $0x6e, (%rax)
pushq $-0x1
popq %rax
jmp 0x3cf5
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: write_timeout
int write_timeout(int fd, unsigned int wait_seconds)
{
    int ret = 0;
    if (wait_seconds > 0)
    {
        fd_set write_fdset;
        struct timeval timeout;

        FD_ZERO(&write_fdset);
        FD_SET(fd, &write_fdset);

        timeout.tv_sec = wait_seconds;
        timeout.tv_usec = 0;
        do
        {
            ret = select(fd + 1, NULL, NULL, &write_fdset, &timeout);
        } while (ret < 0 && errno == EINTR);

        if (ret == 0)
        {
            ret = -1;
            errno = ETIMEDOUT;
        }
        else if (ret == 1)
            ret = 0;
    }

    return ret;
}

// Assembly:
testl %esi, %esi
je 0x3d8f
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %edi, %ebx
xorl %eax, %eax
cmpq $0x10, %rax
je 0x3d39
andq $0x0, 0x18(%rsp,%rax,8)
incq %rax
jmp 0x3d28
pushq $0x40
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %ebx, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, 0x18(%rsp,%rdx,8)
movl %esi, %eax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
andq $0x0, 0x8(%r14)
incl %ebx
leaq 0x18(%rsp), %r15
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
movq %r15, %rcx
movq %r14, %r8
callq 0x3370
movl %eax, %ebp
testl %eax, %eax
jns 0x3d92
callq 0x3060
cmpl $0x4, (%rax)
je 0x3d6c
jmp 0x3d94
xorl %eax, %eax
retq
je 0x3daa
xorl %eax, %eax
cmpl $0x1, %ebp
cmovnel %ebp, %eax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x3060
movl $0x6e, (%rax)
pushq $-0x1
popq %rax
jmp 0x3d9c
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: accept_timeout
int accept_timeout(int fd, struct sockaddr_in *addr, unsigned int wait_seconds)
{
    int ret;
    socklen_t addrlen = sizeof(struct sockaddr_in);

    if (wait_seconds > 0)
    {
        fd_set accept_fdset;
        struct timeval timeout;
        FD_ZERO(&accept_fdset);
        FD_SET(fd, &accept_fdset);
        timeout.tv_sec = wait_seconds;
        timeout.tv_usec = 0;
        do
        {
            ret = select(fd + 1, &accept_fdset, NULL, NULL, &timeout);
        } while (ret < 0 && errno == EINTR);
        if (ret == -1)
            return -1;
        else if (ret == 0)
        {
            errno = ETIMEDOUT;
            return -1;
        }
    }

    if (addr != NULL)
        ret = accept(fd, (struct sockaddr*)addr, &addrlen);
    else
        ret = accept(fd, NULL, NULL);
/*  if (ret == -1)
        ERR_EXIT("accept");
        */

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rsi, %r14
movl %edi, %ebx
movl $0x10, 0x4(%rsp)
testl %edx, %edx
je 0x3e68
movl %edx, %r8d
xorl %eax, %eax
cmpq $0x10, %rax
je 0x3df6
andq $0x0, 0x18(%rsp,%rax,8)
incq %rax
jmp 0x3de5
pushq $0x40
popq %rcx
movl %ebx, %eax
cltd
idivl %ecx
movslq %eax, %rdx
shll $0x6, %eax
movl %ebx, %ecx
subl %eax, %ecx
pushq $0x1
popq %rax
shlq %cl, %rax
orq %rax, 0x18(%rsp,%rdx,8)
movl %r8d, %eax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
andq $0x0, 0x8(%r15)
leal 0x1(%rbx), %ebp
leaq 0x18(%rsp), %r12
movl %ebp, %edi
movq %r12, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x3370
movl %eax, %r13d
testl %eax, %eax
jns 0x3e4d
callq 0x3060
cmpl $0x4, (%rax)
je 0x3e2b
cmpl $-0x1, %r13d
je 0x3e63
testl %r13d, %r13d
jne 0x3e68
callq 0x3060
movl $0x6e, (%rax)
pushq $-0x1
popq %rax
jmp 0x3e84
testq %r14, %r14
je 0x3e79
leaq 0x4(%rsp), %rdx
movl %ebx, %edi
movq %r14, %rsi
jmp 0x3e7f
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x34a0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: readn
ssize_t readn(int fd, void *buf, size_t count)
{
    size_t nleft = count;
    ssize_t nread;
    char *bufp = (char*)buf;

    while (nleft > 0)
    {
        if ((nread = read(fd, bufp, nleft)) < 0)
        {
            if (errno == EINTR)
                continue;
            return -1;
        }
        else if (nread == 0)
            return count - nleft;

        bufp += nread;
        nleft -= nread;
    }

    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
pushq $-0x1
popq %r12
movq %rdx, %r15
testq %r15, %r15
je 0x400e
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3280
testq %rax, %rax
jns 0x4001
callq 0x3060
cmpl $0x4, (%rax)
je 0x3fe3
jmp 0x400b
je 0x401a
addq %rax, %r14
subq %rax, %r15
jmp 0x3fde
movq %r12, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
subq %r15, %rbx
jmp 0x400e
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: writen
ssize_t writen(int fd, const void *buf, size_t count)
{
    size_t nleft = count;
    ssize_t nwritten;
    char *bufp = (char*)buf;

    while (nleft > 0)
    {
        if ((nwritten = write(fd, bufp, nleft)) < 0)
        {
            if (errno == EINTR)
                continue;
            return -1;
        }
        else if (nwritten == 0)
            continue;

        bufp += nwritten;
        nleft -= nwritten;
    }

    return count;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movl %edi, %ebp
pushq $-0x1
popq %r12
movq %rdx, %r15
testq %r15, %r15
je 0x4068
movl %ebp, %edi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3100
testq %rax, %rax
js 0x4051
je 0x403b
jmp 0x405d
callq 0x3060
cmpl $0x4, (%rax)
je 0x403b
jmp 0x4065
addq %rax, %r14
subq %rax, %r15
jmp 0x4036
movq %r12, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: readline
ssize_t readline(int sockfd, void *buf, size_t maxline)
{
    int ret;
    int nread;
    char *bufp = buf;
    int nleft = maxline;
    while (1)
    {
        ret = recv_peek(sockfd, bufp, nleft);
        if (ret < 0)
            return ret;
        else if (ret == 0)
            return ret;

        nread = ret;
        int i;
        for (i=0; i<nread; i++)
        {
            if (bufp[i] == '\n')
            {
                ret = readn(sockfd, bufp, i+1);
                if (ret != i+1)
                    exit(EXIT_FAILURE);

                return ret;
            }
        }

        if (nread > nleft)
            exit(EXIT_FAILURE);

        nleft -= nread;
        ret = readn(sockfd, bufp, nread);
        if (ret != nread)
            exit(EXIT_FAILURE);

        bufp += nread;
    }

    return -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movl %edi, %ebp
pushq $0x1
popq %r13
movslq %r15d, %rdx
movl %ebp, %edi
movq %r14, %rsi
callq 0x4074
movq %rax, %r12
testl %r12d, %r12d
js 0x4156
je 0x415b
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
negq %rax
movq %r13, %rbx
leaq (%rax,%r13), %rcx
cmpq $0x1, %rcx
je 0x410a
cmpb $0xa, -0x1(%r14,%r13)
je 0x4133
incq %r13
jmp 0x40f3
subl %r12d, %r15d
jl 0x415f
movl %r12d, %r13d
andl $0x7fffffff, %r13d      # imm = 0x7FFFFFFF
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x3fc7
cmpl %r12d, %eax
jne 0x415f
addq %r13, %r14
movq %rbx, %r13
jmp 0x40ce
movl %ebp, %edi
movq %r14, %rsi
movq %r13, %rdx
callq 0x3fc7
cmpl %r13d, %eax
jne 0x415f
cltq
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movslq %r12d, %rax
jmp 0x4147
xorl %eax, %eax
jmp 0x4147
pushq $0x1
popq %rdi
callq 0x34e0
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: send_fd
void send_fd(int sock_fd, int fd)
{
    int ret;
    struct msghdr msg;
    struct cmsghdr *p_cmsg;
    struct iovec vec;
    char cmsgbuf[CMSG_SPACE(sizeof(fd))];
    int *p_fds;
    char sendchar = 0;
    msg.msg_control = cmsgbuf;
    msg.msg_controllen = sizeof(cmsgbuf);
    p_cmsg = CMSG_FIRSTHDR(&msg);
    p_cmsg->cmsg_level = SOL_SOCKET;
    p_cmsg->cmsg_type = SCM_RIGHTS;
    p_cmsg->cmsg_len = CMSG_LEN(sizeof(fd));
    p_fds = (int*)CMSG_DATA(p_cmsg);
    *p_fds = fd;

    msg.msg_name = NULL;
    msg.msg_namelen = 0;
    msg.msg_iov = &vec;
    msg.msg_iovlen = 1;
    msg.msg_flags = 0;

    vec.iov_base = &sendchar;
    vec.iov_len = sizeof(sendchar);
    ret = sendmsg(sock_fd, &msg, 0);
    if (ret != 1)
        ERR_EXIT("sendmsg");
}

// Assembly:
subq $0x78, %rsp
leaq 0x20(%rsp), %rcx
leaq 0x40(%rsp), %rax
movq %rcx, 0x20(%rax)
movq $0x18, 0x28(%rax)
movabsq $0x100000001, %rdx      # imm = 0x100000001
movq %rdx, 0x8(%rcx)
andq $0x0, (%rax)
movq $0x14, (%rcx)
andl $0x0, 0x8(%rax)
movl %esi, 0x10(%rcx)
leaq 0x10(%rsp), %rcx
movq %rcx, 0x10(%rax)
pushq $0x1
popq %rdx
movq %rdx, 0x18(%rax)
andl $0x0, 0x30(%rax)
leaq 0xf(%rsp), %rsi
movb $0x0, (%rsi)
movq %rsi, (%rcx)
movq %rdx, 0x8(%rcx)
movq %rax, %rsi
xorl %edx, %edx
callq 0x30b0
cmpl $0x1, %eax
jne 0x41d8
addq $0x78, %rsp
retq
leaq 0x2f58(%rip), %rdi      # 0x7137
callq 0x3470
pushq $0x1
popq %rdi
callq 0x34e0
// File: /workspace/github_c_makefile_star2_O2/icysunlight[P]miniftpd/sysutil.c
// Function: recv_fd
int recv_fd(const int sock_fd)
{
    int ret;
    struct msghdr msg;
    char recvchar;
    struct iovec vec;
    int recv_fd;
    char cmsgbuf[CMSG_SPACE(sizeof(recv_fd))];
    struct cmsghdr *p_cmsg;
    int *p_fd;
    vec.iov_base = &recvchar;
    vec.iov_len = sizeof(recvchar);
    msg.msg_name = NULL;
    msg.msg_namelen = 0;
    msg.msg_iov = &vec;
    msg.msg_iovlen = 1;
    msg.msg_control = cmsgbuf;
    msg.msg_controllen = sizeof(cmsgbuf);
    msg.msg_flags = 0;

    p_fd = (int*)CMSG_DATA(CMSG_FIRSTHDR(&msg));
    *p_fd = -1;
    ret = recvmsg(sock_fd, &msg, 0);
    if (ret != 1)
        ERR_EXIT("recvmsg");

    p_cmsg = CMSG_FIRSTHDR(&msg);
    if (p_cmsg == NULL)
        ERR_EXIT("no passed fd");


    p_fd = (int*)CMSG_DATA(p_cmsg);
    recv_fd = *p_fd;
    if (recv_fd == -1)
        ERR_EXIT("no passed fd");

    return recv_fd;
}

// Assembly:
subq $0x68, %rsp
leaq 0x7(%rsp), %rax
leaq 0x8(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x18(%rsp), %rsi
andq $0x0, (%rsi)
pushq $0x1
popq %rax
andl $0x0, 0x8(%rsi)
movq %rcx, 0x10(%rsi)
movq %rax, 0x18(%rsi)
leaq 0x50(%rsp), %rdx
movq %rdx, 0x20(%rsi)
movq $0x18, 0x28(%rsi)
andl $0x0, 0x30(%rsi)
movq %rax, 0x8(%rcx)
orl $-0x1, 0x10(%rdx)
xorl %edx, %edx
callq 0x33f0
cmpl $0x1, %eax
jne 0x4266
cmpq $0x10, 0x40(%rsp)
jb 0x425d
movq 0x38(%rsp), %rax
testq %rax, %rax
je 0x425d
movl 0x10(%rax), %eax
cmpl $-0x1, %eax
je 0x425d
addq $0x68, %rsp
retq
leaq 0x2ee3(%rip), %rdi      # 0x7147
jmp 0x426d
leaq 0x2ed2(%rip), %rdi      # 0x713f
callq 0x3470
pushq $0x1
popq %rdi
callq 0x34e0
nop