// File: /workspace/github_c_makefile_star2_O0/mohuangrui[P]ArtraCFD/calculator.c
// Function: TranslateToMath
static int TranslateToMath(char *str)
{
    char *scanner = str;
    char *receiver = str;
    while ('\0' != *scanner) {
        switch (*scanner) {
            case 'e':
                if (('x' == scanner[1]) && ('p' == scanner[2])) { /* exp */
                    *receiver = 'e';
                    ++receiver;
                    scanner += 3;
                } else {
                    ShowWarning("unknown operator: e..");
                    return 1;
                }
                break;
            case 'l':
                if (('n' == scanner[1])) {/* ln */
                    *receiver = 'n';
                    ++receiver;
                    scanner += 2;
                } else {
                    if (('g' == scanner[1])) { /* lg */
                        *receiver = 'g';
                        ++receiver;
                        scanner += 2;
                    } else {
                        ShowWarning("unknown operator: l..");
                        return 1;
                    }
                }
                break;
            case 'a':
                if (('b' == scanner[1]) && ('s' == scanner[2])) { /* abs */
                    *receiver = 'a';
                    ++receiver;
                    scanner += 3;
                } else {
                    if (('n' == scanner[1]) && ('s' == scanner[2])) { /* ans */
                        *receiver = 'q';
                        ++receiver;
                        scanner += 3;
                    } else {
                        ShowWarning("unknown operator: a..");
                        return 1;
                    }
                }
                break;
            case 's':
                if (('i' == scanner[1]) && ('n' == scanner[2])) { /* sin */
                    *receiver = 's';
                    ++receiver;
                    scanner += 3;
                } else {
                    ShowWarning("unknown operator: s..");
                    return 1;
                }
                break;
            case 'c':
                if (('o' == scanner[1]) && ('s' == scanner[2])) { /* cos */
                    *receiver = 'c';
                    ++receiver;
                    scanner += 3;
                } else {
                    ShowWarning("unknown operator: c..");
                    return 1;
                }
                break;
            case 't':
                if (('a' == scanner[1]) && ('n' == scanner[2])) { /* tan */
                    *receiver = 't';
                    ++receiver;
                    scanner += 3;
                } else { /* t */
                    *receiver = 'u';
                    ++receiver;
                    ++scanner;
                }
                break;
            case 'p':
                if (('i' == scanner[1])) { /* pi */
                    *receiver = 'p';
                    ++receiver;
                    scanner += 2;
                } else {
                    ShowWarning("unknown operator: p..");
                    return 1;
                }
                break;
            case 'x': /* x */
                *receiver = 'x';
                ++receiver;
                ++scanner;
                break;
            case 'y': /* y */
                *receiver = 'y';
                ++receiver;
                ++scanner;
                break;
            case 'z': /* z */
                *receiver = 'z';
                ++receiver;
                ++scanner;
                break;
            case '.':
                if (IsDigit(scanner[1]) && IsDigit(scanner[-1])) {
                    *receiver = *scanner;
                    ++receiver;
                    ++scanner;
                } else {
                    ShowWarning(". is preceded or followed by non digits");
                    return 1;
                }
                break;
            case ' ':
                ++scanner;  /* ignore space */
                break;
            default:
                if (IsDigit(*scanner) || IsPureBinaryOperator(*scanner) ||
                        IsDualOperator(*scanner) || IsLeftParentheses(*scanner) ||
                        IsRightParentheses(*scanner)) { /* legal input single character */
                    *receiver = *scanner;
                    ++receiver;
                    ++scanner;
                } else {
                    ShowWarning("unknown operator in expression");
                    return 1;
                }
                break;
        }
    }
    *receiver='\0';
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x3d73
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
addl $-0x20, %eax
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0x5a, %eax
ja 0x3cda
movq -0x28(%rbp), %rax
leaq 0x20737(%rip), %rcx     # 0x24018
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x78, %eax
cmpl %ecx, %eax
jne 0x392d
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %ecx
movl $0x70, %eax
cmpl %ecx, %eax
jne 0x392d
movq -0x20(%rbp), %rax
movb $0x65, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x3947
leaq 0x20e52(%rip), %rdi     # 0x24786
movb $0x0, %al
callq 0xbb20
movl $0x1, -0x4(%rbp)
jmp 0x3d81
jmp 0x3d6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x6e, %eax
cmpl %ecx, %eax
jne 0x397e
movq -0x20(%rbp), %rax
movb $0x6e, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rbp)
jmp 0x39cc
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x67, %eax
cmpl %ecx, %eax
jne 0x39b0
movq -0x20(%rbp), %rax
movb $0x67, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rbp)
jmp 0x39ca
leaq 0x20de5(%rip), %rdi     # 0x2479c
movb $0x0, %al
callq 0xbb20
movl $0x1, -0x4(%rbp)
jmp 0x3d81
jmp 0x39cc
jmp 0x3d6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x62, %eax
cmpl %ecx, %eax
jne 0x3a14
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %ecx
movl $0x73, %eax
cmpl %ecx, %eax
jne 0x3a14
movq -0x20(%rbp), %rax
movb $0x61, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x3a73
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x6e, %eax
cmpl %ecx, %eax
jne 0x3a57
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %ecx
movl $0x73, %eax
cmpl %ecx, %eax
jne 0x3a57
movq -0x20(%rbp), %rax
movb $0x71, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x3a71
leaq 0x20d54(%rip), %rdi     # 0x247b2
movb $0x0, %al
callq 0xbb20
movl $0x1, -0x4(%rbp)
jmp 0x3d81
jmp 0x3a73
jmp 0x3d6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x69, %eax
cmpl %ecx, %eax
jne 0x3abb
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %ecx
movl $0x6e, %eax
cmpl %ecx, %eax
jne 0x3abb
movq -0x20(%rbp), %rax
movb $0x73, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x3ad5
leaq 0x20d06(%rip), %rdi     # 0x247c8
movb $0x0, %al
callq 0xbb20
movl $0x1, -0x4(%rbp)
jmp 0x3d81
jmp 0x3d6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x6f, %eax
cmpl %ecx, %eax
jne 0x3b1d
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %ecx
movl $0x73, %eax
cmpl %ecx, %eax
jne 0x3b1d
movq -0x20(%rbp), %rax
movb $0x63, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x3b37
leaq 0x20cba(%rip), %rdi     # 0x247de
movb $0x0, %al
callq 0xbb20
movl $0x1, -0x4(%rbp)
jmp 0x3d81
jmp 0x3d6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x61, %eax
cmpl %ecx, %eax
jne 0x3b7f
movq -0x18(%rbp), %rax
movsbl 0x2(%rax), %ecx
movl $0x6e, %eax
cmpl %ecx, %eax
jne 0x3b7f
movq -0x20(%rbp), %rax
movb $0x74, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x18(%rbp)
jmp 0x3b9e
movq -0x20(%rbp), %rax
movb $0x75, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3d6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %ecx
movl $0x69, %eax
cmpl %ecx, %eax
jne 0x3bd5
movq -0x20(%rbp), %rax
movb $0x70, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x2, %rax
movq %rax, -0x18(%rbp)
jmp 0x3bef
leaq 0x20c18(%rip), %rdi     # 0x247f4
movb $0x0, %al
callq 0xbb20
movl $0x1, -0x4(%rbp)
jmp 0x3d81
jmp 0x3d6e
movq -0x20(%rbp), %rax
movb $0x78, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3d6e
movq -0x20(%rbp), %rax
movb $0x79, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3d6e
movq -0x20(%rbp), %rax
movb $0x7a, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3d6e
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %edi
callq 0x3e30
cmpl $0x0, %eax
je 0x3caa
movq -0x18(%rbp), %rax
movsbl -0x1(%rax), %edi
callq 0x3e30
cmpl $0x0, %eax
je 0x3caa
movq -0x18(%rbp), %rax
movb (%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3cc4
leaq 0x20b59(%rip), %rdi     # 0x2480a
movb $0x0, %al
callq 0xbb20
movl $0x1, -0x4(%rbp)
jmp 0x3d81
jmp 0x3d6e
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3d6e
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x3e30
cmpl $0x0, %eax
jne 0x3d2f
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4730
cmpl $0x0, %eax
jne 0x3d2f
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4780
cmpl $0x0, %eax
jne 0x3d2f
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x47c0
cmpl $0x0, %eax
jne 0x3d2f
movq -0x18(%rbp), %rax
movsbl (%rax), %edi
callq 0x4810
cmpl $0x0, %eax
je 0x3d55
movq -0x18(%rbp), %rax
movb (%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x3d6c
leaq 0x20ad6(%rip), %rdi     # 0x24832
movb $0x0, %al
callq 0xbb20
movl $0x1, -0x4(%rbp)
jmp 0x3d81
jmp 0x3d6e
jmp 0x38ac
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)