#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*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  int i = 1;
  do {
    i++;
  } while (i % n != 2);
  while (i < 10000) {
    printf("%d\n", i);
    i += n;
  }
  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>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x2,%edx
jne    1146 <main+0x26>
jmp    1164 <main+0x44>
cmpl   $0x2710,-0xc(%rbp)
jge    118e <main+0x6e>
mov    -0xc(%rbp),%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1164 <main+0x44>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
xor    %ebx,%ebx
mov    0x4(%rsp),%ecx
nopl   0x0(%rax,%rax,1)
lea    0x2(%rbx),%eax
cltd
idiv   %ecx
add    $0x1,%ebx
cmp    $0x2,%edx
jne    1140 <main+0x20>
cmp    $0x270e,%ebx
ja     1176 <main+0x56>
add    $0x1,%ebx
lea    0xea3(%rip),%r14
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    0x4(%rsp),%ebx
cmp    $0x2710,%ebx
jl     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
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
br label %5
5: ; preds = %5, %0
%6 = phi i32 [ 1, %0 ], [ %7, %5 ]
%7 = add nuw nsw i32 %6, 1
%8 = srem i32 %7, %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %5
10: ; preds = %5
%11 = icmp ult i32 %6, 9999
br i1 %11, label %12, label %18
12: ; preds = %10, %12
%13 = phi i32 [ %16, %12 ], [ %7, %10 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %1
%16 = add nsw i32 %15, %13
%17 = icmp slt i32 %16, 10000
br i1 %17, label %12, label %18
18: ; preds = %12, %10
ret i32 0
}