#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 */
char EOF;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *);
void bcindent() {
  FILE *f, *fp, *fd, *fo;
  f = fopen("temp3.txt", "a+");
  fd = fopen("temp3.txt", "a+");
  fo = fopen("temp3.txt", "a+");
  fp = fopen("temp1.txt", "w");
  char c, d, e;
  int count = 0, comment = 0, sam = 0, sc = 0;
  int counter = 0, cfsc = 0;
  int temp = 0, last = 0;
  if (f == NULL) {
    printf("file not exist");
    exit(0);
  } else {
    while (1) {
      if (count == 0) {
        c = fgetc(f);
        d = fgetc(fd);
      } else {
        c = fgetc(f);
        d = fgetc(fd);
        e = fgetc(fo);
      }
      if (e == EOF) {
        break;
      }
      if (count > 0) {
        fprintf(fp, "%c", e);
      }
      count++;
      if (c == '"' && sc == 0) {
        if (sam == 0) {
          sam++;
        } else {
          sam--;
        }
      }
      if (c == 39 && sam == 0) {
        if (sc == 0) {
          sc++;
        } else {
          sc--;
        }
      }
      if (c == '(' && sc == 0 && sam == 0) {
        last++;
      }
      if (c == '/') {
        comment++;
      } else {
        comment = 0;
      }
      if (comment == 2 && sam == 0) {
        while (1) {
          if (c == '\n')
            break;
          c = fgetc(f);
          d = fgetc(fd);
          e = fgetc(fo);
          fprintf(fp, "%c", e);
        }
        comment = 0;
      }
      if (c == '{' && sam == 0 && sc == 0 && last != 0) {
        while (d != '\n') {
          d = fgetc(fd);
          if (d == '"' && cfsc == 0) {
            if (counter == 0) {
              counter++;
            } else {
              counter--;
            }
          }
          if (d == 39 && counter == 0) {
            if (cfsc == 0) {
              cfsc++;
            } else {
              cfsc--;
            }
          }
          if (d == '{' && counter == 0 && cfsc == 0)
            temp++;
          if (d == '}' && counter == 0 && cfsc == 0)
            temp--;
        }
        if (temp == 0 && sam == 0 && sc == 0) {
          fprintf(fp, "\n");
          c = fgetc(f);
          e = fgetc(fo);
          fprintf(fp, "%c", e);
          fprintf(fp, "\n");
        } else {
          temp = 0;
        }
        while (c != '\n') {
          c = fgetc(f);
          e = fgetc(fo);
          fprintf(fp, "%c", e);
          sc = 0;
          last = 0;
          temp = 0;
          comment = 0;
          sam = 0;
        }
      }
    }
  }
  fclose(f);
  fclose(fo);
  fclose(fd);
  fclose(fp);
}


x86 assembly (clang, -O0):
<bcindent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xe91(%rip),%rdi
lea    0xe94(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x8(%rbp)
lea    0xe7a(%rip),%rdi
lea    0xe7d(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe63(%rip),%rdi
lea    0xe66(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xe59(%rip),%rdi
lea    0xe5c(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    121a <bcindent+0xba>
lea    0xe0b(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
jmp    121f <bcindent+0xbf>
cmpl   $0x0,-0x28(%rbp)
jne    1246 <bcindent+0xe6>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x22(%rbp)
jmp    126a <bcindent+0x10a>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x22(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x23(%rbp)
movsbl -0x23(%rbp),%eax
mov    0x2d73(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1285 <bcindent+0x125>
jmp    15ef <bcindent+0x48f>
cmpl   $0x0,-0x28(%rbp)
jle    12a5 <bcindent+0x145>
mov    -0x10(%rbp),%rdi
movsbl -0x23(%rbp),%edx
lea    0xd8a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x22,%eax
jne    12eb <bcindent+0x18b>
cmpl   $0x0,-0x34(%rbp)
jne    12eb <bcindent+0x18b>
cmpl   $0x0,-0x30(%rbp)
jne    12dd <bcindent+0x17d>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    12e6 <bcindent+0x186>
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
jmp    12eb <bcindent+0x18b>
movsbl -0x21(%rbp),%eax
cmp    $0x27,%eax
jne    1328 <bcindent+0x1c8>
cmpl   $0x0,-0x30(%rbp)
jne    1328 <bcindent+0x1c8>
cmpl   $0x0,-0x34(%rbp)
jne    131a <bcindent+0x1ba>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1323 <bcindent+0x1c3>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1328 <bcindent+0x1c8>
movsbl -0x21(%rbp),%eax
cmp    $0x28,%eax
jne    1352 <bcindent+0x1f2>
cmpl   $0x0,-0x34(%rbp)
jne    1352 <bcindent+0x1f2>
cmpl   $0x0,-0x30(%rbp)
jne    1352 <bcindent+0x1f2>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x2f,%eax
jne    136d <bcindent+0x20d>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1374 <bcindent+0x214>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jne    13e5 <bcindent+0x285>
cmpl   $0x0,-0x30(%rbp)
jne    13e5 <bcindent+0x285>
jmp    138d <bcindent+0x22d>
movsbl -0x21(%rbp),%eax
cmp    $0xa,%eax
jne    139f <bcindent+0x23f>
jmp    13de <bcindent+0x27e>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x22(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x23(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x23(%rbp),%edx
lea    0xc56(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    138d <bcindent+0x22d>
movl   $0x0,-0x2c(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x7b,%eax
jne    15ea <bcindent+0x48a>
cmpl   $0x0,-0x30(%rbp)
jne    15ea <bcindent+0x48a>
cmpl   $0x0,-0x34(%rbp)
jne    15ea <bcindent+0x48a>
cmpl   $0x0,-0x44(%rbp)
je     15ea <bcindent+0x48a>
jmp    1415 <bcindent+0x2b5>
movsbl -0x22(%rbp),%eax
cmp    $0xa,%eax
je     1501 <bcindent+0x3a1>
mov    -0x18(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x22(%rbp)
movsbl -0x22(%rbp),%eax
cmp    $0x22,%eax
jne    146b <bcindent+0x30b>
cmpl   $0x0,-0x3c(%rbp)
jne    146b <bcindent+0x30b>
cmpl   $0x0,-0x38(%rbp)
jne    145d <bcindent+0x2fd>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1466 <bcindent+0x306>
mov    -0x38(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x38(%rbp)
jmp    146b <bcindent+0x30b>
movsbl -0x22(%rbp),%eax
cmp    $0x27,%eax
jne    14a8 <bcindent+0x348>
cmpl   $0x0,-0x38(%rbp)
jne    14a8 <bcindent+0x348>
cmpl   $0x0,-0x3c(%rbp)
jne    149a <bcindent+0x33a>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    14a3 <bcindent+0x343>
mov    -0x3c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
jmp    14a8 <bcindent+0x348>
movsbl -0x22(%rbp),%eax
cmp    $0x7b,%eax
jne    14d2 <bcindent+0x372>
cmpl   $0x0,-0x38(%rbp)
jne    14d2 <bcindent+0x372>
cmpl   $0x0,-0x3c(%rbp)
jne    14d2 <bcindent+0x372>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
movsbl -0x22(%rbp),%eax
cmp    $0x7d,%eax
jne    14fc <bcindent+0x39c>
cmpl   $0x0,-0x38(%rbp)
jne    14fc <bcindent+0x39c>
cmpl   $0x0,-0x3c(%rbp)
jne    14fc <bcindent+0x39c>
mov    -0x40(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x40(%rbp)
jmp    1415 <bcindent+0x2b5>
cmpl   $0x0,-0x40(%rbp)
jne    1576 <bcindent+0x416>
cmpl   $0x0,-0x30(%rbp)
jne    1576 <bcindent+0x416>
cmpl   $0x0,-0x34(%rbp)
jne    1576 <bcindent+0x416>
mov    -0x10(%rbp),%rdi
lea    0xb01(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x23(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x23(%rbp),%edx
lea    0xad0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xac1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    157d <bcindent+0x41d>
movl   $0x0,-0x40(%rbp)
jmp    1582 <bcindent+0x422>
movsbl -0x21(%rbp),%eax
cmp    $0xa,%eax
je     15e5 <bcindent+0x485>
mov    -0x8(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <fgetc@plt>
mov    %al,-0x23(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x23(%rbp),%edx
lea    0xa72(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
jmp    1582 <bcindent+0x422>
jmp    15ea <bcindent+0x48a>
jmp    121f <bcindent+0xbf>
jmp    15f4 <bcindent+0x494>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcindent>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeb1(%rip),%rbx
lea    0xeb4(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <fopen@plt>
mov    %rax,%r15
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <fopen@plt>
lea    0xe89(%rip),%rdi
lea    0xe8c(%rip),%rsi
call   1050 <fopen@plt>
test   %r15,%r15
jne    11a8 <bcindent+0x68>
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>
mov    %r15,%rdi
call   1040 <fgetc@plt>
mov    %r14,%rdi
call   1040 <fgetc@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"temp3.txt\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [10 x i8] c"temp1.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [15 x i8] c"file not exist\00"
@EOF = global i8 0
@.str.5 = [3 x i8] c"%c\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @bcindent() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %16, i32** %1
%17 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %17, i32** %3
%18 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %18, i32** %4
%19 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %19, i32** %2
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
%20 = load i32*, i32** %1
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %0
%23 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%24 = call i32 @exit(i32 0)
unreachable
25: ; preds = %0
br label %26
26: ; preds = %25, %256
%27 = load i32, i32* %8
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %34
29: ; preds = %26
%30 = load i32*, i32** %1
%31 = call signext i8 @fgetc(i32* %30)
store i8 %31, i8* %5
%32 = load i32*, i32** %3
%33 = call signext i8 @fgetc(i32* %32)
store i8 %33, i8* %6
br label %41
34: ; preds = %26
%35 = load i32*, i32** %1
%36 = call signext i8 @fgetc(i32* %35)
store i8 %36, i8* %5
%37 = load i32*, i32** %3
%38 = call signext i8 @fgetc(i32* %37)
store i8 %38, i8* %6
%39 = load i32*, i32** %4
%40 = call signext i8 @fgetc(i32* %39)
store i8 %40, i8* %7
br label %41
41: ; preds = %34, %29
%42 = load i8, i8* %7
%43 = sext i8 %42 to i32
%44 = load i8, i8* @EOF
%45 = sext i8 %44 to i32
%46 = icmp eq i32 %43, %45
br i1 %46, label %47, label %48
47: ; preds = %41
br label %257
48: ; preds = %41
%49 = load i32, i32* %8
%50 = icmp sgt i32 %49, 0
br i1 %50, label %51, label %56
51: ; preds = %48
%52 = load i32*, i32** %2
%53 = load i8, i8* %7
%54 = sext i8 %53 to i32
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %51, %48
%57 = load i32, i32* %8
%58 = add nsw i32 %57, 1
store i32 %58, i32* %8
%59 = load i8, i8* %5
%60 = sext i8 %59 to i32
%61 = icmp eq i32 %60, 34
br i1 %61, label %62, label %75
62: ; preds = %56
%63 = load i32, i32* %11
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %75
65: ; preds = %62
%66 = load i32, i32* %10
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %65
%69 = load i32, i32* %10
%70 = add nsw i32 %69, 1
store i32 %70, i32* %10
br label %74
71: ; preds = %65
%72 = load i32, i32* %10
%73 = add nsw i32 %72, -1
store i32 %73, i32* %10
br label %74
74: ; preds = %71, %68
br label %75
75: ; preds = %74, %62, %56
%76 = load i8, i8* %5
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 39
br i1 %78, label %79, label %92
79: ; preds = %75
%80 = load i32, i32* %10
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %92
82: ; preds = %79
%83 = load i32, i32* %11
%84 = icmp eq i32 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %82
%86 = load i32, i32* %11
%87 = add nsw i32 %86, 1
store i32 %87, i32* %11
br label %91
88: ; preds = %82
%89 = load i32, i32* %11
%90 = add nsw i32 %89, -1
store i32 %90, i32* %11
br label %91
91: ; preds = %88, %85
br label %92
92: ; preds = %91, %79, %75
%93 = load i8, i8* %5
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 40
br i1 %95, label %96, label %105
96: ; preds = %92
%97 = load i32, i32* %11
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %105
99: ; preds = %96
%100 = load i32, i32* %10
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %105
102: ; preds = %99
%103 = load i32, i32* %15
%104 = add nsw i32 %103, 1
store i32 %104, i32* %15
br label %105
105: ; preds = %102, %99, %96, %92
%106 = load i8, i8* %5
%107 = sext i8 %106 to i32
%108 = icmp eq i32 %107, 47
br i1 %108, label %109, label %112
109: ; preds = %105
%110 = load i32, i32* %9
%111 = add nsw i32 %110, 1
store i32 %111, i32* %9
br label %113
112: ; preds = %105
store i32 0, i32* %9
br label %113
113: ; preds = %112, %109
%114 = load i32, i32* %9
%115 = icmp eq i32 %114, 2
br i1 %115, label %116, label %137
116: ; preds = %113
%117 = load i32, i32* %10
%118 = icmp eq i32 %117, 0
br i1 %118, label %119, label %137
119: ; preds = %116
br label %120
120: ; preds = %119, %125
%121 = load i8, i8* %5
%122 = sext i8 %121 to i32
%123 = icmp eq i32 %122, 10
br i1 %123, label %124, label %125
124: ; preds = %120
br label %136
125: ; preds = %120
%126 = load i32*, i32** %1
%127 = call signext i8 @fgetc(i32* %126)
store i8 %127, i8* %5
%128 = load i32*, i32** %3
%129 = call signext i8 @fgetc(i32* %128)
store i8 %129, i8* %6
%130 = load i32*, i32** %4
%131 = call signext i8 @fgetc(i32* %130)
store i8 %131, i8* %7
%132 = load i32*, i32** %2
%133 = load i8, i8* %7
%134 = sext i8 %133 to i32
%135 = call i32 (i32*, i8*, ...) @fprintf(i32* %132, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %134)
br label %120
136: ; preds = %124
store i32 0, i32* %9
br label %137
137: ; preds = %136, %116, %113
%138 = load i8, i8* %5
%139 = sext i8 %138 to i32
%140 = icmp eq i32 %139, 123
br i1 %140, label %141, label %256
141: ; preds = %137
%142 = load i32, i32* %10
%143 = icmp eq i32 %142, 0
br i1 %143, label %144, label %256
144: ; preds = %141
%145 = load i32, i32* %11
%146 = icmp eq i32 %145, 0
br i1 %146, label %147, label %256
147: ; preds = %144
%148 = load i32, i32* %15
%149 = icmp ne i32 %148, 0
br i1 %149, label %150, label %256
150: ; preds = %147
br label %151
151: ; preds = %217, %150
%152 = load i8, i8* %6
%153 = sext i8 %152 to i32
%154 = icmp ne i32 %153, 10
br i1 %154, label %155, label %218
155: ; preds = %151
%156 = load i32*, i32** %3
%157 = call signext i8 @fgetc(i32* %156)
store i8 %157, i8* %6
%158 = load i8, i8* %6
%159 = sext i8 %158 to i32
%160 = icmp eq i32 %159, 34
br i1 %160, label %161, label %174
161: ; preds = %155
%162 = load i32, i32* %13
%163 = icmp eq i32 %162, 0
br i1 %163, label %164, label %174
164: ; preds = %161
%165 = load i32, i32* %12
%166 = icmp eq i32 %165, 0
br i1 %166, label %167, label %170
167: ; preds = %164
%168 = load i32, i32* %12
%169 = add nsw i32 %168, 1
store i32 %169, i32* %12
br label %173
170: ; preds = %164
%171 = load i32, i32* %12
%172 = add nsw i32 %171, -1
store i32 %172, i32* %12
br label %173
173: ; preds = %170, %167
br label %174
174: ; preds = %173, %161, %155
%175 = load i8, i8* %6
%176 = sext i8 %175 to i32
%177 = icmp eq i32 %176, 39
br i1 %177, label %178, label %191
178: ; preds = %174
%179 = load i32, i32* %12
%180 = icmp eq i32 %179, 0
br i1 %180, label %181, label %191
181: ; preds = %178
%182 = load i32, i32* %13
%183 = icmp eq i32 %182, 0
br i1 %183, label %184, label %187
184: ; preds = %181
%185 = load i32, i32* %13
%186 = add nsw i32 %185, 1
store i32 %186, i32* %13
br label %190
187: ; preds = %181
%188 = load i32, i32* %13
%189 = add nsw i32 %188, -1
store i32 %189, i32* %13
br label %190
190: ; preds = %187, %184
br label %191
191: ; preds = %190, %178, %174
%192 = load i8, i8* %6
%193 = sext i8 %192 to i32
%194 = icmp eq i32 %193, 123
br i1 %194, label %195, label %204
195: ; preds = %191
%196 = load i32, i32* %12
%197 = icmp eq i32 %196, 0
br i1 %197, label %198, label %204
198: ; preds = %195
%199 = load i32, i32* %13
%200 = icmp eq i32 %199, 0
br i1 %200, label %201, label %204
201: ; preds = %198
%202 = load i32, i32* %14
%203 = add nsw i32 %202, 1
store i32 %203, i32* %14
br label %204
204: ; preds = %201, %198, %195, %191
%205 = load i8, i8* %6
%206 = sext i8 %205 to i32
%207 = icmp eq i32 %206, 125
br i1 %207, label %208, label %217
208: ; preds = %204
%209 = load i32, i32* %12
%210 = icmp eq i32 %209, 0
br i1 %210, label %211, label %217
211: ; preds = %208
%212 = load i32, i32* %13
%213 = icmp eq i32 %212, 0
br i1 %213, label %214, label %217
214: ; preds = %211
%215 = load i32, i32* %14
%216 = add nsw i32 %215, -1
store i32 %216, i32* %14
br label %217
217: ; preds = %214, %211, %208, %204
br label %151
218: ; preds = %151
%219 = load i32, i32* %14
%220 = icmp eq i32 %219, 0
br i1 %220, label %221, label %240
221: ; preds = %218
%222 = load i32, i32* %10
%223 = icmp eq i32 %222, 0
br i1 %223, label %224, label %240
224: ; preds = %221
%225 = load i32, i32* %11
%226 = icmp eq i32 %225, 0
br i1 %226, label %227, label %240
227: ; preds = %224
%228 = load i32*, i32** %2
%229 = call i32 (i32*, i8*, ...) @fprintf(i32* %228, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%230 = load i32*, i32** %1
%231 = call signext i8 @fgetc(i32* %230)
store i8 %231, i8* %5
%232 = load i32*, i32** %4
%233 = call signext i8 @fgetc(i32* %232)
store i8 %233, i8* %7
%234 = load i32*, i32** %2
%235 = load i8, i8* %7
%236 = sext i8 %235 to i32
%237 = call i32 (i32*, i8*, ...) @fprintf(i32* %234, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %236)
%238 = load i32*, i32** %2
%239 = call i32 (i32*, i8*, ...) @fprintf(i32* %238, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %241
240: ; preds = %224, %221, %218
store i32 0, i32* %14
br label %241
241: ; preds = %240, %227
br label %242
242: ; preds = %246, %241
%243 = load i8, i8* %5
%244 = sext i8 %243 to i32
%245 = icmp ne i32 %244, 10
br i1 %245, label %246, label %255
246: ; preds = %242
%247 = load i32*, i32** %1
%248 = call signext i8 @fgetc(i32* %247)
store i8 %248, i8* %5
%249 = load i32*, i32** %4
%250 = call signext i8 @fgetc(i32* %249)
store i8 %250, i8* %7
%251 = load i32*, i32** %2
%252 = load i8, i8* %7
%253 = sext i8 %252 to i32
%254 = call i32 (i32*, i8*, ...) @fprintf(i32* %251, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %253)
store i32 0, i32* %11
store i32 0, i32* %15
store i32 0, i32* %14
store i32 0, i32* %9
store i32 0, i32* %10
br label %242
255: ; preds = %242
br label %256
256: ; preds = %255, %147, %144, %141, %137
br label %26
257: ; preds = %47
br label %258
258: ; preds = %257
%259 = load i32*, i32** %1
%260 = call i32 @fclose(i32* %259)
%261 = load i32*, i32** %4
%262 = call i32 @fclose(i32* %261)
%263 = load i32*, i32** %3
%264 = call i32 @fclose(i32* %263)
%265 = load i32*, i32** %2
%266 = call i32 @fclose(i32* %265)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"temp3.txt\00"
@.str.1 = [3 x i8] c"a+\00"
@.str.2 = [10 x i8] c"temp1.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [15 x i8] c"file not exist\00"
@EOF = global i8 0
define void @bcindent() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%5 = icmp eq i32* %1, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %0
%10 = tail call signext i8 @fgetc(i32* %1)
%11 = tail call signext i8 @fgetc(i32* %2)
unreachable
}