#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 ceil(int);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, long *);
int main() {
  long int p_low, p;
  int i;
  while (scanf("%ld", &p) > 0) {
    p_low = (long int)ceil(p / 9.);
    for (i = 0; p >= 1; i++) {
      if (p_low <= 1 && p >= 1)
        printf("Stan wins.\n");
      else if (((long int)ceil(p_low / 2.)) <= 1 && p_low - 1 >= 1)
        printf("Ollie wins.\n");
      p = (long int)ceil(p_low / 2.) - 1;
      p_low = (long int)ceil(ceil(p_low / 2.) / 9.);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x0,%rax
jle    126f <main+0x13f>
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  0xe99(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
cltq
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x1,-0x18(%rbp)
jl     126a <main+0x13a>
cmpq   $0x1,-0x10(%rbp)
jg     11b3 <main+0x83>
cmpq   $0x1,-0x18(%rbp)
jl     11b3 <main+0x83>
lea    0xe6b(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <main+0xcd>
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xe47(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
cltq
cmp    $0x1,%rax
jg     11f8 <main+0xc8>
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
cmp    $0x1,%rax
jl     11f8 <main+0xc8>
lea    0xe2d(%rip),%rdi
call   1040 <printf@plt>
jmp    11fd <main+0xcd>
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xdfd(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
cltq
sub    $0x1,%rax
mov    %rax,-0x18(%rbp)
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xdd8(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
cvtsi2sd %eax,%xmm0
movsd  0xdb7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <ceil@plt>
cltq
mov    %rax,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1181 <main+0x51>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecd(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jle    1248 <main+0x118>
lea    0xec3(%rip),%rbx
lea    0xeb0(%rip),%r14
lea    0xea5(%rip),%r15
lea    0x8(%rsp),%r12
jmp    1194 <main+0x64>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
test   %rax,%rax
jle    1248 <main+0x118>
xorps  %xmm0,%xmm0
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xe5a(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <ceil@plt>
cmpq   $0x0,0x8(%rsp)
jle    1180 <main+0x50>
mov    %eax,%ebp
jmp    121a <main+0xea>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <puts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xe31(%rip),%xmm0
cvttsd2si %xmm0,%ebp
mov    %ebp,%edi
call   1040 <ceil@plt>
cltq
add    $0xffffffffffffffff,%rax
mov    %rax,0x8(%rsp)
mov    %ebp,%edi
call   1040 <ceil@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xdfd(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1040 <ceil@plt>
mov    %eax,%ebp
cmpq   $0x0,0x8(%rsp)
jle    1180 <main+0x50>
cmp    $0x1,%ebp
jle    11c0 <main+0x90>
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
mulsd  0xdda(%rip),%xmm0
cvttsd2si %xmm0,%ebp
mov    %ebp,%edi
call   1040 <ceil@plt>
cmp    $0x1,%eax
jg     11db <main+0xab>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    11db <main+0xab>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%ld\00"
@.str.1 = [12 x i8] c"Stan wins.\0A\00"
@.str.2 = [13 x i8] c"Ollie wins.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %62, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %3)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %63
8: ; preds = %5
%9 = load i64, i64* %3
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 9.000000e+00
%12 = fptosi double %11 to i32
%13 = call i32 @ceil(i32 %12)
%14 = sext i32 %13 to i64
store i64 %14, i64* %2
store i32 0, i32* %4
br label %15
15: ; preds = %59, %8
%16 = load i64, i64* %3
%17 = icmp sge i64 %16, 1
br i1 %17, label %18, label %62
18: ; preds = %15
%19 = load i64, i64* %2
%20 = icmp sle i64 %19, 1
br i1 %20, label %21, label %26
21: ; preds = %18
%22 = load i64, i64* %3
%23 = icmp sge i64 %22, 1
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %41
26: ; preds = %21, %18
%27 = load i64, i64* %2
%28 = sitofp i64 %27 to double
%29 = fdiv double %28, 2.000000e+00
%30 = fptosi double %29 to i32
%31 = call i32 @ceil(i32 %30)
%32 = sext i32 %31 to i64
%33 = icmp sle i64 %32, 1
br i1 %33, label %34, label %40
34: ; preds = %26
%35 = load i64, i64* %2
%36 = sub nsw i64 %35, 1
%37 = icmp sge i64 %36, 1
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38, %34, %26
br label %41
41: ; preds = %40, %24
%42 = load i64, i64* %2
%43 = sitofp i64 %42 to double
%44 = fdiv double %43, 2.000000e+00
%45 = fptosi double %44 to i32
%46 = call i32 @ceil(i32 %45)
%47 = sext i32 %46 to i64
%48 = sub nsw i64 %47, 1
store i64 %48, i64* %3
%49 = load i64, i64* %2
%50 = sitofp i64 %49 to double
%51 = fdiv double %50, 2.000000e+00
%52 = fptosi double %51 to i32
%53 = call i32 @ceil(i32 %52)
%54 = sitofp i32 %53 to double
%55 = fdiv double %54, 9.000000e+00
%56 = fptosi double %55 to i32
%57 = call i32 @ceil(i32 %56)
%58 = sext i32 %57 to i64
store i64 %58, i64* %2
br label %59
59: ; preds = %41
%60 = load i32, i32* %4
%61 = add nsw i32 %60, 1
store i32 %61, i32* %4
br label %15
62: ; preds = %15
br label %5
63: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ld\00"
@str = [12 x i8] c"Ollie wins.\00"
@str.3 = [11 x i8] c"Stan wins.\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %8, label %44
5: ; preds = %32, %8
%6 = call i64 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64* %1)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %44
8: ; preds = %0, %5
%9 = load i64, i64* %1
%10 = sitofp i64 %9 to double
%11 = fdiv double %10, 9.000000e+00
%12 = fptosi double %11 to i32
%13 = call i32 @ceil(i32 %12)
%14 = load i64, i64* %1
%15 = icmp sgt i64 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %8, %32
%17 = phi i32 [ %41, %32 ], [ %13, %8 ]
%18 = icmp slt i32 %17, 2
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.3, i64 0, i64 0))
%21 = sitofp i32 %17 to double
%22 = fmul double %21, 5.000000e-01
%23 = fptosi double %22 to i32
br label %32
24: ; preds = %16
%25 = sitofp i32 %17 to double
%26 = fmul double %25, 5.000000e-01
%27 = fptosi double %26 to i32
%28 = call i32 @ceil(i32 %27)
%29 = icmp slt i32 %28, 2
br i1 %29, label %30, label %32
30: ; preds = %24
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %32
32: ; preds = %24, %30, %19
%33 = phi i32 [ %27, %24 ], [ %27, %30 ], [ %23, %19 ]
%34 = call i32 @ceil(i32 %33)
%35 = sext i32 %34 to i64
%36 = add nsw i64 %35, -1
store i64 %36, i64* %1
%37 = call i32 @ceil(i32 %33)
%38 = sitofp i32 %37 to double
%39 = fdiv double %38, 9.000000e+00
%40 = fptosi double %39 to i32
%41 = call i32 @ceil(i32 %40)
%42 = load i64, i64* %1
%43 = icmp sgt i64 %42, 0
br i1 %43, label %16, label %5
44: ; preds = %5, %0
ret i32 0
}