#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 *, ...);
int /*<<< orphan*/ sub(int);
int main() {
  float e = 1, w, a = 0.6, b = a + a;
  int i = 0;
  do {
    i++;
    e /= 2;
    w = 1 + e;
    printf("%2d:", i);
    sub(e);
    printf("  w");
    sub(w);
  } while (w > 1);
  if (b == 1.2f) {
    printf("same\n");
  } else {
    printf("diff\n");
  }
  sub(a);
  sub(0.6);
  sub(b);
  sub(0.6 * 2);
  sub(2 * a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xecd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe93(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe7e(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvttss2si -0x8(%rbp),%edi
call   1040 <sub@plt>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvttss2si -0xc(%rbp),%edi
call   1040 <sub@plt>
movss  -0xc(%rbp),%xmm0
movss  0xe34(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     115f <main+0x3f>
movss  -0x14(%rbp),%xmm0
movss  0xe26(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1208 <main+0xe8>
jp     1208 <main+0xe8>
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1216 <main+0xf6>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvttss2si -0x10(%rbp),%edi
call   1040 <sub@plt>
xor    %edi,%edi
call   1040 <sub@plt>
cvttss2si -0x14(%rbp),%edi
call   1040 <sub@plt>
mov    $0x1,%edi
call   1040 <sub@plt>
movss  0xdc5(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1040 <sub@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movss  0xebf(%rip),%xmm0
mov    $0x1,%ebx
lea    0xebb(%rip),%r14
lea    0xeb9(%rip),%r15
movss  %xmm0,0x8(%rsp)
nopw   0x0(%rax,%rax,1)
movss  0x8(%rsp),%xmm0
mulss  0xe96(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
addss  0xe84(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cvttss2si 0x8(%rsp),%edi
call   1050 <sub@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cvttss2si 0xc(%rsp),%edi
call   1050 <sub@plt>
add    $0x1,%ebx
cmp    $0x19,%ebx
jne    1160 <main+0x30>
lea    0xe54(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <sub@plt>
xor    %edi,%edi
call   1050 <sub@plt>
mov    $0x1,%edi
call   1050 <sub@plt>
mov    $0x1,%edi
call   1050 <sub@plt>
mov    $0x1,%edi
call   1050 <sub@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%2d:\00"
@.str.1 = [4 x i8] c" w\00"
@.str.2 = [6 x i8] c"same\0A\00"
@.str.3 = [6 x i8] c"diff\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store i32 0, i32* %1
store float 1.000000e+00, float* %2
store float 0x3FE3333340000000, float* %4
%7 = load float, float* %4
%8 = load float, float* %4
%9 = fadd float %7, %8
store float %9, float* %5
store i32 0, i32* %6
br label %10
10: ; preds = %26, %0
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
store i32 %12, i32* %6
%13 = load float, float* %2
%14 = fdiv float %13, 2.000000e+00
store float %14, float* %2
%15 = load float, float* %2
%16 = fadd float 1.000000e+00, %15
store float %16, float* %3
%17 = load i32, i32* %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load float, float* %2
%20 = fptosi float %19 to i32
%21 = call i32 @sub(i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%23 = load float, float* %3
%24 = fptosi float %23 to i32
%25 = call i32 @sub(i32 %24)
br label %26
26: ; preds = %10
%27 = load float, float* %3
%28 = fcmp ogt float %27, 1.000000e+00
br i1 %28, label %10, label %29
29: ; preds = %26
%30 = load float, float* %5
%31 = fcmp oeq float %30, 0x3FF3333340000000
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %36
34: ; preds = %29
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
%37 = load float, float* %4
%38 = fptosi float %37 to i32
%39 = call i32 @sub(i32 %38)
%40 = call i32 @sub(i32 0)
%41 = load float, float* %5
%42 = fptosi float %41 to i32
%43 = call i32 @sub(i32 %42)
%44 = call i32 @sub(i32 1)
%45 = load float, float* %4
%46 = fmul float 2.000000e+00, %45
%47 = fptosi float %46 to i32
%48 = call i32 @sub(i32 %47)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2d:\00"
@.str.1 = [4 x i8] c" w\00"
@str = [5 x i8] c"same\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi float [ 1.000000e+00, %0 ], [ %5, %1 ]
%3 = phi i32 [ 0, %0 ], [ %4, %1 ]
%4 = add nuw nsw i32 %3, 1
%5 = fmul float %2, 5.000000e-01
%6 = fadd float %5, 1.000000e+00
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %4)
%8 = fptosi float %5 to i32
%9 = tail call i32 @sub(i32 %8)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = fptosi float %6 to i32
%12 = tail call i32 @sub(i32 %11)
%13 = icmp eq i32 %4, 24
br i1 %13, label %14, label %1
14: ; preds = %1
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%16 = tail call i32 @sub(i32 0)
%17 = tail call i32 @sub(i32 0)
%18 = tail call i32 @sub(i32 1)
%19 = tail call i32 @sub(i32 1)
%20 = tail call i32 @sub(i32 1)
ret i32 0
}