#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 */
scalar_t__ EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, int, int, int);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *, int *, int *, ...);
int /*<<< orphan*/ printf(char *);
scalar_t__ remove(char *);
int main(void) {
  FILE *file1, *file2;
  int class = 0, win = 0, lost = 0, i = 0, delete = 0;
  int win_c = 0, lost_c = 0;
  double winp = 0.00;
  file1 = fopen("Stats.txt", "r");
  file2 = fopen("Stats1.txt", "w");
  while (fscanf(file1, "%d %d %d", &class, &win, &lost) != EOF) {
    fprintf(file2, " %d %d %d %d", class, win, lost, 0);
  }
  fclose(file1);
  fclose(file2);
  file1 = fopen("Stats.txt", "w");
  file2 = fopen("Stats1.txt", "r");
  while (fscanf(file2, "%d %d %d %d", &class, &win, &lost, &delete) != EOF) {
    fprintf(file1, " %d %d %d %d", class, win, lost, delete);
  }
  fclose(file1);
  fclose(file2);
  if (remove("Stats1.txt") == 0)
    printf("\n __________________________________ \n"
           ": Succes                           :\n"
           ":__________________________________:\n\n");
  else {
    printf("\n __________________________________ \n"
           ": Succes                           :\n"
           ":__________________________________:\n\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
lea    0xe51(%rip),%rdi
lea    0xe54(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe46(%rip),%rdi
lea    0xe4a(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe3c(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    0x2ded(%rip),%rcx
cmp    (%rcx),%rax
je     1226 <main+0xc6>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
lea    0xe00(%rip),%rsi
xor    %r9d,%r9d
call   1070 <fprintf@plt>
jmp    11d6 <main+0x76>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xdc1(%rip),%rdi
lea    0xdd1(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xdb6(%rip),%rdi
lea    0xdad(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xda9(%rip),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%r8
lea    -0x2c(%rbp),%r9
mov    $0x0,%al
call   1060 <fscanf@plt>
mov    0x2d59(%rip),%rcx
cmp    (%rcx),%rax
je     12bb <main+0x15b>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    -0x2c(%rbp),%r9d
lea    0xd68(%rip),%rsi
call   1070 <fprintf@plt>
jmp    1266 <main+0x106>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xd38(%rip),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
jne    12f4 <main+0x194>
lea    0xd3c(%rip),%rdi
call   1050 <printf@plt>
jmp    1300 <main+0x1a0>
lea    0xd2b(%rip),%rdi
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x14(%rsp)
lea    0xe6b(%rip),%rdi
lea    0xe6e(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
lea    0xe61(%rip),%rdi
lea    0xe65(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
lea    0xe5c(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    0x2e07(%rip),%rcx
cmp    (%rcx),%rax
je     1241 <main+0xe1>
lea    0xe30(%rip),%r12
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rbp
lea    0x8(%rsp),%r15
nopl   0x0(%rax)
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    %rbx,%rdi
lea    0xe02(%rip),%rsi
xor    %r9d,%r9d
call   1070 <fprintf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbp,%rcx
mov    %r15,%r8
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    0x2dac(%rip),%rcx
cmp    (%rcx),%rax
jne    1200 <main+0xa0>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xda8(%rip),%rdi
lea    0xdb8(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
lea    0xd9e(%rip),%rdi
lea    0xd95(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
lea    0xd96(%rip),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
lea    0x8(%rsp),%r8
lea    0x14(%rsp),%r9
mov    %rax,%rdi
xor    %eax,%eax
call   1060 <fscanf@plt>
mov    0x2d3f(%rip),%r13
cmp    0x0(%r13),%rax
je     1306 <main+0x1a6>
lea    0xc(%rsp),%rbp
lea    0x8(%rsp),%r15
lea    0x14(%rsp),%r12
xchg   %ax,%ax
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x8(%rsp),%r8d
mov    0x14(%rsp),%r9d
mov    %r14,%rdi
lea    0xd3d(%rip),%rsi
call   1070 <fprintf@plt>
mov    %rbx,%rdi
lea    0xd2f(%rip),%rsi
lea    0x10(%rsp),%rdx
mov    %rbp,%rcx
mov    %r15,%r8
mov    %r12,%r9
xor    %eax,%eax
call   1060 <fscanf@plt>
cmp    0x0(%r13),%rax
jne    12c0 <main+0x160>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xcef(%rip),%rdi
call   1030 <remove@plt>
lea    0xcfd(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Stats.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"Stats1.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [9 x i8] c"%d %d %d\00"
@EOF = global i64 0
@.str.5 = [13 x i8] c" %d %d %d %d\00"
@.str.6 = [12 x i8] c"%d %d %d %d\00"
@.str.7 = [114 x i8] c"\0A __________________________________ \0A: Succes :\0A:__________________________________:\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store double 0.000000e+00, double* %11
%12 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %12, i32** %2
%13 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 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* %13, i32** %3
br label %14
14: ; preds = %19, %0
%15 = load i32*, i32** %2
%16 = call i64 (i32*, i8*, i32*, i32*, i32*, ...) @fscanf(i32* %15, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%17 = load i64, i64* @EOF
%18 = icmp ne i64 %16, %17
br i1 %18, label %19, label %25
19: ; preds = %14
%20 = load i32*, i32** %3
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = call i32 @fprintf(i32* %20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %21, i32 %22, i32 %23, i32 0)
br label %14
25: ; preds = %14
%26 = load i32*, i32** %2
%27 = call i32 @fclose(i32* %26)
%28 = load i32*, i32** %3
%29 = call i32 @fclose(i32* %28)
%30 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %30, i32** %2
%31 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %31, i32** %3
br label %32
32: ; preds = %37, %25
%33 = load i32*, i32** %3
%34 = call i64 (i32*, i8*, i32*, i32*, i32*, ...) @fscanf(i32* %33, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32* %4, i32* %5, i32* %6, i32* %8)
%35 = load i64, i64* @EOF
%36 = icmp ne i64 %34, %35
br i1 %36, label %37, label %44
37: ; preds = %32
%38 = load i32*, i32** %2
%39 = load i32, i32* %4
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = load i32, i32* %8
%43 = call i32 @fprintf(i32* %38, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %39, i32 %40, i32 %41, i32 %42)
br label %32
44: ; preds = %32
%45 = load i32*, i32** %2
%46 = call i32 @fclose(i32* %45)
%47 = load i32*, i32** %3
%48 = call i32 @fclose(i32* %47)
%49 = call i64 @remove(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %44
%52 = call i32 @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.7, i64 0, i64 0))
br label %55
53: ; preds = %44
%54 = call i32 @printf(i8* getelementptr inbounds ([114 x i8], [114 x i8]* @.str.7, i64 0, i64 0))
br label %55
55: ; preds = %53, %51
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
@.str = [10 x i8] c"Stats.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [11 x i8] c"Stats1.txt\00"
@.str.3 = [2 x i8] c"w\00"
@.str.4 = [9 x i8] c"%d %d %d\00"
@EOF = global i64 0
@.str.5 = [13 x i8] c" %d %d %d %d\00"
@.str.6 = [12 x i8] c"%d %d %d %d\00"
@str.8 = [113 x i8] c"\0A __________________________________ \0A: Succes :\0A:__________________________________:\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%6 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%11 = call i64 (i32*, i8*, i32*, i32*, i32*, ...) @fscanf(i32* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %22, label %14
14: ; preds = %0, %14
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = call i32 @fprintf(i32* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 0)
%19 = call i64 (i32*, i8*, i32*, i32*, i32*, ...) @fscanf(i32* %9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%20 = load i64, i64* @EOF
%21 = icmp eq i64 %19, %20
br i1 %21, label %22, label %14
22: ; preds = %14, %0
%23 = call i32 @fclose(i32* %9)
%24 = call i32 @fclose(i32* %10)
%25 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = call i64 (i32*, i8*, i32*, i32*, i32*, ...) @fscanf(i32* %26, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%28 = load i64, i64* @EOF
%29 = icmp eq i64 %27, %28
br i1 %29, label %39, label %30
30: ; preds = %22, %30
%31 = load i32, i32* %1
%32 = load i32, i32* %2
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %31, i32 %32, i32 %33, i32 %34)
%36 = call i64 (i32*, i8*, i32*, i32*, i32*, ...) @fscanf(i32* %26, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32* %1, i32* %2, i32* %3, i32* %4)
%37 = load i64, i64* @EOF
%38 = icmp eq i64 %36, %37
br i1 %38, label %39, label %30
39: ; preds = %30, %22
%40 = call i32 @fclose(i32* %25)
%41 = call i32 @fclose(i32* %26)
%42 = call i64 @remove(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%43 = icmp eq i64 %42, 0
%44 = select i1 %43, i8* getelementptr inbounds ([113 x i8], [113 x i8]* @str.8, i64 0, i64 0), i8* getelementptr inbounds ([113 x i8], [113 x i8]* @str.8, i64 0, i64 0)
%45 = call i32 @puts(i8* dereferenceable(1) %44)
ret i32 0
}