#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__ EOF;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, ...);
int main(void) {
  char buf[11];
  int kill = 0, die = 0, assist = 0, combo = 0;
  scanf("%d");
  while (scanf("%s", buf) != EOF) {
    if (buf[0] == 'D') {
      if (combo < 3)
        printf("You have been slained.\n");
      else
        printf("SHUTDOWN.\n");
      combo = 0;
      die++;
    } else if (buf[4] == 'K') {
      switch (++combo) {
      case 1:
      case 2:
        printf("You have slain an enemie.\n");
        break;
      case 3:
        printf("KILLING SPREE!\n");
        break;
      case 4:
        printf("RAMPAGE~\n");
        break;
      case 5:
        printf("UNSTOPPABLE!\n");
        break;
      case 6:
        printf("DOMINATING!\n");
        break;
      case 7:
        printf("GUALIKE!\n");
        break;
      default:
        printf("LEGENDARY!\n");
        break;
      }
      kill++;
    } else
      assist++;
  }
  printf("%d/%d/%d\n", kill, die, assist);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0xf(%rbp),%rsi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    0x2e76(%rip),%rcx
cmp    (%rcx),%rax
je     12a5 <main+0x185>
movsbl -0xf(%rbp),%eax
cmp    $0x44,%eax
jne    11c8 <main+0xa8>
cmpl   $0x3,-0x20(%rbp)
jge    11a5 <main+0x85>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b3 <main+0x93>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12a0 <main+0x180>
movsbl -0xb(%rbp),%eax
cmp    $0x4b,%eax
jne    1292 <main+0x172>
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
mov    %ecx,%eax
add    $0x1,%eax
sub    $0x6,%rcx
mov    %eax,-0x20(%rbp)
ja     1276 <main+0x156>
mov    -0x28(%rbp),%rax
lea    0xe05(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1284 <main+0x164>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1284 <main+0x164>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1284 <main+0x164>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1284 <main+0x164>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1284 <main+0x164>
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1284 <main+0x164>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    129b <main+0x17b>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12a0 <main+0x180>
jmp    1159 <main+0x39>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
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
lea    0xebb(%rip),%rdi
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xead(%rip),%rdi
lea    0xd(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e7f(%rip),%rcx
mov    $0x0,%ebx
mov    $0x0,%ebp
cmp    (%rcx),%rax
jne    119e <main+0x6e>
lea    0xe87(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe5e(%rip),%r15
lea    0xd(%rsp),%r12
xor    %r13d,%r13d
xor    %ebp,%ebp
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    11fe <main+0xce>
cs nopw 0x0(%rax,%rax,1)
cmp    $0x3,%r13d
lea    0xea4(%rip),%rdi
lea    0xea7(%rip),%rax
cmovl  %rax,%rdi
call   1030 <puts@plt>
add    $0x1,%ebx
xor    %r13d,%r13d
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2df3(%rip),%rcx
cmp    (%rcx),%rax
je     1178 <main+0x48>
cmpb   $0x44,0xd(%rsp)
je     11c0 <main+0x90>
cmpb   $0x4b,0x11(%rsp)
jne    1240 <main+0x110>
lea    0xe51(%rip),%rdi
cmp    $0x6,%r13d
ja     122a <main+0xfa>
movslq %r13d,%rax
lea    0xe6d(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
add    $0x1,%r13d
call   1030 <puts@plt>
add    $0x1,%r14d
jmp    11e1 <main+0xb1>
nopl   0x0(%rax)
add    $0x1,%ebp
jmp    11e1 <main+0xb1>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.2 = [24 x i8] c"You have been slained.\0A\00"
@.str.3 = [11 x i8] c"SHUTDOWN.\0A\00"
@.str.4 = [27 x i8] c"You have slain an enemie.\0A\00"
@.str.5 = [16 x i8] c"KILLING SPREE!\0A\00"
@.str.6 = [10 x i8] c"RAMPAGE~\0A\00"
@.str.7 = [14 x i8] c"UNSTOPPABLE!\0A\00"
@.str.8 = [13 x i8] c"DOMINATING!\0A\00"
@.str.9 = [10 x i8] c"GUALIKE!\0A\00"
@.str.10 = [12 x i8] c"LEGENDARY!\0A\00"
@.str.11 = [10 x i8] c"%d/%d/%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%7 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %57, %0
%9 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%10 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %58
13: ; preds = %8
%14 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 68
br i1 %17, label %18, label %28
18: ; preds = %13
%19 = load i32, i32* %6
%20 = icmp slt i32 %19, 3
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
br label %25
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
store i32 0, i32* %6
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %57
28: ; preds = %13
%29 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 4
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 75
br i1 %32, label %33, label %53
33: ; preds = %28
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
switch i32 %35, label %48 [
i32 1, label %36
i32 2, label %36
i32 3, label %38
i32 4, label %40
i32 5, label %42
i32 6, label %44
i32 7, label %46
]
36: ; preds = %33, %33
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
br label %50
38: ; preds = %33
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %50
40: ; preds = %33
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %50
42: ; preds = %33
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
br label %50
44: ; preds = %33
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0))
br label %50
46: ; preds = %33
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %50
48: ; preds = %33
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
br label %50
50: ; preds = %48, %46, %44, %42, %40, %38, %36
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %56
53: ; preds = %28
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
br label %56
56: ; preds = %53, %50
br label %57
57: ; preds = %56, %25
br label %8
58: ; preds = %8
%59 = load i32, i32* %3
%60 = load i32, i32* %4
%61 = load i32, i32* %5
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %59, i32 %60, i32 %61)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.11 = [10 x i8] c"%d/%d/%d\0A\00"
@str = [9 x i8] c"GUALIKE!\00"
@str.12 = [12 x i8] c"DOMINATING!\00"
@str.13 = [13 x i8] c"UNSTOPPABLE!\00"
@str.14 = [9 x i8] c"RAMPAGE~\00"
@str.15 = [15 x i8] c"KILLING SPREE!\00"
@str.16 = [26 x i8] c"You have slain an enemie.\00"
@str.17 = [11 x i8] c"LEGENDARY!\00"
@str.18 = [10 x i8] c"SHUTDOWN.\00"
@str.19 = [23 x i8] c"You have been slained.\00"
@reltable.main = [7 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @str.16 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([26 x i8]* @str.16 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([15 x i8]* @str.15 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.14 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @str.13 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([12 x i8]* @str.12 to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str to i64), i64 ptrtoint ([7 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = tail call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i64, i64* @EOF
%6 = icmp eq i64 %4, %5
br i1 %6, label %45, label %7
7: ; preds = %0
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 4
br label %9
9: ; preds = %7, %37
%10 = phi i32 [ 0, %7 ], [ %41, %37 ]
%11 = phi i32 [ 0, %7 ], [ %40, %37 ]
%12 = phi i32 [ 0, %7 ], [ %39, %37 ]
%13 = phi i32 [ 0, %7 ], [ %38, %37 ]
%14 = load i8, i8* %2
%15 = icmp eq i8 %14, 68
br i1 %15, label %16, label %21
16: ; preds = %9
%17 = icmp slt i32 %10, 3
%18 = select i1 %17, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.19, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str.18, i64 0, i64 0)
%19 = call i32 @puts(i8* dereferenceable(1) %18)
%20 = add nsw i32 %12, 1
br label %37
21: ; preds = %9
%22 = load i8, i8* %8
%23 = icmp eq i8 %22, 75
br i1 %23, label %24, label %35
24: ; preds = %21
%25 = add nsw i32 %10, 1
%26 = icmp ult i32 %10, 7
br i1 %26, label %27, label %31
27: ; preds = %24
%28 = sext i32 %10 to i64
%29 = shl i64 %28, 2
%30 = call i8* @llvm.load.relative.i64(i8* bitcast ([7 x i32]* @reltable.main to i8*), i64 %29)
br label %31
31: ; preds = %24, %27
%32 = phi i8* [ %30, %27 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.17, i64 0, i64 0), %24 ]
%33 = call i32 @puts(i8* dereferenceable(1) %32)
%34 = add nsw i32 %13, 1
br label %37
35: ; preds = %21
%36 = add nsw i32 %11, 1
br label %37
37: ; preds = %31, %35, %16
%38 = phi i32 [ %13, %16 ], [ %34, %31 ], [ %13, %35 ]
%39 = phi i32 [ %20, %16 ], [ %12, %31 ], [ %12, %35 ]
%40 = phi i32 [ %11, %16 ], [ %11, %31 ], [ %36, %35 ]
%41 = phi i32 [ 0, %16 ], [ %25, %31 ], [ %10, %35 ]
%42 = call i64 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%43 = load i64, i64* @EOF
%44 = icmp eq i64 %42, %43
br i1 %44, label %45, label %9
45: ; preds = %37, %0
%46 = phi i32 [ 0, %0 ], [ %38, %37 ]
%47 = phi i32 [ 0, %0 ], [ %39, %37 ]
%48 = phi i32 [ 0, %0 ], [ %40, %37 ]
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %46, i32 %47, i32 %48)
ret i32 0
}