LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::bigEndianRead(unsigned char const*, unsigned int, unsigned long)
unsigned long Cuckoo::bigEndianRead(const unsigned char* digest, unsigned startPosition, size_t length) {
    unsigned long readNumber = 0;
    for (unsigned i = 0; i < length; ++i) {
        readNumber <<= 8;
        readNumber += digest[startPosition + i];
    }
    return readNumber;
}

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r14
movq %rdi, %rbx
leaq 0x10(%rdi), %r15
movq %r15, (%rdi)
movq (%rsi), %rax
movq 0x8(%rsi), %rdx
addq %rax, %rdx
movq %rax, %rsi
callq 0x3980
cmpq $0x0, 0x8(%r14)
je 0x29c4
leaq 0x2839(%rip), %rsi      # 0x516d
leaq -0x60(%rbp), %rdi
movq %r14, %rdx
callq 0x38f5
leaq 0x2826(%rip), %rsi      # 0x516d
leaq -0x60(%rbp), %rdi
callq 0x22b0
leaq -0x30(%rbp), %r12
movq %r12, -0x10(%r12)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x2975
movq %rdx, -0x40(%rbp)
movq (%rcx), %rdx
movq %rdx, -0x30(%rbp)
jmp 0x297d
movups (%rcx), %xmm0
movups %xmm0, (%r12)
movq 0x8(%rax), %rdx
movq %rdx, -0x38(%rbp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq %rbx, %rdi
callq 0x20c0
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x29b2
callq 0x21c0
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x29c4
callq 0x21c0
movq %rbx, %rax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x29ea
callq 0x21c0
jmp 0x29ea
movq %rax, %r14
leaq -0x50(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a01
callq 0x21c0
jmp 0x2a01
movq %rax, %r14
movq (%rbx), %rdi
cmpq %r15, %rdi
je 0x2a0e
callq 0x21c0
movq %r14, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O1/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::hash(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
unsigned Cuckoo::hash(std::string key, unsigned entries) {
    // Given the following inputs:
    //
    // * `key`, an array of characters.
    // * `N`, an integer

    // 1. Let `hash-value` be the SHA-256 message digest {{RFC6234}} of `key`, truncated to 32 bits, expressed as an integer.
    unsigned char hash[SHA256_DIGEST_LENGTH];
    SHA256_CTX sha256;
    SHA256_Init(&sha256);
    SHA256_Update(&sha256, key.c_str(), key.size());
    SHA256_Final(hash, &sha256);
    // Truncate to 32 bits
    unsigned long hashValue = bigEndianRead((const unsigned char *)hash, SHA256_DIGEST_LENGTH - 4, 4);
    // 2. Return `hash-value` modulo N.
    return hashValue % entries;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x98, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq -0xb0(%rbp), %r15
movq %r15, %rdi
callq 0x2150
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r15, %rdi
callq 0x2260
leaq -0x40(%rbp), %rdi
movq %r15, %rsi
callq 0x22c0
movl $0x1c, %ecx
xorl %eax, %eax
movq %rax, %rdx
shlq $0x8, %rdx
movzbl -0x40(%rbp,%rcx), %eax
orq %rdx, %rax
incq %rcx
cmpq $0x20, %rcx
jne 0x2a5c
movl %ebx, %ecx
xorl %edx, %edx
divq %rcx
movq %rdx, %rax
addq $0x98, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::fingerprint(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
unsigned long Cuckoo::fingerprint(std::string key, unsigned fingerprintSize) {
    // Given the following inputs:
    //
    // * `key`, an array of characters
    // * `f`, an integer indicating the number of output bits

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

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
testl %esi, %esi
je 0x2b16
movl %esi, %ebx
movq %rdi, %r14
leaq -0xb0(%rbp), %r12
movq %r12, %rdi
callq 0x2150
movq (%r14), %rsi
movq 0x8(%r14), %rdx
movq %r12, %rdi
callq 0x2260
leaq -0x40(%rbp), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x22c0
movl $0x100, %esi            # imm = 0x100
subl %ebx, %esi
xorl %r14d, %r14d
movl %esi, %r12d
subl %ebx, %r12d
jb 0x2afb
movq %r15, %rdi
movl %ebx, %edx
callq 0x2bd4
movl %r12d, %esi
testq %rax, %rax
je 0x2ae1
movq %rax, %r14
cmpq $0x1, %r14
adcq $0x0, %r14
movq %r14, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2652(%rip), %rdi      # 0x516f
leaq 0x2536(%rip), %rsi      # 0x505a
leaq 0x2658(%rip), %rcx      # 0x5183
movl $0x12d, %edx            # imm = 0x12D
callq 0x2160
nop
// File: /workspace/github_cpp_makefile_star2_O1/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::alternateHash(unsigned int, unsigned long, unsigned int)
unsigned Cuckoo::alternateHash(unsigned hash1, unsigned long fingerprintValue, unsigned entries) {
    // Given the following inputs:
    //
    // * `hash1`, an integer indicating the previous hash
    // * `fingerprint`, an integer indicating the fingerprint value
    // * `N`, an integer indicating the number of entries in the digest

    // Note: This is not thread safe (but a bit faster)!!!
    static char fingerprintString[20];
    // 1. Let `fingerprint-string` be the value of `fingerprint` in base 10, expressed as a string.
    sprintf((char*)fingerprintString, "%lu", fingerprintValue);
    // 2. Let `h2` be the return value of {{hash}} with `fingerprint-string` and `N` as inputs, XORed with `h1`.
    unsigned long hash2 = hash(std::string(fingerprintString), entries);
    hash2 ^= hash1;
    // 3. Return `hash2`.
    return hash2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r14d
movq %rsi, %rdx
movl %edi, %ebx
leaq 0x463a(%rip), %r15      # 0x7190
leaq 0x2684(%rip), %rsi      # 0x51e1
movq %r15, %rdi
xorl %eax, %eax
callq 0x2080
leaq -0x38(%rbp), %r13
movq %r13, -0x10(%r13)
movq %r15, %rdi
callq 0x2100
leaq (%rax,%r15), %rdx
leaq -0x48(%rbp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x3a1a
movq %r12, %rdi
movl %r14d, %esi
callq 0x2a16
movl %eax, %r14d
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2ba6
callq 0x21c0
xorl %ebx, %r14d
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2bcc
callq 0x21c0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O1/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::readFingerprint(unsigned char const*, unsigned int, unsigned int)
unsigned long Cuckoo::readFingerprint(const unsigned char* hash, unsigned positionInBits, unsigned fingerprintSizeInBits) {
    const float Bits = 8.0;
    unsigned endPositionInBits = positionInBits + fingerprintSizeInBits;
    unsigned startPositionInBytes = floor((float)positionInBits / Bits);
    unsigned endPositionInBytes = ceil((float)endPositionInBits / Bits);
    unsigned lengthInBytes = endPositionInBytes - startPositionInBytes;
    unsigned long hashValue = bigEndianRead((const unsigned char *)(hash), startPositionInBytes, lengthInBytes);
    unsigned extraBitsAtStart = positionInBits - startPositionInBytes * Bits;
    unsigned extraBitsAtEnd = endPositionInBytes * Bits - endPositionInBits;
    unsigned extraBytes = sizeof(hashValue) - lengthInBytes;
    // TODO(yoav): There's probably a better way to do this, but I'm too jetlagged to think.
    hashValue <<= extraBytes * (unsigned)Bits + extraBitsAtStart;
    hashValue >>= extraBytes * (unsigned)Bits + extraBitsAtStart + extraBitsAtEnd;
    return hashValue;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %r14d
movq %rdi, %rbx
movl %esi, %eax
cvtsi2ss %rax, %xmm0
addl %esi, %r14d
movss %xmm0, -0x20(%rbp)
mulss 0x2445(%rip), %xmm0     # 0x5040
callq 0x20f0
cvttss2si %xmm0, %r15
cvtsi2ss %r14, %xmm1
movss %xmm1, -0x1c(%rbp)
movss 0x2429(%rip), %xmm0     # 0x5040
mulss %xmm1, %xmm0
callq 0x2140
cvttss2si %xmm0, %rsi
movl %esi, %edx
subl %r15d, %edx
jne 0x2c30
xorl %eax, %eax
jmp 0x2c4d
movl %edx, %ecx
xorl %eax, %eax
movl %r15d, %edi
shlq $0x8, %rax
movl %edi, %r8d
movzbl (%rbx,%r8), %r8d
orq %r8, %rax
incl %edi
decq %rcx
jne 0x2c37
movl %r15d, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
movss 0x23e4(%rip), %xmm1     # 0x5044
mulss %xmm1, %xmm0
movss -0x20(%rbp), %xmm2
subss %xmm0, %xmm2
cvttss2si %xmm2, %rcx
movl %esi, %esi
xorps %xmm0, %xmm0
cvtsi2ss %rsi, %xmm0
mulss %xmm1, %xmm0
subss -0x1c(%rbp), %xmm0
shll $0x3, %edx
subl %edx, %ecx
shlq %cl, %rax
cvttss2si %xmm0, %rdx
addl %edx, %ecx
addl $0x40, %ecx
shrq %cl, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: Cuckoo::writeFingerprint(unsigned char*, unsigned int, unsigned int, unsigned long)
void Cuckoo::writeFingerprint(unsigned char* hash, unsigned positionInBits, unsigned fingerprintSizeInBits, unsigned long fingerprintValue) {
    const float Bits = 8.0;
    unsigned endPositionInBits = positionInBits + fingerprintSizeInBits;
    unsigned startPositionInBytes = floor((float)positionInBits / Bits);
    unsigned endPositionInBytes = ceil((float)endPositionInBits / Bits);
    unsigned lengthInBytes = endPositionInBytes - startPositionInBytes;
    unsigned long hashValue = bigEndianRead((const unsigned char *)(hash), startPositionInBytes, lengthInBytes);
    unsigned extraBitsAtStart = positionInBits - startPositionInBytes * Bits;
    unsigned extraBitsAtEnd = endPositionInBytes * Bits - endPositionInBits;
    unsigned extraBytes = sizeof(hashValue) - lengthInBytes;
    unsigned long bitmap = -1;
    bitmap >>= extraBitsAtEnd + fingerprintSizeInBits;
    bitmap <<= extraBitsAtEnd + fingerprintSizeInBits;
    bitmap += (unsigned)(pow(2, extraBitsAtEnd)) - 1;
    hashValue &= bitmap;
    fingerprintValue <<= extraBitsAtEnd;
    hashValue |= fingerprintValue;
    bigEndianWrite(hash, startPositionInBytes, lengthInBytes, hashValue);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
movl %esi, %eax
cvtsi2ss %rax, %xmm0
movq %rdi, %r14
movq %rdx, -0x38(%rbp)
leal (%rdx,%rsi), %r15d
mulss 0x236c(%rip), %xmm0     # 0x5040
callq 0x20f0
cvttss2si %xmm0, %r12
cvtsi2ss %r15, %xmm1
movss %xmm1, -0x2c(%rbp)
movss 0x2350(%rip), %xmm0     # 0x5040
mulss %xmm1, %xmm0
callq 0x2140
cvttss2si %xmm0, %r13
movl %r13d, %eax
subl %r12d, %eax
movl %eax, -0x30(%rbp)
jne 0x2d0e
xorl %r15d, %r15d
jmp 0x2d2a
movl %eax, %eax
xorl %r15d, %r15d
shlq $0x8, %r15
movl %r12d, %ecx
movzbl (%r14,%rcx), %ecx
orq %rcx, %r15
incl %r12d
decq %rax
jne 0x2d13
movl %r13d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
mulss 0x2307(%rip), %xmm0     # 0x5044
subss -0x2c(%rbp), %xmm0
cvttss2si %xmm0, %r12
movl %r12d, %eax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
callq 0x21b0
movl -0x30(%rbp), %esi
decl %esi
js 0x2da0
movq -0x38(%rbp), %rcx
addl %r12d, %ecx
movq $-0x1, %rax
shlq %cl, %rax
cvttsd2si %xmm0, %rdx
decl %edx
addq %rax, %rdx
andq %r15, %rdx
movl %r12d, %ecx
shlq %cl, %rbx
orq %rdx, %rbx
movl %esi, %eax
incq %rax
decl %r13d
movl %r13d, %ecx
movb %bl, (%r14,%rcx)
shrq $0x8, %rbx
decl %r13d
decq %rax
jg 0x2d8d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/yoavweiss[P]cache-digests-cuckoo/cuckoo.cpp
// Function: hex(unsigned char)
unsigned char hex(unsigned char input) {
    if (input >= '0' && input <= '9')
        return input - '0';
    if (input >= 'a' && input <= 'f') {
        return 10 + input - 'a';
    }
    if (input >= 'A' && input <= 'F') {
        return 10 + input - 'A';
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
leal -0x30(%rdi), %eax
cmpb $0xa, %al
jb 0x3375
leal -0x61(%rdi), %eax
cmpb $0x5, %al
ja 0x3363
addb $-0x57, %dil
movl %edi, %eax
jmp 0x3375
leal -0x41(%rdi), %eax
addb $-0x37, %dil
xorl %ecx, %ecx
cmpb $0x6, %al
movzbl %dil, %eax
cmovael %ecx, %eax
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/matrix.cpp
// Function: Matrix3::RotX(double)
void Matrix3::RotX (double theta) {
  if (theta == 0.0) {
    Identity();
  } else {
    Set(0, 1.0); Set(1, 0.0);        Set(2, 0.0);
    Set(3, 0.0); Set(4, cos(theta)); Set(5, -sin(theta));
    Set(6, 0.0); Set(7, sin(theta)); Set(8,  cos(theta));
    identity = false;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x5523
jp 0x5523
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rbx)
movupd %xmm0, 0x20(%rbx)
movupd %xmm0, 0x10(%rbx)
movupd %xmm0, (%rbx)
movq $0x0, 0x40(%rbx)
movq $-0x4, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x20(%rbx,%rax,8)
addq $0x4, %rax
cmpq $0x5, %rax
jb 0x550f
movb $0x1, %r14b
jmp 0x5586
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, (%rbx)
xorpd %xmm1, %xmm1
movupd %xmm1, 0x8(%rbx)
xorl %r14d, %r14d
movq %r14, 0x18(%rbx)
movsd %xmm0, (%rsp)
callq 0x4380
movsd %xmm0, 0x20(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
xorps 0x7b10(%rip), %xmm0     # 0xd070
movlps %xmm0, 0x28(%rbx)
movq %r14, 0x30(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x38(%rbx)
movsd (%rsp), %xmm0
callq 0x4380
movsd %xmm0, 0x40(%rbx)
movb %r14b, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/matrix.cpp
// Function: Matrix3::RotY(double)
void Matrix3::RotY (double theta) {
  if (theta == 0.0) {
    Identity();
  } else {
    Set(0, cos(theta)); Set(1, 0.0); Set(2, -sin(theta));
    Set(3, 0.0);        Set(4, 1.0); Set(5, 0.0);
    Set(6, sin(theta)); Set(7, 0.0); Set(8, cos(theta));
    identity = false;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x55e9
jp 0x55e9
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rbx)
movupd %xmm0, 0x20(%rbx)
movupd %xmm0, 0x10(%rbx)
movupd %xmm0, (%rbx)
movq $0x0, 0x40(%rbx)
movq $-0x4, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x20(%rbx,%rax,8)
addq $0x4, %rax
cmpq $0x5, %rax
jb 0x55d5
movb $0x1, %r14b
jmp 0x564b
movsd %xmm0, (%rsp)
callq 0x4380
movsd %xmm0, (%rbx)
xorl %r14d, %r14d
movq %r14, 0x8(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
xorps 0x7a61(%rip), %xmm0     # 0xd070
movlps %xmm0, 0x10(%rbx)
movq %r14, 0x18(%rbx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x20(%rbx)
movq %r14, 0x28(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x30(%rbx)
movq %r14, 0x38(%rbx)
movsd (%rsp), %xmm0
callq 0x4380
movsd %xmm0, 0x40(%rbx)
movb %r14b, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/matrix.cpp
// Function: Matrix3::RotZ(double)
void Matrix3::RotZ (double theta) {
  if (theta == 0.0) {
    Identity();
  } else {
    Set(0, cos(theta)); Set(1, -sin(theta)); Set(2, 0.0);
    Set(3, sin(theta)); Set(4,  cos(theta)); Set(5, 0.0);
    Set(6, 0.0);        Set(7, 0.0);         Set(8, 1.0);
    identity = false;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x56af
jp 0x56af
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rbx)
movupd %xmm0, 0x20(%rbx)
movupd %xmm0, 0x10(%rbx)
movupd %xmm0, (%rbx)
movq $0x0, 0x40(%rbx)
movq $-0x4, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x20(%rbx,%rax,8)
addq $0x4, %rax
cmpq $0x5, %rax
jb 0x569b
movb $0x1, %r14b
jmp 0x5712
movsd %xmm0, (%rsp)
callq 0x4380
movsd %xmm0, (%rbx)
movsd (%rsp), %xmm0
callq 0x4070
xorps 0x79a2(%rip), %xmm0     # 0xd070
movlps %xmm0, 0x8(%rbx)
xorl %r14d, %r14d
movq %r14, 0x10(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x18(%rbx)
movsd (%rsp), %xmm0
callq 0x4380
movsd %xmm0, 0x20(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x28(%rbx)
movq %r14, 0x38(%rbx)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x40(%rbx)
movb %r14b, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/matrix.cpp
// Function: Matrix3::Mult(Matrix3 const&, Matrix3 const&)
void Matrix3::Mult (const Matrix3& m1, const Matrix3& m2) 
{ 
  if (m1.identity) {
    if (m2.identity) {
      Identity();
    } else {
      Copy(m2);
    }
  } else if (m2.identity) {
    Copy(m1);
  } else {
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
	double x = 0.0;
	x += m1.Get(i,0) * m2.Get(0,j);
	x += m1.Get(i,1) * m2.Get(1,j);
	x += m1.Get(i,2) * m2.Get(2,j);
	Set(i,j,x);
      }
    }
    identity = false; // We could check the indices at this point
  }
}

// Assembly:
movb 0x48(%rsi), %al
movb 0x48(%rdx), %cl
cmpb $0x1, %al
jne 0x57fa
testb %cl, %cl
je 0x5815
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rdi)
movupd %xmm0, 0x20(%rdi)
movupd %xmm0, 0x10(%rdi)
movupd %xmm0, (%rdi)
movq $0x0, 0x40(%rdi)
movq $-0x4, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
movq %rcx, 0x20(%rdi,%rax,8)
addq $0x4, %rax
cmpq $0x5, %rax
jb 0x57e4
movb $0x1, %al
jmp 0x5890
testb %cl, %cl
je 0x582e
xorl %ecx, %ecx
movsd (%rsi,%rcx,8), %xmm0
movsd %xmm0, (%rdi,%rcx,8)
incq %rcx
cmpq $0x9, %rcx
jne 0x5800
jmp 0x5890
xorl %eax, %eax
movsd (%rdx,%rax,8), %xmm0
movsd %xmm0, (%rdi,%rax,8)
incq %rax
cmpq $0x9, %rax
jne 0x5817
movl %ecx, %eax
jmp 0x5890
xorl %eax, %eax
xorpd %xmm0, %xmm0
movq %rdi, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
movsd (%rsi,%rax,8), %xmm1
movsd 0x18(%rsi,%rax,8), %xmm2
mulsd (%rdx,%r8), %xmm1
addsd %xmm0, %xmm1
incq %r9
mulsd 0x8(%rdx,%r8), %xmm2
addsd %xmm1, %xmm2
movsd 0x30(%rsi,%rax,8), %xmm1
mulsd 0x10(%rdx,%r8), %xmm1
addsd %xmm2, %xmm1
movsd %xmm1, (%rcx,%r8)
addq $0x18, %r8
cmpq $0x3, %r9
jne 0x583d
incq %rax
addq $0x8, %rcx
cmpq $0x3, %rax
jne 0x5837
xorl %eax, %eax
movb %al, 0x48(%rdi)
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/matrix.cpp
// Function: Matrix3::Apply(double&, double&, double&) const
void Matrix3::Apply (double& x, double& y, double& z) const
{
  if (!identity) {
    double x1 = Get(0) * x + Get(1) * y + Get(2) * z;
    double y1 = Get(3) * x + Get(4) * y + Get(5) * z;
    double z1 = Get(6) * x + Get(7) * y + Get(8) * z;
    x = x1; y = y1; z = z1;
  }
}

// Assembly:
cmpb $0x0, 0x48(%rdi)
jne 0x590e
movsd (%rsi), %xmm0
movsd (%rdx), %xmm1
movsd 0x8(%rdi), %xmm2
mulsd %xmm1, %xmm2
movsd (%rdi), %xmm3
mulsd %xmm0, %xmm3
addsd %xmm2, %xmm3
movsd (%rcx), %xmm2
movsd 0x10(%rdi), %xmm4
mulsd %xmm2, %xmm4
addsd %xmm3, %xmm4
movsd 0x20(%rdi), %xmm3
mulsd %xmm1, %xmm3
movsd 0x18(%rdi), %xmm5
mulsd %xmm0, %xmm5
addsd %xmm3, %xmm5
movsd 0x28(%rdi), %xmm3
mulsd %xmm2, %xmm3
mulsd 0x38(%rdi), %xmm1
mulsd 0x30(%rdi), %xmm0
addsd %xmm5, %xmm3
addsd %xmm1, %xmm0
mulsd 0x40(%rdi), %xmm2
addsd %xmm0, %xmm2
movsd %xmm4, (%rsi)
movsd %xmm3, (%rdx)
movsd %xmm2, (%rcx)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/matrix.cpp
// Function: Matrix3::ApplyLatLong(double&, double&) const
void Matrix3::ApplyLatLong (double& phi, double& lambda) const
{
  if (!identity) {
    double x = cos(lambda) * cos(phi);
    double y = sin(lambda) * cos(phi);
    double z = sin(phi);
    Apply(x,y,z);
    phi = asin(z);
    lambda = atan2(y,x);
  }
}

// Assembly:
cmpb $0x0, 0x48(%rdi)
jne 0x59dc
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movsd (%rdx), %xmm0
callq 0x4380
movsd %xmm0, 0x8(%rsp)
movsd (%r14), %xmm0
callq 0x4380
mulsd 0x8(%rsp), %xmm0
leaq 0x20(%rsp), %r12
movsd %xmm0, (%r12)
movsd (%rbx), %xmm0
callq 0x4070
movsd %xmm0, 0x8(%rsp)
movsd (%r14), %xmm0
callq 0x4380
mulsd 0x8(%rsp), %xmm0
leaq 0x18(%rsp), %r13
movsd %xmm0, (%r13)
movsd (%r14), %xmm0
callq 0x4070
leaq 0x10(%rsp), %rbp
movsd %xmm0, (%rbp)
movq %r15, %rdi
movq %r12, %rsi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x5894
movsd (%rbp), %xmm0
callq 0x4300
movsd %xmm0, (%r14)
movsd (%r13), %xmm0
movsd (%r12), %xmm1
callq 0x4050
movsd %xmm0, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: convertlatlong(double&, double&, double&, double&, double&, Matrix3 const&)
void convertlatlong(double &phi, double &lambda, 
		    double& x, double& y, double& z,
		    const Matrix3& m)
{
  x = cos(lambda) * cos(phi);
  y = sin(lambda) * cos(phi);
  z = sin(phi);
  if (!m.IsIdentity()) {
    m.Apply(x,y,z);
    phi = asin(z);
    lambda = atan2(y,x);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %rbp
movq %r8, %r13
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r12
movsd (%rsi), %xmm0
callq 0x4380
movsd %xmm0, (%rsp)
movsd (%r12), %xmm0
callq 0x4380
mulsd (%rsp), %xmm0
movsd %xmm0, (%r14)
movsd (%rbx), %xmm0
callq 0x4070
movsd %xmm0, (%rsp)
movsd (%r12), %xmm0
callq 0x4380
mulsd (%rsp), %xmm0
movsd %xmm0, (%r15)
movsd (%r12), %xmm0
callq 0x4070
movsd %xmm0, (%r13)
cmpb $0x0, 0x48(%rbp)
jne 0x5a8f
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x5894
movsd (%r13), %xmm0
callq 0x4300
movsd %xmm0, (%r12)
movsd (%r15), %xmm0
movsd (%r14), %xmm1
callq 0x4050
movsd %xmm0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: distance(double, double, double, double)
double distance(double phi0, double lambda0, double phi1, double lambda1)
{
  double x0 = cos(lambda0) * cos(phi0);
  double y0 = sin(lambda0) * cos(phi0);
  double z0 = sin(phi0);
  double x1 = cos(lambda1) * cos(phi1);
  double y1 = sin(lambda1) * cos(phi1);
  double z1 = sin(phi1);
  double d = acos((x0*x1 + y0*y1 + z0*z1));
  return d;
}

// Assembly:
subq $0x38, %rsp
movsd %xmm3, 0x8(%rsp)
movsd %xmm2, 0x28(%rsp)
movsd %xmm1, 0x18(%rsp)
movsd %xmm0, 0x20(%rsp)
movaps %xmm1, %xmm0
callq 0x4380
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4380
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4380
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4380
movsd %xmm0, 0x30(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x4380
mulsd 0x30(%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x4380
mulsd 0x8(%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
addsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x4070
mulsd 0x20(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
addq $0x38, %rsp
jmp 0x41f0
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Transform::CheckPoint(TransformParams const&, double, double) const
bool Transform::CheckPoint(const TransformParams &params, double phi, double lambda) const
{
  if (params.radius != 0 && 
      distance(phi,lambda,params.lat,params.lon) > params.radius) {
    return false;
  }
  return true;
}

// Assembly:
movaps %xmm0, %xmm2
movsd 0x30(%rsi), %xmm0
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm0
jne 0x6208
jnp 0x6317
pushq %rbx
subq $0x30, %rsp
movq %rsi, %rbx
movsd 0x18(%rsi), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x20(%rsi), %xmm0
movsd %xmm0, (%rsp)
movaps %xmm1, %xmm0
movsd %xmm2, 0x18(%rsp)
movsd %xmm1, 0x10(%rsp)
callq 0x4380
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4380
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4380
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x18(%rsp)
movsd (%rsp), %xmm0
callq 0x4380
movsd %xmm0, 0x28(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4380
mulsd 0x28(%rsp), %xmm0
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd (%rsp), %xmm0
callq 0x4070
movsd %xmm0, (%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4380
mulsd (%rsp), %xmm0
mulsd 0x10(%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4070
mulsd 0x18(%rsp), %xmm0
addsd (%rsp), %xmm0
callq 0x41f0
ucomisd 0x30(%rbx), %xmm0
leaq 0x30(%rsp), %rsp
popq %rbx
jbe 0x6317
xorl %eax, %eax
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: applyRotation(double, double&, double&)
void applyRotation(double r, double &x, double &y)
{
  double x1 =  x * cos(r) + y * sin(r);
  double y1 = -x * sin(r) + y * cos(r);
  //double x1 = -y;
  //double y1 = x;
  //fprintf(stderr,"%g %g:", x, y);
  x = x1;
  y = y1;
  //fprintf(stderr,"%g %g\n", x, y);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd %xmm0, 0x18(%rsp)
movsd (%rdi), %xmm1
movsd %xmm1, 0x8(%rsp)
callq 0x4380
movsd %xmm0, 0x10(%rsp)
movsd (%rbx), %xmm0
movsd %xmm0, (%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4070
mulsd (%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x10(%rsp)
movsd (%r14), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4070
movsd %xmm0, (%rsp)
movsd (%rbx), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4380
mulsd 0x20(%rsp), %xmm0
movsd (%rsp), %xmm1
mulsd 0x8(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd 0x10(%rsp), %xmm1
movsd %xmm1, (%r14)
movsd %xmm0, (%rbx)
addq $0x28, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Transform::SetDataInv(Image const&, Image&, TransformParams const&, double, double, double, double, unsigned int)
bool Transform::SetDataInv(const Image& inImage, Image& outImage,
			   const TransformParams& params,
			   double ox, double oy, // Coordinates in output image
			   double x, double y,   // scaled coordinates in input image
			   unsigned int outIndex)	     
{
  (void(ox));
  (void(oy));
  int iw = inImage.Width();
  int ih = inImage.Height();
  double orgx = 0.5 * iw;
  double orgy = 0.5 * ih;

  // Scale so that half width is 1
  double scaleFactor = BasicScale(iw,ih) / params.scale;

  // This is what we are inverting
  //double x = scaleFactor * (ix - orgx) + params.xoff;
  //double y = scaleFactor * (orgy - iy) + params.yoff;
  //applyRotation(-params.rotate,x,y)
  
  if (params.rotate != 0) {
    applyRotation(params.rotate,x,y);
  }
  int ix = int(floor(orgx + (x - params.xoff) / scaleFactor));
  int iy = int(floor(orgy - (y - params.yoff) / scaleFactor));

  if (ix < 0 || ix >= iw || iy < 0 || iy >= ih) {
    return false;
  } else {
    Rgb rgb;
    unsigned int inIndex = iy * iw + ix;
    inImage.GetRgb(inIndex, rgb);
    outImage.SetRgb(outIndex, rgb);
    return true;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %r8d, 0x24(%rsp)
movsd %xmm3, (%rsp)
movsd %xmm2, 0x18(%rsp)
movq %rcx, %r13
movq %rdx, %r14
movq %rsi, %r15
movl (%rsi), %ebp
movl 0x8(%rsi), %r12d
cvtsi2sd %ebp, %xmm1
movsd 0x6ae5(%rip), %xmm0     # 0xd438
mulsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %r12d, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x40(%rsp)
movq (%rdi), %rax
movl %ebp, %esi
movl %r12d, %edx
callq *0x18(%rax)
divsd 0x28(%r13), %xmm0
movsd %xmm0, 0x28(%rsp)
movsd 0x10(%r13), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6998
jnp 0x6a0d
movsd %xmm0, 0x10(%rsp)
callq 0x4380
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x4070
mulsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x30(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x4380
mulsd (%rsp), %xmm0
movsd 0x30(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm1
jmp 0x6a13
movsd 0x18(%rsp), %xmm1
subsd 0xb0(%r13), %xmm1
divsd 0x28(%rsp), %xmm1
movsd 0x38(%rsp), %xmm0
addsd %xmm1, %xmm0
callq 0x4320
cvttsd2si %xmm0, %ebx
movsd (%rsp), %xmm1
subsd 0xb8(%r13), %xmm1
divsd 0x28(%rsp), %xmm1
movsd 0x40(%rsp), %xmm0
subsd %xmm1, %xmm0
callq 0x4320
xorl %eax, %eax
testl %ebx, %ebx
js 0x6aa1
cmpl %ebp, %ebx
jge 0x6aa1
cvttsd2si %xmm0, %ecx
testl %ecx, %ecx
js 0x6aa1
cmpl %r12d, %ecx
jge 0x6aa1
imull %ebp, %ecx
movl %ebx, %eax
addq %rcx, %rax
movq 0x10(%r15), %rcx
addq %rax, %rcx
addq %rax, %rcx
movzwl (%rcx,%rax), %edx
movb 0x2(%rcx,%rax), %al
movl 0x24(%rsp), %ecx
movq 0x10(%r14), %rsi
addq %rcx, %rsi
addq %rcx, %rsi
movw %dx, (%rcx,%rsi)
movb %al, 0x2(%rcx,%rsi)
movb $0x1, %al
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Transform::MapXY(Image const&, TransformParams const&, double, double, double&, double&) const
bool Transform::MapXY(const Image& outImage, 
		      const TransformParams& params,
		      double phi, double lambda, double& x, double& y) const
{
  bool result = false;
  // Set x and y to where phi and lambda are mapped to
  // x, y are in image coordinates
  // Get projection coordinates for x and y
  if (CheckPoint(params,phi,lambda) &&
      ProjectInv(params, phi,lambda, x, y)) {
    // Now x and y are in 2pi scale
    int ow = outImage.Width();
    int oh = outImage.Height();
    double orgx = 0.5 * ow;
    double orgy = 0.5 * oh;
    double scaleFactor = BasicScale(ow,oh) / params.scale;
    if (params.rotate != 0) {
      applyRotation(params.rotate,x,y);
    }
    x = orgx + (x - params.xoff) / scaleFactor;
    y = orgy + (y - params.yoff) / -scaleFactor;
    result = true;
  }
  return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %r8, %rbx
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %r13
movq %rdi, %r12
movq (%rdi), %rax
movq %rdx, %rsi
movsd %xmm0, (%rsp)
movsd %xmm1, 0x8(%rsp)
callq *0x30(%rax)
testb %al, %al
je 0x6c59
movq (%r12), %rax
movq %r12, %rdi
movq %r14, %rsi
movsd (%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movq %r15, %rdx
movq %rbx, %rcx
callq *0x28(%rax)
testb %al, %al
je 0x6c59
movl (%r13), %esi
movl 0x8(%r13), %edx
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
movsd 0x6913(%rip), %xmm0     # 0xd438
mulsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, 0x38(%rsp)
movq (%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movapd %xmm0, %xmm2
divsd 0x28(%r14), %xmm2
movsd 0x10(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x6b6a
jnp 0x6c15
movsd (%r15), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd %xmm2, 0x28(%rsp)
movsd %xmm0, 0x8(%rsp)
callq 0x4380
movsd %xmm0, (%rsp)
movsd (%rbx), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4070
mulsd 0x10(%rsp), %xmm0
movsd (%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
movsd (%r15), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x10(%rsp)
movsd (%rbx), %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4380
movsd 0x28(%rsp), %xmm2
mulsd 0x20(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
mulsd 0x18(%rsp), %xmm1
subsd %xmm1, %xmm0
movsd (%rsp), %xmm1
movsd %xmm1, (%r15)
movsd %xmm0, (%rbx)
movsd (%r15), %xmm0
subsd 0xb0(%r14), %xmm0
divsd %xmm2, %xmm0
movsd 0x30(%rsp), %xmm1
addsd %xmm0, %xmm1
movsd %xmm1, (%r15)
movsd (%rbx), %xmm0
subsd 0xb8(%r14), %xmm0
divsd %xmm2, %xmm0
movsd 0x38(%rsp), %xmm1
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
movb $0x1, %al
jmp 0x6c5b
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: PolarTransform::Init(TransformParams const&)
void PolarTransform::Init (const TransformParams& params)
{
  Transform::Init(params);

  // Polar transforms have the north pole as the centre.
  // For consistency with other transforms, we rotate to set lat = 0
  m = Matrix3(YAxis,-piovertwo) * m;
  minv = minv * Matrix3(YAxis,piovertwo);

  k = params.conic;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
callq 0x5c62
movq %rsp, %r15
movsd 0x5ea2(%rip), %xmm0     # 0xd028
movq %r15, %rdi
movl $0x1, %esi
callq 0x54b0
leaq 0x8(%rbx), %r12
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5756
movl $0x9, %ecx
movq %r12, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movb 0x48(%r13), %al
movb %al, 0x50(%rbx)
leaq 0x58(%rbx), %r15
movq %rsp, %r12
movsd 0x5e52(%rip), %xmm0     # 0xd020
movq %r12, %rdi
movl $0x1, %esi
callq 0x54b0
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x5756
movl $0x9, %ecx
movq %r15, %rdi
movq %r13, %rsi
rep  movsq (%rsi), %es:(%rdi)
movb 0x48(%r13), %al
movb %al, 0xa0(%rbx)
movsd 0xa0(%r14), %xmm0
movsd %xmm0, 0xc0(%rbx)
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: PolarTransform::Project(TransformParams const&, double, double, double&, double&, double&, double&, double&) const
bool PolarTransform::Project(const TransformParams& params,
			     double x0, double y0, 
			     double& x, double& y, double& z,
			     double& phi, double& lambda) const
{
  bool result = false;
  double r = sqrt(sqr(x0) + sqr(y0)) - params.conicr;
  lambda = params.conic * atan2(x0, -y0);
  if (r > 0.0 && lambda >= -pi && lambda <= pi) {
    GetPhi(r, phi);
    if (phi >= -piovertwo && phi <= piovertwo) {
      convertlatlong(phi,lambda,x,y,z,m);
      result = true;
    }
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r15
movq %r8, 0x20(%rsp)
movq %rcx, %r14
movq %rdx, %r12
movapd %xmm0, %xmm3
movq %rsi, %rbp
movq %rdi, %r13
movq 0x60(%rsp), %rbx
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movapd %xmm1, %xmm0
mulsd %xmm1, %xmm0
addsd %xmm2, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
jb 0x7277
sqrtsd %xmm0, %xmm0
jmp 0x7294
movapd %xmm1, 0x10(%rsp)
movsd %xmm3, 0x8(%rsp)
callq 0x4190
movsd 0x8(%rsp), %xmm3
movapd 0x10(%rsp), %xmm1
subsd 0xa8(%rbp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0xa0(%rbp), %xmm0
movsd %xmm0, 0x8(%rsp)
xorpd 0x5db8(%rip), %xmm1     # 0xd070
movapd %xmm3, %xmm0
callq 0x4050
movsd 0x10(%rsp), %xmm2
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rbx)
xorl %eax, %eax
ucomisd 0x6185(%rip), %xmm2     # 0xd460
jbe 0x7342
andpd 0x611b(%rip), %xmm0     # 0xd400
movsd 0x5d1b(%rip), %xmm1     # 0xd008
ucomisd %xmm0, %xmm1
jb 0x7342
movq (%r13), %rax
movq %r13, %rdi
movapd %xmm2, %xmm0
movq %r15, %rsi
callq *0x48(%rax)
movsd (%r15), %xmm0
andpd 0x60ef(%rip), %xmm0     # 0xd400
movsd 0x5d07(%rip), %xmm1     # 0xd020
ucomisd %xmm0, %xmm1
jae 0x7323
xorl %eax, %eax
jmp 0x7342
addq $0x8, %r13
movq %r15, %rdi
movq %rbx, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq 0x20(%rsp), %r8
movq %r13, %r9
callq 0x59e0
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: PolarTransform::ProjectInv(TransformParams const&, double, double, double&, double&) const
bool PolarTransform::ProjectInv(const TransformParams& params,
				double phi, double lambda,
				double& x, double& y) const
{
  bool result = false;
  // Set x and y to where phi and lambda are mapped to
  // x, y are in image coordinates
  // Get projection coordinates for x and y
  double x0,y0,z0;
  convertlatlong(phi,lambda,x0,y0,z0,minv);
  double r = 0.0;
  if (GetR(phi, r)) {
    x = (r + params.conicr) * sin(lambda / params.conic);
    y = -(r + params.conicr) * cos(lambda / params.conic);
    result = true;
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rcx, %rbx
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %r12
leaq 0x50(%rsp), %r13
movsd %xmm0, (%r13)
leaq 0x30(%rsp), %rsi
movsd %xmm1, (%rsi)
leaq 0x58(%rdi), %r9
leaq 0x48(%rsp), %rdx
leaq 0x40(%rsp), %rcx
leaq 0x38(%rsp), %r8
movq %r13, %rdi
callq 0x59e0
leaq 0x8(%rsp), %rsi
movq $0x0, (%rsi)
movsd (%r13), %xmm0
movq (%r12), %rax
movq %r12, %rdi
callq *0x50(%rax)
movl %eax, %ebp
testb %al, %al
je 0x7432
movsd 0x8(%rsp), %xmm0
addsd 0xa8(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x28(%rsp)
divsd 0xa0(%r14), %xmm0
callq 0x4070
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, (%r15)
movsd 0x8(%rsp), %xmm0
addsd 0xa8(%r14), %xmm0
xorpd 0x5c62(%rip), %xmm0     # 0xd070
movapd %xmm0, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
divsd 0xa0(%r14), %xmm0
callq 0x4380
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rbx)
movl %ebp, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: CylindricalTransform::Project(TransformParams const&, double, double, double&, double&, double&, double&, double&) const
bool CylindricalTransform::Project(const TransformParams& params,
				   double x0, double y0, 
				   double& x, double& y, double& z,
				   double& phi, double& lambda) const
{
  (void(params));
  (void(y0));
  bool result = false;

  phi = phi0;
  lambda = GetLong(x0);

  if (lambda >= -pi && lambda <= pi && 
      phi >= -piovertwo && phi <= piovertwo) {
    // Transform to new lat and long.
    // cartesian coords from latlong
    convertlatlong(phi,lambda,x,y,z,m);
    result = true;
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r13
movq %rdi, %r15
movq 0x40(%rsp), %rbp
movsd 0xc0(%rdi), %xmm1
movsd %xmm1, (%r9)
movq (%rdi), %rax
callq *0x58(%rax)
movsd %xmm0, (%rbp)
andpd 0x5f7d(%rip), %xmm0     # 0xd400
movsd 0x5b7d(%rip), %xmm1     # 0xd008
ucomisd %xmm0, %xmm1
jb 0x74ad
movsd (%r12), %xmm0
andpd 0x5f61(%rip), %xmm0     # 0xd400
movsd 0x5b79(%rip), %xmm1     # 0xd020
ucomisd %xmm0, %xmm1
jae 0x74b1
xorl %eax, %eax
jmp 0x74ce
addq $0x8, %r15
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %r15, %r9
callq 0x59e0
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Mercator::GetLat(double)
double Mercator::GetLat(double y)
{
  double k = exp(fabs(y));
  double phi = acos(2*k/(k*k+1));
  if (y < 0) phi = -phi;
  return phi;
}

// Assembly:
subq $0x18, %rsp
movapd %xmm0, %xmm1
movapd %xmm0, (%rsp)
movapd 0x5c8f(%rip), %xmm0     # 0xd400
andpd %xmm1, %xmm0
callq 0x4360
movapd %xmm0, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm0
addsd 0x58ba(%rip), %xmm0     # 0xd048
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x41f0
movapd 0x58cd(%rip), %xmm1     # 0xd070
xorpd %xmm0, %xmm1
xorpd %xmm2, %xmm2
movapd (%rsp), %xmm3
cmpltsd %xmm2, %xmm3
movapd %xmm3, %xmm2
andnpd %xmm0, %xmm2
andpd %xmm1, %xmm3
orpd %xmm2, %xmm3
movapd %xmm3, %xmm0
addq $0x18, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Mercator::GetXY(double, double, double&, double&) const
bool Mercator::GetXY(double phi, double lambda, double& x, double& y) const
{
  x = lambda;
  y = log((1 + sin(fabs(phi))) / cos(fabs(phi)));
  if (phi < 0) {
    y = -y;
  }
  return true;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movapd %xmm0, %xmm2
movapd %xmm0, 0x10(%rsp)
movsd %xmm1, (%rsi)
movapd 0x5c12(%rip), %xmm0     # 0xd400
andpd %xmm2, %xmm0
callq 0x4070
addsd 0x5849(%rip), %xmm0     # 0xd048
movsd %xmm0, 0x8(%rsp)
movapd 0x10(%rsp), %xmm0
callq 0x4380
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x41a0
movapd 0x5845(%rip), %xmm1     # 0xd070
xorpd %xmm0, %xmm1
xorpd %xmm2, %xmm2
movapd 0x10(%rsp), %xmm3
cmpltsd %xmm2, %xmm3
movapd %xmm3, %xmm2
andnpd %xmm0, %xmm2
andpd %xmm1, %xmm3
orpd %xmm2, %xmm3
movlpd %xmm3, (%rbx)
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Rectilinear::GetR(double, double&) const
bool Rectilinear::GetR(double phi, double& r) const
{
  bool result = false;
  if (phi >= 0.0) {
    r = cos(phi);
    result = true;
  }
  return result;
}

// Assembly:
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x790e
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4380
xorpd %xmm1, %xmm1
movsd %xmm0, (%rbx)
movsd 0x8(%rsp), %xmm0
addq $0x10, %rsp
popq %rbx
ucomisd %xmm1, %xmm0
setae %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Gnomonic::GetR(double, double&) const
bool Gnomonic::GetR(double phi, double& r) const
{
  bool result = false;
  if (phi > 0) {
    r = 1 / (2 * tan(phi));
    result = true;
  }
  return result;
}

// Assembly:
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x7a20
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4110
addsd %xmm0, %xmm0
movsd 0x563f(%rip), %xmm1     # 0xd048
divsd %xmm0, %xmm1
movsd 0x8(%rsp), %xmm0
movsd %xmm1, (%rbx)
xorpd %xmm1, %xmm1
addq $0x10, %rsp
popq %rbx
ucomisd %xmm1, %xmm0
seta %al
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Hammer::ProjectSimple(double, double, double&, double&) const
bool Hammer::ProjectSimple(double x, double y, 
			   double& phi, double& lambda) const
{
  bool result = false;
  double z2 = 2-sqr(x)-sqr(2*y);
  double z = sqrt(z2);
  double t1 = 2*y*z;
  if (t1 >= -1.0 && t1 <= 1.0) {
    phi = asin(t1);
    lambda = 2 * atan2(x*z,z2 - 1);
    if (lambda >= -pi && lambda <= pi) {
      result = true;
    }
  }
  return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movsd %xmm0, 0x18(%rsp)
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movsd 0x5a17(%rip), %xmm0     # 0xd468
subsd %xmm2, %xmm0
addsd %xmm1, %xmm1
movapd %xmm1, %xmm2
mulsd %xmm1, %xmm2
subsd %xmm2, %xmm0
xorpd %xmm2, %xmm2
ucomisd %xmm2, %xmm0
movsd %xmm0, 0x20(%rsp)
jb 0x7a7b
sqrtsd %xmm0, %xmm3
jmp 0x7a8e
movapd %xmm1, (%rsp)
callq 0x4190
movapd (%rsp), %xmm1
movapd %xmm0, %xmm3
mulsd %xmm3, %xmm1
movapd 0x5966(%rip), %xmm0     # 0xd400
andpd %xmm1, %xmm0
movsd 0x55a2(%rip), %xmm2     # 0xd048
ucomisd %xmm0, %xmm2
jae 0x7ab0
xorl %eax, %eax
jmp 0x7b00
movapd %xmm1, %xmm0
movsd %xmm3, (%rsp)
callq 0x4300
movsd %xmm0, (%r14)
movsd (%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
addsd 0x5994(%rip), %xmm1     # 0xd470
callq 0x4050
addsd %xmm0, %xmm0
movsd %xmm0, (%rbx)
andpd 0x590f(%rip), %xmm0     # 0xd400
movsd 0x550f(%rip), %xmm1     # 0xd008
ucomisd %xmm0, %xmm1
setae %al
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/matthewarcus[P]mmps/transform.cpp
// Function: Hammer::ProjectInvSimple(double, double, double&, double&) const
bool Hammer::ProjectInvSimple(double phi, double lambda, double& x, double& y) const
{
  double z = sqrt(1 + cos(phi)*cos(lambda/2));
  x = cos(phi)*sin(lambda/2)/z;
  y = sin(phi)/(2 * z);
  return true;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x18(%rsp)
callq 0x4380
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x58fe(%rip), %xmm0     # 0xd438
movsd %xmm0, 0x10(%rsp)
callq 0x4380
mulsd 0x8(%rsp), %xmm0
addsd 0x54f5(%rip), %xmm0     # 0xd048
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7b63
sqrtsd %xmm0, %xmm0
jmp 0x7b68
callq 0x4190
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4380
movsd %xmm0, 0x20(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x4070
mulsd 0x20(%rsp), %xmm0
divsd 0x8(%rsp), %xmm0
movsd %xmm0, (%r14)
movsd 0x18(%rsp), %xmm0
callq 0x4070
movsd 0x8(%rsp), %xmm1
addsd %xmm1, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r14
retq