#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);
main() {
  float a = 4, b = 1;
  a = a / b;
  b += 2;
  while (a >= 3.1416) {
    a = a - (4 / b);
    b += 2;
    a = a + (4 / b);
    b += 2;
  }
  printf("%.4f", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xee1(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xeb0(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11d4 <main+0xc4>
movss  -0x8(%rbp),%xmm0
movss  0xe86(%rip),%xmm1
divss  -0xc(%rbp),%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe68(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe59(%rip),%xmm1
divss  -0xc(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe3b(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    115a <main+0x4a>
movss  -0x8(%rbp),%xmm0
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xee7(%rip),%xmm0
movss  0xee3(%rip),%xmm5
movss  0xedf(%rip),%xmm1
movaps 0xee0(%rip),%xmm2
movsd  0xee8(%rip),%xmm3
movaps %xmm5,%xmm4
nopl   0x0(%rax,%rax,1)
addss  %xmm1,%xmm4
unpcklps %xmm4,%xmm5
movaps %xmm0,%xmm6
movaps %xmm2,%xmm0
divps  %xmm5,%xmm0
subss  %xmm0,%xmm6
shufps $0x55,%xmm0,%xmm0
addss  %xmm6,%xmm0
addss  %xmm1,%xmm4
xorps  %xmm5,%xmm5
cvtss2sd %xmm0,%xmm5
ucomisd %xmm3,%xmm5
movaps %xmm4,%xmm5
jae    1140 <main+0x30>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%.4f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
store i32 0, i32* %1
store float 4.000000e+00, float* %2
store float 1.000000e+00, float* %3
%4 = load float, float* %2
%5 = load float, float* %3
%6 = fdiv float %4, %5
store float %6, float* %2
%7 = load float, float* %3
%8 = fadd float %7, 2.000000e+00
store float %8, float* %3
br label %9
9: ; preds = %13, %0
%10 = load float, float* %2
%11 = fpext float %10 to double
%12 = fcmp oge double %11, 3.141600e+00
br i1 %12, label %13, label %26
13: ; preds = %9
%14 = load float, float* %2
%15 = load float, float* %3
%16 = fdiv float 4.000000e+00, %15
%17 = fsub float %14, %16
store float %17, float* %2
%18 = load float, float* %3
%19 = fadd float %18, 2.000000e+00
store float %19, float* %3
%20 = load float, float* %2
%21 = load float, float* %3
%22 = fdiv float 4.000000e+00, %21
%23 = fadd float %20, %22
store float %23, float* %2
%24 = load float, float* %3
%25 = fadd float %24, 2.000000e+00
store float %25, float* %3
br label %9
26: ; preds = %9
%27 = load float, float* %2
%28 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%.4f\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi float [ 3.000000e+00, %0 ], [ %12, %1 ]
%3 = phi float [ 4.000000e+00, %0 ], [ %11, %1 ]
%4 = fadd float %2, 2.000000e+00
%5 = insertelement <2 x float> poison, float %2, i64 0
%6 = insertelement <2 x float> %5, float %4, i64 1
%7 = fdiv <2 x float> <float 4.000000e+00, float 4.000000e+00>, %6
%8 = extractelement <2 x float> %7, i64 0
%9 = fsub float %3, %8
%10 = extractelement <2 x float> %7, i64 1
%11 = fadd float %9, %10
%12 = fadd float %4, 2.000000e+00
%13 = fpext float %11 to double
%14 = fcmp ult double %13, 3.141600e+00
br i1 %14, label %15, label %1
15: ; preds = %1
%16 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), float %11)
ret i32 0
}