#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*/ cofile(int /*<<< orphan*/ *, int /*<<< orphan*/ *, char *,
                          int);
int /*<<< orphan*/ convertlist(char *, char *, char *, char *,
                               int /*<<< orphan*/ *);
int /*<<< orphan*/ convertlists(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ unlink(char *);
int main(int argc, char **argv) {
  int i;
  FILE *handle;
  FILE *fconfif;
  char file[200];
  char sn[200];
  system("mv *.LOG log 2>/dev/null");
  system("mv *.LOG.old log 2>/dev/null");
  system("mv *.log log 2>/dev/null");
  system("mv *.log.old log 2>/dev/null");
  system("mv *.TRL log 2>/dev/null");
  system("mv *.MOTD motd 2>/dev/null");
  system("mv *.MOTD.old motd 2>/dev/null");
  system("rm -rf *.INI.old 2>/dev/null");
  handle = fopen("psbnc.ini", "r");
  if (handle != NULL) {
    fclose(handle);
    printf(
        "psyBNC2.1 -> psyBNC2.2 Conversion Utility\nChecking old Ini-Files\n");
    fconfif = fopen("psybnc.conf", "a");
    if (fconfif == NULL) {
      printf("Can't open psybnc.conf, aborting\n");
      exit(0x1);
    }
    handle = fopen("psbnc.ini", "r");
    cofile(handle, fconfif, "PSYBNC", 1);
    fclose(handle);
    unlink("psbnc.ini");
    handle = fopen("LINKS.INI", "r");
    if (handle != NULL) {
      cofile(handle, fconfif, "LINKS", 0);
      fclose(handle);
      unlink("LINKS.INI");
    }
    for (i = 1; i < 1000; i++) {
      sprintf(file, "USER%d.INI", i);
      sprintf(sn, "USER%d", i);
      handle = fopen(file, "r");
      if (handle != NULL) {
        cofile(handle, fconfif, sn, 0);
        fclose(handle);
        convertlists(i, fconfif);
        unlink(file);
      }
    }
    convertlist("HOSTALLOWS", "ENTRY%d", "PSYBNC", "psbnc.hosts", fconfif);
    fclose(fconfif);
  } else {
    fconfif = fopen("psybnc.conf", "r");
    if (fconfif != NULL) {
      printf("Using existent configuration File.\n");
      fclose(fconfif);
    } else {
      fconfif = fopen("psybnc.conf", "w");
      fprintf(fconfif, "PSYBNC.SYSTEM.PORT1=31337\n");
      fprintf(fconfif, "PSYBNC.SYSTEM.HOST1=*\n");
      fprintf(fconfif, "PSYBNC.HOSTALLOWS.ENTRY0=*;*\n");
      fclose(fconfif);
    }
  }
  fconfif = fopen("config.h", "r");
  if (fconfif == NULL) {
    fconfif = fopen("config.h", "w");
    fprintf(fconfif, "/* Empty Config File */\n");
    fclose(fconfif);
  } else {
    fclose(fconfif);
  }
  exit(0x0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe30(%rip),%rdi
call   1060 <system@plt>
lea    0xe3d(%rip),%rdi
call   1060 <system@plt>
lea    0xe4e(%rip),%rdi
call   1060 <system@plt>
lea    0xe5b(%rip),%rdi
call   1060 <system@plt>
lea    0xe6c(%rip),%rdi
call   1060 <system@plt>
lea    0xe79(%rip),%rdi
call   1060 <system@plt>
lea    0xe88(%rip),%rdi
call   1060 <system@plt>
lea    0xe9b(%rip),%rdi
call   1060 <system@plt>
lea    0xeac(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1409 <main+0x259>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xe8d(%rip),%rdi
call   1070 <printf@plt>
lea    0xec3(%rip),%rdi
lea    0xec8(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1298 <main+0xe8>
lea    0xeaf(%rip),%rdi
call   1070 <printf@plt>
mov    $0x1,%edi
call   10d0 <exit@plt>
lea    0xe3d(%rip),%rdi
lea    0xe40(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    0xe9c(%rip),%rdx
mov    $0x1,%ecx
call   1040 <cofile@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xe04(%rip),%rdi
call   1030 <unlink@plt>
lea    0xe7d(%rip),%rdi
lea    0xdfb(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     132a <main+0x17a>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    0xe5d(%rip),%rdx
xor    %ecx,%ecx
call   1040 <cofile@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xe3c(%rip),%rdi
call   1030 <unlink@plt>
movl   $0x1,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jge    13d6 <main+0x226>
lea    -0xf0(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe22(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x1c0(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    0xe17(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0xf0(%rbp),%rdi
lea    0xd6e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     13c3 <main+0x213>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
lea    -0x1c0(%rbp),%rdx
xor    %ecx,%ecx
call   1040 <cofile@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x14(%rbp),%edi
mov    -0x28(%rbp),%rsi
call   1090 <convertlists@plt>
lea    -0xf0(%rbp),%rdi
call   1030 <unlink@plt>
jmp    13c8 <main+0x218>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1331 <main+0x181>
mov    -0x28(%rbp),%r8
lea    0xda2(%rip),%rdi
lea    0xda6(%rip),%rsi
lea    0xd6b(%rip),%rdx
lea    0xda0(%rip),%rcx
call   10a0 <convertlist@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
jmp    149a <main+0x2ea>
lea    0xd1a(%rip),%rdi
lea    0xccf(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1445 <main+0x295>
lea    0xd70(%rip),%rdi
call   1070 <printf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
jmp    1495 <main+0x2e5>
lea    0xcde(%rip),%rdi
lea    0xd73(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xd61(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd6c(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdi
lea    0xd73(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
jmp    149a <main+0x2ea>
lea    0xd77(%rip),%rdi
lea    0xc3e(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    14f1 <main+0x341>
lea    0xd55(%rip),%rdi
lea    0xcfc(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xd43(%rip),%rsi
call   1080 <fprintf@plt>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
jmp    14fa <main+0x34a>
mov    -0x28(%rbp),%rdi
call   1050 <fclose@plt>
xor    %edi,%edi
call   10d0 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
lea    0xe38(%rip),%rdi
call   1070 <system@plt>
lea    0xe45(%rip),%rdi
call   1070 <system@plt>
lea    0xe56(%rip),%rdi
call   1070 <system@plt>
lea    0xe63(%rip),%rdi
call   1070 <system@plt>
lea    0xe74(%rip),%rdi
call   1070 <system@plt>
lea    0xe81(%rip),%rdi
call   1070 <system@plt>
lea    0xe90(%rip),%rdi
call   1070 <system@plt>
lea    0xea3(%rip),%rdi
call   1070 <system@plt>
lea    0xeb4(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
jne    12b8 <main+0x108>
lea    0xea8(%rip),%rdi
lea    0xe9f(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
jne    12fa <main+0x14a>
lea    0xe8c(%rip),%rdi
lea    0xedb(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0xece(%rip),%rdi
mov    $0x1a,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10d0 <fwrite@plt>
lea    0xed0(%rip),%rdi
mov    $0x16,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
lea    0xece(%rip),%rdi
mov    $0x1d,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10d0 <fwrite@plt>
jmp    1309 <main+0x159>
mov    %rax,%rdi
call   1060 <fclose@plt>
lea    0xf0e(%rip),%rdi
call   1040 <puts@plt>
lea    0xe15(%rip),%rdi
lea    0xe1a(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
jne    1311 <main+0x161>
lea    0xf2b(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    %rax,%rbx
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
jmp    1443 <main+0x293>
mov    %rax,%r15
lea    0xdc1(%rip),%r12
lea    0xdc4(%rip),%r14
mov    %r12,%rdi
mov    %r14,%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0xdbf(%rip),%rdx
mov    $0x1,%ebp
mov    %rax,%rdi
mov    %r15,%rsi
mov    $0x1,%ecx
call   1050 <cofile@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    %r12,%rdi
call   1030 <unlink@plt>
lea    0xd9a(%rip),%rdi
mov    %r14,%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     139b <main+0x1eb>
mov    %rax,%rbx
lea    0xd8d(%rip),%rdx
mov    %rax,%rdi
mov    %r15,%rsi
xor    %ecx,%ecx
call   1050 <cofile@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
lea    0xd67(%rip),%rdi
call   1030 <unlink@plt>
lea    0xd0(%rsp),%rbx
mov    %rsp,%r13
lea    0xd39(%rip),%r14
jmp    13bb <main+0x20b>
nop
add    $0x1,%ebp
cmp    $0x3e8,%ebp
je     141c <main+0x26c>
mov    %rbx,%rdi
lea    0xd48(%rip),%rsi
mov    %ebp,%edx
call   10b0 <sprintf@plt>
mov    %r13,%rdi
lea    0xd42(%rip),%rsi
mov    %ebp,%edx
call   10b0 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13b0 <main+0x200>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r13,%rdx
xor    %ecx,%ecx
call   1050 <cofile@plt>
mov    %r12,%rdi
call   1060 <fclose@plt>
mov    %ebp,%edi
mov    %r15,%rsi
call   1080 <convertlists@plt>
mov    %rbx,%rdi
call   1030 <unlink@plt>
jmp    13b0 <main+0x200>
lea    0xcfc(%rip),%rdi
lea    0xd00(%rip),%rsi
lea    0xcc5(%rip),%rdx
lea    0xcfa(%rip),%rcx
mov    %r15,%r8
call   1090 <convertlist@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
lea    0xd41(%rip),%rdi
lea    0xc90(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
jne    1494 <main+0x2e4>
lea    0xd29(%rip),%rdi
lea    0xcd0(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0xd1c(%rip),%rdi
mov    $0x18,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   10d0 <fwrite@plt>
mov    %rbx,%rdi
jmp    1497 <main+0x2e7>
mov    %rax,%rdi
call   1060 <fclose@plt>
xor    %edi,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"mv *.LOG log 2>/dev/null\00"
@.str.1 = [29 x i8] c"mv *.LOG.old log 2>/dev/null\00"
@.str.2 = [25 x i8] c"mv *.log log 2>/dev/null\00"
@.str.3 = [29 x i8] c"mv *.log.old log 2>/dev/null\00"
@.str.4 = [25 x i8] c"mv *.TRL log 2>/dev/null\00"
@.str.5 = [27 x i8] c"mv *.MOTD motd 2>/dev/null\00"
@.str.6 = [31 x i8] c"mv *.MOTD.old motd 2>/dev/null\00"
@.str.7 = [29 x i8] c"rm -rf *.INI.old 2>/dev/null\00"
@.str.8 = [10 x i8] c"psbnc.ini\00"
@.str.9 = [2 x i8] c"r\00"
@.str.10 = [66 x i8] c"psyBNC2.1 -> psyBNC2.2 Conversion Utility\0AChecking old Ini-Files\0A\00"
@.str.11 = [12 x i8] c"psybnc.conf\00"
@.str.12 = [2 x i8] c"a\00"
@.str.13 = [34 x i8] c"Can't open psybnc.conf, aborting\0A\00"
@.str.14 = [7 x i8] c"PSYBNC\00"
@.str.15 = [10 x i8] c"LINKS.INI\00"
@.str.16 = [6 x i8] c"LINKS\00"
@.str.17 = [11 x i8] c"USER%d.INI\00"
@.str.18 = [7 x i8] c"USER%d\00"
@.str.19 = [11 x i8] c"HOSTALLOWS\00"
@.str.20 = [8 x i8] c"ENTRY%d\00"
@.str.21 = [12 x i8] c"psbnc.hosts\00"
@.str.22 = [36 x i8] c"Using existent configuration File.\0A\00"
@.str.23 = [2 x i8] c"w\00"
@.str.24 = [27 x i8] c"PSYBNC.SYSTEM.PORT1=31337\0A\00"
@.str.25 = [23 x i8] c"PSYBNC.SYSTEM.HOST1=*\0A\00"
@.str.26 = [30 x i8] c"PSYBNC.HOSTALLOWS.ENTRY0=*;*\0A\00"
@.str.27 = [9 x i8] c"config.h\00"
@.str.28 = [25 x i8] c"/* Empty Config File */\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [200 x i8]
%10 = alloca [200 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%19 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %19, i32** %7
%20 = load i32*, i32** %7
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %86
22: ; preds = %2
%23 = load i32*, i32** %7
%24 = call i32 @fclose(i32* %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.10, i64 0, i64 0))
%26 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %26, i32** %8
%27 = load i32*, i32** %8
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %32
29: ; preds = %22
%30 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0))
%31 = call i32 @exit(i32 1)
unreachable
32: ; preds = %22
%33 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %33, i32** %7
%34 = load i32*, i32** %7
%35 = load i32*, i32** %8
%36 = call i32 @cofile(i32* %34, i32* %35, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i32 1)
%37 = load i32*, i32** %7
%38 = call i32 @fclose(i32* %37)
%39 = call i32 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%40 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %40, i32** %7
%41 = load i32*, i32** %7
%42 = icmp ne i32* %41, null
br i1 %42, label %43, label %50
43: ; preds = %32
%44 = load i32*, i32** %7
%45 = load i32*, i32** %8
%46 = call i32 @cofile(i32* %44, i32* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i32 0)
%47 = load i32*, i32** %7
%48 = call i32 @fclose(i32* %47)
%49 = call i32 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %50
50: ; preds = %43, %32
store i32 1, i32* %6
br label %51
51: ; preds = %78, %50
%52 = load i32, i32* %6
%53 = icmp slt i32 %52, 1000
br i1 %53, label %54, label %81
54: ; preds = %51
%55 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%56 = load i32, i32* %6
%57 = call i32 @sprintf(i8* %55, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i32 %56)
%58 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%59 = load i32, i32* %6
%60 = call i32 @sprintf(i8* %58, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%62 = call i32* @fopen(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %62, i32** %7
%63 = load i32*, i32** %7
%64 = icmp ne i32* %63, null
br i1 %64, label %65, label %77
65: ; preds = %54
%66 = load i32*, i32** %7
%67 = load i32*, i32** %8
%68 = getelementptr inbounds [200 x i8], [200 x i8]* %10, i64 0, i64 0
%69 = call i32 @cofile(i32* %66, i32* %67, i8* %68, i32 0)
%70 = load i32*, i32** %7
%71 = call i32 @fclose(i32* %70)
%72 = load i32, i32* %6
%73 = load i32*, i32** %8
%74 = call i32 @convertlists(i32 %72, i32* %73)
%75 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%76 = call i32 @unlink(i8* %75)
br label %77
77: ; preds = %65, %54
br label %78
78: ; preds = %77
%79 = load i32, i32* %6
%80 = add nsw i32 %79, 1
store i32 %80, i32* %6
br label %51
81: ; preds = %51
%82 = load i32*, i32** %8
%83 = call i32 @convertlist(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i32* %82)
%84 = load i32*, i32** %8
%85 = call i32 @fclose(i32* %84)
br label %105
86: ; preds = %2
%87 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %87, i32** %8
%88 = load i32*, i32** %8
%89 = icmp ne i32* %88, null
br i1 %89, label %90, label %94
90: ; preds = %86
%91 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.22, i64 0, i64 0))
%92 = load i32*, i32** %8
%93 = call i32 @fclose(i32* %92)
br label %104
94: ; preds = %86
%95 = call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
store i32* %95, i32** %8
%96 = load i32*, i32** %8
%97 = call i32 @fprintf(i32* %96, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.24, i64 0, i64 0))
%98 = load i32*, i32** %8
%99 = call i32 @fprintf(i32* %98, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.25, i64 0, i64 0))
%100 = load i32*, i32** %8
%101 = call i32 @fprintf(i32* %100, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.26, i64 0, i64 0))
%102 = load i32*, i32** %8
%103 = call i32 @fclose(i32* %102)
br label %104
104: ; preds = %94, %90
br label %105
105: ; preds = %104, %81
%106 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %106, i32** %8
%107 = load i32*, i32** %8
%108 = icmp eq i32* %107, null
br i1 %108, label %109, label %115
109: ; preds = %105
%110 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
store i32* %110, i32** %8
%111 = load i32*, i32** %8
%112 = call i32 @fprintf(i32* %111, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.28, i64 0, i64 0))
%113 = load i32*, i32** %8
%114 = call i32 @fclose(i32* %113)
br label %118
115: ; preds = %105
%116 = load i32*, i32** %8
%117 = call i32 @fclose(i32* %116)
br label %118
118: ; preds = %115, %109
%119 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [25 x i8] c"mv *.LOG log 2>/dev/null\00"
@.str.1 = [29 x i8] c"mv *.LOG.old log 2>/dev/null\00"
@.str.2 = [25 x i8] c"mv *.log log 2>/dev/null\00"
@.str.3 = [29 x i8] c"mv *.log.old log 2>/dev/null\00"
@.str.4 = [25 x i8] c"mv *.TRL log 2>/dev/null\00"
@.str.5 = [27 x i8] c"mv *.MOTD motd 2>/dev/null\00"
@.str.6 = [31 x i8] c"mv *.MOTD.old motd 2>/dev/null\00"
@.str.7 = [29 x i8] c"rm -rf *.INI.old 2>/dev/null\00"
@.str.8 = [10 x i8] c"psbnc.ini\00"
@.str.9 = [2 x i8] c"r\00"
@.str.11 = [12 x i8] c"psybnc.conf\00"
@.str.12 = [2 x i8] c"a\00"
@.str.14 = [7 x i8] c"PSYBNC\00"
@.str.15 = [10 x i8] c"LINKS.INI\00"
@.str.16 = [6 x i8] c"LINKS\00"
@.str.17 = [11 x i8] c"USER%d.INI\00"
@.str.18 = [7 x i8] c"USER%d\00"
@.str.19 = [11 x i8] c"HOSTALLOWS\00"
@.str.20 = [8 x i8] c"ENTRY%d\00"
@.str.21 = [12 x i8] c"psbnc.hosts\00"
@.str.23 = [2 x i8] c"w\00"
@.str.24 = [27 x i8] c"PSYBNC.SYSTEM.PORT1=31337\0A\00"
@.str.25 = [23 x i8] c"PSYBNC.SYSTEM.HOST1=*\0A\00"
@.str.26 = [30 x i8] c"PSYBNC.HOSTALLOWS.ENTRY0=*;*\0A\00"
@.str.27 = [9 x i8] c"config.h\00"
@.str.28 = [25 x i8] c"/* Empty Config File */\0A\00"
@str = [35 x i8] c"Using existent configuration File.\00"
@str.29 = [65 x i8] c"psyBNC2.1 -> psyBNC2.2 Conversion Utility\0AChecking old Ini-Files\00"
@str.30 = [33 x i8] c"Can't open psybnc.conf, aborting\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [200 x i8]
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%9 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%11 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 @system(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
%13 = tail call i32 @system(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%14 = tail call i32 @system(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
%15 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %54, label %17
17: ; preds = %2
%18 = tail call i32 @fclose(i32* %15)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str.29, i64 0, i64 0))
%20 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.30, i64 0, i64 0))
%24 = tail call i32 @exit(i32 1)
unreachable
25: ; preds = %17
%26 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%27 = tail call i32 @cofile(i32* %26, i32* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i32 1)
%28 = tail call i32 @fclose(i32* %26)
%29 = tail call i32 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%30 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%31 = icmp eq i32* %30, null
br i1 %31, label %36, label %32
32: ; preds = %25
%33 = tail call i32 @cofile(i32* %30, i32* %20, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0), i32 0)
%34 = tail call i32 @fclose(i32* %30)
%35 = tail call i32 @unlink(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
br label %36
36: ; preds = %32, %25
br label %37
37: ; preds = %36, %48
%38 = phi i32 [ %49, %48 ], [ 1, %36 ]
%39 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i32 %38)
%40 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.18, i64 0, i64 0), i32 %38)
%41 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%42 = icmp eq i32* %41, null
br i1 %42, label %48, label %43
43: ; preds = %37
%44 = call i32 @cofile(i32* %41, i32* %20, i8* %6, i32 0)
%45 = call i32 @fclose(i32* %41)
%46 = call i32 @convertlists(i32 %38, i32* %20)
%47 = call i32 @unlink(i8* %5)
br label %48
48: ; preds = %37, %43
%49 = add nuw nsw i32 %38, 1
%50 = icmp eq i32 %49, 1000
br i1 %50, label %51, label %37
51: ; preds = %48
%52 = call i32 @convertlist(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.21, i64 0, i64 0), i32* %20)
%53 = call i32 @fclose(i32* %20)
br label %66
54: ; preds = %2
%55 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%56 = icmp eq i32* %55, null
br i1 %56, label %60, label %57
57: ; preds = %54
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%59 = tail call i32 @fclose(i32* %55)
br label %66
60: ; preds = %54
%61 = tail call i32* @fopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%62 = tail call i64 @fwrite(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.24, i64 0, i64 0), i64 26, i64 1, i32* %61)
%63 = tail call i64 @fwrite(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.25, i64 0, i64 0), i64 22, i64 1, i32* %61)
%64 = tail call i64 @fwrite(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.26, i64 0, i64 0), i64 29, i64 1, i32* %61)
%65 = tail call i32 @fclose(i32* %61)
br label %66
66: ; preds = %57, %60, %51
%67 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%68 = icmp eq i32* %67, null
br i1 %68, label %69, label %73
69: ; preds = %66
%70 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.27, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0))
%71 = call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.28, i64 0, i64 0), i64 24, i64 1, i32* %70)
%72 = call i32 @fclose(i32* %70)
br label %75
73: ; preds = %66
%74 = call i32 @fclose(i32* %67)
br label %75
75: ; preds = %73, %69
%76 = call i32 @exit(i32 0)
unreachable
}