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

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_program clCreateProgramWithSource(cl_context context, cl_uint count,
                                     const char **strings,
                                     const size_t *lengths,
                                     cl_int *errcode_ret) {
  unsigned int sys_args[5];
  sys_args[0] = (unsigned int)context;
  sys_args[1] = (unsigned int)count;
  sys_args[2] = (unsigned int)strings;
  sys_args[3] = (unsigned int)lengths;
  sys_args[4] = (unsigned int)errcode_ret;
  return (cl_program)syscall(325, 1028, sys_args);
}


x86 assembly (clang, -O0):
<clCreateProgramWithSource>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,-0x34(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,-0x30(%rbp)
lea    -0x40(%rbp),%rdx
mov    $0x145,%edi
mov    $0x404,%esi
call   1030 <syscall@plt>
add    $0x40,%rsp
pop    %rbp
ret

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

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

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