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

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, float);
void testLocalDouble() {
  double d[3];
  float m[12];
  m[0] = 1.0f;
  m[1] = 2.0f;
  d[0] = 1.0;
  d[1] = 2.0;
  d[2] = d[0] + d[1];
  m[2] = m[0] + m[1];
  printf("localDouble: %g %g\n", d[2], m[2]);
}


x86 assembly (clang, -O0):
<testLocalDouble>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x50(%rbp)
movss  0xee3(%rip),%xmm0
movss  %xmm0,-0x4c(%rbp)
movsd  0xece(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeb9(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x50(%rbp),%xmm0
addss  -0x4c(%rbp),%xmm0
movss  %xmm0,-0x48(%rbp)
movsd  -0x10(%rbp),%xmm0
movss  -0x48(%rbp),%xmm1
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testLocalDouble>:
lea    0xef5(%rip),%rdi
movsd  0xee1(%rip),%xmm0
movss  0xee1(%rip),%xmm1
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"localDouble: %g %g\0A\00"
define void @testLocalDouble() {
%1 = alloca [3 x double]
%2 = alloca [12 x float]
%3 = getelementptr inbounds [12 x float], [12 x float]* %2, i64 0, i64 0
store float 1.000000e+00, float* %3
%4 = getelementptr inbounds [12 x float], [12 x float]* %2, i64 0, i64 1
store float 2.000000e+00, float* %4
%5 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
store double 1.000000e+00, double* %5
%6 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
store double 2.000000e+00, double* %6
%7 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 0
%8 = load double, double* %7
%9 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 1
%10 = load double, double* %9
%11 = fadd double %8, %10
%12 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
store double %11, double* %12
%13 = getelementptr inbounds [12 x float], [12 x float]* %2, i64 0, i64 0
%14 = load float, float* %13
%15 = getelementptr inbounds [12 x float], [12 x float]* %2, i64 0, i64 1
%16 = load float, float* %15
%17 = fadd float %14, %16
%18 = getelementptr inbounds [12 x float], [12 x float]* %2, i64 0, i64 2
store float %17, float* %18
%19 = getelementptr inbounds [3 x double], [3 x double]* %1, i64 0, i64 2
%20 = load double, double* %19
%21 = getelementptr inbounds [12 x float], [12 x float]* %2, i64 0, i64 2
%22 = load float, float* %21
%23 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %20, float %22)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"localDouble: %g %g\0A\00"
define void @testLocalDouble() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double 3.000000e+00, float 3.000000e+00)
ret void
}