LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/travisdowns[P]sort-bench/./simple-timer.hpp
// Function: SimpleTimerT<std::chrono::_V2::system_clock>::checkState(SimpleTimerT<std::chrono::_V2::system_clock>::State, char const*)
void checkState(State expected, const char *msg) {
        if (mode_ != expected) {
            if (mode_ != STARTED && mode_ != STOPPED) {
                throw std::logic_error("bad state (maybe uninit?)");
            } else {
                throw std::logic_error(msg);
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl 0x10(%rdi), %ebp
cmpl %esi, %ebp
jne 0x2b50
popq %rbx
popq %r14
popq %rbp
retq
movq %rdx, %r14
movl $0x10, %edi
callq 0x2090
movq %rax, %rbx
cmpl $0x2, %ebp
jae 0x2b72
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21a0
jmp 0x2b81
leaq 0x2618(%rip), %rsi      # 0x5191
movq %rbx, %rdi
callq 0x21a0
movq 0x5460(%rip), %rsi      # 0x7fe8
movq 0x5441(%rip), %rdx      # 0x7fd0
movq %rbx, %rdi
callq 0x21c0
jmp 0x2b99
movq %rax, %r14
movq %rbx, %rdi
callq 0x20e0
movq %r14, %rdi
callq 0x21d0
// File: /workspace/github_cpp_makefile_star2_O3/travisdowns[P]sort-bench/msort-copy.cpp
// Function: void msort_with_tmp<CompareU64>(msort_param const*, void*, unsigned long, CompareU64)
void msort_with_tmp (const struct msort_param *p, void *b, size_t n, C cmp)
{
  char *b1, *b2;
  size_t n1, n2;

  if (n <= 1)
    return;

  n1 = n / 2;
  n2 = n - n1;
  b1 = (char *)b;
  b2 = (char *) b + (n1 * p->s);

  msort_with_tmp (p, b1, n1, cmp);
  msort_with_tmp (p, b2, n2, cmp);

  char *tmp = p->t;
  const size_t s = p->s;
  assert(p->var == 1);
  while (n1 > 0 && n2 > 0)
  {
    if (cmp(b1, b2) <= 0)
    {
      *(uint64_t *) tmp = *(uint64_t *) b1;
      b1 += sizeof (uint64_t);
      --n1;
    }
    else
    {
      *(uint64_t *) tmp = *(uint64_t *) b2;
      b2 += sizeof (uint64_t);
      --n2;
    }
    tmp += sizeof (uint64_t);
  }

  if (n1 > 0)
    memcpy (tmp, b1, n1 * s);
  memcpy (b, p->t, (n - n2) * s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x2, %rdx
jae 0x307d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %r13
shrq %r13
movq %rdx, %r12
subq %r13, %r12
movq (%rdi), %rbp
imulq %r13, %rbp
addq %rsi, %rbp
movq %r13, %rdx
callq 0x305d
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x305d
cmpq $0x1, 0x8(%r15)
jne 0x3148
movq (%r15), %r8
movq 0x10(%r15), %rsi
testq %r12, %r12
je 0x3106
movq %r14, %rax
movq %rsi, %rdi
movq (%rax), %rcx
movq (%rbp), %rdx
cmpq %rdx, %rcx
jbe 0x30e7
addq $0x8, %rbp
decq %r12
movq %rdx, %rcx
jmp 0x30ee
addq $0x8, %rax
decq %r13
movq %rcx, (%rdi)
addq $0x8, %rdi
testq %r13, %r13
je 0x30ff
testq %r12, %r12
jne 0x30cf
testq %r13, %r13
jne 0x310f
jmp 0x3128
xorl %r12d, %r12d
movq %r14, %rax
movq %rsi, %rdi
imulq %r8, %r13
movq %rax, %rsi
movq %r13, %rdx
movq %r8, %r13
callq 0x2100
movq %r13, %r8
movq 0x10(%r15), %rsi
subq %r12, %rbx
imulq %r8, %rbx
movq %r14, %rdi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
leaq 0x2218(%rip), %rdi      # 0x5367
leaq 0x2193(%rip), %rsi      # 0x52e9
leaq 0x22c3(%rip), %rcx      # 0x5420
movl $0x3a, %edx
callq 0x20c0
nop
// File: /workspace/github_cpp_makefile_star2_O3/travisdowns[P]sort-bench/radix1.cpp
// Function: radix_sort1(unsigned long*, unsigned long)
void radix_sort1(uint64_t *a, size_t count)
{
    using queuetype = std::vector<uint64_t>;

    for (size_t pass = 0; pass < RADIX_LEVELS; pass++) {
        uint64_t shift = pass * RADIX_BITS;
        std::array<queuetype, RADIX_SIZE> queues;

        // copy each element into the appropriate queue based on the current RADIX_BITS sized
        // "digit" within it
        for (size_t i = 0; i < count; i++) {
            size_t value = a[i];
            size_t index = (value >> shift) & RADIX_MASK;
            queues[index].push_back(value);
        }

        // copy all the queues back over top of the original array in order
        uint64_t* aptr = a;
        for (auto& queue : queues) {
            aptr = std::copy(queue.begin(), queue.end(), aptr);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1808, %rsp           # imm = 0x1808
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
movq %rsp, %r13
movl $0x1800, %edx           # imm = 0x1800
leaq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x20b0
testq %r14, %r14
je 0x31eb
leaq (,%r12,8), %rbp
xorl %ebx, %ebx
movq (%r15,%rbx,8), %rax
movq %rax, %rdx
movl %ebp, %ecx
shrq %cl, %rdx
movq %rax, (%rsp)
movzbl %dl, %ecx
leaq (%rcx,%rcx,2), %rcx
leaq (%rsp,%rcx,8), %rdi
addq $0x8, %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x31db
movq %rax, (%rsi)
addq $0x8, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x31e3
movq %r13, %rdx
callq 0x327e
incq %rbx
cmpq %rbx, %r14
jne 0x31a5
movl $0x8, %r13d
movq %r15, %rbp
movq (%rsp,%r13), %rsi
movq 0x8(%rsp,%r13), %rbx
subq %rsi, %rbx
je 0x320d
movq %rbp, %rdi
movq %rbx, %rdx
callq 0x21b0
addq %rbx, %rbp
addq $0x18, %r13
cmpq $0x1808, %r13           # imm = 0x1808
jne 0x31f4
movl $0x1800, %ebx           # imm = 0x1800
movq %rsp, %r13
movq -0x10(%rsp,%rbx), %rdi
testq %rdi, %rdi
je 0x323b
movq (%rsp,%rbx), %rsi
subq %rdi, %rsi
callq 0x2120
addq $-0x18, %rbx
jne 0x3225
incq %r12
cmpq $0x8, %r12
jne 0x3185
addq $0x1808, %rsp           # imm = 0x1808
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rsi
leaq 0x1808(%rsp), %rdi
callq 0x2258
movq %rbx, %rdi
callq 0x21d0
nop
// File: /workspace/github_cpp_makefile_star2_O3/travisdowns[P]sort-bench/radix5.cpp
// Function: radix_sort5(unsigned long*, unsigned long)
void radix_sort5(uint64_t *a, size_t count)
{
    std::unique_ptr<uint64_t[]> queue_area(new uint64_t[count]);

    freq_array_type freqs = {};
    count_frequency(a, count, freqs);

    uint64_t *from = a, *to = queue_area.get();
    
    for (size_t pass = 0; pass < RADIX_LEVELS; pass++) {
        uint64_t shift = pass * RADIX_BITS;

        // array of pointers to the current position in each queue, which we set up based on the
        // known final sizes of each queue (i.e., "tighly packed")
        uint64_t * queue_ptrs[RADIX_SIZE], * next = to;
        for (size_t i = 0; i < RADIX_SIZE; i++) {
            queue_ptrs[i] = next;
            next += freqs[pass][i];
        }

        // copy each element into the appropriate queue based on the current RADIX_BITS sized
        // "digit" within it
        for (size_t i = 0; i < count; i++) {
            size_t value = from[i];
            size_t index = (value >> shift) & RADIX_MASK;
            *queue_ptrs[index]++ = value;
        }

        // swap from and to areas
        std::swap(from, to);
    }

    if (RADIX_LEVELS & 1) {
        std::copy(queue_area.get(), queue_area.get() + count, a);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x4808, %rsp           # imm = 0x4808
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rax
shrq $0x3d, %rax
leaq (,%rsi,8), %rcx
xorl %edi, %edi
negq %rax
sbbq %rdi, %rdi
orq %rcx, %rdi
callq 0x2030
movq %rax, %r15
leaq 0x800(%rsp), %r12
movl $0x4000, %edx           # imm = 0x4000
movq %r12, %rdi
xorl %esi, %esi
callq 0x20b0
testq %rbx, %rbx
je 0x3944
xorl %eax, %eax
movq (%r14,%rax,8), %rcx
xorl %edx, %edx
movzbl %cl, %esi
leaq (%rsp,%rsi,8), %rsi
addq $0x800, %rsi            # imm = 0x800
incq (%rdx,%rsi)
shrq $0x8, %rcx
addq $0x800, %rdx            # imm = 0x800
cmpq $0x4000, %rdx           # imm = 0x4000
jne 0x3916
incq %rax
cmpq %rbx, %rax
jne 0x3910
xorl %eax, %eax
movq %r15, %rcx
movq %r14, %rdx
movq %rcx, %r14
xorl %ecx, %ecx
movq %r14, %rsi
movq %rsi, (%rsp,%rcx,8)
movq (%r12,%rcx,8), %rdi
leaq (%rsi,%rdi,8), %rsi
incq %rcx
cmpq $0x100, %rcx            # imm = 0x100
jne 0x3954
testq %rbx, %rbx
je 0x39a0
leaq (,%rax,8), %rcx
xorl %esi, %esi
movq (%rdx,%rsi,8), %rdi
movq %rdi, %r8
shrq %cl, %r8
movzbl %r8b, %r8d
movq (%rsp,%r8,8), %r9
leaq 0x8(%r9), %r10
movq %r10, (%rsp,%r8,8)
movq %rdi, (%r9)
incq %rsi
cmpq %rsi, %rbx
jne 0x397b
incq %rax
addq $0x800, %r12            # imm = 0x800
movq %rdx, %rcx
cmpq $0x8, %rax
jne 0x3949
movq %r15, %rdi
addq $0x4808, %rsp           # imm = 0x4808
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2160
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/graph.cpp
// Function: Graph::add_neighbor(int, int)
void Graph::add_neighbor(int node_index, int neighbor_index)
{
  if (node_index != neighbor_index)
  {
    if (node_index>=counted_nodes_number ||
        neighbor_index>=counted_nodes_number)
    {
      counted_nodes_number = max(node_index, neighbor_index) + 1;
      neighbors.resize(max(counted_nodes_number, (int) neighbors.size()));
    }

    if (find(neighbors[node_index].begin(),
             neighbors[node_index].end(),
             neighbor_index) == neighbors[node_index].end())
    {
      neighbors[node_index].push_back(neighbor_index);
      neighbors[neighbor_index].push_back(node_index);
      counted_edges_number += 1;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, 0x4(%rsp)
movl %edx, (%rsp)
cmpl %edx, %esi
je 0x2a29
movl %esi, %ebp
movq %rdi, %rbx
movl 0x8(%rdi), %eax
cmpl %esi, %eax
setg %cl
cmpl %edx, %eax
setg %al
testb %al, %cl
jne 0x29a1
cmpl %edx, %ebp
cmovgl %ebp, %edx
incl %edx
movl %edx, 0x8(%rbx)
leaq 0x10(%rbx), %rdi
movq 0x18(%rbx), %rax
subq 0x10(%rbx), %rax
shrq $0x3, %rax
imull $0xaaaaaaab, %eax, %eax # imm = 0xAAAAAAAB
cmpl %eax, %edx
cmovlel %eax, %edx
movslq %edx, %rsi
callq 0x317a
movslq %ebp, %rax
movq 0x10(%rbx), %rcx
shlq $0x3, %rax
leaq (%rax,%rax,2), %r14
movq (%rcx,%r14), %rdi
movq 0x8(%rcx,%r14), %rsi
movq %rsp, %rdx
callq 0x3549
movq 0x10(%rbx), %rcx
movq 0x8(%rcx,%r14), %rsi
cmpq %rsi, %rax
jne 0x2a29
addq %rcx, %r14
cmpq 0x10(%r14), %rax
je 0x29e7
movl (%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r14)
jmp 0x29fc
movq %rsp, %r15
movq %r14, %rdi
movq %r15, %rdx
callq 0x35ee
movl (%r15), %eax
movq 0x10(%rbx), %rcx
cltq
leaq (%rax,%rax,2), %rax
leaq (%rcx,%rax,8), %rdi
movq 0x8(%rdi), %rsi
cmpq 0x10(%rdi), %rsi
je 0x2a1c
movl %ebp, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rdi)
jmp 0x2a26
leaq 0x4(%rsp), %rdx
callq 0x35ee
incq (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/graph.cpp
// Function: Graph::print_graph() const
void Graph::print_graph() const
{
/*  for (int i=0; i<nodes_number; i++)
  {
    printf("Node %d has neighbors: ",i);
    const vector<int>& neighbors = get_neighbors(i);
    for (vector<int>::const_iterator it = neighbors.begin();
         it != neighbors.end();
         it++)
    {
      printf("%d ",*it);
    }
    printf("\n");
    }*/
  printf("%d %lld\n",counted_nodes_number, counted_edges_number);
  for (int i=0; i<counted_nodes_number; i++)
  {
    const vector<int>& neighbors = get_neighbors(i);
    bool no = true;
    for (vector<int>::const_iterator it = neighbors.begin();
         it != neighbors.end();
         it++)
    {
      no = false;
      printf("%d ",*it+1);
    }
    if (no)
      printf("%d ",i+1);
    printf("\n");
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %esi
movq (%rdi), %rdx
leaq 0x37ce(%rip), %rdi      # 0x6243
xorl %eax, %eax
callq 0x2030
cmpl $0x0, 0x8(%rbx)
jle 0x2ae5
leaq 0x37c3(%rip), %r14      # 0x624c
xorl %r15d, %r15d
movq 0x10(%rbx), %rax
leaq (%r15,%r15,2), %rcx
movq (%rax,%rcx,8), %r12
cmpq 0x8(%rax,%rcx,8), %r12
je 0x2ac2
leaq (%rax,%rcx,8), %r13
movl (%r12), %esi
incl %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x2030
addq $0x4, %r12
cmpq 0x8(%r13), %r12
jne 0x2aa3
incq %r15
jmp 0x2ad2
incq %r15
movq %r14, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x2030
movl $0xa, %edi
callq 0x21f0
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x2a8c
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/graph.cpp
// Function: Graph::get_nodes_randomly(std::vector<int, std::allocator<int>>*) const
void Graph::get_nodes_randomly(vector<int>* nodes) const {
  srand ( unsigned ( std::time(0) ) );
  nodes->resize(counted_nodes_number);
  for (int i=0; i<counted_nodes_number; i++)
    (*nodes)[i] = i;
  random_shuffle(nodes->begin(), nodes->end(), myrandom);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorl %edi, %edi
callq 0x2150
movl %eax, %edi
callq 0x2170
movslq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0x31b6
cmpl $0x0, 0x8(%r14)
jle 0x2b53
movq (%rbx), %rax
xorl %ecx, %ecx
movl %ecx, (%rax,%rcx,4)
incq %rcx
movslq 0x8(%r14), %rdx
cmpq %rdx, %rcx
jl 0x2b44
movq (%rbx), %r14
movq 0x8(%rbx), %rbx
cmpq %rbx, %r14
je 0x2bb2
leaq 0x4(%r14), %rax
cmpq %rbx, %rax
je 0x2bb2
movl $0x4, %r15d
movq %r15, %r12
shrq $0x2, %r12
incl %r12d
callq 0x2070
cltd
idivl %r12d
movslq %edx, %rax
leaq (,%rax,4), %rcx
cmpq %rcx, %r15
je 0x2ba1
leaq (%r14,%r15), %rcx
leaq (%r14,%rax,4), %rax
movl (%rcx), %edx
movl (%rax), %esi
movl %esi, (%rcx)
movl %edx, (%rax)
leaq (%r14,%r15), %rax
addq $0x4, %rax
addq $0x4, %r15
cmpq %rbx, %rax
jne 0x2b6e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/graph.cpp
// Function: Graph::get_fraction_edges_cut(Partition const&) const
double Graph::get_fraction_edges_cut(const Partition& partition) const {
  long long int edges_cut = 0;

  for (int node = 0; node < counted_nodes_number; node++)
  {
    int node_partition = partition.get_node_partition(node);
    for (vector<int>::const_iterator neighbor = neighbors[node].begin();
         neighbor != neighbors[node].end();
         ++neighbor)
    {
      if (node_partition != partition.get_node_partition(*neighbor))
        edges_cut++;
    }
  }

  edges_cut /= 2;

  return ((double) edges_cut)/counted_edges_number;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
jle 0x2f3c
movq %rsi, %r14
xorl %r15d, %r15d
xorl %r12d, %r12d
movq %r14, %rdi
movl %r15d, %esi
callq 0x41b4
movl %eax, %ebp
movq 0x10(%rbx), %rax
movq %r15, (%rsp)
leaq (%r15,%r15,2), %r13
movq (%rax,%r13,8), %r15
cmpq 0x8(%rax,%r13,8), %r15
je 0x2f18
movl (%r15), %esi
movq %r14, %rdi
callq 0x41b4
xorl %ecx, %ecx
cmpl %eax, %ebp
setne %cl
addq %rcx, %r12
addq $0x4, %r15
movq 0x10(%rbx), %rax
jmp 0x2ef2
movq (%rsp), %r15
incq %r15
movslq 0x8(%rbx), %rax
cmpq %rax, %r15
jl 0x2ed5
movq %r12, %rax
shrq $0x3f, %rax
addq %r12, %rax
sarq %rax
cvtsi2sd %rax, %xmm0
jmp 0x2f40
xorpd %xmm0, %xmm0
cvtsi2sdq (%rbx), %xmm1
divsd %xmm1, %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/graph.cpp
// Function: Graph::get_communication_volume(Partition const&) const
double Graph::get_communication_volume(const Partition& partition) const
{
  int communication_volume = 0;

  for (int node = 0; node < counted_nodes_number; node++)
  {
    int node_partition = partition.get_node_partition(node);
    vector<bool> seen_partition(partition.get_partitions_number(), false);
    for (vector<int>::const_iterator neighbor = neighbors[node].begin();
         neighbor != neighbors[node].end();
         ++neighbor)
    {
      int neighbor_partition = partition.get_node_partition(*neighbor);
      if (node_partition != neighbor_partition &&
          !seen_partition[neighbor_partition])
      {
        communication_volume ++;
        seen_partition[neighbor_partition] = true;
      }
    }
  }

  double fraction_communication_volume = ((double) communication_volume) /
    (counted_nodes_number * (partition.get_partitions_number()-1));

  return fraction_communication_volume;;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movl 0x8(%rdi), %r14d
testl %r14d, %r14d
jle 0x3097
movq %rdi, %r15
movabsq $-0x8000000000000000, %rax # imm = 0x8000000000000000
leaq 0x3f(%rax), %rbp
xorl %r13d, %r13d
movl $0x0, 0x10(%rsp)
movq %rbx, %rdi
movl %r13d, %esi
callq 0x41b4
movl %eax, %r12d
movq %rbx, %rdi
callq 0x41cc
movslq %eax, %rsi
movb $0x0, 0xe(%rsp)
leaq 0x20(%rsp), %rdi
leaq 0xe(%rsp), %rdx
leaq 0xf(%rsp), %rcx
callq 0x31e8
movq 0x10(%r15), %rax
movq %r13, 0x18(%rsp)
leaq (%r13,%r13,2), %r13
movq (%rax,%r13,8), %r14
cmpq 0x8(%rax,%r13,8), %r14
je 0x304f
movl (%r14), %esi
movq %rbx, %rdi
callq 0x41b4
cmpl %eax, %r12d
je 0x3045
leal 0x3f(%rax), %ecx
testl %eax, %eax
cmovnsl %eax, %ecx
movslq %eax, %rdi
sarl $0x6, %ecx
movslq %ecx, %rdx
shlq $0x3, %rdx
addq 0x20(%rsp), %rdx
andq %rbp, %rdi
xorl %esi, %esi
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
cmpq %rcx, %rdi
setbe %sil
movl $0x1, %edi
movl %eax, %ecx
shlq %cl, %rdi
movq -0x8(%rdx,%rsi,8), %rcx
btq %rax, %rcx
jb 0x3045
leaq -0x8(,%rsi,8), %rax
incl 0x10(%rsp)
orq %rdi, %rcx
movq %rcx, (%rdx,%rax)
addq $0x4, %r14
movq 0x10(%r15), %rax
jmp 0x2fd6
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x307a
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x21c0
xorl %eax, %eax
movq %rax, 0x20(%rsp)
movl $0x0, 0x28(%rsp)
movq %rax, 0x30(%rsp)
movq 0x18(%rsp), %r13
incq %r13
movslq 0x8(%r15), %r14
cmpq %r14, %r13
jl 0x2f92
cvtsi2sdl 0x10(%rsp), %xmm0
jmp 0x309b
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
callq 0x41cc
decl %eax
imull %r14d, %eax
cvtsi2sd %eax, %xmm1
movsd 0x10(%rsp), %xmm0
divsd %xmm1, %xmm0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x20(%rsp), %rsi
testq %rsi, %rsi
je 0x30e3
leaq 0x40(%rsp), %rdi
callq 0x22c0
movq %rbx, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/graph.cpp
// Function: Graph::get_normalized_maximum_load(Partition const&) const
double Graph::get_normalized_maximum_load(const Partition& partition) const {
  int maximum_load = 0;

  for (int i=0; i<partition.get_partitions_number(); i++)
  {
    int partition_size = partition.get_partition_size(i);
    if (partition_size > maximum_load)
      maximum_load = partition_size;
  }

  return maximum_load / \
    ((double) counted_nodes_number / partition.get_partitions_number());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x41cc
testl %eax, %eax
jle 0x3133
xorl %r15d, %r15d
xorl %ebp, %ebp
movq %rbx, %rdi
movl %ebp, %esi
callq 0x41c0
cmpl %r15d, %eax
cmovgl %eax, %r15d
incl %ebp
movq %rbx, %rdi
callq 0x41cc
cmpl %eax, %ebp
jl 0x310d
cvtsi2sd %r15d, %xmm0
jmp 0x3137
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sdl 0x8(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbx, %rdi
callq 0x41cc
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
movsd 0x10(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
divsd %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/loaders.cpp
// Function: snap_loader(Graph*, char const*)
void snap_loader(Graph* graph, const char* file_name) {
  int n,m;
  int from, to;
  char buffer[1000];
  FILE *fp = fopen(file_name, "r");

  if (fp == NULL)
  {
    printf("File %s not found\n",file_name);
    exit(1);
  }

  fgets(buffer, sizeof buffer, fp);
  fgets(buffer, sizeof buffer, fp);
  fgets(buffer, sizeof buffer, fp);
  sscanf(buffer, "# Nodes: %d Edges: %d",&n,&m);

  //read edges
  while (fgets(buffer, sizeof buffer, fp) != NULL)
  {
    if (buffer[0] != '#')
    {
      sscanf(buffer, "%d\t%d", &from,&to);
      graph->add_neighbor(from,to);
    }
  }

  //graph->print_graph_size();

  fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x24fb(%rip), %rsi      # 0x61a9
movq %r15, %rdi
callq 0x21d0
testq %rax, %rax
je 0x3d93
movq %rax, %r14
leaq 0x10(%rsp), %r15
movq %r15, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x2230
movq %r15, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2230
movq %r15, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2230
leaq 0x25e0(%rip), %rsi      # 0x62de
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
xorl %eax, %eax
callq 0x2190
movq %r15, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2230
testq %rax, %rax
je 0x3d79
leaq 0x10(%rsp), %r15
leaq 0x25c1(%rip), %r12      # 0x62f4
leaq 0x4(%rsp), %r13
movq %rsp, %rbp
cmpb $0x23, 0x10(%rsp)
je 0x3d64
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2190
movl 0x4(%rsp), %esi
movl (%rsp), %edx
movq %rbx, %rdi
callq 0x2948
movq %r15, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2230
testq %rax, %rax
jne 0x3d3b
movq %r14, %rdi
callq 0x21a0
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2531(%rip), %rdi      # 0x62cb
movq %r15, %rsi
xorl %eax, %eax
callq 0x2030
movl $0x1, %edi
callq 0x21e0
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/loaders.cpp
// Function: preprocessed_loader(Graph*, char const*)
void preprocessed_loader(Graph* graph, const char* file_name) {
  int n,m;
  int from, to;
  char buffer[1000];
  char pre_file_name[1000];
  strcpy(pre_file_name, file_name);
  strcat(pre_file_name, ".preprocessed");

  printf("%s\n",pre_file_name);

  FILE *fp = fopen(pre_file_name, "r");

  fgets(buffer, sizeof buffer, fp);
  sscanf(buffer, "%d %d\n",&n,&m);

  //read edges
  while (fgets(buffer, sizeof buffer, fp) != NULL)
  {
    sscanf(buffer, "%d %d", &from,&to);
    graph->add_neighbor(from,to);
  }

  graph->print_graph_size();

  fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x7e8, %rsp            # imm = 0x7E8
movq %rdi, %rbx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x2160
movq %r14, %rdi
callq 0x20c0
movabsq $0x636f72706572702e, %rcx # imm = 0x636F72706572702E
movq %rcx, 0x10(%rsp,%rax)
movabsq $0x6465737365636f, %rcx # imm = 0x6465737365636F
movq %rcx, 0x16(%rsp,%rax)
movq %r14, %rdi
callq 0x2220
leaq 0x23a5(%rip), %rsi      # 0x61a9
movq %r14, %rdi
callq 0x21d0
movq %rax, %r14
leaq 0x400(%rsp), %r15
movq %r15, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x2230
leaq 0x2422(%rip), %rsi      # 0x6250
leaq 0xc(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %r15, %rdi
xorl %eax, %eax
callq 0x2190
movq %r15, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2230
testq %rax, %rax
je 0x3ea5
leaq 0x24aa(%rip), %r15      # 0x6308
leaq 0x400(%rsp), %r12
leaq 0x4(%rsp), %r13
movq %rsp, %rbp
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2190
movl 0x4(%rsp), %esi
movl (%rsp), %edx
movq %rbx, %rdi
callq 0x2948
movq %r12, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2230
testq %rax, %rax
jne 0x3e6e
movq %rbx, %rdi
callq 0x2a34
movq %r14, %rdi
callq 0x21a0
addq $0x7e8, %rsp            # imm = 0x7E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/loaders.cpp
// Function: elt_loader(Graph*)
void elt_loader(Graph* graph) {
  int n,m;
  int neighbor;
  string line;
  ifstream elt_file(ELT_FILE);

  elt_file >> n;
  elt_file >> m;

  //read edges
  getline(elt_file, line);
  for (int i=0 ; i<n; i++)
  {
    getline(elt_file, line);
    stringstream linestream(line);

    while (linestream >> neighbor)
    {
      neighbor--;
      graph->add_neighbor(i, neighbor);
    }
  }

  graph->print_graph_size();

  elt_file.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
movq %rdi, %rbx
leaq 0x20(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x2418(%rip), %rsi      # 0x630e
leaq 0x38(%rsp), %rdi
movl $0x8, %edx
callq 0x2290
leaq 0x38(%rsp), %rdi
leaq 0xc(%rsp), %rsi
callq 0x2110
leaq 0x38(%rsp), %r14
leaq 0x34(%rsp), %rsi
movq %r14, %rdi
callq 0x2110
movq 0x38(%rsp), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %edx
leaq 0x38(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x22a0
cmpl $0x0, 0xc(%rsp)
jle 0x3ffb
xorl %ebp, %ebp
leaq 0x10(%rsp), %r12
leaq 0x240(%rsp), %r13
leaq 0x8(%rsp), %r15
movq 0x38(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %edx
movq %r14, %rdi
movq %r12, %rsi
callq 0x22a0
movq %r13, %rdi
movq %r12, %rsi
movl $0x18, %edx
callq 0x2240
movq %r13, %rdi
movq %r15, %rsi
callq 0x2110
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x3fd3
movl 0x8(%rsp), %edx
decl %edx
movl %edx, 0x8(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2948
jmp 0x3fa4
movq %r13, %rdi
movq 0x4ff3(%rip), %rsi      # 0x8fd0
callq 0x2120
leaq 0x2c0(%rsp), %rdi
callq 0x2090
incl %ebp
cmpl 0xc(%rsp), %ebp
jl 0x3f70
movq %rbx, %rdi
callq 0x2a34
leaq 0x38(%rsp), %rdi
callq 0x2040
leaq 0x38(%rsp), %rdi
callq 0x2060
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x4033
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21c0
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x4081
jmp 0x404e
jmp 0x404e
movq %rax, %rbx
jmp 0x4077
movq %rax, %rbx
movq 0x4f73(%rip), %rsi      # 0x8fd0
leaq 0x240(%rsp), %rdi
callq 0x2120
leaq 0x2c0(%rsp), %rdi
callq 0x2090
leaq 0x38(%rsp), %rdi
callq 0x2060
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x409d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21c0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/loaders.cpp
// Function: twitter_loader(Graph*)
void twitter_loader(Graph* graph) {
  int from, to;
  char buffer[1000];
  FILE *fp = fopen(TWITTER_FILE, "r");

  //read edges
  while (fgets(buffer, sizeof buffer, fp) != NULL)
  {
      sscanf(buffer, "%d\t%d", &from,&to);
      graph->add_neighbor(from,to);
  }

  graph->print_graph_size();

  fclose(fp);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rdi, %rbx
leaq 0x2265(%rip), %rdi      # 0x6325
leaq 0x20e2(%rip), %rsi      # 0x61a9
callq 0x21d0
movq %rax, %r14
leaq 0x10(%rsp), %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %rax, %rdx
callq 0x2230
testq %rax, %rax
je 0x4134
leaq 0x2207(%rip), %r15      # 0x62f4
leaq 0x10(%rsp), %r12
leaq 0xc(%rsp), %r13
leaq 0x8(%rsp), %rbp
movq %r12, %rdi
movq %r15, %rsi
movq %r13, %rdx
movq %rbp, %rcx
xorl %eax, %eax
callq 0x2190
movl 0xc(%rsp), %esi
movl 0x8(%rsp), %edx
movq %rbx, %rdi
callq 0x2948
movq %r12, %rdi
movl $0x3e8, %esi            # imm = 0x3E8
movq %r14, %rdx
callq 0x2230
testq %rax, %rax
jne 0x40fc
movq %rbx, %rdi
callq 0x2a34
movq %r14, %rdi
callq 0x21a0
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/pollo[P]graph-partitioning/partition.cpp
// Function: Partition::set_size(int, int)
void Partition::set_size(int nodes_number, int partitions_number)
{
  this->nodes_number = nodes_number;
  this->partitions_number = partitions_number;
  //-1 means not yet assigned
  partitions.resize(nodes_number, -1);
  partition_sizes.resize(partitions_number, 0);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
addq $0x8, %rdi
movslq %esi, %rsi
leaq 0x4(%rsp), %rdx
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
callq 0x41d0
addq $0x20, %r14
movslq %ebx, %rsi
movq %rsp, %rdx
movl $0x0, (%rdx)
movq %r14, %rdi
callq 0x41d0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/examples/./Blob.h
// Function: BlobPtr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator++()
BlobPtr<T>& BlobPtr<T>::operator++()
{
	// if curr already points past the end of the container, can't increment it
	check(curr, "increment past end of BlobPtr");
	++curr;       // advance the current state
	return *this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %r14
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x17aa(%rip), %rsi      # 0x408a
leaq 0x17c0(%rip), %rdx      # 0x40a7
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x2b4a
leaq -0x50(%rbp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0x319a
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2913
callq 0x29b4
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x2928
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2130
incq 0x10(%rbx)
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x2954
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2130
movq %rbx, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH16_TemplatesAndGenericProgramming/examples/./Blob.h
// Function: BlobPtr<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::check(unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&) const
std::shared_ptr<std::vector<T>> BlobPtr<T>::check(std::size_t i, const std::string& msg) const
{
	auto ret = wptr.lock();   // is the vector still around?
	if (!ret)
		throw std::runtime_error("unbound BlobPtr");
	if (i >= ret->size())
		throw std::out_of_range(msg);
	return ret; // otherwise, return a shared_ptr to the vector
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r14
movq %rdi, %rbx
callq 0x3154
movq (%rbx), %rax
testq %rax, %rax
je 0x31d8
movq 0x8(%rax), %rcx
subq (%rax), %rcx
sarq $0x5, %rcx
cmpq %r14, %rcx
jbe 0x3204
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x2080
movq %rax, %r14
leaq 0xebc(%rip), %rsi       # 0x40a8
movq %rax, %rdi
callq 0x2060
movq 0x2db5(%rip), %rdx      # 0x5fb0
movq 0x2dee(%rip), %rsi      # 0x5ff0
jmp 0x322a
movl $0x10, %edi
callq 0x2080
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x2170
movq 0x2da5(%rip), %rdx      # 0x5fc8
movq 0x2da6(%rip), %rsi      # 0x5fd0
movq %r14, %rdi
callq 0x21a0
jmp 0x3234
movq %rax, %r15
movq %r14, %rdi
callq 0x20d0
jmp 0x3244
movq %rax, %r15
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x3252
callq 0x29b4
movq %r15, %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O3/CDISC2020[P]Projet_satellite_agile/src/FDIR/main_FDIR.cpp
// Function: gestion_wd_arduino(void*)
void* gestion_wd_arduino(void* args)
{
	while(1)
	{
		if(set_wd_ard==true)
		{
			myFDIR.set_arduino();//on demande a mettre la pin a 1
			usleep(5000);
			myFDIR.reset_arduino();//on demande a mettre la pin a 0
			usleep(20000);
			set_wd_ard=false;
		}

		usleep(100);
	}

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x519f(%rip), %rbx      # 0x8244
cmpb $0x1, 0x51bc(%rip)      # 0x8268
jne 0x30d9
movq %rbx, %rdi
callq 0x3d8e
movl $0x1388, %edi           # imm = 0x1388
callq 0x22a0
movq %rbx, %rdi
callq 0x3d9c
movl $0x4e20, %edi           # imm = 0x4E20
callq 0x22a0
movb $0x0, 0x518f(%rip)      # 0x8268
movl $0x64, %edi
callq 0x22a0
jmp 0x30a5
// File: /workspace/github_cpp_makefile_star2_O3/CDISC2020[P]Projet_satellite_agile/src/FDIR/main_FDIR.cpp
// Function: ARINC_PID(int)
void ARINC_PID(int signal)
{
	ifstream fichier;
	fichier.open("pid_ARINC");
	string line;
	if(!fichier)
	{
		cout << "Failed to open pid_ARINC" << endl;
		exit(1);
	}
	getline(fichier,line);
	arinc_pid=atoi(line.c_str());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
leaq -0x238(%rbp), %rbx
movq %rbx, %rdi
callq 0x2220
leaq 0x1d5d(%rip), %rsi      # 0x523c
movq %rbx, %rdi
movl $0x8, %edx
callq 0x2130
leaq -0x20(%rbp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
movq -0x238(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x218(%rbp,%rax)
jne 0x3574
leaq (%rax,%rbp), %rdi
addq $-0x238, %rdi           # imm = 0xFDC8
movl $0xa, %esi
callq 0x2200
movsbl %al, %edx
leaq -0x238(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x23d0
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
callq 0x2330
movl %eax, 0x4cc9(%rip)      # 0x8218
cmpq %r14, %rbx
je 0x355c
movq %rbx, %rdi
callq 0x21e0
leaq -0x238(%rbp), %rdi
callq 0x20b0
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r14
popq %rbp
retq
movq 0x4a55(%rip), %rdi      # 0x7fd0
leaq 0x1cab(%rip), %rsi      # 0x522d
movl $0x18, %edx
callq 0x2240
movq 0x4a3d(%rip), %rdi      # 0x7fd0
callq 0x2110
movl $0x1, %edi
callq 0x2260
movq %rax, %rbx
jmp 0x35b8
movq %rax, %rbx
movq -0x30(%rbp), %rdi
cmpq %r14, %rdi
je 0x35b8
callq 0x21e0
leaq -0x238(%rbp), %rdi
callq 0x20b0
movq %rbx, %rdi
callq 0x23b0
// File: /workspace/github_cpp_makefile_star2_O3/CDISC2020[P]Projet_satellite_agile/src/FDIR/main_FDIR.cpp
// Function: reboot_PM(void*)
void* reboot_PM(void* args)
{
	// reboot PM
	system("xterm -e ./main_PM &");
	sleep(1);

	// maj du listpid
	maj_listpid();

	// previent ARINC qu'il faut prendre en compte la modif de listpid
	if(arinc_pid!=-1)
		kill(arinc_pid,SIGUSR1);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1c6f(%rip), %rdi      # 0x5246
callq 0x21b0
movl $0x1, %edi
callq 0x2170
callq 0x30e5
movl 0x4c27(%rip), %edi      # 0x8218
cmpl $-0x1, %edi
je 0x3600
movl $0xa, %esi
callq 0x22b0
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CDISC2020[P]Projet_satellite_agile/src/FDIR/main_FDIR.cpp
// Function: reboot_COM(void*)
void* reboot_COM(void* args)
{
	// reboot COM
	system("xterm -e ./main_Com_ST &");
	sleep(1);

	// maj du listpid
	maj_listpid();

	// previent ARINC qu'il faut prendre en compte la modif de listpid
	if(arinc_pid!=-1)
		kill(arinc_pid,SIGUSR1);

	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leaq 0x1c4c(%rip), %rdi      # 0x525b
callq 0x21b0
movl $0x1, %edi
callq 0x2170
callq 0x30e5
movl 0x4bef(%rip), %edi      # 0x8218
cmpl $-0x1, %edi
je 0x3638
movl $0xa, %esi
callq 0x22b0
xorl %eax, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/CDISC2020[P]Projet_satellite_agile/src/FDIR/main_FDIR.cpp
// Function: recouvrement_COM()
void recouvrement_COM()
{
	// tolere faute par crash pas par freeze, sinon faut tuer process avant et donc recup les pid de tout le monde

	if(rec_COM)
	{
		// autre time out
		cout << "faut changer de raspy my boi" << endl;
	}
	else
	{
		rec_COM=true;

		pthread_attr_t *thread_attributes;
	        pthread_t *thread;

	        thread_attributes=(pthread_attr_t *)malloc(sizeof(pthread_attr_t));
	        thread=(pthread_t *)malloc(sizeof(pthread_t));

	        pthread_attr_init(thread_attributes);
	        if (pthread_create(thread, thread_attributes, reboot_COM,(void *) NULL) != 0)
	                perror ("Thread FDIR COM!");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x1, 0x4c8a(%rip)      # 0x82d4
jne 0x3692
movq 0x497d(%rip), %rbx      # 0x7fd0
leaq 0x1c1a(%rip), %rsi      # 0x5274
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2150
movb $0x1, 0x4c3b(%rip)      # 0x82d4
movl $0x38, %edi
callq 0x2280
movq %rax, %rbx
movl $0x8, %edi
callq 0x2280
movq %rax, %r14
movq %rbx, %rdi
callq 0x2270
leaq -0xbe(%rip), %rdx       # 0x3604
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x23c0
testl %eax, %eax
jne 0x36d8
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1bb2(%rip), %rdi      # 0x5291
popq %rbx
popq %r14
popq %rbp
jmp 0x2190
// File: /workspace/github_cpp_makefile_star2_O3/CDISC2020[P]Projet_satellite_agile/src/FDIR/main_FDIR.cpp
// Function: recouvrement_PM()
void recouvrement_PM()
{
	// tolere faute par crash pas par freeze, sinon faut tuer process avant et donc recup les pid de tout le monde

	if(rec_PM)
	{
		cout << "faut changer de raspy my boi" << endl;
	}
	else
	{
		rec_PM=true;

		pthread_attr_t *thread_attributes;
	        pthread_t *thread;

	        thread_attributes=(pthread_attr_t *)malloc(sizeof(pthread_attr_t));
	        thread=(pthread_t *)malloc(sizeof(pthread_t));

	        pthread_attr_init(thread_attributes);
	        if (pthread_create(thread, thread_attributes, reboot_PM,(void *) NULL) != 0)
	                perror ("Thread FDIR PM!");
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x1, 0x4bdf(%rip)      # 0x82d5
jne 0x373e
movq 0x48d1(%rip), %rbx      # 0x7fd0
leaq 0x1b6e(%rip), %rsi      # 0x5274
movl $0x1c, %edx
movq %rbx, %rdi
callq 0x2240
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2150
movb $0x1, 0x4b90(%rip)      # 0x82d5
movl $0x38, %edi
callq 0x2280
movq %rax, %rbx
movl $0x8, %edi
callq 0x2280
movq %rax, %r14
movq %rbx, %rdi
callq 0x2270
leaq -0x1a2(%rip), %rdx      # 0x35cc
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x23c0
testl %eax, %eax
jne 0x3784
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1b17(%rip), %rdi      # 0x52a2
popq %rbx
popq %r14
popq %rbp
jmp 0x2190
// File: /workspace/github_cpp_makefile_star2_O3/CDISC2020[P]Projet_satellite_agile/src/FDIR/watchdog_arduino.cpp
// Function: Watchdog_arduino::Watchdog_arduino()
Watchdog_arduino::Watchdog_arduino() 
{
	// activation des GPIO
	GPIOExport(3);
	GPIOExport(2);

	// choix du mode (in/out) des GPIO
	GPIODirection(3,OUT);
	GPIODirection(2,IN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x3, %edi
callq 0x3e70
movl $0x2, %edi
callq 0x3e70
movl $0x3, %edi
movl $0x1, %esi
callq 0x3f6a
movl $0x2, %edi
xorl %esi, %esi
popq %rbp
jmp 0x3f6a
// File: /workspace/github_cpp_makefile_star2_O3/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::Cuckoo(unsigned int, unsigned int, int)
Cuckoo::Cuckoo(unsigned probability, unsigned entries, int maxCount) {
    // Given the following inputs:
    // * `P`, an integer smaller than 256, that indicates the probability of a false positive that is acceptable, expressed as `1/2\*\*P`.
    // * `N`, an integer that represents the number of entries - a prime number smaller than 2\*\*32
    assert(probability < 256);
    assert(entries < pow(2,32));

    // 1. Let `f` be the number of bits per fingerprint, calculated as `P + 3`
    unsigned fingerprintSize = probability + 3;

    // 3. Let `allocated` be the closest power of 2 that is larger than `N`.
    unsigned logEntries = ceil(log2(entries));
    unsigned allocationEntries = (unsigned)pow(2, logEntries);
    // 4. Let `bytes` be `f`\*`allocated`\*`b`/8 rounded up to the nearest integer
    unsigned bytes = ceil((float)(fingerprintSize * allocationEntries * BucketSize) / 8.0);
    // 5. Add 5 to `bytes`
    bytes += 5;
    // 6. Allocate memory of `bytes` and set it to zero. Assign it to `digest-value`.
    m_digest = new unsigned char[bytes];
    memset(m_digest, 0, bytes);

    // 7. Set the first byte to `P`
    m_digest[0] = (char)fingerprintSize;
    // 8. Set the second till fifth bytes to `N` in big endian form
    bigEndianWrite(m_digest, 1, 4, entries);

    m_digestSize = bytes;
    m_maxCount = maxCount;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, -0x2c(%rbp)
cmpl $0x100, %esi            # imm = 0x100
jae 0x24b4
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %r14
movl %edx, %eax
cvtsi2sd %rax, %xmm0
addl $0x3, %r12d
callq 0x2290
callq 0x2070
cvttsd2si %xmm0, %rax
movl %eax, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x21b0
cvttsd2si %xmm0, %rax
imull %r12d, %eax
shlq $0x2, %rax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
cvtss2sd %xmm0, %xmm0
mulsd 0x2bac(%rip), %xmm0     # 0x5008
callq 0x2070
cvttsd2si %xmm0, %r13
addl $0x5, %r13d
movq %r13, %rdi
callq 0x2030
movq %rax, %rbx
movq %rax, (%r14)
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x2130
movb %r12b, (%rbx)
movl $0x4, %eax
movb %r15b, (%rbx,%rax)
shrl $0x8, %r15d
decq %rax
jne 0x248d
movq %r13, 0x8(%r14)
movl -0x2c(%rbp), %eax
movl %eax, 0x10(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2b8d(%rip), %rdi      # 0x5048
leaq 0x2b98(%rip), %rsi      # 0x505a
leaq 0x2b9c(%rip), %rcx      # 0x5065
movl $0x1c, %edx
callq 0x2160
nop
// File: /workspace/github_cpp_makefile_star2_O3/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::bigEndianWrite(unsigned char*, unsigned int, unsigned long, unsigned long)
void Cuckoo::bigEndianWrite(unsigned char* digest, unsigned startPosition, size_t length, unsigned long number) {
    const unsigned long digit = 0xff;
    for (int i = length - 1; i >= 0; --i) {
        unsigned long temp = number & digit;
        digest[startPosition + i] = (unsigned char)temp;
        number >>= 8;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
decl %edx
js 0x24f0
movl %edx, %eax
movl %esi, %edx
leal (%rdx,%rax), %esi
movb %cl, (%rdi,%rsi)
shrq $0x8, %rcx
addq $-0x1, %rax
jb 0x24e0
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::bigEndianRead(unsigned char const*, unsigned int, unsigned long)
unsigned long Cuckoo::bigEndianRead(const unsigned char* digest, unsigned startPosition, size_t length) {
    unsigned long readNumber = 0;
    for (unsigned i = 0; i < length; ++i) {
        readNumber <<= 8;
        readNumber += digest[startPosition + i];
    }
    return readNumber;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
testq %rdx, %rdx
je 0x284b
movl $0x1, %ecx
xorl %r8d, %r8d
shlq $0x8, %r8
movl %esi, %eax
movzbl (%rdi,%rax), %eax
orq %r8, %rax
movl %ecx, %r9d
incl %esi
incl %ecx
movq %rax, %r8
cmpq %rdx, %r9
jb 0x282d
jmp 0x284d
xorl %eax, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::key(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
std::string Cuckoo::key(std::string URL, std::string ETag) {
    // Given the following inputs:
    //
    // * `URL`, an array of characters
    // * `ETag`, an array of characters
    // 1. Let `key` be `URL` converted to an ASCII string by percent-encoding as appropriate {{RFC3986}}.
    // TODO(yoav): Convert to ascii.
    std::string keyString = URL;
    // 2. If `ETag` is not null:
    if (!ETag.empty()) {
        // 1. Append `ETag` to `key` as an ASCII string, including both the `weak` indicator (if present) and double quotes, as per {{RFC7232}}, Section 2.3.
        // TODO(yoav): Only add the double quotes if they are not already there.
        keyString += "\"" + ETag + "\"";
    }
    return keyString;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x387a
cmpq $0x0, 0x8(%r14)
je 0x291b
leaq 0x28dd(%rip), %rsi      # 0x516d
leaq -0x60(%rbp), %rdi
movq %r14, %rdx
callq 0x37ef
leaq 0x28ca(%rip), %rsi      # 0x516d
leaq -0x60(%rbp), %rdi
callq 0x22b0
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rsi
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rsi
je 0x28d1
movq %rsi, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x28dc
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq %r12, %rsi
movq 0x8(%rax), %rdx
movq %rdx, -0x38(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0x20c0
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x2909
callq 0x21c0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x291b
callq 0x21c0
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x2941
callq 0x21c0
jmp 0x2941
movq %rax, %r14
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2958
callq 0x21c0
jmp 0x2958
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x2965
callq 0x21c0
movq %r14, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O3/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::fingerprint(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
unsigned long Cuckoo::fingerprint(std::string key, unsigned fingerprintSize) {
    // Given the following inputs:
    //
    // * `key`, an array of characters
    // * `f`, an integer indicating the number of output bits

    assert(fingerprintSize > 0);
    // 1. Let `hash-value` be the SHA-256 message digest {{RFC6234}} of `key`, expressed as an integer.
    unsigned char hash[SHA256_DIGEST_LENGTH];
    SHA256_CTX sha256;
    SHA256_Init(&sha256);
    SHA256_Update(&sha256, key.c_str(), key.size());
    SHA256_Final(hash, &sha256);
    unsigned long fingerprintValue;
    // Note: the implementation below diverges from the literal specified steps, but achieves the same goals.
    // 2. Let `h` be the number of bits in `hash-value`
    // 3. Let `fingerprint-value` be 0
    // 4. While `fingerprint-value` is 0 and `h` > `f`:
    for (unsigned i = SHA256_DIGEST_LENGTH * 8 - fingerprintSize; i >= fingerprintSize; i -= fingerprintSize) {
        // 1. Let `fingerprint-value` be the `f` least significant bits of `hash-value`.
        // 2. Let `hash-value` be the `h`-`f` most significant bits of `hash-value`.
        // 3. Substract `f` from `h`.
        fingerprintValue = readFingerprint(hash, i, fingerprintSize);
        if (fingerprintValue != 0)
            break;
    }
    // 5. If `fingerprint-value` is 0, let `fingerprint-value` be 1.
    if (fingerprintValue == 0)
        fingerprintValue = 1;
    // 6. Return `fingerprint-value`.
    return fingerprintValue;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
testl %esi, %esi
je 0x2a6e
movl %esi, %ebx
movq %rdi, %r14
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
callq 0x2150
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r12, %rdi
callq 0x2260
leaq -0x40(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x22c0
movl $0x100, %esi            # imm = 0x100
subl %ebx, %esi
xorl %r14d, %r14d
movl %esi, %r12d
subl %ebx, %r12d
jb 0x2a53
movq %r15, %rdi
movl %ebx, %edx
callq 0x2b2c
movl %r12d, %esi
testq %rax, %rax
je 0x2a39
movq %rax, %r14
cmpq $0x1, %r14
adcq $0x0, %r14
movq %r14, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26fa(%rip), %rdi      # 0x516f
leaq 0x25de(%rip), %rsi      # 0x505a
leaq 0x2700(%rip), %rcx      # 0x5183
movl $0x12d, %edx            # imm = 0x12D
callq 0x2160
nop