#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ *type0Totype1Converter(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *);
int /*<<< orphan*/ *type0Totype2Converter(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *);
int /*<<< orphan*/ *type0Totype3Converter(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *);
int main() {
  FILE *type0;
  FILE *type1;
  FILE *type2;
  FILE *type3;
  type0 = fopen("type0-0-100.txt", "r");
  type1 = fopen("type1-0-100.txt", "wt");
  type2 = fopen("type2-0-100.txt", "wt");
  type3 = fopen("type3-0-100.txt", "wt");
  fseek(type0, 0, 0);
  fseek(type1, 0, 0);
  type1 = type0Totype1Converter(type0, type1);
  fseek(type0, 0, 0);
  fseek(type2, 0, 0);
  type2 = type0Totype2Converter(type0, type2);
  fseek(type0, 0, 0);
  fseek(type3, 0, 0);
  type3 = type0Totype3Converter(type0, type3);
  fclose(type0);
  fclose(type1);
  fclose(type2);
  fclose(type3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    0xe93(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x10(%rbp)
lea    0xe85(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x18(%rbp)
lea    0xe81(%rip),%rdi
lea    0xe77(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
lea    0xe7a(%rip),%rdi
lea    0xe60(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <fseek@plt>
mov    -0x18(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <fseek@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <type0Totype1Converter@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <fseek@plt>
mov    -0x20(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <fseek@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <type0Totype2Converter@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <fseek@plt>
mov    -0x28(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <fseek@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <type0Totype3Converter@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x28(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xe91(%rip),%rdi
lea    0xe9a(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
lea    0xe8d(%rip),%rdi
lea    0xe96(%rip),%r14
mov    %r14,%rsi
call   1080 <fopen@plt>
mov    %rax,%r15
lea    0xe87(%rip),%rdi
mov    %r14,%rsi
call   1080 <fopen@plt>
mov    %rax,%r12
lea    0xe85(%rip),%rdi
mov    %r14,%rsi
call   1080 <fopen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <fseek@plt>
mov    %r15,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <fseek@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <type0Totype1Converter@plt>
mov    %rax,%r15
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <fseek@plt>
mov    %r12,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <fseek@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <type0Totype2Converter@plt>
mov    %rax,%r12
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <fseek@plt>
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <fseek@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <type0Totype3Converter@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    %r15,%rdi
call   1030 <fclose@plt>
mov    %r12,%rdi
call   1030 <fclose@plt>
mov    %r14,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [16 x i8] c"type0-0-100.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"type1-0-100.txt\00"
@.str.3 = [3 x i8] c"wt\00"
@.str.4 = [16 x i8] c"type2-0-100.txt\00"
@.str.5 = [16 x i8] c"type3-0-100.txt\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
%6 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %6, i32** %2
%7 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %7, i32** %3
%8 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %8, i32** %4
%9 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
store i32* %9, i32** %5
%10 = load i32*, i32** %2
%11 = call i32 @fseek(i32* %10, i32 0, i32 0)
%12 = load i32*, i32** %3
%13 = call i32 @fseek(i32* %12, i32 0, i32 0)
%14 = load i32*, i32** %2
%15 = load i32*, i32** %3
%16 = call i32* @type0Totype1Converter(i32* %14, i32* %15)
store i32* %16, i32** %3
%17 = load i32*, i32** %2
%18 = call i32 @fseek(i32* %17, i32 0, i32 0)
%19 = load i32*, i32** %4
%20 = call i32 @fseek(i32* %19, i32 0, i32 0)
%21 = load i32*, i32** %2
%22 = load i32*, i32** %4
%23 = call i32* @type0Totype2Converter(i32* %21, i32* %22)
store i32* %23, i32** %4
%24 = load i32*, i32** %2
%25 = call i32 @fseek(i32* %24, i32 0, i32 0)
%26 = load i32*, i32** %5
%27 = call i32 @fseek(i32* %26, i32 0, i32 0)
%28 = load i32*, i32** %2
%29 = load i32*, i32** %5
%30 = call i32* @type0Totype3Converter(i32* %28, i32* %29)
store i32* %30, i32** %5
%31 = load i32*, i32** %2
%32 = call i32 @fclose(i32* %31)
%33 = load i32*, i32** %3
%34 = call i32 @fclose(i32* %33)
%35 = load i32*, i32** %4
%36 = call i32 @fclose(i32* %35)
%37 = load i32*, i32** %5
%38 = call i32 @fclose(i32* %37)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"type0-0-100.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"type1-0-100.txt\00"
@.str.3 = [3 x i8] c"wt\00"
@.str.4 = [16 x i8] c"type2-0-100.txt\00"
@.str.5 = [16 x i8] c"type3-0-100.txt\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%4 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @fseek(i32* %1, i32 0, i32 0)
%6 = tail call i32 @fseek(i32* %2, i32 0, i32 0)
%7 = tail call i32* @type0Totype1Converter(i32* %1, i32* %2)
%8 = tail call i32 @fseek(i32* %1, i32 0, i32 0)
%9 = tail call i32 @fseek(i32* %3, i32 0, i32 0)
%10 = tail call i32* @type0Totype2Converter(i32* %1, i32* %3)
%11 = tail call i32 @fseek(i32* %1, i32 0, i32 0)
%12 = tail call i32 @fseek(i32* %4, i32 0, i32 0)
%13 = tail call i32* @type0Totype3Converter(i32* %1, i32* %4)
%14 = tail call i32 @fclose(i32* %1)
%15 = tail call i32 @fclose(i32* %7)
%16 = tail call i32 @fclose(i32* %10)
%17 = tail call i32 @fclose(i32* %13)
ret i32 0
}