#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 */
double atof(char *);
int atoi(char *);
int /*<<< orphan*/ exit(int);
int pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  double gamma = 1.0;
  int maxin = 16383;
  int maxout = 255;
  int shadow = 0;
  int highlight = maxin;
  int in, out;
  float f;
  if ((argc == 1) || (argc > 6)) {
    printf("Usage: %s gamma [shadow [highlight [maxin [maxout]]]]\n", argv[0]);
    exit(-1);
  }
  if (argc > 1) {
    gamma = atof(argv[1]);
  }
  if (argc > 2) {
    shadow = atoi(argv[2]);
  }
  if (argc > 3) {
    highlight = atoi(argv[3]);
  }
  if (argc > 4) {
    maxin = atoi(argv[4]);
  }
  if (argc > 5) {
    maxout = atoi(argv[5]);
  }
  if (shadow < 0) {
    printf("%s error: shadow=%d < 0\n", argv[0], shadow);
    exit(-1);
  }
  if (highlight < 0) {
    printf("%s error: highlight=%d < 0\n", argv[0], highlight);
    exit(-1);
  }
  if (maxin < 0) {
    printf("%s error: maxin=%d < 0\n", argv[0], maxin);
    exit(-1);
  }
  if (maxout < 0) {
    printf("%s error: maxout=%d < 0\n", argv[0], maxout);
    exit(-1);
  }
  if (shadow >= highlight) {
    printf("%s error: shadow=%d >= highlight=%d\n", argv[0], shadow, highlight);
    exit(-1);
  }
  if (highlight > maxin) {
    printf("%s error: highlight=%d > maxin=%d\n", argv[0], highlight, maxin);
    exit(-1);
  }
  if ((gamma < 0.1) || (gamma > 5)) {
    printf("%s error: gamma=%f out of range [0.1;5]\n", argv[0], gamma);
    exit(-1);
  }
  f = (highlight - shadow) / 255.0 + shadow;
  printf("[%d]%d-", 0, 0);
  if (shadow > 0) {
    printf("[%d]%d-", shadow, 0);
  }
  while (f < highlight) {
    in = (int)f;
    out = maxout *
          pow((double)(in - shadow) / (highlight - shadow), (1.0 / gamma));
    printf("[%d]%d-", in, out);
    f *= 1.5;
  }
  if (f > highlight) {
    printf("[%d]%d-", highlight, maxout);
  }
  printf("[%d]%d", maxin, maxout);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x3fff,-0x1c(%rbp)
movl   $0xff,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     11a2 <main+0x52>
cmpl   $0x6,-0x8(%rbp)
jle    11c1 <main+0x71>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
cmpl   $0x1,-0x8(%rbp)
jle    11dd <main+0x8d>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    11f7 <main+0xa7>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    1211 <main+0xc1>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x28(%rbp)
cmpl   $0x4,-0x8(%rbp)
jle    122b <main+0xdb>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x5,-0x8(%rbp)
jle    1245 <main+0xf5>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1271 <main+0x121>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x24(%rbp),%edx
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
cmpl   $0x0,-0x28(%rbp)
jge    129d <main+0x14d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x28(%rbp),%edx
lea    0xdec(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
cmpl   $0x0,-0x1c(%rbp)
jge    12c9 <main+0x179>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x1c(%rbp),%edx
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
cmpl   $0x0,-0x20(%rbp)
jge    12f5 <main+0x1a5>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%edx
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jl     1326 <main+0x1d6>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x28(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1357 <main+0x207>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x28(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
movsd  0xca9(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
ja     1381 <main+0x231>
movsd  -0x18(%rbp),%xmm0
movsd  0xc99(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13a5 <main+0x255>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
movsd  -0x18(%rbp),%xmm0
lea    0xd79(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    -0x28(%rbp),%eax
sub    -0x24(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xc61(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0x24(%rbp),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
lea    0xd62(%rip),%rdi
xor    %edx,%edx
mov    %edx,%esi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x24(%rbp)
jle    13fc <main+0x2ac>
mov    -0x24(%rbp),%esi
lea    0xd43(%rip),%rdi
xor    %edx,%edx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1401 <main+0x2b1>
movss  -0x34(%rbp),%xmm1
cvtsi2ssl -0x28(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    148e <main+0x33e>
cvttss2si -0x34(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
sub    -0x24(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x28(%rbp),%eax
sub    -0x24(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
movsd  0xbbe(%rip),%xmm1
divsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xba4(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x34(%rbp)
jmp    1401 <main+0x2b1>
movss  -0x34(%rbp),%xmm0
cvtsi2ssl -0x28(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jbe    14b5 <main+0x365>
mov    -0x28(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xc88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xc7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
cmp    $0x1,%edi
je     13c4 <main+0x274>
mov    %edi,%r13d
cmp    $0x7,%edi
jge    13c4 <main+0x274>
mov    $0xff,%r14d
xor    %r12d,%r12d
mov    $0x3fff,%ebp
cmp    $0x2,%r13d
jl     1242 <main+0xf2>
mov    0x8(%rbx),%rdi
call   1030 <atof@plt>
cmp    $0x2,%r13d
je     124a <main+0xfa>
movsd  %xmm0,0x8(%rsp)
mov    0x10(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r12d
cmp    $0x4,%r13d
jb     13a0 <main+0x250>
mov    0x18(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r15d
mov    $0xff,%r14d
mov    $0x3fff,%ebp
cmp    $0x4,%r13d
je     11f7 <main+0xa7>
mov    0x20(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
cmp    $0x6,%r13d
jb     11f7 <main+0xa7>
mov    0x28(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r14d
test   %r12d,%r12d
movsd  0x8(%rsp),%xmm0
js     13fa <main+0x2aa>
test   %r15d,%r15d
js     142a <main+0x2da>
test   %ebp,%ebp
js     1439 <main+0x2e9>
test   %r14d,%r14d
js     1447 <main+0x2f7>
cmp    %r12d,%r15d
jbe    1409 <main+0x2b9>
cmp    %ebp,%r15d
jbe    1250 <main+0x100>
mov    (%rbx),%rsi
lea    0xeae(%rip),%rdi
mov    %r15d,%edx
mov    %ebp,%ecx
jmp    1419 <main+0x2c9>
movsd  0xdb6(%rip),%xmm0
mov    $0x3fff,%r15d
movsd  0xdb0(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     13df <main+0x28f>
ucomisd 0xda6(%rip),%xmm0
ja     13df <main+0x28f>
movsd  %xmm0,0x8(%rsp)
mov    %r15d,%eax
sub    %r12d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x20(%rsp)
divsd  0xd87(%rip),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %r12d,%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x10(%rsp)
lea    0xe88(%rip),%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
test   %r12d,%r12d
je     12cd <main+0x17d>
lea    0xe71(%rip),%rdi
mov    %r12d,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%r13d
xorps  %xmm1,%xmm1
cvtsi2ss %r15d,%xmm1
movsd  0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm2
ucomiss %xmm2,%xmm1
movsd  0x8(%rsp),%xmm0
jbe    1362 <main+0x212>
movsd  0xd0b(%rip),%xmm3
divsd  %xmm0,%xmm3
movsd  %xmm3,0x10(%rsp)
lea    0xe2c(%rip),%rbx
movss  %xmm1,0x1c(%rsp)
nopl   0x0(%rax)
movss  %xmm2,0x8(%rsp)
cvttss2si %xmm2,%ebp
mov    %ebp,%eax
sub    %r12d,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0x20(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1050 <pow@plt>
imul   %r14d,%eax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm2
movss  0x1c(%rsp),%xmm1
mulss  0xcc3(%rip),%xmm2
ucomiss %xmm2,%xmm1
ja     1310 <main+0x1c0>
ucomiss %xmm1,%xmm2
jbe    137b <main+0x22b>
lea    0xdc4(%rip),%rdi
mov    %r15d,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdb8(%rip),%rdi
mov    %r13d,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
test   %r12d,%r12d
movsd  0x8(%rsp),%xmm0
js     13fa <main+0x2aa>
mov    $0x3fff,%r15d
cmp    $0x3fff,%r12d
jae    1409 <main+0x2b9>
mov    $0x3fff,%ebp
jmp    1250 <main+0x100>
mov    (%rbx),%rsi
lea    0xc56(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    (%rbx),%rsi
lea    0xd20(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    (%rbx),%rsi
lea    0xc57(%rip),%rdi
mov    %r12d,%edx
jmp    1454 <main+0x304>
mov    (%rbx),%rsi
lea    0xcae(%rip),%rdi
mov    %r12d,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>
mov    (%rbx),%rsi
lea    0xc40(%rip),%rdi
mov    %r15d,%edx
jmp    1454 <main+0x304>
mov    (%rbx),%rsi
lea    0xc4d(%rip),%rdi
mov    %ebp,%edx
jmp    1454 <main+0x304>
mov    (%rbx),%rsi
lea    0xc57(%rip),%rdi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Usage: %s gamma [shadow [highlight [maxin [maxout]]]]\0A\00"
@.str.1 = [25 x i8] c"%s error: shadow=%d < 0\0A\00"
@.str.2 = [28 x i8] c"%s error: highlight=%d < 0\0A\00"
@.str.3 = [24 x i8] c"%s error: maxin=%d < 0\0A\00"
@.str.4 = [25 x i8] c"%s error: maxout=%d < 0\0A\00"
@.str.5 = [37 x i8] c"%s error: shadow=%d >= highlight=%d\0A\00"
@.str.6 = [35 x i8] c"%s error: highlight=%d > maxin=%d\0A\00"
@.str.7 = [41 x i8] c"%s error: gamma=%f out of range [0.1;5]\0A\00"
@.str.8 = [8 x i8] c"[%d]%d-\00"
@.str.9 = [7 x i8] c"[%d]%d\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.000000e+00, double* %6
store i32 16383, i32* %7
store i32 255, i32* %8
store i32 0, i32* %9
%14 = load i32, i32* %7
store i32 %14, i32* %10
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 1
br i1 %16, label %20, label %17
17: ; preds = %2
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 6
br i1 %19, label %20, label %26
20: ; preds = %17, %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = call i32 @exit(i32 -1)
unreachable
26: ; preds = %17
%27 = load i32, i32* %4
%28 = icmp sgt i32 %27, 1
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = call double @atof(i8* %32)
store double %33, double* %6
br label %34
34: ; preds = %29, %26
%35 = load i32, i32* %4
%36 = icmp sgt i32 %35, 2
br i1 %36, label %37, label %42
37: ; preds = %34
%38 = load i8**, i8*** %5
%39 = getelementptr inbounds i8*, i8** %38, i64 2
%40 = load i8*, i8** %39
%41 = call i32 @atoi(i8* %40)
store i32 %41, i32* %9
br label %42
42: ; preds = %37, %34
%43 = load i32, i32* %4
%44 = icmp sgt i32 %43, 3
br i1 %44, label %45, label %50
45: ; preds = %42
%46 = load i8**, i8*** %5
%47 = getelementptr inbounds i8*, i8** %46, i64 3
%48 = load i8*, i8** %47
%49 = call i32 @atoi(i8* %48)
store i32 %49, i32* %10
br label %50
50: ; preds = %45, %42
%51 = load i32, i32* %4
%52 = icmp sgt i32 %51, 4
br i1 %52, label %53, label %58
53: ; preds = %50
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 4
%56 = load i8*, i8** %55
%57 = call i32 @atoi(i8* %56)
store i32 %57, i32* %7
br label %58
58: ; preds = %53, %50
%59 = load i32, i32* %4
%60 = icmp sgt i32 %59, 5
br i1 %60, label %61, label %66
61: ; preds = %58
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 5
%64 = load i8*, i8** %63
%65 = call i32 @atoi(i8* %64)
store i32 %65, i32* %8
br label %66
66: ; preds = %61, %58
%67 = load i32, i32* %9
%68 = icmp slt i32 %67, 0
br i1 %68, label %69, label %76
69: ; preds = %66
%70 = load i8**, i8*** %5
%71 = getelementptr inbounds i8*, i8** %70, i64 0
%72 = load i8*, i8** %71
%73 = load i32, i32* %9
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %72, i32 %73)
%75 = call i32 @exit(i32 -1)
unreachable
76: ; preds = %66
%77 = load i32, i32* %10
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %86
79: ; preds = %76
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 0
%82 = load i8*, i8** %81
%83 = load i32, i32* %10
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %82, i32 %83)
%85 = call i32 @exit(i32 -1)
unreachable
86: ; preds = %76
%87 = load i32, i32* %7
%88 = icmp slt i32 %87, 0
br i1 %88, label %89, label %96
89: ; preds = %86
%90 = load i8**, i8*** %5
%91 = getelementptr inbounds i8*, i8** %90, i64 0
%92 = load i8*, i8** %91
%93 = load i32, i32* %7
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %92, i32 %93)
%95 = call i32 @exit(i32 -1)
unreachable
96: ; preds = %86
%97 = load i32, i32* %8
%98 = icmp slt i32 %97, 0
br i1 %98, label %99, label %106
99: ; preds = %96
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 0
%102 = load i8*, i8** %101
%103 = load i32, i32* %8
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i8* %102, i32 %103)
%105 = call i32 @exit(i32 -1)
unreachable
106: ; preds = %96
%107 = load i32, i32* %9
%108 = load i32, i32* %10
%109 = icmp sge i32 %107, %108
br i1 %109, label %110, label %118
110: ; preds = %106
%111 = load i8**, i8*** %5
%112 = getelementptr inbounds i8*, i8** %111, i64 0
%113 = load i8*, i8** %112
%114 = load i32, i32* %9
%115 = load i32, i32* %10
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %113, i32 %114, i32 %115)
%117 = call i32 @exit(i32 -1)
unreachable
118: ; preds = %106
%119 = load i32, i32* %10
%120 = load i32, i32* %7
%121 = icmp sgt i32 %119, %120
br i1 %121, label %122, label %130
122: ; preds = %118
%123 = load i8**, i8*** %5
%124 = getelementptr inbounds i8*, i8** %123, i64 0
%125 = load i8*, i8** %124
%126 = load i32, i32* %10
%127 = load i32, i32* %7
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i8* %125, i32 %126, i32 %127)
%129 = call i32 @exit(i32 -1)
unreachable
130: ; preds = %118
%131 = load double, double* %6
%132 = fcmp olt double %131, 1.000000e-01
br i1 %132, label %136, label %133
133: ; preds = %130
%134 = load double, double* %6
%135 = fcmp ogt double %134, 5.000000e+00
br i1 %135, label %136, label %143
136: ; preds = %133, %130
%137 = load i8**, i8*** %5
%138 = getelementptr inbounds i8*, i8** %137, i64 0
%139 = load i8*, i8** %138
%140 = load double, double* %6
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i8* %139, double %140)
%142 = call i32 @exit(i32 -1)
unreachable
143: ; preds = %133
%144 = load i32, i32* %10
%145 = load i32, i32* %9
%146 = sub nsw i32 %144, %145
%147 = sitofp i32 %146 to double
%148 = fdiv double %147, 2.550000e+02
%149 = load i32, i32* %9
%150 = sitofp i32 %149 to double
%151 = fadd double %148, %150
%152 = fptrunc double %151 to float
store float %152, float* %13
%153 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 0, i32 0)
%154 = load i32, i32* %9
%155 = icmp sgt i32 %154, 0
br i1 %155, label %156, label %159
156: ; preds = %143
%157 = load i32, i32* %9
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %157, i32 0)
br label %159
159: ; preds = %156, %143
br label %160
160: ; preds = %165, %159
%161 = load float, float* %13
%162 = load i32, i32* %10
%163 = sitofp i32 %162 to float
%164 = fcmp olt float %161, %163
br i1 %164, label %165, label %189
165: ; preds = %160
%166 = load float, float* %13
%167 = fptosi float %166 to i32
store i32 %167, i32* %11
%168 = load i32, i32* %8
%169 = load i32, i32* %11
%170 = load i32, i32* %9
%171 = sub nsw i32 %169, %170
%172 = sitofp i32 %171 to double
%173 = load i32, i32* %10
%174 = load i32, i32* %9
%175 = sub nsw i32 %173, %174
%176 = sitofp i32 %175 to double
%177 = fdiv double %172, %176
%178 = load double, double* %6
%179 = fdiv double 1.000000e+00, %178
%180 = call i32 @pow(double %177, double %179)
%181 = mul nsw i32 %168, %180
store i32 %181, i32* %12
%182 = load i32, i32* %11
%183 = load i32, i32* %12
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %182, i32 %183)
%185 = load float, float* %13
%186 = fpext float %185 to double
%187 = fmul double %186, 1.500000e+00
%188 = fptrunc double %187 to float
store float %188, float* %13
br label %160
189: ; preds = %160
%190 = load float, float* %13
%191 = load i32, i32* %10
%192 = sitofp i32 %191 to float
%193 = fcmp ogt float %190, %192
br i1 %193, label %194, label %198
194: ; preds = %189
%195 = load i32, i32* %10
%196 = load i32, i32* %8
%197 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %195, i32 %196)
br label %198
198: ; preds = %194, %189
%199 = load i32, i32* %7
%200 = load i32, i32* %8
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %199, i32 %200)
ret i32 0
}

LLVM IR (-O2):
@.str = [55 x i8] c"Usage: %s gamma [shadow [highlight [maxin [maxout]]]]\0A\00"
@.str.1 = [25 x i8] c"%s error: shadow=%d < 0\0A\00"
@.str.2 = [28 x i8] c"%s error: highlight=%d < 0\0A\00"
@.str.3 = [24 x i8] c"%s error: maxin=%d < 0\0A\00"
@.str.4 = [25 x i8] c"%s error: maxout=%d < 0\0A\00"
@.str.5 = [37 x i8] c"%s error: shadow=%d >= highlight=%d\0A\00"
@.str.6 = [35 x i8] c"%s error: highlight=%d > maxin=%d\0A\00"
@.str.7 = [41 x i8] c"%s error: gamma=%f out of range [0.1;5]\0A\00"
@.str.8 = [8 x i8] c"[%d]%d-\00"
@.str.9 = [7 x i8] c"[%d]%d\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
%4 = icmp sgt i32 %0, 6
%5 = or i1 %3, %4
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %2
%11 = icmp sgt i32 %0, 1
br i1 %11, label %12, label %79
12: ; preds = %10
%13 = getelementptr inbounds i8*, i8** %1, i64 1
%14 = load i8*, i8** %13
%15 = tail call double @atof(i8* %14)
%16 = icmp eq i32 %0, 2
br i1 %16, label %79, label %17
17: ; preds = %12
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = icmp ugt i32 %0, 3
br i1 %21, label %22, label %40
22: ; preds = %17
%23 = getelementptr inbounds i8*, i8** %1, i64 3
%24 = load i8*, i8** %23
%25 = tail call i32 @atoi(i8* %24)
%26 = icmp eq i32 %0, 4
br i1 %26, label %36, label %27
27: ; preds = %22
%28 = getelementptr inbounds i8*, i8** %1, i64 4
%29 = load i8*, i8** %28
%30 = tail call i32 @atoi(i8* %29)
%31 = icmp ugt i32 %0, 5
br i1 %31, label %32, label %36
32: ; preds = %27
%33 = getelementptr inbounds i8*, i8** %1, i64 5
%34 = load i8*, i8** %33
%35 = tail call i32 @atoi(i8* %34)
br label %36
36: ; preds = %22, %32, %27
%37 = phi i32 [ %30, %32 ], [ %30, %27 ], [ 16383, %22 ]
%38 = phi i32 [ %35, %32 ], [ 255, %27 ], [ 255, %22 ]
%39 = icmp slt i32 %20, 0
br i1 %39, label %42, label %46
40: ; preds = %17
%41 = icmp slt i32 %20, 0
br i1 %41, label %42, label %66
42: ; preds = %40, %36
%43 = load i8*, i8** %1
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i8* %43, i32 %20)
%45 = tail call i32 @exit(i32 -1)
unreachable
46: ; preds = %36
%47 = icmp slt i32 %25, 0
br i1 %47, label %48, label %52
48: ; preds = %46
%49 = load i8*, i8** %1
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i8* %49, i32 %25)
%51 = tail call i32 @exit(i32 -1)
unreachable
52: ; preds = %46
%53 = icmp slt i32 %37, 0
br i1 %53, label %54, label %58
54: ; preds = %52
%55 = load i8*, i8** %1
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %55, i32 %37)
%57 = tail call i32 @exit(i32 -1)
unreachable
58: ; preds = %52
%59 = icmp slt i32 %38, 0
br i1 %59, label %60, label %64
60: ; preds = %58
%61 = load i8*, i8** %1
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i8* %61, i32 %38)
%63 = tail call i32 @exit(i32 -1)
unreachable
64: ; preds = %58
%65 = icmp ugt i32 %25, %20
br i1 %65, label %73, label %68
66: ; preds = %40
%67 = icmp ult i32 %20, 16383
br i1 %67, label %79, label %68
68: ; preds = %66, %64
%69 = phi i32 [ 16383, %66 ], [ %25, %64 ]
%70 = load i8*, i8** %1
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i8* %70, i32 %20, i32 %69)
%72 = tail call i32 @exit(i32 -1)
unreachable
73: ; preds = %64
%74 = icmp ugt i32 %25, %37
br i1 %74, label %75, label %79
75: ; preds = %73
%76 = load i8*, i8** %1
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i8* %76, i32 %25, i32 %37)
%78 = tail call i32 @exit(i32 -1)
unreachable
79: ; preds = %66, %12, %10, %73
%80 = phi i32 [ %37, %73 ], [ 16383, %10 ], [ 16383, %12 ], [ 16383, %66 ]
%81 = phi i32 [ %20, %73 ], [ 0, %10 ], [ 0, %12 ], [ %20, %66 ]
%82 = phi double [ %15, %73 ], [ 1.000000e+00, %10 ], [ %15, %12 ], [ %15, %66 ]
%83 = phi i32 [ %25, %73 ], [ 16383, %10 ], [ 16383, %12 ], [ 16383, %66 ]
%84 = phi i32 [ %38, %73 ], [ 255, %10 ], [ 255, %12 ], [ 255, %66 ]
%85 = fcmp olt double %82, 1.000000e-01
%86 = fcmp ogt double %82, 5.000000e+00
%87 = or i1 %85, %86
br i1 %87, label %88, label %92
88: ; preds = %79
%89 = load i8*, i8** %1
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0), i8* %89, double %82)
%91 = tail call i32 @exit(i32 -1)
unreachable
92: ; preds = %79
%93 = sub nsw i32 %83, %81
%94 = sitofp i32 %93 to double
%95 = fdiv double %94, 2.550000e+02
%96 = sitofp i32 %81 to double
%97 = fadd double %95, %96
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 0, i32 0)
%99 = icmp eq i32 %81, 0
br i1 %99, label %102, label %100
100: ; preds = %92
%101 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %81, i32 0)
br label %102
102: ; preds = %100, %92
%103 = sitofp i32 %83 to float
%104 = fptrunc double %97 to float
%105 = fcmp olt float %104, %103
br i1 %105, label %106, label %119
106: ; preds = %102
%107 = fdiv double 1.000000e+00, %82
br label %108
108: ; preds = %106, %108
%109 = phi float [ %104, %106 ], [ %117, %108 ]
%110 = fptosi float %109 to i32
%111 = sub nsw i32 %110, %81
%112 = sitofp i32 %111 to double
%113 = fdiv double %112, %94
%114 = tail call i32 @pow(double %113, double %107)
%115 = mul nsw i32 %114, %84
%116 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %110, i32 %115)
%117 = fmul float %109, 1.500000e+00
%118 = fcmp olt float %117, %103
br i1 %118, label %108, label %119
119: ; preds = %108, %102
%120 = phi float [ %104, %102 ], [ %117, %108 ]
%121 = fcmp ogt float %120, %103
br i1 %121, label %122, label %124
122: ; preds = %119
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 %83, i32 %84)
br label %124
124: ; preds = %122, %119
%125 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 %80, i32 %84)
ret i32 0
}