#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*/ time_t;
struct tm {
  int tm_min;
  int tm_sec;
};
struct stat {
  int st_size;
};

/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ fstat(int, struct stat *);
struct tm *localtime(int /*<<< orphan*/ *);
scalar_t__ mmap(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/, int,
                int /*<<< orphan*/);
int /*<<< orphan*/ munmap(unsigned char *, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, int, int);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  struct tm *local;
  time_t t;
  int fd_hex;
  char strTmp[20];
  char bytes_write;
  char buffer_hex[57];
  char buffer_hex_1[57];
  unsigned char i = 0;
  unsigned char j = 0;
  unsigned char ucCount = 0;
  unsigned int IntegerData;
  struct stat tStat;
  unsigned char *ptFileMap = NULL;
  unsigned char *pcTmpFile = NULL;
  buffer_hex[0] = 0x51;
  buffer_hex[1] = 0xaa;
  for (i = 0; i < (57 - 2); i++)
    buffer_hex[i + 2] = 0x31;
  buffer_hex_1[0] = 0x55;
  buffer_hex_1[1] = 0xaa;
  for (i = 0; i < (57 - 2); i++)
    buffer_hex_1[i + 2] = 0x32;
  t = time(NULL);
  local = localtime(&t);
  printf("Local min is: %d\n", local->tm_min);
  printf("Local sec is: %d\n", local->tm_sec);
  snprintf(strTmp, 20, "%s/%d_%d", "/mnt/data", local->tm_min, local->tm_sec);
  strTmp[19] = '\0';
  printf("Local file name is: %s\n", strTmp);
  if ((fd_hex = open("/mnt/data/4_32", O_RDWR)) == -1) {
    fprintf(stderr, "Open %s Error:%s/n", strTmp, strerror(errno));
    exit(1);
  }
  fstat(fd_hex, &tStat);
  printf("file size %d \n", tStat.st_size);
  ptFileMap = (unsigned char *)mmap(NULL, tStat.st_size, PROT_READ | PROT_WRITE,
                                    MAP_SHARED, fd_hex, 0);
  if (ptFileMap == (unsigned char *)-1) {
    printf("faile mmap\n");
    return -1;
  }
  printf("ok\n");
  pcTmpFile = ptFileMap;
  i = 1;
  while (!((*ptFileMap) == 0x55)) {
    ucCount++;
    ptFileMap++;
  }
  if (*(++ptFileMap) == 0xaa) {
    ptFileMap = pcTmpFile + ucCount;
    IntegerData = (tStat.st_size - ucCount) / 57;
    for (j = 0; j < IntegerData; j++) {
      for (i = 0; i < 57; i++)
        printf("j = %d, i = %d, char = %0x\n", j, (i + 1),
               ptFileMap[(j * 57) + i]);
    }
  }
  ptFileMap = pcTmpFile;
  munmap(ptFileMap, tStat.st_size);
  close(fd_hex);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0xb1(%rbp)
movb   $0x0,-0xb2(%rbp)
movb   $0x0,-0xb3(%rbp)
movq   $0x0,-0xc8(%rbp)
movq   $0x0,-0xd0(%rbp)
movb   $0x51,-0x70(%rbp)
movb   $0xaa,-0x6f(%rbp)
movb   $0x0,-0xb1(%rbp)
movzbl -0xb1(%rbp),%eax
cmp    $0x37,%eax
jge    1240 <main+0x80>
movzbl -0xb1(%rbp),%eax
add    $0x2,%eax
cltq
movb   $0x31,-0x70(%rbp,%rax,1)
mov    -0xb1(%rbp),%al
add    $0x1,%al
mov    %al,-0xb1(%rbp)
jmp    120c <main+0x4c>
movb   $0x55,-0xb0(%rbp)
movb   $0xaa,-0xaf(%rbp)
movb   $0x0,-0xb1(%rbp)
movzbl -0xb1(%rbp),%eax
cmp    $0x37,%eax
jge    128c <main+0xcc>
movzbl -0xb1(%rbp),%eax
add    $0x2,%eax
cltq
movb   $0x32,-0xb0(%rbp,%rax,1)
32
mov    -0xb1(%rbp),%al
add    $0x1,%al
mov    %al,-0xb1(%rbp)
jmp    1255 <main+0x95>
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xd4e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xd4b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%r8d
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%r9d
mov    $0x14,%esi
lea    0xd37(%rip),%rdx
lea    0xd39(%rip),%rcx
call   1060 <snprintf@plt>
movb   $0x0,-0x1d(%rbp)
lea    -0x30(%rbp),%rsi
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2cc2(%rip),%rax
mov    (%rax),%esi
lea    0xd30(%rip),%rdi
call   10b0 <open@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
jne    137e <main+0x1be>
mov    0x2c91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xdc(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    0x2c6f(%rip),%rax
mov    (%rax),%edi
call   10d0 <strerror@plt>
mov    -0xdc(%rbp),%edi
mov    -0xd8(%rbp),%rdx
mov    %rax,%rcx
lea    0xcef(%rip),%rsi
call   1080 <fprintf@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0x18(%rbp),%edi
lea    -0xc0(%rbp),%rsi
call   10e0 <fstat@plt>
mov    -0xc0(%rbp),%esi
lea    0xcd7(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc0(%rbp),%esi
mov    0x2c4a(%rip),%rax
mov    (%rax),%edx
mov    0x2c01(%rip),%rax
or     (%rax),%edx
mov    0x2c28(%rip),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1040 <mmap@plt>
mov    %rax,-0xc8(%rbp)
mov    $0xffffffffffffffff,%rax
cmp    %rax,-0xc8(%rbp)
jne    1407 <main+0x247>
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    159a <main+0x3da>
lea    0xc7e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xc8(%rbp),%rax
mov    %rax,-0xd0(%rbp)
movb   $0x1,-0xb1(%rbp)
mov    -0xc8(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x55,%eax
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1449 <main+0x289>
jmp    146e <main+0x2ae>
mov    -0xb3(%rbp),%al
add    $0x1,%al
mov    %al,-0xb3(%rbp)
mov    -0xc8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0xc8(%rbp)
jmp    142a <main+0x26a>
mov    -0xc8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xc8(%rbp)
movzbl 0x1(%rax),%eax
cmp    $0xaa,%eax
jne    156b <main+0x3ab>
mov    -0xd0(%rbp),%rax
movzbl -0xb3(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc0(%rbp),%eax
movzbl -0xb3(%rbp),%ecx
sub    %ecx,%eax
mov    $0x39,%ecx
cltd
idiv   %ecx
mov    %eax,-0xb8(%rbp)
movb   $0x0,-0xb2(%rbp)
movzbl -0xb2(%rbp),%eax
cmp    -0xb8(%rbp),%eax
jae    1566 <main+0x3a6>
movb   $0x0,-0xb1(%rbp)
movzbl -0xb1(%rbp),%eax
cmp    $0x39,%eax
jge    154e <main+0x38e>
movzbl -0xb2(%rbp),%esi
movzbl -0xb1(%rbp),%edx
add    $0x1,%edx
mov    -0xc8(%rbp),%rax
movzbl -0xb2(%rbp),%ecx
imul   $0x39,%ecx,%ecx
movzbl -0xb1(%rbp),%edi
add    %edi,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%ecx
lea    0xb5c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0xb1(%rbp),%al
add    $0x1,%al
mov    %al,-0xb1(%rbp)
jmp    14eb <main+0x32b>
jmp    1553 <main+0x393>
mov    -0xb2(%rbp),%al
add    $0x1,%al
mov    %al,-0xb2(%rbp)
jmp    14d1 <main+0x311>
jmp    156b <main+0x3ab>
mov    -0xd0(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0xc8(%rbp),%rdi
mov    -0xc0(%rbp),%esi
call   10a0 <munmap@plt>
mov    -0x18(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,0x14(%rsp)
lea    0x14(%rsp),%rdi
call   1030 <localtime@plt>
mov    %rax,%rbx
mov    (%rax),%esi
lea    0xe01(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x4(%rbx),%esi
lea    0xe02(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%rbx),%r8d
mov    0x4(%rbx),%r9d
lea    0xdff(%rip),%rdx
lea    0xe01(%rip),%rcx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x14,%esi
call   1070 <snprintf@plt>
movb   $0x0,0x33(%rsp)
lea    0xded(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2d7d(%rip),%rax
mov    (%rax),%esi
lea    0xdeb(%rip),%rdi
call   10c0 <open@plt>
cmp    $0xffffffff,%eax
je     13ed <main+0x21d>
mov    %eax,%ebx
lea    0x8(%rsp),%rsi
mov    %eax,%edi
call   10f0 <fstat@plt>
mov    0x8(%rsp),%ebp
lea    0xde6(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2d5d(%rip),%rax
mov    0x2d16(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2d3b(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %ebp,%esi
mov    %ebx,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
cmp    $0xffffffffffffffff,%rax
je     12f2 <main+0x122>
mov    %rax,%r12
lea    0xdce(%rip),%rdi
call   1040 <puts@plt>
cmpb   $0x55,(%r12)
mov    %ebx,0x10(%rsp)
mov    %ebp,0x4(%rsp)
jne    1308 <main+0x138>
xor    %eax,%eax
mov    %r12,%rcx
cmpb   $0xaa,0x1(%rcx)
je     132a <main+0x15a>
jmp    13c7 <main+0x1f7>
lea    0xda6(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%eax
jmp    13de <main+0x20e>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x55,0x1(%r12,%rax,1)
lea    0x1(%rax),%rax
jne    1310 <main+0x140>
lea    (%r12,%rax,1),%rcx
cmpb   $0xaa,0x1(%rcx)
jne    13c7 <main+0x1f7>
movzbl %al,%eax
mov    0x4(%rsp),%ecx
sub    %eax,%ecx
lea    0x38(%rcx),%edx
cmp    $0x71,%edx
jb     13c7 <main+0x1f7>
movslq %ecx,%rdx
imul   $0xffffffff8fb823ef,%rdx,%r13
shr    $0x20,%r13
add    %ecx,%r13d
mov    %r13d,%ecx
shr    $0x1f,%ecx
sar    $0x5,%r13d
add    %ecx,%r13d
mov    %r12,%rcx
add    %rax,%rcx
mov    %rcx,0x18(%rsp)
lea    0xd11(%rip),%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %ebp,%eax
imul   $0x39,%rax,%r15
add    0x18(%rsp),%r15
mov    $0xffffffffffffffc7,%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x39(%r15,%r14,1),%ecx
lea    0x3a(%r14),%edx
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
inc    %r14
jne    13a0 <main+0x1d0>
add    $0x1,%ebp
movzbl %bpl,%ebp
cmp    %ebp,%r13d
ja     1380 <main+0x1b0>
mov    %r12,%rdi
mov    0x4(%rsp),%esi
call   10b0 <munmap@plt>
mov    0x10(%rsp),%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2bd4(%rip),%rax
mov    (%rax),%ebx
mov    0x2bc3(%rip),%rax
mov    (%rax),%edi
call   10e0 <strerror@plt>
lea    0xc53(%rip),%rsi
lea    0x20(%rsp),%rdx
mov    %ebx,%edi
mov    %rax,%rcx
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
%struct.stat = type { i32 }
@.str = [18 x i8] c"Local min is: %d\0A\00"
@.str.1 = [18 x i8] c"Local sec is: %d\0A\00"
@.str.2 = [9 x i8] c"%s/%d_%d\00"
@.str.3 = [10 x i8] c"/mnt/data\00"
@.str.4 = [24 x i8] c"Local file name is: %s\0A\00"
@.str.5 = [15 x i8] c"/mnt/data/4_32\00"
@O_RDWR = global i32 0
@stderr = global i32 0
@.str.6 = [19 x i8] c"Open %s Error:%s/n\00"
@errno = global i32 0
@.str.7 = [15 x i8] c"file size %d \0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.8 = [12 x i8] c"faile mmap\0A\00"
@.str.9 = [4 x i8] c"ok\0A\00"
@.str.10 = [28 x i8] c"j = %d, i = %d, char = %0x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = alloca i32
%4 = alloca i32
%5 = alloca [20 x i8]
%6 = alloca i8
%7 = alloca [57 x i8]
%8 = alloca [57 x i8]
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i32
%13 = alloca %struct.stat
%14 = alloca i8*
%15 = alloca i8*
store i32 0, i32* %1
store i8 0, i8* %9
store i8 0, i8* %10
store i8 0, i8* %11
store i8* null, i8** %14
store i8* null, i8** %15
%16 = getelementptr inbounds [57 x i8], [57 x i8]* %7, i64 0, i64 0
store i8 81, i8* %16
%17 = getelementptr inbounds [57 x i8], [57 x i8]* %7, i64 0, i64 1
store i8 -86, i8* %17
store i8 0, i8* %9
br label %18
18: ; preds = %28, %0
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = icmp slt i32 %20, 55
br i1 %21, label %22, label %31
22: ; preds = %18
%23 = load i8, i8* %9
%24 = zext i8 %23 to i32
%25 = add nsw i32 %24, 2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [57 x i8], [57 x i8]* %7, i64 0, i64 %26
store i8 49, i8* %27
br label %28
28: ; preds = %22
%29 = load i8, i8* %9
%30 = add i8 %29, 1
store i8 %30, i8* %9
br label %18
31: ; preds = %18
%32 = getelementptr inbounds [57 x i8], [57 x i8]* %8, i64 0, i64 0
store i8 85, i8* %32
%33 = getelementptr inbounds [57 x i8], [57 x i8]* %8, i64 0, i64 1
store i8 -86, i8* %33
store i8 0, i8* %9
br label %34
34: ; preds = %44, %31
%35 = load i8, i8* %9
%36 = zext i8 %35 to i32
%37 = icmp slt i32 %36, 55
br i1 %37, label %38, label %47
38: ; preds = %34
%39 = load i8, i8* %9
%40 = zext i8 %39 to i32
%41 = add nsw i32 %40, 2
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [57 x i8], [57 x i8]* %8, i64 0, i64 %42
store i8 50, i8* %43
br label %44
44: ; preds = %38
%45 = load i8, i8* %9
%46 = add i8 %45, 1
store i8 %46, i8* %9
br label %34
47: ; preds = %34
%48 = call i32 @time(i32* null)
store i32 %48, i32* %3
%49 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %49, %struct.tm** %2
%50 = load %struct.tm*, %struct.tm** %2
%51 = getelementptr inbounds %struct.tm, %struct.tm* %50, i32 0, i32 0
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %52)
%54 = load %struct.tm*, %struct.tm** %2
%55 = getelementptr inbounds %struct.tm, %struct.tm* %54, i32 0, i32 1
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %56)
%58 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%59 = load %struct.tm*, %struct.tm** %2
%60 = getelementptr inbounds %struct.tm, %struct.tm* %59, i32 0, i32 0
%61 = load i32, i32* %60
%62 = load %struct.tm*, %struct.tm** %2
%63 = getelementptr inbounds %struct.tm, %struct.tm* %62, i32 0, i32 1
%64 = load i32, i32* %63
%65 = call i32 @snprintf(i8* %58, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %61, i32 %64)
%66 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 19
store i8 0, i8* %66
%67 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %67)
%69 = load i32, i32* @O_RDWR
%70 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %69)
store i32 %70, i32* %4
%71 = icmp eq i32 %70, -1
br i1 %71, label %72, label %79
72: ; preds = %47
%73 = load i32, i32* @stderr
%74 = getelementptr inbounds [20 x i8], [20 x i8]* %5, i64 0, i64 0
%75 = load i32, i32* @errno
%76 = call i8* @strerror(i32 %75)
%77 = call i32 @fprintf(i32 %73, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %74, i8* %76)
%78 = call i32 @exit(i32 1)
unreachable
79: ; preds = %47
%80 = load i32, i32* %4
%81 = call i32 @fstat(i32 %80, %struct.stat* %13)
%82 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%83 = load i32, i32* %82
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %83)
%85 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%86 = load i32, i32* %85
%87 = load i32, i32* @PROT_READ
%88 = load i32, i32* @PROT_WRITE
%89 = or i32 %87, %88
%90 = load i32, i32* @MAP_SHARED
%91 = load i32, i32* %4
%92 = call i64 @mmap(i32* null, i32 %86, i32 %89, i32 %90, i32 %91, i32 0)
%93 = inttoptr i64 %92 to i8*
store i8* %93, i8** %14
%94 = load i8*, i8** %14
%95 = icmp eq i8* %94, inttoptr (i64 -1 to i8*)
br i1 %95, label %96, label %98
96: ; preds = %79
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
store i32 -1, i32* %1
br label %174
98: ; preds = %79
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%100 = load i8*, i8** %14
store i8* %100, i8** %15
store i8 1, i8* %9
br label %101
101: ; preds = %107, %98
%102 = load i8*, i8** %14
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = icmp eq i32 %104, 85
%106 = xor i1 %105, true
br i1 %106, label %107, label %112
107: ; preds = %101
%108 = load i8, i8* %11
%109 = add i8 %108, 1
store i8 %109, i8* %11
%110 = load i8*, i8** %14
%111 = getelementptr inbounds i8, i8* %110, i32 1
store i8* %111, i8** %14
br label %101
112: ; preds = %101
%113 = load i8*, i8** %14
%114 = getelementptr inbounds i8, i8* %113, i32 1
store i8* %114, i8** %14
%115 = load i8, i8* %114
%116 = zext i8 %115 to i32
%117 = icmp eq i32 %116, 170
br i1 %117, label %118, label %166
118: ; preds = %112
%119 = load i8*, i8** %15
%120 = load i8, i8* %11
%121 = zext i8 %120 to i32
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds i8, i8* %119, i64 %122
store i8* %123, i8** %14
%124 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%125 = load i32, i32* %124
%126 = load i8, i8* %11
%127 = zext i8 %126 to i32
%128 = sub nsw i32 %125, %127
%129 = sdiv i32 %128, 57
store i32 %129, i32* %12
store i8 0, i8* %10
br label %130
130: ; preds = %162, %118
%131 = load i8, i8* %10
%132 = zext i8 %131 to i32
%133 = load i32, i32* %12
%134 = icmp ult i32 %132, %133
br i1 %134, label %135, label %165
135: ; preds = %130
store i8 0, i8* %9
br label %136
136: ; preds = %158, %135
%137 = load i8, i8* %9
%138 = zext i8 %137 to i32
%139 = icmp slt i32 %138, 57
br i1 %139, label %140, label %161
140: ; preds = %136
%141 = load i8, i8* %10
%142 = zext i8 %141 to i32
%143 = load i8, i8* %9
%144 = zext i8 %143 to i32
%145 = add nsw i32 %144, 1
%146 = load i8*, i8** %14
%147 = load i8, i8* %10
%148 = zext i8 %147 to i32
%149 = mul nsw i32 %148, 57
%150 = load i8, i8* %9
%151 = zext i8 %150 to i32
%152 = add nsw i32 %149, %151
%153 = sext i32 %152 to i64
%154 = getelementptr inbounds i8, i8* %146, i64 %153
%155 = load i8, i8* %154
%156 = zext i8 %155 to i32
%157 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %142, i32 %145, i32 %156)
br label %158
158: ; preds = %140
%159 = load i8, i8* %9
%160 = add i8 %159, 1
store i8 %160, i8* %9
br label %136
161: ; preds = %136
br label %162
162: ; preds = %161
%163 = load i8, i8* %10
%164 = add i8 %163, 1
store i8 %164, i8* %10
br label %130
165: ; preds = %130
br label %166
166: ; preds = %165, %112
%167 = load i8*, i8** %15
store i8* %167, i8** %14
%168 = load i8*, i8** %14
%169 = getelementptr inbounds %struct.stat, %struct.stat* %13, i32 0, i32 0
%170 = load i32, i32* %169
%171 = call i32 @munmap(i8* %168, i32 %170)
%172 = load i32, i32* %4
%173 = call i32 @close(i32 %172)
store i32 0, i32* %1
br label %174
174: ; preds = %166, %96
%175 = load i32, i32* %1
ret i32 %175
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.tm = type { i32, i32 }
@.str = [18 x i8] c"Local min is: %d\0A\00"
@.str.1 = [18 x i8] c"Local sec is: %d\0A\00"
@.str.2 = [9 x i8] c"%s/%d_%d\00"
@.str.3 = [10 x i8] c"/mnt/data\00"
@.str.4 = [24 x i8] c"Local file name is: %s\0A\00"
@.str.5 = [15 x i8] c"/mnt/data/4_32\00"
@O_RDWR = global i32 0
@stderr = global i32 0
@.str.6 = [19 x i8] c"Open %s Error:%s/n\00"
@errno = global i32 0
@.str.7 = [15 x i8] c"file size %d \0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.10 = [28 x i8] c"j = %d, i = %d, char = %0x\0A\00"
@str = [3 x i8] c"ok\00"
@str.11 = [11 x i8] c"faile mmap\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca %struct.stat
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%6 = bitcast %struct.stat* %3 to i8*
%7 = tail call i32 @time(i32* null)
store i32 %7, i32* %1
%8 = call %struct.tm* @localtime(i32* %1)
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 0
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = getelementptr inbounds %struct.tm, %struct.tm* %8, i64 0, i32 1
%13 = load i32, i32* %12
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i32, i32* %9
%16 = load i32, i32* %12
%17 = call i32 @snprintf(i8* %5, i32 20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %15, i32 %16)
%18 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 19
store i8 0, i8* %18
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), i8* %5)
%20 = load i32, i32* @O_RDWR
%21 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 %20)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %29
23: ; preds = %0
%24 = load i32, i32* @stderr
%25 = load i32, i32* @errno
%26 = call i8* @strerror(i32 %25)
%27 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %5, i8* %26)
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %0
%30 = call i32 @fstat(i32 %21, %struct.stat* %3)
%31 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i32 %32)
%34 = load i32, i32* @PROT_READ
%35 = load i32, i32* @PROT_WRITE
%36 = or i32 %35, %34
%37 = load i32, i32* @MAP_SHARED
%38 = call i64 @mmap(i32* null, i32 %32, i32 %36, i32 %37, i32 %21, i32 0)
%39 = inttoptr i64 %38 to i8*
%40 = icmp eq i8* %39, inttoptr (i64 -1 to i8*)
br i1 %40, label %41, label %43
41: ; preds = %29
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.11, i64 0, i64 0))
br label %89
43: ; preds = %29
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%45 = load i8, i8* %39
%46 = icmp eq i8 %45, 85
br i1 %46, label %54, label %47
47: ; preds = %43, %47
%48 = phi i8* [ %51, %47 ], [ %39, %43 ]
%49 = phi i8 [ %50, %47 ], [ 0, %43 ]
%50 = add i8 %49, 1
%51 = getelementptr inbounds i8, i8* %48, i64 1
%52 = load i8, i8* %51
%53 = icmp eq i8 %52, 85
br i1 %53, label %54, label %47
54: ; preds = %47, %43
%55 = phi i8 [ 0, %43 ], [ %50, %47 ]
%56 = phi i8* [ %39, %43 ], [ %51, %47 ]
%57 = getelementptr inbounds i8, i8* %56, i64 1
%58 = load i8, i8* %57
%59 = icmp eq i8 %58, -86
br i1 %59, label %60, label %86
60: ; preds = %54
%61 = zext i8 %55 to i32
%62 = zext i8 %55 to i64
%63 = getelementptr inbounds i8, i8* %39, i64 %62
%64 = sub nsw i32 %32, %61
%65 = sdiv i32 %64, 57
%66 = add i32 %64, 56
%67 = icmp ult i32 %66, 113
br i1 %67, label %86, label %68
68: ; preds = %60, %82
%69 = phi i32 [ %84, %82 ], [ 0, %60 ]
%70 = mul nuw nsw i32 %69, 57
%71 = zext i32 %70 to i64
br label %72
72: ; preds = %68, %72
%73 = phi i64 [ 0, %68 ], [ %74, %72 ]
%74 = add nuw nsw i64 %73, 1
%75 = add nuw nsw i64 %73, %71
%76 = getelementptr inbounds i8, i8* %63, i64 %75
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = trunc i64 %74 to i32
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %69, i32 %79, i32 %78)
%81 = icmp eq i64 %74, 57
br i1 %81, label %82, label %72
82: ; preds = %72
%83 = add nuw nsw i32 %69, 1
%84 = and i32 %83, 255
%85 = icmp ugt i32 %65, %84
br i1 %85, label %68, label %86
86: ; preds = %82, %60, %54
%87 = call i32 @munmap(i8* %39, i32 %32)
%88 = call i32 @close(i32 %21)
br label %89
89: ; preds = %86, %41
%90 = phi i32 [ -1, %41 ], [ 0, %86 ]
ret i32 %90
}