LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_empty
void fst_empty(struct _fst * fst) {
    struct _state * state;

    for(state_t s=0; s < fst->n_states; ++s) {
        state = fst->states + s;
        if (state->arcs != NULL)
            free(state->arcs);
    } 
    
    if ( fst->states != NULL )
        free(fst->states);

    fst->n_states = 0;
    fst->n_max = 0;
    fst->states = NULL;
    fst->start = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x4(%rdi)
je 0x226b
movl $0x10, %r14d
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
movq (%rax,%r14), %rdi
testq %rdi, %rdi
je 0x225c
callq 0x1030
incq %r15
movl 0x4(%rbx), %eax
addq $0x18, %r14
cmpq %rax, %r15
jb 0x224a
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2279
callq 0x1030
movl $0x0, 0x8(%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_write
void fst_write(const struct _fst * fst, FILE * fout) {
    struct _state * state;

    fwrite( &_fst_header, sizeof(_fst_header), 1, fout);
    fwrite( &fst->start, sizeof(state_t), 1, fout);
    fwrite( &fst->n_states, sizeof(state_t), 1, fout);
    fwrite( &fst->sr_type, sizeof(uint8_t), 1, fout);
    fwrite( &fst->flags, sizeof(uint8_t), 1, fout);

    for (int s=0; s < fst->n_states; ++s) {
        state = &fst->states[s];  
        
        fwrite( &state->weight, sizeof(weight_t), 1, fout);
        fwrite( &state->n_arcs, sizeof(arc_t), 1, fout);
        fwrite( &state->final, sizeof(int), 1, fout);

        fwrite( state->arcs, sizeof(struct _arc), state->n_arcs, fout);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x3de3(%rip), %rdi      # 0x60b0
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rcx
callq 0x11c0
leaq 0x4(%r14), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movsbl 0xc(%r14), %edi
movq %rbx, %rsi
callq 0x10f0
movsbl 0xd(%r14), %edi
movq %rbx, %rsi
callq 0x10f0
cmpl $0x0, 0x4(%r14)
je 0x23be
xorl %r12d, %r12d
xorl %r13d, %r13d
movq %r14, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %r14
leaq (%r14,%r12), %r15
leaq (%r14,%r12), %rdi
addq $0x8, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x11c0
leaq (%r14,%r12), %r15
addq $0xc, %r15
movq -0x30(%rbp), %r14
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x11c0
movq 0x4(%r15), %rdi
movl -0xc(%r15), %edx
movl $0x10, %esi
movq %rbx, %rcx
callq 0x11c0
incq %r13
movl 0x4(%r14), %eax
addq $0x18, %r12
cmpq %rax, %r13
jb 0x2339
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_read
void fst_read(struct _fst * fst, FILE * fin) {
    struct _state * state;
    uint32_t header = 0;

    fread( &header, sizeof(header), 1, fin);
    if (header != _fst_header) {
        printf("Wrong file format\n");
        exit(EXIT_FAILURE);
    }

    fread( &fst->start, sizeof(state_t), 1, fin);
    fread( &fst->n_states, sizeof(state_t), 1, fin);
    fread( &fst->sr_type, sizeof(uint8_t), 1, fin);
    fread( &fst->flags, sizeof(uint8_t), 1, fin);

    fst->n_max = fst->n_states;

    fst->states = malloc(sizeof(struct _state) * fst->n_states);

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

        fread ( &state->weight, sizeof(weight_t), 1, fin);
        fread ( &state->n_arcs, sizeof(arc_t), 1, fin);
        fread ( &state->final, sizeof(int), 1, fin);

        state->n_max = state->n_arcs;

        state->arcs = malloc(sizeof(struct _arc) * state->n_arcs);
        fread ( state->arcs, sizeof(struct _arc), state->n_arcs, fin);
    }
}

// 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 -0x34(%rbp), %r15
movl $0x0, (%r15)
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1080
cmpl $0x66733031, (%r15)     # imm = 0x66733031
jne 0x2548
movl $0x4, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x1080
leaq 0x4(%r12), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1080
leaq 0xc(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1080
leaq 0xd(%r12), %rdi
movl $0x1, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1080
movl 0x4(%r12), %eax
movl %eax, 0x8(%r12)
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x1150
movq %rax, 0x10(%r12)
cmpl $0x0, 0x4(%r12)
je 0x2539
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r12, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq 0x10(%rax), %r12
leaq (%r12,%r13), %r15
leaq (%r12,%r13), %rdi
addq $0x8, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1080
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1080
leaq (%r12,%r13), %r15
addq $0xc, %r15
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x1080
movl -0xc(%r15), %r12d
movl %r12d, -0x8(%r15)
movq %r12, %rdi
shlq $0x4, %rdi
callq 0x1150
movq %rax, 0x4(%r15)
movl $0x10, %esi
movq %rax, %rdi
movq %r12, %rdx
movq -0x30(%rbp), %r12
movq %rbx, %rcx
callq 0x1080
incq %r14
movl 0x4(%r12), %eax
addq $0x18, %r13
cmpq %rax, %r14
jb 0x249d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3b82(%rip), %rdi      # 0x60d1
callq 0x1060
movl $0x1, %edi
callq 0x11b0
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_fwrite
void fst_fwrite(const struct _fst * fst, const char * filename) {
    FILE * fout = NULL;

    if (( fout = fopen(filename, "wb")) == NULL ) {
        fprintf(stderr, "Error opening file: %s", filename);
        exit(EXIT_FAILURE);
    }
    fst_write(fst, fout);
    fclose(fout); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x3b3f(%rip), %rsi      # 0x60b4
movq %r14, %rdi
callq 0x1180
testq %rax, %rax
je 0x25a2
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x22b2
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1090
movq %r14, %rdi
callq 0x120a
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_fread
void fst_fread(struct _fst * fst, const char * filename) {
    FILE * fin = NULL;

    if (( fin = fopen(filename, "rb")) == NULL ) {
        fprintf(stderr, "Error opening file: %s", filename);
        exit(EXIT_FAILURE);
    }
    fst_read(fst, fin);
    fclose(fin); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x3b0d(%rip), %rsi      # 0x60ce
movq %r14, %rdi
callq 0x1180
testq %rax, %rax
je 0x25ee
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x23cd
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1090
movq %r14, %rdi
callq 0x1231
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_get_n_arcs
arc_t fst_get_n_arcs(const struct _fst * fst) {
    arc_t n = 0;
    for (state_t s = 0; s < fst->n_states; ++s) {
        n += fst->states[s].n_arcs; 
    }
    return n;
}

// Assembly:
movl 0x4(%rdi), %eax
testq %rax, %rax
je 0x2620
pushq %rbp
movq %rsp, %rbp
movq 0x10(%rdi), %rcx
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
xorl %esi, %esi
xorl %eax, %eax
addl (%rcx,%rsi), %eax
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0x2612
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_stack
void fst_stack(struct _fst * a, const struct _fst * b) {
    struct _state * state;
    struct _arc * arc_tmp;

    state_t offset = a->n_states; 
    a->n_states = a->n_states + b->n_states; 

    /*
    Check if there is enough space for stacking.
    If not then allocate additional space.

    */

    if (a->n_max < a->n_states) {
        a->n_max = a->n_states; 
        a->states = realloc(a->states, a->n_max * sizeof(struct _state));
    }

    memcpy(&a->states[offset], b->states, b->n_states * sizeof(struct _state));

    for(state_t i=offset; i < a->n_states; ++i) {
        state = &a->states[i];
        arc_tmp = state->arcs;
        state->arcs = malloc(state->n_max * sizeof(struct _arc));
        memcpy(state->arcs, arc_tmp, state->n_arcs * sizeof(struct _arc));
        for (arc_t j=0; j < state->n_arcs; ++j)
            (&state->arcs[j])->state += offset;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x4(%rdi), %r15d
movl 0x8(%rdi), %ecx
movl 0x4(%rsi), %eax
addl %r15d, %eax
movl %eax, 0x4(%rdi)
cmpl %eax, %ecx
jae 0x2665
movl %eax, 0x8(%rbx)
movq 0x10(%rbx), %rdi
movl %eax, %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rsi
callq 0x1170
movq %rax, 0x10(%rbx)
leaq (%r15,%r15,2), %rdi
shlq $0x3, %rdi
addq 0x10(%rbx), %rdi
movq 0x10(%r14), %rsi
movl 0x4(%r14), %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
callq 0x1140
movl 0x4(%rbx), %eax
movq %rax, -0x30(%rbp)
cmpl %eax, %r15d
jae 0x26fc
movq 0x10(%rbx), %r12
movq %r15, %r13
leaq (,%r13,2), %r14
addq %r13, %r14
movq 0x10(%r12,%r14,8), %rbx
movl 0x4(%r12,%r14,8), %edi
shlq $0x4, %rdi
callq 0x1150
movq %rax, 0x10(%r12,%r14,8)
movl (%r12,%r14,8), %edx
shlq $0x4, %rdx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1140
movl (%r12,%r14,8), %eax
testq %rax, %rax
je 0x26f3
leaq (%r12,%r14,8), %rcx
movq 0x10(%rcx), %rcx
shlq $0x4, %rax
xorl %edx, %edx
addl %r15d, (%rcx,%rdx)
addq $0x10, %rdx
cmpq %rdx, %rax
jne 0x26e6
incq %r13
cmpq -0x30(%rbp), %r13
jne 0x2699
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_copy
void fst_copy(const struct _fst * orig, struct _fst * copy) {
    struct _state * so, * sc;

    memcpy(copy, orig, sizeof(struct _fst));
    
    copy->states = malloc(sizeof(struct _state) * orig->n_max);
    memcpy(copy->states, orig->states, sizeof(struct _state) * orig->n_states);
    
    for(state_t s=0; s < copy->n_states; ++s) {
        sc = &copy->states[s];
        so = &orig->states[s];
        sc->arcs = malloc(sizeof(struct _arc) * sc->n_max);
        memcpy(sc->arcs, so->arcs, sizeof(struct _arc) * sc->n_arcs);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r15
movq %rdi, %r12
movq 0x10(%rdi), %rax
movq %rax, 0x10(%rsi)
movups (%rdi), %xmm0
movups %xmm0, (%rsi)
movl 0x8(%rdi), %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdi
callq 0x1150
movq %rax, %rbx
movq %rax, 0x10(%r15)
movq 0x10(%r12), %r14
movl 0x4(%r12), %eax
shlq $0x3, %rax
leaq (%rax,%rax,2), %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1140
movl 0x4(%r15), %eax
testq %rax, %rax
je 0x27a3
shlq $0x3, %rax
leaq (%rax,%rax,2), %r15
xorl %r12d, %r12d
movl 0x4(%rbx,%r12), %edi
shlq $0x4, %rdi
callq 0x1150
movq %rax, 0x10(%rbx,%r12)
movq 0x10(%r14,%r12), %rsi
movl (%rbx,%r12), %edx
shlq $0x4, %rdx
movq %rax, %rdi
callq 0x1140
addq $0x18, %r12
cmpq %r12, %r15
jne 0x2772
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/fst.c
// Function: fst_relabel
void fst_relabel(struct _fst * fst, label_t old, label_t new, int dir) {
    // change labels through the whole automaton:
    // 0 - input 
    // 1 - output 
    
    struct _state * state;
    struct _arc * arc;

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

            if (dir == 0) {
                if (arc->ilabel == old) arc->ilabel = new; 
            } else {
                if (arc->olabel == old) arc->olabel = new; 
            }
        }
    }
}

// Assembly:
movl 0x4(%rdi), %eax
testq %rax, %rax
je 0x281a
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0x10(%rdi), %rdi
xorl %r8d, %r8d
leaq (%r8,%r8,2), %r10
movl (%rdi,%r10,8), %r9d
testq %r9, %r9
je 0x280e
leaq (%rdi,%r10,8), %r10
movq 0x10(%r10), %r10
leaq 0x8(%r10), %r11
xorl %ebx, %ebx
testl %ecx, %ecx
je 0x27f7
cmpl %esi, 0x4(%r11)
jne 0x2802
movq %rbx, %r14
shlq $0x4, %r14
addq %r10, %r14
addq $0xc, %r14
jmp 0x27ff
movq %r11, %r14
cmpl %esi, (%r11)
jne 0x2802
movl %edx, (%r14)
incq %rbx
addq $0x10, %r11
decq %r9
jne 0x27dd
incq %r8
cmpq %rax, %r8
jne 0x27c2
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: symt_read
struct _symt * symt_read(struct _symt * st, FILE * fin) {
    char p[0xffff];
    char token[TOKEN_SIZE];
    size_t line = 1;
    size_t token_id;

    while (fgets(p, sizeof(p), fin) != NULL) {
        if (sscanf(p, "%s\t%zu", token, &token_id) == 2) {
            symt_add(st, token_id, token);
        }
        else {
                printf("Invalid input line %zd: %s", line, p);
                exit(EXIT_FAILURE);
        }
        ++line;
    }
    return st;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10408, %rsp          # imm = 0x10408
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x10430(%rbp), %rdi
movl $0xffff, %esi           # imm = 0xFFFF
movq %r14, %rdx
callq 0x1100
testq %rax, %rax
je 0x28a7
movl $0x1, %r15d
leaq -0x10430(%rbp), %r13
leaq -0x430(%rbp), %r12
movq %r13, %rdi
leaq 0x3876(%rip), %rsi      # 0x60e3
movq %r12, %rdx
leaq -0x30(%rbp), %rcx
xorl %eax, %eax
callq 0x1160
cmpl $0x2, %eax
jne 0x28bc
movq -0x30(%rbp), %rsi
movq %rbx, %rdi
movq %r12, %rdx
callq 0x28de
incq %r15
movq %r13, %rdi
movl $0xffff, %esi           # imm = 0xFFFF
movq %r14, %rdx
callq 0x1100
testq %rax, %rax
jne 0x2863
movq %rbx, %rax
addq $0x10408, %rsp          # imm = 0x10408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3741(%rip), %rdi      # 0x6004
leaq -0x10430(%rbp), %rdx
movq %r15, %rsi
xorl %eax, %eax
callq 0x10b0
movl $0x1, %edi
callq 0x11b0
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: symt_add
char * symt_add(
                        struct _symt * st, 
                        size_t id, 
                        const char * token) {

    // Token should be a C-string
    size_t s = st->n_max;
    char ** p;

    assert(st->sym != NULL);
    assert(st->n_max != 0);

    while (st->n_max <= id) {
        st->n_max *= 2;
    }

    if( st->n_max > s) {
        p = realloc(st->sym, st->n_max * sizeof(char *)); 
        st->sym = p;
    }

    for(size_t i = s; i < st->n_max; ++i)
        st->sym[i] = NULL;

    char * t = malloc(strlen(token) + 1);
    //strncpy(t, token, TOKEN_SIZE);
    strcpy(t, token);
    st->sym[id] = t;
    ++st->n_items;

    return st->sym[id];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x298b
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x29aa
movq %rdx, %r15
movq %rsi, %rbx
movq 0x8(%r14), %rsi
cmpq %rbx, %rsi
ja 0x2921
addq %rsi, %rsi
cmpq %rbx, %rsi
jbe 0x2915
movq %rsi, 0x8(%r14)
cmpq %r12, %rsi
jbe 0x2933
shlq $0x3, %rsi
callq 0x1170
movq %rax, 0x10(%r14)
movq 0x8(%r14), %rax
cmpq %rax, %r12
jae 0x2950
movq 0x10(%r14), %rcx
movq $0x0, (%rcx,%r12,8)
incq %r12
cmpq %r12, %rax
jne 0x293c
movq %r15, %rdi
callq 0x10a0
leaq 0x1(%rax), %rdi
callq 0x1150
movq %rax, %r12
movq %rax, %rdi
movq %r15, %rsi
callq 0x1050
movq 0x10(%r14), %rax
movq %r12, (%rax,%rbx,8)
incq (%r14)
movq 0x10(%r14), %rax
movq (%rax,%rbx,8), %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3779(%rip), %rdi      # 0x610b
leaq 0x3782(%rip), %rsi      # 0x611b
leaq 0x3786(%rip), %rcx      # 0x6126
movl $0x7d, %edx
callq 0x10c0
leaq 0x37aa(%rip), %rdi      # 0x615b
leaq 0x3763(%rip), %rsi      # 0x611b
leaq 0x3767(%rip), %rcx      # 0x6126
movl $0x7e, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: symt_compile
struct _symt * symt_compile(struct _symt * st, const char * str) {
    char p[0xffff];
    char token[TOKEN_SIZE];
    char * tok;
    size_t line = 1;
    size_t token_id;

    strcpy(p, str);

    do {
        if (line == 1)
            tok = strtok(p, "\n");
        else {
            tok = strtok(NULL, "\n");
        }

        if (tok) {
            if (sscanf(p, "%s\t%zd", token, &token_id) == 2) {
                symt_add(st, token_id, token);
            }
            else {
                    printf("Invalid input line %zd: %s", line, p);
                    exit(EXIT_FAILURE);
            }
        }
        ++line;
    } while (tok);

    return st;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10408, %rsp          # imm = 0x10408
movq %rdi, %rbx
leaq -0x10430(%rbp), %r15
movq %r15, %rdi
callq 0x1050
movl $0x1, %r14d
leaq -0x430(%rbp), %r13
cmpq $0x1, %r14
jne 0x2a07
movq %r15, %rdi
jmp 0x2a09
xorl %edi, %edi
leaq 0x39d0(%rip), %rsi      # 0x63e0
callq 0x1190
movq %rax, %r12
testq %rax, %rax
je 0x2a49
movq %r15, %rdi
leaq 0x36c3(%rip), %rsi      # 0x60ea
movq %r13, %rdx
leaq -0x30(%rbp), %rcx
xorl %eax, %eax
callq 0x1160
cmpl $0x2, %eax
jne 0x2a66
movq -0x30(%rbp), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x28de
incq %r14
testq %r12, %r12
jne 0x29fc
movq %rbx, %rax
addq $0x10408, %rsp          # imm = 0x10408
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3597(%rip), %rdi      # 0x6004
leaq -0x10430(%rbp), %rdx
movq %r14, %rsi
xorl %eax, %eax
callq 0x10b0
movl $0x1, %edi
callq 0x11b0
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: symt_fread
struct _symt * symt_fread(struct _symt * st, const char * filename) {
    FILE * fin = NULL;
    if (( fin = fopen(filename, "r")) == NULL ) {
        fprintf(stderr, "Error opening file: %s\n", filename);
        exit(EXIT_FAILURE);
    }

    st = symt_read(st, fin);
    if (fin != NULL)
        fclose(fin);
    return st;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x3652(%rip), %rsi      # 0x60f1
movq %r14, %rdi
callq 0x1180
testq %rax, %rax
je 0x2ad0
movq %rax, %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x281c
movq %r15, %rdi
callq 0x1090
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x1258
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: symt_create
struct _symt * symt_create() {
    struct _symt * st = malloc(sizeof(struct _symt));

    st->rev = NULL;
    st->sym = malloc(SYM_INIT_SIZE * sizeof(char *));

    st->n_items = 0;
    st->n_max = SYM_INIT_SIZE;

    for(size_t i=0; i < st->n_max; ++i)
        st->sym[i] = NULL;

    return st;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl $0x20, %edi
callq 0x1150
movq %rax, %rbx
xorl %r14d, %r14d
movq %r14, 0x18(%rax)
movl $0x2000, %edi           # imm = 0x2000
callq 0x1150
movq %rax, 0x10(%rbx)
movq %r14, (%rbx)
movq $0x400, 0x8(%rbx)       # imm = 0x400
movl $0x2000, %edx           # imm = 0x2000
movq %rax, %rdi
xorl %esi, %esi
callq 0x10e0
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: symt_remove
void symt_remove(struct _symt * st) {
    for(size_t i=0; i < st->n_max; ++i) 
        if(st->sym[i] != NULL)  
            free(st->sym[i]);

    if (st->rev != NULL)
        hash_remove(st->rev);

    free(st->sym);
    free(st);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, 0x8(%rdi)
je 0x2b52
xorl %r14d, %r14d
movq 0x10(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x2b49
callq 0x1030
incq %r14
cmpq 0x8(%rbx), %r14
jb 0x2b37
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2b60
callq 0x1f45
movq 0x10(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: symt_reverse
struct _hash * symt_reverse(struct _symt * st) {
    if(st->rev != NULL)
        hash_remove(st->rev);

    st->rev = hash_create(
                    fnv32,
                    str_cmp,
                    TOKEN_SIZE,
                    sizeof(size_t),
                    st->n_items * 2);

    char token[TOKEN_SIZE] = {0};

    for(size_t i=0; i < st->n_max; ++i) {
        if ( st->sym[i] != NULL ) {
            strncpy(token, st->sym[i], TOKEN_SIZE - 1);
            //strcpy(token, st->sym[i]);
            hash_add(st->rev, token, &i);
            //hash_add(st->rev, st->sym[i], &i);
        }
    } 

    return st->rev;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x2be2
callq 0x1f45
movq (%rbx), %r8
addq %r8, %r8
leaq 0x95(%rip), %rdi        # 0x2c84
leaq 0xd2(%rip), %rsi        # 0x2cc8
movl $0x400, %edx            # imm = 0x400
movl $0x8, %ecx
callq 0x1c50
movq %rax, 0x18(%rbx)
leaq -0x420(%rbp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x10e0
movq $0x0, -0x20(%rbp)
cmpq $0x0, 0x8(%rbx)
je 0x2c72
xorl %eax, %eax
leaq -0x420(%rbp), %r14
leaq -0x20(%rbp), %r15
movq 0x10(%rbx), %rcx
movq (%rcx,%rax,8), %rsi
testq %rsi, %rsi
je 0x2c61
movl $0x3ff, %edx            # imm = 0x3FF
movq %r14, %rdi
callq 0x1040
movq 0x18(%rbx), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1d8e
movq -0x20(%rbp), %rax
incq %rax
movq %rax, -0x20(%rbp)
cmpq 0x8(%rbx), %rax
jb 0x2c38
movq 0x18(%rbx), %rax
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: fnv32
static size_t fnv32(void * str) {

    const char * s = str;
    uint32_t hsh = FNV_OFFSET_32, i;

    for(i = 0; i < strlen(s); i++) {
        // xor next byte into the bottom of the hash
        hsh = hsh ^ (s[i]); 
        // Multiply by prime number found to work well
        hsh = hsh * FNV_PRIME_32; 
    }
    return hsh;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x10a0
testq %rax, %rax
je 0x2cbc
movl $0x811c9dc5, %ecx       # imm = 0x811C9DC5
movl $0x1, %edx
xorl %esi, %esi
movsbl (%rbx,%rsi), %esi
xorl %ecx, %esi
imull $0x1000193, %esi, %ecx  # imm = 0x1000193
movl %edx, %esi
incl %edx
cmpq %rsi, %rax
ja 0x2ca3
movl %ecx, %eax
jmp 0x2cc1
movl $0x811c9dc5, %eax       # imm = 0x811C9DC5
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/symt.c
// Function: symt_getr
size_t symt_getr(struct _symt * st, char * token) {
    size_t id = -1;
    if (st->rev == NULL)
       symt_reverse(st); 

    hash_get(st->rev, token, &id); 

    return id; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq $-0x1, -0x18(%rbp)
cmpq $0x0, 0x18(%rdi)
jne 0x2d04
movq %r14, %rdi
callq 0x2bc1
movq 0x18(%r14), %rdi
leaq -0x18(%rbp), %r14
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1f92
movq (%r14), %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/sort.c
// Function: fst_arc_sort
void fst_arc_sort(struct _fst * fst, int sort_outer) {
    struct _state * state;

    int (*comp)(const void *, const void *);

    if (sort_outer == 0)    {
        comp=icomp;
        fst->flags |= ISORT;
    } else {
        comp=ocomp;
        fst->flags |= OSORT;
    }
    
    for(state_t s = 0; s < fst->n_states; ++s) {
        state = &fst->states[s];
        qsort(  state->arcs, 
                state->n_arcs,
                sizeof(struct _arc),
                comp );
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testl %esi, %esi
sete %al
leaq 0x56(%rip), %rcx        # 0x2da9
leaq 0x5b(%rip), %r14        # 0x2db5
cmoveq %rcx, %r14
movb $0x2, %cl
subb %al, %cl
orb %cl, 0xd(%rdi)
cmpl $0x0, 0x4(%rdi)
je 0x2da0
movq %rdi, %rbx
movl $0x10, %r15d
xorl %r12d, %r12d
movq 0x10(%rbx), %rax
movq (%rax,%r15), %rdi
movl -0x10(%rax,%r15), %esi
movl $0x10, %edx
movq %r14, %rcx
callq 0x1070
incq %r12
movl 0x4(%rbx), %eax
addq $0x18, %r15
cmpq %rax, %r12
jb 0x2d77
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/queue.c
// Function: queue_create
struct _queue * queue_create(size_t item_size) {
    struct _queue * q;

    q = (struct _queue *) malloc(sizeof(struct _queue));
    q->item_size = item_size;

    q->n_items = 0;

    q->head = NULL;
    q->tail = NULL;

    return q;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x20, %edi
callq 0x1150
movq %rbx, 0x10(%rax)
movq $0x0, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/queue.c
// Function: queue_enque
void queue_enque(struct _queue * q, void * item) {
    struct _qnode * node;

    assert ( q != NULL);

    node = (struct _qnode *)malloc(sizeof(struct _qnode) - 1 + q->item_size);
    node->next = NULL;

    memcpy(node->item, item, q->item_size);

    if (q->head == NULL)
        q->head = q->tail = node;
    else {
        q->tail->next = node;  
        q->tail = node;
    }

    ++q->n_items;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
testq %rdi, %rdi
je 0x2e55
movq %rsi, %r15
movq %rdi, %rbx
movq 0x10(%rdi), %r12
leaq 0xf(%r12), %rdi
callq 0x1150
movq %rax, %r14
movq $0x0, (%rax)
leaq 0x8(%rax), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1140
leaq 0x8(%rbx), %rax
cmpq $0x0, (%rbx)
je 0x2e3c
movq (%rax), %rcx
jmp 0x2e42
movq %rax, %rcx
movq %rbx, %rax
movq %r14, (%rcx)
movq %r14, (%rax)
incq 0x18(%rbx)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3316(%rip), %rdi      # 0x6172
leaq 0x3319(%rip), %rsi      # 0x617c
leaq 0x331e(%rip), %rcx      # 0x6188
movl $0x1c, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O1/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 0x2ec5
movq %rdi, %r14
movq (%rdi), %r15
testq %r15, %r15
je 0x2eb5
movq %rsi, %rbx
leaq 0x8(%r15), %rsi
movq 0x10(%r14), %rdx
movq %rbx, %rdi
callq 0x1140
movq (%r15), %rax
movq %rax, (%r14)
movq %r15, %rdi
callq 0x1030
decq 0x18(%r14)
jmp 0x2eb7
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x32a6(%rip), %rdi      # 0x6172
leaq 0x32a9(%rip), %rsi      # 0x617c
leaq 0x32d8(%rip), %rcx      # 0x61b2
movl $0x30, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O1/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 0x1150
movq %rax, %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2e74
testq %rax, %rax
jne 0x2efa
movq $0x0, 0x18(%rbx)
movq %r14, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O1/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 0x1150
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 0x1150
movq %rax, (%rbx)
cmpl $-0x1f, %r15d
jl 0x2f92
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_O1/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 0x2dc4
movq %rax, %r14
movl $0x0, -0x2c(%rbp)
cmpl $0x0, 0x4(%rbx)
je 0x31e7
xorl %eax, %eax
leaq 0x3118(%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 0x31c0
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 0x3192
cmpl $0x1, %r13d
movq -0x38(%rbp), %r14
jne 0x31d6
movq %r14, %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2df0
movl -0x2c(%rbp), %eax
incl %eax
movl %eax, -0x2c(%rbp)
movq -0x40(%rbp), %rbx
cmpl 0x4(%rbx), %eax
jb 0x316f
leaq -0x2c(%rbp), %rsi
movq %r14, %rdi
callq 0x2e74
testq %rax, %rax
je 0x3231
leaq 0x3092(%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 0x2e74
testq %rax, %rax
jne 0x3203
movq %r14, %rdi
callq 0x2f1e
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x2d23
testq %rax, %rax
je 0x34b5
movq %rbx, %rdi
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1050
callq 0x127f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/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 0x2f00(%rip), %rdi      # 0x63e2
callq 0x10d0
movq %rbx, %rsi
cmpl $0x0, 0x4(%r12)
je 0x35d2
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 0x352b
movq %rsi, %rdi
leaq 0x2dd5(%rip), %rsi      # 0x62f0
movl %ebx, %edx
movq %rbx, %r15
movl %ebx, %ecx
xorl %eax, %eax
callq 0x1120
jmp 0x355c
movl (%r12), %eax
cmpq %rax, %rbx
leaq 0x2db1(%rip), %r8       # 0x62ea
leaq 0x2da3(%rip), %rax      # 0x62e3
cmoveq %rax, %r8
movq %rsi, %rdi
leaq 0x2d63(%rip), %rsi      # 0x62b1
movl %ebx, %edx
movq %rbx, %r15
movl %ebx, %ecx
xorl %eax, %eax
callq 0x1120
leaq (%r13,%r14,8), %r13
cmpl $0x0, (%r13)
movq -0x30(%rbp), %rsi
movq %r15, %rbx
je 0x35bd
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 0x2d8b(%rip), %rsi      # 0x632c
movl %ebx, %edx
movb $0x1, %al
callq 0x1120
movq %r15, %rsi
incq %r12
movl (%r13), %eax
addq $0x10, %r14
cmpq %rax, %r12
jb 0x3578
incq %rbx
movq -0x38(%rbp), %r12
movl 0x4(%r12), %eax
cmpq %rax, %rbx
jb 0x3500
leaq 0x2e3f(%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_O1/c0stya[P]fslib/src/compose.c
// Function: hash_pair
static size_t hash_pair(void * p) {
    size_t hash = 17;
    hash = hash*31 + ((struct _spair *)p)->a;
    hash = hash*31 + ((struct _spair *)p)->b;
    return hash;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %eax
movl 0x4(%rdi), %ecx
movq %rax, %rdx
shlq $0x5, %rdx
subq %rax, %rdx
leaq (%rdx,%rcx), %rax
addq $0x3fd1, %rax           # imm = 0x3FD1
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x5118(%rip), %rax      # 0x9118
movl (%rdi), %ecx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x4(%rbp)
movl (%rsi), %ecx
movss (%rax,%rcx,4), %xmm1
callq *0x50e7(%rip)           # 0x9100
cmpeqss -0x4(%rbp), %xmm0
movd %xmm0, %eax
andl $0x1, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x58, %rsp
movq %r8, -0x50(%rbp)
movl %ecx, -0x2c(%rbp)
movq %rsi, -0x38(%rbp)
movq %rdi, -0x40(%rbp)
testl %edx, %edx
je 0x410d
movl %edx, %eax
movq %rax, -0x48(%rbp)
movl -0x2c(%rbp), %r14d
addq $0x8, -0x38(%rbp)
xorl %r12d, %r12d
cmpl $0x0, -0x2c(%rbp)
je 0x4100
movq %r12, %rax
shlq $0x4, %rax
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax), %r15
addq %rcx, %rax
addq $0xc, %rax
movq %rax, -0x58(%rbp)
movq -0x38(%rbp), %rbx
xorl %r13d, %r13d
movl 0xc(%r15), %eax
cmpl (%rbx), %eax
jne 0x40f4
movq -0x58(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x40d1
testq %r12, %r12
setne %al
testq %r13, %r13
setne %cl
testb %cl, %al
jne 0x40f4
movl %r13d, %eax
orl %r12d, %eax
testq %rax, %rax
je 0x40f4
leaq -0x8(%rbx), %rax
movups (%r15), %xmm0
movaps %xmm0, -0x80(%rbp)
movups (%rax), %xmm0
leaq -0x70(%rbp), %rax
movups %xmm0, (%rax)
movq -0x50(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2df0
incq %r13
addq $0x10, %rbx
cmpq %r13, %r14
jne 0x40a5
incq %r12
cmpq -0x48(%rbp), %r12
jne 0x407e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/match.c
// Function: match_half_sorted
void match_half_sorted(
                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 < M; ++i) {
        l = 0;
        h = N-1;
        while ( l <= h ) {
            m = (l + h) >> 1;
            if (a[i].olabel > b[m].ilabel) l = m + 1; 
            else  
                if (a[i].olabel < b[m].ilabel) {
                    if (m == 0) break;  // sentinel for unsigned index h
                    h = m - 1;
                }
                else {
                    ll = hh = m;
                    
                    while ((ll > l) && (a[i].olabel == b[ll-1].ilabel)) --ll;
                    while ((hh < h) && (a[i].olabel == b[hh+1].ilabel)) ++hh;

                    while (ll <= hh ) {
                        mi.a = a[i]; 
                        mi.b = b[ll];
                        if (_match(a, b, i, ll))
                            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 %ecx, -0x2c(%rbp)
movq %rdi, -0x38(%rbp)
testl %edx, %edx
je 0x4273
movq %rsi, %r15
decl -0x2c(%rbp)
movl %edx, %eax
movq %rax, -0x50(%rbp)
leaq -0x8(%rsi), %rax
movq %rax, -0x40(%rbp)
leaq 0x18(%rsi), %rax
movq %rax, -0x48(%rbp)
xorl %r13d, %r13d
movq %r13, %rax
shlq $0x4, %rax
movq -0x38(%rbp), %rcx
leaq (%rcx,%rax), %rdx
movq %rdx, -0x60(%rbp)
movl 0xc(%rcx,%rax), %ecx
xorl %edi, %edi
movl -0x2c(%rbp), %edx
leal (%rdi,%rdx), %r8d
movl %r8d, %esi
shrl %esi
movq %rsi, %r9
shlq $0x4, %r9
cmpl 0x8(%r15,%r9), %ecx
jbe 0x4198
incl %esi
movl %esi, %edi
jmp 0x41a8
jae 0x41b1
cmpl $0x2, %r8d
jb 0x4266
decl %esi
movl %esi, %edx
cmpl %edx, %edi
jbe 0x417b
jmp 0x4266
movl %esi, %r12d
cmpl %edi, %esi
jbe 0x41dd
shrl %r8d
movq %r8, %r9
shlq $0x4, %r9
addq -0x40(%rbp), %r9
movl %r8d, %r12d
cmpl (%r9), %ecx
jne 0x41dd
decl %r12d
addq $-0x10, %r9
cmpl %r12d, %edi
jb 0x41c9
movl %edi, %r12d
cmpl %esi, %edx
cmovbel %esi, %edx
movq %rsi, %rdi
shlq $0x4, %rdi
addq -0x48(%rbp), %rdi
movl %esi, %ebx
cmpl %esi, %edx
je 0x4201
leal 0x1(%rbx), %esi
leaq 0x10(%rdi), %r8
cmpl (%rdi), %ecx
movq %r8, %rdi
je 0x41ed
cmpl %ebx, %r12d
ja 0x4266
movq -0x38(%rbp), %rcx
leaq (%rcx,%rax), %r14
addq $0xc, %r14
movq -0x60(%rbp), %rax
movups (%rax), %xmm0
movaps %xmm0, -0x80(%rbp)
movl %r12d, %eax
shlq $0x4, %rax
movups (%r15,%rax), %xmm0
leaq -0x70(%rbp), %rax
movups %xmm0, (%rax)
cmpl $0x0, (%r14)
jne 0x4251
testq %r13, %r13
setne %al
testl %r12d, %r12d
setne %cl
andb %al, %cl
movl %r12d, %eax
orl %r13d, %eax
sete %al
orb %cl, %al
jne 0x425e
movq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2df0
incl %r12d
cmpl %ebx, %r12d
jbe 0x4212
incq %r13
cmpq -0x50(%rbp), %r13
jne 0x415f
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x43c1
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 0x42f8
incl %edx
movl %edx, %esi
jmp 0x4307
jae 0x4310
cmpl $0x2, %edi
jb 0x43b4
decl %edx
movl %edx, %ecx
cmpl %ecx, %esi
jbe 0x42dd
jmp 0x43b4
movl %edx, %r14d
cmpl %esi, %edx
jbe 0x433b
shrl %edi
movq %rdi, %r8
shlq $0x4, %r8
addq -0x38(%rbp), %r8
movl %edi, %r14d
cmpl (%r8), %eax
jne 0x433b
decl %r14d
addq $-0x10, %r8
cmpl %r14d, %esi
jb 0x4327
movl %esi, %r14d
cmpl %edx, %ecx
cmovbel %edx, %ecx
movq %rdx, %rsi
shlq $0x4, %rsi
addq -0x40(%rbp), %rsi
movl %edx, %ebx
cmpl %edx, %ecx
je 0x43af
leal 0x1(%rbx), %edx
leaq 0x10(%rsi), %rdi
cmpl (%rsi), %eax
movq %rdi, %rsi
je 0x434b
jmp 0x43af
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 0x439f
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 0x43ac
movq -0x58(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x2df0
incl %r14d
cmpl %ebx, %r14d
jbe 0x4361
incq %r13
cmpq -0x48(%rbp), %r13
jne 0x42c5
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 $0x48, %rsp
movq %r8, -0x48(%rbp)
movq %rsi, %r12
testl %edx, %edx
sete %al
testl %ecx, %ecx
sete %sil
orb %al, %sil
jne 0x44dc
xorl %r9d, %r9d
xorl %r14d, %r14d
movl %ecx, -0x34(%rbp)
movl %edx, -0x30(%rbp)
movq %rdi, -0x40(%rbp)
movl %r14d, %esi
shlq $0x4, %rsi
leaq (%rdi,%rsi), %r13
movl %r9d, %eax
movq %rax, %r8
shlq $0x4, %r8
movl 0x8(%r12,%r8), %r8d
cmpl %r8d, 0xc(%rdi,%rsi)
jae 0x4435
incl %r14d
jmp 0x44ce
jbe 0x443f
incl %r9d
jmp 0x44ce
movl %r9d, -0x2c(%rbp)
movl 0xc(%r13), %edx
shlq $0x4, %rax
cmpl 0x8(%r12,%rax), %edx
jne 0x44bd
addq %r12, %rax
movq -0x40(%rbp), %rcx
leaq (%rcx,%rsi), %r15
addq $0xc, %r15
movl -0x2c(%rbp), %ecx
movl %ecx, %ebx
movups (%r13), %xmm0
movaps %xmm0, -0x70(%rbp)
movups (%rax), %xmm0
leaq -0x60(%rbp), %rax
movups %xmm0, (%rax)
cmpl $0x0, (%r15)
jne 0x4498
testl %r14d, %r14d
setne %al
testl %ebx, %ebx
setne %cl
andb %al, %cl
movl %ebx, %eax
orl %r14d, %eax
sete %al
orb %cl, %al
jne 0x44a5
movq -0x48(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2df0
incl %ebx
movl 0xc(%r13), %ecx
movq %rbx, %rdx
shlq $0x4, %rdx
leaq (%r12,%rdx), %rax
cmpl 0x8(%r12,%rdx), %ecx
je 0x4466
incl %r14d
movl -0x34(%rbp), %ecx
movl -0x30(%rbp), %edx
movq -0x40(%rbp), %rdi
movl -0x2c(%rbp), %r9d
cmpl %edx, %r14d
jae 0x44dc
cmpl %ecx, %r9d
jb 0x440c
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/c0stya[P]fslib/src/heap.c
// Function: heap_create
struct _heap * heap_create(         heap_cmp cmp, 
                                    size_t item_size, 
                                    size_t init_size,
                                    size_t limit) {
    struct _heap * heap;

    heap = malloc(sizeof(struct _heap));
    heap->n_items = 0;
    heap->item_size = item_size;
    heap->limit = limit;

    heap->cmp = cmp;

    if (limit != 0) {
        heap->n_max = limit + 1; 
    } else {
        if (init_size == 0) 
            heap->n_max = HEAP_INIT_SIZE;
        else 
            heap->n_max = init_size;    
    }

    heap->items = malloc(heap->item_size * heap->n_max); 

    // create lookup hash table to track indexes
    heap->ht = NULL;
    
    return heap;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x38, %edi
callq 0x1150
movq %rax, %r13
xorl %eax, %eax
movq %rax, (%r13)
movq %r15, 0x10(%r13)
movq %rbx, 0x18(%r13)
movq %r12, 0x20(%r13)
leaq 0x1(%rbx), %rax
testq %r14, %r14
movl $0xff, %edi
cmovneq %r14, %rdi
testq %rbx, %rbx
cmovneq %rax, %rdi
movq %rdi, 0x8(%r13)
imulq %r15, %rdi
callq 0x1150
movq %rax, 0x30(%r13)
xorl %eax, %eax
movq %rax, 0x28(%r13)
movq %r13, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/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 0x4586
callq 0x1f45
movq 0x8(%rbx), %r8
movq 0x10(%rbx), %rdx
movl $0x8, %ecx
movq %r15, %rdi
movq %r14, %rsi
callq 0x1c50
movq %rax, 0x28(%rbx)
movq $0x0, -0x20(%rbp)
cmpq $0x0, (%rbx)
je 0x45db
xorl %esi, %esi
leaq -0x20(%rbp), %r14
movq 0x28(%rbx), %rdi
imulq 0x10(%rbx), %rsi
addq 0x30(%rbx), %rsi
movq %r14, %rdx
callq 0x1d8e
movq -0x20(%rbp), %rsi
incq %rsi
movq %rsi, -0x20(%rbp)
cmpq (%rbx), %rsi
jb 0x45b6
movq 0x28(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq