#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 scalar_t__ cl_device_id;
typedef scalar_t__ cl_context;
typedef scalar_t__ cl_command_queue_properties;
typedef int /*<<< orphan*/ cl_command_queue;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_command_queue clCreateCommandQueue(cl_context context, cl_device_id device,
                                      cl_command_queue_properties properties,
                                      cl_int *errcode_ret) {
  unsigned int sys_args[4];
  sys_args[0] = (unsigned int)context;
  sys_args[1] = (unsigned int)device;
  sys_args[2] = (unsigned int)properties;
  sys_args[3] = (unsigned int)errcode_ret;
  return (cl_command_queue)syscall(325, 1009, sys_args);
}


x86 assembly (clang, -O0):
<clCreateCommandQueue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,-0x24(%rbp)
lea    -0x30(%rbp),%rdx
mov    $0x145,%edi
mov    $0x3f1,%esi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clCreateCommandQueue>:
sub    $0x18,%rsp
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %edx,0x8(%rsp)
mov    %ecx,0xc(%rsp)
mov    %rsp,%rdx
mov    $0x145,%edi
mov    $0x3f1,%esi
call   1030 <syscall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @clCreateCommandQueue(i64 %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca [4 x i32]
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i64, i64* %5
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
store i32 %11, i32* %12
%13 = load i64, i64* %6
%14 = trunc i64 %13 to i32
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i64, i64* %7
%17 = trunc i64 %16 to i32
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
store i32 %17, i32* %18
%19 = load i32*, i32** %8
%20 = ptrtoint i32* %19 to i32
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 3
store i32 %20, i32* %21
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%23 = call i32 @syscall(i32 325, i32 1009, i32* %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @clCreateCommandQueue(i64 %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca [4 x i32]
%6 = bitcast [4 x i32]* %5 to i8*
%7 = trunc i64 %0 to i32
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 %7, i32* %8
%9 = trunc i64 %1 to i32
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
store i32 %9, i32* %10
%11 = trunc i64 %2 to i32
%12 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 %11, i32* %12
%13 = ptrtoint i32* %3 to i64
%14 = trunc i64 %13 to i32
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
store i32 %14, i32* %15
%16 = call i32 @syscall(i32 325, i32 1009, i32* %8)
ret i32 %16
}