#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stderr;
int strlen(char *);
int main() {
  char str[2333] = {0};
  scanf("%[^\n]", str);
  printf("%s\n", str);
  bool hasSign = false, gotDot = false, gotDigit = false, exp = false;
  int len, i = 0;
  len = strlen(str);
  bool isOK = true;
  while (i < len) {
    char ch = str[i];
    if (((ch) >= '0' && (ch) <= '9')) {
      gotDigit = true;
    } else if (ch == '.') {
      if (!exp) {
        if (!gotDot) {
          gotDot = true;
        } else {
          (fprintf(stderr, "%s\n", ("multidot")));
          isOK = false;
          break;
        }
      } else {
        (fprintf(stderr, "%s\n", ("dot in exp")));
        isOK = false;
        break;
      }
    } else if (ch == 'e') {
      if (!exp) {
        if (!gotDigit) {
          (fprintf(stderr, "%s\n", ("no digit before exp")));
          isOK = false;
          break;
        }
        exp = true;
        hasSign = false;
        gotDigit = false;
      } else {
        (fprintf(stderr, "%s\n", ("multiexp")));
        isOK = false;
        break;
      }
    } else if (ch == '-' || ch == '+') {
      if (!hasSign) {
        hasSign = true;
      } else {
        (fprintf(stderr, "%s\n", ("multisign")));
        isOK = false;
        break;
      }
    } else {
      (fprintf(stderr, "%s\n", ("invalid char")));
      isOK = false;
      break;
    }
    ++i;
  }
  if (isOK && !gotDigit) {
    (fprintf(stderr, "%s\n", ("no digit")));
    isOK = false;
  }
  printf("isok: %d\n", isOK);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x950,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x930(%rbp),%rdi
xor    %esi,%esi
mov    $0x91d,%edx
call   1050 <memset@plt>
lea    -0x930(%rbp),%rsi
lea    0xe7d(%rip),%rdi
call   1070 <scanf@plt>
lea    -0x930(%rbp),%rsi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x934(%rbp)
movl   $0x0,-0x938(%rbp)
movl   $0x0,-0x93c(%rbp)
movl   $0x0,-0x940(%rbp)
movl   $0x0,-0x948(%rbp)
lea    -0x930(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x944(%rbp)
movl   $0x1,-0x94c(%rbp)
mov    -0x948(%rbp),%eax
cmp    -0x944(%rbp),%eax
jge    143b <main+0x2eb>
movslq -0x948(%rbp),%rax
mov    -0x930(%rbp,%rax,1),%al
mov    %al,-0x94d(%rbp)
movsbl -0x94d(%rbp),%eax
cmp    $0x30,%eax
jl     1240 <main+0xf0>
movsbl -0x94d(%rbp),%eax
cmp    $0x39,%eax
jg     1240 <main+0xf0>
movl   $0x1,-0x93c(%rbp)
jmp    1427 <main+0x2d7>
movsbl -0x94d(%rbp),%eax
cmp    $0x2e,%eax
jne    12d9 <main+0x189>
cmpl   $0x0,-0x940(%rbp)
jne    12a9 <main+0x159>
cmpl   $0x0,-0x938(%rbp)
jne    1279 <main+0x129>
movl   $0x1,-0x938(%rbp)
jmp    12a4 <main+0x154>
mov    0x2d60(%rip),%rax
mov    (%rax),%edi
lea    0xd7d(%rip),%rsi
lea    0xd7a(%rip),%rdx
call   1060 <fprintf@plt>
movl   $0x0,-0x94c(%rbp)
jmp    143b <main+0x2eb>
jmp    12d4 <main+0x184>
mov    0x2d30(%rip),%rax
mov    (%rax),%edi
lea    0xd4d(%rip),%rsi
lea    0xd53(%rip),%rdx
call   1060 <fprintf@plt>
movl   $0x0,-0x94c(%rbp)
jmp    143b <main+0x2eb>
jmp    1422 <main+0x2d2>
movsbl -0x94d(%rbp),%eax
cmp    $0x65,%eax
jne    1381 <main+0x231>
cmpl   $0x0,-0x940(%rbp)
jne    1351 <main+0x201>
cmpl   $0x0,-0x93c(%rbp)
jne    132e <main+0x1de>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
lea    0xcf3(%rip),%rsi
lea    0xd04(%rip),%rdx
call   1060 <fprintf@plt>
movl   $0x0,-0x94c(%rbp)
jmp    143b <main+0x2eb>
movl   $0x1,-0x940(%rbp)
movl   $0x0,-0x934(%rbp)
movl   $0x0,-0x93c(%rbp)
jmp    137c <main+0x22c>
mov    0x2c88(%rip),%rax
mov    (%rax),%edi
lea    0xca5(%rip),%rsi
lea    0xcca(%rip),%rdx
call   1060 <fprintf@plt>
movl   $0x0,-0x94c(%rbp)
jmp    143b <main+0x2eb>
jmp    141d <main+0x2cd>
movsbl -0x94d(%rbp),%eax
cmp    $0x2d,%eax
je     13a1 <main+0x251>
movsbl -0x94d(%rbp),%eax
cmp    $0x2b,%eax
jne    13ed <main+0x29d>
cmpl   $0x0,-0x934(%rbp)
jne    13bd <main+0x26d>
movl   $0x1,-0x934(%rbp)
jmp    13e8 <main+0x298>
mov    0x2c1c(%rip),%rax
mov    (%rax),%edi
lea    0xc39(%rip),%rsi
lea    0xc67(%rip),%rdx
call   1060 <fprintf@plt>
movl   $0x0,-0x94c(%rbp)
jmp    143b <main+0x2eb>
jmp    1418 <main+0x2c8>
mov    0x2bec(%rip),%rax
mov    (%rax),%edi
lea    0xc09(%rip),%rsi
lea    0xc41(%rip),%rdx
call   1060 <fprintf@plt>
movl   $0x0,-0x94c(%rbp)
jmp    143b <main+0x2eb>
jmp    141d <main+0x2cd>
jmp    1422 <main+0x2d2>
jmp    1427 <main+0x2d7>
mov    -0x948(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x948(%rbp)
jmp    11eb <main+0x9b>
cmpl   $0x0,-0x94c(%rbp)
je     147b <main+0x32b>
cmpl   $0x0,-0x93c(%rbp)
jne    147b <main+0x32b>
mov    0x2b84(%rip),%rax
mov    (%rax),%edi
lea    0xba1(%rip),%rsi
lea    0xbe6(%rip),%rdx
call   1060 <fprintf@plt>
movl   $0x0,-0x94c(%rbp)
mov    -0x94c(%rbp),%esi
lea    0xbd3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x950,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x928,%rsp
mov    %rsp,%rbx
mov    $0x91d,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xe76(%rip),%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xea9(%rip),%rdx
test   %eax,%eax
jle    128d <main+0x12d>
mov    %eax,%eax
xor    %esi,%esi
lea    0xe89(%rip),%r8
lea    0xe78(%rip),%r14
lea    0xe68(%rip),%r15
lea    0xe4d(%rip),%r9
lea    0xe3b(%rip),%r10
lea    0xe2b(%rip),%r11
xor    %ebx,%ebx
xor    %r13d,%r13d
xor    %ecx,%ecx
xor    %r12d,%r12d
jmp    11fe <main+0x9e>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%ecx
add    $0x1,%rsi
cmp    %rsi,%rax
je     1266 <main+0x106>
movzbl (%rsp,%rsi,1),%ebp
lea    -0x30(%rbp),%edi
cmp    $0xa,%dil
jb     11f0 <main+0x90>
cmp    $0x2d,%bpl
jg     1230 <main+0xd0>
cmp    $0x2b,%bpl
je     121d <main+0xbd>
cmp    $0x2d,%bpl
jne    127b <main+0x11b>
test   %ebx,%ebx
mov    $0x1,%ebx
je     11f5 <main+0x95>
jmp    1271 <main+0x111>
nopl   0x0(%rax,%rax,1)
cmp    $0x65,%bpl
je     1251 <main+0xf1>
cmp    $0x2e,%bpl
jne    127b <main+0x11b>
test   %r13d,%r13d
jne    1280 <main+0x120>
test   %r12d,%r12d
jne    1285 <main+0x125>
xor    %r13d,%r13d
mov    $0x1,%r12d
jmp    11f5 <main+0x95>
test   %r13d,%r13d
jne    1276 <main+0x116>
test   %ecx,%ecx
je     128a <main+0x12a>
mov    $0x1,%r13d
xor    %ecx,%ecx
xor    %ebx,%ebx
jmp    11f5 <main+0x95>
mov    $0x1,%esi
test   %ecx,%ecx
jne    12a4 <main+0x144>
jmp    128d <main+0x12d>
mov    %r14,%rdx
jmp    128d <main+0x12d>
mov    %r15,%rdx
jmp    128d <main+0x12d>
mov    %r8,%rdx
jmp    128d <main+0x12d>
mov    %r10,%rdx
jmp    128d <main+0x12d>
mov    %r11,%rdx
jmp    128d <main+0x12d>
mov    %r9,%rdx
mov    0x2d4c(%rip),%rax
mov    (%rax),%edi
lea    0xd69(%rip),%rsi
call   1070 <fprintf@plt>
xor    %esi,%esi
lea    0xdb0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x928,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%[^\0A]\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@stderr = global i32 0
@.str.2 = [9 x i8] c"multidot\00"
@.str.3 = [11 x i8] c"dot in exp\00"
@.str.4 = [20 x i8] c"no digit before exp\00"
@.str.5 = [9 x i8] c"multiexp\00"
@.str.6 = [10 x i8] c"multisign\00"
@.str.7 = [13 x i8] c"invalid char\00"
@.str.8 = [9 x i8] c"no digit\00"
@.str.9 = [10 x i8] c"isok: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2333 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32 0, i32* %1
%11 = bitcast [2333 x i8]* %2 to i8*
%12 = getelementptr inbounds [2333 x i8], [2333 x i8]* %2, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [2333 x i8], [2333 x i8]* %2, i64 0, i64 0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14)
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %8
%16 = getelementptr inbounds [2333 x i8], [2333 x i8]* %2, i64 0, i64 0
%17 = call i32 @strlen(i8* %16)
store i32 %17, i32* %7
store i32 1, i32* %9
br label %18
18: ; preds = %94, %0
%19 = load i32, i32* %8
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %97
22: ; preds = %18
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2333 x i8], [2333 x i8]* %2, i64 0, i64 %24
%26 = load i8, i8* %25
store i8 %26, i8* %10
%27 = load i8, i8* %10
%28 = sext i8 %27 to i32
%29 = icmp sge i32 %28, 48
br i1 %29, label %30, label %35
30: ; preds = %22
%31 = load i8, i8* %10
%32 = sext i8 %31 to i32
%33 = icmp sle i32 %32, 57
br i1 %33, label %34, label %35
34: ; preds = %30
store i32 1, i32* %5
br label %94
35: ; preds = %30, %22
%36 = load i8, i8* %10
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 46
br i1 %38, label %39, label %54
39: ; preds = %35
%40 = load i32, i32* %6
%41 = icmp ne i32 %40, 0
br i1 %41, label %50, label %42
42: ; preds = %39
%43 = load i32, i32* %4
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %42
store i32 1, i32* %4
br label %49
46: ; preds = %42
%47 = load i32, i32* @stderr
%48 = call i32 @fprintf(i32 %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %9
br label %97
49: ; preds = %45
br label %53
50: ; preds = %39
%51 = load i32, i32* @stderr
%52 = call i32 @fprintf(i32 %51, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %9
br label %97
53: ; preds = %49
br label %93
54: ; preds = %35
%55 = load i8, i8* %10
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 101
br i1 %57, label %58, label %72
58: ; preds = %54
%59 = load i32, i32* %6
%60 = icmp ne i32 %59, 0
br i1 %60, label %68, label %61
61: ; preds = %58
%62 = load i32, i32* %5
%63 = icmp ne i32 %62, 0
br i1 %63, label %67, label %64
64: ; preds = %61
%65 = load i32, i32* @stderr
%66 = call i32 @fprintf(i32 %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %9
br label %97
67: ; preds = %61
store i32 1, i32* %6
store i32 0, i32* %3
store i32 0, i32* %5
br label %71
68: ; preds = %58
%69 = load i32, i32* @stderr
%70 = call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %9
br label %97
71: ; preds = %67
br label %92
72: ; preds = %54
%73 = load i8, i8* %10
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 45
br i1 %75, label %80, label %76
76: ; preds = %72
%77 = load i8, i8* %10
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 43
br i1 %79, label %80, label %88
80: ; preds = %76, %72
%81 = load i32, i32* %3
%82 = icmp ne i32 %81, 0
br i1 %82, label %84, label %83
83: ; preds = %80
store i32 1, i32* %3
br label %87
84: ; preds = %80
%85 = load i32, i32* @stderr
%86 = call i32 @fprintf(i32 %85, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %9
br label %97
87: ; preds = %83
br label %91
88: ; preds = %76
%89 = load i32, i32* @stderr
%90 = call i32 @fprintf(i32 %89, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %9
br label %97
91: ; preds = %87
br label %92
92: ; preds = %91, %71
br label %93
93: ; preds = %92, %53
br label %94
94: ; preds = %93, %34
%95 = load i32, i32* %8
%96 = add nsw i32 %95, 1
store i32 %96, i32* %8
br label %18
97: ; preds = %88, %84, %68, %64, %50, %46, %18
%98 = load i32, i32* %9
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %106
100: ; preds = %97
%101 = load i32, i32* %5
%102 = icmp ne i32 %101, 0
br i1 %102, label %106, label %103
103: ; preds = %100
%104 = load i32, i32* @stderr
%105 = call i32 @fprintf(i32 %104, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %9
br label %106
106: ; preds = %103, %100, %97
%107 = load i32, i32* %9
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %107)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%[^\0A]\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@stderr = global i32 0
@.str.2 = [9 x i8] c"multidot\00"
@.str.3 = [11 x i8] c"dot in exp\00"
@.str.4 = [20 x i8] c"no digit before exp\00"
@.str.5 = [9 x i8] c"multiexp\00"
@.str.6 = [10 x i8] c"multisign\00"
@.str.7 = [13 x i8] c"invalid char\00"
@.str.8 = [9 x i8] c"no digit\00"
@.str.9 = [10 x i8] c"isok: %d\0A\00"
define i32 @main() {
%1 = alloca [2333 x i8]
%2 = getelementptr inbounds [2333 x i8], [2333 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @puts(i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %39
7: ; preds = %0
%8 = zext i32 %5 to i64
br label %9
9: ; preds = %7, %30
%10 = phi i64 [ 0, %7 ], [ %35, %30 ]
%11 = phi i32 [ 0, %7 ], [ %34, %30 ]
%12 = phi i32 [ 0, %7 ], [ %33, %30 ]
%13 = phi i32 [ 0, %7 ], [ %32, %30 ]
%14 = phi i32 [ 0, %7 ], [ %31, %30 ]
%15 = getelementptr inbounds [2333 x i8], [2333 x i8]* %1, i64 0, i64 %10
%16 = load i8, i8* %15
%17 = add i8 %16, -48
%18 = icmp ult i8 %17, 10
br i1 %18, label %30, label %19
19: ; preds = %9
switch i8 %16, label %39 [
i8 46, label %20
i8 101, label %24
i8 45, label %28
i8 43, label %28
]
20: ; preds = %19
%21 = icmp eq i32 %12, 0
br i1 %21, label %22, label %39
22: ; preds = %20
%23 = icmp eq i32 %14, 0
br i1 %23, label %30, label %39
24: ; preds = %19
%25 = icmp eq i32 %12, 0
br i1 %25, label %26, label %39
26: ; preds = %24
%27 = icmp eq i32 %13, 0
br i1 %27, label %39, label %30
28: ; preds = %19, %19
%29 = icmp eq i32 %11, 0
br i1 %29, label %30, label %39
30: ; preds = %9, %22, %26, %28
%31 = phi i32 [ %14, %9 ], [ 1, %22 ], [ %14, %26 ], [ %14, %28 ]
%32 = phi i32 [ 1, %9 ], [ %13, %22 ], [ 0, %26 ], [ %13, %28 ]
%33 = phi i32 [ %12, %9 ], [ 0, %22 ], [ 1, %26 ], [ %12, %28 ]
%34 = phi i32 [ %11, %9 ], [ %11, %22 ], [ 0, %26 ], [ 1, %28 ]
%35 = add nuw nsw i64 %10, 1
%36 = icmp eq i64 %35, %8
br i1 %36, label %37, label %9
37: ; preds = %30
%38 = icmp eq i32 %32, 0
br i1 %38, label %39, label %43
39: ; preds = %19, %28, %24, %26, %20, %22, %37, %0
%40 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), %0 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), %37 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), %22 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), %20 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), %26 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), %24 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), %28 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), %19 ]
%41 = load i32, i32* @stderr
%42 = call i32 @fprintf(i32 %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %40)
br label %43
43: ; preds = %39, %37
%44 = phi i32 [ 1, %37 ], [ 0, %39 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %44)
ret i32 0
}