LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O3/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 0x46e2(%rip), %r15      # 0x7190
leaq 0x272c(%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 0x3918
movq %r12, %rdi
movl %r14d, %esi
callq 0x296e
movl %eax, %r14d
movq -0x48(%rbp), %rdi
cmpq %r13, %rdi
je 0x2afe
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 0x2b24
callq 0x21c0
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O3/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 0x24ed(%rip), %xmm0     # 0x5040
callq 0x20f0
cvttss2si %xmm0, %r15
cvtsi2ss %r14, %xmm1
movss %xmm1, -0x1c(%rbp)
movss 0x24d1(%rip), %xmm0     # 0x5040
mulss %xmm1, %xmm0
callq 0x2140
cvttss2si %xmm0, %rsi
movl %esi, %edx
subl %r15d, %edx
jne 0x2b88
xorl %eax, %eax
jmp 0x2ba5
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 0x2b8f
movl %r15d, %ecx
xorps %xmm0, %xmm0
cvtsi2ss %rcx, %xmm0
movss 0x248c(%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_O3/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 0x2414(%rip), %xmm0     # 0x5040
callq 0x20f0
cvttss2si %xmm0, %r12
cvtsi2ss %r15, %xmm1
movss %xmm1, -0x2c(%rbp)
movss 0x23f8(%rip), %xmm0     # 0x5040
mulss %xmm1, %xmm0
callq 0x2140
cvttss2si %xmm0, %r13
movl %r13d, %eax
subl %r12d, %eax
movl %eax, -0x30(%rbp)
jne 0x2c66
xorl %r15d, %r15d
jmp 0x2c82
movl %eax, %eax
xorl %r15d, %r15d
shlq $0x8, %r15
movl %r12d, %ecx
movzbl (%r14,%rcx), %ecx
orq %rcx, %r15
incl %r12d
decq %rax
jne 0x2c6b
movl %r13d, %eax
xorps %xmm0, %xmm0
cvtsi2ss %rax, %xmm0
mulss 0x23af(%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 0x2cf8
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
jne 0x2ce5
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x3296
leal -0x61(%rdi), %eax
cmpb $0x5, %al
ja 0x3284
addb $-0x57, %dil
movl %edi, %eax
jmp 0x3296
leal -0x41(%rdi), %eax
addb $-0x37, %dil
xorl %ecx, %ecx
cmpb $0x6, %al
movzbl %dil, %eax
cmovael %ecx, %eax
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x56a5
jp 0x56a5
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rbx)
movupd %xmm0, 0x20(%rbx)
movupd %xmm0, 0x10(%rbx)
movupd %xmm0, (%rbx)
movq $0x0, 0x40(%rbx)
leaq 0x20(%rbx), %rax
xorl %ecx, %ecx
movdqa 0x7db0(%rip), %xmm0     # 0xd3e0
movdqa 0x7db8(%rip), %xmm1     # 0xd3f0
movdqa 0x7dc0(%rip), %xmm2     # 0xd400
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movq %rcx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm0, %xmm4
pxor %xmm1, %xmm4
movdqa %xmm2, %xmm5
pcmpgtd %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pcmpeqd %xmm3, %xmm4
pand %xmm5, %xmm4
movd %xmm4, %esi
testb $0x1, %sil
je 0x5684
movq %rdx, -0x20(%rax)
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x5692
movq %rdx, (%rax)
addq $0x2, %rcx
addq $0x40, %rax
cmpq $0x4, %rcx
jne 0x564f
movb $0x1, %r14b
jmp 0x5708
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 0x4370
movsd %xmm0, 0x20(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
xorps 0x798e(%rip), %xmm0     # 0xd070
movlps %xmm0, 0x28(%rbx)
movq %r14, 0x30(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x38(%rbx)
movq (%rsp), %xmm0
callq 0x4370
movq %xmm0, 0x40(%rbx)
movb %r14b, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x57d1
jp 0x57d1
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rbx)
movupd %xmm0, 0x20(%rbx)
movupd %xmm0, 0x10(%rbx)
movupd %xmm0, (%rbx)
movq $0x0, 0x40(%rbx)
leaq 0x20(%rbx), %rax
xorl %ecx, %ecx
movdqa 0x7c84(%rip), %xmm0     # 0xd3e0
movdqa 0x7c8c(%rip), %xmm1     # 0xd3f0
movdqa 0x7c94(%rip), %xmm2     # 0xd400
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movq %rcx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm0, %xmm4
pxor %xmm1, %xmm4
movdqa %xmm2, %xmm5
pcmpgtd %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pcmpeqd %xmm3, %xmm4
pand %xmm5, %xmm4
movd %xmm4, %esi
testb $0x1, %sil
je 0x57b0
movq %rdx, -0x20(%rax)
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x57be
movq %rdx, (%rax)
addq $0x2, %rcx
addq $0x40, %rax
cmpq $0x4, %rcx
jne 0x577b
movb $0x1, %r14b
jmp 0x582f
movsd %xmm0, (%rsp)
callq 0x4370
movsd %xmm0, (%rbx)
xorl %r14d, %r14d
movq %r14, 0x8(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
xorps 0x7879(%rip), %xmm0     # 0xd070
movlps %xmm0, 0x10(%rbx)
xorps %xmm0, %xmm0
movhps 0x7843(%rip), %xmm0     # xmm0 = xmm0[0,1],mem[0,1]
movups %xmm0, 0x18(%rbx)
movq %r14, 0x28(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x30(%rbx)
movq %r14, 0x38(%rbx)
movq (%rsp), %xmm0
callq 0x4370
movq %xmm0, 0x40(%rbx)
movb %r14b, 0x48(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x58f9
jp 0x58f9
xorpd %xmm0, %xmm0
movupd %xmm0, 0x30(%rbx)
movupd %xmm0, 0x20(%rbx)
movupd %xmm0, 0x10(%rbx)
movupd %xmm0, (%rbx)
movq $0x0, 0x40(%rbx)
leaq 0x20(%rbx), %rax
xorl %ecx, %ecx
movdqa 0x7b5c(%rip), %xmm0     # 0xd3e0
movdqa 0x7b64(%rip), %xmm1     # 0xd3f0
movdqa 0x7b6c(%rip), %xmm2     # 0xd400
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movq %rcx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm0, %xmm4
pxor %xmm1, %xmm4
movdqa %xmm2, %xmm5
pcmpgtd %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pcmpeqd %xmm3, %xmm4
pand %xmm5, %xmm4
movd %xmm4, %esi
testb $0x1, %sil
je 0x58d8
movq %rdx, -0x20(%rax)
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x58e6
movq %rdx, (%rax)
addq $0x2, %rcx
addq $0x40, %rax
cmpq $0x4, %rcx
jne 0x58a3
movb $0x1, %r14b
jmp 0x595c
movsd %xmm0, (%rsp)
callq 0x4370
movsd %xmm0, (%rbx)
movsd (%rsp), %xmm0
callq 0x4070
xorps 0x7758(%rip), %xmm0     # 0xd070
movlps %xmm0, 0x8(%rbx)
xorl %r14d, %r14d
movq %r14, 0x10(%rbx)
movsd (%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x18(%rbx)
movq (%rsp), %xmm0
callq 0x4370
movq %xmm0, 0x20(%rbx)
pxor %xmm0, %xmm0
movdqu %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_O3/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 0x5b05
testb %cl, %cl
je 0x5b20
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movq $0x0, 0x40(%rdi)
leaq 0x20(%rdi), %rax
xorl %ecx, %ecx
movdqa 0x7952(%rip), %xmm0     # 0xd3e0
movdqa 0x795a(%rip), %xmm1     # 0xd3f0
movdqa 0x7962(%rip), %xmm2     # 0xd400
pshufd $0xf5, %xmm2, %xmm3     # xmm3 = xmm2[1,1,3,3]
movabsq $0x3ff0000000000000, %rdx # imm = 0x3FF0000000000000
movq %rcx, %xmm4
pshufd $0x44, %xmm4, %xmm4     # xmm4 = xmm4[0,1,0,1]
por %xmm0, %xmm4
pxor %xmm1, %xmm4
movdqa %xmm2, %xmm5
pcmpgtd %xmm4, %xmm5
pshufd $0xf5, %xmm4, %xmm4     # xmm4 = xmm4[1,1,3,3]
pcmpeqd %xmm3, %xmm4
pand %xmm5, %xmm4
movd %xmm4, %esi
testb $0x1, %sil
je 0x5ae2
movq %rdx, -0x20(%rax)
pextrw $0x4, %xmm4, %esi
testb $0x1, %sil
je 0x5af0
movq %rdx, (%rax)
addq $0x2, %rcx
addq $0x40, %rax
cmpq $0x4, %rcx
jne 0x5aad
movb $0x1, %al
jmp 0x5b9b
testb %cl, %cl
je 0x5b39
xorl %ecx, %ecx
movq (%rsi,%rcx,8), %xmm0
movq %xmm0, (%rdi,%rcx,8)
incq %rcx
cmpq $0x9, %rcx
jne 0x5b0b
jmp 0x5b9b
xorl %eax, %eax
movq (%rdx,%rax,8), %xmm0
movq %xmm0, (%rdi,%rax,8)
incq %rax
cmpq $0x9, %rax
jne 0x5b22
movl %ecx, %eax
jmp 0x5b9b
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 0x5b48
incq %rax
addq $0x8, %rcx
cmpq $0x3, %rax
jne 0x5b42
xorl %eax, %eax
movb %al, 0x48(%rdi)
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4370
movsd %xmm0, (%rsp)
movsd (%r12), %xmm0
callq 0x4370
mulsd (%rsp), %xmm0
movsd %xmm0, (%r14)
movsd (%rbx), %xmm0
callq 0x4070
movsd %xmm0, (%rsp)
movsd (%r12), %xmm0
callq 0x4370
mulsd (%rsp), %xmm0
movsd %xmm0, (%r15)
movsd (%r12), %xmm0
callq 0x4070
movsd %xmm0, (%r13)
cmpb $0x0, 0x48(%rbp)
jne 0x5d9b
movq %rbp, %rdi
movq %r14, %rsi
movq %r15, %rdx
movq %r13, %rcx
callq 0x5ba0
movsd (%r13), %xmm0
callq 0x42f0
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_O3/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 0x4370
movsd %xmm0, 0x10(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4370
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4370
mulsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x20(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4370
movsd %xmm0, 0x30(%rsp)
movsd 0x28(%rsp), %xmm0
callq 0x4370
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 0x4370
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 0x41e0
// File: /workspace/github_cpp_makefile_star2_O3/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 0x6542
jnp 0x6651
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 0x4370
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4370
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4370
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4070
movsd %xmm0, 0x18(%rsp)
movsd (%rsp), %xmm0
callq 0x4370
movsd %xmm0, 0x28(%rsp)
movsd 0x20(%rsp), %xmm0
callq 0x4370
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 0x4370
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 0x41e0
ucomisd 0x30(%rbx), %xmm0
leaq 0x30(%rsp), %rsp
popq %rbx
jbe 0x6651
xorl %eax, %eax
retq
movb $0x1, %al
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4370
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 0x4370
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_O3/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 0x6feb
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 0x6feb
movl (%r13), %esi
movl 0x8(%r13), %edx
xorps %xmm1, %xmm1
cvtsi2sd %esi, %xmm1
movsd 0x6571(%rip), %xmm0     # 0xd428
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 0x6efc
jnp 0x6fa7
movsd (%r15), %xmm1
movsd %xmm1, 0x18(%rsp)
movsd %xmm2, 0x28(%rsp)
movsd %xmm0, 0x8(%rsp)
callq 0x4370
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 0x4370
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 0x6fed
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5f6e
movq %rsp, %r15
movsd 0x5b10(%rip), %xmm0     # 0xd028
movq %r15, %rdi
movl $0x1, %esi
callq 0x55cc
leaq 0x8(%rbx), %r12
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x59a0
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 0x5ac0(%rip), %xmm0     # 0xd020
movq %r12, %rdi
movl $0x1, %esi
callq 0x55cc
leaq 0x50(%rsp), %r13
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x59a0
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_O3/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 $0x18, %rsp
movq %r9, %r15
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r12
movq %rdi, %r13
movapd %xmm0, %xmm2
mulsd %xmm0, %xmm2
movapd %xmm1, %xmm3
mulsd %xmm1, %xmm3
addsd %xmm2, %xmm3
xorps %xmm2, %xmm2
sqrtsd %xmm3, %xmm2
subsd 0xa8(%rsi), %xmm2
movsd %xmm2, 0x8(%rsp)
movq 0x50(%rsp), %rbp
movsd 0xa0(%rsi), %xmm2
movsd %xmm2, 0x10(%rsp)
xorpd 0x5a55(%rip), %xmm1     # 0xd070
callq 0x4050
movsd 0x8(%rsp), %xmm2
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rbp)
xorl %eax, %eax
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
jbe 0x76a0
andpd 0x5ecb(%rip), %xmm0     # 0xd510
movsd 0x59bb(%rip), %xmm1     # 0xd008
ucomisd %xmm0, %xmm1
jb 0x76a0
movq (%r13), %rax
movq %r13, %rdi
movapd %xmm2, %xmm0
movq %r15, %rsi
callq *0x48(%rax)
movsd (%r15), %xmm0
andpd 0x5e9f(%rip), %xmm0     # 0xd510
movsd 0x59a7(%rip), %xmm1     # 0xd020
ucomisd %xmm0, %xmm1
jae 0x7683
xorl %eax, %eax
jmp 0x76a0
addq $0x8, %r13
movq %r15, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %r13, %r9
callq 0x5cec
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/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 0x5cec
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 0x7790
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 0x5904(%rip), %xmm0     # 0xd070
movapd %xmm0, 0x10(%rsp)
movsd 0x28(%rsp), %xmm0
divsd 0xa0(%r14), %xmm0
callq 0x4370
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_O3/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 0x5d2f(%rip), %xmm0     # 0xd510
movsd 0x581f(%rip), %xmm1     # 0xd008
ucomisd %xmm0, %xmm1
jb 0x780b
movsd (%r12), %xmm0
andpd 0x5d13(%rip), %xmm0     # 0xd510
movsd 0x581b(%rip), %xmm1     # 0xd020
ucomisd %xmm0, %xmm1
jae 0x780f
xorl %eax, %eax
jmp 0x782c
addq $0x8, %r15
movq %r12, %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %r14, %rcx
movq %rbx, %r8
movq %r15, %r9
callq 0x5cec
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_O3/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 0x5a41(%rip), %xmm0     # 0xd510
andpd %xmm1, %xmm0
callq 0x4350
movapd %xmm0, %xmm1
addsd %xmm0, %xmm1
mulsd %xmm0, %xmm0
addsd 0x555c(%rip), %xmm0     # 0xd048
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x41e0
movapd 0x556f(%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_O3/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 0x59c4(%rip), %xmm0     # 0xd510
andpd %xmm2, %xmm0
callq 0x4070
addsd 0x54eb(%rip), %xmm0     # 0xd048
movsd %xmm0, 0x8(%rsp)
movapd 0x10(%rsp), %xmm0
callq 0x4370
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
callq 0x4190
movapd 0x54e7(%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_O3/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 0x7c6c
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4370
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_O3/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 0x7d7e
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movsd %xmm0, 0x8(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4100
addsd %xmm0, %xmm0
movsd 0x52e1(%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_O3/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 0x56a9(%rip), %xmm0     # 0xd458
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 0x7dd9
sqrtsd %xmm0, %xmm3
jmp 0x7dec
movapd %xmm1, (%rsp)
callq 0x4180
movapd (%rsp), %xmm1
movapd %xmm0, %xmm3
mulsd %xmm3, %xmm1
movapd 0x5718(%rip), %xmm0     # 0xd510
andpd %xmm1, %xmm0
movsd 0x5244(%rip), %xmm2     # 0xd048
ucomisd %xmm0, %xmm2
jae 0x7e0e
xorl %eax, %eax
jmp 0x7e5e
movapd %xmm1, %xmm0
movsd %xmm3, (%rsp)
callq 0x42f0
movsd %xmm0, (%r14)
movsd (%rsp), %xmm0
mulsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
addsd 0x5626(%rip), %xmm1     # 0xd460
callq 0x4050
addsd %xmm0, %xmm0
movsd %xmm0, (%rbx)
andpd 0x56c1(%rip), %xmm0     # 0xd510
movsd 0x51b1(%rip), %xmm1     # 0xd008
ucomisd %xmm0, %xmm1
setae %al
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O3/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 0x4370
movsd %xmm0, 0x8(%rsp)
movsd 0x10(%rsp), %xmm0
mulsd 0x5590(%rip), %xmm0     # 0xd428
movsd %xmm0, 0x10(%rsp)
callq 0x4370
mulsd 0x8(%rsp), %xmm0
addsd 0x5197(%rip), %xmm0     # 0xd048
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jb 0x7ec1
sqrtsd %xmm0, %xmm0
jmp 0x7ec6
callq 0x4180
movsd %xmm0, 0x8(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4370
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
// File: /workspace/github_cpp_makefile_star2_O3/matthewarcus[P]mmps/transform.cpp
// Function: Bonne::ProjectSimple(double, double, double&, double&) const
bool Bonne::ProjectSimple(double x, double y, 
			  double& phi, double& lambda) const
{
  bool result = false;
  double rho = sqrt(sqr(x) + sqr(cotp - y));
  if (p > 0) {
    phi = cotp + p - rho;
    lambda = rho * atan2(x, cotp - y)/cos(phi);
  } else if (p < 0) {
    phi = cotp + p + rho;
    lambda = rho * atan2(x, y - cotp)/cos(phi);
  } else {
    // Degenerate case - the sinusoidal projection
    phi = y;
    lambda = x/cos(phi);
  }
  if (phi >= -piovertwo && phi <= +piovertwo &&
      lambda >= -pi && lambda <= pi) {
    result = true;
  }
  return result;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r14
movq %rsi, %rbx
movapd %xmm0, %xmm3
mulsd %xmm0, %xmm3
movsd 0xc0(%rdi), %xmm5
movsd 0xc8(%rdi), %xmm2
movapd %xmm2, %xmm4
subsd %xmm1, %xmm4
mulsd %xmm4, %xmm4
addsd %xmm3, %xmm4
sqrtsd %xmm4, %xmm4
xorpd %xmm3, %xmm3
ucomisd %xmm3, %xmm5
jbe 0x7fc3
addsd %xmm2, %xmm5
subsd %xmm4, %xmm5
movsd %xmm5, (%rbx)
movsd 0xc8(%rdi), %xmm2
subsd %xmm1, %xmm2
movapd %xmm2, %xmm1
jmp 0x7fdd
ucomisd %xmm5, %xmm3
jbe 0x7ff7
addsd %xmm2, %xmm5
addsd %xmm4, %xmm5
movsd %xmm5, (%rbx)
subsd 0xc8(%rdi), %xmm1
movsd %xmm4, (%rsp)
callq 0x4050
mulsd (%rsp), %xmm0
movapd %xmm0, (%rsp)
movsd (%rbx), %xmm1
jmp 0x8000
movsd %xmm1, (%rbx)
movapd %xmm0, (%rsp)
movapd %xmm1, %xmm0
callq 0x4370
movapd (%rsp), %xmm2
divsd %xmm0, %xmm2
movsd %xmm2, (%r14)
movsd (%rbx), %xmm0
movapd 0x54ed(%rip), %xmm1     # 0xd510
andpd %xmm1, %xmm0
andpd %xmm1, %xmm2
movsd 0x4fd5(%rip), %xmm1     # 0xd008
cmplepd %xmm1, %xmm2
movsd 0x4fe0(%rip), %xmm1     # 0xd020
cmplepd %xmm1, %xmm0
andpd %xmm2, %xmm0
movd %xmm0, %eax
andb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/matthewarcus[P]mmps/transform.cpp
// Function: Bonne::ProjectInvSimple(double, double, double&, double&) const
bool Bonne::ProjectInvSimple(double phi, double lambda, double& x, double& y) const
{
  if (p == 0.0) {
    x = lambda * cos(phi);
    y = phi;
  } else {
    double rho = cotp + p - phi;
    double e = lambda * cos(phi)/rho;
    x = rho * sin(e);
    y = cotp - rho * cos(e);
  }
  return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movsd %xmm1, 0x8(%rsp)
movsd 0xc0(%rdi), %xmm2
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm2
jne 0x809f
jp 0x809f
movsd %xmm0, 0x18(%rsp)
callq 0x4370
movsd 0x18(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm0
movsd %xmm0, (%r14)
jmp 0x8105
movq %rdi, %r15
addsd 0xc8(%rdi), %xmm2
subsd %xmm0, %xmm2
movsd %xmm2, 0x10(%rsp)
callq 0x4370
mulsd 0x8(%rsp), %xmm0
divsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
callq 0x4070
mulsd 0x10(%rsp), %xmm0
movsd %xmm0, (%r14)
movsd 0xc8(%r15), %xmm0
movsd %xmm0, 0x18(%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4370
movsd 0x18(%rsp), %xmm1
mulsd 0x10(%rsp), %xmm0
subsd %xmm0, %xmm1
movsd %xmm1, (%rbx)
movb $0x1, %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/matthewarcus[P]mmps/transform.cpp
// Function: Perspective::Init(TransformParams const&)
void Perspective::Init(const TransformParams& params) 
{
  Transform::Init(params);
  vx = params.x; vy = params.y; vz = params.z;
  rx = vx; ry = vy; rz = vz;
  m.Apply(rx,ry,rz);
  scalefactor = (vx + 1) * tan(params.aw/2);
  iscalefactor = 1/scalefactor;

  a = params.ox;
  b = params.oy;
  c = params.oz;
  a2 = sqr(a);
  b2 = sqr(b);
  c2 = sqr(c);
  ia2 = 1/a2;
  ib2 = 1/b2;
  ic2 = 1/c2;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x5f6e
movups 0x48(%r14), %xmm0
movups %xmm0, 0xd0(%rbx)
movsd 0x58(%r14), %xmm1
movsd %xmm1, 0xe0(%rbx)
leaq 0xe8(%rbx), %rsi
leaq 0xf0(%rbx), %rdx
movups %xmm0, 0xe8(%rbx)
leaq 0xf8(%rbx), %rcx
movsd %xmm1, 0xf8(%rbx)
leaq 0x8(%rbx), %rdi
callq 0x5ba0
movsd 0xd0(%rbx), %xmm0
addsd 0x4ecc(%rip), %xmm0     # 0xd048
movsd %xmm0, (%rsp)
movsd 0x40(%r14), %xmm0
mulsd 0x5299(%rip), %xmm0     # 0xd428
callq 0x4100
mulsd (%rsp), %xmm0
movsd %xmm0, 0xc0(%rbx)
movsd 0x4e9f(%rip), %xmm3     # 0xd048
movapd %xmm3, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0xc8(%rbx)
movsd 0x70(%r14), %xmm0
movsd %xmm0, 0x110(%rbx)
movupd 0x60(%r14), %xmm1
movupd %xmm1, 0x100(%rbx)
mulpd %xmm1, %xmm1
movupd %xmm1, 0x118(%rbx)
mulsd %xmm0, %xmm0
movsd %xmm0, 0x128(%rbx)
movapd 0x52db(%rip), %xmm2     # 0xd4d0
divpd %xmm1, %xmm2
movupd %xmm2, 0x130(%rbx)
movapd %xmm3, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x140(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/matthewarcus[P]mmps/transform.cpp
// Function: CylindricalTransform::AdjustSize(int&, int&, TransformParams&)
void CylindricalTransform::AdjustSize (int& w, int& h, 
				       TransformParams& params)
{
  if (params.scale < 1.0) {
    w = int(w * params.scale);
    params.scale = 1.0;     
  }
  // If a parallel has been given, check it's valid
  if (params.p < 0 || params.p >= piovertwo) {
    error ("Invalid parallel");
  }
  double h0 = GetMaxHeight(params);
  if (h0 > 0.0) { // Return <= 0 for don't adjust
    int newh = int(h0 * w * params.scale / pi);
    if (newh < h) { h = newh; };
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movsd 0x28(%rcx), %xmm0
movsd 0x470e(%rip), %xmm1     # 0xd048
ucomisd %xmm0, %xmm1
jbe 0x8961
xorps %xmm1, %xmm1
cvtsi2sdl (%r15), %xmm1
mulsd %xmm1, %xmm0
cvttsd2si %xmm0, %eax
movl %eax, (%r15)
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x28(%r14)
movsd 0x80(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
ja 0x897e
ucomisd 0x46a4(%rip), %xmm0     # 0xd020
jb 0x898a
leaq 0x4c52(%rip), %rdi      # 0xd5d7
callq 0xab5c
movq (%r12), %rax
movq %r12, %rdi
movq %r14, %rsi
callq *0x60(%rax)
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jbe 0x89ec
xorps %xmm1, %xmm1
cvtsi2sdl (%r15), %xmm1
mulsd %xmm1, %xmm0
mulsd 0x28(%r14), %xmm0
movsd %xmm0, 0x10(%rsp)
fldl 0x10(%rsp)
fdivl 0x4645(%rip)            # 0xd008
fnstcw 0x8(%rsp)
movzwl 0x8(%rsp), %eax
orl $0xc00, %eax            # imm = 0xC00
movw %ax, 0xa(%rsp)
fldcw 0xa(%rsp)
fistpl 0xc(%rsp)
fldcw 0x8(%rsp)
movl 0xc(%rsp), %eax
cmpl %eax, (%rbx)
jle 0x89ec
movl %eax, (%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O3/matthewarcus[P]mmps/transform.cpp
// Function: Sinusoidal2::CalcParams(double, double, double&, double&)
void Sinusoidal2::CalcParams(double a, double phi, double& k, double& b)
{
  // Find the t value for phi
  double t1 = 0;
  double t2 = pi/2.0;
  double epsilon = 1e-6;
  double k0 = 0.0, b0 = 0.0;
  while (fabs(t2 - t1) > epsilon) {
    double t0 = (t1 + t2)/2.0;
    k0 = sqr((cos(t0) + a) / ((a+1)*cos(phi)));
    b0 = (k0 * (a+1))/(1 + a * pi / 2.0);
    double p0 = b0 * sin(t0) + a * t0 - k0 * (a+1) * sin(phi);
    if (p0 <= 0.0) t1 = t0;
    else t2 = t0;
  }
  k = k0; b = b0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x98, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movsd %xmm1, 0x18(%rsp)
movsd 0x45fa(%rip), %xmm1     # 0xd048
addsd %xmm0, %xmm1
movsd %xmm1, 0x30(%rsp)
movsd %xmm0, 0x10(%rsp)
movsd %xmm0, 0x58(%rsp)
fldl 0x58(%rsp)
fmull 0x459a(%rip)            # 0xd008
fmuls 0x4ac4(%rip)            # 0xd538
fld1
faddp %st, %st(1)
fstpt 0x64(%rsp)
movsd 0x459c(%rip), %xmm0     # 0xd020
xorpd %xmm2, %xmm2
movsd %xmm2, 0x40(%rsp)
movapd %xmm0, 0x80(%rsp)
addsd %xmm2, %xmm0
mulsd 0x4985(%rip), %xmm0     # 0xd428
movapd %xmm0, 0x20(%rsp)
callq 0x4370
addsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4370
movsd 0x30(%rsp), %xmm1
mulsd %xmm1, %xmm0
movsd (%rsp), %xmm2
divsd %xmm0, %xmm2
mulsd %xmm2, %xmm2
movsd %xmm2, (%rsp)
mulsd %xmm2, %xmm1
movsd %xmm1, 0x38(%rsp)
movsd %xmm1, 0x50(%rsp)
fldt 0x64(%rsp)
fdivrl 0x50(%rsp)
fstpl 0x48(%rsp)
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x8(%rsp)
movapd 0x20(%rsp), %xmm0
callq 0x4070
movapd 0x20(%rsp), %xmm1
mulsd 0x10(%rsp), %xmm1
mulsd 0x8(%rsp), %xmm0
addsd %xmm1, %xmm0
movapd %xmm0, 0x70(%rsp)
movsd 0x18(%rsp), %xmm0
callq 0x4070
movapd 0x70(%rsp), %xmm3
movsd 0x40(%rsp), %xmm2
xorpd %xmm1, %xmm1
mulsd 0x38(%rsp), %xmm0
subsd %xmm0, %xmm3
movapd 0x20(%rsp), %xmm0
ucomisd %xmm3, %xmm1
jb 0x8b64
movapd %xmm0, %xmm2
cmpnlesd %xmm1, %xmm3
andpd %xmm3, %xmm0
andnpd 0x80(%rsp), %xmm3
orpd %xmm0, %xmm3
movapd %xmm3, %xmm0
subsd %xmm2, %xmm0
andpd 0x4986(%rip), %xmm0     # 0xd510
ucomisd 0x48de(%rip), %xmm0     # 0xd470
movapd %xmm3, %xmm0
ja 0x8a88
movsd (%rsp), %xmm0
movsd %xmm0, (%r14)
movsd 0x8(%rsp), %xmm0
movsd %xmm0, (%rbx)
addq $0x98, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O3/matthewarcus[P]mmps/transform.cpp
// Function: Sinusoidal2::GetXY(double, double, double&, double&) const
bool Sinusoidal2::GetXY(double phi, double lambda, double& x, double& y) const
{
  bool result = false;
  Sinusoidal2Equation equation;
  equation.b = b; equation.a = a; equation.k = k; equation.sinphi = sin(phi);
  double t = 0.0;
  if (equation.FindRoot(-pi/2, pi/2, 1e-5, t)) {
    y = b * t;
    x = lambda * (cos(t) + a) / (a+1);
    result = true;
  }
  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdx, %r15
movq %rsi, %rbx
movsd %xmm1, 0x8(%rsp)
movq %rdi, %r14
leaq 0x9d3e(%rip), %rax      # 0x12a18
leaq 0x18(%rsp), %r12
movq %rax, (%r12)
movups 0xc8(%rdi), %xmm1
shufps $0x4e, %xmm1, %xmm1     # xmm1 = xmm1[2,3,0,1]
movups %xmm1, 0x8(%r12)
movsd 0xd8(%rdi), %xmm1
movsd %xmm1, 0x18(%r12)
callq 0x4070
movsd %xmm0, 0x20(%r12)
leaq 0x10(%rsp), %rsi
movq $0x0, (%rsi)
movsd 0x4305(%rip), %xmm0     # 0xd028
movsd 0x42f5(%rip), %xmm1     # 0xd020
movsd 0x4745(%rip), %xmm2     # 0xd478
movq %r12, %rdi
callq 0xa21c
movl %eax, %ebp
testb %al, %al
je 0x8d81
movsd 0x10(%rsp), %xmm0
movsd 0xd0(%r14), %xmm1
mulsd %xmm0, %xmm1
movsd %xmm1, (%r15)
callq 0x4370
movsd 0xc8(%r14), %xmm1
addsd %xmm1, %xmm0
mulsd 0x8(%rsp), %xmm0
addsd 0x42cf(%rip), %xmm1     # 0xd048
divsd %xmm1, %xmm0
movsd %xmm0, (%rbx)
movl %ebp, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O3/matthewarcus[P]mmps/transform.cpp
// Function: Mollweide::CalcParams(double, double&)
void Mollweide::CalcParams(double phi, double& a)
{
  // Now we need to find a suitable t
  // Good old binary search - note we cavalierly fail to check if there's
  // a solution in the interval. Hell, we're going to terminate with something.
  double t = 0;     // phi = 0;
  double t1 = pi/2;  // phi = pi/2;
  double b = 0.5 * pi * sin(phi);
  double epsilon = 1e-6;
  while (fabs(t1 - t) > epsilon) {
    double t2 = (t + t1)/2.0;
    double p = t2 + 0.5 * sin (2 * t2) - b;
    if (p <= 0.0) t = t2; 
    else t1 = t2;
  }
  // t is our selected value
  a = pi / (4 * sqr(cos (t)/cos(phi)));
}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movq %rdi, %rbx
movsd %xmm0, 0x8(%rsp)
callq 0x4070
movsd %xmm0, 0x28(%rsp)
fldl 0x28(%rsp)
fmull 0x4241(%rip)            # 0xd020
fstpl 0x20(%rsp)
movsd 0x4235(%rip), %xmm1     # 0xd020
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
xorpd %xmm2, %xmm2
movsd %xmm2, (%rsp)
movapd %xmm1, 0x40(%rsp)
addsd %xmm2, %xmm1
movsd 0x4616(%rip), %xmm0     # 0xd428
mulsd %xmm0, %xmm1
movapd %xmm1, 0x30(%rsp)
movapd %xmm1, %xmm0
addsd %xmm1, %xmm0
callq 0x4070
movapd 0x30(%rsp), %xmm3
movsd (%rsp), %xmm2
xorpd %xmm1, %xmm1
mulsd 0x45e8(%rip), %xmm0     # 0xd428
addsd %xmm3, %xmm0
subsd 0x10(%rsp), %xmm0
ucomisd %xmm0, %xmm1
jb 0x8e54
movapd %xmm3, %xmm2
cmpnlesd %xmm1, %xmm0
andpd %xmm0, %xmm3
andnpd 0x40(%rsp), %xmm0
orpd %xmm3, %xmm0
movapd %xmm0, %xmm1
subsd %xmm2, %xmm1
andpd 0x4699(%rip), %xmm1     # 0xd510
ucomisd 0x45f1(%rip), %xmm1     # 0xd470
movapd %xmm0, %xmm1
ja 0x8dfb
movapd %xmm2, %xmm0
callq 0x4370
movsd %xmm0, (%rsp)
movsd 0x8(%rsp), %xmm0
callq 0x4370
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
mulsd %xmm1, %xmm1
mulsd 0x45c9(%rip), %xmm1     # 0xd480
movsd %xmm1, 0x18(%rsp)
fldl 0x4145(%rip)            # 0xd008
fdivl 0x18(%rsp)
fstpl (%rbx)
addq $0x50, %rsp
popq %rbx
retq
nop