#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 cl_uint;
typedef int /*<<< orphan*/ cl_platform_id;
typedef int /*<<< orphan*/ cl_max_freq;
typedef int /*<<< orphan*/ cl_max_cunits;
typedef scalar_t__ cl_int;
typedef int /*<<< orphan*/ cl_device_id;

/* Variables and functions */
int /*<<< orphan*/ CL_DEVICE_MAX_CLOCK_FREQUENCY;
int /*<<< orphan*/ CL_DEVICE_MAX_COMPUTE_UNITS;
int /*<<< orphan*/ CL_DEVICE_NAME;
int /*<<< orphan*/ CL_DEVICE_TYPE_ALL;
int /*<<< orphan*/ CL_DEVICE_VENDOR;
int /*<<< orphan*/ CL_DEVICE_VERSION;
int /*<<< orphan*/ CL_DRIVER_VERSION;
int /*<<< orphan*/ CL_PLATFORM_NAME;
int /*<<< orphan*/ CL_PLATFORM_VENDOR;
scalar_t__ CL_SUCCESS;
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ alloca(size_t);
scalar_t__ clGetDeviceIDs(int /*<<< orphan*/, int /*<<< orphan*/, int,
                          int /*<<< orphan*/ *, int *);
scalar_t__ clGetDeviceInfo(int /*<<< orphan*/, int /*<<< orphan*/, int, ...);
scalar_t__ clGetPlatformIDs(int, int /*<<< orphan*/ *, int *);
scalar_t__ clGetPlatformInfo(int /*<<< orphan*/, int /*<<< orphan*/, size_t,
                             char *, size_t *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *);
char *loclGetErrCode(scalar_t__);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
void loclPrintAvailableDevices(void) {
  cl_uint cnt_platforms, cnt_device_ids;
  cl_platform_id *platform_ids;
  {
    cl_int err = clGetPlatformIDs(0, NULL, &cnt_platforms);
    if (CL_SUCCESS != err) {
      fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/heads/master/"
              "common/loclutil.h",
              130, loclGetErrCode(err));
      exit(EXIT_FAILURE);
    }
  };
  platform_ids =
      (cl_platform_id *)alloca(sizeof(cl_platform_id) * cnt_platforms);
  {
    cl_int err = clGetPlatformIDs(cnt_platforms, platform_ids, NULL);
    if (CL_SUCCESS != err) {
      fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/heads/master/"
              "common/loclutil.h",
              133, loclGetErrCode(err));
      exit(EXIT_FAILURE);
    }
  };
  int cur_dev_idx = 1;
  for (int i = 0; i < (int)cnt_platforms; i++) {
    {
      cl_int err = clGetDeviceIDs(platform_ids[i], CL_DEVICE_TYPE_ALL, 0, NULL,
                                  &cnt_device_ids);
      if (CL_SUCCESS != err) {
        fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                "heads/master/common/loclutil.h",
                137, loclGetErrCode(err));
        exit(EXIT_FAILURE);
      }
    };
    size_t t;
    {
      cl_int err =
          clGetPlatformInfo(platform_ids[i], CL_PLATFORM_NAME, 0, NULL, &t);
      if (CL_SUCCESS != err) {
        fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                "heads/master/common/loclutil.h",
                140, loclGetErrCode(err));
        exit(EXIT_FAILURE);
      }
    };
    char *cl_plf_name = (char *)alloca(t);
    {
      cl_int err = clGetPlatformInfo(platform_ids[i], CL_PLATFORM_NAME, t,
                                     cl_plf_name, NULL);
      if (CL_SUCCESS != err) {
        fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                "heads/master/common/loclutil.h",
                142, loclGetErrCode(err));
        exit(EXIT_FAILURE);
      }
    };
    {
      cl_int err =
          clGetPlatformInfo(platform_ids[i], CL_PLATFORM_VENDOR, 0, NULL, &t);
      if (CL_SUCCESS != err) {
        fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                "heads/master/common/loclutil.h",
                143, loclGetErrCode(err));
        exit(EXIT_FAILURE);
      }
    };
    char *cl_plf_vendor = (char *)alloca(t);
    {
      cl_int err = clGetPlatformInfo(platform_ids[i], CL_PLATFORM_VENDOR, t,
                                     cl_plf_vendor, NULL);
      if (CL_SUCCESS != err) {
        fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                "heads/master/common/loclutil.h",
                145, loclGetErrCode(err));
        exit(EXIT_FAILURE);
      }
    };
    printf("Platform %d (name:%s, vendor:%s) has %d devices\n", i + 1,
           cl_plf_name, cl_plf_vendor, (int)cnt_device_ids);
    cl_device_id *device_ids =
        (cl_device_id *)alloca(sizeof(cl_device_id) * cnt_device_ids);
    {
      cl_int err = clGetDeviceIDs(platform_ids[i], CL_DEVICE_TYPE_ALL,
                                  cnt_device_ids, device_ids, NULL);
      if (CL_SUCCESS != err) {
        fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                "heads/master/common/loclutil.h",
                150, loclGetErrCode(err));
        exit(EXIT_FAILURE);
      }
    };
    for (int d = 0; d < (int)cnt_device_ids; d++) {
      {
        cl_int err =
            clGetDeviceInfo(device_ids[d], CL_DEVICE_NAME, 0, NULL, &t);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  153, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      char *cl_dev_name = (char *)alloca(t);
      {
        cl_int err = clGetDeviceInfo(device_ids[d], CL_DEVICE_NAME, t,
                                     cl_dev_name, NULL);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  155, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      {
        cl_int err =
            clGetDeviceInfo(device_ids[d], CL_DEVICE_VENDOR, 0, NULL, &t);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  156, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      char *cl_dev_vendor = (char *)alloca(t);
      {
        cl_int err = clGetDeviceInfo(device_ids[d], CL_DEVICE_VENDOR, t,
                                     cl_dev_vendor, NULL);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  158, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      {
        cl_int err =
            clGetDeviceInfo(device_ids[d], CL_DRIVER_VERSION, 0, NULL, &t);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  159, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      char *cl_driver_ver = (char *)alloca(t);
      {
        cl_int err = clGetDeviceInfo(device_ids[d], CL_DRIVER_VERSION, t,
                                     cl_driver_ver, NULL);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  161, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      {
        cl_int err =
            clGetDeviceInfo(device_ids[d], CL_DEVICE_VERSION, 0, NULL, &t);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  162, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      char *cl_device_ver = (char *)alloca(t);
      {
        cl_int err = clGetDeviceInfo(device_ids[d], CL_DEVICE_VERSION, t,
                                     cl_device_ver, NULL);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  164, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      cl_uint cl_max_freq, cl_max_cunits;
      {
        cl_int err =
            clGetDeviceInfo(device_ids[d], CL_DEVICE_MAX_CLOCK_FREQUENCY,
                            sizeof(cl_max_freq), &cl_max_freq, NULL);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  166, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      {
        cl_int err =
            clGetDeviceInfo(device_ids[d], CL_DEVICE_MAX_COMPUTE_UNITS,
                            sizeof(cl_max_cunits), &cl_max_cunits, NULL);
        if (CL_SUCCESS != err) {
          fprintf(stderr, "OpenCL error in file '%s' in line %i : %s.\n",
                  "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                  "outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/"
                  "heads/master/common/loclutil.h",
                  167, loclGetErrCode(err));
          exit(EXIT_FAILURE);
        }
      };
      printf(" [%d].Vendor: %s Device: %s (%d compute units, freq %dMHz, %s, "
             "driver: %s)\n",
             cur_dev_idx, cl_dev_vendor, cl_dev_name, cl_max_cunits,
             cl_max_freq, cl_device_ver, cl_driver_ver);
      cur_dev_idx++;
    }
  }
  if (cur_dev_idx > 1)
    printf("Please select a device(1..%d)\n", cur_dev_idx - 1);
  else
    printf("No OpenCL device found\n");
}


x86 assembly (clang, -O0):
<loclPrintAvailableDevices>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
xor    %edi,%edi
xor    %eax,%eax
mov    %eax,%esi
lea    -0x4(%rbp),%rdx
call   1050 <clGetPlatformIDs@plt>
mov    %rax,-0x18(%rbp)
mov    0x2ddb(%rip),%rax
mov    (%rax),%rax
cmp    -0x18(%rbp),%rax
je     1209 <loclPrintAvailableDevices+0x79>
mov    0x2ddf(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xfc(%rbp)
mov    -0x18(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0xfc(%rbp),%edi
mov    %rax,%r8
lea    0xe16(%rip),%rsi
lea    0xe3b(%rip),%rdx
mov    $0x82,%ecx
call   1080 <fprintf@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
movslq -0x4(%rbp),%rdi
shl    $0x2,%rdi
call   1090 <alloca@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <clGetPlatformIDs@plt>
mov    %rax,-0x20(%rbp)
mov    0x2d5b(%rip),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
je     1289 <loclPrintAvailableDevices+0xf9>
mov    0x2d5f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x100(%rbp)
mov    -0x20(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x100(%rbp),%edi
mov    %rax,%r8
lea    0xd96(%rip),%rsi
lea    0xdbb(%rip),%rdx
mov    $0x85,%ecx
call   1080 <fprintf@plt>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1c75 <loclPrintAvailableDevices+0xae5>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2d13(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x8(%rbp),%r8
call   1030 <clGetDeviceIDs@plt>
mov    %rax,-0x30(%rbp)
mov    0x2cbf(%rip),%rax
mov    (%rax),%rax
cmp    -0x30(%rbp),%rax
je     1325 <loclPrintAvailableDevices+0x195>
mov    0x2cc3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x104(%rbp)
mov    -0x30(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x104(%rbp),%edi
mov    %rax,%r8
lea    0xcfa(%rip),%rsi
lea    0xd1f(%rip),%rdx
mov    $0x89,%ecx
call   1080 <fprintf@plt>
mov    0x2c7a(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2c81(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x38(%rbp),%r8
mov    %rcx,%rdx
call   1070 <clGetPlatformInfo@plt>
mov    %rax,-0x40(%rbp)
mov    0x2c3c(%rip),%rax
mov    (%rax),%rax
cmp    -0x40(%rbp),%rax
je     13a8 <loclPrintAvailableDevices+0x218>
mov    0x2c40(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x108(%rbp)
mov    -0x40(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x108(%rbp),%edi
mov    %rax,%r8
lea    0xc77(%rip),%rsi
lea    0xc9c(%rip),%rdx
mov    $0x8c,%ecx
call   1080 <fprintf@plt>
mov    0x2bf7(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1090 <alloca@plt>
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2bf1(%rip),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rdx
mov    -0x48(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1070 <clGetPlatformInfo@plt>
mov    %rax,-0x50(%rbp)
mov    0x2baa(%rip),%rax
mov    (%rax),%rax
cmp    -0x50(%rbp),%rax
je     143a <loclPrintAvailableDevices+0x2aa>
mov    0x2bae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x10c(%rbp)
mov    -0x50(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x10c(%rbp),%edi
mov    %rax,%r8
lea    0xbe5(%rip),%rsi
lea    0xc0a(%rip),%rdx
mov    $0x8e,%ecx
call   1080 <fprintf@plt>
mov    0x2b65(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2b34(%rip),%rax
mov    (%rax),%esi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x38(%rbp),%r8
mov    %rcx,%rdx
call   1070 <clGetPlatformInfo@plt>
mov    %rax,-0x58(%rbp)
mov    0x2b27(%rip),%rax
mov    (%rax),%rax
cmp    -0x58(%rbp),%rax
je     14bd <loclPrintAvailableDevices+0x32d>
mov    0x2b2b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x110(%rbp)
mov    -0x58(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x110(%rbp),%edi
mov    %rax,%r8
lea    0xb62(%rip),%rsi
lea    0xb87(%rip),%rdx
mov    $0x8f,%ecx
call   1080 <fprintf@plt>
mov    0x2ae2(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1090 <alloca@plt>
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2aa4(%rip),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rdx
mov    -0x60(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1070 <clGetPlatformInfo@plt>
mov    %rax,-0x68(%rbp)
mov    0x2a95(%rip),%rax
mov    (%rax),%rax
cmp    -0x68(%rbp),%rax
je     154f <loclPrintAvailableDevices+0x3bf>
mov    0x2a99(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x114(%rbp)
mov    -0x68(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x114(%rbp),%edi
mov    %rax,%r8
lea    0xad0(%rip),%rsi
lea    0xaf5(%rip),%rdx
mov    $0x91,%ecx
call   1080 <fprintf@plt>
mov    0x2a50(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x28(%rbp),%esi
add    $0x1,%esi
mov    -0x48(%rbp),%rdx
mov    -0x60(%rbp),%rcx
mov    -0x8(%rbp),%r8d
lea    0xb56(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x8(%rbp),%rdi
shl    $0x2,%rdi
call   1090 <alloca@plt>
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2a36(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    -0x70(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <clGetDeviceIDs@plt>
mov    %rax,-0x78(%rbp)
mov    0x29e0(%rip),%rax
mov    (%rax),%rax
cmp    -0x78(%rbp),%rax
je     1604 <loclPrintAvailableDevices+0x474>
mov    0x29e4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x118(%rbp)
mov    -0x78(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x118(%rbp),%edi
mov    %rax,%r8
lea    0xa1b(%rip),%rsi
lea    0xa40(%rip),%rdx
mov    $0x96,%ecx
call   1080 <fprintf@plt>
mov    0x299b(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1c62 <loclPrintAvailableDevices+0xad2>
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2987(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x38(%rbp),%r8
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0x88(%rbp)
mov    0x2946(%rip),%rax
mov    (%rax),%rax
cmp    -0x88(%rbp),%rax
je     16a4 <loclPrintAvailableDevices+0x514>
mov    0x2947(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x11c(%rbp)
mov    -0x88(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x11c(%rbp),%edi
mov    %rax,%r8
lea    0x97b(%rip),%rsi
lea    0x9a0(%rip),%rdx
mov    $0x99,%ecx
call   1080 <fprintf@plt>
mov    0x28fb(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1090 <alloca@plt>
mov    %rax,-0x90(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x28ea(%rip),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
mov    -0x90(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0x98(%rbp)
mov    0x28a1(%rip),%rax
mov    (%rax),%rax
cmp    -0x98(%rbp),%rax
je     1749 <loclPrintAvailableDevices+0x5b9>
mov    0x28a2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x120(%rbp)
mov    -0x98(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x120(%rbp),%edi
mov    %rax,%r8
lea    0x8d6(%rip),%rsi
lea    0x8fb(%rip),%rdx
mov    $0x9b,%ecx
call   1080 <fprintf@plt>
mov    0x2856(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2845(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x38(%rbp),%r8
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0xa0(%rbp)
mov    0x2814(%rip),%rax
mov    (%rax),%rax
cmp    -0xa0(%rbp),%rax
je     17d6 <loclPrintAvailableDevices+0x646>
mov    0x2815(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x124(%rbp)
mov    -0xa0(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x124(%rbp),%edi
mov    %rax,%r8
lea    0x849(%rip),%rsi
lea    0x86e(%rip),%rdx
mov    $0x9c,%ecx
call   1080 <fprintf@plt>
mov    0x27c9(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1090 <alloca@plt>
mov    %rax,-0xa8(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x27a8(%rip),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
mov    -0xa8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0xb0(%rbp)
mov    0x276f(%rip),%rax
mov    (%rax),%rax
cmp    -0xb0(%rbp),%rax
je     187b <loclPrintAvailableDevices+0x6eb>
mov    0x2770(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x128(%rbp)
mov    -0xb0(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x128(%rbp),%edi
mov    %rax,%r8
lea    0x7a4(%rip),%rsi
lea    0x7c9(%rip),%rdx
mov    $0x9e,%ecx
call   1080 <fprintf@plt>
mov    0x2724(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2743(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x38(%rbp),%r8
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0xb8(%rbp)
mov    0x26e2(%rip),%rax
mov    (%rax),%rax
cmp    -0xb8(%rbp),%rax
je     1908 <loclPrintAvailableDevices+0x778>
mov    0x26e3(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x12c(%rbp)
mov    -0xb8(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x12c(%rbp),%edi
mov    %rax,%r8
lea    0x717(%rip),%rsi
lea    0x73c(%rip),%rdx
mov    $0x9f,%ecx
call   1080 <fprintf@plt>
mov    0x2697(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1090 <alloca@plt>
mov    %rax,-0xc0(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x26a6(%rip),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
mov    -0xc0(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0xc8(%rbp)
mov    0x263d(%rip),%rax
mov    (%rax),%rax
cmp    -0xc8(%rbp),%rax
je     19ad <loclPrintAvailableDevices+0x81d>
mov    0x263e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x130(%rbp)
mov    -0xc8(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x130(%rbp),%edi
mov    %rax,%r8
lea    0x672(%rip),%rsi
lea    0x697(%rip),%rdx
mov    $0xa1,%ecx
call   1080 <fprintf@plt>
mov    0x25f2(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2619(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x38(%rbp),%r8
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0xd0(%rbp)
mov    0x25b0(%rip),%rax
mov    (%rax),%rax
cmp    -0xd0(%rbp),%rax
je     1a3a <loclPrintAvailableDevices+0x8aa>
mov    0x25b1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x134(%rbp)
mov    -0xd0(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x134(%rbp),%edi
mov    %rax,%r8
lea    0x5e5(%rip),%rsi
lea    0x60a(%rip),%rdx
mov    $0xa2,%ecx
call   1080 <fprintf@plt>
mov    0x2565(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x38(%rbp),%rdi
call   1090 <alloca@plt>
mov    %rax,-0xd8(%rbp)
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x257c(%rip),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rax
mov    %eax,%edx
mov    -0xd8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0xe0(%rbp)
mov    0x250b(%rip),%rax
mov    (%rax),%rax
cmp    -0xe0(%rbp),%rax
je     1adf <loclPrintAvailableDevices+0x94f>
mov    0x250c(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x138(%rbp)
mov    -0xe0(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x138(%rbp),%edi
mov    %rax,%r8
lea    0x540(%rip),%rsi
lea    0x565(%rip),%rdx
mov    $0xa4,%ecx
call   1080 <fprintf@plt>
mov    0x24c0(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x24ef(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%edx
lea    -0xe4(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0xf0(%rbp)
mov    0x2477(%rip),%rax
mov    (%rax),%rax
cmp    -0xf0(%rbp),%rax
je     1b73 <loclPrintAvailableDevices+0x9e3>
mov    0x2478(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x13c(%rbp)
mov    -0xf0(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x13c(%rbp),%edi
mov    %rax,%r8
lea    0x4ac(%rip),%rsi
lea    0x4d1(%rip),%rdx
mov    $0xa6,%ecx
call   1080 <fprintf@plt>
mov    0x242c(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x70(%rbp),%rax
movslq -0x7c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x246b(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%edx
lea    -0xe8(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
mov    $0x0,%al
call   1040 <clGetDeviceInfo@plt>
mov    %rax,-0xf8(%rbp)
mov    0x23e3(%rip),%rax
mov    (%rax),%rax
cmp    -0xf8(%rbp),%rax
je     1c07 <loclPrintAvailableDevices+0xa77>
mov    0x23e4(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x140(%rbp)
mov    -0xf8(%rbp),%rdi
call   10b0 <loclGetErrCode@plt>
mov    -0x140(%rbp),%edi
mov    %rax,%r8
lea    0x418(%rip),%rsi
lea    0x43d(%rip),%rdx
mov    $0xa7,%ecx
call   1080 <fprintf@plt>
mov    0x2398(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
mov    -0x24(%rbp),%esi
mov    -0xa8(%rbp),%rdx
mov    -0x90(%rbp),%rcx
mov    -0xe8(%rbp),%r8d
mov    -0xe4(%rbp),%r9d
mov    -0xd8(%rbp),%r10
mov    -0xc0(%rbp),%rax
lea    0x4b4(%rip),%rdi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    160b <loclPrintAvailableDevices+0x47b>
jmp    1c67 <loclPrintAvailableDevices+0xad7>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1297 <loclPrintAvailableDevices+0x107>
cmpl   $0x1,-0x24(%rbp)
jle    1c98 <loclPrintAvailableDevices+0xb08>
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
lea    0x4af(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1ca6 <loclPrintAvailableDevices+0xb16>
lea    0x4bb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<loclPrintAvailableDevices>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0x18(%rsp),%rdx
xor    %edi,%edi
xor    %esi,%esi
call   1060 <clGetPlatformIDs@plt>
mov    0x2dcd(%rip),%r15
cmp    %rax,(%r15)
jne    1876 <loclPrintAvailableDevices+0x6d6>
movslq 0x18(%rsp),%rdi
shl    $0x2,%rdi
call   10a0 <alloca@plt>
mov    %rax,%r12
mov    0x18(%rsp),%edi
mov    %rax,%rsi
xor    %edx,%edx
call   1060 <clGetPlatformIDs@plt>
cmp    %rax,(%r15)
jne    18a1 <loclPrintAvailableDevices+0x701>
cmpl   $0x0,0x18(%rsp)
jle    15a9 <loclPrintAvailableDevices+0x409>
movl   $0x1,0x1c(%rsp)
mov    0x2daa(%rip),%rbp
mov    0x2d6b(%rip),%r13
xor    %ebx,%ebx
mov    %r12,0x28(%rsp)
jmp    1249 <loclPrintAvailableDevices+0xa9>
xchg   %ax,%ax
movslq 0x18(%rsp),%rax
mov    0x30(%rsp),%rcx
mov    %rcx,%rbx
cmp    %rax,%rcx
mov    0x28(%rsp),%r12
mov    0x2d7c(%rip),%rbp
mov    0x2d3d(%rip),%r13
jge    158d <loclPrintAvailableDevices+0x3ed>
mov    (%r12,%rbx,4),%edi
mov    0x2d74(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
xor    %ecx,%ecx
lea    0x14(%rsp),%r8
call   1040 <clGetDeviceIDs@plt>
cmp    %rax,(%r15)
jne    177a <loclPrintAvailableDevices+0x5da>
mov    (%r12,%rbx,4),%edi
mov    0x0(%rbp),%esi
xor    %edx,%edx
xor    %ecx,%ecx
lea    0x8(%rsp),%r8
call   1080 <clGetPlatformInfo@plt>
cmp    %rax,(%r15)
jne    17a2 <loclPrintAvailableDevices+0x602>
mov    0x8(%rsp),%rdi
call   10a0 <alloca@plt>
mov    %rax,%r14
mov    (%r12,%rbx,4),%edi
mov    0x0(%rbp),%esi
mov    0x8(%rsp),%rdx
mov    %rax,%rcx
xor    %r8d,%r8d
call   1080 <clGetPlatformInfo@plt>
cmp    %rax,(%r15)
jne    17ca <loclPrintAvailableDevices+0x62a>
mov    (%r12,%rbx,4),%edi
mov    0x0(%r13),%esi
xor    %edx,%edx
xor    %ecx,%ecx
lea    0x8(%rsp),%r8
call   1080 <clGetPlatformInfo@plt>
cmp    %rax,(%r15)
jne    17f5 <loclPrintAvailableDevices+0x655>
mov    0x8(%rsp),%rdi
call   10a0 <alloca@plt>
mov    %rax,%rbp
mov    (%r12,%rbx,4),%edi
mov    0x0(%r13),%esi
mov    0x8(%rsp),%rdx
mov    %rax,%rcx
xor    %r8d,%r8d
call   1080 <clGetPlatformInfo@plt>
cmp    %rax,(%r15)
jne    1820 <loclPrintAvailableDevices+0x680>
lea    0x1(%rbx),%rsi
mov    0x14(%rsp),%r8d
lea    0xda9(%rip),%rdi
mov    %rsi,0x30(%rsp)
mov    %r14,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1070 <printf@plt>
movslq 0x14(%rsp),%rdi
shl    $0x2,%rdi
call   10a0 <alloca@plt>
mov    %rax,%r13
mov    (%r12,%rbx,4),%edi
mov    0x2c85(%rip),%rax
mov    (%rax),%esi
mov    0x14(%rsp),%edx
mov    %r13,%rcx
xor    %r8d,%r8d
call   1040 <clGetDeviceIDs@plt>
cmp    %rax,(%r15)
jne    184b <loclPrintAvailableDevices+0x6ab>
cmpl   $0x0,0x14(%rsp)
lea    0x8(%rsp),%r12
mov    0x2c42(%rip),%rbx
jle    1220 <loclPrintAvailableDevices+0x80>
mov    0x1c(%rsp),%eax
mov    %rax,0x38(%rsp)
xor    %ebp,%ebp
nop
mov    0x0(%r13,%rbp,4),%edi
mov    (%rbx),%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%r15)
jne    15c4 <loclPrintAvailableDevices+0x424>
mov    0x8(%rsp),%rdi
call   10a0 <alloca@plt>
mov    %rax,%r14
mov    0x0(%r13,%rbp,4),%edi
mov    (%rbx),%esi
mov    0x8(%rsp),%edx
mov    %rax,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%r15)
jne    15ef <loclPrintAvailableDevices+0x44f>
mov    0x0(%r13,%rbp,4),%edi
mov    0x2bc8(%rip),%rbx
mov    (%rbx),%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%r15)
jne    161a <loclPrintAvailableDevices+0x47a>
mov    0x8(%rsp),%rdi
call   10a0 <alloca@plt>
mov    0x0(%r13,%rbp,4),%edi
mov    (%rbx),%esi
mov    0x8(%rsp),%edx
mov    %rax,0x50(%rsp)
mov    %rax,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%r15)
jne    1645 <loclPrintAvailableDevices+0x4a5>
mov    0x0(%r13,%rbp,4),%edi
mov    0x2ba3(%rip),%rbx
mov    (%rbx),%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%r15)
jne    1670 <loclPrintAvailableDevices+0x4d0>
mov    0x8(%rsp),%rdi
call   10a0 <alloca@plt>
mov    0x0(%r13,%rbp,4),%edi
mov    (%rbx),%esi
mov    0x8(%rsp),%edx
mov    %rax,0x48(%rsp)
mov    %rax,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%r15)
jne    169b <loclPrintAvailableDevices+0x4fb>
mov    %r14,0x40(%rsp)
mov    0x0(%r13,%rbp,4),%edi
mov    %r13,%r14
mov    0x2b4e(%rip),%r13
mov    0x0(%r13),%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r12,%r8
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%r15)
jne    16c6 <loclPrintAvailableDevices+0x526>
mov    0x8(%rsp),%rdi
call   10a0 <alloca@plt>
mov    %r15,%rbx
mov    %rax,%r12
mov    (%r14,%rbp,4),%edi
mov    0x0(%r13),%esi
mov    0x8(%rsp),%edx
mov    %rax,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%r15)
jne    16ee <loclPrintAvailableDevices+0x54e>
mov    (%r14,%rbp,4),%edi
mov    0x2afe(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%edx
lea    0x24(%rsp),%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%rbx)
jne    1716 <loclPrintAvailableDevices+0x576>
mov    %r14,%r13
mov    (%r14,%rbp,4),%edi
mov    0x2ae1(%rip),%rax
mov    (%rax),%esi
mov    $0x4,%edx
lea    0x20(%rsp),%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1050 <clGetDeviceInfo@plt>
cmp    %rax,(%rbx)
jne    173e <loclPrintAvailableDevices+0x59e>
mov    %rbx,%r15
mov    0x38(%rsp),%rax
lea    (%rax,%rbp,1),%rsi
mov    0x20(%rsp),%r8d
mov    0x24(%rsp),%r9d
lea    0xba4(%rip),%rdi
mov    0x50(%rsp),%rdx
mov    0x40(%rsp),%rcx
xor    %eax,%eax
push   0x48(%rsp)
push   %r12
call   1070 <printf@plt>
add    $0x10,%rsp
add    $0x1,%rbp
movslq 0x14(%rsp),%rax
cmp    %rax,%rbp
lea    0x8(%rsp),%r12
mov    0x2a32(%rip),%rbx
jl     1380 <loclPrintAvailableDevices+0x1e0>
add    %ebp,0x1c(%rsp)
jmp    1220 <loclPrintAvailableDevices+0x80>
mov    0x1c(%rsp),%esi
cmp    $0x1,%esi
jle    15a9 <loclPrintAvailableDevices+0x409>
add    $0xffffffff,%esi
lea    0xb9b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    15b5 <loclPrintAvailableDevices+0x415>
lea    0xbaa(%rip),%rdi
call   1030 <puts@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x29dd(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0xa24(%rip),%rsi
lea    0xa49(%rip),%rdx
mov    %ebx,%edi
mov    $0x99,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x29b2(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x9f9(%rip),%rsi
lea    0xa1e(%rip),%rdx
mov    %ebx,%edi
mov    $0x9b,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x2987(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x9ce(%rip),%rsi
lea    0x9f3(%rip),%rdx
mov    %ebx,%edi
mov    $0x9c,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x295c(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x9a3(%rip),%rsi
lea    0x9c8(%rip),%rdx
mov    %ebx,%edi
mov    $0x9e,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x2931(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x978(%rip),%rsi
lea    0x99d(%rip),%rdx
mov    %ebx,%edi
mov    $0x9f,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x2906(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x94d(%rip),%rsi
lea    0x972(%rip),%rdx
mov    %ebx,%edi
mov    $0xa1,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x28db(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x922(%rip),%rsi
lea    0x947(%rip),%rdx
mov    %ebx,%edi
mov    $0xa2,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x28b3(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x8fa(%rip),%rsi
lea    0x91f(%rip),%rdx
mov    %ebx,%edi
mov    $0xa4,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x288b(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x8d2(%rip),%rsi
lea    0x8f7(%rip),%rdx
mov    %ebx,%edi
mov    $0xa6,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x2863(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x8aa(%rip),%rsi
lea    0x8cf(%rip),%rdx
mov    %ebx,%edi
mov    $0xa7,%ecx
mov    %rax,%r8
call   1090 <fprintf@plt>
mov    0x2825(%rip),%rax
mov    (%rax),%edi
call   10b0 <exit@plt>
mov    0x2827(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x86e(%rip),%rsi
lea    0x893(%rip),%rdx
mov    %ebx,%edi
mov    $0x89,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x27ff(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x846(%rip),%rsi
lea    0x86b(%rip),%rdx
mov    %ebx,%edi
mov    $0x8c,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x27d7(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x81e(%rip),%rsi
lea    0x843(%rip),%rdx
mov    %ebx,%edi
mov    $0x8e,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x27ac(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x7f3(%rip),%rsi
lea    0x818(%rip),%rdx
mov    %ebx,%edi
mov    $0x8f,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x2781(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x7c8(%rip),%rsi
lea    0x7ed(%rip),%rdx
mov    %ebx,%edi
mov    $0x91,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x2756(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x79d(%rip),%rsi
lea    0x7c2(%rip),%rdx
mov    %ebx,%edi
mov    $0x96,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x272b(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x772(%rip),%rsi
lea    0x797(%rip),%rdx
mov    %ebx,%edi
mov    $0x82,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>
mov    0x2700(%rip),%rcx
mov    (%rcx),%ebx
mov    %rax,%rdi
call   10c0 <loclGetErrCode@plt>
lea    0x747(%rip),%rsi
lea    0x76c(%rip),%rdx
mov    %ebx,%edi
mov    $0x85,%ecx
jmp    1764 <loclPrintAvailableDevices+0x5c4>

LLVM IR (-O0):
@CL_SUCCESS = global i64 0
@stderr = global i32 0
@.str = [44 x i8] c"OpenCL error in file '%s' in line %i : %s.\0A\00"
@.str.1 = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/heads/master/common/loclutil.h\00"
@EXIT_FAILURE = global i32 0
@CL_DEVICE_TYPE_ALL = global i32 0
@CL_PLATFORM_NAME = global i32 0
@CL_PLATFORM_VENDOR = global i32 0
@.str.2 = [49 x i8] c"Platform %d (name:%s, vendor:%s) has %d devices\0A\00"
@CL_DEVICE_NAME = global i32 0
@CL_DEVICE_VENDOR = global i32 0
@CL_DRIVER_VERSION = global i32 0
@CL_DEVICE_VERSION = global i32 0
@CL_DEVICE_MAX_CLOCK_FREQUENCY = global i32 0
@CL_DEVICE_MAX_COMPUTE_UNITS = global i32 0
@.str.3 = [76 x i8] c" [%d].Vendor: %s Device: %s (%d compute units, freq %dMHz, %s, driver: %s)\0A\00"
@.str.4 = [31 x i8] c"Please select a device(1..%d)\0A\00"
@.str.5 = [24 x i8] c"No OpenCL device found\0A\00"
define void @loclPrintAvailableDevices() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i32*
%17 = alloca i64
%18 = alloca i32
%19 = alloca i64
%20 = alloca i8*
%21 = alloca i64
%22 = alloca i64
%23 = alloca i8*
%24 = alloca i64
%25 = alloca i64
%26 = alloca i8*
%27 = alloca i64
%28 = alloca i64
%29 = alloca i8*
%30 = alloca i64
%31 = alloca i32
%32 = alloca i32
%33 = alloca i64
%34 = alloca i64
%35 = call i64 @clGetPlatformIDs(i32 0, i32* null, i32* %1)
store i64 %35, i64* %4
%36 = load i64, i64* @CL_SUCCESS
%37 = load i64, i64* %4
%38 = icmp ne i64 %36, %37
br i1 %38, label %39, label %46
39: ; preds = %0
%40 = load i32, i32* @stderr
%41 = load i64, i64* %4
%42 = call i8* @loclGetErrCode(i64 %41)
%43 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 130, i8* %42)
%44 = load i32, i32* @EXIT_FAILURE
%45 = call i32 @exit(i32 %44)
unreachable
46: ; preds = %0
%47 = load i32, i32* %1
%48 = sext i32 %47 to i64
%49 = mul i64 4, %48
%50 = call i64 @alloca(i64 %49)
%51 = inttoptr i64 %50 to i32*
store i32* %51, i32** %3
%52 = load i32, i32* %1
%53 = load i32*, i32** %3
%54 = call i64 @clGetPlatformIDs(i32 %52, i32* %53, i32* null)
store i64 %54, i64* %5
%55 = load i64, i64* @CL_SUCCESS
%56 = load i64, i64* %5
%57 = icmp ne i64 %55, %56
br i1 %57, label %58, label %65
58: ; preds = %46
%59 = load i32, i32* @stderr
%60 = load i64, i64* %5
%61 = call i8* @loclGetErrCode(i64 %60)
%62 = call i32 @fprintf(i32 %59, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 133, i8* %61)
%63 = load i32, i32* @EXIT_FAILURE
%64 = call i32 @exit(i32 %63)
unreachable
65: ; preds = %46
store i32 1, i32* %6
store i32 0, i32* %7
br label %66
66: ; preds = %425, %65
%67 = load i32, i32* %7
%68 = load i32, i32* %1
%69 = icmp slt i32 %67, %68
br i1 %69, label %70, label %428
70: ; preds = %66
%71 = load i32*, i32** %3
%72 = load i32, i32* %7
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i32, i32* %71, i64 %73
%75 = load i32, i32* %74
%76 = load i32, i32* @CL_DEVICE_TYPE_ALL
%77 = call i64 @clGetDeviceIDs(i32 %75, i32 %76, i32 0, i32* null, i32* %2)
store i64 %77, i64* %8
%78 = load i64, i64* @CL_SUCCESS
%79 = load i64, i64* %8
%80 = icmp ne i64 %78, %79
br i1 %80, label %81, label %88
81: ; preds = %70
%82 = load i32, i32* @stderr
%83 = load i64, i64* %8
%84 = call i8* @loclGetErrCode(i64 %83)
%85 = call i32 @fprintf(i32 %82, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 137, i8* %84)
%86 = load i32, i32* @EXIT_FAILURE
%87 = call i32 @exit(i32 %86)
unreachable
88: ; preds = %70
%89 = load i32*, i32** %3
%90 = load i32, i32* %7
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %89, i64 %91
%93 = load i32, i32* %92
%94 = load i32, i32* @CL_PLATFORM_NAME
%95 = call i64 @clGetPlatformInfo(i32 %93, i32 %94, i64 0, i8* null, i64* %9)
store i64 %95, i64* %10
%96 = load i64, i64* @CL_SUCCESS
%97 = load i64, i64* %10
%98 = icmp ne i64 %96, %97
br i1 %98, label %99, label %106
99: ; preds = %88
%100 = load i32, i32* @stderr
%101 = load i64, i64* %10
%102 = call i8* @loclGetErrCode(i64 %101)
%103 = call i32 @fprintf(i32 %100, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 140, i8* %102)
%104 = load i32, i32* @EXIT_FAILURE
%105 = call i32 @exit(i32 %104)
unreachable
106: ; preds = %88
%107 = load i64, i64* %9
%108 = call i64 @alloca(i64 %107)
%109 = inttoptr i64 %108 to i8*
store i8* %109, i8** %11
%110 = load i32*, i32** %3
%111 = load i32, i32* %7
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds i32, i32* %110, i64 %112
%114 = load i32, i32* %113
%115 = load i32, i32* @CL_PLATFORM_NAME
%116 = load i64, i64* %9
%117 = load i8*, i8** %11
%118 = call i64 @clGetPlatformInfo(i32 %114, i32 %115, i64 %116, i8* %117, i64* null)
store i64 %118, i64* %12
%119 = load i64, i64* @CL_SUCCESS
%120 = load i64, i64* %12
%121 = icmp ne i64 %119, %120
br i1 %121, label %122, label %129
122: ; preds = %106
%123 = load i32, i32* @stderr
%124 = load i64, i64* %12
%125 = call i8* @loclGetErrCode(i64 %124)
%126 = call i32 @fprintf(i32 %123, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 142, i8* %125)
%127 = load i32, i32* @EXIT_FAILURE
%128 = call i32 @exit(i32 %127)
unreachable
129: ; preds = %106
%130 = load i32*, i32** %3
%131 = load i32, i32* %7
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds i32, i32* %130, i64 %132
%134 = load i32, i32* %133
%135 = load i32, i32* @CL_PLATFORM_VENDOR
%136 = call i64 @clGetPlatformInfo(i32 %134, i32 %135, i64 0, i8* null, i64* %9)
store i64 %136, i64* %13
%137 = load i64, i64* @CL_SUCCESS
%138 = load i64, i64* %13
%139 = icmp ne i64 %137, %138
br i1 %139, label %140, label %147
140: ; preds = %129
%141 = load i32, i32* @stderr
%142 = load i64, i64* %13
%143 = call i8* @loclGetErrCode(i64 %142)
%144 = call i32 @fprintf(i32 %141, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 143, i8* %143)
%145 = load i32, i32* @EXIT_FAILURE
%146 = call i32 @exit(i32 %145)
unreachable
147: ; preds = %129
%148 = load i64, i64* %9
%149 = call i64 @alloca(i64 %148)
%150 = inttoptr i64 %149 to i8*
store i8* %150, i8** %14
%151 = load i32*, i32** %3
%152 = load i32, i32* %7
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i32, i32* %151, i64 %153
%155 = load i32, i32* %154
%156 = load i32, i32* @CL_PLATFORM_VENDOR
%157 = load i64, i64* %9
%158 = load i8*, i8** %14
%159 = call i64 @clGetPlatformInfo(i32 %155, i32 %156, i64 %157, i8* %158, i64* null)
store i64 %159, i64* %15
%160 = load i64, i64* @CL_SUCCESS
%161 = load i64, i64* %15
%162 = icmp ne i64 %160, %161
br i1 %162, label %163, label %170
163: ; preds = %147
%164 = load i32, i32* @stderr
%165 = load i64, i64* %15
%166 = call i8* @loclGetErrCode(i64 %165)
%167 = call i32 @fprintf(i32 %164, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 145, i8* %166)
%168 = load i32, i32* @EXIT_FAILURE
%169 = call i32 @exit(i32 %168)
unreachable
170: ; preds = %147
%171 = load i32, i32* %7
%172 = add nsw i32 %171, 1
%173 = load i8*, i8** %11
%174 = load i8*, i8** %14
%175 = load i32, i32* %2
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i32 %172, i8* %173, i8* %174, i32 %175)
%177 = load i32, i32* %2
%178 = sext i32 %177 to i64
%179 = mul i64 4, %178
%180 = call i64 @alloca(i64 %179)
%181 = inttoptr i64 %180 to i32*
store i32* %181, i32** %16
%182 = load i32*, i32** %3
%183 = load i32, i32* %7
%184 = sext i32 %183 to i64
%185 = getelementptr inbounds i32, i32* %182, i64 %184
%186 = load i32, i32* %185
%187 = load i32, i32* @CL_DEVICE_TYPE_ALL
%188 = load i32, i32* %2
%189 = load i32*, i32** %16
%190 = call i64 @clGetDeviceIDs(i32 %186, i32 %187, i32 %188, i32* %189, i32* null)
store i64 %190, i64* %17
%191 = load i64, i64* @CL_SUCCESS
%192 = load i64, i64* %17
%193 = icmp ne i64 %191, %192
br i1 %193, label %194, label %201
194: ; preds = %170
%195 = load i32, i32* @stderr
%196 = load i64, i64* %17
%197 = call i8* @loclGetErrCode(i64 %196)
%198 = call i32 @fprintf(i32 %195, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 150, i8* %197)
%199 = load i32, i32* @EXIT_FAILURE
%200 = call i32 @exit(i32 %199)
unreachable
201: ; preds = %170
store i32 0, i32* %18
br label %202
202: ; preds = %421, %201
%203 = load i32, i32* %18
%204 = load i32, i32* %2
%205 = icmp slt i32 %203, %204
br i1 %205, label %206, label %424
206: ; preds = %202
%207 = load i32*, i32** %16
%208 = load i32, i32* %18
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds i32, i32* %207, i64 %209
%211 = load i32, i32* %210
%212 = load i32, i32* @CL_DEVICE_NAME
%213 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %211, i32 %212, i32 0, i8* null, i64* %9)
store i64 %213, i64* %19
%214 = load i64, i64* @CL_SUCCESS
%215 = load i64, i64* %19
%216 = icmp ne i64 %214, %215
br i1 %216, label %217, label %224
217: ; preds = %206
%218 = load i32, i32* @stderr
%219 = load i64, i64* %19
%220 = call i8* @loclGetErrCode(i64 %219)
%221 = call i32 @fprintf(i32 %218, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 153, i8* %220)
%222 = load i32, i32* @EXIT_FAILURE
%223 = call i32 @exit(i32 %222)
unreachable
224: ; preds = %206
%225 = load i64, i64* %9
%226 = call i64 @alloca(i64 %225)
%227 = inttoptr i64 %226 to i8*
store i8* %227, i8** %20
%228 = load i32*, i32** %16
%229 = load i32, i32* %18
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds i32, i32* %228, i64 %230
%232 = load i32, i32* %231
%233 = load i32, i32* @CL_DEVICE_NAME
%234 = load i64, i64* %9
%235 = trunc i64 %234 to i32
%236 = load i8*, i8** %20
%237 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %232, i32 %233, i32 %235, i8* %236, i8* null)
store i64 %237, i64* %21
%238 = load i64, i64* @CL_SUCCESS
%239 = load i64, i64* %21
%240 = icmp ne i64 %238, %239
br i1 %240, label %241, label %248
241: ; preds = %224
%242 = load i32, i32* @stderr
%243 = load i64, i64* %21
%244 = call i8* @loclGetErrCode(i64 %243)
%245 = call i32 @fprintf(i32 %242, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 155, i8* %244)
%246 = load i32, i32* @EXIT_FAILURE
%247 = call i32 @exit(i32 %246)
unreachable
248: ; preds = %224
%249 = load i32*, i32** %16
%250 = load i32, i32* %18
%251 = sext i32 %250 to i64
%252 = getelementptr inbounds i32, i32* %249, i64 %251
%253 = load i32, i32* %252
%254 = load i32, i32* @CL_DEVICE_VENDOR
%255 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %253, i32 %254, i32 0, i8* null, i64* %9)
store i64 %255, i64* %22
%256 = load i64, i64* @CL_SUCCESS
%257 = load i64, i64* %22
%258 = icmp ne i64 %256, %257
br i1 %258, label %259, label %266
259: ; preds = %248
%260 = load i32, i32* @stderr
%261 = load i64, i64* %22
%262 = call i8* @loclGetErrCode(i64 %261)
%263 = call i32 @fprintf(i32 %260, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 156, i8* %262)
%264 = load i32, i32* @EXIT_FAILURE
%265 = call i32 @exit(i32 %264)
unreachable
266: ; preds = %248
%267 = load i64, i64* %9
%268 = call i64 @alloca(i64 %267)
%269 = inttoptr i64 %268 to i8*
store i8* %269, i8** %23
%270 = load i32*, i32** %16
%271 = load i32, i32* %18
%272 = sext i32 %271 to i64
%273 = getelementptr inbounds i32, i32* %270, i64 %272
%274 = load i32, i32* %273
%275 = load i32, i32* @CL_DEVICE_VENDOR
%276 = load i64, i64* %9
%277 = trunc i64 %276 to i32
%278 = load i8*, i8** %23
%279 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %274, i32 %275, i32 %277, i8* %278, i8* null)
store i64 %279, i64* %24
%280 = load i64, i64* @CL_SUCCESS
%281 = load i64, i64* %24
%282 = icmp ne i64 %280, %281
br i1 %282, label %283, label %290
283: ; preds = %266
%284 = load i32, i32* @stderr
%285 = load i64, i64* %24
%286 = call i8* @loclGetErrCode(i64 %285)
%287 = call i32 @fprintf(i32 %284, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 158, i8* %286)
%288 = load i32, i32* @EXIT_FAILURE
%289 = call i32 @exit(i32 %288)
unreachable
290: ; preds = %266
%291 = load i32*, i32** %16
%292 = load i32, i32* %18
%293 = sext i32 %292 to i64
%294 = getelementptr inbounds i32, i32* %291, i64 %293
%295 = load i32, i32* %294
%296 = load i32, i32* @CL_DRIVER_VERSION
%297 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %295, i32 %296, i32 0, i8* null, i64* %9)
store i64 %297, i64* %25
%298 = load i64, i64* @CL_SUCCESS
%299 = load i64, i64* %25
%300 = icmp ne i64 %298, %299
br i1 %300, label %301, label %308
301: ; preds = %290
%302 = load i32, i32* @stderr
%303 = load i64, i64* %25
%304 = call i8* @loclGetErrCode(i64 %303)
%305 = call i32 @fprintf(i32 %302, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 159, i8* %304)
%306 = load i32, i32* @EXIT_FAILURE
%307 = call i32 @exit(i32 %306)
unreachable
308: ; preds = %290
%309 = load i64, i64* %9
%310 = call i64 @alloca(i64 %309)
%311 = inttoptr i64 %310 to i8*
store i8* %311, i8** %26
%312 = load i32*, i32** %16
%313 = load i32, i32* %18
%314 = sext i32 %313 to i64
%315 = getelementptr inbounds i32, i32* %312, i64 %314
%316 = load i32, i32* %315
%317 = load i32, i32* @CL_DRIVER_VERSION
%318 = load i64, i64* %9
%319 = trunc i64 %318 to i32
%320 = load i8*, i8** %26
%321 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %316, i32 %317, i32 %319, i8* %320, i8* null)
store i64 %321, i64* %27
%322 = load i64, i64* @CL_SUCCESS
%323 = load i64, i64* %27
%324 = icmp ne i64 %322, %323
br i1 %324, label %325, label %332
325: ; preds = %308
%326 = load i32, i32* @stderr
%327 = load i64, i64* %27
%328 = call i8* @loclGetErrCode(i64 %327)
%329 = call i32 @fprintf(i32 %326, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 161, i8* %328)
%330 = load i32, i32* @EXIT_FAILURE
%331 = call i32 @exit(i32 %330)
unreachable
332: ; preds = %308
%333 = load i32*, i32** %16
%334 = load i32, i32* %18
%335 = sext i32 %334 to i64
%336 = getelementptr inbounds i32, i32* %333, i64 %335
%337 = load i32, i32* %336
%338 = load i32, i32* @CL_DEVICE_VERSION
%339 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %337, i32 %338, i32 0, i8* null, i64* %9)
store i64 %339, i64* %28
%340 = load i64, i64* @CL_SUCCESS
%341 = load i64, i64* %28
%342 = icmp ne i64 %340, %341
br i1 %342, label %343, label %350
343: ; preds = %332
%344 = load i32, i32* @stderr
%345 = load i64, i64* %28
%346 = call i8* @loclGetErrCode(i64 %345)
%347 = call i32 @fprintf(i32 %344, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 162, i8* %346)
%348 = load i32, i32* @EXIT_FAILURE
%349 = call i32 @exit(i32 %348)
unreachable
350: ; preds = %332
%351 = load i64, i64* %9
%352 = call i64 @alloca(i64 %351)
%353 = inttoptr i64 %352 to i8*
store i8* %353, i8** %29
%354 = load i32*, i32** %16
%355 = load i32, i32* %18
%356 = sext i32 %355 to i64
%357 = getelementptr inbounds i32, i32* %354, i64 %356
%358 = load i32, i32* %357
%359 = load i32, i32* @CL_DEVICE_VERSION
%360 = load i64, i64* %9
%361 = trunc i64 %360 to i32
%362 = load i8*, i8** %29
%363 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %358, i32 %359, i32 %361, i8* %362, i8* null)
store i64 %363, i64* %30
%364 = load i64, i64* @CL_SUCCESS
%365 = load i64, i64* %30
%366 = icmp ne i64 %364, %365
br i1 %366, label %367, label %374
367: ; preds = %350
%368 = load i32, i32* @stderr
%369 = load i64, i64* %30
%370 = call i8* @loclGetErrCode(i64 %369)
%371 = call i32 @fprintf(i32 %368, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 164, i8* %370)
%372 = load i32, i32* @EXIT_FAILURE
%373 = call i32 @exit(i32 %372)
unreachable
374: ; preds = %350
%375 = load i32*, i32** %16
%376 = load i32, i32* %18
%377 = sext i32 %376 to i64
%378 = getelementptr inbounds i32, i32* %375, i64 %377
%379 = load i32, i32* %378
%380 = load i32, i32* @CL_DEVICE_MAX_CLOCK_FREQUENCY
%381 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %379, i32 %380, i32 4, i32* %31, i8* null)
store i64 %381, i64* %33
%382 = load i64, i64* @CL_SUCCESS
%383 = load i64, i64* %33
%384 = icmp ne i64 %382, %383
br i1 %384, label %385, label %392
385: ; preds = %374
%386 = load i32, i32* @stderr
%387 = load i64, i64* %33
%388 = call i8* @loclGetErrCode(i64 %387)
%389 = call i32 @fprintf(i32 %386, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 166, i8* %388)
%390 = load i32, i32* @EXIT_FAILURE
%391 = call i32 @exit(i32 %390)
unreachable
392: ; preds = %374
%393 = load i32*, i32** %16
%394 = load i32, i32* %18
%395 = sext i32 %394 to i64
%396 = getelementptr inbounds i32, i32* %393, i64 %395
%397 = load i32, i32* %396
%398 = load i32, i32* @CL_DEVICE_MAX_COMPUTE_UNITS
%399 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %397, i32 %398, i32 4, i32* %32, i8* null)
store i64 %399, i64* %34
%400 = load i64, i64* @CL_SUCCESS
%401 = load i64, i64* %34
%402 = icmp ne i64 %400, %401
br i1 %402, label %403, label %410
403: ; preds = %392
%404 = load i32, i32* @stderr
%405 = load i64, i64* %34
%406 = call i8* @loclGetErrCode(i64 %405)
%407 = call i32 @fprintf(i32 %404, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 167, i8* %406)
%408 = load i32, i32* @EXIT_FAILURE
%409 = call i32 @exit(i32 %408)
unreachable
410: ; preds = %392
%411 = load i32, i32* %6
%412 = load i8*, i8** %23
%413 = load i8*, i8** %20
%414 = load i32, i32* %32
%415 = load i32, i32* %31
%416 = load i8*, i8** %29
%417 = load i8*, i8** %26
%418 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.3, i64 0, i64 0), i32 %411, i8* %412, i8* %413, i32 %414, i32 %415, i8* %416, i8* %417)
%419 = load i32, i32* %6
%420 = add nsw i32 %419, 1
store i32 %420, i32* %6
br label %421
421: ; preds = %410
%422 = load i32, i32* %18
%423 = add nsw i32 %422, 1
store i32 %423, i32* %18
br label %202
424: ; preds = %202
br label %425
425: ; preds = %424
%426 = load i32, i32* %7
%427 = add nsw i32 %426, 1
store i32 %427, i32* %7
br label %66
428: ; preds = %66
%429 = load i32, i32* %6
%430 = icmp sgt i32 %429, 1
br i1 %430, label %431, label %435
431: ; preds = %428
%432 = load i32, i32* %6
%433 = sub nsw i32 %432, 1
%434 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i32 %433)
br label %437
435: ; preds = %428
%436 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0))
br label %437
437: ; preds = %435, %431
ret void
}

LLVM IR (-O2):
@CL_SUCCESS = global i64 0
@stderr = global i32 0
@.str = [44 x i8] c"OpenCL error in file '%s' in line %i : %s.\0A\00"
@.str.1 = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/ekondis/gpumembench/refs/heads/master/common/loclutil.h\00"
@EXIT_FAILURE = global i32 0
@CL_DEVICE_TYPE_ALL = global i32 0
@CL_PLATFORM_NAME = global i32 0
@CL_PLATFORM_VENDOR = global i32 0
@.str.2 = [49 x i8] c"Platform %d (name:%s, vendor:%s) has %d devices\0A\00"
@CL_DEVICE_NAME = global i32 0
@CL_DEVICE_VENDOR = global i32 0
@CL_DRIVER_VERSION = global i32 0
@CL_DEVICE_VERSION = global i32 0
@CL_DEVICE_MAX_CLOCK_FREQUENCY = global i32 0
@CL_DEVICE_MAX_COMPUTE_UNITS = global i32 0
@.str.3 = [76 x i8] c" [%d].Vendor: %s Device: %s (%d compute units, freq %dMHz, %s, driver: %s)\0A\00"
@.str.4 = [31 x i8] c"Please select a device(1..%d)\0A\00"
@str = [23 x i8] c"No OpenCL device found\00"
define void @loclPrintAvailableDevices() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = call i64 @clGetPlatformIDs(i32 0, i32* null, i32* %1)
%9 = load i64, i64* @CL_SUCCESS
%10 = icmp eq i64 %9, %8
br i1 %10, label %17, label %11
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = call i8* @loclGetErrCode(i64 %8)
%14 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 130, i8* %13)
%15 = load i32, i32* @EXIT_FAILURE
%16 = call i32 @exit(i32 %15)
unreachable
17: ; preds = %0
%18 = load i32, i32* %1
%19 = sext i32 %18 to i64
%20 = shl nsw i64 %19, 2
%21 = call i64 @alloca(i64 %20)
%22 = inttoptr i64 %21 to i32*
%23 = load i32, i32* %1
%24 = call i64 @clGetPlatformIDs(i32 %23, i32* %22, i32* null)
%25 = load i64, i64* @CL_SUCCESS
%26 = icmp eq i64 %25, %24
br i1 %26, label %27, label %34
27: ; preds = %17
%28 = load i32, i32* %1
%29 = icmp sgt i32 %28, 0
br i1 %29, label %30, label %298
30: ; preds = %27
%31 = bitcast i64* %3 to i8*
%32 = bitcast i32* %4 to i8*
%33 = bitcast i32* %5 to i8*
br label %42
34: ; preds = %17
%35 = load i32, i32* @stderr
%36 = call i8* @loclGetErrCode(i64 %24)
%37 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 133, i8* %36)
%38 = load i32, i32* @EXIT_FAILURE
%39 = call i32 @exit(i32 %38)
unreachable
40: ; preds = %138
%41 = icmp sgt i32 %139, 1
br i1 %41, label %295, label %298
42: ; preds = %30, %138
%43 = phi i64 [ 0, %30 ], [ %114, %138 ]
%44 = phi i32 [ 1, %30 ], [ %139, %138 ]
%45 = getelementptr inbounds i32, i32* %22, i64 %43
%46 = load i32, i32* %45
%47 = load i32, i32* @CL_DEVICE_TYPE_ALL
%48 = call i64 @clGetDeviceIDs(i32 %46, i32 %47, i32 0, i32* null, i32* %2)
%49 = load i64, i64* @CL_SUCCESS
%50 = icmp eq i64 %49, %48
br i1 %50, label %57, label %51
51: ; preds = %42
%52 = load i32, i32* @stderr
%53 = call i8* @loclGetErrCode(i64 %48)
%54 = call i32 @fprintf(i32 %52, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 137, i8* %53)
%55 = load i32, i32* @EXIT_FAILURE
%56 = call i32 @exit(i32 %55)
unreachable
57: ; preds = %42
%58 = load i32, i32* %45
%59 = load i32, i32* @CL_PLATFORM_NAME
%60 = call i64 @clGetPlatformInfo(i32 %58, i32 %59, i64 0, i8* null, i64* %3)
%61 = load i64, i64* @CL_SUCCESS
%62 = icmp eq i64 %61, %60
br i1 %62, label %69, label %63
63: ; preds = %57
%64 = load i32, i32* @stderr
%65 = call i8* @loclGetErrCode(i64 %60)
%66 = call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 140, i8* %65)
%67 = load i32, i32* @EXIT_FAILURE
%68 = call i32 @exit(i32 %67)
unreachable
69: ; preds = %57
%70 = load i64, i64* %3
%71 = call i64 @alloca(i64 %70)
%72 = inttoptr i64 %71 to i8*
%73 = load i32, i32* %45
%74 = load i32, i32* @CL_PLATFORM_NAME
%75 = load i64, i64* %3
%76 = call i64 @clGetPlatformInfo(i32 %73, i32 %74, i64 %75, i8* %72, i64* null)
%77 = load i64, i64* @CL_SUCCESS
%78 = icmp eq i64 %77, %76
br i1 %78, label %85, label %79
79: ; preds = %69
%80 = load i32, i32* @stderr
%81 = call i8* @loclGetErrCode(i64 %76)
%82 = call i32 @fprintf(i32 %80, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 142, i8* %81)
%83 = load i32, i32* @EXIT_FAILURE
%84 = call i32 @exit(i32 %83)
unreachable
85: ; preds = %69
%86 = load i32, i32* %45
%87 = load i32, i32* @CL_PLATFORM_VENDOR
%88 = call i64 @clGetPlatformInfo(i32 %86, i32 %87, i64 0, i8* null, i64* %3)
%89 = load i64, i64* @CL_SUCCESS
%90 = icmp eq i64 %89, %88
br i1 %90, label %97, label %91
91: ; preds = %85
%92 = load i32, i32* @stderr
%93 = call i8* @loclGetErrCode(i64 %88)
%94 = call i32 @fprintf(i32 %92, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 143, i8* %93)
%95 = load i32, i32* @EXIT_FAILURE
%96 = call i32 @exit(i32 %95)
unreachable
97: ; preds = %85
%98 = load i64, i64* %3
%99 = call i64 @alloca(i64 %98)
%100 = inttoptr i64 %99 to i8*
%101 = load i32, i32* %45
%102 = load i32, i32* @CL_PLATFORM_VENDOR
%103 = load i64, i64* %3
%104 = call i64 @clGetPlatformInfo(i32 %101, i32 %102, i64 %103, i8* %100, i64* null)
%105 = load i64, i64* @CL_SUCCESS
%106 = icmp eq i64 %105, %104
br i1 %106, label %113, label %107
107: ; preds = %97
%108 = load i32, i32* @stderr
%109 = call i8* @loclGetErrCode(i64 %104)
%110 = call i32 @fprintf(i32 %108, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 145, i8* %109)
%111 = load i32, i32* @EXIT_FAILURE
%112 = call i32 @exit(i32 %111)
unreachable
113: ; preds = %97
%114 = add nuw nsw i64 %43, 1
%115 = load i32, i32* %2
%116 = trunc i64 %114 to i32
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), i32 %116, i8* %72, i8* %100, i32 %115)
%118 = load i32, i32* %2
%119 = sext i32 %118 to i64
%120 = shl nsw i64 %119, 2
%121 = call i64 @alloca(i64 %120)
%122 = inttoptr i64 %121 to i32*
%123 = load i32, i32* %45
%124 = load i32, i32* @CL_DEVICE_TYPE_ALL
%125 = load i32, i32* %2
%126 = call i64 @clGetDeviceIDs(i32 %123, i32 %124, i32 %125, i32* %122, i32* null)
%127 = load i64, i64* @CL_SUCCESS
%128 = icmp eq i64 %127, %126
br i1 %128, label %129, label %132
129: ; preds = %113
%130 = load i32, i32* %2
%131 = icmp sgt i32 %130, 0
br i1 %131, label %143, label %138
132: ; preds = %113
%133 = load i32, i32* @stderr
%134 = call i8* @loclGetErrCode(i64 %126)
%135 = call i32 @fprintf(i32 %133, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 150, i8* %134)
%136 = load i32, i32* @EXIT_FAILURE
%137 = call i32 @exit(i32 %136)
unreachable
138: ; preds = %286, %129
%139 = phi i32 [ %44, %129 ], [ %290, %286 ]
%140 = load i32, i32* %1
%141 = sext i32 %140 to i64
%142 = icmp slt i64 %114, %141
br i1 %142, label %42, label %40
143: ; preds = %129, %286
%144 = phi i64 [ %291, %286 ], [ 0, %129 ]
%145 = phi i32 [ %290, %286 ], [ %44, %129 ]
%146 = getelementptr inbounds i32, i32* %122, i64 %144
%147 = load i32, i32* %146
%148 = load i32, i32* @CL_DEVICE_NAME
%149 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %147, i32 %148, i32 0, i8* null, i64* %3)
%150 = load i64, i64* @CL_SUCCESS
%151 = icmp eq i64 %150, %149
br i1 %151, label %158, label %152
152: ; preds = %143
%153 = load i32, i32* @stderr
%154 = call i8* @loclGetErrCode(i64 %149)
%155 = call i32 @fprintf(i32 %153, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 153, i8* %154)
%156 = load i32, i32* @EXIT_FAILURE
%157 = call i32 @exit(i32 %156)
unreachable
158: ; preds = %143
%159 = load i64, i64* %3
%160 = call i64 @alloca(i64 %159)
%161 = inttoptr i64 %160 to i8*
%162 = load i32, i32* %146
%163 = load i32, i32* @CL_DEVICE_NAME
%164 = load i64, i64* %3
%165 = trunc i64 %164 to i32
%166 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %162, i32 %163, i32 %165, i8* %161, i8* null)
%167 = load i64, i64* @CL_SUCCESS
%168 = icmp eq i64 %167, %166
br i1 %168, label %175, label %169
169: ; preds = %158
%170 = load i32, i32* @stderr
%171 = call i8* @loclGetErrCode(i64 %166)
%172 = call i32 @fprintf(i32 %170, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 155, i8* %171)
%173 = load i32, i32* @EXIT_FAILURE
%174 = call i32 @exit(i32 %173)
unreachable
175: ; preds = %158
%176 = load i32, i32* %146
%177 = load i32, i32* @CL_DEVICE_VENDOR
%178 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %176, i32 %177, i32 0, i8* null, i64* %3)
%179 = load i64, i64* @CL_SUCCESS
%180 = icmp eq i64 %179, %178
br i1 %180, label %187, label %181
181: ; preds = %175
%182 = load i32, i32* @stderr
%183 = call i8* @loclGetErrCode(i64 %178)
%184 = call i32 @fprintf(i32 %182, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 156, i8* %183)
%185 = load i32, i32* @EXIT_FAILURE
%186 = call i32 @exit(i32 %185)
unreachable
187: ; preds = %175
%188 = load i64, i64* %3
%189 = call i64 @alloca(i64 %188)
%190 = inttoptr i64 %189 to i8*
%191 = load i32, i32* %146
%192 = load i32, i32* @CL_DEVICE_VENDOR
%193 = load i64, i64* %3
%194 = trunc i64 %193 to i32
%195 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %191, i32 %192, i32 %194, i8* %190, i8* null)
%196 = load i64, i64* @CL_SUCCESS
%197 = icmp eq i64 %196, %195
br i1 %197, label %204, label %198
198: ; preds = %187
%199 = load i32, i32* @stderr
%200 = call i8* @loclGetErrCode(i64 %195)
%201 = call i32 @fprintf(i32 %199, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 158, i8* %200)
%202 = load i32, i32* @EXIT_FAILURE
%203 = call i32 @exit(i32 %202)
unreachable
204: ; preds = %187
%205 = load i32, i32* %146
%206 = load i32, i32* @CL_DRIVER_VERSION
%207 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %205, i32 %206, i32 0, i8* null, i64* %3)
%208 = load i64, i64* @CL_SUCCESS
%209 = icmp eq i64 %208, %207
br i1 %209, label %216, label %210
210: ; preds = %204
%211 = load i32, i32* @stderr
%212 = call i8* @loclGetErrCode(i64 %207)
%213 = call i32 @fprintf(i32 %211, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 159, i8* %212)
%214 = load i32, i32* @EXIT_FAILURE
%215 = call i32 @exit(i32 %214)
unreachable
216: ; preds = %204
%217 = load i64, i64* %3
%218 = call i64 @alloca(i64 %217)
%219 = inttoptr i64 %218 to i8*
%220 = load i32, i32* %146
%221 = load i32, i32* @CL_DRIVER_VERSION
%222 = load i64, i64* %3
%223 = trunc i64 %222 to i32
%224 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %220, i32 %221, i32 %223, i8* %219, i8* null)
%225 = load i64, i64* @CL_SUCCESS
%226 = icmp eq i64 %225, %224
br i1 %226, label %233, label %227
227: ; preds = %216
%228 = load i32, i32* @stderr
%229 = call i8* @loclGetErrCode(i64 %224)
%230 = call i32 @fprintf(i32 %228, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 161, i8* %229)
%231 = load i32, i32* @EXIT_FAILURE
%232 = call i32 @exit(i32 %231)
unreachable
233: ; preds = %216
%234 = load i32, i32* %146
%235 = load i32, i32* @CL_DEVICE_VERSION
%236 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %234, i32 %235, i32 0, i8* null, i64* %3)
%237 = load i64, i64* @CL_SUCCESS
%238 = icmp eq i64 %237, %236
br i1 %238, label %245, label %239
239: ; preds = %233
%240 = load i32, i32* @stderr
%241 = call i8* @loclGetErrCode(i64 %236)
%242 = call i32 @fprintf(i32 %240, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 162, i8* %241)
%243 = load i32, i32* @EXIT_FAILURE
%244 = call i32 @exit(i32 %243)
unreachable
245: ; preds = %233
%246 = load i64, i64* %3
%247 = call i64 @alloca(i64 %246)
%248 = inttoptr i64 %247 to i8*
%249 = load i32, i32* %146
%250 = load i32, i32* @CL_DEVICE_VERSION
%251 = load i64, i64* %3
%252 = trunc i64 %251 to i32
%253 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %249, i32 %250, i32 %252, i8* %248, i8* null)
%254 = load i64, i64* @CL_SUCCESS
%255 = icmp eq i64 %254, %253
br i1 %255, label %262, label %256
256: ; preds = %245
%257 = load i32, i32* @stderr
%258 = call i8* @loclGetErrCode(i64 %253)
%259 = call i32 @fprintf(i32 %257, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 164, i8* %258)
%260 = load i32, i32* @EXIT_FAILURE
%261 = call i32 @exit(i32 %260)
unreachable
262: ; preds = %245
%263 = load i32, i32* %146
%264 = load i32, i32* @CL_DEVICE_MAX_CLOCK_FREQUENCY
%265 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %263, i32 %264, i32 4, i32* %4, i8* null)
%266 = load i64, i64* @CL_SUCCESS
%267 = icmp eq i64 %266, %265
br i1 %267, label %274, label %268
268: ; preds = %262
%269 = load i32, i32* @stderr
%270 = call i8* @loclGetErrCode(i64 %265)
%271 = call i32 @fprintf(i32 %269, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 166, i8* %270)
%272 = load i32, i32* @EXIT_FAILURE
%273 = call i32 @exit(i32 %272)
unreachable
274: ; preds = %262
%275 = load i32, i32* %146
%276 = load i32, i32* @CL_DEVICE_MAX_COMPUTE_UNITS
%277 = call i64 (i32, i32, i32, ...) @clGetDeviceInfo(i32 %275, i32 %276, i32 4, i32* %5, i8* null)
%278 = load i64, i64* @CL_SUCCESS
%279 = icmp eq i64 %278, %277
br i1 %279, label %286, label %280
280: ; preds = %274
%281 = load i32, i32* @stderr
%282 = call i8* @loclGetErrCode(i64 %277)
%283 = call i32 @fprintf(i32 %281, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str.1, i64 0, i64 0), i32 167, i8* %282)
%284 = load i32, i32* @EXIT_FAILURE
%285 = call i32 @exit(i32 %284)
unreachable
286: ; preds = %274
%287 = load i32, i32* %5
%288 = load i32, i32* %4
%289 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @.str.3, i64 0, i64 0), i32 %145, i8* %190, i8* %161, i32 %287, i32 %288, i8* %248, i8* %219)
%290 = add nsw i32 %145, 1
%291 = add nuw nsw i64 %144, 1
%292 = load i32, i32* %2
%293 = sext i32 %292 to i64
%294 = icmp slt i64 %291, %293
br i1 %294, label %143, label %138
295: ; preds = %40
%296 = add nsw i32 %139, -1
%297 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i32 %296)
br label %300
298: ; preds = %27, %40
%299 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %300
300: ; preds = %298, %295
ret void
}