long solution() {
  char number[1000] =
      "731671765313306249192251196744265747423553491949349698352031277450632623"
      "957831801698480186947885184385861560789112949495459501737958331952853208"
      "805511125406987471585238630507156932909632952274430435576689664895044524"
      "452316173185640309871112172238311362229893423380308135336276614282806444"
      "486645238749303589072962904915604407723907138105158593079608667017242712"
      "188399879790879227492190169972088809377665727333001053367881220235421809"
      "751254540594752243525849077116705560136048395864467063244157221553975369"
      "781797784617406495514929086256932197846862248283972241375657056057490261"
      "407972968652414535100474821663704844031998900088952434506585412275886668"
      "811642717147992444292823086346567481391912316282458617866458359124566529"
      "476545682848912883142607690042242190226710556263211111093705442175069416"
      "589604080719840385096245544436298123098787992724428490918884580156166097"
      "919133875499200524063689912560717606058861164671094050775410022569831552"
      "0005593572972571636269561882670428252483600823257530420752963450";
  int i, y, x, value;
  long result, max_result;
  max_result = 0L;
  y = 13;
  result = number[0] - '0';
  for (i = 1; i < 1000; i++) {
    for (x = i; x < y; x++) {
      value = number[x] - '0';
      if (value == 0) {
        break;
      }
      result = result * (number[x] - '0');
    }
    if (result > max_result) {
      max_result = result;
    }
    result = number[i] - '0';
    y++;
  }
  return max_result;
}


x86 assembly (clang, -O0):
<solution>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
lea    -0x3f0(%rbp),%rdi
lea    0xed7(%rip),%rsi
mov    $0x3e8,%edx
call   1030 <memcpy@plt>
movq   $0x0,-0x410(%rbp)
movl   $0xd,-0x3f8(%rbp)
movsbl -0x3f0(%rbp),%eax
sub    $0x30,%eax
cltq
mov    %rax,-0x408(%rbp)
movl   $0x1,-0x3f4(%rbp)
cmpl   $0x3e8,-0x3f4(%rbp)
jge    1258 <solution+0x148>
mov    -0x3f4(%rbp),%eax
mov    %eax,-0x3fc(%rbp)
mov    -0x3fc(%rbp),%eax
cmp    -0x3f8(%rbp),%eax
jge    11f8 <solution+0xe8>
movslq -0x3fc(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x30,%eax
mov    %eax,-0x400(%rbp)
cmpl   $0x0,-0x400(%rbp)
jne    11bd <solution+0xad>
jmp    11f8 <solution+0xe8>
mov    -0x408(%rbp),%rax
movslq -0x3fc(%rbp),%rcx
movsbl -0x3f0(%rbp,%rcx,1),%ecx
ff
sub    $0x30,%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
mov    %rax,-0x408(%rbp)
mov    -0x3fc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3fc(%rbp)
jmp    1181 <solution+0x71>
mov    -0x408(%rbp),%rax
cmp    -0x410(%rbp),%rax
jle    121a <solution+0x10a>
mov    -0x408(%rbp),%rax
mov    %rax,-0x410(%rbp)
movslq -0x3f4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
sub    $0x30,%eax
cltq
mov    %rax,-0x408(%rbp)
mov    -0x3f8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f8(%rbp)
mov    -0x3f4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3f4(%rbp)
jmp    1165 <solution+0x55>
mov    -0x410(%rbp),%rax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solution>:
mov    $0x7,%edx
mov    $0xc,%ecx
xor    %eax,%eax
lea    0xeed(%rip),%r8
jmp    1138 <solution+0x38>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %rax,%rdi
cmovg  %rdi,%rax
add    $0x1,%rcx
cmp    $0x3f3,%rcx
je     1233 <solution+0x133>
mov    %rdx,%rdi
movsbq -0xb(%rcx,%r8,1),%rdx
add    $0xffffffffffffffd0,%rdx
test   %edx,%edx
je     1120 <solution+0x20>
imul   %rdx,%rdi
movsbq -0xa(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x9(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x8(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x7(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x6(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x5(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x4(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x3(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x2(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq -0x1(%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
movsbq (%rcx,%r8,1),%rsi
add    $0xffffffffffffffd0,%rsi
test   %esi,%esi
je     1120 <solution+0x20>
imul   %rsi,%rdi
jmp    1120 <solution+0x20>
ret

LLVM IR (-O0):
@__const.solution.number = [1000 x i8] c"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"
define i64 @solution() {
%1 = alloca [1000 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = bitcast [1000 x i8]* %1 to i8*
store i64 0, i64* %7
store i32 13, i32* %3
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = sub nsw i32 %11, 48
%13 = sext i32 %12 to i64
store i64 %13, i64* %6
store i32 1, i32* %2
br label %14
14: ; preds = %62, %0
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 1000
br i1 %16, label %17, label %65
17: ; preds = %14
%18 = load i32, i32* %2
store i32 %18, i32* %4
br label %19
19: ; preds = %43, %17
%20 = load i32, i32* %4
%21 = load i32, i32* %3
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %46
23: ; preds = %19
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = sub nsw i32 %28, 48
store i32 %29, i32* %5
%30 = load i32, i32* %5
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %23
br label %46
33: ; preds = %23
%34 = load i64, i64* %6
%35 = load i32, i32* %4
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = sub nsw i32 %39, 48
%41 = sext i32 %40 to i64
%42 = mul nsw i64 %34, %41
store i64 %42, i64* %6
br label %43
43: ; preds = %33
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %19
46: ; preds = %32, %19
%47 = load i64, i64* %6
%48 = load i64, i64* %7
%49 = icmp sgt i64 %47, %48
br i1 %49, label %50, label %52
50: ; preds = %46
%51 = load i64, i64* %6
store i64 %51, i64* %7
br label %52
52: ; preds = %50, %46
%53 = load i32, i32* %2
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = sext i8 %56 to i32
%58 = sub nsw i32 %57, 48
%59 = sext i32 %58 to i64
store i64 %59, i64* %6
%60 = load i32, i32* %3
%61 = add nsw i32 %60, 1
store i32 %61, i32* %3
br label %62
62: ; preds = %52
%63 = load i32, i32* %2
%64 = add nsw i32 %63, 1
store i32 %64, i32* %2
br label %14
65: ; preds = %14
%66 = load i64, i64* %7
ret i64 %66
}

LLVM IR (-O2):
@__const.solution.number = [1000 x i8] c"7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729629049156044077239071381051585930796086670172427121883998797908792274921901699720888093776657273330010533678812202354218097512545405947522435258490771167055601360483958644670632441572215539753697817977846174064955149290862569321978468622482839722413756570560574902614079729686524145351004748216637048440319989000889524345065854122758866688116427171479924442928230863465674813919123162824586178664583591245665294765456828489128831426076900422421902267105562632111110937054421750694165896040807198403850962455444362981230987879927244284909188845801561660979191338754992005240636899125607176060588611646710940507754100225698315520005593572972571636269561882670428252483600823257530420752963450"
define i64 @solution() {
br label %1
1: ; preds = %112, %0
%2 = phi i64 [ 1, %0 ], [ %118, %112 ]
%3 = phi i64 [ 0, %0 ], [ %115, %112 ]
%4 = phi i64 [ 7, %0 ], [ %117, %112 ]
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, -48
%9 = icmp eq i32 %8, 0
br i1 %9, label %112, label %10
10: ; preds = %1
%11 = sext i32 %8 to i64
%12 = mul nsw i64 %4, %11
%13 = add nuw nsw i64 %2, 1
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = add nsw i32 %16, -48
%18 = icmp eq i32 %17, 0
br i1 %18, label %112, label %19
19: ; preds = %10
%20 = sext i32 %17 to i64
%21 = mul nsw i64 %12, %20
%22 = add nuw nsw i64 %2, 2
%23 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = add nsw i32 %25, -48
%27 = icmp eq i32 %26, 0
br i1 %27, label %112, label %28
28: ; preds = %19
%29 = sext i32 %26 to i64
%30 = mul nsw i64 %21, %29
%31 = add nuw nsw i64 %2, 3
%32 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = add nsw i32 %34, -48
%36 = icmp eq i32 %35, 0
br i1 %36, label %112, label %37
37: ; preds = %28
%38 = sext i32 %35 to i64
%39 = mul nsw i64 %30, %38
%40 = add nuw nsw i64 %2, 4
%41 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = add nsw i32 %43, -48
%45 = icmp eq i32 %44, 0
br i1 %45, label %112, label %46
46: ; preds = %37
%47 = sext i32 %44 to i64
%48 = mul nsw i64 %39, %47
%49 = add nuw nsw i64 %2, 5
%50 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = add nsw i32 %52, -48
%54 = icmp eq i32 %53, 0
br i1 %54, label %112, label %55
55: ; preds = %46
%56 = sext i32 %53 to i64
%57 = mul nsw i64 %48, %56
%58 = add nuw nsw i64 %2, 6
%59 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = sext i8 %60 to i32
%62 = add nsw i32 %61, -48
%63 = icmp eq i32 %62, 0
br i1 %63, label %112, label %64
64: ; preds = %55
%65 = sext i32 %62 to i64
%66 = mul nsw i64 %57, %65
%67 = add nuw nsw i64 %2, 7
%68 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i32
%71 = add nsw i32 %70, -48
%72 = icmp eq i32 %71, 0
br i1 %72, label %112, label %73
73: ; preds = %64
%74 = sext i32 %71 to i64
%75 = mul nsw i64 %66, %74
%76 = add nuw nsw i64 %2, 8
%77 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = add nsw i32 %79, -48
%81 = icmp eq i32 %80, 0
br i1 %81, label %112, label %82
82: ; preds = %73
%83 = sext i32 %80 to i64
%84 = mul nsw i64 %75, %83
%85 = add nuw nsw i64 %2, 9
%86 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = add nsw i32 %88, -48
%90 = icmp eq i32 %89, 0
br i1 %90, label %112, label %91
91: ; preds = %82
%92 = sext i32 %89 to i64
%93 = mul nsw i64 %84, %92
%94 = add nuw nsw i64 %2, 10
%95 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %94
%96 = load i8, i8* %95
%97 = sext i8 %96 to i32
%98 = add nsw i32 %97, -48
%99 = icmp eq i32 %98, 0
br i1 %99, label %112, label %100
100: ; preds = %91
%101 = sext i32 %98 to i64
%102 = mul nsw i64 %93, %101
%103 = add nuw nsw i64 %2, 11
%104 = getelementptr inbounds [1000 x i8], [1000 x i8]* @__const.solution.number, i64 0, i64 %103
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = add nsw i32 %106, -48
%108 = icmp eq i32 %107, 0
br i1 %108, label %112, label %109
109: ; preds = %100
%110 = sext i32 %107 to i64
%111 = mul nsw i64 %102, %110
br label %112
112: ; preds = %1, %10, %19, %28, %37, %46, %55, %64, %73, %82, %91, %100, %109
%113 = phi i64 [ %4, %1 ], [ %12, %10 ], [ %21, %19 ], [ %30, %28 ], [ %39, %37 ], [ %48, %46 ], [ %57, %55 ], [ %66, %64 ], [ %75, %73 ], [ %84, %82 ], [ %93, %91 ], [ %102, %100 ], [ %111, %109 ]
%114 = icmp sgt i64 %113, %3
%115 = select i1 %114, i64 %113, i64 %3
%116 = sext i8 %6 to i64
%117 = add nsw i64 %116, -48
%118 = add nuw nsw i64 %2, 1
%119 = icmp eq i64 %118, 1000
br i1 %119, label %120, label %1
120: ; preds = %112
ret i64 %115
}