LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x31e9
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x2c(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x31d9
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x30(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x31b4
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x31b2
movl -0x10(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x8(%rax)
jmp 0x31cc
movq -0x28(%rbp), %rax
movl 0xc(%rax), %eax
cmpl -0xc(%rbp), %eax
jne 0x31ca
movl -0x10(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0xc(%rax)
jmp 0x31cc
jmp 0x31ce
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x3175
jmp 0x31db
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3148
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10420, %rsp          # imm = 0x10420
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x1, -0x10418(%rbp)
leaq -0x10010(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0xffff, %esi           # imm = 0xFFFF
callq 0x10d0
cmpq $0x0, %rax
je 0x32a7
leaq -0x10010(%rbp), %rdi
leaq -0x10410(%rbp), %rdx
leaq 0x4eae(%rip), %rsi      # 0x80ec
leaq -0x10420(%rbp), %rcx
movb $0x0, %al
callq 0x1130
cmpl $0x2, %eax
jne 0x326a
movq -0x8(%rbp), %rdi
movq -0x10420(%rbp), %rsi
leaq -0x10410(%rbp), %rdx
callq 0x32c0
jmp 0x3290
movq -0x10418(%rbp), %rsi
leaq -0x10010(%rbp), %rdx
leaq 0x4d89(%rip), %rdi      # 0x8008
movb $0x0, %al
callq 0x10a0
movl $0x1, %edi
callq 0x1180
movq -0x10418(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10418(%rbp)
jmp 0x320e
movq -0x8(%rbp), %rax
addq $0x10420, %rsp          # imm = 0x10420
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x32ed
jmp 0x330c
leaq 0x4e20(%rip), %rdi      # 0x8114
leaq 0x4e29(%rip), %rsi      # 0x8124
movl $0x7d, %edx
leaq 0x4e28(%rip), %rcx      # 0x812f
callq 0x10b0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x3319
jmp 0x3338
leaq 0x4e44(%rip), %rdi      # 0x8164
leaq 0x4dfd(%rip), %rsi      # 0x8124
movl $0x7e, %edx
leaq 0x4dfc(%rip), %rcx      # 0x812f
callq 0x10b0
jmp 0x333a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x10(%rbp), %rax
ja 0x3359
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
shlq %rcx
movq %rcx, 0x8(%rax)
jmp 0x333a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x20(%rbp), %rax
jbe 0x3390
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
shlq $0x3, %rsi
callq 0x1140
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x33c8
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x3398
movq -0x18(%rbp), %rdi
callq 0x1090
movq %rax, %rdi
addq $0x1, %rdi
callq 0x1120
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x1050
movq -0x38(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10430, %rsp          # imm = 0x10430
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x1, -0x10420(%rbp)
leaq -0x10010(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x1050
cmpq $0x1, -0x10420(%rbp)
jne 0x3484
leaq -0x10010(%rbp), %rdi
leaq 0x4f73(%rip), %rsi      # 0x83e9
callq 0x1160
movq %rax, -0x10418(%rbp)
jmp 0x349b
xorl %eax, %eax
movl %eax, %edi
leaq 0x4f5a(%rip), %rsi      # 0x83e9
callq 0x1160
movq %rax, -0x10418(%rbp)
cmpq $0x0, -0x10418(%rbp)
je 0x350e
leaq -0x10010(%rbp), %rdi
leaq -0x10410(%rbp), %rdx
leaq 0x4c39(%rip), %rsi      # 0x80f3
leaq -0x10428(%rbp), %rcx
movb $0x0, %al
callq 0x1130
cmpl $0x2, %eax
jne 0x34e6
movq -0x8(%rbp), %rdi
movq -0x10428(%rbp), %rsi
leaq -0x10410(%rbp), %rdx
callq 0x32c0
jmp 0x350c
movq -0x10420(%rbp), %rsi
leaq -0x10010(%rbp), %rdx
leaq 0x4b0d(%rip), %rdi      # 0x8008
movb $0x0, %al
callq 0x10a0
movl $0x1, %edi
callq 0x1180
jmp 0x350e
movq -0x10420(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10420(%rbp)
cmpq $0x0, -0x10418(%rbp)
jne 0x345e
movq -0x8(%rbp), %rax
addq $0x10430, %rsp          # imm = 0x10430
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x4b97(%rip), %rsi      # 0x80fa
callq 0x1150
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x3598
movq 0x7a7f(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x4b75(%rip), %rsi      # 0x80fc
movb $0x0, %al
callq 0x10f0
movl $0x1, %edi
callq 0x1180
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x31f0
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x35b9
movq -0x18(%rbp), %rdi
callq 0x1080
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl $0x20, %edi
callq 0x1120
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movl $0x2000, %edi           # imm = 0x2000
callq 0x1120
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x8(%rbp), %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
movq $0x400, 0x8(%rax)       # imm = 0x400
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x3656
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq $0x0, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3626
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x36ba
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x36aa
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1030
jmp 0x36ac
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3674
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x36d2
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x23a0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1030
movq -0x8(%rbp), %rdi
callq 0x1030
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x420, %rsp            # imm = 0x420
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x3787
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x23a0
movq -0x8(%rbp), %rax
movq (%rax), %r8
shlq %r8
leaq 0xd8(%rip), %rdi        # 0x3870
leaq 0x141(%rip), %rsi       # 0x38e0
movl $0x400, %edx            # imm = 0x400
movl $0x8, %ecx
callq 0x1e90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x18(%rax)
leaq -0x410(%rbp), %rdi
xorl %esi, %esi
movl $0x400, %edx            # imm = 0x400
callq 0x10c0
movq $0x0, -0x418(%rbp)
movq -0x418(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x3853
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x418(%rbp), %rcx
cmpq $0x0, (%rax,%rcx,8)
je 0x383d
leaq -0x410(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x418(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
movl $0x3ff, %edx            # imm = 0x3FF
callq 0x1040
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
leaq -0x410(%rbp), %rsi
leaq -0x418(%rbp), %rdx
callq 0x20e0
jmp 0x383f
movq -0x418(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x418(%rbp)
jmp 0x37d7
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
addq $0x420, %rsp            # imm = 0x420
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movl $0x811c9dc5, -0x14(%rbp) # imm = 0x811C9DC5
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1090
movq %rax, %rcx
movq -0x20(%rbp), %rax
cmpq %rcx, %rax
jae 0x38d6
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
movl -0x18(%rbp), %edx
movsbl (%rcx,%rdx), %ecx
xorl %ecx, %eax
movl %eax, -0x14(%rbp)
imull $0x1000193, -0x14(%rbp), %eax # imm = 0x1000193
movl %eax, -0x14(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x3892
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $-0x1, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x394c
movq -0x8(%rbp), %rdi
callq 0x3760
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x10(%rbp), %rsi
leaq -0x18(%rbp), %rdx
callq 0x2410
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x39e0
leaq 0x94(%rip), %rax        # 0x3a60
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movzbl 0xd(%rax), %ecx
orl $0x1, %ecx
movb %cl, 0xd(%rax)
jmp 0x39f9
leaq 0x99(%rip), %rax        # 0x3a80
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movzbl 0xd(%rax), %ecx
orl $0x2, %ecx
movb %cl, 0xd(%rax)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x3a4b
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl %eax, %esi
movq -0x20(%rbp), %rcx
movl $0x10, %edx
callq 0x1060
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x3a00
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x20, %edi
callq 0x1120
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x3b19
jmp 0x3b38
leaq 0x465b(%rip), %rdi      # 0x817b
leaq 0x465e(%rip), %rsi      # 0x8185
movl $0x1c, %edx
leaq 0x465e(%rip), %rcx      # 0x8191
callq 0x10b0
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
addq $0xf, %rdi
callq 0x1120
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq $0x0, (%rax)
movq -0x18(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x1110
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x3b90
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x3bab
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x3be9
jmp 0x3c08
leaq 0x458b(%rip), %rdi      # 0x817b
leaq 0x458e(%rip), %rsi      # 0x8185
movl $0x30, %edx
leaq 0x45b8(%rip), %rcx      # 0x81bb
callq 0x10b0
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x3c1c
movq $0x0, -0x8(%rbp)
jmp 0x3c6f
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x8, %rsi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x1110
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
callq 0x1030
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
addq $-0x1, %rcx
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x1120
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3bd0
cmpq $0x0, %rax
je 0x3cb2
jmp 0x3c9d
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0x1030
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl $0x10, %edi
callq 0x1120
movq %rax, -0x10(%rbp)
movl -0x4(%rbp), %eax
movl $0x20, %ecx
cltd
idivl %ecx
movl %eax, %ecx
addl $0x1, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movslq 0x8(%rax), %rdi
shlq $0x2, %rdi
callq 0x1120
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
callq 0x3d60
movq -0x10(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl $0x4, %edi
callq 0x3aa0
movq %rax, -0x40(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x4198
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movl $0x0, -0x38(%rbp)
movl -0x38(%rbp), %eax
cmpl -0x20(%rbp), %eax
jae 0x4175
movq -0x10(%rbp), %rax
movl -0x38(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x34(%rbp), %esi
movl -0x30(%rbp), %edx
movl -0x28(%rbp), %ecx
movl -0x24(%rbp), %r8d
movss -0x2c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x4125(%rip), %rdi      # 0x8288
movb $0x1, %al
callq 0x10a0
movl -0x38(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x4121
cmpl $0x1, -0x14(%rbp)
jne 0x4188
movq -0x40(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x3b00
jmp 0x418a
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x40e1
jmp 0x419a
movq -0x40(%rbp), %rdi
leaq -0x34(%rbp), %rsi
callq 0x3bd0
cmpq $0x0, %rax
je 0x41f2
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x34(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
movl -0x34(%rbp), %esi
movss -0x18(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x40b1(%rip), %rdi      # 0x829a
movb $0x1, %al
callq 0x10a0
jmp 0x419a
movq -0x40(%rbp), %rdi
callq 0x3cd0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x3970
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4532
movq $0x0, -0x18(%rbp)
movq 0x6add(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x18(%rbp), %rdx
leaq 0x3b4e(%rip), %rsi      # 0x8077
movb $0x0, %al
callq 0x10f0
jmp 0x453f
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x1050
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq 0x6b75(%rip), %rdx      # 0xb0e0
leaq 0x3aed(%rip), %rsi      # 0x805f
movb $0x0, %al
callq 0x10f0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x467c
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x24(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0xc(%rax)
jne 0x45e9
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %edx
movl -0x24(%rbp), %ecx
movl -0x24(%rbp), %esi
movq -0x8(%rbp), %rax
movl (%rax), %r9d
leaq 0x3d28(%rip), %r8       # 0x82f3
leaq 0x3d1a(%rip), %rax      # 0x82ec
cmpl %r9d, %esi
cmoveq %rax, %r8
leaq 0x3cda(%rip), %rsi      # 0x82ba
movb $0x0, %al
callq 0x10f0
jmp 0x4601
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %edx
movl -0x24(%rbp), %ecx
leaq 0x3cff(%rip), %rsi      # 0x82f9
movb $0x0, %al
callq 0x10f0
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x466c
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0x28(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %edx
movq -0x20(%rbp), %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movl 0x8(%rax), %r8d
movq -0x20(%rbp), %rax
movl 0xc(%rax), %r9d
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x3cdb(%rip), %rsi      # 0x8335
movb $0x1, %al
callq 0x10f0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x4608
jmp 0x466e
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x4580
movq -0x10(%rbp), %rdi
movq 0x6a61(%rip), %rdx      # 0xb0e8
leaq 0x39d1(%rip), %rsi      # 0x805f
movb $0x0, %al
callq 0x10f0
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/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
movq %rdi, -0x8(%rbp)
movq $0x11, -0x10(%rbp)
imulq $0x1f, -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
imulq $0x1f, -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
movl 0x4(%rcx), %ecx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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 $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq 0x5e49(%rip), %rax      # 0xb110
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movss (%rax,%rcx,4), %xmm0
movss %xmm0, -0x14(%rbp)
movq 0x5e1a(%rip), %rax      # 0xb0f8
movq 0x5e2b(%rip), %rcx      # 0xb110
movq -0x8(%rbp), %rdx
movl (%rdx), %edx
movss (%rcx,%rdx,4), %xmm0
movq 0x5e19(%rip), %rcx      # 0xb110
movq -0x10(%rbp), %rdx
movl (%rdx), %edx
movss (%rcx,%rdx,4), %xmm1
callq *%rax
movaps %xmm0, %xmm1
movss -0x14(%rbp), %xmm0
xorl %eax, %eax
movl $0x1, %ecx
ucomiss %xmm1, %xmm0
setnp %sil
sete %dl
testb %sil, %dl
cmovnel %ecx, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/c0stya[P]fslib/src/shortest.c
// Function: backtrace
static void backtrace(struct _fst * path, state_t f) {
    struct _arc arc;
    state_t s;
    state_t n=0; 

    fst_add_state(path);

    // Two-scan approach. Could we do better?

    for(s=f; s != 0; s=B[s].state, ++n)
        fst_add_state(path);

    fst_set_final(path, n, sr.one);
    
    for(s=f; s != 0; s=B[s].state, --n) {
        arc=B[s];
        fst_add_arc(path, n-1, n, arc.ilabel, arc.olabel, arc.weight);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x8(%rbp), %rdi
callq 0x27a0
movl -0xc(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x53d5
movq -0x8(%rbp), %rdi
callq 0x27a0
movq 0x5d5d(%rip), %rax      # 0xb118
movl -0x20(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x53a5
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
movss 0x5d28(%rip), %xmm0     # 0xb10c
callq 0x2a30
movl -0xc(%rbp), %eax
movl %eax, -0x20(%rbp)
cmpl $0x0, -0x20(%rbp)
je 0x5454
movq 0x5d1c(%rip), %rax      # 0xb118
movl -0x20(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x1c(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movl -0x24(%rbp), %esi
subl $0x1, %esi
movl -0x24(%rbp), %edx
movl -0x14(%rbp), %ecx
movl -0x10(%rbp), %r8d
movss -0x18(%rbp), %xmm0
callq 0x2870
movq 0x5cde(%rip), %rax      # 0xb118
movl -0x20(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x53ef
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x5543
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
cmpl -0x18(%rbp), %eax
jae 0x5533
movq -0x8(%rbp), %rax
movl -0x44(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
movl -0x48(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jne 0x5523
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x44(%rbp), %edx
movl -0x48(%rbp), %ecx
callq 0x5550
cmpl $0x0, %eax
je 0x5523
movq -0x8(%rbp), %rax
movl -0x44(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movl -0x48(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x3b00
jmp 0x5525
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x5494
jmp 0x5535
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x5481
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/c0stya[P]fslib/src/match.c
// Function: match
static int _match(struct _arc * a, struct _arc * b, arc_t i, arc_t j) {
    label_t al = a[i].olabel; 

    if (al == EPS)
        if ( (i != 0 && j != 0) || (i == 0 && j == 0)) {
            return 0;
        }
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %ecx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x1c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jne 0x559f
cmpl $0x0, -0x1c(%rbp)
je 0x5588
cmpl $0x0, -0x20(%rbp)
jne 0x5594
cmpl $0x0, -0x1c(%rbp)
jne 0x559d
cmpl $0x0, -0x20(%rbp)
jne 0x559d
movl $0x0, -0x4(%rbp)
jmp 0x55a6
jmp 0x559f
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x24(%rbp), %ecx
xorl %eax, %eax
cmpl -0x14(%rbp), %ecx
movb %al, -0x4d(%rbp)
jae 0x59f1
movl -0x28(%rbp), %eax
cmpl -0x18(%rbp), %eax
setb %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0x59fd
jmp 0x5b0a
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jae 0x5a2f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5b05
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
movl -0x28(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jbe 0x5a61
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x5b03
movl -0x28(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movq -0x10(%rbp), %rcx
movl -0x2c(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
cmpl 0x8(%rcx), %eax
jne 0x5afa
movq -0x8(%rbp), %rax
movl -0x24(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x4c(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x44(%rbp)
movq -0x10(%rbp), %rax
movl -0x2c(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rcx
movq %rcx, -0x3c(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x24(%rbp), %edx
movl -0x2c(%rbp), %ecx
callq 0x5550
cmpl $0x0, %eax
je 0x5aea
movq -0x20(%rbp), %rdi
leaq -0x4c(%rbp), %rsi
callq 0x3b00
jmp 0x5aec
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x5a67
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5b05
jmp 0x59d8
addq $0x50, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movl $0x38, %edi
callq 0x1120
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x8(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x20(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x5b7e
movq -0x20(%rbp), %rcx
addq $0x1, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x5ba1
cmpq $0x0, -0x18(%rbp)
jne 0x5b93
movq -0x28(%rbp), %rax
movq $0xff, 0x8(%rax)
jmp 0x5b9f
movq -0x18(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x5ba1
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rax
imulq 0x8(%rax), %rdi
callq 0x1120
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x28(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x5c0c
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x23a0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %r8
movl $0x8, %ecx
callq 0x1e90
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x28(%rax)
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x5c85
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
imulq 0x10(%rcx), %rax
addq %rax, %rsi
leaq -0x20(%rbp), %rdx
callq 0x20e0
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x5c41
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5cb5
jmp 0x5cd4
leaq 0x27d1(%rip), %rdi      # 0x848d
leaq 0x27d7(%rip), %rsi      # 0x849a
movl $0x5f, %edx
leaq 0x27d6(%rip), %rcx      # 0x84a5
callq 0x10b0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x30(%rax)
je 0x5ce1
jmp 0x5d00
leaq 0x27de(%rip), %rdi      # 0x84c6
leaq 0x27ab(%rip), %rsi      # 0x849a
movl $0x60, %edx
leaq 0x27aa(%rip), %rcx      # 0x84a5
callq 0x10b0
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x5d18
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x23a0
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x1030
movq -0x8(%rbp), %rdi
callq 0x1030
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x5d7f
movq $0x0, -0x8(%rbp)
jmp 0x5e11
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1110
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jbe 0x5df2
movq -0x20(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq -0x28(%rbp), %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
callq 0x1110
movq $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x5df0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x20e0
jmp 0x5df2
movq -0x10(%rbp), %rax
cmpq $0x1, (%rax)
jbe 0x5e09
movq -0x10(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5e20
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x3c(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x5e5e
jmp 0x5e7d
leaq 0x2675(%rip), %rdi      # 0x84da
leaq 0x262e(%rip), %rsi      # 0x849a
movl $0x97, %edx
leaq 0x2674(%rip), %rcx      # 0x84ec
callq 0x10b0
jmp 0x5e7f
cmpl $0x0, -0x3c(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x5e91
jmp 0x5f90
movq -0x10(%rbp), %rax
addq $0x1, %rax
shlq %rax
subq $0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
shlq %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x5ef9
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rcx
imulq -0x20(%rbp), %rcx
addq %rcx, %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rcx
imulq -0x20(%rbp), %rcx
addq %rcx, %rsi
callq *%rax
cmpl $0x0, %eax
je 0x5ef9
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0x5f01
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq (%rcx), %rax
jae 0x5f4f
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rcx
imulq -0x20(%rbp), %rcx
addq %rcx, %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rcx
imulq -0x20(%rbp), %rcx
addq %rcx, %rsi
callq *%rax
cmpl $0x0, %eax
je 0x5f4f
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
jmp 0x5f57
movq -0x38(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x5f84
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x5fa0
movq -0x38(%rbp), %rax
movq %rax, -0x10(%rbp)
jmp 0x5f8b
movl $0x1, -0x3c(%rbp)
jmp 0x5e7f
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0x1120
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
imulq -0x28(%rbp), %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
callq 0x1110
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
imulq -0x28(%rbp), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
imulq -0x28(%rbp), %rax
addq %rax, %rsi
movq -0x28(%rbp), %rdx
callq 0x1110
movq -0x20(%rbp), %rdi
movq -0x18(%rbp), %rax
imulq -0x28(%rbp), %rax
addq %rax, %rdi
movq -0x30(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x1110
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x6089
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rax
imulq -0x28(%rbp), %rax
addq %rax, %rsi
leaq -0x10(%rbp), %rdx
callq 0x20e0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x18(%rbp), %rax
imulq -0x28(%rbp), %rax
addq %rax, %rsi
leaq -0x18(%rbp), %rdx
callq 0x20e0
movq -0x30(%rbp), %rdi
callq 0x1030
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)