#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
char fgetc(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ printf(char *, char *);
void new_start() {
  int sum;
  FILE *fpio;
  fpio = fopen("data/select.db", "r");
  if (fpio == NULL) {
    printf("error	:	files %s can not open !\n", "data/select.db");
    exit(1);
  }
  for (sum = 0; !feof(fpio);) {
    if (fgetc(fpio) == '^')
      sum++;
  }
  fclose(fpio);
  if ((fpio = fopen("data/option.ini", "w")) == NULL) {
    printf("error	:	files %s can not save !\n", "data/option.ini");
    exit(1);
  }
  fprintf(fpio, "password = %d", 6796286);
  fclose(fpio);
}


x86 assembly (clang, -O0):
<new_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe81(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11b7 <new_start+0x47>
lea    0xe70(%rip),%rdi
lea    0xe58(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11dc <new_start+0x6c>
jmp    11ff <new_start+0x8f>
mov    -0x10(%rbp),%rdi
call   1050 <fgetc@plt>
movsbl %al,%eax
cmp    $0x5e,%eax
jne    11fa <new_start+0x8a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11be <new_start+0x4e>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xe23(%rip),%rdi
lea    0xe2c(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1246 <new_start+0xd6>
lea    0xe14(%rip),%rdi
lea    0xdfb(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
mov    -0x10(%rbp),%rdi
lea    0xe14(%rip),%rsi
mov    $0x67b3fe,%edx
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<new_start>:
push   %rbx
lea    0xe88(%rip),%rdi
lea    0xe90(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     11e6 <new_start+0x76>
mov    %rax,%rbx
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    11a6 <new_start+0x36>
mov    %rbx,%rdi
call   1050 <fgetc@plt>
jmp    1190 <new_start+0x20>
mov    %rbx,%rdi
call   1030 <fclose@plt>
lea    0xe7d(%rip),%rdi
lea    0xe86(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     11f6 <new_start+0x86>
mov    %rax,%rbx
lea    0xe95(%rip),%rsi
mov    %rax,%rdi
mov    $0x67b3fe,%edx
call   1060 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
lea    0xe24(%rip),%rdi
lea    0xe0c(%rip),%rsi
jmp    1204 <new_start+0x94>
lea    0xe47(%rip),%rdi
lea    0xe2e(%rip),%rsi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"data/select.db\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [33 x i8] c"error\09:\09files %s can not open !\0A\00"
@.str.3 = [16 x i8] c"data/option.ini\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [33 x i8] c"error\09:\09files %s can not save !\0A\00"
@.str.6 = [14 x i8] c"password = %d\00"
define void @new_start() {
%1 = alloca i32
%2 = alloca i32*
%3 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %23, %9
%11 = load i32*, i32** %2
%12 = call i32 @feof(i32* %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
br i1 %14, label %15, label %24
15: ; preds = %10
%16 = load i32*, i32** %2
%17 = call signext i8 @fgetc(i32* %16)
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 94
br i1 %19, label %20, label %23
20: ; preds = %15
%21 = load i32, i32* %1
%22 = add nsw i32 %21, 1
store i32 %22, i32* %1
br label %23
23: ; preds = %20, %15
br label %10
24: ; preds = %10
%25 = load i32*, i32** %2
%26 = call i32 @fclose(i32* %25)
%27 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32* %27, i32** %2
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %32
29: ; preds = %24
%30 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %24
%33 = load i32*, i32** %2
%34 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 6796286)
%35 = load i32*, i32** %2
%36 = call i32 @fclose(i32* %35)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"data/select.db\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [33 x i8] c"error\09:\09files %s can not open !\0A\00"
@.str.3 = [16 x i8] c"data/option.ini\00"
@.str.4 = [2 x i8] c"w\00"
@.str.5 = [33 x i8] c"error\09:\09files %s can not save !\0A\00"
@.str.6 = [14 x i8] c"password = %d\00"
define void @new_start() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @feof(i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %13
6: ; preds = %0
%7 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %3, %9
%10 = tail call signext i8 @fgetc(i32* %1)
%11 = tail call i32 @feof(i32* %1)
%12 = icmp eq i32 %11, 0
br i1 %12, label %9, label %13
13: ; preds = %9, %3
%14 = tail call i32 @fclose(i32* %1)
%15 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%19 = tail call i32 @exit(i32 1)
unreachable
20: ; preds = %13
%21 = tail call i32 @fprintf(i32* %15, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 6796286)
%22 = tail call i32 @fclose(i32* %15)
ret void
}