#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 = 0, i = 2;
  scanf(" %d", &N);
  while (i <= 10000) {
    if (i % N == 2)
      printf("%d\n", i);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2710,-0xc(%rbp)
jg     1187 <main+0x67>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x2,%edx
jne    1179 <main+0x59>
mov    -0xc(%rbp),%esi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xecd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    $0x2,%ebx
lea    0xebb(%rip),%r14
jmp    115b <main+0x3b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x2711,%ebx
je     1173 <main+0x53>
mov    %ebx,%eax
cltd
idivl  0x4(%rsp)
cmp    $0x2,%edx
jne    1150 <main+0x30>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 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
store i32 0, i32* %2
store i32 2, i32* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %3
%7 = icmp sle i32 %6, 10000
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = srem i32 %9, %10
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %16
13: ; preds = %8
%14 = load i32, i32* %3
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [4 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*
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
br label %4
4: ; preds = %0, %11
%5 = phi i32 [ 2, %0 ], [ %12, %11 ]
%6 = load i32, i32* %1
%7 = srem i32 %5, %6
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %11
11: ; preds = %9, %4
%12 = add nuw nsw i32 %5, 1
%13 = icmp eq i32 %12, 10001
br i1 %13, label %14, label %4
14: ; preds = %11
ret i32 0
}