#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 */
int bin(int, int, int, int, int, int, int, int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int r0, r1, r2, g0, g1, g2, b0, b1;
  int R, G, B, r, g, b;
  char tr, tg, tb;
  FILE *f;
  f = fopen("128col-sg.html", "w");
  if (f == NULL) {
    printf("No file!\n");
    return 1;
  }
  fprintf(f, "<html>\n\t<head>\n");
  fprintf(f, "\t\t<title>minimOS palette**</title>\n");
  fprintf(f, "\t</head>\n\t<body>\n");
  fprintf(f, "\t\t<table border='0'>\n");
  fprintf(f, "\t\t\t<tr>\n");
  for (g1 = 0; g1 < 2; g1++) {
    for (r1 = 0; r1 < 2; r1++) {
      for (g0 = 0; g0 < 2; g0++) {
        for (b1 = 0; b1 < 2; b1++) {
          R = 255 * r1;
          G = 170 * g1 + 85 * g0;
          B = 255 * b1;
          fprintf(f, "\t\t\t\t<td style='color:");
          if (G > 127) {
            fprintf(f, "black");
          } else {
            fprintf(f, "white");
          }
          fprintf(f, ";background-color:rgb(%d,%d,%d);'>S%d<br />%d%d%d</td>\n",
                  R, G, B, bin(0, 0, 0, 0, g1, r1, g0, b1), R / 128, G / 85,
                  B / 128);
        }
      }
    }
  }
  fprintf(f, "\t\t\t</tr>\n");
  fprintf(f, "\t\t\t<tr>\n");
  for (g1 = 1; g1 < 17; g1++) {
    G = g1 * 15;
    fprintf(f, "\t\t\t\t<td style='color:");
    if (G > 127) {
      fprintf(f, "black");
    } else {
      fprintf(f, "white");
    }
    fprintf(f, ";background-color:rgb(%d,%d,%d);'>G%d<br />%d</td>\n", G, G, G,
            g1, G);
  }
  fprintf(f, "\t\t\t</tr>\n");
  for (r1 = 0; r1 < 1; r1++) {
    for (g0 = 0; g0 < 2; g0++) {
      for (r0 = 0; r0 < 2; r0++) {
        for (b0 = 0; b0 < 2; b0++) {
          fprintf(f, "\t\t\t<tr>\n");
          for (g2 = 0; g2 < 2; g2++) {
            for (r2 = 0; r2 < 2; r2++) {
              for (g1 = 0; g1 < 2; g1++) {
                for (b1 = 0; b1 < 2; b1++) {
                  R = bin(r2, r1, r2, r1, r2, r1, r2, r1);
                  G = bin(g2, g1, g0, g2, g1, g0, g2, g1);
                  B = bin(b1, b0, b1, b0, b1, b0, b1, b0);
                  r = bin(0, 0, 0, 0, 0, 0, r1, r0);
                  g = bin(0, 0, 0, 0, 0, g2, g1, g0);
                  b = bin(0, 0, 0, 0, 0, 0, b1, b0);
                  tr = 48 + r;
                  tg = 48 + g;
                  tb = 48 + b;
                  fprintf(f, "\t\t\t\t<td style='color:");
                  if (tg > '3') {
                    fprintf(f, "black");
                  } else {
                    fprintf(f, "white");
                  }
                  fprintf(f, ";background-color:rgb(%d,%d,%d);'>%c%c%c<br />",
                          R, G, B, tr, tg, tb);
                  fprintf(f,
                          "<span "
                          "style='font-size:0.7em;background-color:rgb(%d,%d,%"
                          "d);'>%c%c%c</span></td>\n",
                          r * 255 / 7, g * 255 / 7, b * 255 / 3, tr, tg, tb);
                }
              }
            }
          }
          fprintf(f, "\t\t\t</tr>\n");
        }
      }
    }
  }
  fprintf(f, "\t\t</table>\n\t</body>\n</html>");
  fclose(f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    119c <main+0x4c>
lea    0xe86(%rip),%rdi
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1790 <main+0x640>
mov    -0x48(%rbp),%rdi
lea    0xe74(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xe72(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xe84(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    137b <main+0x22b>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    1368 <main+0x218>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1355 <main+0x205>
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    1342 <main+0x1f2>
imul   $0xff,-0xc(%rbp),%eax
mov    %eax,-0x28(%rbp)
imul   $0xaa,-0x18(%rbp),%eax
imul   $0x55,-0x14(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x2c(%rbp)
imul   $0xff,-0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xe17(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpl   $0x7f,-0x2c(%rbp)
jle    1291 <main+0x141>
mov    -0x48(%rbp),%rdi
lea    0xe11(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    12a3 <main+0x153>
mov    -0x48(%rbp),%rdi
lea    0xe00(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x18(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x14(%rbp),%r10d
mov    -0x24(%rbp),%eax
xor    %ecx,%ecx
mov    %ecx,%edi
mov    %ecx,%esi
mov    %ecx,%edx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <bin@plt>
mov    -0x60(%rbp),%rdi
mov    -0x54(%rbp),%ecx
mov    -0x50(%rbp),%r8d
mov    %eax,%r9d
mov    -0x28(%rbp),%eax
mov    $0x80,%esi
cltd
idiv   %esi
mov    %eax,%r11d
mov    -0x2c(%rbp),%eax
mov    $0x55,%esi
cltd
idiv   %esi
mov    %eax,%r10d
mov    -0x30(%rbp),%eax
mov    $0x80,%esi
cltd
idiv   %esi
mov    -0x4c(%rbp),%edx
lea    0xd82(%rip),%rsi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1230 <main+0xe0>
jmp    1347 <main+0x1f7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    121f <main+0xcf>
jmp    135a <main+0x20a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    120e <main+0xbe>
jmp    136d <main+0x21d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11fd <main+0xad>
mov    -0x48(%rbp),%rdi
lea    0xd54(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
lea    0xcdf(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jge    1430 <main+0x2e0>
imul   $0xf,-0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xcbe(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
cmpl   $0x7f,-0x2c(%rbp)
jle    13ea <main+0x29a>
mov    -0x48(%rbp),%rdi
lea    0xcb8(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13fc <main+0x2ac>
mov    -0x48(%rbp),%rdi
lea    0xca7(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x2c(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x2c(%rbp),%eax
lea    0xccc(%rip),%rsi
mov    %eax,(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13a6 <main+0x256>
mov    -0x48(%rbp),%rdi
lea    0xc9f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    176e <main+0x61e>
movl   $0x0,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    175b <main+0x60b>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1748 <main+0x5f8>
movl   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x20(%rbp)
jge    1735 <main+0x5e5>
mov    -0x48(%rbp),%rdi
lea    0xbe6(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    1715 <main+0x5c5>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1702 <main+0x5b2>
movl   $0x0,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jge    16ef <main+0x59f>
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    16dc <main+0x58c>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x10(%rbp),%r10d
mov    -0xc(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <bin@plt>
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x14(%rbp),%r9d
mov    -0x1c(%rbp),%r10d
mov    -0x18(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <bin@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x24(%rbp),%r10d
mov    -0x20(%rbp),%eax
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <bin@plt>
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%r10d
mov    -0x8(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <bin@plt>
mov    %eax,-0x34(%rbp)
mov    -0x1c(%rbp),%r9d
mov    -0x18(%rbp),%r10d
mov    -0x14(%rbp),%eax
xor    %r8d,%r8d
mov    %r8d,%edi
mov    %r8d,%esi
mov    %r8d,%edx
mov    %r8d,%ecx
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <bin@plt>
mov    %eax,-0x38(%rbp)
mov    -0x24(%rbp),%r10d
mov    -0x20(%rbp),%eax
xor    %r9d,%r9d
mov    %r9d,%edi
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <bin@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x34(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x3d(%rbp)
mov    -0x38(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x3e(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x3f(%rbp)
mov    -0x48(%rbp),%rdi
lea    0xa81(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movsbl -0x3e(%rbp),%eax
cmp    $0x33,%eax
jle    162a <main+0x4da>
mov    -0x48(%rbp),%rdi
lea    0xa78(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    163c <main+0x4ec>
mov    -0x48(%rbp),%rdi
lea    0xa67(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
movsbl -0x3d(%rbp),%r9d
movsbl -0x3e(%rbp),%r10d
movsbl -0x3f(%rbp),%eax
lea    0xab9(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
imul   $0xff,-0x34(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,-0x64(%rbp)
imul   $0xff,-0x38(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
imul   $0xff,-0x3c(%rbp),%eax
mov    $0x3,%esi
cltd
idiv   %esi
mov    -0x64(%rbp),%edx
mov    %eax,%r8d
movsbl -0x3d(%rbp),%r9d
movsbl -0x3e(%rbp),%r10d
movsbl -0x3f(%rbp),%eax
lea    0xa88(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    14d2 <main+0x382>
jmp    16e1 <main+0x591>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    14c1 <main+0x371>
jmp    16f4 <main+0x5a4>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    14b0 <main+0x360>
jmp    1707 <main+0x5b7>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    149f <main+0x34f>
mov    -0x48(%rbp),%rdi
lea    0x9ba(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    147c <main+0x32c>
jmp    173a <main+0x5ea>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    146b <main+0x31b>
jmp    174d <main+0x5fd>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    145a <main+0x30a>
jmp    1760 <main+0x610>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1449 <main+0x2f9>
mov    -0x48(%rbp),%rdi
lea    0xa20(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xe8b(%rip),%rdi
lea    0xe93(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     18dc <main+0x77c>
mov    %rax,%rbx
lea    0xe7d(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1080 <fwrite@plt>
lea    0xe74(%rip),%rdi
mov    $0x23,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe7f(%rip),%rdi
mov    $0x11,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe78(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
lea    0xe75(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbx,0x8(%rsp)
mov    %rbx,%rcx
call   1080 <fwrite@plt>
xor    %eax,%eax
mov    %rax,(%rsp)
mov    $0x1,%al
lea    0xe6e(%rip),%r13
mov    0x8(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,0x28(%rsp)
mov    (%rsp),%rax
imul   $0xaa,%eax,%ecx
add    %eax,%eax
mov    %rax,0x48(%rsp)
lea    0x55(%rcx),%eax
mov    %rax,0x40(%rsp)
mov    %rax,%rdx
mov    $0xc0c0c0c1,%eax
imul   %rax,%rdx
shr    $0x26,%rdx
mov    %rdx,0x38(%rsp)
cmp    $0x7f,%ecx
lea    0xe26(%rip),%rax
mov    %rax,%rdx
cmova  %r13,%rdx
mov    %rdx,0x10(%rsp)
mov    %rcx,0x18(%rsp)
cmp    $0x2b,%ecx
cmovae %r13,%rax
mov    %rax,0x30(%rsp)
mov    $0x1,%al
xor    %r15d,%r15d
xchg   %ax,%ax
mov    %eax,0x50(%rsp)
mov    %r15d,%r13d
shl    $0x8,%r13d
sub    %r15d,%r13d
mov    %r13d,%ebx
shr    $0x7,%ebx
mov    $0x15,%esi
mov    $0x1,%edx
lea    0xdc1(%rip),%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    $0x5,%esi
mov    $0x1,%edx
mov    0x10(%rsp),%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    (%rsp),%rbp
mov    %ebp,%r8d
mov    %r15d,%r9d
push   $0x0
push   $0x0
call   1050 <bin@plt>
add    $0x8,%rsp
mov    %r12,%rdi
lea    0xd9b(%rip),%rsi
mov    %r13d,%edx
mov    0x20(%rsp),%rcx
xor    %r8d,%r8d
mov    %eax,%r9d
xor    %eax,%eax
push   $0x0
mov    0x58(%rsp),%r14
push   %r14
mov    %rbx,0x38(%rsp)
push   %rbx
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    $0x15,%esi
mov    $0x1,%edx
lea    0xd40(%rip),%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    $0x5,%esi
mov    $0x1,%edx
mov    0x10(%rsp),%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbp,(%rsp)
mov    %ebp,%r8d
mov    %r15d,%r9d
push   $0x1
push   $0x0
call   1050 <bin@plt>
add    $0x8,%rsp
mov    %r12,%rdi
lea    0xd1a(%rip),%rsi
mov    %r13d,%edx
mov    0x20(%rsp),%rcx
mov    $0xff,%r8d
mov    %eax,%r9d
xor    %eax,%eax
push   $0x1
push   %r14
push   %rbx
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    $0x15,%esi
mov    $0x1,%edx
lea    0xcc6(%rip),%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    $0x5,%esi
mov    $0x1,%edx
mov    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebp,%r8d
mov    %r15d,%r9d
push   $0x0
push   $0x1
call   1050 <bin@plt>
add    $0x8,%rsp
mov    %r12,%rdi
lea    0xca1(%rip),%rsi
mov    %r13d,%edx
mov    0x48(%rsp),%r14
mov    %r14d,%ecx
xor    %r8d,%r8d
mov    %eax,%r9d
xor    %eax,%eax
push   $0x0
mov    0x48(%rsp),%rbp
push   %rbp
push   0x38(%rsp)
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    $0x15,%esi
mov    $0x1,%edx
lea    0xc46(%rip),%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    $0x5,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    (%rsp),%r8
lea    0xc38(%rip),%rbx
mov    %r15d,%r9d
push   $0x1
push   $0x1
call   1050 <bin@plt>
add    $0x8,%rsp
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r13d,%edx
mov    %r14d,%ecx
mov    $0xff,%r8d
mov    %eax,%r9d
xor    %eax,%eax
push   $0x1
push   %rbp
push   0x38(%rsp)
call   1060 <fprintf@plt>
add    $0x20,%rsp
mov    $0x1,%r15d
testb  $0x1,0x50(%rsp)
mov    $0x0,%eax
jne    1290 <main+0x130>
mov    $0x1,%eax
mov    %rax,(%rsp)
testb  $0x1,0x28(%rsp)
mov    $0x0,%eax
lea    0xbc5(%rip),%r13
jne    1230 <main+0xd0>
lea    0xbfc(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    0x8(%rsp),%r12
mov    %r12,%rcx
call   1080 <fwrite@plt>
lea    0xb7b(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    $0x1,%ebx
mov    $0xf,%ebp
lea    0xbc5(%rip),%r15
lea    0xb76(%rip),%r14
nopl   0x0(%rax)
mov    $0x15,%esi
mov    $0x1,%edx
lea    0xb45(%rip),%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
cmp    $0x7f,%ebp
mov    %r14,%rdi
cmova  %r13,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1080 <fwrite@plt>
sub    $0x8,%rsp
mov    %r12,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %ebp,%r8d
mov    %ebx,%r9d
xor    %eax,%eax
push   %rbp
call   1060 <fprintf@plt>
add    $0x10,%rsp
add    $0x1,%ebx
add    $0xf,%ebp
cmp    $0xff,%ebp
jne    1520 <main+0x3c0>
lea    0xb46(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1080 <fwrite@plt>
xor    %r13d,%r13d
mov    $0x1,%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,0x58(%rsp)
mov    $0x1,%al
xor    %r14d,%r14d
mov    %r13,0x28(%rsp)
xchg   %ax,%ax
mov    %eax,0x5c(%rsp)
xor    %ecx,%ecx
mov    $0x1,%al
mov    %r14,0x70(%rsp)
nopl   (%rax)
mov    %rcx,0x30(%rsp)
mov    %eax,0x60(%rsp)
mov    $0x8,%esi
mov    $0x1,%edx
lea    0xa83(%rip),%rdi
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    $0x1,%al
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    %eax,0x64(%rsp)
xor    %edi,%edi
mov    $0x1,%al
mov    %r12,0x38(%rsp)
nopl   (%rax)
mov    %eax,0x68(%rsp)
mov    $0x1,%al
xor    %ebx,%ebx
mov    %rdi,0x40(%rsp)
nopl   (%rax)
mov    %eax,0x6c(%rsp)
xor    %r15d,%r15d
mov    $0x1,%al
mov    %rbx,0x48(%rsp)
xchg   %ax,%ax
mov    %eax,(%rsp)
xor    %esi,%esi
mov    %edi,%edx
xor    %ecx,%ecx
mov    %edi,%r8d
xor    %r9d,%r9d
push   $0x0
push   %rdi
call   1050 <bin@plt>
add    $0x10,%rsp
mov    %eax,0x20(%rsp)
mov    %r12d,%edi
mov    %ebx,%esi
mov    %r13d,%edx
mov    %r12d,%ecx
mov    %ebx,%r8d
mov    %r13d,%r9d
push   %rbx
push   %r12
call   1050 <bin@plt>
add    $0x10,%rsp
mov    %eax,0x18(%rsp)
mov    %r15d,%edi
mov    0x30(%rsp),%rbp
mov    %ebp,%esi
mov    %r15d,%edx
mov    %ebp,%ecx
mov    %r15d,%r8d
mov    %ebp,%r9d
push   %rbp
push   %r15
call   1050 <bin@plt>
add    $0x10,%rsp
mov    %eax,0x10(%rsp)
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %r14
push   $0x0
call   1050 <bin@plt>
add    $0x10,%rsp
mov    %eax,%r14d
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    %r12d,%r9d
push   %r13
push   %rbx
call   1050 <bin@plt>
add    $0x10,%rsp
mov    %eax,%r13d
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
push   %rbp
push   %r15
call   1050 <bin@plt>
add    $0x10,%rsp
mov    %eax,%ebx
mov    %rbx,0x50(%rsp)
mov    $0x15,%esi
mov    $0x1,%edx
lea    0x974(%rip),%rdi
mov    0x8(%rsp),%r12
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    %r13d,%eax
shl    $0x18,%eax
add    $0x30000000,%eax
mov    %eax,%r15d
sar    $0x18,%r15d
cmp    $0x33000001,%eax
lea    0x965(%rip),%rdi
lea    0x958(%rip),%rax
cmovge %rax,%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1080 <fwrite@plt>
lea    0x30(%r14),%eax
movsbl %al,%r9d
lea    0x30(%rbx),%eax
movsbl %al,%ebp
mov    %r12,%rdi
lea    0x9ac(%rip),%rsi
mov    0x20(%rsp),%edx
mov    0x18(%rsp),%ecx
mov    0x10(%rsp),%r8d
mov    %r9d,%ebx
xor    %eax,%eax
push   %rbp
push   %r15
call   1060 <fprintf@plt>
add    $0x10,%rsp
mov    %r14d,%eax
shl    $0x8,%eax
sub    %r14d,%eax
lea    0x9ad(%rip),%rsi
movslq %eax,%rdx
imul   $0xffffffff92492493,%rdx,%rax
shr    $0x20,%rax
add    %eax,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x2,%edx
add    %eax,%edx
mov    %r13d,%eax
shl    $0x8,%eax
sub    %r13d,%eax
mov    0x28(%rsp),%r13
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
sar    $0x2,%ecx
add    %eax,%ecx
imul   $0x55,0x50(%rsp),%r8d
mov    %r12,%rdi
mov    %ebx,%r9d
xor    %eax,%eax
push   %rbp
mov    0x50(%rsp),%rbx
mov    0x40(%rsp),%r12
push   %r15
mov    0x80(%rsp),%r14
call   1060 <fprintf@plt>
mov    0x50(%rsp),%rdi
add    $0x10,%rsp
mov    $0x1,%r15d
testb  $0x1,(%rsp)
mov    $0x0,%eax
jne    1630 <main+0x4d0>
mov    $0x1,%ebx
testb  $0x1,0x6c(%rsp)
mov    $0x0,%eax
jne    1620 <main+0x4c0>
mov    $0x1,%edi
testb  $0x1,0x68(%rsp)
mov    $0x0,%eax
jne    1610 <main+0x4b0>
mov    $0x1,%r12d
testb  $0x1,0x64(%rsp)
mov    $0x0,%eax
jne    1600 <main+0x4a0>
mov    $0x9,%esi
mov    $0x1,%edx
lea    0x867(%rip),%rdi
mov    0x8(%rsp),%r12
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    $0x1,%ecx
testb  $0x1,0x60(%rsp)
mov    $0x0,%eax
jne    15d0 <main+0x470>
mov    $0x1,%r14d
testb  $0x1,0x5c(%rsp)
mov    $0x0,%eax
jne    15c0 <main+0x460>
mov    $0x1,%r13d
xor    %ebx,%ebx
testb  $0x1,0x58(%rsp)
mov    $0x0,%eax
jne    15b0 <main+0x450>
lea    0x8cf(%rip),%rdi
mov    $0x1b,%esi
mov    $0x1,%edx
mov    %r12,%rcx
call   1080 <fwrite@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
jmp    18ed <main+0x78d>
lea    0x8c8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"128col-sg.html\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [10 x i8] c"No file!\0A\00"
@.str.3 = [16 x i8] c"<html>\0A\09<head>\0A\00"
@.str.4 = [36 x i8] c"\09\09<title>minimOS palette**</title>\0A\00"
@.str.5 = [18 x i8] c"\09</head>\0A\09<body>\0A\00"
@.str.6 = [22 x i8] c"\09\09<table border='0'>\0A\00"
@.str.7 = [9 x i8] c"\09\09\09<tr>\0A\00"
@.str.8 = [22 x i8] c"\09\09\09\09<td style='color:\00"
@.str.9 = [6 x i8] c"black\00"
@.str.10 = [6 x i8] c"white\00"
@.str.11 = [56 x i8] c";background-color:rgb(%d,%d,%d);'>S%d<br />%d%d%d</td>\0A\00"
@.str.12 = [10 x i8] c"\09\09\09</tr>\0A\00"
@.str.13 = [52 x i8] c";background-color:rgb(%d,%d,%d);'>G%d<br />%d</td>\0A\00"
@.str.14 = [47 x i8] c";background-color:rgb(%d,%d,%d);'>%c%c%c<br />\00"
@.str.15 = [82 x i8] c"<span style='font-size:0.7em;background-color:rgb(%d,%d,%d);'>%c%c%c</span></td>\0A\00"
@.str.16 = [28 x i8] c"\09\09</table>\0A\09</body>\0A</html>\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8
%17 = alloca i8
%18 = alloca i8
%19 = alloca i32*
store i32 0, i32* %1
%20 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %20, i32** %19
%21 = load i32*, i32** %19
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %0
%24 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %296
25: ; preds = %0
%26 = load i32*, i32** %19
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%28 = load i32*, i32** %19
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%30 = load i32*, i32** %19
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%32 = load i32*, i32** %19
%33 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%34 = load i32*, i32** %19
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %6
br label %36
36: ; preds = %100, %25
%37 = load i32, i32* %6
%38 = icmp slt i32 %37, 2
br i1 %38, label %39, label %103
39: ; preds = %36
store i32 0, i32* %3
br label %40
40: ; preds = %96, %39
%41 = load i32, i32* %3
%42 = icmp slt i32 %41, 2
br i1 %42, label %43, label %99
43: ; preds = %40
store i32 0, i32* %5
br label %44
44: ; preds = %92, %43
%45 = load i32, i32* %5
%46 = icmp slt i32 %45, 2
br i1 %46, label %47, label %95
47: ; preds = %44
store i32 0, i32* %9
br label %48
48: ; preds = %88, %47
%49 = load i32, i32* %9
%50 = icmp slt i32 %49, 2
br i1 %50, label %51, label %91
51: ; preds = %48
%52 = load i32, i32* %3
%53 = mul nsw i32 255, %52
store i32 %53, i32* %10
%54 = load i32, i32* %6
%55 = mul nsw i32 170, %54
%56 = load i32, i32* %5
%57 = mul nsw i32 85, %56
%58 = add nsw i32 %55, %57
store i32 %58, i32* %11
%59 = load i32, i32* %9
%60 = mul nsw i32 255, %59
store i32 %60, i32* %12
%61 = load i32*, i32** %19
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%63 = load i32, i32* %11
%64 = icmp sgt i32 %63, 127
br i1 %64, label %65, label %68
65: ; preds = %51
%66 = load i32*, i32** %19
%67 = call i32 (i32*, i8*, ...) @fprintf(i32* %66, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %71
68: ; preds = %51
%69 = load i32*, i32** %19
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %71
71: ; preds = %68, %65
%72 = load i32*, i32** %19
%73 = load i32, i32* %10
%74 = load i32, i32* %11
%75 = load i32, i32* %12
%76 = load i32, i32* %6
%77 = load i32, i32* %3
%78 = load i32, i32* %5
%79 = load i32, i32* %9
%80 = call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 %76, i32 %77, i32 %78, i32 %79)
%81 = load i32, i32* %10
%82 = sdiv i32 %81, 128
%83 = load i32, i32* %11
%84 = sdiv i32 %83, 85
%85 = load i32, i32* %12
%86 = sdiv i32 %85, 128
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), i32 %73, i32 %74, i32 %75, i32 %80, i32 %82, i32 %84, i32 %86)
br label %88
88: ; preds = %71
%89 = load i32, i32* %9
%90 = add nsw i32 %89, 1
store i32 %90, i32* %9
br label %48
91: ; preds = %48
br label %92
92: ; preds = %91
%93 = load i32, i32* %5
%94 = add nsw i32 %93, 1
store i32 %94, i32* %5
br label %44
95: ; preds = %44
br label %96
96: ; preds = %95
%97 = load i32, i32* %3
%98 = add nsw i32 %97, 1
store i32 %98, i32* %3
br label %40
99: ; preds = %40
br label %100
100: ; preds = %99
%101 = load i32, i32* %6
%102 = add nsw i32 %101, 1
store i32 %102, i32* %6
br label %36
103: ; preds = %36
%104 = load i32*, i32** %19
%105 = call i32 (i32*, i8*, ...) @fprintf(i32* %104, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
%106 = load i32*, i32** %19
%107 = call i32 (i32*, i8*, ...) @fprintf(i32* %106, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %6
br label %108
108: ; preds = %132, %103
%109 = load i32, i32* %6
%110 = icmp slt i32 %109, 17
br i1 %110, label %111, label %135
111: ; preds = %108
%112 = load i32, i32* %6
%113 = mul nsw i32 %112, 15
store i32 %113, i32* %11
%114 = load i32*, i32** %19
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %114, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%116 = load i32, i32* %11
%117 = icmp sgt i32 %116, 127
br i1 %117, label %118, label %121
118: ; preds = %111
%119 = load i32*, i32** %19
%120 = call i32 (i32*, i8*, ...) @fprintf(i32* %119, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %124
121: ; preds = %111
%122 = load i32*, i32** %19
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %122, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %124
124: ; preds = %121, %118
%125 = load i32*, i32** %19
%126 = load i32, i32* %11
%127 = load i32, i32* %11
%128 = load i32, i32* %11
%129 = load i32, i32* %6
%130 = load i32, i32* %11
%131 = call i32 (i32*, i8*, ...) @fprintf(i32* %125, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.13, i64 0, i64 0), i32 %126, i32 %127, i32 %128, i32 %129, i32 %130)
br label %132
132: ; preds = %124
%133 = load i32, i32* %6
%134 = add nsw i32 %133, 1
store i32 %134, i32* %6
br label %108
135: ; preds = %108
%136 = load i32*, i32** %19
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %3
br label %138
138: ; preds = %288, %135
%139 = load i32, i32* %3
%140 = icmp slt i32 %139, 1
br i1 %140, label %141, label %291
141: ; preds = %138
store i32 0, i32* %5
br label %142
142: ; preds = %284, %141
%143 = load i32, i32* %5
%144 = icmp slt i32 %143, 2
br i1 %144, label %145, label %287
145: ; preds = %142
store i32 0, i32* %2
br label %146
146: ; preds = %280, %145
%147 = load i32, i32* %2
%148 = icmp slt i32 %147, 2
br i1 %148, label %149, label %283
149: ; preds = %146
store i32 0, i32* %8
br label %150
150: ; preds = %276, %149
%151 = load i32, i32* %8
%152 = icmp slt i32 %151, 2
br i1 %152, label %153, label %279
153: ; preds = %150
%154 = load i32*, i32** %19
%155 = call i32 (i32*, i8*, ...) @fprintf(i32* %154, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %7
br label %156
156: ; preds = %270, %153
%157 = load i32, i32* %7
%158 = icmp slt i32 %157, 2
br i1 %158, label %159, label %273
159: ; preds = %156
store i32 0, i32* %4
br label %160
160: ; preds = %266, %159
%161 = load i32, i32* %4
%162 = icmp slt i32 %161, 2
br i1 %162, label %163, label %269
163: ; preds = %160
store i32 0, i32* %6
br label %164
164: ; preds = %262, %163
%165 = load i32, i32* %6
%166 = icmp slt i32 %165, 2
br i1 %166, label %167, label %265
167: ; preds = %164
store i32 0, i32* %9
br label %168
168: ; preds = %258, %167
%169 = load i32, i32* %9
%170 = icmp slt i32 %169, 2
br i1 %170, label %171, label %261
171: ; preds = %168
%172 = load i32, i32* %4
%173 = load i32, i32* %3
%174 = load i32, i32* %4
%175 = load i32, i32* %3
%176 = load i32, i32* %4
%177 = load i32, i32* %3
%178 = load i32, i32* %4
%179 = load i32, i32* %3
%180 = call i32 @bin(i32 %172, i32 %173, i32 %174, i32 %175, i32 %176, i32 %177, i32 %178, i32 %179)
store i32 %180, i32* %10
%181 = load i32, i32* %7
%182 = load i32, i32* %6
%183 = load i32, i32* %5
%184 = load i32, i32* %7
%185 = load i32, i32* %6
%186 = load i32, i32* %5
%187 = load i32, i32* %7
%188 = load i32, i32* %6
%189 = call i32 @bin(i32 %181, i32 %182, i32 %183, i32 %184, i32 %185, i32 %186, i32 %187, i32 %188)
store i32 %189, i32* %11
%190 = load i32, i32* %9
%191 = load i32, i32* %8
%192 = load i32, i32* %9
%193 = load i32, i32* %8
%194 = load i32, i32* %9
%195 = load i32, i32* %8
%196 = load i32, i32* %9
%197 = load i32, i32* %8
%198 = call i32 @bin(i32 %190, i32 %191, i32 %192, i32 %193, i32 %194, i32 %195, i32 %196, i32 %197)
store i32 %198, i32* %12
%199 = load i32, i32* %3
%200 = load i32, i32* %2
%201 = call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %199, i32 %200)
store i32 %201, i32* %13
%202 = load i32, i32* %7
%203 = load i32, i32* %6
%204 = load i32, i32* %5
%205 = call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 0, i32 %202, i32 %203, i32 %204)
store i32 %205, i32* %14
%206 = load i32, i32* %9
%207 = load i32, i32* %8
%208 = call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %206, i32 %207)
store i32 %208, i32* %15
%209 = load i32, i32* %13
%210 = add nsw i32 48, %209
%211 = trunc i32 %210 to i8
store i8 %211, i8* %16
%212 = load i32, i32* %14
%213 = add nsw i32 48, %212
%214 = trunc i32 %213 to i8
store i8 %214, i8* %17
%215 = load i32, i32* %15
%216 = add nsw i32 48, %215
%217 = trunc i32 %216 to i8
store i8 %217, i8* %18
%218 = load i32*, i32** %19
%219 = call i32 (i32*, i8*, ...) @fprintf(i32* %218, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%220 = load i8, i8* %17
%221 = sext i8 %220 to i32
%222 = icmp sgt i32 %221, 51
br i1 %222, label %223, label %226
223: ; preds = %171
%224 = load i32*, i32** %19
%225 = call i32 (i32*, i8*, ...) @fprintf(i32* %224, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
br label %229
226: ; preds = %171
%227 = load i32*, i32** %19
%228 = call i32 (i32*, i8*, ...) @fprintf(i32* %227, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %229
229: ; preds = %226, %223
%230 = load i32*, i32** %19
%231 = load i32, i32* %10
%232 = load i32, i32* %11
%233 = load i32, i32* %12
%234 = load i8, i8* %16
%235 = sext i8 %234 to i32
%236 = load i8, i8* %17
%237 = sext i8 %236 to i32
%238 = load i8, i8* %18
%239 = sext i8 %238 to i32
%240 = call i32 (i32*, i8*, ...) @fprintf(i32* %230, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.14, i64 0, i64 0), i32 %231, i32 %232, i32 %233, i32 %235, i32 %237, i32 %239)
%241 = load i32*, i32** %19
%242 = load i32, i32* %13
%243 = mul nsw i32 %242, 255
%244 = sdiv i32 %243, 7
%245 = load i32, i32* %14
%246 = mul nsw i32 %245, 255
%247 = sdiv i32 %246, 7
%248 = load i32, i32* %15
%249 = mul nsw i32 %248, 255
%250 = sdiv i32 %249, 3
%251 = load i8, i8* %16
%252 = sext i8 %251 to i32
%253 = load i8, i8* %17
%254 = sext i8 %253 to i32
%255 = load i8, i8* %18
%256 = sext i8 %255 to i32
%257 = call i32 (i32*, i8*, ...) @fprintf(i32* %241, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.15, i64 0, i64 0), i32 %244, i32 %247, i32 %250, i32 %252, i32 %254, i32 %256)
br label %258
258: ; preds = %229
%259 = load i32, i32* %9
%260 = add nsw i32 %259, 1
store i32 %260, i32* %9
br label %168
261: ; preds = %168
br label %262
262: ; preds = %261
%263 = load i32, i32* %6
%264 = add nsw i32 %263, 1
store i32 %264, i32* %6
br label %164
265: ; preds = %164
br label %266
266: ; preds = %265
%267 = load i32, i32* %4
%268 = add nsw i32 %267, 1
store i32 %268, i32* %4
br label %160
269: ; preds = %160
br label %270
270: ; preds = %269
%271 = load i32, i32* %7
%272 = add nsw i32 %271, 1
store i32 %272, i32* %7
br label %156
273: ; preds = %156
%274 = load i32*, i32** %19
%275 = call i32 (i32*, i8*, ...) @fprintf(i32* %274, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0))
br label %276
276: ; preds = %273
%277 = load i32, i32* %8
%278 = add nsw i32 %277, 1
store i32 %278, i32* %8
br label %150
279: ; preds = %150
br label %280
280: ; preds = %279
%281 = load i32, i32* %2
%282 = add nsw i32 %281, 1
store i32 %282, i32* %2
br label %146
283: ; preds = %146
br label %284
284: ; preds = %283
%285 = load i32, i32* %5
%286 = add nsw i32 %285, 1
store i32 %286, i32* %5
br label %142
287: ; preds = %142
br label %288
288: ; preds = %287
%289 = load i32, i32* %3
%290 = add nsw i32 %289, 1
store i32 %290, i32* %3
br label %138
291: ; preds = %138
%292 = load i32*, i32** %19
%293 = call i32 (i32*, i8*, ...) @fprintf(i32* %292, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0))
%294 = load i32*, i32** %19
%295 = call i32 @fclose(i32* %294)
store i32 0, i32* %1
br label %296
296: ; preds = %291, %23
%297 = load i32, i32* %1
ret i32 %297
}

LLVM IR (-O2):
@.str = [15 x i8] c"128col-sg.html\00"
@.str.1 = [2 x i8] c"w\00"
@.str.3 = [16 x i8] c"<html>\0A\09<head>\0A\00"
@.str.4 = [36 x i8] c"\09\09<title>minimOS palette**</title>\0A\00"
@.str.5 = [18 x i8] c"\09</head>\0A\09<body>\0A\00"
@.str.6 = [22 x i8] c"\09\09<table border='0'>\0A\00"
@.str.7 = [9 x i8] c"\09\09\09<tr>\0A\00"
@.str.8 = [22 x i8] c"\09\09\09\09<td style='color:\00"
@.str.9 = [6 x i8] c"black\00"
@.str.10 = [6 x i8] c"white\00"
@.str.11 = [56 x i8] c";background-color:rgb(%d,%d,%d);'>S%d<br />%d%d%d</td>\0A\00"
@.str.12 = [10 x i8] c"\09\09\09</tr>\0A\00"
@.str.13 = [52 x i8] c";background-color:rgb(%d,%d,%d);'>G%d<br />%d</td>\0A\00"
@.str.14 = [47 x i8] c";background-color:rgb(%d,%d,%d);'>%c%c%c<br />\00"
@.str.15 = [82 x i8] c"<span style='font-size:0.7em;background-color:rgb(%d,%d,%d);'>%c%c%c</span></td>\0A\00"
@.str.16 = [28 x i8] c"\09\09</table>\0A\09</body>\0A</html>\00"
@str = [9 x i8] c"No file!\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %119
5: ; preds = %0
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i64 15, i64 1, i32* %1)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i64 35, i64 1, i32* %1)
%8 = tail call i64 @fwrite(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i64 17, i64 1, i32* %1)
%9 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i64 21, i64 1, i32* %1)
%10 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64 8, i64 1, i32* %1)
br label %11
11: ; preds = %5, %45
%12 = phi i1 [ true, %5 ], [ false, %45 ]
%13 = phi i32 [ 0, %5 ], [ 1, %45 ]
%14 = mul nuw nsw i32 %13, 170
%15 = icmp ugt i32 %14, 127
%16 = shl nuw nsw i32 %13, 1
%17 = add nuw nsw i32 %14, 85
%18 = icmp ugt i32 %14, 42
%19 = udiv i32 %17, 85
%20 = select i1 %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
%21 = select i1 %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
%22 = select i1 %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
%23 = select i1 %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
br label %24
24: ; preds = %11, %24
%25 = phi i1 [ true, %11 ], [ false, %24 ]
%26 = phi i32 [ 0, %11 ], [ 1, %24 ]
%27 = mul nuw nsw i32 %26, 255
%28 = lshr i32 %27, 7
%29 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 21, i64 1, i32* %1)
%30 = tail call i64 @fwrite(i8* %20, i64 5, i64 1, i32* %1)
%31 = tail call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 %13, i32 %26, i32 0, i32 0)
%32 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), i32 %27, i32 %14, i32 0, i32 %31, i32 %28, i32 %16, i32 0)
%33 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 21, i64 1, i32* %1)
%34 = tail call i64 @fwrite(i8* %21, i64 5, i64 1, i32* %1)
%35 = tail call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 %13, i32 %26, i32 0, i32 1)
%36 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), i32 %27, i32 %14, i32 255, i32 %35, i32 %28, i32 %16, i32 1)
%37 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 21, i64 1, i32* %1)
%38 = tail call i64 @fwrite(i8* %22, i64 5, i64 1, i32* %1)
%39 = tail call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 %13, i32 %26, i32 1, i32 0)
%40 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), i32 %27, i32 %17, i32 0, i32 %39, i32 %28, i32 %19, i32 0)
%41 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 21, i64 1, i32* %1)
%42 = tail call i64 @fwrite(i8* %23, i64 5, i64 1, i32* %1)
%43 = tail call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 %13, i32 %26, i32 1, i32 1)
%44 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.11, i64 0, i64 0), i32 %27, i32 %17, i32 255, i32 %43, i32 %28, i32 %19, i32 1)
br i1 %25, label %24, label %45
45: ; preds = %24
br i1 %12, label %11, label %46
46: ; preds = %45
%47 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i64 9, i64 1, i32* %1)
%48 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64 8, i64 1, i32* %1)
br label %49
49: ; preds = %46, %49
%50 = phi i32 [ 1, %46 ], [ %57, %49 ]
%51 = mul nuw nsw i32 %50, 15
%52 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 21, i64 1, i32* %1)
%53 = icmp ugt i32 %51, 127
%54 = select i1 %53, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
%55 = tail call i64 @fwrite(i8* %54, i64 5, i64 1, i32* %1)
%56 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.13, i64 0, i64 0), i32 %51, i32 %51, i32 %51, i32 %50, i32 %51)
%57 = add nuw nsw i32 %50, 1
%58 = icmp eq i32 %57, 17
br i1 %58, label %59, label %49
59: ; preds = %49
%60 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i64 9, i64 1, i32* %1)
br label %61
61: ; preds = %59, %115
%62 = phi i1 [ true, %59 ], [ false, %115 ]
%63 = phi i32 [ 0, %59 ], [ 1, %115 ]
br label %64
64: ; preds = %61, %114
%65 = phi i1 [ true, %61 ], [ false, %114 ]
%66 = phi i32 [ 0, %61 ], [ 1, %114 ]
br label %67
67: ; preds = %64, %112
%68 = phi i1 [ true, %64 ], [ false, %112 ]
%69 = phi i32 [ 0, %64 ], [ 1, %112 ]
%70 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i64 8, i64 1, i32* %1)
br label %71
71: ; preds = %67, %111
%72 = phi i1 [ true, %67 ], [ false, %111 ]
%73 = phi i32 [ 0, %67 ], [ 1, %111 ]
br label %74
74: ; preds = %71, %110
%75 = phi i1 [ true, %71 ], [ false, %110 ]
%76 = phi i32 [ 0, %71 ], [ 1, %110 ]
br label %77
77: ; preds = %74, %109
%78 = phi i1 [ true, %74 ], [ false, %109 ]
%79 = phi i32 [ 0, %74 ], [ 1, %109 ]
br label %80
80: ; preds = %77, %80
%81 = phi i1 [ true, %77 ], [ false, %80 ]
%82 = phi i32 [ 0, %77 ], [ 1, %80 ]
%83 = tail call i32 @bin(i32 %76, i32 0, i32 %76, i32 0, i32 %76, i32 0, i32 %76, i32 0)
%84 = tail call i32 @bin(i32 %73, i32 %79, i32 %63, i32 %73, i32 %79, i32 %63, i32 %73, i32 %79)
%85 = tail call i32 @bin(i32 %82, i32 %69, i32 %82, i32 %69, i32 %82, i32 %69, i32 %82, i32 %69)
%86 = tail call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %66)
%87 = tail call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 0, i32 %73, i32 %79, i32 %63)
%88 = tail call i32 @bin(i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 %82, i32 %69)
%89 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i64 21, i64 1, i32* %1)
%90 = shl i32 %87, 24
%91 = add i32 %90, 805306368
%92 = ashr exact i32 %91, 24
%93 = icmp sgt i32 %91, 855638016
%94 = select i1 %93, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0)
%95 = tail call i64 @fwrite(i8* %94, i64 5, i64 1, i32* %1)
%96 = shl i32 %86, 24
%97 = add i32 %96, 805306368
%98 = ashr exact i32 %97, 24
%99 = shl i32 %88, 24
%100 = add i32 %99, 805306368
%101 = ashr exact i32 %100, 24
%102 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.14, i64 0, i64 0), i32 %83, i32 %84, i32 %85, i32 %98, i32 %92, i32 %101)
%103 = mul nsw i32 %86, 255
%104 = sdiv i32 %103, 7
%105 = mul nsw i32 %87, 255
%106 = sdiv i32 %105, 7
%107 = mul nsw i32 %88, 85
%108 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.15, i64 0, i64 0), i32 %104, i32 %106, i32 %107, i32 %98, i32 %92, i32 %101)
br i1 %81, label %80, label %109
109: ; preds = %80
br i1 %78, label %77, label %110
110: ; preds = %109
br i1 %75, label %74, label %111
111: ; preds = %110
br i1 %72, label %71, label %112
112: ; preds = %111
%113 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i64 9, i64 1, i32* %1)
br i1 %68, label %67, label %114
114: ; preds = %112
br i1 %65, label %64, label %115
115: ; preds = %114
br i1 %62, label %61, label %116
116: ; preds = %115
%117 = tail call i64 @fwrite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.16, i64 0, i64 0), i64 27, i64 1, i32* %1)
%118 = tail call i32 @fclose(i32* %1)
br label %119
119: ; preds = %116, %3
%120 = phi i32 [ 1, %3 ], [ 0, %116 ]
ret i32 %120
}