LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_mul
bigint* bigint_mul(bigint *dst, const bigint *a, const bigint *b){
    int na = a->size;
    int nb = b->size;
    int n = na + nb;
    bigint_word *tmp;

    bigint_reserve(dst, n);

    /* bigint_raw_mul_karatsuba already has this fastpath */
    /* but this way we avoid allocating tmp */
    if (
        dst != a &&
        dst != b &&
        na < BIGINT_KARATSUBA_WORD_THRESHOLD &&
        nb < BIGINT_KARATSUBA_WORD_THRESHOLD
    ){
        bigint_raw_zero(dst->words, 0, na + nb);
        dst->size = bigint_raw_mul_add(dst->words, a->words, na, b->words, nb);
    }else{
        int magical_upper_bound = BIGINT_MAX(na, nb) * 11 + 180 + n;
        tmp = (bigint_word*)malloc(magical_upper_bound * sizeof(*tmp));

        dst->size = bigint_raw_mul_karatsuba(tmp, a->words, na, b->words, nb, tmp + n);
        bigint_raw_cpy(dst->words, tmp, dst->size);
        free(tmp);
    }

    return bigint_set_neg(dst, a->neg ^ b->neg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rsi), %r13d
movl 0xc(%rdx), %r12d
leal (%r12,%r13), %ebp
movl %ebp, %esi
callq 0x1a71
cmpq %r14, %rbx
je 0x26a5
cmpq %r15, %rbx
sete %al
cmpl $0x14, %r13d
setge %cl
cmpl $0x14, %r12d
setge %dl
orb %cl, %dl
orb %al, %dl
jne 0x26a5
testl %ebp, %ebp
jle 0x268c
movq (%rbx), %rdi
movl %ebp, %edx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x1070
movq (%rbx), %rdi
movq (%r14), %rsi
movq (%r15), %rcx
movl %r13d, %edx
movl %r12d, %r8d
callq 0x1f5f
movl %eax, 0xc(%rbx)
jmp 0x2715
cmpl %r12d, %r13d
movl %r12d, %eax
cmovgl %r13d, %eax
leal (%rax,%rax,4), %ecx
leal (%rax,%rcx,2), %eax
addl %ebp, %eax
addl $0xb4, %eax
movslq %eax, %rdi
shlq $0x2, %rdi
callq 0x10b0
movq %r14, (%rsp)
movq %r15, %r14
movq %rax, %r15
movq (%rsp), %rax
movq (%rax), %rsi
movq (%r14), %rcx
movslq %ebp, %rax
leaq (%r15,%rax,4), %r9
movq %r15, %rdi
movl %r13d, %edx
movl %r12d, %r8d
callq 0x2324
movl %eax, 0xc(%rbx)
movq (%rbx), %rdi
movslq %eax, %rdx
shlq $0x2, %rdx
movq %r15, %rsi
callq 0x10a0
movq %r15, %rdi
movq %r14, %r15
movq (%rsp), %r14
callq 0x1030
movl 0x8(%r15), %eax
xorl 0x8(%r14), %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_from_str_base
bigint* bigint_from_str_base(bigint *dst, const char *src, int src_base){
    int n_digits_src, n_digits_dst;
    double dst_base = pow(2.0, BIGINT_WORD_BITS);

    n_digits_src = bigint_count_digits(src);
    n_digits_dst = bigint_digits_bound(n_digits_src, src_base, dst_base);

    bigint_reserve(dst, n_digits_dst);
    dst->size = n_digits_dst;
    bigint_raw_zero(dst->words, 0, n_digits_dst);

    dst->size = bigint_raw_from_str_base(dst->words, src, src_base);
    return bigint_set_neg(dst, *src == '-');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movb (%rsi), %al
testb %al, %al
je 0x280a
leaq 0x1(%r14), %r12
xorl %r15d, %r15d
movsbl %al, %edi
callq 0x19a0
xorl %ecx, %ecx
cmpl $-0x1, %eax
setne %cl
addl %ecx, %r15d
movb (%r12), %al
incq %r12
testb %al, %al
jne 0x27e5
cvtsi2sd %r15d, %xmm0
jmp 0x280e
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %ebp, %xmm0
callq 0x1080
mulsd 0x8(%rsp), %xmm0
divsd 0x29aa(%rip), %xmm0     # 0x51d8
callq 0x10e0
addsd 0x27dd(%rip), %xmm0     # 0x5018
cvttsd2si %xmm0, %r15d
movq %rbx, %rdi
movl %r15d, %esi
callq 0x1a71
movl %r15d, 0xc(%rbx)
testl %r15d, %r15d
jle 0x2865
movq (%rbx), %rdi
movl %r15d, %edx
shlq $0x2, %rdx
xorl %esi, %esi
callq 0x1070
movq (%rbx), %rdi
movq %r14, %rsi
movl %ebp, %edx
callq 0x208e
movl %eax, 0xc(%rbx)
xorl %eax, %eax
cmpb $0x2d, (%r14)
sete %al
movl %eax, 0x8(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_from_int
bigint* bigint_from_int(bigint *dst, int src){
    unsigned int x = BIGINT_INT_ABS(src);
    int n = BIGINT_MAX(1, sizeof(x)/sizeof(bigint_word));
    bigint_reserve(dst, n);
    bigint_raw_zero(dst->words, 0, n);
    memcpy(dst->words, &x, sizeof(x));
    dst->size = bigint_raw_truncate(dst->words, n);
    return bigint_set_neg(dst, src < 0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movl %esi, %ebp
negl %ebp
cmovsl %esi, %ebp
movl $0x1, %esi
callq 0x1a71
movq (%r14), %rax
movl $0x0, (%rax)
movq (%r14), %rax
movl %ebp, (%rax)
movq (%r14), %rax
xorl %ecx, %ecx
cmpl $0x0, (%rax)
setne %cl
movl %ecx, 0xc(%r14)
shrl $0x1f, %ebx
movl %ebx, 0x8(%r14)
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_from_word
bigint* bigint_from_word(bigint *dst, bigint_word a){
    bigint_reserve(dst, 1);
    dst->words[0] = a;
    dst->size = bigint_raw_truncate(dst->words, 1);
    return bigint_set_neg(dst, 0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x1, %esi
callq 0x1a71
movq (%r14), %rax
movl %ebx, (%rax)
xorl %eax, %eax
testl %ebx, %ebx
setne %al
movl %eax, 0xc(%r14)
movl $0x0, 0x8(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_raw_add_signed
int bigint_raw_add_signed(
    bigint_word *dst, int *dst_neg,
    const bigint_word *a, int na, int a_neg,
    const bigint_word *b, int nb, int b_neg
){
    if (a_neg){
        if (b_neg){
            if (na >= nb){
                *dst_neg = 1;
                return bigint_raw_add(dst, a, na, b, nb);
            }else{
                *dst_neg = 1;
                return bigint_raw_add(dst, b, nb, a, na);
            }
        }else{
            if (bigint_raw_cmp_abs(a, na, b, nb) >= 0){
                *dst_neg = 1;
                return bigint_raw_sub(dst, a, na, b, nb);
            }else{
                *dst_neg = 0;
                return bigint_raw_sub(dst, b, nb, a, na);
            }
        }
    }else{
        if (b_neg){
            if (bigint_raw_cmp_abs(a, na, b, nb) >= 0){
                *dst_neg = 0;
                return bigint_raw_sub(dst, a, na, b, nb);
            }else{
                *dst_neg = 1;
                return bigint_raw_sub(dst, b, nb, a, na);
            }
        }else{
            if (na >= nb){
                *dst_neg = 0;
                return bigint_raw_add(dst, a, na, b, nb);
            }else{
                *dst_neg = 0;
                return bigint_raw_add(dst, b, nb, a, na);
            }
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r12
movl 0x48(%rsp), %eax
movl 0x40(%rsp), %ebp
testl %r8d, %r8d
je 0x294b
testl %eax, %eax
je 0x296c
movl $0x1, (%r13)
jmp 0x299f
testl %eax, %eax
je 0x2997
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x1b00
testl %eax, %eax
js 0x29d1
movl $0x0, (%r13)
jmp 0x2987
movq %r15, %rdi
movl %ebx, %esi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x1b00
testl %eax, %eax
js 0x29db
movl $0x1, (%r13)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
movq %r14, %rcx
movl %ebp, %r8d
jmp 0x29f1
movl $0x0, (%r13)
movq %r12, %rdi
cmpl %ebp, %ebx
jge 0x29b3
movq %r14, %rsi
movl %ebp, %edx
movq %r15, %rcx
movl %ebx, %r8d
jmp 0x29be
movq %r15, %rsi
movl %ebx, %edx
movq %r14, %rcx
movl %ebp, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2150
movl $0x1, (%r13)
jmp 0x29e3
movl $0x0, (%r13)
movq %r12, %rdi
movq %r14, %rsi
movl %ebp, %edx
movq %r15, %rcx
movl %ebx, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2210
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_add_signed
bigint* bigint_add_signed(
    bigint *dst,
    const bigint *a, int a_neg,
    const bigint *b, int b_neg
){
    int na = a->size;
    int nb = b->size;
    int n = BIGINT_MAX(na, nb) + 1;

    bigint_reserve(dst, n);

    dst->size = bigint_raw_add_signed(
        dst->words, &dst->neg,
        a->words, na, a_neg,
        b->words, nb, b_neg
    );

    return dst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
movq %rcx, %r15
movl %edx, %ebp
movq %rsi, %r12
movq %rdi, %rbx
movl 0xc(%rsi), %r13d
movl 0xc(%rcx), %r14d
cmpl %r14d, %r13d
movl %r14d, %esi
cmovgl %r13d, %esi
incl %esi
callq 0x1a71
movq (%rbx), %rdi
leaq 0x8(%rbx), %rsi
movq (%r12), %rdx
movq (%r15), %r9
movl %r13d, %ecx
movl %ebp, %r8d
pushq (%rsp)
pushq %r14
callq 0x2917
addq $0x10, %rsp
movl %eax, 0xc(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_add_word_signed
bigint* bigint_add_word_signed(
    bigint *dst,
    const bigint *src_a,
    bigint_word b, int b_neg
){
    int na = src_a->size;

    bigint_reserve(dst, na + 1);

    dst->size = bigint_raw_add_signed(
        dst->words, &dst->neg,
        src_a->words, na, src_a->neg,
        &b, 1, b_neg
    );

    return dst;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %ecx, %r14d
movq %rsi, %r15
movq %rdi, %rbx
leaq 0xc(%rsp), %r12
movl %edx, (%r12)
movl 0xc(%rsi), %r13d
leal 0x1(%r13), %esi
callq 0x1a71
movq (%rbx), %rdi
leaq 0x8(%rbx), %rsi
movq (%r15), %rdx
movl 0x8(%r15), %r8d
movl %r13d, %ecx
movq %r12, %r9
pushq %r14
pushq $0x1
callq 0x2917
addq $0x10, %rsp
movl %eax, 0xc(%rbx)
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_shift_left
bigint* bigint_shift_left(bigint *dst, const bigint *src, unsigned shift){
    unsigned n = src->size + shift / BIGINT_WORD_BITS + (shift % BIGINT_WORD_BITS != 0);
    bigint_reserve(dst, n);
    dst->size = bigint_raw_shift_left(dst->words, dst->capacity, src->words, src->size, shift);
    return bigint_set_neg(dst, src->neg);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %rbx
movl %edx, %esi
shrl $0x5, %esi
movl %edx, %eax
andl $0x1f, %eax
cmpl $0x1, %eax
sbbl $-0x1, %esi
addl 0xc(%r14), %esi
callq 0x1a71
movq (%rbx), %rdi
movl 0x10(%rbx), %esi
movq (%r14), %rdx
movl 0xc(%r14), %ecx
movl %ebp, %r8d
callq 0x2b05
movl %eax, 0xc(%rbx)
movl 0x8(%r14), %eax
movl %eax, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_count_trailing_zeros
int bigint_count_trailing_zeros(const bigint *a){
    int i;
    for (i = 0; i < a->size; i++){
        bigint_word w = a->words[i];
        if (w) return bigint_word_count_trailing_zeros(w) + i*BIGINT_WORD_BITS;
    }
    return a->size * BIGINT_WORD_BITS;
}

// Assembly:
movslq 0xc(%rdi), %rcx
testq %rcx, %rcx
jle 0x2f7e
movq (%rdi), %rdx
xorl %esi, %esi
movl (%rdx,%rsi,4), %edi
testl %edi, %edi
je 0x2f72
xorl %r8d, %r8d
btl %r8d, %edi
jb 0x2f6a
incl %r8d
cmpl $0x20, %r8d
jne 0x2f55
movl $0x20, %r8d
movl %esi, %eax
shll $0x5, %eax
addl %r8d, %eax
testl %edi, %edi
jne 0x2f83
incq %rsi
cmpq %rcx, %rsi
jne 0x2f4b
shll $0x5, %ecx
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_div_mod_half_word
bigint* bigint_div_mod_half_word(
    bigint *dst,
    bigint_word *dst_remainder,
    bigint_word denominator
){
    int i, j;
    bigint_word parts[2], div_word, mod_word, remainder = 0;

    BIGINT_ASSERT(denominator, !=, 0);
    BIGINT_ASSERT(denominator, <=, BIGINT_HALF_WORD_MAX);

    for (i = dst->size - 1; i >= 0; i--){
        bigint_word dst_word = 0;
        bigint_word src_word = dst->words[i];
        parts[1] = BIGINT_WORD_LO(src_word);
        parts[0] = BIGINT_WORD_HI(src_word);

        /* divide by denominator twice, keeping remainder in mind */
        for (j = 0; j < 2; j++){
            remainder <<= BIGINT_WORD_BITS / 2;
            remainder |= parts[j];

            div_word = remainder / denominator;
            mod_word = remainder % denominator;
            remainder = mod_word;

            dst_word <<= BIGINT_WORD_BITS / 2;
            dst_word |= div_word;
        }

        dst->words[i] = dst_word;
    }

    *dst_remainder = remainder;
    dst->size = bigint_raw_truncate(dst->words, dst->size);
    return dst;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
testl %edx, %edx
je 0x32b4
movl %edx, %ecx
cmpl $0x10000, %edx          # imm = 0x10000
jae 0x32d3
movslq 0xc(%rdi), %r8
testq %r8, %r8
jle 0x3285
movq (%rdi), %r9
xorl %edx, %edx
leaq -0x1(%r8), %r10
movl -0x4(%r9,%r8,4), %eax
movzwl %ax, %r11d
movl %r11d, 0xc(%rsp)
shrl $0x10, %eax
movl %eax, 0x8(%rsp)
xorl %ebx, %ebx
xorl %r11d, %r11d
shll $0x10, %edx
orl 0x8(%rsp,%rbx,4), %edx
movl %edx, %eax
xorl %edx, %edx
divl %ecx
shll $0x10, %r11d
orl %eax, %r11d
incq %rbx
cmpq $0x1, %rbx
je 0x3259
movl %r11d, (%r9,%r10,4)
cmpq $0x1, %r8
movq %r10, %r8
jg 0x323b
jmp 0x3287
xorl %edx, %edx
movl %edx, (%rsi)
movl 0xc(%rdi), %eax
testl %eax, %eax
jle 0x32a8
movq (%rdi), %rcx
movl %eax, %edx
cmpl $0x0, -0x4(%rcx,%rdx,4)
jne 0x32a8
leal -0x1(%rax), %edx
cmpl $0x1, %eax
movl %edx, %eax
jg 0x3293
xorl %eax, %eax
movl %eax, 0xc(%rdi)
movq %rdi, %rax
addq $0x10, %rsp
popq %rbx
retq
leaq 0x2221(%rip), %rdi      # 0x54dc
leaq 0x1f51(%rip), %rsi      # 0x5213
leaq 0x2228(%rip), %rcx      # 0x54f1
movl $0x366, %edx            # imm = 0x366
callq 0x1060
leaq 0x225e(%rip), %rdi      # 0x5538
leaq 0x1f32(%rip), %rsi      # 0x5213
leaq 0x2209(%rip), %rcx      # 0x54f1
movl $0x367, %edx            # imm = 0x367
callq 0x1060
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_div
bigint* bigint_div(
    bigint *dst,
    const bigint *numerator,
    const bigint *denominator
){
    bigint unused[1];
    bigint_init(unused);

    bigint_div_mod(dst, unused, numerator, denominator);

    bigint_free(unused);
    return dst;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movl $0x0, 0x10(%r14)
movq %r14, %rsi
callq 0x2f84
movq (%r14), %rdi
callq 0x1030
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_mod
bigint* bigint_mod(
    bigint *dst,
    const bigint *numerator,
    const bigint *denominator
){
    bigint unused[1];
    bigint_init(unused);

    bigint_div_mod(unused, dst, numerator, denominator);

    bigint_free(unused);
    return dst;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rcx
movq %rsi, %rdx
movq %rdi, %rbx
xorps %xmm0, %xmm0
movq %rsp, %r14
movaps %xmm0, (%r14)
movl $0x0, 0x10(%r14)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2f84
movq (%r14), %rdi
callq 0x1030
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_sqrt
bigint* bigint_sqrt(bigint *dst, const bigint *src){
    int bit;
    bigint sum[1], tmp[1];
    const double MAX_INT_THAT_FITS_IN_DOUBLE = pow(2.0, 52.0);

    dst->neg = 0;
    dst->size = 0;

    if (src->size == 0) return dst;

    if (src->size == 1 && src->words[0] < MAX_INT_THAT_FITS_IN_DOUBLE){
        bigint_from_word(dst, sqrt(src->words[0]));
        return dst;
    }

    bigint_init(sum);
    bigint_init(tmp);

    bigint_cpy(tmp, src);
    tmp->neg = 0;

    /* index of highest 1 bit rounded down */
    bit = bigint_bitlength(src);
    if (bit & 1) bit ^= 1;

    for (; bit >= 0; bit -= 2){
        bigint_cpy(sum, dst);
        bigint_set_bit(sum, bit);

        if (bigint_cmp_abs(tmp, sum) >= 0){
            bigint_sub(tmp, tmp, sum);
            bigint_set_bit(dst, bit + 1);
        }

        bigint_shift_right(dst, dst, 1);
    }

    bigint_free(tmp);
    bigint_free(sum);
    return dst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
movq $0x0, 0x8(%rdi)
movl 0xc(%rsi), %eax
testl %eax, %eax
je 0x36c8
movq %rsi, %r15
cmpl $0x1, %eax
jne 0x3580
movq (%r15), %rax
movl (%rax), %eax
cvtsi2sd %rax, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x3699
sqrtsd %xmm0, %xmm0
jmp 0x369e
xorl %r14d, %r14d
movl %r14d, 0x10(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
leaq 0x20(%rsp), %r12
movapd %xmm0, (%r12)
movl %r14d, 0x10(%r12)
movq %r12, %rdi
movq %r15, %rsi
callq 0x1c5e
movl %r14d, 0x8(%r12)
movl 0xc(%r15), %eax
testl %eax, %eax
jle 0x35e3
movq (%r15), %rcx
decl %eax
movl (%rcx,%rax,4), %edx
movl $0x20, %ecx
leal -0x1(%rcx), %esi
movzbl %sil, %esi
btl %esi, %edx
jb 0x35d8
decl %ecx
jne 0x35c6
xorl %ecx, %ecx
shll $0x5, %eax
addl %ecx, %eax
andl $-0x2, %eax
movl %eax, %r14d
testl %r14d, %r14d
js 0x3667
movq %rsp, %r15
leaq 0x20(%rsp), %r12
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1c5e
movq %r15, %rdi
movl %r14d, %esi
callq 0x1d39
movq 0x20(%rsp), %rdi
movl 0x2c(%rsp), %esi
movq (%rsp), %rdx
movl 0xc(%rsp), %ecx
callq 0x1b00
testl %eax, %eax
js 0x364a
movl 0x28(%rsp), %edx
xorl %r8d, %r8d
cmpl $0x0, 0x8(%rsp)
sete %r8b
movq %r12, %rdi
movq %r12, %rsi
movq %r15, %rcx
callq 0x2a04
leal 0x1(%r14), %esi
movq %rbx, %rdi
callq 0x1d39
movq %rbx, %rdi
movq %rbx, %rsi
movl $0x1, %edx
callq 0x2ea3
leal -0x2(%r14), %eax
cmpl $0x1, %r14d
movl %eax, %r14d
jg 0x35f0
movq 0x20(%rsp), %rdi
callq 0x1030
xorl %ebp, %ebp
movl %ebp, 0x30(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, 0x20(%rsp)
movq (%rsp), %rdi
callq 0x1030
movl %ebp, 0x10(%rsp)
xorpd %xmm0, %xmm0
movapd %xmm0, (%rsp)
jmp 0x36c8
callq 0x10d0
cvttsd2si %xmm0, %r14
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1a71
movq (%rbx), %rax
movl %r14d, (%rax)
xorl %eax, %eax
testl %r14d, %r14d
setne %al
movl %eax, 0xc(%rbx)
movl $0x0, 0x8(%rbx)
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_write_base
char* bigint_write_base(
    char *dst,
    int *n_dst,
    const bigint *a,
    bigint_word base,
    int zero_terminate
){
    int i = 0, n = *n_dst;
    static const char *table = "0123456789abcdefghijklmnopqrstuvwxyz";
    BIGINT_ASSERT(base, >=, 2);
    BIGINT_ASSERT(base, <=, 36);

    if (zero_terminate) if (i < n) dst[i++] = '\0';

    if (a->size == 0){
        if (i < n) dst[i++] = '0';
    }else{
        bigint tmp[1];
        bigint_init(tmp);
        bigint_cpy(tmp, a);

        while (tmp->size > 0){
            bigint_word remainder;
            /* TODO extract as many digits as fit into bigint_word at once */
            /* tricky with leading zeros */
            bigint_div_mod_half_word(tmp, &remainder, base);
            if (i < n) dst[i++] = table[remainder];
        }

        bigint_free(tmp);
    }

    if (a->neg) if (i < n) dst[i++] = '-';
    BIGINT_REVERSE(char, dst, i);
    *n_dst = i;

    return dst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, (%rsp)
cmpl $0x1, %ecx
jbe 0x3830
movl %ecx, %ebp
cmpl $0x25, %ecx
jae 0x384f
movq %rsi, %r9
movl (%rsi), %r15d
testl %r8d, %r8d
setne %al
testl %r15d, %r15d
setg %cl
andb %al, %cl
xorl %r14d, %r14d
cmpb $0x1, %cl
jne 0x3727
movq (%rsp), %rax
movb $0x0, (%rax)
movl $0x1, %r14d
cmpl $0x0, 0xc(%rdx)
je 0x37b8
movq %r9, 0x18(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
movl $0x0, 0x10(%r12)
movq %r12, %rdi
movq %rdx, 0x10(%rsp)
movq %rdx, %rsi
callq 0x1c5e
cmpl $0x0, 0xc(%r12)
jle 0x37a2
leaq 0x20(%rsp), %r12
leaq 0xc(%rsp), %r13
leaq 0x1e0d(%rip), %rbx      # 0x5582
movq %r12, %rdi
movq %r13, %rsi
movl %ebp, %edx
callq 0x3212
cmpl %r15d, %r14d
jge 0x379b
movl 0xc(%rsp), %eax
movb (%rax,%rbx), %al
movslq %r14d, %rcx
incl %r14d
movq (%rsp), %rdx
movb %al, (%rdx,%rcx)
cmpl $0x0, 0x2c(%rsp)
jg 0x3775
movq 0x20(%rsp), %rdi
callq 0x1030
movq 0x18(%rsp), %r9
movq 0x10(%rsp), %rdx
jmp 0x37cb
cmpl %r15d, %r14d
jge 0x37cb
movl %r14d, %eax
incl %r14d
movq (%rsp), %rcx
movb $0x30, (%rcx,%rax)
cmpl $0x0, 0x8(%rdx)
je 0x37e4
cmpl %r15d, %r14d
jge 0x37e4
movslq %r14d, %rax
incl %r14d
movq (%rsp), %rcx
movb $0x2d, (%rcx,%rax)
cmpl $0x2, %r14d
jl 0x381a
movl %r14d, %eax
shrl %eax
movl %r14d, %ecx
movq (%rsp), %rsi
addq %rsi, %rcx
decq %rcx
negq %rax
xorl %edx, %edx
movb (%rsi), %dil
movb (%rcx,%rdx), %r8b
movb %r8b, (%rsi)
movb %dil, (%rcx,%rdx)
incq %rsi
decq %rdx
cmpq %rdx, %rax
jne 0x3801
movl %r14d, (%r9)
movq (%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d70(%rip), %rdi      # 0x55a7
leaq 0x19d5(%rip), %rsi      # 0x5213
leaq 0x1d70(%rip), %rcx      # 0x55b5
movl $0x3de, %edx            # imm = 0x3DE
callq 0x1060
leaq 0x1da8(%rip), %rdi      # 0x55fe
leaq 0x19b6(%rip), %rsi      # 0x5213
leaq 0x1d51(%rip), %rcx      # 0x55b5
movl $0x3df, %edx            # imm = 0x3DF
callq 0x1060
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_rand_bits
bigint* bigint_rand_bits(bigint *dst, int n_bits, bigint_rand_func rand_func){
    int n_word_bits = n_bits % BIGINT_WORD_BITS;
    int n_words = n_bits / BIGINT_WORD_BITS + (n_word_bits != 0);

    bigint_reserve(dst, n_words);

    rand_func((uint8_t*)dst->words, sizeof(*dst->words) * n_words);

    if (n_word_bits){
        dst->words[n_words - 1] >>= BIGINT_WORD_BITS - n_word_bits;
    }

    dst->size = bigint_raw_truncate(dst->words, n_words);
    return dst;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rdi, %rbx
movslq %esi, %r12
movq %r12, %rax
shrq $0x5, %rax
xorl %r14d, %r14d
movl %r12d, %ecx
andl $0x1f, %ecx
setne %r14b
addq %rax, %r14
movl %r14d, %esi
callq 0x1a71
movq (%rbx), %rdi
leal (,%r14,4), %esi
callq *%r15
andl $0x1f, %r12d
je 0x3900
movq (%rbx), %rax
movq %r14, %rcx
shlq $0x20, %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
addq %rcx, %rdx
sarq $0x1e, %rdx
movb $0x20, %cl
subb %r12b, %cl
shrl %cl, (%rax,%rdx)
testl %r14d, %r14d
jle 0x3922
movq (%rbx), %rax
movl %r14d, %ecx
cmpl $0x0, -0x4(%rax,%rcx,4)
jne 0x3922
leal -0x1(%r14), %ecx
cmpl $0x1, %r14d
movl %ecx, %r14d
jg 0x3908
xorl %r14d, %r14d
movl %r14d, 0xc(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_rand_inclusive
bigint* bigint_rand_inclusive(
    bigint *dst,
    const bigint *n,
    bigint_rand_func rand_func
){
    int n_bits = bigint_bitlength(n);

    do {
        bigint_rand_bits(dst, n_bits, rand_func);
    } while (bigint_cmp(dst, n) > 0);

    return dst;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0xc(%rsi), %r12d
testl %r12d, %r12d
jle 0x3978
movq (%r15), %rax
decl %r12d
movl (%rax,%r12,4), %ecx
movl $0x20, %eax
leal -0x1(%rax), %edx
movzbl %dl, %edx
btl %edx, %ecx
jb 0x396f
decl %eax
jne 0x395e
xorl %eax, %eax
shll $0x5, %r12d
addl %eax, %r12d
jmp 0x397b
xorl %r12d, %r12d
movq %r14, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq 0x3899
movq (%r14), %rdi
movl 0xc(%r14), %esi
movl 0x8(%r14), %edx
movq (%r15), %rcx
movl 0xc(%r15), %r8d
movl 0x8(%r15), %r9d
callq 0x1b6d
testl %eax, %eax
jg 0x397b
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_rand_exclusive
bigint* bigint_rand_exclusive(
    bigint *dst,
    const bigint *n,
    bigint_rand_func rand_func
){
    int n_bits = bigint_bitlength(n);

    do {
        bigint_rand_bits(dst, n_bits, rand_func);
    } while (bigint_cmp(dst, n) >= 0);

    return dst;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0xc(%rsi), %r12d
testl %r12d, %r12d
jle 0x39fa
movq (%r15), %rax
decl %r12d
movl (%rax,%r12,4), %ecx
movl $0x20, %eax
leal -0x1(%rax), %edx
movzbl %dl, %edx
btl %edx, %ecx
jb 0x39f1
decl %eax
jne 0x39e0
xorl %eax, %eax
shll $0x5, %r12d
addl %eax, %r12d
jmp 0x39fd
xorl %r12d, %r12d
movq %r14, %rdi
movl %r12d, %esi
movq %rbx, %rdx
callq 0x3899
movq (%r14), %rdi
movl 0xc(%r14), %esi
movl 0x8(%r14), %edx
movq (%r15), %rcx
movl 0xc(%r15), %r8d
movl 0x8(%r15), %r9d
callq 0x1b6d
testl %eax, %eax
jns 0x39fd
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_pow_mod
bigint* bigint_pow_mod(
    bigint *dst,
    const bigint *src_base,
    const bigint *src_exponent,
    const bigint *src_modulus
){
    bigint base[1], exponent[1], tmp[1], unused[1], modulus[1];

    bigint_init(base);
    bigint_init(exponent);
    bigint_init(tmp);
    bigint_init(unused);
    bigint_init(modulus);

    bigint_cpy(exponent, src_exponent);
    bigint_cpy(modulus, src_modulus);
    bigint_div_mod(unused, base, src_base, modulus);
    bigint_from_word(dst, 1);

    for (; exponent->size; bigint_shift_right(exponent, exponent, 1)){
        if (bigint_get_bit(exponent, 0)){
            bigint_mul(tmp, dst, base);
            bigint_div_mod(unused, dst, tmp, modulus);
        }
        bigint_mul(tmp, base, base);
        bigint_div_mod(unused, base, tmp, modulus);
    }

    bigint_free(base);
    bigint_free(exponent);
    bigint_free(tmp);
    bigint_free(unused);
    bigint_free(modulus);
    return dst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rcx, %r12
movq %rsi, 0x38(%rsp)
movq %rdi, %rbx
xorps %xmm0, %xmm0
leaq 0x60(%rsp), %r13
movaps %xmm0, (%r13)
xorl %eax, %eax
movl %eax, 0x10(%r13)
movq %rsp, %r14
movaps %xmm0, (%r14)
movl %eax, 0x10(%r14)
movaps %xmm0, 0x20(%rsp)
movl %eax, 0x30(%rsp)
leaq 0x40(%rsp), %rbp
movaps %xmm0, (%rbp)
movl %eax, 0x10(%rbp)
leaq 0x80(%rsp), %r15
movaps %xmm0, (%r15)
movl %eax, 0x10(%r15)
movq %r14, %rdi
movq %rdx, %rsi
callq 0x1c5e
movq %r15, %rdi
movq %r12, %rsi
callq 0x1c5e
movq %rbp, %rdi
movq %r13, %rsi
movq 0x38(%rsp), %rdx
movq %r15, %rcx
callq 0x2f84
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1a71
movq (%rbx), %rax
movl $0x1, (%rax)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%rbx)
movl 0xc(%r14), %eax
testl %eax, %eax
je 0x3b6a
leaq 0x20(%rsp), %r14
leaq 0x60(%rsp), %r15
leaq 0x40(%rsp), %r12
leaq 0x80(%rsp), %r13
movq %rsp, %rbp
testl %eax, %eax
jle 0x3b33
movq (%rsp), %rax
testb $0x1, (%rax)
je 0x3b33
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2632
movq %r12, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x2f84
movq %r14, %rdi
movq %r15, %rsi
movq %r15, %rdx
callq 0x2632
movq %r12, %rdi
movq %r15, %rsi
movq %r14, %rdx
movq %r13, %rcx
callq 0x2f84
movq %rbp, %rdi
movq %rbp, %rsi
movl $0x1, %edx
callq 0x2ea3
movl 0xc(%rsp), %eax
testl %eax, %eax
jne 0x3b07
movq 0x60(%rsp), %rdi
callq 0x1030
xorl %ebp, %ebp
movl %ebp, 0x70(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movq (%rsp), %rdi
callq 0x1030
movl %ebp, 0x10(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movq 0x20(%rsp), %rdi
callq 0x1030
movl %ebp, 0x30(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq 0x40(%rsp), %rdi
callq 0x1030
movl %ebp, 0x50(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq 0x80(%rsp), %rdi
callq 0x1030
movq %rbx, %rax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_pow_word
bigint* bigint_pow_word(bigint *dst, const bigint *base, bigint_word exponent){
    bigint result[1], p[1];

    bigint_init(p);
    bigint_init(result);

    bigint_cpy(p, base);
    bigint_from_word(result, 1);

    for (; exponent; exponent >>= 1){
        if (exponent & 1){
            bigint_mul(result, result, p);
            exponent--;
        }
        bigint_mul(p, p, p);
    }

    bigint_cpy(dst, result);
    bigint_free(p);
    bigint_free(result);
    return dst;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebp
movq %rdi, %rbx
xorl %eax, %eax
movq %rsp, %rdi
movl %eax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
leaq 0x20(%rsp), %r14
movaps %xmm0, (%r14)
movl %eax, 0x10(%r14)
callq 0x1c5e
movq %r14, %rdi
movl $0x1, %esi
callq 0x1a71
movq (%r14), %rax
movl $0x1, (%rax)
movabsq $0x100000000, %rax      # imm = 0x100000000
movq %rax, 0x8(%r14)
testl %ebp, %ebp
je 0x3fb5
movq %rsp, %r14
leaq 0x20(%rsp), %r15
testb $0x1, %bpl
je 0x3f9c
movq %r15, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2632
decl %ebp
movq %r14, %rdi
movq %r14, %rsi
movq %r14, %rdx
callq 0x2632
movl %ebp, %eax
shrl %eax
cmpl $0x1, %ebp
movl %eax, %ebp
ja 0x3f86
leaq 0x20(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c5e
movq (%rsp), %rdi
callq 0x1030
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
movl $0x0, 0x10(%rsp)
movq (%r14), %rdi
callq 0x1030
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_raw_get_high_bits
void bigint_raw_get_high_bits(
    bigint_word *dst, int n_dst,
    const bigint_word *src_a, int na,
    int n_bits,
    int *n_bitlength
){
    int shift;
    *n_bitlength = bigint_raw_bitlength(src_a, na);
    shift = n_bits - *n_bitlength + 1;

    if (shift < 0) bigint_raw_shift_right(dst, n_dst, src_a, na, -shift);
    else           bigint_raw_shift_left (dst, n_dst, src_a, na, +shift);
}

// Assembly:
pushq %rbx
testl %ecx, %ecx
jle 0x4022
leal -0x1(%rcx), %eax
movl (%rdx,%rax,4), %r11d
movl $0x20, %r10d
leal -0x1(%r10), %ebx
movzbl %bl, %ebx
btl %ebx, %r11d
jb 0x401a
decl %r10d
jne 0x4005
xorl %r10d, %r10d
shll $0x5, %eax
addl %r10d, %eax
jmp 0x4024
xorl %eax, %eax
movl %eax, (%r9)
subl %eax, %r8d
cmpl $-0x2, %r8d
jg 0x4039
notl %r8d
popq %rbx
jmp 0x2cf0
incl %r8d
popq %rbx
jmp 0x2b05
// File: /workspace/github_c_makefile_star2_O1/983[P]bigint/bigint.c
// Function: bigint_double
double bigint_double(const bigint *src){
    /* assumes IEEE 754 floating point standard */
    int n, n_mant_bits = 52;
    uint64_t x = 0, exponent = 1023;
    double d;
    bigint_word tmp[20];

    if (src->size == 0) return 0.0;

    bigint_raw_get_high_bits(tmp, 20, src->words, src->size, n_mant_bits, &n);
    /* this bit is stored implicitely */
    bigint_raw_clr_bit(tmp, n_mant_bits);
    exponent--;
    exponent += n;
    memcpy(&x, tmp, sizeof(x));
    x |= exponent << n_mant_bits;

    memcpy(&d, &x, sizeof(d));
    return src->neg ? -d : d;
}

// Assembly:
movl 0xc(%rdi), %ecx
testl %ecx, %ecx
je 0x40b1
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
movq %rdi, %rbx
movq (%rdi), %rdx
leaq 0x10(%rsp), %r14
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movl $0x14, %esi
movl $0x34, %r8d
movq %r15, %r9
callq 0x3ff3
andb $-0x11, 0x6(%r14)
movl (%r15), %eax
shlq $0x34, %rax
movabsq $0x3fe0000000000000, %rcx # imm = 0x3FE0000000000000
addq %rax, %rcx
orq (%r14), %rcx
movq %rcx, %xmm0
cmpl $0x0, 0x8(%rbx)
je 0x40a7
pxor 0x1149(%rip), %xmm0     # 0x51f0
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
xorps %xmm0, %xmm0
retq
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSCircularBuffer.c
// Function: eaDSCircularBufferInitWithDetails
eaDSCircularBuffer eaDSCircularBufferInitWithDetails(size_t sizeOfData, void * (*dataCreate)(size_t), void * (*dataCopy)(void *, const void *, size_t), int (*dataCompare)(const void *, const void *, size_t), void (*dataClear)(void *), size_t capacity)
{
	eaDSCircularBuffer circularBuffer = (eaDSCircularBuffer) calloc(1, sizeof(struct _eaDSCircularBuffer));

	if (NULL == circularBuffer)
	{
		perror(NULL);
	}
	else
	{
		circularBuffer->Data = dataCreate(sizeOfData * capacity);

		if (NULL == circularBuffer->Data)
		{
			perror(NULL);
			free(circularBuffer);
			circularBuffer = NULL;
		}
		else
		{
			circularBuffer->Capacity = capacity;
			circularBuffer->SizeOfData = sizeOfData;
			circularBuffer->dataCreate = dataCreate;
			circularBuffer->dataCopy = dataCopy;
			circularBuffer->dataCompare = dataCompare;
			circularBuffer->dataClear = dataClear;
		}
	}

	return circularBuffer;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r13
movq %r8, (%rsp)
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %rbp
movq %rdi, %r14
movl $0x1, %edi
movl $0x50, %esi
callq 0x1060
testq %rax, %rax
je 0x12db
movq %rax, %rbx
movq %r13, %rdi
imulq %r14, %rdi
callq *%rbp
movq %rax, (%rbx)
testq %rax, %rax
je 0x12e6
movq %r13, 0x18(%rbx)
movq %r14, 0x28(%rbx)
movq %rbp, 0x30(%rbx)
movq %r12, 0x38(%rbx)
movq %r15, 0x40(%rbx)
movq (%rsp), %rax
movq %rax, 0x48(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
xorl %edi, %edi
callq 0x10b0
jmp 0x12c9
xorl %edi, %edi
callq 0x10b0
movq %rbx, %rdi
callq 0x10e0
xorl %ebx, %ebx
jmp 0x12c9
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSCircularBuffer.c
// Function: eaDSCircularBufferAdd
int eaDSCircularBufferAdd(eaDSCircularBuffer circularBuffer, const void * data, size_t len)
{
	if (circularBuffer->Stop)
	{
		return EXIT_FAILURE;
	}

	if (circularBuffer->Tail >= circularBuffer->Head)
	{
		if (len <= (circularBuffer->Capacity - circularBuffer->Tail))
		{
			circularBuffer->dataCopy((char *)circularBuffer->Data + circularBuffer->SizeOfData * circularBuffer->Tail, data, circularBuffer->SizeOfData * len);
			circularBuffer->Tail += len;

			if (circularBuffer->Tail == circularBuffer->Capacity)
			{
				circularBuffer->Tail = 0;
			}
		}
		else
		{
			if (len > (circularBuffer->Head + circularBuffer->Capacity - circularBuffer->Tail))
			{
				return EXIT_FAILURE;
			}
			else
			{
				circularBuffer->dataCopy((char *)circularBuffer->Data + circularBuffer->SizeOfData * circularBuffer->Tail, data, circularBuffer->SizeOfData * (circularBuffer->Capacity - circularBuffer->Tail));
				circularBuffer->dataCopy(circularBuffer->Data, (char *)data + circularBuffer->SizeOfData * (circularBuffer->Capacity - circularBuffer->Tail), circularBuffer->SizeOfData * (len - circularBuffer->Capacity + circularBuffer->Tail));
				circularBuffer->Tail = len - circularBuffer->Capacity + circularBuffer->Tail;
			}
		}
	}
	else
	{
		if (len > (circularBuffer->Head - circularBuffer->Tail))
		{
			return EXIT_FAILURE;
		}
		else
		{
			circularBuffer->dataCopy((char *)circularBuffer->Data + circularBuffer->SizeOfData * circularBuffer->Tail, data, circularBuffer->SizeOfData * len);
			circularBuffer->Tail += len;
		}
	}

	if (circularBuffer->Head == circularBuffer->Tail)
	{
		circularBuffer->Stop = 1;
	}

	return EXIT_SUCCESS;
}

// Assembly:
movl $0x1, %eax
cmpl $0x0, 0x20(%rdi)
je 0x1320
retq
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rcx
movq 0x10(%rdi), %rdi
subq %rdi, %rcx
jbe 0x135b
cmpq %r14, %rcx
jb 0x13fb
movq 0x28(%rbx), %rdx
imulq %rdx, %rdi
addq (%rbx), %rdi
imulq %r14, %rdx
movq %r15, %rsi
callq *0x38(%rbx)
jmp 0x13b8
movq 0x18(%rbx), %rsi
movq %rsi, %rdx
subq %rdi, %rdx
cmpq %r14, %rdx
jae 0x13c1
addq %rsi, %rcx
cmpq %r14, %rcx
jb 0x13fb
movq 0x28(%rbx), %rax
imulq %rax, %rdi
addq (%rbx), %rdi
imulq %rax, %rdx
movq %r15, %rsi
callq *0x38(%rbx)
movq 0x28(%rbx), %rax
movq 0x18(%rbx), %rsi
movq (%rbx), %rdi
movq 0x10(%rbx), %rcx
movq %r14, %rdx
subq %rsi, %rdx
subq %rcx, %rsi
imulq %rax, %rsi
addq %r15, %rsi
addq %rcx, %rdx
imulq %rax, %rdx
callq *0x38(%rbx)
subq 0x18(%rbx), %r14
addq 0x10(%rbx), %r14
movq %r14, %rcx
jmp 0x13e8
movq 0x28(%rbx), %rdx
imulq %rdx, %rdi
addq (%rbx), %rdi
imulq %r14, %rdx
movq %r15, %rsi
callq *0x38(%rbx)
addq 0x10(%rbx), %r14
movq %r14, 0x10(%rbx)
xorl %ecx, %ecx
cmpq 0x18(%rbx), %r14
cmovneq %r14, %rcx
movq %rcx, 0x10(%rbx)
xorl %eax, %eax
cmpq %rcx, 0x8(%rbx)
jne 0x13fb
movl $0x1, 0x20(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSCircularBuffer.c
// Function: eaDSCircularBufferGet
int eaDSCircularBufferGet(eaDSCircularBuffer circularBuffer, void * data, size_t numberOfData)
{
	if (numberOfData > circularBuffer->Capacity)
	{
		return EXIT_FAILURE;
	}

	if (circularBuffer->Tail < circularBuffer->Head)
	{
		if (numberOfData <= (circularBuffer->Capacity - circularBuffer->Head))
		{
			circularBuffer->dataCopy(data, (char *)circularBuffer->Data + circularBuffer->SizeOfData * circularBuffer->Head, circularBuffer->SizeOfData * numberOfData);
			circularBuffer->Head += numberOfData;

			if (circularBuffer->Head == circularBuffer->Capacity)
			{
				circularBuffer->Head = 0;
			}
		}
		else
		{
			if (numberOfData > (circularBuffer->Tail + circularBuffer->Capacity - circularBuffer->Head))
			{
				return EXIT_FAILURE;
			}
			else
			{
				circularBuffer->dataCopy(data, (char *)circularBuffer->Data + circularBuffer->SizeOfData * circularBuffer->Head, circularBuffer->SizeOfData * (circularBuffer->Capacity - circularBuffer->Head));
				circularBuffer->dataCopy((char *)data + circularBuffer->SizeOfData * (circularBuffer->Capacity - circularBuffer->Head),circularBuffer->Data, circularBuffer->SizeOfData * (numberOfData - circularBuffer->Capacity + circularBuffer->Head));
				circularBuffer->Head = numberOfData - circularBuffer->Capacity + circularBuffer->Head;
			}
		}
	}
	else
	{
		if (numberOfData > (circularBuffer->Tail - circularBuffer->Head))
		{
			return EXIT_FAILURE;
		}
		else
		{
			circularBuffer->dataCopy(data, (char *)circularBuffer->Data + circularBuffer->SizeOfData * circularBuffer->Head, circularBuffer->SizeOfData * numberOfData);
			circularBuffer->Head += numberOfData;
		}
	}

	return EXIT_SUCCESS;
}

// Assembly:
movq 0x18(%rdi), %rcx
movl $0x1, %eax
cmpq %rdx, %rcx
jb 0x14e4
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
movq %rdi, %rdx
subq %rsi, %rdx
jae 0x148f
movq %rcx, %rdx
subq %rsi, %rdx
cmpq %r14, %rdx
jae 0x14b2
addq %rcx, %rdi
subq %rsi, %rdi
cmpq %r14, %rdi
jb 0x14df
movq 0x28(%rbx), %rax
imulq %rax, %rsi
addq (%rbx), %rsi
imulq %rax, %rdx
movq %r15, %rdi
callq *0x38(%rbx)
movq 0x28(%rbx), %rax
movq 0x18(%rbx), %rdi
movq (%rbx), %rsi
movq 0x8(%rbx), %rcx
movq %r14, %rdx
subq %rdi, %rdx
subq %rcx, %rdi
imulq %rax, %rdi
addq %r15, %rdi
addq %rcx, %rdx
imulq %rax, %rdx
callq *0x38(%rbx)
subq 0x18(%rbx), %r14
jmp 0x14a9
cmpq %r14, %rdx
jb 0x14df
movq 0x28(%rbx), %rdx
imulq %rdx, %rsi
addq (%rbx), %rsi
imulq %r14, %rdx
movq %r15, %rdi
callq *0x38(%rbx)
addq 0x8(%rbx), %r14
movq %r14, %rax
jmp 0x14d9
movq 0x28(%rbx), %rdx
imulq %rdx, %rsi
addq (%rbx), %rsi
imulq %r14, %rdx
movq %r15, %rdi
callq *0x38(%rbx)
addq 0x8(%rbx), %r14
movq %r14, 0x8(%rbx)
xorl %eax, %eax
cmpq 0x18(%rbx), %r14
cmovneq %r14, %rax
movq %rax, 0x8(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSCircularBuffer.c
// Function: eaDSCircularBufferGetWhereIsIt
int eaDSCircularBufferGetWhereIsIt(const eaDSCircularBuffer circularBuffer, const void * data, size_t numberOfData, size_t * len)
{
	size_t i;

	if (circularBuffer->Head <= circularBuffer->Tail)
	{
		for (i = circularBuffer->Head; i < circularBuffer->Tail; ++i)
		{
			if (circularBuffer->dataCompare((char *)circularBuffer->Data + i, data, circularBuffer->SizeOfData * numberOfData) == 0)
			{
				*len = i - circularBuffer->Head;

				return EXIT_SUCCESS;
			}
		}
	}
	else
	{
		for (i = circularBuffer->Head; i < circularBuffer->Capacity; ++i)
		{
			if (circularBuffer->dataCompare((char *)circularBuffer->Data + i, data, circularBuffer->SizeOfData * numberOfData) == 0)
			{
				*len = i - circularBuffer->Head;

				return EXIT_SUCCESS;
			}
		}

		for (i = 0; i < circularBuffer->Tail; ++i)
		{
			if (circularBuffer->dataCompare((char *)circularBuffer->Data + i, data, circularBuffer->SizeOfData * numberOfData) == 0)
			{
				*len = i + circularBuffer->Capacity - circularBuffer->Head;

				return EXIT_SUCCESS;
			}
		}
	}

	return EXIT_FAILURE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movq 0x8(%rdi), %r13
cmpq 0x10(%rdi), %r13
jbe 0x152a
cmpq 0x18(%r14), %r13
jae 0x1553
movq (%r14), %rdi
addq %r13, %rdi
movq 0x28(%r14), %rdx
imulq %r15, %rdx
movq %r12, %rsi
callq *0x40(%r14)
testl %eax, %eax
je 0x158a
incq %r13
jmp 0x1506
movl $0x1, %ebp
cmpq 0x10(%r14), %r13
jae 0x1593
movq (%r14), %rdi
addq %r13, %rdi
movq 0x28(%r14), %rdx
imulq %r15, %rdx
movq %r12, %rsi
callq *0x40(%r14)
testl %eax, %eax
je 0x158a
incq %r13
jmp 0x152f
movl $0x1, %ebp
cmpq $0x0, 0x10(%r14)
je 0x1593
xorl %r13d, %r13d
movq (%r14), %rdi
addq %r13, %rdi
movq 0x28(%r14), %rdx
imulq %r15, %rdx
movq %r12, %rsi
callq *0x40(%r14)
testl %eax, %eax
je 0x1586
incq %r13
cmpq 0x10(%r14), %r13
jb 0x1562
jmp 0x1593
addq 0x18(%r14), %r13
subq 0x8(%r14), %r13
movq %r13, (%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSDynamicArray.c
// Function: eaDSDynamicArrayInitWithDetails
int eaDSDynamicArrayInitWithDetails(eaDSDynamicArray * dynamicArray, void * (*dataCreateAndCopy)(const void *), int (*dataCompare)(const void *, const void *), void (*dataClear)(void *), unsigned short expFactor, unsigned short startingCapacity)
{
	if (startingCapacity == 0)
		startingCapacity = DEFAULT_STARTING_CAPACITY;

	dynamicArray->Data = (void **) malloc(startingCapacity * sizeof(void *));

	if (NULL == dynamicArray->Data)
	{
		perror(NULL);
		return EXIT_FAILURE;
	}

	dynamicArray->Count = 0;
	dynamicArray->Capacity = startingCapacity;
	dynamicArray->StartingCapacity = startingCapacity;
	dynamicArray->ExpFactor = (expFactor < 2) ? DEFAULT_EXP_FACTOR : expFactor;
	dynamicArray->dataCreateAndCopy = (NULL == dataCreateAndCopy) ? copyAddress : dataCreateAndCopy;
	dynamicArray->dataCompare = (NULL == dataCompare) ? compareAddress : dataCompare;
	dynamicArray->dataClear = (NULL == dataClear) ? free : dataClear;

	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
testl %r9d, %r9d
movl $0x4, %r13d
cmovnel %r9d, %r13d
leal (,%r13,8), %edi
callq 0x1090
movq %rax, (%r14)
testq %rax, %rax
je 0x168c
movq $0x0, 0x8(%r14)
movq %r13, 0x10(%r14)
movw %r13w, 0x1a(%r14)
cmpw $0x3, %bp
movl $0x2, %eax
cmovael %ebp, %eax
testq %r12, %r12
leaq 0x4e(%rip), %rcx        # 0x169a
cmovneq %r12, %rcx
movw %ax, 0x18(%r14)
movq %rcx, 0x20(%r14)
testq %r15, %r15
leaq 0x3b(%rip), %rax        # 0x169e
cmovneq %r15, %rax
movq %rax, 0x28(%r14)
testq %rbx, %rbx
jne 0x1677
movq 0x4959(%rip), %rbx      # 0x5fd0
movq %rbx, 0x30(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
callq 0x10b0
movl $0x1, %eax
jmp 0x167d
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSDynamicArray.c
// Function: eaDSDynamicArrayReset
int eaDSDynamicArrayReset(eaDSDynamicArray * dynamicArray)
{
	if (NULL == dynamicArray->Data)
	{
		dynamicArray->Data = (void **) malloc(dynamicArray->Capacity * sizeof(void *));

		if (NULL == dynamicArray->Data)
		{
			perror(NULL);

			return EXIT_FAILURE;
		}
	}
	else
	{
		while (dynamicArray->Count)
		{
			dynamicArray->dataClear(dynamicArray->Data[--dynamicArray->Count]);
		}

		if (dynamicArray->StartingCapacity < dynamicArray->Capacity)
		{
			free(dynamicArray->Data);
			dynamicArray->Data = (void **) malloc(dynamicArray->StartingCapacity * sizeof(void *));

			if (NULL == dynamicArray->Data)
			{
				perror(NULL);

				return EXIT_FAILURE;
			}

			dynamicArray->Capacity = dynamicArray->StartingCapacity;
		}
	}

	return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpq $0x0, (%rdi)
je 0x1706
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x16d2
movq (%rbx), %rcx
leaq -0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq -0x8(%rcx,%rax,8), %rdi
callq *0x30(%rbx)
jmp 0x16b4
movzwl 0x1a(%rbx), %eax
xorl %ebp, %ebp
cmpq %rax, 0x10(%rbx)
jbe 0x171d
movq (%rbx), %rdi
callq 0x10e0
movzwl 0x1a(%rbx), %r14d
leal (,%r14,8), %edi
callq 0x1090
movq %rax, (%rbx)
testq %rax, %rax
je 0x1724
movq %r14, 0x10(%rbx)
jmp 0x171d
movq 0x10(%rbx), %rdi
shlq $0x3, %rdi
callq 0x1090
movq %rax, (%rbx)
xorl %ebp, %ebp
testq %rax, %rax
je 0x1724
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
xorl %edi, %edi
callq 0x10b0
movl $0x1, %ebp
jmp 0x171d
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSDynamicArray.c
// Function: eaDSDynamicArrayClear
void eaDSDynamicArrayClear(eaDSDynamicArray * dynamicArray)
{
	if (NULL != dynamicArray->Data)
	{
		while (dynamicArray->Count)
		{
			dynamicArray->dataClear(dynamicArray->Data[--dynamicArray->Count]);
		}

		free(dynamicArray->Data);
	}
}

// Assembly:
cmpq $0x0, (%rdi)
je 0x1763
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x175a
movq (%rbx), %rcx
leaq -0x1(%rax), %rdx
movq %rdx, 0x8(%rbx)
movq -0x8(%rcx,%rax,8), %rdi
callq *0x30(%rbx)
jmp 0x173c
movq (%rbx), %rdi
popq %rbx
jmp 0x10e0
retq
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSDynamicArray.c
// Function: eaDSDynamicArraySort
void eaDSDynamicArraySort(eaDSDynamicArray * dynamicArray)
{
	void * buf;
	size_t i, j, N = dynamicArray->Count;

	for (i = 1; i < N; i++)
	{
		for (j = i; (0 < j) && (dynamicArray->dataCompare(dynamicArray->Data[j - 1], dynamicArray->Data[j]) > 0); j--)
		{
			buf = dynamicArray->Data[j];
			dynamicArray->Data[j] = dynamicArray->Data[j - 1];
			dynamicArray->Data[j - 1] = buf;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq 0x8(%rdi), %r14
cmpq $0x2, %r14
jb 0x17c2
movq %rdi, %rbx
movl $0x1, %r15d
xorl %r12d, %r12d
movq %r12, %r13
movq (%rbx), %rax
movq (%rax,%r13,8), %rdi
movq 0x8(%rax,%r13,8), %rsi
callq *0x28(%rbx)
testl %eax, %eax
jle 0x17b7
movq (%rbx), %rax
movq (%rax,%r13,8), %rcx
movq 0x8(%rax,%r13,8), %rdx
movq %rcx, 0x8(%rax,%r13,8)
movq (%rbx), %rax
movq %rdx, (%rax,%r13,8)
addq $-0x1, %r13
jb 0x1786
incq %r15
incq %r12
cmpq %r14, %r15
jne 0x1783
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Enes1313[P]DataStructures/DS/eaDSDynamicArray.c
// Function: eaDSDynamicArrayAdd
int eaDSDynamicArrayAdd(eaDSDynamicArray * dynamicArray, const void * data)
{
	void * item = dynamicArray->dataCreateAndCopy(data);

	if (NULL == item)
	{
		perror(NULL);

		return EXIT_FAILURE;
	}

	if (dynamicArray->Count == dynamicArray->Capacity)
	{
		void ** tmp;

		dynamicArray->Capacity *= dynamicArray->ExpFactor;
		tmp = (void **) realloc(dynamicArray->Data, dynamicArray->Capacity * sizeof(void *));

		if (NULL == tmp)
		{
			perror(NULL);
			dynamicArray->Capacity /= dynamicArray->ExpFactor;

			return EXIT_FAILURE;
		}

		dynamicArray->Data = tmp;
	}

	dynamicArray->Data[dynamicArray->Count] = item;
	dynamicArray->Count++;

	return EXIT_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq *0x20(%rbx)
testq %rax, %rax
je 0x1834
movq %rax, %r14
movq 0x10(%rbx), %rsi
cmpq %rsi, 0x8(%rbx)
jne 0x181e
movzwl 0x18(%rbx), %eax
imulq %rax, %rsi
movq %rsi, 0x10(%rbx)
movq (%rbx), %rdi
shlq $0x3, %rsi
callq 0x10a0
movq %rax, %r15
testq %rax, %rax
je 0x1846
movq %r15, (%rbx)
testq %r15, %r15
je 0x183b
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
movq %r14, (%rax,%rcx,8)
incq %rcx
movq %rcx, 0x8(%rbx)
xorl %eax, %eax
jmp 0x1840
xorl %edi, %edi
callq 0x10b0
movl $0x1, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x10(%rbx), %rsi
leaq 0x18(%rbx), %rdi
callq 0x10f0
jmp 0x1819