#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 /*<<< orphan*/ scanf(char *, double *);
int main() {
  double x, c;
  int b, i = 0;
  scanf("%lf", &x);
  while ((int)x / 2 != 0) {
    x = (int)x / 2;
    i++;
  }
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cvttsd2si -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1180 <main+0x60>
cvttsd2si -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1146 <main+0x26>
mov    -0x20(%rbp),%esi
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cvttsd2si (%rsp),%eax
lea    0x1(%rax),%ecx
xor    %esi,%esi
cmp    $0x3,%ecx
jb     116d <main+0x4d>
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %ecx,%eax
sar    %eax
add    $0x1,%esi
lea    0x1(%rax),%ecx
cmp    $0x2,%ecx
ja     1150 <main+0x30>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,(%rsp)
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %2)
br label %7
7: ; preds = %12, %0
%8 = load double, double* %2
%9 = fptosi double %8 to i32
%10 = sdiv i32 %9, 2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %19
12: ; preds = %7
%13 = load double, double* %2
%14 = fptosi double %13 to i32
%15 = sdiv i32 %14, 2
%16 = sitofp i32 %15 to double
store double %16, double* %2
%17 = load i32, i32* %5
%18 = add nsw i32 %17, 1
store i32 %18, i32* %5
br label %7
19: ; preds = %7
%20 = load i32, i32* %5
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%lf\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %1)
%4 = load double, double* %1
%5 = fptosi double %4 to i32
%6 = add i32 %5, 1
%7 = icmp ult i32 %6, 3
br i1 %7, label %17, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %11, %8 ], [ %5, %0 ]
%10 = phi i32 [ %12, %8 ], [ 0, %0 ]
%11 = sdiv i32 %9, 2
%12 = add nuw nsw i32 %10, 1
%13 = add nsw i32 %11, 1
%14 = icmp ult i32 %13, 3
br i1 %14, label %15, label %8
15: ; preds = %8
%16 = sitofp i32 %11 to double
store double %16, double* %1
br label %17
17: ; preds = %15, %0
%18 = phi i32 [ %12, %15 ], [ 0, %0 ]
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %18)
ret i32 0
}