#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*/ prepareNearestPowerOfTwoSieve(int *);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int caseId = 1, numLine, nearestPowerOfTwoArr[10001];
  prepareNearestPowerOfTwoSieve(nearestPowerOfTwoArr);
  while (1) {
    scanf("%d", &numLine);
    if (numLine < 0)
      break;
    printf("Case %d: %d\n", caseId, nearestPowerOfTwoArr[numLine]);
    caseId++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
lea    -0x9c50(%rbp),%rdi
call   1040 <prepareNearestPowerOfTwoSieve@plt>
lea    0xea4(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0xc(%rbp)
jge    1174 <main+0x44>
jmp    119c <main+0x6c>
mov    -0x8(%rbp),%esi
movslq -0xc(%rbp),%rax
mov    -0x9c50(%rbp,%rax,4),%edx
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1155 <main+0x25>
xor    %eax,%eax
add    $0x9c50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x9c58,%rsp
lea    0x10(%rsp),%rdi
call   1040 <prepareNearestPowerOfTwoSieve@plt>
lea    0xeb1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
js     11a6 <main+0x76>
mov    $0x1,%ebx
lea    0xe96(%rip),%r14
lea    0xe8c(%rip),%r15
lea    0xc(%rsp),%r12
nopl   0x0(%rax)
mov    %eax,%eax
mov    0x10(%rsp,%rax,4),%edx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%ebx
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jns    1180 <main+0x50>
xor    %eax,%eax
add    $0x9c58,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"Case %d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10001 x i32]
store i32 0, i32* %1
store i32 1, i32* %2
%5 = getelementptr inbounds [10001 x i32], [10001 x i32]* %4, i64 0, i64 0
%6 = call i32 @prepareNearestPowerOfTwoSieve(i32* %5)
br label %7
7: ; preds = %0, %12
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %7
br label %21
12: ; preds = %7
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [10001 x i32], [10001 x i32]* %4, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %17)
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %7
21: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [13 x i8] c"Case %d: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10001 x i32]
%3 = bitcast i32* %1 to i8*
%4 = bitcast [10001 x i32]* %2 to i8*
%5 = getelementptr inbounds [10001 x i32], [10001 x i32]* %2, i64 0, i64 0
%6 = call i32 @prepareNearestPowerOfTwoSieve(i32* %5)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp slt i32 %8, 0
br i1 %9, label %21, label %10
10: ; preds = %0, %10
%11 = phi i32 [ %19, %10 ], [ %8, %0 ]
%12 = phi i32 [ %17, %10 ], [ 1, %0 ]
%13 = zext i32 %11 to i64
%14 = getelementptr inbounds [10001 x i32], [10001 x i32]* %2, i64 0, i64 %13
%15 = load i32, i32* %14
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %15)
%17 = add nuw nsw i32 %12, 1
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%19 = load i32, i32* %1
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %10
21: ; preds = %10, %0
ret i32 0
}