// File: havluj[P]spreadsheet/src/CExpressionParser.cpp
// Function: CExpressionParser::Evaluate(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&)
bool CExpressionParser::Evaluate(const std::vector<std::string>& rpn, std::string& result) {
    typedef std::vector<std::string>::const_iterator rpn_iter;
    std::stack<std::string> stack;

    // While there are input tokens left
    for (rpn_iter it = rpn.begin(); it != rpn.end(); it++) {
	  // Read the next token from input.
	  std::string token = *it;

	  // If the token is a value push it onto the stack.
	  if (IsNumber(token) ||
		    IsFloat(token) ||
		    IsPi(token) ||
		    IsE(token)) {
		if (IsPi(token)) {
		    std::stringstream s;
		    s << pi;
		    token = s.str();
		} else if (IsE(token)) {
		    std::stringstream s;
		    s << e;
		    token = s.str();
		}
		stack.push(token);
	  }// Otherwise, the token is an operator or a function
	  else if (IsOperator(token) || IsFunction(token)) {
		double result = 0.0;

		// It is known a priori that the operator takes n arguments.
		unsigned int nargs = OpArgCount(UpperCase(token));

		bool isUnary = false;
		unsigned int stackArgs = stack.size();
		std::vector<double> args;

		if (stackArgs < nargs) {
		    // For dealing with unary '-' or unary '+'
		    if (stackArgs == 1 && nargs == 2 && (token == "+" || token == "-")) {
			  std::string value = stack.top();
			  result = strtod(value.c_str(), NULL);
			  stack.pop();
			  isUnary = true;
		    } else {
			  // (Error) The user has not input sufficient values in the expression.
			  return false;
		    }
		} else {
		    // Else, Pop the top n values from the stack.				
		    while (nargs > 0) {
			  std::string value = stack.top();
			  double d = strtod(value.c_str(), NULL);
			  args.push_back(d);
			  stack.pop();
			  nargs--;
		    }
		}

		// Evaluate the operator, with the values as arguments.                       
		if (IsOperator(token) && !isUnary) {
		    // Token is an operator: pop top two entries                          
		    double d2 = args[ 0 ];
		    double d1 = args[ 1 ];

		    //Get the result  
		    if (token == "+") {
			  result = d1 + d2;
		    } else if (token == "-") {
			  result = d1 - d2;
		    } else if (token == "*") {
			  result = d1 * d2;
		    } else if (token == "/") {
			  result = d1 / d2;
		    } else if (token == "%") {
			  int i2 = (int) args[ 0 ];
			  int i1 = (int) args[ 1 ];
			  double iresult = Modulo(i1, i2);
			  result = iresult;
		    }
		} else if (IsFunction(token)) {
		    double d0 = args[ 0 ];

		    std::string capToken = UpperCase(token);

		    // If say -SIN( x ) then multiply result of SIN by -1.0
		    double mult =
				token.find("-") != std::string::npos ? -1 : 1;

		    if (capToken.find("SIN") != std::string::npos) {
			  result = sin(d0);
		    } else if (capToken.find("COS") != std::string::npos) {
			  result = cos(d0);
		    } else if (capToken.find("TAN") != std::string::npos) {
			  result = tan(d0);
		    } else if (capToken.find("LN") != std::string::npos) {
			  result = log(d0);
		    } else if (capToken.find("LOG") != std::string::npos) {
			  result = log10(d0);
		    } else if (capToken.find("EXP") != std::string::npos) {
			  result = exp(d0);
		    } else if (capToken.find("^") != std::string::npos) {
			  double d2 = args[ 0 ];
			  double d1 = args[ 1 ];

			  if (d1 < 0) mult = -1.0;

			  result = pow((double) d1, d2);
		    } else if (capToken.find("POW") != std::string::npos) {
			  double d2 = args[ 0 ];
			  double d1 = args[ 1 ];
			  result = pow(d1, d2);
		    } else if (capToken.find("SQRT") != std::string::npos) {
			  result = sqrt(d0);
		    }

		    result *= mult;
		}

		// Push the returned results, if any, back onto the stack
		// Push result onto stack   
		if (result == (long) result) {
		    result = long( result);
		}
		std::stringstream s;
		s << result;
		stack.push(s.str());
	  }
    }

    // If there is only one value in the stack then
    // that value is the result of the calculation.
    if (stack.size() == 1) {
	  result = stack.top();

	  // Output the result
	  double res = strtod(result.c_str(), NULL);
	  if (res == (long) res) {
		long lres = (long) res;
		std::stringstream s;
		s << lres;
		result = s.str();
	  }

	  return true;
    }

    // If there are more values in the stack
    // (Error) The user input has too many values.
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x920, %rsp            # imm = 0x920
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x181e0
movq -0x18(%rbp), %rdi
callq 0x18210
movq %rax, -0x78(%rbp)
movq -0x18(%rbp), %rdi
callq 0x18280
movq %rax, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x18240
testb $0x1, %al
jne 0x16330
jmp 0x16f4b
leaq -0x78(%rbp), %rdi
callq 0x182b0
movq %rax, %rsi
leaq -0xa0(%rbp), %rdi
callq 0x51b0
jmp 0x1634a
leaq -0xa0(%rbp), %rdi
callq 0x14d50
movb %al, -0x8b9(%rbp)
jmp 0x1635e
movb -0x8b9(%rbp), %al
testb $0x1, %al
jne 0x163cd
jmp 0x1636a
leaq -0xa0(%rbp), %rdi
callq 0x14c30
movb %al, -0x8ba(%rbp)
jmp 0x1637e
movb -0x8ba(%rbp), %al
testb $0x1, %al
jne 0x163cd
jmp 0x1638a
leaq -0xa0(%rbp), %rdi
callq 0x14990
movb %al, -0x8bb(%rbp)
jmp 0x1639e
movb -0x8bb(%rbp), %al
testb $0x1, %al
jne 0x163cd
jmp 0x163aa
leaq -0xa0(%rbp), %rdi
callq 0x14a30
movb %al, -0x8bc(%rbp)
jmp 0x163be
movb -0x8bc(%rbp), %al
testb $0x1, %al
jne 0x163cd
jmp 0x1656f
leaq -0xa0(%rbp), %rdi
callq 0x14990
movb %al, -0x8bd(%rbp)
jmp 0x163e1
movb -0x8bd(%rbp), %al
testb $0x1, %al
jne 0x163f0
jmp 0x164aa
leaq -0x238(%rbp), %rdi
callq 0x52f0
jmp 0x163fe
leaq -0x228(%rbp), %rdi
movsd 0x646b(%rip), %xmm0     # 0x1c878
callq 0x57e0
jmp 0x16414
leaq -0x258(%rbp), %rdi
leaq -0x238(%rbp), %rsi
callq 0x5410
jmp 0x16429
leaq -0xa0(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x5510
leaq -0x258(%rbp), %rdi
callq 0x52a0
leaq -0x238(%rbp), %rdi
callq 0x5320
jmp 0x16558
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x1709c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x16f3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x5320
jmp 0x16f3a
leaq -0xa0(%rbp), %rdi
callq 0x14a30
movb %al, -0x8be(%rbp)
jmp 0x164be
movb -0x8be(%rbp), %al
testb $0x1, %al
jne 0x164cd
jmp 0x16556
leaq -0x3e0(%rbp), %rdi
callq 0x52f0
jmp 0x164db
leaq -0x3d0(%rbp), %rdi
movsd 0x6386(%rip), %xmm0     # 0x1c870
callq 0x57e0
jmp 0x164f1
leaq -0x400(%rbp), %rdi
leaq -0x3e0(%rbp), %rsi
callq 0x5410
jmp 0x16506
leaq -0xa0(%rbp), %rdi
leaq -0x400(%rbp), %rsi
callq 0x5510
leaq -0x400(%rbp), %rdi
callq 0x52a0
leaq -0x3e0(%rbp), %rdi
callq 0x5320
jmp 0x16556
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x3e0(%rbp), %rdi
callq 0x5320
jmp 0x16f3a
jmp 0x16558
leaq -0x70(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x182d0
jmp 0x1656a
jmp 0x16efb
leaq -0xa0(%rbp), %rdi
callq 0x147e0
movb %al, -0x8bf(%rbp)
jmp 0x16583
movb -0x8bf(%rbp), %al
testb $0x1, %al
jne 0x165b2
jmp 0x1658f
leaq -0xa0(%rbp), %rdi
callq 0x14ad0
movb %al, -0x8c0(%rbp)
jmp 0x165a3
movb -0x8c0(%rbp), %al
testb $0x1, %al
jne 0x165b2
jmp 0x16ef9
movq $0x0, -0x408(%rbp)
leaq -0x450(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x51b0
jmp 0x165d2
leaq -0x430(%rbp), %rdi
movq %rdi, -0x8d0(%rbp)
leaq -0x450(%rbp), %rsi
callq 0x148f0
movq -0x8d0(%rbp), %rdi
callq 0x14550
movl %eax, -0x8c4(%rbp)
jmp 0x16600
leaq -0x430(%rbp), %rdi
callq 0x52a0
leaq -0x450(%rbp), %rdi
callq 0x52a0
movl -0x8c4(%rbp), %eax
movl %eax, -0x40c(%rbp)
movb $0x0, -0x451(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x18300
movq %rax, -0x8d8(%rbp)
jmp 0x1663d
movq -0x8d8(%rbp), %rax
movl %eax, -0x458(%rbp)
leaq -0x470(%rbp), %rdi
callq 0x18320
movl -0x458(%rbp), %eax
cmpl -0x40c(%rbp), %eax
jae 0x167bb
cmpl $0x1, -0x458(%rbp)
jne 0x167a3
cmpl $0x2, -0x40c(%rbp)
jne 0x167a3
leaq 0x597f(%rip), %rsi      # 0x1c008
leaq -0xa0(%rbp), %rdi
callq 0x17ac0
movb %al, -0x8d9(%rbp)
jmp 0x1669d
movb -0x8d9(%rbp), %al
testb $0x1, %al
jne 0x166d3
jmp 0x166a9
leaq 0x595a(%rip), %rsi      # 0x1c00a
leaq -0xa0(%rbp), %rdi
callq 0x17ac0
movb %al, -0x8da(%rbp)
jmp 0x166c4
movb -0x8da(%rbp), %al
testb $0x1, %al
jne 0x166d3
jmp 0x167a3
leaq -0x70(%rbp), %rdi
callq 0x18340
movq %rax, -0x8e8(%rbp)
jmp 0x166e5
movq -0x8e8(%rbp), %rsi
leaq -0x490(%rbp), %rdi
callq 0x51b0
jmp 0x166fa
leaq -0x490(%rbp), %rdi
callq 0x5190
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5330
movsd %xmm0, -0x408(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x18360
jmp 0x16725
movb $0x1, -0x451(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x52a0
jmp 0x167b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x430(%rbp), %rdi
callq 0x52a0
leaq -0x450(%rbp), %rdi
callq 0x52a0
jmp 0x16f3a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x16eeb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x490(%rbp), %rdi
callq 0x52a0
jmp 0x16eeb
movb $0x0, -0x1(%rbp)
movl $0x1, -0x494(%rbp)
jmp 0x16e93
jmp 0x16876
jmp 0x167bd
cmpl $0x0, -0x40c(%rbp)
jbe 0x16874
leaq -0x70(%rbp), %rdi
callq 0x18340
movq %rax, -0x8f0(%rbp)
jmp 0x167dc
movq -0x8f0(%rbp), %rsi
leaq -0x4b8(%rbp), %rdi
callq 0x51b0
jmp 0x167f1
leaq -0x4b8(%rbp), %rdi
callq 0x5190
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5330
movsd %xmm0, -0x4c0(%rbp)
leaq -0x470(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0x18380
jmp 0x16826
leaq -0x70(%rbp), %rdi
callq 0x18360
jmp 0x16831
movl -0x40c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40c(%rbp)
leaq -0x4b8(%rbp), %rdi
callq 0x52a0
jmp 0x167bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x4b8(%rbp), %rdi
callq 0x52a0
jmp 0x16eeb
jmp 0x16876
leaq -0xa0(%rbp), %rdi
callq 0x147e0
movb %al, -0x8f1(%rbp)
jmp 0x1688a
movb -0x8f1(%rbp), %al
testb $0x1, %al
jne 0x16899
jmp 0x16a8c
testb $0x1, -0x451(%rbp)
jne 0x16a8c
xorl %eax, %eax
movl %eax, %esi
leaq -0x470(%rbp), %rdi
movq %rdi, -0x900(%rbp)
callq 0x183f0
movq -0x900(%rbp), %rdi
movsd (%rax), %xmm0
movsd %xmm0, -0x4c8(%rbp)
movl $0x1, %esi
callq 0x183f0
movsd (%rax), %xmm0
movsd %xmm0, -0x4d0(%rbp)
leaq 0x571b(%rip), %rsi      # 0x1c008
leaq -0xa0(%rbp), %rdi
callq 0x17ac0
movb %al, -0x8f2(%rbp)
jmp 0x16901
movb -0x8f2(%rbp), %al
testb $0x1, %al
jne 0x1690d
jmp 0x1692a
movsd -0x4d0(%rbp), %xmm0
addsd -0x4c8(%rbp), %xmm0
movsd %xmm0, -0x408(%rbp)
jmp 0x16a87
leaq 0x56d9(%rip), %rsi      # 0x1c00a
leaq -0xa0(%rbp), %rdi
callq 0x17ac0
movb %al, -0x901(%rbp)
jmp 0x16945
movb -0x901(%rbp), %al
testb $0x1, %al
jne 0x16951
jmp 0x1696e
movsd -0x4d0(%rbp), %xmm0
subsd -0x4c8(%rbp), %xmm0
movsd %xmm0, -0x408(%rbp)
jmp 0x16a85
leaq 0x5697(%rip), %rsi      # 0x1c00c
leaq -0xa0(%rbp), %rdi
callq 0x17ac0
movb %al, -0x902(%rbp)
jmp 0x16989
movb -0x902(%rbp), %al
testb $0x1, %al
jne 0x16995
jmp 0x169b2
movsd -0x4d0(%rbp), %xmm0
mulsd -0x4c8(%rbp), %xmm0
movsd %xmm0, -0x408(%rbp)
jmp 0x16a83
leaq 0x5655(%rip), %rsi      # 0x1c00e
leaq -0xa0(%rbp), %rdi
callq 0x17ac0
movb %al, -0x903(%rbp)
jmp 0x169cd
movb -0x903(%rbp), %al
testb $0x1, %al
jne 0x169d9
jmp 0x169f6
movsd -0x4d0(%rbp), %xmm0
divsd -0x4c8(%rbp), %xmm0
movsd %xmm0, -0x408(%rbp)
jmp 0x16a81
leaq 0x5609(%rip), %rsi      # 0x1c006
leaq -0xa0(%rbp), %rdi
callq 0x17ac0
movb %al, -0x904(%rbp)
jmp 0x16a11
movb -0x904(%rbp), %al
testb $0x1, %al
jne 0x16a1d
jmp 0x16a7f
leaq -0x470(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x183f0
cvttsd2si (%rax), %eax
movl %eax, -0x4d4(%rbp)
leaq -0x470(%rbp), %rdi
movl $0x1, %esi
callq 0x183f0
cvttsd2si (%rax), %eax
movl %eax, -0x4d8(%rbp)
movl -0x4d8(%rbp), %edi
movl -0x4d4(%rbp), %esi
callq 0x14510
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x4e0(%rbp)
movsd -0x4e0(%rbp), %xmm0
movsd %xmm0, -0x408(%rbp)
jmp 0x16a81
jmp 0x16a83
jmp 0x16a85
jmp 0x16a87
jmp 0x16df2
leaq -0xa0(%rbp), %rdi
callq 0x14ad0
movb %al, -0x905(%rbp)
jmp 0x16aa0
movb -0x905(%rbp), %al
testb $0x1, %al
jne 0x16aaf
jmp 0x16df0
xorl %eax, %eax
movl %eax, %esi
leaq -0x470(%rbp), %rdi
callq 0x183f0
movsd (%rax), %xmm0
movsd %xmm0, -0x4e8(%rbp)
leaq -0x528(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0x51b0
jmp 0x16ae0
leaq -0x508(%rbp), %rdi
leaq -0x528(%rbp), %rsi
callq 0x148f0
leaq -0x528(%rbp), %rdi
callq 0x52a0
leaq -0xa0(%rbp), %rdi
leaq 0x54fd(%rip), %rsi      # 0x1c00a
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
movq %rax, %rdx
movl $0x1, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq $-0x1, %rdx
cmovnel %ecx, %eax
cvtsi2sd %eax, %xmm0
movsd %xmm0, -0x530(%rbp)
leaq -0x508(%rbp), %rdi
leaq 0x5d45(%rip), %rsi      # 0x1c889
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16b6d
movsd -0x4e8(%rbp), %xmm0
callq 0x50c0
movsd %xmm0, -0x408(%rbp)
jmp 0x16dcc
leaq -0x508(%rbp), %rdi
leaq 0x5d12(%rip), %rsi      # 0x1c88d
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16ba4
movsd -0x4e8(%rbp), %xmm0
callq 0x57b0
movsd %xmm0, -0x408(%rbp)
jmp 0x16dca
leaq -0x508(%rbp), %rdi
leaq 0x5cdf(%rip), %rsi      # 0x1c891
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16bdb
movsd -0x4e8(%rbp), %xmm0
callq 0x5240
movsd %xmm0, -0x408(%rbp)
jmp 0x16dc8
leaq -0x508(%rbp), %rdi
leaq 0x5cac(%rip), %rsi      # 0x1c895
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16c12
movsd -0x4e8(%rbp), %xmm0
callq 0x5370
movsd %xmm0, -0x408(%rbp)
jmp 0x16dc6
leaq -0x508(%rbp), %rdi
leaq 0x5c78(%rip), %rsi      # 0x1c898
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16c49
movsd -0x4e8(%rbp), %xmm0
callq 0x5210
movsd %xmm0, -0x408(%rbp)
jmp 0x16dc4
leaq -0x508(%rbp), %rdi
leaq 0x5c45(%rip), %rsi      # 0x1c89c
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16c80
movsd -0x4e8(%rbp), %xmm0
callq 0x5750
movsd %xmm0, -0x408(%rbp)
jmp 0x16dc2
leaq -0x508(%rbp), %rdi
leaq 0x5747(%rip), %rsi      # 0x1c3d5
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16d15
leaq -0x470(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x183f0
movsd (%rax), %xmm0
movsd %xmm0, -0x538(%rbp)
leaq -0x470(%rbp), %rdi
movl $0x1, %esi
callq 0x183f0
movsd (%rax), %xmm0
movsd %xmm0, -0x540(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x540(%rbp), %xmm0
jbe 0x16cf3
movsd 0x5b7d(%rip), %xmm0     # 0x1c868
movsd %xmm0, -0x530(%rbp)
movsd -0x540(%rbp), %xmm0
movsd -0x538(%rbp), %xmm1
callq 0x5720
movsd %xmm0, -0x408(%rbp)
jmp 0x16dc0
leaq -0x508(%rbp), %rdi
leaq 0x5b5d(%rip), %rsi      # 0x1c880
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16d8a
leaq -0x470(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x183f0
movsd (%rax), %xmm0
movsd %xmm0, -0x548(%rbp)
leaq -0x470(%rbp), %rdi
movl $0x1, %esi
callq 0x183f0
movsd (%rax), %xmm0
movsd %xmm0, -0x550(%rbp)
movsd -0x550(%rbp), %xmm0
movsd -0x548(%rbp), %xmm1
callq 0x5720
movsd %xmm0, -0x408(%rbp)
jmp 0x16dbe
leaq -0x508(%rbp), %rdi
leaq 0x5b08(%rip), %rsi      # 0x1c8a0
xorl %eax, %eax
movl %eax, %edx
callq 0x5830
cmpq $-0x1, %rax
je 0x16dbc
movsd -0x4e8(%rbp), %xmm0
callq 0x5350
movsd %xmm0, -0x408(%rbp)
jmp 0x16dbe
jmp 0x16dc0
jmp 0x16dc2
jmp 0x16dc4
jmp 0x16dc6
jmp 0x16dc8
jmp 0x16dca
jmp 0x16dcc
movsd -0x530(%rbp), %xmm0
mulsd -0x408(%rbp), %xmm0
movsd %xmm0, -0x408(%rbp)
leaq -0x508(%rbp), %rdi
callq 0x52a0
jmp 0x16df2
movsd -0x408(%rbp), %xmm0
cvttsd2si -0x408(%rbp), %rax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jne 0x16e26
jp 0x16e26
cvttsd2si -0x408(%rbp), %rax
cvtsi2sd %rax, %xmm0
movsd %xmm0, -0x408(%rbp)
leaq -0x6d8(%rbp), %rdi
callq 0x52f0
jmp 0x16e34
leaq -0x6c8(%rbp), %rdi
movsd -0x408(%rbp), %xmm0
callq 0x57e0
jmp 0x16e4a
leaq -0x6f8(%rbp), %rdi
leaq -0x6d8(%rbp), %rsi
callq 0x5410
jmp 0x16e5f
leaq -0x70(%rbp), %rdi
leaq -0x6f8(%rbp), %rsi
callq 0x18410
jmp 0x16e71
leaq -0x6f8(%rbp), %rdi
callq 0x52a0
leaq -0x6d8(%rbp), %rdi
callq 0x5320
movl $0x0, -0x494(%rbp)
leaq -0x470(%rbp), %rdi
callq 0x18440
movl -0x494(%rbp), %eax
testl %eax, %eax
jne 0x16f05
jmp 0x16eab
jmp 0x16ef9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
jmp 0x16edf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x6f8(%rbp), %rdi
callq 0x52a0
leaq -0x6d8(%rbp), %rdi
callq 0x5320
leaq -0x470(%rbp), %rdi
callq 0x18440
jmp 0x16f3a
jmp 0x16efb
movl $0x0, -0x494(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x52a0
movl -0x494(%rbp), %eax
testl %eax, %eax
jne 0x17085
jmp 0x16f21
jmp 0x16f23
leaq -0x78(%rbp), %rdi
xorl %esi, %esi
callq 0x184a0
movq %rax, -0x700(%rbp)
jmp 0x1630d
leaq -0xa0(%rbp), %rdi
callq 0x52a0
jmp 0x1709c
leaq -0x70(%rbp), %rdi
callq 0x18300
movq %rax, -0x910(%rbp)
jmp 0x16f5d
movq -0x910(%rbp), %rax
cmpq $0x1, %rax
jne 0x17077
leaq -0x70(%rbp), %rdi
callq 0x18340
movq %rax, -0x918(%rbp)
jmp 0x16f80
movq -0x918(%rbp), %rsi
movq -0x20(%rbp), %rdi
callq 0x5040
jmp 0x16f92
movq -0x20(%rbp), %rdi
callq 0x5190
movq %rax, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5330
movsd %xmm0, -0x708(%rbp)
movsd -0x708(%rbp), %xmm0
cvttsd2si -0x708(%rbp), %rax
cvtsi2sd %rax, %xmm1
ucomisd %xmm1, %xmm0
jne 0x17067
jp 0x17067
cvttsd2si -0x708(%rbp), %rax
movq %rax, -0x710(%rbp)
leaq -0x898(%rbp), %rdi
callq 0x52f0
jmp 0x16ff3
leaq -0x888(%rbp), %rdi
movq -0x710(%rbp), %rsi
callq 0x5770
jmp 0x17008
leaq -0x8b8(%rbp), %rdi
leaq -0x898(%rbp), %rsi
callq 0x5410
jmp 0x1701d
movq -0x20(%rbp), %rdi
leaq -0x8b8(%rbp), %rsi
callq 0x5510
leaq -0x8b8(%rbp), %rdi
callq 0x52a0
leaq -0x898(%rbp), %rdi
callq 0x5320
jmp 0x17067
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xa8(%rbp)
movl %eax, -0xac(%rbp)
leaq -0x898(%rbp), %rdi
callq 0x5320
jmp 0x1709c
movb $0x1, -0x1(%rbp)
movl $0x1, -0x494(%rbp)
jmp 0x17085
movb $0x0, -0x1(%rbp)
movl $0x1, -0x494(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x184e0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x920, %rsp            # imm = 0x920
popq %rbp
retq
leaq -0x70(%rbp), %rdi
callq 0x184e0
movq -0xa8(%rbp), %rdi
callq 0x5730
nopw %cs:(%rax,%rax)