#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*/ reset();
int /*<<< orphan*/ setColor(int, int);
scalar_t__ strcmp(char *, char *);
void processCommand(char *line) {
  if (strcmp(line, "help\n") == 0) {
    printf("COMMANDS\n\t\"version\" Print the current version of the "
           "interpreter\n\t\"reset\"   Reset program memory\n");
  } else if (strcmp(line, "version\n") == 0) {
    printf("Beta 1.3.2\n");
  } else if (strcmp(line, "reset\n") == 0) {
    reset();
    setColor(0, 7);
    printf("Memory reset\n");
    setColor(7, 0);
  } else {
    printf("Unrecognized command\n");
  }
}


x86 assembly (clang, -O0):
<processCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xea9(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1177 <processCommand+0x37>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1202 <processCommand+0xc2>
mov    -0x8(%rbp),%rdi
lea    0xee6(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11a2 <processCommand+0x62>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <processCommand+0xbd>
mov    -0x8(%rbp),%rdi
lea    0xed7(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11ec <processCommand+0xac>
mov    $0x0,%al
call   1050 <reset@plt>
xor    %edi,%edi
mov    $0x7,%esi
call   1060 <setColor@plt>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
mov    $0x7,%edi
xor    %esi,%esi
call   1060 <setColor@plt>
jmp    11f8 <processCommand+0xb8>
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
jmp    11fd <processCommand+0xbd>
jmp    1202 <processCommand+0xc2>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processCommand>:
push   %rbx
mov    %rdi,%rbx
lea    0xeb5(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     118a <processCommand+0x4a>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1197 <processCommand+0x57>
lea    0xe9f(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11a4 <processCommand+0x64>
lea    0xe92(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xeb2(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
lea    0xe9a(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>
xor    %eax,%eax
call   1050 <reset@plt>
xor    %edi,%edi
mov    $0x7,%esi
call   1060 <setColor@plt>
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
mov    $0x7,%edi
xor    %esi,%esi
pop    %rbx
jmp    1060 <setColor@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"help\0A\00"
@.str.1 = [98 x i8] c"COMMANDS\0A\09\22version\22 Print the current version of the interpreter\0A\09\22reset\22 Reset program memory\0A\00"
@.str.2 = [9 x i8] c"version\0A\00"
@.str.3 = [12 x i8] c"Beta 1.3.2\0A\00"
@.str.4 = [7 x i8] c"reset\0A\00"
@.str.5 = [14 x i8] c"Memory reset\0A\00"
@.str.6 = [22 x i8] c"Unrecognized command\0A\00"
define void @processCommand(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str.1, i64 0, i64 0))
br label %27
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i64 @strcmp(i8* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %26
14: ; preds = %8
%15 = load i8*, i8** %2
%16 = call i64 @strcmp(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 (...) @reset()
%20 = call i32 @setColor(i32 0, i32 7)
%21 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 @setColor(i32 7, i32 0)
br label %25
23: ; preds = %14
%24 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %25
25: ; preds = %23, %18
br label %26
26: ; preds = %25, %12
br label %27
27: ; preds = %26, %6
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"help\0A\00"
@.str.2 = [9 x i8] c"version\0A\00"
@.str.4 = [7 x i8] c"reset\0A\00"
@str = [21 x i8] c"Unrecognized command\00"
@str.7 = [13 x i8] c"Memory reset\00"
@str.8 = [11 x i8] c"Beta 1.3.2\00"
@str.9 = [97 x i8] c"COMMANDS\0A\09\22version\22 Print the current version of the interpreter\0A\09\22reset\22 Reset program memory\00"
define void @processCommand(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str.9, i64 0, i64 0))
br label %21
6: ; preds = %1
%7 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.8, i64 0, i64 0))
br label %21
11: ; preds = %6
%12 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %11
%15 = tail call i32 (...) @reset()
%16 = tail call i32 @setColor(i32 0, i32 7)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.7, i64 0, i64 0))
%18 = tail call i32 @setColor(i32 7, i32 0)
br label %21
19: ; preds = %11
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %21
21: ; preds = %9, %19, %14, %4
ret void
}