#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*/ buf;

/* Variables and functions */
int /*<<< orphan*/ send_cmd(int, char *, int);
void send_cmd_i3d1(int cmd_code, int arg1, int arg2, int arg3, double arg4) {
  struct {
    int ival[3];
    double dval;
  } buf;
  buf.ival[0] = arg1;
  buf.ival[1] = arg2;
  buf.ival[2] = arg3;
  buf.dval = arg4;
  send_cmd(cmd_code, (char *)&buf, sizeof(buf));
}


x86 assembly (clang, -O0):
<send_cmd_i3d1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    $0x18,%edx
call   1030 <send_cmd@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_cmd_i3d1>:
sub    $0x18,%rsp
mov    %esi,(%rsp)
mov    %edx,0x4(%rsp)
mov    %ecx,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
mov    %rsp,%rsi
mov    $0x18,%edx
call   1030 <send_cmd@plt>
add    $0x18,%rsp
ret

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

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