#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 */
scalar_t__ gets(char *);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strcmp(char *, char *);
int main() {
  char s[20];
  int i = 1;
  while (gets(s)) {
    if (s[0] == '#')
      break;
    if (strcmp(s, "HELLO") == 0)
      printf("Case %d: ENGLISH\n", i);
    else if (strcmp(s, "HOLA") == 0)
      printf("Case %d: SPANISH\n", i);
    else if (strcmp(s, "HALLO") == 0)
      printf("Case %d: GERMAN\n", i);
    else if (strcmp(s, "BONJOUR") == 0)
      printf("Case %d: FRENCH\n", i);
    else if (strcmp(s, "CIAO") == 0)
      printf("Case %d: ITALIAN\n", i);
    else if (strcmp(s, "ZDRAVSTVUJTE") == 0)
      printf("Case %d: RUSSIAN\n", i);
    else
      printf("Case %d: UNKNOWN\n", i);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
call   1050 <gets@plt>
cmp    $0x0,%rax
je     12b5 <main+0x185>
movsbl -0x20(%rbp),%eax
cmp    $0x23,%eax
jne    116b <main+0x3b>
jmp    12b5 <main+0x185>
lea    -0x20(%rbp),%rdi
lea    0xe8a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1199 <main+0x69>
mov    -0x24(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
jmp    12a7 <main+0x177>
lea    -0x20(%rbp),%rdi
lea    0xe74(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11c7 <main+0x97>
mov    -0x24(%rbp),%esi
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
jmp    12a2 <main+0x172>
lea    -0x20(%rbp),%rdi
lea    0xe5d(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11f5 <main+0xc5>
mov    -0x24(%rbp),%esi
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    129d <main+0x16d>
lea    -0x20(%rbp),%rdi
lea    0xe46(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1223 <main+0xf3>
mov    -0x24(%rbp),%esi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    1298 <main+0x168>
lea    -0x20(%rbp),%rdi
lea    0xe31(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1251 <main+0x121>
mov    -0x24(%rbp),%esi
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
jmp    1293 <main+0x163>
lea    -0x20(%rbp),%rdi
lea    0xe1a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    127f <main+0x14f>
mov    -0x24(%rbp),%esi
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
jmp    128e <main+0x15e>
mov    -0x24(%rbp),%esi
lea    0xe0c(%rip),%rdi
call   1030 <printf@plt>
jmp    1293 <main+0x163>
jmp    1298 <main+0x168>
jmp    129d <main+0x16d>
jmp    12a2 <main+0x172>
jmp    12a7 <main+0x177>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     1241 <main+0x111>
cmpb   $0x23,(%rsp)
je     1241 <main+0x111>
mov    $0x1,%ebx
lea    0xe9b(%rip),%r14
mov    %rsp,%r15
lea    0xe97(%rip),%rbp
lea    0xea2(%rip),%r12
lea    0xea0(%rip),%r13
nopl   (%rax)
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rbp,%rdi
test   %rax,%rax
je     1220 <main+0xf0>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <strcmp@plt>
mov    %r13,%rdi
test   %rax,%rax
je     1220 <main+0xf0>
mov    %r15,%rdi
lea    0xe7b(%rip),%rsi
call   1040 <strcmp@plt>
lea    0xe75(%rip),%rdi
test   %rax,%rax
je     1220 <main+0xf0>
mov    %r15,%rdi
lea    0xe77(%rip),%rsi
call   1040 <strcmp@plt>
lea    0xe73(%rip),%rdi
test   %rax,%rax
je     1220 <main+0xf0>
mov    %r15,%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcmp@plt>
lea    0xe6e(%rip),%rdi
test   %rax,%rax
je     1220 <main+0xf0>
mov    %r15,%rdi
lea    0xe71(%rip),%rsi
call   1040 <strcmp@plt>
lea    0xe72(%rip),%rdi
test   %rax,%rax
je     1220 <main+0xf0>
lea    0xe78(%rip),%rdi
nopl   (%rax)
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
call   1050 <gets@plt>
test   %rax,%rax
je     1241 <main+0x111>
add    $0x1,%ebx
cmpb   $0x23,(%rsp)
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"HELLO\00"
@.str.1 = [18 x i8] c"Case %d: ENGLISH\0A\00"
@.str.2 = [5 x i8] c"HOLA\00"
@.str.3 = [18 x i8] c"Case %d: SPANISH\0A\00"
@.str.4 = [6 x i8] c"HALLO\00"
@.str.5 = [17 x i8] c"Case %d: GERMAN\0A\00"
@.str.6 = [8 x i8] c"BONJOUR\00"
@.str.7 = [17 x i8] c"Case %d: FRENCH\0A\00"
@.str.8 = [5 x i8] c"CIAO\00"
@.str.9 = [18 x i8] c"Case %d: ITALIAN\0A\00"
@.str.10 = [13 x i8] c"ZDRAVSTVUJTE\00"
@.str.11 = [18 x i8] c"Case %d: RUSSIAN\0A\00"
@.str.12 = [18 x i8] c"Case %d: UNKNOWN\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %3
br label %4
4: ; preds = %64, %0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i64 @gets(i8* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %67
8: ; preds = %4
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 35
br i1 %12, label %13, label %14
13: ; preds = %8
br label %67
14: ; preds = %8
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %64
21: ; preds = %14
%22 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %3
%27 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %26)
br label %63
28: ; preds = %21
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%30 = call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i32, i32* %3
%34 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %33)
br label %62
35: ; preds = %28
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %35
%40 = load i32, i32* %3
%41 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), i32 %40)
br label %61
42: ; preds = %35
%43 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%44 = call i64 @strcmp(i8* %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* %3
%48 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), i32 %47)
br label %60
49: ; preds = %42
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%51 = call i64 @strcmp(i8* %50, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %56
53: ; preds = %49
%54 = load i32, i32* %3
%55 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i32 %54)
br label %59
56: ; preds = %49
%57 = load i32, i32* %3
%58 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %56, %53
br label %60
60: ; preds = %59, %46
br label %61
61: ; preds = %60, %39
br label %62
62: ; preds = %61, %32
br label %63
63: ; preds = %62, %25
br label %64
64: ; preds = %63, %18
%65 = load i32, i32* %3
%66 = add nsw i32 %65, 1
store i32 %66, i32* %3
br label %4
67: ; preds = %13, %4
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"HELLO\00"
@.str.1 = [18 x i8] c"Case %d: ENGLISH\0A\00"
@.str.2 = [5 x i8] c"HOLA\00"
@.str.3 = [18 x i8] c"Case %d: SPANISH\0A\00"
@.str.4 = [6 x i8] c"HALLO\00"
@.str.5 = [17 x i8] c"Case %d: GERMAN\0A\00"
@.str.6 = [8 x i8] c"BONJOUR\00"
@.str.7 = [17 x i8] c"Case %d: FRENCH\0A\00"
@.str.8 = [5 x i8] c"CIAO\00"
@.str.9 = [18 x i8] c"Case %d: ITALIAN\0A\00"
@.str.10 = [13 x i8] c"ZDRAVSTVUJTE\00"
@.str.11 = [18 x i8] c"Case %d: RUSSIAN\0A\00"
@.str.12 = [18 x i8] c"Case %d: UNKNOWN\0A\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i64 @gets(i8* %2)
%4 = icmp eq i64 %3, 0
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 35
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %37, label %8
8: ; preds = %0, %28
%9 = phi i32 [ %31, %28 ], [ 1, %0 ]
%10 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %28, label %12
12: ; preds = %8
%13 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %28, label %15
15: ; preds = %12
%16 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %28, label %18
18: ; preds = %15
%19 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %28, label %21
21: ; preds = %18
%22 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%23 = icmp eq i64 %22, 0
br i1 %23, label %28, label %24
24: ; preds = %21
%25 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
%27 = select i1 %26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0)
br label %28
28: ; preds = %24, %21, %18, %15, %12, %8
%29 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), %12 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), %15 ], [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.7, i64 0, i64 0), %18 ], [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0), %21 ], [ %27, %24 ]
%30 = call i32 @printf(i8* %29, i32 %9)
%31 = add nuw nsw i32 %9, 1
%32 = call i64 @gets(i8* %2)
%33 = icmp eq i64 %32, 0
%34 = load i8, i8* %2
%35 = icmp eq i8 %34, 35
%36 = select i1 %33, i1 true, i1 %35
br i1 %36, label %37, label %8
37: ; preds = %28, %0
ret i32 0
}