#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*/ printf(char *);
int scan(char *s, int l) {
  char *p = s;
  char *q = 0;
  for (;;) {
    {
      char yych;
      if (((s + l) - p) < 2)
        ;
      yych = *p;
      switch (yych) {
      case 0x00:
        goto yy10;
      case 0x4E:
        goto yy6;
      case 0x60:
        goto yy8;
      case 0xF0:
        goto yy2;
      case 0xF1:
      case 0xF2:
      case 0xF3:
      case 0xF4:
      case 0xF5:
      case 0xF6:
      case 0xF7:
      case 0xF8:
      case 0xF9:
        goto yy4;
      default:
        goto yy12;
      }
    yy2:
      ++p;
      switch ((yych = *p)) {
      case 0xF0:
      case 0xF1:
      case 0xF2:
      case 0xF3:
      case 0xF4:
      case 0xF5:
      case 0xF6:
      case 0xF7:
      case 0xF8:
      case 0xF9:
        goto yy16;
      default:
        goto yy3;
      }
    yy3 : {
      printf("Num\n");
      continue;
    }
    yy4:
      ++p;
      yych = *p;
      goto yy15;
    yy5 : {
      printf("Num\n");
      continue;
    }
    yy6:
      ++p;
      {
        printf("+\n");
        continue;
      }
    yy8:
      ++p;
      {
        printf("-\n");
        continue;
      }
    yy10:
      ++p;
      {
        printf("EOF\n");
        return 0;
      }
    yy12:
      ++p;
      {
        printf("ERR\n");
        return 1;
      }
    yy14:
      ++p;
      if ((s + l) <= p)
        ;
      yych = *p;
    yy15:
      switch (yych) {
      case 0xF0:
      case 0xF1:
      case 0xF2:
      case 0xF3:
      case 0xF4:
      case 0xF5:
      case 0xF6:
      case 0xF7:
      case 0xF8:
      case 0xF9:
        goto yy14;
      default:
        goto yy5;
      }
    yy16:
      ++p;
      if ((s + l) <= p)
        ;
      yych = *p;
      switch (yych) {
      case 0xF0:
      case 0xF1:
      case 0xF2:
      case 0xF3:
      case 0xF4:
      case 0xF5:
      case 0xF6:
      case 0xF7:
      case 0xF8:
      case 0xF9:
        goto yy16;
      default:
        goto yy18;
      }
    yy18 : {
      printf("Oct\n");
      continue;
    }
    }
  }
}


x86 assembly (clang, -O0):
<scan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x2,%rax
jge    1150 <scan+0x40>
jmp    1150 <scan+0x40>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
movsbl -0x29(%rbp),%eax
mov    %eax,-0x30(%rbp)
test   %eax,%eax
je     11b8 <scan+0xa8>
jmp    116d <scan+0x5d>
mov    -0x30(%rbp),%eax
sub    $0x4e,%eax
je     11bd <scan+0xad>
jmp    117e <scan+0x6e>
mov    -0x30(%rbp),%eax
sub    $0x60,%eax
je     11c2 <scan+0xb2>
jmp    118f <scan+0x7f>
mov    -0x30(%rbp),%eax
sub    $0xf0,%eax
je     11c7 <scan+0xb7>
jmp    11a2 <scan+0x92>
mov    -0x30(%rbp),%eax
add    $0xffffff0f,%eax
sub    $0x9,%eax
jb     11cc <scan+0xbc>
jmp    11d1 <scan+0xc1>
jmp    1281 <scan+0x171>
jmp    1247 <scan+0x137>
jmp    1264 <scan+0x154>
jmp    11d6 <scan+0xc6>
jmp    121c <scan+0x10c>
jmp    12a5 <scan+0x195>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
mov    %al,%cl
mov    %cl,-0x29(%rbp)
add    $0xffffff10,%eax
sub    $0x9,%eax
ja     1206 <scan+0xf6>
jmp    1201 <scan+0xf1>
jmp    1319 <scan+0x209>
jmp    120b <scan+0xfb>
lea    0xdee(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <scan+0x1f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
jmp    12f8 <scan+0x1e8>
lea    0xdc3(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <scan+0x1f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
lea    0xdab(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <scan+0x1f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
lea    0xd91(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <scan+0x1f>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
lea    0xd77(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    137a <scan+0x26a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
lea    0xd58(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    137a <scan+0x26a>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
cmp    -0x20(%rbp),%rax
ja     12ef <scan+0x1df>
jmp    12ef <scan+0x1df>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
movsbl -0x29(%rbp),%eax
add    $0xffffff10,%eax
sub    $0x9,%eax
ja     1314 <scan+0x204>
jmp    130f <scan+0x1ff>
jmp    12c9 <scan+0x1b9>
jmp    1236 <scan+0x126>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
cmp    -0x20(%rbp),%rax
ja     133f <scan+0x22f>
jmp    133f <scan+0x22f>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x29(%rbp)
movsbl -0x29(%rbp),%eax
add    $0xffffff10,%eax
sub    $0x9,%eax
ja     1364 <scan+0x254>
jmp    135f <scan+0x24f>
jmp    1319 <scan+0x209>
jmp    1369 <scan+0x259>
lea    0xca5(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <scan+0x1f>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xee3(%rip),%r14
lea    0xeda(%rip),%r15
jmp    1139 <scan+0x29>
nopl   0x0(%rax,%rax,1)
call   1030 <puts@plt>
add    $0x1,%rbx
movsbl (%rbx),%eax
mov    %r14,%rdi
cmp    $0x4e,%eax
je     1130 <scan+0x20>
cmp    $0x60,%eax
jne    114e <scan+0x3e>
mov    %r15,%rdi
jmp    1130 <scan+0x20>
test   %eax,%eax
jne    115d <scan+0x4d>
xor    %ebx,%ebx
lea    0xea9(%rip),%rdi
jmp    1169 <scan+0x59>
mov    $0x1,%ebx
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"Num\0A\00"
@.str.1 = [3 x i8] c"+\0A\00"
@.str.2 = [3 x i8] c"-\0A\00"
@.str.3 = [5 x i8] c"EOF\0A\00"
@.str.4 = [5 x i8] c"ERR\0A\00"
@.str.5 = [5 x i8] c"Oct\0A\00"
define i32 @scan(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
%9 = load i8*, i8** %4
store i8* %9, i8** %6
store i8* null, i8** %7
br label %10
10: ; preds = %100, %53, %49, %47, %40, %2
%11 = load i8*, i8** %4
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8*, i8** %6
%16 = ptrtoint i8* %14 to i64
%17 = ptrtoint i8* %15 to i64
%18 = sub i64 %16, %17
%19 = icmp slt i64 %18, 2
br i1 %19, label %20, label %21
20: ; preds = %10
br label %21
21: ; preds = %20, %10
%22 = load i8*, i8** %6
%23 = load i8, i8* %22
store i8 %23, i8* %8
%24 = load i8, i8* %8
%25 = sext i8 %24 to i32
switch i32 %25, label %31 [
i32 0, label %26
i32 78, label %27
i32 96, label %28
i32 240, label %29
i32 241, label %30
i32 242, label %30
i32 243, label %30
i32 244, label %30
i32 245, label %30
i32 246, label %30
i32 247, label %30
i32 248, label %30
i32 249, label %30
]
26: ; preds = %21
br label %57
27: ; preds = %21
br label %49
28: ; preds = %21
br label %53
29: ; preds = %21
br label %32
30: ; preds = %21, %21, %21, %21, %21, %21, %21, %21, %21
br label %42
31: ; preds = %21
br label %61
32: ; preds = %29
%33 = load i8*, i8** %6
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %6
%35 = load i8*, i8** %6
%36 = load i8, i8* %35
store i8 %36, i8* %8
%37 = sext i8 %36 to i32
switch i32 %37, label %39 [
i32 240, label %38
i32 241, label %38
i32 242, label %38
i32 243, label %38
i32 244, label %38
i32 245, label %38
i32 246, label %38
i32 247, label %38
i32 248, label %38
i32 249, label %38
]
38: ; preds = %32, %32, %32, %32, %32, %32, %32, %32, %32, %32
br label %83
39: ; preds = %32
br label %40
40: ; preds = %39
%41 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
42: ; preds = %30
%43 = load i8*, i8** %6
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %6
%45 = load i8*, i8** %6
%46 = load i8, i8* %45
store i8 %46, i8* %8
br label %78
47: ; preds = %82
%48 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %10
49: ; preds = %27
%50 = load i8*, i8** %6
%51 = getelementptr inbounds i8, i8* %50, i32 1
store i8* %51, i8** %6
%52 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %10
53: ; preds = %28
%54 = load i8*, i8** %6
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %6
%56 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %10
57: ; preds = %26
%58 = load i8*, i8** %6
%59 = getelementptr inbounds i8, i8* %58, i32 1
store i8* %59, i8** %6
%60 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %3
br label %102
61: ; preds = %31
%62 = load i8*, i8** %6
%63 = getelementptr inbounds i8, i8* %62, i32 1
store i8* %63, i8** %6
%64 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %3
br label %102
65: ; preds = %81
%66 = load i8*, i8** %6
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %6
%68 = load i8*, i8** %4
%69 = load i32, i32* %5
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %68, i64 %70
%72 = load i8*, i8** %6
%73 = icmp ule i8* %71, %72
br i1 %73, label %74, label %75
74: ; preds = %65
br label %75
75: ; preds = %74, %65
%76 = load i8*, i8** %6
%77 = load i8, i8* %76
store i8 %77, i8* %8
br label %78
78: ; preds = %75, %42
%79 = load i8, i8* %8
%80 = sext i8 %79 to i32
switch i32 %80, label %82 [
i32 240, label %81
i32 241, label %81
i32 242, label %81
i32 243, label %81
i32 244, label %81
i32 245, label %81
i32 246, label %81
i32 247, label %81
i32 248, label %81
i32 249, label %81
]
81: ; preds = %78, %78, %78, %78, %78, %78, %78, %78, %78, %78
br label %65
82: ; preds = %78
br label %47
83: ; preds = %98, %38
%84 = load i8*, i8** %6
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %6
%86 = load i8*, i8** %4
%87 = load i32, i32* %5
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %86, i64 %88
%90 = load i8*, i8** %6
%91 = icmp ule i8* %89, %90
br i1 %91, label %92, label %93
92: ; preds = %83
br label %93
93: ; preds = %92, %83
%94 = load i8*, i8** %6
%95 = load i8, i8* %94
store i8 %95, i8* %8
%96 = load i8, i8* %8
%97 = sext i8 %96 to i32
switch i32 %97, label %99 [
i32 240, label %98
i32 241, label %98
i32 242, label %98
i32 243, label %98
i32 244, label %98
i32 245, label %98
i32 246, label %98
i32 247, label %98
i32 248, label %98
i32 249, label %98
]
98: ; preds = %93, %93, %93, %93, %93, %93, %93, %93, %93, %93
br label %83
99: ; preds = %93
br label %100
100: ; preds = %99
%101 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %10
102: ; preds = %61, %57
%103 = load i32, i32* %3
ret i32 %103
}

LLVM IR (-O2):
@str = [2 x i8] c"-\00"
@str.6 = [2 x i8] c"+\00"
@str.7 = [4 x i8] c"EOF\00"
@str.8 = [4 x i8] c"ERR\00"
define i32 @scan(i8* nocapture %0, i32 %1) {
br label %3
3: ; preds = %8, %2
%4 = phi i8* [ %0, %2 ], [ %11, %8 ]
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %12 [
i32 0, label %13
i32 78, label %8
i32 96, label %7
]
7: ; preds = %3
br label %8
8: ; preds = %3, %7
%9 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), %7 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0), %3 ]
%10 = tail call i32 @puts(i8* dereferenceable(1) %9)
%11 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
12: ; preds = %3
br label %13
13: ; preds = %3, %12
%14 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.8, i64 0, i64 0), %12 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0), %3 ]
%15 = phi i32 [ 1, %12 ], [ 0, %3 ]
%16 = tail call i32 @puts(i8* dereferenceable(1) %14)
ret i32 %15
}