#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*/ die(char *, char *);
int /*<<< orphan*/ step_brightness(int);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if (argc == 2 && !strcmp("up", argv[1]))
    step_brightness(+1);
  else if (argc == 2 && !strcmp("down", argv[1]))
    step_brightness(-1);
  else
    die("usage: %s <up|down>\n", argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    117c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xea1(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    117c <main+0x4c>
mov    $0x1,%edi
call   1040 <step_brightness@plt>
jmp    11ca <main+0x9a>
cmpl   $0x2,-0x8(%rbp)
jne    11b2 <main+0x82>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe6e(%rip),%rdi
call   1030 <strcmp@plt>
cmp    $0x0,%eax
jne    11b2 <main+0x82>
mov    $0xffffffff,%edi
call   1040 <step_brightness@plt>
jmp    11c5 <main+0x95>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe48(%rip),%rdi
call   1050 <die@plt>
jmp    11ca <main+0x9a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
cmp    $0x2,%edi
jne    1166 <main+0x36>
mov    0x8(%rbx),%r14
lea    0xeb9(%rip),%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     1177 <main+0x47>
lea    0xea9(%rip),%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
je     117e <main+0x4e>
mov    (%rbx),%rsi
lea    0xe98(%rip),%rdi
call   1050 <die@plt>
jmp    1188 <main+0x58>
mov    $0x1,%edi
jmp    1183 <main+0x53>
mov    $0xffffffff,%edi
call   1040 <step_brightness@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"up\00"
@.str.1 = [5 x i8] c"down\00"
@.str.2 = [21 x i8] c"usage: %s <up|down>\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 @strcmp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = call i32 @step_brightness(i32 1)
br label %33
16: ; preds = %8, %2
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 2
br i1 %18, label %19, label %27
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @strcmp(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %27, label %25
25: ; preds = %19
%26 = call i32 @step_brightness(i32 -1)
br label %32
27: ; preds = %19, %16
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
%31 = call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %30)
br label %32
32: ; preds = %27, %25
br label %33
33: ; preds = %32, %14
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"up\00"
@.str.1 = [5 x i8] c"down\00"
@.str.2 = [21 x i8] c"usage: %s <up|down>\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* dereferenceable(1) %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @step_brightness(i32 1)
br label %19
11: ; preds = %4
%12 = tail call i32 @strcmp(i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* dereferenceable(1) %6)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 @step_brightness(i32 -1)
br label %19
16: ; preds = %2, %11
%17 = load i8*, i8** %1
%18 = tail call i32 @die(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* %17)
br label %19
19: ; preds = %14, %16, %9
ret i32 0
}