LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/heap.c
// Function: heap_heapify
void heap_heapify(struct _heap * heap, size_t i) {
    char * items = heap->items;
    size_t s = heap->item_size;

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

    assert( i < heap->n_items );

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

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq %rsi, (%rdi)
jbe 0x43ee
movq %rsi, %r14
movq %rdi, %rbx
movq 0x30(%rdi), %rax
movq %rax, -0x30(%rbp)
movq 0x10(%rdi), %r13
leaq 0x1(,%r14,2), %r12
cmpq (%rbx), %r12
jae 0x4395
movq %r12, %rdi
imulq %r13, %rdi
movq -0x30(%rbp), %rax
addq %rax, %rdi
movq %r14, %rsi
imulq %r13, %rsi
addq %rax, %rsi
callq *0x20(%rbx)
testl %eax, %eax
jne 0x4398
movq %r14, %r12
leaq 0x2(,%r14,2), %r15
cmpq (%rbx), %r15
jae 0x43c4
movq %r15, %rdi
imulq %r13, %rdi
movq -0x30(%rbp), %rax
addq %rax, %rdi
movq %r12, %rsi
imulq %r13, %rsi
addq %rax, %rsi
callq *0x20(%rbx)
testl %eax, %eax
jne 0x43c7
movq %r12, %r15
cmpq %r14, %r15
je 0x43df
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x440d
movq %r15, %r14
jmp 0x4369
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x20dc(%rip), %rdi      # 0x64d1
leaq 0x2095(%rip), %rsi      # 0x6491
leaq 0x20e0(%rip), %rcx      # 0x64e3
movl $0x97, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/heap.c
// Function: heap_items_swap
static void heap_items_swap(struct _heap * heap, size_t i, size_t j) {
    char * items = heap->items;
    size_t s = heap->item_size;
    char * tmp = malloc(s);

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

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

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

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

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

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

    /* 

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

    */

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq (%rdi), %rsi
movq 0x10(%rdi), %r15
cmpq $0x0, 0x18(%rdi)
jne 0x4501
cmpq %rsi, 0x8(%rbx)
jne 0x4501
addq %rsi, %rsi
movq %rsi, 0x8(%rbx)
movq 0x30(%rbx), %rdi
imulq %r15, %rsi
callq 0x1170
movq %rax, 0x30(%rbx)
movq (%rbx), %rsi
imulq %r15, %rsi
addq 0x30(%rbx), %rsi
movq %rsi, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1140
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x452b
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1c3c
movq (%rbx), %rdx
movq 0x18(%rbx), %rax
decq %rax
cmpq %rdx, %rax
jae 0x45e4
movq 0x10(%rbx), %r15
movq 0x30(%rbx), %rax
movq %rax, -0x30(%rbp)
leaq (%rax,%r15), %r12
pushq $0x1
popq %r14
xorl %r13d, %r13d
leaq 0x1(%rdx), %rax
cmpq %rax, %r14
jae 0x4581
movq %r13, %rdi
imulq %r15, %rdi
addq -0x30(%rbp), %rdi
movq %r12, %rsi
callq *0x20(%rbx)
testl %eax, %eax
je 0x4576
movq %r14, %r13
incq %r14
movq (%rbx), %rdx
addq %r15, %r12
jmp 0x4555
movq %r13, -0x38(%rbp)
cmpq %rdx, %r13
je 0x45d5
movq %r13, %r12
imulq %r15, %r12
movq -0x30(%rbp), %rax
addq %rax, %r12
imulq %r15, %rdx
addq %rax, %rdx
movq %r12, %rdi
movq %rdx, %rsi
movq %r15, %rdx
callq 0x1140
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x45c8
leaq -0x38(%rbp), %r14
movq %r12, %rsi
movq %r14, %rdx
callq 0x1c3c
movq (%r14), %r13
movq %rbx, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x4605
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rax
incq %rax
movq %rax, (%rbx)
movq %rbx, %rdi
xorl %esi, %esi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4605
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/heap.c
// Function: heap_update
void heap_update(struct _heap * heap, void * item, size_t i) { 
    char * items = heap->items;
    size_t s = heap->item_size;
    size_t j;
    
    // remove assertion for equality
    assert ( i < heap->n_items );

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

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

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

        i = j;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, -0x30(%rbp)
cmpq %rdx, (%rdi)
jbe 0x46db
movq %rdx, %r15
movq %rdi, %rbx
movq 0x30(%rdi), %r12
movq 0x10(%rdi), %r14
testq %rsi, %rsi
je 0x46c7
movq %r14, %r13
imulq %r15, %r13
addq %r12, %r13
movq %rsi, -0x38(%rbp)
movq %rsi, %rdi
movq %r13, %rsi
callq *0x20(%rbx)
testl %eax, %eax
je 0x46fa
movq %r13, %rdi
movq -0x38(%rbp), %rsi
movq %r14, %rdx
callq 0x1140
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x46c7
leaq -0x30(%rbp), %r15
movq -0x38(%rbp), %rsi
movq %r15, %rdx
callq 0x1c3c
movq (%r15), %r15
jmp 0x46c7
movq %r15, %rdi
imulq %r14, %rdi
addq %r12, %rdi
incq %r15
shrq %r15
decq %r15
imulq %r14, %r15
addq %r12, %r15
movq %r15, %rsi
callq *0x20(%rbx)
testl %eax, %eax
je 0x46cc
movq -0x30(%rbp), %rsi
leaq 0x1(%rsi), %r15
shrq %r15
decq %r15
movq %rbx, %rdi
movq %r15, %rdx
callq 0x440d
movq %r15, -0x30(%rbp)
testq %r15, %r15
jne 0x4686
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1def(%rip), %rdi      # 0x64d1
leaq 0x1da8(%rip), %rsi      # 0x6491
leaq 0x1e1d(%rip), %rcx      # 0x650d
movl $0xee, %edx
callq 0x10c0
leaq 0x1e3d(%rip), %rdi      # 0x653e
leaq 0x1d89(%rip), %rsi      # 0x6491
leaq 0x1dfe(%rip), %rcx      # 0x650d
movl $0xf3, %edx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/iter.c
// Function: fst_iter_create
struct _fst_iter * fst_iter_create(const struct _fst * fst) {
    struct _fst_iter * iter;
    iter = malloc(sizeof(struct _fst_iter));
    iter->fst = fst;
    iter->state = fst->start;
    iter->marked = bitset_create(fst->n_states);
    iter->queue = queue_create(sizeof(state_t));

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

    return iter;
}

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

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

    return iter->state;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
leaq -0x2c(%rbp), %rsi
callq 0x2ca6
testq %rax, %rax
je 0x4858
movl -0x2c(%rbp), %eax
movl %eax, 0x18(%rbx)
movq (%rbx), %rcx
imulq $0x18, %rax, %r15
addq 0x10(%rcx), %r15
xorl %r12d, %r12d
xorl %r13d, %r13d
movl (%r15), %eax
cmpq %rax, %r13
jae 0x4853
movq 0x10(%r15), %r14
movq 0x8(%rbx), %rdi
movl (%r14,%r12), %esi
callq 0x2e2b
testl %eax, %eax
jne 0x484a
addq %r12, %r14
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x2c27
movq 0x8(%rbx), %rdi
movl (%r14), %esi
callq 0x2de9
incq %r13
addq $0x10, %r12
jmp 0x4812
movl 0x18(%rbx), %eax
jmp 0x485f
orl $-0x1, 0x18(%rbx)
pushq $-0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/test.c
// Function: assert_arc_equal
void assert_arc_equal(const struct _arc * arc_a, const struct _arc * arc_b) {
    assert ( arc_a->state == arc_b->state ); 
    assert ( arc_a->ilabel == arc_b->ilabel ); 
    assert ( arc_a->olabel == arc_b->olabel ); 
    assert ( arc_a->weight == arc_b->weight ); 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0x48a5
movl 0x8(%rdi), %eax
cmpl 0x8(%rsi), %eax
jne 0x48be
movl 0xc(%rdi), %eax
cmpl 0xc(%rsi), %eax
jne 0x48d7
movss 0x4(%rdi), %xmm0
ucomiss 0x4(%rsi), %xmm0
jne 0x48f0
jp 0x48f0
popq %rbp
retq
leaq 0x1cf2(%rip), %rdi      # 0x659e
leaq 0x1d08(%rip), %rsi      # 0x65bb
leaq 0x1d0c(%rip), %rcx      # 0x65c6
pushq $0x7
jmp 0x4907
leaq 0x1d41(%rip), %rdi      # 0x6606
leaq 0x1cef(%rip), %rsi      # 0x65bb
leaq 0x1cf3(%rip), %rcx      # 0x65c6
pushq $0x8
jmp 0x4907
leaq 0x1d47(%rip), %rdi      # 0x6625
leaq 0x1cd6(%rip), %rsi      # 0x65bb
leaq 0x1cda(%rip), %rcx      # 0x65c6
pushq $0x9
jmp 0x4907
leaq 0x1d4d(%rip), %rdi      # 0x6644
leaq 0x1cbd(%rip), %rsi      # 0x65bb
leaq 0x1cc1(%rip), %rcx      # 0x65c6
pushq $0xa
popq %rdx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/test.c
// Function: assert_fst_equal
void assert_fst_equal(const struct _fst * a, const struct _fst * b) {
    struct _state * state_a; 
    struct _state * state_b; 

    struct _arc * arc_a; 
    struct _arc * arc_b; 

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

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

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

            assert_arc_equal( arc_a, arc_b );
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl (%rdi), %eax
cmpl (%rsi), %eax
jne 0x4a19
movb 0xc(%rdi), %al
cmpb 0xc(%rsi), %al
jne 0x4a32
movl 0x4(%rdi), %eax
cmpl 0x4(%rsi), %eax
jne 0x4a4b
xorl %r13d, %r13d
movq %rsi, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
cmpl %eax, %r13d
jae 0x49ed
cmpl 0x4(%rsi), %r13d
jae 0x49ed
movq 0x10(%rdi), %r15
movl %r13d, %eax
imulq $0x18, %rax, %rax
movq 0x10(%rsi), %r12
movl (%r15,%rax), %ecx
cmpl (%r12,%rax), %ecx
jne 0x49fc
addq %rax, %r15
addq %rax, %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0x490d
xorl %r14d, %r14d
xorl %ebx, %ebx
movl (%r15), %eax
cmpq %rax, %rbx
jae 0x49dd
movl (%r12), %eax
cmpq %rax, %rbx
jae 0x49dd
movq 0x10(%r15), %rdi
addq %r14, %rdi
movq 0x10(%r12), %rsi
addq %r14, %rsi
callq 0x487c
incq %rbx
addq $0x10, %r14
jmp 0x49af
incl %r13d
movq -0x30(%rbp), %rdi
movl 0x4(%rdi), %eax
movq -0x38(%rbp), %rsi
jmp 0x4975
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d50(%rip), %rdi      # 0x6753
leaq 0x1bb1(%rip), %rsi      # 0x65bb
leaq 0x1cce(%rip), %rcx      # 0x66df
pushq $0x23
popq %rdx
callq 0x10c0
leaq 0x1caa(%rip), %rdi      # 0x66ca
leaq 0x1b94(%rip), %rsi      # 0x65bb
leaq 0x1cb1(%rip), %rcx      # 0x66df
pushq $0x1a
jmp 0x4a13
leaq 0x1ce6(%rip), %rdi      # 0x671f
leaq 0x1b7b(%rip), %rsi      # 0x65bb
leaq 0x1c98(%rip), %rcx      # 0x66df
pushq $0x1b
jmp 0x4a13
leaq 0x1ce6(%rip), %rdi      # 0x6738
leaq 0x1b62(%rip), %rsi      # 0x65bb
leaq 0x1c7f(%rip), %rcx      # 0x66df
pushq $0x1c
jmp 0x4a13
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/trim.c
// Function: fst_close
void fst_close(struct _fst * fst, struct _queue * finals) {
    /*
    This methods replace multiple final states with
    a single final state. 

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

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

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


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

// Assembly:
cmpq $0x2, 0x18(%rsi)
jb 0x4afb
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movzbl 0xc(%rdi), %esi
leaq -0x40(%rbp), %r12
movq %r12, %rdi
callq 0x1f64
movq %r14, %rdi
callq 0x1fbc
movl %eax, %r15d
movss 0x14(%r12), %xmm0
movq %r14, %rdi
movl %eax, %esi
callq 0x210b
leaq -0x24(%rbp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2ca6
testq %rax, %rax
je 0x4aef
movq 0x10(%r14), %rax
movl -0x24(%rbp), %ecx
imulq $0x18, %rcx, %rcx
andl $0x0, 0xc(%rax,%rcx)
movl -0x24(%rbp), %esi
movss 0x8(%rax,%rcx), %xmm0
movq %r14, %rdi
movl %r15d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x2011
jmp 0x4ab4
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/trim.c
// Function: fst_reverse
void fst_reverse(struct _fst * fst) {
    struct _sr sr = sr_get(fst->sr_type); 
    struct _state * state;
    struct _arc * arc;
    struct _fst * orig = fst_create();
    state_t s;
    state_t start_s = fst->start;

    fst_copy(fst, orig);

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

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

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

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

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

    fst_remove(orig);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movzbl 0xc(%rdi), %esi
leaq -0x48(%rbp), %rdi
callq 0x1f64
xorl %r12d, %r12d
xorl %eax, %eax
callq 0x1fa0
movq %rax, %r14
movl (%rbx), %r15d
movq %rbx, %rdi
movq %rax, %rsi
callq 0x257c
movl 0x4(%rbx), %eax
pushq $0xc
popq %rcx
cmpq %rax, %r12
jae 0x4b62
movq 0x10(%rbx), %rdx
andl $0x0, -0xc(%rdx,%rcx)
cmpl $0x0, (%rdx,%rcx)
je 0x4b59
movl %r12d, (%rbx)
andl $0x0, (%rdx,%rcx)
incq %r12
addq $0x18, %rcx
jmp 0x4b3e
movss -0x34(%rbp), %xmm0
movq %rbx, %rdi
movl %r15d, %esi
callq 0x210b
xorl %r15d, %r15d
movq %r14, -0x30(%rbp)
movl 0x4(%r14), %eax
cmpq %rax, %r15
jae 0x4bd0
imulq $0x18, %r15, %r13
addq 0x10(%r14), %r13
pushq $0xc
popq %r12
xorl %r14d, %r14d
movl (%r13), %eax
cmpq %rax, %r14
jae 0x4bc7
movq 0x10(%r13), %rax
movl -0xc(%rax,%r12), %esi
movl -0x4(%rax,%r12), %ecx
movl (%rax,%r12), %r8d
movss -0x8(%rax,%r12), %xmm0
movq %rbx, %rdi
movl %r15d, %edx
callq 0x2011
incq %r14
addq $0x10, %r12
jmp 0x4b91
incq %r15
movq -0x30(%rbp), %r14
jmp 0x4b79
movq %r14, %rdi
callq 0x20a0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/trim.c
// Function: fst_rm_states
struct _fst * fst_rm_states(struct _fst * fst, struct _bitset * mask) {
    struct _state * state;
    struct _arc * arc;

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

    state_t shift = 0;

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

    fst->n_states -= shift;

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

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

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

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

    return fst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, -0x30(%rbp)
movq %rdi, %rbx
movl 0x4(%rdi), %ecx
movq %rsp, %r12
movq %rcx, %rax
shlq $0x4, %rax
subq %rax, %r12
movq %r12, %rsp
xorl %r13d, %r13d
xorl %r15d, %r15d
xorl %r14d, %r14d
movl %ecx, %eax
cmpq %rax, %r15
jae 0x4c65
movq -0x30(%rbp), %rdi
movl %r15d, %esi
callq 0x2e2b
testl %eax, %eax
je 0x4c34
incl %r14d
jmp 0x4c59
movl %r14d, (%r12,%r15,4)
movq 0x10(%rbx), %rax
movl %r15d, %ecx
subl %r14d, %ecx
imulq $0x18, %rcx, %rcx
movq 0x10(%rax,%r13), %rdx
movq %rdx, 0x10(%rax,%rcx)
movups (%rax,%r13), %xmm0
movups %xmm0, (%rax,%rcx)
incq %r15
movl 0x4(%rbx), %ecx
addq $0x18, %r13
jmp 0x4c18
subl %r14d, %ecx
movl %ecx, 0x4(%rbx)
xorl %eax, %eax
movl %ecx, %ecx
cmpq %rcx, %rax
jae 0x4cd5
imulq $0x18, %rax, %rcx
addq 0x10(%rbx), %rcx
xorl %edx, %edx
xorl %edi, %edi
xorl %esi, %esi
movl (%rcx), %r8d
cmpq %r8, %rdi
jae 0x4cc7
movq 0x10(%rcx), %r8
movl (%r8,%rdx), %r9d
movl (%r12,%r9,4), %r10d
subl %r10d, %r9d
movl %r9d, (%r8,%rdx)
cmpl 0x4(%rbx), %r9d
jae 0x4cbc
leaq (%r8,%rdx), %r9
movl %edi, %r10d
subl %esi, %r10d
shlq $0x4, %r10
movups (%r9), %xmm0
movups %xmm0, (%r8,%r10)
jmp 0x4cbe
incl %esi
incq %rdi
addq $0x10, %rdx
jmp 0x4c82
subl %esi, %r8d
movl %r8d, (%rcx)
incq %rax
movl 0x4(%rbx), %ecx
jmp 0x4c6d
movq %rbx, %rax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/c0stya[P]fslib/src/trim.c
// Function: fst_trim
struct _fst * fst_trim(struct _fst * fst) {
    struct _queue * finals = queue_create(sizeof(state_t));

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

    fst_get_finals(fst, finals);

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

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

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

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

        fst_reverse(fst);

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

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

        /* Remove non accessible and non coacessible states */

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

        bitset_toggle_all(iter->marked);

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


        fst_iter_remove(iter_rev);
        fst_iter_remove(iter);
    }

    queue_remove(finals);

    return fst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
pushq $0x4
popq %rdi
callq 0x2c00
movq %rax, %r14
xorl %eax, %eax
leaq -0x24(%rbp), %r15
movl %eax, -0x24(%rbp)
cmpl 0x4(%rbx), %eax
jae 0x4d35
movq 0x10(%rbx), %rcx
movl %eax, %edx
imulq $0x18, %rdx, %rdx
cmpl $0x0, 0xc(%rcx,%rdx)
je 0x4d31
movq %r14, %rdi
movq %r15, %rsi
callq 0x2c27
movl -0x24(%rbp), %eax
incl %eax
jmp 0x4d0a
movq 0x18(%r14), %rax
cmpq $0x1, %rax
je 0x4d56
movq %rbx, %rdi
testq %rax, %rax
jne 0x4d4e
callq 0x20bc
jmp 0x4dc9
movq %r14, %rsi
callq 0x4a64
movq %rbx, %rdi
callq 0x474c
movq %rax, %r15
movq %r15, %rdi
callq 0x47d8
cmpl $-0x1, %eax
jne 0x4d61
movq %rbx, %rdi
callq 0x4afc
movq %rbx, %rdi
callq 0x474c
movq %rax, %r12
movq %r12, %rdi
callq 0x47d8
cmpl $-0x1, %eax
jne 0x4d81
movq %rbx, %rdi
callq 0x4afc
movq 0x8(%r15), %rdi
movq 0x8(%r12), %rsi
callq 0x2eb1
movq 0x8(%r15), %rdi
callq 0x2efa
movq 0x8(%r15), %rsi
movq %rbx, %rdi
callq 0x4be7
movq %r12, %rdi
callq 0x47af
movq %r15, %rdi
callq 0x47af
movq %r14, %rdi
callq 0x2d4b
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/kthread.c
// Function: kt_for
void kt_for(int n_threads, void (*func)(void*,long,int), void *data, long n)
{
	int i;
	kt_for_t t;
	pthread_t *tid;
	t.func = func, t.data = data, t.n_threads = n_threads, t.n = n;
	t.w = (ktf_worker_t*)alloca(n_threads * sizeof(ktf_worker_t));
	tid = (pthread_t*)alloca(n_threads * sizeof(pthread_t));
	for (i = 0; i < n_threads; ++i)
		t.w[i].t = &t, t.w[i].i = i;
	for (i = 0; i < n_threads; ++i) pthread_create(&tid[i], 0, ktf_worker, &t.w[i]);
	for (i = 0; i < n_threads; ++i) pthread_join(tid[i], 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq -0x50(%rbp), %rax
movq %rsi, 0x18(%rax)
movq %rdx, 0x20(%rax)
movl %edi, (%rax)
movq %rcx, 0x8(%rax)
movslq %edi, %r15
movq %r15, %rdx
shlq $0x4, %rdx
movq %rsp, %rsi
movq %rsi, %rcx
subq %rdx, %rcx
movq %rcx, %rsp
movq %rcx, 0x10(%rax)
movq %rsp, %r12
leaq 0xf(,%r15,8), %rcx
andq $-0x10, %rcx
subq %rcx, %r12
movq %r12, %rsp
xorl %ecx, %ecx
testl %r15d, %r15d
cmovlel %ecx, %r15d
negq %rdx
addq %rsi, %rdx
addq $0x8, %rdx
cmpq %rcx, %r15
je 0x2416
movq %rax, -0x8(%rdx)
movq %rcx, (%rdx)
incq %rcx
addq $0x10, %rdx
jmp 0x2401
movq %r15, %r13
shlq $0x4, %r13
xorl %ebx, %ebx
movq %r12, %r14
cmpq %rbx, %r13
je 0x2449
movq -0x40(%rbp), %rcx
addq %rbx, %rcx
movq %r14, %rdi
xorl %esi, %esi
leaq 0x35(%rip), %rdx        # 0x246f
callq 0x21e0
addq $0x10, %rbx
addq $0x8, %r14
jmp 0x2422
xorl %ebx, %ebx
cmpq %rbx, %r15
je 0x2460
movq (%r12,%rbx,8), %rdi
xorl %esi, %esi
callq 0x2250
incq %rbx
jmp 0x244b
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/kthread.c
// Function: ktf_worker
static void *ktf_worker(void *data)
{
	ktf_worker_t *w = (ktf_worker_t*)data;
	long i;
	for (;;) {
		i = __sync_fetch_and_add(&w->i, w->t->n_threads);
		if (i >= w->t->n) break;
		w->t->func(w->t->data, i, w - w->t->w);
	}
	while ((i = steal_work(w->t)) >= 0)
		w->t->func(w->t->data, i, w - w->t->w);
	pthread_exit(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rbx), %rax
movslq (%rax), %rsi
lock
xaddq %rsi, 0x8(%rbx)
movq (%rbx), %rax
cmpq 0x8(%rax), %rsi
jge 0x24a2
movq 0x20(%rax), %rdi
movq %rbx, %rdx
subq 0x10(%rax), %rdx
shrq $0x4, %rdx
callq *0x18(%rax)
jmp 0x2479
movabsq $0x7fffffffffffffff, %r14 # imm = 0x7FFFFFFFFFFFFFFF
pushq $-0x1
popq %rbp
pushq $-0x1
popq %r15
movslq (%rax), %rsi
testl %esi, %esi
movl $0x0, %edx
cmovgl %esi, %edx
movq 0x10(%rax), %rcx
leaq 0x8(%rcx), %rdi
xorl %r9d, %r9d
movl %ebp, %r8d
movq %r14, %r10
cmpq %r9, %rdx
je 0x24ed
movq (%rdi), %r11
cmpq %r11, %r10
cmovgl %r9d, %r8d
cmovgeq %r11, %r10
incq %r9
addq $0x10, %rdi
jmp 0x24d1
movslq %r8d, %rdx
shlq $0x4, %rdx
lock
xaddq %rsi, 0x8(%rcx,%rdx)
cmpq 0x8(%rax), %rsi
cmovgeq %r15, %rsi
testq %rsi, %rsi
js 0x2522
movq (%rbx), %rax
movq 0x20(%rax), %rdi
movq %rbx, %rdx
subq 0x10(%rax), %rdx
shrq $0x4, %rdx
callq *0x18(%rax)
movq (%rbx), %rax
jmp 0x24b3
xorl %edi, %edi
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/kthread.c
// Function: kt_pipeline
void kt_pipeline(int n_threads, void *(*func)(void*, int, void*), void *shared_data, int n_steps)
{
	ktp_t aux;
	pthread_t *tid;
	int i;

	if (n_threads < 1) n_threads = 1;
	aux.n_workers = n_threads;
	aux.n_steps = n_steps;
	aux.func = func;
	aux.shared = shared_data;
	pthread_mutex_init(&aux.mutex, 0);
	pthread_cond_init(&aux.cv, 0);

	aux.workers = alloca(n_threads * sizeof(ktp_worker_t));
	for (i = 0; i < n_threads; ++i) {
		ktp_worker_t *w = &aux.workers[i];
		w->step = w->running = 0; w->pl = &aux; w->data = 0;
	}

	tid = alloca(n_threads * sizeof(pthread_t));
	for (i = 0; i < n_threads; ++i) pthread_create(&tid[i], 0, ktp_worker, &aux.workers[i]);
	for (i = 0; i < n_threads; ++i) pthread_join(tid[i], 0);

	pthread_mutex_destroy(&aux.mutex);
	pthread_cond_destroy(&aux.cv);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
cmpl $0x2, %edi
pushq $0x1
popq %r15
cmovgel %edi, %r15d
leaq -0x88(%rbp), %rdi
movl %r15d, -0x10(%rdi)
movl %ecx, -0xc(%rdi)
movq %rsi, -0x18(%rdi)
movq %rdx, -0x20(%rdi)
xorl %ebx, %ebx
xorl %esi, %esi
callq 0x2270
leaq -0x60(%rbp), %r12
movq %r12, %rdi
xorl %esi, %esi
callq 0x2180
imulq $0x18, %r15, %r14
leaq 0xf(%r14), %rax
movabsq $0x1ffffffff0, %rcx     # imm = 0x1FFFFFFFF0
andq %rax, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x30(%r12)
xorps %xmm0, %xmm0
leaq -0xa8(%rbp), %rcx
cmpq %rbx, %r14
je 0x25b6
movups %xmm0, 0x8(%rax,%rbx)
movq %rcx, (%rax,%rbx)
addq $0x18, %rbx
jmp 0x25a2
movq %rsp, %rbx
movq %r15, -0x30(%rbp)
leaq 0xf(,%r15,8), %rax
andq $-0x10, %rax
subq %rax, %rbx
movq %rbx, %rsp
xorl %r13d, %r13d
leaq 0x69(%rip), %r15        # 0x2642
movq %rbx, %r12
cmpq %r13, %r14
je 0x2602
movq -0x90(%rbp), %rcx
addq %r13, %rcx
movq %r12, %rdi
xorl %esi, %esi
movq %r15, %rdx
callq 0x21e0
addq $0x18, %r13
addq $0x8, %r12
jmp 0x25dc
xorl %r14d, %r14d
movq -0x30(%rbp), %r15
cmpq %r14, %r15
je 0x261e
movq (%rbx,%r14,8), %rdi
xorl %esi, %esi
callq 0x2250
incq %r14
jmp 0x2609
leaq -0x88(%rbp), %rdi
callq 0x20f0
leaq -0x60(%rbp), %rdi
callq 0x2210
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/kthread.c
// Function: ktp_worker
static void *ktp_worker(void *data)
{
	ktp_worker_t *w = (ktp_worker_t*)data;
	ktp_t *p = w->pl;
	while (w->step < p->n_steps) {
		// test whether we can kick off the job with this worker
		pthread_mutex_lock(&p->mutex);
		for (;;) {
			int i;
			// test whether another worker is doing the same step
			for (i = 0; i < p->n_workers; ++i) {
				if (w == &p->workers[i]) continue; // ignore itself
				if (p->workers[i].running && p->workers[i].step == w->step)
					break;
			}
			if (i == p->n_workers) break; // no other workers doing w->step; then this worker will
			pthread_cond_wait(&p->cv, &p->mutex);
		}
		w->running = 1;
		pthread_mutex_unlock(&p->mutex);

		// working on w->step
		w->data = p->func(p->shared, w->step, w->step? w->data : 0); // for the first step, input is NULL

		// update step and let other workers know
		pthread_mutex_lock(&p->mutex);
		w->step = w->step == p->n_steps - 1 || w->data? (w->step + 1) % p->n_steps : p->n_steps;
		w->running = 0;
		pthread_cond_broadcast(&p->cv);
		pthread_mutex_unlock(&p->mutex);
	}
	pthread_exit(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r12
leaq 0x20(%r12), %r14
leaq 0x48(%r12), %r15
movl 0x8(%rbx), %eax
cmpl 0x14(%r12), %eax
jge 0x2730
movq %r14, %rdi
callq 0x2280
movl 0x10(%r12), %eax
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
xorl %esi, %esi
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x26b1
movq 0x18(%r12), %rdi
leaq (%rdi,%rsi), %r8
cmpq %rbx, %r8
je 0x26a6
cmpl $0x0, 0xc(%rdi,%rsi)
je 0x26a6
movl 0x8(%rdi,%rsi), %edi
cmpl 0x8(%rbx), %edi
je 0x26af
incq %rdx
addq $0x18, %rsi
jmp 0x2683
movl %edx, %ecx
cmpl %eax, %ecx
je 0x26c2
movq %r15, %rdi
movq %r14, %rsi
callq 0x20c0
jmp 0x2670
movl $0x1, 0xc(%rbx)
movq %r14, %rdi
callq 0x2190
movq (%r12), %rdi
movq 0x8(%r12), %rax
movl 0x8(%rbx), %esi
testl %esi, %esi
je 0x26e7
movq 0x10(%rbx), %rdx
jmp 0x26e9
xorl %edx, %edx
callq *%rax
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x2280
movl 0x8(%rbx), %eax
movl 0x14(%r12), %ecx
leal -0x1(%rcx), %edx
cmpl %edx, %eax
je 0x270d
cmpq $0x0, 0x10(%rbx)
je 0x2714
incl %eax
cltd
idivl %ecx
movl %edx, %ecx
movl %ecx, 0x8(%rbx)
andl $0x0, 0xc(%rbx)
movq %r15, %rdi
callq 0x2080
movq %r14, %rdi
callq 0x2190
jmp 0x265a
xorl %edi, %edi
callq 0x21a0
nop
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_sc_gen
lt_seqcloud_t *lt_sc_gen(const char *s)
{
	lt_seqcloud_t *sc;
	uint64_t x = 0;
	int i;
	sc = lt_sc_init();
	sc->l = strlen(s);
	for (i = 0; s[i] && i < sc->l; ++i) {
		int c = seq_nt4_table[(uint8_t)s[i]];
		if (c > 3) {
			lt_sc_destroy(sc);
			return 0;
		}
		x = x << 2 | c;
	}
	lt_sc_add_core(sc, x);
	return sc;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
pushq $0x1
popq %r15
pushq $0x18
popq %rsi
movq %r15, %rdi
callq 0x2120
movq %rax, %rbx
pushq $0x28
popq %rsi
movq %r15, %rdi
callq 0x2120
movq %rax, 0x10(%rbx)
movq %r14, %rdi
callq 0x20d0
movl %eax, (%rbx)
cltq
xorl %ecx, %ecx
leaq 0x5573(%rip), %rdx      # 0x8170
xorl %esi, %esi
movzbl (%r14,%rcx), %edi
testq %rdi, %rdi
je 0x2c21
cmpq %rax, %rcx
jge 0x2c21
movzbl (%rdi,%rdx), %edi
cmpq $0x4, %rdi
jae 0x2c2b
leaq (%rdi,%rsi,4), %rsi
incq %rcx
jmp 0x2bff
movq %rbx, %rdi
callq 0x277a
jmp 0x2c35
movq %rbx, %rdi
callq 0x2738
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_sc_test
int lt_sc_test(const lt_seqcloud_t *sc, const char *seq, int max_hits, lt_sc_hit_t *hits)
{
	int i, l, n = 0;
	uint64_t x = 0, mask = (1ULL << sc->l*2) - 1;
	for (i = l = 0; seq[i]; ++i) {
		int c = seq_nt4_table[(uint8_t)seq[i]];
		if (c < 4) {
			x = (x << 2 | c) & mask;
			if (++l >= sc->l) {
				if (x == sc->s || kh_get(s64, sc->mm, x) != kh_end(sc->mm)) {
					hits[n].pos = i - (sc->l - 1);
					hits[n++].type = x == sc->s? 0 : 1;
					if (n == max_hits) return n;
				}
			}
		} else l = 0, x = 0;
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r8
movl %edx, %r9d
movb (%rdi), %cl
addb %cl, %cl
movabsq $-0x1, %rbx
shlq %cl, %rbx
notq %rbx
xorl %r10d, %r10d
leaq 0x5504(%rip), %r14      # 0x8170
movl $0xc0000000, %r12d      # imm = 0xC0000000
xorl %ebp, %ebp
xorl %eax, %eax
xorl %r11d, %r11d
movq %r8, -0x10(%rsp)
movq %rdi, -0x18(%rsp)
movq %rbx, -0x20(%rsp)
movq %rsi, -0x28(%rsp)
movzbl (%rsi,%r10), %ecx
testq %rcx, %rcx
je 0x2e0b
movzbl (%rcx,%r14), %ecx
cmpq $0x3, %rcx
ja 0x2d81
leaq (%rcx,%r11,4), %r11
andq %rbx, %r11
incl %ebp
movl (%rdi), %r15d
cmpl %r15d, %ebp
jl 0x2e03
cmpq 0x8(%rdi), %r11
je 0x2dc7
movq 0x10(%rdi), %rdx
movl (%rdx), %ecx
testl %ecx, %ecx
je 0x2dc1
movl %eax, -0x2c(%rsp)
movl %r9d, %esi
movq %rcx, -0x8(%rsp)
leal -0x1(%rcx), %r8d
movq %r11, %r14
shrq $0x21, %r14
movl %r11d, %ecx
shll $0xb, %ecx
xorl %ecx, %r14d
xorl %r11d, %r14d
movl %r8d, %ebx
andl %r14d, %ebx
movl %r14d, %ecx
shrl $0x3, %ecx
shll $0x3, %r14d
xorl %ecx, %r14d
orl $0x1, %r14d
andl %r8d, %r14d
movq %rdx, %rdi
movq 0x10(%rdx), %r9
movl %ebx, %edx
movl %edx, %ecx
shrl $0x4, %ecx
movl (%r9,%rcx,4), %r13d
leal (%rdx,%rdx), %ecx
andl $0x1e, %ecx
movl %r13d, %r12d
shrl %cl, %r12d
testb $0x2, %r12b
jne 0x2d88
testb $0x1, %r12b
jne 0x2d4a
movq 0x18(%rdi), %r12
movl %edx, %eax
cmpq %r11, (%r12,%rax,8)
je 0x2d88
addl %r14d, %edx
andl %r8d, %edx
cmpl %ebx, %edx
jne 0x2d1d
movq -0x10(%rsp), %r8
movl %esi, %r9d
movq -0x18(%rsp), %rdi
movq -0x20(%rsp), %rbx
movq -0x28(%rsp), %rsi
leaq 0x53fe(%rip), %r14      # 0x8170
movl $0xc0000000, %r12d      # imm = 0xC0000000
movl -0x2c(%rsp), %eax
jmp 0x2e03
xorl %r11d, %r11d
xorl %ebp, %ebp
jmp 0x2e03
shrl %cl, %r13d
testb $0x3, %r13b
movq -0x8(%rsp), %rcx
cmovnel %ecx, %edx
movq -0x10(%rsp), %r8
movl %esi, %r9d
movq -0x18(%rsp), %rdi
movq -0x20(%rsp), %rbx
movq -0x28(%rsp), %rsi
leaq 0x53bb(%rip), %r14      # 0x8170
movl $0xc0000000, %r12d      # imm = 0xC0000000
movl -0x2c(%rsp), %eax
jmp 0x2dc3
xorl %edx, %edx
cmpl %ecx, %edx
je 0x2e03
movl %r10d, %r13d
subl %r15d, %r13d
incl %r13d
movslq %eax, %rcx
andl $0x3fffffff, %r13d      # imm = 0x3FFFFFFF
movl (%r8,%rcx,4), %edx
andl %r12d, %edx
orl %r13d, %edx
movl %edx, (%r8,%rcx,4)
xorl %edx, %edx
cmpq 0x8(%rdi), %r11
setne %dl
leal 0x1(%rcx), %eax
shll $0x1e, %edx
orl %r13d, %edx
movl %edx, (%r8,%rcx,4)
cmpl %r9d, %eax
je 0x2e0b
incq %r10
jmp 0x2c8d
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_seq_rev
void lt_seq_rev(int l, const char *f, char *r)
{
	int i;
	for (i = 0; i < l; ++i)
		r[l - i - 1] = f[i];
	r[l] = 0;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
movl $0x0, %ecx
cmovgl %edi, %ecx
leal -0x1(%rdi), %r8d
cmpq %rax, %rcx
je 0x2e3e
movb (%rsi,%rax), %r9b
movslq %r8d, %r8
movb %r9b, (%rdx,%r8)
incq %rax
decl %r8d
jmp 0x2e26
movslq %edi, %rax
movb $0x0, (%rdx,%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_seq_revcomp
void lt_seq_revcomp(int l, const char *f, char *r)
{
	int i;
	for (i = 0; i < l; ++i)
		r[l - i - 1] = (uint8_t)f[i] >= 128? 'N' : comp_tab[(uint8_t)f[i]];
	r[l] = 0;
}

// Assembly:
xorl %eax, %eax
testl %edi, %edi
movl $0x0, %ecx
cmovgl %edi, %ecx
leal -0x1(%rdi), %r8d
leaq 0x5413(%rip), %r9       # 0x8270
cmpq %rax, %rcx
je 0x2e84
movsbq (%rsi,%rax), %r10
testq %r10, %r10
js 0x2e72
movb (%r10,%r9), %r10b
jmp 0x2e75
movb $0x4e, %r10b
movslq %r8d, %r8
movb %r10b, (%rdx,%r8)
incq %rax
decl %r8d
jmp 0x2e5d
movslq %edi, %rax
movb $0x0, (%rdx,%rax)
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_ue_for1
int lt_ue_for1(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int min_len, int max_pen)
{
	int i, pen = 0;
	for (i = 0; i < l1 && i < l2; ++i) {
		if (s1[i] != s2[i]) {
			pen += q1[i] >= LT_QUAL_THRES && (q2 == 0 || q2[i] >= LT_QUAL_THRES)? LT_HIGH_PEN : LT_LOW_PEN;
			if (i <= min_len && pen > max_pen) break;
			if (i > min_len && pen * min_len > i * max_pen) break; // in effect: pen > max_pen * ((double)i / min_len)
		}
	}
	return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %ecx, %eax
movl 0x40(%rsp), %ecx
cmpl %eax, %edi
cmovll %edi, %eax
movslq 0x38(%rsp), %rdi
movslq %ecx, %r11
xorl %ebx, %ebx
testl %eax, %eax
cmovlel %ebx, %eax
xorl %r14d, %r14d
xorl %ebp, %ebp
cmpq %r14, %rax
je 0x2f37
movb (%rsi,%r14), %r15b
cmpb (%r8,%r14), %r15b
jne 0x2ec9
movl %ebp, %r15d
jmp 0x2f29
testq %r9, %r9
sete %r13b
xorl %r15d, %r15d
cmpb $0x35, (%rdx,%r14)
setge %r12b
setl %r10b
orb %r13b, %r10b
je 0x2ef2
movb %r12b, %r15b
leal 0x1(,%r15,2), %r15d
jmp 0x2f06
xorl %r10d, %r10d
cmpb $0x35, (%r9,%r14)
setge %r10b
leal 0x1(,%r10,2), %r15d
addl %ebp, %r15d
cmpq %rdi, %r14
jg 0x2f13
cmpl %ecx, %r15d
jg 0x2f34
cmpq %rdi, %r14
jle 0x2f29
movl %r15d, %r10d
imull 0x38(%rsp), %r10d
movslq %r10d, %r10
cmpq %r10, %rbx
jl 0x2f34
incq %r14
addq %r11, %rbx
movl %r15d, %ebp
jmp 0x2eb5
movl %r14d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_ue_rev1
int lt_ue_rev1(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int min_len, int max_pen)
{
	int i, pen = 0;
	for (i = 0; i < l1 && i < l2; ++i) {
		if (s1[l1-1-i] != s2[l2-1-i]) {
			pen += q1[l1-1-i] >= LT_QUAL_THRES && (q2 == 0 || q2[l2-1-i] >= LT_QUAL_THRES)? LT_HIGH_PEN : LT_LOW_PEN;
			if (i <= min_len && pen > max_pen) break;
			if (i > min_len && pen * min_len > i * max_pen) break;
		}
	}
	return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, -0x8(%rsp)
cmpl %ecx, %edi
movl %ecx, %eax
cmovll %edi, %eax
movslq 0x38(%rsp), %r14
movslq 0x40(%rsp), %rdx
xorl %r15d, %r15d
testl %eax, %eax
cmovlel %r15d, %eax
decl %edi
decl %ecx
xorl %r12d, %r12d
xorl %ebp, %ebp
movq %rax, -0x10(%rsp)
cmpq %r12, %rax
je 0x3022
movslq %edi, %r10
movb (%rsi,%r10), %r11b
movslq %ecx, %r13
cmpb (%r8,%r13), %r11b
jne 0x2f97
movl %ebp, %r13d
jmp 0x300d
movq %rdx, %rax
testq %r9, %r9
sete %bl
xorl %r11d, %r11d
movq -0x8(%rsp), %rdx
cmpb $0x35, (%rdx,%r10)
setge %r10b
setl %dl
orb %bl, %dl
je 0x2fc5
movb %r10b, %r11b
leal 0x1(,%r11,2), %r13d
jmp 0x2fd7
xorl %edx, %edx
cmpb $0x35, (%r9,%r13)
setge %dl
leal 0x1(,%rdx,2), %r13d
addl %ebp, %r13d
cmpq %r14, %r12
jg 0x2fe6
cmpl 0x40(%rsp), %r13d
jg 0x301f
cmpq %r14, %r12
jle 0x3005
movl %r13d, %edx
imull 0x38(%rsp), %edx
movslq %edx, %rdx
cmpq %rdx, %r15
movq %rax, %rdx
movq -0x10(%rsp), %rax
jge 0x300d
jmp 0x301f
movq %rax, %rdx
movq -0x10(%rsp), %rax
incq %r12
decl %edi
decl %ecx
addq %rdx, %r15
movl %r13d, %ebp
jmp 0x2f79
movl %r12d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_ue_for
int lt_ue_for(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int max_pen, int min_len, int max_pos, uint64_t *pos)
{
	int i, n = 0;
	for (i = min_len; i <= l1; ++i) {
		int l;
		l = lt_ue_for1(i, s1 + l1 - i, q1 + l1 - i, l2, s2, q2, min_len, max_pen);
		if (l >= min_len && (l == i || l == l2)) {
			pos[n++] = (uint64_t)(l1 - i) << 32 | l;
			if (n == max_pos) return n;
		}
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movl %ecx, %ebx
movq %rdx, %r15
movl 0x68(%rsp), %eax
movslq %edi, %r14
movslq %eax, %r12
movq %r14, %r13
subq %r12, %r13
addq %r13, %r15
addq %rsi, %r13
movq %r14, 0x20(%rsp)
shlq $0x20, %r14
movq %r12, %rax
shlq $0x20, %rax
subq %rax, %r14
movl $0x0, 0xc(%rsp)
cmpq 0x20(%rsp), %r12
jg 0x30f6
movl %r12d, %edi
movq %r13, %rsi
movq %r15, %rdx
movl %ebx, %ecx
movq 0x10(%rsp), %r8
movq 0x18(%rsp), %r9
movl 0x60(%rsp), %eax
pushq %rax
movl 0x70(%rsp), %ebp
pushq %rbp
callq 0x2e8c
addq $0x10, %rsp
cmpl %ebp, %eax
jl 0x30de
cmpl %eax, %r12d
setne %cl
cmpl %ebx, %eax
setne %dl
testb %dl, %cl
jne 0x30de
cltq
orq %r14, %rax
movl 0xc(%rsp), %edi
movslq %edi, %rsi
incl %edi
movq 0x78(%rsp), %rdx
movq %rax, (%rdx,%rsi,8)
movl %edi, 0xc(%rsp)
cmpl 0x70(%rsp), %edi
je 0x30f6
incq %r12
decq %r15
decq %r13
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r14
jmp 0x307b
movl 0xc(%rsp), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_ue_rev
int lt_ue_rev(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int max_pen, int min_len, int max_pos, uint64_t *pos)
{
	int i, n = 0;
	for (i = min_len; i <= l1; ++i) {
		int l;
		l = lt_ue_rev1(i, s1, q1, l2, s2, q2, min_len, max_pen);
		if (l >= min_len && (l == i || l == l2)) {
			pos[n++] = (uint64_t)(l1 - i) << 32 | l;
			if (n == max_pos) return n;
		}
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl %ecx, %ebp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl 0x68(%rsp), %r14d
movslq %r14d, %r13
movslq %edi, %r12
movq %r12, %r15
shlq $0x20, %r15
movq %r13, %rax
shlq $0x20, %rax
subq %rax, %r15
xorl %ebx, %ebx
cmpq %r12, %r13
jg 0x31b8
movl %r13d, %edi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl %ebp, %ecx
movq 0x18(%rsp), %r8
movq 0x20(%rsp), %r9
movl 0x60(%rsp), %eax
pushq %rax
pushq %r14
callq 0x2f42
addq $0x10, %rsp
cmpl %r14d, %eax
jl 0x31a6
cmpl %eax, %r13d
setne %cl
cmpl %ebp, %eax
setne %dl
testb %dl, %cl
jne 0x31a6
cltq
orq %r15, %rax
movslq %ebx, %rcx
incl %ebx
movq 0x78(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
cmpl 0x70(%rsp), %ebx
je 0x31b8
incq %r13
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r15
jmp 0x314b
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: lt_ue_contained
int lt_ue_contained(int l1, const char *s1, const char *q1, int l2, const char *s2, const char *q2, int max_pen, int max_pos, uint64_t *pos)
{
	int i, n = 0;
	for (i = 1; i < l2 - l1; ++i) {
		int l;
		l = lt_ue_for1(l1, s1, q1, l2 - i, s2 + i, q2 + i, l1, max_pen);
		if (l == l1) {
			pos[n++] = (uint64_t)i << 32 | l;
			if (n == max_pos) return n;
		}
	}
	return n;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, 0x20(%rsp)
movq %r8, 0x18(%rsp)
movl %ecx, %ebp
movq %rdx, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl %edi, %r13d
movabsq $0x100000000, %r12      # imm = 0x100000000
movl %ecx, %eax
subl %edi, %eax
movslq %eax, %r14
movslq %edi, %rax
movq %rax, (%rsp)
decl %ebp
xorl %ebx, %ebx
pushq $0x1
popq %r15
cmpq %r14, %r15
jge 0x327a
movq 0x18(%rsp), %rax
leaq (%rax,%r15), %r8
movq 0x20(%rsp), %rax
leaq (%rax,%r15), %r9
movl %r13d, %edi
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rdx
movl %ebp, %ecx
movl 0x60(%rsp), %eax
pushq %rax
pushq %r13
callq 0x2e8c
addq $0x10, %rsp
cmpl %r13d, %eax
jne 0x3266
movq %r12, %rax
orq (%rsp), %rax
movslq %ebx, %rcx
incl %ebx
movq 0x70(%rsp), %rdx
movq %rax, (%rdx,%rcx,8)
cmpl 0x68(%rsp), %ebx
je 0x327a
incq %r15
decl %ebp
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r12
jmp 0x3210
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: merge_base
static inline int merge_base(int max_qual, char fc, char fq, char rc, char rq)
{
	int y;
	if (fc == rc) {
		int q = fq > rq? fq - 33 : rq - 33;
		y = toupper(fc) | (33 + (q < max_qual? q : max_qual)) << 8;
	} else {
		if (fq > rq) y = toupper(fc) | (33 + (fq - rq)) << 8;
		else y = toupper(rc) | (33 + (rq - fq)) << 8;
	}
	return y;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %r15d
movl %ecx, %r14d
movl %edx, %r12d
movl %esi, %ebx
movl %edi, %ebp
callq 0x2030
movq (%rax), %rcx
cmpb %r14b, %bl
jne 0x40fb
movzbl %r12b, %eax
movzbl %r15b, %edx
cmpb %r15b, %r12b
cmovgl %eax, %edx
movsbl %dl, %eax
addl $-0x21, %eax
movsbq %bl, %rdx
leaq (%rcx,%rdx,4), %rcx
cmpl %ebp, %eax
cmovgel %ebp, %eax
jmp 0x411f
movsbl %r12b, %eax
movsbl %r15b, %edx
cmpb %dl, %al
jle 0x4113
movsbq %bl, %rsi
leaq (%rcx,%rsi,4), %rcx
subl %edx, %eax
jmp 0x411f
movsbq %r14b, %rsi
leaq (%rcx,%rsi,4), %rcx
subl %eax, %edx
movl %edx, %eax
shll $0x8, %eax
addl $0x2100, %eax           # imm = 0x2100
orl (%rcx), %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/DReichLab[P]adna/trim.c
// Function: trim_adap
static inline void trim_adap(bseq1_t *s, const char *adap, int is_5, int min_len, int max_pen, int allow_contained)
{
	int n_hits, l_adap;
	uint64_t hits[4];
	l_adap = strlen(adap);
	if (is_5) n_hits = lt_ue_rev(s->l_seq, s->seq, s->qual, l_adap, adap, 0, max_pen, min_len, 4, hits);
	else n_hits = lt_ue_for(s->l_seq, s->seq, s->qual, l_adap, adap, 0, max_pen, min_len, 4, hits);
	if (n_hits > 0 && (allow_contained || (hits[0]>>32) + (uint32_t)hits[0] == s->l_seq || (hits[n_hits-1]>>32) + (uint32_t)hits[n_hits-1] == s->l_seq)) {
		int len = s->l_seq - (hits[n_hits-1]>>32); // trim the longest hit
		if (is_5) {
			if (len > min_len) trim_bseq_5(s, len); // trim
			else memset(s->qual, 33+1, len); // reduce baseQ
		} else {
			if (len > min_len) s->l_seq -= len, s->seq[s->l_seq] = s->qual[s->l_seq] = 0; // trim
			else memset(s->qual + (s->l_seq - len), 33+1, len); // reduce baseQ
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rcx, 0x8(%rsp)
movl %edx, %r15d
movq %rsi, %r13
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20d0
movl (%rbx), %r12d
movl %r12d, %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
movq 0x10(%rbx), %rsi
movq 0x18(%rbx), %r14
leaq 0x10(%rsp), %r10
movl %ebp, %edi
movq %r14, %rdx
movl %eax, %ecx
movq %r13, %r8
xorl %r9d, %r9d
pushq %r10
pushq $0x4
pushq %r15
pushq 0x20(%rsp)
callq 0x302d
addq $0x20, %rsp
testl %eax, %eax
jle 0x41d7
decl %eax
movq 0x10(%rsp,%rax,8), %rcx
movq %rcx, %rax
shrq $0x20, %rax
subl %eax, %ebp
cmpl %r15d, %ebp
jle 0x41e6
movl %eax, %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl $0x80000000, %r12d      # imm = 0x80000000
orl %ecx, %r12d
movl %r12d, (%rbx)
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andq %rcx, %rax
xorl %edx, %edx
movb %dl, (%r14,%rax)
movq 0x10(%rbx), %rax
movl (%rbx), %esi
andq %rcx, %rsi
movb %dl, (%rax,%rsi)
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
sarq $0x20, %rcx
addq %rcx, %r14
movslq %ebp, %rdx
pushq $0x22
popq %rsi
movq %r14, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110