#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 *, long long);
int main() {
  const int num = 13;
  char n[1001] =
      "731671765313306249192251196744265747423553491949349698352031277450632623"
      "957831801698480186947885184385861560789112949495459501737958331952853208"
      "805511125406987471585238630507156932909632952274430435576689664895044524"
      "452316173185640309871112172238311362229893423380308135336276614282806444"
      "486645238749303589072962904915604407723907138105158593079608667017242712"
      "188399879790879227492190169972088809377665727333001053367881220235421809"
      "751254540594752243525849077116705560136048395864467063244157221553975369"
      "781797784617406495514929086256932197846862248283972241375657056057490261"
      "407972968652414535100474821663704844031998900088952434506585412275886668"
      "811642717147992444292823086346567481391912316282458617866458359124566529"
      "476545682848912883142607690042242190226710556263211111093705442175069416"
      "589604080719840385096245544436298123098787992724428490918884580156166097"
      "919133875499200524063689912560717606058861164671094050775410022569831552"
      "0005593572972571636269561882670428252483600823257530420752963450";
  int i;
  long long max = 0;
  for (i = 0; i < 1001 - num; i++) {
    int j;
    long long sum = 1;
    for (j = 0; j < num; j++) {
      sum *= (n[i + j] - 48);
    }
    if (sum > max)
      max = sum;
  }
  printf("%lld\n", max);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
lea    -0x400(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x3e9,%edx
call   1040 <memcpy@plt>
movq   $0x0,-0x410(%rbp)
movl   $0x0,-0x404(%rbp)
cmpl   $0x3dc,-0x404(%rbp)
jge    1211 <main+0xf1>
movq   $0x1,-0x420(%rbp)
movl   $0x0,-0x414(%rbp)
cmpl   $0xd,-0x414(%rbp)
jge    11d6 <main+0xb6>
mov    -0x404(%rbp),%eax
add    -0x414(%rbp),%eax
cltq
movsbl -0x400(%rbp,%rax,1),%eax
ff
sub    $0x30,%eax
cltq
imul   -0x420(%rbp),%rax
ff
mov    %rax,-0x420(%rbp)
mov    -0x414(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x414(%rbp)
jmp    118b <main+0x6b>
mov    -0x420(%rbp),%rax
cmp    -0x410(%rbp),%rax
jle    11f8 <main+0xd8>
mov    -0x420(%rbp),%rax
mov    %rax,-0x410(%rbp)
jmp    11fd <main+0xdd>
mov    -0x404(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x404(%rbp)
jmp    1166 <main+0x46>
mov    -0x410(%rbp),%rsi
lea    0x11ca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@__const.main.n = [1001 x i8] c"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\00"
@.str = [6 x i8] c"%lld\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 55, %0 ], [ %9, %1 ]
%3 = phi i64 [ 0, %0 ], [ %7, %1 ]
%4 = phi i64 [ 0, %0 ], [ %80, %1 ]
%5 = sext i8 %2 to i64
%6 = add nsw i64 %5, -48
%7 = add nuw nsw i64 %3, 1
%8 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = sext i8 %9 to i64
%11 = add nsw i64 %10, -48
%12 = mul nsw i64 %11, %6
%13 = add nuw nsw i64 %3, 2
%14 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, 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 %3, 3
%20 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, 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 %3, 4
%26 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, 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 %3, 5
%32 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, 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 %3, 6
%38 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, 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 %3, 7
%44 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, 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 %3, 8
%50 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i64
%53 = add nsw i64 %52, -48
%54 = mul nsw i64 %53, %48
%55 = add nuw nsw i64 %3, 9
%56 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = sext i8 %57 to i64
%59 = add nsw i64 %58, -48
%60 = mul nsw i64 %59, %54
%61 = add nuw nsw i64 %3, 10
%62 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = sext i8 %63 to i64
%65 = add nsw i64 %64, -48
%66 = mul nsw i64 %65, %60
%67 = add nuw nsw i64 %3, 11
%68 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i64
%71 = add nsw i64 %70, -48
%72 = mul nsw i64 %71, %66
%73 = add nuw nsw i64 %3, 12
%74 = getelementptr inbounds [1001 x i8], [1001 x i8]* @__const.main.n, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = sext i8 %75 to i64
%77 = add nsw i64 %76, -48
%78 = mul nsw i64 %77, %72
%79 = icmp sgt i64 %78, %4
%80 = select i1 %79, i64 %78, i64 %4
%81 = icmp eq i64 %7, 988
br i1 %81, label %82, label %1
82: ; preds = %1
%83 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 %80)
ret i32 0
}