int main(void) {
  volatile double d;
  volatile float f;
  double *dp = malloc(sizeof(double));
  float *fp = malloc(sizeof(float));
  int *ip = (int *)0x1234567;
  d += 1.0;
  f += 10.0;
  *dp += (d ? 2.0 : 3.0);
  *fp += (f ? 20.0 : 21.0);
  free(dp);
  free(fp);
  *dp += 3.0;
  *fp += 30.0;
  free(ip);
  ip = malloc(sizeof(int));
  *((double *)ip) = 1.2 + d;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
movq   $0x1234567,-0x30(%rbp)
01
movsd  -0x10(%rbp),%xmm0
movsd  0xeb8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm1
xorps  %xmm0,%xmm0
cmpneqsd %xmm1,%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
mov    %eax,%ecx
lea    0xe83(%rip),%rax
movsd  (%rax,%rcx,8),%xmm1
mov    -0x20(%rbp),%rax
movsd  (%rax),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax)
movss  -0x14(%rbp),%xmm1
xorps  %xmm0,%xmm0
cmpneqss %xmm1,%xmm0
movd   %xmm0,%eax
and    $0x1,%eax
mov    %eax,%ecx
lea    0xe61(%rip),%rax
movsd  (%rax,%rcx,8),%xmm1
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rax
movsd  0xdfe(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,(%rax)
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdda(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xda2(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movsd  %xmm0,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0x10(%rsp),%xmm0
addsd  0xede(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movss  0xc(%rsp),%xmm0
addss  0xed2(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
movsd  0x10(%rsp),%xmm0
movss  0xc(%rsp),%xmm0
mov    $0x1234567,%edi
call   1030 <free@plt>
movsd  0x10(%rsp),%xmm0
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca float
%4 = alloca double*
%5 = alloca float*
%6 = alloca i32*
store i32 0, i32* %1
%7 = call i8* @malloc(i64 8)
%8 = bitcast i8* %7 to double*
store double* %8, double** %4
%9 = call i8* @malloc(i64 4)
%10 = bitcast i8* %9 to float*
store float* %10, float** %5
store i32* inttoptr (i64 19088743 to i32*), i32** %6
%11 = load volatile double, double* %2
%12 = fadd double %11, 1.000000e+00
store volatile double %12, double* %2
%13 = load volatile float, float* %3
%14 = fpext float %13 to double
%15 = fadd double %14, 1.000000e+01
%16 = fptrunc double %15 to float
store volatile float %16, float* %3
%17 = load volatile double, double* %2
%18 = fcmp une double %17, 0.000000e+00
%19 = zext i1 %18 to i64
%20 = select i1 %18, double 2.000000e+00, double 3.000000e+00
%21 = load double*, double** %4
%22 = load double, double* %21
%23 = fadd double %22, %20
store double %23, double* %21
%24 = load volatile float, float* %3
%25 = fcmp une float %24, 0.000000e+00
%26 = zext i1 %25 to i64
%27 = select i1 %25, double 2.000000e+01, double 2.100000e+01
%28 = load float*, float** %5
%29 = load float, float* %28
%30 = fpext float %29 to double
%31 = fadd double %30, %27
%32 = fptrunc double %31 to float
store float %32, float* %28
%33 = load double*, double** %4
%34 = bitcast double* %33 to i8*
%35 = load float*, float** %5
%36 = bitcast float* %35 to i8*
%37 = load double*, double** %4
%38 = load double, double* %37
%39 = fadd double %38, 3.000000e+00
store double %39, double* %37
%40 = load float*, float** %5
%41 = load float, float* %40
%42 = fpext float %41 to double
%43 = fadd double %42, 3.000000e+01
%44 = fptrunc double %43 to float
store float %44, float* %40
%45 = load i32*, i32** %6
%46 = bitcast i32* %45 to i8*
%47 = call i8* @malloc(i64 4)
%48 = bitcast i8* %47 to i32*
store i32* %48, i32** %6
%49 = load volatile double, double* %2
%50 = fadd double 1.200000e+00, %49
%51 = load i32*, i32** %6
%52 = bitcast i32* %51 to double*
store double %50, double* %52
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca double
%2 = alloca float
%3 = bitcast double* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = load volatile double, double* %1
%6 = fadd double %5, 1.000000e+00
store volatile double %6, double* %1
%7 = load volatile float, float* %2
%8 = fadd float %7, 1.000000e+01
store volatile float %8, float* %2
%9 = load volatile double, double* %1
%10 = load volatile float, float* %2
tail call void @free(i8* inttoptr (i64 19088743 to i8*))
%11 = load volatile double, double* %1
ret i32 0
}