void mcsetstate(double x, double y, double z, double kx, double ky, double kz,
                double phi, double t, double Ex, double Ey, double Ez,
                double p) {
  extern double mcnx, mcny, mcnz, mcnkx, mcnky, mcnkz;
  extern double mcnphi, mcnt, mcnEx, mcnEy, mcnEz, mcnp;
  mcnx = x;
  mcny = y;
  mcnz = z;
  mcnkx = kx;
  mcnky = ky;
  mcnkz = kz;
  mcnphi = phi;
  mcnt = t;
  mcnEx = Ex;
  mcnEy = Ey;
  mcnEz = Ez;
  mcnp = p;
}


x86 assembly (clang, -O0):
<mcsetstate>:
push   %rbp
mov    %rsp,%rbp
movsd  0x28(%rbp),%xmm8
movsd  0x20(%rbp),%xmm8
movsd  0x18(%rbp),%xmm8
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    0x2e50(%rip),%rax
movsd  %xmm0,(%rax)
movsd  -0x10(%rbp),%xmm0
mov    0x2e60(%rip),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    0x2e28(%rip),%rax
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    0x2e50(%rip),%rax
movsd  %xmm0,(%rax)
movsd  -0x28(%rbp),%xmm0
mov    0x2e18(%rip),%rax
movsd  %xmm0,(%rax)
movsd  -0x30(%rbp),%xmm0
mov    0x2e28(%rip),%rax
movsd  %xmm0,(%rax)
movsd  -0x38(%rbp),%xmm0
mov    0x2e28(%rip),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    0x2dd0(%rip),%rax
movsd  %xmm0,(%rax)
movsd  0x10(%rbp),%xmm0
mov    0x2e18(%rip),%rax
movsd  %xmm0,(%rax)
movsd  0x18(%rbp),%xmm0
mov    0x2dd0(%rip),%rax
movsd  %xmm0,(%rax)
movsd  0x20(%rbp),%xmm0
mov    0x2df0(%rip),%rax
movsd  %xmm0,(%rax)
movsd  0x28(%rbp),%xmm0
mov    0x2d88(%rip),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcsetstate>:
movsd  0x20(%rsp),%xmm8
movsd  0x18(%rsp),%xmm9
movsd  0x10(%rsp),%xmm10
movsd  0x8(%rsp),%xmm11
mov    0x2e7d(%rip),%rax
movsd  %xmm0,(%rax)
mov    0x2e92(%rip),%rax
movsd  %xmm1,(%rax)
mov    0x2e5f(%rip),%rax
movsd  %xmm2,(%rax)
mov    0x2e8c(%rip),%rax
movsd  %xmm3,(%rax)
mov    0x2e59(%rip),%rax
movsd  %xmm4,(%rax)
mov    0x2e6e(%rip),%rax
movsd  %xmm5,(%rax)
mov    0x2e73(%rip),%rax
movsd  %xmm6,(%rax)
mov    0x2e20(%rip),%rax
movsd  %xmm7,(%rax)
mov    0x2e6d(%rip),%rax
movsd  %xmm11,(%rax)
mov    0x2e29(%rip),%rax
movsd  %xmm10,(%rax)
mov    0x2e4d(%rip),%rax
movsd  %xmm9,(%rax)
mov    0x2de9(%rip),%rax
movsd  %xmm8,(%rax)
ret

LLVM IR (-O0):
@mcnx = external global double
@mcny = external global double
@mcnz = external global double
@mcnkx = external global double
@mcnky = external global double
@mcnkz = external global double
@mcnphi = external global double
@mcnt = external global double
@mcnEx = external global double
@mcnEy = external global double
@mcnEz = external global double
@mcnp = external global double
define void @mcsetstate(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11) {
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
store double %0, double* %13
store double %1, double* %14
store double %2, double* %15
store double %3, double* %16
store double %4, double* %17
store double %5, double* %18
store double %6, double* %19
store double %7, double* %20
store double %8, double* %21
store double %9, double* %22
store double %10, double* %23
store double %11, double* %24
%25 = load double, double* %13
store double %25, double* @mcnx
%26 = load double, double* %14
store double %26, double* @mcny
%27 = load double, double* %15
store double %27, double* @mcnz
%28 = load double, double* %16
store double %28, double* @mcnkx
%29 = load double, double* %17
store double %29, double* @mcnky
%30 = load double, double* %18
store double %30, double* @mcnkz
%31 = load double, double* %19
store double %31, double* @mcnphi
%32 = load double, double* %20
store double %32, double* @mcnt
%33 = load double, double* %21
store double %33, double* @mcnEx
%34 = load double, double* %22
store double %34, double* @mcnEy
%35 = load double, double* %23
store double %35, double* @mcnEz
%36 = load double, double* %24
store double %36, double* @mcnp
ret void
}

LLVM IR (-O2):
@mcnx = external global double
@mcny = external global double
@mcnz = external global double
@mcnkx = external global double
@mcnky = external global double
@mcnkz = external global double
@mcnphi = external global double
@mcnt = external global double
@mcnEx = external global double
@mcnEy = external global double
@mcnEz = external global double
@mcnp = external global double
define void @mcsetstate(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double %9, double %10, double %11) {
store double %0, double* @mcnx
store double %1, double* @mcny
store double %2, double* @mcnz
store double %3, double* @mcnkx
store double %4, double* @mcnky
store double %5, double* @mcnkz
store double %6, double* @mcnphi
store double %7, double* @mcnt
store double %8, double* @mcnEx
store double %9, double* @mcnEy
store double %10, double* @mcnEz
store double %11, double* @mcnp
ret void
}