#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 /*<<< orphan*/ fill(int *, int /*<<< orphan*/, int, int /*<<< orphan*/,
                        int);
double lookUpCos(int);
double lookUpSin(int);
void init(double *tfstoreA, double *tfstoreB, int *brLookup) {
  int loop = 0;
  for (loop = 0; loop < 64 / 2; loop++) {
    tfstoreA[loop] = lookUpCos(loop);
    tfstoreB[loop] = lookUpSin(loop);
  }
  fill(brLookup, 0, 64, 0, 1);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x20,-0x1c(%rbp)
jge    1194 <init+0x64>
mov    -0x1c(%rbp),%edi
call   1040 <lookUpCos@plt>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%edi
call   1050 <lookUpSin@plt>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1152 <init+0x22>
mov    -0x18(%rbp),%rdi
xor    %ecx,%ecx
mov    $0x40,%edx
mov    $0x1,%r8d
mov    %ecx,%esi
call   1030 <fill@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1040 <lookUpCos@plt>
movsd  %xmm0,(%r12,%rbx,8)
mov    %ebx,%edi
call   1050 <lookUpSin@plt>
movsd  %xmm0,(%r15,%rbx,8)
add    $0x1,%rbx
cmp    $0x20,%rbx
jne    1150 <init+0x20>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x40,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <fill@plt>

LLVM IR (-O0):
define void @init(double* %0, double* %1, i32* %2) {
%4 = alloca double*
%5 = alloca double*
%6 = alloca i32*
%7 = alloca i32
store double* %0, double** %4
store double* %1, double** %5
store i32* %2, i32** %6
store i32 0, i32* %7
store i32 0, i32* %7
br label %8
8: ; preds = %24, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 32
br i1 %10, label %11, label %27
11: ; preds = %8
%12 = load i32, i32* %7
%13 = call double @lookUpCos(i32 %12)
%14 = load double*, double** %4
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds double, double* %14, i64 %16
store double %13, double* %17
%18 = load i32, i32* %7
%19 = call double @lookUpSin(i32 %18)
%20 = load double*, double** %5
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds double, double* %20, i64 %22
store double %19, double* %23
br label %24
24: ; preds = %11
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
br label %8
27: ; preds = %8
%28 = load i32*, i32** %6
%29 = call i32 @fill(i32* %28, i32 0, i32 64, i32 0, i32 1)
ret void
}

LLVM IR (-O2):
define void @init(double* nocapture writeonly %0, double* nocapture writeonly %1, i32* %2) {
br label %4
4: ; preds = %3, %4
%5 = phi i64 [ 0, %3 ], [ %11, %4 ]
%6 = trunc i64 %5 to i32
%7 = tail call double @lookUpCos(i32 %6)
%8 = getelementptr inbounds double, double* %0, i64 %5
store double %7, double* %8
%9 = tail call double @lookUpSin(i32 %6)
%10 = getelementptr inbounds double, double* %1, i64 %5
store double %9, double* %10
%11 = add nuw nsw i64 %5, 1
%12 = icmp eq i64 %11, 32
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = tail call i32 @fill(i32* %2, i32 0, i32 64, i32 0, i32 1)
ret void
}