#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*/ cl_program;
typedef int /*<<< orphan*/ cl_platform_id;
typedef unsigned int cl_mem;
typedef int /*<<< orphan*/ cl_kernel;
typedef int /*<<< orphan*/ cl_int;
typedef int /*<<< orphan*/ cl_device_id;
typedef int /*<<< orphan*/ cl_context;
typedef int /*<<< orphan*/ cl_command_queue;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ CL_DEVICE_TYPE_CPU;
int /*<<< orphan*/ CL_MEM_READ_ONLY;
int /*<<< orphan*/ CL_MEM_WRITE_ONLY;
int /*<<< orphan*/ CL_TRUE;
size_t ceil(unsigned int);
int /*<<< orphan*/ clBuildProgram(int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                  int /*<<< orphan*/ *);
unsigned int clCreateBuffer(int /*<<< orphan*/, int /*<<< orphan*/, size_t,
                            int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clCreateCommandQueue(int /*<<< orphan*/, int /*<<< orphan*/,
                                        int /*<<< orphan*/,
                                        int /*<<< orphan*/ *);
int /*<<< orphan*/ clCreateContext(int /*<<< orphan*/, int,
                                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clCreateKernel(int /*<<< orphan*/, char *,
                                  int /*<<< orphan*/ *);
int /*<<< orphan*/ clCreateProgramWithSource(int /*<<< orphan*/, int,
                                             char const **, size_t const *,
                                             int /*<<< orphan*/ *);
int /*<<< orphan*/ clEnqueueNDRangeKernel(
    int /*<<< orphan*/, int /*<<< orphan*/, int, int /*<<< orphan*/ *, size_t *,
    size_t *, int /*<<< orphan*/, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clEnqueueReadBuffer(int /*<<< orphan*/, unsigned int,
                                       int /*<<< orphan*/, int /*<<< orphan*/,
                                       size_t, float *, int /*<<< orphan*/,
                                       int /*<<< orphan*/ *,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ clEnqueueWriteBuffer(int /*<<< orphan*/, unsigned int,
                                        int /*<<< orphan*/, int /*<<< orphan*/,
                                        size_t, float *, int /*<<< orphan*/,
                                        int /*<<< orphan*/ *,
                                        int /*<<< orphan*/ *);
int /*<<< orphan*/ clFinish(int /*<<< orphan*/);
int /*<<< orphan*/ clGetDeviceIDs(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                  int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clGetPlatformIDs(int, int /*<<< orphan*/ *,
                                    int /*<<< orphan*/ *);
int /*<<< orphan*/ clReleaseCommandQueue(int /*<<< orphan*/);
int /*<<< orphan*/ clReleaseContext(int /*<<< orphan*/);
int /*<<< orphan*/ clReleaseKernel(int /*<<< orphan*/);
int /*<<< orphan*/ clReleaseMemObject(unsigned int);
int /*<<< orphan*/ clReleaseProgram(int /*<<< orphan*/);
int /*<<< orphan*/ clSetKernelArg(int /*<<< orphan*/, int, int, unsigned int *);
float cosf(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
size_t fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printSystemInfo(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, float, float, float);
float sinf(int);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  unsigned int n = 10;
  float *h_a;
  float *h_b;
  float *h_c;
  cl_mem d_a;
  cl_mem d_b;
  cl_mem d_c;
  cl_platform_id platform_id;
  cl_device_id device_id;
  cl_context context;
  cl_command_queue queue;
  cl_program program;
  cl_kernel kernel;
  size_t bytes = n * sizeof(float);
  h_a = (float *)malloc(bytes);
  h_b = (float *)malloc(bytes);
  h_c = (float *)malloc(bytes);
  FILE *fp;
  fp = fopen("kernel_addVector.cl", "r");
  if (!fp) {
    fprintf(stderr, "Failed to load kernel.\n");
    exit(1);
  }
  char *source_str;
  size_t source_size;
  source_str = (char *)malloc((0x100000));
  source_size = fread(source_str, 1, (0x100000), fp);
  fclose(fp);
  int i;
  for (i = 0; i < n; i++) {
    h_a[i] = sinf(i) * sinf(i);
    h_b[i] = cosf(i) * cosf(i);
  }
  size_t globalSize, localSize;
  cl_int err;
  localSize = 64;
  globalSize = ceil(n / (float)localSize) * localSize;
  err = clGetPlatformIDs(1, &platform_id, NULL);
  err = clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_CPU, 1, &device_id, NULL);
  err = printSystemInfo(platform_id, device_id);
  context = clCreateContext(0, 1, &device_id, NULL, NULL, &err);
  queue = clCreateCommandQueue(context, device_id, 0, &err);
  program = clCreateProgramWithSource(context, 1, (const char **)&source_str,
                                      (const size_t *)&source_size, &err);
  clBuildProgram(program, 1, &device_id, NULL, NULL, NULL);
  kernel = clCreateKernel(program, "addVector", &err);
  d_a = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, NULL);
  d_b = clCreateBuffer(context, CL_MEM_READ_ONLY, bytes, NULL, NULL);
  d_c = clCreateBuffer(context, CL_MEM_WRITE_ONLY, bytes, NULL, NULL);
  err = clEnqueueWriteBuffer(queue, d_a, CL_TRUE, 0, bytes, h_a, 0, NULL, NULL);
  err = clEnqueueWriteBuffer(queue, d_b, CL_TRUE, 0, bytes, h_b, 0, NULL, NULL);
  err = clSetKernelArg(kernel, 0, sizeof(cl_mem), &d_a);
  err = clSetKernelArg(kernel, 1, sizeof(cl_mem), &d_b);
  err = clSetKernelArg(kernel, 2, sizeof(cl_mem), &d_c);
  err = clSetKernelArg(kernel, 3, sizeof(unsigned int), &n);
  err = clEnqueueNDRangeKernel(queue, kernel, 1, NULL, &globalSize, &localSize,
                               0, NULL, NULL);
  clFinish(queue);
  clEnqueueReadBuffer(queue, d_c, CL_TRUE, 0, bytes, h_c, 0, NULL, NULL);
  for (i = 0; i < n; i++)
    printf("a= %f  b= %f  c=a+b= %f \n", h_a[i], h_b[i], h_c[i]);
  clReleaseMemObject(d_a);
  clReleaseMemObject(d_b);
  clReleaseMemObject(d_c);
  clReleaseProgram(program);
  clReleaseKernel(kernel);
  clReleaseCommandQueue(queue);
  clReleaseContext(context);
  free(h_a);
  free(h_b);
  free(h_c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x2,%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
mov    %eax,%edi
call   1170 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x60(%rbp),%rax
mov    %eax,%edi
call   1170 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x60(%rbp),%rax
mov    %eax,%edi
call   1170 <malloc@plt>
mov    %rax,-0x30(%rbp)
lea    0xcc1(%rip),%rdi
lea    0xcee(%rip),%rsi
call   11b0 <fopen@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    1379 <main+0x99>
mov    0x2c6f(%rip),%rax
mov    (%rax),%edi
lea    0xcaa(%rip),%rsi
call   1150 <fprintf@plt>
mov    $0x1,%edi
call   11d0 <exit@plt>
mov    $0x100000,%edi
call   1170 <malloc@plt>
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x68(%rbp),%rcx
mov    $0x1,%esi
mov    $0x100000,%edx
call   1080 <fread@plt>
mov    %rax,-0x78(%rbp)
mov    -0x68(%rbp),%rdi
call   10e0 <fclose@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1434 <main+0x154>
mov    -0x7c(%rbp),%edi
call   1050 <sinf@plt>
movss  %xmm0,-0x9c(%rbp)
ff
mov    -0x7c(%rbp),%edi
call   1050 <sinf@plt>
movaps %xmm0,%xmm1
movss  -0x9c(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mov    -0x20(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x7c(%rbp),%edi
call   10f0 <cosf@plt>
movss  %xmm0,-0x98(%rbp)
ff
mov    -0x7c(%rbp),%edi
call   10f0 <cosf@plt>
movaps %xmm0,%xmm1
movss  -0x98(%rbp),%xmm0
ff
mulss  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    13b2 <main+0xd2>
movq   $0x40,-0x90(%rbp)
mov    -0x14(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0xa8(%rbp)
ff
mov    -0x90(%rbp),%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0xa4(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0xa0(%rbp)
ff
js     149b <main+0x1bb>
movss  -0xa4(%rbp),%xmm0
ff
movss  %xmm0,-0xa0(%rbp)
ff
movss  -0xa8(%rbp),%xmm0
ff
movss  -0xa0(%rbp),%xmm1
ff
divss  %xmm1,%xmm0
cvttss2si %xmm0,%rax
mov    %eax,%edi
call   10c0 <ceil@plt>
imul   -0x90(%rbp),%rax
ff
mov    %rax,-0x88(%rbp)
mov    $0x1,%edi
lea    -0x40(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1120 <clGetPlatformIDs@plt>
mov    %eax,-0x94(%rbp)
mov    -0x40(%rbp),%edi
mov    0x2adc(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
lea    -0x44(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   10d0 <clGetDeviceIDs@plt>
mov    %eax,-0x94(%rbp)
mov    -0x40(%rbp),%edi
mov    -0x44(%rbp),%esi
call   11f0 <printSystemInfo@plt>
mov    %eax,-0x94(%rbp)
xor    %edi,%edi
mov    $0x1,%esi
lea    -0x44(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x94(%rbp),%r9
mov    %r8,%rcx
call   1140 <clCreateContext@plt>
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%edi
mov    -0x44(%rbp),%esi
xor    %edx,%edx
lea    -0x94(%rbp),%rcx
call   1110 <clCreateCommandQueue@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%edi
mov    $0x1,%esi
lea    -0x70(%rbp),%rdx
lea    -0x78(%rbp),%rcx
lea    -0x94(%rbp),%r8
call   1070 <clCreateProgramWithSource@plt>
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%edi
mov    $0x1,%esi
lea    -0x44(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%rcx
mov    %r9,%r8
call   1030 <clBuildProgram@plt>
mov    -0x50(%rbp),%edi
lea    0xa96(%rip),%rsi
lea    -0x94(%rbp),%rdx
call   11c0 <clCreateKernel@plt>
mov    %eax,-0x54(%rbp)
mov    -0x48(%rbp),%edi
mov    0x2a11(%rip),%rax
mov    (%rax),%esi
mov    -0x60(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   10a0 <clCreateBuffer@plt>
mov    %eax,-0x34(%rbp)
mov    -0x48(%rbp),%edi
mov    0x29f1(%rip),%rax
mov    (%rax),%esi
mov    -0x60(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   10a0 <clCreateBuffer@plt>
mov    %eax,-0x38(%rbp)
mov    -0x48(%rbp),%edi
mov    0x29f1(%rip),%rax
mov    (%rax),%esi
mov    -0x60(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rcx
call   10a0 <clCreateBuffer@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    0x29d6(%rip),%rax
mov    (%rax),%edx
mov    -0x60(%rbp),%r8
mov    -0x20(%rbp),%r9
xor    %ecx,%ecx
xor    %eax,%eax
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1200 <clEnqueueWriteBuffer@plt>
mov    %eax,-0x94(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x38(%rbp),%esi
mov    0x2997(%rip),%rax
mov    (%rax),%edx
mov    -0x60(%rbp),%r8
mov    -0x28(%rbp),%r9
xor    %ecx,%ecx
xor    %eax,%eax
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1200 <clEnqueueWriteBuffer@plt>
mov    %eax,-0x94(%rbp)
mov    -0x54(%rbp),%edi
xor    %esi,%esi
mov    $0x4,%edx
lea    -0x34(%rbp),%rcx
call   11e0 <clSetKernelArg@plt>
mov    %eax,-0x94(%rbp)
mov    -0x54(%rbp),%edi
mov    $0x1,%esi
mov    $0x4,%edx
lea    -0x38(%rbp),%rcx
call   11e0 <clSetKernelArg@plt>
mov    %eax,-0x94(%rbp)
mov    -0x54(%rbp),%edi
mov    $0x2,%esi
mov    $0x4,%edx
lea    -0x3c(%rbp),%rcx
call   11e0 <clSetKernelArg@plt>
mov    %eax,-0x94(%rbp)
mov    -0x54(%rbp),%edi
mov    $0x3,%esi
mov    $0x4,%edx
lea    -0x14(%rbp),%rcx
call   11e0 <clSetKernelArg@plt>
mov    %eax,-0x94(%rbp)
mov    -0x4c(%rbp),%edi
mov    -0x54(%rbp),%esi
mov    $0x1,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x88(%rbp),%r8
lea    -0x90(%rbp),%r9
xor    %eax,%eax
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1100 <clEnqueueNDRangeKernel@plt>
mov    %eax,-0x94(%rbp)
mov    -0x4c(%rbp),%edi
call   1060 <clFinish@plt>
mov    -0x4c(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    0x28a0(%rip),%rax
mov    (%rax),%edx
mov    -0x60(%rbp),%r8
mov    -0x30(%rbp),%r9
xor    %ecx,%ecx
xor    %eax,%eax
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1180 <clEnqueueReadBuffer@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    17c8 <main+0x4e8>
mov    -0x20(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm1
mov    -0x30(%rbp),%rax
movslq -0x7c(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm2
lea    0x881(%rip),%rdi
call   1130 <printf@plt>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    177b <main+0x49b>
mov    -0x34(%rbp),%edi
call   11a0 <clReleaseMemObject@plt>
mov    -0x38(%rbp),%edi
call   11a0 <clReleaseMemObject@plt>
mov    -0x3c(%rbp),%edi
call   11a0 <clReleaseMemObject@plt>
mov    -0x50(%rbp),%edi
call   10b0 <clReleaseProgram@plt>
mov    -0x54(%rbp),%edi
call   1090 <clReleaseKernel@plt>
mov    -0x4c(%rbp),%edi
call   1160 <clReleaseCommandQueue@plt>
mov    -0x48(%rbp),%edi
call   1190 <clReleaseContext@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
mov    -0x28(%rbp),%rdi
call   1040 <free@plt>
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
movl   $0xa,0x34(%rsp)
mov    $0x28,%edi
call   1170 <malloc@plt>
mov    %rax,%r14
mov    $0x28,%edi
call   1170 <malloc@plt>
mov    %rax,%r13
mov    $0x28,%edi
call   1170 <malloc@plt>
mov    %rax,0x50(%rsp)
lea    0xcea(%rip),%rdi
lea    0xd17(%rip),%rsi
call   11b0 <fopen@plt>
test   %rax,%rax
je     196f <main+0x68f>
mov    %rax,%rbp
mov    $0x100000,%edi
call   1170 <malloc@plt>
mov    %rax,0x70(%rsp)
mov    %rax,%rdi
mov    $0x1,%esi
mov    $0x100000,%edx
mov    %rbp,%rcx
call   1080 <fread@plt>
mov    %rax,0x68(%rsp)
mov    %rbp,%rdi
call   10e0 <fclose@plt>
xor    %edi,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
xor    %edi,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,(%r14)
xor    %edi,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
xor    %edi,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x0(%r13)
mov    $0x1,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x1,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x4(%r14)
mov    $0x1,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x1,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x4(%r13)
mov    $0x2,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x2,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x8(%r14)
mov    $0x2,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x2,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x8(%r13)
mov    $0x3,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x3,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0xc(%r14)
mov    $0x3,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x3,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0xc(%r13)
mov    $0x4,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x4,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x10(%r14)
mov    $0x4,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x4,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x10(%r13)
mov    $0x5,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x5,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x14(%r14)
mov    $0x5,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x5,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x14(%r13)
mov    $0x6,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x6,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x18(%r14)
mov    $0x6,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x6,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x18(%r13)
mov    $0x7,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x7,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x1c(%r14)
mov    $0x7,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x7,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x1c(%r13)
mov    $0x8,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x8,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x20(%r14)
mov    $0x8,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x8,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x20(%r13)
mov    $0x9,%edi
call   1050 <sinf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x9,%edi
call   1050 <sinf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x24(%r14)
mov    $0x9,%edi
call   10f0 <cosf@plt>
movss  %xmm0,0x24(%rsp)
mov    $0x9,%edi
call   10f0 <cosf@plt>
mulss  0x24(%rsp),%xmm0
movss  %xmm0,0x24(%r13)
movq   $0x40,0x58(%rsp)
xor    %edi,%edi
call   10c0 <ceil@plt>
shl    $0x6,%rax
mov    %rax,0x60(%rsp)
lea    0x3c(%rsp),%rsi
mov    $0x1,%edi
xor    %edx,%edx
call   1120 <clGetPlatformIDs@plt>
mov    0x3c(%rsp),%edi
mov    0x2939(%rip),%rax
mov    (%rax),%esi
lea    0x38(%rsp),%r12
mov    $0x1,%edx
mov    %r12,%rcx
xor    %r8d,%r8d
call   10d0 <clGetDeviceIDs@plt>
mov    0x3c(%rsp),%edi
mov    0x38(%rsp),%esi
call   11f0 <printSystemInfo@plt>
mov    %eax,0x28(%rsp)
lea    0x28(%rsp),%rbx
xor    %edi,%edi
mov    $0x1,%esi
mov    %r12,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    %rbx,%r9
call   1140 <clCreateContext@plt>
mov    %eax,%r15d
mov    0x38(%rsp),%esi
mov    %eax,%edi
xor    %edx,%edx
mov    %rbx,%rcx
call   1110 <clCreateCommandQueue@plt>
mov    %eax,0x48(%rsp)
lea    0x70(%rsp),%rdx
lea    0x68(%rsp),%rcx
mov    %r15d,%edi
mov    $0x1,%esi
mov    %rbx,%r8
call   1070 <clCreateProgramWithSource@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0x1,%esi
mov    %r12,%rdx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <clBuildProgram@plt>
lea    0x918(%rip),%rsi
mov    %ebp,0x4c(%rsp)
mov    %ebp,%edi
mov    %rbx,%rdx
call   11c0 <clCreateKernel@plt>
mov    %eax,%ebx
mov    0x2885(%rip),%rbp
mov    0x0(%rbp),%esi
mov    $0x28,%edx
mov    %r15d,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10a0 <clCreateBuffer@plt>
mov    %eax,%r12d
mov    %eax,0x44(%rsp)
mov    0x0(%rbp),%esi
mov    $0x28,%edx
mov    %r15d,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10a0 <clCreateBuffer@plt>
mov    %eax,0x2c(%rsp)
mov    %eax,0x40(%rsp)
mov    0x2865(%rip),%rax
mov    (%rax),%esi
mov    $0x28,%edx
mov    %r15d,0x24(%rsp)
mov    %r15d,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10a0 <clCreateBuffer@plt>
mov    %eax,0x30(%rsp)
mov    0x2849(%rip),%r15
mov    (%r15),%edx
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
mov    $0x28,%r8d
mov    0x48(%rsp),%ebp
mov    %ebp,%edi
mov    %r12d,%esi
xor    %ecx,%ecx
mov    %r14,%r9
call   1200 <clEnqueueWriteBuffer@plt>
mov    %eax,0x28(%rsp)
mov    (%r15),%edx
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
mov    $0x28,%r8d
mov    %ebp,%edi
mov    0x2c(%rsp),%esi
mov    %ebp,%r12d
xor    %ecx,%ecx
mov    %r13,%r9
call   1200 <clEnqueueWriteBuffer@plt>
mov    %eax,0x28(%rsp)
lea    0x44(%rsp),%rcx
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x4,%edx
call   11e0 <clSetKernelArg@plt>
mov    %eax,0x28(%rsp)
lea    0x40(%rsp),%rcx
mov    %ebx,%edi
mov    $0x1,%esi
mov    $0x4,%edx
call   11e0 <clSetKernelArg@plt>
mov    %eax,0x28(%rsp)
lea    0x30(%rsp),%rcx
mov    %ebx,%edi
mov    $0x2,%esi
mov    $0x4,%edx
call   11e0 <clSetKernelArg@plt>
mov    %eax,0x28(%rsp)
lea    0x34(%rsp),%rcx
mov    %ebx,%edi
mov    $0x3,%esi
mov    $0x4,%edx
call   11e0 <clSetKernelArg@plt>
mov    %eax,0x28(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
lea    0x60(%rsp),%r8
lea    0x58(%rsp),%r9
mov    %ebp,%edi
mov    %ebx,0x2c(%rsp)
mov    %ebx,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1100 <clEnqueueNDRangeKernel@plt>
mov    %eax,0x28(%rsp)
mov    %ebp,%edi
call   1060 <clFinish@plt>
mov    0x30(%rsp),%esi
mov    (%r15),%edx
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
mov    $0x28,%r8d
mov    %ebp,%edi
xor    %ecx,%ecx
mov    0x50(%rsp),%rbp
mov    %rbp,%r9
call   1180 <clEnqueueReadBuffer@plt>
cmpl   $0x0,0x34(%rsp)
je     1908 <main+0x628>
xor    %ebx,%ebx
lea    0x76f(%rip),%r15
nopw   0x0(%rax,%rax,1)
movss  (%r14,%rbx,4),%xmm0
movss  0x0(%r13,%rbx,4),%xmm1
movss  0x0(%rbp,%rbx,4),%xmm2
mov    %r15,%rdi
call   1130 <printf@plt>
add    $0x1,%rbx
mov    0x34(%rsp),%eax
cmp    %rax,%rbx
jb     18e0 <main+0x600>
mov    0x44(%rsp),%edi
call   11a0 <clReleaseMemObject@plt>
mov    0x40(%rsp),%edi
call   11a0 <clReleaseMemObject@plt>
mov    0x30(%rsp),%edi
call   11a0 <clReleaseMemObject@plt>
mov    0x4c(%rsp),%edi
call   10b0 <clReleaseProgram@plt>
mov    0x2c(%rsp),%edi
call   1090 <clReleaseKernel@plt>
mov    %r12d,%edi
call   1160 <clReleaseCommandQueue@plt>
mov    0x24(%rsp),%edi
call   1190 <clReleaseContext@plt>
mov    %r14,%rdi
call   1040 <free@plt>
mov    %r13,%rdi
call   1040 <free@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x265a(%rip),%rax
mov    (%rax),%edi
lea    0x6a5(%rip),%rsi
call   1150 <fprintf@plt>
mov    $0x1,%edi
call   11d0 <exit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"kernel_addVector.cl\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [24 x i8] c"Failed to load kernel.\0A\00"
@CL_DEVICE_TYPE_CPU = global i32 0
@.str.3 = [10 x i8] c"addVector\00"
@CL_MEM_READ_ONLY = global i32 0
@CL_MEM_WRITE_ONLY = global i32 0
@CL_TRUE = global i32 0
@.str.4 = [26 x i8] c"a= %f b= %f c=a+b= %f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca float*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i64
%20 = alloca i32*
%21 = alloca i8*
%22 = alloca i64
%23 = alloca i32
%24 = alloca i64
%25 = alloca i64
%26 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 10, i32* %6
%27 = load i32, i32* %6
%28 = zext i32 %27 to i64
%29 = mul i64 %28, 4
store i64 %29, i64* %19
%30 = load i64, i64* %19
%31 = trunc i64 %30 to i32
%32 = call i64 @malloc(i32 %31)
%33 = inttoptr i64 %32 to float*
store float* %33, float** %7
%34 = load i64, i64* %19
%35 = trunc i64 %34 to i32
%36 = call i64 @malloc(i32 %35)
%37 = inttoptr i64 %36 to float*
store float* %37, float** %8
%38 = load i64, i64* %19
%39 = trunc i64 %38 to i32
%40 = call i64 @malloc(i32 %39)
%41 = inttoptr i64 %40 to float*
store float* %41, float** %9
%42 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %42, i32** %20
%43 = load i32*, i32** %20
%44 = icmp ne i32* %43, null
br i1 %44, label %49, label %45
45: ; preds = %2
%46 = load i32, i32* @stderr
%47 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %2
%50 = call i64 @malloc(i32 1048576)
%51 = inttoptr i64 %50 to i8*
store i8* %51, i8** %21
%52 = load i8*, i8** %21
%53 = load i32*, i32** %20
%54 = call i64 @fread(i8* %52, i32 1, i32 1048576, i32* %53)
store i64 %54, i64* %22
%55 = load i32*, i32** %20
%56 = call i32 @fclose(i32* %55)
store i32 0, i32* %23
br label %57
57: ; preds = %80, %49
%58 = load i32, i32* %23
%59 = load i32, i32* %6
%60 = icmp ult i32 %58, %59
br i1 %60, label %61, label %83
61: ; preds = %57
%62 = load i32, i32* %23
%63 = call float @sinf(i32 %62)
%64 = load i32, i32* %23
%65 = call float @sinf(i32 %64)
%66 = fmul float %63, %65
%67 = load float*, float** %7
%68 = load i32, i32* %23
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds float, float* %67, i64 %69
store float %66, float* %70
%71 = load i32, i32* %23
%72 = call float @cosf(i32 %71)
%73 = load i32, i32* %23
%74 = call float @cosf(i32 %73)
%75 = fmul float %72, %74
%76 = load float*, float** %8
%77 = load i32, i32* %23
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds float, float* %76, i64 %78
store float %75, float* %79
br label %80
80: ; preds = %61
%81 = load i32, i32* %23
%82 = add nsw i32 %81, 1
store i32 %82, i32* %23
br label %57
83: ; preds = %57
store i64 64, i64* %25
%84 = load i32, i32* %6
%85 = uitofp i32 %84 to float
%86 = load i64, i64* %25
%87 = uitofp i64 %86 to float
%88 = fdiv float %85, %87
%89 = fptoui float %88 to i32
%90 = call i64 @ceil(i32 %89)
%91 = load i64, i64* %25
%92 = mul i64 %90, %91
store i64 %92, i64* %24
%93 = call i32 @clGetPlatformIDs(i32 1, i32* %13, i32* null)
store i32 %93, i32* %26
%94 = load i32, i32* %13
%95 = load i32, i32* @CL_DEVICE_TYPE_CPU
%96 = call i32 @clGetDeviceIDs(i32 %94, i32 %95, i32 1, i32* %14, i32* null)
store i32 %96, i32* %26
%97 = load i32, i32* %13
%98 = load i32, i32* %14
%99 = call i32 @printSystemInfo(i32 %97, i32 %98)
store i32 %99, i32* %26
%100 = call i32 @clCreateContext(i32 0, i32 1, i32* %14, i32* null, i32* null, i32* %26)
store i32 %100, i32* %15
%101 = load i32, i32* %15
%102 = load i32, i32* %14
%103 = call i32 @clCreateCommandQueue(i32 %101, i32 %102, i32 0, i32* %26)
store i32 %103, i32* %16
%104 = load i32, i32* %15
%105 = call i32 @clCreateProgramWithSource(i32 %104, i32 1, i8** %21, i64* %22, i32* %26)
store i32 %105, i32* %17
%106 = load i32, i32* %17
%107 = call i32 @clBuildProgram(i32 %106, i32 1, i32* %14, i32* null, i32* null, i32* null)
%108 = load i32, i32* %17
%109 = call i32 @clCreateKernel(i32 %108, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32* %26)
store i32 %109, i32* %18
%110 = load i32, i32* %15
%111 = load i32, i32* @CL_MEM_READ_ONLY
%112 = load i64, i64* %19
%113 = call i32 @clCreateBuffer(i32 %110, i32 %111, i64 %112, i32* null, i32* null)
store i32 %113, i32* %10
%114 = load i32, i32* %15
%115 = load i32, i32* @CL_MEM_READ_ONLY
%116 = load i64, i64* %19
%117 = call i32 @clCreateBuffer(i32 %114, i32 %115, i64 %116, i32* null, i32* null)
store i32 %117, i32* %11
%118 = load i32, i32* %15
%119 = load i32, i32* @CL_MEM_WRITE_ONLY
%120 = load i64, i64* %19
%121 = call i32 @clCreateBuffer(i32 %118, i32 %119, i64 %120, i32* null, i32* null)
store i32 %121, i32* %12
%122 = load i32, i32* %16
%123 = load i32, i32* %10
%124 = load i32, i32* @CL_TRUE
%125 = load i64, i64* %19
%126 = load float*, float** %7
%127 = call i32 @clEnqueueWriteBuffer(i32 %122, i32 %123, i32 %124, i32 0, i64 %125, float* %126, i32 0, i32* null, i32* null)
store i32 %127, i32* %26
%128 = load i32, i32* %16
%129 = load i32, i32* %11
%130 = load i32, i32* @CL_TRUE
%131 = load i64, i64* %19
%132 = load float*, float** %8
%133 = call i32 @clEnqueueWriteBuffer(i32 %128, i32 %129, i32 %130, i32 0, i64 %131, float* %132, i32 0, i32* null, i32* null)
store i32 %133, i32* %26
%134 = load i32, i32* %18
%135 = call i32 @clSetKernelArg(i32 %134, i32 0, i32 4, i32* %10)
store i32 %135, i32* %26
%136 = load i32, i32* %18
%137 = call i32 @clSetKernelArg(i32 %136, i32 1, i32 4, i32* %11)
store i32 %137, i32* %26
%138 = load i32, i32* %18
%139 = call i32 @clSetKernelArg(i32 %138, i32 2, i32 4, i32* %12)
store i32 %139, i32* %26
%140 = load i32, i32* %18
%141 = call i32 @clSetKernelArg(i32 %140, i32 3, i32 4, i32* %6)
store i32 %141, i32* %26
%142 = load i32, i32* %16
%143 = load i32, i32* %18
%144 = call i32 @clEnqueueNDRangeKernel(i32 %142, i32 %143, i32 1, i32* null, i64* %24, i64* %25, i32 0, i32* null, i32* null)
store i32 %144, i32* %26
%145 = load i32, i32* %16
%146 = call i32 @clFinish(i32 %145)
%147 = load i32, i32* %16
%148 = load i32, i32* %12
%149 = load i32, i32* @CL_TRUE
%150 = load i64, i64* %19
%151 = load float*, float** %9
%152 = call i32 @clEnqueueReadBuffer(i32 %147, i32 %148, i32 %149, i32 0, i64 %150, float* %151, i32 0, i32* null, i32* null)
store i32 0, i32* %23
br label %153
153: ; preds = %174, %83
%154 = load i32, i32* %23
%155 = load i32, i32* %6
%156 = icmp ult i32 %154, %155
br i1 %156, label %157, label %177
157: ; preds = %153
%158 = load float*, float** %7
%159 = load i32, i32* %23
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds float, float* %158, i64 %160
%162 = load float, float* %161
%163 = load float*, float** %8
%164 = load i32, i32* %23
%165 = sext i32 %164 to i64
%166 = getelementptr inbounds float, float* %163, i64 %165
%167 = load float, float* %166
%168 = load float*, float** %9
%169 = load i32, i32* %23
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds float, float* %168, i64 %170
%172 = load float, float* %171
%173 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), float %162, float %167, float %172)
br label %174
174: ; preds = %157
%175 = load i32, i32* %23
%176 = add nsw i32 %175, 1
store i32 %176, i32* %23
br label %153
177: ; preds = %153
%178 = load i32, i32* %10
%179 = call i32 @clReleaseMemObject(i32 %178)
%180 = load i32, i32* %11
%181 = call i32 @clReleaseMemObject(i32 %180)
%182 = load i32, i32* %12
%183 = call i32 @clReleaseMemObject(i32 %182)
%184 = load i32, i32* %17
%185 = call i32 @clReleaseProgram(i32 %184)
%186 = load i32, i32* %18
%187 = call i32 @clReleaseKernel(i32 %186)
%188 = load i32, i32* %16
%189 = call i32 @clReleaseCommandQueue(i32 %188)
%190 = load i32, i32* %15
%191 = call i32 @clReleaseContext(i32 %190)
%192 = load float*, float** %7
%193 = call i32 @free(float* %192)
%194 = load float*, float** %8
%195 = call i32 @free(float* %194)
%196 = load float*, float** %9
%197 = call i32 @free(float* %196)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"kernel_addVector.cl\00"
@.str.1 = [2 x i8] c"r\00"
@stderr = global i32 0
@.str.2 = [24 x i8] c"Failed to load kernel.\0A\00"
@CL_DEVICE_TYPE_CPU = global i32 0
@.str.3 = [10 x i8] c"addVector\00"
@CL_MEM_READ_ONLY = global i32 0
@CL_MEM_WRITE_ONLY = global i32 0
@CL_TRUE = global i32 0
@.str.4 = [26 x i8] c"a= %f b= %f c=a+b= %f \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
%14 = bitcast i32* %3 to i8*
store i32 10, i32* %3
%15 = bitcast i32* %4 to i8*
%16 = bitcast i32* %5 to i8*
%17 = bitcast i32* %6 to i8*
%18 = bitcast i32* %7 to i8*
%19 = bitcast i32* %8 to i8*
%20 = tail call i64 @malloc(i32 40)
%21 = inttoptr i64 %20 to float*
%22 = tail call i64 @malloc(i32 40)
%23 = inttoptr i64 %22 to float*
%24 = tail call i64 @malloc(i32 40)
%25 = inttoptr i64 %24 to float*
%26 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i32* %26, null
br i1 %27, label %28, label %32
28: ; preds = %2
%29 = load i32, i32* @stderr
%30 = tail call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %2
%33 = bitcast i8** %9 to i8*
%34 = bitcast i64* %10 to i8*
%35 = tail call i64 @malloc(i32 1048576)
%36 = inttoptr i64 %35 to i8*
store i8* %36, i8** %9
%37 = tail call i64 @fread(i8* %36, i32 1, i32 1048576, i32* %26)
store i64 %37, i64* %10
%38 = tail call i32 @fclose(i32* %26)
%39 = tail call float @sinf(i32 0)
%40 = tail call float @sinf(i32 0)
%41 = fmul float %39, %40
store float %41, float* %21
%42 = tail call float @cosf(i32 0)
%43 = tail call float @cosf(i32 0)
%44 = fmul float %42, %43
store float %44, float* %23
%45 = tail call float @sinf(i32 1)
%46 = tail call float @sinf(i32 1)
%47 = fmul float %45, %46
%48 = getelementptr inbounds float, float* %21, i64 1
store float %47, float* %48
%49 = tail call float @cosf(i32 1)
%50 = tail call float @cosf(i32 1)
%51 = fmul float %49, %50
%52 = getelementptr inbounds float, float* %23, i64 1
store float %51, float* %52
%53 = tail call float @sinf(i32 2)
%54 = tail call float @sinf(i32 2)
%55 = fmul float %53, %54
%56 = getelementptr inbounds float, float* %21, i64 2
store float %55, float* %56
%57 = tail call float @cosf(i32 2)
%58 = tail call float @cosf(i32 2)
%59 = fmul float %57, %58
%60 = getelementptr inbounds float, float* %23, i64 2
store float %59, float* %60
%61 = tail call float @sinf(i32 3)
%62 = tail call float @sinf(i32 3)
%63 = fmul float %61, %62
%64 = getelementptr inbounds float, float* %21, i64 3
store float %63, float* %64
%65 = tail call float @cosf(i32 3)
%66 = tail call float @cosf(i32 3)
%67 = fmul float %65, %66
%68 = getelementptr inbounds float, float* %23, i64 3
store float %67, float* %68
%69 = tail call float @sinf(i32 4)
%70 = tail call float @sinf(i32 4)
%71 = fmul float %69, %70
%72 = getelementptr inbounds float, float* %21, i64 4
store float %71, float* %72
%73 = tail call float @cosf(i32 4)
%74 = tail call float @cosf(i32 4)
%75 = fmul float %73, %74
%76 = getelementptr inbounds float, float* %23, i64 4
store float %75, float* %76
%77 = tail call float @sinf(i32 5)
%78 = tail call float @sinf(i32 5)
%79 = fmul float %77, %78
%80 = getelementptr inbounds float, float* %21, i64 5
store float %79, float* %80
%81 = tail call float @cosf(i32 5)
%82 = tail call float @cosf(i32 5)
%83 = fmul float %81, %82
%84 = getelementptr inbounds float, float* %23, i64 5
store float %83, float* %84
%85 = tail call float @sinf(i32 6)
%86 = tail call float @sinf(i32 6)
%87 = fmul float %85, %86
%88 = getelementptr inbounds float, float* %21, i64 6
store float %87, float* %88
%89 = tail call float @cosf(i32 6)
%90 = tail call float @cosf(i32 6)
%91 = fmul float %89, %90
%92 = getelementptr inbounds float, float* %23, i64 6
store float %91, float* %92
%93 = tail call float @sinf(i32 7)
%94 = tail call float @sinf(i32 7)
%95 = fmul float %93, %94
%96 = getelementptr inbounds float, float* %21, i64 7
store float %95, float* %96
%97 = tail call float @cosf(i32 7)
%98 = tail call float @cosf(i32 7)
%99 = fmul float %97, %98
%100 = getelementptr inbounds float, float* %23, i64 7
store float %99, float* %100
%101 = tail call float @sinf(i32 8)
%102 = tail call float @sinf(i32 8)
%103 = fmul float %101, %102
%104 = getelementptr inbounds float, float* %21, i64 8
store float %103, float* %104
%105 = tail call float @cosf(i32 8)
%106 = tail call float @cosf(i32 8)
%107 = fmul float %105, %106
%108 = getelementptr inbounds float, float* %23, i64 8
store float %107, float* %108
%109 = tail call float @sinf(i32 9)
%110 = tail call float @sinf(i32 9)
%111 = fmul float %109, %110
%112 = getelementptr inbounds float, float* %21, i64 9
store float %111, float* %112
%113 = tail call float @cosf(i32 9)
%114 = tail call float @cosf(i32 9)
%115 = fmul float %113, %114
%116 = getelementptr inbounds float, float* %23, i64 9
store float %115, float* %116
%117 = bitcast i64* %11 to i8*
%118 = bitcast i64* %12 to i8*
%119 = bitcast i32* %13 to i8*
store i64 64, i64* %12
%120 = tail call i64 @ceil(i32 0)
%121 = shl i64 %120, 6
store i64 %121, i64* %11
%122 = call i32 @clGetPlatformIDs(i32 1, i32* %7, i32* null)
%123 = load i32, i32* %7
%124 = load i32, i32* @CL_DEVICE_TYPE_CPU
%125 = call i32 @clGetDeviceIDs(i32 %123, i32 %124, i32 1, i32* %8, i32* null)
%126 = load i32, i32* %7
%127 = load i32, i32* %8
%128 = call i32 @printSystemInfo(i32 %126, i32 %127)
store i32 %128, i32* %13
%129 = call i32 @clCreateContext(i32 0, i32 1, i32* %8, i32* null, i32* null, i32* %13)
%130 = load i32, i32* %8
%131 = call i32 @clCreateCommandQueue(i32 %129, i32 %130, i32 0, i32* %13)
%132 = call i32 @clCreateProgramWithSource(i32 %129, i32 1, i8** %9, i64* %10, i32* %13)
%133 = call i32 @clBuildProgram(i32 %132, i32 1, i32* %8, i32* null, i32* null, i32* null)
%134 = call i32 @clCreateKernel(i32 %132, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%135 = load i32, i32* @CL_MEM_READ_ONLY
%136 = call i32 @clCreateBuffer(i32 %129, i32 %135, i64 40, i32* null, i32* null)
store i32 %136, i32* %4
%137 = load i32, i32* @CL_MEM_READ_ONLY
%138 = call i32 @clCreateBuffer(i32 %129, i32 %137, i64 40, i32* null, i32* null)
store i32 %138, i32* %5
%139 = load i32, i32* @CL_MEM_WRITE_ONLY
%140 = call i32 @clCreateBuffer(i32 %129, i32 %139, i64 40, i32* null, i32* null)
store i32 %140, i32* %6
%141 = load i32, i32* @CL_TRUE
%142 = call i32 @clEnqueueWriteBuffer(i32 %131, i32 %136, i32 %141, i32 0, i64 40, float* %21, i32 0, i32* null, i32* null)
store i32 %142, i32* %13
%143 = load i32, i32* @CL_TRUE
%144 = call i32 @clEnqueueWriteBuffer(i32 %131, i32 %138, i32 %143, i32 0, i64 40, float* %23, i32 0, i32* null, i32* null)
store i32 %144, i32* %13
%145 = call i32 @clSetKernelArg(i32 %134, i32 0, i32 4, i32* %4)
store i32 %145, i32* %13
%146 = call i32 @clSetKernelArg(i32 %134, i32 1, i32 4, i32* %5)
store i32 %146, i32* %13
%147 = call i32 @clSetKernelArg(i32 %134, i32 2, i32 4, i32* %6)
store i32 %147, i32* %13
%148 = call i32 @clSetKernelArg(i32 %134, i32 3, i32 4, i32* %3)
store i32 %148, i32* %13
%149 = call i32 @clEnqueueNDRangeKernel(i32 %131, i32 %134, i32 1, i32* null, i64* %11, i64* %12, i32 0, i32* null, i32* null)
store i32 %149, i32* %13
%150 = call i32 @clFinish(i32 %131)
%151 = load i32, i32* %6
%152 = load i32, i32* @CL_TRUE
%153 = call i32 @clEnqueueReadBuffer(i32 %131, i32 %151, i32 %152, i32 0, i64 40, float* %25, i32 0, i32* null, i32* null)
%154 = load i32, i32* %3
%155 = icmp eq i32 %154, 0
br i1 %155, label %169, label %156
156: ; preds = %32, %156
%157 = phi i64 [ %165, %156 ], [ 0, %32 ]
%158 = getelementptr inbounds float, float* %21, i64 %157
%159 = load float, float* %158
%160 = getelementptr inbounds float, float* %23, i64 %157
%161 = load float, float* %160
%162 = getelementptr inbounds float, float* %25, i64 %157
%163 = load float, float* %162
%164 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), float %159, float %161, float %163)
%165 = add nuw nsw i64 %157, 1
%166 = load i32, i32* %3
%167 = zext i32 %166 to i64
%168 = icmp ult i64 %165, %167
br i1 %168, label %156, label %169
169: ; preds = %156, %32
%170 = load i32, i32* %4
%171 = call i32 @clReleaseMemObject(i32 %170)
%172 = load i32, i32* %5
%173 = call i32 @clReleaseMemObject(i32 %172)
%174 = load i32, i32* %6
%175 = call i32 @clReleaseMemObject(i32 %174)
%176 = call i32 @clReleaseProgram(i32 %132)
%177 = call i32 @clReleaseKernel(i32 %134)
%178 = call i32 @clReleaseCommandQueue(i32 %131)
%179 = call i32 @clReleaseContext(i32 %129)
%180 = call i32 @free(float* %21)
%181 = call i32 @free(float* %23)
%182 = call i32 @free(float* %25)
ret i32 0
}