#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*/ makeLED(char *, char *);
int message(int, char *);
scalar_t__ strcmp(char *, char *);
int processCommand(int client, char *command) {
  int val = -1;
  if (strcmp(command, "LED on") == 0) {
    val = message(client, "\r[Turning the LED on]");
    makeLED("value", "1");
  } else if (strcmp(command, "LED off") == 0) {
    val = message(client, "\r[Turning the LED off]");
    makeLED("value", "0");
  } else if (strcmp(command, "quit") == 0) {
    val = message(client, "\r[goodbye]");
  } else {
    val = message(client, "\r[Unknown command]");
  }
  return val;
}


x86 assembly (clang, -O0):
<processCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeaf(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    118a <processCommand+0x5a>
mov    -0x4(%rbp),%edi
lea    0xe9d(%rip),%rsi
call   1030 <message@plt>
mov    %eax,-0x14(%rbp)
lea    0xea4(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1040 <makeLED@plt>
jmp    121b <processCommand+0xeb>
mov    -0x10(%rbp),%rdi
lea    0xe90(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ce <processCommand+0x9e>
mov    -0x4(%rbp),%edi
lea    0xe7f(%rip),%rsi
call   1030 <message@plt>
mov    %eax,-0x14(%rbp)
lea    0xe60(%rip),%rdi
lea    0xe80(%rip),%rsi
call   1040 <makeLED@plt>
jmp    1216 <processCommand+0xe6>
mov    -0x10(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    11ff <processCommand+0xcf>
mov    -0x4(%rbp),%edi
lea    0xe59(%rip),%rsi
call   1030 <message@plt>
mov    %eax,-0x14(%rbp)
jmp    1211 <processCommand+0xe1>
mov    -0x4(%rbp),%edi
lea    0xe4d(%rip),%rsi
call   1030 <message@plt>
mov    %eax,-0x14(%rbp)
jmp    1216 <processCommand+0xe6>
jmp    121b <processCommand+0xeb>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processCommand>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     117d <processCommand+0x4d>
lea    0xed2(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     119d <processCommand+0x6d>
lea    0xedf(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcmp@plt>
test   %rax,%rax
je     11c9 <processCommand+0x99>
lea    0xedb(%rip),%rsi
jmp    11d0 <processCommand+0xa0>
lea    0xe83(%rip),%rsi
mov    %ebp,%edi
call   1030 <message@plt>
mov    %eax,%ebx
lea    0xe89(%rip),%rdi
lea    0xe88(%rip),%rsi
jmp    11bb <processCommand+0x8b>
lea    0xe89(%rip),%rsi
mov    %ebp,%edi
call   1030 <message@plt>
mov    %eax,%ebx
lea    0xe69(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1040 <makeLED@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe7b(%rip),%rsi
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <message@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"LED on\00"
@.str.1 = [22 x i8] c"\0D[Turning the LED on]\00"
@.str.2 = [6 x i8] c"value\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [8 x i8] c"LED off\00"
@.str.5 = [23 x i8] c"\0D[Turning the LED off]\00"
@.str.6 = [2 x i8] c"0\00"
@.str.7 = [5 x i8] c"quit\00"
@.str.8 = [11 x i8] c"\0D[goodbye]\00"
@.str.9 = [19 x i8] c"\0D[Unknown command]\00"
define i32 @processCommand(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
store i32 %0, i32* %3
store i8* %1, i8** %4
store i32 -1, i32* %5
%6 = load i8*, i8** %4
%7 = call i64 @strcmp(i8* %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = call i32 @message(i32 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
store i32 %11, i32* %5
%12 = call i32 @makeLED(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %33
13: ; preds = %2
%14 = load i8*, i8** %4
%15 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %3
%19 = call i32 @message(i32 %18, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
store i32 %19, i32* %5
%20 = call i32 @makeLED(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %32
21: ; preds = %13
%22 = load i8*, i8** %4
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i32, i32* %3
%27 = call i32 @message(i32 %26, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
store i32 %27, i32* %5
br label %31
28: ; preds = %21
%29 = load i32, i32* %3
%30 = call i32 @message(i32 %29, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
store i32 %30, i32* %5
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %17
br label %33
33: ; preds = %32, %9
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
@.str = [7 x i8] c"LED on\00"
@.str.1 = [22 x i8] c"\0D[Turning the LED on]\00"
@.str.2 = [6 x i8] c"value\00"
@.str.3 = [2 x i8] c"1\00"
@.str.4 = [8 x i8] c"LED off\00"
@.str.5 = [23 x i8] c"\0D[Turning the LED off]\00"
@.str.6 = [2 x i8] c"0\00"
@.str.7 = [5 x i8] c"quit\00"
@.str.8 = [11 x i8] c"\0D[goodbye]\00"
@.str.9 = [19 x i8] c"\0D[Unknown command]\00"
define i32 @processCommand(i32 %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @message(i32 %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @makeLED(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %21
8: ; preds = %2
%9 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 @message(i32 %0, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 @makeLED(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %21
14: ; preds = %8
%15 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = tail call i32 @message(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %21
19: ; preds = %14
%20 = tail call i32 @message(i32 %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.9, i64 0, i64 0))
br label %21
21: ; preds = %11, %19, %17, %5
%22 = phi i32 [ %6, %5 ], [ %12, %11 ], [ %18, %17 ], [ %20, %19 ]
ret i32 %22
}