#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*/ clrscr();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ printf(char *, int);
void main() {
  int i, j, f;
  float r;
  clrscr();
  for (i = 2; i <= 50; i++) {
    f = 1;
    for (j = 2; j < i; j++) {
      if (i % j == 0) {
        f = 0;
      }
    }
    if (f == 1)
      printf("\t%d", i);
  }
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clrscr@plt>
movl   $0x2,-0x4(%rbp)
cmpl   $0x32,-0x4(%rbp)
jg     11c0 <main+0x90>
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1194 <main+0x64>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    1181 <main+0x51>
movl   $0x0,-0xc(%rbp)
jmp    1186 <main+0x56>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115e <main+0x2e>
cmpl   $0x1,-0xc(%rbp)
jne    11ad <main+0x7d>
mov    -0x4(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1040 <printf@plt>
jmp    11b2 <main+0x82>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <main+0x16>
mov    $0x0,%al
call   1050 <getch@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r15d,%r15d
xor    %eax,%eax
call   1030 <clrscr@plt>
mov    $0x2,%ebx
lea    0xeb3(%rip),%r14
jmp    116a <main+0x3a>
nop
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%ebx
add    $0x1,%r15d
cmp    $0x33,%ebx
je     11fd <main+0xcd>
cmp    $0x3,%ebx
jb     1150 <main+0x20>
cmp    $0x1,%r15d
jne    1190 <main+0x60>
mov    $0x2,%ecx
mov    $0x1,%esi
jmp    11de <main+0xae>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15d,%r8d
and    $0xfffffffe,%r8d
neg    %r8d
mov    $0x2,%ebp
mov    $0x1,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%eax
xor    %edx,%edx
div    %ebp
mov    %edx,%ecx
lea    0x1(%rbp),%edi
mov    %ebx,%eax
xor    %edx,%edx
div    %edi
test   %ecx,%ecx
cmove  %ecx,%esi
test   %edx,%edx
cmove  %edx,%esi
mov    %ebp,%ecx
add    $0x2,%ecx
lea    (%r8,%rbp,1),%eax
add    $0x2,%eax
mov    %ecx,%ebp
cmp    $0x2,%eax
jne    11b0 <main+0x80>
test   $0x1,%r15b
je     11ef <main+0xbf>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
test   %edx,%edx
cmove  %edx,%esi
cmp    $0x1,%esi
je     1150 <main+0x20>
jmp    115a <main+0x2a>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <getch@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"\09%d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = call i32 (...) @clrscr()
store i32 2, i32* %1
br label %6
6: ; preds = %31, %0
%7 = load i32, i32* %1
%8 = icmp sle i32 %7, 50
br i1 %8, label %9, label %34
9: ; preds = %6
store i32 1, i32* %3
store i32 2, i32* %2
br label %10
10: ; preds = %21, %9
%11 = load i32, i32* %2
%12 = load i32, i32* %1
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = srem i32 %15, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %14
store i32 0, i32* %3
br label %20
20: ; preds = %19, %14
br label %21
21: ; preds = %20
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %10
24: ; preds = %10
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, 1
br i1 %26, label %27, label %30
27: ; preds = %24
%28 = load i32, i32* %1
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %24
br label %31
31: ; preds = %30
%32 = load i32, i32* %1
%33 = add nsw i32 %32, 1
store i32 %33, i32* %1
br label %6
34: ; preds = %6
%35 = call i32 (...) @getch()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\09%d\00"
define void @main() {
%1 = tail call i32 (...) @clrscr()
br label %2
2: ; preds = %0, %39
%3 = phi i32 [ 0, %0 ], [ %42, %39 ]
%4 = phi i32 [ 2, %0 ], [ %40, %39 ]
%5 = icmp ugt i32 %4, 2
br i1 %5, label %6, label %37
6: ; preds = %2
%7 = and i32 %3, 1
%8 = icmp eq i32 %3, 1
br i1 %8, label %25, label %9
9: ; preds = %6
%10 = and i32 %3, -2
br label %11
11: ; preds = %11, %9
%12 = phi i32 [ 1, %9 ], [ %21, %11 ]
%13 = phi i32 [ 2, %9 ], [ %22, %11 ]
%14 = phi i32 [ 0, %9 ], [ %23, %11 ]
%15 = urem i32 %4, %13
%16 = icmp eq i32 %15, 0
%17 = or i32 %13, 1
%18 = urem i32 %4, %17
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, i1 true, i1 %16
%21 = select i1 %20, i32 0, i32 %12
%22 = add nuw nsw i32 %13, 2
%23 = add i32 %14, 2
%24 = icmp eq i32 %23, %10
br i1 %24, label %25, label %11
25: ; preds = %11, %6
%26 = phi i32 [ undef, %6 ], [ %21, %11 ]
%27 = phi i32 [ 1, %6 ], [ %21, %11 ]
%28 = phi i32 [ 2, %6 ], [ %22, %11 ]
%29 = icmp eq i32 %7, 0
br i1 %29, label %34, label %30
30: ; preds = %25
%31 = urem i32 %4, %28
%32 = icmp eq i32 %31, 0
%33 = select i1 %32, i32 0, i32 %27
br label %34
34: ; preds = %25, %30
%35 = phi i32 [ %26, %25 ], [ %33, %30 ]
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %39
37: ; preds = %2, %34
%38 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %39
39: ; preds = %34, %37
%40 = add nuw nsw i32 %4, 1
%41 = icmp eq i32 %40, 51
%42 = add i32 %3, 1
br i1 %41, label %43, label %2
43: ; preds = %39
%44 = tail call i32 (...) @getch()
ret void
}