LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_decode.c
// Function: lzfse_decode_buffer
size_t lzfse_decode_buffer(uint8_t *__restrict dst_buffer, size_t dst_size,
                           const uint8_t *__restrict src_buffer,
                           size_t src_size, void *__restrict scratch_buffer) {
  int has_malloc = 0;
  size_t ret = 0;

  // Deal with the possible NULL pointer
  if (scratch_buffer == NULL) {
    // +1 in case scratch size could be zero
    scratch_buffer = malloc(lzfse_decode_scratch_size() + 1);
    has_malloc = 1;
  }
  if (scratch_buffer == NULL)
    return 0;
  ret = lzfse_decode_buffer_with_scratch(dst_buffer, 
                               dst_size, src_buffer, 
                               src_size, scratch_buffer);
  if (has_malloc)
    free(scratch_buffer);
  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movq %r8, %r15
testq %r8, %r8
jne 0x3cb2
movl $0xb921, %edi           # imm = 0xB921
callq 0x30d0
movq %rax, %r15
testq %r15, %r15
je 0x3cdd
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0x3936
movq %rax, %r14
testq %rbx, %rbx
jne 0x3ce0
movq %r15, %rdi
callq 0x3030
jmp 0x3ce0
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_decode.c
// Function: lzfse_decode_file
size_t lzfse_decode_file(FILE *dst_file, FILE *src_file, size_t src_size,
                         int *error, void *__restrict scratch_buffer) {
  int has_malloc = 0;
  size_t ret = 0;

  // Deal with the possible NULL pointer
  if (scratch_buffer == NULL) {
    // +1 in case scratch size could be zero
    scratch_buffer = malloc(lzfse_decode_scratch_size() + 1);
    has_malloc = 1;
  }
  if (scratch_buffer == NULL) {
    if (error != NULL) *error = 1;
    return 0;
  }
  ret = lzfse_decode_file_with_scratch(dst_file, src_file, src_size, error, scratch_buffer);
  if (has_malloc)
    free(scratch_buffer);
  return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
movq %r8, %r15
testq %r8, %r8
jne 0x3d21
movl $0xb921, %edi           # imm = 0xB921
callq 0x30d0
movq %rax, %r15
testq %r15, %r15
je 0x3d4c
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %r15, %r8
callq 0x39a4
movq %rax, %r14
testq %rbx, %rbx
jne 0x3d5b
movq %r15, %rdi
callq 0x3030
jmp 0x3d5b
testq %r14, %r14
je 0x3d58
movl $0x1, (%r14)
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_encode_base.c
// Function: lzfse_encode_init
int lzfse_encode_init(lzfse_encoder_state *s) {
  const lzfse_match NO_MATCH = {0};
  lzfse_history_set line;
  for (int i = 0; i < LZFSE_ENCODE_HASH_WIDTH; i++) {
    line.pos[i] = -4 * LZFSE_ENCODE_MAX_D_VALUE; // invalid pos
    line.value[i] = 0;
  }
  // Fill table
  for (int i = 0; i < LZFSE_ENCODE_HASH_VALUES; i++)
    s->history_table[i] = line;
  s->pending = NO_MATCH;
  s->src_literal = 0;

  return LZFSE_STATUS_OK; // OK
}

// Assembly:
xorl %eax, %eax
movl $0xfff00014, -0x20(%rsp,%rax,4) # imm = 0xFFF00014
movl $0x0, -0x10(%rsp,%rax,4)
incq %rax
cmpq $0x4, %rax
jne 0x3d72
leaq 0x27160(%rdi), %rax
xorl %ecx, %ecx
movups -0x20(%rsp), %xmm0
movups -0x10(%rsp), %xmm1
movups %xmm1, 0x10(%rax,%rcx)
movups %xmm0, (%rax,%rcx)
addq $0x20, %rcx
cmpq $0x80000, %rcx          # imm = 0x80000
jne 0x3d94
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
xorl %eax, %eax
movq %rax, 0x50(%rdi)
movq %rax, 0x10(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_encode_base.c
// Function: lzfse_encode_translate
int lzfse_encode_translate(lzfse_encoder_state *s, lzfse_offset delta) {
  assert(delta >= 0);
  if (delta == 0)
    return LZFSE_STATUS_OK; // OK

  // SRC
  s->src += delta;

  // Offsets in SRC
  s->src_end -= delta;
  s->src_encode_i -= delta;
  s->src_encode_end -= delta;
  s->src_literal -= delta;

  // Pending match
  s->pending.pos -= delta;
  s->pending.ref -= delta;

  // history_table positions, translated, and clamped to invalid pos
  int32_t invalidPos = -4 * LZFSE_ENCODE_MAX_D_VALUE;
  for (int i = 0; i < LZFSE_ENCODE_HASH_VALUES; i++) {
    int32_t *p = &(s->history_table[i].pos[0]);
    for (int j = 0; j < LZFSE_ENCODE_HASH_WIDTH; j++) {
      lzfse_offset newPos = p[j] - delta; // translate
      p[j] = (int32_t)((newPos < invalidPos) ? invalidPos : newPos); // clamp
    }
  }

  return LZFSE_STATUS_OK; // OK
}

// Assembly:
pushq %rax
testq %rsi, %rsi
js 0x3e2f
je 0x3e2b
addq %rsi, (%rdi)
subq %rsi, 0x8(%rdi)
subq %rsi, 0x18(%rdi)
subq %rsi, 0x20(%rdi)
subq %rsi, 0x10(%rdi)
subq %rsi, 0x40(%rdi)
subq %rsi, 0x48(%rdi)
addq $0x27160, %rdi          # imm = 0x27160
xorl %eax, %eax
movq $-0xfffec, %rcx         # imm = 0xFFF00014
xorl %edx, %edx
movslq (%rdi,%rdx,4), %r8
subq %rsi, %r8
cmpq $-0xfffeb, %r8          # imm = 0xFFF00015
cmovlq %rcx, %r8
movl %r8d, (%rdi,%rdx,4)
incq %rdx
cmpq $0x4, %rdx
jne 0x3dfd
incq %rax
addq $0x20, %rdi
cmpq $0x4000, %rax           # imm = 0x4000
jne 0x3dfb
xorl %eax, %eax
popq %rcx
retq
leaq 0x5717(%rip), %rdi      # 0x954d
leaq 0x571b(%rip), %rsi      # 0x9558
leaq 0x572c(%rip), %rcx      # 0x9570
movl $0x262, %edx            # imm = 0x262
callq 0x3070
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_encode_base.c
// Function: lzfse_backend_match
static int lzfse_backend_match(lzfse_encoder_state *s,
                               const lzfse_match *match) {
  // Try to push the match in state
  if (lzfse_push_match(s, match) == LZFSE_STATUS_OK)
    return LZFSE_STATUS_OK; // OK, match added to state

  // Here state tables are full, try to emit block
  if (lzfse_encode_matches(s) != LZFSE_STATUS_OK)
    return LZFSE_STATUS_DST_FULL; // DST full, match not added

  // Here block has been emitted, re-try to push the match in state
  return lzfse_push_match(s, match);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x433d
testl %eax, %eax
je 0x4293
movq %r14, %rdi
callq 0x4640
movl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testl %ecx, %ecx
jne 0x4295
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x433d
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_encode_base.c
// Function: lzfse_encode_finish
int lzfse_encode_finish(lzfse_encoder_state *s) {
  const lzfse_match NO_MATCH = {0};

  // Emit pending match
  if (s->pending.length > 0) {
    if (lzfse_backend_match(s, &s->pending) != LZFSE_STATUS_OK)
      return LZFSE_STATUS_DST_FULL;
    s->pending = NO_MATCH;
  }

  // Emit final literals if any
  lzfse_offset L = s->src_end - s->src_literal;
  if (L > 0) {
    if (lzfse_backend_literals(s, L) != LZFSE_STATUS_OK)
      return LZFSE_STATUS_DST_FULL;
  }

  // Emit all matches, and end-of-stream block
  if (lzfse_backend_end_of_stream(s) != LZFSE_STATUS_OK)
    return LZFSE_STATUS_DST_FULL;

  return LZFSE_STATUS_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
cmpl $0x0, 0x50(%rdi)
je 0x42d6
leaq 0x40(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x425b
movl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testl %ecx, %ecx
jne 0x4335
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq $0x0, 0x10(%r14)
movq 0x8(%rbx), %rax
cmpq 0x10(%rbx), %rax
jle 0x4307
movq %rsp, %rsi
movq %rax, (%rsi)
decq %rax
movq %rax, 0x8(%rsi)
movl $0x0, 0x10(%rsi)
movq %rbx, %rdi
callq 0x425b
movl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testl %ecx, %ecx
jne 0x4335
movq %rbx, %rdi
callq 0x4640
movl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testl %ecx, %ecx
jne 0x4335
movq 0x28(%rbx), %rcx
leaq 0x4(%rcx), %rdx
cmpq 0x38(%rbx), %rdx
ja 0x4335
movl $0x24787662, (%rcx)     # imm = 0x24787662
addq $0x4, 0x28(%rbx)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_fse.c
// Function: fse_init_encoder_table
void fse_init_encoder_table(int nstates, int nsymbols,
                            const uint16_t *__restrict freq,
                            fse_encoder_entry *__restrict t) {
  int offset = 0; // current offset
  int n_clz = __builtin_clz(nstates);
  for (int i = 0; i < nsymbols; i++) {
    int f = (int)freq[i];
    if (f == 0)
      continue; // skip this symbol, no occurrences
    int k =
        __builtin_clz(f) - n_clz; // shift needed to ensure N <= (F<<K) < 2*N
    t[i].s0 = (int16_t)((f << k) - nstates);
    t[i].k = (int16_t)k;
    t[i].delta0 = (int16_t)(offset - f + (nstates >> k));
    t[i].delta1 = (int16_t)(offset - f + (nstates >> (k - 1)));
    offset += f;
  }
}

// Assembly:
testl %esi, %esi
jle 0x7ae3
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rax
bsrl %edi, %r8d
xorl $0x1f, %r8d
movl %esi, %esi
xorl %r9d, %r9d
xorl %r10d, %r10d
movzwl (%rdx,%r9,2), %r11d
testl %r11d, %r11d
je 0x7ad7
bsrl %r11d, %ecx
xorl $0x1f, %ecx
subl %r8d, %ecx
movl %r11d, %ebx
shll %cl, %ebx
subl %edi, %ebx
movw %bx, (%rax,%r9,8)
movw %cx, 0x2(%rax,%r9,8)
movl %r10d, %ebx
movl %edi, %ebp
sarl %cl, %ebp
subl %r11d, %ebx
addl %ebx, %ebp
decl %ecx
movl %edi, %r14d
sarl %cl, %r14d
movw %bp, 0x4(%rax,%r9,8)
addl %ebx, %r14d
movw %r14w, 0x6(%rax,%r9,8)
addl %r11d, %r10d
incq %r9
cmpq %r9, %rsi
jne 0x7a8b
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_fse.c
// Function: fse_init_decoder_table
int fse_init_decoder_table(int nstates, int nsymbols,
                           const uint16_t *__restrict freq,
                           int32_t *__restrict t) {
  assert(nsymbols <= 256);
  assert(fse_check_freq(freq, nsymbols, nstates) == 0);
  int n_clz = __builtin_clz(nstates);
  int sum_of_freq = 0;
  for (int i = 0; i < nsymbols; i++) {
    int f = (int)freq[i];
    if (f == 0)
      continue; // skip this symbol, no occurrences

    sum_of_freq += f;

    if (sum_of_freq > nstates) {
      return -1;
    }

    int k =
        __builtin_clz(f) - n_clz; // shift needed to ensure N <= (F<<K) < 2*N
    int j0 = ((2 * nstates) >> k) - f;

    // Initialize all states S reached by this symbol: OFFSET <= S < OFFSET + F
    for (int j = 0; j < f; j++) {
      fse_decoder_entry e;

      e.symbol = (uint8_t)i;
      if (j < j0) {
        e.k = (int8_t)k;
        e.delta = (int16_t)(((f + j) << k) - nstates);
      } else {
        e.k = (int8_t)(k - 1);
        e.delta = (int16_t)((j - j0) << (k - 1));
      }

      memcpy(t, &e, sizeof(e));
      t++;
    }
  }

  return 0; // OK
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x101, %esi            # imm = 0x101
jge 0x7bf4
movq %rcx, %rax
movslq %edi, %rcx
movl %esi, %r9d
testl %esi, %esi
je 0x7b20
xorl %r10d, %r10d
xorl %r8d, %r8d
movzwl (%rdx,%r10,2), %r11d
addq %r11, %r8
incq %r10
cmpq %r10, %r9
jne 0x7b0e
jmp 0x7b23
xorl %r8d, %r8d
cmpq %rcx, %r8
ja 0x7c13
testl %esi, %esi
setg %r10b
jle 0x7bdc
bsrl %edi, %ecx
xorl $0x1f, %ecx
movl %ecx, 0x4(%rsp)
leal (%rdi,%rdi), %ecx
movl %ecx, (%rsp)
xorl %r14d, %r14d
xorl %ebp, %ebp
movzwl (%rdx,%r14,2), %r15d
testl %r15d, %r15d
je 0x7bc2
addl %r15d, %ebp
movl $0x1, %ecx
cmpl %edi, %ebp
jg 0x7bc7
bsrl %r15d, %esi
xorl $0x1f, %esi
subl 0x4(%rsp), %esi
movl (%rsp), %r12d
movl %esi, %ecx
sarl %cl, %r12d
leal -0x1(%rsi), %r8d
movl %r15d, %r13d
subl %r12d, %r13d
subl %r15d, %r12d
xorl %ebx, %ebx
cmpl %r12d, %ebx
jge 0x7b9b
leal (%r15,%rbx), %r11d
movl %esi, %ecx
shll %cl, %r11d
subl %edi, %r11d
movl %esi, %ecx
jmp 0x7ba8
leal (%rbx,%r13), %r11d
movl %r8d, %ecx
shll %cl, %r11d
movl %r8d, %ecx
movb %cl, (%rax)
movb %r14b, 0x1(%rax)
movw %r11w, 0x2(%rax)
addq $0x4, %rax
incl %ebx
cmpl %ebx, %r15d
jne 0x7b86
xorl %ecx, %ecx
jmp 0x7bc7
movl $0x4, %ecx
testb $0x3, %cl
jne 0x7bdc
incq %r14
cmpq %r9, %r14
setb %r10b
jne 0x7b4d
movzbl %r10b, %eax
andl $0x1, %eax
negl %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d48(%rip), %rdi      # 0x9943
leaq 0x1d51(%rip), %rsi      # 0x9953
leaq 0x1d5a(%rip), %rcx      # 0x9963
movl $0x3c, %edx
callq 0x3070
leaq 0x1d9b(%rip), %rdi      # 0x99b5
leaq 0x1d32(%rip), %rsi      # 0x9953
leaq 0x1d3b(%rip), %rcx      # 0x9963
movl $0x3d, %edx
callq 0x3070
// File: /workspace/github_cpp_makefile_star2_O1/sbingner[P]kerneldec/lzfse/src/lzfse_fse.c
// Function: fse_init_value_decoder_table
void fse_init_value_decoder_table(int nstates, int nsymbols,
                                  const uint16_t *__restrict freq,
                                  const uint8_t *__restrict symbol_vbits,
                                  const int32_t *__restrict symbol_vbase,
                                  fse_value_decoder_entry *__restrict t) {
  assert(nsymbols <= 256);
  assert(fse_check_freq(freq, nsymbols, nstates) == 0);

  int n_clz = __builtin_clz(nstates);
  for (int i = 0; i < nsymbols; i++) {
    int f = (int)freq[i];
    if (f == 0)
      continue; // skip this symbol, no occurrences

    int k =
        __builtin_clz(f) - n_clz; // shift needed to ensure N <= (F<<K) < 2*N
    int j0 = ((2 * nstates) >> k) - f;

    fse_value_decoder_entry ei = {0};
    ei.value_bits = symbol_vbits[i];
    ei.vbase = symbol_vbase[i];

    // Initialize all states S reached by this symbol: OFFSET <= S < OFFSET + F
    for (int j = 0; j < f; j++) {
      fse_value_decoder_entry e = ei;

      if (j < j0) {
        e.total_bits = (uint8_t)k + e.value_bits;
        e.delta = (int16_t)(((f + j) << k) - nstates);
      } else {
        e.total_bits = (uint8_t)(k - 1) + e.value_bits;
        e.delta = (int16_t)((j - j0) << (k - 1));
      }

      memcpy(t, &e, 8);
      t++;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movq %rcx, 0x8(%rsp)
cmpl $0x101, %esi            # imm = 0x101
jge 0x7d3d
movslq %edi, %rax
movl %esi, %r11d
testl %esi, %esi
je 0x7c77
xorl %r8d, %r8d
xorl %ecx, %ecx
movzwl (%rdx,%r8,2), %r10d
addq %r10, %rcx
incq %r8
cmpq %r8, %r11
jne 0x7c65
jmp 0x7c79
xorl %ecx, %ecx
cmpq %rax, %rcx
ja 0x7d5c
testl %esi, %esi
jle 0x7d2e
bsrl %edi, %eax
xorl $0x1f, %eax
movl %eax, 0x4(%rsp)
leal (%rdi,%rdi), %eax
movl %eax, (%rsp)
xorl %r14d, %r14d
movzwl (%rdx,%r14,2), %r8d
testl %r8d, %r8d
je 0x7d22
bsrl %r8d, %esi
xorl $0x1f, %esi
subl 0x4(%rsp), %esi
movl (%rsp), %eax
movl %eax, %r15d
movl %esi, %ecx
sarl %cl, %r15d
movl %r15d, %r12d
subl %r8d, %r12d
movq 0x8(%rsp), %rax
movb (%rax,%r14), %r13b
movq 0x10(%rsp), %rax
movl (%rax,%r14,4), %eax
leal -0x1(%rsi), %r10d
movl %r8d, %r8d
negl %r15d
addq %r8, %r15
xorl %ebp, %ebp
cmpl %r12d, %ebp
jge 0x7cf7
leal (%r8,%rbp), %ebx
movl %esi, %ecx
shll %cl, %ebx
subl %edi, %ebx
movl %esi, %ecx
jmp 0x7d03
leal (%r15,%rbp), %ebx
movl %r10d, %ecx
shll %cl, %ebx
movl %r10d, %ecx
addb %r13b, %cl
movb %cl, (%r9)
movb %r13b, 0x1(%r9)
movw %bx, 0x2(%r9)
movl %eax, 0x4(%r9)
addq $0x8, %r9
incq %rbp
cmpl %ebp, %r8d
jne 0x7ce4
incq %r14
cmpq %r11, %r14
jne 0x7c9d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1bff(%rip), %rdi      # 0x9943
leaq 0x1c08(%rip), %rsi      # 0x9953
leaq 0x1c90(%rip), %rcx      # 0x99e2
movl $0x72, %edx
callq 0x3070
leaq 0x1c52(%rip), %rdi      # 0x99b5
leaq 0x1be9(%rip), %rsi      # 0x9953
leaq 0x1c71(%rip), %rcx      # 0x99e2
movl $0x73, %edx
callq 0x3070
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/./log.h
// Function: GET_MSG(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
char *GET_MSG(int level, string s)
{
    static char log_msg[1000];
    time_t t = time(0);
    struct tm *local = localtime(&t);
    char time_buf[128];
    strftime(time_buf, 64, "%Y/%m/%d %H:%M:%S", local);
    strcpy(log_msg, "[");
    strcat(log_msg, time_buf);
    strcat(log_msg, "] [");
    strcat(log_msg, LEVEL[level]);
    strcat(log_msg, "] ");
    strcat(log_msg, s.c_str());
    strcat(log_msg, "\n");
    return log_msg;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movl %edi, %ebp
xorl %edi, %edi
callq 0x2200
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x2180
leaq 0x3a60(%rip), %rdx      # 0x6099
leaq 0x10(%rsp), %r15
movl $0x40, %esi
movq %r15, %rdi
movq %rax, %rcx
callq 0x21b0
movw $0x5b, 0x6c19(%rip)     # 0x9270
leaq 0x6c12(%rip), %r14      # 0x9270
movq %r14, %rdi
movq %r15, %rsi
callq 0x23e0
movq %r14, %rdi
callq 0x2110
movl $0x5b205d, (%rax,%r14)  # imm = 0x5B205D
movslq %ebp, %rax
leaq (%rax,%rax,4), %rax
leaq 0x39c9(%rip), %rcx      # 0x6050
leaq (%rcx,%rax,4), %rsi
movq %r14, %rdi
callq 0x23e0
movq %r14, %rdi
callq 0x2110
movw $0x205d, (%rax,%r14)    # imm = 0x205D
movb $0x0, 0x2(%rax,%r14)
movq (%rbx), %rsi
movq %r14, %rdi
callq 0x23e0
movq %r14, %rdi
callq 0x2110
movw $0xa, (%rax,%r14)
movq %r14, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/ema_tool.cpp
// Function: StringToDatetime(char const*)
time_t StringToDatetime(const char* str)
{
	tm tm_;
	int year, month, day, hour, minute, second;
	sscanf(str, "%d-%d-%d %d:%d:%d", &year, &month, &day, &hour, &minute, &second);
	tm_.tm_year = year - 1900;
	tm_.tm_mon = month - 1;
	tm_.tm_mday = day;
	tm_.tm_hour = hour;
	tm_.tm_min = minute;
	tm_.tm_sec = second;
	tm_.tm_isdst = 0;

	time_t t_ = mktime(&tm_);
	return t_;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
leaq 0x8(%rsp), %r13
leaq 0xc(%rsp), %rbp
leaq 0x3998(%rip), %rsi      # 0x60ae
leaq 0x1c(%rsp), %rbx
leaq 0x18(%rsp), %r14
leaq 0x14(%rsp), %r15
leaq 0x10(%rsp), %r12
movq %rbx, %rdx
movq %r14, %rcx
movq %r15, %r8
movq %r12, %r9
xorl %eax, %eax
pushq %r13
pushq %rbp
callq 0x2230
addq $0x10, %rsp
movl $0xfffff894, %eax       # imm = 0xFFFFF894
addl (%rbx), %eax
leaq 0x20(%rsp), %rdi
movl %eax, 0x14(%rdi)
movl (%r14), %eax
decl %eax
movl %eax, 0x10(%rdi)
movl (%r15), %eax
movl %eax, 0xc(%rdi)
movl (%r12), %eax
movl %eax, 0x8(%rdi)
movl (%rbp), %eax
movl %eax, 0x4(%rdi)
movl (%r13), %eax
movl %eax, (%rdi)
movl $0x0, 0x20(%rdi)
callq 0x2160
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/cache_stat.cpp
// Function: StatCache::StatCache(long)
StatCache::StatCache(long st)
{
	total_seq = re_seq = map_size = current_hour = current_day = 0;
	start_time = st;
	for (int i = 0; i < 1024; i++)
	{
		reuse_dis_array[i] = 0l;
	}

	string output_path = "./result";
	string shell_str = "mkdir -p " + output_path;
	int ret = system(shell_str.c_str());
	assert(0 == ret);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rdi, %rbx
leaq 0x2060(%rdi), %rax
movq %rax, 0x2030(%rdi)
movl $0x1, %eax
movq %rax, 0x2038(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x2040(%rdi)
movl $0x3f800000, %ecx       # imm = 0x3F800000
movl %ecx, 0x2050(%rdi)
movups %xmm0, 0x2058(%rdi)
leaq 0x2098(%rdi), %rdx
movq %rdx, 0x2068(%rdi)
movq %rax, 0x2070(%rdi)
movups %xmm0, 0x2078(%rdi)
movl %ecx, 0x2088(%rdi)
movups %xmm0, 0x2090(%rdi)
movups %xmm0, (%rdi)
movups %xmm0, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
movq %rsi, 0x28(%rdi)
addq $0x30, %rdi
movl $0x2000, %edx           # imm = 0x2000
xorl %esi, %esi
callq 0x2130
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x265e(%rip), %rsi      # 0x63c0
leaq 0x265f(%rip), %rdx      # 0x63c8
movq %rsp, %rdi
callq 0x3c32
leaq 0x2651(%rip), %rsi      # 0x63c9
leaq 0x20(%rsp), %rdi
movq %rsp, %rdx
callq 0x4797
movq 0x20(%rsp), %rdi
callq 0x21d0
testl %eax, %eax
jne 0x3dbe
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3da6
callq 0x2210
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3db4
callq 0x2210
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x260e(%rip), %rdi      # 0x63d3
leaq 0x2610(%rip), %rsi      # 0x63dc
leaq 0x2618(%rip), %rcx      # 0x63eb
movl $0x13, %edx
callq 0x2150
movq %rax, %r14
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3df8
callq 0x2210
jmp 0x3df8
movq %rax, %r14
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x3e0b
callq 0x2210
jmp 0x3e0b
movq %rax, %r14
leaq 0x2030(%rbx), %r15
addq $0x2068, %rbx           # imm = 0x2068
movq %rbx, %rdi
callq 0x4818
movq %r15, %rdi
callq 0x4886
movq %r14, %rdi
callq 0x23d0
nop
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/cache_stat.cpp
// Function: StatCache::is_new_day(_IoRecord*)
bool StatCache::is_new_day(IoRecord* ir)
{
	bool result = false;
	long tmp = get_time_day(ir->alloc_time);
	if (tmp - current_day > 0)
	{
		result = true;
		current_day = tmp;
	}
	else if (tmp < current_day)
	{
		ir->alloc_time += 1;
	}
	return result;
}

// Assembly:
movq (%rsi), %rcx
leaq 0x7080(%rcx), %rax
movabsq $0x1845c8a0ce512957, %rdx # imm = 0x1845C8A0CE512957
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xd, %rdx
addq %rax, %rdx
movq 0x20(%rdi), %rax
cmpq %rax, %rdx
jle 0x44ce
movq %rdx, 0x20(%rdi)
jmp 0x44d6
jge 0x44d6
incq %rcx
movq %rcx, (%rsi)
cmpq %rax, %rdx
setg %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/cache_stat.cpp
// Function: StatCache::plot_rar_curve(SeqNum*)
void StatCache::plot_rar_curve(struct SeqNum* sn_tmp)
{
	//y = a*log(t) + b
	//x = log(t)
	//a = (y1-y2)/(x1-x2)
	//b = (x1*y2-x2*y1)/(x1-x2)
	double x1 = log(3600);
	double x2 = log(3600 * 20);
	double x3 = log(3600 * 47);
	double y1 = sn_tmp->re_retio[0];
	double y2 = sn_tmp->re_retio[1];
	double y3 = sn_tmp->re_retio[2];
	sn_tmp->a[0] = (y1 - y2) / (x1 - x2);
	sn_tmp->a[1] = (y3 - y2) / (x3 - x2);
	sn_tmp->b[0] = (x1 * y2 - x2 * y1) / (x1 - x2);
	sn_tmp->b[1] = (x3 * y2 - x2 * y3) / (x3 - x2);

}

// Assembly:
movq (%rsi), %rax
movq 0x10(%rsi), %rcx
movsd (%rcx), %xmm1
movsd 0x8(%rcx), %xmm0
movsd 0x10(%rcx), %xmm2
movapd %xmm1, %xmm3
subsd %xmm0, %xmm3
movsd 0x1e59(%rip), %xmm4     # 0x6380
divsd %xmm4, %xmm3
movsd %xmm3, (%rax)
movapd %xmm2, %xmm3
subsd %xmm0, %xmm3
movsd 0x1e49(%rip), %xmm5     # 0x6388
divsd %xmm5, %xmm3
movsd %xmm3, 0x8(%rax)
movsd 0x1e40(%rip), %xmm3     # 0x6390
mulsd %xmm3, %xmm1
movsd 0x1e3c(%rip), %xmm6     # 0x6398
mulsd %xmm0, %xmm6
addsd %xmm1, %xmm6
divsd %xmm4, %xmm6
movq 0x8(%rsi), %rax
movsd %xmm6, (%rax)
mulsd 0x1e28(%rip), %xmm0     # 0x63a0
mulsd %xmm3, %xmm2
addsd %xmm2, %xmm0
divsd %xmm5, %xmm0
movsd %xmm0, 0x8(%rax)
retq
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/cache_stat.cpp
// Function: StatCache::is_new_hour(_IoRecord*)
bool StatCache::is_new_hour(IoRecord* ir)
{
	bool result = false;
	long tmp = get_time_hour(ir->alloc_time);
	if (tmp - current_hour > 0)
	{
		result = true;
		current_hour = tmp;
	}
	else if (tmp < current_hour)
	{
		ir->alloc_time += 1;
	}
	return result;
}

// Assembly:
movq (%rsi), %rcx
movabsq $0x48d159e26af37c05, %rdx # imm = 0x48D159E26AF37C05
movq %rcx, %rax
imulq %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xa, %rdx
addq %rax, %rdx
movq 0x18(%rdi), %rax
cmpq %rax, %rdx
jle 0x45ba
movq %rdx, 0x18(%rdi)
jmp 0x45c2
jge 0x45c2
incq %rcx
movq %rcx, (%rsi)
cmpq %rax, %rdx
setg %al
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/cache_stat.cpp
// Function: StatCache::get_reuse_curve(long, long)
double StatCache::get_reuse_curve(long time_span, long timestamp)
{
	/*
	get reuse distance
	y = a*log(x) + b
	reusedistance = total_block_cnt * (1 - re_access_ratio)
	*/
	double result = 0;
	if (time_span <= 1 || (get_time_day(timestamp) - get_time_day(start_time) < 2))
	{
		result = 0;
	}
	else
	{
		SeqNum* sn_tmp = seq_map[get_time_day(timestamp) - 2];
		if (time_span <= 72000)
		{
			result = sn_tmp->a[0] * log(time_span) + sn_tmp->b[0];
		}
		else
		{
			result = sn_tmp->a[1] * log(time_span) + sn_tmp->b[1];
		}
	}

	return result < 0.99 ? result : 0.99;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
xorpd %xmm0, %xmm0
cmpq $0x2, %rsi
jl 0x46cb
movq %rsi, %rbx
movl $0x7080, %esi           # imm = 0x7080
addq %rsi, %rdx
movabsq $0x1845c8a0ce512957, %rcx # imm = 0x1845C8A0CE512957
movq %rdx, %rax
imulq %rcx
movq %rdx, %rcx
addq 0x28(%rdi), %rsi
movabsq $-0x1845c8a0ce512957, %rdx # imm = 0xE7BA375F31AED6A9
movq %rsi, %rax
imulq %rdx
movq %rcx, %rax
shrq $0x3f, %rax
sarq $0xd, %rcx
addq %rax, %rcx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xd, %rdx
addq %rax, %rdx
addq %rcx, %rdx
cmpq $0x2, %rdx
jl 0x46cb
addq $0x2068, %rdi           # imm = 0x2068
addq $-0x2, %rcx
leaq 0x10(%rsp), %rsi
movq %rcx, (%rsi)
callq 0x4bbe
movq (%rax), %r14
movq (%r14), %rax
cmpq $0x11940, %rbx          # imm = 0x11940
jg 0x46a4
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
callq 0x21a0
movq 0x8(%r14), %rax
mulsd 0x8(%rsp), %xmm0
addsd (%rax), %xmm0
jmp 0x46cb
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
xorps %xmm0, %xmm0
cvtsi2sd %rbx, %xmm0
callq 0x21a0
movq 0x8(%r14), %rax
mulsd 0x8(%rsp), %xmm0
addsd 0x8(%rax), %xmm0
minsd 0x1ce5(%rip), %xmm0     # 0x63b8
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/cache_stat.cpp
// Function: StatCache::output_reuse_distance()
void StatCache::output_reuse_distance()
{
	string filename = "./result/reuse_dis.txt";
	FILE* fp = fopen(filename.c_str(), "w");
	assert(NULL != fp);
	for (int i = 0; i < 1024; i++) {
		fprintf(fp, "%ld,", reuse_dis_array[i]);
	}
	fclose(fp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1db0(%rip), %rsi      # 0x64ad
leaq 0x1dbf(%rip), %rdx      # 0x64c3
movq %rsp, %r14
movq %r14, %rdi
callq 0x3c32
movq (%r14), %rdi
leaq 0x1d40(%rip), %rsi      # 0x6459
callq 0x22b0
testq %rax, %rax
je 0x4772
movq %rax, %r14
leaq 0x1dbf(%rip), %r15      # 0x64ec
xorl %r13d, %r13d
movq 0x30(%rbx,%r13,8), %rdx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2340
incq %r13
cmpq $0x400, %r13            # imm = 0x400
jne 0x4730
movq %r14, %rdi
callq 0x2240
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x4764
callq 0x2210
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x1a2d(%rip), %rdi      # 0x61a6
leaq 0x1c5c(%rip), %rsi      # 0x63dc
leaq 0x1d3d(%rip), %rcx      # 0x64c4
movl $0x97, %edx
callq 0x2150
nop
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/time_analysis_tool.cpp
// Function: TimeAnalysis::add_time(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void TimeAnalysis::add_time(string key)
{
	if (!TIME_ON)
	{
		return;
	}
	auto it = time_map.find(key);
	if (it == time_map.end())
	{
		struct time_struct* ts = (struct time_struct*)
			malloc(sizeof(struct time_struct));
		ts->cnt = 1;
		ts->latency = end_tv.tv_sec * 1000 + end_tv.tv_usec * 1.0 / 1000 -
			start_tv.tv_sec * 1000 - start_tv.tv_usec * 1.0 / 1000;
		time_map[key] = ts;

	}
	else
	{
		struct time_struct* ts = it->second;
		ts->cnt++;
		ts->latency += end_tv.tv_sec * 1000 + end_tv.tv_usec * 1.0 / 1000 -
			start_tv.tv_sec * 1000 - start_tv.tv_usec * 1.0 / 1000;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rdi), %r15
movq %r15, %rdi
callq 0x5248
testq %rax, %rax
je 0x4fa5
movq 0x28(%rax), %rax
incq (%rax)
imulq $0x3e8, 0x10(%rbx), %rcx # imm = 0x3E8
cvtsi2sd %rcx, %xmm0
cvtsi2sdq 0x18(%rbx), %xmm1
movsd 0x158b(%rip), %xmm2     # 0x64f8
divsd %xmm2, %xmm1
addsd %xmm0, %xmm1
imulq $0x3e8, (%rbx), %rcx    # imm = 0x3E8
xorps %xmm0, %xmm0
cvtsi2sd %rcx, %xmm0
subsd %xmm0, %xmm1
xorps %xmm0, %xmm0
cvtsi2sdq 0x8(%rbx), %xmm0
divsd %xmm2, %xmm0
subsd %xmm0, %xmm1
addsd 0x8(%rax), %xmm1
movsd %xmm1, 0x8(%rax)
jmp 0x5012
movl $0x10, %edi
callq 0x2310
movq %rax, %r12
movq $0x1, (%rax)
imulq $0x3e8, 0x10(%rbx), %rax # imm = 0x3E8
cvtsi2sd %rax, %xmm0
cvtsi2sdq 0x18(%rbx), %xmm1
movsd 0x1524(%rip), %xmm2     # 0x64f8
divsd %xmm2, %xmm1
addsd %xmm0, %xmm1
imulq $0x3e8, (%rbx), %rax    # imm = 0x3E8
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
cvtsi2sdq 0x8(%rbx), %xmm3
subsd %xmm0, %xmm1
divsd %xmm2, %xmm3
subsd %xmm3, %xmm1
movsd %xmm1, 0x8(%r12)
movq %r15, %rdi
movq %r14, %rsi
callq 0x5360
movq %r12, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/time_analysis_tool.cpp
// Function: TimeAnalysis::get_latency(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
double TimeAnalysis::get_latency(string key)
{
	auto it = time_map.find(key);
	if (it == time_map.end())
	{
		return 0;
	}
	else
	{
		struct time_struct* ts = it->second;
		return ts->latency / ts->cnt;
	}
}

// Assembly:
pushq %rax
addq $0x20, %rdi
callq 0x5248
testq %rax, %rax
je 0x505b
movq 0x28(%rax), %rax
movsd 0x8(%rax), %xmm0
movsd (%rax), %xmm1
unpcklps 0xfcf(%rip), %xmm1      # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0xfd7(%rip), %xmm1      # 0x6020
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
addsd %xmm1, %xmm2
divsd %xmm2, %xmm0
jmp 0x505f
xorpd %xmm0, %xmm0
popq %rax
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/dudulu233[P]EMA-Tool/time_analysis_tool.cpp
// Function: TimeAnalysis::print_all_latency()
void TimeAnalysis::print_all_latency()
{
	char shell_str[256];
	strcpy(shell_str, "mkdir -p ./result");
	int ret = system(shell_str);
	assert(0 == ret);

	FILE* fp = fopen("./result/time_analysis.log", "w");
	double total_time = 0;
	for (auto it = time_map.begin();
		it != time_map.end();
		++it)
	{
		struct time_struct* ts = it->second;
		fprintf(fp, "%s : %.6f ms \t\t\t total_time : %.6f ms ( cnt : % llu )\n",
			(it->first).c_str(), ts->latency / ts->cnt,
			ts->latency, ts->cnt);
		total_time += ts->latency;
	}
	fprintf(fp, "---------------------------------------------\n");
	fprintf(fp, "total time-consuming : %.6f minutes\n", total_time / 1000 / 60);
	fclose(fp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x118, %rsp            # imm = 0x118
movq %rdi, %r14
movapd 0x1495(%rip), %xmm0     # 0x6510
leaq 0x10(%rsp), %rdi
movapd %xmm0, (%rdi)
movw $0x74, 0x10(%rdi)
callq 0x21d0
testl %eax, %eax
jne 0x5189
leaq 0x14c2(%rip), %rdi      # 0x6560
leaq 0x13b4(%rip), %rsi      # 0x6459
callq 0x22b0
movq %rax, %rbx
movq 0x30(%r14), %r15
xorpd %xmm0, %xmm0
testq %r15, %r15
je 0x512d
movsd %xmm0, 0x8(%rsp)
leaq 0x14b4(%rip), %r14      # 0x657b
movq 0x8(%r15), %rdx
movq 0x28(%r15), %r12
movsd 0x8(%r12), %xmm1
movq (%r12), %rcx
movq %rcx, %xmm0
punpckldq 0xf29(%rip), %xmm0 # xmm0 = xmm0[0],mem[0],xmm0[1],mem[1]
subpd 0xf31(%rip), %xmm0      # 0x6020
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
movapd %xmm1, %xmm0
divsd %xmm2, %xmm0
movq %rbx, %rdi
movq %r14, %rsi
movb $0x2, %al
callq 0x2340
movsd 0x8(%rsp), %xmm0
addsd 0x8(%r12), %xmm0
movsd %xmm0, 0x8(%rsp)
movq (%r15), %r15
testq %r15, %r15
jne 0x50c7
jmp 0x5133
movsd %xmm0, 0x8(%rsp)
leaq 0x1478(%rip), %rdi      # 0x65b2
movl $0x2e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x2440
movsd 0x8(%rsp), %xmm0
divsd 0x139e(%rip), %xmm0     # 0x64f8
divsd 0x139e(%rip), %xmm0     # 0x6500
leaq 0x1478(%rip), %rsi      # 0x65e1
movq %rbx, %rdi
movb $0x1, %al
callq 0x2340
movq %rbx, %rdi
addq $0x118, %rsp            # imm = 0x118
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2240
leaq 0x1243(%rip), %rdi      # 0x63d3
leaq 0x138b(%rip), %rsi      # 0x6522
leaq 0x139b(%rip), %rcx      # 0x6539
movl $0x47, %edx
callq 0x2150
// File: /workspace/github_cpp_makefile_star2_O1/gauravtewari[P]netlist/netlist.cpp
// Function: trim(char*)
char *trim(char *token){
		char *last;
		
		/* Remove leading spaces from token */
		while(isspace(*token)) token++;
		if(*token == 0) return token;	/* Check if its all spaces */
			
		/* Remove trailing spaces from token */
		last = token + strlen(token) - 1;				/* Got to last non null character of string */
		while(last > token && isspace(*last)) last--;		/* Check all the characters that are space by going back up */
		*(last+1) = '\0';									/* Null terminate the token */
		return token;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
decq %rbx
movb 0x1(%rbx), %bpl
incq %rbx
movsbl %bpl, %edi
callq 0x2070
testl %eax, %eax
jne 0x354b
testb %bpl, %bpl
je 0x3591
movq %rbx, %rdi
callq 0x2110
leaq (%rbx,%rax), %rcx
decq %rcx
movq %rcx, %r14
cmpq %rbx, %rcx
jbe 0x358c
movsbl (%r14), %edi
callq 0x2070
leaq -0x1(%r14), %rcx
testl %eax, %eax
jne 0x3573
movb $0x0, 0x1(%r14)
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/gauravtewari[P]netlist/netlist.cpp
// Function: circuit::add_net(net_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
u32 circuit::add_net(net_t type, string &tag){
	struct net temp;

	/* Check if the edge already exists */
	if(edge_map.find(tag) == edge_map.end()){
		/* Allocate a new net entry */
		struct net temp;
		edge_map[tag]=num_nets;
		temp.id = num_nets;
		temp.weight = 0;
		temp.type = type;
		temp.gates = list<u32>();
		net_list.push_back(temp);
		net_type[temp.type]++;
		num_nets++;
		return temp.id;
	}
	else
	 return edge_map[tag];
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
movabsq $-0x7fffffff00000001, %rbp # imm = 0x80000000FFFFFFFF
leaq 0x48(%rsp), %r13
movq %rbp, -0x10(%r13)
movl $0x5, -0x8(%r13)
xorps %xmm0, %xmm0
movups %xmm0, (%r13)
movq %r13, 0x8(%r13)
movq %r13, (%r13)
movq $0x0, 0x10(%r13)
leaq 0xc0(%rdi), %r12
movq %r12, %rdi
movq %rdx, %rsi
callq 0x4248
leaq 0xc8(%r14), %rcx
cmpq %rcx, %rax
je 0x3959
movq %r12, %rdi
movq %r15, %rsi
callq 0x4046
movl (%rax), %ebp
jmp 0x3a2f
movl %ebx, 0xc(%rsp)
leaq 0x20(%rsp), %rbx
movq %rbp, -0x10(%rbx)
movl $0x5, -0x8(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, 0x8(%rbx)
movq %rbx, (%rbx)
movq $0x0, 0x10(%rbx)
movl 0x4(%r14), %ebp
movq %r12, %rdi
movq %r15, %rsi
callq 0x4046
movl %ebp, (%rax)
movl 0x4(%r14), %eax
movl %eax, 0x10(%rsp)
movl $0x0, 0x14(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x18(%rsp)
leaq 0x60(%rsp), %r15
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
movq %r15, 0x8(%r15)
movq %r15, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x45e4
movq (%r15), %rdi
cmpq %r15, %rdi
je 0x39ee
movq (%rdi), %r12
movl $0x18, %esi
callq 0x2210
movq %r12, %rdi
cmpq %r15, %r12
jne 0x39d9
leaq 0xa8(%r14), %rdi
leaq 0x10(%rsp), %rsi
callq 0x40c2
movl 0x18(%rsp), %eax
incl 0x2c(%r14,%rax,4)
incl 0x4(%r14)
movl 0x10(%rsp), %ebp
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3a2f
movq (%rdi), %r14
movl $0x18, %esi
callq 0x2210
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x3a1a
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x3a4e
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x2210
movq %rbx, %rdi
cmpq %r13, %rbx
jne 0x3a39
movl %ebp, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3a85
movq %rax, %r14
movq 0x20(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3a88
movq (%rdi), %r15
movl $0x18, %esi
callq 0x2210
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x3a6e
jmp 0x3a88
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r13, %rdi
je 0x3aa7
movq (%rdi), %rbx
movl $0x18, %esi
callq 0x2210
movq %rbx, %rdi
cmpq %r13, %rbx
jne 0x3a92
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O1/gauravtewari[P]netlist/netlist.cpp
// Function: circuit::add_gate(unsigned int)
u32 circuit::add_gate(u32 type){
	/* we have to add a new gate to the gates adjacency list */
	struct gate temp;
	temp.id = num_gates;
	temp.type = type;
	temp.fan_out = 0;
	temp.fan_in = 0;
	temp.nets = list<u32>();
	gate_list.push_back(temp);
	
	num_gates++;
	gate_type[temp.type]++;
	return temp.id;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rdi, %r14
leaq 0x10(%rsp), %rbx
pcmpeqd %xmm0, %xmm0
movdqa %xmm0, -0x10(%rbx)
pxor %xmm0, %xmm0
movdqa %xmm0, (%rbx)
movq %rbx, 0x8(%rbx)
movq %rbx, (%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movl (%rdi), %ecx
movl %ecx, -0x10(%rbx)
movl %esi, -0xc(%rbx)
movq %rax, -0x8(%rbx)
leaq 0x30(%rsp), %r15
movdqa %xmm0, (%r15)
movq %rax, 0x10(%r15)
movq %r15, 0x8(%r15)
movq %r15, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x45e4
movq (%r15), %rdi
cmpq %r15, %rdi
je 0x3b2b
movq (%rdi), %r12
movl $0x18, %esi
callq 0x2210
movq %r12, %rdi
cmpq %r15, %r12
jne 0x3b16
leaq 0x90(%r14), %rdi
movq %rsp, %rsi
callq 0x4102
incl (%r14)
movl 0x4(%rsp), %eax
incl 0x8(%r14,%rax,4)
movl (%rsp), %ebp
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3b68
movq (%rdi), %r14
movl $0x18, %esi
callq 0x2210
movq %r14, %rdi
cmpq %rbx, %r14
jne 0x3b53
movl %ebp, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %rbx, %rdi
je 0x3b99
movq (%rdi), %r15
movl $0x18, %esi
callq 0x2210
movq %r15, %rdi
cmpq %rbx, %r15
jne 0x3b84
movq %r14, %rdi
callq 0x2300
nop
// File: /workspace/github_cpp_makefile_star2_O1/gauravtewari[P]netlist/netlist.cpp
// Function: circuit::get_gate_type(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
u32 circuit::get_gate_type(string str){
	u32 size = (u32)gate_t.size();
	if(gate_t.find(str) == gate_t.end())
		gate_t[str]=size;
	return gate_t[str];
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
leaq 0xf0(%rdi), %r14
movq 0x118(%rdi), %r12
movq %r14, %rdi
callq 0x4bea
addq $0xf8, %r15
cmpq %r15, %rax
jne 0x3be0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x413c
movl %r12d, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x413c
movl (%rax), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/gauravtewari[P]netlist/netlist.cpp
// Function: circuit::add_outnet_to_gate(unsigned int, unsigned int)
int circuit::add_outnet_to_gate(u32 gate_id, u32 net_id){
	/* We assume that gate_id and net_id are valid and the corresponding entries exist */
	gate_list[gate_id].nets.push_back(net_id);
	
	/* We can update the fan_out of the gate here but we leave it for later */
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %eax
movq 0x90(%rdi), %rcx
leaq (%rax,%rax,4), %rax
leaq (%rcx,%rax,8), %r14
addq $0x10, %r14
movl $0x18, %edi
callq 0x2200
movl %ebx, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2060
incq 0x10(%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/gauravtewari[P]netlist/netlist.cpp
// Function: circuit::add_gate_to_net(unsigned int, unsigned int)
int circuit::add_gate_to_net(u32 net_id, u32 gate_id){
	
	/* We assume that gate_id and net_id are valid and the corresponding entries exist */
	if(!net_list[net_id].gates.empty()){
		net_type[net_list[net_id].type]--;
		net_list[net_id].type = HYPEREDGE;
		net_type[net_list[net_id].type]++;
	}
	
	net_list[net_id].gates.push_back(gate_id);
	/* We defer the fan_out updation till later */
	/* Fan in is updated here */
	gate_list[gate_id].fan_in ++;
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rdi, %rbx
movl %esi, %eax
movq 0xa8(%rdi), %rcx
leaq (%rax,%rax,4), %rax
leaq (%rcx,%rax,8), %r15
leaq (%rcx,%rax,8), %r14
addq $0x10, %r14
cmpq %r14, (%r14)
je 0x3c79
movl 0x8(%r15), %eax
decl 0x2c(%rbx,%rax,4)
movl $0x3, 0x8(%r15)
incl 0x38(%rbx)
movl $0x18, %edi
callq 0x2200
movl %ebp, 0x10(%rax)
movq %rax, %rdi
movq %r14, %rsi
callq 0x2060
incq 0x20(%r15)
movl %ebp, %eax
movq 0x90(%rbx), %rcx
leaq (%rax,%rax,4), %rax
incl 0x8(%rcx,%rax,8)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH03_StringsVectorsAndArrays/examples/square.cc
// Function: main
int main()
{
	vector<int> v{1,2,3,4,5,6,7,8,9};
	for (auto &i : v) // for each element in v (note: i is a reference)
		i *= i;           // square the element value
	for (auto i : v)      // for each element in v
		cout << i << " "; // print the element
	cout << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x50, %rsp
movups 0xda2(%rip), %xmm0      # 0x2014
leaq -0x70(%rbp), %rsi
movaps %xmm0, 0x10(%rsi)
movups 0xd83(%rip), %xmm0      # 0x2004
movaps %xmm0, (%rsi)
movl $0x9, 0x20(%rsi)
leaq -0x40(%rbp), %rbx
leaq -0x21(%rbp), %rcx
movl $0x9, %edx
movq %rbx, %rdi
callq 0x136c
movq (%rbx), %r15
movq 0x8(%rbx), %r12
cmpq %r12, %r15
je 0x12bf
movq %r15, %rax
movl (%rax), %ecx
imull %ecx, %ecx
movl %ecx, (%rax)
addq $0x4, %rax
cmpq %r12, %rax
jne 0x12af
cmpq %r12, %r15
je 0x12f6
movq 0x2d0d(%rip), %rbx      # 0x3fd8
leaq 0xd56(%rip), %r14       # 0x2028
movl (%r15), %esi
movq %rbx, %rdi
callq 0x10f0
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x10c0
addq $0x4, %r15
cmpq %r12, %r15
jne 0x12d2
movq 0x2cdb(%rip), %rdi      # 0x3fd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x1090
movsbl %al, %esi
movq 0x2cc0(%rip), %rdi      # 0x3fd8
callq 0x1030
movq %rax, %rdi
callq 0x1060
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x133a
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x10b0
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x134b
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x1363
movq -0x30(%rbp), %rsi
subq %rdi, %rsi
callq 0x10b0
movq %rbx, %rdi
callq 0x1100
nop
// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH14_OverloadedOperationsAndConversions/examples/readStr.cc
// Function: main
int main()
{
	vector<string> vs;
	ReadLine rl(cin);    // object that read lines from cin
	string s;
	while (rl(s))        // store what rl reads into s
		vs.push_back(s);

	cout << "read : " << vs.size() << " elements" << endl;
	PrintString printer;   // uses the defaults; prints to cout
	printer(s);            // prints s followed by a space on cout

	PrintString errors(cerr, '\n');
	errors(s);             // prints s followed by a newline on cerr

	cerr << "for_each printing to cerr" << endl;
	for_each(vs.begin(), vs.end(), PrintString(cerr, '\n'));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
xorps %xmm0, %xmm0
leaq -0x60(%rbp), %rbx
movaps %xmm0, (%rbx)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
leaq -0x38(%rbp), %r12
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
movq 0x2cd3(%rip), %r14      # 0x3fd8
leaq -0x48(%rbp), %r15
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x1170
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1346
movq %rbx, %rdi
movq %r15, %rsi
callq 0x14c0
jmp 0x1309
movq 0x2c7b(%rip), %rdi      # 0x3fc8
leaq 0xcb0(%rip), %rsi       # 0x2004
movl $0x7, %edx
callq 0x1110
movq -0x58(%rbp), %rsi
subq -0x60(%rbp), %rsi
sarq $0x5, %rsi
movq 0x2c57(%rip), %rdi      # 0x3fc8
callq 0x1080
movq %rax, %rbx
leaq 0xc8c(%rip), %rsi       # 0x200c
movl $0x9, %edx
movq %rax, %rdi
callq 0x1110
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2c05(%rip), %rdi      # 0x3fc8
callq 0x1110
leaq -0x21(%rbp), %rsi
movb $0x20, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x1110
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq 0x2c05(%rip), %rdi      # 0x3ff0
callq 0x1110
leaq -0x21(%rbp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x1110
movq 0x2be5(%rip), %rbx      # 0x3ff0
leaq 0xc04(%rip), %rsi       # 0x2016
movl $0x19, %edx
movq %rbx, %rdi
callq 0x1110
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x10e0
movsbl %al, %esi
movq 0x2bb3(%rip), %rdi      # 0x3ff0
callq 0x1030
movq %rax, %rdi
callq 0x1090
movq -0x60(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq 0x2b97(%rip), %rdx      # 0x3ff0
movl $0xa, %ecx
callq 0x150c
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x1478
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1100
leaq -0x60(%rbp), %rdi
callq 0x1570
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1496
jmp 0x1496
jmp 0x1496
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r12, %rdi
je 0x14ae
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x1100
leaq -0x60(%rbp), %rdi
callq 0x1570
movq %rbx, %rdi
callq 0x1150
nop
// File: /workspace/github_cpp_makefile_star2_O1/cgvwzq[P]aes_bf/src/aes-brute-force.cpp
// Function: is_hexdigit(char)
int hexdigit_value(char c)
{
	int nibble = -1;
	if (('0'<=c) && (c<='9'))
	{
		nibble = c-'0';
	}
	if (('a'<=c) && (c<='f'))
	{
		nibble = c-'a' + 10;
	}
	if (('A'<=c) && (c<='F'))
	{
		nibble = c-'A' + 10;
	}
	return nibble;
}

// Assembly:
leal -0x30(%rdi), %eax
leal -0x30(%rdi), %ecx
cmpb $0xa, %al
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovbl %ecx, %eax
leal -0x61(%rdi), %ecx
leal -0x57(%rdi), %edx
cmpb $0x6, %cl
cmovael %eax, %edx
leal -0x41(%rdi), %eax
addl $-0x37, %edi
cmpb $0x6, %al
cmovael %edx, %edi
xorl %eax, %eax
cmpl $-0x1, %edi
setne %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/cgvwzq[P]aes_bf/src/aes-brute-force.cpp
// Function: hexstr_to_bytes(unsigned char*, unsigned long, char*)
size_t hexstr_to_bytes(uint8_t *dst, size_t dst_size, char *hexstr)
{
	unsigned int len = strlen(hexstr);
	if (dst_size > (len/2))
	{
		dst_size = (len/2);
	}
	memset (dst,0,dst_size);
	for (unsigned int i=0; i < dst_size*2; i++)
	{
		unsigned int shift = 4 - 4 * (i & 1);
		unsigned int charIndex = i; //len-1-i;
		char c = hexstr[charIndex];
		uint8_t nibble = hexdigit_value (c);
		dst[i/2] |= nibble << shift;
	}
	return dst_size;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rdx, %rdi
callq 0x2070
shrl %eax
cmpq %rbx, %rax
cmovbq %rax, %rbx
movq %r15, %rdi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x20b0
testq %rbx, %rbx
je 0x246b
leal (%rbx,%rbx), %eax
xorl %edx, %edx
movl $0xff, %esi
xorl %edi, %edi
movl %edx, %ecx
notb %cl
andb $0x4, %cl
movb (%r14,%rdi), %r8b
leal -0x30(%r8), %r9d
cmpb $0xa, %r9b
movzbl %r9b, %r9d
cmovael %esi, %r9d
leal -0x61(%r8), %r10d
leal -0x57(%r8), %r11d
cmpb $0x6, %r10b
movzbl %r11b, %r10d
cmovael %r9d, %r10d
leal -0x41(%r8), %r9d
addb $-0x37, %r8b
cmpb $0x6, %r9b
movzbl %r8b, %r8d
cmovael %r10d, %r8d
shlb %cl, %r8b
movl %edi, %ecx
shrl %ecx
orb %r8b, (%r15,%rcx)
incq %rdi
addb $0x4, %dl
cmpq %rdi, %rax
jne 0x2412
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq