#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 *, float);
int main(int argc, char **argv) {
  float a = 1.0f;
  float b = 100000000.0f;
  float c = -100000000.0f;
  float erg1, erg2;
  erg1 = (a + b);
  erg1 += c;
  erg2 = (b + c);
  erg2 += a;
  printf("erg1 = %.10f\n", erg1);
  printf("erg2 = %.10f\n", erg2);
  printf("(a + b) + c = %.10f\n", (a + b) + c);
  printf("a + (b + c) = %.10f\n", a + (b + c));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xeb8(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x1c(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x14(%rbp),%xmm0
addss  -0x24(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x20(%rbp),%xmm0
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
addss  -0x18(%rbp),%xmm0
addss  -0x1c(%rbp),%xmm0
lea    0xe67(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
addss  -0x1c(%rbp),%xmm1
addss  %xmm1,%xmm0
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
movss  0xed1(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
movss  0xeae(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"erg1 = %.10f\0A\00"
@.str.1 = [14 x i8] c"erg2 = %.10f\0A\00"
@.str.2 = [21 x i8] c"(a + b) + c = %.10f\0A\00"
@.str.3 = [21 x i8] c"a + (b + c) = %.10f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 1.000000e+00, float* %6
store float 1.000000e+08, float* %7
store float -1.000000e+08, float* %8
%11 = load float, float* %6
%12 = load float, float* %7
%13 = fadd float %11, %12
store float %13, float* %9
%14 = load float, float* %8
%15 = load float, float* %9
%16 = fadd float %15, %14
store float %16, float* %9
%17 = load float, float* %7
%18 = load float, float* %8
%19 = fadd float %17, %18
store float %19, float* %10
%20 = load float, float* %6
%21 = load float, float* %10
%22 = fadd float %21, %20
store float %22, float* %10
%23 = load float, float* %9
%24 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float %23)
%25 = load float, float* %10
%26 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), float %25)
%27 = load float, float* %6
%28 = load float, float* %7
%29 = fadd float %27, %28
%30 = load float, float* %8
%31 = fadd float %29, %30
%32 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), float %31)
%33 = load float, float* %6
%34 = load float, float* %7
%35 = load float, float* %8
%36 = fadd float %34, %35
%37 = fadd float %33, %36
%38 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), float %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"erg1 = %.10f\0A\00"
@.str.1 = [14 x i8] c"erg2 = %.10f\0A\00"
@.str.2 = [21 x i8] c"(a + b) + c = %.10f\0A\00"
@.str.3 = [21 x i8] c"a + (b + c) = %.10f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), float 0.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), float 1.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), float 0.000000e+00)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), float 1.000000e+00)
ret i32 0
}