#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 getchar();
int /*<<< orphan*/ printf(char *);
void recogniser2() {
  const int sign = 0, integer = 1, fraction = 2, real = 3, error = 4;
  int ch;
  int condition = sign;
  while ((ch = getchar()) != '\n')
    if (condition == sign) {
      if (ch == '+' || ch == '-')
        condition = sign;
      else if (ch >= '0' && ch <= '9')
        condition = integer;
      else if (ch = '.')
        condition = fraction;
    } else if (condition == integer) {
      if (ch == '+' || ch == '-')
        condition = error;
      else if (ch >= '0' && ch <= '9')
        condition = integer;
      else if (ch = '.')
        condition = real;
    } else if (condition == fraction) {
      if (ch == '+' || ch == '-')
        condition = error;
      else if (ch >= '0' && ch <= '9')
        condition = real;
      else if (ch = '.')
        condition = error;
    } else if (condition == real) {
      if (ch == '+' || ch == '-')
        condition = error;
      else if (ch >= '0' && ch <= '9')
        condition = real;
      else if (ch = '.')
        condition = error;
    } else if (condition == error) {
      if (ch == '+' || ch == '-')
        condition = error;
      else if (ch >= '0' && ch <= '9')
        condition = error;
      else if (ch = '.')
        condition = error;
    }
  if (condition == real)
    printf("Accepted by method 2\n");
  else
    printf("Rejected by method 2\n");
}


x86 assembly (clang, -O0):
<recogniser2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xa,%eax
je     13cc <recogniser2+0x2ac>
cmpl   $0x0,-0x1c(%rbp)
jne    11db <recogniser2+0xbb>
cmpl   $0x2b,-0x18(%rbp)
je     1183 <recogniser2+0x63>
cmpl   $0x2d,-0x18(%rbp)
jne    118f <recogniser2+0x6f>
movl   $0x0,-0x1c(%rbp)
jmp    11d6 <recogniser2+0xb6>
cmpl   $0x30,-0x18(%rbp)
jl     11af <recogniser2+0x8f>
cmpl   $0x39,-0x18(%rbp)
jg     11af <recogniser2+0x8f>
movl   $0x1,-0x1c(%rbp)
jmp    11d1 <recogniser2+0xb1>
movl   $0x2e,-0x18(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    11c5 <recogniser2+0xa5>
jmp    11cc <recogniser2+0xac>
movl   $0x2,-0x1c(%rbp)
jmp    11d1 <recogniser2+0xb1>
jmp    11d6 <recogniser2+0xb6>
jmp    13c7 <recogniser2+0x2a7>
cmpl   $0x1,-0x1c(%rbp)
jne    1251 <recogniser2+0x131>
cmpl   $0x2b,-0x18(%rbp)
je     11f9 <recogniser2+0xd9>
cmpl   $0x2d,-0x18(%rbp)
jne    1205 <recogniser2+0xe5>
movl   $0x4,-0x1c(%rbp)
jmp    124c <recogniser2+0x12c>
cmpl   $0x30,-0x18(%rbp)
jl     1225 <recogniser2+0x105>
cmpl   $0x39,-0x18(%rbp)
jg     1225 <recogniser2+0x105>
movl   $0x1,-0x1c(%rbp)
jmp    1247 <recogniser2+0x127>
movl   $0x2e,-0x18(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    123b <recogniser2+0x11b>
jmp    1242 <recogniser2+0x122>
movl   $0x3,-0x1c(%rbp)
jmp    1247 <recogniser2+0x127>
jmp    124c <recogniser2+0x12c>
jmp    13c2 <recogniser2+0x2a2>
cmpl   $0x2,-0x1c(%rbp)
jne    12c7 <recogniser2+0x1a7>
cmpl   $0x2b,-0x18(%rbp)
je     126f <recogniser2+0x14f>
cmpl   $0x2d,-0x18(%rbp)
jne    127b <recogniser2+0x15b>
movl   $0x4,-0x1c(%rbp)
jmp    12c2 <recogniser2+0x1a2>
cmpl   $0x30,-0x18(%rbp)
jl     129b <recogniser2+0x17b>
cmpl   $0x39,-0x18(%rbp)
jg     129b <recogniser2+0x17b>
movl   $0x3,-0x1c(%rbp)
jmp    12bd <recogniser2+0x19d>
movl   $0x2e,-0x18(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    12b1 <recogniser2+0x191>
jmp    12b8 <recogniser2+0x198>
movl   $0x4,-0x1c(%rbp)
jmp    12bd <recogniser2+0x19d>
jmp    12c2 <recogniser2+0x1a2>
jmp    13bd <recogniser2+0x29d>
cmpl   $0x3,-0x1c(%rbp)
jne    133d <recogniser2+0x21d>
cmpl   $0x2b,-0x18(%rbp)
je     12e5 <recogniser2+0x1c5>
cmpl   $0x2d,-0x18(%rbp)
jne    12f1 <recogniser2+0x1d1>
movl   $0x4,-0x1c(%rbp)
jmp    1338 <recogniser2+0x218>
cmpl   $0x30,-0x18(%rbp)
jl     1311 <recogniser2+0x1f1>
cmpl   $0x39,-0x18(%rbp)
jg     1311 <recogniser2+0x1f1>
movl   $0x3,-0x1c(%rbp)
jmp    1333 <recogniser2+0x213>
movl   $0x2e,-0x18(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1327 <recogniser2+0x207>
jmp    132e <recogniser2+0x20e>
movl   $0x4,-0x1c(%rbp)
jmp    1333 <recogniser2+0x213>
jmp    1338 <recogniser2+0x218>
jmp    13b8 <recogniser2+0x298>
cmpl   $0x4,-0x1c(%rbp)
jne    13b3 <recogniser2+0x293>
cmpl   $0x2b,-0x18(%rbp)
je     135b <recogniser2+0x23b>
cmpl   $0x2d,-0x18(%rbp)
jne    1367 <recogniser2+0x247>
movl   $0x4,-0x1c(%rbp)
jmp    13ae <recogniser2+0x28e>
cmpl   $0x30,-0x18(%rbp)
jl     1387 <recogniser2+0x267>
cmpl   $0x39,-0x18(%rbp)
jg     1387 <recogniser2+0x267>
movl   $0x4,-0x1c(%rbp)
jmp    13a9 <recogniser2+0x289>
movl   $0x2e,-0x18(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    139d <recogniser2+0x27d>
jmp    13a4 <recogniser2+0x284>
movl   $0x4,-0x1c(%rbp)
jmp    13a9 <recogniser2+0x289>
jmp    13ae <recogniser2+0x28e>
jmp    13b3 <recogniser2+0x293>
jmp    13b8 <recogniser2+0x298>
jmp    13bd <recogniser2+0x29d>
jmp    13c2 <recogniser2+0x2a2>
jmp    13c7 <recogniser2+0x2a7>
jmp    1152 <recogniser2+0x32>
cmpl   $0x3,-0x1c(%rbp)
jne    13e7 <recogniser2+0x2c7>
lea    0xc23(%rip),%rdi
call   1030 <printf@plt>
jmp    13f3 <recogniser2+0x2d3>
lea    0xc28(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recogniser2>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     11e8 <recogniser2+0xc8>
lea    0xec6(%rip),%rbx
xor    %ebp,%ebp
jmp    115c <recogniser2+0x3c>
add    $0xffffffd0,%eax
cmp    $0xa,%eax
mov    $0x2,%ebp
sbb    $0x0,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xa,%eax
je     11da <recogniser2+0xba>
mov    %ebp,%ecx
mov    $0x4,%ebp
cmp    $0x3,%ecx
ja     1150 <recogniser2+0x30>
mov    %ecx,%ecx
movslq (%rbx,%rcx,4),%rcx
add    %rbx,%rcx
jmp    *%rcx
mov    $0x4,%ebp
cmp    $0x2b,%eax
je     1150 <recogniser2+0x30>
mov    $0x4,%ebp
cmp    $0x2d,%eax
je     1150 <recogniser2+0x30>
add    $0xffffffd0,%eax
cmp    $0xa,%eax
mov    $0x4,%ebp
jmp    1149 <recogniser2+0x29>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ebp,%ebp
cmp    $0x2b,%eax
je     1150 <recogniser2+0x30>
cmp    $0x2d,%eax
je     1150 <recogniser2+0x30>
jmp    113e <recogniser2+0x1e>
xchg   %ax,%ax
mov    $0x4,%ebp
cmp    $0x2b,%eax
je     1150 <recogniser2+0x30>
mov    $0x4,%ebp
cmp    $0x2d,%eax
je     1150 <recogniser2+0x30>
add    $0xffffffd0,%eax
xor    %ecx,%ecx
cmp    $0xa,%eax
setae  %cl
lea    (%rcx,%rcx,1),%ebp
add    $0x1,%ebp
jmp    1150 <recogniser2+0x30>
cmp    $0x3,%ebp
jne    11e8 <recogniser2+0xc8>
lea    0xe3f(%rip),%rdi
jmp    11ef <recogniser2+0xcf>
lea    0xe21(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Accepted by method 2\0A\00"
@.str.1 = [22 x i8] c"Rejected by method 2\0A\00"
define void @recogniser2() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
store i32 4, i32* %5
store i32 0, i32* %7
br label %8
8: ; preds = %125, %0
%9 = call i32 (...) @getchar()
store i32 %9, i32* %6
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %126
11: ; preds = %8
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %33
14: ; preds = %11
%15 = load i32, i32* %6
%16 = icmp eq i32 %15, 43
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %6
%19 = icmp eq i32 %18, 45
br i1 %19, label %20, label %21
20: ; preds = %17, %14
store i32 0, i32* %7
br label %32
21: ; preds = %17
%22 = load i32, i32* %6
%23 = icmp sge i32 %22, 48
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* %6
%26 = icmp sle i32 %25, 57
br i1 %26, label %27, label %28
27: ; preds = %24
store i32 1, i32* %7
br label %31
28: ; preds = %24, %21
store i32 46, i32* %6
br i1 true, label %29, label %30
29: ; preds = %28
store i32 2, i32* %7
br label %30
30: ; preds = %29, %28
br label %31
31: ; preds = %30, %27
br label %32
32: ; preds = %31, %20
br label %125
33: ; preds = %11
%34 = load i32, i32* %7
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %55
36: ; preds = %33
%37 = load i32, i32* %6
%38 = icmp eq i32 %37, 43
br i1 %38, label %42, label %39
39: ; preds = %36
%40 = load i32, i32* %6
%41 = icmp eq i32 %40, 45
br i1 %41, label %42, label %43
42: ; preds = %39, %36
store i32 4, i32* %7
br label %54
43: ; preds = %39
%44 = load i32, i32* %6
%45 = icmp sge i32 %44, 48
br i1 %45, label %46, label %50
46: ; preds = %43
%47 = load i32, i32* %6
%48 = icmp sle i32 %47, 57
br i1 %48, label %49, label %50
49: ; preds = %46
store i32 1, i32* %7
br label %53
50: ; preds = %46, %43
store i32 46, i32* %6
br i1 true, label %51, label %52
51: ; preds = %50
store i32 3, i32* %7
br label %52
52: ; preds = %51, %50
br label %53
53: ; preds = %52, %49
br label %54
54: ; preds = %53, %42
br label %124
55: ; preds = %33
%56 = load i32, i32* %7
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %77
58: ; preds = %55
%59 = load i32, i32* %6
%60 = icmp eq i32 %59, 43
br i1 %60, label %64, label %61
61: ; preds = %58
%62 = load i32, i32* %6
%63 = icmp eq i32 %62, 45
br i1 %63, label %64, label %65
64: ; preds = %61, %58
store i32 4, i32* %7
br label %76
65: ; preds = %61
%66 = load i32, i32* %6
%67 = icmp sge i32 %66, 48
br i1 %67, label %68, label %72
68: ; preds = %65
%69 = load i32, i32* %6
%70 = icmp sle i32 %69, 57
br i1 %70, label %71, label %72
71: ; preds = %68
store i32 3, i32* %7
br label %75
72: ; preds = %68, %65
store i32 46, i32* %6
br i1 true, label %73, label %74
73: ; preds = %72
store i32 4, i32* %7
br label %74
74: ; preds = %73, %72
br label %75
75: ; preds = %74, %71
br label %76
76: ; preds = %75, %64
br label %123
77: ; preds = %55
%78 = load i32, i32* %7
%79 = icmp eq i32 %78, 3
br i1 %79, label %80, label %99
80: ; preds = %77
%81 = load i32, i32* %6
%82 = icmp eq i32 %81, 43
br i1 %82, label %86, label %83
83: ; preds = %80
%84 = load i32, i32* %6
%85 = icmp eq i32 %84, 45
br i1 %85, label %86, label %87
86: ; preds = %83, %80
store i32 4, i32* %7
br label %98
87: ; preds = %83
%88 = load i32, i32* %6
%89 = icmp sge i32 %88, 48
br i1 %89, label %90, label %94
90: ; preds = %87
%91 = load i32, i32* %6
%92 = icmp sle i32 %91, 57
br i1 %92, label %93, label %94
93: ; preds = %90
store i32 3, i32* %7
br label %97
94: ; preds = %90, %87
store i32 46, i32* %6
br i1 true, label %95, label %96
95: ; preds = %94
store i32 4, i32* %7
br label %96
96: ; preds = %95, %94
br label %97
97: ; preds = %96, %93
br label %98
98: ; preds = %97, %86
br label %122
99: ; preds = %77
%100 = load i32, i32* %7
%101 = icmp eq i32 %100, 4
br i1 %101, label %102, label %121
102: ; preds = %99
%103 = load i32, i32* %6
%104 = icmp eq i32 %103, 43
br i1 %104, label %108, label %105
105: ; preds = %102
%106 = load i32, i32* %6
%107 = icmp eq i32 %106, 45
br i1 %107, label %108, label %109
108: ; preds = %105, %102
store i32 4, i32* %7
br label %120
109: ; preds = %105
%110 = load i32, i32* %6
%111 = icmp sge i32 %110, 48
br i1 %111, label %112, label %116
112: ; preds = %109
%113 = load i32, i32* %6
%114 = icmp sle i32 %113, 57
br i1 %114, label %115, label %116
115: ; preds = %112
store i32 4, i32* %7
br label %119
116: ; preds = %112, %109
store i32 46, i32* %6
br i1 true, label %117, label %118
117: ; preds = %116
store i32 4, i32* %7
br label %118
118: ; preds = %117, %116
br label %119
119: ; preds = %118, %115
br label %120
120: ; preds = %119, %108
br label %121
121: ; preds = %120, %99
br label %122
122: ; preds = %121, %98
br label %123
123: ; preds = %122, %76
br label %124
124: ; preds = %123, %54
br label %125
125: ; preds = %124, %32
br label %8
126: ; preds = %8
%127 = load i32, i32* %7
%128 = icmp eq i32 %127, 3
br i1 %128, label %129, label %131
129: ; preds = %126
%130 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %133
131: ; preds = %126
%132 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %133
133: ; preds = %131, %129
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"Rejected by method 2\00"
@str.2 = [21 x i8] c"Accepted by method 2\00"
define void @recogniser2() {
%1 = tail call i32 (...) @getchar()
%2 = icmp eq i32 %1, 10
br i1 %2, label %32, label %3
3: ; preds = %0, %26
%4 = phi i32 [ %28, %26 ], [ %1, %0 ]
%5 = phi i32 [ %27, %26 ], [ 0, %0 ]
switch i32 %5, label %26 [
i32 0, label %6
i32 1, label %11
i32 2, label %16
i32 3, label %21
]
6: ; preds = %3
switch i32 %4, label %7 [
i32 45, label %26
i32 43, label %26
]
7: ; preds = %6
%8 = add i32 %4, -48
%9 = icmp ult i32 %8, 10
%10 = select i1 %9, i32 1, i32 2
br label %26
11: ; preds = %3
switch i32 %4, label %12 [
i32 45, label %26
i32 43, label %26
]
12: ; preds = %11
%13 = add i32 %4, -48
%14 = icmp ult i32 %13, 10
%15 = select i1 %14, i32 1, i32 3
br label %26
16: ; preds = %3
switch i32 %4, label %17 [
i32 45, label %26
i32 43, label %26
]
17: ; preds = %16
%18 = add i32 %4, -48
%19 = icmp ult i32 %18, 10
%20 = select i1 %19, i32 3, i32 4
br label %26
21: ; preds = %3
switch i32 %4, label %22 [
i32 45, label %26
i32 43, label %26
]
22: ; preds = %21
%23 = add i32 %4, -48
%24 = icmp ult i32 %23, 10
%25 = select i1 %24, i32 3, i32 4
br label %26
26: ; preds = %3, %22, %21, %21, %17, %16, %16, %12, %11, %11, %7, %6, %6
%27 = phi i32 [ 0, %6 ], [ 0, %6 ], [ %10, %7 ], [ 4, %11 ], [ 4, %11 ], [ %15, %12 ], [ 4, %16 ], [ 4, %16 ], [ %20, %17 ], [ 4, %21 ], [ 4, %21 ], [ %25, %22 ], [ 4, %3 ]
%28 = tail call i32 (...) @getchar()
%29 = icmp eq i32 %28, 10
br i1 %29, label %30, label %3
30: ; preds = %26
%31 = icmp eq i32 %27, 3
br i1 %31, label %33, label %32
32: ; preds = %0, %30
br label %33
33: ; preds = %30, %32
%34 = phi i8* [ getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0), %32 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @str.2, i64 0, i64 0), %30 ]
%35 = tail call i32 @puts(i8* dereferenceable(1) %34)
ret void
}