#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 */
float powf(float, float);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("#include <stdint.h>\n");
  printf("const float xyz_table[256] = {\n    ");
  for (int i = 0; i < 256; i++) {
    float t = i / 255.0f;
    if (t > 0.04045f) {
      t = powf(((t + 0.055f) / 1.055f), 2.4f);
    } else {
      t /= 12.92f;
    }
    t *= 100.0f;
    printf("%.6ff, ", t);
    if (i == 255) {
      printf("\n");
    } else if ((i + 1) % 8 == 0) {
      printf("\n    ");
    }
  }
  printf("};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    125e <main+0x13e>
cvtsi2ssl -0x14(%rbp),%xmm0
movss  0xe91(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0xe77(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    11c2 <main+0xa2>
movss  0xe7a(%rip),%xmm0
addss  -0x18(%rbp),%xmm0
movss  0xe69(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe59(%rip),%xmm1
call   1030 <powf@plt>
movss  %xmm0,-0x18(%rbp)
jmp    11d8 <main+0xb8>
movss  -0x18(%rbp),%xmm0
movss  0xe39(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xe38(%rip),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
cmpl   $0xff,-0x14(%rbp)
jne    1221 <main+0x101>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124b <main+0x12b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1246 <main+0x126>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    124b <main+0x12b>
jmp    1250 <main+0x130>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1159 <main+0x39>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xefd(%rip),%rdi
call   1040 <puts@plt>
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xedb(%rip),%rbx
lea    0xece(%rip),%r14
xor    %ebp,%ebp
jmp    1178 <main+0x38>
cmp    $0x100,%ebp
je     11f5 <main+0xb5>
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
divss  0xe79(%rip),%xmm0
ucomiss 0xe76(%rip),%xmm0
jbe    11b0 <main+0x70>
addss  0xe74(%rip),%xmm0
divss  0xe70(%rip),%xmm0
movss  0xe6c(%rip),%xmm1
call   1050 <powf@plt>
jmp    11b8 <main+0x78>
nop
divss  0xe50(%rip),%xmm0
mulss  0xe58(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
cmp    $0xff,%ebp
je     11eb <main+0xab>
add    $0x1,%ebp
test   $0x7,%bpl
jne    1170 <main+0x30>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1170 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe60(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"#include <stdint.h>\0A\00"
@.str.1 = [36 x i8] c"const float xyz_table[256] = {\0A \00"
@.str.2 = [8 x i8] c"%.6ff, \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [6 x i8] c"\0A \00"
@.str.5 = [4 x i8] c"};\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %10
10: ; preds = %46, %2
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 256
br i1 %12, label %13, label %49
13: ; preds = %10
%14 = load i32, i32* %6
%15 = sitofp i32 %14 to float
%16 = fdiv float %15, 2.550000e+02
store float %16, float* %7
%17 = load float, float* %7
%18 = fcmp ogt float %17, 0x3FA4B5DCC0000000
br i1 %18, label %19, label %24
19: ; preds = %13
%20 = load float, float* %7
%21 = fadd float %20, 0x3FAC28F5C0000000
%22 = fdiv float %21, 0x3FF0E147A0000000
%23 = call float @powf(float %22, float 0x4003333340000000)
store float %23, float* %7
br label %27
24: ; preds = %13
%25 = load float, float* %7
%26 = fdiv float %25, 0x4029D70A40000000
store float %26, float* %7
br label %27
27: ; preds = %24, %19
%28 = load float, float* %7
%29 = fmul float %28, 1.000000e+02
store float %29, float* %7
%30 = load float, float* %7
%31 = fpext float %30 to double
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %31)
%33 = load i32, i32* %6
%34 = icmp eq i32 %33, 255
br i1 %34, label %35, label %37
35: ; preds = %27
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %45
37: ; preds = %27
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
%40 = srem i32 %39, 8
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %37
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %44
44: ; preds = %42, %37
br label %45
45: ; preds = %44, %35
br label %46
46: ; preds = %45
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %10
49: ; preds = %10
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [36 x i8] c"const float xyz_table[256] = {\0A \00"
@.str.2 = [8 x i8] c"%.6ff, \00"
@.str.4 = [6 x i8] c"\0A \00"
@str = [20 x i8] c"#include <stdint.h>\00"
@str.6 = [3 x i8] c"};\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %7
5: ; preds = %32, %24
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.6, i64 0, i64 0))
ret i32 0
7: ; preds = %2, %32
%8 = phi i32 [ 0, %2 ], [ %27, %32 ]
%9 = sitofp i32 %8 to float
%10 = fdiv float %9, 2.550000e+02
%11 = fcmp ogt float %10, 0x3FA4B5DCC0000000
br i1 %11, label %12, label %16
12: ; preds = %7
%13 = fadd float %10, 0x3FAC28F5C0000000
%14 = fdiv float %13, 0x3FF0E147A0000000
%15 = tail call float @powf(float %14, float 0x4003333340000000)
br label %18
16: ; preds = %7
%17 = fdiv float %10, 0x4029D70A40000000
br label %18
18: ; preds = %16, %12
%19 = phi float [ %15, %12 ], [ %17, %16 ]
%20 = fmul float %19, 1.000000e+02
%21 = fpext float %20 to double
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %21)
%23 = icmp eq i32 %8, 255
br i1 %23, label %24, label %26
24: ; preds = %18
%25 = tail call i32 @putchar(i32 10)
br label %5
26: ; preds = %18
%27 = add nuw nsw i32 %8, 1
%28 = and i32 %27, 7
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %32
32: ; preds = %26, %30
%33 = icmp eq i32 %27, 256
br i1 %33, label %5, label %7
}