#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 pow(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int count, trail, num;
  scanf("%d", &num);
  for (count = 0, trail = 0; trail < num; trail += 5 * pow(2, count), count++)
    ;
  count--;
  trail -= 5 * pow(2, count);
  count = pow(2, count);
  num--;
  if ((num - trail) / count == 0)
    printf("Sheldon");
  else if ((num - trail) / count == 1)
    printf("Leonard");
  else if ((num - trail) / count == 2)
    printf("Penny");
  else if ((num - trail) / count == 3)
    printf("Rajesh");
  else if ((num - trail) / count == 4)
    printf("Howard");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1192 <main+0x62>
jmp    116e <main+0x3e>
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1050 <pow@plt>
imul   $0x5,%eax,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115d <main+0x2d>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1050 <pow@plt>
imul   $0x5,%eax,%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%eax
jne    11f0 <main+0xc0>
lea    0xe1d(%rip),%rdi
call   1030 <printf@plt>
jmp    128f <main+0x15f>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x1,%eax
jne    1214 <main+0xe4>
lea    0xe01(%rip),%rdi
call   1030 <printf@plt>
jmp    128a <main+0x15a>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x2,%eax
jne    1238 <main+0x108>
lea    0xde5(%rip),%rdi
call   1030 <printf@plt>
jmp    1285 <main+0x155>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x3,%eax
jne    125c <main+0x12c>
lea    0xdc7(%rip),%rdi
call   1030 <printf@plt>
jmp    1280 <main+0x150>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x4,%eax
jne    127b <main+0x14b>
lea    0xdaa(%rip),%rdi
call   1030 <printf@plt>
jmp    1280 <main+0x150>
jmp    1285 <main+0x155>
jmp    128a <main+0x15a>
jmp    128f <main+0x15f>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    117c <main+0x4c>
xor    %ebp,%ebp
mov    $0xffffffff,%ebx
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1050 <pow@plt>
lea    (%rax,%rax,4),%eax
add    %eax,%ebp
cmp    0xc(%rsp),%ebp
jl     1160 <main+0x30>
jmp    1183 <main+0x53>
xor    %ebp,%ebp
mov    $0xffffffff,%ebx
mov    $0x2,%edi
mov    %ebx,%esi
call   1050 <pow@plt>
mov    %eax,%r14d
mov    $0x2,%edi
mov    %ebx,%esi
call   1050 <pow@plt>
mov    %eax,%ecx
mov    0xc(%rsp),%eax
lea    -0x1(%rax),%edx
mov    %edx,0xc(%rsp)
lea    (%r14,%r14,4),%edx
sub    %ebp,%edx
add    %edx,%eax
add    $0xffffffff,%eax
cltd
idiv   %ecx
cmp    $0x4,%eax
ja     11d3 <main+0xa3>
cltq
lea    0xe61(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Sheldon\00"
@.str.2 = [8 x i8] c"Leonard\00"
@.str.3 = [6 x i8] c"Penny\00"
@.str.4 = [7 x i8] c"Rajesh\00"
@.str.5 = [7 x i8] c"Howard\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 0, i32* %2
store i32 0, i32* %3
br label %6
6: ; preds = %11, %0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %19
10: ; preds = %6
br label %11
11: ; preds = %10
%12 = load i32, i32* %2
%13 = call i32 @pow(i32 2, i32 %12)
%14 = mul nsw i32 5, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %6
19: ; preds = %6
%20 = load i32, i32* %2
%21 = add nsw i32 %20, -1
store i32 %21, i32* %2
%22 = load i32, i32* %2
%23 = call i32 @pow(i32 2, i32 %22)
%24 = mul nsw i32 5, %23
%25 = load i32, i32* %3
%26 = sub nsw i32 %25, %24
store i32 %26, i32* %3
%27 = load i32, i32* %2
%28 = call i32 @pow(i32 2, i32 %27)
store i32 %28, i32* %2
%29 = load i32, i32* %4
%30 = add nsw i32 %29, -1
store i32 %30, i32* %4
%31 = load i32, i32* %4
%32 = load i32, i32* %3
%33 = sub nsw i32 %31, %32
%34 = load i32, i32* %2
%35 = sdiv i32 %33, %34
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %19
%38 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %79
39: ; preds = %19
%40 = load i32, i32* %4
%41 = load i32, i32* %3
%42 = sub nsw i32 %40, %41
%43 = load i32, i32* %2
%44 = sdiv i32 %42, %43
%45 = icmp eq i32 %44, 1
br i1 %45, label %46, label %48
46: ; preds = %39
%47 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %78
48: ; preds = %39
%49 = load i32, i32* %4
%50 = load i32, i32* %3
%51 = sub nsw i32 %49, %50
%52 = load i32, i32* %2
%53 = sdiv i32 %51, %52
%54 = icmp eq i32 %53, 2
br i1 %54, label %55, label %57
55: ; preds = %48
%56 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %77
57: ; preds = %48
%58 = load i32, i32* %4
%59 = load i32, i32* %3
%60 = sub nsw i32 %58, %59
%61 = load i32, i32* %2
%62 = sdiv i32 %60, %61
%63 = icmp eq i32 %62, 3
br i1 %63, label %64, label %66
64: ; preds = %57
%65 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
br label %76
66: ; preds = %57
%67 = load i32, i32* %4
%68 = load i32, i32* %3
%69 = sub nsw i32 %67, %68
%70 = load i32, i32* %2
%71 = sdiv i32 %69, %70
%72 = icmp eq i32 %71, 4
br i1 %72, label %73, label %75
73: ; preds = %66
%74 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
br label %75
75: ; preds = %73, %66
br label %76
76: ; preds = %75, %64
br label %77
77: ; preds = %76, %55
br label %78
78: ; preds = %77, %46
br label %79
79: ; preds = %78, %37
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [8 x i8] c"Sheldon\00"
@.str.2 = [8 x i8] c"Leonard\00"
@.str.3 = [6 x i8] c"Penny\00"
@.str.4 = [7 x i8] c"Rajesh\00"
@.str.5 = [7 x i8] c"Howard\00"
@reltable.main = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.1 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @.str.2 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.4 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.5 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %0, %6
%7 = phi i32 [ %11, %6 ], [ 0, %0 ]
%8 = phi i32 [ %12, %6 ], [ 0, %0 ]
%9 = call i32 @pow(i32 2, i32 %8)
%10 = mul nsw i32 %9, 5
%11 = add nsw i32 %10, %7
%12 = add nuw nsw i32 %8, 1
%13 = load i32, i32* %1
%14 = icmp slt i32 %11, %13
br i1 %14, label %6, label %15
15: ; preds = %6, %0
%16 = phi i32 [ -1, %0 ], [ %8, %6 ]
%17 = phi i32 [ 0, %0 ], [ %11, %6 ]
%18 = call i32 @pow(i32 2, i32 %16)
%19 = call i32 @pow(i32 2, i32 %16)
%20 = load i32, i32* %1
%21 = add nsw i32 %20, -1
store i32 %21, i32* %1
%22 = mul i32 %18, 5
%23 = sub i32 %22, %17
%24 = add i32 %23, %21
%25 = sdiv i32 %24, %19
%26 = icmp ult i32 %25, 5
br i1 %26, label %27, label %32
27: ; preds = %15
%28 = sext i32 %25 to i64
%29 = shl i64 %28, 2
%30 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.main to i8*), i64 %29)
%31 = call i32 @printf(i8* dereferenceable(1) %30)
br label %32
32: ; preds = %15, %27
ret i32 0
}