#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*/ version;
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};
typedef int /*<<< orphan*/ param;
typedef int numImages;
typedef int /*<<< orphan*/ cl_program;
typedef scalar_t__ cl_platform_id;
typedef int cl_mem;
typedef int /*<<< orphan*/ cl_kernel;
typedef int cl_int;
typedef double cl_float;
typedef int /*<<< orphan*/ *cl_event;
typedef int /*<<< orphan*/ cl_device_id;
typedef scalar_t__ cl_context_properties;
typedef int /*<<< orphan*/ cl_context;
typedef int /*<<< orphan*/ cl_command_queue;
typedef int /*<<< orphan*/ buffer;

/* Variables and functions */
scalar_t__ CL_CONTEXT_PLATFORM;
int /*<<< orphan*/ CL_DEVICE_LOCAL_MEM_SIZE;
int /*<<< orphan*/ CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE;
int /*<<< orphan*/ CL_DEVICE_MAX_WORK_GROUP_SIZE;
int /*<<< orphan*/ CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS;
int /*<<< orphan*/ CL_DEVICE_MAX_WORK_ITEM_SIZES;
int /*<<< orphan*/ CL_DEVICE_TYPE_GPU;
int /*<<< orphan*/ CL_DEVICE_VERSION;
int /*<<< orphan*/ CL_DRIVER_VERSION;
int /*<<< orphan*/ CL_MEM_READ_ONLY;
int /*<<< orphan*/ CL_MEM_READ_WRITE;
int /*<<< orphan*/ CL_PROGRAM_BUILD_LOG;
int CL_SUCCESS;
int /*<<< orphan*/ CL_TRUE;
scalar_t__ calloc(int, int);
int clBuildProgram(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                   int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int clCreateBuffer(int /*<<< orphan*/, int /*<<< orphan*/, int,
                   int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ clCreateCommandQueue(int /*<<< orphan*/, int /*<<< orphan*/,
                                        int /*<<< orphan*/, int *);
int /*<<< orphan*/ clCreateContext(scalar_t__ *, int, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                   int *);
int /*<<< orphan*/ clCreateKernel(int /*<<< orphan*/, char *, int *);
int /*<<< orphan*/ clCreateProgramWithSource(int /*<<< orphan*/, int,
                                             char const **,
                                             int /*<<< orphan*/ *, int *);
int clEnqueueNDRangeKernel(int /*<<< orphan*/, int /*<<< orphan*/, int,
                           int /*<<< orphan*/ *, size_t *, size_t *,
                           int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *);
int clEnqueueReadBuffer(int /*<<< orphan*/, int, int /*<<< orphan*/,
                        int /*<<< orphan*/, int, double *, int /*<<< orphan*/,
                        int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int clEnqueueWriteBuffer(int /*<<< orphan*/, int, int /*<<< orphan*/,
                         int /*<<< orphan*/, int, double *, int /*<<< orphan*/,
                         int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clFinish(int /*<<< orphan*/);
int clGetDeviceIDs(scalar_t__, int /*<<< orphan*/, int, int /*<<< orphan*/ *,
                   int /*<<< orphan*/ *);
int /*<<< orphan*/ clGetDeviceInfo(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                   ...);
int clGetPlatformIDs(int, scalar_t__ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clGetProgramBuildInfo(int /*<<< orphan*/, int /*<<< orphan*/,
                                         int /*<<< orphan*/, int, char *,
                                         size_t *);
int /*<<< orphan*/ clReleaseCommandQueue(int /*<<< orphan*/);
int /*<<< orphan*/ clReleaseContext(int /*<<< orphan*/);
int /*<<< orphan*/ clReleaseMemObject(int);
int /*<<< orphan*/ clSetKernelArg(int /*<<< orphan*/, int, int, ...);
int floor(int);
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
char *loadcusource(char *, char *, int, char *, int, char *, int, char *, int,
                   char *, int, char *, int /*<<< orphan*/, char *, int,
                   int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ usleep(int);
int main() {
  int i, j, k;
  int nthreads = 1;
  int nbOfAverages = 1;
  int opsMAC = 2;
  cl_float *in, *out;
  cl_float *ck;
  double tops;
  cl_int err;
  cl_platform_id platform = 0;
  cl_device_id device = 0;
  cl_context_properties props[3] = {CL_CONTEXT_PLATFORM, 0, 0};
  cl_context ctx = 0;
  cl_command_queue queues[1];
  cl_mem bufin, bufck, bufout;
  cl_event event = NULL;
  cl_program program;
  cl_kernel kernel;
  size_t global[2], local[2];
  size_t param[5];
  char version[300];
  err = clGetPlatformIDs(1, &platform, NULL);
  if (err)
    printf("clGetPlatformIDs failed, err=%d\n", err);
  err = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 1, &device, NULL);
  if (err)
    printf("clGetDeviceIDs failed, err=%d\n", err);
  props[1] = (cl_context_properties)platform;
  ctx = clCreateContext(props, 1, &device, NULL, NULL, &err);
  if (err)
    printf("clCreateContext failed, err=%d\n", err);
  for (i = 0; i < 1; i++)
    queues[i] = clCreateCommandQueue(ctx, device, 0, &err);
  clGetDeviceInfo(device, CL_DEVICE_VERSION, sizeof(version), version, NULL);
  printf("CL_DEVICE_VERSION=%s\n", version);
  clGetDeviceInfo(device, CL_DRIVER_VERSION, sizeof(version), version, NULL);
  printf("CL_DRIVER_VERSION=%s\n", version);
  clGetDeviceInfo(device, CL_DEVICE_LOCAL_MEM_SIZE, sizeof(param[0]), param,
                  NULL);
  printf("CL_DEVICE_LOCAL_MEM_SIZE=%d\n", (int)param[0]);
  clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(param[0]),
                  param, NULL);
  printf("CL_DEVICE_MAX_WORK_GROUP_SIZE=%d\n", (int)param[0]);
  clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS, sizeof(param[0]),
                  param, NULL);
  printf("CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS=%d\n", (int)param[0]);
  j = param[0];
  clGetDeviceInfo(device, CL_DEVICE_MAX_WORK_ITEM_SIZES, sizeof(param[0]) * j,
                  param, NULL);
  printf("CL_DEVICE_MAX_WORK_ITEM_SIZES=");
  for (i = 0; i < j; i++)
    printf("%d ", (int)param[i]);
  printf("\n");
  clGetDeviceInfo(device, CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, sizeof(param[0]),
                  param, NULL);
  printf("CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE=%d\n", (int)param[0]);
  int numImgColors = 3;
  int numImages = 128;
  int numFilters = 32;
  int imgSizeX = 256;
  int imgSizeY = 256;
  int filterSize = 9;
  int padding = 0;
  int paddingStart = -floor(padding / 2);
  int moduleStride = 1;
  int numModulesY = (padding + imgSizeY - filterSize) / moduleStride + 1;
  int numModulesX = (padding + imgSizeX - filterSize) / moduleStride + 1;
  int imgStride = numImages;
  float scaleTargets = 0;
  float scaleOutputs = 1;
  int conv = 1;
  int imgsPerThread = numImages % 128 == 0 ? 4 : numImages % 64 == 0 ? 2 : 1;
  int numModules = numModulesY * numModulesX;
  int checkImgBounds = numImages % (32 * imgsPerThread) != 0;
  in = (cl_float *)calloc(numImages * numImgColors * imgSizeX * imgSizeY,
                          sizeof(*in));
  out = (cl_float *)calloc(numImages * numFilters * numModulesX * numModulesY,
                           sizeof(*out));
  ck = (cl_float *)calloc(numFilters * numImgColors * filterSize * filterSize,
                          sizeof(*ck));
  in[0] = 2.0f;
  in[1] = 3.0f;
  in[imgSizeX] = 1.0;
  ck[0] = 2.0f;
  ck[numFilters] = 0.5f;
  char *src = loadcusource(
      "filterActs_YxX_color.cu", "B_Y", 4, "B_X", 32, "imgsPerThread", 1,
      "filtersPerThread", (numFilters % 32 == 0 ? 8 : 4), "numColors",
      numImgColors, "scale", 0, "checkImgBounds", checkImgBounds, 0);
  program = clCreateProgramWithSource(ctx, 1, (const char **)&src, NULL, &err);
  if (!program) {
    printf("Error creating program, err = %d\n", err);
    return -1;
  }
  err = clBuildProgram(program, 0, 0, 0, 0, 0);
  if (err != CL_SUCCESS) {
    char buffer[20000];
    size_t len;
    clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, sizeof(buffer),
                          buffer, &len);
    puts(buffer);
    return -1;
  }
  kernel = clCreateKernel(program, "filterActs_YxX_color", &err);
  if (!kernel || err != CL_SUCCESS) {
    printf("Error creating kernel\n");
    return -1;
  }
  int elem_in = imgSizeX * imgSizeY * numImgColors * numImages;
  int elem_filt = filterSize * filterSize * numImgColors * numFilters;
  int elem_out = numImages * numFilters * numModulesY * numModulesX;
  bufin =
      clCreateBuffer(ctx, CL_MEM_READ_ONLY, elem_in * sizeof(*in), NULL, &err);
  bufck = clCreateBuffer(ctx, CL_MEM_READ_ONLY, elem_filt * sizeof(*ck), NULL,
                         &err);
  bufout = clCreateBuffer(ctx, CL_MEM_READ_WRITE, elem_out * sizeof(*out), NULL,
                          &err);
  err = clEnqueueWriteBuffer(queues[0], bufin, CL_TRUE, 0,
                             elem_in * sizeof(*in), in, 0, NULL, NULL);
  err = clEnqueueWriteBuffer(queues[0], bufck, CL_TRUE, 0,
                             elem_filt * sizeof(*ck), ck, 0, NULL, NULL);
  clSetKernelArg(kernel, 0, sizeof(cl_mem), &bufin);
  clSetKernelArg(kernel, 1, sizeof(cl_mem), &bufck);
  clSetKernelArg(kernel, 2, sizeof(cl_mem), &bufout);
  clSetKernelArg(kernel, 3, sizeof(int), &numImages);
  clSetKernelArg(kernel, 4, sizeof(int), &numFilters);
  clSetKernelArg(kernel, 5, sizeof(int), &imgSizeY);
  clSetKernelArg(kernel, 6, sizeof(int), &imgSizeX);
  clSetKernelArg(kernel, 7, sizeof(int), &filterSize);
  clSetKernelArg(kernel, 8, sizeof(int), &paddingStart);
  clSetKernelArg(kernel, 9, sizeof(int), &moduleStride);
  clSetKernelArg(kernel, 10, sizeof(int), &numModulesY);
  clSetKernelArg(kernel, 11, sizeof(int), &numModulesX);
  clSetKernelArg(kernel, 12, sizeof(int), &imgStride);
  clSetKernelArg(kernel, 13, sizeof(float), &scaleTargets);
  clSetKernelArg(kernel, 14, sizeof(float), &scaleOutputs);
  clSetKernelArg(kernel, 15, sizeof(int), &conv);
  if (numFilters % 32 == 0) {
    global[0] =
        (((numImages) + (32 * imgsPerThread - 1)) / (32 * imgsPerThread));
    global[1] = (numModules * numFilters) / (4 * 8);
  } else {
    global[0] =
        (((numImages) + (32 * imgsPerThread - 1)) / (32 * imgsPerThread));
    global[1] = (numModules * numFilters) / (4 * 4);
  }
  local[0] = 32;
  local[1] = 4;
  global[0] *= local[0];
  global[1] *= local[1];
  usleep(100000);
  struct timeval start, end;
  gettimeofday(&start, NULL);
  for (k = 0; k < nthreads; k++) {
    for (i = 0; i < nbOfAverages; i++) {
      err = clEnqueueNDRangeKernel(queues[0], kernel, 2, NULL, global, local, 0,
                                   NULL, NULL);
      if (err != CL_SUCCESS) {
        printf("clEnqueueNDRangeKernel error %d\n", err);
        return -1;
      }
    }
  }
  clFinish(queues[0]);
  gettimeofday(&end, NULL);
  double t = ((double)(end.tv_sec - start.tv_sec)) +
             ((double)(end.tv_usec - start.tv_usec)) / 1e6;
  err = clEnqueueReadBuffer(queues[0], bufout, CL_TRUE, 0,
                            elem_out * sizeof(*out), out, 0, NULL, NULL);
  clFinish(queues[0]);
  printf("%f %f %f %f\n", out[0], out[1], out[imgSizeX], out[imgSizeX + 1]);
  clReleaseMemObject(bufin);
  clReleaseMemObject(bufck);
  clReleaseMemObject(bufout);
  for (i = 0; i < 1; i++)
    clReleaseCommandQueue(queues[i]);
  clReleaseContext(ctx);
  tops = 1.0 * nthreads * opsMAC * numModulesX * numModulesY * numFilters *
         numImages * numImgColors * filterSize * filterSize;
  printf("Total M ops = %.0lf, # of threads = %d", nbOfAverages * tops * 1e-6,
         nthreads);
  printf("\nTime in s: %lf:", t);
  printf("\nTest performance [G OP/s] %lf:", tops * nbOfAverages / t * 1e-9);
  printf("\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x5130,%rsp
movl   $0x0,-0x24(%rbp)
movl   $0x1,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
movl   $0x2,-0x3c(%rbp)
movq   $0x0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
mov    0x3cb4(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x90(%rbp)
movq   $0x0,-0x88(%rbp)
movq   $0x0,-0x80(%rbp)
movl   $0x0,-0x94(%rbp)
movq   $0x0,-0xb0(%rbp)
mov    $0x1,%edi
lea    -0x70(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   10c0 <clGetPlatformIDs@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1336 <main+0xa6>
mov    -0x64(%rbp),%esi
lea    0x1d11(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x70(%rbp),%rdi
mov    0x3c67(%rip),%rax
mov    (%rax),%esi
mov    $0x1,%edx
lea    -0x74(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1080 <clGetDeviceIDs@plt>
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     1374 <main+0xe4>
mov    -0x64(%rbp),%esi
lea    0x1cf4(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x70(%rbp),%rax
mov    %rax,-0x88(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x1,%esi
lea    -0x74(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x64(%rbp),%r9
mov    %r8,%rcx
call   1100 <clCreateContext@plt>
mov    %eax,-0x94(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     13c1 <main+0x131>
mov    -0x64(%rbp),%esi
lea    0x1cc6(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x1,-0x28(%rbp)
jge    1401 <main+0x171>
mov    -0x94(%rbp),%edi
mov    -0x74(%rbp),%esi
xor    %edx,%edx
lea    -0x64(%rbp),%rcx
call   10b0 <clCreateCommandQueue@plt>
mov    %eax,%ecx
movslq -0x28(%rbp),%rax
mov    %ecx,-0x98(%rbp,%rax,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13c8 <main+0x138>
mov    -0x74(%rbp),%edi
mov    0x3bd5(%rip),%rax
mov    (%rax),%esi
lea    -0x240(%rbp),%rcx
mov    $0x12c,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1090 <clGetDeviceInfo@plt>
lea    -0x240(%rbp),%rsi
lea    0x1c6d(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x74(%rbp),%edi
mov    0x3b84(%rip),%rax
mov    (%rax),%esi
lea    -0x240(%rbp),%rcx
mov    $0x12c,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1090 <clGetDeviceInfo@plt>
lea    -0x240(%rbp),%rsi
lea    0x1c4a(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x74(%rbp),%edi
mov    0x3b13(%rip),%rax
mov    (%rax),%esi
lea    -0x110(%rbp),%rcx
mov    $0x8,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1090 <clGetDeviceInfo@plt>
mov    -0x110(%rbp),%rax
mov    %eax,%esi
lea    0x1c25(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x74(%rbp),%edi
mov    0x3b40(%rip),%rax
mov    (%rax),%esi
lea    -0x110(%rbp),%rcx
mov    $0x8,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1090 <clGetDeviceInfo@plt>
mov    -0x110(%rbp),%rax
mov    %eax,%esi
lea    0x1c07(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x74(%rbp),%edi
mov    0x3aa5(%rip),%rax
mov    (%rax),%esi
lea    -0x110(%rbp),%rcx
mov    $0x8,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1090 <clGetDeviceInfo@plt>
mov    -0x110(%rbp),%rax
mov    %eax,%esi
lea    0x1bee(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x110(%rbp),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x74(%rbp),%edi
mov    0x3a88(%rip),%rax
mov    (%rax),%esi
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
lea    -0x110(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1090 <clGetDeviceInfo@plt>
lea    0x1bd4(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    15a2 <main+0x312>
movslq -0x28(%rbp),%rax
mov    -0x110(%rbp,%rax,8),%rax
ff
mov    %eax,%esi
lea    0x1bc4(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    156c <main+0x2dc>
lea    0x1c51(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
mov    -0x74(%rbp),%edi
mov    0x39fe(%rip),%rax
mov    (%rax),%esi
lea    -0x110(%rbp),%rcx
mov    $0x8,%edx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1090 <clGetDeviceInfo@plt>
mov    -0x110(%rbp),%rax
mov    %eax,%esi
lea    0x1b71(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
movl   $0x3,-0x244(%rbp)
movl   $0x80,-0x248(%rbp)
movl   $0x20,-0x24c(%rbp)
movl   $0x100,-0x250(%rbp)
movl   $0x100,-0x254(%rbp)
movl   $0x9,-0x258(%rbp)
movl   $0x0,-0x25c(%rbp)
mov    -0x25c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1190 <floor@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x260(%rbp)
movl   $0x1,-0x264(%rbp)
mov    -0x25c(%rbp),%eax
add    -0x254(%rbp),%eax
sub    -0x258(%rbp),%eax
cltd
idivl  -0x264(%rbp)
add    $0x1,%eax
mov    %eax,-0x268(%rbp)
mov    -0x25c(%rbp),%eax
add    -0x250(%rbp),%eax
sub    -0x258(%rbp),%eax
cltd
idivl  -0x264(%rbp)
add    $0x1,%eax
mov    %eax,-0x26c(%rbp)
mov    -0x248(%rbp),%eax
mov    %eax,-0x270(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x274(%rbp)
ff
movss  0x1941(%rip),%xmm0
movss  %xmm0,-0x278(%rbp)
ff
movl   $0x1,-0x27c(%rbp)
mov    -0x248(%rbp),%eax
mov    $0x80,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    16f8 <main+0x468>
mov    $0x4,%eax
mov    %eax,-0x50f4(%rbp)
jmp    171c <main+0x48c>
mov    -0x248(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
mov    $0x1,%eax
mov    $0x2,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
mov    %eax,-0x50f4(%rbp)
mov    -0x50f4(%rbp),%eax
mov    %eax,-0x280(%rbp)
mov    -0x268(%rbp),%eax
imul   -0x26c(%rbp),%eax
mov    %eax,-0x284(%rbp)
mov    -0x248(%rbp),%eax
mov    -0x280(%rbp),%ecx
shl    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x288(%rbp)
mov    -0x248(%rbp),%edi
imul   -0x244(%rbp),%edi
imul   -0x250(%rbp),%edi
imul   -0x254(%rbp),%edi
mov    $0x8,%esi
call   10f0 <calloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x248(%rbp),%edi
imul   -0x24c(%rbp),%edi
imul   -0x26c(%rbp),%edi
imul   -0x268(%rbp),%edi
mov    $0x8,%esi
call   10f0 <calloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x24c(%rbp),%edi
imul   -0x244(%rbp),%edi
imul   -0x258(%rbp),%edi
imul   -0x258(%rbp),%edi
mov    $0x8,%esi
call   10f0 <calloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rax
movsd  0x182b(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x48(%rbp),%rax
movsd  0x182b(%rip),%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x48(%rbp),%rax
movslq -0x250(%rbp),%rcx
movsd  0x180b(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x58(%rbp),%rax
movsd  0x17f2(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x58(%rbp),%rax
movslq -0x24c(%rbp),%rcx
movsd  0x17d3(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24c(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    $0x4,%r15d
mov    $0x8,%eax
cmp    $0x0,%edx
cmove  %eax,%r15d
mov    -0x244(%rbp),%ebx
mov    -0x288(%rbp),%eax
lea    0x190f(%rip),%rdi
lea    0x1920(%rip),%rsi
mov    $0x4,%edx
lea    0x1918(%rip),%rcx
mov    $0x20,%r8d
lea    0x190f(%rip),%r9
lea    0x1916(%rip),%r12
lea    0x1920(%rip),%r14
lea    0x1923(%rip),%r11
xor    %r10d,%r10d
lea    0x191f(%rip),%r10
movl   $0x1,(%rsp)
mov    %r12,0x8(%rsp)
mov    %r15d,0x10(%rsp)
mov    %r14,0x18(%rsp)
mov    %ebx,0x20(%rsp)
mov    %r11,0x28(%rsp)
movl   $0x0,0x30(%rsp)
mov    %r10,0x38(%rsp)
mov    %eax,0x40(%rsp)
movl   $0x0,0x48(%rsp)
call   1160 <loadcusource@plt>
mov    %rax,-0x290(%rbp)
mov    -0x94(%rbp),%edi
mov    $0x1,%esi
lea    -0x290(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x64(%rbp),%r8
call   1050 <clCreateProgramWithSource@plt>
mov    %eax,-0xb4(%rbp)
cmpl   $0x0,-0xb4(%rbp)
jne    193f <main+0x6af>
mov    -0x64(%rbp),%esi
lea    0x18ae(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    2172 <main+0xee2>
mov    -0xb4(%rbp),%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <clBuildProgram@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    0x3612(%rip),%rcx
cmp    (%rcx),%eax
je     19b0 <main+0x720>
mov    -0xb4(%rbp),%edi
mov    -0x74(%rbp),%esi
mov    0x3632(%rip),%rax
mov    (%rax),%edx
lea    -0x50b0(%rbp),%r8
mov    $0x4e20,%ecx
lea    -0x50b8(%rbp),%r9
call   1110 <clGetProgramBuildInfo@plt>
lea    -0x50b0(%rbp),%rdi
call   1060 <puts@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    2172 <main+0xee2>
mov    -0xb4(%rbp),%edi
lea    0x183f(%rip),%rsi
lea    -0x64(%rbp),%rdx
call   1170 <clCreateKernel@plt>
mov    %eax,-0xb8(%rbp)
cmpl   $0x0,-0xb8(%rbp)
je     19eb <main+0x75b>
mov    -0x64(%rbp),%eax
mov    0x3595(%rip),%rcx
cmp    (%rcx),%eax
je     1a05 <main+0x775>
lea    0x181f(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    2172 <main+0xee2>
mov    -0x250(%rbp),%eax
imul   -0x254(%rbp),%eax
imul   -0x244(%rbp),%eax
imul   -0x248(%rbp),%eax
mov    %eax,-0x50bc(%rbp)
mov    -0x258(%rbp),%eax
imul   -0x258(%rbp),%eax
imul   -0x244(%rbp),%eax
imul   -0x24c(%rbp),%eax
mov    %eax,-0x50c0(%rbp)
mov    -0x248(%rbp),%eax
imul   -0x24c(%rbp),%eax
imul   -0x268(%rbp),%eax
imul   -0x26c(%rbp),%eax
mov    %eax,-0x50c4(%rbp)
mov    -0x94(%rbp),%edi
mov    0x350b(%rip),%rax
mov    (%rax),%esi
movslq -0x50bc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x64(%rbp),%r8
call   1070 <clCreateBuffer@plt>
mov    %eax,-0x9c(%rbp)
mov    -0x94(%rbp),%edi
mov    0x34dc(%rip),%rax
mov    (%rax),%esi
movslq -0x50c0(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x64(%rbp),%r8
call   1070 <clCreateBuffer@plt>
mov    %eax,-0xa0(%rbp)
mov    -0x94(%rbp),%edi
mov    0x34fd(%rip),%rax
mov    (%rax),%esi
movslq -0x50c4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x64(%rbp),%r8
call   1070 <clCreateBuffer@plt>
mov    %eax,-0xa4(%rbp)
mov    -0x98(%rbp),%edi
mov    -0x9c(%rbp),%esi
mov    0x34d0(%rip),%rax
mov    (%rax),%edx
movslq -0x50bc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%r8d
mov    -0x48(%rbp),%r9
xor    %ecx,%ecx
xor    %eax,%eax
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   11b0 <clEnqueueWriteBuffer@plt>
mov    %eax,-0x64(%rbp)
mov    -0x98(%rbp),%edi
mov    -0xa0(%rbp),%esi
mov    0x3484(%rip),%rax
mov    (%rax),%edx
movslq -0x50c0(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%r8d
mov    -0x58(%rbp),%r9
xor    %ecx,%ecx
xor    %eax,%eax
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   11b0 <clEnqueueWriteBuffer@plt>
mov    %eax,-0x64(%rbp)
mov    -0xb8(%rbp),%edi
xor    %esi,%esi
mov    $0x4,%edx
lea    -0x9c(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x1,%esi
mov    $0x4,%edx
lea    -0xa0(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x2,%esi
mov    $0x4,%edx
lea    -0xa4(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x3,%esi
mov    $0x4,%edx
lea    -0x248(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x4,%edx
lea    -0x24c(%rbp),%rcx
mov    %edx,%esi
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x5,%esi
mov    $0x4,%edx
lea    -0x254(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x6,%esi
mov    $0x4,%edx
lea    -0x250(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x7,%esi
mov    $0x4,%edx
lea    -0x258(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x8,%esi
mov    $0x4,%edx
lea    -0x260(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0x9,%esi
mov    $0x4,%edx
lea    -0x264(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0xa,%esi
mov    $0x4,%edx
lea    -0x268(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0xb,%esi
mov    $0x4,%edx
lea    -0x26c(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0xc,%esi
mov    $0x4,%edx
lea    -0x270(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0xd,%esi
mov    $0x4,%edx
lea    -0x274(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0xe,%esi
mov    $0x4,%edx
lea    -0x278(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0xb8(%rbp),%edi
mov    $0xf,%esi
mov    $0x4,%edx
lea    -0x27c(%rbp),%rcx
mov    $0x0,%al
call   1180 <clSetKernelArg@plt>
mov    -0x24c(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1dca <main+0xb3a>
mov    -0x248(%rbp),%eax
mov    -0x280(%rbp),%ecx
shl    $0x5,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0x280(%rbp),%ecx
shl    $0x5,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0xd0(%rbp)
mov    -0x284(%rbp),%eax
imul   -0x24c(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0xc8(%rbp)
jmp    1e11 <main+0xb81>
mov    -0x248(%rbp),%eax
mov    -0x280(%rbp),%ecx
shl    $0x5,%ecx
sub    $0x1,%ecx
add    %ecx,%eax
mov    -0x280(%rbp),%ecx
shl    $0x5,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0xd0(%rbp)
mov    -0x284(%rbp),%eax
imul   -0x24c(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cltq
mov    %rax,-0xc8(%rbp)
movq   $0x20,-0xe0(%rbp)
movq   $0x4,-0xd8(%rbp)
mov    -0xe0(%rbp),%rax
imul   -0xd0(%rbp),%rax
ff
mov    %rax,-0xd0(%rbp)
mov    -0xd8(%rbp),%rax
imul   -0xc8(%rbp),%rax
ff
mov    %rax,-0xc8(%rbp)
mov    $0x186a0,%edi
call   11a0 <usleep@plt>
lea    -0x50d8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10e0 <gettimeofday@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1f2e <main+0xc9e>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1f1b <main+0xc8b>
mov    -0x98(%rbp),%edi
mov    -0xb8(%rbp),%esi
lea    -0xd0(%rbp),%r8
lea    -0xe0(%rbp),%r9
mov    $0x2,%edx
xor    %eax,%eax
mov    %eax,%ecx
xor    %eax,%eax
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   10a0 <clEnqueueNDRangeKernel@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
mov    0x3095(%rip),%rcx
cmp    (%rcx),%eax
je     1f08 <main+0xc78>
mov    -0x64(%rbp),%esi
lea    0x1333(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    2172 <main+0xee2>
jmp    1f0d <main+0xc7d>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1e87 <main+0xbf7>
jmp    1f20 <main+0xc90>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1e74 <main+0xbe4>
mov    -0x98(%rbp),%edi
call   1040 <clFinish@plt>
lea    -0x50e8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10e0 <gettimeofday@plt>
mov    -0x50e0(%rbp),%rax
sub    -0x50d0(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    -0x50e8(%rbp),%rax
sub    -0x50d8(%rbp),%rax
cvtsi2sd %rax,%xmm1
movsd  0x10b1(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50f0(%rbp)
ff
mov    -0x98(%rbp),%edi
mov    -0xa4(%rbp),%esi
mov    0x303e(%rip),%rax
mov    (%rax),%edx
movslq -0x50c4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%r8d
mov    -0x50(%rbp),%r9
xor    %ecx,%ecx
xor    %eax,%eax
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1130 <clEnqueueReadBuffer@plt>
mov    %eax,-0x64(%rbp)
mov    -0x98(%rbp),%edi
call   1040 <clFinish@plt>
mov    -0x50(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x50(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x50(%rbp),%rax
movslq -0x250(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
mov    -0x50(%rbp),%rax
mov    -0x250(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm3
lea    0x122e(%rip),%rdi
mov    $0x4,%al
call   10d0 <printf@plt>
mov    -0x9c(%rbp),%edi
call   1150 <clReleaseMemObject@plt>
mov    -0xa0(%rbp),%edi
call   1150 <clReleaseMemObject@plt>
mov    -0xa4(%rbp),%edi
call   1150 <clReleaseMemObject@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x1,-0x28(%rbp)
jge    2072 <main+0xde2>
movslq -0x28(%rbp),%rax
mov    -0x98(%rbp,%rax,4),%edi
call   1120 <clReleaseCommandQueue@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    204a <main+0xdba>
mov    -0x94(%rbp),%edi
call   1140 <clReleaseContext@plt>
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  0xf8e(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x26c(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x268(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x24c(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x248(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x244(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x258(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
cvtsi2sdl -0x258(%rbp),%xmm1
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  0xf36(%rip),%xmm1
mulsd  %xmm1,%xmm0
mov    -0x34(%rbp),%esi
lea    0x1146(%rip),%rdi
mov    $0x1,%al
call   10d0 <printf@plt>
movsd  -0x50f0(%rbp),%xmm0
ff
lea    0x1157(%rip),%rdi
mov    $0x1,%al
call   10d0 <printf@plt>
movsd  -0x60(%rbp),%xmm0
cvtsi2sdl -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x50f0(%rbp),%xmm0
ff
movsd  0xee5(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0x1138(%rip),%rdi
mov    $0x1,%al
call   10d0 <printf@plt>
lea    0x1096(%rip),%rdi
mov    $0x0,%al
call   10d0 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x5130,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x5048,%rsp
movq   $0x0,0x40(%rsp)
movl   $0x0,0x8(%rsp)
mov    0x2cbf(%rip),%rax
mov    (%rax),%rax
mov    %rax,0xd0(%rsp)
movq   $0x0,0xe0(%rsp)
lea    0x40(%rsp),%rsi
mov    $0x1,%edi
xor    %edx,%edx
call   10d0 <clGetPlatformIDs@plt>
test   %eax,%eax
je     1305 <main+0x65>
lea    0xd54(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
mov    0x40(%rsp),%rdi
mov    0x2c97(%rip),%rax
mov    (%rax),%esi
lea    0x8(%rsp),%rcx
mov    $0x1,%edx
xor    %r8d,%r8d
call   1090 <clGetDeviceIDs@plt>
mov    %eax,0x4(%rsp)
test   %eax,%eax
je     133d <main+0x9d>
lea    0xd3d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10e0 <printf@plt>
mov    0x40(%rsp),%rax
mov    %rax,0xd8(%rsp)
lea    0xd0(%rsp),%rdi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%r9
mov    $0x1,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1110 <clCreateContext@plt>
mov    %eax,%r13d
mov    0x4(%rsp),%esi
test   %esi,%esi
je     1384 <main+0xe4>
lea    0xd13(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
mov    0x8(%rsp),%esi
lea    0x4(%rsp),%rcx
mov    %r13d,%edi
xor    %edx,%edx
call   10c0 <clCreateCommandQueue@plt>
mov    %eax,%r12d
mov    0x8(%rsp),%edi
mov    0x2c3b(%rip),%rax
mov    (%rax),%esi
lea    0xf0(%rsp),%rbx
mov    $0x12c,%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   10a0 <clGetDeviceInfo@plt>
lea    0xce8(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10e0 <printf@plt>
mov    0x8(%rsp),%edi
mov    0x2beb(%rip),%rax
mov    (%rax),%esi
mov    $0x12c,%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   10a0 <clGetDeviceInfo@plt>
lea    0xcce(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   10e0 <printf@plt>
mov    0x8(%rsp),%edi
mov    0x2b83(%rip),%rax
mov    (%rax),%esi
lea    0x70(%rsp),%rbx
mov    $0x8,%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   10a0 <clGetDeviceInfo@plt>
mov    0x70(%rsp),%esi
lea    0xcab(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
mov    0x8(%rsp),%edi
mov    0x2bb5(%rip),%rax
mov    (%rax),%esi
mov    $0x8,%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   10a0 <clGetDeviceInfo@plt>
mov    0x70(%rsp),%esi
lea    0xc97(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
mov    0x8(%rsp),%edi
mov    0x2b24(%rip),%rax
mov    (%rax),%esi
mov    $0x8,%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   10a0 <clGetDeviceInfo@plt>
mov    0x70(%rsp),%esi
lea    0xc88(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
mov    0x70(%rsp),%rbp
mov    0x8(%rsp),%edi
mov    0x2b16(%rip),%rax
mov    (%rax),%esi
lea    0x0(,%rbp,8),%edx
mov    %rbx,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   10a0 <clGetDeviceInfo@plt>
lea    0xc7b(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
test   %ebp,%ebp
jle    14f7 <main+0x257>
mov    %ebp,%ebp
lea    0xc86(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    0x70(%rsp,%rbx,8),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    14e0 <main+0x240>
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    0x8(%rsp),%edi
mov    0x2aac(%rip),%rax
mov    (%rax),%esi
lea    0x70(%rsp),%rcx
mov    $0x8,%edx
xor    %r8d,%r8d
xor    %eax,%eax
call   10a0 <clGetDeviceInfo@plt>
mov    0x70(%rsp),%esi
lea    0xc38(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
movl   $0x80,0x10(%rsp)
movl   $0x20,0xc(%rsp)
movl   $0x100,0x24(%rsp)
movl   $0x100,0x64(%rsp)
movl   $0x9,0x20(%rsp)
xor    %edi,%edi
call   11a0 <floor@plt>
neg    %eax
mov    %eax,0x60(%rsp)
movl   $0x1,0x5c(%rsp)
movl   $0xf8,0x1c(%rsp)
movl   $0xf8,0x18(%rsp)
movl   $0x80,0x58(%rsp)
movl   $0x0,0x54(%rsp)
movl   $0x3f800000,0x50(%rsp)
3f
movl   $0x1,0x4c(%rsp)
mov    $0x1800000,%edi
mov    $0x8,%esi
call   1100 <calloc@plt>
mov    %rax,%r14
mov    $0xf040000,%edi
mov    $0x8,%esi
call   1100 <calloc@plt>
mov    %rax,0x38(%rsp)
mov    $0x1e60,%edi
mov    $0x8,%esi
call   1100 <calloc@plt>
mov    %rax,%r15
movapd 0xa1f(%rip),%xmm0
movupd %xmm0,(%r14)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x800(%r14)
movabs $0x4000000000000000,%rax
mov    %rax,(%r15)
movabs $0x3fe0000000000000,%rax
mov    %rax,0x100(%r15)
lea    0xbbf(%rip),%rax
lea    0xbb2(%rip),%rbp
lea    0xba1(%rip),%rbx
lea    0xb89(%rip),%r10
lea    0xb54(%rip),%rdi
lea    0xb65(%rip),%rsi
lea    0xb62(%rip),%rcx
lea    0xb5f(%rip),%r9
mov    $0x4,%edx
mov    $0x20,%r8d
push   $0x0
push   $0x0
push   %rax
push   $0x0
push   %rbp
push   $0x3
push   %rbx
push   $0x8
push   %r10
push   $0x1
call   1170 <loadcusource@plt>
add    $0x50,%rsp
mov    %rax,0x68(%rsp)
lea    0x68(%rsp),%rdx
lea    0x4(%rsp),%r8
mov    %r13d,%edi
mov    $0x1,%esi
xor    %ecx,%ecx
call   1060 <clCreateProgramWithSource@plt>
test   %eax,%eax
je     1ba9 <main+0x909>
mov    %eax,%ebp
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <clBuildProgram@plt>
mov    %eax,0x4(%rsp)
mov    0x28c0(%rip),%rbx
cmp    (%rbx),%eax
jne    1bbd <main+0x91d>
lea    0xb45(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %ebp,%edi
call   1180 <clCreateKernel@plt>
test   %eax,%eax
je     1bee <main+0x94e>
mov    %eax,%ebp
mov    0x4(%rsp),%eax
cmp    (%rbx),%eax
jne    1bee <main+0x94e>
mov    0x2890(%rip),%rax
mov    (%rax),%esi
lea    0x4(%rsp),%r8
mov    %r13d,%edi
mov    $0xc000000,%edx
xor    %ecx,%ecx
call   1080 <clCreateBuffer@plt>
mov    %r12d,%ebx
mov    %eax,%r12d
mov    %eax,0x2c(%rsp)
mov    0x2869(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
mov    $0xf300,%edx
xor    %ecx,%ecx
lea    0x4(%rsp),%r8
call   1080 <clCreateBuffer@plt>
mov    %eax,0x30(%rsp)
mov    %eax,0x28(%rsp)
mov    0x2894(%rip),%rax
mov    (%rax),%esi
mov    %r13d,%edi
mov    $0x78200000,%edx
xor    %ecx,%ecx
lea    0x4(%rsp),%r8
call   1080 <clCreateBuffer@plt>
mov    %eax,0x14(%rsp)
mov    0x287b(%rip),%rax
mov    (%rax),%edx
sub    $0x20,%rsp
xorpd  %xmm0,%xmm0
movupd %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
mov    %ebx,%edi
mov    %r12d,%esi
mov    %ebx,%r12d
mov    %rax,%rbx
xor    %ecx,%ecx
mov    $0xc000000,%r8d
mov    %r14,%r9
call   11c0 <clEnqueueWriteBuffer@plt>
add    $0x20,%rsp
mov    %eax,0x4(%rsp)
mov    (%rbx),%edx
sub    $0x20,%rsp
xorpd  %xmm0,%xmm0
movupd %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
mov    %r12d,%edi
mov    0x50(%rsp),%esi
xor    %ecx,%ecx
mov    $0xf300,%r8d
mov    %r15,%r9
call   11c0 <clEnqueueWriteBuffer@plt>
add    $0x20,%rsp
mov    %eax,0x4(%rsp)
lea    0x2c(%rsp),%rcx
mov    %ebp,%edi
xor    %esi,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x28(%rsp),%rcx
mov    %ebp,%edi
mov    $0x1,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x14(%rsp),%rcx
mov    %ebp,%edi
mov    $0x2,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x10(%rsp),%rcx
mov    %ebp,%edi
mov    $0x3,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0xc(%rsp),%rcx
mov    %ebp,%edi
mov    $0x4,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x64(%rsp),%rcx
mov    %ebp,%edi
mov    $0x5,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x24(%rsp),%rcx
mov    %ebp,%edi
mov    $0x6,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x20(%rsp),%rcx
mov    %ebp,%edi
mov    $0x7,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x60(%rsp),%rcx
mov    %ebp,%edi
mov    $0x8,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x5c(%rsp),%rcx
mov    %ebp,%edi
mov    $0x9,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x1c(%rsp),%rcx
mov    %ebp,%edi
mov    $0xa,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x18(%rsp),%rcx
mov    %ebp,%edi
mov    $0xb,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x58(%rsp),%rcx
mov    %ebp,%edi
mov    $0xc,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x54(%rsp),%rcx
mov    %ebp,%edi
mov    $0xd,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x50(%rsp),%rcx
mov    %ebp,%edi
mov    $0xe,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
lea    0x4c(%rsp),%rcx
mov    %ebp,%edi
mov    $0xf,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1190 <clSetKernelArg@plt>
mov    0xc(%rsp),%eax
test   $0x1f,%al
mov    $0x782,%ecx
mov    $0xf04,%edx
cmove  %ecx,%edx
imul   %eax,%edx
mov    0x10(%rsp),%eax
lea    0x7f(%rax),%ecx
movslq %edx,%rdx
add    $0xfe,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x7,%eax
cltq
movapd 0x68f(%rip),%xmm0
movapd %xmm0,0xa0(%rsp)
shl    $0x5,%rax
mov    %rax,0x220(%rsp)
shl    $0x2,%rdx
mov    %rdx,0x228(%rsp)
mov    $0x186a0,%edi
call   11b0 <usleep@plt>
lea    0xc0(%rsp),%rdi
xor    %esi,%esi
call   10f0 <gettimeofday@plt>
sub    $0x20,%rsp
xorpd  %xmm0,%xmm0
movupd %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
lea    0x240(%rsp),%r8
lea    0xc0(%rsp),%r9
mov    %r12d,%edi
mov    %ebp,%esi
mov    $0x2,%edx
xor    %ecx,%ecx
call   10b0 <clEnqueueNDRangeKernel@plt>
add    $0x20,%rsp
mov    %eax,0x4(%rsp)
mov    0x2578(%rip),%rcx
cmp    (%rcx),%eax
jne    1c11 <main+0x971>
mov    %r12d,%edi
call   1050 <clFinish@plt>
lea    0xb0(%rsp),%rdi
xor    %esi,%esi
call   10f0 <gettimeofday@plt>
mov    0xb0(%rsp),%rax
mov    0xb8(%rsp),%rcx
sub    0xc8(%rsp),%rcx
xorps  %xmm0,%xmm0
cvtsi2sd %rcx,%xmm0
sub    0xc0(%rsp),%rax
cvtsi2sd %rax,%xmm1
divsd  0x5dc(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x30(%rsp)
mov    0x14(%rsp),%esi
mov    (%rbx),%edx
sub    $0x20,%rsp
xorpd  %xmm0,%xmm0
movupd %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
mov    %r12d,%edi
xor    %ecx,%ecx
mov    $0x78200000,%r8d
mov    0x58(%rsp),%rbx
mov    %rbx,%r9
call   1140 <clEnqueueReadBuffer@plt>
add    $0x20,%rsp
mov    %eax,0x4(%rsp)
mov    %r12d,%edi
call   1050 <clFinish@plt>
movsd  (%rbx),%xmm0
movsd  0x8(%rbx),%xmm1
movslq 0x24(%rsp),%rax
movsd  (%rbx,%rax,8),%xmm2
movsd  0x8(%rbx,%rax,8),%xmm3
lea    0x781(%rip),%rdi
mov    $0x4,%al
call   10e0 <printf@plt>
mov    0x2c(%rsp),%edi
call   1160 <clReleaseMemObject@plt>
mov    0x28(%rsp),%edi
call   1160 <clReleaseMemObject@plt>
mov    0x14(%rsp),%edi
call   1160 <clReleaseMemObject@plt>
mov    %r12d,%edi
call   1130 <clReleaseCommandQueue@plt>
mov    %r13d,%edi
call   1150 <clReleaseContext@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl 0x18(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x1c(%rsp),%xmm1
addsd  %xmm0,%xmm0
mulsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0xc(%rsp),%xmm0
mulsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x10(%rsp),%xmm1
mulsd  %xmm0,%xmm1
mulsd  0x509(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sdl 0x20(%rsp),%xmm0
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x38(%rsp)
movsd  0x4f2(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0x6f6(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   10e0 <printf@plt>
lea    0x70a(%rip),%rdi
movsd  0x30(%rsp),%xmm0
mov    $0x1,%al
call   10e0 <printf@plt>
movsd  0x38(%rsp),%xmm0
divsd  0x30(%rsp),%xmm0
mulsd  0x4bb(%rip),%xmm0
lea    0x6f3(%rip),%rdi
mov    $0x1,%al
call   10e0 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
jmp    1bff <main+0x95f>
mov    0x4(%rsp),%esi
lea    0x636(%rip),%rdi
xor    %eax,%eax
call   10e0 <printf@plt>
jmp    1bfa <main+0x95a>
mov    0x8(%rsp),%esi
mov    0x23e8(%rip),%rax
mov    (%rax),%edx
lea    0x220(%rsp),%rbx
lea    0xa0(%rsp),%r9
mov    %ebp,%edi
mov    $0x4e20,%ecx
mov    %rbx,%r8
call   1120 <clGetProgramBuildInfo@plt>
mov    %rbx,%rdi
jmp    1bf5 <main+0x955>
lea    0x6b2(%rip),%rdi
call   1070 <puts@plt>
mov    $0xffffffff,%eax
add    $0x5048,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x609(%rip),%rdi
mov    %eax,%esi
jmp    1bb4 <main+0x914>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@CL_CONTEXT_PLATFORM = global i64 0
@.str = [33 x i8] c"clGetPlatformIDs failed, err=%d\0A\00"
@CL_DEVICE_TYPE_GPU = global i32 0
@.str.1 = [31 x i8] c"clGetDeviceIDs failed, err=%d\0A\00"
@.str.2 = [32 x i8] c"clCreateContext failed, err=%d\0A\00"
@CL_DEVICE_VERSION = global i32 0
@.str.3 = [22 x i8] c"CL_DEVICE_VERSION=%s\0A\00"
@CL_DRIVER_VERSION = global i32 0
@.str.4 = [22 x i8] c"CL_DRIVER_VERSION=%s\0A\00"
@CL_DEVICE_LOCAL_MEM_SIZE = global i32 0
@.str.5 = [29 x i8] c"CL_DEVICE_LOCAL_MEM_SIZE=%d\0A\00"
@CL_DEVICE_MAX_WORK_GROUP_SIZE = global i32 0
@.str.6 = [34 x i8] c"CL_DEVICE_MAX_WORK_GROUP_SIZE=%d\0A\00"
@CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = global i32 0
@.str.7 = [39 x i8] c"CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS=%d\0A\00"
@CL_DEVICE_MAX_WORK_ITEM_SIZES = global i32 0
@.str.8 = [31 x i8] c"CL_DEVICE_MAX_WORK_ITEM_SIZES=\00"
@.str.9 = [4 x i8] c"%d \00"
@.str.10 = [2 x i8] c"\0A\00"
@CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = global i32 0
@.str.11 = [39 x i8] c"CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE=%d\0A\00"
@.str.12 = [24 x i8] c"filterActs_YxX_color.cu\00"
@.str.13 = [4 x i8] c"B_Y\00"
@.str.14 = [4 x i8] c"B_X\00"
@.str.15 = [14 x i8] c"imgsPerThread\00"
@.str.16 = [17 x i8] c"filtersPerThread\00"
@.str.17 = [10 x i8] c"numColors\00"
@.str.18 = [6 x i8] c"scale\00"
@.str.19 = [15 x i8] c"checkImgBounds\00"
@.str.20 = [34 x i8] c"Error creating program, err = %d\0A\00"
@CL_SUCCESS = global i32 0
@CL_PROGRAM_BUILD_LOG = global i32 0
@.str.21 = [21 x i8] c"filterActs_YxX_color\00"
@.str.22 = [23 x i8] c"Error creating kernel\0A\00"
@CL_MEM_READ_ONLY = global i32 0
@CL_MEM_READ_WRITE = global i32 0
@CL_TRUE = global i32 0
@.str.23 = [33 x i8] c"clEnqueueNDRangeKernel error %d\0A\00"
@.str.24 = [13 x i8] c"%f %f %f %f\0A\00"
@.str.25 = [39 x i8] c"Total M ops = %.0lf, # of threads = %d\00"
@.str.26 = [17 x i8] c"\0ATime in s: %lf:\00"
@.str.27 = [32 x i8] c"\0ATest performance [G OP/s] %lf:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double
%12 = alloca i32
%13 = alloca i64
%14 = alloca i32
%15 = alloca [3 x i64]
%16 = alloca i32
%17 = alloca [1 x i32]
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32*
%22 = alloca i32
%23 = alloca i32
%24 = alloca [2 x i64]
%25 = alloca [2 x i64]
%26 = alloca [5 x i64]
%27 = alloca [300 x i8]
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca i32
%35 = alloca i32
%36 = alloca i32
%37 = alloca i32
%38 = alloca i32
%39 = alloca i32
%40 = alloca float
%41 = alloca float
%42 = alloca i32
%43 = alloca i32
%44 = alloca i32
%45 = alloca i32
%46 = alloca i8*
%47 = alloca [20000 x i8]
%48 = alloca i64
%49 = alloca i32
%50 = alloca i32
%51 = alloca i32
%52 = alloca %struct.timeval
%53 = alloca %struct.timeval
%54 = alloca double
store i32 0, i32* %1
store i32 1, i32* %5
store i32 1, i32* %6
store i32 2, i32* %7
store i64 0, i64* %13
store i32 0, i32* %14
%55 = getelementptr inbounds [3 x i64], [3 x i64]* %15, i64 0, i64 0
%56 = load i64, i64* @CL_CONTEXT_PLATFORM
store i64 %56, i64* %55
%57 = getelementptr inbounds i64, i64* %55, i64 1
store i64 0, i64* %57
%58 = getelementptr inbounds i64, i64* %57, i64 1
store i64 0, i64* %58
store i32 0, i32* %16
store i32* null, i32** %21
%59 = call i32 @clGetPlatformIDs(i32 1, i64* %13, i32* null)
store i32 %59, i32* %12
%60 = load i32, i32* %12
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %0
%63 = load i32, i32* %12
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %62, %0
%66 = load i64, i64* %13
%67 = load i32, i32* @CL_DEVICE_TYPE_GPU
%68 = call i32 @clGetDeviceIDs(i64 %66, i32 %67, i32 1, i32* %14, i32* null)
store i32 %68, i32* %12
%69 = load i32, i32* %12
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %74
71: ; preds = %65
%72 = load i32, i32* %12
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %71, %65
%75 = load i64, i64* %13
%76 = getelementptr inbounds [3 x i64], [3 x i64]* %15, i64 0, i64 1
store i64 %75, i64* %76
%77 = getelementptr inbounds [3 x i64], [3 x i64]* %15, i64 0, i64 0
%78 = call i32 @clCreateContext(i64* %77, i32 1, i32* %14, i32* null, i32* null, i32* %12)
store i32 %78, i32* %16
%79 = load i32, i32* %12
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %74
%82 = load i32, i32* %12
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %82)
br label %84
84: ; preds = %81, %74
store i32 0, i32* %2
br label %85
85: ; preds = %95, %84
%86 = load i32, i32* %2
%87 = icmp slt i32 %86, 1
br i1 %87, label %88, label %98
88: ; preds = %85
%89 = load i32, i32* %16
%90 = load i32, i32* %14
%91 = call i32 @clCreateCommandQueue(i32 %89, i32 %90, i32 0, i32* %12)
%92 = load i32, i32* %2
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [1 x i32], [1 x i32]* %17, i64 0, i64 %93
store i32 %91, i32* %94
br label %95
95: ; preds = %88
%96 = load i32, i32* %2
%97 = add nsw i32 %96, 1
store i32 %97, i32* %2
br label %85
98: ; preds = %85
%99 = load i32, i32* %14
%100 = load i32, i32* @CL_DEVICE_VERSION
%101 = getelementptr inbounds [300 x i8], [300 x i8]* %27, i64 0, i64 0
%102 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %99, i32 %100, i32 300, i8* %101, i8* null)
%103 = getelementptr inbounds [300 x i8], [300 x i8]* %27, i64 0, i64 0
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8* %103)
%105 = load i32, i32* %14
%106 = load i32, i32* @CL_DRIVER_VERSION
%107 = getelementptr inbounds [300 x i8], [300 x i8]* %27, i64 0, i64 0
%108 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %105, i32 %106, i32 300, i8* %107, i8* null)
%109 = getelementptr inbounds [300 x i8], [300 x i8]* %27, i64 0, i64 0
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %109)
%111 = load i32, i32* %14
%112 = load i32, i32* @CL_DEVICE_LOCAL_MEM_SIZE
%113 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%114 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %111, i32 %112, i32 8, i64* %113, i8* null)
%115 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%116 = load i64, i64* %115
%117 = trunc i64 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %117)
%119 = load i32, i32* %14
%120 = load i32, i32* @CL_DEVICE_MAX_WORK_GROUP_SIZE
%121 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%122 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %119, i32 %120, i32 8, i64* %121, i8* null)
%123 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%124 = load i64, i64* %123
%125 = trunc i64 %124 to i32
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %125)
%127 = load i32, i32* %14
%128 = load i32, i32* @CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS
%129 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%130 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %127, i32 %128, i32 8, i64* %129, i8* null)
%131 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%132 = load i64, i64* %131
%133 = trunc i64 %132 to i32
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i32 %133)
%135 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%136 = load i64, i64* %135
%137 = trunc i64 %136 to i32
store i32 %137, i32* %3
%138 = load i32, i32* %14
%139 = load i32, i32* @CL_DEVICE_MAX_WORK_ITEM_SIZES
%140 = load i32, i32* %3
%141 = sext i32 %140 to i64
%142 = mul i64 8, %141
%143 = trunc i64 %142 to i32
%144 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%145 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %138, i32 %139, i32 %143, i64* %144, i8* null)
%146 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %2
br label %147
147: ; preds = %158, %98
%148 = load i32, i32* %2
%149 = load i32, i32* %3
%150 = icmp slt i32 %148, %149
br i1 %150, label %151, label %161
151: ; preds = %147
%152 = load i32, i32* %2
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 %153
%155 = load i64, i64* %154
%156 = trunc i64 %155 to i32
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %156)
br label %158
158: ; preds = %151
%159 = load i32, i32* %2
%160 = add nsw i32 %159, 1
store i32 %160, i32* %2
br label %147
161: ; preds = %147
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%163 = load i32, i32* %14
%164 = load i32, i32* @CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE
%165 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%166 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %163, i32 %164, i32 8, i64* %165, i8* null)
%167 = getelementptr inbounds [5 x i64], [5 x i64]* %26, i64 0, i64 0
%168 = load i64, i64* %167
%169 = trunc i64 %168 to i32
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %169)
store i32 3, i32* %28
store i32 128, i32* %29
store i32 32, i32* %30
store i32 256, i32* %31
store i32 256, i32* %32
store i32 9, i32* %33
store i32 0, i32* %34
%171 = load i32, i32* %34
%172 = sdiv i32 %171, 2
%173 = call i32 @floor(i32 %172)
%174 = sub nsw i32 0, %173
store i32 %174, i32* %35
store i32 1, i32* %36
%175 = load i32, i32* %34
%176 = load i32, i32* %32
%177 = add nsw i32 %175, %176
%178 = load i32, i32* %33
%179 = sub nsw i32 %177, %178
%180 = load i32, i32* %36
%181 = sdiv i32 %179, %180
%182 = add nsw i32 %181, 1
store i32 %182, i32* %37
%183 = load i32, i32* %34
%184 = load i32, i32* %31
%185 = add nsw i32 %183, %184
%186 = load i32, i32* %33
%187 = sub nsw i32 %185, %186
%188 = load i32, i32* %36
%189 = sdiv i32 %187, %188
%190 = add nsw i32 %189, 1
store i32 %190, i32* %38
%191 = load i32, i32* %29
store i32 %191, i32* %39
store float 0.000000e+00, float* %40
store float 1.000000e+00, float* %41
store i32 1, i32* %42
%192 = load i32, i32* %29
%193 = srem i32 %192, 128
%194 = icmp eq i32 %193, 0
br i1 %194, label %195, label %196
195: ; preds = %161
br label %202
196: ; preds = %161
%197 = load i32, i32* %29
%198 = srem i32 %197, 64
%199 = icmp eq i32 %198, 0
%200 = zext i1 %199 to i64
%201 = select i1 %199, i32 2, i32 1
br label %202
202: ; preds = %196, %195
%203 = phi i32 [ 4, %195 ], [ %201, %196 ]
store i32 %203, i32* %43
%204 = load i32, i32* %37
%205 = load i32, i32* %38
%206 = mul nsw i32 %204, %205
store i32 %206, i32* %44
%207 = load i32, i32* %29
%208 = load i32, i32* %43
%209 = mul nsw i32 32, %208
%210 = srem i32 %207, %209
%211 = icmp ne i32 %210, 0
%212 = zext i1 %211 to i32
store i32 %212, i32* %45
%213 = load i32, i32* %29
%214 = load i32, i32* %28
%215 = mul nsw i32 %213, %214
%216 = load i32, i32* %31
%217 = mul nsw i32 %215, %216
%218 = load i32, i32* %32
%219 = mul nsw i32 %217, %218
%220 = call i64 @calloc(i32 %219, i32 8)
%221 = inttoptr i64 %220 to double*
store double* %221, double** %8
%222 = load i32, i32* %29
%223 = load i32, i32* %30
%224 = mul nsw i32 %222, %223
%225 = load i32, i32* %38
%226 = mul nsw i32 %224, %225
%227 = load i32, i32* %37
%228 = mul nsw i32 %226, %227
%229 = call i64 @calloc(i32 %228, i32 8)
%230 = inttoptr i64 %229 to double*
store double* %230, double** %9
%231 = load i32, i32* %30
%232 = load i32, i32* %28
%233 = mul nsw i32 %231, %232
%234 = load i32, i32* %33
%235 = mul nsw i32 %233, %234
%236 = load i32, i32* %33
%237 = mul nsw i32 %235, %236
%238 = call i64 @calloc(i32 %237, i32 8)
%239 = inttoptr i64 %238 to double*
store double* %239, double** %10
%240 = load double*, double** %8
%241 = getelementptr inbounds double, double* %240, i64 0
store double 2.000000e+00, double* %241
%242 = load double*, double** %8
%243 = getelementptr inbounds double, double* %242, i64 1
store double 3.000000e+00, double* %243
%244 = load double*, double** %8
%245 = load i32, i32* %31
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds double, double* %244, i64 %246
store double 1.000000e+00, double* %247
%248 = load double*, double** %10
%249 = getelementptr inbounds double, double* %248, i64 0
store double 2.000000e+00, double* %249
%250 = load double*, double** %10
%251 = load i32, i32* %30
%252 = sext i32 %251 to i64
%253 = getelementptr inbounds double, double* %250, i64 %252
store double 5.000000e-01, double* %253
%254 = load i32, i32* %30
%255 = srem i32 %254, 32
%256 = icmp eq i32 %255, 0
%257 = zext i1 %256 to i64
%258 = select i1 %256, i32 8, i32 4
%259 = load i32, i32* %28
%260 = load i32, i32* %45
%261 = call i8* @loadcusource(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i32 %258, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i32 %259, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0), i32 %260, i32 0)
store i8* %261, i8** %46
%262 = load i32, i32* %16
%263 = call i32 @clCreateProgramWithSource(i32 %262, i32 1, i8** %46, i32* null, i32* %12)
store i32 %263, i32* %22
%264 = load i32, i32* %22
%265 = icmp ne i32 %264, 0
br i1 %265, label %269, label %266
266: ; preds = %202
%267 = load i32, i32* %12
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.20, i64 0, i64 0), i32 %267)
store i32 -1, i32* %1
br label %587
269: ; preds = %202
%270 = load i32, i32* %22
%271 = call i32 @clBuildProgram(i32 %270, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %271, i32* %12
%272 = load i32, i32* %12
%273 = load i32, i32* @CL_SUCCESS
%274 = icmp ne i32 %272, %273
br i1 %274, label %275, label %283
275: ; preds = %269
%276 = load i32, i32* %22
%277 = load i32, i32* %14
%278 = load i32, i32* @CL_PROGRAM_BUILD_LOG
%279 = getelementptr inbounds [20000 x i8], [20000 x i8]* %47, i64 0, i64 0
%280 = call i32 @clGetProgramBuildInfo(i32 %276, i32 %277, i32 %278, i32 20000, i8* %279, i64* %48)
%281 = getelementptr inbounds [20000 x i8], [20000 x i8]* %47, i64 0, i64 0
%282 = call i32 @puts(i8* %281)
store i32 -1, i32* %1
br label %587
283: ; preds = %269
%284 = load i32, i32* %22
%285 = call i32 @clCreateKernel(i32 %284, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.21, i64 0, i64 0), i32* %12)
store i32 %285, i32* %23
%286 = load i32, i32* %23
%287 = icmp ne i32 %286, 0
br i1 %287, label %288, label %292
288: ; preds = %283
%289 = load i32, i32* %12
%290 = load i32, i32* @CL_SUCCESS
%291 = icmp ne i32 %289, %290
br i1 %291, label %292, label %294
292: ; preds = %288, %283
%293 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.22, i64 0, i64 0))
store i32 -1, i32* %1
br label %587
294: ; preds = %288
%295 = load i32, i32* %31
%296 = load i32, i32* %32
%297 = mul nsw i32 %295, %296
%298 = load i32, i32* %28
%299 = mul nsw i32 %297, %298
%300 = load i32, i32* %29
%301 = mul nsw i32 %299, %300
store i32 %301, i32* %49
%302 = load i32, i32* %33
%303 = load i32, i32* %33
%304 = mul nsw i32 %302, %303
%305 = load i32, i32* %28
%306 = mul nsw i32 %304, %305
%307 = load i32, i32* %30
%308 = mul nsw i32 %306, %307
store i32 %308, i32* %50
%309 = load i32, i32* %29
%310 = load i32, i32* %30
%311 = mul nsw i32 %309, %310
%312 = load i32, i32* %37
%313 = mul nsw i32 %311, %312
%314 = load i32, i32* %38
%315 = mul nsw i32 %313, %314
store i32 %315, i32* %51
%316 = load i32, i32* %16
%317 = load i32, i32* @CL_MEM_READ_ONLY
%318 = load i32, i32* %49
%319 = sext i32 %318 to i64
%320 = mul i64 %319, 8
%321 = trunc i64 %320 to i32
%322 = call i32 @clCreateBuffer(i32 %316, i32 %317, i32 %321, i32* null, i32* %12)
store i32 %322, i32* %18
%323 = load i32, i32* %16
%324 = load i32, i32* @CL_MEM_READ_ONLY
%325 = load i32, i32* %50
%326 = sext i32 %325 to i64
%327 = mul i64 %326, 8
%328 = trunc i64 %327 to i32
%329 = call i32 @clCreateBuffer(i32 %323, i32 %324, i32 %328, i32* null, i32* %12)
store i32 %329, i32* %19
%330 = load i32, i32* %16
%331 = load i32, i32* @CL_MEM_READ_WRITE
%332 = load i32, i32* %51
%333 = sext i32 %332 to i64
%334 = mul i64 %333, 8
%335 = trunc i64 %334 to i32
%336 = call i32 @clCreateBuffer(i32 %330, i32 %331, i32 %335, i32* null, i32* %12)
store i32 %336, i32* %20
%337 = getelementptr inbounds [1 x i32], [1 x i32]* %17, i64 0, i64 0
%338 = load i32, i32* %337
%339 = load i32, i32* %18
%340 = load i32, i32* @CL_TRUE
%341 = load i32, i32* %49
%342 = sext i32 %341 to i64
%343 = mul i64 %342, 8
%344 = trunc i64 %343 to i32
%345 = load double*, double** %8
%346 = call i32 @clEnqueueWriteBuffer(i32 %338, i32 %339, i32 %340, i32 0, i32 %344, double* %345, i32 0, i32* null, i32* null)
store i32 %346, i32* %12
%347 = getelementptr inbounds [1 x i32], [1 x i32]* %17, i64 0, i64 0
%348 = load i32, i32* %347
%349 = load i32, i32* %19
%350 = load i32, i32* @CL_TRUE
%351 = load i32, i32* %50
%352 = sext i32 %351 to i64
%353 = mul i64 %352, 8
%354 = trunc i64 %353 to i32
%355 = load double*, double** %10
%356 = call i32 @clEnqueueWriteBuffer(i32 %348, i32 %349, i32 %350, i32 0, i32 %354, double* %355, i32 0, i32* null, i32* null)
store i32 %356, i32* %12
%357 = load i32, i32* %23
%358 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %357, i32 0, i32 4, i32* %18)
%359 = load i32, i32* %23
%360 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %359, i32 1, i32 4, i32* %19)
%361 = load i32, i32* %23
%362 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %361, i32 2, i32 4, i32* %20)
%363 = load i32, i32* %23
%364 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %363, i32 3, i32 4, i32* %29)
%365 = load i32, i32* %23
%366 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %365, i32 4, i32 4, i32* %30)
%367 = load i32, i32* %23
%368 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %367, i32 5, i32 4, i32* %32)
%369 = load i32, i32* %23
%370 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %369, i32 6, i32 4, i32* %31)
%371 = load i32, i32* %23
%372 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %371, i32 7, i32 4, i32* %33)
%373 = load i32, i32* %23
%374 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %373, i32 8, i32 4, i32* %35)
%375 = load i32, i32* %23
%376 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %375, i32 9, i32 4, i32* %36)
%377 = load i32, i32* %23
%378 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %377, i32 10, i32 4, i32* %37)
%379 = load i32, i32* %23
%380 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %379, i32 11, i32 4, i32* %38)
%381 = load i32, i32* %23
%382 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %381, i32 12, i32 4, i32* %39)
%383 = load i32, i32* %23
%384 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %383, i32 13, i32 4, float* %40)
%385 = load i32, i32* %23
%386 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %385, i32 14, i32 4, float* %41)
%387 = load i32, i32* %23
%388 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %387, i32 15, i32 4, i32* %42)
%389 = load i32, i32* %30
%390 = srem i32 %389, 32
%391 = icmp eq i32 %390, 0
br i1 %391, label %392, label %409
392: ; preds = %294
%393 = load i32, i32* %29
%394 = load i32, i32* %43
%395 = mul nsw i32 32, %394
%396 = sub nsw i32 %395, 1
%397 = add nsw i32 %393, %396
%398 = load i32, i32* %43
%399 = mul nsw i32 32, %398
%400 = sdiv i32 %397, %399
%401 = sext i32 %400 to i64
%402 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 0, i64 0
store i64 %401, i64* %402
%403 = load i32, i32* %44
%404 = load i32, i32* %30
%405 = mul nsw i32 %403, %404
%406 = sdiv i32 %405, 32
%407 = sext i32 %406 to i64
%408 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 0, i64 1
store i64 %407, i64* %408
br label %426
409: ; preds = %294
%410 = load i32, i32* %29
%411 = load i32, i32* %43
%412 = mul nsw i32 32, %411
%413 = sub nsw i32 %412, 1
%414 = add nsw i32 %410, %413
%415 = load i32, i32* %43
%416 = mul nsw i32 32, %415
%417 = sdiv i32 %414, %416
%418 = sext i32 %417 to i64
%419 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 0, i64 0
store i64 %418, i64* %419
%420 = load i32, i32* %44
%421 = load i32, i32* %30
%422 = mul nsw i32 %420, %421
%423 = sdiv i32 %422, 16
%424 = sext i32 %423 to i64
%425 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 0, i64 1
store i64 %424, i64* %425
br label %426
426: ; preds = %409, %392
%427 = getelementptr inbounds [2 x i64], [2 x i64]* %25, i64 0, i64 0
store i64 32, i64* %427
%428 = getelementptr inbounds [2 x i64], [2 x i64]* %25, i64 0, i64 1
store i64 4, i64* %428
%429 = getelementptr inbounds [2 x i64], [2 x i64]* %25, i64 0, i64 0
%430 = load i64, i64* %429
%431 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 0, i64 0
%432 = load i64, i64* %431
%433 = mul i64 %432, %430
store i64 %433, i64* %431
%434 = getelementptr inbounds [2 x i64], [2 x i64]* %25, i64 0, i64 1
%435 = load i64, i64* %434
%436 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 0, i64 1
%437 = load i64, i64* %436
%438 = mul i64 %437, %435
store i64 %438, i64* %436
%439 = call i32 @usleep(i32 100000)
%440 = call i32 @gettimeofday(%struct.timeval* %52, i32* null)
store i32 0, i32* %4
br label %441
441: ; preds = %468, %426
%442 = load i32, i32* %4
%443 = load i32, i32* %5
%444 = icmp slt i32 %442, %443
br i1 %444, label %445, label %471
445: ; preds = %441
store i32 0, i32* %2
br label %446
446: ; preds = %464, %445
%447 = load i32, i32* %2
%448 = load i32, i32* %6
%449 = icmp slt i32 %447, %448
br i1 %449, label %450, label %467
450: ; preds = %446
%451 = getelementptr inbounds [1 x i32], [1 x i32]* %17, i64 0, i64 0
%452 = load i32, i32* %451
%453 = load i32, i32* %23
%454 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 0, i64 0
%455 = getelementptr inbounds [2 x i64], [2 x i64]* %25, i64 0, i64 0
%456 = call i32 @clEnqueueNDRangeKernel(i32 %452, i32 %453, i32 2, i32* null, i64* %454, i64* %455, i32 0, i32* null, i32* null)
store i32 %456, i32* %12
%457 = load i32, i32* %12
%458 = load i32, i32* @CL_SUCCESS
%459 = icmp ne i32 %457, %458
br i1 %459, label %460, label %463
460: ; preds = %450
%461 = load i32, i32* %12
%462 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.23, i64 0, i64 0), i32 %461)
store i32 -1, i32* %1
br label %587
463: ; preds = %450
br label %464
464: ; preds = %463
%465 = load i32, i32* %2
%466 = add nsw i32 %465, 1
store i32 %466, i32* %2
br label %446
467: ; preds = %446
br label %468
468: ; preds = %467
%469 = load i32, i32* %4
%470 = add nsw i32 %469, 1
store i32 %470, i32* %4
br label %441
471: ; preds = %441
%472 = getelementptr inbounds [1 x i32], [1 x i32]* %17, i64 0, i64 0
%473 = load i32, i32* %472
%474 = call i32 @clFinish(i32 %473)
%475 = call i32 @gettimeofday(%struct.timeval* %53, i32* null)
%476 = getelementptr inbounds %struct.timeval, %struct.timeval* %53, i32 0, i32 1
%477 = load i64, i64* %476
%478 = getelementptr inbounds %struct.timeval, %struct.timeval* %52, i32 0, i32 1
%479 = load i64, i64* %478
%480 = sub nsw i64 %477, %479
%481 = sitofp i64 %480 to double
%482 = getelementptr inbounds %struct.timeval, %struct.timeval* %53, i32 0, i32 0
%483 = load i64, i64* %482
%484 = getelementptr inbounds %struct.timeval, %struct.timeval* %52, i32 0, i32 0
%485 = load i64, i64* %484
%486 = sub nsw i64 %483, %485
%487 = sitofp i64 %486 to double
%488 = fdiv double %487, 1.000000e+06
%489 = fadd double %481, %488
store double %489, double* %54
%490 = getelementptr inbounds [1 x i32], [1 x i32]* %17, i64 0, i64 0
%491 = load i32, i32* %490
%492 = load i32, i32* %20
%493 = load i32, i32* @CL_TRUE
%494 = load i32, i32* %51
%495 = sext i32 %494 to i64
%496 = mul i64 %495, 8
%497 = trunc i64 %496 to i32
%498 = load double*, double** %9
%499 = call i32 @clEnqueueReadBuffer(i32 %491, i32 %492, i32 %493, i32 0, i32 %497, double* %498, i32 0, i32* null, i32* null)
store i32 %499, i32* %12
%500 = getelementptr inbounds [1 x i32], [1 x i32]* %17, i64 0, i64 0
%501 = load i32, i32* %500
%502 = call i32 @clFinish(i32 %501)
%503 = load double*, double** %9
%504 = getelementptr inbounds double, double* %503, i64 0
%505 = load double, double* %504
%506 = load double*, double** %9
%507 = getelementptr inbounds double, double* %506, i64 1
%508 = load double, double* %507
%509 = load double*, double** %9
%510 = load i32, i32* %31
%511 = sext i32 %510 to i64
%512 = getelementptr inbounds double, double* %509, i64 %511
%513 = load double, double* %512
%514 = load double*, double** %9
%515 = load i32, i32* %31
%516 = add nsw i32 %515, 1
%517 = sext i32 %516 to i64
%518 = getelementptr inbounds double, double* %514, i64 %517
%519 = load double, double* %518
%520 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.24, i64 0, i64 0), double %505, double %508, double %513, double %519)
%521 = load i32, i32* %18
%522 = call i32 @clReleaseMemObject(i32 %521)
%523 = load i32, i32* %19
%524 = call i32 @clReleaseMemObject(i32 %523)
%525 = load i32, i32* %20
%526 = call i32 @clReleaseMemObject(i32 %525)
store i32 0, i32* %2
br label %527
527: ; preds = %536, %471
%528 = load i32, i32* %2
%529 = icmp slt i32 %528, 1
br i1 %529, label %530, label %539
530: ; preds = %527
%531 = load i32, i32* %2
%532 = sext i32 %531 to i64
%533 = getelementptr inbounds [1 x i32], [1 x i32]* %17, i64 0, i64 %532
%534 = load i32, i32* %533
%535 = call i32 @clReleaseCommandQueue(i32 %534)
br label %536
536: ; preds = %530
%537 = load i32, i32* %2
%538 = add nsw i32 %537, 1
store i32 %538, i32* %2
br label %527
539: ; preds = %527
%540 = load i32, i32* %16
%541 = call i32 @clReleaseContext(i32 %540)
%542 = load i32, i32* %5
%543 = sitofp i32 %542 to double
%544 = fmul double 1.000000e+00, %543
%545 = load i32, i32* %7
%546 = sitofp i32 %545 to double
%547 = fmul double %544, %546
%548 = load i32, i32* %38
%549 = sitofp i32 %548 to double
%550 = fmul double %547, %549
%551 = load i32, i32* %37
%552 = sitofp i32 %551 to double
%553 = fmul double %550, %552
%554 = load i32, i32* %30
%555 = sitofp i32 %554 to double
%556 = fmul double %553, %555
%557 = load i32, i32* %29
%558 = sitofp i32 %557 to double
%559 = fmul double %556, %558
%560 = load i32, i32* %28
%561 = sitofp i32 %560 to double
%562 = fmul double %559, %561
%563 = load i32, i32* %33
%564 = sitofp i32 %563 to double
%565 = fmul double %562, %564
%566 = load i32, i32* %33
%567 = sitofp i32 %566 to double
%568 = fmul double %565, %567
store double %568, double* %11
%569 = load i32, i32* %6
%570 = sitofp i32 %569 to double
%571 = load double, double* %11
%572 = fmul double %570, %571
%573 = fmul double %572, 0x3EB0C6F7A0B5ED8D
%574 = load i32, i32* %5
%575 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.25, i64 0, i64 0), double %573, i32 %574)
%576 = load double, double* %54
%577 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0), double %576)
%578 = load double, double* %11
%579 = load i32, i32* %6
%580 = sitofp i32 %579 to double
%581 = fmul double %578, %580
%582 = load double, double* %54
%583 = fdiv double %581, %582
%584 = fmul double %583, 1.000000e-09
%585 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.27, i64 0, i64 0), double %584)
%586 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %1
br label %587
587: ; preds = %539, %460, %292, %275, %266
%588 = load i32, i32* %1
ret i32 %588
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@CL_CONTEXT_PLATFORM = global i64 0
@.str = [33 x i8] c"clGetPlatformIDs failed, err=%d\0A\00"
@CL_DEVICE_TYPE_GPU = global i32 0
@.str.1 = [31 x i8] c"clGetDeviceIDs failed, err=%d\0A\00"
@.str.2 = [32 x i8] c"clCreateContext failed, err=%d\0A\00"
@CL_DEVICE_VERSION = global i32 0
@.str.3 = [22 x i8] c"CL_DEVICE_VERSION=%s\0A\00"
@CL_DRIVER_VERSION = global i32 0
@.str.4 = [22 x i8] c"CL_DRIVER_VERSION=%s\0A\00"
@CL_DEVICE_LOCAL_MEM_SIZE = global i32 0
@.str.5 = [29 x i8] c"CL_DEVICE_LOCAL_MEM_SIZE=%d\0A\00"
@CL_DEVICE_MAX_WORK_GROUP_SIZE = global i32 0
@.str.6 = [34 x i8] c"CL_DEVICE_MAX_WORK_GROUP_SIZE=%d\0A\00"
@CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS = global i32 0
@.str.7 = [39 x i8] c"CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS=%d\0A\00"
@CL_DEVICE_MAX_WORK_ITEM_SIZES = global i32 0
@.str.8 = [31 x i8] c"CL_DEVICE_MAX_WORK_ITEM_SIZES=\00"
@.str.9 = [4 x i8] c"%d \00"
@CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = global i32 0
@.str.11 = [39 x i8] c"CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE=%d\0A\00"
@.str.12 = [24 x i8] c"filterActs_YxX_color.cu\00"
@.str.13 = [4 x i8] c"B_Y\00"
@.str.14 = [4 x i8] c"B_X\00"
@.str.15 = [14 x i8] c"imgsPerThread\00"
@.str.16 = [17 x i8] c"filtersPerThread\00"
@.str.17 = [10 x i8] c"numColors\00"
@.str.18 = [6 x i8] c"scale\00"
@.str.19 = [15 x i8] c"checkImgBounds\00"
@.str.20 = [34 x i8] c"Error creating program, err = %d\0A\00"
@CL_SUCCESS = global i32 0
@CL_PROGRAM_BUILD_LOG = global i32 0
@.str.21 = [21 x i8] c"filterActs_YxX_color\00"
@CL_MEM_READ_ONLY = global i32 0
@CL_MEM_READ_WRITE = global i32 0
@CL_TRUE = global i32 0
@.str.23 = [33 x i8] c"clEnqueueNDRangeKernel error %d\0A\00"
@.str.24 = [13 x i8] c"%f %f %f %f\0A\00"
@.str.25 = [39 x i8] c"Total M ops = %.0lf, # of threads = %d\00"
@.str.26 = [17 x i8] c"\0ATime in s: %lf:\00"
@.str.27 = [32 x i8] c"\0ATest performance [G OP/s] %lf:\00"
@str = [22 x i8] c"Error creating kernel\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
%4 = alloca [3 x i64]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [2 x i64]
%9 = alloca <2 x i64>
%10 = alloca [5 x i64]
%11 = alloca [300 x i8]
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca float
%23 = alloca float
%24 = alloca i32
%25 = alloca i8*
%26 = alloca [20000 x i8]
%27 = alloca i64
%28 = alloca %struct.timeval
%29 = alloca %struct.timeval
%30 = bitcast i32* %1 to i8*
%31 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%32 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%33 = bitcast [3 x i64]* %4 to i8*
%34 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
%35 = load i64, i64* @CL_CONTEXT_PLATFORM
store i64 %35, i64* %34
%36 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 1
%37 = bitcast i32* %5 to i8*
%38 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
store i64 0, i64* %38
%39 = bitcast i32* %6 to i8*
%40 = bitcast i32* %7 to i8*
%41 = bitcast [2 x i64]* %8 to i8*
%42 = bitcast <2 x i64>* %9 to i8*
%43 = bitcast [5 x i64]* %10 to i8*
%44 = getelementptr inbounds [300 x i8], [300 x i8]* %11, i64 0, i64 0
%45 = call i32 @clGetPlatformIDs(i32 1, i64* %2, i32* null)
%46 = icmp eq i32 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %0
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %45)
br label %49
49: ; preds = %47, %0
%50 = load i64, i64* %2
%51 = load i32, i32* @CL_DEVICE_TYPE_GPU
%52 = call i32 @clGetDeviceIDs(i64 %50, i32 %51, i32 1, i32* %3, i32* null)
store i32 %52, i32* %1
%53 = icmp eq i32 %52, 0
br i1 %53, label %56, label %54
54: ; preds = %49
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %52)
br label %56
56: ; preds = %54, %49
%57 = load i64, i64* %2
store i64 %57, i64* %36
%58 = call i32 @clCreateContext(i64* %34, i32 1, i32* %3, i32* null, i32* null, i32* %1)
%59 = load i32, i32* %1
%60 = icmp eq i32 %59, 0
br i1 %60, label %63, label %61
61: ; preds = %56
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i32 %59)
br label %63
63: ; preds = %61, %56
%64 = load i32, i32* %3
%65 = call i32 @clCreateCommandQueue(i32 %58, i32 %64, i32 0, i32* %1)
%66 = load i32, i32* %3
%67 = load i32, i32* @CL_DEVICE_VERSION
%68 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %66, i32 %67, i32 300, i8* %44, i8* null)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i8* %44)
%70 = load i32, i32* %3
%71 = load i32, i32* @CL_DRIVER_VERSION
%72 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %70, i32 %71, i32 300, i8* %44, i8* null)
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %44)
%74 = load i32, i32* %3
%75 = load i32, i32* @CL_DEVICE_LOCAL_MEM_SIZE
%76 = getelementptr inbounds [5 x i64], [5 x i64]* %10, i64 0, i64 0
%77 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %74, i32 %75, i32 8, i64* %76, i8* null)
%78 = load i64, i64* %76
%79 = trunc i64 %78 to i32
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %79)
%81 = load i32, i32* %3
%82 = load i32, i32* @CL_DEVICE_MAX_WORK_GROUP_SIZE
%83 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %81, i32 %82, i32 8, i64* %76, i8* null)
%84 = load i64, i64* %76
%85 = trunc i64 %84 to i32
%86 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i32 %85)
%87 = load i32, i32* %3
%88 = load i32, i32* @CL_DEVICE_MAX_WORK_ITEM_DIMENSIONS
%89 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %87, i32 %88, i32 8, i64* %76, i8* null)
%90 = load i64, i64* %76
%91 = trunc i64 %90 to i32
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0), i32 %91)
%93 = load i64, i64* %76
%94 = trunc i64 %93 to i32
%95 = load i32, i32* %3
%96 = load i32, i32* @CL_DEVICE_MAX_WORK_ITEM_SIZES
%97 = shl i32 %94, 3
%98 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %95, i32 %96, i32 %97, i64* %76, i8* null)
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.8, i64 0, i64 0))
%100 = icmp sgt i32 %94, 0
br i1 %100, label %101, label %111
101: ; preds = %63
%102 = and i64 %93, 4294967295
br label %103
103: ; preds = %101, %103
%104 = phi i64 [ 0, %101 ], [ %109, %103 ]
%105 = getelementptr inbounds [5 x i64], [5 x i64]* %10, i64 0, i64 %104
%106 = load i64, i64* %105
%107 = trunc i64 %106 to i32
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 %107)
%109 = add nuw nsw i64 %104, 1
%110 = icmp eq i64 %109, %102
br i1 %110, label %111, label %103
111: ; preds = %103, %63
%112 = call i32 @putchar(i32 10)
%113 = load i32, i32* %3
%114 = load i32, i32* @CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE
%115 = call i32 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %113, i32 %114, i32 8, i64* %76, i8* null)
%116 = load i64, i64* %76
%117 = trunc i64 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0), i32 %117)
%119 = bitcast i32* %12 to i8*
store i32 128, i32* %12
%120 = bitcast i32* %13 to i8*
store i32 32, i32* %13
%121 = bitcast i32* %14 to i8*
store i32 256, i32* %14
%122 = bitcast i32* %15 to i8*
store i32 256, i32* %15
%123 = bitcast i32* %16 to i8*
store i32 9, i32* %16
%124 = bitcast i32* %17 to i8*
%125 = call i32 @floor(i32 0)
%126 = sub nsw i32 0, %125
store i32 %126, i32* %17
%127 = bitcast i32* %18 to i8*
store i32 1, i32* %18
%128 = bitcast i32* %19 to i8*
store i32 248, i32* %19
%129 = bitcast i32* %20 to i8*
store i32 248, i32* %20
%130 = bitcast i32* %21 to i8*
store i32 128, i32* %21
%131 = bitcast float* %22 to i8*
store float 0.000000e+00, float* %22
%132 = bitcast float* %23 to i8*
store float 1.000000e+00, float* %23
%133 = bitcast i32* %24 to i8*
store i32 1, i32* %24
%134 = call i64 @calloc(i32 25165824, i32 8)
%135 = inttoptr i64 %134 to double*
%136 = call i64 @calloc(i32 251920384, i32 8)
%137 = inttoptr i64 %136 to double*
%138 = call i64 @calloc(i32 7776, i32 8)
%139 = inttoptr i64 %138 to double*
%140 = inttoptr i64 %134 to <2 x double>*
store <2 x double> <double 2.000000e+00, double 3.000000e+00>, <2 x double>* %140
%141 = getelementptr inbounds double, double* %135, i64 256
store double 1.000000e+00, double* %141
store double 2.000000e+00, double* %139
%142 = getelementptr inbounds double, double* %139, i64 32
store double 5.000000e-01, double* %142
%143 = bitcast i8** %25 to i8*
%144 = call i8* @loadcusource(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0), i32 32, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.15, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0), i32 8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.17, i64 0, i64 0), i32 3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0), i32 0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0), i32 0, i32 0)
store i8* %144, i8** %25
%145 = call i32 @clCreateProgramWithSource(i32 %58, i32 1, i8** %25, i32* null, i32* %1)
%146 = icmp eq i32 %145, 0
br i1 %146, label %147, label %150
147: ; preds = %111
%148 = load i32, i32* %1
%149 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.20, i64 0, i64 0), i32 %148)
br label %288
150: ; preds = %111
%151 = call i32 @clBuildProgram(i32 %145, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %151, i32* %1
%152 = load i32, i32* @CL_SUCCESS
%153 = icmp eq i32 %151, %152
br i1 %153, label %161, label %154
154: ; preds = %150
%155 = getelementptr inbounds [20000 x i8], [20000 x i8]* %26, i64 0, i64 0
%156 = bitcast i64* %27 to i8*
%157 = load i32, i32* %3
%158 = load i32, i32* @CL_PROGRAM_BUILD_LOG
%159 = call i32 @clGetProgramBuildInfo(i32 %145, i32 %157, i32 %158, i32 20000, i8* %155, i64* %27)
%160 = call i32 @puts(i8* %155)
br label %288
161: ; preds = %150
%162 = call i32 @clCreateKernel(i32 %145, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.21, i64 0, i64 0), i32* %1)
%163 = icmp eq i32 %162, 0
br i1 %163, label %168, label %164
164: ; preds = %161
%165 = load i32, i32* %1
%166 = load i32, i32* @CL_SUCCESS
%167 = icmp eq i32 %165, %166
br i1 %167, label %170, label %168
168: ; preds = %164, %161
%169 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %288
170: ; preds = %164
%171 = load i32, i32* @CL_MEM_READ_ONLY
%172 = call i32 @clCreateBuffer(i32 %58, i32 %171, i32 201326592, i32* null, i32* %1)
store i32 %172, i32* %5
%173 = load i32, i32* @CL_MEM_READ_ONLY
%174 = call i32 @clCreateBuffer(i32 %58, i32 %173, i32 62208, i32* null, i32* %1)
store i32 %174, i32* %6
%175 = load i32, i32* @CL_MEM_READ_WRITE
%176 = call i32 @clCreateBuffer(i32 %58, i32 %175, i32 2015363072, i32* null, i32* %1)
store i32 %176, i32* %7
%177 = load i32, i32* @CL_TRUE
%178 = call i32 @clEnqueueWriteBuffer(i32 %65, i32 %172, i32 %177, i32 0, i32 201326592, double* %135, i32 0, i32* null, i32* null)
store i32 %178, i32* %1
%179 = load i32, i32* @CL_TRUE
%180 = call i32 @clEnqueueWriteBuffer(i32 %65, i32 %174, i32 %179, i32 0, i32 62208, double* %139, i32 0, i32* null, i32* null)
store i32 %180, i32* %1
%181 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 0, i32 4, i32* %5)
%182 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 1, i32 4, i32* %6)
%183 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 2, i32 4, i32* %7)
%184 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 3, i32 4, i32* %12)
%185 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 4, i32 4, i32* %13)
%186 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 5, i32 4, i32* %15)
%187 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 6, i32 4, i32* %14)
%188 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 7, i32 4, i32* %16)
%189 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 8, i32 4, i32* %17)
%190 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 9, i32 4, i32* %18)
%191 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 10, i32 4, i32* %19)
%192 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 11, i32 4, i32* %20)
%193 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 12, i32 4, i32* %21)
%194 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 13, i32 4, float* %22)
%195 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 14, i32 4, float* %23)
%196 = call i32 (i32, i32, i32, ...) @clSetKernelArg(i32 %162, i32 15, i32 4, i32* %24)
%197 = load i32, i32* %13
%198 = and i32 %197, 31
%199 = icmp eq i32 %198, 0
%200 = select i1 %199, i32 1922, i32 3844
%201 = mul nsw i32 %197, %200
%202 = load i32, i32* %12
%203 = add nsw i32 %202, 127
%204 = sext i32 %201 to i64
%205 = sdiv i32 %203, 128
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds [2 x i64], [2 x i64]* %8, i64 0, i64 0
%208 = getelementptr inbounds [2 x i64], [2 x i64]* %8, i64 0, i64 1
%209 = getelementptr inbounds <2 x i64>, <2 x i64>* %9, i64 0, i64 0
store <2 x i64> <i64 32, i64 4>, <2 x i64>* %9
%210 = shl nsw i64 %206, 5
store i64 %210, i64* %207
%211 = shl nsw i64 %204, 2
store i64 %211, i64* %208
%212 = call i32 @usleep(i32 100000)
%213 = bitcast %struct.timeval* %28 to i8*
%214 = bitcast %struct.timeval* %29 to i8*
%215 = call i32 @gettimeofday(%struct.timeval* %28, i32* null)
%216 = call i32 @clEnqueueNDRangeKernel(i32 %65, i32 %162, i32 2, i32* null, i64* %207, i64* %209, i32 0, i32* null, i32* null)
store i32 %216, i32* %1
%217 = load i32, i32* @CL_SUCCESS
%218 = icmp eq i32 %216, %217
br i1 %218, label %221, label %219
219: ; preds = %170
%220 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.23, i64 0, i64 0), i32 %216)
br label %286
221: ; preds = %170
%222 = call i32 @clFinish(i32 %65)
%223 = call i32 @gettimeofday(%struct.timeval* %29, i32* null)
%224 = getelementptr inbounds %struct.timeval, %struct.timeval* %29, i64 0, i32 1
%225 = load i64, i64* %224
%226 = getelementptr inbounds %struct.timeval, %struct.timeval* %28, i64 0, i32 1
%227 = load i64, i64* %226
%228 = sub nsw i64 %225, %227
%229 = sitofp i64 %228 to double
%230 = getelementptr inbounds %struct.timeval, %struct.timeval* %29, i64 0, i32 0
%231 = load i64, i64* %230
%232 = getelementptr inbounds %struct.timeval, %struct.timeval* %28, i64 0, i32 0
%233 = load i64, i64* %232
%234 = sub nsw i64 %231, %233
%235 = sitofp i64 %234 to double
%236 = fdiv double %235, 1.000000e+06
%237 = fadd double %236, %229
%238 = load i32, i32* %7
%239 = load i32, i32* @CL_TRUE
%240 = call i32 @clEnqueueReadBuffer(i32 %65, i32 %238, i32 %239, i32 0, i32 2015363072, double* %137, i32 0, i32* null, i32* null)
store i32 %240, i32* %1
%241 = call i32 @clFinish(i32 %65)
%242 = load double, double* %137
%243 = getelementptr inbounds double, double* %137, i64 1
%244 = load double, double* %243
%245 = load i32, i32* %14
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds double, double* %137, i64 %246
%248 = load double, double* %247
%249 = add nsw i32 %245, 1
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds double, double* %137, i64 %250
%252 = load double, double* %251
%253 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.24, i64 0, i64 0), double %242, double %244, double %248, double %252)
%254 = load i32, i32* %5
%255 = call i32 @clReleaseMemObject(i32 %254)
%256 = load i32, i32* %6
%257 = call i32 @clReleaseMemObject(i32 %256)
%258 = load i32, i32* %7
%259 = call i32 @clReleaseMemObject(i32 %258)
%260 = call i32 @clReleaseCommandQueue(i32 %65)
%261 = call i32 @clReleaseContext(i32 %58)
%262 = load i32, i32* %20
%263 = sitofp i32 %262 to double
%264 = fmul double %263, 2.000000e+00
%265 = load i32, i32* %19
%266 = sitofp i32 %265 to double
%267 = fmul double %264, %266
%268 = load i32, i32* %13
%269 = sitofp i32 %268 to double
%270 = fmul double %267, %269
%271 = load i32, i32* %12
%272 = sitofp i32 %271 to double
%273 = fmul double %270, %272
%274 = fmul double %273, 3.000000e+00
%275 = load i32, i32* %16
%276 = sitofp i32 %275 to double
%277 = fmul double %274, %276
%278 = fmul double %277, %276
%279 = fmul double %278, 0x3EB0C6F7A0B5ED8D
%280 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.25, i64 0, i64 0), double %279, i32 1)
%281 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.26, i64 0, i64 0), double %237)
%282 = fdiv double %278, %237
%283 = fmul double %282, 1.000000e-09
%284 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.27, i64 0, i64 0), double %283)
%285 = call i32 @putchar(i32 10)
br label %286
286: ; preds = %221, %219
%287 = phi i32 [ -1, %219 ], [ 0, %221 ]
br label %288
288: ; preds = %286, %168, %154, %147
%289 = phi i32 [ -1, %154 ], [ -1, %168 ], [ %287, %286 ], [ -1, %147 ]
ret i32 %289
}