#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 rand();
int /*<<< orphan*/ srand(int);
void kkTURB_Init(float *table, int sr) {
  int i;
  srand(sr);
  for (i = 0; i < 256; i++)
    table[i] = -1.0 + 2.0 * (float)(rand() & 255) / 255.0;
}


x86 assembly (clang, -O0):
<kkTURB_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <srand@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x100,-0x10(%rbp)
jge    11a2 <kkTURB_Init+0x82>
mov    $0x0,%al
call   1040 <rand@plt>
and    $0xff,%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea9(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe95(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xe81(%rip),%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113e <kkTURB_Init+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kkTURB_Init>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    %esi,%edi
call   1030 <srand@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <rand@plt>
movzbl %al,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
divsd  0xeaf(%rip),%xmm0
addsd  0xeaf(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1130 <kkTURB_Init+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @kkTURB_Init(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @srand(i32 %6)
store i32 0, i32* %5
br label %8
8: ; preds = %24, %2
%9 = load i32, i32* %5
%10 = icmp slt i32 %9, 256
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = call i32 (...) @rand()
%13 = and i32 %12, 255
%14 = sitofp i32 %13 to float
%15 = fpext float %14 to double
%16 = fmul double 2.000000e+00, %15
%17 = fdiv double %16, 2.550000e+02
%18 = fadd double -1.000000e+00, %17
%19 = fptrunc double %18 to float
%20 = load float*, float** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds float, float* %20, i64 %22
store float %19, float* %23
br label %24
24: ; preds = %11
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %8
27: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @kkTURB_Init(float* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @srand(i32 %1)
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %15, %4 ]
%6 = tail call i32 (...) @rand()
%7 = and i32 %6, 255
%8 = sitofp i32 %7 to float
%9 = fpext float %8 to double
%10 = fmul double %9, 2.000000e+00
%11 = fdiv double %10, 2.550000e+02
%12 = fadd double %11, -1.000000e+00
%13 = fptrunc double %12 to float
%14 = getelementptr inbounds float, float* %0, i64 %5
store float %13, float* %14
%15 = add nuw nsw i64 %5, 1
%16 = icmp eq i64 %15, 256
br i1 %16, label %17, label %4
17: ; preds = %4
ret void
}