#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 /*<<< orphan*/ scanf(char *, float *);
int main() {
  float x, a, g;
  scanf("%f", &a);
  scanf("%f", &x);
  g = a + x;
  printf("g1 = %f\n", g);
  g = a + x * a;
  printf("g2 = %f\n", g);
  g = (a + x) * a;
  printf("g3 = %f\n", g);
  g = (a + x) / 3.5f;
  printf("g4 = %f\n", g);
  g = (a + x) / (2 + a);
  printf("g5 = %f\n", g);
  g /= 10;
  printf("g6 = %f\n", g);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed6(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe65(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xe35(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  0xe05(%rip),%xmm1
addss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xdd5(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xdfc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee0(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
mulss  %xmm1,%xmm0
addss  %xmm1,%xmm0
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
addss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
addss  0x8(%rsp),%xmm0
divss  0xe4e(%rip),%xmm0
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  0x8(%rsp),%xmm0
addss  %xmm1,%xmm0
addss  0xe2e(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,0xc(%rsp)
lea    0xe4c(%rip),%rdi
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
divss  0xe0e(%rip),%xmm0
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [9 x i8] c"g1 = %f\0A\00"
@.str.2 = [9 x i8] c"g2 = %f\0A\00"
@.str.3 = [9 x i8] c"g3 = %f\0A\00"
@.str.4 = [9 x i8] c"g4 = %f\0A\00"
@.str.5 = [9 x i8] c"g5 = %f\0A\00"
@.str.6 = [9 x i8] c"g6 = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%7 = load float, float* %3
%8 = load float, float* %2
%9 = fadd float %7, %8
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float %10)
%12 = load float, float* %3
%13 = load float, float* %2
%14 = load float, float* %3
%15 = call float @llvm.fmuladd.f32(float %13, float %14, float %12)
store float %15, float* %4
%16 = load float, float* %4
%17 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), float %16)
%18 = load float, float* %3
%19 = load float, float* %2
%20 = fadd float %18, %19
%21 = load float, float* %3
%22 = fmul float %20, %21
store float %22, float* %4
%23 = load float, float* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), float %23)
%25 = load float, float* %3
%26 = load float, float* %2
%27 = fadd float %25, %26
%28 = fdiv float %27, 3.500000e+00
store float %28, float* %4
%29 = load float, float* %4
%30 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), float %29)
%31 = load float, float* %3
%32 = load float, float* %2
%33 = fadd float %31, %32
%34 = load float, float* %3
%35 = fadd float 2.000000e+00, %34
%36 = fdiv float %33, %35
store float %36, float* %4
%37 = load float, float* %4
%38 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), float %37)
%39 = load float, float* %4
%40 = fdiv float %39, 1.000000e+01
store float %40, float* %4
%41 = load float, float* %4
%42 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), float %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [9 x i8] c"g1 = %f\0A\00"
@.str.2 = [9 x i8] c"g2 = %f\0A\00"
@.str.3 = [9 x i8] c"g3 = %f\0A\00"
@.str.4 = [9 x i8] c"g4 = %f\0A\00"
@.str.5 = [9 x i8] c"g5 = %f\0A\00"
@.str.6 = [9 x i8] c"g6 = %f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%7 = load float, float* %2
%8 = load float, float* %1
%9 = fadd float %7, %8
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float %9)
%11 = load float, float* %2
%12 = load float, float* %1
%13 = call float @llvm.fmuladd.f32(float %12, float %11, float %11)
%14 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), float %13)
%15 = load float, float* %2
%16 = load float, float* %1
%17 = fadd float %15, %16
%18 = fmul float %15, %17
%19 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), float %18)
%20 = load float, float* %2
%21 = load float, float* %1
%22 = fadd float %20, %21
%23 = fdiv float %22, 3.500000e+00
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), float %23)
%25 = load float, float* %2
%26 = load float, float* %1
%27 = fadd float %25, %26
%28 = fadd float %25, 2.000000e+00
%29 = fdiv float %27, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), float %29)
%31 = fdiv float %29, 1.000000e+01
%32 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), float %31)
ret i32 0
}