#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 */
typedef int /*<<< orphan*/ answer;

/* Variables and functions */
int memcmp(char *, char *, int);
int /*<<< orphan*/ printf(char *);
void main(int argc, char *argv[]) {
  char answer[5] = "linux";
  if (argc < 2) {
    printf("MOAR!\n");
    return;
  }
  if (argc > 2) {
    printf("LESS!\n");
    return;
  }
  int comp = (memcmp(argv[1], answer, sizeof(answer)));
  if (comp > 0) {
    printf("TOO SPICEY!\n");
    return;
  }
  if (comp < 0) {
    printf("TOO SOUR!\n");
    return;
  }
  if (comp == 0) {
    printf("Just right!\n");
    return;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x11(%rbp)
cmpl   $0x2,-0x4(%rbp)
jge    115c <main+0x3c>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
cmpl   $0x2,-0x4(%rbp)
jle    1177 <main+0x57>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    -0x15(%rbp),%rsi
mov    $0x5,%edx
call   1040 <memcmp@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jle    11ab <main+0x8b>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
cmpl   $0x0,-0x1c(%rbp)
jge    11c6 <main+0xa6>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
cmpl   $0x0,-0x1c(%rbp)
jne    11dc <main+0xbc>
lea    0xe54(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x78,0x4(%rsp)
movl   $0x756e696c,(%rsp)
cmp    $0x1,%edi
jg     113f <main+0x1f>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
cmp    $0x2,%edi
jne    1162 <main+0x42>
mov    0x8(%rsi),%rdi
mov    %rsp,%rsi
mov    $0x5,%edx
call   1040 <memcmp@plt>
test   %eax,%eax
jle    116f <main+0x4f>
lea    0xebb(%rip),%rdi
jmp    1181 <main+0x61>
lea    0xebe(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>
jns    117a <main+0x5a>
lea    0xe99(%rip),%rdi
jmp    1181 <main+0x61>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.main.answer = [5 x i8] c"linux"
@.str = [7 x i8] c"MOAR!\0A\00"
@.str.1 = [7 x i8] c"LESS!\0A\00"
@.str.2 = [13 x i8] c"TOO SPICEY!\0A\00"
@.str.3 = [11 x i8] c"TOO SOUR!\0A\00"
@.str.4 = [13 x i8] c"Just right!\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca [5 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%7 = bitcast [5 x i8]* %5 to i8*
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %37
12: ; preds = %2
%13 = load i32, i32* %3
%14 = icmp sgt i32 %13, 2
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %37
17: ; preds = %12
%18 = load i8**, i8*** %4
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%22 = call i32 @memcmp(i8* %20, i8* %21, i32 5)
store i32 %22, i32* %6
%23 = load i32, i32* %6
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %17
%26 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %37
27: ; preds = %17
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %37
32: ; preds = %27
%33 = load i32, i32* %6
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
br label %37
37: ; preds = %10, %15, %25, %30, %35, %32
ret void
}

LLVM IR (-O2):
@__const.main.answer = [5 x i8] c"linux"
@str = [12 x i8] c"Just right!\00"
@str.5 = [10 x i8] c"TOO SOUR!\00"
@str.6 = [12 x i8] c"TOO SPICEY!\00"
@str.7 = [6 x i8] c"LESS!\00"
@str.8 = [6 x i8] c"MOAR!\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.8, i64 0, i64 0))
br label %25
8: ; preds = %2
%9 = icmp eq i32 %0, 2
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.7, i64 0, i64 0))
br label %25
12: ; preds = %8
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @memcmp(i8* %14, i8* %4, i32 5)
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %12
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.6, i64 0, i64 0))
br label %25
19: ; preds = %12
%20 = icmp slt i32 %15, 0
br i1 %20, label %21, label %23
21: ; preds = %19
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.5, i64 0, i64 0))
br label %25
23: ; preds = %19
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %25
25: ; preds = %17, %21, %23, %10, %6
ret void
}