#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int getc(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  unsigned long long res = 0;
  char buffer[512];
  printf("Enter the name of the input file: ");
  if (fgets(buffer, 512, stdin) == NULL) {
    perror("fgets");
    exit(EXIT_FAILURE);
  }
  buffer[strlen(buffer) - 1] = '\0';
  FILE *input_file = fopen(buffer, "r");
  if (input_file == NULL) {
    perror("fopen");
    exit(EXIT_FAILURE);
  }
  unsigned long long temp = 1;
  int digits[13];
  int digits_size = 0;
  int index = 0;
  int input;
  while ((input = getc(input_file)) != EOF) {
    if (input < '0' || input > '9') {
      continue;
    }
    int digit = input - '0';
    if (digit == 0) {
      digits_size = 0;
      index = 0;
      temp = 1;
    } else {
      if (digits_size < 13) {
        digits[digits_size++] = digit;
        temp *= digit;
        if (digits_size == 13 && temp > res) {
          res = temp;
        }
      } else {
        temp /= digits[index];
        temp *= digit;
        digits[index] = digit;
        index = (index + 1) % 13;
        if (temp > res) {
          res = temp;
        }
      }
    }
  }
  fclose(input_file);
  printf("If you can trust me, the number you "
         "are looking for is %llu\n",
         res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x270,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x210(%rbp),%rdi
mov    0x2e32(%rip),%rax
mov    (%rax),%edx
mov    $0x200,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
jne    11e6 <main+0x66>
lea    0xe50(%rip),%rdi
call   1080 <perror@plt>
mov    0x2df1(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
lea    -0x210(%rbp),%rdi
call   1040 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0x210(%rbp,%rax,1)
lea    -0x210(%rbp),%rdi
lea    0xe1c(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x218(%rbp)
cmpq   $0x0,-0x218(%rbp)
jne    1241 <main+0xc1>
lea    0xdfd(%rip),%rdi
call   1080 <perror@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>
movq   $0x1,-0x220(%rbp)
movl   $0x0,-0x264(%rbp)
movl   $0x0,-0x268(%rbp)
mov    -0x218(%rbp),%rdi
call   10a0 <getc@plt>
mov    %eax,-0x26c(%rbp)
mov    0x2d67(%rip),%rcx
cmp    (%rcx),%eax
je     13df <main+0x25f>
cmpl   $0x30,-0x26c(%rbp)
jl     129b <main+0x11b>
cmpl   $0x39,-0x26c(%rbp)
jle    12a0 <main+0x120>
jmp    1260 <main+0xe0>
mov    -0x26c(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x270(%rbp)
cmpl   $0x0,-0x270(%rbp)
jne    12e0 <main+0x160>
movl   $0x0,-0x264(%rbp)
movl   $0x0,-0x268(%rbp)
movq   $0x1,-0x220(%rbp)
jmp    13da <main+0x25a>
cmpl   $0xd,-0x264(%rbp)
jge    1351 <main+0x1d1>
mov    -0x270(%rbp),%ecx
mov    -0x264(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x264(%rbp)
cltq
mov    %ecx,-0x260(%rbp,%rax,4)
movslq -0x270(%rbp),%rax
imul   -0x220(%rbp),%rax
ff
mov    %rax,-0x220(%rbp)
cmpl   $0xd,-0x264(%rbp)
jne    134c <main+0x1cc>
mov    -0x220(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    134c <main+0x1cc>
mov    -0x220(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    13d5 <main+0x255>
movslq -0x268(%rbp),%rax
movslq -0x260(%rbp,%rax,4),%rcx
ff
mov    -0x220(%rbp),%rax
xor    %edx,%edx
div    %rcx
mov    %rax,-0x220(%rbp)
movslq -0x270(%rbp),%rax
imul   -0x220(%rbp),%rax
ff
mov    %rax,-0x220(%rbp)
mov    -0x270(%rbp),%ecx
movslq -0x268(%rbp),%rax
mov    %ecx,-0x260(%rbp,%rax,4)
mov    -0x268(%rbp),%eax
add    $0x1,%eax
mov    $0xd,%ecx
cltd
idiv   %ecx
mov    %edx,-0x268(%rbp)
mov    -0x220(%rbp),%rax
cmp    -0x10(%rbp),%rax
jbe    13d0 <main+0x250>
mov    -0x220(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    13d5 <main+0x255>
jmp    13da <main+0x25a>
jmp    1260 <main+0xe0>
mov    -0x218(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rsi
lea    0xc3b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x270,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x248,%rsp
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e42(%rip),%rax
mov    (%rax),%edx
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     12f9 <main+0x179>
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
lea    0xe50(%rip),%rsi
mov    %rbx,%rdi
call   1070 <fopen@plt>
test   %rax,%rax
je     1302 <main+0x182>
mov    %rax,%rbx
mov    $0x1,%r15d
xor    %r13d,%r13d
mov    0x2de3(%rip),%r12
xor    %ebp,%ebp
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   10a0 <getc@plt>
cmp    (%r12),%eax
je     12cc <main+0x14c>
mov    %eax,%ecx
lea    -0x3a(%rcx),%eax
cmp    $0xfffffff6,%eax
jb     1210 <main+0x90>
add    $0xffffffd0,%ecx
je     1290 <main+0x110>
cmp    $0xc,%r13d
jle    12a0 <main+0x120>
movslq %ebp,%rsi
movslq (%rsp,%rsi,4),%rdi
mov    %r15,%rax
or     %rdi,%rax
shr    $0x20,%rax
je     1254 <main+0xd4>
mov    %r15,%rax
xor    %edx,%edx
div    %rdi
jmp    125b <main+0xdb>
mov    %r15d,%eax
xor    %edx,%edx
div    %edi
mov    %ecx,%r15d
imul   %rax,%r15
mov    %ecx,(%rsp,%rsi,4)
add    $0x1,%esi
movslq %esi,%rbp
imul   $0x4ec4ec4f,%rbp,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%ecx
lea    (%rax,%rcx,4),%eax
sub    %eax,%ebp
cmp    %r14,%r15
cmova  %r15,%r14
jmp    1210 <main+0x90>
xor    %r13d,%r13d
xor    %ebp,%ebp
mov    $0x1,%r15d
jmp    1210 <main+0x90>
movslq %r13d,%rax
add    $0x1,%r13d
mov    %ecx,(%rsp,%rax,4)
mov    %ecx,%eax
imul   %rax,%r15
cmp    $0xd,%r13d
jne    1210 <main+0x90>
cmp    %r14,%r15
cmova  %r15,%r14
mov    $0xd,%r13d
jmp    1210 <main+0x90>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0xd56(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x248,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd23(%rip),%rdi
jmp    1309 <main+0x189>
lea    0xd22(%rip),%rdi
call   1080 <perror@plt>
mov    0x2cbb(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"Enter the name of the input file: \00"
@stdin = global i32 0
@.str.1 = [6 x i8] c"fgets\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [6 x i8] c"fopen\00"
@EOF = global i32 0
@.str.4 = [61 x i8] c"If you can trust me, the number you are looking for is %llu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca [512 x i8]
%4 = alloca i32*
%5 = alloca i64
%6 = alloca [13 x i32]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i64 0, i64* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i32* @fgets(i8* %12, i32 512, i32 %13)
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %20
16: ; preds = %0
%17 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @EXIT_FAILURE
%19 = call i32 @exit(i32 %18)
unreachable
20: ; preds = %0
%21 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
%23 = sub nsw i32 %22, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 %24
store i8 0, i8* %25
%26 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
store i32* %27, i32** %4
%28 = load i32*, i32** %4
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %34
30: ; preds = %20
%31 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%32 = load i32, i32* @EXIT_FAILURE
%33 = call i32 @exit(i32 %32)
unreachable
34: ; preds = %20
store i64 1, i64* %5
store i32 0, i32* %7
store i32 0, i32* %8
br label %35
35: ; preds = %101, %46, %34
%36 = load i32*, i32** %4
%37 = call i32 @getc(i32* %36)
store i32 %37, i32* %9
%38 = load i32, i32* @EOF
%39 = icmp ne i32 %37, %38
br i1 %39, label %40, label %102
40: ; preds = %35
%41 = load i32, i32* %9
%42 = icmp slt i32 %41, 48
br i1 %42, label %46, label %43
43: ; preds = %40
%44 = load i32, i32* %9
%45 = icmp sgt i32 %44, 57
br i1 %45, label %46, label %47
46: ; preds = %43, %40
br label %35
47: ; preds = %43
%48 = load i32, i32* %9
%49 = sub nsw i32 %48, 48
store i32 %49, i32* %10
%50 = load i32, i32* %10
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %53
52: ; preds = %47
store i32 0, i32* %7
store i32 0, i32* %8
store i64 1, i64* %5
br label %101
53: ; preds = %47
%54 = load i32, i32* %7
%55 = icmp slt i32 %54, 13
br i1 %55, label %56, label %75
56: ; preds = %53
%57 = load i32, i32* %10
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
store i32 %59, i32* %7
%60 = sext i32 %58 to i64
%61 = getelementptr inbounds [13 x i32], [13 x i32]* %6, i64 0, i64 %60
store i32 %57, i32* %61
%62 = load i32, i32* %10
%63 = sext i32 %62 to i64
%64 = load i64, i64* %5
%65 = mul i64 %64, %63
store i64 %65, i64* %5
%66 = load i32, i32* %7
%67 = icmp eq i32 %66, 13
br i1 %67, label %68, label %74
68: ; preds = %56
%69 = load i64, i64* %5
%70 = load i64, i64* %2
%71 = icmp ugt i64 %69, %70
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = load i64, i64* %5
store i64 %73, i64* %2
br label %74
74: ; preds = %72, %68, %56
br label %100
75: ; preds = %53
%76 = load i32, i32* %8
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [13 x i32], [13 x i32]* %6, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = sext i32 %79 to i64
%81 = load i64, i64* %5
%82 = udiv i64 %81, %80
store i64 %82, i64* %5
%83 = load i32, i32* %10
%84 = sext i32 %83 to i64
%85 = load i64, i64* %5
%86 = mul i64 %85, %84
store i64 %86, i64* %5
%87 = load i32, i32* %10
%88 = load i32, i32* %8
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [13 x i32], [13 x i32]* %6, i64 0, i64 %89
store i32 %87, i32* %90
%91 = load i32, i32* %8
%92 = add nsw i32 %91, 1
%93 = srem i32 %92, 13
store i32 %93, i32* %8
%94 = load i64, i64* %5
%95 = load i64, i64* %2
%96 = icmp ugt i64 %94, %95
br i1 %96, label %97, label %99
97: ; preds = %75
%98 = load i64, i64* %5
store i64 %98, i64* %2
br label %99
99: ; preds = %97, %75
br label %100
100: ; preds = %99, %74
br label %101
101: ; preds = %100, %52
br label %35
102: ; preds = %35
%103 = load i32*, i32** %4
%104 = call i32 @fclose(i32* %103)
%105 = load i64, i64* %2
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0), i64 %105)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"Enter the name of the input file: \00"
@stdin = global i32 0
@.str.1 = [6 x i8] c"fgets\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [2 x i8] c"r\00"
@.str.3 = [6 x i8] c"fopen\00"
@EOF = global i32 0
@.str.4 = [61 x i8] c"If you can trust me, the number you are looking for is %llu\0A\00"
define i32 @main() {
%1 = alloca [512 x i8]
%2 = alloca [13 x i32]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdin
%6 = call i32* @fgets(i8* %3, i32 512, i32 %5)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %0
%13 = call i32 @strlen(i8* %3)
%14 = add nsw i32 %13, -1
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [512 x i8], [512 x i8]* %1, i64 0, i64 %15
store i8 0, i8* %16
%17 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %23
19: ; preds = %12
%20 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%21 = load i32, i32* @EXIT_FAILURE
%22 = call i32 @exit(i32 %21)
unreachable
23: ; preds = %12
%24 = bitcast [13 x i32]* %2 to i8*
br label %25
25: ; preds = %53, %23
%26 = phi i32 [ 0, %23 ], [ %54, %53 ]
%27 = phi i32 [ 0, %23 ], [ %55, %53 ]
%28 = phi i64 [ 1, %23 ], [ %56, %53 ]
%29 = phi i64 [ 0, %23 ], [ %57, %53 ]
%30 = icmp slt i32 %26, 13
br label %31
31: ; preds = %25, %61
%32 = phi i32 [ %70, %61 ], [ %27, %25 ]
%33 = phi i64 [ %68, %61 ], [ %28, %25 ]
%34 = phi i64 [ %72, %61 ], [ %29, %25 ]
br label %35
35: ; preds = %31, %39
%36 = call i32 @getc(i32* %17)
%37 = load i32, i32* @EOF
%38 = icmp eq i32 %36, %37
br i1 %38, label %73, label %39
39: ; preds = %35
%40 = add i32 %36, -58
%41 = icmp ult i32 %40, -10
br i1 %41, label %35, label %42
42: ; preds = %39
%43 = add nsw i32 %36, -48
%44 = icmp eq i32 %43, 0
br i1 %44, label %53, label %45
45: ; preds = %42
br i1 %30, label %46, label %61
46: ; preds = %45
%47 = add nsw i32 %26, 1
%48 = sext i32 %26 to i64
%49 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 %48
store i32 %43, i32* %49
%50 = zext i32 %43 to i64
%51 = mul i64 %33, %50
%52 = icmp eq i32 %47, 13
br i1 %52, label %58, label %53
53: ; preds = %42, %46, %58
%54 = phi i32 [ 13, %58 ], [ %47, %46 ], [ 0, %42 ]
%55 = phi i32 [ %32, %58 ], [ %32, %46 ], [ 0, %42 ]
%56 = phi i64 [ %51, %58 ], [ %51, %46 ], [ 1, %42 ]
%57 = phi i64 [ %60, %58 ], [ %34, %46 ], [ %34, %42 ]
br label %25
58: ; preds = %46
%59 = icmp ugt i64 %51, %34
%60 = select i1 %59, i64 %51, i64 %34
br label %53
61: ; preds = %45
%62 = sext i32 %32 to i64
%63 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 %62
%64 = load i32, i32* %63
%65 = sext i32 %64 to i64
%66 = udiv i64 %33, %65
%67 = zext i32 %43 to i64
%68 = mul i64 %66, %67
store i32 %43, i32* %63
%69 = add nsw i32 %32, 1
%70 = srem i32 %69, 13
%71 = icmp ugt i64 %68, %34
%72 = select i1 %71, i64 %68, i64 %34
br label %31
73: ; preds = %35
%74 = call i32 @fclose(i32* %17)
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0), i64 %34)
ret i32 0
}