#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);
int main(void) {
  unsigned long long number;
  int i;
  number = 28433;
  for (i = 0; i < 7830457; ++i) {
    number *= 2;
    number %= 10000000000ULL;
  }
  number += 1;
  number %= 10000000000ULL;
  printf("28433*2^7830457+1 mod 10000000000ULL is %llu\n", number);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x6f11,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x777bb9,-0x14(%rbp)
jge    116c <main+0x5c>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movabs $0x2540be400,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112e <main+0x1e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movabs $0x2540be400,%rcx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x6f11,%esi
mov    $0x777bb8,%ecx
movabs $0xdbe6fecebdedd5bf,%rdi
fe e6 db
movabs $0x2540be400,%r8
xchg   %ax,%ax
add    %rsi,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x21,%rdx
imul   %r8,%rdx
sub    %rdx,%rsi
test   %ecx,%ecx
je     1189 <main+0x79>
add    %rsi,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x21,%rdx
imul   %r8,%rdx
sub    %rdx,%rsi
add    %rsi,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x21,%rdx
imul   %r8,%rdx
sub    %rdx,%rsi
add    %rsi,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x21,%rdx
imul   %r8,%rdx
sub    %rdx,%rsi
add    $0xfffffffc,%ecx
jmp    1130 <main+0x20>
push   %rax
add    $0x1,%rsi
mov    %rsi,%rax
mul    %rdi
shr    $0x21,%rdx
imul   %r8,%rdx
sub    %rdx,%rsi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"28433*2^7830457+1 mod 10000000000ULL is %llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i32
store i32 0, i32* %1
store i64 28433, i64* %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 7830457
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i64, i64* %2
%9 = mul i64 %8, 2
store i64 %9, i64* %2
%10 = load i64, i64* %2
%11 = urem i64 %10, 10000000000
store i64 %11, i64* %2
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i64, i64* %2
%17 = add i64 %16, 1
store i64 %17, i64* %2
%18 = load i64, i64* %2
%19 = urem i64 %18, 10000000000
store i64 %19, i64* %2
%20 = load i64, i64* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i64 %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [46 x i8] c"28433*2^7830457+1 mod 10000000000ULL is %llu\0A\00"
define i32 @main() {
br label %1
1: ; preds = %7, %0
%2 = phi i32 [ 0, %0 ], [ %14, %7 ]
%3 = phi i64 [ 28433, %0 ], [ %13, %7 ]
%4 = shl nuw nsw i64 %3, 1
%5 = urem i64 %4, 10000000000
%6 = icmp eq i32 %2, 7830456
br i1 %6, label %15, label %7
7: ; preds = %1
%8 = shl nuw nsw i64 %5, 1
%9 = urem i64 %8, 10000000000
%10 = shl nuw nsw i64 %9, 1
%11 = urem i64 %10, 10000000000
%12 = shl nuw nsw i64 %11, 1
%13 = urem i64 %12, 10000000000
%14 = add nuw nsw i32 %2, 4
br label %1
15: ; preds = %1
%16 = add nuw nsw i64 %5, 1
%17 = urem i64 %16, 10000000000
%18 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i64 %17)
ret i32 0
}