#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*/ *create_file(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int, char *);
int /*<<< orphan*/ *open_file(char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ rename_file(char *);
int /*<<< orphan*/ save_str(int /*<<< orphan*/ *, int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ save_strlist(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                char *);
int /*<<< orphan*/ strip_line(char *);
void convert_userdata(char *filename) {
  FILE *f, *f2;
  char buf[512];
  int i;
  printf("converting userdata %s\n", filename);
  if ((f = open_file(filename)) == NULL)
    return;
  if ((f2 = create_file(filename)) == NULL) {
    fclose(f);
    return;
  }
  save_str(f, f2, "passwd");
  save_str(f, f2, "real_name");
  save_str(f, f2, "street");
  save_str(f, f2, "zipcode");
  save_str(f, f2, "city");
  save_str(f, f2, "state");
  save_str(f, f2, "country");
  save_str(f, f2, "phone");
  save_str(f, f2, "email");
  save_str(f, f2, "www");
  save_str(f, f2, "doing");
  save_str(f, f2, "reminder");
  save_str(f, f2, "default_anon");
  save_str(f, f2, "from_ip");
  save_str(f, f2, "from_ipnum");
  save_str(f, f2, "birth");
  save_str(f, f2, "last_logout");
  save_str(f, f2, "flags");
  save_str(f, f2, "logins");
  save_str(f, f2, "total_time");
  save_str(f, f2, "xsent");
  save_str(f, f2, "xrecv");
  save_str(f, f2, "esent");
  save_str(f, f2, "erecv");
  save_str(f, f2, "posted");
  save_str(f, f2, "read");
  save_str(f, f2, "colors");
  save_strlist(f, f2, "rooms");
  for (i = 0; i < 10; i++) {
    fgets(buf, 512, f);
    strip_line(buf);
    if (*buf)
      fprintf(f2, "quick=%d %s\n", i, buf);
  }
  save_strlist(f, f2, "friends");
  save_strlist(f, f2, "enemies");
  save_strlist(f, f2, "info");
  fgets(buf, 512, f);
  save_str(f, f2, "fsent");
  save_str(f, f2, "frecv");
  fclose(f);
  fclose(f2);
  rename_file(filename);
}


x86 assembly (clang, -O0):
<convert_userdata>:
push   %rbp
mov    %rsp,%rbp
sub    $0x230,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe46(%rip),%rdi
call   1060 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <open_file@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11db <convert_userdata+0x3b>
jmp    153f <convert_userdata+0x39f>
mov    -0x8(%rbp),%rdi
call   10c0 <create_file@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1200 <convert_userdata+0x60>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
jmp    153f <convert_userdata+0x39f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xe09(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xdfc(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xdf2(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xde5(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xdd9(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xdca(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xdbc(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xdb0(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xda2(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd94(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd84(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd76(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd6b(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd64(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd58(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd4f(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd41(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd39(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd2b(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd1e(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd15(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xd07(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xcf9(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xceb(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xcdd(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xcd0(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xcc1(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xcb4(%rip),%rdx
call   10a0 <save_strlist@plt>
movl   $0x0,-0x224(%rbp)
cmpl   $0xa,-0x224(%rbp)
jge    14ab <convert_userdata+0x30b>
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x200,%esi
call   1070 <fgets@plt>
lea    -0x220(%rbp),%rdi
call   1090 <strip_line@plt>
cmpb   $0x0,-0x220(%rbp)
je     1492 <convert_userdata+0x2f2>
mov    -0x18(%rbp),%rdi
mov    -0x224(%rbp),%edx
lea    -0x220(%rbp),%rcx
lea    0xc58(%rip),%rsi
call   1080 <fprintf@plt>
jmp    1497 <convert_userdata+0x2f7>
mov    -0x224(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x224(%rbp)
jmp    143a <convert_userdata+0x29a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xc38(%rip),%rdx
call   10a0 <save_strlist@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xc2c(%rip),%rdx
call   10a0 <save_strlist@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xc20(%rip),%rdx
call   10a0 <save_strlist@plt>
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x200,%esi
call   1070 <fgets@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xbfc(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    0xbee(%rip),%rdx
call   1030 <save_str@plt>
mov    -0x10(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x8(%rbp),%rdi
call   10b0 <rename_file@plt>
add    $0x230,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_userdata>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
mov    %rdi,%r14
lea    0xe45(%rip),%rdi
mov    %r14,%rsi
call   1060 <printf@plt>
mov    %r14,%rdi
call   1050 <open_file@plt>
test   %rax,%rax
je     14ba <convert_userdata+0x31a>
mov    %rax,%r12
mov    %r14,%rdi
call   10c0 <create_file@plt>
test   %rax,%rax
je     14cc <convert_userdata+0x32c>
mov    %rax,%r15
lea    0xe26(%rip),%rdx
mov    %r12,%rdi
mov    %rax,%rsi
call   1030 <save_str@plt>
lea    0xe1b(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xe13(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xe08(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xdfe(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xdf1(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xde5(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xddb(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xdcf(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xdc3(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xdb5(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xda9(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xda0(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd9b(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd91(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd8a(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd7e(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd78(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd6c(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd61(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd5a(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd4e(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd42(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd36(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd2a(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd1f(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd12(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xd07(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   10a0 <save_strlist@plt>
xor    %ebp,%ebp
mov    %rsp,%rbx
lea    0xcf6(%rip),%r13
jmp    1408 <convert_userdata+0x268>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    $0xa,%ebp
je     1438 <convert_userdata+0x298>
mov    %rbx,%rdi
mov    $0x200,%esi
mov    %r12,%rdx
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1090 <strip_line@plt>
cmpb   $0x0,(%rsp)
je     1400 <convert_userdata+0x260>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1080 <fprintf@plt>
jmp    1400 <convert_userdata+0x260>
lea    0xcb3(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   10a0 <save_strlist@plt>
lea    0xca9(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   10a0 <save_strlist@plt>
lea    0xc9f(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   10a0 <save_strlist@plt>
mov    %rsp,%rdi
mov    $0x200,%esi
mov    %r12,%rdx
call   1070 <fgets@plt>
lea    0xc82(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
lea    0xc76(%rip),%rdx
mov    %r12,%rdi
mov    %r15,%rsi
call   1030 <save_str@plt>
mov    %r12,%rdi
call   1040 <fclose@plt>
mov    %r15,%rdi
call   1040 <fclose@plt>
mov    %r14,%rdi
call   10b0 <rename_file@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12,%rdi
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fclose@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"converting userdata %s\0A\00"
@.str.1 = [7 x i8] c"passwd\00"
@.str.2 = [10 x i8] c"real_name\00"
@.str.3 = [7 x i8] c"street\00"
@.str.4 = [8 x i8] c"zipcode\00"
@.str.5 = [5 x i8] c"city\00"
@.str.6 = [6 x i8] c"state\00"
@.str.7 = [8 x i8] c"country\00"
@.str.8 = [6 x i8] c"phone\00"
@.str.9 = [6 x i8] c"email\00"
@.str.10 = [4 x i8] c"www\00"
@.str.11 = [6 x i8] c"doing\00"
@.str.12 = [9 x i8] c"reminder\00"
@.str.13 = [13 x i8] c"default_anon\00"
@.str.14 = [8 x i8] c"from_ip\00"
@.str.15 = [11 x i8] c"from_ipnum\00"
@.str.16 = [6 x i8] c"birth\00"
@.str.17 = [12 x i8] c"last_logout\00"
@.str.18 = [6 x i8] c"flags\00"
@.str.19 = [7 x i8] c"logins\00"
@.str.20 = [11 x i8] c"total_time\00"
@.str.21 = [6 x i8] c"xsent\00"
@.str.22 = [6 x i8] c"xrecv\00"
@.str.23 = [6 x i8] c"esent\00"
@.str.24 = [6 x i8] c"erecv\00"
@.str.25 = [7 x i8] c"posted\00"
@.str.26 = [5 x i8] c"read\00"
@.str.27 = [7 x i8] c"colors\00"
@.str.28 = [6 x i8] c"rooms\00"
@.str.29 = [13 x i8] c"quick=%d %s\0A\00"
@.str.30 = [8 x i8] c"friends\00"
@.str.31 = [8 x i8] c"enemies\00"
@.str.32 = [5 x i8] c"info\00"
@.str.33 = [6 x i8] c"fsent\00"
@.str.34 = [6 x i8] c"frecv\00"
define void @convert_userdata(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [512 x i8]
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32* @open_file(i8* %9)
store i32* %10, i32** %3
%11 = icmp eq i32* %10, null
br i1 %11, label %12, label %13
12: ; preds = %1
br label %151
13: ; preds = %1
%14 = load i8*, i8** %2
%15 = call i32* @create_file(i8* %14)
store i32* %15, i32** %4
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32*, i32** %3
%19 = call i32 @fclose(i32* %18)
br label %151
20: ; preds = %13
%21 = load i32*, i32** %3
%22 = load i32*, i32** %4
%23 = call i32 @save_str(i32* %21, i32* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32*, i32** %3
%25 = load i32*, i32** %4
%26 = call i32 @save_str(i32* %24, i32* %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%27 = load i32*, i32** %3
%28 = load i32*, i32** %4
%29 = call i32 @save_str(i32* %27, i32* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%30 = load i32*, i32** %3
%31 = load i32*, i32** %4
%32 = call i32 @save_str(i32* %30, i32* %31, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%33 = load i32*, i32** %3
%34 = load i32*, i32** %4
%35 = call i32 @save_str(i32* %33, i32* %34, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%36 = load i32*, i32** %3
%37 = load i32*, i32** %4
%38 = call i32 @save_str(i32* %36, i32* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%39 = load i32*, i32** %3
%40 = load i32*, i32** %4
%41 = call i32 @save_str(i32* %39, i32* %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%42 = load i32*, i32** %3
%43 = load i32*, i32** %4
%44 = call i32 @save_str(i32* %42, i32* %43, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%45 = load i32*, i32** %3
%46 = load i32*, i32** %4
%47 = call i32 @save_str(i32* %45, i32* %46, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%48 = load i32*, i32** %3
%49 = load i32*, i32** %4
%50 = call i32 @save_str(i32* %48, i32* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%51 = load i32*, i32** %3
%52 = load i32*, i32** %4
%53 = call i32 @save_str(i32* %51, i32* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%54 = load i32*, i32** %3
%55 = load i32*, i32** %4
%56 = call i32 @save_str(i32* %54, i32* %55, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%57 = load i32*, i32** %3
%58 = load i32*, i32** %4
%59 = call i32 @save_str(i32* %57, i32* %58, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%60 = load i32*, i32** %3
%61 = load i32*, i32** %4
%62 = call i32 @save_str(i32* %60, i32* %61, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%63 = load i32*, i32** %3
%64 = load i32*, i32** %4
%65 = call i32 @save_str(i32* %63, i32* %64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0))
%66 = load i32*, i32** %3
%67 = load i32*, i32** %4
%68 = call i32 @save_str(i32* %66, i32* %67, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%69 = load i32*, i32** %3
%70 = load i32*, i32** %4
%71 = call i32 @save_str(i32* %69, i32* %70, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%72 = load i32*, i32** %3
%73 = load i32*, i32** %4
%74 = call i32 @save_str(i32* %72, i32* %73, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%75 = load i32*, i32** %3
%76 = load i32*, i32** %4
%77 = call i32 @save_str(i32* %75, i32* %76, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
%78 = load i32*, i32** %3
%79 = load i32*, i32** %4
%80 = call i32 @save_str(i32* %78, i32* %79, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%81 = load i32*, i32** %3
%82 = load i32*, i32** %4
%83 = call i32 @save_str(i32* %81, i32* %82, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
%84 = load i32*, i32** %3
%85 = load i32*, i32** %4
%86 = call i32 @save_str(i32* %84, i32* %85, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%87 = load i32*, i32** %3
%88 = load i32*, i32** %4
%89 = call i32 @save_str(i32* %87, i32* %88, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%90 = load i32*, i32** %3
%91 = load i32*, i32** %4
%92 = call i32 @save_str(i32* %90, i32* %91, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
%93 = load i32*, i32** %3
%94 = load i32*, i32** %4
%95 = call i32 @save_str(i32* %93, i32* %94, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
%96 = load i32*, i32** %3
%97 = load i32*, i32** %4
%98 = call i32 @save_str(i32* %96, i32* %97, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0))
%99 = load i32*, i32** %3
%100 = load i32*, i32** %4
%101 = call i32 @save_str(i32* %99, i32* %100, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
%102 = load i32*, i32** %3
%103 = load i32*, i32** %4
%104 = call i32 @save_strlist(i32* %102, i32* %103, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i64 0, i64 0))
store i32 0, i32* %6
br label %105
105: ; preds = %123, %20
%106 = load i32, i32* %6
%107 = icmp slt i32 %106, 10
br i1 %107, label %108, label %126
108: ; preds = %105
%109 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%110 = load i32*, i32** %3
%111 = call i32 @fgets(i8* %109, i32 512, i32* %110)
%112 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%113 = call i32 @strip_line(i8* %112)
%114 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%115 = load i8, i8* %114
%116 = icmp ne i8 %115, 0
br i1 %116, label %117, label %122
117: ; preds = %108
%118 = load i32*, i32** %4
%119 = load i32, i32* %6
%120 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%121 = call i32 @fprintf(i32* %118, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.29, i64 0, i64 0), i32 %119, i8* %120)
br label %122
122: ; preds = %117, %108
br label %123
123: ; preds = %122
%124 = load i32, i32* %6
%125 = add nsw i32 %124, 1
store i32 %125, i32* %6
br label %105
126: ; preds = %105
%127 = load i32*, i32** %3
%128 = load i32*, i32** %4
%129 = call i32 @save_strlist(i32* %127, i32* %128, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0))
%130 = load i32*, i32** %3
%131 = load i32*, i32** %4
%132 = call i32 @save_strlist(i32* %130, i32* %131, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.31, i64 0, i64 0))
%133 = load i32*, i32** %3
%134 = load i32*, i32** %4
%135 = call i32 @save_strlist(i32* %133, i32* %134, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.32, i64 0, i64 0))
%136 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%137 = load i32*, i32** %3
%138 = call i32 @fgets(i8* %136, i32 512, i32* %137)
%139 = load i32*, i32** %3
%140 = load i32*, i32** %4
%141 = call i32 @save_str(i32* %139, i32* %140, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.33, i64 0, i64 0))
%142 = load i32*, i32** %3
%143 = load i32*, i32** %4
%144 = call i32 @save_str(i32* %142, i32* %143, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.34, i64 0, i64 0))
%145 = load i32*, i32** %3
%146 = call i32 @fclose(i32* %145)
%147 = load i32*, i32** %4
%148 = call i32 @fclose(i32* %147)
%149 = load i8*, i8** %2
%150 = call i32 @rename_file(i8* %149)
br label %151
151: ; preds = %126, %17, %12
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"converting userdata %s\0A\00"
@.str.1 = [7 x i8] c"passwd\00"
@.str.2 = [10 x i8] c"real_name\00"
@.str.3 = [7 x i8] c"street\00"
@.str.4 = [8 x i8] c"zipcode\00"
@.str.5 = [5 x i8] c"city\00"
@.str.6 = [6 x i8] c"state\00"
@.str.7 = [8 x i8] c"country\00"
@.str.8 = [6 x i8] c"phone\00"
@.str.9 = [6 x i8] c"email\00"
@.str.10 = [4 x i8] c"www\00"
@.str.11 = [6 x i8] c"doing\00"
@.str.12 = [9 x i8] c"reminder\00"
@.str.13 = [13 x i8] c"default_anon\00"
@.str.14 = [8 x i8] c"from_ip\00"
@.str.15 = [11 x i8] c"from_ipnum\00"
@.str.16 = [6 x i8] c"birth\00"
@.str.17 = [12 x i8] c"last_logout\00"
@.str.18 = [6 x i8] c"flags\00"
@.str.19 = [7 x i8] c"logins\00"
@.str.20 = [11 x i8] c"total_time\00"
@.str.21 = [6 x i8] c"xsent\00"
@.str.22 = [6 x i8] c"xrecv\00"
@.str.23 = [6 x i8] c"esent\00"
@.str.24 = [6 x i8] c"erecv\00"
@.str.25 = [7 x i8] c"posted\00"
@.str.26 = [5 x i8] c"read\00"
@.str.27 = [7 x i8] c"colors\00"
@.str.28 = [6 x i8] c"rooms\00"
@.str.29 = [13 x i8] c"quick=%d %s\0A\00"
@.str.30 = [8 x i8] c"friends\00"
@.str.31 = [8 x i8] c"enemies\00"
@.str.32 = [5 x i8] c"info\00"
@.str.33 = [6 x i8] c"fsent\00"
@.str.34 = [6 x i8] c"frecv\00"
define void @convert_userdata(i8* %0) {
%2 = alloca [512 x i8]
%3 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = tail call i32* @open_file(i8* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %62, label %7
7: ; preds = %1
%8 = tail call i32* @create_file(i8* %0)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @fclose(i32* %5)
br label %62
12: ; preds = %7
%13 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
%15 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%16 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%17 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%18 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%19 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%20 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%21 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%22 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%23 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0))
%24 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%25 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.13, i64 0, i64 0))
%26 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0))
%27 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0))
%28 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%29 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%30 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%31 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0))
%32 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%33 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.21, i64 0, i64 0))
%34 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.22, i64 0, i64 0))
%35 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.23, i64 0, i64 0))
%36 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.24, i64 0, i64 0))
%37 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i64 0, i64 0))
%38 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.26, i64 0, i64 0))
%39 = tail call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0))
%40 = tail call i32 @save_strlist(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.28, i64 0, i64 0))
br label %41
41: ; preds = %12, %49
%42 = phi i32 [ 0, %12 ], [ %50, %49 ]
%43 = call i32 @fgets(i8* %3, i32 512, i32* %5)
%44 = call i32 @strip_line(i8* %3)
%45 = load i8, i8* %3
%46 = icmp eq i8 %45, 0
br i1 %46, label %49, label %47
47: ; preds = %41
%48 = call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.29, i64 0, i64 0), i32 %42, i8* %3)
br label %49
49: ; preds = %41, %47
%50 = add nuw nsw i32 %42, 1
%51 = icmp eq i32 %50, 10
br i1 %51, label %52, label %41
52: ; preds = %49
%53 = call i32 @save_strlist(i32* %5, i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.30, i64 0, i64 0))
%54 = call i32 @save_strlist(i32* %5, i32* %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.31, i64 0, i64 0))
%55 = call i32 @save_strlist(i32* %5, i32* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.32, i64 0, i64 0))
%56 = call i32 @fgets(i8* %3, i32 512, i32* %5)
%57 = call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.33, i64 0, i64 0))
%58 = call i32 @save_str(i32* %5, i32* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.34, i64 0, i64 0))
%59 = call i32 @fclose(i32* %5)
%60 = call i32 @fclose(i32* %8)
%61 = call i32 @rename_file(i8* %0)
br label %62
62: ; preds = %1, %52, %10
ret void
}