#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 EXIT_SUCCESS;
int /*<<< orphan*/ bgcolor(char *);
int /*<<< orphan*/ fgcolor(char *);
int /*<<< orphan*/ list_colors();
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  if (argc == 1) {
    usage();
    return EXIT_SUCCESS;
  }
  if (!strcmp(argv[1], "--list")) {
    list_colors();
    return EXIT_SUCCESS;
  }
  fgcolor(argv[1]);
  if (argv[2])
    bgcolor(argv[2]);
  return EXIT_SUCCESS;
}


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   $0x1,-0x8(%rbp)
jne    1188 <main+0x38>
mov    $0x0,%al
call   1060 <usage@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11f2 <main+0xa2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe69(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    11bd <main+0x6d>
mov    $0x0,%al
call   1040 <list_colors@plt>
mov    0x2e2d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11f2 <main+0xa2>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <fgcolor@plt>
mov    -0x10(%rbp),%rax
cmpq   $0x0,0x10(%rax)
je     11e6 <main+0x96>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <bgcolor@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    1162 <main+0x12>
xor    %eax,%eax
call   1060 <usage@plt>
jmp    119b <main+0x4b>
mov    %rsi,%rbx
mov    0x8(%rsi),%r14
lea    0xe90(%rip),%rsi
mov    %r14,%rdi
call   1050 <strcmp@plt>
test   %eax,%eax
je     1194 <main+0x44>
mov    %r14,%rdi
call   1030 <fgcolor@plt>
mov    0x10(%rbx),%rdi
test   %rdi,%rdi
je     119b <main+0x4b>
call   1070 <bgcolor@plt>
jmp    119b <main+0x4b>
xor    %eax,%eax
call   1040 <list_colors@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@.str = [7 x i8] c"--list\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, 1
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 (...) @usage()
%10 = load i32, i32* @EXIT_SUCCESS
store i32 %10, i32* %3
br label %36
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @strcmp(i8* %14, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %11
%18 = call i32 (...) @list_colors()
%19 = load i32, i32* @EXIT_SUCCESS
store i32 %19, i32* %3
br label %36
20: ; preds = %11
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @fgcolor(i8* %23)
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = icmp ne i8* %27, null
br i1 %28, label %29, label %34
29: ; preds = %20
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = call i32 @bgcolor(i8* %32)
br label %34
34: ; preds = %29, %20
%35 = load i32, i32* @EXIT_SUCCESS
store i32 %35, i32* %3
br label %36
36: ; preds = %34, %17, %8
%37 = load i32, i32* %3
ret i32 %37
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@.str = [7 x i8] c"--list\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %20
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @strcmp(i8* dereferenceable(1) %8, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = tail call i32 (...) @list_colors()
br label %20
13: ; preds = %6
%14 = tail call i32 @fgcolor(i8* %8)
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, null
br i1 %17, label %20, label %18
18: ; preds = %13
%19 = tail call i32 @bgcolor(i8* %16)
br label %20
20: ; preds = %13, %18, %11, %4
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}