#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 int);
size_t strlen(char *);
int main(int argc, char *argv[]) {
  char *n =
      "731671765313306249192251196744265747423553491949349698352031277450632623"
      "957831801698480186947885184385861560789112949495459501737958331952853208"
      "805511125406987471585238630507156932909632952274430435576689664895044524"
      "452316173185640309871112172238311362229893423380308135336276614282806444"
      "486645238749303589072962904915604407723907138105158593079608667017242712"
      "188399879790879227492190169972088809377665727333001053367881220235421809"
      "751254540594752243525849077116705560136048395864467063244157221553975369"
      "781797784617406495514929086256932197846862248283972241375657056057490261"
      "407972968652414535100474821663704844031998900088952434506585412275886668"
      "811642717147992444292823086346567481391912316282458617866458359124566529"
      "476545682848912883142607690042242190226710556263211111093705442175069416"
      "589604080719840385096245544436298123098787992724428490918884580156166097"
      "919133875499200524063689912560717606058861164671094050775410022569831552"
      "0005593572972571636269561882670428252483600823257530420752963450";
  size_t len = strlen(n);
  unsigned int max = 0;
  for (int i = 0; i < len; i++) {
    unsigned int p = (n[i] - '0') * (n[i + 1] - '0') * (n[i + 2] - '0') *
                     (n[i + 3] - '0') * (n[i + 4] - '0');
    max = (max > p) ? max : p;
  }
  printf("%i", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movslq -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1209 <main+0xe9>
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x30,%eax
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%edx
add    $0x2,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%edx
add    $0x3,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%edx
add    $0x4,%edx
movslq %edx,%rdx
movsbl (%rcx,%rdx,1),%ecx
sub    $0x30,%ecx
imul   %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jbe    11ef <main+0xcf>
mov    -0x24(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    11f5 <main+0xd5>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    115c <main+0x3c>
mov    -0x24(%rbp),%esi
lea    0x11d6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %esi,%esi
mov    $0x37,%r9b
mov    $0x33,%dl
mov    $0x31,%r11b
mov    $0x36,%dil
mov    $0x4,%ecx
lea    0xed6(%rip),%r8
nopw   0x0(%rax,%rax,1)
mov    %esi,%r10d
movsbl %r9b,%esi
mov    %edx,%r9d
movsbl %dl,%eax
mov    %r11d,%edx
mov    %edi,%r11d
add    $0xffffffd0,%esi
add    $0xffffffd0,%eax
imul   %esi,%eax
movsbl %dl,%esi
add    $0xffffffd0,%esi
movsbl %dil,%ebx
add    $0xffffffd0,%ebx
imul   %esi,%ebx
imul   %eax,%ebx
movsbl (%rcx,%r8,1),%edi
mov    %edi,%esi
add    $0xffffffd0,%esi
imul   %ebx,%esi
cmp    %esi,%r10d
cmova  %r10d,%esi
add    $0x1,%rcx
cmp    $0x3ec,%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 = [3 x i8] c"%i\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([1001 x i8], [1001 x i8]* @.str, i64 0, i64 0), i8** %6
%11 = load i8*, i8** %6
%12 = call i64 @strlen(i8* %11)
store i64 %12, i64* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %13
13: ; preds = %71, %2
%14 = load i32, i32* %9
%15 = sext i32 %14 to i64
%16 = load i64, i64* %7
%17 = icmp ult i64 %15, %16
br i1 %17, label %18, label %74
18: ; preds = %13
%19 = load i8*, i8** %6
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = sub nsw i32 %24, 48
%26 = load i8*, i8** %6
%27 = load i32, i32* %9
%28 = add nsw i32 %27, 1
%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** %6
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 2
%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** %6
%45 = load i32, i32* %9
%46 = add nsw i32 %45, 3
%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
%53 = load i8*, i8** %6
%54 = load i32, i32* %9
%55 = add nsw i32 %54, 4
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %53, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = sub nsw i32 %59, 48
%61 = mul nsw i32 %52, %60
store i32 %61, i32* %10
%62 = load i32, i32* %8
%63 = load i32, i32* %10
%64 = icmp ugt i32 %62, %63
br i1 %64, label %65, label %67
65: ; preds = %18
%66 = load i32, i32* %8
br label %69
67: ; preds = %18
%68 = load i32, i32* %10
br label %69
69: ; preds = %67, %65
%70 = phi i32 [ %66, %65 ], [ %68, %67 ]
store i32 %70, i32* %8
br label %71
71: ; preds = %69
%72 = load i32, i32* %9
%73 = add nsw i32 %72, 1
store i32 %73, i32* %9
br label %13
74: ; preds = %13
%75 = load i32, i32* %8
%76 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %75)
ret i32 0
}

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