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

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int INT_MAX;
scalar_t__ char2int(char);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int getline(char **, size_t *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memmove(char *, char *, int);
int /*<<< orphan*/ printf(char *, unsigned long long);
int main() {
  char arr[100][50];
  int n = 0;
  FILE *fp;
  char *line = NULL;
  size_t len = 0;
  ssize_t read;
  fp = fopen("13.txt", "r");
  if (fp == NULL)
    exit(EXIT_FAILURE);
  while ((read = getline(&line, &len, fp)) != -1) {
    memmove(arr[n++], line, 50);
  }
  if (line)
    free(line);
  printf("echo :%i", INT_MAX);
  int i, j;
  int sqare[100][50];
  unsigned long long tmp = 0;
  int res[100] = {0};
  for (i = 0; i < 100; i++) {
    for (j = 0; j < 50; j++) {
      tmp += tmp * 10 + char2int(arr[i][j]);
    }
    res[i] = tmp;
    printf("%ld\n", tmp);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x6390,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1394(%rbp)
movq   $0x0,-0x13a8(%rbp)
movq   $0x0,-0x13b0(%rbp)
lea    0xe47(%rip),%rdi
lea    0xe47(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x13a0(%rbp)
cmpq   $0x0,-0x13a0(%rbp)
jne    11e8 <main+0x68>
mov    0x2df7(%rip),%rax
mov    (%rax),%edi
call   10a0 <exit@plt>
jmp    11ed <main+0x6d>
mov    -0x13a0(%rbp),%rdx
lea    -0x13a8(%rbp),%rdi
lea    -0x13b0(%rbp),%rsi
call   1090 <getline@plt>
mov    %eax,-0x13b4(%rbp)
cmp    $0xffffffff,%eax
je     124d <main+0xcd>
mov    -0x1394(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x1394(%rbp)
cltq
lea    -0x1390(%rbp),%rdi
imul   $0x32,%rax,%rax
add    %rax,%rdi
mov    -0x13a8(%rbp),%rsi
mov    $0x32,%edx
call   1070 <memmove@plt>
jmp    11ed <main+0x6d>
cmpq   $0x0,-0x13a8(%rbp)
je     1267 <main+0xe7>
mov    -0x13a8(%rbp),%rdi
call   1030 <free@plt>
mov    0x2d7a(%rip),%rax
movslq (%rax),%rsi
lea    0xd91(%rip),%rdi
call   1040 <printf@plt>
movq   $0x0,-0x61e8(%rbp)
lea    -0x6380(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1050 <memset@plt>
movl   $0x0,-0x13b8(%rbp)
cmpl   $0x64,-0x13b8(%rbp)
jge    136a <main+0x1ea>
movl   $0x0,-0x13bc(%rbp)
cmpl   $0x32,-0x13bc(%rbp)
jge    132c <main+0x1ac>
imul   $0xa,-0x61e8(%rbp),%rax
0a
mov    %rax,-0x6388(%rbp)
movslq -0x13b8(%rbp),%rcx
lea    -0x1390(%rbp),%rax
imul   $0x32,%rcx,%rcx
add    %rcx,%rax
movslq -0x13bc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1060 <char2int@plt>
mov    %rax,%rcx
mov    -0x6388(%rbp),%rax
add    %rcx,%rax
add    -0x61e8(%rbp),%rax
mov    %rax,-0x61e8(%rbp)
mov    -0x13bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13bc(%rbp)
jmp    12bc <main+0x13c>
mov    -0x61e8(%rbp),%rax
mov    %eax,%ecx
movslq -0x13b8(%rbp),%rax
mov    %ecx,-0x6380(%rbp,%rax,4)
mov    -0x61e8(%rbp),%rsi
lea    0xcc1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x13b8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x13b8(%rbp)
jmp    12a5 <main+0x125>
mov    -0x4(%rbp),%eax
add    $0x6390,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x13a0,%rsp
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe68(%rip),%rdi
lea    0xe68(%rip),%rsi
call   1070 <fopen@plt>
test   %rax,%rax
je     1297 <main+0x127>
mov    %rax,%r14
mov    %rsp,%rdi
lea    0x8(%rsp),%rsi
mov    %rax,%rdx
call   1080 <getline@plt>
cmp    $0xffffffff,%eax
je     1208 <main+0x98>
lea    0x10(%rsp),%rbx
mov    %rsp,%r15
lea    0x8(%rsp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsp),%rsi
mov    %rbx,%rdi
mov    $0x32,%edx
call   1060 <memmove@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1080 <getline@plt>
add    $0x32,%rbx
cmp    $0xffffffff,%eax
jne    11e0 <main+0x70>
mov    (%rsp),%rdi
test   %rdi,%rdi
je     1216 <main+0xa6>
call   1030 <free@plt>
mov    0x2dcb(%rip),%rax
movslq (%rax),%rsi
lea    0xde2(%rip),%rdi
call   1040 <printf@plt>
lea    0x10(%rsp),%r15
xor    %r12d,%r12d
lea    0xdd7(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    $0xffffffffffffffce,%r13
nopw   0x0(%rax,%rax,1)
movsbl 0x32(%r15,%r13,1),%edi
call   1050 <char2int@plt>
lea    (%rbx,%rbx,4),%rcx
lea    (%rbx,%rcx,2),%rbx
add    %rax,%rbx
inc    %r13
jne    1250 <main+0xe0>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
add    $0x1,%r12
add    $0x32,%r15
cmp    $0x64,%r12
jne    1240 <main+0xd0>
xor    %eax,%eax
add    $0x13a0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"13.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [9 x i8] c"echo :%i\00"
@INT_MAX = global i32 0
@.str.3 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x [50 x i8]]
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [100 x [50 x i32]]
%11 = alloca i64
%12 = alloca [100 x i32]
store i32 0, i32* %1
store i32 0, i32* %3
store i8* null, i8** %5
store i64 0, i64* %6
%13 = call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %13, i32** %4
%14 = load i32*, i32** %4
%15 = icmp eq i32* %14, null
br i1 %15, label %16, label %19
16: ; preds = %0
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %0
br label %20
20: ; preds = %24, %19
%21 = load i32*, i32** %4
%22 = call i32 @getline(i8** %5, i64* %6, i32* %21)
store i32 %22, i32* %7
%23 = icmp ne i32 %22, -1
br i1 %23, label %24, label %32
24: ; preds = %20
%25 = load i32, i32* %3
%26 = add nsw i32 %25, 1
store i32 %26, i32* %3
%27 = sext i32 %25 to i64
%28 = getelementptr inbounds [100 x [50 x i8]], [100 x [50 x i8]]* %2, i64 0, i64 %27
%29 = getelementptr inbounds [50 x i8], [50 x i8]* %28, i64 0, i64 0
%30 = load i8*, i8** %5
%31 = call i32 @memmove(i8* %29, i8* %30, i32 50)
br label %20
32: ; preds = %20
%33 = load i8*, i8** %5
%34 = icmp ne i8* %33, null
br i1 %34, label %35, label %38
35: ; preds = %32
%36 = load i8*, i8** %5
%37 = call i32 @free(i8* %36)
br label %38
38: ; preds = %35, %32
%39 = load i32, i32* @INT_MAX
%40 = sext i32 %39 to i64
%41 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %40)
store i64 0, i64* %11
%42 = bitcast [100 x i32]* %12 to i8*
store i32 0, i32* %8
br label %43
43: ; preds = %75, %38
%44 = load i32, i32* %8
%45 = icmp slt i32 %44, 100
br i1 %45, label %46, label %78
46: ; preds = %43
store i32 0, i32* %9
br label %47
47: ; preds = %64, %46
%48 = load i32, i32* %9
%49 = icmp slt i32 %48, 50
br i1 %49, label %50, label %67
50: ; preds = %47
%51 = load i64, i64* %11
%52 = mul i64 %51, 10
%53 = load i32, i32* %8
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [100 x [50 x i8]], [100 x [50 x i8]]* %2, i64 0, i64 %54
%56 = load i32, i32* %9
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [50 x i8], [50 x i8]* %55, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = call i64 @char2int(i8 signext %59)
%61 = add i64 %52, %60
%62 = load i64, i64* %11
%63 = add i64 %62, %61
store i64 %63, i64* %11
br label %64
64: ; preds = %50
%65 = load i32, i32* %9
%66 = add nsw i32 %65, 1
store i32 %66, i32* %9
br label %47
67: ; preds = %47
%68 = load i64, i64* %11
%69 = trunc i64 %68 to i32
%70 = load i32, i32* %8
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [100 x i32], [100 x i32]* %12, i64 0, i64 %71
store i32 %69, i32* %72
%73 = load i64, i64* %11
%74 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 %73)
br label %75
75: ; preds = %67
%76 = load i32, i32* %8
%77 = add nsw i32 %76, 1
store i32 %77, i32* %8
br label %43
78: ; preds = %43
%79 = load i32, i32* %1
ret i32 %79
}

LLVM IR (-O2):
@.str = [7 x i8] c"13.txt\00"
@.str.1 = [2 x i8] c"r\00"
@EXIT_FAILURE = global i32 0
@.str.2 = [9 x i8] c"echo :%i\00"
@INT_MAX = global i32 0
@.str.3 = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca [100 x [50 x i8]]
%2 = alloca i8*
%3 = alloca i64
%4 = getelementptr inbounds [100 x [50 x i8]], [100 x [50 x i8]]* %1, i64 0, i64 0, i64 0
%5 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%6 = bitcast i64* %3 to i8*
store i64 0, i64* %3
%7 = tail call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32* %7, null
br i1 %8, label %12, label %9
9: ; preds = %0
%10 = call i32 @getline(i8** %2, i64* %3, i32* %7)
%11 = icmp eq i32 %10, -1
br i1 %11, label %23, label %15
12: ; preds = %0
%13 = load i32, i32* @EXIT_FAILURE
%14 = tail call i32 @exit(i32 %13)
unreachable
15: ; preds = %9, %15
%16 = phi i64 [ %17, %15 ], [ 0, %9 ]
%17 = add nuw i64 %16, 1
%18 = getelementptr inbounds [100 x [50 x i8]], [100 x [50 x i8]]* %1, i64 0, i64 %16, i64 0
%19 = load i8*, i8** %2
%20 = call i32 @memmove(i8* %18, i8* %19, i32 50)
%21 = call i32 @getline(i8** %2, i64* %3, i32* %7)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %15
23: ; preds = %15, %9
%24 = load i8*, i8** %2
%25 = icmp eq i8* %24, null
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = call i32 @free(i8* %24)
br label %28
28: ; preds = %26, %23
%29 = load i32, i32* @INT_MAX
%30 = sext i32 %29 to i64
%31 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i64 %30)
br label %32
32: ; preds = %28, %45
%33 = phi i64 [ 0, %28 ], [ %47, %45 ]
%34 = phi i64 [ 0, %28 ], [ %42, %45 ]
br label %35
35: ; preds = %32, %35
%36 = phi i64 [ 0, %32 ], [ %43, %35 ]
%37 = phi i64 [ %34, %32 ], [ %42, %35 ]
%38 = getelementptr inbounds [100 x [50 x i8]], [100 x [50 x i8]]* %1, i64 0, i64 %33, i64 %36
%39 = load i8, i8* %38
%40 = call i64 @char2int(i8 signext %39)
%41 = mul i64 %37, 11
%42 = add i64 %41, %40
%43 = add nuw nsw i64 %36, 1
%44 = icmp eq i64 %43, 50
br i1 %44, label %45, label %35
45: ; preds = %35
%46 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i64 %42)
%47 = add nuw nsw i64 %33, 1
%48 = icmp eq i64 %47, 100
br i1 %48, label %49, label %32
49: ; preds = %45
ret i32 0
}