#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 /*<<< orphan*/ scanf(char *, int *);
int main() {
  int m, n, i, j, k;
  scanf("%d", &n);
  m = 1;
  printf("=====\n");
  for (i = n; i >= m; i--) {
    for (j = 2; j < i; j++)
      if (i % j == 0)
        break;
    if (j >= i && i != 1 && i != 0)
      printf("%d\n", i);
  }
  printf("=====\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     11e5 <main+0xc5>
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11a1 <main+0x81>
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    118e <main+0x6e>
jmp    11a1 <main+0x81>
jmp    1193 <main+0x73>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116d <main+0x4d>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11d2 <main+0xb2>
cmpl   $0x1,-0x10(%rbp)
je     11d2 <main+0xb2>
cmpl   $0x0,-0x10(%rbp)
je     11d2 <main+0xb2>
mov    -0x10(%rbp),%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d7 <main+0xb7>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    115a <main+0x3a>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%ebx
test   %ebx,%ebx
jle    11b9 <main+0x89>
lea    0xea3(%rip),%r14
jmp    117a <main+0x4a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%eax
cmp    $0x1,%ebx
mov    %eax,%ebx
jle    11b9 <main+0x89>
mov    $0x2,%ecx
cmp    $0x3,%ebx
jb     11a2 <main+0x72>
mov    $0x2,%ecx
nopl   0x0(%rax)
mov    %ebx,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     11a2 <main+0x72>
add    $0x1,%ecx
cmp    %ecx,%ebx
jne    1190 <main+0x60>
mov    %ebx,%ecx
cmp    $0x1,%ebx
je     1170 <main+0x40>
cmp    %ebx,%ecx
jl     1170 <main+0x40>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1170 <main+0x40>
lea    0xe47(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@str.3 = [6 x i8] c"=====\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 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %27
7: ; preds = %0, %24
%8 = phi i32 [ %25, %24 ], [ %5, %0 ]
%9 = icmp ugt i32 %8, 2
br i1 %9, label %10, label %17
10: ; preds = %7, %14
%11 = phi i32 [ %15, %14 ], [ 2, %7 ]
%12 = srem i32 %8, %11
%13 = icmp eq i32 %12, 0
br i1 %13, label %17, label %14
14: ; preds = %10
%15 = add nuw nsw i32 %11, 1
%16 = icmp eq i32 %15, %8
br i1 %16, label %17, label %10
17: ; preds = %14, %10, %7
%18 = phi i32 [ 2, %7 ], [ %11, %10 ], [ %8, %14 ]
%19 = icmp sge i32 %18, %8
%20 = icmp ne i32 %8, 1
%21 = and i1 %20, %19
br i1 %21, label %22, label %24
22: ; preds = %17
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %24
24: ; preds = %17, %22
%25 = add nsw i32 %8, -1
%26 = icmp sgt i32 %8, 1
br i1 %26, label %7, label %27
27: ; preds = %24, %0
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}