#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 *, ...);
int main() {
  int N, cont;
  double C;
  scanf(" %d", &N);
  while (N > 0) {
    cont = 0;
    scanf(" %lf", &C);
    while (C > 1) {
      C /= 2;
      cont++;
    }
    printf("%d dias\n", cont);
    N--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jle    11bc <main+0x9c>
movl   $0x0,-0xc(%rbp)
lea    0xebb(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe8f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    119f <main+0x7f>
movsd  -0x18(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <main+0x44>
mov    -0xc(%rbp),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1141 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xedf(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11c5 <main+0xa5>
lea    0xec5(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xebe(%rip),%rbx
jmp    117a <main+0x5a>
nopl   (%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0xc(%rsp)
cmp    $0x1,%eax
jle    11c5 <main+0xa5>
xor    %ebp,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0xe69(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1160 <main+0x40>
xor    %ebp,%ebp
movsd  0xe61(%rip),%xmm2
nopw   0x0(%rax,%rax,1)
mulsd  %xmm2,%xmm0
add    $0x1,%ebp
ucomisd %xmm1,%xmm0
ja     11b0 <main+0x90>
movsd  %xmm0,0x10(%rsp)
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c" %d\00"
@.str.1 = [5 x i8] c" %lf\00"
@.str.2 = [9 x i8] c"%d dias\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = bitcast i32* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %25
8: ; preds = %0, %19
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), double* %2)
%10 = load double, double* %2
%11 = fcmp ogt double %10, 1.000000e+00
br i1 %11, label %12, label %19
12: ; preds = %8, %12
%13 = phi i32 [ %16, %12 ], [ 0, %8 ]
%14 = phi double [ %15, %12 ], [ %10, %8 ]
%15 = fmul double %14, 5.000000e-01
%16 = add nuw nsw i32 %13, 1
%17 = fcmp ogt double %15, 1.000000e+00
br i1 %17, label %12, label %18
18: ; preds = %12
store double %15, double* %2
br label %19
19: ; preds = %18, %8
%20 = phi i32 [ %16, %18 ], [ 0, %8 ]
%21 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %1
%23 = add nsw i32 %22, -1
store i32 %23, i32* %1
%24 = icmp sgt i32 %22, 1
br i1 %24, label %8, label %25
25: ; preds = %19, %0
ret i32 0
}