#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ cl_int;
typedef int /*<<< orphan*/ cl_device_id;
typedef int /*<<< orphan*/ cl_context;
typedef int /*<<< orphan*/ cl_command_queue;

/* Variables and functions */
int /*<<< orphan*/ CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE;
int /*<<< orphan*/ clCreateCommandQueue(int /*<<< orphan*/, int /*<<< orphan*/,
                                        int /*<<< orphan*/,
                                        int /*<<< orphan*/ *);
int /*<<< orphan*/ oclCheckStatus(int /*<<< orphan*/, char *);
cl_command_queue oclCreateCommandQueueOOO(cl_context context,
                                          cl_device_id device) {
  cl_int status;
  cl_command_queue commandQueue = clCreateCommandQueue(
      context, device, CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &status);
  oclCheckStatus(status, "clCreateCommandQueue OOO failed.");
  return commandQueue;
}


x86 assembly (clang, -O0):
<oclCreateCommandQueueOOO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
call   1030 <clCreateCommandQueue@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
lea    0xead(%rip),%rsi
call   1040 <oclCheckStatus@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oclCreateCommandQueueOOO>:
push   %rbx
sub    $0x10,%rsp
mov    0x2ebc(%rip),%rax
mov    (%rax),%edx
lea    0xc(%rsp),%rcx
call   1030 <clCreateCommandQueue@plt>
mov    %eax,%ebx
mov    0xc(%rsp),%edi
lea    0xebb(%rip),%rsi
call   1040 <oclCheckStatus@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE = global i32 0
@.str = [33 x i8] c"clCreateCommandQueue OOO failed.\00"
define i32 @oclCreateCommandQueueOOO(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = load i32, i32* @CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
%10 = call i32 @clCreateCommandQueue(i32 %7, i32 %8, i32 %9, i32* %5)
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = call i32 @oclCheckStatus(i32 %11, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* %6
ret i32 %13
}

LLVM IR (-O2):
@CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE = global i32 0
@.str = [33 x i8] c"clCreateCommandQueue OOO failed.\00"
define i32 @oclCreateCommandQueueOOO(i32 %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE
%6 = call i32 @clCreateCommandQueue(i32 %0, i32 %1, i32 %5, i32* %3)
%7 = load i32, i32* %3
%8 = call i32 @oclCheckStatus(i32 %7, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 %6
}