#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__ EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int n, i, max;
  while (scanf("%d", &n) != EOF) {
    if (n == 1)
      max = 9;
    else if (n == 2)
      max = 99;
    else if (n == 3)
      max = 999;
    else if (n == 4)
      max = 9999;
    else if (n == 5)
      max = 99999;
    for (i = 1; i <= max; i++)
      printf("%d\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     1201 <main+0xe1>
cmpl   $0x1,-0x8(%rbp)
jne    1165 <main+0x45>
movl   $0x9,-0x10(%rbp)
jmp    11cc <main+0xac>
cmpl   $0x2,-0x8(%rbp)
jne    117b <main+0x5b>
movl   $0x63,-0x10(%rbp)
jmp    11c7 <main+0xa7>
cmpl   $0x3,-0x8(%rbp)
jne    1191 <main+0x71>
movl   $0x3e7,-0x10(%rbp)
jmp    11c2 <main+0xa2>
cmpl   $0x4,-0x8(%rbp)
jne    11a7 <main+0x87>
movl   $0x270f,-0x10(%rbp)
jmp    11bd <main+0x9d>
cmpl   $0x5,-0x8(%rbp)
jne    11b8 <main+0x98>
movl   $0x1869f,-0x10(%rbp)
jmp    11bd <main+0x9d>
jmp    11c2 <main+0xa2>
jmp    11c7 <main+0xa7>
jmp    11cc <main+0xac>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11fc <main+0xdc>
mov    -0xc(%rbp),%esi
lea    0xe1a(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11d3 <main+0xb3>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea5(%rip),%rcx
cmp    (%rcx),%rax
je     11c4 <main+0xa4>
lea    0xeb4(%rip),%r12
lea    0xeaa(%rip),%r14
lea    0x4(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1178 <main+0x58>
cltq
lea    0xe93(%rip),%rcx
mov    (%rcx,%rax,4),%ebp
mov    %ebp,%r13d
neg    %r13d
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    (%rbx,%r13,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1190 <main+0x70>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x2e29(%rip),%rcx
cmp    (%rcx),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %44, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %45
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 9, i32* %4
br label %33
13: ; preds = %9
%14 = load i32, i32* %2
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 99, i32* %4
br label %32
17: ; preds = %13
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, 3
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 999, i32* %4
br label %31
21: ; preds = %17
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 4
br i1 %23, label %24, label %25
24: ; preds = %21
store i32 9999, i32* %4
br label %30
25: ; preds = %21
%26 = load i32, i32* %2
%27 = icmp eq i32 %26, 5
br i1 %27, label %28, label %29
28: ; preds = %25
store i32 99999, i32* %4
br label %29
29: ; preds = %28, %25
br label %30
30: ; preds = %29, %24
br label %31
31: ; preds = %30, %20
br label %32
32: ; preds = %31, %16
br label %33
33: ; preds = %32, %12
store i32 1, i32* %3
br label %34
34: ; preds = %41, %33
%35 = load i32, i32* %3
%36 = load i32, i32* %4
%37 = icmp sle i32 %35, %36
br i1 %37, label %38, label %44
38: ; preds = %34
%39 = load i32, i32* %3
%40 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
br label %34
44: ; preds = %34
br label %5
45: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
@switch.table.main = [5 x i32] [i32 9, i32 99, i32 999, i32 9999, i32 99999]
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %26, label %10
6: ; preds = %21
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %26, label %10
10: ; preds = %0, %6
%11 = phi i32 [ %20, %6 ], [ undef, %0 ]
%12 = load i32, i32* %1
%13 = add i32 %12, -1
%14 = icmp ult i32 %13, 5
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = sext i32 %13 to i64
%17 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.main, i64 0, i64 %16
%18 = load i32, i32* %17
br label %19
19: ; preds = %10, %15
%20 = phi i32 [ %18, %15 ], [ %11, %10 ]
br label %21
21: ; preds = %19, %21
%22 = phi i32 [ %24, %21 ], [ 1, %19 ]
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = add nuw i32 %22, 1
%25 = icmp eq i32 %22, %20
br i1 %25, label %6, label %21
26: ; preds = %6, %0
ret i32 0
}