void compute_curve_gamma_table_type0(float gamma_table[256]) {
  unsigned int i;
  for (i = 0; i < 256; i++) {
    gamma_table[i] = i / 255.;
  }
}


x86 assembly (clang, -O0):
<compute_curve_gamma_table_type0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jae    114e <compute_curve_gamma_table_type0+0x4e>
mov    -0xc(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  0xed4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
movss  %xmm0,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <compute_curve_gamma_table_type0+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_curve_gamma_table_type0>:
movapd 0xef8(%rip),%xmm0
xor    %eax,%eax
xorpd  %xmm1,%xmm1
movapd 0xefa(%rip),%xmm2
movapd 0xf02(%rip),%xmm3
movdqa 0xf0a(%rip),%xmm4
movdqa 0xf12(%rip),%xmm5
xchg   %ax,%ax
movapd %xmm0,%xmm6
unpckhps %xmm1,%xmm6
orpd   %xmm2,%xmm6
subpd  %xmm2,%xmm6
movapd %xmm0,%xmm7
unpcklps %xmm1,%xmm7
orpd   %xmm2,%xmm7
subpd  %xmm2,%xmm7
divpd  %xmm3,%xmm7
divpd  %xmm3,%xmm6
cvtpd2ps %xmm6,%xmm6
cvtpd2ps %xmm7,%xmm7
unpcklpd %xmm6,%xmm7
movupd %xmm7,(%rdi,%rax,4)
movapd %xmm0,%xmm6
paddd  %xmm4,%xmm6
movdqa %xmm6,%xmm7
punpckhdq %xmm1,%xmm7
por    %xmm2,%xmm7
subpd  %xmm2,%xmm7
punpckldq %xmm1,%xmm6
por    %xmm2,%xmm6
subpd  %xmm2,%xmm6
divpd  %xmm3,%xmm7
cvtpd2ps %xmm7,%xmm7
divpd  %xmm3,%xmm6
cvtpd2ps %xmm6,%xmm6
unpcklpd %xmm7,%xmm6
movupd %xmm6,0x10(%rdi,%rax,4)
add    $0x8,%rax
paddd  %xmm5,%xmm0
cmp    $0x100,%rax
jne    1130 <compute_curve_gamma_table_type0+0x30>
ret

LLVM IR (-O0):
define void @compute_curve_gamma_table_type0(float* %0) {
%2 = alloca float*
%3 = alloca i32
store float* %0, float** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 256
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i32, i32* %3
%9 = uitofp i32 %8 to double
%10 = fdiv double %9, 2.550000e+02
%11 = fptrunc double %10 to float
%12 = load float*, float** %2
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds float, float* %12, i64 %14
store float %11, float* %15
br label %16
16: ; preds = %7
%17 = load i32, i32* %3
%18 = add i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @compute_curve_gamma_table_type0(float* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %17, %2 ]
%4 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %1 ], [ %18, %2 ]
%5 = uitofp <4 x i32> %4 to <4 x double>
%6 = fdiv <4 x double> %5, <double 2.550000e+02, double 2.550000e+02, double 2.550000e+02, double 2.550000e+02>
%7 = fptrunc <4 x double> %6 to <4 x float>
%8 = getelementptr inbounds float, float* %0, i64 %3
%9 = bitcast float* %8 to <4 x float>*
store <4 x float> %7, <4 x float>* %9
%10 = or i64 %3, 4
%11 = add <4 x i32> %4, <i32 4, i32 4, i32 4, i32 4>
%12 = uitofp <4 x i32> %11 to <4 x double>
%13 = fdiv <4 x double> %12, <double 2.550000e+02, double 2.550000e+02, double 2.550000e+02, double 2.550000e+02>
%14 = fptrunc <4 x double> %13 to <4 x float>
%15 = getelementptr inbounds float, float* %0, i64 %10
%16 = bitcast float* %15 to <4 x float>*
store <4 x float> %14, <4 x float>* %16
%17 = add nuw nsw i64 %3, 8
%18 = add <4 x i32> %4, <i32 8, i32 8, i32 8, i32 8>
%19 = icmp eq i64 %17, 256
br i1 %19, label %20, label %2
20: ; preds = %2
ret void
}