#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 scalar_t__ cl_uint;
typedef scalar_t__ cl_program;
typedef int /*<<< orphan*/ cl_kernel;
typedef int /*<<< orphan*/ cl_int;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clCreateKernelsInProgram(cl_program program, cl_uint num_kernels,
                                cl_kernel *kernels, cl_uint *num_kernels_ret) {
  unsigned int sys_args[4];
  sys_args[0] = (unsigned int)program;
  sys_args[1] = (unsigned int)num_kernels;
  sys_args[2] = (unsigned int)kernels;
  sys_args[3] = (unsigned int)num_kernels_ret;
  return (cl_int)syscall(325, 1037, sys_args);
}


x86 assembly (clang, -O0):
<clCreateKernelsInProgram>:
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    $0x40d,%esi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clCreateKernelsInProgram>:
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    $0x40d,%esi
call   1030 <syscall@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @clCreateKernelsInProgram(i64 %0, i64 %1, i32* %2, i64* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i64*
%9 = alloca [4 x i32]
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32* %2, i32** %7
store i64* %3, i64** %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 i32*, i32** %7
%17 = ptrtoint i32* %16 to i32
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 2
store i32 %17, i32* %18
%19 = load i64*, i64** %8
%20 = ptrtoint i64* %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 1037, i32* %22)
ret i32 %23
}

LLVM IR (-O2):
define i32 @clCreateKernelsInProgram(i64 %0, i64 %1, i32* %2, i64* %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 = ptrtoint i32* %2 to i64
%12 = trunc i64 %11 to i32
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
store i32 %12, i32* %13
%14 = ptrtoint i64* %3 to i64
%15 = trunc i64 %14 to i32
%16 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
store i32 %15, i32* %16
%17 = call i32 @syscall(i32 325, i32 1037, i32* %8)
ret i32 %17
}