#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*/ choose_music();
int /*<<< orphan*/ clearBuffer();
int /*<<< orphan*/ getCpuVendor();
int /*<<< orphan*/ getTime();
int /*<<< orphan*/ help();
int /*<<< orphan*/ playTest();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ ringingKeyboard();
int /*<<< orphan*/ setScreensaver(int);
int /*<<< orphan*/ setTime();
scalar_t__ sscanf(char const *, char *, ...);
scalar_t__ strcmp(char *, char *);
void parseCommand(const char *line) {
  char command[80] = {0};
  char args[80] = {0};
  int hasCommand = sscanf(line, "%s %s", command, args);
  if (hasCommand == 0)
    return;
  if (strcmp(command, "help") == 0) {
    help();
  } else if (strcmp(command, "stime") == 0) {
    setTime();
  } else if (strcmp(command, "time") == 0) {
    getTime();
  } else if (strcmp(command, "ss") == 0) {
    int seconds = 0;
    if (sscanf(args, "%d", &seconds) > 0 && seconds > 0) {
      setScreensaver(seconds);
    } else
      printf("Invalid argument\n");
  } else if (strcmp(command, "cpuid") == 0) {
    getCpuVendor();
  } else if (strcmp(command, "playtest") == 0) {
    playTest();
  } else if (strcmp(command, "rkeyboard") == 0) {
    ringingKeyboard();
  } else if (strcmp(command, "choosemusic") == 0) {
    choose_music();
  } else {
    printf("Command not found.\n");
  }
  clearBuffer();
}


x86 assembly (clang, -O0):
<parseCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1080 <memset@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1080 <memset@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rdx
lea    -0xb0(%rbp),%rcx
lea    0xde8(%rip),%rsi
mov    $0x0,%al
call   10c0 <sscanf@plt>
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb4(%rbp)
jne    1237 <parseCommand+0x67>
jmp    13ef <parseCommand+0x21f>
lea    -0x60(%rbp),%rdi
lea    0xdc4(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    125d <parseCommand+0x8d>
mov    $0x0,%al
call   10d0 <help@plt>
jmp    13e8 <parseCommand+0x218>
lea    -0x60(%rbp),%rdi
lea    0xda3(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1283 <parseCommand+0xb3>
mov    $0x0,%al
call   10a0 <setTime@plt>
jmp    13e3 <parseCommand+0x213>
lea    -0x60(%rbp),%rdi
lea    0xd7e(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12a9 <parseCommand+0xd9>
mov    $0x0,%al
call   1050 <getTime@plt>
jmp    13de <parseCommand+0x20e>
lea    -0x60(%rbp),%rdi
lea    0xd5d(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1321 <parseCommand+0x151>
movl   $0x0,-0xb8(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0xd39(%rip),%rsi
lea    -0xb8(%rbp),%rdx
mov    $0x0,%al
call   10c0 <sscanf@plt>
cmp    $0x0,%rax
jle    1310 <parseCommand+0x140>
cmpl   $0x0,-0xb8(%rbp)
jle    1310 <parseCommand+0x140>
mov    -0xb8(%rbp),%edi
call   10f0 <setScreensaver@plt>
jmp    131c <parseCommand+0x14c>
lea    0xd00(%rip),%rdi
call   1070 <printf@plt>
jmp    13d9 <parseCommand+0x209>
lea    -0x60(%rbp),%rdi
lea    0xcfd(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1347 <parseCommand+0x177>
mov    $0x0,%al
call   1030 <getCpuVendor@plt>
jmp    13d4 <parseCommand+0x204>
lea    -0x60(%rbp),%rdi
lea    0xcdd(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    136d <parseCommand+0x19d>
mov    $0x0,%al
call   10e0 <playTest@plt>
jmp    13cf <parseCommand+0x1ff>
lea    -0x60(%rbp),%rdi
lea    0xcc0(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1393 <parseCommand+0x1c3>
mov    $0x0,%al
call   1040 <ringingKeyboard@plt>
jmp    13ca <parseCommand+0x1fa>
lea    -0x60(%rbp),%rdi
lea    0xca4(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    13b9 <parseCommand+0x1e9>
mov    $0x0,%al
call   10b0 <choose_music@plt>
jmp    13c5 <parseCommand+0x1f5>
lea    0xc8e(%rip),%rdi
call   1070 <printf@plt>
jmp    13ca <parseCommand+0x1fa>
jmp    13cf <parseCommand+0x1ff>
jmp    13d4 <parseCommand+0x204>
jmp    13d9 <parseCommand+0x209>
jmp    13de <parseCommand+0x20e>
jmp    13e3 <parseCommand+0x213>
jmp    13e8 <parseCommand+0x218>
mov    $0x0,%al
call   1060 <clearBuffer@plt>
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseCommand>:
sub    $0xb8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
lea    0xdf4(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0x60(%rsp),%rcx
xor    %eax,%eax
call   10b0 <sscanf@plt>
test   %eax,%eax
je     1384 <parseCommand+0x1c4>
lea    0xdda(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12fe <parseCommand+0x13e>
lea    0xdc5(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1307 <parseCommand+0x147>
lea    0xdac(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1310 <parseCommand+0x150>
lea    0xd97(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1319 <parseCommand+0x159>
lea    0xd83(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     134d <parseCommand+0x18d>
lea    0xd6f(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1364 <parseCommand+0x1a4>
lea    0xd5e(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     136d <parseCommand+0x1ad>
lea    0xd4e(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1376 <parseCommand+0x1b6>
lea    0xd40(%rip),%rdi
jmp    135d <parseCommand+0x19d>
xor    %eax,%eax
call   10c0 <help@plt>
jmp    137d <parseCommand+0x1bd>
xor    %eax,%eax
call   1090 <setTime@plt>
jmp    137d <parseCommand+0x1bd>
xor    %eax,%eax
call   1060 <getTime@plt>
jmp    137d <parseCommand+0x1bd>
movl   $0x0,0xc(%rsp)
lea    0xcec(%rip),%rsi
lea    0x60(%rsp),%rdi
lea    0xc(%rsp),%rdx
xor    %eax,%eax
call   10b0 <sscanf@plt>
test   %rax,%rax
jle    1356 <parseCommand+0x196>
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    1356 <parseCommand+0x196>
call   10e0 <setScreensaver@plt>
jmp    137d <parseCommand+0x1bd>
xor    %eax,%eax
call   1040 <getCpuVendor@plt>
jmp    137d <parseCommand+0x1bd>
lea    0xcf2(%rip),%rdi
call   1030 <puts@plt>
jmp    137d <parseCommand+0x1bd>
xor    %eax,%eax
call   10d0 <playTest@plt>
jmp    137d <parseCommand+0x1bd>
xor    %eax,%eax
call   1050 <ringingKeyboard@plt>
jmp    137d <parseCommand+0x1bd>
xor    %eax,%eax
call   10a0 <choose_music@plt>
xor    %eax,%eax
call   1070 <clearBuffer@plt>
add    $0xb8,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [6 x i8] c"stime\00"
@.str.3 = [5 x i8] c"time\00"
@.str.4 = [3 x i8] c"ss\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.6 = [18 x i8] c"Invalid argument\0A\00"
@.str.7 = [6 x i8] c"cpuid\00"
@.str.8 = [9 x i8] c"playtest\00"
@.str.9 = [10 x i8] c"rkeyboard\00"
@.str.10 = [12 x i8] c"choosemusic\00"
@.str.11 = [20 x i8] c"Command not found.\0A\00"
define void @parseCommand(i8* %0) {
%2 = alloca i8*
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = bitcast [80 x i8]* %3 to i8*
%8 = bitcast [80 x i8]* %4 to i8*
%9 = load i8*, i8** %2
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%12 = call i64 (i8*, i8*, ...) @sscanf(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %10, i8* %11)
%13 = trunc i64 %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %5
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %1
br label %87
17: ; preds = %1
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = call i32 (...) @help()
br label %85
23: ; preds = %17
%24 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %23
%28 = call i32 (...) @setTime()
br label %84
29: ; preds = %23
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 (...) @getTime()
br label %83
35: ; preds = %29
%36 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %52
39: ; preds = %35
store i32 0, i32* %6
%40 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%41 = call i64 (i8*, i8*, ...) @sscanf(i8* %40, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %6)
%42 = icmp sgt i64 %41, 0
br i1 %42, label %43, label %49
43: ; preds = %39
%44 = load i32, i32* %6
%45 = icmp sgt i32 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %43
%47 = load i32, i32* %6
%48 = call i32 @setScreensaver(i32 %47)
br label %51
49: ; preds = %43, %39
%50 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %51
51: ; preds = %49, %46
br label %82
52: ; preds = %35
%53 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 (...) @getCpuVendor()
br label %81
58: ; preds = %52
%59 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%60 = call i64 @strcmp(i8* %59, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 (...) @playTest()
br label %80
64: ; preds = %58
%65 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%66 = call i64 @strcmp(i8* %65, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %70
68: ; preds = %64
%69 = call i32 (...) @ringingKeyboard()
br label %79
70: ; preds = %64
%71 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%72 = call i64 @strcmp(i8* %71, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
%73 = icmp eq i64 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %70
%75 = call i32 (...) @choose_music()
br label %78
76: ; preds = %70
%77 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
br label %78
78: ; preds = %76, %74
br label %79
79: ; preds = %78, %68
br label %80
80: ; preds = %79, %62
br label %81
81: ; preds = %80, %56
br label %82
82: ; preds = %81, %51
br label %83
83: ; preds = %82, %33
br label %84
84: ; preds = %83, %27
br label %85
85: ; preds = %84, %21
%86 = call i32 (...) @clearBuffer()
br label %87
87: ; preds = %85, %16
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [5 x i8] c"help\00"
@.str.2 = [6 x i8] c"stime\00"
@.str.3 = [5 x i8] c"time\00"
@.str.4 = [3 x i8] c"ss\00"
@.str.5 = [3 x i8] c"%d\00"
@.str.7 = [6 x i8] c"cpuid\00"
@.str.8 = [9 x i8] c"playtest\00"
@.str.9 = [10 x i8] c"rkeyboard\00"
@.str.10 = [12 x i8] c"choosemusic\00"
@str = [19 x i8] c"Command not found.\00"
@str.12 = [17 x i8] c"Invalid argument\00"
define void @parseCommand(i8* %0) {
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
%4 = alloca i32
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = call i64 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = trunc i64 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %64, label %10
10: ; preds = %1
%11 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (...) @help()
br label %62
15: ; preds = %10
%16 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 (...) @setTime()
br label %62
20: ; preds = %15
%21 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (...) @getTime()
br label %62
25: ; preds = %20
%26 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %40
28: ; preds = %25
%29 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%30 = call i64 (i8*, i8*, ...) @sscanf(i8* %6, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%31 = icmp sgt i64 %30, 0
%32 = load i32, i32* %4
%33 = icmp sgt i32 %32, 0
%34 = select i1 %31, i1 %33, i1 false
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = call i32 @setScreensaver(i32 %32)
br label %39
37: ; preds = %28
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.12, i64 0, i64 0))
br label %39
39: ; preds = %37, %35
br label %62
40: ; preds = %25
%41 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %40
%44 = call i32 (...) @getCpuVendor()
br label %62
45: ; preds = %40
%46 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (...) @playTest()
br label %62
50: ; preds = %45
%51 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = call i32 (...) @ringingKeyboard()
br label %62
55: ; preds = %50
%56 = call i64 @strcmp(i8* %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %60
58: ; preds = %55
%59 = call i32 (...) @choose_music()
br label %62
60: ; preds = %55
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %62
62: ; preds = %18, %39, %48, %58, %60, %53, %43, %23, %13
%63 = call i32 (...) @clearBuffer()
br label %64
64: ; preds = %1, %62
ret void
}