#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 */
struct treenode {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
struct treenode *addNode(struct treenode *, int /*<<< orphan*/);
int /*<<< orphan*/ createNode(char *, char *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, ...);
int /*<<< orphan*/ partDeux(int /*<<< orphan*/ *, struct treenode *);
int /*<<< orphan*/ printGame(int /*<<< orphan*/ *, struct treenode *, char *);
int /*<<< orphan*/ printName(struct treenode *, int /*<<< orphan*/ *);
scalar_t__ strcmp(char *, char *);
struct treenode *subNode(struct treenode *, char *);
void vroom(FILE *ifp, FILE *ofp, struct treenode *root) {
  int i = 0;
  char command[20];
  char add[4] = {'A', 'D', 'D', '\0'};
  char sub[7] = {'R', 'E', 'M', 'O', 'V', 'E', '\0'};
  char printgame[10] = {'P', 'R', 'I', 'N', 'T', 'G', 'A', 'M', 'E', '\0'};
  char print[6] = {'P', 'R', 'I', 'N', 'T', '\0'};
  char partdeux[6] = {'P', 'A', 'R', 'T', '2', '\0'};
  char tempName[20], tempGame[20];
  while (!feof(ifp)) {
    fscanf(ifp, "%s", command);
    if (strcmp(command, add) == 0) {
      fscanf(ifp, "%s %s", tempName, tempGame);
      root = addNode(root, createNode(tempName, tempGame));
    } else if (strcmp(command, sub) == 0) {
      fscanf(ifp, "%s", tempName);
      root = subNode(root, tempName);
    } else if (strcmp(command, printgame) == 0) {
      fscanf(ifp, "%s", tempGame);
      fprintf(ofp, "%s:\n", tempGame);
      printGame(ofp, root, tempGame);
    } else if (strcmp(command, print) == 0) {
      printName(root, ofp);
    }
    if (strcmp(command, partdeux) == 0) {
      partDeux(ofp, root);
    }
  }
}


x86 assembly (clang, -O0):
<vroom>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    0xe3c(%rip),%eax
mov    %eax,-0x34(%rbp)
mov    0xe37(%rip),%eax
mov    %eax,-0x3b(%rbp)
mov    0xe31(%rip),%ax
mov    %ax,-0x37(%rbp)
mov    0xe29(%rip),%al
mov    %al,-0x35(%rbp)
mov    0xe20(%rip),%rax
mov    %rax,-0x45(%rbp)
mov    0xe1d(%rip),%ax
mov    %ax,-0x3d(%rbp)
mov    0xe15(%rip),%eax
mov    %eax,-0x4b(%rbp)
mov    0xe0f(%rip),%ax
mov    %ax,-0x47(%rbp)
mov    0xe07(%rip),%eax
mov    %eax,-0x51(%rbp)
mov    0xe01(%rip),%ax
mov    %ax,-0x4d(%rbp)
mov    -0x8(%rbp),%rdi
call   1080 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1240 <vroom+0xa0>
jmp    13bb <vroom+0x21b>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    0xdd5(%rip),%rsi
mov    $0x0,%al
call   1050 <fscanf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x34(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12bc <vroom+0x11c>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    -0x90(%rbp),%rcx
lea    0xd9e(%rip),%rsi
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x98(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1040 <createNode@plt>
mov    -0x98(%rbp),%rdi
mov    %eax,%esi
call   10a0 <addNode@plt>
mov    %rax,-0x18(%rbp)
jmp    1392 <vroom+0x1f2>
lea    -0x30(%rbp),%rdi
lea    -0x3b(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    12ff <vroom+0x15f>
mov    -0x8(%rbp),%rdi
lea    -0x70(%rbp),%rdx
lea    0xd42(%rip),%rsi
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1030 <subNode@plt>
mov    %rax,-0x18(%rbp)
jmp    138d <vroom+0x1ed>
lea    -0x30(%rbp),%rdi
lea    -0x45(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    135f <vroom+0x1bf>
mov    -0x8(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    0xcfc(%rip),%rsi
mov    $0x0,%al
call   1050 <fscanf@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    0xce6(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x90(%rbp),%rdx
call   10b0 <printGame@plt>
jmp    1388 <vroom+0x1e8>
lea    -0x30(%rbp),%rdi
lea    -0x4b(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1383 <vroom+0x1e3>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10c0 <printName@plt>
jmp    1388 <vroom+0x1e8>
jmp    138d <vroom+0x1ed>
jmp    1392 <vroom+0x1f2>
lea    -0x30(%rbp),%rdi
lea    -0x51(%rbp),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    13b6 <vroom+0x216>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <partDeux@plt>
jmp    1222 <vroom+0x82>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vroom>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdx,%r15
mov    %rsi,0x8(%rsp)
mov    %rdi,%rbx
movl   $0x444441,0x24(%rsp)
movl   $0x45564f,0x2b(%rsp)
movl   $0x4f4d4552,0x28(%rsp)
4f
movabs $0x4d4147544e495250,%rax
47 41 4d
mov    %rax,0x30(%rsp)
movw   $0x45,0x38(%rsp)
movw   $0x54,0x20(%rsp)
movl   $0x4e495250,0x1c(%rsp)
4e
movw   $0x32,0x18(%rsp)
movl   $0x54524150,0x14(%rsp)
54
call   1080 <feof@plt>
test   %eax,%eax
je     1223 <vroom+0x83>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xdf6(%rip),%r12
lea    0x80(%rsp),%r13
jmp    124c <vroom+0xac>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
call   1080 <feof@plt>
test   %eax,%eax
jne    1211 <vroom+0x71>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    %r13,%rdi
lea    0x24(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     12d0 <vroom+0x130>
mov    %r13,%rdi
lea    0x28(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1320 <vroom+0x180>
mov    %r13,%rdi
lea    0x30(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1345 <vroom+0x1a5>
mov    %r13,%rdi
lea    0x1c(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1380 <vroom+0x1e0>
mov    %r15,%rdi
mov    0x8(%rsp),%rsi
call   10c0 <printName@plt>
jmp    1380 <vroom+0x1e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
lea    0xd43(%rip),%rsi
mov    %r12,%r14
lea    0x60(%rsp),%r12
mov    %r12,%rdx
lea    0x40(%rsp),%rbp
mov    %rbp,%rcx
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    %r12,%rdi
mov    %r14,%r12
mov    %rbp,%rsi
call   1040 <createNode@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   10a0 <addNode@plt>
mov    %rax,%r15
jmp    1380 <vroom+0x1e0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r12,%rsi
lea    0x60(%rsp),%rbp
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1030 <subNode@plt>
mov    %rax,%r15
jmp    1380 <vroom+0x1e0>
mov    %rbx,%rdi
mov    %r12,%rsi
lea    0x40(%rsp),%r14
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <fscanf@plt>
mov    0x8(%rsp),%rbp
mov    %rbp,%rdi
lea    0xcba(%rip),%rsi
mov    %r14,%rdx
call   1070 <fprintf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   10b0 <printGame@plt>
nop
mov    %r13,%rdi
lea    0x14(%rsp),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    1240 <vroom+0xa0>
mov    0x8(%rsp),%rdi
mov    %r15,%rsi
call   1090 <partDeux@plt>
jmp    1240 <vroom+0xa0>

LLVM IR (-O0):
%struct.treenode = type { i32 }
@__const.vroom.add = [4 x i8] c"ADD\00"
@__const.vroom.sub = [7 x i8] c"REMOVE\00"
@__const.vroom.printgame = [10 x i8] c"PRINTGAME\00"
@__const.vroom.print = [6 x i8] c"PRINT\00"
@__const.vroom.partdeux = [6 x i8] c"PART2\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [5 x i8] c"%s:\0A\00"
define void @vroom(i32* %0, i32* %1, %struct.treenode* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca %struct.treenode*
%7 = alloca i32
%8 = alloca [20 x i8]
%9 = alloca [4 x i8]
%10 = alloca [7 x i8]
%11 = alloca [10 x i8]
%12 = alloca [6 x i8]
%13 = alloca [6 x i8]
%14 = alloca [20 x i8]
%15 = alloca [20 x i8]
store i32* %0, i32** %4
store i32* %1, i32** %5
store %struct.treenode* %2, %struct.treenode** %6
store i32 0, i32* %7
%16 = bitcast [4 x i8]* %9 to i8*
%17 = bitcast [7 x i8]* %10 to i8*
%18 = bitcast [10 x i8]* %11 to i8*
%19 = bitcast [6 x i8]* %12 to i8*
%20 = bitcast [6 x i8]* %13 to i8*
br label %21
21: ; preds = %93, %3
%22 = load i32*, i32** %4
%23 = call i32 @feof(i32* %22)
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
br i1 %25, label %26, label %94
26: ; preds = %21
%27 = load i32*, i32** %4
%28 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%29 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%31 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%32 = call i64 @strcmp(i8* %30, i8* %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %44
34: ; preds = %26
%35 = load i32*, i32** %4
%36 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%37 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0, i64 0
%38 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %36, i8* %37)
%39 = load %struct.treenode*, %struct.treenode** %6
%40 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0, i64 0
%42 = call i32 @createNode(i8* %40, i8* %41)
%43 = call %struct.treenode* @addNode(%struct.treenode* %39, i32 %42)
store %struct.treenode* %43, %struct.treenode** %6
br label %84
44: ; preds = %26
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%46 = getelementptr inbounds [7 x i8], [7 x i8]* %10, i64 0, i64 0
%47 = call i64 @strcmp(i8* %45, i8* %46)
%48 = icmp eq i64 %47, 0
br i1 %48, label %49, label %56
49: ; preds = %44
%50 = load i32*, i32** %4
%51 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%52 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %51)
%53 = load %struct.treenode*, %struct.treenode** %6
%54 = getelementptr inbounds [20 x i8], [20 x i8]* %14, i64 0, i64 0
%55 = call %struct.treenode* @subNode(%struct.treenode* %53, i8* %54)
store %struct.treenode* %55, %struct.treenode** %6
br label %83
56: ; preds = %44
%57 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%58 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%59 = call i64 @strcmp(i8* %57, i8* %58)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %72
61: ; preds = %56
%62 = load i32*, i32** %4
%63 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0, i64 0
%64 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %62, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %63)
%65 = load i32*, i32** %5
%66 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0, i64 0
%67 = call i32 @fprintf(i32* %65, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %66)
%68 = load i32*, i32** %5
%69 = load %struct.treenode*, %struct.treenode** %6
%70 = getelementptr inbounds [20 x i8], [20 x i8]* %15, i64 0, i64 0
%71 = call i32 @printGame(i32* %68, %struct.treenode* %69, i8* %70)
br label %82
72: ; preds = %56
%73 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%74 = getelementptr inbounds [6 x i8], [6 x i8]* %12, i64 0, i64 0
%75 = call i64 @strcmp(i8* %73, i8* %74)
%76 = icmp eq i64 %75, 0
br i1 %76, label %77, label %81
77: ; preds = %72
%78 = load %struct.treenode*, %struct.treenode** %6
%79 = load i32*, i32** %5
%80 = call i32 @printName(%struct.treenode* %78, i32* %79)
br label %81
81: ; preds = %77, %72
br label %82
82: ; preds = %81, %61
br label %83
83: ; preds = %82, %49
br label %84
84: ; preds = %83, %34
%85 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%86 = getelementptr inbounds [6 x i8], [6 x i8]* %13, i64 0, i64 0
%87 = call i64 @strcmp(i8* %85, i8* %86)
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %93
89: ; preds = %84
%90 = load i32*, i32** %5
%91 = load %struct.treenode*, %struct.treenode** %6
%92 = call i32 @partDeux(i32* %90, %struct.treenode* %91)
br label %93
93: ; preds = %89, %84
br label %21
94: ; preds = %21
ret void
}

LLVM IR (-O2):
%struct.treenode = type { i32 }
@__const.vroom.sub = [7 x i8] c"REMOVE\00"
@__const.vroom.printgame = [10 x i8] c"PRINTGAME\00"
@__const.vroom.print = [6 x i8] c"PRINT\00"
@__const.vroom.partdeux = [6 x i8] c"PART2\00"
@.str = [3 x i8] c"%s\00"
@.str.1 = [6 x i8] c"%s %s\00"
@.str.2 = [5 x i8] c"%s:\0A\00"
define void @vroom(i32* nocapture %0, i32* %1, %struct.treenode* %2) {
%4 = alloca [20 x i8]
%5 = alloca i32
%6 = alloca [7 x i8]
%7 = alloca [10 x i8]
%8 = alloca [6 x i8]
%9 = alloca [6 x i8]
%10 = alloca [20 x i8]
%11 = alloca [20 x i8]
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%13 = bitcast i32* %5 to i8*
store i32 4473921, i32* %5
%14 = getelementptr inbounds [7 x i8], [7 x i8]* %6, i64 0, i64 0
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%17 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %10, i64 0, i64 0
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %11, i64 0, i64 0
%20 = call i32 @feof(i32* %0)
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %58
22: ; preds = %3, %55
%23 = phi %struct.treenode* [ %50, %55 ], [ %2, %3 ]
%24 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%25 = call i64 @strcmp(i8* %12, i8* %13)
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* %19)
%29 = call i32 @createNode(i8* %18, i8* %19)
%30 = call %struct.treenode* @addNode(%struct.treenode* %23, i32 %29)
br label %49
31: ; preds = %22
%32 = call i64 @strcmp(i8* %12, i8* %14)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
%36 = call %struct.treenode* @subNode(%struct.treenode* %23, i8* %18)
br label %49
37: ; preds = %31
%38 = call i64 @strcmp(i8* %12, i8* %15)
%39 = icmp eq i64 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %19)
%42 = call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%43 = call i32 @printGame(i32* %1, %struct.treenode* %23, i8* %19)
br label %49
44: ; preds = %37
%45 = call i64 @strcmp(i8* %12, i8* %16)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %49
47: ; preds = %44
%48 = call i32 @printName(%struct.treenode* %23, i32* %1)
br label %49
49: ; preds = %34, %44, %47, %40, %27
%50 = phi %struct.treenode* [ %30, %27 ], [ %36, %34 ], [ %23, %40 ], [ %23, %47 ], [ %23, %44 ]
%51 = call i64 @strcmp(i8* %12, i8* %17)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %49
%54 = call i32 @partDeux(i32* %1, %struct.treenode* %50)
br label %55
55: ; preds = %53, %49
%56 = call i32 @feof(i32* %0)
%57 = icmp eq i32 %56, 0
br i1 %57, label %22, label %58
58: ; preds = %55, %3
ret void
}