#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 /*<<< orphan*/ scanf(char *, char *);
int main() {
  char A[20], B[20], C[20];
  scanf(" %s", A);
  scanf(" %s", B);
  scanf(" %s", C);
  switch (A[0]) {
  case 'v':
    switch (B[0]) {
    case 'a':
      switch (C[0]) {
      case 'c':
        printf("aguia\n");
        break;
      case 'o':
        printf("pomba\n");
        break;
      }
      break;
    case 'm':
      switch (C[0]) {
      case 'o':
        printf("homem\n");
        break;
      case 'h':
        printf("vaca\n");
        break;
      }
      break;
    };
    break;
  case 'i':
    switch (B[0]) {
    case 'i':
      switch (C[2]) {
      case 'm':
        printf("pulga\n");
        break;
      case 'r':
        printf("lagarta\n");
        break;
      }
      break;
    case 'a':
      switch (C[0]) {
      case 'h':
        printf("sanguessuga\n");
        break;
      case 'o':
        printf("minhoca\n");
        break;
      }
      break;
    };
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    %rdi,-0x70(%rbp)
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x70(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x70(%rbp),%rdi
lea    -0x60(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x20(%rbp),%eax
mov    %eax,-0x64(%rbp)
sub    $0x69,%eax
je     1241 <main+0x121>
jmp    1175 <main+0x55>
mov    -0x64(%rbp),%eax
sub    $0x76,%eax
jne    1308 <main+0x1e8>
jmp    1186 <main+0x66>
movsbl -0x40(%rbp),%eax
mov    %eax,-0x74(%rbp)
sub    $0x61,%eax
je     11ac <main+0x8c>
jmp    119b <main+0x7b>
mov    -0x74(%rbp),%eax
sub    $0x6d,%eax
je     11f4 <main+0xd4>
jmp    123c <main+0x11c>
movsbl -0x60(%rbp),%eax
mov    %eax,-0x78(%rbp)
sub    $0x63,%eax
je     11d2 <main+0xb2>
jmp    11c1 <main+0xa1>
mov    -0x78(%rbp),%eax
sub    $0x6f,%eax
je     11e3 <main+0xc3>
jmp    11ef <main+0xcf>
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
jmp    11ef <main+0xcf>
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
jmp    123c <main+0x11c>
movsbl -0x60(%rbp),%eax
mov    %eax,-0x7c(%rbp)
sub    $0x68,%eax
je     122b <main+0x10b>
jmp    1209 <main+0xe9>
mov    -0x7c(%rbp),%eax
sub    $0x6f,%eax
jne    1237 <main+0x117>
jmp    121a <main+0xfa>
lea    0xdf1(%rip),%rdi
call   1030 <printf@plt>
jmp    1237 <main+0x117>
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
jmp    123c <main+0x11c>
jmp    1308 <main+0x1e8>
movsbl -0x40(%rbp),%eax
mov    %eax,-0x80(%rbp)
sub    $0x61,%eax
je     12b5 <main+0x195>
jmp    1256 <main+0x136>
mov    -0x80(%rbp),%eax
sub    $0x69,%eax
jne    1303 <main+0x1e3>
jmp    1267 <main+0x147>
movsbl -0x5e(%rbp),%eax
mov    %eax,-0x84(%rbp)
sub    $0x6d,%eax
je     1293 <main+0x173>
jmp    127f <main+0x15f>
mov    -0x84(%rbp),%eax
sub    $0x72,%eax
je     12a4 <main+0x184>
jmp    12b0 <main+0x190>
lea    0xd85(%rip),%rdi
call   1030 <printf@plt>
jmp    12b0 <main+0x190>
lea    0xd7b(%rip),%rdi
call   1030 <printf@plt>
jmp    1303 <main+0x1e3>
movsbl -0x60(%rbp),%eax
mov    %eax,-0x88(%rbp)
sub    $0x68,%eax
je     12e1 <main+0x1c1>
jmp    12cd <main+0x1ad>
mov    -0x88(%rbp),%eax
sub    $0x6f,%eax
je     12f2 <main+0x1d2>
jmp    12fe <main+0x1de>
lea    0xd47(%rip),%rdi
call   1030 <printf@plt>
jmp    12fe <main+0x1de>
lea    0xd43(%rip),%rdi
call   1030 <printf@plt>
jmp    1303 <main+0x1e3>
jmp    1308 <main+0x1e8>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
lea    0xed4(%rip),%rbx
lea    0x40(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsbl 0x40(%rsp),%eax
cmp    $0x69,%eax
je     1192 <main+0x72>
cmp    $0x76,%eax
jne    120e <main+0xee>
movsbl 0x20(%rsp),%eax
cmp    $0x6d,%eax
je     11b9 <main+0x99>
cmp    $0x61,%eax
jne    120e <main+0xee>
movsbl (%rsp),%eax
cmp    $0x63,%eax
je     11e7 <main+0xc7>
cmp    $0x6f,%eax
jne    120e <main+0xee>
lea    0xea1(%rip),%rdi
jmp    1209 <main+0xe9>
movsbl 0x20(%rsp),%eax
cmp    $0x61,%eax
je     11d0 <main+0xb0>
cmp    $0x69,%eax
jne    120e <main+0xee>
movsbl 0x2(%rsp),%eax
cmp    $0x6d,%eax
je     11f0 <main+0xd0>
cmp    $0x72,%eax
jne    120e <main+0xee>
lea    0xe61(%rip),%rdi
jmp    1209 <main+0xe9>
movsbl (%rsp),%eax
cmp    $0x6f,%eax
je     11f9 <main+0xd9>
cmp    $0x68,%eax
jne    120e <main+0xee>
lea    0xe58(%rip),%rdi
jmp    1209 <main+0xe9>
movsbl (%rsp),%eax
cmp    $0x68,%eax
je     1202 <main+0xe2>
cmp    $0x6f,%eax
jne    120e <main+0xee>
lea    0xe1f(%rip),%rdi
jmp    1209 <main+0xe9>
lea    0xe49(%rip),%rdi
jmp    1209 <main+0xe9>
lea    0xe29(%rip),%rdi
jmp    1209 <main+0xe9>
lea    0xe2b(%rip),%rdi
jmp    1209 <main+0xe9>
lea    0xe03(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c" %s\00"
@.str.1 = [7 x i8] c"aguia\0A\00"
@.str.2 = [7 x i8] c"pomba\0A\00"
@.str.3 = [7 x i8] c"homem\0A\00"
@.str.4 = [6 x i8] c"vaca\0A\00"
@.str.5 = [7 x i8] c"pulga\0A\00"
@.str.6 = [9 x i8] c"lagarta\0A\00"
@.str.7 = [13 x i8] c"sanguessuga\0A\00"
@.str.8 = [9 x i8] c"minhoca\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
store i32 0, i32* %1
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %60 [
i32 118, label %14
i32 105, label %37
]
14: ; preds = %0
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
switch i32 %17, label %36 [
i32 97, label %18
i32 109, label %27
]
18: ; preds = %14
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
switch i32 %21, label %26 [
i32 99, label %22
i32 111, label %24
]
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %26
24: ; preds = %18
%25 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %26
26: ; preds = %18, %24, %22
br label %36
27: ; preds = %14
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
switch i32 %30, label %35 [
i32 111, label %31
i32 104, label %33
]
31: ; preds = %27
%32 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %35
33: ; preds = %27
%34 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %35
35: ; preds = %27, %33, %31
br label %36
36: ; preds = %14, %35, %26
br label %60
37: ; preds = %0
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
switch i32 %40, label %59 [
i32 105, label %41
i32 97, label %50
]
41: ; preds = %37
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 2
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
switch i32 %44, label %49 [
i32 109, label %45
i32 114, label %47
]
45: ; preds = %41
%46 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %49
47: ; preds = %41
%48 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %49
49: ; preds = %41, %47, %45
br label %59
50: ; preds = %37
%51 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
switch i32 %53, label %58 [
i32 104, label %54
i32 111, label %56
]
54: ; preds = %50
%55 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %58
56: ; preds = %50
%57 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %58
58: ; preds = %50, %56, %54
br label %59
59: ; preds = %37, %58, %49
br label %60
60: ; preds = %0, %59, %36
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c" %s\00"
@str = [8 x i8] c"minhoca\00"
@str.9 = [12 x i8] c"sanguessuga\00"
@str.10 = [8 x i8] c"lagarta\00"
@str.11 = [6 x i8] c"pulga\00"
@str.12 = [5 x i8] c"vaca\00"
@str.13 = [6 x i8] c"homem\00"
@str.14 = [6 x i8] c"pomba\00"
@str.15 = [6 x i8] c"aguia\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
switch i32 %11, label %38 [
i32 118, label %12
i32 105, label %23
]
12: ; preds = %0
%13 = load i8, i8* %5
%14 = sext i8 %13 to i32
switch i32 %14, label %38 [
i32 97, label %15
i32 109, label %19
]
15: ; preds = %12
%16 = load i8, i8* %6
%17 = sext i8 %16 to i32
switch i32 %17, label %38 [
i32 99, label %35
i32 111, label %18
]
18: ; preds = %15
br label %35
19: ; preds = %12
%20 = load i8, i8* %6
%21 = sext i8 %20 to i32
switch i32 %21, label %38 [
i32 111, label %35
i32 104, label %22
]
22: ; preds = %19
br label %35
23: ; preds = %0
%24 = load i8, i8* %5
%25 = sext i8 %24 to i32
switch i32 %25, label %38 [
i32 105, label %26
i32 97, label %31
]
26: ; preds = %23
%27 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 2
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
switch i32 %29, label %38 [
i32 109, label %35
i32 114, label %30
]
30: ; preds = %26
br label %35
31: ; preds = %23
%32 = load i8, i8* %6
%33 = sext i8 %32 to i32
switch i32 %33, label %38 [
i32 104, label %35
i32 111, label %34
]
34: ; preds = %31
br label %35
35: ; preds = %31, %26, %19, %15, %22, %18, %34, %30
%36 = phi i8* [ getelementptr inbounds ([8 x i8], [8 x i8]* @str.10, i64 0, i64 0), %30 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), %34 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.14, i64 0, i64 0), %18 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.12, i64 0, i64 0), %22 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.15, i64 0, i64 0), %15 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.13, i64 0, i64 0), %19 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.11, i64 0, i64 0), %26 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0), %31 ]
%37 = call i32 @puts(i8* dereferenceable(1) %36)
br label %38
38: ; preds = %35, %23, %26, %31, %12, %15, %19, %0
ret i32 0
}