#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*/ scanf(char *, int *, ...);
int main() {
  int a, b, r, day = 0, cou, i;
  double c, d;
  scanf("%d", &cou);
  for (i = 0; i < cou; i++) {
    scanf("%d%d%lf%lf", &a, &b, &c, &d);
    day = 0;
    while (a <= b) {
      r = (a * c) / 100;
      a += r;
      r = (b * d) / 100;
      b += r;
      day++;
    }
    if (day > 100) {
      printf("Mais de 1 seculo.\n");
    } else
      printf("%d anos.\n", day);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xecb(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1227 <main+0x107>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x28(%rbp),%rcx
lea    -0x30(%rbp),%r8
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11e6 <main+0xc6>
cvtsi2sdl -0x8(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  0xe62(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xe3c(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1180 <main+0x60>
cmpl   $0x64,-0x14(%rbp)
jle    1203 <main+0xe3>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1214 <main+0xf4>
mov    -0x14(%rbp),%esi
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1219 <main+0xf9>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    123a <main+0x10a>
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0x20(%rsp),%r13
lea    0x18(%rsp),%rbx
xor    %r14d,%r14d
jmp    11a2 <main+0x72>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
lea    0xe94(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14d
cmp    0xc(%rsp),%r14d
jge    123a <main+0x10a>
xor    %ebp,%ebp
lea    0xe68(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
cmp    %ecx,%eax
jg     1183 <main+0x53>
movd   %ecx,%xmm1
movd   %eax,%xmm0
punpckldq %xmm1,%xmm0
movsd  0x20(%rsp),%xmm1
movhpd 0x18(%rsp),%xmm1
mov    $0xffffffff,%ebp
movapd 0xe11(%rip),%xmm3
nop
cvtdq2pd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm3,%xmm2
cvttpd2dq %xmm2,%xmm2
paddd  %xmm2,%xmm0
movd   %xmm0,%eax
pshufd $0x55,%xmm0,%xmm2
movd   %xmm2,%ecx
add    $0x1,%ebp
cmp    %ecx,%eax
jle    11f0 <main+0xc0>
mov    %eax,0x14(%rsp)
mov    %ecx,0x10(%rsp)
cmp    $0x64,%ebp
jb     1180 <main+0x50>
lea    0xdf8(%rip),%rdi
call   1030 <puts@plt>
jmp    1193 <main+0x63>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"%d%d%lf%lf\00"
@.str.2 = [19 x i8] c"Mais de 1 seculo.\0A\00"
@.str.3 = [10 x i8] c"%d anos.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
store i32 0, i32* %1
store i32 0, i32* %5
%10 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %6)
store i32 0, i32* %7
br label %11
11: ; preds = %51, %0
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %54
15: ; preds = %11
%16 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, double* %8, double* %9)
store i32 0, i32* %5
br label %17
17: ; preds = %21, %15
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = icmp sle i32 %18, %19
br i1 %20, label %21, label %42
21: ; preds = %17
%22 = load i32, i32* %2
%23 = sitofp i32 %22 to double
%24 = load double, double* %8
%25 = fmul double %23, %24
%26 = fdiv double %25, 1.000000e+02
%27 = fptosi double %26 to i32
store i32 %27, i32* %4
%28 = load i32, i32* %4
%29 = load i32, i32* %2
%30 = add nsw i32 %29, %28
store i32 %30, i32* %2
%31 = load i32, i32* %3
%32 = sitofp i32 %31 to double
%33 = load double, double* %9
%34 = fmul double %32, %33
%35 = fdiv double %34, 1.000000e+02
%36 = fptosi double %35 to i32
store i32 %36, i32* %4
%37 = load i32, i32* %4
%38 = load i32, i32* %3
%39 = add nsw i32 %38, %37
store i32 %39, i32* %3
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %17
42: ; preds = %17
%43 = load i32, i32* %5
%44 = icmp sgt i32 %43, 100
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %50
47: ; preds = %42
%48 = load i32, i32* %5
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %47, %45
br label %51
51: ; preds = %50
%52 = load i32, i32* %7
%53 = add nsw i32 %52, 1
store i32 %53, i32* %7
br label %11
54: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [11 x i8] c"%d%d%lf%lf\00"
@.str.3 = [10 x i8] c"%d anos.\0A\00"
@str = [18 x i8] c"Mais de 1 seculo.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast i32* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast double* %5 to i8*
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %50
14: ; preds = %0, %46
%15 = phi i32 [ %47, %46 ], [ 0, %0 ]
%16 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, double* %4, double* %5)
%17 = load i32, i32* %1
%18 = load i32, i32* %2
%19 = icmp sgt i32 %17, %18
br i1 %19, label %43, label %20
20: ; preds = %14
%21 = load double, double* %4
%22 = load double, double* %5
%23 = insertelement <2 x i32> poison, i32 %17, i64 0
%24 = insertelement <2 x i32> %23, i32 %18, i64 1
%25 = insertelement <2 x double> poison, double %21, i64 0
%26 = insertelement <2 x double> %25, double %22, i64 1
br label %27
27: ; preds = %20, %27
%28 = phi i32 [ 0, %20 ], [ %35, %27 ]
%29 = phi <2 x i32> [ %24, %20 ], [ %34, %27 ]
%30 = sitofp <2 x i32> %29 to <2 x double>
%31 = fmul <2 x double> %26, %30
%32 = fdiv <2 x double> %31, <double 1.000000e+02, double 1.000000e+02>
%33 = fptosi <2 x double> %32 to <2 x i32>
%34 = add nsw <2 x i32> %29, %33
%35 = add nuw nsw i32 %28, 1
%36 = extractelement <2 x i32> %34, i64 0
%37 = extractelement <2 x i32> %34, i64 1
%38 = icmp sgt i32 %36, %37
br i1 %38, label %39, label %27
39: ; preds = %27
store i32 %36, i32* %1
store i32 %37, i32* %2
%40 = icmp ugt i32 %28, 99
br i1 %40, label %41, label %43
41: ; preds = %39
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %46
43: ; preds = %14, %39
%44 = phi i32 [ %35, %39 ], [ 0, %14 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %44)
br label %46
46: ; preds = %41, %43
%47 = add nuw nsw i32 %15, 1
%48 = load i32, i32* %3
%49 = icmp slt i32 %47, %48
br i1 %49, label %14, label %50
50: ; preds = %46, %0
ret i32 0
}