LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/reader.h
// Function: unsigned int rapidjson::GenericReader<rapidjson::UTF8<char>, rapidjson::UTF8<char>, rapidjson::CrtAllocator>::ParseHex4<rapidjson::GenericStringStream<rapidjson::UTF8<char>>>(rapidjson::GenericStringStream<rapidjson::UTF8<char>>&, unsigned long)
unsigned ParseHex4(InputStream& is, size_t escapeOffset) {
        unsigned codepoint = 0;
        for (int i = 0; i < 4; i++) {
            Ch c = is.Peek();
            codepoint <<= 4;
            codepoint += static_cast<unsigned>(c);
            if (c >= '0' && c <= '9')
                codepoint -= '0';
            else if (c >= 'A' && c <= 'F')
                codepoint -= 'A' - 10;
            else if (c >= 'a' && c <= 'f')
                codepoint -= 'a' - 10;
            else {
                RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, escapeOffset);
                RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0);
            }
            is.Take();
        }
        return codepoint;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq (%rsi), %rcx
incq %rcx
xorl %eax, %eax
movl $0x4, %r8d
movsbl -0x1(%rcx), %r9d
leal -0x30(%r9), %r11d
movl $0xffffffd0, %r10d      # imm = 0xFFFFFFD0
cmpb $0xa, %r11b
jb 0xe7fb
leal -0x41(%r9), %r11d
movl $0xffffffc9, %r10d      # imm = 0xFFFFFFC9
cmpb $0x6, %r11b
jb 0xe7fb
leal -0x61(%r9), %r11d
movl $0xffffffa9, %r10d      # imm = 0xFFFFFFA9
cmpb $0x6, %r11b
jae 0xe811
shll $0x4, %eax
addl %r9d, %eax
addl %r10d, %eax
movq %rcx, (%rsi)
incq %rcx
decl %r8d
jne 0xe7c6
jmp 0xe824
cmpl $0x0, 0x30(%rdi)
jne 0xe826
movl $0x8, 0x30(%rdi)
movq %rdx, 0x38(%rdi)
xorl %eax, %eax
popq %rbp
retq
leaq 0x1e72(%rip), %rdi      # 0x1069f
leaq 0x1e7c(%rip), %rsi      # 0x106b0
leaq 0x2701(%rip), %rcx      # 0x10f3c
movl $0x396, %edx            # imm = 0x396
callq 0x72b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/document.h
// Function: rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>::GenericValue(rapidjson::Type)
explicit GenericValue(Type type) RAPIDJSON_NOEXCEPT : data_() {
        static const uint16_t defaultFlags[] = {
            kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag,
            kNumberAnyFlag
        };
        RAPIDJSON_NOEXCEPT_ASSERT(type >= kNullType && type <= kNumberType);
        data_.f.flags = defaultFlags[type];

        // Use ShortString to store empty string.
        if (type == kStringType)
            data_.ss.SetLength(0);
    }

// Assembly:
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
cmpl $0x7, %esi
jae 0xeae4
movl %esi, %eax
movq 0x74be(%rip), %rcx      # 0x15f90
movzwl (%rcx,%rax,2), %eax
movw %ax, 0xe(%rdi)
cmpl $0x5, %esi
jne 0xeae3
movb $0xd, 0xd(%rdi)
retq
pushq %rbp
movq %rsp, %rbp
leaq 0x1681(%rip), %rdi      # 0x10170
leaq 0x7ce(%rip), %rsi       # 0xf2c4
leaq 0x169c(%rip), %rcx      # 0x10199
movl $0x299, %edx            # imm = 0x299
callq 0x72b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/document.h
// Function: rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>::SetObjectRaw(rapidjson::GenericMember<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>*, unsigned int, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>&)
void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) {
        data_.f.flags = kObjectFlag;
        if (count) {
            Member* m = static_cast<Member*>(allocator.Malloc(count * sizeof(Member)));
            SetMembersPointer(m);
            std::memcpy(static_cast<void*>(m), members, count * sizeof(Member));
        }
        else
            SetMembersPointer(0);
        data_.o.size = data_.o.capacity = count;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rdi, %r14
movabsq $-0x1000000000000, %r13 # imm = 0xFFFF000000000000
movw $0x3, 0xe(%rdi)
testl %edx, %edx
je 0xeb9f
movq %rsi, %r15
movl %ebx, %r12d
shlq $0x5, %r12
movq %rcx, %rdi
movq %r12, %rsi
callq 0x70f0
andq 0x8(%r14), %r13
orq %rax, %r13
movq %r13, 0x8(%r14)
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x7310
jmp 0xeba3
andq %r13, 0x8(%r14)
movl %ebx, 0x4(%r14)
movl %ebx, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/internal/stack.h
// Function: rapidjson::internal::Stack<rapidjson::CrtAllocator>::ShrinkToFit()
void ShrinkToFit() { 
        if (Empty()) {
            // If the stack is empty, completely deallocate the memory.
            Allocator::Free(stack_); // NOLINT (+clang-analyzer-unix.Malloc)
            stack_ = 0;
            stackTop_ = 0;
            stackEnd_ = 0;
        }
        else
            Resize(GetSize());
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
movq 0x18(%rbx), %rsi
subq %rdi, %rsi
je 0xed42
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x7790
addq $0x10, %rbx
callq 0x7530
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq $0x0, 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/document.h
// Function: rapidjson::GenericMemberIterator<false, rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>> rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>::FindMember<rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>> const&)
MemberIterator FindMember(const GenericValue<Encoding, SourceAllocator>& name) {
        RAPIDJSON_ASSERT(IsObject());
        RAPIDJSON_ASSERT(name.IsString());
        MemberIterator member = MemberBegin();
        for ( ; member != MemberEnd(); ++member)
            if (name.StringEqual(member->name))
                break;
        return member;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpw $0x3, 0xe(%rsi)
jne 0xee71
movq %rdx, %r14
testb $0x4, 0xf(%rdx)
je 0xee90
movq %rsi, %r15
movq %rdi, %rbx
movabsq $0xffffffffffff, %r13   # imm = 0xFFFFFFFFFFFF
movq 0x8(%rsi), %rax
movq %rax, %r12
andq %r13, %r12
shrq $0x30, %rax
cmpl $0x3, %eax
jne 0xee3a
movq 0x8(%r15), %rax
andq %r13, %rax
movl (%r15), %ecx
shlq $0x5, %rcx
addq %rax, %rcx
cmpq %rcx, %r12
je 0xee5c
movq %r14, %rdi
movq %r12, %rsi
callq 0x77f0
testb %al, %al
jne 0xee5c
addq $0x20, %r12
cmpw $0x3, 0xe(%r15)
je 0xee09
movq %r12, (%rbx)
leaq 0x990(%rip), %rdi       # 0xf7d4
leaq 0x479(%rip), %rsi       # 0xf2c4
leaq 0x2b2d(%rip), %rcx      # 0x1197f
movl $0x4b0, %edx            # imm = 0x4B0
callq 0x72b0
movq %r12, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x95c(%rip), %rdi       # 0xf7d4
leaq 0x445(%rip), %rsi       # 0xf2c4
leaq 0x2a01(%rip), %rcx      # 0x11887
movl $0x505, %edx            # imm = 0x505
callq 0x72b0
leaq 0x41d(%rip), %rdi       # 0xf2b4
leaq 0x426(%rip), %rsi       # 0xf2c4
leaq 0x29e2(%rip), %rcx      # 0x11887
movl $0x506, %edx            # imm = 0x506
callq 0x72b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/document.h
// Function: bool rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>::StringEqual<rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>> const&) const
bool StringEqual(const GenericValue<Encoding, SourceAllocator>& rhs) const {
        RAPIDJSON_ASSERT(IsString());
        RAPIDJSON_ASSERT(rhs.IsString());

        const SizeType len1 = GetStringLength();
        const SizeType len2 = rhs.GetStringLength();
        if(len1 != len2) { return false; }

        const Ch* const str1 = GetString();
        const Ch* const str2 = rhs.GetString();
        if(str1 == str2) { return true; } // fast path for constant string

        return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0);
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testb $0x4, 0xf(%rdi)
je 0xef1f
movq %rsi, %rbx
testb $0x4, 0xf(%rsi)
je 0xef3e
movq %rdi, %r15
callq 0x7450
movl %eax, %r14d
movq %rbx, %rdi
callq 0x7450
cmpl %eax, %r14d
jne 0xef0e
movq %r15, %rdi
callq 0x7090
movq %rax, %r15
movq %rbx, %rdi
callq 0x7090
cmpq %rax, %r15
je 0xef12
movl %r14d, %edx
movq %r15, %rdi
movq %rax, %rsi
callq 0x7420
testl %eax, %eax
sete %al
jmp 0xef14
xorl %eax, %eax
jmp 0xef14
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x393(%rip), %rdi       # 0xf2b9
leaq 0x397(%rip), %rsi       # 0xf2c4
leaq 0x2adf(%rip), %rcx      # 0x11a13
movl $0x84a, %edx            # imm = 0x84A
callq 0x72b0
leaq 0x2bc3(%rip), %rdi      # 0x11b08
leaq 0x378(%rip), %rsi       # 0xf2c4
leaq 0x2ac0(%rip), %rcx      # 0x11a13
movl $0x84b, %edx            # imm = 0x84B
callq 0x72b0
nop
// File: /workspace/github_cpp_makefile_star2_O3/cqbqdd11519[P]DockerClient/rapidjson/include/rapidjson/document.h
// Function: rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>& rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>::operator[]<rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>>(rapidjson::GenericValue<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>> const&)
GenericValue& operator[](const GenericValue<Encoding, SourceAllocator>& name) {
        MemberIterator member = FindMember(name);
        if (member != MemberEnd())
            return member->value;
        else {
            RAPIDJSON_ASSERT(false);    // see above note

            // This will generate -Wexit-time-destructors in clang
            // static GenericValue NullValue;
            // return NullValue;

            // Use static buffer and placement-new to prevent destruction
            static char buffer[sizeof(GenericValue)];
            return *new (buffer) GenericValue();
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rdx
movq %rdi, %rbx
leaq -0x10(%rbp), %rdi
movq %rbx, %rsi
callq 0x72d0
cmpw $0x3, 0xe(%rbx)
jne 0xefa8
movabsq $0xffffffffffff, %rax   # imm = 0xFFFFFFFFFFFF
andq 0x8(%rbx), %rax
movl (%rbx), %ecx
shlq $0x5, %rcx
addq %rax, %rcx
movq -0x10(%rbp), %rax
cmpq %rcx, %rax
je 0xefc7
addq $0x10, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x825(%rip), %rdi       # 0xf7d4
leaq 0x30e(%rip), %rsi       # 0xf2c4
leaq 0x29c2(%rip), %rcx      # 0x1197f
movl $0x4b0, %edx            # imm = 0x4B0
callq 0x72b0
leaq 0x2b3(%rip), %rdi       # 0xf281
leaq 0x2ef(%rip), %rsi       # 0xf2c4
leaq 0x2b3b(%rip), %rcx      # 0x11b17
movl $0x491, %edx            # imm = 0x491
callq 0x72b0
// File: /workspace/github_cpp_makefile_star2_O3/willprice[P]parallel-cpp-workshop/parallel_reduce.cpp
// Function: main
int main(int argc, char **argv)
{
  auto total = tbb::parallel_reduce(
      tbb::blocked_range<int>(0, 10000),
      0.0,
      [&](tbb::blocked_range<int> r, double running_total) {
        for (int i = r.begin(); i < r.end(); i++) {
          running_total += std::sin(i * 0.001);
        }
        return running_total;
      }, std::plus<double>());
  std::cout << total << std::endl;
}

// Assembly:
pushq %rbx
subq $0xe0, %rsp
xorl %ebx, %ebx
leaq 0x58(%rsp), %rax
movq %rbx, (%rax)
movq %rax, 0x18(%rsp)
leaq 0xf(%rsp), %rax
movq %rax, 0x20(%rsp)
leaq 0xe(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %rbx, 0x30(%rsp)
leaq 0x60(%rsp), %rdi
movw $0x401, 0xc(%rdi)       # imm = 0x401
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rdi)
movq $0x4, 0x40(%rdi)
callq 0x2110
movq %rbx, 0x38(%rsp)
movl $0x1, 0x40(%rsp)
movl $0x1, %eax
movq %rax, 0x48(%rsp)
movq %rax, 0x50(%rsp)
leaq 0x10(%rsp), %rdi
movq %rbx, (%rdi)
movl $0x80, %esi
callq 0x2050
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x28(%rax)
movups %xmm0, 0x18(%rax)
movups %xmm0, 0x8(%rax)
movq $0x0, 0x38(%rax)
leaq 0x29de(%rip), %rax      # 0x4d38
movq %rax, (%rbx)
movq $0x2710, 0x40(%rbx)     # imm = 0x2710
movq $0x1, 0x48(%rbx)
leaq 0x18(%rsp), %rax
movq %rax, 0x50(%rbx)
xorl %edi, %edi
callq 0x2170
leaq 0x48(%rsp), %rdx
cltq
movl $0x0, 0x68(%rbx)
movb $0x5, 0x6c(%rbx)
addq %rax, %rax
movabsq $0x7ffffffffffffffe, %rcx # imm = 0x7FFFFFFFFFFFFFFE
andq %rax, %rcx
movq %rcx, 0x60(%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x70(%rbx)
movb $0x0, 0x78(%rbx)
leaq 0x38(%rsp), %rax
movq %rax, 0x58(%rbx)
leaq 0x60(%rsp), %rcx
movq %rbx, %rdi
movq %rcx, %rsi
callq 0x2100
leaq 0x60(%rsp), %rdi
callq 0x20e0
movsd 0x30(%rsp), %xmm0
movq 0x2bf8(%rip), %rdi      # 0x4fd8
callq 0x2130
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x20c0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20a0
xorl %eax, %eax
addq $0xe0, %rsp
popq %rbx
retq
jmp 0x2431
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2150
movq %rax, %rdi
callq 0x29c3
nop
// File: /workspace/github_cpp_makefile_star2_O3/iZhangHui[P]CppPrimer/CH07_Classes/examples/useAccount.cc
// Function: main
int main()
{
	Account a1("bem", 42);
	cout << a1.balance() << endl;
	a1.calculate();
	cout << a1.balance() << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x138, %rsp            # imm = 0x138
leaq -0x28(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xd65(%rip), %rsi       # 0x2020
leaq 0xd61(%rip), %rdx       # 0x2023
leaq -0x38(%rbp), %rdi
callq 0x14ba
leaq -0x140(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
addq %rsi, %rdx
leaq -0x150(%rbp), %rdi
callq 0x141c
movabsq $0x4045000000000000, %rax # imm = 0x4045000000000000
movq %rax, -0x130(%rbp)
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x131d
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x1090
movsd -0x130(%rbp), %xmm0
jmp 0x1325
movsd 0xcf3(%rip), %xmm0      # 0x2018
movq 0x2cac(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
movsd -0x130(%rbp), %xmm1
leaq 0x2d46(%rip), %rax      # 0x40b0
movsd (%rax), %xmm0
mulsd %xmm1, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x130(%rbp)
movq 0x2c53(%rip), %rdi      # 0x3fd8
callq 0x10b0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x1080
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1040
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
je 0x13cf
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x1090
xorl %eax, %eax
addq $0x138, %rsp            # imm = 0x138
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x38(%rbp), %rdi
cmpq %r15, %rdi
je 0x1414
movq -0x28(%rbp), %rsi
jmp 0x140c
movq %rax, %rbx
jmp 0x1414
movq %rax, %rbx
movq -0x150(%rbp), %rdi
cmpq %r14, %rdi
je 0x1414
movq -0x140(%rbp), %rsi
incq %rsi
callq 0x1090
movq %rbx, %rdi
callq 0x10c0
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Matrix/Mat.cpp
// Function: Matrix::Matrix(int, int)
Matrix::Matrix (int height, int width) {
    this->width = width;
    this->height = height;
    array = new Vector[height];
    for (int i = 0; i < height; i++) {
        array[i] = Vector(width);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rdi, %r14
movl %edx, 0xc(%rdi)
movl %esi, 0x8(%rdi)
movl %esi, -0x2c(%rbp)
movslq %esi, %r15
movq %r15, %r13
shlq $0x4, %r13
testl %r15d, %r15d
movq $-0x1, %rdi
cmovnsq %r13, %rdi
callq 0x2030
movq %rax, %r12
testl %r15d, %r15d
je 0x2af5
xorl %r15d, %r15d
leaq (%r12,%r15), %rdi
callq 0x7868
addq $0x10, %r15
cmpq %r15, %r13
jne 0x2aa3
movq %r12, (%r14)
movl -0x2c(%rbp), %eax
testl %eax, %eax
jle 0x2af8
movl %eax, %r12d
shlq $0x4, %r12
xorl %r13d, %r13d
leaq -0x40(%rbp), %r15
movq %r15, %rdi
movl %ebx, %esi
callq 0x77e0
movq (%r14), %rax
movl -0x38(%rbp), %ecx
movl %ecx, 0x8(%rax,%r13)
movq -0x40(%rbp), %rcx
movq %rcx, (%rax,%r13)
addq $0x10, %r13
cmpq %r13, %r12
jne 0x2acd
jmp 0x2af8
movq %r12, (%r14)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x21d0
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Matrix/Mat.cpp
// Function: Matrix::print()
void Matrix::print () {
    cout<<endl;
    for (int i = 0; i < this->height; i++) {
        for (int x = 0; x < this->width; x++) {
            cout<<this->array[i].array[x].value<<" ";
        }
        cout<<endl;
    }
    cout<<endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movq 0xc496(%rip), %r15      # 0xefc8
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
cmpl $0x0, 0x8(%r14)
jle 0x2bf8
movq $0x0, -0x30(%rbp)
cmpl $0x0, 0xc(%r14)
jle 0x2bb9
movq -0x30(%rbp), %r13
shlq $0x4, %r13
xorl %r12d, %r12d
xorl %ebx, %ebx
movq (%r14), %rax
movq (%rax,%r13), %rax
movsd (%rax,%r12), %xmm0
movq %r15, %rdi
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
leaq 0x7700(%rip), %rsi      # 0xa2a4
callq 0x21b0
incq %rbx
movslq 0xc(%r14), %rax
addq $0x30, %r12
cmpq %rax, %rbx
jl 0x2b80
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
callq 0x2110
movq -0x30(%rbp), %rdx
incq %rdx
movslq 0x8(%r14), %rax
movq %rdx, -0x30(%rbp)
cmpq %rax, %rdx
jl 0x2b6c
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %r15, %rdi
callq 0x2040
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2110
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Matrix/operations.cpp
// Function: Matrix::operator=(std::initializer_list<std::initializer_list<Variable>>)
void Matrix::operator= (initializer_list<initializer_list<Variable>> ar) {
    // find height / width
    int ar_height = ar.size();
    int ar_width = ar.begin()->size();
    for (int i = 1; i < ar_height; i++) {
        if (ar_width != (ar.begin()+i)->size()) {
            throw invalid_argument("array invalid");
        }
    }
    // check height / width
    if (this->height != ar_height) throw invalid_argument("height invalid");
    if (this->width != ar_width) throw invalid_argument("width invalid");
    // assign
    for (int i = 0; i < ar_height; i++) {
        this->array[i] = *(ar.begin() + i);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x8(%rsi), %rax
cmpl $0x2, %ebx
jl 0x30a1
movslq %eax, %rcx
movl %ebx, %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leaq 0x18(%r14), %rsi
decq %rdx
cmpq (%rsi), %rcx
jne 0x30e8
addq $0x10, %rsi
decq %rdx
jne 0x3093
cmpl %ebx, 0x8(%r15)
jne 0x311a
cmpl %eax, 0xc(%r15)
jne 0x3138
testl %ebx, %ebx
jle 0x30df
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
shlq $0x4, %rbx
xorl %r12d, %r12d
movq (%r14,%r12), %rsi
movq 0x8(%r14,%r12), %rdx
movq (%r15), %rdi
addq %r12, %rdi
callq 0x8b2e
addq $0x10, %r12
cmpq %r12, %rbx
jne 0x30c2
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x6f08(%rip), %rsi      # 0xa004
movq %rax, %rdi
callq 0x2290
movq 0xbed5(%rip), %rsi      # 0xefe0
movq 0xbebe(%rip), %rdx      # 0xefd0
movq %rbx, %rdi
callq 0x2210
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x6f1e(%rip), %rsi      # 0xa04c
movq %rax, %rdi
callq 0x2290
jmp 0x3104
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x6f0f(%rip), %rsi      # 0xa05b
movq %rax, %rdi
callq 0x2290
jmp 0x3104
jmp 0x315a
jmp 0x315a
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Matrix/operations.cpp
// Function: operator+(Matrix const&, Matrix const&)
Matrix operator+ (const Matrix &a, const Matrix &b) {
    // see if width / height is feasible
    if (a.width != b.width) throw invalid_argument("Width invalid");
    if (a.height != b.height) throw invalid_argument("Height invalid");
    // create matrix 
    Matrix return_mat = Matrix(a.height, a.width);
    // operations
    for (int i = 0; i < a.height; i++) {
        for (int x = 0; x < a.width; x++) {
            return_mat.array[i].array[x] = a.array[i].array[x] + b.array[i].array[x];
        }
    }
    // return
    return return_mat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movl 0xc(%rdi), %edx
cmpl 0xc(%rsi), %edx
jne 0x3251
movq %rsi, %rax
movl 0x8(%rdi), %esi
movq %rax, -0x38(%rbp)
cmpl 0x8(%rax), %esi
jne 0x326f
movq %rdi, %r14
leaq -0x48(%rbp), %rdi
callq 0x2a5c
movl 0x8(%r14), %ecx
testl %ecx, %ecx
jle 0x323a
movl 0xc(%r14), %eax
xorl %r13d, %r13d
leaq -0x78(%rbp), %rbx
testl %eax, %eax
jle 0x322f
movq %r13, -0x30(%rbp)
shlq $0x4, %r13
xorl %r12d, %r12d
xorl %r15d, %r15d
movq (%r14), %rax
movq (%rax,%r13), %rsi
addq %r12, %rsi
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq (%rax,%r13), %rdx
addq %r12, %rdx
movq %rbx, %rdi
callq 0x5406
movq -0x48(%rbp), %rax
movq (%rax,%r13), %rax
movups -0x78(%rbp), %xmm0
movups -0x68(%rbp), %xmm1
movups -0x58(%rbp), %xmm2
movups %xmm2, 0x20(%rax,%r12)
movups %xmm1, 0x10(%rax,%r12)
movups %xmm0, (%rax,%r12)
incq %r15
movslq 0xc(%r14), %rax
addq $0x30, %r12
cmpq %rax, %r15
jl 0x31d2
movl 0x8(%r14), %ecx
movq -0x30(%rbp), %r13
incq %r13
movslq %ecx, %rdx
cmpq %rdx, %r13
jl 0x31c0
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x6e04(%rip), %rsi      # 0xa069
movq %rax, %rdi
callq 0x2290
jmp 0x328b
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x6df4(%rip), %rsi      # 0xa077
movq %rax, %rdi
callq 0x2290
movq 0xbd4e(%rip), %rsi      # 0xefe0
movq 0xbd37(%rip), %rdx      # 0xefd0
movq %rbx, %rdi
callq 0x2210
jmp 0x32a3
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Matrix/operations.cpp
// Function: operator+(Matrix const&, double const&)
Matrix operator+ (const Matrix &a, const double &b) {
    // create matrix 
    Matrix return_mat = Matrix(a.height, a.width);
    // operations
    for (int i = 0; i < a.height; i++) {
        for (int x = 0; x < a.width; x++) {
            Variable *new_var = new Variable();
            new_var->operation = op::argument;
            new_var->value = b;
            return_mat.array[i].array[x] = a.array[i].array[x] + (*new_var);
        }
    }
    // return
    return return_mat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, -0x38(%rbp)
movq %rdi, %r14
movl 0x8(%rdi), %esi
movl 0xc(%rdi), %edx
leaq -0x48(%rbp), %rdi
callq 0x2a5c
movl 0x8(%r14), %ecx
testl %ecx, %ecx
jle 0x339b
movl 0xc(%r14), %eax
xorl %r13d, %r13d
testl %eax, %eax
jle 0x338c
movq %r13, -0x30(%rbp)
shlq $0x4, %r13
xorl %r15d, %r15d
xorl %ebx, %ebx
movl $0x30, %edi
callq 0x2190
movq %rax, %r12
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movl $0x1, 0x8(%r12)
movq -0x38(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%r12)
movq (%r14), %rax
movq (%rax,%r13), %rsi
addq %r15, %rsi
leaq -0x78(%rbp), %rdi
movq %r12, %rdx
callq 0x5406
movq -0x48(%rbp), %rax
movq (%rax,%r13), %rax
movups -0x78(%rbp), %xmm0
movups -0x68(%rbp), %xmm1
movups -0x58(%rbp), %xmm2
movups %xmm2, 0x20(%rax,%r15)
movups %xmm1, 0x10(%rax,%r15)
movups %xmm0, (%rax,%r15)
incq %rbx
movslq 0xc(%r14), %rax
addq $0x30, %r15
cmpq %rax, %rbx
jl 0x3305
movl 0x8(%r14), %ecx
movq -0x30(%rbp), %r13
incq %r13
movslq %ecx, %rdx
cmpq %rdx, %r13
jl 0x32f0
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Matrix/operations.cpp
// Function: operator+(double const&, Matrix const&)
Matrix operator+ (const double &b, const Matrix &a) {
    // create matrix 
    Matrix return_mat = Matrix(a.height, a.width);
    // operations
    for (int i = 0; i < a.height; i++) {
        for (int x = 0; x < a.width; x++) {
            Variable *new_var = new Variable();
            new_var->operation = op::argument;
            new_var->value = b;
            return_mat.array[i].array[x] = *(new_var) + a.array[i].array[x];
        }
    }
    // return
    return return_mat;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, -0x38(%rbp)
movl 0x8(%rsi), %esi
movl 0xc(%rbx), %edx
leaq -0x48(%rbp), %rdi
callq 0x2a5c
movl 0x8(%rbx), %ecx
testl %ecx, %ecx
jle 0x34a8
movl 0xc(%rbx), %eax
xorl %r13d, %r13d
testl %eax, %eax
jle 0x3499
movq %r13, -0x30(%rbp)
shlq $0x4, %r13
xorl %r15d, %r15d
xorl %r14d, %r14d
movl $0x30, %edi
callq 0x2190
movq %rax, %r12
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movl $0x1, 0x8(%r12)
movq -0x38(%rbp), %rax
movsd (%rax), %xmm0
movsd %xmm0, (%r12)
movq (%rbx), %rax
movq (%rax,%r13), %rdx
addq %r15, %rdx
leaq -0x78(%rbp), %rdi
movq %r12, %rsi
callq 0x5406
movq -0x48(%rbp), %rax
movq (%rax,%r13), %rax
movups -0x78(%rbp), %xmm0
movups -0x68(%rbp), %xmm1
movups -0x58(%rbp), %xmm2
movups %xmm2, 0x20(%rax,%r15)
movups %xmm1, 0x10(%rax,%r15)
movups %xmm0, (%rax,%r15)
incq %r14
movslq 0xc(%rbx), %rax
addq $0x30, %r15
cmpq %rax, %r14
jl 0x3413
movl 0x8(%rbx), %ecx
movq -0x30(%rbp), %r13
incq %r13
movslq %ecx, %rdx
cmpq %rdx, %r13
jl 0x33fd
movq -0x48(%rbp), %rax
movq -0x40(%rbp), %rdx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r12, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/Var.cpp
// Function: Variable::Variable(double, bool)
Variable::Variable (double value, bool t) {
    this->child[0] = nullptr;
    this->child[1] = nullptr;
    this->arg = nullptr;
    this->operation = op::input; 
    this->value = value;
    static int id_counter = 0;
    if (t) {
        id_counter++;
        this->id = id_counter;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0xffffffff, 0x20(%rdi) # imm = 0xFFFFFFFF
movq $0x0, 0x28(%rdi)
movl $0x0, 0x8(%rdi)
xorps %xmm1, %xmm1
movups %xmm1, 0x10(%rdi)
movsd %xmm0, (%rdi)
testl %esi, %esi
je 0x4186
movl 0xb001(%rip), %eax      # 0xf17c
incl %eax
movl %eax, 0xaff9(%rip)      # 0xf17c
movl %eax, 0x20(%rdi)
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/eval.cpp
// Function: Variable::exec_op(double, op, double)
double Variable::exec_op(double num_one, op operation, double num_two) {
    if (operation == add) return num_one + num_two;
    else if (operation == subtract) return num_one - num_two;
    else if (operation == multiply) return num_one * num_two;
    else if (operation == divide) return num_one / num_two;
    else if (operation == exponent) return pow(num_one, num_two);
    else if (operation == op::min && num_one > num_two) return num_two;
    else if (operation == op::min && num_one < num_two) return num_one;
    else if (operation == op::max && num_one > num_two) return num_one;
    else if (operation == op::max && num_one < num_two) return num_two; 
    else if (operation == op::sin_r_op) return sin(num_one);
    else if (operation == op::cos_r_op) return cos(num_one);
    else if (operation == op::sin_d_op) return sin(num_one * (pi/180)); 
    else if (operation == op::cos_d_op) return cos(num_one * (pi/180)); 
    else {throw invalid_argument("exec op error");}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
leal -0x2(%rsi), %eax
cmpl $0x4, %eax
ja 0x41d3
leaq 0x5fca(%rip), %rcx      # 0xa168
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
addsd %xmm0, %xmm1
jmp 0x41ca
popq %rbx
popq %r14
popq %rbp
jmp 0x2240
divsd %xmm1, %xmm0
jmp 0x41c6
mulsd %xmm0, %xmm1
jmp 0x41ca
subsd %xmm1, %xmm0
movapd %xmm0, %xmm1
movapd %xmm1, %xmm0
popq %rbx
popq %r14
popq %rbp
retq
cmpl $0x8, %esi
jne 0x41de
ucomisd %xmm1, %xmm0
ja 0x41ca
cmpl $0x8, %esi
jne 0x41e9
ucomisd %xmm0, %xmm1
ja 0x41c6
cmpl $0x9, %esi
jne 0x41f4
ucomisd %xmm1, %xmm0
ja 0x41c6
cmpl $0x9, %esi
jne 0x41ff
ucomisd %xmm0, %xmm1
ja 0x41ca
addl $-0xb, %esi
cmpl $0x3, %esi
ja 0x4239
leaq 0x5f6e(%rip), %rax      # 0xa17c
movslq (%rax,%rsi,4), %rcx
addq %rax, %rcx
jmpq *%rcx
mulsd 0x5f41(%rip), %xmm0     # 0xa160
popq %rbx
popq %r14
popq %rbp
jmp 0x2060
mulsd 0x5f30(%rip), %xmm0     # 0xa160
popq %rbx
popq %r14
popq %rbp
jmp 0x2280
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x5f3f(%rip), %rsi      # 0xa18c
movq %rax, %rdi
callq 0x2290
movq 0xad84(%rip), %rsi      # 0xefe0
movq 0xad6d(%rip), %rdx      # 0xefd0
movq %rbx, %rdi
callq 0x2210
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/eval.cpp
// Function: Variable::find_unique_id(std::vector<int, std::allocator<int>>*, std::vector<int, std::allocator<int>>*)
void Variable::find_unique_id (vector<int> *ID_ARRAY, vector<int> *input_map) {
    if (this->child[0] != NULL && child[1] != NULL) {
        if (this->child[1] != NULL) {
            this->child[0]->find_unique_id(ID_ARRAY, input_map);
            this->child[1]->find_unique_id(ID_ARRAY, input_map);
        } else {
            this->child[0]->find_unique_id(ID_ARRAY, input_map);
        }
    } else {
        if (this->operation == op::input) {
            // ID_ARRAY
            bool found = false;
            for (auto i : *ID_ARRAY) {
                if (i == this->id) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                ID_ARRAY->push_back(this->id);   
            }
            // input-map
            found = false;
            for (auto i : *input_map) {
                if (i == this->id) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                input_map->push_back(this->id);
            }
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x454c
cmpq $0x0, 0x18(%r14)
je 0x454c
movq %r15, %rsi
movq %rbx, %rdx
callq 0x4514
movq 0x18(%r14), %r14
movq 0x10(%r14), %rdi
jmp 0x452b
cmpl $0x0, 0x8(%r14)
jne 0x45c4
movq (%r15), %rax
movq 0x8(%r15), %rsi
cmpq %rsi, %rax
je 0x4570
movl 0x20(%r14), %ecx
cmpl %ecx, (%rax)
je 0x4590
addq $0x4, %rax
cmpq %rsi, %rax
jne 0x4563
leaq 0x20(%r14), %rdx
cmpq 0x10(%r15), %rsi
je 0x4588
movl (%rdx), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%r15)
jmp 0x4590
movq %r15, %rdi
callq 0x4696
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
cmpq %rsi, %rax
je 0x45ad
movl 0x20(%r14), %ecx
cmpl %ecx, (%rax)
je 0x45c4
addq $0x4, %rax
cmpq %rsi, %rax
jne 0x45a0
addq $0x20, %r14
cmpq 0x10(%rbx), %rsi
je 0x45cf
movl (%r14), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4696
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/grad.cpp
// Function: print_array(std::vector<double, std::allocator<double>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
void print_array (vector<double> array, string name = "") {
    if (name != "") {
        cout<<name<<": ";
    }
    for (auto a : array) {
        cout<<a<<" ";
    }
    cout<<endl; 
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x5abd(%rip), %rsi      # 0xa2a5
movq %r14, %rdi
callq 0x2070
testl %eax, %eax
je 0x481b
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq 0xa7c6(%rip), %rdi      # 0xefc8
callq 0x21b0
leaq 0x5a95(%rip), %rsi      # 0xa2a3
movl $0x2, %edx
movq %rax, %rdi
callq 0x21b0
movq (%rbx), %r15
movq 0x8(%rbx), %r12
cmpq %r12, %r15
je 0x485b
movq 0xa79a(%rip), %rbx      # 0xefc8
leaq 0x5a6f(%rip), %r14      # 0xa2a4
movsd (%r15), %xmm0
movq %rbx, %rdi
callq 0x21f0
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x21b0
addq $0x8, %r15
cmpq %r12, %r15
jne 0x4835
movq 0xa766(%rip), %rbx      # 0xefc8
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2180
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2040
movq %rax, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2110
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/grad.cpp
// Function: Variable::dir_eval(double, op, double, bool)
double Variable::dir_eval (double x, op operation, double y, bool respect_x) {
    if (operation == op::add) return 1;
    if (operation == op::multiply) return y;
    if (operation == op::min) return 1;
    if (operation == op::max) return 1;
    if (operation == op::clip) return 1; 
    if (operation == op::sin_d_op) return d_to_r(cos(r_to_d(x))); 
    if (operation == op::sin_r_op) return cos(x);
    if (operation == op::cos_d_op) return d_to_r(-sin(r_to_d(x)));
    if (operation == op::cos_r_op) return -sin(x); 
    if (respect_x) {
        if (operation == op::subtract) return 1;
        if (operation == op::divide) return 1 / y;
        if (operation == op::exponent) return y * pow(x, y - 1);
    } else {
        if (operation == op::subtract) return -1;
        if (operation == op::divide) return (-y) / pow(x,2);
        if (operation == op::exponent) return pow(y,x)*log10(y);
    }
    cout<<"ERROR OPERATION: "<<operation<<endl; 
    throw invalid_argument("operation not valid when running dir_eval()");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movapd %xmm1, %xmm3
movl %esi, %ebx
movapd %xmm0, %xmm2
movsd 0x596d(%rip), %xmm0     # 0xa238
leal -0x2(%rbx), %eax
cmpl $0xc, %eax
ja 0x494a
leaq 0x5986(%rip), %rcx      # 0xa260
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movapd %xmm3, %xmm0
jmp 0x4941
mulsd 0x593f(%rip), %xmm2     # 0xa230
movapd %xmm2, %xmm0
callq 0x2060
mulsd 0x593e(%rip), %xmm0     # 0xa240
jmp 0x4941
movapd %xmm2, %xmm0
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x2280
movapd %xmm2, %xmm0
callq 0x2060
xorpd 0x592a(%rip), %xmm0     # 0xa250
jmp 0x4941
mulsd 0x5900(%rip), %xmm2     # 0xa230
movapd %xmm2, %xmm0
callq 0x2280
mulsd 0x581f(%rip), %xmm0     # 0xa160
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
testb %dl, %dl
je 0x496f
cmpl $0x3, %ebx
je 0x4941
cmpl $0x6, %ebx
je 0x4993
cmpl $0x4, %ebx
jne 0x49ec
movsd 0x58cf(%rip), %xmm0     # 0xa238
divsd %xmm3, %xmm0
jmp 0x4941
cmpl $0x3, %ebx
je 0x49df
cmpl $0x6, %ebx
je 0x49b4
cmpl $0x4, %ebx
jne 0x49ec
xorpd 0x58ca(%rip), %xmm3     # 0xa250
mulsd %xmm2, %xmm2
divsd %xmm2, %xmm3
jmp 0x48e3
movsd 0x58ad(%rip), %xmm1     # 0xa248
addsd %xmm3, %xmm1
movapd %xmm2, %xmm0
movapd %xmm3, -0x20(%rbp)
callq 0x2240
mulsd -0x20(%rbp), %xmm0
jmp 0x4941
movapd %xmm3, %xmm0
movapd %xmm2, %xmm1
movapd %xmm3, -0x20(%rbp)
callq 0x2240
movsd %xmm0, -0x28(%rbp)
movapd -0x20(%rbp), %xmm0
callq 0x20d0
mulsd -0x28(%rbp), %xmm0
jmp 0x4941
movsd 0x5861(%rip), %xmm0     # 0xa248
jmp 0x4941
movq 0xa5d5(%rip), %r14      # 0xefc8
leaq 0x589a(%rip), %rsi      # 0xa294
movl $0x11, %edx
movq %r14, %rdi
callq 0x21b0
movq %r14, %rdi
movl %ebx, %esi
callq 0x2220
movq %rax, %rdi
callq 0x20b0
movl $0x10, %edi
callq 0x20c0
movq %rax, %rbx
leaq 0x5879(%rip), %rsi      # 0xa2a6
movq %rax, %rdi
callq 0x2290
movq 0xa5a4(%rip), %rsi      # 0xefe0
movq 0xa58d(%rip), %rdx      # 0xefd0
movq %rbx, %rdi
callq 0x2210
movq %rax, %r14
movq %rbx, %rdi
callq 0x2130
movq %r14, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/operations/add.cpp
// Function: operator+(Variable const&, Variable const&)
Variable operator+ (const Variable &left, const Variable &right) {
    Variable new_var = Variable(false);
    new_var.operation = op::add;
    new_var.child[0] = new Variable();
    new_var.child[1] = new Variable();
    *(new_var.child[0]) = left;
    *(new_var.child[1]) = right;
    return new_var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x414c
movl $0x2, 0x8(%rbx)
movl $0x30, %edi
callq 0x2190
movq %rax, %r12
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r12, 0x10(%rbx)
movl $0x30, %edi
callq 0x2190
movq %rax, %r12
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r12, 0x18(%rbx)
movq 0x10(%rbx), %rax
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq 0x18(%rbx), %rax
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm1, 0x10(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm0, (%rax)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5222
movq %rax, %rbx
movq %r12, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/operations/add.cpp
// Function: operator+(Variable const&, double const&)
Variable operator+ (const Variable &left, const double &right) {
    Variable new_var = Variable(false);
    new_var.operation = op::add;
    new_var.child[0] = new Variable();
    *(new_var.child[0]) = left;
    
    new_var.child[1] = new Variable(false);
    new_var.child[1]->value = right;
    new_var.child[1]->operation = op::argument;    
    return new_var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x414c
movl $0x2, 0x8(%rbx)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x10(%rbx)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups 0x20(%r12), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x18(%rbx)
movsd (%r14), %xmm0
movsd %xmm0, (%r15)
movl $0x1, 0x8(%r15)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x536a
movq %rax, %rbx
movq %r15, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/operations/add.cpp
// Function: operator+(double const&, Variable const&)
Variable operator+ (const double &left, const Variable &right) {
    Variable new_var = Variable(false);
    new_var.operation = op::add;
    new_var.child[0] = new Variable(false);
    new_var.child[0]->value = left;
    new_var.child[0]->operation = op::argument;
    new_var.child[1] = new Variable();
    *(new_var.child[1]) = right; 
    return new_var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %rbx
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x414c
movl $0x2, 0x8(%rbx)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x10(%rbx)
movsd (%r12), %xmm0
movsd %xmm0, (%r15)
movl $0x1, 0x8(%r15)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x18(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x556a
movq %rax, %rbx
movq %r15, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/operations/clip.cpp
// Function: Variable::clip(Variable const&, Variable const&)
Variable Variable::clip (const Variable &left, const Variable &right) {
    Variable new_var = Variable();
    new_var.arg = new Variable(); 
    new_var.arg->value = this->value;
    new_var.operation = op::clip;
    new_var.child[0] = new Variable();
    *(new_var.child[0]) = left;
    new_var.child[1] = new Variable();
    *(new_var.child[1]) = right;
    return new_var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x414c
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x28(%rbx)
movsd (%r13), %xmm0
movsd %xmm0, (%r15)
movl $0xa, 0x8(%rbx)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x10(%rbx)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups 0x20(%r12), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x18(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x56ed
jmp 0x56ed
movq %rax, %rbx
movq %r15, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/operations/clip.cpp
// Function: Variable::clip(Variable const&, Variable&)
Variable Variable::clip (const Variable &left, Variable &right) {
    Variable new_var = Variable();
    new_var.arg = new Variable(); 
    new_var.arg->value = this->value;
    new_var.operation = op::clip;
    new_var.child[0] = new Variable(); 
    *(new_var.child[0]) = left;
    new_var.child[1] = &right;
    return new_var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %r14
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x414c
movl $0x30, %edi
callq 0x2190
movq %rax, %r12
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r12, 0x28(%r14)
movsd (%r13), %xmm0
movsd %xmm0, (%r12)
movl $0xa, 0x8(%r14)
movl $0x30, %edi
callq 0x2190
movq %rax, %r12
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r12, 0x10(%r14)
movups (%r15), %xmm0
movups 0x10(%r15), %xmm1
movups 0x20(%r15), %xmm2
movups %xmm2, 0x20(%r12)
movups %xmm1, 0x10(%r12)
movups %xmm0, (%r12)
movq %rbx, 0x18(%r14)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x57b4
movq %rax, %rbx
movq %r12, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
nop
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/operations/clip.cpp
// Function: Variable::clip(Variable const&, double const&)
Variable Variable::clip (const Variable &left, const double &right) {
    Variable new_var = Variable();
    new_var.arg = new Variable(); 
    new_var.arg->value = this->value;
    new_var.operation = op::clip;
    new_var.child[0] = new Variable();
    *(new_var.child[0]) = left;
    new_var.child[1] = new Variable();
    new_var.child[1]->operation = op::argument;
    new_var.child[1]->value = right;
    return new_var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x414c
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x28(%r14)
movsd (%r13), %xmm0
movsd %xmm0, (%r15)
movl $0xa, 0x8(%r14)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x10(%r14)
movups (%r12), %xmm0
movups 0x10(%r12), %xmm1
movups 0x20(%r12), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x18(%r14)
movl $0x1, 0x8(%r15)
movsd (%rbx), %xmm0
movsd %xmm0, (%r15)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x58ab
jmp 0x58ab
movq %rax, %rbx
movq %r15, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/operations/clip.cpp
// Function: Variable::clip(Variable&, Variable const&)
Variable Variable::clip (Variable &left, const Variable &right) {
    Variable new_var = Variable();
    new_var.arg = new Variable(); 
    new_var.arg->value = this->value;
    new_var.operation = op::clip;
    new_var.child[0] = &left;
    new_var.child[1] = new Variable(); 
    *(new_var.child[1]) = right;
    return new_var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x414c
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x28(%rbx)
movsd (%r13), %xmm0
movsd %xmm0, (%r15)
movl $0xa, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movl $0x30, %edi
callq 0x2190
movq %rax, %r15
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r15, 0x18(%rbx)
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm2, 0x20(%r15)
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x596d
movq %rax, %rbx
movq %r15, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
// File: /workspace/github_cpp_makefile_star2_O3/Eshaancoding[P]AutoDiff/src/Variable/operations/clip.cpp
// Function: Variable::clip(Variable&, Variable&)
Variable Variable::clip (Variable &left, Variable &right) {
    Variable new_var = Variable();
    new_var.arg = new Variable(); 
    new_var.arg->value = this->value;
    new_var.operation = op::clip;
    new_var.child[0] = &left;
    new_var.child[1] = &right;
    return new_var;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
xorps %xmm0, %xmm0
movl $0x1, %esi
callq 0x414c
movl $0x30, %edi
callq 0x2190
movq %rax, %r13
xorps %xmm0, %xmm0
movq %rax, %rdi
movl $0x1, %esi
callq 0x414c
movq %r13, 0x28(%r15)
movsd (%r12), %xmm0
movsd %xmm0, (%r13)
movl $0xa, 0x8(%r15)
movq %r14, 0x10(%r15)
movq %rbx, 0x18(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %r13, %rdi
callq 0x2170
movq %rbx, %rdi
callq 0x2250
nop