#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 */
typedef int /*<<< orphan*/ mpz_t;

/* Variables and functions */
int /*<<< orphan*/ gmp_printf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_add_ui(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
scalar_t__ mpz_cmp(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_powm(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_str(int /*<<< orphan*/, char *, int);
int main(int argc, char const *argv[]) {
  mpz_t e, n, tmp, end, cipherText;
  mpz_init(e);
  mpz_init(n);
  mpz_init(tmp);
  mpz_init(end);
  mpz_init(cipherText);
  mpz_set_str(e, "1040674049", 10);
  mpz_set_str(n, "2081441641", 10);
  mpz_set_str(tmp, "1", 10);
  mpz_set_str(end, "65535", 10);
  for (; mpz_cmp(tmp, end) <= 0; mpz_add_ui(tmp, tmp, 1)) {
    mpz_powm(cipherText, tmp, e, n);
    gmp_printf("%Zd\n", cipherText);
  }
  mpz_clear(e);
  mpz_clear(n);
  mpz_clear(tmp);
  mpz_clear(end);
  mpz_clear(cipherText);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x18(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x1c(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x20(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x24(%rbp),%edi
call   1050 <mpz_init@plt>
mov    -0x14(%rbp),%edi
lea    0xe48(%rip),%rsi
mov    $0xa,%edx
call   1060 <mpz_set_str@plt>
mov    -0x18(%rbp),%edi
lea    0xe3f(%rip),%rsi
mov    $0xa,%edx
call   1060 <mpz_set_str@plt>
mov    -0x1c(%rbp),%edi
lea    0xe34(%rip),%rsi
mov    $0xa,%edx
call   1060 <mpz_set_str@plt>
mov    -0x20(%rbp),%edi
lea    0xe22(%rip),%rsi
mov    $0xa,%edx
call   1060 <mpz_set_str@plt>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1070 <mpz_cmp@plt>
cmp    $0x0,%rax
jg     1248 <main+0xd8>
mov    -0x24(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1030 <mpz_powm@plt>
mov    -0x24(%rbp),%esi
lea    0xdee(%rip),%rdi
call   1090 <gmp_printf@plt>
mov    -0x1c(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x1,%edx
call   1040 <mpz_add_ui@plt>
jmp    11fe <main+0x8e>
mov    -0x14(%rbp),%edi
call   1080 <mpz_clear@plt>
mov    -0x18(%rbp),%edi
call   1080 <mpz_clear@plt>
mov    -0x1c(%rbp),%edi
call   1080 <mpz_clear@plt>
mov    -0x20(%rbp),%edi
call   1080 <mpz_clear@plt>
mov    -0x24(%rbp),%edi
call   1080 <mpz_clear@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
call   1050 <mpz_init@plt>
lea    0xe6f(%rip),%rsi
mov    $0xa,%edx
call   1060 <mpz_set_str@plt>
lea    0xe69(%rip),%rsi
mov    $0xa,%edx
call   1060 <mpz_set_str@plt>
lea    0xe61(%rip),%rsi
mov    $0xa,%edx
call   1060 <mpz_set_str@plt>
lea    0xe52(%rip),%rsi
mov    $0xa,%edx
call   1060 <mpz_set_str@plt>
call   1070 <mpz_cmp@plt>
test   %rax,%rax
jg     1201 <main+0x91>
lea    0xe3d(%rip),%rbx
nop
call   1030 <mpz_powm@plt>
mov    %rbx,%rdi
call   1090 <gmp_printf@plt>
mov    $0x1,%edx
call   1040 <mpz_add_ui@plt>
call   1070 <mpz_cmp@plt>
test   %rax,%rax
jle    11e0 <main+0x70>
call   1080 <mpz_clear@plt>
call   1080 <mpz_clear@plt>
call   1080 <mpz_clear@plt>
call   1080 <mpz_clear@plt>
call   1080 <mpz_clear@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"1040674049\00"
@.str.1 = [11 x i8] c"2081441641\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [6 x i8] c"65535\00"
@.str.4 = [5 x i8] c"%Zd\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %6
%12 = call i32 @mpz_init(i32 %11)
%13 = load i32, i32* %7
%14 = call i32 @mpz_init(i32 %13)
%15 = load i32, i32* %8
%16 = call i32 @mpz_init(i32 %15)
%17 = load i32, i32* %9
%18 = call i32 @mpz_init(i32 %17)
%19 = load i32, i32* %10
%20 = call i32 @mpz_init(i32 %19)
%21 = load i32, i32* %6
%22 = call i32 @mpz_set_str(i32 %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%23 = load i32, i32* %7
%24 = call i32 @mpz_set_str(i32 %23, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10)
%25 = load i32, i32* %8
%26 = call i32 @mpz_set_str(i32 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 10)
%27 = load i32, i32* %9
%28 = call i32 @mpz_set_str(i32 %27, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 10)
br label %29
29: ; preds = %42, %2
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = call i64 @mpz_cmp(i32 %30, i32 %31)
%33 = icmp sle i64 %32, 0
br i1 %33, label %34, label %46
34: ; preds = %29
%35 = load i32, i32* %10
%36 = load i32, i32* %8
%37 = load i32, i32* %6
%38 = load i32, i32* %7
%39 = call i32 @mpz_powm(i32 %35, i32 %36, i32 %37, i32 %38)
%40 = load i32, i32* %10
%41 = call i32 @gmp_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %34
%43 = load i32, i32* %8
%44 = load i32, i32* %8
%45 = call i32 @mpz_add_ui(i32 %43, i32 %44, i32 1)
br label %29
46: ; preds = %29
%47 = load i32, i32* %6
%48 = call i32 @mpz_clear(i32 %47)
%49 = load i32, i32* %7
%50 = call i32 @mpz_clear(i32 %49)
%51 = load i32, i32* %8
%52 = call i32 @mpz_clear(i32 %51)
%53 = load i32, i32* %9
%54 = call i32 @mpz_clear(i32 %53)
%55 = load i32, i32* %10
%56 = call i32 @mpz_clear(i32 %55)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"1040674049\00"
@.str.1 = [11 x i8] c"2081441641\00"
@.str.2 = [2 x i8] c"1\00"
@.str.3 = [6 x i8] c"65535\00"
@.str.4 = [5 x i8] c"%Zd\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @mpz_init(i32 undef)
%5 = tail call i32 @mpz_init(i32 undef)
%6 = tail call i32 @mpz_init(i32 undef)
%7 = tail call i32 @mpz_init(i32 undef)
%8 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 10)
%9 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10)
%10 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 10)
%11 = tail call i32 @mpz_set_str(i32 undef, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 10)
%12 = tail call i64 @mpz_cmp(i32 undef, i32 undef)
%13 = icmp slt i64 %12, 1
br i1 %13, label %14, label %20
14: ; preds = %2, %14
%15 = tail call i32 @mpz_powm(i32 undef, i32 undef, i32 undef, i32 undef)
%16 = tail call i32 @gmp_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 undef)
%17 = tail call i32 @mpz_add_ui(i32 undef, i32 undef, i32 1)
%18 = tail call i64 @mpz_cmp(i32 undef, i32 undef)
%19 = icmp slt i64 %18, 1
br i1 %19, label %14, label %20
20: ; preds = %14, %2
%21 = tail call i32 @mpz_clear(i32 undef)
%22 = tail call i32 @mpz_clear(i32 undef)
%23 = tail call i32 @mpz_clear(i32 undef)
%24 = tail call i32 @mpz_clear(i32 undef)
%25 = tail call i32 @mpz_clear(i32 undef)
ret i32 0
}