#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 *, float *, float *);
int main(int argc, char *argv[]) {
  float popA = 0, rateA, popB = 0, rateB;
  do {
    printf("Pais A (pop/taxa): ");
    scanf("%f %f", &popA, &rateA);
  } while (popA <= 0);
  do {
    printf("Pais B (pop/taxa): ");
    scanf("%f %f", &popB, &rateB);
  } while (popA <= popB);
  int years = 0;
  while (popB <= popA) {
    years += 1;
    popA *= (1.0 + rateA / 100);
    popB *= (1.0 + rateB / 100);
  }
  printf("Ultrapassará em %d anos.\n", years);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss -0x14(%rbp),%xmm0
jae    1146 <main+0x26>
jmp    117a <main+0x5a>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x14(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jae    117a <main+0x5a>
movl   $0x0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     1245 <main+0x125>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movss  -0x18(%rbp),%xmm0
movss  0xe29(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe11(%rip),%xmm1
addsd  %xmm0,%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x20(%rbp),%xmm0
movss  0xdf2(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdda(%rip),%xmm1
addsd  %xmm0,%xmm1
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    11b6 <main+0x96>
mov    -0x24(%rbp),%esi
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xee2(%rip),%r14
lea    0xeef(%rip),%r15
lea    0x8(%rsp),%r12
lea    0x14(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
ucomiss 0x8(%rsp),%xmm0
jae    1160 <main+0x40>
lea    0xeb5(%rip),%r14
lea    0xea8(%rip),%r15
lea    0xc(%rsp),%r12
lea    0x10(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm2
movss  0xc(%rsp),%xmm0
ucomiss %xmm2,%xmm0
jae    11a0 <main+0x80>
xor    %esi,%esi
ucomiss %xmm0,%xmm2
jb     1227 <main+0x107>
movss  0x14(%rsp),%xmm1
movss  0x10(%rsp),%xmm3
unpcklps %xmm1,%xmm3
divps  0xe1a(%rip),%xmm3
cvtps2pd %xmm3,%xmm1
addpd  0xe1f(%rip),%xmm1
unpcklps %xmm2,%xmm0
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
cvtps2pd %xmm0,%xmm0
mulpd  %xmm1,%xmm0
cvtpd2ps %xmm0,%xmm0
add    $0x1,%esi
movapd %xmm0,%xmm2
shufps $0x55,%xmm0,%xmm2
ucomiss %xmm0,%xmm2
jae    1200 <main+0xe0>
movss  %xmm2,0x8(%rsp)
movss  %xmm0,0xc(%rsp)
lea    0xe24(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Pais A (pop/taxa): \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [20 x i8] c"Pais B (pop/taxa): \00"
@.str.3 = [27 x i8] c"Ultrapassar\C3\A1 em %d anos.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 0.000000e+00, float* %6
store float 0.000000e+00, float* %8
br label %11
11: ; preds = %14, %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %6, float* %7)
br label %14
14: ; preds = %11
%15 = load float, float* %6
%16 = fcmp ole float %15, 0.000000e+00
br i1 %16, label %11, label %17
17: ; preds = %14
br label %18
18: ; preds = %21, %17
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %8, float* %9)
br label %21
21: ; preds = %18
%22 = load float, float* %6
%23 = load float, float* %8
%24 = fcmp ole float %22, %23
br i1 %24, label %18, label %25
25: ; preds = %21
store i32 0, i32* %10
br label %26
26: ; preds = %30, %25
%27 = load float, float* %8
%28 = load float, float* %6
%29 = fcmp ole float %27, %28
br i1 %29, label %30, label %49
30: ; preds = %26
%31 = load i32, i32* %10
%32 = add nsw i32 %31, 1
store i32 %32, i32* %10
%33 = load float, float* %7
%34 = fdiv float %33, 1.000000e+02
%35 = fpext float %34 to double
%36 = fadd double 1.000000e+00, %35
%37 = load float, float* %6
%38 = fpext float %37 to double
%39 = fmul double %38, %36
%40 = fptrunc double %39 to float
store float %40, float* %6
%41 = load float, float* %9
%42 = fdiv float %41, 1.000000e+02
%43 = fpext float %42 to double
%44 = fadd double 1.000000e+00, %43
%45 = load float, float* %8
%46 = fpext float %45 to double
%47 = fmul double %46, %44
%48 = fptrunc double %47 to float
store float %48, float* %8
br label %26
49: ; preds = %26
%50 = load i32, i32* %10
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %50)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Pais A (pop/taxa): \00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [20 x i8] c"Pais B (pop/taxa): \00"
@.str.3 = [27 x i8] c"Ultrapassar\C3\A1 em %d anos.\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%8 = bitcast float* %4 to i8*
%9 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %5
%10 = bitcast float* %6 to i8*
br label %11
11: ; preds = %11, %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %3, float* %4)
%14 = load float, float* %3
%15 = fcmp ugt float %14, 0.000000e+00
br i1 %15, label %16, label %11
16: ; preds = %11, %16
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %5, float* %6)
%19 = load float, float* %3
%20 = load float, float* %5
%21 = fcmp ugt float %19, %20
br i1 %21, label %22, label %16
22: ; preds = %16
%23 = fcmp ugt float %20, %19
br i1 %23, label %46, label %24
24: ; preds = %22
%25 = load float, float* %4
%26 = load float, float* %6
%27 = insertelement <2 x float> poison, float %26, i64 0
%28 = insertelement <2 x float> %27, float %25, i64 1
%29 = fdiv <2 x float> %28, <float 1.000000e+02, float 1.000000e+02>
%30 = fpext <2 x float> %29 to <2 x double>
%31 = fadd <2 x double> %30, <double 1.000000e+00, double 1.000000e+00>
%32 = insertelement <2 x float> poison, float %20, i64 0
%33 = insertelement <2 x float> %32, float %19, i64 1
br label %34
34: ; preds = %24, %34
%35 = phi i32 [ 0, %24 ], [ %37, %34 ]
%36 = phi <2 x float> [ %33, %24 ], [ %40, %34 ]
%37 = add nuw nsw i32 %35, 1
%38 = fpext <2 x float> %36 to <2 x double>
%39 = fmul <2 x double> %31, %38
%40 = fptrunc <2 x double> %39 to <2 x float>
%41 = extractelement <2 x float> %40, i64 0
%42 = extractelement <2 x float> %40, i64 1
%43 = fcmp ugt float %41, %42
br i1 %43, label %44, label %34
44: ; preds = %34
%45 = extractelement <2 x float> %40, i64 0
store float %42, float* %3
store float %45, float* %5
br label %46
46: ; preds = %44, %22
%47 = phi i32 [ %37, %44 ], [ 0, %22 ]
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i32 %47)
ret i32 0
}