#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 */
scalar_t__ isbouncy(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int count = 0;
  int i;
  for (i = 1;; ++i) {
    double pc = (double)i / 100.0;
    if (isbouncy(i))
      count++;
    if (count / pc >= 99) {
      printf("%d\n", i);
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1040 <isbouncy@plt>
cmp    $0x0,%rax
je     1175 <main+0x55>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x14(%rbp),%xmm0
divsd  -0x20(%rbp),%xmm0
movsd  0xe81(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11a5 <main+0x85>
mov    -0x18(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
jmp    11b8 <main+0x98>
jmp    11aa <main+0x8a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1144 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
divsd  0xebe(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    %ebx,%edi
call   1040 <isbouncy@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
divsd  (%rsp),%xmm0
ucomisd 0xe9f(%rip),%xmm0
jb     1130 <main+0x10>
lea    0xe9e(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 1, i32* %7
br label %9
9: ; preds = %29, %2
%10 = load i32, i32* %7
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 1.000000e+02
store double %12, double* %8
%13 = load i32, i32* %7
%14 = call i64 @isbouncy(i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %9
%17 = load i32, i32* %6
%18 = add nsw i32 %17, 1
store i32 %18, i32* %6
br label %19
19: ; preds = %16, %9
%20 = load i32, i32* %6
%21 = sitofp i32 %20 to double
%22 = load double, double* %8
%23 = fdiv double %21, %22
%24 = fcmp oge double %23, 9.900000e+01
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i32, i32* %7
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
br label %32
28: ; preds = %19
br label %29
29: ; preds = %28
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
br label %9
32: ; preds = %25
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ 0, %2 ], [ %11, %3 ]
%5 = phi i32 [ 1, %2 ], [ %15, %3 ]
%6 = sitofp i32 %5 to double
%7 = fdiv double %6, 1.000000e+02
%8 = tail call i64 @isbouncy(i32 %5)
%9 = icmp ne i64 %8, 0
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %4, %10
%12 = sitofp i32 %11 to double
%13 = fdiv double %12, %7
%14 = fcmp ult double %13, 9.900000e+01
%15 = add nuw nsw i32 %5, 1
br i1 %14, label %3, label %16
16: ; preds = %3
%17 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}