LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/queue.c
// Function: queue_deque
void * queue_deque(struct _queue * q, void * item) {
    struct _qnode * t_node;

    assert ( q != NULL );

    if (q->head == NULL)
        return NULL;    // Return NULL in case of empty queue
    
    t_node = q->head; 
    memcpy(item, t_node->item, q->item_size);

    q->head = t_node->next;
    free(t_node);

    --q->n_items;

    return item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2ef1
movq %rdi, %r14
movq (%rdi), %r15
testq %r15, %r15
je 0x2ee1
movq %rsi, %rbx
leaq 0x8(%r15), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0x1150
movq (%r15), %rax
movq %rax, (%r14)
movq %r15, %rdi
callq 0x1030
decq 0x18(%r14)
jmp 0x2ee3
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x327a(%rip), %rdi      # 0x6172
leaq 0x327d(%rip), %rsi      # 0x617c
leaq 0x32ac(%rip), %rcx      # 0x61b2
movl $0x30, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/queue.c
// Function: queue_empty
void queue_empty(struct _queue * q) {
    void * item = malloc(q->item_size);

    while( queue_deque(q, item) != NULL );

    q->n_items = 0;
    free (item);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
callq 0x1160
movq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2ea0
testq %rax, %rax
jne 0x2f26
movq $0x0, 0x18(%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/bitset.c
// Function: bitset_create
struct _bitset * bitset_create(int nbits) {
    struct _bitset * bitset;

    bitset = malloc(sizeof(struct _bitset));
    bitset->n_words = (nbits / WORD_SIZE + 1);
    bitset->words = malloc(sizeof(*bitset->words) * bitset->n_words);
    bitset_clear_all(bitset);

    return bitset;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %r15d
movl $0x10, %edi
callq 0x1160
movq %rax, %rbx
leal 0x1f(%r15), %eax
testl %r15d, %r15d
cmovnsl %r15d, %eax
sarl $0x5, %eax
leal 0x1(%rax), %ecx
movl %ecx, 0x8(%rbx)
cltq
leaq 0x4(,%rax,4), %r14
movq %r14, %rdi
callq 0x1160
movq %rax, (%rbx)
cmpl $-0x1f, %r15d
jl 0x2fbe
movq %rax, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x10e0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/print.c
// Function: fst_print
void fst_print(const struct _fst * fst) {
    struct _state state;
    struct _arc arc;

    state_t s;
    arc_t   a;
    
    struct _queue *finals = queue_create(sizeof(state_t));
    
    for(s=0; s < fst->n_states; ++s) {
        state = fst->states[s];
        for(a=0; a < state.n_arcs; ++a) {
            arc = state.arcs[a];

            printf("%"PRIu32"\t%"PRIu32"\t%"PRIu32"\t%"PRIu32"\t%.5f\n",
                s,
                arc.state,
                arc.ilabel,
                arc.olabel,
                arc.weight);
        }

        if(state.final == 1) {
            queue_enque(finals, &s);
        }
    }

    while(queue_deque(finals, &s) != NULL) {
        state = fst->states[s];
        printf("%"PRIu32"\t%f\n", s, state.weight);
    }

    queue_remove(finals);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl $0x4, %edi
callq 0x2df0
movq %rax, %r14
movl $0x0, -0x2c(%rbp)
cmpl $0x0, 0x4(%rbx)
je 0x320f
xorl %eax, %eax
leaq 0x30f0(%rip), %r12      # 0x627f
movq %rbx, -0x40(%rbp)
movq %r14, -0x38(%rbp)
movq 0x10(%rbx), %rcx
movl %eax, %eax
leaq (%rax,%rax,2), %rax
movl (%rcx,%rax,8), %r15d
movl 0xc(%rcx,%rax,8), %r13d
testq %r15, %r15
je 0x31e8
movq 0x10(%rcx,%rax,8), %r14
shlq $0x4, %r15
xorl %ebx, %ebx
movl (%r14,%rbx), %edx
movl 0x8(%r14,%rbx), %ecx
movl 0xc(%r14,%rbx), %r8d
movl -0x2c(%rbp), %esi
xorps %xmm0, %xmm0
cvtss2sd 0x4(%r14,%rbx), %xmm0
movq %r12, %rdi
movb $0x1, %al
callq 0x10b0
addq $0x10, %rbx
cmpq %rbx, %r15
jne 0x31ba
cmpl $0x1, %r13d
movq -0x38(%rbp), %r14
jne 0x31fe
movq %r14, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2e1c
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
movq -0x40(%rbp), %rbx
cmpl 0x4(%rbx), %eax
jb 0x3197
leaq -0x2c(%rbp), %rsi
movq %r14, %rdi
callq 0x2ea0
testq %rax, %rax
je 0x3259
leaq 0x306a(%rip), %r15      # 0x6291
leaq -0x2c(%rbp), %r12
movq 0x10(%rbx), %rax
movl -0x2c(%rbp), %esi
leaq (%rsi,%rsi,2), %rcx
xorps %xmm0, %xmm0
cvtss2sd 0x8(%rax,%rcx,8), %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x10b0
movq %r14, %rdi
movq %r12, %rsi
callq 0x2ea0
testq %rax, %rax
jne 0x322b
movq %r14, %rdi
callq 0x2f4a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/print.c
// Function: trt
static char * trt(struct _symt * st, size_t id, char * token) {
    char * t = symt_get(st, id);
    if (t == NULL) {
        token = NULL;
        fprintf(stderr, "Unknown token: %s\n", token);
    } else {
        strcpy(token, t);
    }
    return token;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdx, %rbx
callq 0x2d52
testq %rax, %rax
je 0x34dd
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1050
callq 0x128f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/draw.c
// Function: fst_draw
int fst_draw(const struct _fst * fst, FILE * fout) {
    struct _state * state;
    struct _arc * arc;

    fprintf(fout, "%s", header);

    for(state_t s=0; s < fst->n_states; ++s) {
        state = &fst->states[s];

        if (!state->final) {
            fprintf(fout, "\t%"PRIu32" [label = \"%"PRIu32"\", shape = circle, style = %s ];\n", 
                s, s, s == fst->start ? "filled" : "solid");
        } else { 
            fprintf(fout, "\t%"PRIu32" [label = \"%"PRIu32"\", shape = doublecircle, style = filled ];\n", 
                s, s);
        }

        for(arc_t a=0; a < state->n_arcs; ++a) {
            arc = &state->arcs[a];
            fprintf(fout,
                "\t\t%"PRIu32" -> %"PRIu32" [ label = \"%"PRIu32":%"PRIu32"/%g\" ];\n",
                s, arc->state, 
                arc->ilabel, arc->olabel, 
                arc->weight);
        } 
    }

    fprintf(fout, "%s", footer);

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r12
leaq 0x2ed8(%rip), %rdi      # 0x63e2
callq 0x10d0
movq %rbx, %rsi
cmpl $0x0, 0x4(%r12)
je 0x35fa
xorl %ebx, %ebx
movq %r12, -0x38(%rbp)
movq %rsi, -0x30(%rbp)
movq 0x10(%r12), %r13
leaq (%rbx,%rbx,2), %r14
cmpl $0x0, 0xc(%r13,%r14,8)
je 0x3553
movq %rsi, %rdi
leaq 0x2dad(%rip), %rsi      # 0x62f0
movl %ebx, %edx
movq %rbx, %r15
movl %ebx, %ecx
xorl %eax, %eax
callq 0x1130
jmp 0x3584
movl (%r12), %eax
cmpq %rax, %rbx
leaq 0x2d89(%rip), %r8       # 0x62ea
leaq 0x2d7b(%rip), %rax      # 0x62e3
cmoveq %rax, %r8
movq %rsi, %rdi
leaq 0x2d3b(%rip), %rsi      # 0x62b1
movl %ebx, %edx
movq %rbx, %r15
movl %ebx, %ecx
xorl %eax, %eax
callq 0x1130
leaq (%r13,%r14,8), %r13
cmpl $0x0, (%r13)
movq -0x30(%rbp), %rsi
movq %r15, %rbx
je 0x35e5
movl $0xc, %r14d
xorl %r12d, %r12d
movq 0x10(%r13), %rax
movl -0xc(%rax,%r14), %ecx
movl -0x4(%rax,%r14), %r8d
movl (%rax,%r14), %r9d
xorps %xmm0, %xmm0
cvtss2sd -0x8(%rax,%r14), %xmm0
movq %rsi, %r15
movq %rsi, %rdi
leaq 0x2d63(%rip), %rsi      # 0x632c
movl %ebx, %edx
movb $0x1, %al
callq 0x1130
movq %r15, %rsi
incq %r12
movl (%r13), %eax
addq $0x10, %r14
cmpq %rax, %r12
jb 0x35a0
incq %rbx
movq -0x38(%rbp), %r12
movl 0x4(%r12), %eax
cmpq %rax, %rbx
jb 0x3528
leaq 0x2e17(%rip), %rdi      # 0x6418
callq 0x10d0
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/shortest.c
// Function: states_cmp
static int states_cmp(const void * a, const void * b) {
    return W[*(state_t*)a] == sr.sum(
                    W[*(state_t*)a],
                    W[*(state_t*)b]
    ) ? 1:0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0x50e3(%rip), %rax      # 0x9120
movl (%rdi), %ecx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x4(%rbp)
movl (%rsi), %ecx
movss (%rax,%rcx,4), %xmm1
callq *0x50b2(%rip)           # 0x9108
cmpeqss -0x4(%rbp), %xmm0
movd %xmm0, %eax
andl $0x1, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/match.c
// Function: match_unsorted
void match_unsorted(
                struct _arc * a,
                struct _arc * b,
                arc_t M,
                arc_t N,
                struct _queue * q) 
{
    struct _match_item mi;

    for (arc_t i = 0; i < M; ++i)
        for (arc_t j = 0; j < N; ++j)
            if ( a[i].olabel == b[j].ilabel && _match(a, b, i, j)) {
                mi.a = a[i];
                mi.b = b[j];
                queue_enque(q, &mi);
            }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %r8, -0x50(%rbp)
movl %ecx, -0x2c(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, -0x40(%rbp)
testl %edx, %edx
je 0x4135
movl %edx, %eax
movq %rax, -0x48(%rbp)
movl -0x2c(%rbp), %r14d
addq $0x8, -0x38(%rbp)
xorl %r12d, %r12d
cmpl $0x0, -0x2c(%rbp)
je 0x412c
movq %r12, %r15
shlq $0x4, %r15
addq -0x40(%rbp), %r15
movq -0x38(%rbp), %r13
xorl %ebx, %ebx
movl 0xc(%r15), %eax
cmpl (%r13), %eax
jne 0x4120
testl %eax, %eax
jne 0x40fd
testq %r12, %r12
setne %al
testq %rbx, %rbx
setne %cl
testb %cl, %al
jne 0x4120
movl %ebx, %eax
orl %r12d, %eax
testq %rax, %rax
je 0x4120
leaq -0x8(%r13), %rax
movups (%r15), %xmm0
movaps %xmm0, -0x70(%rbp)
movups (%rax), %xmm0
leaq -0x60(%rbp), %rax
movups %xmm0, (%rax)
movq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2e1c
incq %rbx
addq $0x10, %r13
cmpq %rbx, %r14
jne 0x40d5
incq %r12
cmpq -0x48(%rbp), %r12
jne 0x40be
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/match.c
// Function: match_half_sorted_rev
void match_half_sorted_rev(
                struct _arc * a,
                struct _arc * b,
                arc_t M,
                arc_t N,
                struct _queue * q) 
{
    arc_t l, h, ll, hh;
    arc_t i,m;

    struct _match_item mi;

    for (i=0; i < N; ++i) {
        l = 0;
        h = M-1;
        while ( l <= h ) {
            m = (l + h) >> 1;
            if (b[i].ilabel > a[m].olabel) l = m + 1; 
            else  
                if (b[i].ilabel < a[m].olabel) {
                    if (m == 0) break;  // sentinel for unsigned index h
                    h = m - 1;
                }
                else {
                    ll = hh = m;
                    
                    while ((ll > l) && (b[i].ilabel == a[ll-1].olabel)) --ll;
                    while ((hh < h) && (b[i].ilabel == a[hh+1].olabel)) ++hh;

                    while (ll <= hh ) {
                        mi.a = a[ll];
                        mi.b = b[i]; 
                        if (_match(a, b, ll, i))
                            queue_enque(q, &mi);
                        ++ll;
                    }
                    break;
                }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %r8, -0x58(%rbp)
movl %edx, -0x2c(%rbp)
movq %rsi, -0x50(%rbp)
testl %ecx, %ecx
je 0x43ff
movq %rdi, %r12
decl -0x2c(%rbp)
movl %ecx, %eax
movq %rax, -0x48(%rbp)
leaq -0x4(%rdi), %rax
movq %rax, -0x38(%rbp)
leaq 0x1c(%rdi), %rax
movq %rax, -0x40(%rbp)
xorl %r13d, %r13d
movq %r13, %rax
shlq $0x4, %rax
movq -0x50(%rbp), %rcx
leaq (%rcx,%rax), %r15
movl 0x8(%rcx,%rax), %eax
xorl %esi, %esi
movl -0x2c(%rbp), %ecx
leal (%rsi,%rcx), %edi
movl %edi, %edx
shrl %edx
movq %rdx, %r8
shlq $0x4, %r8
cmpl 0xc(%r12,%r8), %eax
jbe 0x432c
incl %edx
movl %edx, %esi
jmp 0x433b
jae 0x4344
cmpl $0x2, %edi
jb 0x43f2
decl %edx
movl %edx, %ecx
cmpl %ecx, %esi
jbe 0x4311
jmp 0x43f2
movl %edx, %r14d
cmpl %esi, %edx
jbe 0x436c
movq %rdx, %rdi
shlq $0x4, %rdi
addq -0x38(%rbp), %rdi
movl %edx, %r14d
cmpl (%rdi), %eax
jne 0x436c
decl %r14d
addq $-0x10, %rdi
cmpl %r14d, %esi
jb 0x4359
movl %esi, %r14d
cmpl %edx, %ecx
cmovbel %edx, %ecx
leal (%rcx,%rdx), %esi
subl %edx, %esi
negl %ecx
movl %edx, %ebx
decl %ebx
shlq $0x4, %rdx
addq -0x40(%rbp), %rdx
leal (%rcx,%rbx), %edi
cmpl $-0x1, %edi
je 0x439b
incl %ebx
leaq 0x10(%rdx), %rdi
cmpl (%rdx), %eax
movq %rdi, %rdx
je 0x4384
jmp 0x43ed
movl %esi, %ebx
jmp 0x43ed
movl %r14d, %eax
shlq $0x4, %rax
movups (%r12,%rax), %xmm0
movaps %xmm0, -0x80(%rbp)
movups (%r15), %xmm0
leaq -0x70(%rbp), %rcx
movups %xmm0, (%rcx)
cmpl $0x0, 0xc(%r12,%rax)
jne 0x43dd
testq %r13, %r13
setne %al
testl %r14d, %r14d
setne %cl
andb %al, %cl
movl %r14d, %eax
orl %r13d, %eax
sete %al
orb %cl, %al
jne 0x43ea
movq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2e1c
incl %r14d
cmpl %ebx, %r14d
jbe 0x439f
incq %r13
cmpq -0x48(%rbp), %r13
jne 0x42f9
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/match.c
// Function: match_full_sorted
void match_full_sorted(
                struct _arc * a,
                struct _arc * b,
                arc_t M,
                arc_t N,
                struct _queue *   q) 
{
    arc_t i = 0; 
    arc_t j = 0; 
    arc_t t;

    struct _match_item mi;

    while (i < M && j < N) {
        if ( a[i].olabel <  b[j].ilabel ) ++i;
        else
            if ( a[i].olabel > b[j].ilabel ) ++j;
            else {
                for (t=j; a[i].olabel == b[t].ilabel; ++t ) {
                    mi.a = a[i]; 
                    mi.b = b[t]; 
                    if (_match(a, b, i, t))
                        queue_enque(q, &mi);
                }
                ++i;
            }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
testl %edx, %edx
sete %al
testl %ecx, %ecx
sete %sil
orb %al, %sil
jne 0x44f3
movq %r8, %rbx
xorl %r8d, %r8d
xorl %r15d, %r15d
movl %ecx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
movq %rdi, -0x40(%rbp)
movl %r15d, %eax
shlq $0x4, %rax
leaq (%rdi,%rax), %r14
movl 0xc(%rdi,%rax), %eax
movl %r8d, %esi
shlq $0x4, %rsi
cmpl 0x8(%r12,%rsi), %eax
jae 0x446b
incl %r15d
jmp 0x44e5
jbe 0x4472
incl %r8d
jmp 0x44e5
addq %r12, %rsi
movl %r8d, -0x34(%rbp)
movl %r8d, %r13d
movups (%r14), %xmm0
movaps %xmm0, -0x60(%rbp)
movups (%rsi), %xmm0
leaq -0x50(%rbp), %rcx
movups %xmm0, (%rcx)
testl %eax, %eax
jne 0x44af
testl %r15d, %r15d
setne %al
testl %r13d, %r13d
setne %cl
andb %al, %cl
movl %r13d, %eax
orl %r15d, %eax
sete %dl
xorl %eax, %eax
orb %cl, %dl
jne 0x44bf
movq %rbx, %rdi
leaq -0x60(%rbp), %rsi
callq 0x2e1c
movl 0xc(%r14), %eax
incl %r13d
movq %r13, %rdx
shlq $0x4, %rdx
leaq (%r12,%rdx), %rsi
cmpl 0x8(%r12,%rdx), %eax
je 0x447c
incl %r15d
movl -0x30(%rbp), %ecx
movl -0x2c(%rbp), %edx
movq -0x40(%rbp), %rdi
movl -0x34(%rbp), %r8d
cmpl %edx, %r15d
jae 0x44f3
cmpl %ecx, %r8d
jb 0x4449
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/heap.c
// Function: heap_index
struct _hash * heap_index(struct _heap * heap, hash_func hsh, cmp_func hcmp) {
    if (heap->ht != NULL)
        hash_remove(heap->ht);
    
    heap->ht = hash_create( hsh, 
                            hcmp, 
                            heap->item_size,    // key size
                            sizeof(size_t),     // item size
                            heap->n_max         // init size
                        ); 
    
    // lets index all the items 
    for (size_t i = 0;  i < heap->n_items; ++i)
        hash_add(heap->ht, heap->items + i*heap->item_size, &i);
    
    return heap->ht;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
testq %rdi, %rdi
je 0x459e
callq 0x1f40
movq 0x8(%rbx), %r8
movq 0x10(%rbx), %rdx
movl $0x8, %ecx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1c58
movq %rax, 0x28(%rbx)
movq $0x0, -0x20(%rbp)
cmpq $0x0, (%rbx)
je 0x45f7
xorl %esi, %esi
leaq -0x20(%rbp), %r14
movq 0x28(%rbx), %rdi
imulq 0x10(%rbx), %rsi
addq 0x30(%rbx), %rsi
movq %r14, %rdx
callq 0x1d96
movq -0x20(%rbp), %rsi
incq %rsi
movq %rsi, -0x20(%rbp)
cmpq (%rbx), %rsi
jb 0x45ce
movq 0x28(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/heap.c
// Function: heap_remove
void heap_remove(struct _heap * heap) {
    assert( heap != NULL ); 
    assert( heap->items != NULL );

    if (heap->ht != NULL) {
        hash_remove(heap->ht);
    }

    free(heap->items);
    free(heap); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x4641
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
testq %rdi, %rdi
je 0x4660
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x462e
movq %rax, %rdi
callq 0x1f40
movq 0x30(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1030
leaq 0x1e3c(%rip), %rdi      # 0x6484
leaq 0x1e42(%rip), %rsi      # 0x6491
leaq 0x1e46(%rip), %rcx      # 0x649c
movl $0x5f, %edx
callq 0x10c0
leaq 0x1e56(%rip), %rdi      # 0x64bd
leaq 0x1e23(%rip), %rsi      # 0x6491
leaq 0x1e27(%rip), %rcx      # 0x649c
movl $0x60, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/heap.c
// Function: heap_pop
void * heap_pop(struct _heap * heap, void * item) {
    char * items = heap->items;
    size_t s = heap->item_size;

    if (heap->n_items == 0)
        return NULL; 

    // get top node 
    memcpy(item, items, s);
    --heap->n_items;

    // if still not empty - move tail to head
    if (heap->n_items > 0) {
        memcpy(items, items + heap->n_items * s, s);
        // index
        size_t i=0;
        if (heap->ht != NULL)  
            hash_add(heap->ht, items, &i);
    }

    // heapify if more than 1
    if (heap->n_items > 1)
        heap_heapify(heap, 0);

    return item;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
cmpq $0x0, (%rdi)
je 0x46fc
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %r12
movq 0x30(%rdi), %r15
movq %rsi, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1150
movq (%r14), %rsi
decq %rsi
movq %rsi, (%r14)
je 0x46fe
imulq %r12, %rsi
addq %r15, %rsi
movq %r15, %rdi
movq %r12, %rdx
callq 0x1150
movq $0x0, -0x28(%rbp)
movq 0x28(%r14), %rdi
testq %rdi, %rdi
je 0x46ea
leaq -0x28(%rbp), %rdx
movq %r15, %rsi
callq 0x1d96
cmpq $0x2, (%r14)
jb 0x46fe
movq %r14, %rdi
xorl %esi, %esi
callq 0x470e
jmp 0x46fe
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/heap.c
// Function: heap_heapify
void heap_heapify(struct _heap * heap, size_t i) {
    char * items = heap->items;
    size_t s = heap->item_size;

    size_t l, r, mx;
    int done = 0;

    assert( i < heap->n_items );

    while (!done) {
        l = HEAP_LEFT(i);
        r = HEAP_RIGHT(i);

        mx = ( l < heap->n_items && heap->cmp(items + l*s, items + i*s)) 
            ?  l : i;  
        mx = ( r < heap->n_items && heap->cmp(items + r*s, items + mx*s)) 
            ? r : mx;
        
        if (mx != i) {
            heap_items_swap(heap, i, mx);
            i = mx;
        } else {
            done=1;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rsi, (%rdi)
jbe 0x47bc
movq %rsi, %r14
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq %rax, -0x30(%rbp)
movq 0x10(%rdi), %r13
leaq 0x1(,%r14,2), %r12
cmpq (%rbx), %r12
jae 0x4763
movq %r12, %rdi
imulq %r13, %rdi
movq -0x30(%rbp), %rax
addq %rax, %rdi
movq %r14, %rsi
imulq %r13, %rsi
addq %rax, %rsi
callq *0x20(%rbx)
testl %eax, %eax
jne 0x4766
movq %r14, %r12
leaq 0x2(,%r14,2), %r15
cmpq (%rbx), %r15
jae 0x4792
movq %r15, %rdi
imulq %r13, %rdi
movq -0x30(%rbp), %rax
addq %rax, %rdi
movq %r12, %rsi
imulq %r13, %rsi
addq %rax, %rsi
callq *0x20(%rbx)
testl %eax, %eax
jne 0x4795
movq %r12, %r15
cmpq %r14, %r15
je 0x47ad
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x47db
movq %r15, %r14
jmp 0x4737
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d0e(%rip), %rdi      # 0x64d1
leaq 0x1cc7(%rip), %rsi      # 0x6491
leaq 0x1d12(%rip), %rcx      # 0x64e3
movl $0x97, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/heap.c
// Function: heap_items_swap
static void heap_items_swap(struct _heap * heap, size_t i, size_t j) {
    char * items = heap->items;
    size_t s = heap->item_size;
    char * tmp = malloc(s);

    memcpy(tmp, items + i*s, s);
    memcpy(items + i*s, items + j*s, s);
    memcpy(items + j*s, tmp, s);

    // index
    if (heap->ht != NULL) {
        hash_add(heap->ht, items + i*s, &i);
        hash_add(heap->ht, items + j*s, &j);
    }
    
    free(tmp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r12
movq %rdi, %r15
movq %rsi, -0x40(%rbp)
movq %rdx, -0x38(%rbp)
movq 0x10(%rdi), %r13
movq 0x30(%rdi), %r14
movq %r14, -0x30(%rbp)
movq %r13, %rdi
callq 0x1160
imulq %r13, %r12
addq %r14, %r12
movq %rax, %rdi
movq %rax, %r14
movq %r12, %rsi
movq %r13, %rdx
callq 0x1150
imulq %r13, %rbx
addq -0x30(%rbp), %rbx
movq %r12, %rdi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x1150
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x1150
movq 0x28(%r15), %rdi
testq %rdi, %rdi
je 0x4872
leaq -0x40(%rbp), %rdx
movq %r12, %rsi
callq 0x1d96
movq 0x28(%r15), %rdi
leaq -0x38(%rbp), %rdx
movq %rbx, %rsi
callq 0x1d96
movq %r14, %rdi
callq 0x1030
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/heap.c
// Function: heap_insert
void heap_insert(struct _heap * heap, void * item) {
    size_t s = heap->item_size;

    if (heap->limit == 0 && heap->n_max == heap->n_items) {
        heap->n_max *= HEAP_RESIZE_FACTOR;
        heap->items = realloc(heap->items, heap->n_max * s);
    }

    // move to tail
    memcpy(heap->items + heap->n_items * s, item, s);

    // index
    if (heap->ht != NULL) 
        hash_add(heap->ht, item, &heap->n_items);

    /* 

    A little trick here:
    we invoke heap_update with NULL to specify
    that we don't need an assignment and value check.

    */

    if (heap->limit == 0 || heap->n_items < heap->limit) {
        heap_update(heap, NULL, heap->n_items++);
    } else {
        heap_delete_max(heap);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq (%rdi), %rsi
movq 0x10(%rdi), %r15
cmpq $0x0, 0x18(%rdi)
movq %rdi, -0x30(%rbp)
jne 0x48d4
cmpq %rsi, 0x8(%rdi)
jne 0x48d4
addq %rsi, %rsi
movq %rsi, 0x8(%rdi)
movq 0x30(%rdi), %rdi
imulq %r15, %rsi
callq 0x1180
movq -0x30(%rbp), %rdi
movq %rax, 0x30(%rdi)
movq (%rdi), %rsi
imulq %r15, %rsi
addq 0x30(%rdi), %rsi
movq %rsi, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1150
movq -0x30(%rbp), %r8
movq 0x28(%r8), %rdi
testq %rdi, %rdi
je 0x4906
movq %r14, %rsi
movq %r8, %rdx
callq 0x1d96
movq -0x30(%rbp), %r8
movq (%r8), %rdx
movq 0x18(%r8), %rax
decq %rax
cmpq %rdx, %rax
jae 0x496e
movq 0x10(%r8), %r15
movq 0x30(%r8), %rax
cmpq $-0x1, %rdx
je 0x498f
leaq (%rax,%r15), %r12
movl $0x1, %r14d
xorl %ebx, %ebx
movq %rbx, %rdi
imulq %r15, %rdi
movq %rax, %r13
addq %rax, %rdi
movq %r12, %rsi
callq *0x20(%r8)
testl %eax, %eax
je 0x494a
movq %r14, %rbx
incq %r14
movq -0x30(%rbp), %r8
movq (%r8), %rsi
leaq 0x1(%rsi), %rax
addq %r15, %r12
cmpq %rax, %r14
movq %r13, %rax
jb 0x492f
movq %rbx, -0x38(%rbp)
cmpq %rsi, %rbx
jne 0x49a0
jmp 0x49ec
movq %rdx, %rax
incq %rax
movq %rax, (%r8)
movq %r8, %rdi
xorl %esi, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x49fb
movq $0x0, -0x38(%rbp)
movq $-0x1, %rsi
xorl %ebx, %ebx
movq %rbx, %r12
imulq %r15, %r12
addq %rax, %r12
imulq %r15, %rsi
addq %rax, %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x1150
movq -0x30(%rbp), %rax
movq 0x28(%rax), %rdi
testq %rdi, %rdi
je 0x49df
leaq -0x38(%rbp), %r14
movq %r12, %rsi
movq %r14, %rdx
callq 0x1d96
movq -0x30(%rbp), %rax
movq (%r14), %rbx
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x49fb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/heap.c
// Function: heap_update
void heap_update(struct _heap * heap, void * item, size_t i) { 
    char * items = heap->items;
    size_t s = heap->item_size;
    size_t j;
    
    // remove assertion for equality
    assert ( i < heap->n_items );

    if (item != NULL) {  // if invoked directly
        // check if we reducing the priority and 
        // not increasing it
        assert( heap->cmp(item, items + i*s) );
        memcpy(items + i*s, item, s);

        // index
        if (heap->ht != NULL) 
            hash_add(heap->ht, item, &i);
    }

    while (i > 0 && heap->cmp(items + i*s, items + HEAP_PARENT(i)*s)) {
        j = HEAP_PARENT(i);
        heap_items_swap(heap, i, j);

        i = j;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, -0x30(%rbp)
cmpq %rdx, (%rdi)
jbe 0x4ace
movq %rdx, %r15
movq %rdi, %rbx
movq 0x30(%rdi), %r12
movq 0x10(%rdi), %r14
testq %rsi, %rsi
je 0x4a76
movq %r14, %r13
imulq %r15, %r13
addq %r12, %r13
movq %rsi, -0x38(%rbp)
movq %rsi, %rdi
movq %r13, %rsi
callq *0x20(%rbx)
testl %eax, %eax
je 0x4aed
movq %r13, %rdi
movq -0x38(%rbp), %rsi
movq %r14, %rdx
callq 0x1150
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x4a76
leaq -0x30(%rbp), %r15
movq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0x1d96
movq (%r15), %r15
testq %r15, %r15
je 0x4abf
movq %r15, %rdi
imulq %r14, %rdi
addq %r12, %rdi
incq %r15
shrq %r15
decq %r15
imulq %r14, %r15
addq %r12, %r15
movq %r15, %rsi
callq *0x20(%rbx)
testl %eax, %eax
je 0x4abf
movq -0x30(%rbp), %rsi
leaq 0x1(%rsi), %r15
shrq %r15
leaq -0x1(%r15), %rdx
movq %rbx, %rdi
callq 0x47db
decq %r15
movq %r15, -0x30(%rbp)
jne 0x4a7b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x19fc(%rip), %rdi      # 0x64d1
leaq 0x19b5(%rip), %rsi      # 0x6491
leaq 0x1a2a(%rip), %rcx      # 0x650d
movl $0xee, %edx
callq 0x10c0
leaq 0x1a4a(%rip), %rdi      # 0x653e
leaq 0x1996(%rip), %rsi      # 0x6491
leaq 0x1a0b(%rip), %rcx      # 0x650d
movl $0xf3, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/iter.c
// Function: fst_iter_create
struct _fst_iter * fst_iter_create(const struct _fst * fst) {
    struct _fst_iter * iter;
    iter = malloc(sizeof(struct _fst_iter));
    iter->fst = fst;
    iter->state = fst->start;
    iter->marked = bitset_create(fst->n_states);
    iter->queue = queue_create(sizeof(state_t));

    queue_enque(iter->queue, &iter->state);
    bitset_set(iter->marked, iter->state);

    return iter;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x20, %edi
callq 0x1160
movq %rax, %rbx
movq %r14, (%rax)
movl (%r14), %eax
leaq 0x18(%rbx), %r15
movl %eax, 0x18(%rbx)
movl 0x4(%r14), %edi
callq 0x2f68
movq %rax, 0x8(%rbx)
movl $0x4, %edi
callq 0x2df0
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movq %r15, %rsi
callq 0x2e1c
movq 0x8(%rbx), %rdi
movl 0x18(%rbx), %esi
callq 0x300f
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/iter.c
// Function: fst_iter_remove
void fst_iter_remove(struct _fst_iter * iter) {
    bitset_remove(iter->marked); 
    queue_remove(iter->queue);
    iter->fst = NULL;
    free(iter);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2ff0
movq 0x10(%rbx), %rdi
callq 0x2f4a
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/iter.c
// Function: fst_iter_next
state_t fst_iter_next(struct _fst_iter * iter) {
    struct _arc * arc;
    struct _state * state;
    state_t s;
    arc_t a;
    
    if((queue_deque(iter->queue, &s)) != NULL) {
        iter->state = s; 
        state = &iter->fst->states[s]; 
        for(a=0; a < state->n_arcs; ++a) {
            arc = &state->arcs[a];
            if (bitset_get(iter->marked, arc->state) == 0) {
                queue_enque(iter->queue, &arc->state);
                bitset_set(iter->marked, arc->state);
            }
        }
    } else {
        iter->state = -1;
    }

    return iter->state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2ea0
testq %rax, %rax
je 0x4c54
movl -0x2c(%rbp), %eax
movl %eax, 0x18(%rbx)
movq (%rbx), %rcx
movq 0x10(%rcx), %rcx
leaq (%rax,%rax,2), %rdx
cmpl $0x0, (%rcx,%rdx,8)
je 0x4c60
leaq (%rcx,%rdx,8), %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%r15), %r14
movq 0x8(%rbx), %rdi
movl (%r14,%r12), %esi
callq 0x3055
testl %eax, %eax
jne 0x4c40
addq %r12, %r14
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x2e1c
movq 0x8(%rbx), %rdi
movl (%r14), %esi
callq 0x300f
incq %r13
movl (%r15), %eax
addq $0x10, %r12
cmpq %rax, %r13
jb 0x4c10
movl 0x18(%rbx), %eax
jmp 0x4c60
movl $0xffffffff, 0x18(%rbx) # imm = 0xFFFFFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/test.c
// Function: assert_arc_equal
void assert_arc_equal(const struct _arc * arc_a, const struct _arc * arc_b) {
    assert ( arc_a->state == arc_b->state ); 
    assert ( arc_a->ilabel == arc_b->ilabel ); 
    assert ( arc_a->olabel == arc_b->olabel ); 
    assert ( arc_a->weight == arc_b->weight ); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0x4ca9
movl 0x8(%rdi), %eax
cmpl 0x8(%rsi), %eax
jne 0x4cc8
movl 0xc(%rdi), %eax
cmpl 0xc(%rsi), %eax
jne 0x4ce7
movss 0x4(%rdi), %xmm0
ucomiss 0x4(%rsi), %xmm0
jne 0x4d06
jp 0x4d06
popq %rbp
retq
leaq 0x18ee(%rip), %rdi      # 0x659e
leaq 0x1904(%rip), %rsi      # 0x65bb
leaq 0x1908(%rip), %rcx      # 0x65c6
movl $0x7, %edx
callq 0x10c0
leaq 0x1937(%rip), %rdi      # 0x6606
leaq 0x18e5(%rip), %rsi      # 0x65bb
leaq 0x18e9(%rip), %rcx      # 0x65c6
movl $0x8, %edx
callq 0x10c0
leaq 0x1937(%rip), %rdi      # 0x6625
leaq 0x18c6(%rip), %rsi      # 0x65bb
leaq 0x18ca(%rip), %rcx      # 0x65c6
movl $0x9, %edx
callq 0x10c0
leaq 0x1937(%rip), %rdi      # 0x6644
leaq 0x18a7(%rip), %rsi      # 0x65bb
leaq 0x18ab(%rip), %rcx      # 0x65c6
movl $0xa, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/test.c
// Function: assert_fst_equal
void assert_fst_equal(const struct _fst * a, const struct _fst * b) {
    struct _state * state_a; 
    struct _state * state_b; 

    struct _arc * arc_a; 
    struct _arc * arc_b; 

    assert (a->start ==     b->start);
    assert (a->sr_type ==   b->sr_type);
    assert (a->n_states ==  b->n_states);
    
    for (state_t st = 0; st < a->n_states && st < b->n_states; ++st) {

        state_a = &a->states[st];
        state_b = &b->states[st];
        
        assert( state_a->n_arcs == state_b->n_arcs );
        assert_state_equal( state_a, state_b );

        for (arc_t arc = 0; 
                    arc < state_a->n_arcs && arc < state_b->n_arcs; 
                    ++arc) {
            arc_a = &state_a->arcs[arc];
            arc_b = &state_b->arcs[arc];

            assert_arc_equal( arc_a, arc_b );
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0x4e62
movb 0xc(%rdi), %al
cmpb 0xc(%rsi), %al
jne 0x4e81
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
jne 0x4ea0
testl %eax, %eax
je 0x4e15
xorl %r15d, %r15d
movq %rsi, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
cmpl 0x4(%rsi), %r15d
jae 0x4e15
movq 0x10(%rdi), %r12
movl %r15d, %ecx
shlq $0x3, %rcx
leaq (%rcx,%rcx,2), %rdx
movq 0x10(%rsi), %r13
movl (%r12,%rdx), %ecx
cmpl (%r13,%rdx), %ecx
jne 0x4e24
addq %rdx, %r12
addq %rdx, %r13
movl 0xc(%r12), %edx
cmpl 0xc(%r13), %edx
jne 0x4e43
testl %ecx, %ecx
je 0x4e0d
xorl %r14d, %r14d
xorl %ebx, %ebx
movl (%r13), %eax
cmpq %rax, %rbx
jae 0x4e02
movq 0x10(%r12), %rdi
addq %r14, %rdi
movq 0x10(%r13), %rsi
addq %r14, %rsi
callq 0x4c80
incq %rbx
movl (%r12), %eax
addq $0x10, %r14
cmpq %rax, %rbx
jb 0x4dd5
movq -0x30(%rbp), %rdi
movl 0x4(%rdi), %eax
movq -0x38(%rbp), %rsi
incl %r15d
cmpl %eax, %r15d
jb 0x4d97
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1928(%rip), %rdi      # 0x6753
leaq 0x1789(%rip), %rsi      # 0x65bb
leaq 0x18a6(%rip), %rcx      # 0x66df
movl $0x23, %edx
callq 0x10c0
leaq 0x1819(%rip), %rdi      # 0x6663
leaq 0x176a(%rip), %rsi      # 0x65bb
leaq 0x182c(%rip), %rcx      # 0x6684
movl $0x10, %edx
callq 0x10c0
leaq 0x1861(%rip), %rdi      # 0x66ca
leaq 0x174b(%rip), %rsi      # 0x65bb
leaq 0x1868(%rip), %rcx      # 0x66df
movl $0x1a, %edx
callq 0x10c0
leaq 0x1897(%rip), %rdi      # 0x671f
leaq 0x172c(%rip), %rsi      # 0x65bb
leaq 0x1849(%rip), %rcx      # 0x66df
movl $0x1b, %edx
callq 0x10c0
leaq 0x1891(%rip), %rdi      # 0x6738
leaq 0x170d(%rip), %rsi      # 0x65bb
leaq 0x182a(%rip), %rcx      # 0x66df
movl $0x1c, %edx
callq 0x10c0
nop
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/trim.c
// Function: fst_close
void fst_close(struct _fst * fst, struct _queue * finals) {
    /*
    This methods replace multiple final states with
    a single final state. 

    */
    if ( finals->n_items < 2)
        return;    

    struct _state * state;
    struct _sr sr = sr_get(fst->sr_type); 
    state_t final;
    state_t s;

    final = fst_add_state(fst);
    fst_set_final(fst, final, sr.one);


    while(queue_deque(finals, &s) != NULL) {
        state = &fst->states[s];
        state->final = 0;
        fst_add_arc(    fst,
                        s,
                        final,
                        EPS,
                        EPS,
                        state->weight);
    }
}

// Assembly:
cmpq $0x2, 0x18(%rsi)
jb 0x4f69
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0xc(%rdi), %esi
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x20d4
movq %r14, %rdi
callq 0x212d
movl %eax, %r15d
movss 0x14(%r12), %xmm0
movq %r14, %rdi
movl %eax, %esi
callq 0x22a0
leaq -0x24(%rbp), %rsi
movq %rbx, %rdi
callq 0x2ea0
testq %rax, %rax
je 0x4f5d
leaq -0x24(%rbp), %r12
movq 0x10(%r14), %rax
movl -0x24(%rbp), %ecx
leaq (%rcx,%rcx,2), %rcx
movl $0x0, 0xc(%rax,%rcx,8)
movl -0x24(%rbp), %esi
movss 0x8(%rax,%rcx,8), %xmm0
movq %r14, %rdi
movl %r15d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2189
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2ea0
testq %rax, %rax
jne 0x4f21
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/trim.c
// Function: fst_reverse
void fst_reverse(struct _fst * fst) {
    struct _sr sr = sr_get(fst->sr_type); 
    struct _state * state;
    struct _arc * arc;
    struct _fst * orig = fst_create();
    state_t s;
    state_t start_s = fst->start;

    fst_copy(fst, orig);

    for(s=0; s < fst->n_states; ++s ) {
        state = &fst->states[s];

        // 'delete' arcs from each of the automaton states
        state->n_arcs = 0;
       
        // change start to final 
        // NOTE: fst should have only 1 start state
        if (state->final) {
            fst->start = s;
            state->final = 0;
        }
    }

    // set start as final
    fst_set_final(fst, start_s, sr.one);

    // add reversed arcs to the automaton
    for(s=0; s < orig->n_states; ++s) {
        state = &orig->states[s];         

        for(arc_t a=0; a < state->n_arcs; ++a) { 
            arc = &state->arcs[a];
            fst_add_arc(    fst, 
                            arc->state, 
                            s, 
                            arc->ilabel, 
                            arc->olabel, 
                            arc->weight);
        }
    }

    fst_remove(orig);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movzbl 0xc(%rdi), %esi
leaq -0x48(%rbp), %rdi
callq 0x20d4
xorl %eax, %eax
callq 0x2110
movq %rax, %r14
movl (%rbx), %r15d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x271d
movl 0x4(%rbx), %eax
testq %rax, %rax
je 0x4fd5
movq 0x10(%rbx), %rcx
addq $0xc, %rcx
xorl %edx, %edx
movl $0x0, -0xc(%rcx)
cmpl $0x0, (%rcx)
je 0x4fc9
movl %edx, (%rbx)
movl $0x0, (%rcx)
incq %rdx
addq $0x18, %rcx
cmpq %rdx, %rax
jne 0x4fb5
movss -0x34(%rbp), %xmm0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x22a0
movl 0x4(%r14), %eax
testl %eax, %eax
je 0x5056
xorl %r15d, %r15d
movq %r14, -0x30(%rbp)
movq 0x10(%r14), %rcx
leaq (%r15,%r15,2), %rdx
cmpl $0x0, (%rcx,%rdx,8)
je 0x504c
leaq (%rcx,%rdx,8), %r12
movl $0xc, %r13d
xorl %r14d, %r14d
movq 0x10(%r12), %rax
movl -0xc(%rax,%r13), %esi
movl -0x4(%rax,%r13), %ecx
movl (%rax,%r13), %r8d
movss -0x8(%rax,%r13), %xmm0
movq %rbx, %rdi
movl %r15d, %edx
callq 0x2189
incq %r14
movl (%r12), %eax
addq $0x10, %r13
cmpq %rax, %r14
jb 0x500f
movq -0x30(%rbp), %r14
movl 0x4(%r14), %eax
incq %r15
movl %eax, %ecx
cmpq %rcx, %r15
jb 0x4ff4
movq %r14, %rdi
callq 0x221b
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/trim.c
// Function: fst_rm_states
struct _fst * fst_rm_states(struct _fst * fst, struct _bitset * mask) {
    struct _state * state;
    struct _arc * arc;

    state_t idx[sizeof(state_t) * fst->n_states];

    state_t shift = 0;

    for(state_t s=0; s < fst->n_states; ++s) {
        if (bitset_get(mask, s) ) {
            ++shift;
        }
        else {
            idx[s] = shift;
            fst->states[s - shift] = fst->states[s];
        }
    } 

    fst->n_states -= shift;

    // TODO: do not forget to clean up arcs of removed states

    // fix arc's destination state id
    for(state_t s=0; s < fst->n_states; ++s) {
        state = &fst->states[s];

        arc_t sh = 0;
        
        for(arc_t a=0; a < state->n_arcs; ++a) {
            arc = &state->arcs[a];
            arc->state -= idx[arc->state];

            // found link to non-existing state
            if (arc->state >= fst->n_states) {
                ++sh;
            } else {
                state->arcs[a - sh] = state->arcs[a];
            }
        }
        
        state->n_arcs -= sh;
    }

    return fst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
movl 0x4(%rdi), %eax
movq %rsp, %r12
movq %rax, %rcx
shlq $0x4, %rcx
subq %rcx, %r12
movq %r12, %rsp
testq %rax, %rax
je 0x516f
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %r14d, %r14d
movq -0x30(%rbp), %rdi
movl %r15d, %esi
callq 0x3055
testl %eax, %eax
je 0x50bc
incl %r14d
jmp 0x50e1
movl %r14d, (%r12,%r15,4)
movq 0x10(%rbx), %rax
movl %r15d, %ecx
subl %r14d, %ecx
leaq (%rcx,%rcx,2), %rcx
movq 0x10(%rax,%r13), %rdx
movq %rdx, 0x10(%rax,%rcx,8)
movups (%rax,%r13), %xmm0
movups %xmm0, (%rax,%rcx,8)
incq %r15
movl 0x4(%rbx), %esi
addq $0x18, %r13
cmpq %rsi, %r15
jb 0x50a7
subl %r14d, %esi
movl %esi, 0x4(%rbx)
je 0x516f
xorl %eax, %eax
movq 0x10(%rbx), %rcx
leaq (%rax,%rax,2), %rdx
leaq (%rcx,%rdx,8), %rcx
movl (%rcx), %edx
movl $0x0, %edi
testl %edx, %edx
je 0x5163
xorl %esi, %esi
xorl %r8d, %r8d
xorl %edi, %edi
movq 0x10(%rcx), %r9
movl (%r9,%rsi), %r10d
movl (%r12,%r10,4), %r11d
subl %r11d, %r10d
movl %r10d, (%r9,%rsi)
cmpl 0x4(%rbx), %r10d
jae 0x514b
leaq (%r9,%rsi), %rdx
movl %r8d, %r10d
subl %edi, %r10d
shlq $0x4, %r10
movups (%rdx), %xmm0
movups %xmm0, (%r9,%r10)
movl (%rcx), %edx
jmp 0x514d
incl %edi
incq %r8
movl %edx, %r9d
addq $0x10, %rsi
cmpq %r9, %r8
jb 0x5118
movl 0x4(%rbx), %esi
subl %edi, %edx
movl %edx, %edi
movl %edi, (%rcx)
incq %rax
movl %esi, %ecx
cmpq %rcx, %rax
jb 0x50fa
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/c0stya[P]fslib/src/trim.c
// Function: fst_trim
struct _fst * fst_trim(struct _fst * fst) {
    struct _queue * finals = queue_create(sizeof(state_t));

    /*
    Before trimming check that we have at least one final states.
    If not then all the states are not co-accessible and
    there resulting automaton should be empty.
    */

    fst_get_finals(fst, finals);

    if (finals->n_items == 0) {
        fst_empty(fst);
         
    } else { 

        if (finals->n_items > 1) {
            fst_close(fst, finals);
        }

        /* 
        First lets traverse it directly and remove
        all the unreachable states    
        */

        struct _fst_iter * iter = fst_iter_create(fst);
        while ( fst_iter_next(iter) != -1 ) 
            ;
        
        /* 
        Then inverse the arcs and traverse starting
        from the final states of the original transducer
        
        NOTE: we should refresh finals queue
        */

        fst_reverse(fst);

        struct _fst_iter * iter_rev = fst_iter_create(fst);
        while ( fst_iter_next(iter_rev) != -1 ) 
            ;

        /* Reverse it back */
        fst_reverse(fst);

        /* Remove non accessible and non coacessible states */

        bitset_intersect(iter->marked, iter_rev->marked);

        bitset_toggle_all(iter->marked);

        //fst_rm_states(fst, bitset_toggle_all(iter->marked));
        fst_rm_states(fst, iter->marked);


        fst_iter_remove(iter_rev);
        fst_iter_remove(iter);
    }

    queue_remove(finals);

    return fst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl $0x4, %edi
callq 0x2df0
movq %rax, %r14
movl $0x0, -0x24(%rbp)
movl 0x4(%rbx), %eax
testl %eax, %eax
je 0x51df
xorl %ecx, %ecx
leaq -0x24(%rbp), %r15
movq 0x10(%rbx), %rdx
movl %ecx, %esi
leaq (%rsi,%rsi,2), %rsi
cmpl $0x0, 0xc(%rdx,%rsi,8)
je 0x51d6
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e1c
movl -0x24(%rbp), %ecx
movl 0x4(%rbx), %eax
incl %ecx
movl %ecx, -0x24(%rbp)
cmpl %eax, %ecx
jb 0x51b4
movq 0x18(%r14), %rax
cmpq $0x1, %rax
je 0x5200
movq %rbx, %rdi
testq %rax, %rax
jne 0x51f8
callq 0x2237
jmp 0x5273
movq %r14, %rsi
callq 0x4ec0
movq %rbx, %rdi
callq 0x4b3c
movq %rax, %r15
movq %r15, %rdi
callq 0x4bcc
cmpl $-0x1, %eax
jne 0x520b
movq %rbx, %rdi
callq 0x4f6a
movq %rbx, %rdi
callq 0x4b3c
movq %rax, %r12
movq %r12, %rdi
callq 0x4bcc
cmpl $-0x1, %eax
jne 0x522b
movq %rbx, %rdi
callq 0x4f6a
movq 0x8(%r15), %rdi
movq 0x8(%r12), %rsi
callq 0x30e5
movq 0x8(%r15), %rdi
callq 0x3130
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x506d
movq %r12, %rdi
callq 0x4ba3
movq %r15, %rdi
callq 0x4ba3
movq %r14, %rdi
callq 0x2f4a
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/kthread.c
// Function: kt_for
void kt_for(int n_threads, void (*func)(void*,long,int), void *data, long n)
{
	int i;
	kt_for_t t;
	pthread_t *tid;
	t.func = func, t.data = data, t.n_threads = n_threads, t.n = n;
	t.w = (ktf_worker_t*)alloca(n_threads * sizeof(ktf_worker_t));
	tid = (pthread_t*)alloca(n_threads * sizeof(pthread_t));
	for (i = 0; i < n_threads; ++i)
		t.w[i].t = &t, t.w[i].i = i;
	for (i = 0; i < n_threads; ++i) pthread_create(&tid[i], 0, ktf_worker, &t.w[i]);
	for (i = 0; i < n_threads; ++i) pthread_join(tid[i], 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, -0x48(%rbp)
movq %rdx, -0x40(%rbp)
movl %edi, -0x60(%rbp)
movq %rcx, -0x58(%rbp)
movslq %edi, %rcx
movq %rcx, %rdx
shlq $0x4, %rdx
movq %rsp, %rax
subq %rdx, %rax
movq %rax, %rsp
movq %rax, -0x50(%rbp)
movq %rsp, %r15
leaq 0xf(,%rcx,8), %rdx
andq $-0x10, %rdx
subq %rdx, %r15
movq %r15, %rsp
testl %ecx, %ecx
jle 0x2468
movl %edi, %r13d
addq $0x8, %rax
xorl %ecx, %ecx
leaq -0x60(%rbp), %rdx
movq %rdx, -0x8(%rax)
movq %rcx, (%rax)
incq %rcx
addq $0x10, %rax
cmpq %rcx, %r13
jne 0x23f9
testl %edi, %edi
jle 0x2468
movl %edi, -0x2c(%rbp)
movq %r13, %rbx
shlq $0x4, %rbx
xorl %r12d, %r12d
leaq 0x53(%rip), %r14        # 0x2477
movq %r15, -0x38(%rbp)
movq -0x50(%rbp), %rcx
addq %r12, %rcx
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rdx
callq 0x21e0
addq $0x10, %r12
addq $0x8, %r15
cmpq %r12, %rbx
jne 0x2428
cmpl $0x0, -0x2c(%rbp)
movq -0x38(%rbp), %r14
jle 0x2468
xorl %ebx, %ebx
movq (%r14,%rbx,8), %rdi
xorl %esi, %esi
callq 0x2250
incq %rbx
cmpq %rbx, %r13
jne 0x2455
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/DReichLab[P]adna/kthread.c
// Function: ktf_worker
static void *ktf_worker(void *data)
{
	ktf_worker_t *w = (ktf_worker_t*)data;
	long i;
	for (;;) {
		i = __sync_fetch_and_add(&w->i, w->t->n_threads);
		if (i >= w->t->n) break;
		w->t->func(w->t->data, i, w - w->t->w);
	}
	while ((i = steal_work(w->t)) >= 0)
		w->t->func(w->t->data, i, w - w->t->w);
	pthread_exit(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movslq (%rax), %rsi
lock
xaddq %rsi, 0x8(%rdi)
movq (%rdi), %rax
cmpq 0x8(%rax), %rsi
jge 0x24b7
movq 0x20(%rax), %rdi
movq %rbx, %rdx
subq 0x10(%rax), %rdx
shrq $0x4, %rdx
callq *0x18(%rax)
movq (%rbx), %rax
movslq (%rax), %rsi
lock
xaddq %rsi, 0x8(%rbx)
movq (%rbx), %rax
jmp 0x248e
movabsq $0x7fffffffffffffff, %r14 # imm = 0x7FFFFFFFFFFFFFFF
movq $-0x1, %r15
movslq (%rax), %rsi
movq 0x10(%rax), %rcx
movq $-0x1, %rdx
testq %rsi, %rsi
jle 0x2507
leaq 0x8(%rcx), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
movq %r14, %r9
movq (%rdi), %r10
cmpq %r10, %r9
cmovgl %r8d, %edx
cmovgeq %r10, %r9
incq %r8
addq $0x10, %rdi
cmpq %r8, %rsi
jne 0x24ea
movslq %edx, %rdx
shlq $0x4, %rdx
lock
xaddq %rsi, 0x8(%rcx,%rdx)
cmpq 0x8(%rax), %rsi
cmovgeq %r15, %rsi
testq %rsi, %rsi
js 0x2539
movq (%rbx), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rdx
subq 0x10(%rax), %rdx
shrq $0x4, %rdx
callq *0x18(%rax)
movq (%rbx), %rax
jmp 0x24c8
xorl %edi, %edi
callq 0x21a0