#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);
int main() {
  int i = 1;
  float u = 1;
  double v = 1;
  do {
    i++;
    u /= 2;
  } while (1 + u > 1);
  printf("%d\n", i);
  do {
    i++;
    v /= 2;
  } while (1 + v > 1);
  printf("%d\n", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movss  0xee2(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xebe(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xea9(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  0xe9c(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1140 <main+0x30>
mov    -0x8(%rbp),%esi
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe66(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe4d(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  0xe40(%rip),%xmm1
ucomisd %xmm1,%xmm0
ja     118c <main+0x7c>
mov    -0x8(%rbp),%esi
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x19,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4e,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 25)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 78)
ret i32 0
}