#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 testsQtt;
  int aPopulation, bPopulation;
  double aPercentualGrowing, bPercentualGrowing;
  scanf("%d", &testsQtt);
  char results[testsQtt];
  int i, years;
  for (i = 0; i < testsQtt; i++) {
    scanf("%d %d %lf %lf", &aPopulation, &bPopulation, &aPercentualGrowing,
          &bPercentualGrowing);
    years = 0;
    while (aPopulation <= bPopulation) {
      years++;
      if (years > 100) {
        break;
      }
      aPopulation += (int)(aPopulation * aPercentualGrowing / 100);
      bPopulation += (int)(bPopulation * bPercentualGrowing / 100);
    }
    results[i] = years;
  }
  for (i = 0; i < testsQtt; i++) {
    if (results[i] > 100) {
      printf("Mais de 1 seculo.\n");
    } else {
      printf("%d anos.\n", results[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1226 <main+0x106>
lea    0xe8a(%rip),%rdi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x20(%rbp),%r8
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1208 <main+0xe8>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
cmpl   $0x64,-0x38(%rbp)
jle    11c3 <main+0xa3>
jmp    1208 <main+0xe8>
cvtsi2sdl -0xc(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe2b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe0b(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    119f <main+0x7f>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    %cl,%dl
movslq -0x34(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    116e <main+0x4e>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    128e <main+0x16e>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x64,%eax
jle    1261 <main+0x141>
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    127b <main+0x15b>
mov    -0x40(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1280 <main+0x160>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    122d <main+0x10d>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rsp,%r13
mov    -0x2c(%rbp),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    129b <main+0x16b>
mov    %r13,-0x40(%rbp)
lea    -0x30(%rbp),%r12
lea    -0x50(%rbp),%r13
lea    -0x48(%rbp),%rbx
xor    %r15d,%r15d
jmp    11b9 <main+0x89>
nopl   0x0(%rax)
movd   %xmm0,-0x34(%rbp)
pshufd $0x55,%xmm0,%xmm0
movd   %xmm0,-0x30(%rbp)
mov    $0x65,%eax
mov    %al,(%r14,%r15,1)
add    $0x1,%r15
movslq -0x2c(%rbp),%rax
cmp    %rax,%r15
jge    124e <main+0x11e>
lea    0xe53(%rip),%rdi
lea    -0x34(%rbp),%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1050 <scanf@plt>
movapd 0xe24(%rip),%xmm3
mov    -0x34(%rbp),%ecx
mov    -0x30(%rbp),%edx
mov    $0x0,%eax
cmp    %edx,%ecx
jg     11a4 <main+0x74>
movd   %edx,%xmm1
movd   %ecx,%xmm0
punpckldq %xmm1,%xmm0
movsd  -0x50(%rbp),%xmm1
movhpd -0x48(%rbp),%xmm1
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0xffffff9c,%eax
je     1190 <main+0x60>
cvtdq2pd %xmm0,%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm3,%xmm2
cvttpd2dq %xmm2,%xmm2
paddd  %xmm2,%xmm0
movd   %xmm0,%ecx
pshufd $0x55,%xmm0,%xmm2
movd   %xmm2,%edx
add    $0xffffffff,%eax
cmp    %edx,%ecx
jle    1210 <main+0xe0>
mov    %ecx,-0x34(%rbp)
mov    %edx,-0x30(%rbp)
neg    %eax
jmp    11a4 <main+0x74>
test   %eax,%eax
mov    -0x40(%rbp),%r13
jle    129b <main+0x16b>
lea    0xdce(%rip),%r15
lea    0xdbd(%rip),%r12
xor    %ebx,%ebx
jmp    1287 <main+0x157>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
cmp    %rax,%rbx
jge    129b <main+0x16b>
movsbl (%r14,%rbx,1),%esi
cmp    $0x65,%esi
jl     1270 <main+0x140>
mov    %r15,%rdi
call   1030 <puts@plt>
jmp    127a <main+0x14a>
mov    %r13,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%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 = [14 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 double
%6 = alloca double
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
store i8* %14, i8** %7
%15 = alloca i8, i64 %13
store i64 %13, i64* %8
store i32 0, i32* %9
br label %16
16: ; preds = %55, %0
%17 = load i32, i32* %9
%18 = load i32, i32* %2
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %58
20: ; preds = %16
%21 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, double* %5, double* %6)
store i32 0, i32* %10
br label %22
22: ; preds = %32, %20
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = icmp sle i32 %23, %24
br i1 %25, label %26, label %49
26: ; preds = %22
%27 = load i32, i32* %10
%28 = add nsw i32 %27, 1
store i32 %28, i32* %10
%29 = load i32, i32* %10
%30 = icmp sgt i32 %29, 100
br i1 %30, label %31, label %32
31: ; preds = %26
br label %49
32: ; preds = %26
%33 = load i32, i32* %3
%34 = sitofp i32 %33 to double
%35 = load double, double* %5
%36 = fmul double %34, %35
%37 = fdiv double %36, 1.000000e+02
%38 = fptosi double %37 to i32
%39 = load i32, i32* %3
%40 = add nsw i32 %39, %38
store i32 %40, i32* %3
%41 = load i32, i32* %4
%42 = sitofp i32 %41 to double
%43 = load double, double* %6
%44 = fmul double %42, %43
%45 = fdiv double %44, 1.000000e+02
%46 = fptosi double %45 to i32
%47 = load i32, i32* %4
%48 = add nsw i32 %47, %46
store i32 %48, i32* %4
br label %22
49: ; preds = %31, %22
%50 = load i32, i32* %10
%51 = trunc i32 %50 to i8
%52 = load i32, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %15, i64 %53
store i8 %51, i8* %54
br label %55
55: ; preds = %49
%56 = load i32, i32* %9
%57 = add nsw i32 %56, 1
store i32 %57, i32* %9
br label %16
58: ; preds = %16
store i32 0, i32* %9
br label %59
59: ; preds = %80, %58
%60 = load i32, i32* %9
%61 = load i32, i32* %2
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %83
63: ; preds = %59
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %15, i64 %65
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp sgt i32 %68, 100
br i1 %69, label %70, label %72
70: ; preds = %63
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
br label %79
72: ; preds = %63
%73 = load i32, i32* %9
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %15, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %77)
br label %79
79: ; preds = %72, %70
br label %80
80: ; preds = %79
%81 = load i32, i32* %9
%82 = add nsw i32 %81, 1
store i32 %82, i32* %9
br label %59
83: ; preds = %59
store i32 0, i32* %1
%84 = load i8*, i8** %7
%85 = load i32, i32* %1
ret i32 %85
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 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* %1)
%12 = load i32, i32* %1
%13 = zext i32 %12 to i64
%14 = call i8* @llvm.stacksave()
%15 = alloca i8, i64 %13
%16 = load i32, i32* %1
%17 = icmp sgt i32 %16, 0
br i1 %17, label %20, label %74
18: ; preds = %51
%19 = icmp sgt i32 %56, 0
br i1 %19, label %59, label %74
20: ; preds = %0, %51
%21 = phi i64 [ %55, %51 ], [ 0, %0 ]
%22 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, double* %4, double* %5)
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = icmp sgt i32 %23, %24
br i1 %25, label %51, label %26
26: ; preds = %20
%27 = load double, double* %4
%28 = load double, double* %5
%29 = insertelement <2 x i32> poison, i32 %23, i64 0
%30 = insertelement <2 x i32> %29, i32 %24, i64 1
%31 = insertelement <2 x double> poison, double %27, i64 0
%32 = insertelement <2 x double> %31, double %28, i64 1
br label %33
33: ; preds = %26, %38
%34 = phi i32 [ 0, %26 ], [ %36, %38 ]
%35 = phi <2 x i32> [ %30, %26 ], [ %43, %38 ]
%36 = add nuw nsw i32 %34, 1
%37 = icmp eq i32 %34, 100
br i1 %37, label %47, label %38
38: ; preds = %33
%39 = sitofp <2 x i32> %35 to <2 x double>
%40 = fmul <2 x double> %32, %39
%41 = fdiv <2 x double> %40, <double 1.000000e+02, double 1.000000e+02>
%42 = fptosi <2 x double> %41 to <2 x i32>
%43 = add nsw <2 x i32> %35, %42
%44 = extractelement <2 x i32> %43, i64 0
%45 = extractelement <2 x i32> %43, i64 1
%46 = icmp sgt i32 %44, %45
br i1 %46, label %50, label %33
47: ; preds = %33
%48 = extractelement <2 x i32> %35, i64 0
store i32 %48, i32* %2
%49 = extractelement <2 x i32> %35, i64 1
store i32 %49, i32* %3
br label %51
50: ; preds = %38
store i32 %44, i32* %2
store i32 %45, i32* %3
br label %51
51: ; preds = %50, %47, %20
%52 = phi i32 [ 101, %47 ], [ %36, %50 ], [ 0, %20 ]
%53 = trunc i32 %52 to i8
%54 = getelementptr inbounds i8, i8* %15, i64 %21
store i8 %53, i8* %54
%55 = add nuw nsw i64 %21, 1
%56 = load i32, i32* %1
%57 = sext i32 %56 to i64
%58 = icmp slt i64 %55, %57
br i1 %58, label %20, label %18
59: ; preds = %18, %69
%60 = phi i64 [ %70, %69 ], [ 0, %18 ]
%61 = getelementptr inbounds i8, i8* %15, i64 %60
%62 = load i8, i8* %61
%63 = icmp sgt i8 %62, 100
br i1 %63, label %64, label %66
64: ; preds = %59
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
br label %69
66: ; preds = %59
%67 = sext i8 %62 to i32
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %64, %66
%70 = add nuw nsw i64 %60, 1
%71 = load i32, i32* %1
%72 = sext i32 %71 to i64
%73 = icmp slt i64 %70, %72
br i1 %73, label %59, label %74
74: ; preds = %69, %0, %18
ret i32 0
}