#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_int;
typedef int /*<<< orphan*/ cl_image_format;
typedef int /*<<< orphan*/ cl_device_id;
typedef int /*<<< orphan*/ cl_context;

/* Variables and functions */
int /*<<< orphan*/ CL_DEVICE_TYPE_ALL;
int /*<<< orphan*/ CL_MEM_OBJECT_IMAGE2D;
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ check_cl_error(int /*<<< orphan*/, int, char *);
int /*<<< orphan*/ clCreateContext(int /*<<< orphan*/ *, int,
                                   int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                   int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ clGetDeviceIDs(int /*<<< orphan*/, int /*<<< orphan*/, int,
                                  int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ clGetPlatformIDs(int, int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ clGetSupportedImageFormats(int /*<<< orphan*/,
                                              int /*<<< orphan*/,
                                              int /*<<< orphan*/, int,
                                              int /*<<< orphan*/ *, int *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ stderr;
int main(void) {
  cl_int err;
  cl_platform_id platform[1];
  cl_uint nplatforms;
  cl_device_id devices[2];
  cl_uint ndevices;
  cl_image_format *img_formats;
  cl_uint num_entries;
  err = clGetPlatformIDs(1, platform, &nplatforms);
  do {
    if (check_cl_error(err, 20, "clGetPlatformIDs"))
      exit(EXIT_FAILURE);
  } while (0);
  err = clGetDeviceIDs(platform[0], CL_DEVICE_TYPE_ALL, 2, devices, &ndevices);
  do {
    if (check_cl_error(err, 24, "clGetDeviceIDs"))
      exit(EXIT_FAILURE);
  } while (0);
  do {
    if (!(ndevices >= 2)) {
      fprintf(stderr,
              "Assertion: \n"
              "ndevices >= 2"
              "\nfailed on %s:%i\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jrprice/pocl/refs/heads/master/tests/"
              "runtime/test_clGetSupportedImageFormats.c",
              26);
      return EXIT_FAILURE;
    }
  } while (0);
  cl_context context =
      clCreateContext(NULL, ndevices, devices, NULL, NULL, &err);
  do {
    if (check_cl_error(err, 30, "clCreateContext"))
      exit(EXIT_FAILURE);
  } while (0);
  err = clGetSupportedImageFormats(context, 0, CL_MEM_OBJECT_IMAGE2D, 0, NULL,
                                   &num_entries);
  do {
    if (check_cl_error(err, 34, "clGetSupportedImageFormats"))
      exit(EXIT_FAILURE);
  } while (0);
  img_formats =
      (cl_image_format *)malloc(sizeof(cl_image_format) * num_entries);
  err = clGetSupportedImageFormats(context, 0, CL_MEM_OBJECT_IMAGE2D,
                                   num_entries, img_formats, NULL);
  do {
    if (check_cl_error(err, 40, "clGetSupportedImageFormats"))
      exit(EXIT_FAILURE);
  } while (0);
  do {
    if (!(num_entries != 0)) {
      fprintf(stderr,
              "Assertion: \n"
              "num_entries != 0"
              "\nfailed on %s:%i\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/jrprice/pocl/refs/heads/master/tests/"
              "runtime/test_clGetSupportedImageFormats.c",
              42);
      return EXIT_FAILURE;
    }
  } while (0);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc(%rbp),%rsi
mov    $0x1,%edi
lea    -0x10(%rbp),%rdx
call   1040 <clGetPlatformIDs@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x14,%esi
lea    0xe4d(%rip),%rdx
call   1080 <check_cl_error@plt>
cmp    $0x0,%rax
je     11d0 <main+0x50>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
jmp    11d5 <main+0x55>
mov    -0xc(%rbp),%edi
mov    0x2e09(%rip),%rax
mov    (%rax),%esi
lea    -0x18(%rbp),%rcx
mov    $0x2,%edx
lea    -0x1c(%rbp),%r8
call   1030 <clGetDeviceIDs@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x18,%esi
lea    0xe0c(%rip),%rdx
call   1080 <check_cl_error@plt>
cmp    $0x0,%rax
je     1222 <main+0xa2>
mov    0x2db5(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
jmp    1227 <main+0xa7>
jmp    122c <main+0xac>
cmpl   $0x2,-0x1c(%rbp)
jge    1268 <main+0xe8>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
lea    0xdda(%rip),%rsi
lea    0xdfe(%rip),%rdx
mov    $0x1a,%ecx
call   1060 <fprintf@plt>
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c6 <main+0x246>
jmp    126d <main+0xed>
mov    -0x1c(%rbp),%esi
lea    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x8(%rbp),%r9
mov    %r8,%rdi
mov    %r8,%rcx
call   1050 <clCreateContext@plt>
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1e,%esi
lea    0xe5a(%rip),%rdx
call   1080 <check_cl_error@plt>
cmp    $0x0,%rax
je     12b7 <main+0x137>
mov    0x2d20(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
jmp    12bc <main+0x13c>
mov    -0x30(%rbp),%edi
mov    0x2d02(%rip),%rax
mov    (%rax),%edx
xor    %ecx,%ecx
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x2c(%rbp),%r9
mov    %ecx,%esi
call   1070 <clGetSupportedImageFormats@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x22,%esi
lea    0xe18(%rip),%rdx
call   1080 <check_cl_error@plt>
cmp    $0x0,%rax
je     1309 <main+0x189>
mov    0x2cce(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
jmp    130e <main+0x18e>
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%edi
mov    0x2c9d(%rip),%rax
mov    (%rax),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%r8
xor    %esi,%esi
xor    %eax,%eax
mov    %eax,%r9d
call   1070 <clGetSupportedImageFormats@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x28,%esi
lea    0xdb2(%rip),%rdx
call   1080 <check_cl_error@plt>
cmp    $0x0,%rax
je     136f <main+0x1ef>
mov    0x2c68(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
jmp    1374 <main+0x1f4>
jmp    1379 <main+0x1f9>
cmpl   $0x0,-0x2c(%rbp)
jne    13b5 <main+0x235>
mov    0x2c4e(%rip),%rax
mov    (%rax),%edi
lea    0xd8c(%rip),%rsi
lea    0xcb1(%rip),%rdx
mov    $0x2a,%ecx
call   1060 <fprintf@plt>
mov    0x2c25(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    13c6 <main+0x246>
jmp    13ba <main+0x23a>
mov    0x2bff(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0x18(%rsp),%rsi
lea    0x24(%rsp),%rdx
mov    $0x1,%edi
call   1040 <clGetPlatformIDs@plt>
lea    0xe5e(%rip),%rdx
mov    %eax,%edi
mov    $0x14,%esi
call   1080 <check_cl_error@plt>
test   %rax,%rax
jne    1316 <main+0x196>
mov    0x18(%rsp),%edi
mov    0x2e26(%rip),%rax
mov    (%rax),%esi
lea    0x1c(%rsp),%rcx
lea    0x14(%rsp),%r8
mov    $0x2,%edx
call   1030 <clGetDeviceIDs@plt>
mov    %eax,0xc(%rsp)
lea    0xe2e(%rip),%rdx
mov    %eax,%edi
mov    $0x18,%esi
call   1080 <check_cl_error@plt>
test   %rax,%rax
jne    1316 <main+0x196>
mov    0x14(%rsp),%esi
cmp    $0x1,%esi
jle    12c6 <main+0x146>
lea    0x1c(%rsp),%rdx
lea    0xc(%rsp),%r9
xor    %edi,%edi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1050 <clCreateContext@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
lea    0xecc(%rip),%rdx
mov    $0x1e,%esi
call   1080 <check_cl_error@plt>
test   %rax,%rax
jne    1316 <main+0x196>
mov    0x2d86(%rip),%r14
mov    (%r14),%edx
lea    0x10(%rsp),%r9
mov    %ebx,%edi
xor    %esi,%esi
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1070 <clGetSupportedImageFormats@plt>
mov    %eax,0xc(%rsp)
lea    0xea1(%rip),%rdx
mov    %eax,%edi
mov    $0x22,%esi
call   1080 <check_cl_error@plt>
test   %rax,%rax
jne    1316 <main+0x196>
mov    0x10(%rsp),%edi
shl    $0x2,%edi
call   1090 <malloc@plt>
mov    (%r14),%edx
mov    0x10(%rsp),%ecx
mov    %ebx,%edi
xor    %esi,%esi
mov    %rax,%r8
xor    %r9d,%r9d
call   1070 <clGetSupportedImageFormats@plt>
mov    %eax,0xc(%rsp)
lea    0xe5f(%rip),%rdx
mov    %eax,%edi
mov    $0x28,%esi
call   1080 <check_cl_error@plt>
test   %rax,%rax
jne    1316 <main+0x196>
cmpl   $0x0,0x10(%rsp)
je     12e4 <main+0x164>
mov    0x2cfc(%rip),%rax
jmp    130c <main+0x18c>
mov    0x2d0b(%rip),%rax
mov    (%rax),%edi
lea    0xd4a(%rip),%rsi
lea    0xd6e(%rip),%rdx
mov    $0x1a,%ecx
jmp    1300 <main+0x180>
mov    0x2ced(%rip),%rax
mov    (%rax),%edi
lea    0xe2b(%rip),%rsi
lea    0xd50(%rip),%rdx
mov    $0x2a,%ecx
call   1060 <fprintf@plt>
mov    0x2cc4(%rip),%rax
mov    (%rax),%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2cb3(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"clGetPlatformIDs\00"
@EXIT_FAILURE = global i32 0
@CL_DEVICE_TYPE_ALL = global i32 0
@.str.1 = [15 x i8] c"clGetDeviceIDs\00"
@stderr = global i32 0
@.str.2 = [43 x i8] c"Assertion: \0Andevices >= 2\0Afailed on %s:%i\0A\00"
@.str.3 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jrprice/pocl/refs/heads/master/tests/runtime/test_clGetSupportedImageFormats.c\00"
@.str.4 = [16 x i8] c"clCreateContext\00"
@CL_MEM_OBJECT_IMAGE2D = global i32 0
@.str.5 = [27 x i8] c"clGetSupportedImageFormats\00"
@.str.6 = [46 x i8] c"Assertion: \0Anum_entries != 0\0Afailed on %s:%i\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1 x i32]
%4 = alloca i32
%5 = alloca [2 x i32]
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%11 = call i32 @clGetPlatformIDs(i32 1, i32* %10, i32* %4)
store i32 %11, i32* %2
br label %12
12: ; preds = %0
%13 = load i32, i32* %2
%14 = call i64 @check_cl_error(i32 %13, i32 20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %12
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %12
br label %20
20: ; preds = %19
%21 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%22 = load i32, i32* %21
%23 = load i32, i32* @CL_DEVICE_TYPE_ALL
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%25 = call i32 @clGetDeviceIDs(i32 %22, i32 %23, i32 2, i32* %24, i32* %6)
store i32 %25, i32* %2
br label %26
26: ; preds = %20
%27 = load i32, i32* %2
%28 = call i64 @check_cl_error(i32 %27, i32 24, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp ne i64 %28, 0
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* @EXIT_FAILURE
%32 = call i32 @exit(i32 %31)
unreachable
33: ; preds = %26
br label %34
34: ; preds = %33
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = icmp sge i32 %36, 2
br i1 %37, label %42, label %38
38: ; preds = %35
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.3, i64 0, i64 0), i32 26)
%41 = load i32, i32* @EXIT_FAILURE
store i32 %41, i32* %1
br label %98
42: ; preds = %35
br label %43
43: ; preds = %42
%44 = load i32, i32* %6
%45 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%46 = call i32 @clCreateContext(i32* null, i32 %44, i32* %45, i32* null, i32* null, i32* %2)
store i32 %46, i32* %9
br label %47
47: ; preds = %43
%48 = load i32, i32* %2
%49 = call i64 @check_cl_error(i32 %48, i32 30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = load i32, i32* @EXIT_FAILURE
%53 = call i32 @exit(i32 %52)
unreachable
54: ; preds = %47
br label %55
55: ; preds = %54
%56 = load i32, i32* %9
%57 = load i32, i32* @CL_MEM_OBJECT_IMAGE2D
%58 = call i32 @clGetSupportedImageFormats(i32 %56, i32 0, i32 %57, i32 0, i32* null, i32* %8)
store i32 %58, i32* %2
br label %59
59: ; preds = %55
%60 = load i32, i32* %2
%61 = call i64 @check_cl_error(i32 %60, i32 34, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%62 = icmp ne i64 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = load i32, i32* @EXIT_FAILURE
%65 = call i32 @exit(i32 %64)
unreachable
66: ; preds = %59
br label %67
67: ; preds = %66
%68 = load i32, i32* %8
%69 = sext i32 %68 to i64
%70 = mul i64 4, %69
%71 = trunc i64 %70 to i32
%72 = call i64 @malloc(i32 %71)
%73 = inttoptr i64 %72 to i32*
store i32* %73, i32** %7
%74 = load i32, i32* %9
%75 = load i32, i32* @CL_MEM_OBJECT_IMAGE2D
%76 = load i32, i32* %8
%77 = load i32*, i32** %7
%78 = call i32 @clGetSupportedImageFormats(i32 %74, i32 0, i32 %75, i32 %76, i32* %77, i32* null)
store i32 %78, i32* %2
br label %79
79: ; preds = %67
%80 = load i32, i32* %2
%81 = call i64 @check_cl_error(i32 %80, i32 40, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%82 = icmp ne i64 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %79
%84 = load i32, i32* @EXIT_FAILURE
%85 = call i32 @exit(i32 %84)
unreachable
86: ; preds = %79
br label %87
87: ; preds = %86
br label %88
88: ; preds = %87
%89 = load i32, i32* %8
%90 = icmp ne i32 %89, 0
br i1 %90, label %95, label %91
91: ; preds = %88
%92 = load i32, i32* @stderr
%93 = call i32 @fprintf(i32 %92, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.3, i64 0, i64 0), i32 42)
%94 = load i32, i32* @EXIT_FAILURE
store i32 %94, i32* %1
br label %98
95: ; preds = %88
br label %96
96: ; preds = %95
%97 = load i32, i32* @EXIT_SUCCESS
store i32 %97, i32* %1
br label %98
98: ; preds = %96, %91, %38
%99 = load i32, i32* %1
ret i32 %99
}

LLVM IR (-O2):
@.str = [17 x i8] c"clGetPlatformIDs\00"
@EXIT_FAILURE = global i32 0
@CL_DEVICE_TYPE_ALL = global i32 0
@.str.1 = [15 x i8] c"clGetDeviceIDs\00"
@stderr = global i32 0
@.str.2 = [43 x i8] c"Assertion: \0Andevices >= 2\0Afailed on %s:%i\0A\00"
@.str.3 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jrprice/pocl/refs/heads/master/tests/runtime/test_clGetSupportedImageFormats.c\00"
@.str.4 = [16 x i8] c"clCreateContext\00"
@CL_MEM_OBJECT_IMAGE2D = global i32 0
@.str.5 = [27 x i8] c"clGetSupportedImageFormats\00"
@.str.6 = [46 x i8] c"Assertion: \0Anum_entries != 0\0Afailed on %s:%i\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i32]
%3 = alloca i32
%4 = alloca [2 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast [1 x i32]* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast [2 x i32]* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
%14 = call i32 @clGetPlatformIDs(i32 1, i32* %13, i32* %3)
%15 = call i64 @check_cl_error(i32 %14, i32 20, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %0
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %0
%21 = load i32, i32* %13
%22 = load i32, i32* @CL_DEVICE_TYPE_ALL
%23 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%24 = call i32 @clGetDeviceIDs(i32 %21, i32 %22, i32 2, i32* %23, i32* %5)
store i32 %24, i32* %1
%25 = call i64 @check_cl_error(i32 %24, i32 24, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %20
%28 = load i32, i32* @EXIT_FAILURE
%29 = call i32 @exit(i32 %28)
unreachable
30: ; preds = %20
%31 = load i32, i32* %5
%32 = icmp sgt i32 %31, 1
br i1 %32, label %36, label %33
33: ; preds = %30
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.3, i64 0, i64 0), i32 26)
br label %71
36: ; preds = %30
%37 = call i32 @clCreateContext(i32* null, i32 %31, i32* %23, i32* null, i32* null, i32* %1)
%38 = load i32, i32* %1
%39 = call i64 @check_cl_error(i32 %38, i32 30, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%40 = icmp eq i64 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %36
%42 = load i32, i32* @EXIT_FAILURE
%43 = call i32 @exit(i32 %42)
unreachable
44: ; preds = %36
%45 = load i32, i32* @CL_MEM_OBJECT_IMAGE2D
%46 = call i32 @clGetSupportedImageFormats(i32 %37, i32 0, i32 %45, i32 0, i32* null, i32* %6)
store i32 %46, i32* %1
%47 = call i64 @check_cl_error(i32 %46, i32 34, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i64 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %44
%50 = load i32, i32* @EXIT_FAILURE
%51 = call i32 @exit(i32 %50)
unreachable
52: ; preds = %44
%53 = load i32, i32* %6
%54 = shl i32 %53, 2
%55 = call i64 @malloc(i32 %54)
%56 = inttoptr i64 %55 to i32*
%57 = load i32, i32* @CL_MEM_OBJECT_IMAGE2D
%58 = load i32, i32* %6
%59 = call i32 @clGetSupportedImageFormats(i32 %37, i32 0, i32 %57, i32 %58, i32* %56, i32* null)
store i32 %59, i32* %1
%60 = call i64 @check_cl_error(i32 %59, i32 40, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%61 = icmp eq i64 %60, 0
br i1 %61, label %65, label %62
62: ; preds = %52
%63 = load i32, i32* @EXIT_FAILURE
%64 = call i32 @exit(i32 %63)
unreachable
65: ; preds = %52
%66 = load i32, i32* %6
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i32, i32* @stderr
%70 = call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.3, i64 0, i64 0), i32 42)
br label %71
71: ; preds = %68, %65, %33
%72 = phi i32* [ @EXIT_FAILURE, %33 ], [ @EXIT_FAILURE, %68 ], [ @EXIT_SUCCESS, %65 ]
%73 = load i32, i32* %72
ret i32 %73
}