#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*/ O_RDWR;
int /*<<< orphan*/ atoi(char *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setBrightness(int, int /*<<< orphan*/);
int /*<<< orphan*/ setContrast(int, int /*<<< orphan*/);
int /*<<< orphan*/ setGamma(int, int /*<<< orphan*/);
int /*<<< orphan*/ setHue(int, int /*<<< orphan*/);
int /*<<< orphan*/ setSaturation(int, int /*<<< orphan*/);
int /*<<< orphan*/ setVee(int, int /*<<< orphan*/);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int mFd = open("/dev/fb0", O_RDWR);
  if (!strcmp(argv[1], "contrast")) {
    setContrast(mFd, atoi(argv[2]));
    printf("please enter a number (0 ~ 100)\n");
  }
  if (!strcmp(argv[1], "brightness")) {
    setBrightness(mFd, atoi(argv[2]));
    printf("please enter a number (0 ~ 100)\n");
  }
  if (!strcmp(argv[1], "hue")) {
    setHue(mFd, atoi(argv[2]));
    printf("please enter a number (0 ~ 100)\n");
  }
  if (!strcmp(argv[1], "saturation")) {
    setSaturation(mFd, atoi(argv[2]));
    printf("please enter a number (0 ~ 100)\n");
  }
  if (!strcmp(argv[1], "gamma")) {
    setGamma(mFd, atoi(argv[2]));
    printf("please enter a number (0 ~ 100)\n");
  }
  if (!strcmp(argv[1], "vee")) {
    setVee(mFd, atoi(argv[2]));
    printf("please enter a number (0 ~ 100)\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e2b(%rip),%rax
mov    (%rax),%esi
lea    0xe3a(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe2c(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1214 <main+0x74>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    -0x18(%rbp),%edi
mov    %eax,%esi
call   1050 <setContrast@plt>
lea    0xe03(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe10(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    125a <main+0xba>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    -0x1c(%rbp),%edi
mov    %eax,%esi
call   1090 <setBrightness@plt>
lea    0xdbd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xdd5(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    12a0 <main+0x100>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1070 <setHue@plt>
lea    0xd77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd93(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    12e6 <main+0x146>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1060 <setSaturation@plt>
lea    0xd31(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd58(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    132c <main+0x18c>
mov    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    -0x28(%rbp),%edi
mov    %eax,%esi
call   10c0 <setGamma@plt>
lea    0xceb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd18(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%eax
jne    1372 <main+0x1d2>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10b0 <atoi@plt>
mov    -0x2c(%rbp),%edi
mov    %eax,%esi
call   1040 <setVee@plt>
lea    0xca5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    0x2e3a(%rip),%rax
mov    (%rax),%esi
lea    0xe49(%rip),%rdi
call   10a0 <open@plt>
mov    %eax,%r14d
mov    0x8(%rbx),%rbp
lea    0xe3f(%rip),%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    11f9 <main+0x59>
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1050 <setContrast@plt>
lea    0xe46(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rbp
lea    0xe12(%rip),%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    122f <main+0x8f>
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1090 <setBrightness@plt>
lea    0xe10(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rbp
lea    0xde7(%rip),%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    1265 <main+0xc5>
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1070 <setHue@plt>
lea    0xdda(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rbp
lea    0xdb5(%rip),%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    129b <main+0xfb>
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1060 <setSaturation@plt>
lea    0xda4(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rbp
lea    0xd8a(%rip),%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    12d1 <main+0x131>
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   10c0 <setGamma@plt>
lea    0xd6e(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rbp
lea    0xd5a(%rip),%rsi
mov    %rbp,%rdi
call   1080 <strcmp@plt>
test   %eax,%eax
jne    1303 <main+0x163>
mov    0x10(%rbx),%rdi
call   10b0 <atoi@plt>
mov    %r14d,%edi
mov    %eax,%esi
call   1040 <setVee@plt>
lea    0xd38(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/dev/fb0\00"
@O_RDWR = global i32 0
@.str.1 = [9 x i8] c"contrast\00"
@.str.2 = [33 x i8] c"please enter a number (0 ~ 100)\0A\00"
@.str.3 = [11 x i8] c"brightness\00"
@.str.4 = [4 x i8] c"hue\00"
@.str.5 = [11 x i8] c"saturation\00"
@.str.6 = [6 x i8] c"gamma\00"
@.str.7 = [4 x i8] c"vee\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* @O_RDWR
%8 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7)
store i32 %8, i32* %6
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %22, label %14
14: ; preds = %2
%15 = load i32, i32* %6
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 2
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
%20 = call i32 @setContrast(i32 %15, i32 %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %14, %2
%23 = load i8**, i8*** %5
%24 = getelementptr inbounds i8*, i8** %23, i64 1
%25 = load i8*, i8** %24
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %36, label %28
28: ; preds = %22
%29 = load i32, i32* %6
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
%34 = call i32 @setBrightness(i32 %29, i32 %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %36
36: ; preds = %28, %22
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @strcmp(i8* %39, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp ne i32 %40, 0
br i1 %41, label %50, label %42
42: ; preds = %36
%43 = load i32, i32* %6
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call i32 @atoi(i8* %46)
%48 = call i32 @setHue(i32 %43, i32 %47)
%49 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %50
50: ; preds = %42, %36
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 1
%53 = load i8*, i8** %52
%54 = call i32 @strcmp(i8* %53, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%55 = icmp ne i32 %54, 0
br i1 %55, label %64, label %56
56: ; preds = %50
%57 = load i32, i32* %6
%58 = load i8**, i8*** %5
%59 = getelementptr inbounds i8*, i8** %58, i64 2
%60 = load i8*, i8** %59
%61 = call i32 @atoi(i8* %60)
%62 = call i32 @setSaturation(i32 %57, i32 %61)
%63 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %64
64: ; preds = %56, %50
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = call i32 @strcmp(i8* %67, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%69 = icmp ne i32 %68, 0
br i1 %69, label %78, label %70
70: ; preds = %64
%71 = load i32, i32* %6
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 2
%74 = load i8*, i8** %73
%75 = call i32 @atoi(i8* %74)
%76 = call i32 @setGamma(i32 %71, i32 %75)
%77 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %78
78: ; preds = %70, %64
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 1
%81 = load i8*, i8** %80
%82 = call i32 @strcmp(i8* %81, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%83 = icmp ne i32 %82, 0
br i1 %83, label %92, label %84
84: ; preds = %78
%85 = load i32, i32* %6
%86 = load i8**, i8*** %5
%87 = getelementptr inbounds i8*, i8** %86, i64 2
%88 = load i8*, i8** %87
%89 = call i32 @atoi(i8* %88)
%90 = call i32 @setVee(i32 %85, i32 %89)
%91 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %92
92: ; preds = %84, %78
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/dev/fb0\00"
@O_RDWR = global i32 0
@.str.1 = [9 x i8] c"contrast\00"
@.str.3 = [11 x i8] c"brightness\00"
@.str.4 = [4 x i8] c"hue\00"
@.str.5 = [11 x i8] c"saturation\00"
@.str.6 = [6 x i8] c"gamma\00"
@.str.7 = [4 x i8] c"vee\00"
@str.12 = [32 x i8] c"please enter a number (0 ~ 100)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i32, i32* @O_RDWR
%4 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = tail call i32 @setContrast(i32 %4, i32 %12)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.12, i64 0, i64 0))
%15 = load i8*, i8** %5
br label %16
16: ; preds = %9, %2
%17 = phi i8* [ %15, %9 ], [ %6, %2 ]
%18 = tail call i32 @strcmp(i8* dereferenceable(1) %17, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %27
20: ; preds = %16
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = tail call i32 @setBrightness(i32 %4, i32 %23)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.12, i64 0, i64 0))
%26 = load i8*, i8** %5
br label %27
27: ; preds = %20, %16
%28 = phi i8* [ %26, %20 ], [ %17, %16 ]
%29 = tail call i32 @strcmp(i8* dereferenceable(1) %28, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %38
31: ; preds = %27
%32 = getelementptr inbounds i8*, i8** %1, i64 2
%33 = load i8*, i8** %32
%34 = tail call i32 @atoi(i8* %33)
%35 = tail call i32 @setHue(i32 %4, i32 %34)
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.12, i64 0, i64 0))
%37 = load i8*, i8** %5
br label %38
38: ; preds = %31, %27
%39 = phi i8* [ %37, %31 ], [ %28, %27 ]
%40 = tail call i32 @strcmp(i8* dereferenceable(1) %39, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %38
%43 = getelementptr inbounds i8*, i8** %1, i64 2
%44 = load i8*, i8** %43
%45 = tail call i32 @atoi(i8* %44)
%46 = tail call i32 @setSaturation(i32 %4, i32 %45)
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.12, i64 0, i64 0))
%48 = load i8*, i8** %5
br label %49
49: ; preds = %42, %38
%50 = phi i8* [ %48, %42 ], [ %39, %38 ]
%51 = tail call i32 @strcmp(i8* dereferenceable(1) %50, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %60
53: ; preds = %49
%54 = getelementptr inbounds i8*, i8** %1, i64 2
%55 = load i8*, i8** %54
%56 = tail call i32 @atoi(i8* %55)
%57 = tail call i32 @setGamma(i32 %4, i32 %56)
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.12, i64 0, i64 0))
%59 = load i8*, i8** %5
br label %60
60: ; preds = %53, %49
%61 = phi i8* [ %59, %53 ], [ %50, %49 ]
%62 = tail call i32 @strcmp(i8* dereferenceable(1) %61, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %70
64: ; preds = %60
%65 = getelementptr inbounds i8*, i8** %1, i64 2
%66 = load i8*, i8** %65
%67 = tail call i32 @atoi(i8* %66)
%68 = tail call i32 @setVee(i32 %4, i32 %67)
%69 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.12, i64 0, i64 0))
br label %70
70: ; preds = %64, %60
ret i32 0
}