#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 *, unsigned long long);
main() {
  unsigned long long i, n, p, m;
  i = 0;
  m = 0x0000FFFF;
  p = 0x0000FFFF + 1;
  p = 805315183;
  n = 0;
  for (i = 0; i < m; i++) {
    printf("%d\n", n);
    n = (n + p) % m;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0xffff,-0x28(%rbp)
movq   $0x10000,-0x20(%rbp)
movq   $0x3000226f,-0x20(%rbp)
30
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    1192 <main+0x82>
mov    -0x18(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x28(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114f <main+0x3f>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0xffff,%r15d
xor    %ebx,%ebx
lea    0xed9(%rip),%r14
mov    $0x80008001,%r12d
nopl   (%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
add    $0x3000226f,%rbx
mov    %ebx,%eax
imul   %r12,%rax
shr    $0x2f,%rax
mov    %eax,%ecx
shl    $0x10,%ecx
sub    %ecx,%eax
add    %eax,%ebx
add    $0xffffffffffffffff,%r15
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i32 0, i32* %1
store i64 0, i64* %2
store i64 65535, i64* %5
store i64 65536, i64* %4
store i64 805315183, i64* %4
store i64 0, i64* %3
store i64 0, i64* %2
br label %6
6: ; preds = %18, %0
%7 = load i64, i64* %2
%8 = load i64, i64* %5
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = load i64, i64* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %11)
%13 = load i64, i64* %3
%14 = load i64, i64* %4
%15 = add i64 %13, %14
%16 = load i64, i64* %5
%17 = urem i64 %15, %16
store i64 %17, i64* %3
br label %18
18: ; preds = %10
%19 = load i64, i64* %2
%20 = add i64 %19, 1
store i64 %20, i64* %2
br label %6
21: ; preds = %6
%22 = load i32, i32* %1
ret i32 %22
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i64 [ 0, %0 ], [ %7, %1 ]
%3 = phi i64 [ 0, %0 ], [ %6, %1 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
%5 = add nuw nsw i64 %3, 805315183
%6 = urem i64 %5, 65535
%7 = add nuw nsw i64 %2, 1
%8 = icmp eq i64 %7, 65535
br i1 %8, label %9, label %1
9: ; preds = %1
ret i32 0
}