#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_mem;
typedef int /*<<< orphan*/ cl_int;
typedef int /*<<< orphan*/ cl_event;
typedef scalar_t__ cl_command_queue;

/* Variables and functions */
int /*<<< orphan*/ syscall(int, int, unsigned int *);
cl_int clEnqueueCopyBufferRect(
    cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer,
    const size_t *src_origin, const size_t *dst_origin, const size_t *region,
    size_t src_row_pitch, size_t src_slice_pitch, size_t dst_row_pitch,
    size_t dst_slice_pitch, cl_uint num_events_in_wait_list,
    const cl_event *event_wait_list, cl_event *event) {
  unsigned int sys_args[13];
  sys_args[0] = (unsigned int)command_queue;
  sys_args[1] = (unsigned int)src_buffer;
  sys_args[2] = (unsigned int)dst_buffer;
  sys_args[3] = (unsigned int)src_origin;
  sys_args[4] = (unsigned int)dst_origin;
  sys_args[5] = (unsigned int)region;
  sys_args[6] = (unsigned int)src_row_pitch;
  sys_args[7] = (unsigned int)src_slice_pitch;
  sys_args[8] = (unsigned int)dst_row_pitch;
  sys_args[9] = (unsigned int)dst_slice_pitch;
  sys_args[10] = (unsigned int)num_events_in_wait_list;
  sys_args[11] = (unsigned int)event_wait_list;
  sys_args[12] = (unsigned int)event;
  return (cl_int)syscall(325, 1058, sys_args);
}


x86 assembly (clang, -O0):
<clEnqueueCopyBufferRect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x6c(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,-0x68(%rbp)
mov    -0x20(%rbp),%rax
mov    %eax,-0x64(%rbp)
mov    -0x28(%rbp),%rax
mov    %eax,-0x60(%rbp)
mov    -0x30(%rbp),%rax
mov    %eax,-0x5c(%rbp)
mov    0x10(%rbp),%rax
mov    %eax,-0x58(%rbp)
mov    0x18(%rbp),%rax
mov    %eax,-0x54(%rbp)
mov    0x20(%rbp),%rax
mov    %eax,-0x50(%rbp)
mov    0x28(%rbp),%rax
mov    %eax,-0x4c(%rbp)
mov    0x30(%rbp),%rax
mov    %eax,-0x48(%rbp)
mov    0x38(%rbp),%rax
mov    %eax,-0x44(%rbp)
mov    0x40(%rbp),%rax
mov    %eax,-0x40(%rbp)
lea    -0x70(%rbp),%rdx
mov    $0x145,%edi
mov    $0x422,%esi
call   1030 <syscall@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clEnqueueCopyBufferRect>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    0x90(%rsp),%r10d
mov    0x88(%rsp),%r11d
mov    0x80(%rsp),%r14d
mov    0x78(%rsp),%r15d
mov    0x70(%rsp),%ebp
mov    0x68(%rsp),%eax
mov    0x60(%rsp),%ebx
mov    %edi,(%rsp)
mov    %esi,0x4(%rsp)
mov    %edx,0x8(%rsp)
mov    %ecx,0xc(%rsp)
mov    %r8d,0x10(%rsp)
mov    %r9d,0x14(%rsp)
mov    %ebx,0x18(%rsp)
mov    %eax,0x1c(%rsp)
mov    %ebp,0x20(%rsp)
mov    %r15d,0x24(%rsp)
mov    %r14d,0x28(%rsp)
mov    %r11d,0x2c(%rsp)
mov    %r10d,0x30(%rsp)
mov    %rsp,%rdx
mov    $0x145,%edi
mov    $0x422,%esi
call   1030 <syscall@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @clEnqueueCopyBufferRect(i64 %0, i64 %1, i64 %2, i64* %3, i64* %4, i64* %5, i64 %6, i64 %7, i64 %8, i64 %9, i64 %10, i32* %11, i32* %12) {
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64*
%18 = alloca i64*
%19 = alloca i64*
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
%23 = alloca i64
%24 = alloca i64
%25 = alloca i32*
%26 = alloca i32*
%27 = alloca [13 x i32]
store i64 %0, i64* %14
store i64 %1, i64* %15
store i64 %2, i64* %16
store i64* %3, i64** %17
store i64* %4, i64** %18
store i64* %5, i64** %19
store i64 %6, i64* %20
store i64 %7, i64* %21
store i64 %8, i64* %22
store i64 %9, i64* %23
store i64 %10, i64* %24
store i32* %11, i32** %25
store i32* %12, i32** %26
%28 = load i64, i64* %14
%29 = trunc i64 %28 to i32
%30 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 0
store i32 %29, i32* %30
%31 = load i64, i64* %15
%32 = trunc i64 %31 to i32
%33 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 1
store i32 %32, i32* %33
%34 = load i64, i64* %16
%35 = trunc i64 %34 to i32
%36 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 2
store i32 %35, i32* %36
%37 = load i64*, i64** %17
%38 = ptrtoint i64* %37 to i32
%39 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 3
store i32 %38, i32* %39
%40 = load i64*, i64** %18
%41 = ptrtoint i64* %40 to i32
%42 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 4
store i32 %41, i32* %42
%43 = load i64*, i64** %19
%44 = ptrtoint i64* %43 to i32
%45 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 5
store i32 %44, i32* %45
%46 = load i64, i64* %20
%47 = trunc i64 %46 to i32
%48 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 6
store i32 %47, i32* %48
%49 = load i64, i64* %21
%50 = trunc i64 %49 to i32
%51 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 7
store i32 %50, i32* %51
%52 = load i64, i64* %22
%53 = trunc i64 %52 to i32
%54 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 8
store i32 %53, i32* %54
%55 = load i64, i64* %23
%56 = trunc i64 %55 to i32
%57 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 9
store i32 %56, i32* %57
%58 = load i64, i64* %24
%59 = trunc i64 %58 to i32
%60 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 10
store i32 %59, i32* %60
%61 = load i32*, i32** %25
%62 = ptrtoint i32* %61 to i32
%63 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 11
store i32 %62, i32* %63
%64 = load i32*, i32** %26
%65 = ptrtoint i32* %64 to i32
%66 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 12
store i32 %65, i32* %66
%67 = getelementptr inbounds [13 x i32], [13 x i32]* %27, i64 0, i64 0
%68 = call i32 @syscall(i32 325, i32 1058, i32* %67)
ret i32 %68
}

LLVM IR (-O2):
define i32 @clEnqueueCopyBufferRect(i64 %0, i64 %1, i64 %2, i64* %3, i64* %4, i64* %5, i64 %6, i64 %7, i64 %8, i64 %9, i64 %10, i32* %11, i32* %12) {
%14 = alloca [13 x i32]
%15 = bitcast [13 x i32]* %14 to i8*
%16 = trunc i64 %0 to i32
%17 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 0
store i32 %16, i32* %17
%18 = trunc i64 %1 to i32
%19 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 1
store i32 %18, i32* %19
%20 = trunc i64 %2 to i32
%21 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 2
store i32 %20, i32* %21
%22 = ptrtoint i64* %3 to i64
%23 = trunc i64 %22 to i32
%24 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 3
store i32 %23, i32* %24
%25 = ptrtoint i64* %4 to i64
%26 = trunc i64 %25 to i32
%27 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 4
store i32 %26, i32* %27
%28 = ptrtoint i64* %5 to i64
%29 = trunc i64 %28 to i32
%30 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 5
store i32 %29, i32* %30
%31 = trunc i64 %6 to i32
%32 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 6
store i32 %31, i32* %32
%33 = trunc i64 %7 to i32
%34 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 7
store i32 %33, i32* %34
%35 = trunc i64 %8 to i32
%36 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 8
store i32 %35, i32* %36
%37 = trunc i64 %9 to i32
%38 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 9
store i32 %37, i32* %38
%39 = trunc i64 %10 to i32
%40 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 10
store i32 %39, i32* %40
%41 = ptrtoint i32* %11 to i64
%42 = trunc i64 %41 to i32
%43 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 11
store i32 %42, i32* %43
%44 = ptrtoint i32* %12 to i64
%45 = trunc i64 %44 to i32
%46 = getelementptr inbounds [13 x i32], [13 x i32]* %14, i64 0, i64 12
store i32 %45, i32* %46
%47 = call i32 @syscall(i32 325, i32 1058, i32* %17)
ret i32 %47
}