#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 */
struct stat {
  int dummy;
};
typedef int /*<<< orphan*/ fileName;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, long, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ ftruncate(int /*<<< orphan*/, long);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, double);
int /*<<< orphan*/ sscanf(char *, char *, double *);
scalar_t__ stat(char *, struct stat *);
long strlen(char *);
scalar_t__ strncmp(char *, char *, int);
FILE *copySplitData(FILE *input, double t2, long before) {
  char data[1024];
  char fileName[80];
  double t1;
  FILE *output;
  FILE *rest;
  struct stat fbuf;
  long lastdatalen;
  long currentPos = ftell(input);
  fseek(input, 0L, SEEK_SET);
  while (!feof(input)) {
    fgets(data, 1024, input);
    if (strncmp(data, "##", 2) != 0) {
      sscanf(data, "%lf", &t1);
      break;
    }
  }
  memset(data, 0, 1024);
  snprintf(fileName, sizeof(fileName), "%lf-split.log", t1);
  fseek(input, 0L, SEEK_SET);
  if (stat(fileName, &fbuf) != 0) {
    output = fopen(fileName, "w+");
    printf("I: Creating... %s\n", fileName);
    while (!feof(input)) {
      fgets(data, 1024, input);
      if (ftell(input) >= currentPos)
        break;
      fputs(data, output);
    }
    fseek(input, currentPos - strlen(data), SEEK_SET);
    fclose(output);
  } else {
    printf("W: %s already exists!\n", fileName);
    fseek(input, currentPos - before, SEEK_SET);
  }
  snprintf(fileName, sizeof(fileName), "%lf-split.log", t2);
  if (stat(fileName, &fbuf) != 0) {
    rest = fopen(fileName, "w+");
    printf("I: Creating... %s\n", fileName);
    while (1) {
      fgets(data, 1024, input);
      lastdatalen = strlen(data);
      if (feof(input))
        break;
      fputs(data, rest);
    }
    fflush(rest);
    ftruncate(fileno(input), currentPos - before);
    fclose(input);
    return rest;
  } else {
    fseek(input, 0L, SEEK_SET);
    printf("W: %s already exists!\n", fileName);
    return input;
  }
}


x86 assembly (clang, -O0):
<copySplitData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4b0,%rsp
mov    %rdi,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   10c0 <ftell@plt>
mov    %rax,-0x4a0(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2d9d(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1120 <fseek@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    126d <copySplitData+0x5d>
jmp    12c8 <copySplitData+0xb8>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   10b0 <fgets@plt>
lea    -0x420(%rbp),%rdi
lea    0xd70(%rip),%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     12c3 <copySplitData+0xb3>
lea    -0x420(%rbp),%rdi
lea    0xd51(%rip),%rsi
lea    -0x478(%rbp),%rdx
call   1110 <sscanf@plt>
jmp    12c8 <copySplitData+0xb8>
jmp    124e <copySplitData+0x3e>
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   10a0 <memset@plt>
lea    -0x470(%rbp),%rdi
movsd  -0x478(%rbp),%xmm0
ff
mov    $0x50,%esi
lea    0xd11(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2cda(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1120 <fseek@plt>
lea    -0x470(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   10e0 <stat@plt>
cmp    $0x0,%rax
je     1417 <copySplitData+0x207>
lea    -0x470(%rbp),%rdi
lea    0xcd9(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x480(%rbp)
lea    -0x470(%rbp),%rsi
lea    0xcc2(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10d0 <feof@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    137a <copySplitData+0x16a>
jmp    13c2 <copySplitData+0x1b2>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   10b0 <fgets@plt>
mov    -0x10(%rbp),%rdi
call   10c0 <ftell@plt>
cmp    -0x4a0(%rbp),%rax
jl     13aa <copySplitData+0x19a>
jmp    13c2 <copySplitData+0x1b2>
lea    -0x420(%rbp),%rdi
mov    -0x480(%rbp),%rsi
call   1090 <fputs@plt>
jmp    135b <copySplitData+0x14b>
mov    -0x10(%rbp),%rax
mov    %rax,-0x4a8(%rbp)
mov    -0x4a0(%rbp),%rax
mov    %rax,-0x4b0(%rbp)
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4b0(%rbp),%rsi
mov    -0x4a8(%rbp),%rdi
sub    %rax,%rsi
mov    0x2be1(%rip),%rax
mov    (%rax),%edx
call   1120 <fseek@plt>
mov    -0x480(%rbp),%rdi
call   1040 <fclose@plt>
jmp    1447 <copySplitData+0x237>
lea    -0x470(%rbp),%rsi
lea    0xc06(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4a0(%rbp),%rsi
sub    -0x20(%rbp),%rsi
mov    0x2ba0(%rip),%rax
mov    (%rax),%edx
call   1120 <fseek@plt>
lea    -0x470(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    $0x50,%esi
lea    0xba8(%rip),%rdx
call   1070 <snprintf@plt>
lea    -0x470(%rbp),%rdi
lea    -0x490(%rbp),%rsi
call   10e0 <stat@plt>
cmp    $0x0,%rax
je     1546 <copySplitData+0x336>
lea    -0x470(%rbp),%rdi
lea    0xb86(%rip),%rsi
call   1130 <fopen@plt>
mov    %rax,-0x488(%rbp)
lea    -0x470(%rbp),%rsi
lea    0xb6f(%rip),%rdi
call   1060 <printf@plt>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x400,%esi
call   10b0 <fgets@plt>
lea    -0x420(%rbp),%rdi
call   1050 <strlen@plt>
mov    %rax,-0x498(%rbp)
mov    -0x10(%rbp),%rdi
call   10d0 <feof@plt>
cmp    $0x0,%rax
je     14ee <copySplitData+0x2de>
jmp    1506 <copySplitData+0x2f6>
lea    -0x420(%rbp),%rdi
mov    -0x488(%rbp),%rsi
call   1090 <fputs@plt>
jmp    14ae <copySplitData+0x29e>
mov    -0x488(%rbp),%rdi
call   1100 <fflush@plt>
mov    -0x10(%rbp),%rdi
call   10f0 <fileno@plt>
mov    %eax,%edi
mov    -0x4a0(%rbp),%rsi
sub    -0x20(%rbp),%rsi
call   1080 <ftruncate@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x488(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1577 <copySplitData+0x367>
mov    -0x10(%rbp),%rdi
mov    0x2a8f(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
call   1120 <fseek@plt>
lea    -0x470(%rbp),%rsi
lea    0xac1(%rip),%rdi
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copySplitData>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x478,%rsp
mov    %rsi,%r13
movsd  %xmm0,0x8(%rsp)
mov    %rdi,%rbp
call   10c0 <ftell@plt>
mov    %rax,%r15
mov    0x2da4(%rip),%r14
mov    (%r14),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1120 <fseek@plt>
lea    0x70(%rsp),%rbx
lea    0xdab(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %rax,%rax
jne    12a8 <copySplitData+0x98>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %rbp,%rdx
call   10b0 <fgets@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x2,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1260 <copySplitData+0x50>
lea    0xd6a(%rip),%rsi
lea    0x70(%rsp),%rdi
lea    0x18(%rsp),%rdx
call   1110 <sscanf@plt>
lea    0x70(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   10a0 <memset@plt>
movsd  0x18(%rsp),%xmm0
lea    0xd41(%rip),%rdx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1070 <snprintf@plt>
mov    (%r14),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1120 <fseek@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   10e0 <stat@plt>
test   %rax,%rax
je     13a5 <copySplitData+0x195>
mov    %r13,0x10(%rsp)
lea    0xd10(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1130 <fopen@plt>
mov    %rax,%r12
lea    0xcfc(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %rax,%rax
jne    1375 <copySplitData+0x165>
lea    0x70(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
mov    %r13,%rdi
mov    $0x400,%esi
mov    %rbp,%rdx
call   10b0 <fgets@plt>
mov    %rbp,%rdi
call   10c0 <ftell@plt>
cmp    %r15,%rax
jge    1375 <copySplitData+0x165>
mov    %r13,%rdi
mov    %r12,%rsi
call   1090 <fputs@plt>
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %rax,%rax
je     1340 <copySplitData+0x130>
lea    0x70(%rsp),%rdi
call   1050 <strlen@plt>
mov    %r15,%rsi
sub    %rax,%rsi
mov    0x2c54(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
call   1120 <fseek@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    0x10(%rsp),%r13
jmp    13c7 <copySplitData+0x1b7>
lea    0xc7f(%rip),%rdi
lea    0x20(%rsp),%rsi
call   1060 <printf@plt>
mov    %r15,%rsi
sub    %r13,%rsi
mov    (%r14),%edx
mov    %rbp,%rdi
call   1120 <fseek@plt>
movsd  0x8(%rsp),%xmm0
lea    0xc33(%rip),%rdx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
call   1070 <snprintf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   10e0 <stat@plt>
test   %rax,%rax
je     149f <copySplitData+0x28f>
lea    0xc14(%rip),%rsi
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1130 <fopen@plt>
mov    %rax,%r12
lea    0xc00(%rip),%rdi
mov    %rbx,%rsi
call   1060 <printf@plt>
lea    0x70(%rsp),%rdi
mov    $0x400,%esi
mov    %rbp,%rdx
call   10b0 <fgets@plt>
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %rax,%rax
jne    1478 <copySplitData+0x268>
lea    0x70(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r12,%rsi
call   1090 <fputs@plt>
mov    %rbx,%rdi
mov    $0x400,%esi
mov    %rbp,%rdx
call   10b0 <fgets@plt>
mov    %rbp,%rdi
call   10d0 <feof@plt>
test   %rax,%rax
je     1450 <copySplitData+0x240>
mov    %r12,%rdi
call   1100 <fflush@plt>
mov    %rbp,%rdi
call   10f0 <fileno@plt>
sub    %r13,%r15
mov    %eax,%edi
mov    %r15,%rsi
call   1080 <ftruncate@plt>
mov    %rbp,%rdi
call   1040 <fclose@plt>
jmp    14c6 <copySplitData+0x2b6>
mov    0x2b3a(%rip),%rax
mov    (%rax),%edx
mov    %rbp,%rdi
xor    %esi,%esi
call   1120 <fseek@plt>
lea    0xb72(%rip),%rdi
lea    0x20(%rsp),%rsi
call   1060 <printf@plt>
mov    %rbp,%r12
mov    %r12,%rax
add    $0x478,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@SEEK_SET = global i32 0
@.str = [3 x i8] c"##\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [14 x i8] c"%lf-split.log\00"
@.str.3 = [3 x i8] c"w+\00"
@.str.4 = [19 x i8] c"I: Creating... %s\0A\00"
@.str.5 = [23 x i8] c"W: %s already exists!\0A\00"
define i32* @copySplitData(i32* %0, double %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca double
%7 = alloca i64
%8 = alloca [1024 x i8]
%9 = alloca [80 x i8]
%10 = alloca double
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca %struct.stat
%14 = alloca i64
%15 = alloca i64
store i32* %0, i32** %5
store double %1, double* %6
store i64 %2, i64* %7
%16 = load i32*, i32** %5
%17 = call i64 @ftell(i32* %16)
store i64 %17, i64* %15
%18 = load i32*, i32** %5
%19 = load i32, i32* @SEEK_SET
%20 = call i32 @fseek(i32* %18, i64 0, i32 %19)
br label %21
21: ; preds = %36, %3
%22 = load i32*, i32** %5
%23 = call i64 @feof(i32* %22)
%24 = icmp ne i64 %23, 0
%25 = xor i1 %24, true
br i1 %25, label %26, label %37
26: ; preds = %21
%27 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%28 = load i32*, i32** %5
%29 = call i32 @fgets(i8* %27, i32 1024, i32* %28)
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%31 = call i64 @strncmp(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%32 = icmp ne i64 %31, 0
br i1 %32, label %33, label %36
33: ; preds = %26
%34 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%35 = call i32 @sscanf(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %10)
br label %37
36: ; preds = %26
br label %21
37: ; preds = %33, %21
%38 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%39 = call i32 @memset(i8* %38, i32 0, i32 1024)
%40 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%41 = load double, double* %10
%42 = call i32 @snprintf(i8* %40, i32 80, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %41)
%43 = load i32*, i32** %5
%44 = load i32, i32* @SEEK_SET
%45 = call i32 @fseek(i32* %43, i64 0, i32 %44)
%46 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%47 = call i64 @stat(i8* %46, %struct.stat* %13)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %82
49: ; preds = %37
%50 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%51 = call i32* @fopen(i8* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %51, i32** %11
%52 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%53 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %52)
br label %54
54: ; preds = %68, %49
%55 = load i32*, i32** %5
%56 = call i64 @feof(i32* %55)
%57 = icmp ne i64 %56, 0
%58 = xor i1 %57, true
br i1 %58, label %59, label %72
59: ; preds = %54
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%61 = load i32*, i32** %5
%62 = call i32 @fgets(i8* %60, i32 1024, i32* %61)
%63 = load i32*, i32** %5
%64 = call i64 @ftell(i32* %63)
%65 = load i64, i64* %15
%66 = icmp sge i64 %64, %65
br i1 %66, label %67, label %68
67: ; preds = %59
br label %72
68: ; preds = %59
%69 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%70 = load i32*, i32** %11
%71 = call i32 @fputs(i8* %69, i32* %70)
br label %54
72: ; preds = %67, %54
%73 = load i32*, i32** %5
%74 = load i64, i64* %15
%75 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%76 = call i64 @strlen(i8* %75)
%77 = sub nsw i64 %74, %76
%78 = load i32, i32* @SEEK_SET
%79 = call i32 @fseek(i32* %73, i64 %77, i32 %78)
%80 = load i32*, i32** %11
%81 = call i32 @fclose(i32* %80)
br label %91
82: ; preds = %37
%83 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%84 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %83)
%85 = load i32*, i32** %5
%86 = load i64, i64* %15
%87 = load i64, i64* %7
%88 = sub nsw i64 %86, %87
%89 = load i32, i32* @SEEK_SET
%90 = call i32 @fseek(i32* %85, i64 %88, i32 %89)
br label %91
91: ; preds = %82, %72
%92 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%93 = load double, double* %6
%94 = call i32 @snprintf(i8* %92, i32 80, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %93)
%95 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%96 = call i64 @stat(i8* %95, %struct.stat* %13)
%97 = icmp ne i64 %96, 0
br i1 %97, label %98, label %129
98: ; preds = %91
%99 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%100 = call i32* @fopen(i8* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %100, i32** %12
%101 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%102 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %101)
br label %103
103: ; preds = %98, %113
%104 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%105 = load i32*, i32** %5
%106 = call i32 @fgets(i8* %104, i32 1024, i32* %105)
%107 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%108 = call i64 @strlen(i8* %107)
store i64 %108, i64* %14
%109 = load i32*, i32** %5
%110 = call i64 @feof(i32* %109)
%111 = icmp ne i64 %110, 0
br i1 %111, label %112, label %113
112: ; preds = %103
br label %117
113: ; preds = %103
%114 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%115 = load i32*, i32** %12
%116 = call i32 @fputs(i8* %114, i32* %115)
br label %103
117: ; preds = %112
%118 = load i32*, i32** %12
%119 = call i32 @fflush(i32* %118)
%120 = load i32*, i32** %5
%121 = call i32 @fileno(i32* %120)
%122 = load i64, i64* %15
%123 = load i64, i64* %7
%124 = sub nsw i64 %122, %123
%125 = call i32 @ftruncate(i32 %121, i64 %124)
%126 = load i32*, i32** %5
%127 = call i32 @fclose(i32* %126)
%128 = load i32*, i32** %12
store i32* %128, i32** %4
br label %136
129: ; preds = %91
%130 = load i32*, i32** %5
%131 = load i32, i32* @SEEK_SET
%132 = call i32 @fseek(i32* %130, i64 0, i32 %131)
%133 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%134 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %133)
%135 = load i32*, i32** %5
store i32* %135, i32** %4
br label %136
136: ; preds = %129, %117
%137 = load i32*, i32** %4
ret i32* %137
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@SEEK_SET = global i32 0
@.str = [3 x i8] c"##\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [14 x i8] c"%lf-split.log\00"
@.str.3 = [3 x i8] c"w+\00"
@.str.4 = [19 x i8] c"I: Creating... %s\0A\00"
@.str.5 = [23 x i8] c"W: %s already exists!\0A\00"
define i32* @copySplitData(i32* %0, double %1, i64 %2) {
%4 = alloca [1024 x i8]
%5 = alloca [80 x i8]
%6 = alloca double
%7 = alloca %struct.stat
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%10 = bitcast double* %6 to i8*
%11 = bitcast %struct.stat* %7 to i8*
%12 = tail call i64 @ftell(i32* %0)
%13 = load i32, i32* @SEEK_SET
%14 = tail call i32 @fseek(i32* %0, i64 0, i32 %13)
br label %15
15: ; preds = %18, %3
%16 = call i64 @feof(i32* %0)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = call i32 @fgets(i8* %8, i32 1024, i32* %0)
%20 = call i64 @strncmp(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 2)
%21 = icmp eq i64 %20, 0
br i1 %21, label %15, label %22
22: ; preds = %18
%23 = call i32 @sscanf(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
br label %24
24: ; preds = %15, %22
%25 = call i32 @memset(i8* %8, i32 0, i32 1024)
%26 = load double, double* %6
%27 = call i32 @snprintf(i8* %9, i32 80, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %26)
%28 = load i32, i32* @SEEK_SET
%29 = call i32 @fseek(i32* %0, i64 0, i32 %28)
%30 = call i64 @stat(i8* %9, %struct.stat* %7)
%31 = icmp eq i64 %30, 0
br i1 %31, label %51, label %32
32: ; preds = %24
%33 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%34 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %9)
%35 = call i64 @feof(i32* %0)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %45
37: ; preds = %32, %41
%38 = call i32 @fgets(i8* %8, i32 1024, i32* %0)
%39 = call i64 @ftell(i32* %0)
%40 = icmp slt i64 %39, %12
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = call i32 @fputs(i8* %8, i32* %33)
%43 = call i64 @feof(i32* %0)
%44 = icmp eq i64 %43, 0
br i1 %44, label %37, label %45
45: ; preds = %41, %37, %32
%46 = call i64 @strlen(i8* %8)
%47 = sub nsw i64 %12, %46
%48 = load i32, i32* @SEEK_SET
%49 = call i32 @fseek(i32* %0, i64 %47, i32 %48)
%50 = call i32 @fclose(i32* %33)
br label %56
51: ; preds = %24
%52 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %9)
%53 = sub nsw i64 %12, %2
%54 = load i32, i32* @SEEK_SET
%55 = call i32 @fseek(i32* %0, i64 %53, i32 %54)
br label %56
56: ; preds = %51, %45
%57 = call i32 @snprintf(i8* %9, i32 80, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), double %1)
%58 = call i64 @stat(i8* %9, %struct.stat* %7)
%59 = icmp eq i64 %58, 0
br i1 %59, label %77, label %60
60: ; preds = %56
%61 = call i32* @fopen(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%62 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i8* %9)
%63 = call i32 @fgets(i8* %8, i32 1024, i32* %0)
%64 = call i64 @feof(i32* %0)
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %71
66: ; preds = %60, %66
%67 = call i32 @fputs(i8* %8, i32* %61)
%68 = call i32 @fgets(i8* %8, i32 1024, i32* %0)
%69 = call i64 @feof(i32* %0)
%70 = icmp eq i64 %69, 0
br i1 %70, label %66, label %71
71: ; preds = %66, %60
%72 = call i32 @fflush(i32* %61)
%73 = call i32 @fileno(i32* %0)
%74 = sub nsw i64 %12, %2
%75 = call i32 @ftruncate(i32 %73, i64 %74)
%76 = call i32 @fclose(i32* %0)
br label %81
77: ; preds = %56
%78 = load i32, i32* @SEEK_SET
%79 = call i32 @fseek(i32* %0, i64 0, i32 %78)
%80 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0), i8* %9)
br label %81
81: ; preds = %77, %71
%82 = phi i32* [ %61, %71 ], [ %0, %77 ]
ret i32* %82
}