#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*/ Mmc_Fat_Assign(char *, int /*<<< orphan*/);
unsigned long Mmc_Fat_Get_File_Size();
int /*<<< orphan*/ Mmc_Fat_Read(char *);
int /*<<< orphan*/ Mmc_Fat_Reset(unsigned long);
unsigned long Mmc_Fat_Tell();
void mem_data_re(unsigned int *mmc_res) {
  unsigned long mmc_size, cur_pos;
  unsigned int temp[4], k, i, min = 0, max = 4;
  char character;
  Mmc_Fat_Assign("te_value.txt", 0);
  mmc_size = Mmc_Fat_Get_File_Size();
  cur_pos = Mmc_Fat_Tell();
  if (cur_pos < mmc_size) {
    for (i = 0; i < 128; i++) {
      for (k = min; k < max; k++) {
        Mmc_Fat_Read(&character);
        temp[k] = character - 48;
      }
      for (k = min; k < 2; k++) {
        Mmc_Fat_Read(&character);
      }
      mmc_res[i] =
          (temp[0] * 1000) + (temp[1] * 100) + (temp[2] * 10) + temp[3];
    }
  } else {
    Mmc_Fat_Reset(mmc_size);
  }
}


x86 assembly (clang, -O0):
<mem_data_re>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x4,-0x40(%rbp)
lea    0xe8f(%rip),%rdi
xor    %esi,%esi
call   1060 <Mmc_Fat_Assign@plt>
mov    $0x0,%al
call   1070 <Mmc_Fat_Get_File_Size@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Mmc_Fat_Tell@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1241 <mem_data_re+0xf1>
movl   $0x0,-0x38(%rbp)
cmpl   $0x80,-0x38(%rbp)
jae    123c <mem_data_re+0xec>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x40(%rbp),%eax
jae    11e7 <mem_data_re+0x97>
lea    -0x41(%rbp),%rdi
call   1040 <Mmc_Fat_Read@plt>
movsbl -0x41(%rbp),%ecx
sub    $0x30,%ecx
mov    -0x34(%rbp),%eax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b6 <mem_data_re+0x66>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jae    120e <mem_data_re+0xbe>
lea    -0x41(%rbp),%rdi
call   1040 <Mmc_Fat_Read@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ed <mem_data_re+0x9d>
imul   $0x3e8,-0x30(%rbp),%edx
imul   $0x64,-0x2c(%rbp),%eax
add    %eax,%edx
imul   $0xa,-0x28(%rbp),%eax
add    %eax,%edx
add    -0x24(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11a3 <mem_data_re+0x53>
jmp    124a <mem_data_re+0xfa>
mov    -0x10(%rbp),%rdi
call   1050 <Mmc_Fat_Reset@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_data_re>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbp
lea    0xe9b(%rip),%rdi
xor    %esi,%esi
call   1060 <Mmc_Fat_Assign@plt>
xor    %eax,%eax
call   1070 <Mmc_Fat_Get_File_Size@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <Mmc_Fat_Tell@plt>
cmp    %rbx,%rax
jae    121d <mem_data_re+0xcd>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    0x3(%rsp),%r12
mov    %r12,%rdi
call   1040 <Mmc_Fat_Read@plt>
movsbl 0x3(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    %r12,%rdi
call   1040 <Mmc_Fat_Read@plt>
movsbl 0x3(%rsp),%r13d
mov    %r12,%rdi
call   1040 <Mmc_Fat_Read@plt>
movsbl 0x3(%rsp),%r15d
mov    %r12,%rdi
call   1040 <Mmc_Fat_Read@plt>
movsbl 0x3(%rsp),%r14d
mov    %r12,%rdi
call   1040 <Mmc_Fat_Read@plt>
mov    %r12,%rdi
call   1040 <Mmc_Fat_Read@plt>
imul   $0x3e8,0x4(%rsp),%eax
imul   $0x64,%r13d,%ecx
add    %eax,%ecx
lea    (%r15,%r15,4),%eax
lea    (%rcx,%rax,2),%eax
add    %r14d,%eax
add    $0xffff2fb0,%eax
mov    %eax,0x0(%rbp,%rbx,4)
add    $0x1,%rbx
cmp    $0x80,%rbx
jne    1190 <mem_data_re+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <Mmc_Fat_Reset@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"te_value.txt\00"
define void @mem_data_re(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i64
%5 = alloca [4 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8
store i32* %0, i32** %2
store i32 0, i32* %8
store i32 4, i32* %9
%11 = call i32 @Mmc_Fat_Assign(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%12 = call i64 (...) @Mmc_Fat_Get_File_Size()
store i64 %12, i64* %3
%13 = call i64 (...) @Mmc_Fat_Tell()
store i64 %13, i64* %4
%14 = load i64, i64* %4
%15 = load i64, i64* %3
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %71
17: ; preds = %1
store i32 0, i32* %7
br label %18
18: ; preds = %67, %17
%19 = load i32, i32* %7
%20 = icmp ult i32 %19, 128
br i1 %20, label %21, label %70
21: ; preds = %18
%22 = load i32, i32* %8
store i32 %22, i32* %6
br label %23
23: ; preds = %35, %21
%24 = load i32, i32* %6
%25 = load i32, i32* %9
%26 = icmp ult i32 %24, %25
br i1 %26, label %27, label %38
27: ; preds = %23
%28 = call i32 @Mmc_Fat_Read(i8* %10)
%29 = load i8, i8* %10
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %30, 48
%32 = load i32, i32* %6
%33 = zext i32 %32 to i64
%34 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 %33
store i32 %31, i32* %34
br label %35
35: ; preds = %27
%36 = load i32, i32* %6
%37 = add i32 %36, 1
store i32 %37, i32* %6
br label %23
38: ; preds = %23
%39 = load i32, i32* %8
store i32 %39, i32* %6
br label %40
40: ; preds = %45, %38
%41 = load i32, i32* %6
%42 = icmp ult i32 %41, 2
br i1 %42, label %43, label %48
43: ; preds = %40
%44 = call i32 @Mmc_Fat_Read(i8* %10)
br label %45
45: ; preds = %43
%46 = load i32, i32* %6
%47 = add i32 %46, 1
store i32 %47, i32* %6
br label %40
48: ; preds = %40
%49 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%50 = load i32, i32* %49
%51 = mul i32 %50, 1000
%52 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
%53 = load i32, i32* %52
%54 = mul i32 %53, 100
%55 = add i32 %51, %54
%56 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
%57 = load i32, i32* %56
%58 = mul i32 %57, 10
%59 = add i32 %55, %58
%60 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
%61 = load i32, i32* %60
%62 = add i32 %59, %61
%63 = load i32*, i32** %2
%64 = load i32, i32* %7
%65 = zext i32 %64 to i64
%66 = getelementptr inbounds i32, i32* %63, i64 %65
store i32 %62, i32* %66
br label %67
67: ; preds = %48
%68 = load i32, i32* %7
%69 = add i32 %68, 1
store i32 %69, i32* %7
br label %18
70: ; preds = %18
br label %74
71: ; preds = %1
%72 = load i64, i64* %3
%73 = call i32 @Mmc_Fat_Reset(i64 %72)
br label %74
74: ; preds = %71, %70
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"te_value.txt\00"
define void @mem_data_re(i32* nocapture writeonly %0) {
%2 = alloca i8
%3 = tail call i32 @Mmc_Fat_Assign(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 0)
%4 = tail call i64 (...) @Mmc_Fat_Get_File_Size()
%5 = tail call i64 (...) @Mmc_Fat_Tell()
%6 = icmp ult i64 %5, %4
br i1 %6, label %7, label %33
7: ; preds = %1, %7
%8 = phi i64 [ %31, %7 ], [ 0, %1 ]
%9 = call i32 @Mmc_Fat_Read(i8* %2)
%10 = load i8, i8* %2
%11 = sext i8 %10 to i32
%12 = call i32 @Mmc_Fat_Read(i8* %2)
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = call i32 @Mmc_Fat_Read(i8* %2)
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = call i32 @Mmc_Fat_Read(i8* %2)
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = call i32 @Mmc_Fat_Read(i8* %2)
%22 = call i32 @Mmc_Fat_Read(i8* %2)
%23 = mul nsw i32 %11, 1000
%24 = mul nsw i32 %14, 100
%25 = add nsw i32 %24, %23
%26 = mul nsw i32 %17, 10
%27 = add nsw i32 %25, %26
%28 = add nsw i32 %27, %20
%29 = add nsw i32 %28, -53328
%30 = getelementptr inbounds i32, i32* %0, i64 %8
store i32 %29, i32* %30
%31 = add nuw nsw i64 %8, 1
%32 = icmp eq i64 %31, 128
br i1 %32, label %35, label %7
33: ; preds = %1
%34 = tail call i32 @Mmc_Fat_Reset(i64 %4)
br label %35
35: ; preds = %7, %33
ret void
}