#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);
void main() {
  int i, j;
  unsigned long long temp, result = 0;
  char *number =
      "731671765313306249192251196744265747423553491949349698352031277450632623"
      "957831801698480186947885184385861560789112949495459501737958331952853208"
      "805511125406987471585238630507156932909632952274430435576689664895044524"
      "452316173185640309871112172238311362229893423380308135336276614282806444"
      "486645238749303589072962904915604407723907138105158593079608667017242712"
      "188399879790879227492190169972088809377665727333001053367881220235421809"
      "751254540594752243525849077116705560136048395864467063244157221553975369"
      "781797784617406495514929086256932197846862248283972241375657056057490261"
      "407972968652414535100474821663704844031998900088952434506585412275886668"
      "811642717147992444292823086346567481391912316282458617866458359124566529"
      "476545682848912883142607690042242190226710556263211111093705442175069416"
      "589604080719840385096245544436298123098787992724428490918884580156166097"
      "919133875499200524063689912560717606058861164671094050775410022569831552"
      "0005593572972571636269561882670428252483600823257530420752963450";
  for (i = 0; i < 1000; i++) {
    temp = number[i] - '0';
    for (j = i + 1; j < i + 13; j++)
      temp *= number[j] - '0';
    if (temp > result)
      result = temp;
  }
  printf("%llu\n", result);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x18(%rbp)
lea    0xed9(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x3e8,-0x4(%rbp)
jge    11bf <main+0xaf>
mov    -0x20(%rbp),%rax
movslq -0x4(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0xd,%ecx
cmp    %ecx,%eax
jge    1196 <main+0x86>
mov    -0x20(%rbp),%rax
movslq -0x8(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
cltq
imul   -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    115d <main+0x4d>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jbe    11ac <main+0x9c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    11b1 <main+0xa1>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <main+0x22>
mov    -0x18(%rbp),%rsi
lea    0x121f(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x33,%r9b
mov    $0xc,%eax
xor    %esi,%esi
lea    0xedf(%rip),%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rsi,%r8
movsbq -0xc(%rax,%rcx,1),%rsi
add    $0xffffffffffffffd0,%rsi
movsbq %r9b,%rdi
add    $0xffffffffffffffd0,%rdi
imul   %rsi,%rdi
movsbq -0xa(%rax,%rcx,1),%r9
mov    %r9,%rsi
add    $0xffffffffffffffd0,%rsi
movsbq -0x9(%rax,%rcx,1),%rdx
add    $0xffffffffffffffd0,%rdx
imul   %rsi,%rdx
imul   %rdi,%rdx
movsbq -0x8(%rax,%rcx,1),%rsi
add    $0xffffffffffffffd0,%rsi
movsbq -0x7(%rax,%rcx,1),%rdi
add    $0xffffffffffffffd0,%rdi
imul   %rsi,%rdi
movsbq -0x6(%rax,%rcx,1),%rsi
add    $0xffffffffffffffd0,%rsi
imul   %rdi,%rsi
imul   %rdx,%rsi
movsbq -0x5(%rax,%rcx,1),%rdx
add    $0xffffffffffffffd0,%rdx
movsbq -0x4(%rax,%rcx,1),%rdi
add    $0xffffffffffffffd0,%rdi
imul   %rdx,%rdi
movsbq -0x3(%rax,%rcx,1),%rdx
add    $0xffffffffffffffd0,%rdx
imul   %rdi,%rdx
movsbq -0x2(%rax,%rcx,1),%rdi
add    $0xffffffffffffffd0,%rdi
imul   %rdx,%rdi
imul   %rsi,%rdi
movsbq -0x1(%rax,%rcx,1),%rdx
add    $0xffffffffffffffd0,%rdx
movsbq (%rax,%rcx,1),%rsi
add    $0xffffffffffffffd0,%rsi
imul   %rdx,%rsi
imul   %rdi,%rsi
cmp    %r8,%rsi
cmovbe %r8,%rsi
add    $0x1,%rax
cmp    $0x3f4,%rax
jne    1130 <main+0x20>
lea    0x11e6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [1001 x i8] c"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 0, i64* %4
store i8* getelementptr inbounds ([1001 x i8], [1001 x i8]* @.str, i64 0, i64 0), i8** %5
store i32 0, i32* %1
br label %6
6: ; preds = %46, %0
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, 1000
br i1 %8, label %9, label %49
9: ; preds = %6
%10 = load i8*, i8** %5
%11 = load i32, i32* %1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 48
%17 = sext i32 %16 to i64
store i64 %17, i64* %3
%18 = load i32, i32* %1
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %20
20: ; preds = %36, %9
%21 = load i32, i32* %2
%22 = load i32, i32* %1
%23 = add nsw i32 %22, 13
%24 = icmp slt i32 %21, %23
br i1 %24, label %25, label %39
25: ; preds = %20
%26 = load i8*, i8** %5
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = sub nsw i32 %31, 48
%33 = sext i32 %32 to i64
%34 = load i64, i64* %3
%35 = mul i64 %34, %33
store i64 %35, i64* %3
br label %36
36: ; preds = %25
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %20
39: ; preds = %20
%40 = load i64, i64* %3
%41 = load i64, i64* %4
%42 = icmp ugt i64 %40, %41
br i1 %42, label %43, label %45
43: ; preds = %39
%44 = load i64, i64* %3
store i64 %44, i64* %4
br label %45
45: ; preds = %43, %39
br label %46
46: ; preds = %45
%47 = load i32, i32* %1
%48 = add nsw i32 %47, 1
store i32 %48, i32* %1
br label %6
49: ; preds = %6
%50 = load i64, i64* %4
%51 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %50)
ret void
}

LLVM IR (-O2):
@.str = [1001 x i8] c"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\00"
@.str.1 = [6 x i8] c"%llu\0A\00"
define void @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 51, %0 ], [ %15, %1 ]
%3 = phi i64 [ 0, %0 ], [ %79, %1 ]
%4 = phi i64 [ 1, %0 ], [ %13, %1 ]
%5 = phi i64 [ 0, %0 ], [ %81, %1 ]
%6 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %3
%7 = load i8, i8* %6
%8 = sext i8 %7 to i64
%9 = add nsw i64 %8, -48
%10 = sext i8 %2 to i64
%11 = add nsw i64 %10, -48
%12 = mul nsw i64 %11, %9
%13 = add nuw nsw i64 %4, 1
%14 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i64
%17 = add nsw i64 %16, -48
%18 = mul nsw i64 %17, %12
%19 = add nuw nsw i64 %4, 2
%20 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i64
%23 = add nsw i64 %22, -48
%24 = mul nsw i64 %23, %18
%25 = add nuw nsw i64 %4, 3
%26 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i64
%29 = add nsw i64 %28, -48
%30 = mul nsw i64 %29, %24
%31 = add nuw nsw i64 %4, 4
%32 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i64
%35 = add nsw i64 %34, -48
%36 = mul nsw i64 %35, %30
%37 = add nuw nsw i64 %4, 5
%38 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i64
%41 = add nsw i64 %40, -48
%42 = mul nsw i64 %41, %36
%43 = add nuw nsw i64 %4, 6
%44 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i64
%47 = add nsw i64 %46, -48
%48 = mul nsw i64 %47, %42
%49 = add nuw nsw i64 %4, 7
%50 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i64
%53 = add nsw i64 %52, -48
%54 = mul i64 %53, %48
%55 = add nuw nsw i64 %4, 8
%56 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i64
%59 = add nsw i64 %58, -48
%60 = mul i64 %59, %54
%61 = add nuw nsw i64 %4, 9
%62 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = sext i8 %63 to i64
%65 = add nsw i64 %64, -48
%66 = mul i64 %65, %60
%67 = add nuw nsw i64 %4, 10
%68 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i64
%71 = add nsw i64 %70, -48
%72 = mul i64 %71, %66
%73 = add nuw nsw i64 %4, 11
%74 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i64
%77 = add nsw i64 %76, -48
%78 = mul i64 %77, %72
%79 = add nuw nsw i64 %3, 1
%80 = icmp ugt i64 %78, %5
%81 = select i1 %80, i64 %78, i64 %5
%82 = icmp eq i64 %79, 1000
br i1 %82, label %83, label %1
83: ; preds = %1
%84 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 %81)
ret void
}