#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 *, int);
int main() {
  int curr = 0;
  int n;
  int i;
  char *string =
      "731671765313306249192251196744265747423553491949349698352031277450632623"
      "957831801698480186947885184385861560789112949495459501737958331952853208"
      "805511125406987471585238630507156932909632952274430435576689664895044524"
      "452316173185640309871112172238311362229893423380308135336276614282806444"
      "486645238749303589072962904915604407723907138105158593079608667017242712"
      "188399879790879227492190169972088809377665727333001053367881220235421809"
      "751254540594752243525849077116705560136048395864467063244157221553975369"
      "781797784617406495514929086256932197846862248283972241375657056057490261"
      "407972968652414535100474821663704844031998900088952434506585412275886668"
      "811642717147992444292823086346567481391912316282458617866458359124566529"
      "476545682848912883142607690042242190226710556263211111093705442175069416"
      "589604080719840385096245544436298123098787992724428490918884580156166097"
      "919133875499200524063689912560717606058861164671094050775410022569831552"
      "0005593572972571636269561882670428252483600823257530420752963450";
  for (i = 0; i < 995; i++)
    if ((n = ((string[i] - 48) * (string[i + 1] - 48) * (string[i + 2] - 48) *
              (string[i + 3] - 48) * (string[i + 4] - 48))) > curr)
      curr = n;
  printf("%d\n", curr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xed3(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x3e3,-0x10(%rbp)
jge    11d5 <main+0xc5>
mov    -0x18(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%edx
add    $0x4,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
mov    %eax,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jle    11c2 <main+0xb2>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    11c7 <main+0xb7>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1138 <main+0x28>
mov    -0x8(%rbp),%esi
lea    0x120a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %esi,%esi
mov    $0x37,%r10b
mov    $0x33,%al
mov    $0x31,%r11b
mov    $0x36,%dil
mov    $0x4,%ecx
lea    0xed6(%rip),%r8
nopw   0x0(%rax,%rax,1)
mov    %esi,%r9d
movsbl %r10b,%esi
mov    %eax,%r10d
movsbl %al,%edx
mov    %r11d,%eax
mov    %edi,%r11d
add    $0xffffffd0,%esi
add    $0xffffffd0,%edx
imul   %esi,%edx
movsbl %al,%esi
add    $0xffffffd0,%esi
movsbl %dil,%ebx
add    $0xffffffd0,%ebx
imul   %esi,%ebx
imul   %edx,%ebx
movsbl (%rcx,%r8,1),%edi
mov    %edi,%esi
add    $0xffffffd0,%esi
imul   %ebx,%esi
cmp    %r9d,%esi
cmovle %r9d,%esi
add    $0x1,%rcx
cmp    $0x3e7,%rcx
jne    1130 <main+0x20>
lea    0x1262(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1001 x i8] c"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
store i8* getelementptr inbounds ([1001 x i8], [1001 x i8]* @.str, i64 0, i64 0), i8** %5
store i32 0, i32* %4
br label %6
6: ; preds = %58, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 995
br i1 %8, label %9, label %61
9: ; preds = %6
%10 = load i8*, i8** %5
%11 = load i32, i32* %4
%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 = load i8*, i8** %5
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %17, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = sub nsw i32 %23, 48
%25 = mul nsw i32 %16, %24
%26 = load i8*, i8** %5
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 2
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %26, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = sub nsw i32 %32, 48
%34 = mul nsw i32 %25, %33
%35 = load i8*, i8** %5
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 3
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %35, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = sub nsw i32 %41, 48
%43 = mul nsw i32 %34, %42
%44 = load i8*, i8** %5
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 4
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds i8, i8* %44, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = sub nsw i32 %50, 48
%52 = mul nsw i32 %43, %51
store i32 %52, i32* %3
%53 = load i32, i32* %2
%54 = icmp sgt i32 %52, %53
br i1 %54, label %55, label %57
55: ; preds = %9
%56 = load i32, i32* %3
store i32 %56, i32* %2
br label %57
57: ; preds = %55, %9
br label %58
58: ; preds = %57
%59 = load i32, i32* %4
%60 = add nsw i32 %59, 1
store i32 %60, i32* %4
br label %6
61: ; preds = %6
%62 = load i32, i32* %2
%63 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %62)
ret i32 0
}

LLVM IR (-O2):
@.str = [1001 x i8] c"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 54, %0 ], [ %22, %1 ]
%3 = phi i8 [ 49, %0 ], [ %2, %1 ]
%4 = phi i8 [ 51, %0 ], [ %3, %1 ]
%5 = phi i8 [ 55, %0 ], [ %4, %1 ]
%6 = phi i64 [ 0, %0 ], [ %10, %1 ]
%7 = phi i32 [ 0, %0 ], [ %27, %1 ]
%8 = sext i8 %5 to i32
%9 = add nsw i32 %8, -48
%10 = add nuw nsw i64 %6, 1
%11 = sext i8 %4 to i32
%12 = add nsw i32 %11, -48
%13 = mul nsw i32 %12, %9
%14 = sext i8 %3 to i32
%15 = add nsw i32 %14, -48
%16 = mul nsw i32 %13, %15
%17 = sext i8 %2 to i32
%18 = add nsw i32 %17, -48
%19 = mul nsw i32 %16, %18
%20 = add nuw nsw i64 %6, 4
%21 = getelementptr inbounds [1001 x i8], [1001 x i8]* @.str, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add nsw i32 %23, -48
%25 = mul nsw i32 %19, %24
%26 = icmp sgt i32 %25, %7
%27 = select i1 %26, i32 %25, i32 %7
%28 = icmp eq i64 %10, 995
br i1 %28, label %29, label %1
29: ; preds = %1
%30 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
ret i32 0
}