#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 */
struct tcmi_rpc {
  int dummy;
};

/* Variables and functions */
long tcmi_rpc_do(struct tcmi_rpc *, unsigned int, long *);
long tcmi_rpc_call3(struct tcmi_rpc *self, unsigned int rpc_num, long param1,
                    long param2, long param3) {
  long parameters[6] = {0, 0, 0, 0, 0, 0};
  parameters[0] = param1;
  parameters[1] = param2;
  parameters[2] = param3;
  return tcmi_rpc_do(self, rpc_num, parameters);
}


x86 assembly (clang, -O0):
<tcmi_rpc_call3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x60(%rbp),%rdx
call   1040 <tcmi_rpc_do@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcmi_rpc_call3>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x20(%rsp)
mov    %rdx,(%rsp)
mov    %rcx,0x8(%rsp)
mov    %r8,0x10(%rsp)
mov    %rsp,%rdx
call   1030 <tcmi_rpc_do@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
%struct.tcmi_rpc = type { i32 }
define i64 @tcmi_rpc_call3(%struct.tcmi_rpc* %0, i32 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca %struct.tcmi_rpc*
%7 = alloca i32
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca [6 x i64]
store %struct.tcmi_rpc* %0, %struct.tcmi_rpc** %6
store i32 %1, i32* %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i64 %4, i64* %10
%12 = bitcast [6 x i64]* %11 to i8*
%13 = load i64, i64* %8
%14 = getelementptr inbounds [6 x i64], [6 x i64]* %11, i64 0, i64 0
store i64 %13, i64* %14
%15 = load i64, i64* %9
%16 = getelementptr inbounds [6 x i64], [6 x i64]* %11, i64 0, i64 1
store i64 %15, i64* %16
%17 = load i64, i64* %10
%18 = getelementptr inbounds [6 x i64], [6 x i64]* %11, i64 0, i64 2
store i64 %17, i64* %18
%19 = load %struct.tcmi_rpc*, %struct.tcmi_rpc** %6
%20 = load i32, i32* %7
%21 = getelementptr inbounds [6 x i64], [6 x i64]* %11, i64 0, i64 0
%22 = call i64 @tcmi_rpc_do(%struct.tcmi_rpc* %19, i32 %20, i64* %21)
ret i64 %22
}

LLVM IR (-O2):
%struct.tcmi_rpc = type { i32 }
define i64 @tcmi_rpc_call3(%struct.tcmi_rpc* %0, i32 %1, i64 %2, i64 %3, i64 %4) {
%6 = alloca [6 x i64]
%7 = bitcast [6 x i64]* %6 to i8*
%8 = getelementptr inbounds [6 x i64], [6 x i64]* %6, i64 0, i64 2
%9 = bitcast i64* %8 to i8*
%10 = getelementptr inbounds [6 x i64], [6 x i64]* %6, i64 0, i64 0
store i64 %2, i64* %10
%11 = getelementptr inbounds [6 x i64], [6 x i64]* %6, i64 0, i64 1
store i64 %3, i64* %11
%12 = getelementptr inbounds [6 x i64], [6 x i64]* %6, i64 0, i64 2
store i64 %4, i64* %12
%13 = call i64 @tcmi_rpc_do(%struct.tcmi_rpc* %0, i32 %1, i64* %10)
ret i64 %13
}