long solve() {
  char arr[1000] = "73167176531330624919225119674426574742355349194934"
                   "96983520312774506326239578318016984801869478851843"
                   "85861560789112949495459501737958331952853208805511"
                   "12540698747158523863050715693290963295227443043557"
                   "66896648950445244523161731856403098711121722383113"
                   "62229893423380308135336276614282806444486645238749"
                   "30358907296290491560440772390713810515859307960866"
                   "70172427121883998797908792274921901699720888093776"
                   "65727333001053367881220235421809751254540594752243"
                   "52584907711670556013604839586446706324415722155397"
                   "53697817977846174064955149290862569321978468622482"
                   "83972241375657056057490261407972968652414535100474"
                   "82166370484403199890008895243450658541227588666881"
                   "16427171479924442928230863465674813919123162824586"
                   "17866458359124566529476545682848912883142607690042"
                   "24219022671055626321111109370544217506941658960408"
                   "07198403850962455444362981230987879927244284909188"
                   "84580156166097919133875499200524063689912560717606"
                   "05886116467109405077541002256983155200055935729725"
                   "71636269561882670428252483600823257530420752963450";
  long max = 1L, digits = 13, p = 1L;
  for (int i = 0; i <= 1000 - digits; i++) {
    p = 1;
    for (int j = 0; j < digits; j++)
      p *= arr[i + j] - 0x30;
    if (p > max)
      max = p;
  }
  return max;
}


x86 assembly (clang, -O0):
<solve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x3f0(%rbp),%rdi
lea    0xed7(%rip),%rsi
mov    $0x3e8,%edx
call   1030 <memcpy@plt>
movq   $0x1,-0x3f8(%rbp)
movq   $0xd,-0x400(%rbp)
movq   $0x1,-0x408(%rbp)
movl   $0x0,-0x40c(%rbp)
movslq -0x40c(%rbp),%rax
mov    $0x3e8,%ecx
sub    -0x400(%rbp),%rcx
cmp    %rcx,%rax
jg     121c <solve+0x10c>
movq   $0x1,-0x408(%rbp)
movl   $0x0,-0x410(%rbp)
movslq -0x410(%rbp),%rax
cmp    -0x400(%rbp),%rax
jge    11e1 <solve+0xd1>
mov    -0x40c(%rbp),%eax
add    -0x410(%rbp),%eax
cltq
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x30,%eax
cltq
imul   -0x408(%rbp),%rax
ff
mov    %rax,-0x408(%rbp)
mov    -0x410(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x410(%rbp)
jmp    118f <solve+0x7f>
mov    -0x408(%rbp),%rax
cmp    -0x3f8(%rbp),%rax
jle    1203 <solve+0xf3>
mov    -0x408(%rbp),%rax
mov    %rax,-0x3f8(%rbp)
jmp    1208 <solve+0xf8>
mov    -0x40c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40c(%rbp)
jmp    115e <solve+0x4e>
mov    -0x3f8(%rbp),%rax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solve>:
mov    $0x1,%eax
mov    $0x37,%r9b
mov    $0xc,%ecx
lea    0xeec(%rip),%rdx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rax,%r8
movsbq %r9b,%rax
add    $0xffffffffffffffd0,%rax
movsbq -0xb(%rcx,%rdx,1),%r9
mov    %r9,%rsi
add    $0xffffffffffffffd0,%rsi
imul   %rax,%rsi
movsbq -0xa(%rcx,%rdx,1),%rax
add    $0xffffffffffffffd0,%rax
movsbq -0x9(%rcx,%rdx,1),%rdi
add    $0xffffffffffffffd0,%rdi
imul   %rax,%rdi
imul   %rsi,%rdi
movsbq -0x8(%rcx,%rdx,1),%rax
add    $0xffffffffffffffd0,%rax
movsbq -0x7(%rcx,%rdx,1),%rsi
add    $0xffffffffffffffd0,%rsi
imul   %rax,%rsi
movsbq -0x6(%rcx,%rdx,1),%rax
add    $0xffffffffffffffd0,%rax
imul   %rsi,%rax
imul   %rdi,%rax
movsbq -0x5(%rcx,%rdx,1),%rsi
add    $0xffffffffffffffd0,%rsi
movsbq -0x4(%rcx,%rdx,1),%rdi
add    $0xffffffffffffffd0,%rdi
imul   %rsi,%rdi
movsbq -0x3(%rcx,%rdx,1),%rsi
add    $0xffffffffffffffd0,%rsi
imul   %rdi,%rsi
movsbq -0x2(%rcx,%rdx,1),%rdi
add    $0xffffffffffffffd0,%rdi
imul   %rsi,%rdi
imul   %rax,%rdi
movsbq -0x1(%rcx,%rdx,1),%rsi
add    $0xffffffffffffffd0,%rsi
movsbq (%rcx,%rdx,1),%rax
add    $0xffffffffffffffd0,%rax
imul   %rsi,%rax
imul   %rdi,%rax
cmp    %r8,%rax
cmovle %r8,%rax
add    $0x1,%rcx
cmp    $0x3e8,%rcx
jne    1120 <solve+0x20>
ret

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

LLVM IR (-O2):
@__const.solve.arr = [1000 x i8] c"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"
define i64 @solve() {
br label %1
1: ; preds = %0, %1
%2 = phi i8 [ 55, %0 ], [ %9, %1 ]
%3 = phi i64 [ 0, %0 ], [ %7, %1 ]
%4 = phi i64 [ 1, %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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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 [1000 x i8], [1000 x i8]* @__const.solve.arr, 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
ret i64 %80
}