LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: umatin[P]LogarithmicErrorRegression/./src/irls.h
// Function: weighted_simple_regression(std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&)
linear_regression weighted_simple_regression(std::vector<double>& data, std::vector<double>& weights){
    long double x_mean = weighted_mean_x(data, weights);
    long double y_mean = weighted_mean_y(weights);

    long double top = 0;
    long double bot = 0;
    for(int i = 0; i < data.size(); i++){
        top += weights[i] * (data[i] - x_mean) * ((long double)i - y_mean);
        bot += weights[i] * (data[i] - x_mean) * (data[i] - x_mean);
    }

    double a = top/bot;
    double b = y_mean - (a * x_mean);
    return linear_regression(a,b);
}

// Assembly:
subq $0xe8, %rsp
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq 0xd0(%rsp), %rsi
leaq 0x98(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x6460
movq 0x30(%rsp), %rdi
movq 0xc8(%rsp), %rsi
callq 0x30b0
movq 0x30(%rsp), %rdi
fstpt 0x38(%rsp)
callq 0x6560
fldt 0x38(%rsp)
fstpt 0xb0(%rsp)
movq 0xc8(%rsp), %rdi
callq 0x3170
fstpt 0x80(%rsp)
fldz
fld %st(0)
fstpt 0x70(%rsp)
fstpt 0x60(%rsp)
movl $0x0, 0x5c(%rsp)
movslq 0x5c(%rsp), %rax
movq %rax, 0x28(%rsp)
movq 0xd0(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x28(%rsp), %rax
cmpq %rcx, %rax
jae 0x3398
movq 0xc8(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0x6390
fldl (%rax)
fstpt 0x4(%rsp)
movq 0xd0(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0x6390
fldt 0x4(%rsp)
fldl (%rax)
fldt 0xb0(%rsp)
fsubrp %st, %st(1)
fmulp %st, %st(1)
movl 0x5c(%rsp), %eax
movl %eax, 0x44(%rsp)
fildl 0x44(%rsp)
fldt 0x80(%rsp)
fsubrp %st, %st(1)
fldt 0x70(%rsp)
fxch %st(2)
fmulp %st, %st(1)
faddp %st, %st(1)
fstpt 0x70(%rsp)
movq 0xc8(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0x6390
fldl (%rax)
fstpt 0x10(%rsp)
movq 0xd0(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0x6390
fldt 0x10(%rsp)
fldl (%rax)
fldt 0xb0(%rsp)
fsubrp %st, %st(1)
fmulp %st, %st(1)
fstpt 0x1c(%rsp)
movq 0xd0(%rsp), %rdi
movslq 0x5c(%rsp), %rsi
callq 0x6390
fldt 0x1c(%rsp)
fldl (%rax)
fldt 0xb0(%rsp)
fsubrp %st, %st(1)
fldt 0x60(%rsp)
fxch %st(2)
fmulp %st, %st(1)
faddp %st, %st(1)
fstpt 0x60(%rsp)
movl 0x5c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x5c(%rsp)
jmp 0x3294
fldt 0x70(%rsp)
fldt 0x60(%rsp)
fdivrp %st, %st(1)
fstpl 0x50(%rsp)
fldt 0x80(%rsp)
fldl 0x50(%rsp)
fldt 0xb0(%rsp)
fmulp %st, %st(1)
fsubrp %st, %st(1)
fstpl 0x48(%rsp)
vmovsd 0x50(%rsp), %xmm0
vmovsd 0x48(%rsp), %xmm1
leaq 0xd8(%rsp), %rdi
callq 0x63b0
vmovsd 0xd8(%rsp), %xmm0
vmovsd 0xe0(%rsp), %xmm1
addq $0xe8, %rsp
retq
nopw %cs:(%rax,%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/helpers/../exponential_search.h
// Function: exponential_search_lower_bound(int, double, std::vector<double, std::allocator<double>>&)
int exponential_search_lower_bound(int m, double key, std::vector<double> & data) {
    // Continue doubling the bound until it contains the lower bound. Then use
    // binary search.
    int bound = 1;
    int l, r;  // will do binary search in range [l, r)
    if (data[m] >= key) {
        int size = m;
        while (bound < size && data[m - bound] >= key) {
            bound *= 2;
        }
        l = m - std::min<int>(bound, size);
        r = m - bound / 2;
    } else {
        int size = data.size() - m;
        while (bound < size && data[m + bound] < key) {
            bound *= 2;
        }
        l = m + bound / 2;
        r = m + std::min<int>(bound, size);
    }
    return binary_search_lower_bound(l, r, key, data);
}

// Assembly:
subq $0x48, %rsp
movl %edi, 0x44(%rsp)
vmovsd %xmm0, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movl $0x1, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movslq 0x44(%rsp), %rsi
callq 0x6390
vmovsd (%rax), %xmm0
vucomisd 0x38(%rsp), %xmm0
jb 0x34d7
movl 0x44(%rsp), %eax
movl %eax, 0x20(%rsp)
movl 0x2c(%rsp), %ecx
xorl %eax, %eax
cmpl 0x20(%rsp), %ecx
movb %al, 0x1b(%rsp)
jge 0x3478
movq 0x30(%rsp), %rdi
movl 0x44(%rsp), %eax
subl 0x2c(%rsp), %eax
movslq %eax, %rsi
callq 0x6390
vmovsd (%rax), %xmm0
vucomisd 0x38(%rsp), %xmm0
setae %al
movb %al, 0x1b(%rsp)
movb 0x1b(%rsp), %al
testb $0x1, %al
jne 0x3482
jmp 0x348e
movl 0x2c(%rsp), %eax
shll %eax
movl %eax, 0x2c(%rsp)
jmp 0x3442
movl 0x44(%rsp), %eax
movl %eax, 0x10(%rsp)
leaq 0x2c(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x65c0
movq %rax, %rcx
movl 0x10(%rsp), %eax
subl (%rcx), %eax
movl %eax, 0x28(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x14(%rsp)
movl 0x2c(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0x14(%rsp), %eax
subl %ecx, %eax
movl %eax, 0x24(%rsp)
jmp 0x3581
movq 0x30(%rsp), %rdi
callq 0x6400
movslq 0x44(%rsp), %rcx
subq %rcx, %rax
movl %eax, 0x1c(%rsp)
movl 0x2c(%rsp), %ecx
xorl %eax, %eax
cmpl 0x1c(%rsp), %ecx
movb %al, 0xf(%rsp)
jge 0x3527
movq 0x30(%rsp), %rdi
movl 0x44(%rsp), %eax
addl 0x2c(%rsp), %eax
movslq %eax, %rsi
callq 0x6390
vmovsd (%rax), %xmm1
vmovsd 0x38(%rsp), %xmm0
vucomisd %xmm1, %xmm0
seta %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
testb $0x1, %al
jne 0x3531
jmp 0x353d
movl 0x2c(%rsp), %eax
shll %eax
movl %eax, 0x2c(%rsp)
jmp 0x34ed
movl 0x44(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x2c(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0x4(%rsp), %eax
addl %ecx, %eax
movl %eax, 0x28(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x8(%rsp)
leaq 0x2c(%rsp), %rdi
leaq 0x1c(%rsp), %rsi
callq 0x65c0
movq %rax, %rcx
movl 0x8(%rsp), %eax
addl (%rcx), %eax
movl %eax, 0x24(%rsp)
movl 0x28(%rsp), %edi
movl 0x24(%rsp), %esi
vmovsd 0x38(%rsp), %xmm0
movq 0x30(%rsp), %rdx
callq 0x6600
addq $0x48, %rsp
retq
nop
// File: umatin[P]LogarithmicErrorRegression/./src/helpers/regression_benchmark.h
// Function: benchmark_lookup_linear_regression(std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>, linear_regression)
long benchmark_lookup_linear_regression(std::vector<double> & data, std::vector<double> lookups, linear_regression lr){ 
    int data_size = data.size()-1;
    auto start = std::chrono::high_resolution_clock::now();
    
    for(int i = 0; i < lookups.size(); i++){
        long pos = lr.predict(lookups[i]);
        pos = std::max<long>(std::min<long>(pos, data_size), 0);
        DoNotOptimize(exponential_search_lower_bound_linear_head(pos, lookups[i], data));
    }

    auto stop = std::chrono::high_resolution_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);

    return duration.count();
}

// Assembly:
subq $0x88, %rsp
movq %rsi, 0x10(%rsp)
vmovsd %xmm0, 0x78(%rsp)
vmovsd %xmm1, 0x80(%rsp)
movq %rdi, 0x70(%rsp)
movq %rsi, 0x68(%rsp)
movq 0x70(%rsp), %rdi
callq 0x6400
subq $0x1, %rax
movl %eax, 0x64(%rsp)
callq 0x2030
movq %rax, 0x58(%rsp)
movl $0x0, 0x54(%rsp)
movq 0x10(%rsp), %rdi
movslq 0x54(%rsp), %rax
movq %rax, 0x8(%rsp)
callq 0x6400
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x3b04
movq 0x10(%rsp), %rdi
movslq 0x54(%rsp), %rsi
callq 0x6390
vmovsd (%rax), %xmm0
leaq 0x78(%rsp), %rdi
callq 0x6680
vcvttsd2si %xmm0, %rax
movq %rax, 0x48(%rsp)
movslq 0x64(%rsp), %rax
movq %rax, 0x40(%rsp)
leaq 0x48(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x66f0
movq %rax, %rdi
movq $0x0, 0x38(%rsp)
leaq 0x38(%rsp), %rsi
callq 0x66b0
movq 0x10(%rsp), %rdi
movq (%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movl %eax, 0x4(%rsp)
movslq 0x54(%rsp), %rsi
callq 0x6390
movl 0x4(%rsp), %edi
vmovsd (%rax), %xmm0
movq 0x70(%rsp), %rsi
callq 0x35a0
movl %eax, 0x34(%rsp)
leaq 0x34(%rsp), %rdi
callq 0x6730
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x3a39
callq 0x2030
movq %rax, 0x28(%rsp)
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x6770
movq %rax, 0x18(%rsp)
leaq 0x18(%rsp), %rdi
callq 0x6740
movq %rax, 0x20(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x67c0
addq $0x88, %rsp
retq
nopw %cs:(%rax,%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/helpers/regression_benchmark.h
// Function: perform_benchmark(linear_regression, std::vector<double, std::allocator<double>>&, std::vector<double, std::allocator<double>>&, int)
std::vector<long> perform_benchmark(linear_regression lr, std::vector<double>& data, std::vector<double>& lookups, int num){
    std::vector<long> measurements;
    for (int i = 0; i < num; i++){
        long time = benchmark_lookup_linear_regression(data, lookups, lr);
        measurements.push_back(time);
    }

    std::sort(measurements.begin(), measurements.end());
    return measurements;
}

// Assembly:
subq $0xa8, %rsp
movq %rdi, 0x10(%rsp)
movq %rdi, %rax
movq %rax, 0x18(%rsp)
movq %rdi, 0xa0(%rsp)
vmovsd %xmm0, 0x90(%rsp)
vmovsd %xmm1, 0x98(%rsp)
movq %rsi, 0x88(%rsp)
movq %rdx, 0x80(%rsp)
movl %ecx, 0x7c(%rsp)
movb $0x0, 0x7b(%rsp)
callq 0x67d0
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jge 0x3c63
movq 0x88(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x80(%rsp), %rsi
leaq 0x50(%rsp), %rdi
callq 0x6460
jmp 0x3bd3
movq 0x8(%rsp), %rdi
vmovdqu 0x90(%rsp), %xmm0
vmovdqa %xmm0, 0x30(%rsp)
vmovsd 0x30(%rsp), %xmm0
vmovsd 0x38(%rsp), %xmm1
leaq 0x50(%rsp), %rsi
callq 0x39f0
movq %rax, (%rsp)
jmp 0x3c03
leaq 0x50(%rsp), %rdi
callq 0x6560
movq (%rsp), %rax
movq 0x10(%rsp), %rdi
movq %rax, 0x68(%rsp)
leaq 0x68(%rsp), %rsi
callq 0x67e0
jmp 0x3c27
jmp 0x3c29
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x3ba4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
jmp 0x3cb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x48(%rsp)
movl %eax, 0x44(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x6560
jmp 0x3cb5
movq 0x10(%rsp), %rdi
callq 0x6890
movq 0x10(%rsp), %rdi
movq %rax, 0x28(%rsp)
callq 0x68c0
movq %rax, 0x20(%rsp)
movq 0x28(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0x6850
jmp 0x3c92
movb $0x1, 0x7b(%rsp)
testb $0x1, 0x7b(%rsp)
jne 0x3ca8
movq 0x10(%rsp), %rdi
callq 0x68f0
movq 0x18(%rsp), %rax
addq $0xa8, %rsp
retq
movq 0x10(%rsp), %rdi
callq 0x68f0
movq 0x48(%rsp), %rdi
callq 0x23b0
nopl (%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/helpers/io_handler.h
// Function: std::vector<unsigned long, std::allocator<unsigned long>> load_data<unsigned long>(char*)
static std::vector<T> load_data(char * filename_cs) {
    std::string filename(filename_cs);
    std::vector<T> data;

    std::ifstream in(filename, std::ios::binary);
    if (!in.is_open()) {
        std::cerr << "unable to open " << filename << std::endl;
        exit(EXIT_FAILURE);
    }
    // Read size.
    uint64_t size;
    in.read(reinterpret_cast<char*>(&size), sizeof(uint64_t));
    data.resize(size);
    // Read values.
    in.read(reinterpret_cast<char*>(data.data()), size*sizeof(T));
    in.close();
    
    return data;
}

// Assembly:
subq $0x298, %rsp            # imm = 0x298
movq %rdi, 0x20(%rsp)
movq %rdi, %rax
movq %rax, 0x28(%rsp)
movq %rdi, 0x290(%rsp)
movq %rsi, 0x288(%rsp)
movq 0x288(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0x267(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x23c0
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x268(%rsp), %rdi
callq 0x73f0
jmp 0x497c
leaq 0x267(%rsp), %rdi
callq 0x2260
movq 0x20(%rsp), %rdi
movb $0x0, 0x253(%rsp)
callq 0x6950
leaq 0x48(%rsp), %rdi
leaq 0x268(%rsp), %rsi
movl $0x4, %edx
callq 0x2340
jmp 0x49b4
leaq 0x48(%rsp), %rdi
callq 0x2330
movb %al, 0x1f(%rsp)
jmp 0x49c4
movb 0x1f(%rsp), %al
testb $0x1, %al
jne 0x4a84
jmp 0x49d2
movq 0x16617(%rip), %rdi     # 0x1aff0
leaq 0x10840(%rip), %rsi     # 0x15220
callq 0x2210
movq %rax, 0x10(%rsp)
jmp 0x49ec
movq 0x10(%rsp), %rdi
leaq 0x268(%rsp), %rsi
callq 0x21d0
movq %rax, 0x8(%rsp)
jmp 0x4a05
movq 0x8(%rsp), %rdi
movq 0x165af(%rip), %rsi     # 0x1afc0
callq 0x2240
jmp 0x4a18
movl $0x1, %edi
callq 0x2290
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0x267(%rsp), %rdi
callq 0x2260
jmp 0x4b30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
jmp 0x4b19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x258(%rsp)
movl %eax, 0x254(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x2070
jmp 0x4b19
leaq 0x48(%rsp), %rdi
leaq 0x40(%rsp), %rsi
movl $0x8, %edx
callq 0x22b0
jmp 0x4a9a
movq 0x20(%rsp), %rdi
movq 0x40(%rsp), %rsi
callq 0xfbe0
jmp 0x4aab
movq 0x20(%rsp), %rdi
callq 0xfc80
movq %rax, %rsi
movq 0x40(%rsp), %rdx
shlq $0x3, %rdx
leaq 0x48(%rsp), %rdi
callq 0x22b0
jmp 0x4acd
leaq 0x48(%rsp), %rdi
callq 0x2050
jmp 0x4ad9
movb $0x1, 0x253(%rsp)
leaq 0x48(%rsp), %rdi
callq 0x2070
testb $0x1, 0x253(%rsp)
jne 0x4aff
movq 0x20(%rsp), %rdi
callq 0x6960
leaq 0x268(%rsp), %rdi
callq 0x2120
movq 0x28(%rsp), %rax
addq $0x298, %rsp            # imm = 0x298
retq
movq 0x20(%rsp), %rdi
callq 0x6960
leaq 0x268(%rsp), %rdi
callq 0x2120
movq 0x258(%rsp), %rdi
callq 0x23b0
nopl (%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/fast_brute_force.h
// Function: build_regression(std::vector<double, std::allocator<double>>&)
linear_regression build_regression(std::vector<double>& data){
    long min_cost = std::numeric_limits<long>::max();
    linear_regression lr_opt;
    
    for(int i = 0; i < data.size(); i++){
        double a,b;
        std::pair<linear_regression, long> p = build_regression_i(data, i);
        linear_regression lr = p.first;
        long cost = p.second;
        if(cost < min_cost){
            min_cost = cost;
            lr_opt = lr;
        }
    }
    return lr_opt;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x60(%rsp)
callq 0x7320
movq %rax, 0x58(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x7330
movl $0x0, 0x54(%rsp)
movslq 0x54(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x5714
movq 0x60(%rsp), %rsi
movslq 0x54(%rsp), %rdx
leaq 0x28(%rsp), %rdi
callq 0x4ee0
movq 0x28(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpq 0x58(%rsp), %rax
jge 0x5702
movq 0x10(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x70(%rsp)
jmp 0x5704
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x5685
vmovsd 0x68(%rsp), %xmm0
vmovsd 0x70(%rsp), %xmm1
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/fast_brute_force.h
// Function: find_min_idx(std::vector<double, std::allocator<double>>&, linear_regression, long)
long find_min_idx(std::vector<double>& data, linear_regression lr, long selfi){
    long min_idx = -1;
    double min_err = std::numeric_limits<double>::infinity();
    for(int i = 0; i < data.size(); i++){
        if(i != selfi){
            double err = calculate_error_single_element<L1Norm, false, false>(data, lr.a, lr.b, i);
            if (err < min_err){
                min_idx = i;
                min_err = err;
            }
        }
    }
    return min_idx;
}

// Assembly:
subq $0x48, %rsp
vmovsd %xmm0, 0x38(%rsp)
vmovsd %xmm1, 0x40(%rsp)
movq %rdi, 0x30(%rsp)
movq %rsi, 0x28(%rsp)
movq $-0x1, 0x20(%rsp)
callq 0x63f0
vmovsd %xmm0, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
movslq 0x14(%rsp), %rax
movq %rax, (%rsp)
movq 0x30(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0x57ed
movslq 0x14(%rsp), %rax
cmpq 0x28(%rsp), %rax
je 0x57db
movq 0x30(%rsp), %rdi
vmovsd 0x38(%rsp), %xmm0
vmovsd 0x40(%rsp), %xmm1
movl 0x14(%rsp), %esi
callq 0x7350
vmovsd %xmm0, 0x8(%rsp)
vmovsd 0x8(%rsp), %xmm1
vmovsd 0x18(%rsp), %xmm0
vucomisd %xmm1, %xmm0
jbe 0x57d9
movslq 0x14(%rsp), %rax
movq %rax, 0x20(%rsp)
vmovsd 0x8(%rsp), %xmm0
vmovsd %xmm0, 0x18(%rsp)
jmp 0x57db
jmp 0x57dd
movl 0x14(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x14(%rsp)
jmp 0x5766
movq 0x20(%rsp), %rax
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/fast_brute_force.h
// Function: build_regression_direct_descent(std::vector<double, std::allocator<double>>&, int)
linear_regression build_regression_direct_descent(std::vector<double>& data, int num){
    srand(time(nullptr));
    long index = rand()%data.size();

    linear_regression lr;
    for(int i = 0; i < num; i++){
        double a,b;
        std::pair<linear_regression, long> p = build_regression_i(data, index);
        lr = p.first;
        long cost = p.second;
        index = find_min_idx(data, lr, index);
        //std::cout << calculate_error<DiscreteLogNorm>(data, lr) << std::endl;
    }
    return lr;
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x60(%rsp)
movl %esi, 0x5c(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0x21e0
movl %eax, %edi
callq 0x2200
callq 0x2080
cltq
movq %rax, (%rsp)
movq 0x60(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq (%rsp), %rax
xorl %edx, %edx
divq %rcx
movq %rdx, 0x50(%rsp)
leaq 0x68(%rsp), %rdi
callq 0x7330
movl $0x0, 0x4c(%rsp)
movl 0x4c(%rsp), %eax
cmpl 0x5c(%rsp), %eax
jge 0x58d2
movq 0x60(%rsp), %rsi
movq 0x50(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x4ee0
movq 0x20(%rsp), %rax
movq %rax, 0x68(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x70(%rsp)
movq 0x30(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x50(%rsp), %rsi
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
callq 0x5730
movq %rax, 0x50(%rsp)
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x5855
vmovsd 0x68(%rsp), %xmm0
vmovsd 0x70(%rsp), %xmm1
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/helpers/../exponential_search.h
// Function: binary_search_lower_bound(int, int, double, std::vector<double, std::allocator<double>>&)
inline int binary_search_lower_bound(int l, int r, const double key, std::vector<double> & data) {
    while (l < r) {
        int mid = l + (r - l) / 2;
        if (data[mid] >= key) {
            r = mid;    
        } else {
            l = mid + 1;
        }
    }
    return l;
}

// Assembly:
subq $0x28, %rsp
movl %edi, 0x24(%rsp)
movl %esi, 0x20(%rsp)
vmovsd %xmm0, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movl 0x24(%rsp), %eax
cmpl 0x20(%rsp), %eax
jge 0x6677
movl 0x24(%rsp), %eax
movl %eax, 0x8(%rsp)
movl 0x20(%rsp), %eax
subl 0x24(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0x8(%rsp), %eax
addl %ecx, %eax
movl %eax, 0xc(%rsp)
movq 0x10(%rsp), %rdi
movslq 0xc(%rsp), %rsi
callq 0x6390
vmovsd (%rax), %xmm0
vucomisd 0x18(%rsp), %xmm0
jb 0x666a
movl 0xc(%rsp), %eax
movl %eax, 0x20(%rsp)
jmp 0x6675
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x6617
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
// File: umatin[P]LogarithmicErrorRegression/./src/median.h
// Function: double quickselect<double>(std::vector<double, std::allocator<double>>&, int, int, int)
T quickselect(std::vector<T>& data, int k, int lo, int hi){
    int i = hoare_partition(data, lo, hi, data[(lo+hi)/2]);
    if(i == k){
        return data[i];
    }
    else if(i < k){
        return quickselect(data, k, i+1, hi);
    }
    else{
        return quickselect(data, k, lo, i-1);
    }
}

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movl %esi, 0x24(%rsp)
movl %edx, 0x20(%rsp)
movl %ecx, 0x1c(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x8(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x14(%rsp)
movq 0x28(%rsp), %rdi
movl 0x20(%rsp), %eax
addl 0x1c(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movslq %eax, %rsi
callq 0x6390
movq 0x8(%rsp), %rdi
movl 0x10(%rsp), %esi
movl 0x14(%rsp), %edx
vmovsd (%rax), %xmm0
callq 0x10d60
movl %eax, 0x18(%rsp)
movl 0x18(%rsp), %eax
cmpl 0x24(%rsp), %eax
jne 0x701b
movq 0x28(%rsp), %rdi
movslq 0x18(%rsp), %rsi
callq 0x6390
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x30(%rsp)
jmp 0x7065
movl 0x18(%rsp), %eax
cmpl 0x24(%rsp), %eax
jge 0x7046
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x18(%rsp), %edx
addl $0x1, %edx
movl 0x1c(%rsp), %ecx
callq 0x6f90
vmovsd %xmm0, 0x30(%rsp)
jmp 0x7065
movq 0x28(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x20(%rsp), %edx
movl 0x18(%rsp), %ecx
subl $0x1, %ecx
callq 0x6f90
vmovsd %xmm0, 0x30(%rsp)
vmovsd 0x30(%rsp), %xmm0
addq $0x38, %rsp
retq
// File: umatin[P]LogarithmicErrorRegression/./src/fast_brute_force.h
// Function: comp_target(long, long, long)
inline long comp_target(long i, long error, long index){
    long target = i;
    if (i < index){
        error += 1;
    }
    if(error > 0){
        target += pow2(error - 1);
    }
    else if(error < 0){
        target -= pow2(-error) - 1;
    }
    return target;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movq %rsi, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq 0x20(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
cmpq 0x10(%rsp), %rax
jge 0x7167
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jle 0x7189
movq 0x18(%rsp), %rdi
subq $0x1, %rdi
callq 0xab20
addq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x71b5
cmpq $0x0, 0x18(%rsp)
jge 0x71b3
xorl %eax, %eax
movl %eax, %edi
subq 0x18(%rsp), %rdi
callq 0xab20
movq %rax, %rcx
subq $0x1, %rcx
movq 0x8(%rsp), %rax
subq %rcx, %rax
movq %rax, 0x8(%rsp)
jmp 0x71b5
movq 0x8(%rsp), %rax
addq $0x28, %rsp
retq
nop
// File: umatin[P]LogarithmicErrorRegression/./src/error_function.h
// Function: double calculate_error_single_element<(ERROR_TYPE)0, false, false>(std::vector<double, std::allocator<double>>&, double, double, int)
inline double calculate_error_single_element (std::vector<double>& data, double a, double b, int i){
    double x = data[i];
    double y = i;
    double prediction = (a*x)+b;
    
    return apply_errorfn<E, ROUND, BOUNDED>(prediction, y, data.size()-1);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
vmovsd %xmm0, 0x38(%rsp)
vmovsd %xmm1, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq 0x40(%rsp), %rdi
movslq 0x2c(%rsp), %rsi
callq 0x6390
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x20(%rsp)
vcvtsi2sdl 0x2c(%rsp), %xmm0, %xmm0
vmovsd %xmm0, 0x18(%rsp)
vmovsd 0x38(%rsp), %xmm1
vmovsd 0x20(%rsp), %xmm0
vmovsd 0x30(%rsp), %xmm2
vfmadd213sd %xmm2, %xmm1, %xmm0 # xmm0 = (xmm1 * xmm0) + xmm2
vmovsd %xmm0, 0x10(%rsp)
vmovsd 0x10(%rsp), %xmm0
vmovsd %xmm0, (%rsp)
vmovsd 0x18(%rsp), %xmm0
vmovsd %xmm0, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x6400
vmovsd (%rsp), %xmm0
vmovsd 0x8(%rsp), %xmm1
subq $0x1, %rax
movl %eax, %edi
callq 0x12060
addq $0x48, %rsp
retq
nopw (%rax,%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/median.h
// Function: int hoare_partition<double>(std::vector<double, std::allocator<double>>&, int, int, double)
int hoare_partition(std::vector<T>& data, int lo, int hi, T pivot){
    int i = lo - 1;
    int j = hi + 1;
    while(true){
        do{
            i += 1;
        }while (data[i] < pivot);
        do{
            j -= 1;
        }while (data[j] > pivot);
        if(i >= j){
            return j;
        }
        std::swap(data[i], data[j]);
    }
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movl %esi, 0x1c(%rsp)
movl %edx, 0x18(%rsp)
vmovsd %xmm0, 0x10(%rsp)
movl 0x1c(%rsp), %eax
subl $0x1, %eax
movl %eax, 0xc(%rsp)
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8(%rsp)
jmp 0x10d8f
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
movq 0x20(%rsp), %rdi
movslq 0xc(%rsp), %rsi
callq 0x6390
vmovsd (%rax), %xmm1
vmovsd 0x10(%rsp), %xmm0
vucomisd %xmm1, %xmm0
ja 0x10d8f
jmp 0x10dbb
movl 0x8(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
movslq 0x8(%rsp), %rsi
callq 0x6390
vmovsd (%rax), %xmm0
vucomisd 0x10(%rsp), %xmm0
ja 0x10dbb
movl 0xc(%rsp), %eax
cmpl 0x8(%rsp), %eax
jl 0x10df4
movl 0x8(%rsp), %eax
addq $0x28, %rsp
retq
movq 0x20(%rsp), %rdi
movslq 0xc(%rsp), %rsi
callq 0x6390
movq %rax, (%rsp)
movq 0x20(%rsp), %rdi
movslq 0x8(%rsp), %rsi
callq 0x6390
movq (%rsp), %rdi
movq %rax, %rsi
callq 0xf650
jmp 0x10d8d
nopw (%rax,%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/error_function.h
// Function: long double calculate_error<(ERROR_TYPE)1, true, false>(std::vector<double, std::allocator<double>>&, linear_regression)
long double calculate_error(std::vector<double>& data, linear_regression lr){
    long double total_error = 0;
    for(long i = 0; i < data.size(); i++){
        total_error += calculate_error_single_element<E, CORRECT, BOUNDED>(data, lr, i);
    }
    return total_error;
}

// Assembly:
subq $0x58, %rsp
vmovsd %xmm0, 0x48(%rsp)
vmovsd %xmm1, 0x50(%rsp)
movq %rdi, 0x40(%rsp)
fldz
fstpt 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x28(%rsp), %rax
movq %rax, (%rsp)
movq 0x40(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
jae 0x126bd
movq 0x40(%rsp), %rdi
vmovdqu 0x48(%rsp), %xmm0
vmovdqa %xmm0, 0x10(%rsp)
movl 0x28(%rsp), %esi
vmovsd 0x10(%rsp), %xmm0
vmovsd 0x18(%rsp), %xmm1
callq 0x12810
vmovsd %xmm0, 0x8(%rsp)
fldl 0x8(%rsp)
fldt 0x30(%rsp)
faddp %st, %st(1)
fstpt 0x30(%rsp)
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0x12654
fldt 0x30(%rsp)
addq $0x58, %rsp
retq
nopw %cs:(%rax,%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/error_function.h
// Function: double calculate_error_single_element<(ERROR_TYPE)1, true, false>(std::vector<double, std::allocator<double>>&, linear_regression, int)
inline double calculate_error_single_element (std::vector<double>& data, linear_regression lr, int i){
    double x = data[i];
    double y = i;
    double prediction = lr.predict(x);
    
    return apply_errorfn<E, ROUND, BOUNDED>(prediction, y, data.size()-1);
}

// Assembly:
subq $0x48, %rsp
vmovsd %xmm0, 0x38(%rsp)
vmovsd %xmm1, 0x40(%rsp)
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movq 0x30(%rsp), %rdi
movslq 0x2c(%rsp), %rsi
callq 0x6390
vmovsd (%rax), %xmm0
vmovsd %xmm0, 0x20(%rsp)
vcvtsi2sdl 0x2c(%rsp), %xmm0, %xmm0
vmovsd %xmm0, 0x18(%rsp)
vmovsd 0x20(%rsp), %xmm0
leaq 0x38(%rsp), %rdi
callq 0x6680
vmovsd %xmm0, 0x10(%rsp)
vmovsd 0x10(%rsp), %xmm0
vmovsd %xmm0, (%rsp)
vmovsd 0x18(%rsp), %xmm0
vmovsd %xmm0, 0x8(%rsp)
movq 0x30(%rsp), %rdi
callq 0x6400
vmovsd (%rsp), %xmm0
vmovsd 0x8(%rsp), %xmm1
subq $0x1, %rax
movl %eax, %edi
callq 0x128a0
addq $0x48, %rsp
retq
// File: umatin[P]LogarithmicErrorRegression/./src/log_regression.h
// Function: linear_regression create_regression_tournament_selection<(ERROR_TYPE)1, true, true>(std::vector<double, std::allocator<double>>&)
linear_regression create_regression_tournament_selection(std::vector<double>& data){
    long s = std::pow(2, (int)std::ceil(log2(data.size())));
    std::vector<int> tournament;
    tournament.resize(s);
    for (int i = 0; i < s/2; i++){
        int fr = rand() % data.size();
        int to;
        do{
            to = rand() % data.size();
        }while(fr == to);
        tournament[2*i] = fr;
        tournament[2*i + 1] = to;
    }
    double error;
    return create_regression_tournament_selection_recursive<E,ROUND,BOUNDED>(data, tournament, 0, s, error);
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x80(%rsp)
movq 0x80(%rsp), %rdi
callq 0x6400
vcvtusi2sd %rax, %xmm0, %xmm0
callq 0x23d0
vmovaps %xmm0, %xmm1
vroundsd $0xa, %xmm1, %xmm0, %xmm0
vcvttsd2si %xmm0, %esi
movl $0x2, %edi
callq 0x12d10
vcvttsd2si %xmm0, %rax
movq %rax, 0x78(%rsp)
leaq 0x60(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x12d30
movq 0x38(%rsp), %rdi
movq 0x78(%rsp), %rsi
callq 0x12d40
jmp 0x12b89
movl $0x0, 0x50(%rsp)
movslq 0x50(%rsp), %rax
movq %rax, 0x30(%rsp)
movq 0x78(%rsp), %rax
movl $0x2, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jge 0x12c8c
callq 0x2080
cltq
movq %rax, 0x28(%rsp)
movq 0x80(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x28(%rsp), %rax
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x4c(%rsp)
callq 0x2080
cltq
movq %rax, 0x20(%rsp)
movq 0x80(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x20(%rsp), %rax
xorl %edx, %edx
divq %rcx
movl %edx, %eax
movl %eax, 0x48(%rsp)
movl 0x4c(%rsp), %eax
cmpl 0x48(%rsp), %eax
je 0x12be7
movl 0x4c(%rsp), %eax
movl %eax, 0x18(%rsp)
movl 0x50(%rsp), %eax
shll %eax
movslq %eax, %rsi
leaq 0x60(%rsp), %rdi
callq 0x12de0
movl 0x18(%rsp), %ecx
movl %ecx, (%rax)
movl 0x48(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0x50(%rsp), %eax
shll %eax
addl $0x1, %eax
movslq %eax, %rsi
leaq 0x60(%rsp), %rdi
callq 0x12de0
movl 0x1c(%rsp), %ecx
movl %ecx, (%rax)
movl 0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x50(%rsp)
jmp 0x12b91
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x58(%rsp)
movl %eax, 0x54(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x13170
jmp 0x12cf9
movq 0x80(%rsp), %rdi
movl 0x78(%rsp), %ecx
leaq 0x60(%rsp), %rsi
xorl %edx, %edx
leaq 0x40(%rsp), %r8
callq 0x12e00
vmovsd %xmm1, 0x8(%rsp)
vmovsd %xmm0, 0x10(%rsp)
jmp 0x12cb7
vmovsd 0x8(%rsp), %xmm0
vmovsd 0x10(%rsp), %xmm1
vmovsd %xmm1, 0x88(%rsp)
vmovsd %xmm0, 0x90(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x13170
vmovsd 0x88(%rsp), %xmm0
vmovsd 0x90(%rsp), %xmm1
addq $0x98, %rsp
retq
movq 0x58(%rsp), %rdi
callq 0x23b0
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/error_function.h
// Function: double apply_errorfn<(ERROR_TYPE)4, true, true>(double, double, int)
inline double apply_errorfn(double prediction, double y, int max_bound){
    if(BOUNDED){
        prediction = std::max<long double>(std::min<long double>(prediction, max_bound), 0);
    }
    if(ROUND){
        prediction = std::floor(prediction);
    }

    long double error = y - prediction;
    
    if (E == L1Norm){
        return std::abs(error);
    }
    else if (E == LogNorm){
        return log2(1 + std::abs(error));
    }
    else if (E == SquaredLogNorm){
        return log2(1 + (error)*(error));
    }
    else if (E == DiscreteLogNorm){
        return ceil(log2(1 + std::abs(error)));
    }
    else if (E == L2Norm){
        return std::pow(error, 2);
    }
    else if (E == FastDiscreteLogNorm){
        return LOG2(1 + std::abs(error));
    }
    else if (E == HardwareNorm){
        // Attempt to maximize hits on the same cache line
        // Obtain using either:
        // cat /sys/devices/system/cpu/cpu0/cache/index2/coherency_line_size
        // getconf LEVEL1_DCACHE_LINESIZE
        int cache_line_y = ((int)y-alignment) / CACHE_LINE_SIZE;
        int cache_line_p = ((int)prediction-alignment) / CACHE_LINE_SIZE;
        return cache_line_y == cache_line_p ? LOG2(1 + std::abs(error)) : LOG2(1 + std::abs(error)) + 1;
    }
    else if (E == FPLogNorm){
        //Directly uses the exponent of the number to calculate the discretized logarithm
        int exp;
        frexp(error+1, &exp);
        return exp;
    }
    if (E == ExpNorm){
        //Metric used by IRLS
        return std::pow(2, std::abs(error));
    }
}

// Assembly:
subq $0x98, %rsp
vmovsd %xmm0, 0x90(%rsp)
vmovsd %xmm1, 0x88(%rsp)
movl %edi, 0x84(%rsp)
fldl 0x90(%rsp)
fstpt 0x70(%rsp)
movl 0x84(%rsp), %eax
movl %eax, 0x34(%rsp)
fildl 0x34(%rsp)
fstpt 0x60(%rsp)
leaq 0x70(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x13f30
movq %rax, %rdi
fldz
fld %st(0)
fstpt 0x1c(%rsp)
fstpt 0x50(%rsp)
leaq 0x50(%rsp), %rsi
callq 0x13ef0
fldt (%rax)
fstpl 0x90(%rsp)
vmovsd 0x90(%rsp), %xmm1
vroundsd $0x9, %xmm1, %xmm0, %xmm0
vmovsd %xmm0, 0x90(%rsp)
vmovsd 0x88(%rsp), %xmm0
vmovsd 0x90(%rsp), %xmm1
vsubsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, 0x28(%rsp)
fldl 0x28(%rsp)
fstpt 0x40(%rsp)
fldt 0x40(%rsp)
movq %rsp, %rax
fstpt (%rax)
callq 0x120b0
fldt 0x1c(%rsp)
fld1
faddp %st, %st(2)
flds 0x9dd(%rip)             # 0x15074
fxch %st(2)
fucomi %st(2), %st
fxch %st(1)
fcmovnb %st(2), %st
fstp %st(2)
fsubp %st, %st(1)
fisttpll 0x38(%rsp)
setae %al
movzbl %al, %eax
movl %eax, %ecx
shlq $0x3f, %rcx
movq 0x38(%rsp), %rax
xorq %rcx, %rax
lzcntq %rax, %rax
movslq %eax, %rcx
movl $0x40, %eax
subq %rcx, %rax
subq $0x1, %rax
vcvtusi2sd %eax, %xmm0, %xmm0
addq $0x98, %rsp
retq
nopl (%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/log_regression.h
// Function: linear_regression create_regression_optimal<(ERROR_TYPE)0, true, true>(std::vector<double, std::allocator<double>>&)
linear_regression create_regression_optimal(std::vector<double>& data){
    double e = INFINITY;
    double a, b;
    for(long fr = 0; fr < data.size(); fr++){
        for(long to = fr+1; to < data.size(); to++){
            double a_tmp;
            double b_tmp;
            fit_line(data, fr, to, a_tmp, b_tmp);
            double error_tmp = calculate_error<E,ROUND,BOUNDED>(data, a_tmp, b_tmp);
            if(error_tmp < e){
                a = a_tmp;
                b = b_tmp;
                e = error_tmp;
            }
        }
    }
    return linear_regression(a,b);
}

// Assembly:
subq $0x78, %rsp
movq %rdi, 0x60(%rsp)
vmovsd 0x917(%rip), %xmm0      # 0x15008
vmovsd %xmm0, 0x58(%rsp)
movq $0x0, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x60(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jae 0x147fc
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
movq 0x38(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x60(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x147e7
movq 0x60(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x30(%rsp), %rcx
leaq 0x28(%rsp), %r8
callq 0x2640
movq 0x60(%rsp), %rdi
vmovsd 0x30(%rsp), %xmm0
vmovsd 0x28(%rsp), %xmm1
callq 0x14830
fstpl 0x18(%rsp)
vmovsd 0x18(%rsp), %xmm0
vmovsd %xmm0, 0x20(%rsp)
vmovsd 0x20(%rsp), %xmm1
vmovsd 0x58(%rsp), %xmm0
vucomisd %xmm1, %xmm0
jbe 0x147d2
vmovsd 0x30(%rsp), %xmm0
vmovsd %xmm0, 0x50(%rsp)
vmovsd 0x28(%rsp), %xmm0
vmovsd %xmm0, 0x48(%rsp)
vmovsd 0x20(%rsp), %xmm0
vmovsd %xmm0, 0x58(%rsp)
jmp 0x147d4
movq 0x38(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x38(%rsp)
jmp 0x14733
jmp 0x147e9
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x14700
vmovsd 0x50(%rsp), %xmm0
vmovsd 0x48(%rsp), %xmm1
leaq 0x68(%rsp), %rdi
callq 0x63b0
vmovsd 0x68(%rsp), %xmm0
vmovsd 0x70(%rsp), %xmm1
addq $0x78, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: umatin[P]LogarithmicErrorRegression/./src/error_function.h
// Function: long double calculate_error<(ERROR_TYPE)0, true, true>(std::vector<double, std::allocator<double>>&, double, double)
long double calculate_error(std::vector<double>& data, double a, double b){
    long double total_error = 0;
    for(long i = 0; i < data.size(); i++){
        total_error += calculate_error_single_element<E, CORRECT, BOUNDED>(data, a, b, i);
    }
    return total_error;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
vmovsd %xmm0, 0x38(%rsp)
vmovsd %xmm1, 0x30(%rsp)
fldz
fstpt 0x20(%rsp)
movq $0x0, 0x18(%rsp)
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x40(%rsp), %rdi
callq 0x6400
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jae 0x148b3
movq 0x40(%rsp), %rdi
vmovsd 0x38(%rsp), %xmm0
vmovsd 0x30(%rsp), %xmm1
movl 0x18(%rsp), %esi
callq 0x148c0
vmovsd %xmm0, 0x10(%rsp)
fldl 0x10(%rsp)
fldt 0x20(%rsp)
faddp %st, %st(1)
fstpt 0x20(%rsp)
movq 0x18(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x18(%rsp)
jmp 0x14854
fldt 0x20(%rsp)
addq $0x48, %rsp
retq
nopl (%rax)
// File: ef-gy[P]libefgy/include/ef.gy/continued-fractions.h
// Function: efgy::math::numeric::continuedFractional<long long>::operator efgy::math::numeric::fractional<long long>() const
operator fractional<N>(void) const {
    fractional<N> rv;
    N j = coefficient.size() - N(1);
    for (N i = j; i >= N(0); i--) {
      if (i == j) {
        rv = fractional<N>(N(coefficient[i]));
      } else {
        rv = reciprocal(rv) + coefficient[i];
      }
    }
    if (negative) {
      rv *= N(-1);
    }
    return rv;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x68(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x6f30
movq -0x68(%rbp), %rdi
callq 0x340b0
subq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jl 0x7485
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0x7433
movq -0x68(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x35860
movq (%rax), %rsi
leaq -0x38(%rbp), %rdi
callq 0x34ae0
leaq -0x10(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x7290
jmp 0x7472
leaq -0x10(%rbp), %rdi
callq 0x33fd0
movq -0x68(%rbp), %rdi
movq %rax, -0x58(%rbp)
movq %rdx, -0x50(%rbp)
movq -0x28(%rbp), %rsi
callq 0x35860
movq %rax, %rsi
leaq -0x58(%rbp), %rdi
callq 0x36700
movq %rax, -0x48(%rbp)
movq %rdx, -0x40(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x7290
jmp 0x7474
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x73f6
movq -0x68(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x74a4
movq $-0x1, -0x60(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x33f90
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rdx
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: ef-gy[P]libefgy/include/ef.gy/continued-fractions.h
// Function: std::basic_ostream<char, std::char_traits<char>>& efgy::math::numeric::operator<<<char, long long>(std::basic_ostream<char, std::char_traits<char>>&, efgy::math::numeric::continuedFractional<long long> const&)
std::basic_ostream<C> &operator<<(std::basic_ostream<C> &out,
                                  const continuedFractional<N> &f) {
  if (f.coefficient.size() == N(0)) {
    return out << "[ 0 ]";
  }

  if (f.negative) {
    out << "- ";
  }
  out << "[";
  for (N i = N(0); i < f.coefficient.size(); i++) {
    if (i == N(0)) {
      out << " " << f.coefficient[i];
    } else if (i == N(1)) {
      out << "; " << f.coefficient[i];
    } else {
      out << ", " << f.coefficient[i];
    }
  }

  return out << " ]";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x340b0
cmpq $0x0, %rax
jne 0x74f8
movq -0x10(%rbp), %rdi
leaq 0x30698(%rip), %rsi     # 0x37b82
callq 0x5360
movq %rax, -0x8(%rbp)
jmp 0x760d
movq -0x18(%rbp), %rax
testb $0x1, 0x18(%rax)
je 0x7512
movq -0x10(%rbp), %rdi
leaq 0x2fcc2(%rip), %rsi     # 0x371cf
callq 0x5360
movq -0x10(%rbp), %rdi
leaq 0x3066b(%rip), %rsi     # 0x37b88
callq 0x5360
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
callq 0x340b0
movq %rax, %rcx
movq -0x28(%rbp), %rax
cmpq %rcx, %rax
jae 0x75f9
cmpq $0x0, -0x20(%rbp)
jne 0x7581
movq -0x10(%rbp), %rdi
leaq 0x305d4(%rip), %rsi     # 0x37b31
callq 0x5360
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x35860
movq -0x30(%rbp), %rdi
movq (%rax), %rsi
callq 0x51b0
jmp 0x75e6
cmpq $0x1, -0x20(%rbp)
jne 0x75b7
movq -0x10(%rbp), %rdi
leaq 0x305f7(%rip), %rsi     # 0x37b8a
callq 0x5360
movq %rax, -0x38(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x35860
movq -0x38(%rbp), %rdi
movq (%rax), %rsi
callq 0x51b0
jmp 0x75e4
movq -0x10(%rbp), %rdi
leaq 0x305cb(%rip), %rsi     # 0x37b8d
callq 0x5360
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x35860
movq -0x40(%rbp), %rdi
movq (%rax), %rsi
callq 0x51b0
jmp 0x75e6
jmp 0x75e8
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x752a
movq -0x10(%rbp), %rdi
leaq 0x30581(%rip), %rsi     # 0x37b85
callq 0x5360
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: ef-gy[P]libefgy/include/ef.gy/fractions.h
// Function: efgy::math::numeric::fractional<long long>::operator*=(long long const&)
fractional &operator*=(const N &b) {
    numerator *= b;
    normalise();
    // minimise();
    return (*this);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq (%rdi), %rax
movq %rax, (%rdi)
callq 0x33bc0
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: ef-gy[P]libefgy/include/ef.gy/fractions.h
// Function: efgy::math::numeric::fractional<long long>::operator>(efgy::math::numeric::fractional<long long> const&) const
bool operator>(const fractional &b) const {
    if (numerator < zero()) {
      if (b.numerator >= zero()) {
        return false;
      }
    } else if (b.numerator < zero()) {
      return true;
    }

    return (numerator * b.denominator) > (b.numerator * denominator);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x28(%rbp)
leaq -0x19(%rbp), %rsi
callq 0x33cf0
testb $0x1, %al
jne 0x34b37
jmp 0x34b52
movq -0x18(%rbp), %rdi
leaq -0x1a(%rbp), %rsi
callq 0x34ba0
testb $0x1, %al
jne 0x34b4a
jmp 0x34b50
movb $0x0, -0x1(%rbp)
jmp 0x34b94
jmp 0x34b6d
movq -0x18(%rbp), %rdi
leaq -0x1b(%rbp), %rsi
callq 0x33cf0
testb $0x1, %al
jne 0x34b65
jmp 0x34b6b
movb $0x1, -0x1(%rbp)
jmp 0x34b94
jmp 0x34b6d
movq -0x28(%rbp), %rdx
movq (%rdx), %rax
movq -0x18(%rbp), %rcx
imulq 0x8(%rcx), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
imulq 0x8(%rdx), %rcx
cmpq %rcx, %rax
setg %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nop
// File: ef-gy[P]libefgy/include/ef.gy/continued-fractions.h
// Function: efgy::math::numeric::continuedFractional<long long>::operator,(long long const&) const
continuedFractional operator,(const N &pB) const {
    continuedFractional rv = *this;
    N b = pB;
    if (b < zero()) {
      rv.negative = true;
      rv.coefficient.push_back(-b);
    } else {
      rv.coefficient.push_back(b);
    }
    return rv;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x60(%rbp)
movq %rdi, %rax
movq %rax, -0x58(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x10(%rbp), %rsi
movb $0x0, -0x19(%rbp)
callq 0x359d0
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x29(%rbp), %rsi
callq 0x33cf0
movb %al, -0x49(%rbp)
jmp 0x356a9
movb -0x49(%rbp), %al
testb $0x1, %al
jne 0x356b2
jmp 0x356e9
movq -0x60(%rbp), %rdi
movb $0x1, 0x18(%rdi)
movq -0x28(%rbp), %rax
negq %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rsi
callq 0x33ec0
jmp 0x356d0
jmp 0x356fa
movq -0x60(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
callq 0x73a0
jmp 0x35717
movq -0x60(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x33ef0
jmp 0x356f8
jmp 0x356fa
movb $0x1, -0x19(%rbp)
testb $0x1, -0x19(%rbp)
jne 0x3570d
movq -0x60(%rbp), %rdi
callq 0x73a0
movq -0x58(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x55b0
// File: KJTang[P]SimpleCompiler/Lexer.cpp
// Function: Lexer::lex()
bool Lexer::lex() {
    Token result;
    do {
        result = this->lexToken();
    } while (result != Token::END_OF_FILE);

    if (result == Token::END_OF_FILE) {
        return true;
    } else {
        return false;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x9af0
movl %eax, -0x14(%rbp)
cmpl $-0x1, -0x14(%rbp)
jne 0xa8a4
cmpl $-0x1, -0x14(%rbp)
jne 0xa8c2
movb $0x1, -0x1(%rbp)
jmp 0xa8c6
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)
// File: KJTang[P]SimpleCompiler/AST.cpp
// Function: BlockAST::print()
void BlockAST::print() {
    std::cout<<"block: {"<<std::endl;
    for (auto it = statements.begin(); it != statements.end(); ++it) {
        (*it)->print();
    }
    std::cout<<"}"<<std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x1cbb5(%rip), %rdi     # 0x27fd0
leaq 0xfe9e(%rip), %rsi      # 0x1b2c0
callq 0x3280
movq %rax, %rdi
movq 0x1cb87(%rip), %rsi     # 0x27fb8
callq 0x32e0
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0xddb0
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rdi
addq $0x10, %rdi
callq 0xde20
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xdde0
testb $0x1, %al
jne 0xb46b
jmp 0xb488
leaq -0x10(%rbp), %rdi
callq 0xde50
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
leaq -0x10(%rbp), %rdi
callq 0xde70
jmp 0xb447
movq 0x1cb41(%rip), %rdi     # 0x27fd0
leaq 0xfe33(%rip), %rsi      # 0x1b2c9
callq 0x3280
movq %rax, %rdi
movq 0x1cb13(%rip), %rsi     # 0x27fb8
callq 0x32e0
addq $0x20, %rsp
popq %rbp
retq
// File: KJTang[P]SimpleCompiler/AST.cpp
// Function: IfExprAST::print()
void IfExprAST::print() {
    std::cout<<"if\t";
    condAST->print();
    ifBlockAST->print();
    if (elseBlockAST) {
        std::cout<<"else\t";
        elseBlockAST->print();
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq 0x1cb05(%rip), %rdi     # 0x27fd0
leaq 0xfdf9(%rip), %rsi      # 0x1b2cb
callq 0x3280
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0xb51f
movq 0x1cacb(%rip), %rdi     # 0x27fd0
leaq 0xfdc3(%rip), %rsi      # 0x1b2cf
callq 0x3280
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: KJTang[P]SimpleCompiler/AST.cpp
// Function: CallFuncAST::print()
void CallFuncAST::print() {
    std::cout<<"call func: "<<mCallee<<"("<<std::endl;
    for (auto it = mArgs.begin(); it != mArgs.end(); ++it) {
        (*it)->print();
    }
    std::cout<<")"<<std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x1ca35(%rip), %rdi     # 0x27fd0
leaq 0xfd3a(%rip), %rsi      # 0x1b2dc
callq 0x3280
movq -0x20(%rbp), %rsi
movq %rax, %rdi
addq $0x10, %rsi
callq 0x3250
movq %rax, %rdi
leaq 0xfd33(%rip), %rsi      # 0x1b2f4
callq 0x3280
movq %rax, %rdi
movq 0x1c9e8(%rip), %rsi     # 0x27fb8
callq 0x32e0
movq -0x20(%rbp), %rdi
addq $0x30, %rdi
callq 0xddb0
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rdi
addq $0x30, %rdi
callq 0xde20
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xdde0
testb $0x1, %al
jne 0xb60a
jmp 0xb627
leaq -0x10(%rbp), %rdi
callq 0xde50
movq (%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
leaq -0x10(%rbp), %rdi
callq 0xde70
jmp 0xb5e6
movq 0x1c9a2(%rip), %rdi     # 0x27fd0
leaq 0xfe6d(%rip), %rsi      # 0x1b4a2
callq 0x3280
movq %rax, %rdi
movq 0x1c974(%rip), %rsi     # 0x27fb8
callq 0x32e0
addq $0x20, %rsp
popq %rbp
retq
nop
// File: KJTang[P]SimpleCompiler/AST.cpp
// Function: FunctionAST::print()
void FunctionAST::print() {
    std::cout<<"def func "<<mFunc.second<<": (";
    for (auto it = mArgs.begin(); it != mArgs.end(); ++it) {
        std::cout<<(*it).second<<", ";
    }
    std::cout<<"nullptr) ";
    blockAST->print();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq 0x1c965(%rip), %rdi     # 0x27fd0
leaq 0xfc76(%rip), %rsi      # 0x1b2e8
callq 0x3280
movq -0x20(%rbp), %rsi
movq %rax, %rdi
addq $0x10, %rsi
addq $0x8, %rsi
callq 0x3250
movq %rax, %rdi
leaq 0xfc5d(%rip), %rsi      # 0x1b2f2
callq 0x3280
movq -0x20(%rbp), %rdi
addq $0x38, %rdi
callq 0xaf60
movq %rax, -0x10(%rbp)
movq -0x20(%rbp), %rdi
addq $0x38, %rdi
callq 0xad90
movq %rax, -0x18(%rbp)
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0xde90
testb $0x1, %al
jne 0xb6cf
jmp 0xb705
leaq -0x10(%rbp), %rdi
callq 0xded0
movq %rax, %rsi
addq $0x8, %rsi
movq 0x1c8ea(%rip), %rdi     # 0x27fd0
callq 0x3250
movq %rax, %rdi
leaq 0xfc01(%rip), %rsi      # 0x1b2f6
callq 0x3280
leaq -0x10(%rbp), %rdi
callq 0xdef0
jmp 0xb6ab
movq 0x1c8c4(%rip), %rdi     # 0x27fd0
leaq 0xfbe6(%rip), %rsi      # 0x1b2f9
callq 0x3280
movq -0x20(%rbp), %rax
movq 0x50(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)