#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*/ FE_TONEAREST;
double YfromRGB(double, double, double);
double component(char const *, char const *, int);
int /*<<< orphan*/ fesetround(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int);
double linear_from_sRGB(double);
double nearbyint(double);
int /*<<< orphan*/ printf(char *, ...);
double sRGB_from_linear(double);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char const *, char *);
int /*<<< orphan*/ usage(char const *);
int main(int argc, const char **argv) {
  const char *prog = *argv++;
  int to_linear = 0, to_gray = 0, to_color = 0;
  int channels = 0;
  double c[4];
  fesetround(FE_TONEAREST);
  c[3] = c[2] = c[1] = c[0] = 0;
  while (--argc > 0 && **argv == '-') {
    const char *arg = 1 + *argv++;
    if (strcmp(arg, "sRGB") == 0)
      to_linear = 0;
    else if (strcmp(arg, "linear") == 0)
      to_linear = 1;
    else if (strcmp(arg, "gray") == 0)
      to_gray = 1, to_color = 0;
    else if (strcmp(arg, "color") == 0)
      to_gray = 0, to_color = 1;
    else
      usage(prog);
  }
  switch (argc) {
  default:
    usage(prog);
    break;
  case 4:
    c[3] = component(prog, argv[3], to_linear);
    ++channels;
  case 3:
    c[2] = component(prog, argv[2], to_linear);
    ++channels;
  case 2:
    c[1] = component(prog, argv[1], to_linear);
    ++channels;
  case 1:
    c[0] = component(prog, argv[0], to_linear);
    ++channels;
    break;
  }
  if (to_linear) {
    int i;
    int components = channels;
    if ((components & 1) == 0)
      --components;
    for (i = 0; i < components; ++i)
      c[i] = linear_from_sRGB(c[i] / 255);
    if (components < channels)
      c[components] = c[components] / 255;
  } else {
    int i;
    for (i = 0; i < 4; ++i)
      c[i] /= 65535;
    if ((channels & 1) == 0) {
      double alpha = c[channels - 1];
      if (alpha > 0)
        for (i = 0; i < channels - 1; ++i)
          c[i] /= alpha;
      else
        for (i = 0; i < channels - 1; ++i)
          c[i] = 1;
    }
  }
  if (to_gray) {
    if (channels < 3) {
      fprintf(stderr, "%s: too few channels (%d) for -gray\n", prog, channels);
      usage(prog);
    }
    c[0] = YfromRGB(c[0], c[1], c[2]);
    channels -= 2;
  }
  if (to_color) {
    if (channels > 2) {
      fprintf(stderr, "%s: too many channels (%d) for -color\n", prog,
              channels);
      usage(prog);
    }
    c[3] = c[1];
    c[2] = c[1] = c[0];
  }
  if (to_linear) {
    int i;
    if ((channels & 1) == 0) {
      double alpha = c[channels - 1];
      for (i = 0; i < channels - 1; ++i)
        c[i] *= alpha;
    }
    for (i = 0; i < channels; ++i)
      c[i] = nearbyint(c[i] * 65535);
  } else {
    int i = (channels + 1) & ~1;
    while (--i >= 0)
      c[i] = sRGB_from_linear(c[i]);
    for (i = 0; i < channels; ++i)
      c[i] = nearbyint(c[i] * 255);
  }
  {
    int i;
    for (i = 0; i < channels; ++i)
      printf(" %g", c[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
call   1040 <fesetround@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x89(%rbp)
jle    1249 <main+0xa9>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x89(%rbp)
mov    -0x89(%rbp),%al
test   $0x1,%al
jne    125c <main+0xbc>
jmp    1339 <main+0x199>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
add    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
lea    0xda7(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    129c <main+0xfc>
movl   $0x0,-0x1c(%rbp)
jmp    1334 <main+0x194>
mov    -0x58(%rbp),%rdi
lea    0xd86(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12c2 <main+0x122>
movl   $0x1,-0x1c(%rbp)
jmp    132f <main+0x18f>
mov    -0x58(%rbp),%rdi
lea    0xd67(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    12ef <main+0x14f>
movl   $0x1,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
jmp    132a <main+0x18a>
mov    -0x58(%rbp),%rdi
lea    0xd3f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    131c <main+0x17c>
movl   $0x0,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
jmp    1325 <main+0x185>
mov    -0x18(%rbp),%rdi
call   1090 <usage@plt>
jmp    132a <main+0x18a>
jmp    132f <main+0x18f>
jmp    1334 <main+0x194>
jmp    1219 <main+0x79>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x98(%rbp)
sub    $0x3,%eax
ja     1368 <main+0x1c8>
mov    -0x98(%rbp),%rax
lea    0xcb9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rdi
call   1090 <usage@plt>
jmp    13fd <main+0x25d>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <component@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <component@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <component@plt>
movsd  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <component@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     149c <main+0x2fc>
mov    -0x28(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1425 <main+0x285>
mov    -0x60(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x60(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    146b <main+0x2cb>
movslq -0x5c(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
movsd  0xbc6(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1050 <linear_from_sRGB@plt>
movslq -0x5c(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    142c <main+0x28c>
mov    -0x60(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1497 <main+0x2f7>
movslq -0x60(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
movsd  0xb87(%rip),%xmm1
divsd  %xmm1,%xmm0
movslq -0x60(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
jmp    1596 <main+0x3f6>
movl   $0x0,-0x64(%rbp)
cmpl   $0x4,-0x64(%rbp)
jge    14d7 <main+0x337>
movslq -0x64(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
movsd  0xb49(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    14a3 <main+0x303>
mov    -0x28(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1591 <main+0x3f1>
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x50(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x70(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    154f <main+0x3af>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    154a <main+0x3aa>
movsd  -0x70(%rbp),%xmm1
movslq -0x64(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1512 <main+0x372>
jmp    158c <main+0x3ec>
movl   $0x0,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1587 <main+0x3e7>
movslq -0x64(%rbp),%rax
movsd  0xa8d(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1556 <main+0x3b6>
jmp    158c <main+0x3ec>
jmp    1591 <main+0x3f1>
jmp    1596 <main+0x3f6>
cmpl   $0x0,-0x20(%rbp)
je     15f1 <main+0x451>
cmpl   $0x3,-0x28(%rbp)
jge    15cf <main+0x42f>
mov    0x2a27(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
lea    0xa7e(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1090 <usage@plt>
movsd  -0x50(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
call   10b0 <YfromRGB@plt>
movsd  %xmm0,-0x50(%rbp)
mov    -0x28(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     1643 <main+0x4a3>
cmpl   $0x2,-0x28(%rbp)
jle    162a <main+0x48a>
mov    0x29cc(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%ecx
lea    0xa48(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1090 <usage@plt>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  %xmm0,-0x40(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     16f6 <main+0x556>
mov    -0x28(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    16af <main+0x50f>
mov    -0x28(%rbp),%eax
sub    $0x1,%eax
cltq
movsd  -0x50(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    16aa <main+0x50a>
movsd  -0x80(%rbp),%xmm0
movslq -0x74(%rbp),%rax
mulsd  -0x50(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1676 <main+0x4d6>
jmp    16af <main+0x50f>
movl   $0x0,-0x74(%rbp)
mov    -0x74(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    16f1 <main+0x551>
movslq -0x74(%rbp),%rax
movsd  0x93a(%rip),%xmm0
mulsd  -0x50(%rbp,%rax,8),%xmm0
call   10a0 <nearbyint@plt>
movslq -0x74(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    16b6 <main+0x516>
jmp    179a <main+0x5fa>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
and    $0xfffffffe,%eax
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x84(%rbp)
cmp    $0x0,%eax
jl     1741 <main+0x5a1>
movslq -0x84(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
call   10c0 <sRGB_from_linear@plt>
movslq -0x84(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
jmp    1705 <main+0x565>
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1795 <main+0x5f5>
movslq -0x84(%rbp),%rax
movsd  0x8a7(%rip),%xmm0
mulsd  -0x50(%rbp,%rax,8),%xmm0
call   10a0 <nearbyint@plt>
movslq -0x84(%rbp),%rax
movsd  %xmm0,-0x50(%rbp,%rax,8)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    174b <main+0x5ab>
jmp    179a <main+0x5fa>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    17e2 <main+0x642>
movslq -0x88(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
lea    0x8c4(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    17a4 <main+0x604>
lea    0x8a0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
mov    (%rsi),%rax
mov    %rax,0x28(%rsp)
mov    0x2e16(%rip),%rax
mov    (%rax),%edi
call   1050 <fesetround@plt>
lea    0x8(%rbx),%r15
xor    %r14d,%r14d
xorpd  %xmm1,%xmm1
movapd %xmm1,(%rsp)
xorpd  %xmm0,%xmm0
movapd %xmm0,0x30(%rsp)
movapd %xmm1,0x10(%rsp)
cmp    $0x2,%ebp
jl     12f8 <main+0x148>
mov    (%r15),%r13
cmpb   $0x2d,0x0(%r13)
jne    12f8 <main+0x148>
movl   $0x0,0x24(%rsp)
lea    0xe11(%rip),%rbx
movl   $0x0,0x20(%rsp)
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
add    $0x1,%r13
mov    %r13,%rdi
mov    %rbx,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1290 <main+0xe0>
mov    %r13,%rdi
lea    0xde7(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12a0 <main+0xf0>
mov    %r13,%rdi
lea    0xdda(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12a8 <main+0xf8>
mov    %r13,%rdi
lea    0xdcb(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     12ba <main+0x10a>
mov    0x28(%rsp),%rdi
call   10a0 <usage@plt>
jmp    12ca <main+0x11a>
nopl   0x0(%rax)
xor    %r13d,%r13d
jmp    12cd <main+0x11d>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x1,%r13d
jmp    12cd <main+0x11d>
movl   $0x0,0x20(%rsp)
movl   $0x1,0x24(%rsp)
jmp    12ca <main+0x11a>
movl   $0x1,0x20(%rsp)
movl   $0x0,0x24(%rsp)
mov    %r12d,%r13d
cmp    $0x2,%ebp
jbe    1449 <main+0x299>
mov    %r13d,%r12d
mov    0x8(%r15),%r13
add    $0x8,%r15
add    $0xffffffff,%ebp
cmpb   $0x2d,0x0(%r13)
je     1230 <main+0x80>
lea    -0x8(%r15),%rbx
mov    %r12d,%r13d
jmp    130b <main+0x15b>
movl   $0x0,0x24(%rsp)
movl   $0x0,0x20(%rsp)
xor    %r13d,%r13d
add    $0xfffffffe,%ebp
cmp    $0x3,%ebp
ja     1449 <main+0x299>
mov    $0x1,%r12d
xorpd  %xmm0,%xmm0
lea    0xcf8(%rip),%rax
movslq (%rax,%rbp,4),%rcx
add    %rax,%rcx
mov    0x28(%rsp),%rbp
jmp    *%rcx
mov    0x20(%rbx),%rsi
mov    %rbp,%rdi
mov    %r13d,%edx
call   1030 <component@plt>
movsd  %xmm0,0x18(%rsp)
mov    $0x2,%r12d
movapd %xmm0,0x40(%rsp)
mov    0x18(%rbx),%rsi
mov    %rbp,%rdi
mov    %r13d,%edx
call   1030 <component@plt>
movsd  %xmm0,0x10(%rsp)
unpcklpd 0x40(%rsp),%xmm0
movapd %xmm0,0x30(%rsp)
mov    %r12d,%r14d
mov    0x10(%rbx),%rsi
mov    %rbp,%rdi
mov    %r13d,%edx
call   1030 <component@plt>
movsd  %xmm0,0x8(%rsp)
add    $0x1,%r14d
movapd %xmm0,0x40(%rsp)
mov    (%r15),%rsi
mov    %rbp,%rdi
mov    %r13d,%edx
call   1030 <component@plt>
movsd  %xmm0,(%rsp)
add    $0x1,%r14d
unpcklpd 0x40(%rsp),%xmm0
test   %r13d,%r13d
je     1470 <main+0x2c0>
mov    %r14d,%eax
and    $0x1,%eax
cmp    $0x1,%eax
mov    %r14d,%r15d
sbb    $0x0,%r15d
test   %r15d,%r15d
jle    1420 <main+0x270>
divsd  0xc23(%rip),%xmm0
call   1060 <linear_from_sRGB@plt>
movsd  %xmm0,(%rsp)
cmp    $0x1,%r15d
je     1420 <main+0x270>
mov    %r15d,%ebp
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rsp,%rbx,8),%xmm0
divsd  0xbf3(%rip),%xmm0
call   1060 <linear_from_sRGB@plt>
movsd  %xmm0,(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1400 <main+0x250>
test   $0x1,%r14b
mov    0x28(%rsp),%rbp
jne    15c7 <main+0x417>
movslq %r15d,%rax
movsd  (%rsp,%rax,8),%xmm0
divsd  0xbc1(%rip),%xmm0
movsd  %xmm0,(%rsp,%rax,8)
jmp    15c7 <main+0x417>
mov    0x28(%rsp),%rbp
mov    %rbp,%rdi
call   10a0 <usage@plt>
xorpd  %xmm0,%xmm0
xor    %r14d,%r14d
xorpd  %xmm1,%xmm1
movapd %xmm1,0x30(%rsp)
test   %r13d,%r13d
jne    13c0 <main+0x210>
movapd 0xb98(%rip),%xmm1
divpd  %xmm1,%xmm0
movapd %xmm0,(%rsp)
movapd 0x30(%rsp),%xmm2
divpd  %xmm1,%xmm2
movapd %xmm2,0x10(%rsp)
test   $0x1,%r14b
jne    15c7 <main+0x417>
lea    -0x1(%r14),%eax
mov    %r14d,%ecx
movsd  -0x8(%rsp,%rcx,8),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    154c <main+0x39c>
cmp    $0x2,%r14d
jb     15c7 <main+0x417>
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
cmp    $0x1,%eax
je     15c7 <main+0x417>
mov    %eax,%eax
lea    -0x1(%rax),%rcx
mov    $0x1,%edx
cmp    $0x2,%rcx
jb     15b0 <main+0x400>
mov    %rcx,%rdx
and    $0xfffffffffffffffe,%rdx
movapd %xmm1,%xmm0
unpcklpd %xmm1,%xmm0
lea    -0x2(%rdx),%rsi
mov    %rsi,%rbp
shr    %rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     1576 <main+0x3c6>
mov    %rbp,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movupd 0x8(%rsp,%rsi,8),%xmm2
movupd 0x18(%rsp,%rsi,8),%xmm3
divpd  %xmm0,%xmm2
movupd %xmm2,0x8(%rsp,%rsi,8)
divpd  %xmm0,%xmm3
movupd %xmm3,0x18(%rsp,%rsi,8)
add    $0x4,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1520 <main+0x370>
jmp    1578 <main+0x3c8>
cmp    $0x1,%r14d
jbe    15c7 <main+0x417>
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%rsp)
cmp    $0x1,%eax
je     15c7 <main+0x417>
mov    %rcx,0x8(%rsp)
cmp    $0x2,%eax
je     15c7 <main+0x417>
mov    %rcx,0x10(%rsp)
jmp    15c7 <main+0x417>
xor    %esi,%esi
test   $0x1,%bpl
je     1594 <main+0x3e4>
shl    $0x3,%rsi
or     $0x8,%rsi
movupd (%rsp,%rsi,1),%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,(%rsp,%rsi,1)
cmp    %rdx,%rcx
mov    0x28(%rsp),%rbp
je     15c7 <main+0x417>
or     $0x1,%rcx
mov    %rcx,%rdx
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rsp,%rdx,8),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    15b0 <main+0x400>
cmpl   $0x0,0x24(%rsp)
je     1616 <main+0x466>
cmp    $0x2,%r14d
jg     15f7 <main+0x447>
mov    0x29fd(%rip),%rax
mov    (%rax),%edi
lea    0xa63(%rip),%rsi
mov    %rbp,%rdx
mov    %r14d,%ecx
call   1090 <fprintf@plt>
mov    %rbp,%rdi
call   10a0 <usage@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
call   10c0 <YfromRGB@plt>
movsd  %xmm0,(%rsp)
add    $0xfffffffe,%r14d
mov    0x20(%rsp),%eax
test   %eax,%eax
je     1658 <main+0x4a8>
cmp    $0x3,%r14d
jl     1647 <main+0x497>
mov    0x29ad(%rip),%rax
mov    (%rax),%edi
lea    0xa38(%rip),%rsi
mov    %rbp,%rdx
mov    %r14d,%ecx
call   1090 <fprintf@plt>
mov    %rbp,%rdi
call   10a0 <usage@plt>
movapd (%rsp),%xmm0
movlpd %xmm0,0x8(%rsp)
movapd %xmm0,0x10(%rsp)
test   %r13d,%r13d
je     1690 <main+0x4e0>
test   $0x1,%r14b
jne    1817 <main+0x667>
cmp    $0x2,%r14d
jl     1817 <main+0x667>
lea    -0x1(%r14),%ecx
movslq %r14d,%rax
movsd  -0x8(%rsp,%rax,8),%xmm0
mov    %ecx,%eax
cmp    $0x4,%ecx
jae    1754 <main+0x5a4>
xor    %ecx,%ecx
jmp    1800 <main+0x650>
lea    0x1(%r14),%ebx
test   $0xfffffffe,%ebx
jle    16d1 <main+0x521>
mov    %ebx,%ebp
and    $0xfffffffe,%ebx
or     $0x1,%rbp
add    $0xffffffff,%ebx
nopl   0x0(%rax,%rax,1)
mov    %ebx,%r15d
movsd  (%rsp,%r15,8),%xmm0
call   10d0 <sRGB_from_linear@plt>
movsd  %xmm0,(%rsp,%r15,8)
add    $0xffffffffffffffff,%rbp
add    $0xffffffff,%ebx
cmp    $0x1,%rbp
ja     16b0 <main+0x500>
test   %r14d,%r14d
jle    18c8 <main+0x718>
movsd  (%rsp),%xmm0
mulsd  0x919(%rip),%xmm0
call   10b0 <nearbyint@plt>
movsd  %xmm0,(%rsp)
cmp    $0x1,%r14d
je     1894 <main+0x6e4>
movsd  0x8(%rsp),%xmm0
mulsd  0x8f7(%rip),%xmm0
call   10b0 <nearbyint@plt>
movsd  %xmm0,0x8(%rsp)
cmp    $0x2,%r14d
je     1894 <main+0x6e4>
movsd  0x10(%rsp),%xmm0
mulsd  0x8d4(%rip),%xmm0
call   10b0 <nearbyint@plt>
movsd  %xmm0,0x10(%rsp)
cmp    $0x3,%r14d
je     1894 <main+0x6e4>
movsd  0x18(%rsp),%xmm0
mulsd  0x8b1(%rip),%xmm0
jmp    1889 <main+0x6d9>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
movapd %xmm0,%xmm1
unpcklpd %xmm0,%xmm1
lea    -0x4(%rcx),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
test   %rsi,%rsi
je     18e3 <main+0x733>
mov    %rdx,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movapd (%rsp,%rsi,8),%xmm2
mulpd  %xmm1,%xmm2
movapd 0x10(%rsp,%rsi,8),%xmm3
mulpd  %xmm1,%xmm3
movapd %xmm2,(%rsp,%rsi,8)
movapd %xmm3,0x10(%rsp,%rsi,8)
movapd 0x20(%rsp,%rsi,8),%xmm2
mulpd  %xmm1,%xmm2
movapd 0x30(%rsp,%rsi,8),%xmm3
mulpd  %xmm1,%xmm3
movapd %xmm2,0x20(%rsp,%rsi,8)
movapd %xmm3,0x30(%rsp,%rsi,8)
add    $0x8,%rsi
add    $0xfffffffffffffffe,%rdi
jne    1790 <main+0x5e0>
test   $0x1,%dl
je     17f7 <main+0x647>
movapd (%rsp,%rsi,8),%xmm2
mulpd  %xmm1,%xmm2
mulpd  0x10(%rsp,%rsi,8),%xmm1
movapd %xmm2,(%rsp,%rsi,8)
movapd %xmm1,0x10(%rsp,%rsi,8)
cmp    %rax,%rcx
je     1817 <main+0x667>
nopl   0x0(%rax)
movsd  (%rsp,%rcx,8),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1800 <main+0x650>
test   %r14d,%r14d
jle    18c8 <main+0x718>
movsd  (%rsp),%xmm0
mulsd  0x7db(%rip),%xmm0
call   10b0 <nearbyint@plt>
movsd  %xmm0,(%rsp)
cmp    $0x1,%r14d
je     1894 <main+0x6e4>
movsd  0x8(%rsp),%xmm0
mulsd  0x7bd(%rip),%xmm0
call   10b0 <nearbyint@plt>
movsd  %xmm0,0x8(%rsp)
cmp    $0x2,%r14d
je     1894 <main+0x6e4>
movsd  0x10(%rsp),%xmm0
mulsd  0x79e(%rip),%xmm0
call   10b0 <nearbyint@plt>
movsd  %xmm0,0x10(%rsp)
cmp    $0x3,%r14d
je     1894 <main+0x6e4>
movsd  0x18(%rsp),%xmm0
mulsd  0x77f(%rip),%xmm0
call   10b0 <nearbyint@plt>
movsd  %xmm0,0x18(%rsp)
test   %r14d,%r14d
jle    18c8 <main+0x718>
mov    %r14d,%ebp
xor    %ebx,%ebx
lea    0x7ee(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rsp,%rbx,8),%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    18b0 <main+0x700>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %esi,%esi
test   $0x1,%dl
jne    17dd <main+0x62d>
jmp    17f7 <main+0x647>

LLVM IR (-O0):
@FE_TONEAREST = global i32 0
@.str = [5 x i8] c"sRGB\00"
@.str.1 = [7 x i8] c"linear\00"
@.str.2 = [5 x i8] c"gray\00"
@.str.3 = [6 x i8] c"color\00"
@stderr = global i32 0
@.str.4 = [37 x i8] c"%s: too few channels (%d) for -gray\0A\00"
@.str.5 = [39 x i8] c"%s: too many channels (%d) for -color\0A\00"
@.str.6 = [4 x i8] c" %g\00"
@.str.7 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [4 x double]
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
%17 = alloca i32
%18 = alloca double
%19 = alloca i32
%20 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %5
%23 = load i8*, i8** %21
store i8* %23, i8** %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%24 = load i32, i32* @FE_TONEAREST
%25 = call i32 @fesetround(i32 %24)
%26 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
store double 0.000000e+00, double* %26
%27 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
store double 0.000000e+00, double* %27
%28 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 2
store double 0.000000e+00, double* %28
%29 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 3
store double 0.000000e+00, double* %29
br label %30
30: ; preds = %72, %2
%31 = load i32, i32* %4
%32 = add nsw i32 %31, -1
store i32 %32, i32* %4
%33 = icmp sgt i32 %32, 0
br i1 %33, label %34, label %40
34: ; preds = %30
%35 = load i8**, i8*** %5
%36 = load i8*, i8** %35
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 45
br label %40
40: ; preds = %34, %30
%41 = phi i1 [ false, %30 ], [ %39, %34 ]
br i1 %41, label %42, label %73
42: ; preds = %40
%43 = load i8**, i8*** %5
%44 = getelementptr inbounds i8*, i8** %43, i32 1
store i8** %44, i8*** %5
%45 = load i8*, i8** %43
%46 = getelementptr inbounds i8, i8* %45, i64 1
store i8* %46, i8** %12
%47 = load i8*, i8** %12
%48 = call i64 @strcmp(i8* %47, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%49 = icmp eq i64 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %42
store i32 0, i32* %7
br label %72
51: ; preds = %42
%52 = load i8*, i8** %12
%53 = call i64 @strcmp(i8* %52, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %56
55: ; preds = %51
store i32 1, i32* %7
br label %71
56: ; preds = %51
%57 = load i8*, i8** %12
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
br i1 %59, label %60, label %61
60: ; preds = %56
store i32 1, i32* %8
store i32 0, i32* %9
br label %70
61: ; preds = %56
%62 = load i8*, i8** %12
%63 = call i64 @strcmp(i8* %62, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %66
65: ; preds = %61
store i32 0, i32* %8
store i32 1, i32* %9
br label %69
66: ; preds = %61
%67 = load i8*, i8** %6
%68 = call i32 @usage(i8* %67)
br label %69
69: ; preds = %66, %65
br label %70
70: ; preds = %69, %60
br label %71
71: ; preds = %70, %55
br label %72
72: ; preds = %71, %50
br label %30
73: ; preds = %40
%74 = load i32, i32* %4
switch i32 %74, label %75 [
i32 4, label %78
i32 3, label %88
i32 2, label %98
i32 1, label %108
]
75: ; preds = %73
%76 = load i8*, i8** %6
%77 = call i32 @usage(i8* %76)
br label %118
78: ; preds = %73
%79 = load i8*, i8** %6
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 3
%82 = load i8*, i8** %81
%83 = load i32, i32* %7
%84 = call double @component(i8* %79, i8* %82, i32 %83)
%85 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 3
store double %84, double* %85
%86 = load i32, i32* %10
%87 = add nsw i32 %86, 1
store i32 %87, i32* %10
br label %88
88: ; preds = %73, %78
%89 = load i8*, i8** %6
%90 = load i8**, i8*** %5
%91 = getelementptr inbounds i8*, i8** %90, i64 2
%92 = load i8*, i8** %91
%93 = load i32, i32* %7
%94 = call double @component(i8* %89, i8* %92, i32 %93)
%95 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 2
store double %94, double* %95
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
br label %98
98: ; preds = %73, %88
%99 = load i8*, i8** %6
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 1
%102 = load i8*, i8** %101
%103 = load i32, i32* %7
%104 = call double @component(i8* %99, i8* %102, i32 %103)
%105 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
store double %104, double* %105
%106 = load i32, i32* %10
%107 = add nsw i32 %106, 1
store i32 %107, i32* %10
br label %108
108: ; preds = %73, %98
%109 = load i8*, i8** %6
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 0
%112 = load i8*, i8** %111
%113 = load i32, i32* %7
%114 = call double @component(i8* %109, i8* %112, i32 %113)
%115 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
store double %114, double* %115
%116 = load i32, i32* %10
%117 = add nsw i32 %116, 1
store i32 %117, i32* %10
br label %118
118: ; preds = %108, %75
%119 = load i32, i32* %7
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %161
121: ; preds = %118
%122 = load i32, i32* %10
store i32 %122, i32* %14
%123 = load i32, i32* %14
%124 = and i32 %123, 1
%125 = icmp eq i32 %124, 0
br i1 %125, label %126, label %129
126: ; preds = %121
%127 = load i32, i32* %14
%128 = add nsw i32 %127, -1
store i32 %128, i32* %14
br label %129
129: ; preds = %126, %121
store i32 0, i32* %13
br label %130
130: ; preds = %144, %129
%131 = load i32, i32* %13
%132 = load i32, i32* %14
%133 = icmp slt i32 %131, %132
br i1 %133, label %134, label %147
134: ; preds = %130
%135 = load i32, i32* %13
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %136
%138 = load double, double* %137
%139 = fdiv double %138, 2.550000e+02
%140 = call double @linear_from_sRGB(double %139)
%141 = load i32, i32* %13
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %142
store double %140, double* %143
br label %144
144: ; preds = %134
%145 = load i32, i32* %13
%146 = add nsw i32 %145, 1
store i32 %146, i32* %13
br label %130
147: ; preds = %130
%148 = load i32, i32* %14
%149 = load i32, i32* %10
%150 = icmp slt i32 %148, %149
br i1 %150, label %151, label %160
151: ; preds = %147
%152 = load i32, i32* %14
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %153
%155 = load double, double* %154
%156 = fdiv double %155, 2.550000e+02
%157 = load i32, i32* %14
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %158
store double %156, double* %159
br label %160
160: ; preds = %151, %147
br label %219
161: ; preds = %118
store i32 0, i32* %15
br label %162
162: ; preds = %171, %161
%163 = load i32, i32* %15
%164 = icmp slt i32 %163, 4
br i1 %164, label %165, label %174
165: ; preds = %162
%166 = load i32, i32* %15
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %167
%169 = load double, double* %168
%170 = fdiv double %169, 6.553500e+04
store double %170, double* %168
br label %171
171: ; preds = %165
%172 = load i32, i32* %15
%173 = add nsw i32 %172, 1
store i32 %173, i32* %15
br label %162
174: ; preds = %162
%175 = load i32, i32* %10
%176 = and i32 %175, 1
%177 = icmp eq i32 %176, 0
br i1 %177, label %178, label %218
178: ; preds = %174
%179 = load i32, i32* %10
%180 = sub nsw i32 %179, 1
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %181
%183 = load double, double* %182
store double %183, double* %16
%184 = load double, double* %16
%185 = fcmp ogt double %184, 0.000000e+00
br i1 %185, label %186, label %203
186: ; preds = %178
store i32 0, i32* %15
br label %187
187: ; preds = %199, %186
%188 = load i32, i32* %15
%189 = load i32, i32* %10
%190 = sub nsw i32 %189, 1
%191 = icmp slt i32 %188, %190
br i1 %191, label %192, label %202
192: ; preds = %187
%193 = load double, double* %16
%194 = load i32, i32* %15
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %195
%197 = load double, double* %196
%198 = fdiv double %197, %193
store double %198, double* %196
br label %199
199: ; preds = %192
%200 = load i32, i32* %15
%201 = add nsw i32 %200, 1
store i32 %201, i32* %15
br label %187
202: ; preds = %187
br label %217
203: ; preds = %178
store i32 0, i32* %15
br label %204
204: ; preds = %213, %203
%205 = load i32, i32* %15
%206 = load i32, i32* %10
%207 = sub nsw i32 %206, 1
%208 = icmp slt i32 %205, %207
br i1 %208, label %209, label %216
209: ; preds = %204
%210 = load i32, i32* %15
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %211
store double 1.000000e+00, double* %212
br label %213
213: ; preds = %209
%214 = load i32, i32* %15
%215 = add nsw i32 %214, 1
store i32 %215, i32* %15
br label %204
216: ; preds = %204
br label %217
217: ; preds = %216, %202
br label %218
218: ; preds = %217, %174
br label %219
219: ; preds = %218, %160
%220 = load i32, i32* %8
%221 = icmp ne i32 %220, 0
br i1 %221, label %222, label %243
222: ; preds = %219
%223 = load i32, i32* %10
%224 = icmp slt i32 %223, 3
br i1 %224, label %225, label %232
225: ; preds = %222
%226 = load i32, i32* @stderr
%227 = load i8*, i8** %6
%228 = load i32, i32* %10
%229 = call i32 @fprintf(i32 %226, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %227, i32 %228)
%230 = load i8*, i8** %6
%231 = call i32 @usage(i8* %230)
br label %232
232: ; preds = %225, %222
%233 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%234 = load double, double* %233
%235 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%236 = load double, double* %235
%237 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 2
%238 = load double, double* %237
%239 = call double @YfromRGB(double %234, double %236, double %238)
%240 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
store double %239, double* %240
%241 = load i32, i32* %10
%242 = sub nsw i32 %241, 2
store i32 %242, i32* %10
br label %243
243: ; preds = %232, %219
%244 = load i32, i32* %9
%245 = icmp ne i32 %244, 0
br i1 %245, label %246, label %264
246: ; preds = %243
%247 = load i32, i32* %10
%248 = icmp sgt i32 %247, 2
br i1 %248, label %249, label %256
249: ; preds = %246
%250 = load i32, i32* @stderr
%251 = load i8*, i8** %6
%252 = load i32, i32* %10
%253 = call i32 @fprintf(i32 %250, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %251, i32 %252)
%254 = load i8*, i8** %6
%255 = call i32 @usage(i8* %254)
br label %256
256: ; preds = %249, %246
%257 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%258 = load double, double* %257
%259 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 3
store double %258, double* %259
%260 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%261 = load double, double* %260
%262 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
store double %261, double* %262
%263 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 2
store double %261, double* %263
br label %264
264: ; preds = %256, %243
%265 = load i32, i32* %7
%266 = icmp ne i32 %265, 0
br i1 %266, label %267, label %312
267: ; preds = %264
%268 = load i32, i32* %10
%269 = and i32 %268, 1
%270 = icmp eq i32 %269, 0
br i1 %270, label %271, label %293
271: ; preds = %267
%272 = load i32, i32* %10
%273 = sub nsw i32 %272, 1
%274 = sext i32 %273 to i64
%275 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %274
%276 = load double, double* %275
store double %276, double* %18
store i32 0, i32* %17
br label %277
277: ; preds = %289, %271
%278 = load i32, i32* %17
%279 = load i32, i32* %10
%280 = sub nsw i32 %279, 1
%281 = icmp slt i32 %278, %280
br i1 %281, label %282, label %292
282: ; preds = %277
%283 = load double, double* %18
%284 = load i32, i32* %17
%285 = sext i32 %284 to i64
%286 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %285
%287 = load double, double* %286
%288 = fmul double %287, %283
store double %288, double* %286
br label %289
289: ; preds = %282
%290 = load i32, i32* %17
%291 = add nsw i32 %290, 1
store i32 %291, i32* %17
br label %277
292: ; preds = %277
br label %293
293: ; preds = %292, %267
store i32 0, i32* %17
br label %294
294: ; preds = %308, %293
%295 = load i32, i32* %17
%296 = load i32, i32* %10
%297 = icmp slt i32 %295, %296
br i1 %297, label %298, label %311
298: ; preds = %294
%299 = load i32, i32* %17
%300 = sext i32 %299 to i64
%301 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %300
%302 = load double, double* %301
%303 = fmul double %302, 6.553500e+04
%304 = call double @llvm.nearbyint.f64(double %303)
%305 = load i32, i32* %17
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %306
store double %304, double* %307
br label %308
308: ; preds = %298
%309 = load i32, i32* %17
%310 = add nsw i32 %309, 1
store i32 %310, i32* %17
br label %294
311: ; preds = %294
br label %348
312: ; preds = %264
%313 = load i32, i32* %10
%314 = add nsw i32 %313, 1
%315 = and i32 %314, -2
store i32 %315, i32* %19
br label %316
316: ; preds = %320, %312
%317 = load i32, i32* %19
%318 = add nsw i32 %317, -1
store i32 %318, i32* %19
%319 = icmp sge i32 %318, 0
br i1 %319, label %320, label %329
320: ; preds = %316
%321 = load i32, i32* %19
%322 = sext i32 %321 to i64
%323 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %322
%324 = load double, double* %323
%325 = call double @sRGB_from_linear(double %324)
%326 = load i32, i32* %19
%327 = sext i32 %326 to i64
%328 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %327
store double %325, double* %328
br label %316
329: ; preds = %316
store i32 0, i32* %19
br label %330
330: ; preds = %344, %329
%331 = load i32, i32* %19
%332 = load i32, i32* %10
%333 = icmp slt i32 %331, %332
br i1 %333, label %334, label %347
334: ; preds = %330
%335 = load i32, i32* %19
%336 = sext i32 %335 to i64
%337 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %336
%338 = load double, double* %337
%339 = fmul double %338, 2.550000e+02
%340 = call double @llvm.nearbyint.f64(double %339)
%341 = load i32, i32* %19
%342 = sext i32 %341 to i64
%343 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %342
store double %340, double* %343
br label %344
344: ; preds = %334
%345 = load i32, i32* %19
%346 = add nsw i32 %345, 1
store i32 %346, i32* %19
br label %330
347: ; preds = %330
br label %348
348: ; preds = %347, %311
store i32 0, i32* %20
br label %349
349: ; preds = %359, %348
%350 = load i32, i32* %20
%351 = load i32, i32* %10
%352 = icmp slt i32 %350, %351
br i1 %352, label %353, label %362
353: ; preds = %349
%354 = load i32, i32* %20
%355 = sext i32 %354 to i64
%356 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 %355
%357 = load double, double* %356
%358 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), double %357)
br label %359
359: ; preds = %353
%360 = load i32, i32* %20
%361 = add nsw i32 %360, 1
store i32 %361, i32* %20
br label %349
362: ; preds = %349
%363 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@FE_TONEAREST = global i32 0
@.str = [5 x i8] c"sRGB\00"
@.str.1 = [7 x i8] c"linear\00"
@.str.2 = [5 x i8] c"gray\00"
@.str.3 = [6 x i8] c"color\00"
@stderr = global i32 0
@.str.4 = [37 x i8] c"%s: too few channels (%d) for -gray\0A\00"
@.str.5 = [39 x i8] c"%s: too many channels (%d) for -color\0A\00"
@.str.6 = [4 x i8] c" %g\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [4 x double]
%4 = load i8*, i8** %1
%5 = bitcast [4 x double]* %3 to i8*
%6 = load i32, i32* @FE_TONEAREST
%7 = tail call i32 @fesetround(i32 %6)
%8 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%9 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
%10 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%11 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 3
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = icmp sgt i32 %0, 1
%14 = bitcast [4 x double]* %3 to i8*
br i1 %13, label %15, label %51
15: ; preds = %2
%16 = load i8*, i8** %12
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 45
br i1 %18, label %23, label %51
19: ; preds = %45
%20 = load i8*, i8** %49
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 45
br i1 %22, label %23, label %51
23: ; preds = %15, %19
%24 = phi i8* [ %20, %19 ], [ %16, %15 ]
%25 = phi i32 [ %46, %19 ], [ 0, %15 ]
%26 = phi i32 [ %47, %19 ], [ 0, %15 ]
%27 = phi i32 [ %48, %19 ], [ 0, %15 ]
%28 = phi i32 [ %30, %19 ], [ %0, %15 ]
%29 = phi i8** [ %49, %19 ], [ %12, %15 ]
%30 = add nsw i32 %28, -1
%31 = getelementptr inbounds i8, i8* %24, i64 1
%32 = tail call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%33 = icmp eq i64 %32, 0
br i1 %33, label %45, label %34
34: ; preds = %23
%35 = tail call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%36 = icmp eq i64 %35, 0
br i1 %36, label %45, label %37
37: ; preds = %34
%38 = tail call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%39 = icmp eq i64 %38, 0
br i1 %39, label %45, label %40
40: ; preds = %37
%41 = tail call i64 @strcmp(i8* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%42 = icmp eq i64 %41, 0
br i1 %42, label %45, label %43
43: ; preds = %40
%44 = tail call i32 @usage(i8* %4)
br label %45
45: ; preds = %40, %37, %34, %23, %43
%46 = phi i32 [ %25, %43 ], [ %25, %23 ], [ %25, %34 ], [ 1, %37 ], [ 0, %40 ]
%47 = phi i32 [ %26, %43 ], [ %26, %23 ], [ %26, %34 ], [ 0, %37 ], [ 1, %40 ]
%48 = phi i32 [ %27, %43 ], [ 0, %23 ], [ 1, %34 ], [ %27, %37 ], [ %27, %40 ]
%49 = getelementptr inbounds i8*, i8** %29, i64 1
%50 = icmp ugt i32 %28, 2
br i1 %50, label %19, label %58
51: ; preds = %19, %15, %2
%52 = phi i32 [ 0, %2 ], [ 0, %15 ], [ %46, %19 ]
%53 = phi i32 [ 0, %2 ], [ 0, %15 ], [ %47, %19 ]
%54 = phi i32 [ 0, %2 ], [ 0, %15 ], [ %48, %19 ]
%55 = phi i8** [ %1, %2 ], [ %1, %15 ], [ %29, %19 ]
%56 = phi i32 [ %0, %2 ], [ %0, %15 ], [ %30, %19 ]
%57 = phi i8** [ %12, %2 ], [ %12, %15 ], [ %49, %19 ]
switch i32 %56, label %58 [
i32 5, label %63
i32 4, label %67
i32 3, label %75
i32 2, label %82
]
58: ; preds = %45, %51
%59 = phi i32 [ %54, %51 ], [ %48, %45 ]
%60 = phi i32 [ %53, %51 ], [ %47, %45 ]
%61 = phi i32 [ %52, %51 ], [ %46, %45 ]
%62 = tail call i32 @usage(i8* %4)
br label %91
63: ; preds = %51
%64 = getelementptr inbounds i8*, i8** %55, i64 4
%65 = load i8*, i8** %64
%66 = tail call double @component(i8* %4, i8* %65, i32 %54)
store double %66, double* %11
br label %67
67: ; preds = %51, %63
%68 = phi double [ 0.000000e+00, %51 ], [ %66, %63 ]
%69 = phi i32 [ 1, %51 ], [ 2, %63 ]
%70 = getelementptr inbounds i8*, i8** %55, i64 3
%71 = load i8*, i8** %70
%72 = tail call double @component(i8* %4, i8* %71, i32 %54)
store double %72, double* %10
%73 = insertelement <2 x double> poison, double %72, i64 0
%74 = insertelement <2 x double> %73, double %68, i64 1
br label %75
75: ; preds = %51, %67
%76 = phi i32 [ 0, %51 ], [ %69, %67 ]
%77 = phi <2 x double> [ zeroinitializer, %51 ], [ %74, %67 ]
%78 = getelementptr inbounds i8*, i8** %55, i64 2
%79 = load i8*, i8** %78
%80 = tail call double @component(i8* %4, i8* %79, i32 %54)
store double %80, double* %9
%81 = add nuw nsw i32 %76, 1
br label %82
82: ; preds = %51, %75
%83 = phi double [ 0.000000e+00, %51 ], [ %80, %75 ]
%84 = phi i32 [ 0, %51 ], [ %81, %75 ]
%85 = phi <2 x double> [ zeroinitializer, %51 ], [ %77, %75 ]
%86 = load i8*, i8** %57
%87 = tail call double @component(i8* %4, i8* %86, i32 %54)
store double %87, double* %8
%88 = add nuw nsw i32 %84, 1
%89 = insertelement <2 x double> poison, double %87, i64 0
%90 = insertelement <2 x double> %89, double %83, i64 1
br label %91
91: ; preds = %82, %58
%92 = phi i32 [ %59, %58 ], [ %54, %82 ]
%93 = phi i32 [ %60, %58 ], [ %53, %82 ]
%94 = phi i32 [ %61, %58 ], [ %52, %82 ]
%95 = phi i32 [ 0, %58 ], [ %88, %82 ]
%96 = phi <2 x double> [ zeroinitializer, %58 ], [ %90, %82 ]
%97 = phi <2 x double> [ zeroinitializer, %58 ], [ %85, %82 ]
%98 = icmp eq i32 %92, 0
br i1 %98, label %99, label %106
99: ; preds = %91
%100 = fdiv <2 x double> %96, <double 6.553500e+04, double 6.553500e+04>
%101 = bitcast [4 x double]* %3 to <2 x double>*
store <2 x double> %100, <2 x double>* %101
%102 = fdiv <2 x double> %97, <double 6.553500e+04, double 6.553500e+04>
%103 = bitcast double* %10 to <2 x double>*
store <2 x double> %102, <2 x double>* %103
%104 = and i32 %95, 1
%105 = icmp eq i32 %104, 0
br i1 %105, label %134, label %212
106: ; preds = %91
%107 = and i32 %95, 1
%108 = icmp eq i32 %107, 0
%109 = sext i1 %108 to i32
%110 = add nsw i32 %95, %109
%111 = icmp sgt i32 %110, 0
br i1 %111, label %112, label %128
112: ; preds = %106
%113 = zext i32 %110 to i64
%114 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%115 = extractelement <2 x double> %96, i64 0
%116 = fdiv double %115, 2.550000e+02
%117 = tail call double @linear_from_sRGB(double %116)
store double %117, double* %114
%118 = icmp eq i32 %110, 1
br i1 %118, label %128, label %119
119: ; preds = %112, %119
%120 = phi i64 [ %126, %119 ], [ 1, %112 ]
%121 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %120
%122 = load double, double* %121
%123 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %120
%124 = fdiv double %122, 2.550000e+02
%125 = tail call double @linear_from_sRGB(double %124)
store double %125, double* %123
%126 = add nuw nsw i64 %120, 1
%127 = icmp eq i64 %126, %113
br i1 %127, label %128, label %119
128: ; preds = %119, %112, %106
br i1 %108, label %129, label %212
129: ; preds = %128
%130 = sext i32 %110 to i64
%131 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %130
%132 = load double, double* %131
%133 = fdiv double %132, 2.550000e+02
store double %133, double* %131
br label %212
134: ; preds = %99
%135 = add nsw i32 %95, -1
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %136
%138 = load double, double* %137
%139 = fcmp ogt double %138, 0.000000e+00
%140 = icmp ugt i32 %95, 1
br i1 %139, label %142, label %141
141: ; preds = %134
br i1 %140, label %204, label %212
142: ; preds = %134
br i1 %140, label %143, label %212
143: ; preds = %142
%144 = zext i32 %135 to i64
%145 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%146 = extractelement <2 x double> %100, i64 0
%147 = fdiv double %146, %138
store double %147, double* %145
%148 = icmp eq i32 %135, 1
br i1 %148, label %212, label %149
149: ; preds = %143
%150 = add nsw i64 %144, -1
%151 = icmp ult i64 %150, 2
br i1 %151, label %194, label %152
152: ; preds = %149
%153 = and i64 %150, -2
%154 = or i64 %150, 1
%155 = insertelement <2 x double> poison, double %138, i64 0
%156 = shufflevector <2 x double> %155, <2 x double> poison, <2 x i32> zeroinitializer
%157 = add nsw i64 %153, -2
%158 = lshr exact i64 %157, 1
%159 = add nuw i64 %158, 1
%160 = and i64 %159, 1
%161 = icmp eq i64 %157, 0
br i1 %161, label %182, label %162
162: ; preds = %152
%163 = and i64 %159, -2
br label %164
164: ; preds = %164, %162
%165 = phi i64 [ 0, %162 ], [ %179, %164 ]
%166 = phi i64 [ 0, %162 ], [ %180, %164 ]
%167 = or i64 %165, 1
%168 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %167
%169 = bitcast double* %168 to <2 x double>*
%170 = load <2 x double>, <2 x double>* %169
%171 = fdiv <2 x double> %170, %156
%172 = bitcast double* %168 to <2 x double>*
store <2 x double> %171, <2 x double>* %172
%173 = or i64 %165, 3
%174 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %173
%175 = bitcast double* %174 to <2 x double>*
%176 = load <2 x double>, <2 x double>* %175
%177 = fdiv <2 x double> %176, %156
%178 = bitcast double* %174 to <2 x double>*
store <2 x double> %177, <2 x double>* %178
%179 = add nuw i64 %165, 4
%180 = add nuw i64 %166, 2
%181 = icmp eq i64 %180, %163
br i1 %181, label %182, label %164
182: ; preds = %164, %152
%183 = phi i64 [ 0, %152 ], [ %179, %164 ]
%184 = icmp eq i64 %160, 0
br i1 %184, label %192, label %185
185: ; preds = %182
%186 = or i64 %183, 1
%187 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %186
%188 = bitcast double* %187 to <2 x double>*
%189 = load <2 x double>, <2 x double>* %188
%190 = fdiv <2 x double> %189, %156
%191 = bitcast double* %187 to <2 x double>*
store <2 x double> %190, <2 x double>* %191
br label %192
192: ; preds = %182, %185
%193 = icmp eq i64 %150, %153
br i1 %193, label %212, label %194
194: ; preds = %149, %192
%195 = phi i64 [ 1, %149 ], [ %154, %192 ]
br label %196
196: ; preds = %194, %196
%197 = phi i64 [ %202, %196 ], [ %195, %194 ]
%198 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %197
%199 = load double, double* %198
%200 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %197
%201 = fdiv double %199, %138
store double %201, double* %200
%202 = add nuw nsw i64 %197, 1
%203 = icmp eq i64 %202, %144
br i1 %203, label %212, label %196
204: ; preds = %141
%205 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
store double 1.000000e+00, double* %205
%206 = icmp eq i32 %135, 1
br i1 %206, label %212, label %207
207: ; preds = %204
%208 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
store double 1.000000e+00, double* %208
%209 = icmp eq i32 %135, 2
br i1 %209, label %212, label %210
210: ; preds = %207
%211 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
store double 1.000000e+00, double* %211
br label %212
212: ; preds = %204, %207, %210, %196, %143, %192, %141, %142, %99, %128, %129
%213 = icmp eq i32 %94, 0
br i1 %213, label %226, label %214
214: ; preds = %212
%215 = icmp slt i32 %95, 3
br i1 %215, label %216, label %220
216: ; preds = %214
%217 = load i32, i32* @stderr
%218 = tail call i32 @fprintf(i32 %217, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0), i8* %4, i32 %95)
%219 = tail call i32 @usage(i8* %4)
br label %220
220: ; preds = %216, %214
%221 = load double, double* %8
%222 = load double, double* %9
%223 = load double, double* %10
%224 = tail call double @YfromRGB(double %221, double %222, double %223)
store double %224, double* %8
%225 = add nsw i32 %95, -2
br label %226
226: ; preds = %220, %212
%227 = phi i32 [ %225, %220 ], [ %95, %212 ]
%228 = icmp eq i32 %93, 0
br i1 %228, label %240, label %229
229: ; preds = %226
%230 = icmp sgt i32 %227, 2
br i1 %230, label %231, label %235
231: ; preds = %229
%232 = load i32, i32* @stderr
%233 = tail call i32 @fprintf(i32 %232, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i8* %4, i32 %227)
%234 = tail call i32 @usage(i8* %4)
br label %235
235: ; preds = %231, %229
%236 = bitcast [4 x double]* %3 to <2 x double>*
%237 = load <2 x double>, <2 x double>* %236
%238 = extractelement <2 x double> %237, i64 0
store double %238, double* %9
%239 = bitcast double* %10 to <2 x double>*
store <2 x double> %237, <2 x double>* %239
br label %240
240: ; preds = %235, %226
br i1 %98, label %343, label %241
241: ; preds = %240
%242 = and i32 %227, 1
%243 = icmp eq i32 %242, 0
br i1 %243, label %244, label %318
244: ; preds = %241
%245 = add nsw i32 %227, -1
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %246
%248 = load double, double* %247
%249 = icmp sgt i32 %227, 1
br i1 %249, label %250, label %318
250: ; preds = %244
%251 = zext i32 %245 to i64
%252 = icmp ult i32 %245, 4
br i1 %252, label %309, label %253
253: ; preds = %250
%254 = and i64 %251, 4294967292
%255 = insertelement <2 x double> poison, double %248, i64 0
%256 = shufflevector <2 x double> %255, <2 x double> poison, <2 x i32> zeroinitializer
%257 = insertelement <2 x double> poison, double %248, i64 0
%258 = shufflevector <2 x double> %257, <2 x double> poison, <2 x i32> zeroinitializer
%259 = add nsw i64 %254, -4
%260 = lshr exact i64 %259, 2
%261 = add nuw nsw i64 %260, 1
%262 = and i64 %261, 1
%263 = icmp eq i64 %259, 0
br i1 %263, label %293, label %264
264: ; preds = %253
%265 = and i64 %261, 9223372036854775806
br label %266
266: ; preds = %266, %264
%267 = phi i64 [ 0, %264 ], [ %290, %266 ]
%268 = phi i64 [ 0, %264 ], [ %291, %266 ]
%269 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %267
%270 = bitcast double* %269 to <2 x double>*
%271 = load <2 x double>, <2 x double>* %270
%272 = getelementptr inbounds double, double* %269, i64 2
%273 = bitcast double* %272 to <2 x double>*
%274 = load <2 x double>, <2 x double>* %273
%275 = fmul <2 x double> %256, %271
%276 = fmul <2 x double> %258, %274
%277 = bitcast double* %269 to <2 x double>*
store <2 x double> %275, <2 x double>* %277
%278 = bitcast double* %272 to <2 x double>*
store <2 x double> %276, <2 x double>* %278
%279 = or i64 %267, 4
%280 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %279
%281 = bitcast double* %280 to <2 x double>*
%282 = load <2 x double>, <2 x double>* %281
%283 = getelementptr inbounds double, double* %280, i64 2
%284 = bitcast double* %283 to <2 x double>*
%285 = load <2 x double>, <2 x double>* %284
%286 = fmul <2 x double> %256, %282
%287 = fmul <2 x double> %258, %285
%288 = bitcast double* %280 to <2 x double>*
store <2 x double> %286, <2 x double>* %288
%289 = bitcast double* %283 to <2 x double>*
store <2 x double> %287, <2 x double>* %289
%290 = add nuw i64 %267, 8
%291 = add i64 %268, 2
%292 = icmp eq i64 %291, %265
br i1 %292, label %293, label %266
293: ; preds = %266, %253
%294 = phi i64 [ 0, %253 ], [ %290, %266 ]
%295 = icmp eq i64 %262, 0
br i1 %295, label %307, label %296
296: ; preds = %293
%297 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %294
%298 = bitcast double* %297 to <2 x double>*
%299 = load <2 x double>, <2 x double>* %298
%300 = getelementptr inbounds double, double* %297, i64 2
%301 = bitcast double* %300 to <2 x double>*
%302 = load <2 x double>, <2 x double>* %301
%303 = fmul <2 x double> %256, %299
%304 = fmul <2 x double> %258, %302
%305 = bitcast double* %297 to <2 x double>*
store <2 x double> %303, <2 x double>* %305
%306 = bitcast double* %300 to <2 x double>*
store <2 x double> %304, <2 x double>* %306
br label %307
307: ; preds = %293, %296
%308 = icmp eq i64 %254, %251
br i1 %308, label %318, label %309
309: ; preds = %250, %307
%310 = phi i64 [ 0, %250 ], [ %254, %307 ]
br label %311
311: ; preds = %309, %311
%312 = phi i64 [ %316, %311 ], [ %310, %309 ]
%313 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %312
%314 = load double, double* %313
%315 = fmul double %248, %314
store double %315, double* %313
%316 = add nuw nsw i64 %312, 1
%317 = icmp eq i64 %316, %251
br i1 %317, label %318, label %311
318: ; preds = %311, %307, %244, %241
%319 = icmp sgt i32 %227, 0
br i1 %319, label %320, label %396
320: ; preds = %318
%321 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%322 = load double, double* %321
%323 = fmul double %322, 6.553500e+04
%324 = tail call double @llvm.nearbyint.f64(double %323)
store double %324, double* %321
%325 = icmp eq i32 %227, 1
br i1 %325, label %385, label %326
326: ; preds = %320
%327 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
%328 = load double, double* %327
%329 = fmul double %328, 6.553500e+04
%330 = tail call double @llvm.nearbyint.f64(double %329)
store double %330, double* %327
%331 = icmp eq i32 %227, 2
br i1 %331, label %385, label %332
332: ; preds = %326
%333 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%334 = load double, double* %333
%335 = fmul double %334, 6.553500e+04
%336 = tail call double @llvm.nearbyint.f64(double %335)
store double %336, double* %333
%337 = icmp eq i32 %227, 3
br i1 %337, label %385, label %338
338: ; preds = %332
%339 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 3
%340 = load double, double* %339
%341 = fmul double %340, 6.553500e+04
%342 = tail call double @llvm.nearbyint.f64(double %341)
store double %342, double* %339
br label %385
343: ; preds = %240
%344 = add i32 %227, 1
%345 = and i32 %344, -2
%346 = icmp sgt i32 %345, 0
br i1 %346, label %347, label %350
347: ; preds = %343
%348 = and i32 %344, -2
%349 = zext i32 %348 to i64
br label %352
350: ; preds = %352, %343
%351 = icmp sgt i32 %227, 0
br i1 %351, label %362, label %396
352: ; preds = %347, %352
%353 = phi i64 [ %349, %347 ], [ %361, %352 ]
%354 = phi i32 [ %345, %347 ], [ %355, %352 ]
%355 = add nsw i32 %354, -1
%356 = zext i32 %355 to i64
%357 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %356
%358 = load double, double* %357
%359 = tail call double @sRGB_from_linear(double %358)
store double %359, double* %357
%360 = icmp ugt i64 %353, 1
%361 = add nsw i64 %353, -1
br i1 %360, label %352, label %350
362: ; preds = %350
%363 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 0
%364 = load double, double* %363
%365 = fmul double %364, 2.550000e+02
%366 = tail call double @llvm.nearbyint.f64(double %365)
store double %366, double* %363
%367 = icmp eq i32 %227, 1
br i1 %367, label %385, label %368
368: ; preds = %362
%369 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 1
%370 = load double, double* %369
%371 = fmul double %370, 2.550000e+02
%372 = tail call double @llvm.nearbyint.f64(double %371)
store double %372, double* %369
%373 = icmp eq i32 %227, 2
br i1 %373, label %385, label %374
374: ; preds = %368
%375 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 2
%376 = load double, double* %375
%377 = fmul double %376, 2.550000e+02
%378 = tail call double @llvm.nearbyint.f64(double %377)
store double %378, double* %375
%379 = icmp eq i32 %227, 3
br i1 %379, label %385, label %380
380: ; preds = %374
%381 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 3
%382 = load double, double* %381
%383 = fmul double %382, 2.550000e+02
%384 = tail call double @llvm.nearbyint.f64(double %383)
store double %384, double* %381
br label %385
385: ; preds = %320, %326, %332, %338, %362, %368, %374, %380
%386 = icmp sgt i32 %227, 0
br i1 %386, label %387, label %396
387: ; preds = %385
%388 = zext i32 %227 to i64
br label %389
389: ; preds = %387, %389
%390 = phi i64 [ 0, %387 ], [ %394, %389 ]
%391 = getelementptr inbounds [4 x double], [4 x double]* %3, i64 0, i64 %390
%392 = load double, double* %391
%393 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), double %392)
%394 = add nuw nsw i64 %390, 1
%395 = icmp eq i64 %394, %388
br i1 %395, label %396, label %389
396: ; preds = %389, %350, %318, %385
%397 = tail call i32 @putchar(i32 10)
ret i32 0
}