LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::golomb_decompress(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::golomb_decompress(vector<int> compressed)
{
  vector<int> decompressed;
  int temp, q = 0, r = 0, power = 1, nr = 0;
  char status = 'q';

  for(int i = 0; i < compressed.size(); i++)
  {
    temp = compressed[i];
    for(int j = 0; j < 8; j++)
    {
      if(status == 'q')
      {
        if((temp & 0x80) == 0x80)
          q++;
        else
          status = 'r', r = 0, power = 1, nr = 0;
      }
      else
      {
        if((temp & 0x80) == 0x80)
          r += power;
        nr++, power *= 2;
        if(nr == int(log(golomb_n) / log(2.0) + 1e-8))
        {
          status = 'q';
          decompressed.push_back(q * golomb_n + r);
          q = 0;
        }
      }
      temp <<= 1;
    }
  }

  return decompressed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %r14
xorpd %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movq %rdi, 0x18(%rsp)
movupd %xmm0, (%rdi)
movb $0x71, %r8b
pushq $0x1
popq %r13
xorl %edx, %edx
movl $0x0, 0xc(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x0, 0x14(%rsp)
movq 0x28(%rsp), %rcx
movq (%rcx), %rax
movq 0x8(%rcx), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %rdx, %rcx
jbe 0x3825
movq %rdx, 0x30(%rsp)
movl (%rax,%rdx,4), %r15d
pushq $0x8
popq %rbx
subl $0x1, %ebx
jb 0x3818
cmpb $0x71, %r8b
je 0x37eb
movl %r8d, %ebp
movsbl %r15b, %eax
sarl $0x7, %eax
andl %r13d, %eax
addl %eax, 0x10(%rsp)
movl 0x14(%rsp), %r12d
incl %r12d
addl %r13d, %r13d
movl (%r14), %edi
callq 0x5249
divsd 0x386c(%rip), %xmm0     # 0x7008
addsd 0x386c(%rip), %xmm0     # 0x7010
cvttsd2si %xmm0, %eax
movl %r12d, 0x14(%rsp)
cmpl %eax, %r12d
jne 0x37e6
movl 0x10(%rsp), %eax
movq %r14, %rbp
movl 0xc(%rsp), %ecx
imull (%r14), %ecx
addl %eax, %ecx
movl %ecx, 0x24(%rsp)
movq 0x18(%rsp), %rdi
leaq 0x24(%rsp), %rsi
callq 0x5602
movb $0x71, %r8b
movl $0x0, 0xc(%rsp)
movq %rbp, %r14
jmp 0x3810
movl %ebp, %r8d
jmp 0x3810
testb %r15b, %r15b
js 0x3809
movb $0x72, %r8b
movl $0x0, 0x10(%rsp)
pushq $0x1
popq %r13
movl $0x0, 0x14(%rsp)
jmp 0x3810
incl 0xc(%rsp)
movb $0x71, %r8b
addl %r15d, %r15d
jmp 0x3761
movq 0x30(%rsp), %rdx
incq %rdx
jmp 0x3739
movq 0x18(%rsp), %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x18(%rsp), %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::run_length_decode(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::run_length_decode(vector<int> encoded) {
    int n = encoded.size();
    vector<int> decoded;
    decoded.reserve(n); // Heuristic; reserve some space for the data

    vector<int>::iterator viter = encoded.begin(), data_end = encoded.end();
    while (viter != data_end) {
        int run_int = *(viter++);
        int run_count = 1;
        while (*viter == run_int && run_count < RUN_MIN && viter != data_end) {
            ++viter;
            ++run_count;
        }
        if (run_count == RUN_MIN) run_count += *(viter++);
        for (int i=0; i<run_count; ++i) decoded.push_back(run_int);
    }
    
    return decoded;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq 0x8(%rdx), %rax
subq (%rdx), %rax
movq %rdi, %rbx
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
shrq $0x2, %rax
movslq %eax, %rsi
callq 0x5252
movq (%r14), %r15
movq 0x8(%r14), %r12
pushq $0x1
popq %r13
leaq 0x4(%rsp), %r14
cmpq %r12, %r15
je 0x38e3
movl (%r15), %eax
movl %eax, 0x4(%rsp)
addq $0x4, %r15
movl %r13d, %ebp
movl (%r15), %ecx
cmpl %eax, %ecx
jne 0x38b9
cmpl $0x3, %ebp
ja 0x38b9
cmpq %r12, %r15
je 0x38c7
incl %ebp
addq $0x4, %r15
jmp 0x38a0
cmpl $0x4, %ebp
jne 0x38c7
addq $0x4, %r15
addl $0x4, %ecx
movl %ecx, %ebp
testl %ebp, %ebp
movl $0x0, %eax
cmovlel %eax, %ebp
subl $0x1, %ebp
jb 0x388d
movq %rbx, %rdi
movq %r14, %rsi
callq 0x51de
jmp 0x38d1
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x38f7
movq %rax, %r14
movq %rbx, %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::burrows_wheeler_decode(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::burrows_wheeler_decode(vector<int> data) {
    int n = data.size() - 4;
    long int dollar_pos = 256*256*data[n+1] + 256*data[n+2] + data[n+3];
    int bwt_size = n + 1;
    
    pair<int,int> *f = (pair<int,int> *) calloc(bwt_size, sizeof(pair<int,int>));
    int *t = (int *) calloc(bwt_size, sizeof(int));
    vector<int> s;
    s.resize(n);
    
    for (int i=0; i<bwt_size; ++i) f[i] = pair<int,int>(data[i], i);
    f[dollar_pos].first = INT_MIN;
    stable_sort(f, f + bwt_size, pair_comparator);
    
    for (int i=0; i<bwt_size; ++i) t[f[i].second] = i;
    free(f);
    
    int last_t = dollar_pos;
    for (vector<int>::reverse_iterator viter = s.rbegin(); viter != s.rend(); ++viter) {
        last_t = t[last_t];
        *viter = data[last_t];
    }
    free(t);
    
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, 0x20(%rsp)
movq (%rdx), %rax
movq 0x8(%rdx), %r13
subq %rax, %r13
movq %r13, %rbx
shrq $0x2, %rbx
addl $-0x3, %ebx
movslq %ebx, %r15
movslq (%rax,%r15,4), %rcx
movq %rcx, 0x10(%rsp)
shlq $0x1e, %r13
movabsq $-0x200000000, %rcx     # imm = 0xFFFFFFFE00000000
addq %r13, %rcx
sarq $0x1e, %rcx
movslq (%rax,%rcx), %rbp
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
addq %r13, %rcx
sarq $0x1e, %rcx
movslq (%rax,%rcx), %rax
movq %rax, 0x8(%rsp)
pushq $0x8
popq %rsi
movq %r15, %rdi
callq 0x2110
movq %rax, %r12
pushq $0x4
popq %rsi
movq %r15, 0x18(%rsp)
movq %r15, %rdi
callq 0x2110
movq %rax, %r15
xorps %xmm0, %xmm0
movq 0x20(%rsp), %rax
andq $0x0, 0x10(%rax)
movups %xmm0, (%rax)
movabsq $-0x400000000, %rsi     # imm = 0xFFFFFFFC00000000
addq %r13, %rsi
movq %rax, %r13
sarq $0x20, %rsi
movq %rax, %rdi
callq 0x5300
movq 0x10(%rsp), %rax
shlq $0x10, %rax
shlq $0x8, %rbp
addq %rax, %rbp
addq 0x8(%rsp), %rbp
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
cmpq %rax, %rbx
je 0x39f5
movq (%r14), %rcx
movl (%rcx,%rax,4), %ecx
movl %ecx, (%r12,%rax,8)
movl %eax, 0x4(%r12,%rax,8)
incq %rax
jmp 0x39dc
movl $0x80000000, (%r12,%rbp,8) # imm = 0x80000000
movq 0x18(%rsp), %rax
leaq (%r12,%rax,8), %rsi
leaq 0xac8(%rip), %rdx       # 0x44d5
movq %r12, %rdi
callq 0x5881
xorl %eax, %eax
cmpq %rax, %rbx
je 0x3a2a
movslq 0x4(%r12,%rax,8), %rcx
movl %eax, (%r15,%rcx,4)
incq %rax
jmp 0x3a17
movq %r12, %rdi
callq 0x21d0
movq (%r13), %rax
movq 0x8(%r13), %rcx
cmpq %rax, %rcx
je 0x3a55
movslq %ebp, %rdx
movslq (%r15,%rdx,4), %rbp
movq (%r14), %rdx
movl (%rdx,%rbp,4), %edx
movl %edx, -0x4(%rcx)
addq $-0x4, %rcx
jmp 0x3a3a
movq %r15, %rdi
callq 0x21d0
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %r13, %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::diff_decompress(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::diff_decompress(vector<int> compressed) {
    vector<int> decompressed;
    int x, y, L;
    
    x = compressed[0];
    y = compressed[1];
    L = compressed[2];
    
    decompressed.push_back(x);
    decompressed.push_back(y);
    decompressed.push_back(L);
    
    vector<int>::iterator viter = compressed.begin();
    viter++;
    viter++;
    viter++;
    
    for (int x_ind=0; x_ind < x; ++x_ind) {
        for (int y_ind=0; y_ind < y; ++y_ind) {
            int val = *(viter++);
            val = 256 * val + *(viter++);

            decompressed.push_back(val);
            
            for (int L_ind=1; L_ind < L; ++L_ind) {
                int diff = *(viter++);
                if (diff < 255) {
                    if (diff % 2 == 0) val = val - diff/2;
                    else val = val + (diff+1)/2;
                    decompressed.push_back(val);
                    continue;
                }
                
                val = *(viter++);
                val = 256 * val + *(viter++);
                decompressed.push_back(val);
            }
        }
    }
    
    if (viter != compressed.end()) {
        printf("ERROR: finished decompressing before the end of the compressed string!\n");
        exit(1);
    }
    
    return decompressed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq (%rdx), %rax
movl (%rax), %ecx
leaq 0x1c(%rsp), %rsi
movl %ecx, (%rsi)
movl 0x4(%rax), %ecx
movl %ecx, 0x14(%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x10(%rsp)
callq 0x51de
leaq 0x14(%rsp), %rsi
movq %rbx, %rdi
callq 0x51de
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x51de
movq %r14, 0x20(%rsp)
movq (%r14), %r12
addq $0xc, %r12
xorl %eax, %eax
leaq 0xc(%rsp), %r15
pushq $0x1
popq %rbp
cmpl 0x1c(%rsp), %eax
jge 0x3ba3
movl %eax, 0x18(%rsp)
xorl %r14d, %r14d
cmpl 0x14(%rsp), %r14d
jge 0x3b98
movl (%r12), %eax
shll $0x8, %eax
addl 0x4(%r12), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51de
addq $0x8, %r12
movl %ebp, %r13d
cmpl 0x10(%rsp), %r13d
jge 0x3b90
movl (%r12), %ecx
cmpl $0xfe, %ecx
jg 0x3b50
movl 0xc(%rsp), %eax
testb $0x1, %cl
jne 0x3b72
sarl %ecx
subl %ecx, %eax
jmp 0x3b78
movl 0x4(%r12), %eax
shll $0x8, %eax
addl 0x8(%r12), %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51de
addq $0xc, %r12
jmp 0x3b8b
incl %ecx
sarl %ecx
addl %ecx, %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x51de
addq $0x4, %r12
incl %r13d
jmp 0x3b2e
incl %r14d
jmp 0x3b01
movl 0x18(%rsp), %eax
incl %eax
jmp 0x3af0
movq 0x20(%rsp), %rax
cmpq 0x8(%rax), %r12
jne 0x3bc0
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x3647(%rip), %rdi      # 0x720e
callq 0x2220
pushq $0x1
popq %rdi
callq 0x21e0
jmp 0x3bd8
jmp 0x3bd8
movq %rax, %r14
movq %rbx, %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::frame_diff_decompress(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::frame_diff_decompress(vector<int> compressed)
{
  vector<int> decompressed;
  int x = compressed[0], y = compressed[1], l = compressed[2], q, r;

  decompressed.push_back(x);
  decompressed.push_back(y);
  decompressed.push_back(l);

  for(int x_ind = 0; x_ind < x; x_ind++)
    for(int y_ind = 0; y_ind < y; y_ind++)
    {
      q = compressed[3 + 2 * (x_ind * y + y_ind)];
      r = compressed[3 + 2 * (x_ind * y + y_ind) + 1];
      decompressed.push_back(q * 256 + r);
    }

  return decompressed;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq (%rdx), %rax
movl (%rax), %ecx
leaq 0xc(%rsp), %rsi
movl %ecx, (%rsi)
movl 0x4(%rax), %ecx
movl %ecx, (%rsp)
movl 0x8(%rax), %eax
movl %eax, 0x8(%rsp)
callq 0x51de
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x51de
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x51de
xorl %ebp, %ebp
leaq 0x4(%rsp), %r15
cmpl 0xc(%rsp), %ebp
jge 0x3c87
xorl %r12d, %r12d
movl (%rsp), %eax
cmpl %eax, %r12d
jge 0x3c83
imull %ebp, %eax
addl %r12d, %eax
addl %eax, %eax
movq (%r14), %rcx
cltq
movl 0xc(%rcx,%rax,4), %edx
shll $0x8, %edx
addl 0x10(%rcx,%rax,4), %edx
movl %edx, 0x4(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5602
incl %r12d
jmp 0x3c4f
incl %ebp
jmp 0x3c46
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3c99
movq %rax, %r14
movq %rbx, %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::compute_diffs(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::compute_diffs(vector<int> data) {
    vector<int> diffs;
    
    int x = data[0];
    int y = data[1];
    int L = data[2];
    
    vector<int>::iterator viter = data.begin();
    viter++;
    viter++;
    viter++;
    
    for (int x_ind=0; x_ind < x; ++x_ind) {
        for (int y_ind=0; y_ind < y; ++y_ind) {
            int val = data[3 + L * (x_ind*y + y_ind)];
                        
            for (int L_ind=1; L_ind < L; ++L_ind) {
                int diff = data[3 + L * (x_ind*y + y_ind) + L_ind] - val;
                val = diff + val;
                diffs.push_back(diff);
            }
        }
    }
    
    return diffs;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq (%rdx), %rax
movslq 0x4(%rax), %rcx
xorl %edx, %edx
testl %ecx, %ecx
movl $0x0, %esi
cmovgl %ecx, %esi
movq %rsi, 0x40(%rsp)
movl (%rax), %esi
testl %esi, %esi
cmovlel %edx, %esi
movq %rsi, 0x20(%rsp)
movslq 0x8(%rax), %r12
movq %rcx, 0x18(%rsp)
imulq %r12, %rcx
shlq $0x2, %rcx
movq %rcx, 0x10(%rsp)
leaq (,%r12,4), %rax
movq %rax, 0x28(%rsp)
pushq $0x10
popq %rax
movq %rax, (%rsp)
cmpq 0x20(%rsp), %rdx
je 0x40c4
movq %rdx, %rax
imulq 0x18(%rsp), %rax
movq %rax, 0x38(%rsp)
movq (%rsp), %r13
xorl %ecx, %ecx
movq %rdx, 0x30(%rsp)
cmpq 0x40(%rsp), %rcx
je 0x40b3
movq 0x38(%rsp), %rax
movq %rcx, 0x48(%rsp)
addq %rcx, %rax
imulq %r12, %rax
movq (%r14), %rcx
movl 0xc(%rcx,%rax,4), %eax
movq %r13, 0x50(%rsp)
pushq $0x1
popq %rbp
cmpq %r12, %rbp
jge 0x409a
movq (%r14), %rcx
movl (%rcx,%r13), %r15d
movl %r15d, %ecx
subl %eax, %ecx
movl %ecx, 0xc(%rsp)
movq %rbx, %rdi
leaq 0xc(%rsp), %rsi
callq 0x51de
incq %rbp
addq $0x4, %r13
movl %r15d, %eax
jmp 0x406c
movq 0x48(%rsp), %rcx
incq %rcx
movq 0x50(%rsp), %r13
addq 0x28(%rsp), %r13
movq 0x30(%rsp), %rdx
jmp 0x4045
incq %rdx
movq (%rsp), %rax
addq 0x10(%rsp), %rax
jmp 0x401d
movq %rbx, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::encode_positive(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::encode_positive(vector<int> nonpositive) {
    vector<int> positive;
    positive.reserve(nonpositive.size());
    
    for (vector<int>::iterator viter = nonpositive.begin(); viter != nonpositive.end(); ++viter) {
        int val = *viter;
        if (val == 0) positive.push_back(0);
        else if (val > 0) positive.push_back(2*val - 1);
        else positive.push_back(-2*val);
    }
    return positive;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x8(%rdx), %rsi
subq (%rdx), %rsi
sarq $0x2, %rsi
callq 0x5252
movq (%r14), %rbp
leaq 0x14(%rsp), %r15
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
cmpq 0x8(%r14), %rbp
je 0x417d
movl (%rbp), %eax
testl %eax, %eax
je 0x4152
jle 0x4164
leal -0x1(,%rax,2), %eax
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5602
jmp 0x4177
andl $0x0, 0x14(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5602
jmp 0x4177
addl %eax, %eax
negl %eax
movl %eax, 0xc(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x5602
addq $0x4, %rbp
jmp 0x412b
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4195
jmp 0x4195
jmp 0x4195
movq %rax, %r14
movq %rbx, %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::decode_positive(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::decode_positive(vector<int> positive) {
    vector<int> nonpositive;
    nonpositive.reserve(positive.size());
    
    for (vector<int>::iterator viter = positive.begin(); viter != positive.end(); ++viter) {
        int val = *viter;
        if (val % 2 == 1) nonpositive.push_back((val+1) / 2);
        else nonpositive.push_back(-val/2);
    }
    return nonpositive;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movq 0x8(%rdx), %rsi
subq (%rdx), %rsi
sarq $0x2, %rsi
callq 0x5252
movq (%r14), %r13
leaq 0x4(%rsp), %r15
pushq $-0x2
popq %rbp
movq %rsp, %r12
cmpq 0x8(%r14), %r13
je 0x4225
movl (%r13), %eax
movl %eax, %ecx
andl $0x80000001, %ecx       # imm = 0x80000001
cmpl $0x1, %ecx
jne 0x420e
incl %eax
shrl %eax
movl %eax, 0x4(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5602
jmp 0x421f
cltd
idivl %ebp
movl %eax, (%rsp)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5602
addq $0x4, %r13
jmp 0x41e2
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x423b
jmp 0x423b
movq %rax, %r14
movq %rbx, %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::run_length_encode(int*, int)
int *DATCompression::run_length_encode(int *data, int n) {
    vector<int> encoded;
    int *rle;
    encoded.reserve(n); // Heuristic; reserve enough space for the data
    
    int i=0;
    while (i < n) {
        int run_int = data[i];
        int run_count = 1;
        ++i;
        while (i < n && data[i] == run_int && run_count < RUN_MAX) {
            ++run_count;
            ++i;
        }
        for (int j=0; j<run_count && j<RUN_MIN; ++j) encoded.push_back(run_int);
        if (run_count >= RUN_MIN) encoded.push_back(run_count - RUN_MIN);
    }
    
    rle = (int *) calloc(encoded.size()+1, sizeof(encoded));
    rle[0] = n;
    copy(encoded.begin(), encoded.end(), rle+1);
    
    return rle;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, 0x30(%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
movl %edx, 0x4(%rsp)
movslq %edx, %r15
movq %r15, %rsi
callq 0x5252
xorl %ebx, %ebx
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %rbp
movl 0x4(%rsp), %r13d
subl %ebx, %r13d
jle 0x4310
movslq %ebx, %rcx
movq 0x30(%rsp), %rax
leaq (%rax,%rcx,4), %rdx
movl (%rdx), %esi
movl %esi, 0xc(%rsp)
pushq $0x1
popq %rax
leaq (%rcx,%rax), %rdi
cmpq %r15, %rdi
jge 0x42c5
cmpl %esi, (%rdx,%rax,4)
jne 0x42cb
cmpl $0x102, %eax            # imm = 0x102
ja 0x42cb
incq %rax
jmp 0x42ab
movl 0x4(%rsp), %ebx
jmp 0x42d0
addl %eax, %ebx
movl %eax, %r13d
cmpl $0x4, %r13d
pushq $0x4
popq %r14
cmovbl %r13d, %r14d
subl $0x1, %r14d
jb 0x42ef
movq %r12, %rdi
movq %rbp, %rsi
callq 0x51de
jmp 0x42dc
cmpl $0x3, %r13d
jbe 0x428c
addl $-0x4, %r13d
movl %r13d, 0x8(%rsp)
movq %r12, %rdi
leaq 0x8(%rsp), %rsi
callq 0x5602
jmp 0x428c
movq 0x10(%rsp), %rbx
movq 0x18(%rsp), %r15
movq %r15, %rdi
subq %rbx, %rdi
sarq $0x2, %rdi
incq %rdi
pushq $0x18
popq %rsi
callq 0x2110
movq %rax, %r12
movl 0x4(%rsp), %eax
movl %eax, (%r12)
subq %rbx, %r15
je 0x4351
movq %r12, %rdi
addq $0x4, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2160
leaq 0x10(%rsp), %rdi
callq 0x5466
movq %r12, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4371
jmp 0x4371
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x5466
movq %rbx, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::run_length_decode(int*)
int *DATCompression::run_length_decode(int *encoded) {
    int n = encoded[0];
    int *decoded = (int *) calloc(n, sizeof(int));

    int cur_ind = 1;
    int total_count = 0;
    while (total_count < n) {
        int run_int = encoded[cur_ind++];
        int run_count = 1;
        while (encoded[cur_ind] == run_int && run_count < RUN_MIN) {
            ++cur_ind;
            ++run_count;
        }
        if (run_count == RUN_MIN) run_count += encoded[cur_ind++];
        for (int i=0; i<run_count; ++i) decoded[total_count++] = run_int;
    }
    
    return decoded;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl (%rsi), %ebp
movslq %ebp, %rdi
pushq $0x4
popq %rsi
callq 0x2110
leaq 0x4(%rbx), %rcx
pushq $0x1
popq %r8
xorl %edx, %edx
xorl %esi, %esi
cmpl %ebp, %esi
jge 0x440b
movslq %r8d, %rdi
movl (%rbx,%rdi,4), %r8d
leaq (%rcx,%rdi,4), %r14
xorl %r9d, %r9d
xorl %r10d, %r10d
movl (%r14,%r9,4), %r11d
incq %r9
decq %r10
cmpl %r8d, %r11d
jne 0x43d0
cmpl $0x4, %r9d
jb 0x43bb
addl $0x4, %r11d
cmpl $0x4, %r9d
cmovnel %r9d, %r11d
testl %r11d, %r11d
cmovlel %edx, %r11d
movslq %esi, %r14
addl %r11d, %esi
movslq %esi, %r11
subq %r10, %rdi
cmpq %r14, %r11
je 0x43fd
movl %r8d, (%rax,%r14,4)
incq %r14
jmp 0x43ef
leaq 0x1(%rdi), %r8
cmpl $0x4, %r9d
cmovneq %rdi, %r8
jmp 0x43a6
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::burrows_wheeler_encode(int*, int)
int *DATCompression::burrows_wheeler_encode(int *data, int n) {
    SuffixArray sa(data, n);
    
    int *bwt = (int *) calloc(n+4, sizeof(int));
    long int dollar_ind;
    bwt[0] = data[n-1];
    
    for (int i=0; i<n; ++i) {
        if (sa[i] == 0) {
            bwt[i+1] = INT_MIN;
            dollar_ind = i + 1;
        }
        else bwt[i+1] = data[sa[i] - 1];
    }
    
    bwt[n+1] = dollar_ind / (256*256);
    bwt[n+2] = (dollar_ind / 256) % 256;
    bwt[n+3] = dollar_ind % 256;
    
    return bwt;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rsp, %r12
movq %r12, %rdi
callq 0x47ec
leal 0x4(%r15), %eax
movslq %eax, %rdi
pushq $0x4
popq %rsi
callq 0x2110
movq %rax, %rbx
movslq %r15d, %rsi
movl -0x4(%r14,%rsi,4), %eax
movl %eax, (%rbx)
movq 0x8(%r12), %rax
xorl %edx, %edx
testl %esi, %esi
movl $0x0, %edi
cmovgl %esi, %edi
negq %rdi
incq %rdx
leaq (%rdi,%rdx), %r8
cmpq $0x1, %r8
je 0x448a
movslq -0x4(%rax,%rdx,4), %r8
testq %r8, %r8
je 0x447e
movl -0x4(%r14,%r8,4), %r8d
movl %r8d, (%rbx,%rdx,4)
jmp 0x445c
movl $0x80000000, (%rbx,%rdx,4) # imm = 0x80000000
movq %rdx, %rcx
jmp 0x445c
movl $0x10000, %edi          # imm = 0x10000
movq %rcx, %rax
cqto
idivq %rdi
movl %eax, 0x4(%rbx,%rsi,4)
movl $0x100, %edi            # imm = 0x100
movq %rcx, %rax
cqto
idivq %rdi
movq %rdx, %rcx
cqto
idivq %rdi
movl %edx, 0x8(%rbx,%rsi,4)
movl %ecx, 0xc(%rbx,%rsi,4)
movq %rsp, %rdi
callq 0x52e8
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::burrows_wheeler_decode(int*, int)
int *DATCompression::burrows_wheeler_decode(int *data, int n) {
    long int dollar_pos = 256*256*data[n+1] + 256*data[n+2] + data[n+3];
    int bwt_size = n + 1;
    
    pair<int,int> *f = (pair<int,int> *) calloc(bwt_size, sizeof(pair<int,int>));
    int *t = (int *) calloc(bwt_size, sizeof(int));
    int *s = (int *) calloc(n, sizeof(int));
    
    for (int i=0; i<bwt_size; ++i) f[i] = pair<int,int>(data[i], i);
    stable_sort(f, f + bwt_size, pair_comparator);
    
    for (int i=0; i<bwt_size; ++i) t[f[i].second] = i;
    free(f);
    
    int last_t = dollar_pos;
    for (int i=1; i<=n; ++i) {
        last_t = t[last_t];
        s[n-i] = data[last_t];
    }
    free(t);
    
    return s;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movslq %edx, %r15
leaq 0x1(%r15), %r14
movl 0x4(%rsi,%r15,4), %ebp
movl 0x8(%rsi,%r15,4), %r12d
shll $0x8, %r12d
movl 0xc(%rsi,%r15,4), %eax
movl %eax, 0x4(%rsp)
pushq $0x8
popq %rsi
movq %r14, %rdi
callq 0x2110
movq %rax, %r13
pushq $0x4
popq %rsi
movq %r14, 0x8(%rsp)
movq %r14, %rdi
callq 0x2110
movq %rax, %r14
movq %r15, %rdi
pushq $0x4
popq %rsi
callq 0x2110
movq %rax, 0x10(%rsp)
xorl %eax, %eax
cmpq %r15, %rax
jg 0x4555
movl (%rbx,%rax,4), %ecx
movl %ecx, (%r13,%rax,8)
movl %eax, 0x4(%r13,%rax,8)
incq %rax
jmp 0x453e
shll $0x10, %ebp
addl %ebp, %r12d
movq 0x8(%rsp), %rax
leaq (,%rax,8), %rsi
addq %r13, %rsi
leaq -0x9d(%rip), %rdx       # 0x44d5
movq %r13, %rdi
callq 0x5881
xorl %eax, %eax
cmpq %r15, %rax
jg 0x458f
movslq 0x4(%r13,%rax,8), %rcx
movl %eax, (%r14,%rcx,4)
incq %rax
jmp 0x457c
addl 0x4(%rsp), %r12d
movq %r13, %rdi
callq 0x21d0
xorl %eax, %eax
testl %r15d, %r15d
movl $0x0, %ecx
cmovgl %r15d, %ecx
negq %rcx
movq 0x10(%rsp), %rsi
leaq (%rsi,%r15,4), %rdx
addq $-0x4, %rdx
movq %rsi, %r15
cmpq %rax, %rcx
je 0x45d5
movslq %r12d, %rsi
movslq (%r14,%rsi,4), %r12
movl (%rbx,%r12,4), %esi
movl %esi, (%rdx,%rax,4)
decq %rax
jmp 0x45bd
movq %r14, %rdi
callq 0x21d0
movq %r15, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: DATCompression::compute_diff_statistics(std::vector<int, std::allocator<int>>)
vector<int> DATCompression::compute_diff_statistics(vector<int> data) {
    vector<int> diffs = compute_diffs(data);
    map<int, int> diff_counts;

    for (vector<int>::iterator viter = diffs.begin(); viter < diffs.end(); ++viter) {
        int val = *viter;
        if (diff_counts.count(val) == 0) diff_counts[val] = 0;
        ++diff_counts[val];
    }
    
    cout << "Counts of each difference in the data:" << endl;
    for (map<int, int>::iterator miter = diff_counts.begin(); miter != diff_counts.end(); ++miter) {
        printf("%d: %d\n", (*miter).first, (*miter).second);
    }
    
    return diffs;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
leaq 0x38(%rsp), %r15
movq %r15, %rdi
movq %rdx, %rsi
callq 0x51fc
movq %rbx, %rdi
movq %r15, %rdx
callq 0x3fb4
leaq 0x38(%rsp), %rdi
callq 0x5466
leaq 0x10(%rsp), %r12
andl $0x0, (%r12)
andq $0x0, 0x8(%r12)
movq %r12, 0x10(%r12)
movq %r12, 0x18(%r12)
andq $0x0, 0x20(%r12)
movq (%rbx), %r13
leaq 0x8(%rsp), %r14
leaq 0x4(%rsp), %r15
cmpq 0x8(%rbx), %r13
jae 0x4691
movl (%r13), %eax
movl %eax, 0x4(%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x5332
testq %rax, %rax
jne 0x467e
movq %r14, %rdi
movq %r15, %rsi
callq 0x534c
andl $0x0, (%rax)
movq %r14, %rdi
movq %r15, %rsi
callq 0x534c
incl (%rax)
addq $0x4, %r13
jmp 0x4652
movq 0x6940(%rip), %rdi      # 0xafd8
leaq 0x2a07(%rip), %rsi      # 0x70a6
callq 0x2180
movq %rax, %rdi
callq 0x20d0
movq 0x20(%rsp), %r15
leaq 0x2a15(%rip), %r14      # 0x70cd
cmpq %r12, %r15
je 0x46dc
movl 0x20(%r15), %esi
movl 0x24(%r15), %edx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2040
movq %r15, %rdi
callq 0x2120
movq %rax, %r15
jmp 0x46b8
leaq 0x8(%rsp), %rdi
callq 0x540e
movq %rbx, %rax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
movq %r15, %rbx
jmp 0x470e
jmp 0x4701
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x540e
movq %rbx, %rdi
callq 0x5466
movq %r14, %rdi
callq 0x22a0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: SuffixArray::SuffixArray(std::vector<int, std::allocator<int>>*)
SuffixArray::SuffixArray(vector<int> *data) {
    n = data->size();    
    s = (int *) calloc(n + 3, sizeof(int));

    copy(data->begin(), data->end(), s);
    
    prepareSuffixArray();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq 0x8(%rsi), %rax
subq (%rsi), %rax
movq %rdi, %rbx
movq %rax, %rcx
shrq $0x2, %rcx
movl %ecx, (%rdi)
shlq $0x1e, %rax
movabsq $0x300000000, %rdi      # imm = 0x300000000
addq %rax, %rdi
sarq $0x20, %rdi
pushq $0x4
popq %rsi
callq 0x2110
movq %rax, 0x10(%rbx)
movq (%r14), %rsi
movq 0x8(%r14), %rdx
subq %rsi, %rdx
je 0x476d
movq %rax, %rdi
callq 0x2260
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x477c
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: SuffixArray::prepareSuffixArray()
void SuffixArray::prepareSuffixArray() {
    // Add 3 trailing zeroes for skew algorithm
    int i;
    int *cur_data_elt = s + n;
    *cur_data_elt = 0; ++cur_data_elt;
    *cur_data_elt = 0; ++cur_data_elt;
    *cur_data_elt = 0; ++cur_data_elt;
    
    sa = (int *) calloc(n, sizeof(int));
    
    // Suffix array computation requires values in [1,256] instead of [0,255]
    for (i=0; i<n; ++i) ++s[i];
    doSuffixArrayComputation(s, sa, n, 256);
    for (i=0; i<n; ++i) --s[i];
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %r14
movslq (%rdi), %rax
andq $0x0, (%r14,%rax,4)
andl $0x0, 0x8(%r14,%rax,4)
movl (%rdi), %ebp
movslq %ebp, %rdi
pushq $0x4
popq %rsi
callq 0x2110
movq %rax, 0x8(%rbx)
xorl %ecx, %ecx
movslq %ebp, %rdx
cmpq %rdx, %rcx
jge 0x47bb
incl (%r14,%rcx,4)
incq %rcx
movl (%rbx), %ebp
jmp 0x47a8
movq %rbx, %rdi
movq %r14, %rsi
movq %rax, %rdx
movl %ebp, %ecx
movl $0x100, %r8d            # imm = 0x100
callq 0x482c
movq 0x10(%rbx), %rax
xorl %ecx, %ecx
movslq (%rbx), %rdx
cmpq %rdx, %rcx
jge 0x47e7
decl (%rax,%rcx,4)
incq %rcx
jmp 0x47d7
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: SuffixArray::SuffixArray(int*, int)
SuffixArray::SuffixArray(int *data, int _n) {
    n = _n;
    
    s = (int *) calloc(n + 3, sizeof(int));
    memcpy(s, data, n * (sizeof(int)));
    
    prepareSuffixArray();
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
movl %edx, (%rdi)
leal 0x3(%rbx), %eax
movslq %eax, %rdi
pushq $0x4
popq %rsi
callq 0x2110
movq %rax, 0x10(%r15)
movslq %ebx, %rdx
shlq $0x2, %rdx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2160
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x477c
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: SuffixArray::print()
void SuffixArray::print() {
    for (int i=0; i<(n+3); ++i) {
        printf("s[%d] = %d\n", i, s[i]);
    }
    for (int i=0; i<n; ++i) {
        printf("sa[%d] = %d\n", i, sa[i]);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
leaq 0x23ac(%rip), %r14      # 0x70d5
xorl %r15d, %r15d
movslq (%rbx), %rax
leaq 0x3(%rax), %rcx
cmpq %rcx, %r15
jge 0x4d52
movq 0x10(%rbx), %rax
movl (%rax,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2040
incq %r15
jmp 0x4d2c
leaq 0x2388(%rip), %r14      # 0x70e1
xorl %r15d, %r15d
cltq
cmpq %rax, %r15
jge 0x4d7f
movq 0x8(%rbx), %rax
movl (%rax,%r15,4), %edx
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2040
incq %r15
movl (%rbx), %eax
jmp 0x4d5c
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: SuffixArray::radixPass(int*, int*, int*, int, int)
void SuffixArray::radixPass(int* a, int* b, int* r, int n, int K)
{// count occurrences
    int* c = new int[K + 1]; // counter array
    for (int i = 0; i <= K; i++) c[i] = 0; // reset counters
    for (int i = 0; i < n; i++) c[r[a[i]]]++; // count occurrences
    for (int i = 0, sum = 0; i <= K; i++) // exclusive prefix sums
    {int t = c[i]; c[i] = sum; sum += t; }
    for (int i = 0; i < n; i++) b[c[r[a[i]]]++] = a[i]; // sort
    delete [] c;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movl %r9d, %r13d
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
leal 0x1(%r13), %eax
shlq $0x2, %rax
cmpl $-0x1, %r9d
pushq $-0x1
popq %rdi
cmovgeq %rax, %rdi
callq 0x2030
movslq %r13d, %rcx
xorl %edx, %edx
cmpq %rcx, %rdx
jg 0x4dc9
andl $0x0, (%rax,%rdx,4)
incq %rdx
jmp 0x4dbb
xorl %edx, %edx
testl %ebx, %ebx
cmovlel %edx, %ebx
cmpq %rdx, %rbx
je 0x4de5
movslq (%r12,%rdx,4), %rsi
movslq (%r14,%rsi,4), %rsi
incl (%rax,%rsi,4)
incq %rdx
jmp 0x4dd0
xorl %edx, %edx
xorl %esi, %esi
cmpq %rcx, %rdx
jg 0x4dfd
movl (%rax,%rdx,4), %edi
addl %esi, %edi
movl %esi, (%rax,%rdx,4)
incq %rdx
movl %edi, %esi
jmp 0x4de9
xorl %ecx, %ecx
cmpq %rcx, %rbx
je 0x4e21
movslq (%r12,%rcx,4), %rdx
movslq (%r14,%rdx,4), %rsi
movslq (%rax,%rsi,4), %rdi
leal 0x1(%rdi), %r8d
movl %r8d, (%rax,%rsi,4)
movl %edx, (%r15,%rdi,4)
incq %rcx
jmp 0x4dff
movq %rax, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21f0
// File: /workspace/github_cpp_makefile_star2_O2/dgboy2000[P]compress/compress.cpp
// Function: test_suffix_arrays()
void test_suffix_arrays() {
    int len = 9;
    int word[] = {1, 2, 3, 4, 5, 4, 3, 2, 1};
    int true_suffixes[] = {8, 0, 7, 1, 6, 2, 5, 3, 4};
    
    SuffixArray sa(word, len);
    int *suffixes = sa.getSuffixArray();
    
    
    for (int i=0; i<len; ++i) {
        if (suffixes[i] == true_suffixes[i]) {
            //printf("CORRECT: True suffix SA[%d] = %d\n", i, suffixes[i]);
        } else {
            printf("FAIL: True suffix SA[%d] is %d but found %d\n", i, true_suffixes[i], suffixes[i]);
            return;
        }
    }
    printf("PASS: suffix array is correct\n");
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
leaq 0x2442(%rip), %rsi      # 0x7280
leaq 0x8(%rsp), %rbx
pushq $0x9
popq %rdx
movq %rbx, %rdi
callq 0x47ec
leaq 0x245b(%rip), %rax      # 0x72b0
xorl %esi, %esi
movq 0x8(%rbx), %rdi
cmpq $0x9, %rsi
je 0x4e73
movl (%rdi,%rsi,4), %ecx
movl (%rax), %edx
cmpl %edx, %ecx
jne 0x4e81
incq %rsi
addq $0x4, %rax
jmp 0x4e5b
leaq 0x23db(%rip), %rdi      # 0x7255
callq 0x2220
jmp 0x4e8f
leaq 0x2266(%rip), %rdi      # 0x70ee
xorl %eax, %eax
callq 0x2040
leaq 0x8(%rsp), %rdi
callq 0x52e8
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/strfunc.cpp
// Function: delsp(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string delsp(std::string input){
	//str+=(std::string)" ";
	input.insert(input.length()," ");
	while(1){
		if(input.find("  ",0)==std::string::npos) break;
		input.erase(input.find("  ",0),1);
	}
	if(input[0]==' ') input.erase(0,1);
	#ifdef DEBUG
	std::cout << input << std::endl;
	#endif

	return input;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
leaq 0x3b80(%rip), %rdx      # 0x6005
movq %r14, %rdi
callq 0x2070
leaq 0x3b70(%rip), %r15      # 0x6004
pushq $0x1
popq %r12
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2310
cmpq $-0x1, %rax
je 0x24c8
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2310
movq %r14, %rdi
movq %rax, %rsi
movq %r12, %rdx
callq 0x2060
jmp 0x2498
movq (%r14), %rax
cmpb $0x20, (%rax)
jne 0x24dd
pushq $0x1
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2060
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2240
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/strfunc.cpp
// Function: split(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::list<std::string> split(std::string input){
	int i,pos,n=(int)input.length();
	std::list<std::string> output;
	
	pos = 0;
	for(i=0;i<n;i++){
		if(input[i]==' '){
			output.push_back(input.substr(i-pos,pos));
			#if MYDEBUG
			std::cout << input.substr(i-pos,pos) << std::endl;
			#endif
			pos = 0;
			continue;
		}
		pos++;
	}
	return output;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %r12d
movq %rdi, 0x8(%rdi)
movq %rdi, (%rdi)
andq $0x0, 0x10(%rdi)
xorl %r13d, %r13d
testl %r12d, %r12d
cmovlel %r13d, %r12d
movq %rsp, %r15
xorl %eax, %eax
cmpq %r13, %r12
je 0x256a
movq (%r14), %rcx
cmpb $0x20, (%rcx,%r13)
jne 0x2563
movslq %eax, %rcx
movq %r13, %rdx
subq %rcx, %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x21e0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x259c
movq %r15, %rdi
callq 0x2328
xorl %eax, %eax
jmp 0x2565
incl %eax
incq %r13
jmp 0x2529
movq %rbx, %rax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
jmp 0x258b
movq %rax, %r14
movq %rsp, %rdi
callq 0x2328
movq %rbx, %rdi
callq 0x25a8
movq %r14, %rdi
callq 0x22e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/./element.h
// Function: is_float(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool is_float(std::string input){
	unsigned int i;
	bool dec=false;

	for(i=0;i<input.length();i++){
		if(is_dec(input[i]) && dec){
			throw((std::string)"小数点を2個以上指定することはできません。");
			return false;
		}
		if(!is_dig(input[i]) && !is_dec(input[i])) return false;
		if(is_dec(input[i])) dec=true;

		if(dec && input.length()==1){
			//「.」のみの小数は扱えません
			return false;
		}
	}
	return true;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x8(%rdi), %rax
xorl %ecx, %ecx
xorl %edx, %edx
movl %edx, %edx
cmpq %rdx, %rax
jbe 0x28de
movq (%rdi), %rsi
movb (%rsi,%rdx), %sil
cmpb $0x2e, %sil
jne 0x28c5
testb $0x1, %cl
movb $0x1, %cl
je 0x28d4
jmp 0x28ec
addb $-0x30, %sil
cmpb $0x9, %sil
ja 0x28de
testb $0x1, %cl
je 0x28da
cmpq $0x1, %rax
je 0x28de
incl %edx
jmp 0x28a8
cmpq %rdx, %rax
setbe %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
pushq $0x20
popq %rdi
callq 0x20f0
movq %rax, %rbx
leaq 0x37bb(%rip), %rsi      # 0x60b9
leaq 0x7(%rsp), %rdx
movq %rax, %rdi
callq 0x4eb6
leaq 0x647e(%rip), %rsi      # 0x8d90
movq 0x669f(%rip), %rdx      # 0x8fb8
movq %rbx, %rdi
callq 0x22c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/./element.h
// Function: is_alphastr(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool is_alphastr(std::string input){
	unsigned int i;

	for(i=0;i<input.length();i++){
		if(!is_alphabet(input[i])){
			return false;
		}
	}
	return true;
}

// Assembly:
movq 0x8(%rdi), %rax
xorl %edx, %edx
movl %edx, %ecx
cmpq %rcx, %rax
jbe 0x2959
movq (%rdi), %rdx
movb (%rdx,%rcx), %sil
andb $-0x21, %sil
addb $-0x41, %sil
leal 0x1(%rcx), %edx
cmpb $0x1a, %sil
jb 0x293a
cmpq %rcx, %rax
setbe %al
retq
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/./element.h
// Function: rtntype(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string rtntype(std::string input){
	int n=0;
	std::string type[]={"unknown","op","int","float","complex","rational","variable","constant"};

	if(is_op(input)){
		n=1;
	/*}else if(is_func(input)){
		n=2;*/
	}else if(is_num(input)){
		if(is_int(input)) n=2;
		else if(is_float(input)) n=3;
		// else if(is_complex(input)) n=4;
		// else if(is_rational(input)) n=5
	}

	return type[n];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x190, %rsp            # imm = 0x190
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x3492(%rip), %rsi      # 0x614e
leaq 0x90(%rsp), %r15
leaq 0xf(%rsp), %rdx
movq %r15, %rdi
callq 0x4eb6
leaq 0xb0(%rsp), %r12
leaq 0x3476(%rip), %rsi      # 0x6156
leaq 0xe(%rsp), %rdx
movq %r12, %rdi
callq 0x4eb6
leaq 0xd0(%rsp), %r12
leaq 0x344e(%rip), %rsi      # 0x614a
leaq 0xd(%rsp), %rdx
movq %r12, %rdi
callq 0x4eb6
leaq 0xf0(%rsp), %r12
leaq 0x3441(%rip), %rsi      # 0x6159
leaq 0xc(%rsp), %rdx
movq %r12, %rdi
callq 0x4eb6
leaq 0x110(%rsp), %r12
leaq 0x342b(%rip), %rsi      # 0x615f
leaq 0xb(%rsp), %rdx
movq %r12, %rdi
callq 0x4eb6
leaq 0x130(%rsp), %r12
leaq 0x3417(%rip), %rsi      # 0x6167
leaq 0xa(%rsp), %rdx
movq %r12, %rdi
callq 0x4eb6
leaq 0x150(%rsp), %r12
leaq 0x3404(%rip), %rsi      # 0x6170
leaq 0x9(%rsp), %rdx
movq %r12, %rdi
callq 0x4eb6
leaq 0x170(%rsp), %r12
leaq 0x33f1(%rip), %rsi      # 0x6179
leaq 0x8(%rsp), %rdx
movq %r12, %rdi
callq 0x4eb6
leaq 0x50(%rsp), %rdi
movq %r14, %rsi
callq 0x2260
leaq 0x50(%rsp), %rdi
callq 0x2960
movl %eax, %ebp
leaq 0x50(%rsp), %rdi
callq 0x2328
testb %bpl, %bpl
je 0x2dc5
pushq $0x1
popq %rax
jmp 0x2e49
leaq 0x70(%rsp), %rdi
movq %r14, %rsi
callq 0x2260
leaq 0x70(%rsp), %r15
movq %r15, %rdi
callq 0x27ac
movl %eax, %ebp
movq %r15, %rdi
callq 0x2328
testb %bpl, %bpl
je 0x2e1a
leaq 0x30(%rsp), %rdi
movq %r14, %rsi
callq 0x2260
leaq 0x30(%rsp), %rdi
callq 0x27f9
movl %eax, %ebp
leaq 0x30(%rsp), %rdi
callq 0x2328
testb %bpl, %bpl
je 0x2e1e
pushq $0x2
jmp 0x2dbf
xorl %eax, %eax
jmp 0x2e49
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0x2260
leaq 0x10(%rsp), %rdi
callq 0x289c
movl %eax, %ebp
leaq 0x10(%rsp), %rdi
callq 0x2328
movzbl %bpl, %eax
leaq (%rax,%rax,2), %rax
shll $0x5, %eax
leaq (%rsp,%rax), %rsi
addq $0x90, %rsi
movq %rbx, %rdi
callq 0x2260
movl $0xe0, %r14d
leaq (%rsp,%r14), %rdi
addq $0x90, %rdi
callq 0x2328
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x2e65
movq %rbx, %rax
addq $0x190, %rsp            # imm = 0x190
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
jmp 0x2eae
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x2eae
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x2328
jmp 0x2eda
jmp 0x2ec1
jmp 0x2ec1
jmp 0x2ec1
jmp 0x2ec1
jmp 0x2ec1
jmp 0x2ec1
movq %rax, %rbx
addq $-0x20, %r12
movq %r12, %rdi
callq 0x2328
cmpq %r15, %r12
jne 0x2ec4
jmp 0x2efa
movq %rax, %rbx
movl $0xe0, %r14d
leaq (%rsp,%r14), %rdi
addq $0x90, %rdi
callq 0x2328
addq $-0x20, %r14
cmpq $-0x20, %r14
jne 0x2ee0
movq %rbx, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/./element.h
// Function: findop(Element**, int)
int findop(Element** input,int length){
	int i,output=-1;

	for(i=0;i<length;i++){
		//std::cout << i + " ";
		#if MYDEBUG
		std::cout << input[i]->data_is() << ".type_is() --->" << input[i]->type_is() << std::endl;
		#endif

		if((input[i]->type_is()) == "op"){
			output=i;
			break;
		}
	}
	if(output==-1) throw((std::string)"演算子が見つかりませんでした。");

	return output;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r14d
movq %rdi, %r15
xorl %ebx, %ebx
testl %esi, %esi
cmovlel %ebx, %r14d
leaq 0x8(%rsp), %r12
leaq 0x2f7b(%rip), %r13      # 0x6156
cmpq %rbx, %r14
je 0x3220
movq (%r15,%rbx,8), %rsi
addq $0x20, %rsi
movq %r12, %rdi
callq 0x2260
movq %r12, %rdi
movq %r13, %rsi
callq 0x4f1a
movl %eax, %ebp
movq %r12, %rdi
callq 0x2328
testb %bpl, %bpl
jne 0x320f
incq %rbx
jmp 0x31db
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x20
popq %rdi
callq 0x20f0
movq %rax, %rbx
leaq 0x2f7d(%rip), %rsi      # 0x61af
leaq 0x8(%rsp), %rdx
movq %rax, %rdi
callq 0x4eb6
leaq 0x5b4a(%rip), %rsi      # 0x8d90
movq 0x5d6b(%rip), %rdx      # 0x8fb8
movq %rbx, %rdi
callq 0x22c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/./element.h
// Function: take_elements(Element**, int, int)
Element** take_elements(Element** elements, int pos, int num){
	int i;
	Element **output = new Element*[num];

	for(i=pos;i<pos+num;i++){
		output[i-pos] = elements[i];
	}
	return output;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movq %rdi, %r14
movl %edx, %eax
shlq $0x3, %rax
testl %edx, %edx
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
callq 0x2030
addl %ebp, %ebx
movslq %ebp, %rcx
movslq %ebx, %rdx
leaq (%r14,%rcx,8), %rsi
xorl %edi, %edi
leaq (%rcx,%rdi), %r8
cmpq %rdx, %r8
jge 0x32ab
movq (%rsi,%rdi,8), %r8
movq %r8, (%rax,%rdi,8)
incq %rdi
jmp 0x3295
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/./element.h
// Function: op_plus(Element*, Element*)
Element* op_plus(Element* op1,Element* op2){
	long a;
	double b;
	Element *rtn;
	
	if(op1->type_is() == "int" && op2->type_is() == "int"){
		a = atol(op1->data_is().c_str()) + atol(op2->data_is().c_str());
		rtn = new Element(ltoa(a));
	}else if(op1->type_is() == "float" || op2->type_is() == "float"){
		b = atof(op1->data_is().c_str()) + atof(op2->data_is().c_str());
		rtn = new Element(ftoa(b));
	}
	return rtn;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x20(%rdi), %r15
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2260
leaq 0x2c5e(%rip), %rsi      # 0x614a
movq %r12, %rdi
callq 0x4f1a
testb %al, %al
je 0x35ac
leaq 0x20(%rbx), %rsi
leaq 0x30(%rsp), %rdi
callq 0x2260
leaq 0x2c39(%rip), %rsi      # 0x614a
leaq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0x4f1a
movl %eax, %ebp
movq %r12, %rdi
callq 0x2328
leaq 0x10(%rsp), %rdi
callq 0x2328
testb %bpl, %bpl
je 0x35b6
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2260
movq (%r15), %rdi
callq 0x21f0
movq %rax, %r15
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x2260
leaq 0x30(%rsp), %rbx
movq (%rbx), %rdi
callq 0x21f0
addq %rax, %r15
movq %rbx, %rdi
callq 0x2328
leaq 0x10(%rsp), %rdi
callq 0x2328
pushq $0x40
popq %rdi
callq 0x21c0
movq %rax, %rbx
leaq 0x70(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x26f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2f02
jmp 0x368c
leaq 0x10(%rsp), %rdi
callq 0x2328
leaq 0x10(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x2260
leaq 0x2b8c(%rip), %rsi      # 0x6159
movq %r12, %rdi
callq 0x4f1a
testb %al, %al
jne 0x3603
leaq 0x20(%rbx), %rsi
leaq 0x30(%rsp), %rdi
callq 0x2260
leaq 0x2b6b(%rip), %rsi      # 0x6159
leaq 0x30(%rsp), %r15
movq %r15, %rdi
callq 0x4f1a
movq %r15, %rdi
callq 0x2328
leaq 0x10(%rsp), %rdi
callq 0x2328
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2260
movq (%r15), %rdi
callq 0x2220
movsd %xmm0, 0x8(%rsp)
leaq 0x30(%rsp), %rdi
movq %rbx, %rsi
callq 0x2260
leaq 0x30(%rsp), %rbx
movq (%rbx), %rdi
callq 0x2220
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x2328
leaq 0x10(%rsp), %rdi
callq 0x2328
pushq $0x40
popq %rdi
callq 0x21c0
movq %rax, %rbx
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movsd 0x8(%rsp), %xmm0
callq 0x274b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2f02
movq %r14, %rdi
callq 0x2328
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x70(%rsp), %rdi
jmp 0x36c1
jmp 0x36c8
jmp 0x36d8
jmp 0x36d8
jmp 0x36d8
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x2328
jmp 0x36cb
movq %rax, %r14
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0x21d0
jmp 0x36e5
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2328
movq %r14, %rdi
callq 0x22e0
// File: /workspace/github_cpp_makefile_star2_O2/syusui-s[P]old_rpn_language/./element.h
// Function: op_divide(Element*, Element*)
Element* op_divide(Element* op1,Element* op2){
	//long a;
	double b;
	Element *rtn;
	
	b = atof(op1->data_is().c_str()) / atof(op2->data_is().c_str());
	rtn = new Element(ftoa(b));

	return rtn;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %rsi
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0x2260
movq (%r14), %rdi
callq 0x2220
movsd %xmm0, (%rsp)
leaq 0x48(%rsp), %rdi
movq %rbx, %rsi
callq 0x2260
leaq 0x48(%rsp), %rbx
movq (%rbx), %rdi
callq 0x2220
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movq %rbx, %rdi
callq 0x2328
leaq 0x28(%rsp), %rdi
callq 0x2328
pushq $0x40
popq %rdi
callq 0x21c0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
movsd (%rsp), %xmm0
callq 0x274b
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2f02
leaq 0x8(%rsp), %rdi
callq 0x2328
movq %rbx, %rax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x2328
jmp 0x3c07
movq %rax, %r14
pushq $0x40
popq %rsi
movq %rbx, %rdi
callq 0x21d0
jmp 0x3c21
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x2328
movq %r14, %rdi
callq 0x22e0