#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char EOF;
int /*<<< orphan*/ SEEK_CUR;
int /*<<< orphan*/ fabsf(int);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
char getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ mod2(float);
int /*<<< orphan*/ printf(char *, ...);
unsigned int rnint(int);
int main(int argc, char *argv[]) {
  FILE *fp;
  char ch;
  unsigned r, g, b;
  float h, s, l, v, c, m, y, k;
  if (argc != 2) {
    printf("Usage: %s [FILE]\n", argv[0]);
    return 1;
  }
  fp = fopen(*++argv, "r");
  while ((ch = getc(fp)) != EOF) {
    r = 0;
    g = 0;
    b = 0;
    switch (ch) {
    case 'H':
      fseek(fp, 1, SEEK_CUR);
      ch = getc(fp);
      if (ch == 'L') {
        fscanf(fp, "(%f,%f,%f)%*c", &h, &s, &l);
        s /= 100;
        l /= 100;
        c = (1 - fabsf(2 * l - 1)) * s;
        m = l - c / 2;
      } else {
        fscanf(fp, "(%f,%f,%f)%*c", &h, &s, &v);
        s /= 100;
        v /= 100;
        c = v * s;
        m = v - c;
      }
      h /= 60;
      y = c * (1 - fabsf(mod2(h) - 1));
      if (h < 1) {
        r = rnint(c + m);
        g = rnint(y + m);
        b = rnint(m);
      } else if (h < 2) {
        r = rnint(y + m);
        g = rnint(c + m);
        b = rnint(m);
      } else if (h < 3) {
        r = rnint(m);
        g = rnint(c + m);
        b = rnint(y + m);
      } else if (h < 4) {
        r = rnint(m);
        g = rnint(y + m);
        b = rnint(c + m);
      } else if (h < 5) {
        r = rnint(y + m);
        g = rnint(m);
        b = rnint(c + m);
      } else if (h < 6) {
        r = rnint(c + m);
        g = rnint(m);
        b = rnint(y + m);
      }
      break;
    case '(':
      fscanf(fp, "%f,%f,%f,%f)%*c", &c, &m, &y, &k);
      r = rnint((1 - c) * (1 - k));
      g = rnint((1 - m) * (1 - k));
      b = rnint((1 - y) * (1 - k));
      break;
    case '#':
      fscanf(fp, "%02x%02x%02x%*c", &r, &g, &b);
    }
    printf("RGB(%u,%u,%u)\n", r, g, b);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11c1 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    16ba <main+0x53a>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
lea    0xe5b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   10a0 <getc@plt>
mov    %al,-0x19(%rbp)
movsbl %al,%eax
mov    0x2de6(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     16b3 <main+0x533>
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movsbl -0x19(%rbp),%eax
mov    %eax,-0x4c(%rbp)
sub    $0x23,%eax
je     1679 <main+0x4f9>
jmp    122f <main+0xaf>
mov    -0x4c(%rbp),%eax
sub    $0x28,%eax
je     15d4 <main+0x454>
jmp    1240 <main+0xc0>
mov    -0x4c(%rbp),%eax
sub    $0x48,%eax
jne    1697 <main+0x517>
jmp    1251 <main+0xd1>
mov    -0x18(%rbp),%rdi
mov    0x2d8c(%rip),%rax
mov    (%rax),%edx
mov    $0x1,%esi
call   1080 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   10a0 <getc@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x4c,%eax
jne    1324 <main+0x1a4>
mov    -0x18(%rbp),%rdi
lea    0xdac(%rip),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x34(%rbp),%r8
mov    $0x0,%al
call   1070 <fscanf@plt>
movss  -0x30(%rbp),%xmm0
movss  0xd58(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x34(%rbp),%xmm0
movss  0xd42(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
addss  %xmm0,%xmm0
movss  0xd30(%rip),%xmm1
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1040 <fabsf@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm0
mulss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x34(%rbp),%xmm0
movss  -0x3c(%rbp),%xmm1
movss  0xcf6(%rip),%xmm2
divss  %xmm2,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
jmp    138c <main+0x20c>
mov    -0x18(%rbp),%rdi
lea    0xd09(%rip),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x38(%rbp),%r8
mov    $0x0,%al
call   1070 <fscanf@plt>
movss  -0x30(%rbp),%xmm0
movss  0xcb5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
movss  -0x38(%rbp),%xmm0
movss  0xc9f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm0
mulss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x38(%rbp),%xmm0
subss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  0xc77(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x2c(%rbp),%xmm0
call   1050 <mod2@plt>
mov    %eax,%edi
sub    $0x1,%edi
call   1040 <fabsf@plt>
movss  -0x50(%rbp),%xmm0
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x44(%rbp)
movss  0xc1d(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    142b <main+0x2ab>
movss  -0x3c(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x20(%rbp)
movss  -0x44(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x24(%rbp)
cvttss2si -0x40(%rbp),%edi
call   1030 <rnint@plt>
mov    %eax,-0x28(%rbp)
jmp    15cf <main+0x44f>
movss  0xbd5(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    147b <main+0x2fb>
movss  -0x44(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x20(%rbp)
movss  -0x3c(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x24(%rbp)
cvttss2si -0x40(%rbp),%edi
call   1030 <rnint@plt>
mov    %eax,-0x28(%rbp)
jmp    15ca <main+0x44a>
movss  0xb91(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    14cb <main+0x34b>
cvttss2si -0x40(%rbp),%edi
call   1030 <rnint@plt>
mov    %eax,-0x20(%rbp)
movss  -0x3c(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x24(%rbp)
movss  -0x44(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x28(%rbp)
jmp    15c5 <main+0x445>
movss  0xb45(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    151b <main+0x39b>
cvttss2si -0x40(%rbp),%edi
call   1030 <rnint@plt>
mov    %eax,-0x20(%rbp)
movss  -0x44(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x24(%rbp)
movss  -0x3c(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x28(%rbp)
jmp    15c0 <main+0x440>
movss  0xaf9(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    156b <main+0x3eb>
movss  -0x44(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x20(%rbp)
cvttss2si -0x40(%rbp),%edi
call   1030 <rnint@plt>
mov    %eax,-0x24(%rbp)
movss  -0x3c(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x28(%rbp)
jmp    15bb <main+0x43b>
movss  0xaad(%rip),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    15b6 <main+0x436>
movss  -0x3c(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x20(%rbp)
cvttss2si -0x40(%rbp),%edi
call   1030 <rnint@plt>
mov    %eax,-0x24(%rbp)
movss  -0x44(%rbp),%xmm0
addss  -0x40(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x28(%rbp)
jmp    15bb <main+0x43b>
jmp    15c0 <main+0x440>
jmp    15c5 <main+0x445>
jmp    15ca <main+0x44a>
jmp    15cf <main+0x44f>
jmp    1697 <main+0x517>
mov    -0x18(%rbp),%rdi
lea    0xa67(%rip),%rsi
lea    -0x3c(%rbp),%rdx
lea    -0x40(%rbp),%rcx
lea    -0x44(%rbp),%r8
lea    -0x48(%rbp),%r9
mov    $0x0,%al
call   1070 <fscanf@plt>
movss  0xa02(%rip),%xmm0
subss  -0x3c(%rbp),%xmm0
movss  0x9f5(%rip),%xmm1
subss  -0x48(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x20(%rbp)
movss  0x9d8(%rip),%xmm0
subss  -0x40(%rbp),%xmm0
movss  0x9cb(%rip),%xmm1
subss  -0x48(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x24(%rbp)
movss  0x9ae(%rip),%xmm0
subss  -0x44(%rbp),%xmm0
movss  0x9a1(%rip),%xmm1
subss  -0x48(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,-0x28(%rbp)
jmp    1697 <main+0x517>
mov    -0x18(%rbp),%rdi
lea    0x9d2(%rip),%rsi
lea    -0x20(%rbp),%rdx
lea    -0x24(%rbp),%rcx
lea    -0x28(%rbp),%r8
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%ecx
lea    0x9bf(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11e4 <main+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
cmp    $0x2,%edi
jne    15a3 <main+0x423>
mov    0x8(%rsi),%rdi
lea    0xeb0(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   10a0 <getc@plt>
mov    0x2e27(%rip),%r15
xor    %r14d,%r14d
cmp    (%r15),%al
je     15ba <main+0x43a>
lea    0xeb6(%rip),%rbp
lea    0x28(%rsp),%r12
lea    0x1c(%rsp),%r13
xor    %r14d,%r14d
jmp    1227 <main+0xa7>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xe88(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0xc(%rsp),%r8
xor    %eax,%eax
call   1070 <fscanf@plt>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   10a0 <getc@plt>
cmp    (%r15),%al
je     15ba <main+0x43a>
movsbl %al,%eax
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
cmp    $0x23,%eax
je     11e0 <main+0x60>
cmp    $0x28,%eax
je     1310 <main+0x190>
cmp    $0x48,%eax
jne    1200 <main+0x80>
mov    0x2d8c(%rip),%rax
mov    (%rax),%edx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1080 <fseek@plt>
mov    %rbx,%rdi
call   10a0 <getc@plt>
mov    %rbx,%rdi
lea    0xdd7(%rip),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
cmp    $0x4c,%al
jne    13a9 <main+0x229>
lea    0x24(%rsp),%r8
xor    %eax,%eax
call   1070 <fscanf@plt>
movss  0x1c(%rsp),%xmm0
movss  0xd5f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,0x1c(%rsp)
movss  0x24(%rsp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,0x24(%rsp)
addss  %xmm0,%xmm0
addss  0xd3d(%rip),%xmm0
cvttss2si %xmm0,%edi
call   1040 <fabsf@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
mulss  0x1c(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movaps %xmm0,0x30(%rsp)
mulss  0xd11(%rip),%xmm0
addss  0x24(%rsp),%xmm0
jmp    13f1 <main+0x271>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
lea    0xd48(%rip),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
lea    0x18(%rsp),%r8
lea    0x20(%rsp),%r9
xor    %eax,%eax
call   1070 <fscanf@plt>
movss  0xcc3(%rip),%xmm1
movaps %xmm1,%xmm0
subss  0x8(%rsp),%xmm0
subss  0x20(%rsp),%xmm1
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <rnint@plt>
movss  0xc9f(%rip),%xmm1
movaps %xmm1,%xmm0
subss  0x4(%rsp),%xmm0
subss  0x20(%rsp),%xmm1
mov    %eax,0x14(%rsp)
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
call   1030 <rnint@plt>
movss  0xc77(%rip),%xmm1
movaps %xmm1,%xmm0
subss  0x18(%rsp),%xmm0
subss  0x20(%rsp),%xmm1
mov    %eax,0x10(%rsp)
mulss  %xmm0,%xmm1
cvttss2si %xmm1,%edi
jmp    1560 <main+0x3e0>
lea    0x2c(%rsp),%r8
xor    %eax,%eax
call   1070 <fscanf@plt>
movss  0x2c(%rsp),%xmm0
movss  0x1c(%rsp),%xmm1
unpcklps %xmm0,%xmm1
divps  0xc65(%rip),%xmm1
movss  %xmm1,0x1c(%rsp)
movaps %xmm1,%xmm0
shufps $0x55,%xmm1,%xmm0
movss  %xmm0,0x2c(%rsp)
mulss  %xmm0,%xmm1
movss  %xmm1,0x8(%rsp)
movaps %xmm1,0x30(%rsp)
subss  %xmm1,%xmm0
movss  %xmm0,0x4(%rsp)
movss  0x28(%rsp),%xmm0
divss  0xc0b(%rip),%xmm0
movss  %xmm0,0x28(%rsp)
call   1050 <mod2@plt>
lea    -0x1(%rax),%edi
call   1040 <fabsf@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
mulss  0x30(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
movss  0x28(%rsp),%xmm1
movss  0xbc0(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    1466 <main+0x2e6>
movss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,0x14(%rsp)
movss  0x18(%rsp),%xmm0
jmp    148c <main+0x30c>
movss  0xba6(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    14aa <main+0x32a>
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,0x14(%rsp)
movss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,0x10(%rsp)
cvttss2si 0x4(%rsp),%edi
jmp    1560 <main+0x3e0>
movss  0xb66(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    14e7 <main+0x367>
cvttss2si 0x4(%rsp),%edi
call   1030 <rnint@plt>
mov    %eax,0x14(%rsp)
movss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,0x10(%rsp)
movss  0x18(%rsp),%xmm0
jmp    154a <main+0x3ca>
movss  0xb2d(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    1515 <main+0x395>
cvttss2si 0x4(%rsp),%edi
call   1030 <rnint@plt>
mov    %eax,0x14(%rsp)
movss  0x18(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%edi
jmp    153b <main+0x3bb>
movss  0xb03(%rip),%xmm2
ucomiss %xmm1,%xmm2
jbe    156e <main+0x3ee>
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,0x14(%rsp)
cvttss2si 0x4(%rsp),%edi
call   1030 <rnint@plt>
mov    %eax,0x10(%rsp)
movss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%edi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <rnint@plt>
mov    %eax,0xc(%rsp)
jmp    1200 <main+0x80>
movss  0xaae(%rip),%xmm0
ucomiss %xmm1,%xmm0
jbe    1200 <main+0x80>
movss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1030 <rnint@plt>
mov    %eax,0x14(%rsp)
cvttss2si 0x4(%rsp),%edi
jmp    14d6 <main+0x356>
mov    (%rsi),%rsi
lea    0xa93(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i8 0
@SEEK_CUR = global i32 0
@.str.2 = [14 x i8] c"(%f,%f,%f)%*c\00"
@.str.3 = [16 x i8] c"%f,%f,%f,%f)%*c\00"
@.str.4 = [16 x i8] c"%02x%02x%02x%*c\00"
@.str.5 = [15 x i8] c"RGB(%u,%u,%u)\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 2
br i1 %20, label %21, label %26
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %24)
store i32 1, i32* %3
br label %233
26: ; preds = %2
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i32 1
store i8** %28, i8*** %5
%29 = load i8*, i8** %28
%30 = call i32* @fopen(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %30, i32** %6
br label %31
31: ; preds = %227, %26
%32 = load i32*, i32** %6
%33 = call signext i8 @getc(i32* %32)
store i8 %33, i8* %7
%34 = sext i8 %33 to i32
%35 = load i8, i8* @EOF
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %34, %36
br i1 %37, label %38, label %232
38: ; preds = %31
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%39 = load i8, i8* %7
%40 = sext i8 %39 to i32
switch i32 %40, label %227 [
i32 72, label %41
i32 40, label %200
i32 35, label %224
]
41: ; preds = %38
%42 = load i32*, i32** %6
%43 = load i32, i32* @SEEK_CUR
%44 = call i32 @fseek(i32* %42, i32 1, i32 %43)
%45 = load i32*, i32** %6
%46 = call signext i8 @getc(i32* %45)
store i8 %46, i8* %7
%47 = load i8, i8* %7
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 76
br i1 %49, label %50, label %69
50: ; preds = %41
%51 = load i32*, i32** %6
%52 = call i32 (i32*, i8*, ...) @fscanf(i32* %51, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float* %11, float* %12, float* %13)
%53 = load float, float* %12
%54 = fdiv float %53, 1.000000e+02
store float %54, float* %12
%55 = load float, float* %13
%56 = fdiv float %55, 1.000000e+02
store float %56, float* %13
%57 = load float, float* %13
%58 = call float @llvm.fmuladd.f32(float 2.000000e+00, float %57, float -1.000000e+00)
%59 = fptosi float %58 to i32
%60 = call i32 @fabsf(i32 %59)
%61 = sub nsw i32 1, %60
%62 = sitofp i32 %61 to float
%63 = load float, float* %12
%64 = fmul float %62, %63
store float %64, float* %15
%65 = load float, float* %13
%66 = load float, float* %15
%67 = fdiv float %66, 2.000000e+00
%68 = fsub float %65, %67
store float %68, float* %16
br label %82
69: ; preds = %41
%70 = load i32*, i32** %6
%71 = call i32 (i32*, i8*, ...) @fscanf(i32* %70, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float* %11, float* %12, float* %14)
%72 = load float, float* %12
%73 = fdiv float %72, 1.000000e+02
store float %73, float* %12
%74 = load float, float* %14
%75 = fdiv float %74, 1.000000e+02
store float %75, float* %14
%76 = load float, float* %14
%77 = load float, float* %12
%78 = fmul float %76, %77
store float %78, float* %15
%79 = load float, float* %14
%80 = load float, float* %15
%81 = fsub float %79, %80
store float %81, float* %16
br label %82
82: ; preds = %69, %50
%83 = load float, float* %11
%84 = fdiv float %83, 6.000000e+01
store float %84, float* %11
%85 = load float, float* %15
%86 = load float, float* %11
%87 = call i32 @mod2(float %86)
%88 = sub nsw i32 %87, 1
%89 = call i32 @fabsf(i32 %88)
%90 = sub nsw i32 1, %89
%91 = sitofp i32 %90 to float
%92 = fmul float %85, %91
store float %92, float* %17
%93 = load float, float* %11
%94 = fcmp olt float %93, 1.000000e+00
br i1 %94, label %95, label %109
95: ; preds = %82
%96 = load float, float* %15
%97 = load float, float* %16
%98 = fadd float %96, %97
%99 = fptosi float %98 to i32
%100 = call i32 @rnint(i32 %99)
store i32 %100, i32* %8
%101 = load float, float* %17
%102 = load float, float* %16
%103 = fadd float %101, %102
%104 = fptosi float %103 to i32
%105 = call i32 @rnint(i32 %104)
store i32 %105, i32* %9
%106 = load float, float* %16
%107 = fptosi float %106 to i32
%108 = call i32 @rnint(i32 %107)
store i32 %108, i32* %10
br label %199
109: ; preds = %82
%110 = load float, float* %11
%111 = fcmp olt float %110, 2.000000e+00
br i1 %111, label %112, label %126
112: ; preds = %109
%113 = load float, float* %17
%114 = load float, float* %16
%115 = fadd float %113, %114
%116 = fptosi float %115 to i32
%117 = call i32 @rnint(i32 %116)
store i32 %117, i32* %8
%118 = load float, float* %15
%119 = load float, float* %16
%120 = fadd float %118, %119
%121 = fptosi float %120 to i32
%122 = call i32 @rnint(i32 %121)
store i32 %122, i32* %9
%123 = load float, float* %16
%124 = fptosi float %123 to i32
%125 = call i32 @rnint(i32 %124)
store i32 %125, i32* %10
br label %198
126: ; preds = %109
%127 = load float, float* %11
%128 = fcmp olt float %127, 3.000000e+00
br i1 %128, label %129, label %143
129: ; preds = %126
%130 = load float, float* %16
%131 = fptosi float %130 to i32
%132 = call i32 @rnint(i32 %131)
store i32 %132, i32* %8
%133 = load float, float* %15
%134 = load float, float* %16
%135 = fadd float %133, %134
%136 = fptosi float %135 to i32
%137 = call i32 @rnint(i32 %136)
store i32 %137, i32* %9
%138 = load float, float* %17
%139 = load float, float* %16
%140 = fadd float %138, %139
%141 = fptosi float %140 to i32
%142 = call i32 @rnint(i32 %141)
store i32 %142, i32* %10
br label %197
143: ; preds = %126
%144 = load float, float* %11
%145 = fcmp olt float %144, 4.000000e+00
br i1 %145, label %146, label %160
146: ; preds = %143
%147 = load float, float* %16
%148 = fptosi float %147 to i32
%149 = call i32 @rnint(i32 %148)
store i32 %149, i32* %8
%150 = load float, float* %17
%151 = load float, float* %16
%152 = fadd float %150, %151
%153 = fptosi float %152 to i32
%154 = call i32 @rnint(i32 %153)
store i32 %154, i32* %9
%155 = load float, float* %15
%156 = load float, float* %16
%157 = fadd float %155, %156
%158 = fptosi float %157 to i32
%159 = call i32 @rnint(i32 %158)
store i32 %159, i32* %10
br label %196
160: ; preds = %143
%161 = load float, float* %11
%162 = fcmp olt float %161, 5.000000e+00
br i1 %162, label %163, label %177
163: ; preds = %160
%164 = load float, float* %17
%165 = load float, float* %16
%166 = fadd float %164, %165
%167 = fptosi float %166 to i32
%168 = call i32 @rnint(i32 %167)
store i32 %168, i32* %8
%169 = load float, float* %16
%170 = fptosi float %169 to i32
%171 = call i32 @rnint(i32 %170)
store i32 %171, i32* %9
%172 = load float, float* %15
%173 = load float, float* %16
%174 = fadd float %172, %173
%175 = fptosi float %174 to i32
%176 = call i32 @rnint(i32 %175)
store i32 %176, i32* %10
br label %195
177: ; preds = %160
%178 = load float, float* %11
%179 = fcmp olt float %178, 6.000000e+00
br i1 %179, label %180, label %194
180: ; preds = %177
%181 = load float, float* %15
%182 = load float, float* %16
%183 = fadd float %181, %182
%184 = fptosi float %183 to i32
%185 = call i32 @rnint(i32 %184)
store i32 %185, i32* %8
%186 = load float, float* %16
%187 = fptosi float %186 to i32
%188 = call i32 @rnint(i32 %187)
store i32 %188, i32* %9
%189 = load float, float* %17
%190 = load float, float* %16
%191 = fadd float %189, %190
%192 = fptosi float %191 to i32
%193 = call i32 @rnint(i32 %192)
store i32 %193, i32* %10
br label %194
194: ; preds = %180, %177
br label %195
195: ; preds = %194, %163
br label %196
196: ; preds = %195, %146
br label %197
197: ; preds = %196, %129
br label %198
198: ; preds = %197, %112
br label %199
199: ; preds = %198, %95
br label %227
200: ; preds = %38
%201 = load i32*, i32** %6
%202 = call i32 (i32*, i8*, ...) @fscanf(i32* %201, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), float* %15, float* %16, float* %17, float* %18)
%203 = load float, float* %15
%204 = fsub float 1.000000e+00, %203
%205 = load float, float* %18
%206 = fsub float 1.000000e+00, %205
%207 = fmul float %204, %206
%208 = fptosi float %207 to i32
%209 = call i32 @rnint(i32 %208)
store i32 %209, i32* %8
%210 = load float, float* %16
%211 = fsub float 1.000000e+00, %210
%212 = load float, float* %18
%213 = fsub float 1.000000e+00, %212
%214 = fmul float %211, %213
%215 = fptosi float %214 to i32
%216 = call i32 @rnint(i32 %215)
store i32 %216, i32* %9
%217 = load float, float* %17
%218 = fsub float 1.000000e+00, %217
%219 = load float, float* %18
%220 = fsub float 1.000000e+00, %219
%221 = fmul float %218, %220
%222 = fptosi float %221 to i32
%223 = call i32 @rnint(i32 %222)
store i32 %223, i32* %10
br label %227
224: ; preds = %38
%225 = load i32*, i32** %6
%226 = call i32 (i32*, i8*, ...) @fscanf(i32* %225, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32* %8, i32* %9, i32* %10)
br label %227
227: ; preds = %224, %38, %200, %199
%228 = load i32, i32* %8
%229 = load i32, i32* %9
%230 = load i32, i32* %10
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %228, i32 %229, i32 %230)
br label %31
232: ; preds = %31
store i32 0, i32* %3
br label %233
233: ; preds = %232, %21
%234 = load i32, i32* %3
ret i32 %234
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s [FILE]\0A\00"
@.str.1 = [2 x i8] c"r\00"
@EOF = global i8 0
@SEEK_CUR = global i32 0
@.str.2 = [14 x i8] c"(%f,%f,%f)%*c\00"
@.str.3 = [16 x i8] c"%f,%f,%f,%f)%*c\00"
@.str.4 = [16 x i8] c"%02x%02x%02x%*c\00"
@.str.5 = [15 x i8] c"RGB(%u,%u,%u)\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = bitcast i32* %3 to i8*
%15 = bitcast i32* %4 to i8*
%16 = bitcast i32* %5 to i8*
%17 = bitcast float* %6 to i8*
%18 = bitcast float* %7 to i8*
%19 = bitcast float* %8 to i8*
%20 = bitcast float* %9 to i8*
%21 = bitcast float* %10 to i8*
%22 = bitcast float* %11 to i8*
%23 = bitcast float* %12 to i8*
%24 = bitcast float* %13 to i8*
%25 = icmp eq i32 %0, 2
br i1 %25, label %29, label %26
26: ; preds = %2
%27 = load i8*, i8** %1
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %27)
br label %209
29: ; preds = %2
%30 = getelementptr inbounds i8*, i8** %1, i64 1
%31 = load i8*, i8** %30
%32 = tail call i32* @fopen(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%33 = call signext i8 @getc(i32* %32)
%34 = load i8, i8* @EOF
%35 = icmp eq i8 %33, %34
br i1 %35, label %209, label %36
36: ; preds = %29, %201
%37 = phi i8 [ %206, %201 ], [ %33, %29 ]
%38 = sext i8 %37 to i32
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
switch i32 %38, label %201 [
i32 72, label %39
i32 40, label %176
i32 35, label %199
]
39: ; preds = %36
%40 = load i32, i32* @SEEK_CUR
%41 = call i32 @fseek(i32* %32, i32 1, i32 %40)
%42 = call signext i8 @getc(i32* %32)
%43 = icmp eq i8 %42, 76
br i1 %43, label %44, label %60
44: ; preds = %39
%45 = call i32 (i32*, i8*, ...) @fscanf(i32* %32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float* %6, float* %7, float* %8)
%46 = load float, float* %7
%47 = fdiv float %46, 1.000000e+02
store float %47, float* %7
%48 = load float, float* %8
%49 = fdiv float %48, 1.000000e+02
store float %49, float* %8
%50 = call float @llvm.fmuladd.f32(float %49, float 2.000000e+00, float -1.000000e+00)
%51 = fptosi float %50 to i32
%52 = call i32 @fabsf(i32 %51)
%53 = sub nsw i32 1, %52
%54 = sitofp i32 %53 to float
%55 = load float, float* %7
%56 = fmul float %55, %54
store float %56, float* %10
%57 = load float, float* %8
%58 = fmul float %56, 5.000000e-01
%59 = fsub float %57, %58
br label %71
60: ; preds = %39
%61 = call i32 (i32*, i8*, ...) @fscanf(i32* %32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), float* %6, float* %7, float* %9)
%62 = load float, float* %7
%63 = load float, float* %9
%64 = insertelement <2 x float> poison, float %62, i64 0
%65 = insertelement <2 x float> %64, float %63, i64 1
%66 = fdiv <2 x float> %65, <float 1.000000e+02, float 1.000000e+02>
%67 = extractelement <2 x float> %66, i64 0
store float %67, float* %7
%68 = extractelement <2 x float> %66, i64 1
store float %68, float* %9
%69 = fmul float %67, %68
store float %69, float* %10
%70 = fsub float %68, %69
br label %71
71: ; preds = %60, %44
%72 = phi float [ %69, %60 ], [ %56, %44 ]
%73 = phi float [ %70, %60 ], [ %59, %44 ]
store float %73, float* %11
%74 = load float, float* %6
%75 = fdiv float %74, 6.000000e+01
store float %75, float* %6
%76 = call i32 @mod2(float %75)
%77 = add nsw i32 %76, -1
%78 = call i32 @fabsf(i32 %77)
%79 = sub nsw i32 1, %78
%80 = sitofp i32 %79 to float
%81 = fmul float %72, %80
store float %81, float* %12
%82 = load float, float* %6
%83 = fcmp olt float %82, 1.000000e+00
br i1 %83, label %84, label %98
84: ; preds = %71
%85 = load float, float* %10
%86 = load float, float* %11
%87 = fadd float %85, %86
%88 = fptosi float %87 to i32
%89 = call i32 @rnint(i32 %88)
store i32 %89, i32* %3
%90 = load float, float* %12
%91 = load float, float* %11
%92 = fadd float %90, %91
%93 = fptosi float %92 to i32
%94 = call i32 @rnint(i32 %93)
store i32 %94, i32* %4
%95 = load float, float* %11
%96 = fptosi float %95 to i32
%97 = call i32 @rnint(i32 %96)
store i32 %97, i32* %5
br label %201
98: ; preds = %71
%99 = fcmp olt float %82, 2.000000e+00
br i1 %99, label %100, label %113
100: ; preds = %98
%101 = load float, float* %11
%102 = fadd float %81, %101
%103 = fptosi float %102 to i32
%104 = call i32 @rnint(i32 %103)
store i32 %104, i32* %3
%105 = load float, float* %10
%106 = load float, float* %11
%107 = fadd float %105, %106
%108 = fptosi float %107 to i32
%109 = call i32 @rnint(i32 %108)
store i32 %109, i32* %4
%110 = load float, float* %11
%111 = fptosi float %110 to i32
%112 = call i32 @rnint(i32 %111)
store i32 %112, i32* %5
br label %201
113: ; preds = %98
%114 = fcmp olt float %82, 3.000000e+00
br i1 %114, label %115, label %129
115: ; preds = %113
%116 = load float, float* %11
%117 = fptosi float %116 to i32
%118 = call i32 @rnint(i32 %117)
store i32 %118, i32* %3
%119 = load float, float* %10
%120 = load float, float* %11
%121 = fadd float %119, %120
%122 = fptosi float %121 to i32
%123 = call i32 @rnint(i32 %122)
store i32 %123, i32* %4
%124 = load float, float* %12
%125 = load float, float* %11
%126 = fadd float %124, %125
%127 = fptosi float %126 to i32
%128 = call i32 @rnint(i32 %127)
store i32 %128, i32* %5
br label %201
129: ; preds = %113
%130 = fcmp olt float %82, 4.000000e+00
br i1 %130, label %131, label %145
131: ; preds = %129
%132 = load float, float* %11
%133 = fptosi float %132 to i32
%134 = call i32 @rnint(i32 %133)
store i32 %134, i32* %3
%135 = load float, float* %12
%136 = load float, float* %11
%137 = fadd float %135, %136
%138 = fptosi float %137 to i32
%139 = call i32 @rnint(i32 %138)
store i32 %139, i32* %4
%140 = load float, float* %10
%141 = load float, float* %11
%142 = fadd float %140, %141
%143 = fptosi float %142 to i32
%144 = call i32 @rnint(i32 %143)
store i32 %144, i32* %5
br label %201
145: ; preds = %129
%146 = fcmp olt float %82, 5.000000e+00
br i1 %146, label %147, label %160
147: ; preds = %145
%148 = load float, float* %11
%149 = fadd float %81, %148
%150 = fptosi float %149 to i32
%151 = call i32 @rnint(i32 %150)
store i32 %151, i32* %3
%152 = load float, float* %11
%153 = fptosi float %152 to i32
%154 = call i32 @rnint(i32 %153)
store i32 %154, i32* %4
%155 = load float, float* %10
%156 = load float, float* %11
%157 = fadd float %155, %156
%158 = fptosi float %157 to i32
%159 = call i32 @rnint(i32 %158)
store i32 %159, i32* %5
br label %201
160: ; preds = %145
%161 = fcmp olt float %82, 6.000000e+00
br i1 %161, label %162, label %201
162: ; preds = %160
%163 = load float, float* %10
%164 = load float, float* %11
%165 = fadd float %163, %164
%166 = fptosi float %165 to i32
%167 = call i32 @rnint(i32 %166)
store i32 %167, i32* %3
%168 = load float, float* %11
%169 = fptosi float %168 to i32
%170 = call i32 @rnint(i32 %169)
store i32 %170, i32* %4
%171 = load float, float* %12
%172 = load float, float* %11
%173 = fadd float %171, %172
%174 = fptosi float %173 to i32
%175 = call i32 @rnint(i32 %174)
store i32 %175, i32* %5
br label %201
176: ; preds = %36
%177 = call i32 (i32*, i8*, ...) @fscanf(i32* %32, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), float* %10, float* %11, float* %12, float* %13)
%178 = load float, float* %10
%179 = fsub float 1.000000e+00, %178
%180 = load float, float* %13
%181 = fsub float 1.000000e+00, %180
%182 = fmul float %179, %181
%183 = fptosi float %182 to i32
%184 = call i32 @rnint(i32 %183)
store i32 %184, i32* %3
%185 = load float, float* %11
%186 = fsub float 1.000000e+00, %185
%187 = load float, float* %13
%188 = fsub float 1.000000e+00, %187
%189 = fmul float %186, %188
%190 = fptosi float %189 to i32
%191 = call i32 @rnint(i32 %190)
store i32 %191, i32* %4
%192 = load float, float* %12
%193 = fsub float 1.000000e+00, %192
%194 = load float, float* %13
%195 = fsub float 1.000000e+00, %194
%196 = fmul float %193, %195
%197 = fptosi float %196 to i32
%198 = call i32 @rnint(i32 %197)
store i32 %198, i32* %5
br label %201
199: ; preds = %36
%200 = call i32 (i32*, i8*, ...) @fscanf(i32* %32, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
br label %201
201: ; preds = %84, %115, %147, %162, %160, %131, %100, %199, %36, %176
%202 = load i32, i32* %3
%203 = load i32, i32* %4
%204 = load i32, i32* %5
%205 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %202, i32 %203, i32 %204)
%206 = call signext i8 @getc(i32* %32)
%207 = load i8, i8* @EOF
%208 = icmp eq i8 %206, %207
br i1 %208, label %209, label %36
209: ; preds = %201, %29, %26
%210 = phi i32 [ 1, %26 ], [ 0, %29 ], [ 0, %201 ]
ret i32 %210
}