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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2710,-0x8(%rbp)
jge    1197 <main+0x77>
jmp    1158 <main+0x38>
cmpl   $0x2710,-0xc(%rbp)
jge    1192 <main+0x72>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x2,%edx
jne    118d <main+0x6d>
mov    -0xc(%rbp),%esi
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
jmp    1158 <main+0x38>
jmp    1197 <main+0x77>
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>
mov    0x4(%rsp),%ecx
cmp    $0x270f,%ecx
jg     1175 <main+0x55>
mov    $0x2,%ebx
lea    0xeb6(%rip),%r14
nopl   (%rax)
mov    %ebx,%eax
cltd
idiv   %ecx
cmp    $0x2,%edx
jne    1164 <main+0x44>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x2710,%ebx
je     1175 <main+0x55>
mov    0x4(%rsp),%ecx
add    $0x1,%ebx
jmp    1150 <main+0x30>
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
store i32 1, i32* %3
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 10000
br i1 %6, label %7, label %23
7: ; preds = %0
br label %8
8: ; preds = %21, %7
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10000
br i1 %10, label %11, label %22
11: ; preds = %8
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = srem i32 %14, %15
%17 = icmp eq i32 %16, 2
br i1 %17, label %18, label %21
18: ; preds = %11
%19 = load i32, i32* %3
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
br label %21
21: ; preds = %18, %11
br label %8
22: ; preds = %8
br label %23
23: ; preds = %22, %0
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
%5 = icmp slt i32 %4, 10000
br i1 %5, label %6, label %18
6: ; preds = %0, %16
%7 = phi i32 [ %17, %16 ], [ %4, %0 ]
%8 = phi i32 [ %9, %16 ], [ 1, %0 ]
%9 = add nuw nsw i32 %8, 1
%10 = srem i32 %9, %7
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %14
14: ; preds = %12, %6
%15 = icmp eq i32 %9, 10000
br i1 %15, label %18, label %16
16: ; preds = %14
%17 = load i32, i32* %1
br label %6
18: ; preds = %14, %0
ret i32 0
}