#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*/ median(int);
int powten(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, const char *argv[]) {
  int i;
  printf("0  ");
  for (i = 1; i < 200000; i++) {
    if ((i * i) % (powten(median(i))) == i)
      printf("%d  ", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x30d40,-0x14(%rbp)
jge    11b6 <main+0x86>
mov    -0x14(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <median@plt>
mov    %eax,%edi
call   1050 <powten@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cltd
idiv   %ecx
cmp    -0x14(%rbp),%edx
jne    11a3 <main+0x73>
mov    -0x14(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11a8 <main+0x78>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115b <main+0x2b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%ebx
lea    0xeb6(%rip),%r14
jmp    115b <main+0x2b>
add    $0x1,%ebx
cmp    $0x30d40,%ebx
je     1187 <main+0x57>
mov    %ebx,%ebp
imul   %ebx,%ebp
mov    %ebx,%edi
call   1030 <median@plt>
mov    %eax,%edi
call   1050 <powten@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
cmp    %edx,%ebx
jne    1150 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"0 \00"
@.str.1 = [5 x i8] c"%d \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %2, %13
%5 = phi i32 [ 1, %2 ], [ %14, %13 ]
%6 = mul nsw i32 %5, %5
%7 = tail call i32 @median(i32 %5)
%8 = tail call i32 @powten(i32 %7)
%9 = srem i32 %6, %8
%10 = icmp eq i32 %9, %5
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %5)
br label %13
13: ; preds = %4, %11
%14 = add nuw nsw i32 %5, 1
%15 = icmp eq i32 %14, 200000
br i1 %15, label %16, label %4
16: ; preds = %13
ret i32 0
}