#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() {
  unsigned long long result = 1;
  int i;
  for (i = 0; i < 7830457; i++) {
    result *= 2;
    if (result >= 10000000000) {
      result %= 10000000000;
    }
  }
  result = (result * 28433 + 1) % 10000000000;
  printf("The last ten digits of 28433*2^7830457+1 are %llu\n", result);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%ecx
mov    $0x777bb8,%edi
movabs $0x2540be3ff,%rsi
movabs $0xdbe6fecebdedd5bf,%r9
fe e6 db
movabs $0x2540be400,%r8
jmp    1143 <main+0x33>
nopw   0x0(%rax,%rax,1)
add    $0xfffffffe,%edi
add    %rcx,%rcx
cmp    %rsi,%rcx
jbe    115c <main+0x4c>
mov    %rcx,%rax
mul    %r9
shr    $0x21,%rdx
imul   %r8,%rdx
sub    %rdx,%rcx
test   %edi,%edi
je     117b <main+0x6b>
add    %rcx,%rcx
cmp    %rsi,%rcx
jbe    1140 <main+0x30>
mov    %rcx,%rax
mul    %r9
shr    $0x21,%rdx
imul   %r8,%rdx
sub    %rdx,%rcx
jmp    1140 <main+0x30>
push   %rax
imul   $0x6f11,%rcx,%rcx
add    $0x1,%rcx
mov    %rcx,%rax
mul    %r9
shr    $0x21,%rdx
imul   %r8,%rdx
sub    %rdx,%rcx
lea    0xe61(%rip),%rdi
mov    %rcx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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