LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/phmap/./phmap.h
// Function: std::pair<phmap::container_internal::raw_hash_set<phmap::container_internal::FlatHashMapPolicy<unsigned int, unsigned int>, Hash32, phmap::EqualTo<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>>::iterator, bool> phmap::container_internal::raw_hash_set<phmap::container_internal::FlatHashMapPolicy<unsigned int, unsigned int>, Hash32, phmap::EqualTo<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>>::emplace_decomposable<unsigned int, std::piecewise_construct_t const&, std::tuple<unsigned int&&>, std::tuple<unsigned int&&>>(unsigned int const&, unsigned long, std::piecewise_construct_t const&, std::tuple<unsigned int&&>&&, std::tuple<unsigned int&&>&&)
std::pair<iterator, bool> emplace_decomposable(const K& key, size_t hash, 
                                                   Args&&... args)
    {
        auto res = find_or_prepare_insert(key, hash);
        if (res.second) {
            emplace_at(res.first, std::forward<Args>(args)...);
        }
        return {iterator_at(res.first), res.second};
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r15
movq %r8, %r13
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x17c6
movq %rax, %r12
movl %edx, %ebp
testb $0x1, %dl
je 0x179b
movq 0x40(%rsp), %r8
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %r15, %rcx
callq 0x1898
movq (%r14), %rax
addq %r12, %rax
shlq $0x3, %r12
addq 0x8(%r14), %r12
movq %rax, (%rbx)
movq %r12, 0x8(%rbx)
movb %bpl, 0x10(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/phmap/./phmap.h
// Function: phmap::container_internal::raw_hash_set<phmap::container_internal::FlatHashMapPolicy<unsigned int, unsigned int>, Hash32, phmap::EqualTo<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>>::iterator::operator++()
iterator& operator++() {
            ++ctrl_;
            ++slot_;
            skip_empty_or_deleted();
            return *this;
        }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movdqu (%rdi), %xmm0
paddq 0xdce(%rip), %xmm0      # 0x3050
movdqu %xmm0, (%rdi)
callq 0x2290
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/attractivechaos[P]udb2/phmap/./phmap.h
// Function: phmap::container_internal::raw_hash_set<phmap::container_internal::FlatHashMapPolicy<unsigned int, unsigned int>, Hash32, phmap::EqualTo<unsigned int>, std::allocator<std::pair<unsigned int const, unsigned int>>>::iterator::skip_empty_or_deleted()
void skip_empty_or_deleted() {
            while (IsEmptyOrDeleted(*ctrl_)) {
                // ctrl is not necessarily aligned to Group::kWidth. It is also likely
                // to read past the space for ctrl bytes and into slots. This is ok
                // because ctrl has sizeof() == 1 and slot has sizeof() >= 1 so there
                // is no way to read outside the combined slot array.
                uint32_t shift = Group{ctrl_}.CountLeadingEmptyOrDeleted();
                ctrl_ += shift;
                slot_ += shift;
            }
        }

// Assembly:
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
cmpb $-0x2, (%rax)
jg 0x22c1
movdqu (%rax), %xmm0
pcmpeqd %xmm1, %xmm1
pcmpgtb %xmm0, %xmm1
pmovmskb %xmm1, %edx
incl %edx
bsfl %edx, %edx
addq %rdx, %rax
movq %rax, (%rdi)
leaq (%rcx,%rdx,8), %rcx
movq %rcx, 0x8(%rdi)
jmp 0x2297
retq
// File: /workspace/github_cpp_makefile_star2_O2/j-faria[P]kima/examples/activity_correlations/kima_setup.cpp
// Function: main
int main(int argc, char** argv)
{
    /* Four options to demonstrate the linear correlations with indicators */

    // Load the first file without any correlation (just reads time, RV, error)
    datafile = "simulated1.txt";
    load(datafile, "ms", 4);

    /* Load the first file with linear correlation with indicator "b", in the 4th column */
    // datafile = "simulated1.txt";
    // indicators = {"b"};
    // load(datafile, "ms", 4, indicators);

    /* Load the second file with linear correlation with indicator "b" only */
    // datafile = "simulated2.txt";
    // indicators = {"b"};
    // load(datafile, "ms", 4, indicators);

    /* Load the second file, with linear correlation with "b" and "c", skip 5th column */
    // datafile = "simulated2.txt";
    // indicators = {"b", "", "indc"};
    // load(datafile, "ms", 4, indicators);


    Sampler<RVmodel> sampler = setup<RVmodel>(argc, argv);
    sampler.run(50);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x6c0, %rsp            # imm = 0x6C0
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x437a9(%rip), %r14     # 0x646c0
leaq 0x260ff(%rip), %rsi     # 0x4701d
movq %r14, %rdi
callq 0x6770
leaq 0x8(%rsp), %rdx
movl $0x4, (%rdx)
leaq 0x1b5a9(%rip), %rsi     # 0x3c4e1
movq %r14, %rdi
callq 0x2116b
leaq 0x8(%rsp), %r14
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x21214
pushq $0x32
popq %rsi
movq %r14, %rdi
callq 0x21260
leaq 0x8(%rsp), %rdi
callq 0x21426
xorl %eax, %eax
addq $0x6c0, %rsp            # imm = 0x6C0
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x21426
movq %rbx, %rdi
callq 0x66e0
// File: /workspace/github_cpp_makefile_star2_O2/brianwu02[P]ImageProcessing/unordered_dither.cpp
// Function: main
int main(int argc, char** argv) {
    int	n;
    double gamma;
    imageP	I1, I2, tmp_img;
    // read input image (I1) and reserve space for output (I2)
    I1 = IP_readImage(argv[1]);
    I2 = NEWIMAGE;
    tmp_img = NEWIMAGE;

    // read n and gamma from STDIN
    n = atoi(argv[2]);
    gamma = atof(argv[3]);

    // threshold image and save result in file
    unordered_dither(I1, n, gamma, I2, tmp_img);
    IP_saveImage(I2, argv[4]);

    // free up image structures/memory
    IP_freeImage(I1);
    IP_freeImage(I2);
    IP_freeImage(tmp_img);
    cout << "done" << endl;

	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq 0x8(%rsi), %rdi
callq 0x1590
movq %rax, %rbx
pushq $0x10
popq %r12
movq %r12, %rdi
callq 0x1130
movq %rax, %r15
movq %r12, %rdi
callq 0x1130
movq %rax, %r12
movq 0x10(%r14), %rdi
callq 0x1170
movl %eax, %ebp
movq 0x18(%r14), %rdi
callq 0x1100
cvtsd2ss %xmm0, %xmm0
movq %rbx, %rdi
movl %ebp, %esi
movq %r15, %rdx
movq %r12, %rcx
callq 0x13b0
movq 0x20(%r14), %rsi
movq %r15, %rdi
callq 0x175a
movq %rbx, %rdi
callq 0x185b
movq %r15, %rdi
callq 0x185b
movq %r12, %rdi
callq 0x185b
movq 0x2c40(%rip), %rdi      # 0x3fd0
leaq 0xc89(%rip), %rsi       # 0x2020
callq 0x10c0
movq %rax, %rdi
callq 0x1070
pushq $0x1
popq %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]randomsampling/test.cpp
// Function: testall(std::vector<double, std::allocator<double>>&)
void testall(std::vector<double> &v) {
  std::cout << "Input Data" << std::endl;
  for (size_t i = 0; i < v.size(); i++) {
    std::cout << i << ":" << v[i] << std::endl;
  }
  std::cout << std::endl;
  test<walker_alias>(v);
  test<cumulative_sum>(v);
  test<binary_tree>(v);

  int uindex = 2;
  double uvalue = 6.0;
  std::cout << "Partial Update" << std::endl;
  std::cout << uindex << ":" << v[uindex] << "->" << uvalue << std::endl;
  std::cout << std::endl;
  test_with_update<binary_tree>(v, uindex, uvalue);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x5cca(%rip), %r14      # 0x7fd8
leaq 0x2d47(%rip), %rsi      # 0x505c
movq %r14, %rdi
callq 0x2120
movq %rax, %rdi
callq 0x2080
xorl %r15d, %r15d
leaq 0x2d38(%rip), %r12      # 0x5067
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
cmpq %rax, %r15
jae 0x2373
movq %r14, %rdi
movq %r15, %rsi
callq 0x20b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq (%rbx), %rcx
movsd (%rcx,%r15,8), %xmm0
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x2080
incq %r15
jmp 0x232f
movq 0x5c5e(%rip), %r14      # 0x7fd8
movq %r14, %rdi
callq 0x2080
movq %rbx, %rdi
callq 0x2497
movq %rbx, %rdi
callq 0x2636
movq %rbx, %rdi
callq 0x27cc
leaq 0x2cc8(%rip), %rsi      # 0x5069
movq %r14, %rdi
callq 0x2120
movq %rax, %rdi
callq 0x2080
pushq $0x2
popq %rbp
movq %r14, %rdi
movl %ebp, %esi
callq 0x21a0
leaq 0x2ca2(%rip), %rsi      # 0x5067
movq %rax, %rdi
callq 0x2120
movq (%rbx), %rcx
movsd 0x10(%rcx), %xmm0
movq %rax, %rdi
callq 0x2170
leaq 0x2c94(%rip), %rsi      # 0x5078
movq %rax, %rdi
callq 0x2120
movsd 0x2c14(%rip), %xmm0     # 0x5008
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x2080
movq %r14, %rdi
callq 0x2080
movq %rbx, %rdi
movl %ebp, %esi
movsd 0x2bef(%rip), %xmm0     # 0x5008
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2962
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]randomsampling/test.cpp
// Function: void test<walker_alias>(std::vector<double, std::allocator<double>>&)
void test(std::vector<double> &v) {
  std::vector<double> r(v.size(), 0.0);
  std::mt19937 mt;
  T s(v);
  std::cout << s.name() << std::endl;
  const int N = 100000;
  double sum = std::accumulate(v.begin(), v.end(), 0);
  const double a = sum / N;
  for (int i = 0; i < N; i++) {
    int index = s.select(mt);
    r[index] += a;
  }
  for (size_t i = 0; i < v.size(); i++) {
    std::cout << i << ":" << r[i] << std::endl;
  }
  std::cout << std::endl;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1420, %rsp           # imm = 0x1420
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x3, %rsi
leaq 0x98(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rcx
callq 0x2b80
leaq 0x98(%rsp), %rdi
callq 0x2bd6
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x2be0
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x2e9a
movq 0x5ad9(%rip), %rdi      # 0x7fd8
leaq 0x20(%rsp), %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2080
leaq 0x20(%rsp), %rdi
callq 0x2070
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
xorl %edx, %edx
callq 0x2ebc
cvtsi2sd %eax, %xmm0
divsd 0x2adb(%rip), %xmm0     # 0x5010
movsd %xmm0, (%rsp)
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0x40(%rsp), %r14
leaq 0x98(%rsp), %r15
subl $0x1, %ebp
jb 0x2574
movq %r14, %rdi
movq %r15, %rsi
callq 0x2ed6
cltq
movq 0x8(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
addsd (%rsp), %xmm0
movsd %xmm0, (%rcx,%rax,8)
jmp 0x254c
xorl %r14d, %r14d
movq 0x5a5a(%rip), %r15      # 0x7fd8
leaq 0x2ae2(%rip), %r12      # 0x5067
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
cmpq %rax, %r14
jae 0x25cb
movq %r15, %rdi
movq %r14, %rsi
callq 0x20b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq 0x8(%rsp), %rcx
movsd (%rcx,%r14,8), %xmm0
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x2080
incq %r14
jmp 0x2585
movq 0x5a06(%rip), %rdi      # 0x7fd8
callq 0x2080
leaq 0x40(%rsp), %rdi
callq 0x2f06
leaq 0x8(%rsp), %rdi
callq 0x2b4c
addq $0x1420, %rsp           # imm = 0x1420
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2617
jmp 0x2617
jmp 0x2601
movq %rax, %rbx
jmp 0x2624
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2070
jmp 0x261a
jmp 0x2617
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x2f06
leaq 0x8(%rsp), %rdi
callq 0x2b4c
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]randomsampling/test.cpp
// Function: void test_with_update<binary_tree>(std::vector<double, std::allocator<double>>&, int, double)
void test_with_update(std::vector<double> &v, int ui, double uvalue) {
  std::vector<double> r(v.size(), 0.0);
  std::mt19937 mt;
  T s(v);
  std::cout << s.name() << std::endl;

  v[ui] = uvalue;
  s.update(ui, uvalue);
  const int N = 100000;
  double sum = std::accumulate(v.begin(), v.end(), 0);
  const double a = sum / N;
  for (int i = 0; i < N; i++) {
    int index = s.select(mt);
    r[index] += a;
  }
  for (size_t i = 0; i < v.size(); i++) {
    std::cout << i << ":" << r[i] << std::endl;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x13f0, %rsp           # imm = 0x13F0
movsd %xmm0, (%rsp)
movl %esi, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
subq (%rdi), %rsi
sarq $0x3, %rsi
leaq 0x68(%rsp), %rdx
andq $0x0, (%rdx)
leaq 0x8(%rsp), %rdi
leaq 0x20(%rsp), %rcx
callq 0x2b80
leaq 0x68(%rsp), %rdi
callq 0x2bd6
leaq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x3f68
leaq 0x48(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x407c
movq 0x560d(%rip), %rdi      # 0x7fd8
leaq 0x48(%rsp), %rsi
callq 0x2110
movq %rax, %rdi
callq 0x2080
leaq 0x48(%rsp), %rdi
callq 0x2070
movslq %ebp, %rsi
movq (%rbx), %rax
movsd (%rsp), %xmm0
movsd %xmm0, (%rax,%rsi,8)
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x412c
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
xorl %edx, %edx
callq 0x2ebc
cvtsi2sd %eax, %xmm0
divsd 0x25f2(%rip), %xmm0     # 0x5010
movsd %xmm0, (%rsp)
movl $0x186a0, %ebp          # imm = 0x186A0
leaq 0x68(%rsp), %r15
subl $0x1, %ebp
jb 0x2a55
movq %r14, %rdi
movq %r15, %rsi
callq 0x409e
cltq
movq 0x8(%rsp), %rcx
movsd (%rcx,%rax,8), %xmm0
addsd (%rsp), %xmm0
movsd %xmm0, (%rcx,%rax,8)
jmp 0x2a2d
xorl %r14d, %r14d
movq 0x5579(%rip), %r15      # 0x7fd8
leaq 0x2601(%rip), %r12      # 0x5067
movq 0x8(%rbx), %rax
subq (%rbx), %rax
sarq $0x3, %rax
cmpq %rax, %r14
jae 0x2aac
movq %r15, %rdi
movq %r14, %rsi
callq 0x20b0
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq 0x8(%rsp), %rcx
movsd (%rcx,%r14,8), %xmm0
movq %rax, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x2080
incq %r14
jmp 0x2a66
leaq 0x20(%rsp), %rdi
callq 0x2b4c
leaq 0x8(%rsp), %rdi
callq 0x2b4c
addq $0x13f0, %rsp           # imm = 0x13F0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2aea
jmp 0x2ad4
movq %rax, %rbx
jmp 0x2af7
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x2070
jmp 0x2aed
jmp 0x2aea
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2b4c
leaq 0x8(%rsp), %rdi
callq 0x2b4c
movq %rbx, %rdi
callq 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]randomsampling/./walker_alias.hpp
// Function: walker_alias::select(std::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>&)
int select(std::mt19937 &mt) {
    uint32_t r = mt();
    int k = r & (n - 1);
    r = r >> nb;
    if (r > probi[k]) {
      return index[k];
    } else {
      return k;
    }
  }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x3ad4
movq %rax, %rdx
movl (%rbx), %eax
decl %eax
andl %edx, %eax
movb 0x4(%rbx), %cl
shrl %cl, %edx
movslq %eax, %rcx
movq 0x38(%rbx), %rsi
cmpl (%rsi,%rcx,4), %edx
jbe 0x2f03
movq 0x8(%rbx), %rax
movl (%rax,%rcx,4), %eax
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]randomsampling/./cumulative_sum.hpp
// Function: cumulative_sum::cumulative_sum(std::vector<double, std::allocator<double>>&)
cumulative_sum(std::vector<double> &list) {
    double sum = 0.0;
    for (auto v : list) {
      c_sum.push_back(sum);
      sum += v;
    }
    ud.param(std::uniform_real_distribution<double>::param_type(0, sum));
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
xorpd %xmm0, %xmm0
movupd %xmm0, 0x10(%rdi)
movupd %xmm0, (%rdi)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x20(%rdi)
leaq 0x8(%rsp), %r14
andq $0x0, (%r14)
movq (%rsi), %r15
movq 0x8(%rsi), %r12
xorpd %xmm0, %xmm0
cmpq %r12, %r15
je 0x3c94
movsd (%r15), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3cf6
movsd 0x10(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
addq $0x8, %r15
jmp 0x3c61
andq $0x0, 0x18(%rbx)
movsd %xmm0, 0x20(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2b4c
movq %r14, %rdi
callq 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]randomsampling/./binary_tree.hpp
// Function: binary_tree::binary_tree(std::vector<double, std::allocator<double>>&)
binary_tree(std::vector<double> &list) {
    int n = twopow(list.size());
    list_size = n;
    root_index = 2 * n - 2;
    tree.resize(2 * n - 1, 0.0);
    std::copy(list.begin(), list.end(), tree.begin());
    int s = 0;
    for (int j = 0; (1 << j) < n; j++) {
      for (int i = 0; i < (n >> (j + 1)); i++) {
        tree[s + (n >> j) + i] = tree[s + i * 2] + tree[s + i * 2 + 1];
      }
      s += n >> j;
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorpd %xmm0, %xmm0
andq $0x0, 0x10(%rdi)
movupd %xmm0, (%rdi)
movq 0x8(%rsi), %r15
subq (%rsi), %r15
shrq $0x3, %r15
pushq $0x1
popq %rbp
testl %r15d, %r15d
je 0x3faf
leal -0x1(%r15), %eax
testl %eax, %r15d
je 0x3fb2
bsrl %r15d, %ecx
xorl $0x1f, %ecx
negb %cl
movl %ebp, %r15d
shll %cl, %r15d
jmp 0x3fb2
xorl %r15d, %r15d
movslq %r15d, %rax
movq %rax, 0x20(%rbx)
leal -0x2(,%rax,2), %ecx
movl %ecx, 0x18(%rbx)
leal -0x1(,%rax,2), %eax
movslq %eax, %rsi
movq %rsp, %rdx
andq $0x0, (%rdx)
movq %rbx, %rdi
callq 0x304e
movq (%r14), %rsi
movq 0x8(%r14), %rdx
subq %rsi, %rdx
je 0x3ff0
movq (%rbx), %rdi
callq 0x2180
xorl %esi, %esi
xorl %r8d, %r8d
xorl %edx, %edx
movl %ebp, %eax
movl %edx, %ecx
shll %cl, %eax
cmpl %r15d, %eax
jge 0x405d
leal 0x1(%rdx), %eax
movl %r15d, %edi
movl %eax, %ecx
sarl %cl, %edi
movl %r15d, %r9d
movl %edx, %ecx
sarl %cl, %r9d
movq (%rbx), %rdx
addl %r8d, %r9d
movslq %r9d, %rcx
movslq %r8d, %r8
testl %edi, %edi
cmovlel %esi, %edi
leaq (%rdx,%rcx,8), %rcx
shlq $0x3, %rdi
leaq (%rdx,%r8,8), %rdx
addq $0x8, %rdx
xorl %r8d, %r8d
cmpq %r8, %rdi
je 0x4056
movsd -0x8(%rdx,%r8,2), %xmm0
addsd (%rdx,%r8,2), %xmm0
movsd %xmm0, (%rcx,%r8)
addq $0x8, %r8
jmp 0x4038
movl %r9d, %r8d
movl %eax, %edx
jmp 0x3ff7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x2b4c
movq %r14, %rdi
callq 0x21b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]randomsampling/./binary_tree.hpp
// Function: binary_tree::select(std::mersenne_twister_engine<unsigned long, 32ul, 624ul, 397ul, 31ul, 2567483615ul, 11ul, 4294967295ul, 7ul, 2636928640ul, 15ul, 4022730752ul, 18ul, 1812433253ul>&)
int select(std::mt19937 &mt) {
    std::uniform_real_distribution<double> ud(0.0, 1.0);
    int index = root_index;
    int base = root_index;
    for (int i = 0; index >= list_size; i++) {
      double v = ud(mt) * tree[index];
      int local_index = index - base;
      base -= (2 << i);
      int left = base + local_index * 2;
      int right = left + 1;
      if (v < tree[left]) {
        index = left;
      } else {
        index = right;
      }
    }
    return index;
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
movhpd 0xf62(%rip), %xmm0      # xmm0 = xmm0[0],mem[0]
movq %rsp, %rax
movapd %xmm0, (%rax)
movl 0x18(%rdi), %r15d
xorl %ebp, %ebp
movl %r15d, %r12d
movslq %r12d, %r13
cmpq %r13, 0x20(%r14)
ja 0x411a
movq %rsp, %rdi
movq %rbx, %rsi
callq 0x3dde
movq (%r14), %rax
mulsd (%rax,%r13,8), %xmm0
subl %r15d, %r12d
pushq $-0x2
popq %rcx
movl %ecx, %edx
movl %ebp, %ecx
shll %cl, %edx
addl %r15d, %edx
leal (%rdx,%r12,2), %ecx
movslq %ecx, %r12
movsd (%rax,%r12,8), %xmm1
xorl %eax, %eax
ucomisd %xmm0, %xmm1
setbe %al
addl %eax, %r12d
incl %ebp
movl %edx, %r15d
jmp 0x40ce
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/kaityo256[P]randomsampling/./binary_tree.hpp
// Function: binary_tree::update(int, double)
void update(int index, double value) {
    tree[index] = value;
    int base = 0;
    for (int i = 0; index != root_index; i++) {
      int local_index = index - base;
      base += (list_size >> i);
      index = (index >> 1) << 1;
      int pindex = base + local_index / 2;
      tree[pindex] = tree[index] + tree[index + 1];
      index = pindex;
    }
  }

// Assembly:
pushq %rbx
movslq %esi, %rax
movq (%rdi), %r8
movsd %xmm0, (%r8,%rax,8)
movl 0x18(%rdi), %r9d
movq 0x20(%rdi), %rdi
xorl %ecx, %ecx
movl $0x2, %r10d
xorl %edx, %edx
cmpl %r9d, %esi
je 0x4191
movl %esi, %eax
movq %rdi, %r11
shrq %cl, %r11
subl %edx, %eax
addl %edx, %r11d
movl %esi, %ebx
andl $-0x2, %ebx
cltd
idivl %r10d
addl %r11d, %eax
movslq %ebx, %rdx
movsd (%r8,%rdx,8), %xmm0
orl $0x1, %esi
movslq %esi, %rdx
addsd (%r8,%rdx,8), %xmm0
movslq %eax, %rdx
movsd %xmm0, (%r8,%rdx,8)
incq %rcx
movl %r11d, %edx
movl %eax, %esi
jmp 0x414b
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/compress.cpp
// Function: compress_compatability_test()
void compress_compatability_test ()
{
	unsigned char *v = (unsigned char *)malloc (16u);
	memset (v, 0, 16u);
	if (sizeof(char) !=1 || sizeof(unsigned int) != 4 || sizeof(float) != 4)
		fail ();
	*(float *)(v+1) = 0.123f;
	if (*(unsigned int *)v != 4226247936u || *(unsigned int *)(v+1) != 1039918957u)
		fail ();
	*(float *)(v+1) = -58;
	if (*(unsigned int *)v != 1744830464u || *(unsigned int *)(v+1) != 3261595648u)
		fail ();
	float f[5] = {0.123f, 1.f, 0.f, 0.123f, 0.f};
	memset (v, ~0, 16u);
	vector_compress (VECTOR24, v, &f[0], &f[1], &f[2]);
	float_compress (FLOAT16, v+6, &f[3]);
	float_compress (FLOAT16, v+4, &f[4]);
	if (((unsigned int *)v)[0] != 4286318595u || ((unsigned int *)v)[1] != 3753771008u)
		fail ();
	float_decompress (FLOAT16, v+6, &f[3]);
	float_decompress (FLOAT16, v+4, &f[4]);
	vector_decompress (VECTOR24, v, &f[0], &f[1], &f[2]);
	float ans[5] = {0.109375f,1.015625f,0.015625f,0.123001f,0.000000f};
	int i;
	for (i=0; i<5; ++i)
		if (f[i]-ans[i] > 0.00001f || f[i]-ans[i] < -0.00001f)
			fail ();
	free (v);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x41f0
movq %rax, %r12
movq %rax, %rbx
movl $0x3dfbe76d, 0x1(%rax)  # imm = 0x3DFBE76D
cmpl $0xfbe76d00, (%rax)     # imm = 0xFBE76D00
je 0xc135
callq 0xc0f4
movl $0xc2680000, 0x1(%rbx)  # imm = 0xC2680000
cmpl $0x68000000, (%rbx)     # imm = 0x68000000
je 0xc149
callq 0xc0f4
movdqa 0x2937f(%rip), %xmm0    # 0x354d0
leaq 0x10(%rsp), %r13
movdqa %xmm0, -0x10(%r13)
andl $0x0, (%r13)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, (%rbx)
leaq 0x4(%rsp), %r14
leaq 0x8(%rsp), %r15
pushq $0x3
popq %rdi
movq %rsp, %rdx
movq %rbx, %rsi
movq %r14, %rcx
movq %r15, %r8
callq 0xc276
leaq 0x6(%r12), %rsi
leaq 0xc(%rsp), %rdx
pushq $0x1
popq %rbp
movl %ebp, %edi
callq 0xc4b1
addq $0x4, %r12
movl %ebp, %edi
movq %r12, %rsi
movq %r13, %rdx
callq 0xc4b1
cmpl $0xff7c0803, (%rbx)     # imm = 0xFF7C0803
jne 0xc1c0
xorl %eax, %eax
cmpl $0xdfbe0000, (%r12)     # imm = 0xDFBE0000
je 0xc1cc
callq 0xc0f4
movl (%r12), %eax
movzwl %ax, %eax
movzwl 0x6(%rbx), %ecx
movd %eax, %xmm0
movd %ecx, %xmm1
punpckldq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
pxor %xmm0, %xmm0
movdqa %xmm1, %xmm2
pslld $0xc, %xmm2
por 0x2925f(%rip), %xmm2    # 0x35450
pcmpeqd %xmm1, %xmm0
pandn %xmm2, %xmm0
movq %rsp, %rdx
movq %xmm0, 0xc(%rdx)
pushq $0x3
popq %rdi
movq %rbx, %rsi
movq %r14, %rcx
movq %r15, %r8
callq 0xc532
xorl %r14d, %r14d
leaq 0x292d4(%rip), %r15     # 0x354f0
movaps 0x2907d(%rip), %xmm1    # 0x352a0
movss 0x29235(%rip), %xmm2    # 0x35460
cmpq $0x14, %r14
je 0xc25f
movss (%rsp,%r14), %xmm0
subss (%r14,%r15), %xmm0
andps %xmm1, %xmm0
ucomiss %xmm2, %xmm0
jbe 0xc259
callq 0xc0f4
movss 0x2920e(%rip), %xmm2    # 0x35460
movaps 0x29047(%rip), %xmm1    # 0x352a0
addq $0x4, %r14
jmp 0xc22b
movq %rbx, %rdi
callq 0x4380
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/compress.h
// Function: float_compress(float_type, void*, float const*)
inline void float_compress
	(float_type t, void *s, const float *f)
{
	unsigned int *m = (unsigned int *)s;
	const unsigned int *p = (const unsigned int *)f;
	switch (t)
	{
	case FLOAT32:
		m[0] = *p;
		break;
	case FLOAT16:
		m[0] = bitclr (m[0], 0, 16);
		if (float_iswrong (*p))
			;
		else if (float_istoobig (*p))
			m[0] |= bitget (~0u, 0, 16);
		else if (float_istoosmall (*p))
			;
		else
			m[0] |= bitget (*p, 12, 28);
		break;
	case FLOAT8:
		m[0] = bitclr (m[0], 0, 8);
		if (float_iswrong (*p))
			;
		else if (float_istoobig (*p))
			m[0] |= bitget (~0u, 0, 8);
		else if (float_istoosmall (*p))
			;
		else
			m[0] |= bitget (*p, 20, 28);
		break;
	default:
		;
	}
}

// Assembly:
cmpl $0x2, %edi
je 0xc4f3
cmpl $0x1, %edi
je 0xc4c5
testl %edi, %edi
jne 0xc523
movl (%rdx), %eax
movl %eax, (%rsi)
jmp 0xc523
movl (%rsi), %eax
movl %eax, %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
movl %ecx, (%rsi)
movl (%rdx), %edx
cmpl $0x7f7fffff, %edx       # imm = 0x7F7FFFFF
ja 0xc523
cmpl $0x40000000, %edx       # imm = 0x40000000
jae 0xc524
cmpl $0x30800000, %edx       # imm = 0x30800000
jb 0xc523
shrl $0xc, %edx
movzwl %dx, %eax
jmp 0xc51f
movl (%rsi), %eax
movl %eax, %ecx
andl $0xffffff00, %ecx       # imm = 0xFFFFFF00
movl %ecx, (%rsi)
movl (%rdx), %edx
cmpl $0x7f7fffff, %edx       # imm = 0x7F7FFFFF
ja 0xc523
cmpl $0x40000000, %edx       # imm = 0x40000000
jae 0xc52b
cmpl $0x30800000, %edx       # imm = 0x30800000
jb 0xc523
shrl $0x14, %edx
movzbl %dl, %eax
orl %ecx, %eax
jmp 0xc4c1
retq
orl $0xffff, %eax           # imm = 0xFFFF
jmp 0xc4c1
orl $0xff, %eax
jmp 0xc4c1
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: ApplyInterpolation(interpolation_t const*, int, int const*, float (*) [3])
static void ApplyInterpolation (const interpolation_t *interp, int numstyles, const int *styles, vec3_t *outs
#ifdef ZHLT_XASH
								, vec3_t *outs_direction
#endif
								)
{
	int i;
	int j;

	for (j = 0; j < numstyles; j++)
	{
		VectorClear (outs[j]);
#ifdef ZHLT_XASH
		VectorClear (outs_direction[j]);
#endif
	}
	if (interp->totalweight <= 0)
	{
		return;
	}
	for (i = 0; i < (int)interp->points.size (); i++)
	{
		for (j = 0; j < numstyles; j++)
		{
#ifdef ZHLT_XASH
			const vec3_t *b_direction;
#endif
			const vec3_t *b = GetTotalLight (&g_patches[interp->points[i].patchnum], styles[j]
#ifdef ZHLT_XASH
											, b_direction
#endif
											);
			VectorMA (outs[j], interp->points[i].weight / interp->totalweight, *b, outs[j]);
#ifdef ZHLT_XASH
			VectorMA (outs_direction[j], interp->points[i].weight / interp->totalweight, *b_direction, outs_direction[j]);
#endif
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r12
xorl %eax, %eax
testl %esi, %esi
cmovlel %eax, %r15d
imulq $0xc, %r15, %rdx
cmpq %rax, %rdx
je 0xddf5
andl $0x0, 0x8(%rbx,%rax)
andq $0x0, (%rbx,%rax)
addq $0xc, %rax
jmp 0xdde0
xorps %xmm0, %xmm0
ucomiss 0x4(%r12), %xmm0
jae 0xded1
addq $0x8, %rbx
xorl %r13d, %r13d
movq %rbx, (%rsp)
movq 0x10(%r12), %rax
subq 0x8(%r12), %rax
shrq $0x3, %rax
cltq
cmpq %rax, %r13
jge 0xded1
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xdec5
movq 0x8(%r12), %rax
movslq (%rax,%r13,8), %rax
imulq $0x138, %rax, %rdi      # imm = 0x138
leaq 0x53a6ba6(%rip), %rax   # 0x53b49f0
addq (%rax), %rdi
movl (%r14,%rbp,4), %esi
callq 0x1e833
movq 0x8(%r12), %rcx
movss 0x4(%rcx,%r13,8), %xmm0
divss 0x4(%r12), %xmm0
mulss (%rax), %xmm0
addss -0x8(%rbx), %xmm0
movss %xmm0, -0x8(%rbx)
movq 0x8(%r12), %rcx
movss 0x4(%rcx,%r13,8), %xmm0
divss 0x4(%r12), %xmm0
mulss 0x4(%rax), %xmm0
addss -0x4(%rbx), %xmm0
movss %xmm0, -0x4(%rbx)
movq 0x8(%r12), %rcx
movss 0x4(%rcx,%r13,8), %xmm0
divss 0x4(%r12), %xmm0
mulss 0x8(%rax), %xmm0
addss (%rbx), %xmm0
movss %xmm0, (%rbx)
incq %rbp
addq $0xc, %rbx
jmp 0xde2a
incq %r13
movq (%rsp), %rbx
jmp 0xde0f
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: GetTriangulationPatches(int, int*, int const**)
void GetTriangulationPatches (int facenum, int *numpatches, const int **patches)
{
	const facetriangulation_t *facetrian;

	facetrian = g_facetriangulations[facenum];
	*numpatches = (int)facetrian->usedpatches.size ();
	*patches = facetrian->usedpatches.data ();
}

// Assembly:
movslq %edi, %rax
leaq 0x20b8582(%rip), %rcx   # 0x20c8920
movq (%rcx,%rax,8), %rax
movq 0x58(%rax), %rcx
subq 0x50(%rax), %rcx
shrq $0x2, %rcx
movl %ecx, (%rsi)
movq 0x50(%rax), %rax
movq %rax, (%rdx)
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: FreeTriangulations()
void FreeTriangulations ()
{
	try
	{

	int i;
	int j;
	facetriangulation_t *facetrian;

	for (i = 0; i < g_numfaces; i++)
	{
		facetrian = g_facetriangulations[i];

		for (j = 0; j < (int)facetrian->localtriangulations.size (); j++)
		{
			FreeLocalTriangulation (facetrian->localtriangulations[j]);
		}

		delete facetrian;
		g_facetriangulations[i] = NULL;
	}

	}
	catch (std::bad_alloc)
	{
		hlassume (false, assume_NoMemory);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %r12d, %r12d
leaq 0x20b8553(%rip), %rbp   # 0x20c8920
pushq $0x68
popq %rbx
leaq 0x1b9d02d(%rip), %rax   # 0x1bad404
movslq (%rax), %rax
cmpq %rax, %r12
jge 0x1043f
movq (%rbp,%r12,8), %r14
xorl %r13d, %r13d
movq 0x38(%r14), %rax
movq 0x40(%r14), %rcx
subq %rax, %rcx
shrq $0x3, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r13
jge 0x10421
movq (%rax,%r13,8), %r15
testq %r15, %r15
je 0x1040f
movq %r15, %rdi
callq 0x12e68
movl $0xa0, %esi
movq %r15, %rdi
callq 0x42f0
incq %r13
jmp 0x103e7
movq %r14, %rdi
callq 0x116fe
movq %r14, %rdi
movq %rbx, %rsi
callq 0x42f0
andq $0x0, (%rbp,%r12,8)
incq %r12
jmp 0x103d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lerp.cpp
// Function: GetFrac(float const*, float const*, float const*, float const*)
static vec_t GetFrac (const vec3_t leftspot, const vec3_t rightspot, const vec3_t direction, const vec3_t normal)
{
	vec3_t v;
	vec_t dot1;
	vec_t dot2;
	vec_t frac;

	CrossProduct (direction, normal, v);
	dot1 = DotProduct (leftspot, v);
	dot2 = DotProduct (rightspot, v);
	
	// dot1 <= 0 < dot2
	if (dot1 >= -NORMAL_EPSILON)
	{
		if (g_drawlerp && dot1 > ON_EPSILON)
		{
			Developer (DEVELOPER_LEVEL_SPAM, "Debug: triangulation: internal error 1.\n");
		}
		frac = 0.0;
	}
	else if (dot2 <= NORMAL_EPSILON)
	{
		if (g_drawlerp && dot2 < -ON_EPSILON)
		{
			Developer (DEVELOPER_LEVEL_SPAM, "Debug: triangulation: internal error 2.\n");
		}
		frac = 1.0;
	}
	else
	{
		frac = dot1 / (dot1 - dot2);
		frac = qmax (0, qmin (frac, 1));
	}

	return frac;
}

// Assembly:
pushq %rax
movss (%rdx), %xmm0
movss 0x4(%rdx), %xmm3
movss 0x8(%rcx), %xmm4
movss 0x8(%rdx), %xmm1
movss (%rcx), %xmm5
movss 0x4(%rcx), %xmm6
movaps %xmm3, %xmm2
mulss %xmm4, %xmm2
mulss %xmm0, %xmm4
mulss %xmm6, %xmm0
mulss %xmm1, %xmm6
subss %xmm6, %xmm2
mulss %xmm5, %xmm1
subss %xmm4, %xmm1
mulss %xmm3, %xmm5
subss %xmm5, %xmm0
movss 0x4(%rdi), %xmm3
mulss %xmm1, %xmm3
movss (%rdi), %xmm4
mulss %xmm2, %xmm4
addss %xmm3, %xmm4
movss 0x8(%rdi), %xmm3
mulss %xmm0, %xmm3
addss %xmm4, %xmm3
cvtss2sd %xmm3, %xmm4
ucomisd 0x25002(%rip), %xmm4    # 0x355b0
jae 0x105f4
mulss 0x4(%rsi), %xmm1
mulss (%rsi), %xmm2
addss %xmm1, %xmm2
mulss 0x8(%rsi), %xmm0
addss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x21aae(%rip), %xmm2    # 0x32080
ucomisd %xmm1, %xmm2
jae 0x10623
movaps %xmm3, %xmm1
subss %xmm0, %xmm1
divss %xmm1, %xmm3
minss 0x21a79(%rip), %xmm3    # 0x32064
xorps %xmm0, %xmm0
maxss %xmm3, %xmm0
jmp 0x1065e
ucomisd 0x24fac(%rip), %xmm4    # 0x355a8
xorps %xmm0, %xmm0
jbe 0x1065e
leaq 0x54e6449(%rip), %rax   # 0x54f6a51
cmpb $0x0, (%rax)
je 0x1065e
leaq 0x2510e(%rip), %rsi     # 0x35722
pushq $0x5
popq %rdi
xorl %eax, %eax
callq 0x9045
xorps %xmm0, %xmm0
jmp 0x1065e
movsd 0x24f6d(%rip), %xmm0    # 0x35598
ucomisd %xmm1, %xmm0
movss 0x21a2d(%rip), %xmm0    # 0x32064
jbe 0x1065e
leaq 0x54e6411(%rip), %rax   # 0x54f6a51
cmpb $0x0, (%rax)
je 0x1065e
leaq 0x250ff(%rip), %rsi     # 0x3574b
pushq $0x5
popq %rdi
xorl %eax, %eax
callq 0x9045
movss 0x21a06(%rip), %xmm0    # 0x32064
popq %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: TestFaceIntersect(intersecttest_t*, int)
bool TestFaceIntersect (intersecttest_t *t, int facenum)
{
	dface_t *f2 = &g_dfaces[facenum];
	Winding *w = new Winding (*f2);
	int k;
	for (k = 0; k < w->m_NumPoints; k++)
	{
		VectorAdd (w->m_Points[k], g_face_offset[facenum], w->m_Points[k]);
	}
	for (k = 0; k < t->numclipplanes; k++)
	{
		if (!w->Clip (t->clipplanes[k], false
#ifdef ZHLT_WINDING_EPSILON
			, ON_EPSILON*4
#endif
			))
		{
			break;
		}
	}
	bool intersect = w->m_NumPoints > 0;
	delete w;
	return intersect;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %r14
movslq %esi, %r12
imulq $0x14, %r12, %r15
addq 0x3073b(%rip), %r15     # 0x43fe8
pushq $0x20
popq %rdi
callq 0x42e0
movq %rax, %rbx
movss 0x22104(%rip), %xmm0    # 0x359c4
movq %rax, %rdi
movq %r15, %rsi
callq 0xadb6
imulq $0xc, %r12, %rax
addq 0x306a2(%rip), %rax     # 0x43f78
xorl %ecx, %ecx
xorl %edx, %edx
movl 0x8(%rbx), %esi
cmpq %rsi, %rdx
jae 0x13927
movq 0x10(%rbx), %rsi
movss (%rsi,%rcx), %xmm0
addss (%rax), %xmm0
movss %xmm0, (%rsi,%rcx)
movq 0x10(%rbx), %rsi
movss 0x4(%rsi,%rcx), %xmm0
addss 0x4(%rax), %xmm0
movss %xmm0, 0x4(%rsi,%rcx)
movq 0x10(%rbx), %rsi
movss 0x8(%rsi,%rcx), %xmm0
addss 0x8(%rax), %xmm0
movss %xmm0, 0x8(%rsi,%rcx)
incq %rdx
addq $0xc, %rcx
jmp 0x138da
pushq $-0x1
popq %r15
xorl %esi, %esi
movslq (%r14), %rax
incq %r15
cmpq %rax, %r15
jge 0x13959
leaq 0x14(%rsi), %r12
addq 0x8(%r14), %rsi
movq %rbx, %rdi
xorl %edx, %edx
movss 0x2207b(%rip), %xmm0    # 0x359c8
callq 0xb632
movq %r12, %rsi
testb %al, %al
jne 0x1392d
movq (%rbx), %rax
cmpl $0x0, 0x8(%rbx)
setne %bpl
movq %rbx, %rdi
callq *0x8(%rax)
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x20
popq %rsi
movq %rbx, %rdi
callq 0x42f0
movq %r14, %rdi
callq 0x45a0
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: AddFaceForVertexNormal_printerror(int, int, dface_t*)
void AddFaceForVertexNormal_printerror (const int edgeabs, const int edgeend, dface_t *const f)
{
	if (DEVELOPER_LEVEL_WARNING <= g_developer)
	{
		int i, e;
		Log ("AddFaceForVertexNormal - bad face:\n");
		Log (" edgeabs=%d edgeend=%d\n", edgeabs, edgeend);
		for (i = 0; i < f->numedges; i++)
		{
			e = g_dsurfedges[f->firstedge + i];
			edgeshare_t *es = &g_edgeshare[abs(e)];
			int v0 = g_dedges[abs(e)].v[0], v1 = g_dedges[abs(e)].v[1];
			Log (" e=%d v0=%d(%f,%f,%f) v1=%d(%f,%f,%f) share0=%d share1=%d\n", e,
				v0, g_dvertexes[v0].point[0], g_dvertexes[v0].point[1], g_dvertexes[v0].point[2],
				v1, g_dvertexes[v1].point[0], g_dvertexes[v1].point[1], g_dvertexes[v1].point[2],
				(es->faces[0]==NULL? -1: es->faces[0]-g_dfaces), (es->faces[1]==NULL? -1: es->faces[1]-g_dfaces));
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x20a78a6(%rip), %rax   # 0x20bb450
cmpl $0x2, (%rax)
jl 0x13cb8
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
leaq 0x22162(%rip), %rdi     # 0x35d24
xorl %r15d, %r15d
xorl %eax, %eax
callq 0x8790
leaq 0x22175(%rip), %rdi     # 0x35d48
movl %r14d, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x8790
leaq 0x2134d3a(%rip), %r13   # 0x2148920
leaq 0x1d19823(%rip), %rbp   # 0x1d2d410
leaq 0x101981c(%rip), %r12   # 0x102d410
pushq $-0x1
popq %r14
movswl 0x8(%rbx), %eax
cmpl %eax, %r15d
jge 0x13cb8
movslq 0x4(%rbx), %rax
addq %r15, %rax
leaq 0x1e3381d(%rip), %rcx   # 0x1e47430
movl (%rcx,%rax,4), %esi
movl %esi, %eax
negl %eax
cmovsl %esi, %eax
movzwl (%rbp,%rax,4), %r10d
imulq $0xc, %r10, %rcx
cvtss2sd (%r12,%rcx), %xmm0
cvtss2sd 0x4(%r12,%rcx), %xmm1
cvtss2sd 0x8(%r12,%rcx), %xmm2
movzwl 0x2(%rbp,%rax,4), %ecx
imulq $0xc, %rcx, %rdx
cvtss2sd (%r12,%rdx), %xmm3
cvtss2sd 0x4(%r12,%rdx), %xmm4
cvtss2sd 0x8(%r12,%rdx), %xmm5
imulq $0xb0, %rax, %rdi
movq (%rdi,%r13), %rax
movq %r14, %r8
testq %rax, %rax
je 0x13c7e
subq 0x30376(%rip), %rax     # 0x43fe8
cqto
pushq $0x14
popq %r8
idivq %r8
movq %rax, %r8
addq %r13, %rdi
movq 0x8(%rdi), %rax
movq %r14, %r9
testq %rax, %rax
je 0x13c9f
subq 0x30354(%rip), %rax     # 0x43fe8
cqto
pushq $0x14
popq %rdi
idivq %rdi
movq %rax, %r9
leaq 0x220ba(%rip), %rdi     # 0x35d60
movl %r10d, %edx
movb $0x6, %al
callq 0x8790
incq %r15
jmp 0x13bf8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: MLH_AddFace(mdllight_t*, int)
int MLH_AddFace (mdllight_t *ml, int facenum)
{
	dface_t *f = &g_dfaces[facenum];
	int i, j;
	for (i = 0; i < ml->facecount; i++)
	{
		if (ml->face[i].num == facenum)
		{
			return -1;
		}
	}
	if (ml->facecount >= MLH_MAXFACECOUNT)
	{
		return -1;
	}
	i = ml->facecount;
	ml->facecount++;
	ml->face[i].num = facenum;
	ml->face[i].samplecount = 0;
	for (j = 0; j < ALLSTYLES; j++)
	{
		ml->face[i].style[j].exist = false;
	}
	for (j = 0; j < MAXLIGHTMAPS && f->styles[j] != 255; j++)
	{
		ml->face[i].style[f->styles[j]].exist = true;
		ml->face[i].style[f->styles[j]].seq = j;
	}
	return i;
}

// Assembly:
pushq %rbx
movslq %esi, %rdx
movl 0xa518(%rdi), %ecx
movslq %ecx, %r8
xorl %r10d, %r10d
testl %r8d, %r8d
movl $0x0, %eax
cmovgl %ecx, %eax
leaq 0x18(%rdi), %r9
imulq $0xa50, %rax, %r11      # imm = 0xA50
addq $0xa50, %r11            # imm = 0xA50
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
leaq 0xa50(%r10), %rbx
cmpq %rbx, %r11
je 0x1d40f
cmpl %esi, (%r9,%r10)
movq %rbx, %r10
jne 0x1d3f8
jmp 0x1d482
cmpl $0xf, %ecx
jg 0x1d482
leal 0x1(%rcx), %eax
movl %eax, 0xa518(%rdi)
imulq $0xa50, %r8, %rdi       # imm = 0xA50
leaq (%r9,%rdi), %rax
movl %esi, (%r9,%rdi)
andl $0x0, 0xa48(%r9,%rdi)
xorl %esi, %esi
cmpq $0x40, %rsi
je 0x1d447
movb $0x0, 0x4(%rax,%rsi,8)
incq %rsi
jmp 0x1d437
imulq $0x14, %rdx, %rdx
leaq 0x1b8ffbe(%rip), %rsi   # 0x1bad410
addq %rsi, %rdx
addq $0xc, %rdx
xorl %esi, %esi
cmpq $0x4, %rsi
je 0x1d480
movzbl (%rdx,%rsi), %edi
cmpq $0xff, %rdi
je 0x1d480
movb $0x1, 0x4(%rax,%rdi,8)
movzbl (%rdx,%rsi), %edi
movl %esi, 0x8(%rax,%rdi,8)
incq %rsi
jmp 0x1d45b
movl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: MLH_AddSample(mdllight_t*, int, int, int, int, int, float const*)
void MLH_AddSample (mdllight_t *ml, int facenum, int w, int h, int s, int t, const vec3_t pos)
{
	dface_t *f = &g_dfaces[facenum];
	int i, j;
	int r = MLH_AddFace (ml, facenum);
	if (r == -1)
	{
		return;
	}
	int size = w * h;
	int num = s + w * t;
	for (i = 0; i < ml->face[r].samplecount; i++)
	{
		if (ml->face[r].sample[i].num == num)
		{
			return;
		}
	}
	if (ml->face[r].samplecount >= MLH_MAXSAMPLECOUNT)
	{
		return;
	}
	i = ml->face[r].samplecount;
	ml->face[r].samplecount++;
	ml->face[r].sample[i].num = num;
	VectorCopy (pos, ml->face[r].sample[i].pos);
	for (j = 0; j < ALLSTYLES; j++)
	{
		if (ml->face[r].style[j].exist)
		{
			ml->face[r].sample[i].style[j] = &g_dlightdata[f->lightofs + (num + size * ml->face[r].style[j].seq) * 3];
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r9d, %ebx
movl %r8d, %r15d
movl %ecx, %ebp
movl %edx, %r12d
movl %esi, %r13d
movq %rdi, %r14
callq 0x1d3c6
cmpl $-0x1, %eax
je 0x1d51b
movq 0x40(%rsp), %rdx
movslq %r13d, %rcx
imull %r12d, %ebp
imull %r12d, %ebx
addl %r15d, %ebx
cltq
imulq $0xa50, %rax, %rax      # imm = 0xA50
leaq (%r14,%rax), %rsi
addq $0x18, %rsi
movslq 0xa48(%rsi), %r8
leaq (%r14,%rax), %rdi
addq $0x220, %rdi            # imm = 0x220
xorl %r9d, %r9d
testl %r8d, %r8d
movl $0x0, %r10d
cmovgl %r8d, %r10d
imulq $0x210, %r10, %r10      # imm = 0x210
addq $0x210, %r10            # imm = 0x210
leaq 0x210(%r9), %r11
cmpq %r11, %r10
je 0x1d515
cmpl %ebx, (%rdi,%r9)
movq %r11, %r9
jne 0x1d4fe
jmp 0x1d51b
cmpl $0x3, %r8d
jle 0x1d52a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leal 0x1(%r8), %r9d
movl %r9d, 0xa48(%rsi)
imulq $0x210, %r8, %r8        # imm = 0x210
leaq (%rdi,%r8), %rsi
movl %ebx, (%rdi,%r8)
movss (%rdx), %xmm0
movss %xmm0, 0x4(%rdi,%r8)
movss 0x4(%rdx), %xmm0
movss %xmm0, 0x8(%rdi,%r8)
movss 0x8(%rdx), %xmm0
movss %xmm0, 0xc(%rdi,%r8)
imulq $0x14, %rcx, %rcx
leaq 0x1b8fe9e(%rip), %rdx   # 0x1bad410
addq %rdx, %rcx
addq $0x10, %rcx
addq %r14, %rax
addq $0x20, %rax
xorl %edx, %edx
leaq 0x82ff0f(%rip), %rdi    # 0x84d498
cmpq $0x40, %rdx
je 0x1d51b
cmpb $0x1, -0x4(%rax,%rdx,8)
jne 0x1d5b6
movslq (%rcx), %r8
movl (%rax,%rdx,8), %r9d
imull %ebp, %r9d
addl %ebx, %r9d
movslq %r9d, %r9
leaq (%r9,%r9,2), %r9
addq %r8, %r9
addq (%rdi), %r9
movq %r9, 0x10(%rsi,%rdx,8)
incq %rdx
jmp 0x1d589
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: MLH_mdllightCreate(mdllight_t*)
void MLH_mdllightCreate (mdllight_t *ml)
{
	// code from Quake
	float p[3];
	float end[3];
	ml->facecount = 0;
	VectorCopy (ml->origin, ml->floor);
	VectorCopy (ml->origin, p);
	VectorCopy (ml->origin, end);
	end[2] -= 2048;
	MLH_GetSamples_r (ml, 0, p, end);
}

// Assembly:
subq $0x28, %rsp
andl $0x0, 0xa518(%rdi)
movsd (%rdi), %xmm0
movsd %xmm0, 0xc(%rdi)
movss 0x8(%rdi), %xmm1
movss %xmm1, 0x14(%rdi)
leaq 0x18(%rsp), %rdx
movsd %xmm0, (%rdx)
movss %xmm1, 0x8(%rdx)
leaq 0x8(%rsp), %rcx
movsd %xmm0, (%rcx)
addss 0x180ee(%rip), %xmm1    # 0x35a18
movss %xmm1, 0x8(%rcx)
xorl %esi, %esi
callq 0x1d619
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: MdlLightHack()
void MdlLightHack ()
{
	int ient;
	entity_t *ent1, *ent2;
	vec3_t origin1, origin2;
	const char *target;
#ifndef HLRAD_MDL_LIGHT_HACK_NEW
    double start, end;
#endif
	int used = 0, countent = 0, countsample = 0, r;
#ifndef HLRAD_MDL_LIGHT_HACK_NEW
    start = I_FloatTime();
#endif
	for (ient = 0; ient < g_numentities; ++ient)
	{
		ent1 = &g_entities[ient];
		target = ValueForKey (ent1, "zhlt_copylight");
		if (!strcmp (target, ""))
			continue;
		used = 1;
		ent2 = FindTargetEntity (target);
		if (ent2 == NULL)
		{
			Warning ("target entity '%s' not found", target);
			continue;
		}
		GetVectorForKey (ent1, "origin", origin1);
		GetVectorForKey (ent2, "origin", origin2);
		r = MLH_CopyLight (origin2, origin1);
		if (r < 0)
			Warning ("can not copy light from (%f,%f,%f)", origin2[0], origin2[1], origin2[2]);
		else
		{
			countent += 1;
			countsample += r;
		}
	}
#ifndef HLRAD_MDL_LIGHT_HACK_NEW
    end = I_FloatTime();
#endif
	if (used)
#ifdef HLRAD_MDL_LIGHT_HACK_NEW
		Log ("Adjust mdl light: modified %d samples for %d entities\n", countsample, countent);
#else
		Log("Mdl Light Hack: %d entities %d samples (%.2f seconds)\n", countent, countsample, end - start);
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
leaq 0x201d908(%rip), %rbx   # 0x203b440
xorl %r14d, %r14d
xorl %r13d, %r13d
movl $0x0, 0xc(%rsp)
xorl %r12d, %r12d
leaq 0x201d8e4(%rip), %rax   # 0x203b434
movslq (%rax), %rax
cmpq %rax, %r14
jge 0x1dc0f
movq %rbx, %rdi
leaq 0x1874c(%rip), %rsi     # 0x362b2
callq 0x6929
cmpb $0x0, (%rax)
je 0x1dc03
movq %rax, %r15
movq %rax, %rdi
callq 0x713a
testq %rax, %rax
je 0x1dbcc
movq %rax, %r13
movq %rbx, %rdi
leaq 0x1b99c(%rip), %r15     # 0x3952d
movq %r15, %rsi
leaq 0x1c(%rsp), %rbp
movq %rbp, %rdx
callq 0x71a2
movq %r13, %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %r15
movq %r15, %rdx
callq 0x71a2
movq %r15, %rdi
movq %rbp, %rsi
callq 0x1d93b
testl %eax, %eax
js 0x1dbdf
incl 0xc(%rsp)
addl %eax, %r12d
jmp 0x1dbff
leaq 0x186ee(%rip), %rdi     # 0x362c1
movq %r15, %rsi
xorl %eax, %eax
callq 0x8ea5
jmp 0x1dbff
cvtss2sd 0x10(%rsp), %xmm0
cvtss2sd 0x14(%rsp), %xmm1
cvtss2sd 0x18(%rsp), %xmm2
leaq 0x186e6(%rip), %rdi     # 0x362de
movb $0x3, %al
callq 0x8ea5
pushq $0x1
popq %r13
incq %r14
addq $0x20, %rbx
jmp 0x1db49
testl %r13d, %r13d
je 0x1dc29
leaq 0x186e6(%rip), %rdi     # 0x36301
movl %r12d, %esi
movl 0xc(%rsp), %edx
xorl %eax, %eax
callq 0x8790
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: CreateFacelightDependencyList()
void CreateFacelightDependencyList ()
{
	int facenum;
	dface_t *f;
	facelight_t *fl;
	int i;
	int k;
	int surface;
	facelightlist_t *item;

	for (i = 0; i < MAX_MAP_FACES; i++)
	{
		g_dependentfacelights[i] = NULL;
	}

	// for each face
	for (facenum = 0; facenum < g_numfaces; facenum++)
	{
		f = &g_dfaces[facenum];
		fl = &facelight[facenum];
		if (g_texinfo[f->texinfo].flags & TEX_SPECIAL)
		{
			continue;
		}

		for (k = 0; k < MAXLIGHTMAPS && f->styles[k] != 255; k++)
		{
			for (i = 0; i < fl->numsamples; i++)
			{
				surface = fl->samples[k][i].surface; // that surface contains at least one sample from this face
				if (0 <= surface && surface < g_numfaces)
				{
					// insert this face into the dependency list of that surface
					for (item = g_dependentfacelights[surface]; item != NULL; item = item->next)
					{
						if (item->facenum == facenum)
							break;
					}
					if (item)
					{
						continue;
					}

					item = (facelightlist_t *)malloc (sizeof (facelightlist_t));
					hlassume (item != NULL, assume_NoMemory);
					item->facenum = facenum;
					item->next = g_dependentfacelights[surface];
					g_dependentfacelights[surface] = item;
				}
			}
		}
	}
}

// Assembly:
xorl %eax, %eax
leaq 0x51d0d5f(%rip), %rcx   # 0x51ee9a0
cmpq $0x7fff8, %rax          # imm = 0x7FFF8
je 0x1dc54
andq $0x0, (%rax,%rcx)
addq $0x8, %rax
jmp 0x1dc41
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %r12d, %r12d
leaq 0x1b8f79b(%rip), %rdx   # 0x1bad404
movslq (%rdx), %rax
cmpq %rax, %r12
jge 0x1dd64
imulq $0x14, %r12, %rcx
leaq 0x1b8f790(%rip), %rax   # 0x1bad410
movq %rcx, (%rsp)
movswq 0xa(%rax,%rcx), %rax
imulq $0x28, %rax, %rax
leaq 0x118f76b(%rip), %rcx   # 0x11ad400
testb $0x1, 0x24(%rcx,%rax)
jne 0x1dd5c
movq (%rsp), %rax
addq 0x2633d(%rip), %rax     # 0x43fe8
movq %rax, (%rsp)
imulq $0x28, %r12, %rbx
leaq 0x4f50d06(%rip), %rax   # 0x4f6e9c0
addq %rax, %rbx
xorl %ebp, %ebp
cmpq $0x4, %rbp
je 0x1dd5c
movq (%rsp), %rax
cmpb $-0x1, 0xc(%rax,%rbp)
je 0x1dd5c
xorl %r15d, %r15d
movslq (%rbx), %rax
cmpq %rax, %r15
jge 0x1dd54
movq 0x8(%rbx,%rbp,8), %rax
imulq $0x1c, %r15, %rcx
movslq 0x18(%rax,%rcx), %rax
testq %rax, %rax
js 0x1dd4f
cmpl (%rdx), %eax
jge 0x1dd4f
leaq 0x51d0c9f(%rip), %rcx   # 0x51ee9a0
leaq (%rcx,%rax,8), %r13
movq %r13, %rax
movq (%rax), %rax
testq %rax, %rax
je 0x1dd1d
movl (%rax), %ecx
addq $0x8, %rax
cmpq %rcx, %r12
jne 0x1dd08
jmp 0x1dd4f
pushq $0x10
popq %rdi
callq 0x4420
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
pushq $0x1
popq %rsi
callq 0x92cb
leaq 0x1b8f6c4(%rip), %rdx   # 0x1bad404
movl %r12d, (%r14)
movq (%r13), %rax
movq %rax, 0x8(%r14)
movq %r14, (%r13)
incq %r15
jmp 0x1dcdb
incq %rbp
jmp 0x1dcbf
incq %r12
jmp 0x1dc69
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/FreeSlave[P]vhlt/hlrad/lightmap.cpp
// Function: FreeFacelightDependencyList()
void FreeFacelightDependencyList ()
{
	int i;
	facelightlist_t *item;

	for (i = 0; i < MAX_MAP_FACES; i++)
	{
		while (g_dependentfacelights[i])
		{
			item = g_dependentfacelights[i];
			g_dependentfacelights[i] = item->next;
			free (item);
		}
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
xorl %ebx, %ebx
leaq 0x51d0c20(%rip), %r14   # 0x51ee9a0
cmpq $0xffff, %rbx           # imm = 0xFFFF
je 0x1dda6
movq (%r14,%rbx,8), %rdi
testq %rdi, %rdi
je 0x1dda1
movq 0x8(%rdi), %rax
movq %rax, (%r14,%rbx,8)
callq 0x4380
jmp 0x1dd89
incq %rbx
jmp 0x1dd80
addq $0x8, %rsp
popq %rbx
popq %r14
retq