LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::TurbGen_printf(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ...)
void TurbGen_printf(std::string format, ...) {
        // ******************************************************
        // special printf prepends string and only lets PE=0 print
        // ******************************************************
        va_list args;
        va_start(args, format);
        std::string new_format = ClassSignature+format;
        if (PE == 0) vfprintf(stdout, new_format.c_str(), args);
        va_end(args);
    }

// Assembly:
pushq %rbx
subq $0xf0, %rsp
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x40(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x7a4e
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movq %rsi, 0x10(%rsp)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x8(%rdi), %rsi
leaq 0x20(%rsp), %rdi
movq %r10, %rdx
callq 0xb9ad
cmpl $0x0, 0x150(%rbx)
jne 0x7a9f
movq 0xa519(%rip), %rax      # 0x11fa8
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x3360
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7aba
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
addq $0xf0, %rsp
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::set_number_of_components()
void set_number_of_components(void) {
        // error check on user setting of ndim
        if ((ndim != 1) && (ndim != 1.5) && (ndim != 2) && (ndim != 2.5) && (ndim != 3)) {
            TurbGen_printf("ERROR: number of dimensions must be in [1, 1.5, 2, 2.5, 3].\n");
            exit(-1);
        }
        // set the number of vector field components
        if (ndim == 1) ncmp = 1;
        if (ndim == 2) ncmp = 2;
        if ((ndim == 1.5) || (ndim == 2.5) || (ndim == 3)) ncmp = 3;
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %rbx
movsd 0x158(%rdi), %xmm0
ucomisd 0x561a(%rip), %xmm0     # 0xe028
jne 0x8a12
jnp 0x8a42
ucomisd 0x5666(%rip), %xmm0     # 0xe080
jne 0x8a1e
jnp 0x8a42
ucomisd 0x560a(%rip), %xmm0     # 0xe030
jne 0x8a2a
jnp 0x8a42
ucomisd 0x5616(%rip), %xmm0     # 0xe048
jne 0x8a36
jnp 0x8a42
ucomisd 0x5632(%rip), %xmm0     # 0xe070
jne 0x8aa6
jp 0x8aa6
ucomisd 0x55fe(%rip), %xmm0     # 0xe048
jne 0x8a58
jp 0x8a58
movl $0x1, 0x160(%rbx)
ucomisd 0x55d0(%rip), %xmm0     # 0xe030
jne 0x8a6e
jp 0x8a6e
movl $0x2, 0x160(%rbx)
ucomisd 0x55b2(%rip), %xmm0     # 0xe028
jne 0x8a7a
jnp 0x8a92
ucomisd 0x55ee(%rip), %xmm0     # 0xe070
jne 0x8a86
jnp 0x8a92
ucomisd 0x55f2(%rip), %xmm0     # 0xe080
jne 0x8a9c
jp 0x8a9c
movl $0x3, 0x160(%rbx)
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x10(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x5d2b(%rip), %rsi      # 0xe7e1
leaq 0x5d60(%rip), %rdx      # 0xe81d
movq %rsp, %r14
movq %r14, %rdi
callq 0xbba2
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x79ea
movq %rsp, %rdi
callq 0x3140
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x3300
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r15, %rdi
je 0x8b00
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32a0
movq %rbx, %rdi
callq 0x3480
// File: /workspace/github_cpp_makefile_star2_O1/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::OU_noise_init()
void OU_noise_init(void) {
        // ******************************************************
        // initialize pseudo random sequence for the Ornstein-Uhlenbeck (OU) process
        // ******************************************************
        OUphases.resize(nmodes*ncmp*2);
        for (int m = 0; m < nmodes; m++) {
            for (int d = 0; d < ncmp; d++) {
                for (int ir = 0; ir < 2; ir++) {
                    OUphases[2*ncmp*m+2*d+ir] = OUvar * get_random_number();
                }
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
addq $0x120, %rdi            # imm = 0x120
movl 0x154(%rbx), %eax
imull 0x160(%rbx), %eax
addl %eax, %eax
movslq %eax, %rsi
callq 0xba08
cmpl $0x0, 0x154(%rbx)
jle 0xa886
xorl %r14d, %r14d
cmpl $0x0, 0x160(%rbx)
jle 0xa87a
xorl %ebp, %ebp
xorl %r15d, %r15d
movsd 0x1b0(%rbx), %xmm0
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0xc40c
mulsd (%rsp), %xmm0
movl 0x160(%rbx), %eax
imull %r14d, %eax
addl %ebp, %eax
addl %eax, %eax
cltq
addq %r15, %rax
movq 0x120(%rbx), %rcx
movsd %xmm0, (%rcx,%rax,8)
incq %r15
cmpl $0x1, %r15d
je 0xa82e
incl %ebp
cmpl 0x160(%rbx), %ebp
jl 0xa82b
incl %r14d
cmpl 0x154(%rbx), %r14d
jl 0xa820
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::get_random_number()
double get_random_number(void) {
        // ******************************************************
        //  get random number; draws a number randomly from a Gaussian distribution
        //  with the standard uniform distribution function "ran1s"
        //  using the Box-Muller transformation in polar coordinates. The
        //  resulting Gaussian has unit variance.
        // ******************************************************
        double r1 = ran1s(&seed);
        double r2 = ran1s(&seed);
        double g1 = sqrt(2.0*log(1.0/r1))*cos(2*M_PI*r2);
        return g1;
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x168(%rdi), %r14
movq %r14, %rsi
callq 0xc490
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0xc490
movsd %xmm0, 0x10(%rsp)
movsd 0x1c04(%rip), %xmm0     # 0xe048
divsd 0x8(%rsp), %xmm0
callq 0x3220
addsd %xmm0, %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0xc463
sqrtsd %xmm0, %xmm0
jmp 0xc468
callq 0x3210
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x1c1c(%rip), %xmm0     # 0xe098
callq 0x34e0
mulsd 0x8(%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::ran1s(int*)
double ran1s(int * idum) {
        // ******************************************************
        static const int IA=16807, IM=2147483647, IQ=127773, IR=2836;
        static const double AM=1.0/IM, RNMX=1.0-1.2e-7;
        if (*idum <= 0) *idum = std::max(-*idum, 1);
        int k = *idum/IQ;
        *idum = IA*(*idum-k*IQ)-IR*k;
        if (*idum < 0) *idum = *idum+IM;
        int iy = *idum;
        double ret = std::min(AM*iy, RNMX); // returns uniform random number in [0,1[
        return ret;
    }

// Assembly:
movl (%rsi), %eax
testl %eax, %eax
jg 0xc4a5
negl %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movl %ecx, (%rsi)
movslq (%rsi), %rax
imulq $-0x7cb1f4a1, %rax, %rcx # imm = 0x834E0B5F
shrq $0x20, %rcx
addl %eax, %ecx
movl %ecx, %edx
shrl $0x1f, %edx
sarl $0x10, %ecx
addl %edx, %ecx
imull $0xfffe0ce3, %ecx, %edx # imm = 0xFFFE0CE3
addl %eax, %edx
imull $0x41a7, %edx, %eax     # imm = 0x41A7
imull $0xfffff4ec, %ecx, %ecx # imm = 0xFFFFF4EC
leal (%rax,%rcx), %edx
addl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
addl %ecx, %eax
cmovnsl %eax, %edx
cvtsi2sd %edx, %xmm1
mulsd 0x1beb(%rip), %xmm1     # 0xe0d8
movl %edx, (%rsi)
movsd 0x1bd9(%rip), %xmm0     # 0xe0d0
minsd %xmm1, %xmm0
retq
// File: /workspace/github_cpp_makefile_star2_O1/chfeder[P]turbulence_generator/./TurbGen.h
// Function: TurbGen::TurbGen_printf_raw(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, ...)
void TurbGen_printf_raw(std::string format, ...) {
        // ******************************************************
        // special printf prepends string and only lets PE=0 print
        // ******************************************************
        va_list args;
        va_start(args, format);
        std::string new_format = format;
        if (PE == 0) vfprintf(stdout, new_format.c_str(), args);
        va_end(args);
    }

// Assembly:
pushq %r14
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %rbx
leaq 0x40(%rsp), %rdi
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0xd167
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movq %rdi, 0x10(%rsp)
leaq 0x110(%rsp), %rax
movq %rax, 0x8(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x30(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
leaq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0xdf02
cmpl $0x0, 0x150(%rbx)
jne 0xd1c7
movq 0x4df1(%rip), %rax      # 0x11fa8
movq (%rax), %rdi
movq 0x20(%rsp), %rsi
movq %rsp, %rdx
callq 0x3360
movq 0x20(%rsp), %rdi
cmpq %r14, %rdi
je 0xd1de
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32a0
addq $0xf8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/./thumbsim.hpp
// Function: Cache::printStats() const
void printStats() const {
         cout << dec << size << " byte cache (blocksize " << dec << blocksize
            << " bytes): " << hits << " hits, " << misses << " misses (hit rate: " 
                              << (static_cast<float>(hits) * 100.0f /
                                    static_cast<float>(hits + misses)) << "%)" << endl;
      }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x60c7(%rip), %rdi      # 0x8fd0
movq (%rdi), %rax
movq -0x18(%rax), %rax
movl 0x18(%rdi,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%rdi,%rax)
movl (%rbx), %esi
callq 0x20c0
movq %rax, %r14
leaq 0x31d2(%rip), %rsi      # 0x6101
movl $0x17, %edx
movq %rax, %rdi
callq 0x2170
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x2, %ecx
movl %ecx, 0x18(%r14,%rax)
movl 0x4(%rbx), %esi
movq %r14, %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x31b1(%rip), %rsi      # 0x6119
movl $0x9, %edx
movq %rax, %rdi
callq 0x2170
movl 0x20(%rbx), %esi
movq %r14, %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x3199(%rip), %rsi      # 0x6123
movl $0x7, %edx
movq %rax, %rdi
callq 0x2170
movl 0x24(%rbx), %esi
movq %r14, %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x317f(%rip), %rsi      # 0x612b
movl $0x13, %edx
movq %rax, %rdi
callq 0x2170
movl 0x20(%rbx), %eax
cvtsi2ss %rax, %xmm0
movl 0x24(%rbx), %ecx
addl %eax, %ecx
cvtsi2ss %rcx, %xmm1
mulss 0x3069(%rip), %xmm0     # 0x603c
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movq %r14, %rdi
callq 0x21e0
movq %rax, %rbx
leaq 0x3152(%rip), %rsi      # 0x613f
movl $0x2, %edx
movq %rax, %rdi
callq 0x2170
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x20d0
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(ALL_Types)
Thumb_Types decode (const ALL_Types data) {
  if (data.type.alu.instr.class_type.type_check == ALU_TYPE) {
    return ALU;
  }
  else if (data.type.dp.instr.class_type.type_check == DP_TYPE) {
    return DP;
  }
  else if (data.type.sp.instr.class_type.type_check == SP_TYPE) {
    return SPECIAL;
  }
  else if (data.type.uncond.instr.class_type.type_check == UNCOND_TYPE) {
    return UNCOND;
  }
  else if (data.type.bl.instr.class_type.type_check == BL_TYPE) {
    return BL;
  }
  else if (data.type.misc.instr.class_type.type_check == MISC_TYPE) {
    return MISC;
  }
  else if (data.type.cond.instr.class_type.type_check == COND_TYPE) {
    return COND;
  }
  else if (data.type.ldm.instr.class_type.type_check == LDM_TYPE) {
    return LDM;
  }
  else if (data.type.stm.instr.class_type.type_check == STM_TYPE) {
    return STM;
  }
  else if (data.type.ldrl.instr.class_type.type_check == LDRL_TYPE) {
    return LDRL;
  }
  else if (data.type.addsp.instr.class_type.type_check == ADD_SP_TYPE) {
    return ADD_SP;
  }
  else {
    if (data.type.ld_st.instr.class_type.opA == LD_ST_REG_OPA) {
    }
    else if (data.type.ld_st.instr.class_type.opA == LD_ST_IMM_OPA) {
    }
    else if (data.type.ld_st.instr.class_type.opA == LD_ST_IMMB_OPA) {
    }
    else if (data.type.ld_st.instr.class_type.opA == LD_ST_IMMH_OPA) {
    }
    else if (data.type.ld_st.instr.class_type.opA == LD_ST_IMMSP_OPA) {
    }
    else {
      cout << "NO TYPE FOUND" << endl;
      return ERROR_TYPE;
    }
    return LD_ST;
  }
}

// Assembly:
movzwl %di, %ecx
xorl %eax, %eax
cmpl $0x4000, %ecx           # imm = 0x4000
jae 0x3036
retq
movl %ecx, %eax
shrl $0xa, %eax
cmpw $0x10, %ax
je 0x304c
cmpl $0x11, %eax
jne 0x3052
movl $0x2, %eax
retq
movl $0x1, %eax
retq
movl %ecx, %eax
shrl $0xb, %eax
cmpw $0x1c, %ax
je 0x3068
cmpl $0x1e, %eax
jne 0x306e
movl $0xb, %eax
retq
movl $0x6, %eax
retq
shrl $0xc, %ecx
cmpw $0xb, %cx
je 0x3082
cmpl $0xd, %ecx
jne 0x3088
movl $0x5, %eax
retq
movl $0x4, %eax
retq
movzwl %ax, %eax
cmpl $0x17, %eax
jg 0x30a0
cmpl $0x9, %eax
je 0x30fa
cmpl $0x15, %eax
jne 0x30b0
movl $0xa, %eax
retq
cmpl $0x19, %eax
je 0x3100
cmpl $0x18, %eax
jne 0x30b0
movl $0x8, %eax
retq
movzwl %cx, %ecx
addl $-0x5, %ecx
movl $0x3, %eax
cmpw $0x5, %cx
jb 0x3035
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq 0x5efe(%rip), %rbx      # 0x8fd0
leaq 0x3103(%rip), %rsi      # 0x61dc
movl $0xd, %edx
movq %rbx, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2090
movl $0xc, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl $0x9, %eax
retq
movl $0x7, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(DP_Type)
DP_Ops decode (const DP_Type data) {
  if (data.instr.DP_Instr.op == DP_CMP) {
    // 315: insert code here to print cmp instruction
    return DP_CMP;
  }
  else {
    cerr << "UNKNOWN DP TYPE -- Exiting" << endl;
    exit(1);
  }
}

// Assembly:
andl $0x3c0, %edi            # imm = 0x3C0
cmpl $0x280, %edi            # imm = 0x280
jne 0x33e0
movl $0xa, %eax
retq
pushq %rbp
movq %rsp, %rbp
movq 0x5c05(%rip), %rdi      # 0x8ff0
leaq 0x2e36(%rip), %rsi      # 0x6228
callq 0x2130
movq %rax, %rdi
callq 0x2090
movl $0x1, %edi
callq 0x2180
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(COND_Type)
int decode (const COND_Type data) {
  // complete
  if (opts.instrs) { 
    cout << "b";
    printCond(data.instr.b.cond);
    // consider calling your sign extension function here to get the 
    // printout to be consistent
    cout << " 0x" << hex << rf[15] + 2*(int)((char)(data.instr.b.imm))+2 << endl;
  }
  return COND;
}

// Assembly:
leaq 0x51c0(%rip), %rax      # 0x91d4
cmpb $0x1, 0x2(%rax)
jne 0x41db
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movq 0x4fa2(%rip), %r14      # 0x8fd0
leaq 0x2296(%rip), %rsi      # 0x62cb
movl $0x1, %edx
movq %r14, %rdi
callq 0x2170
movzwl %bx, %eax
shrl $0x8, %eax
movl %eax, %ecx
andb $0xf, %cl
cmpb $0xd, %cl
ja 0x41e1
andl $0xf, %eax
leaq 0x2128(%rip), %rcx      # 0x6188
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x4f60(%rip), %rdi      # 0x8fd0
leaq 0x226f(%rip), %rsi      # 0x62e6
jmp 0x4156
movq 0x4f4d(%rip), %rdi      # 0x8fd0
leaq 0x227d(%rip), %rsi      # 0x6307
jmp 0x4156
movq 0x4f3a(%rip), %rdi      # 0x8fd0
leaq 0x2255(%rip), %rsi      # 0x62f2
jmp 0x4156
movq 0x4f27(%rip), %rdi      # 0x8fd0
leaq 0x225a(%rip), %rsi      # 0x630a
jmp 0x4156
movq 0x4f14(%rip), %rdi      # 0x8fd0
leaq 0x223e(%rip), %rsi      # 0x6301
jmp 0x4156
movq 0x4f01(%rip), %rdi      # 0x8fd0
leaq 0x2216(%rip), %rsi      # 0x62ec
jmp 0x4156
movq 0x4ef1(%rip), %rdi      # 0x8fd0
leaq 0x2209(%rip), %rsi      # 0x62ef
jmp 0x4156
movq 0x4ee1(%rip), %rdi      # 0x8fd0
leaq 0x2205(%rip), %rsi      # 0x62fb
jmp 0x4156
movq 0x4ed1(%rip), %rdi      # 0x8fd0
leaq 0x21e3(%rip), %rsi      # 0x62e9
jmp 0x4156
movq 0x4ec1(%rip), %rdi      # 0x8fd0
leaq 0x21df(%rip), %rsi      # 0x62f5
jmp 0x4156
movq 0x4eb1(%rip), %rdi      # 0x8fd0
leaq 0x21e7(%rip), %rsi      # 0x630d
jmp 0x4156
movq 0x4ea1(%rip), %rdi      # 0x8fd0
leaq 0x21c2(%rip), %rsi      # 0x62f8
jmp 0x4156
movq 0x4e91(%rip), %rdi      # 0x8fd0
leaq 0x21be(%rip), %rsi      # 0x6304
jmp 0x4156
movq 0x4e81(%rip), %rdi      # 0x8fd0
leaq 0x21a8(%rip), %rsi      # 0x62fe
movl $0x2, %edx
callq 0x2170
leaq 0x2167(%rip), %rsi      # 0x62ce
movl $0x3, %edx
movq %r14, %rdi
callq 0x2170
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
leaq 0x5016(%rip), %rdi      # 0x91a8
movl $0xf, %esi
callq 0x46ec
movsbl %bl, %ecx
leal (%rax,%rcx,2), %esi
addl $0x2, %esi
movq %r14, %rdi
callq 0x20c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
popq %rbx
popq %r14
popq %rbp
movl $0x5, %eax
retq
movq 0x4de8(%rip), %rdi      # 0x8fd0
leaq 0x2124(%rip), %rsi      # 0x6313
xorl %edx, %edx
jmp 0x415b
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(UNCOND_Type)
int decode (const UNCOND_Type data) {
  // complete
  if (opts.instrs) { 
    // consider calling your sign extension function here to get the 
    // printout to be consistent
    cout << "b 0x" << hex << rf[15] + 2*(int)((char)(data.instr.b.imm))+2 << endl;
  }
  return UNCOND;
}

// Assembly:
leaq 0x4fd7(%rip), %rax      # 0x91d4
cmpb $0x1, 0x2(%rax)
jne 0x4292
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movq 0x4db9(%rip), %r14      # 0x8fd0
leaq 0x20af(%rip), %rsi      # 0x62cd
movl $0x4, %edx
movq %r14, %rdi
callq 0x2170
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
leaq 0x4f5f(%rip), %rdi      # 0x91a8
movl $0xf, %esi
callq 0x46ec
movsbl %bl, %ecx
leal (%rax,%rcx,2), %esi
addl $0x2, %esi
movq %r14, %rdi
callq 0x20c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
popq %rbx
popq %r14
popq %rbp
movl $0x6, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(BL_Type)
BL_Ops decode (const BL_Type data) {
  // complete
  if (opts.instrs) { 
    cout << "bl 0x" << hex << data.instr.bl_upper.imm10 << endl;
  }
  return BL_UPPER;
}

// Assembly:
leaq 0x4f35(%rip), %rax      # 0x91d4
cmpb $0x1, 0x2(%rax)
jne 0x431f
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movq 0x4d1b(%rip), %r14      # 0x8fd0
leaq 0x2016(%rip), %rsi      # 0x62d2
movl $0x5, %edx
movq %r14, %rdi
callq 0x2170
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
andl $0x3ff, %ebx            # imm = 0x3FF
movq %r14, %rdi
movq %rbx, %rsi
callq 0x20c0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
popq %rbx
popq %r14
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/decode.cpp
// Function: decode(ADD_SP_Type)
int decode (const ADD_SP_Type data) {
  // complete
  if (opts.instrs) { 
    cout << "add r" << data.instr.add.rd << ", sp, #" << data.instr.add.imm*4 << endl;
  }
  return ADD_SP;
}

// Assembly:
leaq 0x4e8a(%rip), %rax      # 0x91d4
cmpb $0x1, 0x2(%rax)
jne 0x43db
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
movq 0x4c6c(%rip), %r14      # 0x8fd0
leaq 0x1f6d(%rip), %rsi      # 0x62d8
movl $0x5, %edx
movq %r14, %rdi
callq 0x2170
movl %ebx, %esi
shrl $0x8, %esi
andl $0x7, %esi
movq %r14, %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x1f4c(%rip), %rsi      # 0x62de
movl $0x7, %edx
movq %rax, %rdi
callq 0x2170
movzbl %bl, %esi
shll $0x2, %esi
movq %r14, %rdi
callq 0x2210
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
popq %rbx
popq %r14
popq %rbp
movl $0xa, %eax
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/thumbsim_driver.cpp
// Function: Memory<Data8, Data32>::write(unsigned int, Data32)
void Memory<Data8, Data32>::write(const unsigned int addr, const Data32 data) {
  // data is in native format
  //   if little-endian, 3210 (MSB=3)
  // memory is in big-endian format (0123, MSB=0)
  int i;
  unsigned int myAddr = addr - base;
  if (size() < myAddr + 4) {
    m.resize(myAddr + 4, 0);
  }
  if (myAddr < lowest) lowest = myAddr;
  if (myAddr > highest) highest = myAddr;
  if (opts.writes) {
    cout << hex << addr << ": " << data << " ( ";
    for (i = 0 ; i < 4 ; i++) {
      cout << static_cast<unsigned int>(data.data_ubyte4(i)) << ' ';
    }
    cout << ")" << endl;
  }
  for (i = 0 ; i < 4 ; i++) {
    m[myAddr+i] = Data8(data.data_ubyte4(i));
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movl %esi, %r12d
movq %rdi, %rbx
movl %edx, -0x30(%rbp)
movl 0x8(%rdi), %ecx
movl %esi, %r13d
subl 0x18(%rdi), %r13d
subl (%rdi), %ecx
leal 0x4(%r13), %eax
cmpl %ecx, %eax
jbe 0x4423
movl %eax, %esi
leaq -0x2a(%rbp), %rdx
movb $0x0, (%rdx)
movq %rbx, %rdi
callq 0x4c22
cmpl 0x1c(%rbx), %r13d
jae 0x442d
movl %r13d, 0x1c(%rbx)
cmpl 0x20(%rbx), %r13d
jbe 0x4437
movl %r13d, 0x20(%rbx)
leaq 0x4d96(%rip), %rax      # 0x91d4
cmpb $0x1, 0x3(%rax)
jne 0x4513
movq 0x4b81(%rip), %r14      # 0x8fd0
movq (%r14), %rax
movq -0x18(%rax), %rax
movl 0x18(%r14,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r14,%rax)
movl %r12d, %esi
movq %r14, %rdi
callq 0x20c0
movq %rax, %r12
leaq 0x1ca5(%rip), %rsi      # 0x6120
movl $0x2, %edx
movq %rax, %rdi
callq 0x2170
movl %r15d, %esi
movq %r12, %rdi
callq 0x20c0
leaq 0x1e76(%rip), %rsi      # 0x6310
movl $0x3, %edx
movq %rax, %rdi
callq 0x2170
movl $0x4, %r12d
leaq -0x29(%rbp), %r15
movzbl -0x31(%rbp,%r12), %esi
movq %r14, %rdi
callq 0x20c0
movb $0x20, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2170
decq %r12
jne 0x44b1
leaq 0x1c61(%rip), %rsi      # 0x6140
movl $0x1, %edx
movq %r14, %rdi
callq 0x2170
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl $0x4, %eax
movb -0x31(%rbp,%rax), %cl
movl %r13d, %edx
movq (%rbx), %rsi
movb %cl, (%rsi,%rdx)
incl %r13d
decq %rax
jne 0x4518
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/thumbsim_driver.cpp
// Function: Memory<Data16, Data16>::write(unsigned int, Data16)
void Memory<Data16, Data16>::write(const unsigned int addr, const Data16 data) {
  // data is in native format
  int i;
  unsigned short myAddr = addr - base;
  if (size() < myAddr + 2) {
    m.resize(myAddr + 2, 0);
  }
  if (myAddr < lowest) lowest = myAddr;
  if (myAddr > highest) highest = myAddr;
  if (opts.writes) {
    cout << hex << addr << ": " << data << " ( ";
    for (i = 0 ; i < 2 ; i++) {
      cout << static_cast<unsigned int>(data.data_ubyte2(i)) << ' ';
    }
    cout << ")" << endl;
  }

  m[myAddr] = data;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movl %esi, %r12d
movq %rdi, %r14
movw %bx, -0x2c(%rbp)
movl %esi, %eax
subl 0x18(%rdi), %eax
movq 0x8(%rdi), %rcx
subq (%rdi), %rcx
shrq %rcx
movzwl %ax, %r13d
leal 0x2(%r13), %eax
cmpl %ecx, %eax
jbe 0x4587
movl %eax, %esi
leaq -0x32(%rbp), %rdx
movw $0x0, (%rdx)
movq %r14, %rdi
callq 0x4c58
cmpl 0x1c(%r14), %r13d
jae 0x4591
movl %r13d, 0x1c(%r14)
cmpl 0x20(%r14), %r13d
jbe 0x459b
movl %r13d, 0x20(%r14)
leaq 0x4c32(%rip), %rax      # 0x91d4
cmpb $0x1, 0x3(%rax)
jne 0x467b
movq 0x4a1d(%rip), %r15      # 0x8fd0
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movl %r12d, %esi
movq %r15, %rdi
callq 0x20c0
movq %rax, %r12
leaq 0x1b41(%rip), %rsi      # 0x6120
movl $0x2, %edx
movq %rax, %rdi
callq 0x2170
movl %ebx, -0x30(%rbp)
movzwl %bx, %esi
movq %r12, %rdi
callq 0x20c0
leaq 0x1d0f(%rip), %rsi      # 0x6310
movl $0x3, %edx
movq %rax, %rdi
callq 0x2170
movl $0x1, %ebx
leaq -0x29(%rbp), %r12
movzbl -0x2c(%rbp,%rbx), %esi
movq %r15, %rdi
callq 0x20c0
movb $0x20, -0x29(%rbp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2170
decq %rbx
je 0x4617
leaq 0x1afc(%rip), %rsi      # 0x6140
movl $0x1, %edx
movq %r15, %rdi
callq 0x2170
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
movl -0x30(%rbp), %ebx
movq (%r14), %rax
movl %r13d, %ecx
movw %bx, (%rax,%rcx,2)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/thumbsim_driver.cpp
// Function: Memory<Data8, Data32>::dump(DataType) const
void Memory<Data8, Data32>::dump(DataType dt) const {
  Data32 d(0);
  unsigned int addr;
  for (addr = lowest ; addr <= highest + 3 ; addr++) {
    unsigned int byte = addr & 0x3;
    d.set_data_ubyte4(byte, m[addr]);
    if ((byte == 0x3) && (dt == INSTRUCTIONS)) {
      cout << hex << d << endl;
    } else if ((byte == 0x3) && (dt == DATA) && (d.data_uint() != 0)) {
      cout << hex << addr - 3 + getBase() << ": " << d << endl;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, -0x30(%rbp)
movl $0x0, -0x2c(%rbp)
movl 0x1c(%rdi), %r12d
movl 0x20(%rdi), %eax
addl $0x3, %eax
cmpl %eax, %r12d
ja 0x4814
movq %rdi, %r14
movq 0x489c(%rip), %r15      # 0x8fd0
movl -0x30(%rbp), %eax
xorl $0x1, %eax
movl %eax, -0x34(%rbp)
movl %r12d, %eax
andl $0x3, %eax
movl %r12d, %ecx
movq (%r14), %rdx
movb (%rdx,%rcx), %cl
movq %rax, %rdx
xorq $0x3, %rdx
movb %cl, -0x2c(%rbp,%rdx)
xorl $0x3, %eax
movl -0x30(%rbp), %ecx
orl %eax, %ecx
jne 0x4780
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movl -0x2c(%rbp), %ebx
movq %r15, %r13
jmp 0x47cd
orl -0x34(%rbp), %eax
jne 0x4801
movl -0x2c(%rbp), %ebx
testl %ebx, %ebx
je 0x4801
movq (%r15), %rax
movq -0x18(%rax), %rax
movl 0x18(%r15,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, 0x18(%r15,%rax)
movl 0x18(%r14), %eax
leal (%r12,%rax), %esi
addl $-0x3, %esi
movq %r15, %rdi
callq 0x20c0
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
leaq 0x1958(%rip), %rsi      # 0x6120
callq 0x2170
movl %ebx, %esi
movq %r13, %rdi
callq 0x20c0
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2120
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20d0
incl %r12d
movl 0x20(%r14), %eax
addl $0x3, %eax
cmpl %eax, %r12d
jbe 0x473d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/parse.cpp
// Function: parse(char const*)
void parse(const char * file) {
  ifstream in(file);
  string s;
  unsigned int addr;
  in >> hex;                    // in takes hex numbers
  in >> s;
  if (s != "PC") {
    exit(1);
  }
  in >> addr;
  pc = addr;
  parseMem(in, "instruction");
  parseMem(in, "data");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x278, %rsp            # imm = 0x278
movq %rdi, %rsi
leaq -0x288(%rbp), %rbx
movq %rbx, %rdi
movl $0x8, %edx
callq 0x2250
leaq -0x70(%rbp), %r14
movq %r14, -0x10(%r14)
movq $0x0, -0x8(%r14)
movb $0x0, (%r14)
movq (%rbx), %rax
movq -0x18(%rax), %rax
movl -0x270(%rbp,%rax), %ecx
andl $-0x4b, %ecx
orl $0x8, %ecx
movl %ecx, -0x270(%rbp,%rax)
leaq -0x80(%rbp), %rsi
movq %rbx, %rdi
callq 0x2190
leaq 0xf9f(%rip), %rsi       # 0x646e
leaq -0x80(%rbp), %rdi
callq 0x2060
testl %eax, %eax
jne 0x55b3
leaq -0x288(%rbp), %rdi
leaq -0x1c(%rbp), %rsi
callq 0x2220
movl -0x1c(%rbp), %eax
leaq 0x3cd6(%rip), %rcx      # 0x91d0
movl %eax, (%rcx)
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xf0b(%rip), %rsi       # 0x6416
leaq 0xf0f(%rip), %rdx       # 0x6421
leaq -0x60(%rbp), %rdi
callq 0x561a
leaq -0x288(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x5174
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x5540
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2150
leaq -0x30(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xeab(%rip), %rsi       # 0x63fa
leaq 0xea8(%rip), %rdx       # 0x63fe
leaq -0x40(%rbp), %rdi
callq 0x561a
leaq -0x288(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x5174
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x5584
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x5599
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2150
leaq -0x288(%rbp), %rdi
callq 0x2050
addq $0x278, %rsp            # imm = 0x278
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %edi
callq 0x2180
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r15, %rdi
je 0x55f0
movq -0x30(%rbp), %rsi
jmp 0x55e1
jmp 0x55ed
movq %rax, %rbx
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x55f0
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x55f0
jmp 0x55ed
movq %rax, %rbx
movq -0x80(%rbp), %rdi
cmpq %r14, %rdi
je 0x5605
movq -0x70(%rbp), %rsi
incq %rsi
callq 0x2150
leaq -0x288(%rbp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x2230
nop
// File: /workspace/github_cpp_makefile_star2_O1/Lupo-CalPoly[P]cpe315-thumbsim/execute.cpp
// Function: setCarryOverflow(int, int, OFType)
void setCarryOverflow (int num1, int num2, OFType oftype) {
  switch (oftype) {
    case OF_ADD:
      if (((unsigned long long int)num1 + (unsigned long long int)num2) ==
          ((unsigned int)num1 + (unsigned int)num2)) {
        flags.C = 0;
      }
      else {
        flags.C = 1;
      }
      if (((long long int)num1 + (long long int)num2) ==
          ((int)num1 + (int)num2)) {
        flags.V = 0;
      }
      else {
        flags.V = 1;
      }
      break;
    case OF_SUB:
      if (num1 >= num2) {
        flags.C = 1;
      }
      else if ((long long int)((unsigned long long int)num1 - (unsigned long long int)num2) ==
          (int)((unsigned int)num1 - (unsigned int)num2)) {
        flags.C = 0;
      }
      else {
        flags.C = 1;
      }
      if (((num1==0) && (num2==0)) ||
          (((long long int)num1 - (long long int)num2) ==
           ((int)num1 - (int)num2))) {
        flags.V = 0;
      }
      else {
        flags.V = 1;
      }
      break;
    case OF_SHIFT:
      // C flag unaffected for shifts by zero
      if (num2 != 0) {
        if (((unsigned long long int)num1 << (unsigned long long int)num2) ==
            ((unsigned int)num1 << (unsigned int)num2)) {
          flags.C = 0;
        }
        else {
          flags.C = 1;
        }
      }
      // Shift doesn't set overflow
      break;
    default:
      cerr << "Bad OverFlow Type encountered." << __LINE__ << __FILE__ << endl;
      exit(1);
  }
}

// Assembly:
cmpl $0x2, %edx
je 0x572e
cmpl $0x1, %edx
je 0x56f0
testl %edx, %edx
jne 0x575c
movslq %edi, %rax
movslq %esi, %rcx
addq %rax, %rcx
addl %edi, %esi
cmpq %rsi, %rcx
setne 0x3b47(%rip)            # 0x9232
movslq %esi, %rax
jmp 0x5721
movb $0x1, %cl
movl %edi, %eax
subl %esi, %eax
jge 0x570a
movslq %edi, %rcx
movslq %esi, %rdx
subq %rdx, %rcx
movslq %eax, %rdx
cmpq %rdx, %rcx
setne %cl
movb %cl, 0x3b22(%rip)       # 0x9232
movl %esi, %ecx
orl %edi, %ecx
je 0x5726
movslq %edi, %rcx
movslq %esi, %rdx
subq %rdx, %rcx
cltq
cmpq %rax, %rcx
jne 0x574c
movb $0x0, 0x3b06(%rip)      # 0x9233
retq
testl %esi, %esi
je 0x575b
movslq %edi, %rax
movq %rax, %rdx
movl %esi, %ecx
shlq %cl, %rdx
shll %cl, %eax
cmpq %rax, %rdx
jne 0x5754
movb $0x0, 0x3ae7(%rip)      # 0x9232
retq
movb $0x1, 0x3ae0(%rip)      # 0x9233
retq
movb $0x1, 0x3ad7(%rip)      # 0x9232
retq
pushq %rbp
movq %rsp, %rbp
movq 0x3889(%rip), %rdi      # 0x8ff0
leaq 0xd8a(%rip), %rsi       # 0x64f8
callq 0x2130
movq %rax, %rdi
movl $0x57, %esi
callq 0x2210
leaq 0xd90(%rip), %rsi       # 0x6517
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x2090
movl $0x1, %edi
callq 0x2180
// File: /workspace/github_cpp_makefile_star2_O1/amukherj[P]concurrencyts/future.cc
// Function: basic_future_state()
void basic_future_state() {
  std::experimental::future_state<int> f;

  std::thread t([&f]() {
    auto val = f.get();
    std::cout << val << '\n';
  });

  std::thread t0([&f]() {
    f.wait();
    std::cout << "Done\n";
  });

  std::thread t1([&f]() {
    auto val = f.get();
    std::cout << val << '\n';
  });

  std::this_thread::sleep_for(std::chrono::seconds(2));
  f.emplace(10);

  t.join();
  t0.join();
  t1.join();
}

// Assembly:
pushq %rbx
subq $0xa0, %rsp
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
callq 0x3200
xorl %eax, %eax
movq %rax, 0x50(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x30(%rbx)
movw $0x0, 0x5c(%rbx)
movups %xmm0, 0x60(%rbx)
movq %rax, 0x28(%rsp)
movl $0x10, %edi
callq 0x31a0
leaq 0xb2ae(%rip), %rcx      # 0xe700
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x28(%rsp), %rdi
xorl %edx, %edx
callq 0x3180
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x347d
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x20(%rsp)
movl $0x10, %edi
callq 0x31a0
leaq 0xb2a9(%rip), %rcx      # 0xe740
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x20(%rsp), %rdi
xorl %edx, %edx
callq 0x3180
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x34c2
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x18(%rsp)
movl $0x10, %edi
callq 0x31a0
leaq 0xb2a4(%rip), %rcx      # 0xe780
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
leaq 0x8(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x18(%rsp), %rdi
xorl %edx, %edx
callq 0x3180
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x3507
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x8(%rsp), %rbx
movq $0x2, (%rbx)
movq $0x0, 0x8(%rbx)
movq %rbx, %rdi
movq %rbx, %rsi
callq 0x3070
cmpl $-0x1, %eax
jne 0x3535
callq 0x3030
cmpl $0x4, (%rax)
je 0x351b
leaq 0x8(%rsp), %rsi
movl $0xa, (%rsi)
leaq 0x30(%rsp), %rdi
callq 0x62bc
leaq 0x28(%rsp), %rdi
callq 0x3250
leaq 0x20(%rsp), %rdi
callq 0x3250
leaq 0x18(%rsp), %rdi
callq 0x3250
cmpq $0x0, 0x18(%rsp)
jne 0x3639
cmpq $0x0, 0x20(%rsp)
jne 0x3639
cmpq $0x0, 0x28(%rsp)
jne 0x3639
leaq 0x30(%rsp), %rdi
callq 0x636a
addq $0xa0, %rsp
popq %rbx
retq
jmp 0x360c
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x35b4
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x8(%rsp)
jmp 0x3617
movq %rax, %rbx
jmp 0x3617
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x35d7
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x8(%rsp)
jmp 0x361f
movq %rax, %rbx
jmp 0x361f
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x35fa
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x8(%rsp)
jmp 0x3627
movq %rax, %rbx
jmp 0x3627
jmp 0x360c
movq %rax, %rbx
cmpq $0x0, 0x18(%rsp)
jne 0x3639
cmpq $0x0, 0x20(%rsp)
jne 0x3639
cmpq $0x0, 0x28(%rsp)
jne 0x3639
leaq 0x30(%rsp), %rdi
callq 0x636a
movq %rbx, %rdi
callq 0x3280
callq 0x3050
// File: /workspace/github_cpp_makefile_star2_O1/amukherj[P]concurrencyts/future.cc
// Function: promise_to_future()
void promise_to_future() {
  std::experimental::promise<int> prom;
  auto fut = prom.get_future();

  std::thread t([&prom]() {
    std::this_thread::sleep_for(std::chrono::seconds(2));
    prom.set(10);
  });
  t.detach();

  std::cout << fut.get() << '\n';
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
xorl %r12d, %r12d
leaq 0x28(%rsp), %rbx
movq %r12, (%rbx)
movl $0x80, %edi
callq 0x31a0
movq %rax, %r14
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x8(%r14)
leaq 0xb4ca(%rip), %rax      # 0xeb40
movq %rax, (%r14)
leaq 0x10(%r14), %r15
movq %r15, %rdi
callq 0x3200
movq %r12, 0x60(%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x50(%r14)
movups %xmm0, 0x40(%r14)
movw $0x0, 0x6c(%r14)
movups %xmm0, 0x70(%r14)
movq %r14, 0x8(%rbx)
movq %r15, (%rbx)
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x63b6
movq $0x0, 0x8(%rsp)
movl $0x10, %edi
callq 0x31a0
leaq 0xb0f0(%rip), %rcx      # 0xe7c0
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
leaq 0x8(%rsp), %rdi
xorl %edx, %edx
callq 0x3180
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x36fb
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x8(%rsp), %rdi
callq 0x3270
movq 0x18(%rsp), %rdi
callq 0x68ce
movl (%rax), %esi
movq 0xb8b8(%rip), %rdi      # 0xefd0
callq 0x3260
leaq 0x10(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x31d0
cmpq $0x0, 0x8(%rsp)
jne 0x37be
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x374d
callq 0x6854
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x375c
callq 0x6854
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x377b
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x10(%rsp)
jmp 0x3798
jmp 0x3795
movq %rax, %rbx
jmp 0x37a7
cmpq $0x0, 0x8(%rsp)
jne 0x37be
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x37a7
callq 0x6854
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x37b6
callq 0x6854
movq %rbx, %rdi
callq 0x3280
callq 0x3050
// File: /workspace/github_cpp_makefile_star2_O1/amukherj[P]concurrencyts/future.cc
// Function: main
int main() {
  basic_future_state();
  promise_to_future();
  async_to_promise();
  when_all();
  when_any();
}

// Assembly:
pushq %rax
callq 0x340c
callq 0x363e
callq 0x37c3
callq 0x3e49
callq 0x41f8
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_cpp_makefile_star2_O1/amukherj[P]concurrencyts/./future.h
// Function: void concurrencyts::future_state<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::emplace<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&)
void emplace(Args&&... args) {
    std::unique_lock<std::mutex> ul(mtx);
    assert(!is_available && !is_complete);
    try {
      new (reinterpret_cast<T*>(&data)) T{std::forward<Args&&>(args)...};
      is_available = true;
    } catch (...) {
      eptr = std::current_exception();
    }
    is_complete = true;
    ul.unlock();

    completed.notify_all();
    notify_wait_queue();
  }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
movq %rsp, %r15
movq %rax, (%r15)
movb $0x0, 0x8(%r15)
movq %r15, %rdi
callq 0x6984
movb $0x1, 0x8(%r15)
cmpb $0x0, 0x78(%rbx)
jne 0x6e48
cmpb $0x1, 0x79(%rbx)
je 0x6e48
leaq 0x68(%rbx), %rcx
movq %rcx, 0x58(%rbx)
movq (%r14), %rdx
leaq 0x10(%r14), %rax
cmpq %rax, %rdx
je 0x6de8
movq %rdx, 0x58(%rbx)
movq (%rax), %rcx
movq %rcx, 0x68(%rbx)
jmp 0x6dee
movups (%rax), %xmm0
movups %xmm0, (%rcx)
movq 0x8(%r14), %rcx
movq %rcx, 0x60(%rbx)
movq %rax, (%r14)
movq $0x0, 0x8(%r14)
movb $0x0, 0x10(%r14)
movw $0x101, 0x78(%rbx)      # imm = 0x101
movq %rsp, %rdi
callq 0x69c0
movq %rbx, %rdi
callq 0x3240
movq 0x80(%rbx), %rbx
testq %rbx, %rbx
je 0x6e36
movq 0x8(%rbx), %rdi
callq 0x3240
movq (%rbx), %rbx
jmp 0x6e23
movq %rsp, %rdi
callq 0x696e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x21d3(%rip), %rdi      # 0x9022
leaq 0x21ea(%rip), %rsi      # 0x9040
leaq 0x229c(%rip), %rcx      # 0x90f9
movl $0x27, %edx
callq 0x3100
movq %rax, %rbx
movq %rsp, %rdi
callq 0x696e
movq %rbx, %rdi
callq 0x3280
// File: /workspace/github_cpp_makefile_star2_O1/amukherj[P]concurrencyts/./future.h
// Function: concurrencyts::future_state<int>::get()
T& get() {
    std::unique_lock<std::mutex> ul(mtx);
    completed.wait(ul, [this]()->bool { return is_complete; });

    if (eptr) {
      std::rethrow_exception(eptr);
    }

    return *(reinterpret_cast<T*>(&data));
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x6984
movb $0x1, 0x8(%r14)
cmpb $0x0, 0x5d(%rbx)
jne 0x6912
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3060
cmpb $0x1, 0x5d(%rbx)
jne 0x6901
movq 0x68(%rbx), %rax
testq %rax, %rax
jne 0x6934
addq $0x58, %rbx
leaq 0x8(%rsp), %rdi
callq 0x696e
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rsp, %rbx
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x3040
movq %rbx, %rdi
callq 0x31c0
movq %rax, %rbx
cmpq $0x0, (%rsp)
je 0x695c
movq %rsp, %rdi
callq 0x3160
leaq 0x8(%rsp), %rdi
callq 0x696e
movq %rbx, %rdi
callq 0x3280
// File: /workspace/github_cpp_makefile_star2_O1/amukherj[P]concurrencyts/./future.h
// Function: concurrencyts::future_state<int>::wait()
void wait() {
    std::unique_lock<std::mutex> ul(mtx);
    completed.wait(ul, [this]()->bool { return is_complete; });

    if (eptr) {
      std::rethrow_exception(eptr);
    }
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x6984
movb $0x1, 0x8(%r14)
cmpb $0x0, 0x5d(%rbx)
jne 0x6a2c
leaq 0x8(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3060
cmpb $0x1, 0x5d(%rbx)
jne 0x6a1b
movq 0x68(%rbx), %rax
testq %rax, %rax
jne 0x6a47
leaq 0x8(%rsp), %rdi
callq 0x696e
addq $0x18, %rsp
popq %rbx
popq %r14
retq
movq %rsp, %rbx
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x3040
movq %rbx, %rdi
callq 0x31c0
movq %rax, %rbx
cmpq $0x0, (%rsp)
je 0x6a6f
movq %rsp, %rdi
callq 0x3160
leaq 0x8(%rsp), %rdi
callq 0x696e
movq %rbx, %rdi
callq 0x3280
nop
// File: /workspace/github_cpp_makefile_star2_O1/amukherj[P]concurrencyts/./future.h
// Function: void concurrencyts::future_state<int>::set_exception<std::exception&>(std::exception&)
void set_exception(E&& exc) {
    std::unique_lock<std::mutex> ul(mtx);
    assert(!is_available && !is_complete);
    eptr = std::make_exception_ptr(std::forward<E>(exc));
    is_complete = true;
    ul.unlock();

    completed.notify_all();
    notify_wait_queue();
  }

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
leaq 0x30(%rdi), %rax
leaq 0x18(%rsp), %r14
movq %rax, (%r14)
movb $0x0, 0x8(%r14)
movq %r14, %rdi
callq 0x6984
movb $0x1, 0x8(%r14)
cmpb $0x0, 0x5c(%rbx)
jne 0x6bcd
cmpb $0x1, 0x5d(%rbx)
je 0x6bcd
movq 0x848d(%rip), %rax      # 0xefc0
addq $0x10, %rax
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movq %rsp, %r14
movq %r14, %rdi
callq 0x6c01
movq (%r14), %rax
movq %rax, 0x8(%rsp)
movq $0x0, (%r14)
movq 0x68(%rbx), %rcx
movq %rcx, 0x8(%rsp)
movq %rax, 0x68(%rbx)
testq %rcx, %rcx
je 0x6b75
leaq 0x8(%rsp), %rdi
callq 0x3160
cmpq $0x0, (%rsp)
je 0x6b84
movq %rsp, %rdi
callq 0x3160
leaq 0x10(%rsp), %rdi
callq 0x32c0
movb $0x1, 0x5d(%rbx)
leaq 0x18(%rsp), %rdi
callq 0x69c0
movq %rbx, %rdi
callq 0x3240
movq 0x60(%rbx), %rbx
testq %rbx, %rbx
je 0x6bbb
movq 0x8(%rbx), %rdi
callq 0x3240
movq (%rbx), %rbx
jmp 0x6ba8
leaq 0x18(%rsp), %rdi
callq 0x696e
addq $0x28, %rsp
popq %rbx
popq %r14
retq
leaq 0x244e(%rip), %rdi      # 0x9022
leaq 0x2465(%rip), %rsi      # 0x9040
leaq 0x24bc(%rip), %rcx      # 0x909e
movl $0x38, %edx
callq 0x3100
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x696e
movq %rbx, %rdi
callq 0x3280
// File: /workspace/github_cpp_makefile_star2_O1/amukherj[P]concurrencyts/./future.h
// Function: concurrencyts::when_any_result<std::vector<std::iterator_traits<__gnu_cxx::__normal_iterator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*, std::vector<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>>::value_type, std::allocator<std::iterator_traits<__gnu_cxx::__normal_iterator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*, std::vector<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>>::value_type>>> concurrencyts::make_when_any_result<__gnu_cxx::__normal_iterator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*, std::vector<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>>(unsigned long, __gnu_cxx::__normal_iterator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*, std::vector<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>, __gnu_cxx::__normal_iterator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>*, std::vector<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<concurrencyts::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>>>>)
auto make_when_any_result(size_t index, InputIt begin, InputIt end)
  -> when_any_result<std::vector<typename std::iterator_traits<InputIt>::value_type>>
{
  using ret_type = typename std::iterator_traits<InputIt>::value_type; 
  when_any_result<std::vector<ret_type>> result;

  for (auto it = begin; it != end; ++it) {
    result.futures.push_back(std::move(*it));
  }
  result.index = index;

  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rdi)
movq $0x0, 0x18(%rdi)
cmpq %rcx, %rdx
je 0x7a14
movq %rcx, %r15
movq %rdx, %r12
leaq 0x8(%rbx), %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x707e
addq $0x10, %r12
cmpq %r15, %r12
jne 0x7a00
movq %r14, (%rbx)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r13, %rdi
callq 0x6536
movq %rbx, %rdi
callq 0x3280
nop
// File: /workspace/github_cpp_makefile_star2_O1/statgen[P]statgen/lib/tclap-1.2.0/examples/test4.cpp
// Function: main
int main(int argc, char** argv)
{

	parseOptions(argc,argv);

	cout << "for string we got : " << _stringTest<< endl
		 << "for bool B we got : " << _boolTestB << endl
		 << "for bool A we got : " << _boolTestA << endl;

}

// Assembly:
pushq %rbx
callq 0x4ac0
movq 0xe608(%rip), %rbx      # 0x12fd0
leaq 0x96e4(%rip), %rsi      # 0xe0b3
movl $0x14, %edx
movq %rbx, %rdi
callq 0x4250
movq 0xe87d(%rip), %rsi      # 0x13260
movq 0xe87e(%rip), %rdx      # 0x13268
movq %rbx, %rdi
callq 0x4250
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x41d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4160
movq %rax, %rbx
leaq 0x96a2(%rip), %rsi      # 0xe0c8
movl $0x14, %edx
movq %rax, %rdi
callq 0x4250
movzbl 0xe81f(%rip), %esi      # 0x13259
movq %rbx, %rdi
callq 0x4360
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x41d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4160
movq %rax, %rbx
leaq 0x9667(%rip), %rsi      # 0xe0dd
movl $0x14, %edx
movq %rax, %rdi
callq 0x4250
movzbl 0xe7d0(%rip), %esi      # 0x1325a
movq %rbx, %rdi
callq 0x4360
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x41d0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x4030
movq %rax, %rdi
callq 0x4160
xorl %eax, %eax
popq %rbx
retq