#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 */

/* Variables and functions */
int /*<<< orphan*/ O_RDWR;
int open(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int open_pty_master(char **ptyslave) {
  int mfd;
  char *major, *minor;
  static char majorchars[] = "pqrstuvwxyzabcdePQRSTUVWXYZABCDE";
  static char minorchars[] = "0123456789abcdefghijklmnopqrstuv"
                             "wxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_+";
  {
    static char ptyname[] = "/dev/pty/mX";
    for (minor = minorchars; *minor; minor++) {
      ptyname[10] = *minor;
      if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
        ptyname[9] = 's';
        *ptyslave = ptyname;
        return mfd;
      }
    }
  }
  {
    static char ptyname[] = "/dev/ptym/ptyXY";
    static char ttyname[] = "/dev/pty/ttyXY";
    for (major = majorchars; *major; major++) {
      ptyname[13] = *major;
      for (minor = minorchars; *minor; minor++) {
        ptyname[14] = *minor;
        if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
          ttyname[12] = *major;
          ttyname[13] = *minor;
          *ptyslave = ttyname;
          return mfd;
        }
      }
    }
  }
  {
    static char ptyname[] = "/dev/ptyXY";
    for (major = majorchars; *major; major++) {
      ptyname[8] = *major;
      for (minor = minorchars; *minor; minor++) {
        ptyname[9] = *minor;
        if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
          ptyname[5] = 't';
          *ptyslave = ptyname;
          return mfd;
        }
      }
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<open_pty_master>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
lea    0x2f3d(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     1199 <open_pty_master+0x89>
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2f6b(%rip)
mov    0x2ea1(%rip),%rax
mov    (%rax),%esi
lea    0x2f51(%rip),%rdi
xor    %edx,%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     1183 <open_pty_master+0x73>
movb   $0x73,0x2f40(%rip)
mov    -0x10(%rbp),%rax
lea    0x2f2c(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    131f <open_pty_master+0x20f>
jmp    1188 <open_pty_master+0x78>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1127 <open_pty_master+0x17>
lea    0x2e90(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1261 <open_pty_master+0x151>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2f00(%rip)
lea    0x2e9c(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     124b <open_pty_master+0x13b>
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2edd(%rip)
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
lea    0x2ebf(%rip),%rdi
xor    %edx,%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     1235 <open_pty_master+0x125>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2ebc(%rip)
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2eb1(%rip)
mov    -0x10(%rbp),%rax
lea    0x2e99(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    131f <open_pty_master+0x20f>
jmp    123a <open_pty_master+0x12a>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11c8 <open_pty_master+0xb8>
jmp    1250 <open_pty_master+0x140>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11a4 <open_pty_master+0x94>
lea    0x2dc8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     1318 <open_pty_master+0x208>
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2e52(%rip)
lea    0x2dd4(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     1302 <open_pty_master+0x1f2>
mov    -0x28(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2e2f(%rip)
mov    0x2d38(%rip),%rax
mov    (%rax),%esi
lea    0x2e16(%rip),%rdi
xor    %edx,%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     12ec <open_pty_master+0x1dc>
movb   $0x74,0x2e01(%rip)
mov    -0x10(%rbp),%rax
lea    0x2df1(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    131f <open_pty_master+0x20f>
jmp    12f1 <open_pty_master+0x1e1>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1290 <open_pty_master+0x180>
jmp    1307 <open_pty_master+0x1f7>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    126c <open_pty_master+0x15c>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_pty_master>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x30,%al
xor    %ebp,%ebp
lea    0x2f07(%rip),%rbx
mov    0x2eb8(%rip),%r12
lea    0xef9(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    %al,0x2ef4(%rip)
mov    (%r12),%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <open@plt>
test   %eax,%eax
jns    1233 <open_pty_master+0x123>
movzbl 0x1(%rbp,%r15,1),%eax
add    $0x1,%rbp
cmp    $0x40,%rbp
jne    1140 <open_pty_master+0x30>
lea    0xe8d(%rip),%rbp
mov    $0x70,%al
lea    0x2ec4(%rip),%rbx
mov    %al,0x2ecb(%rip)
mov    $0x30,%al
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
mov    %al,0x2eb8(%rip)
mov    (%r12),%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <open@plt>
test   %eax,%eax
jns    123c <open_pty_master+0x12c>
movzbl 0x1(%r13,%r15,1),%eax
add    $0x1,%r13
cmp    $0x40,%r13
jne    1190 <open_pty_master+0x80>
mov    0x1(%rbp),%al
add    $0x1,%rbp
lea    0xe56(%rip),%rcx
cmp    %rcx,%rbp
jne    117c <open_pty_master+0x6c>
lea    0xe2a(%rip),%r13
mov    $0x70,%cl
lea    0x2e80(%rip),%rbx
mov    %cl,0x2e82(%rip)
mov    $0x30,%al
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %al,0x2e72(%rip)
mov    (%r12),%esi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <open@plt>
test   %eax,%eax
jns    1269 <open_pty_master+0x159>
movzbl 0x1(%rbp,%r15,1),%eax
add    $0x1,%rbp
cmp    $0x40,%rbp
jne    11f0 <open_pty_master+0xe0>
mov    0x1(%r13),%cl
add    $0x1,%r13
mov    $0xffffffff,%eax
lea    0xdf4(%rip),%rdx
cmp    %rdx,%r13
jne    11df <open_pty_master+0xcf>
jmp    125a <open_pty_master+0x14a>
movb   $0x73,0x2dff(%rip)
jmp    1257 <open_pty_master+0x147>
mov    0x0(%rbp),%cl
mov    %cl,0x2e17(%rip)
lea    0x2e04(%rip),%rbx
mov    0x0(%r13,%r15,1),%cl
mov    %cl,0x2e06(%rip)
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
movb   $0x74,0x2df4(%rip)
jmp    1257 <open_pty_master+0x147>

LLVM IR (-O0):
@open_pty_master.majorchars = internal global [33 x i8] c"pqrstuvwxyzabcdePQRSTUVWXYZABCDE\00"
@open_pty_master.minorchars = internal global [65 x i8] c"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_+\00"
@open_pty_master.ptyname = internal global [12 x i8] c"/dev/pty/mX\00"
@O_RDWR = global i32 0
@open_pty_master.ptyname.1 = internal global [16 x i8] c"/dev/ptym/ptyXY\00"
@open_pty_master.ttyname = internal global [15 x i8] c"/dev/pty/ttyXY\00"
@open_pty_master.ptyname.2 = internal global [11 x i8] c"/dev/ptyXY\00"
define i32 @open_pty_master(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %3
store i8* getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 0), i8** %6
br label %7
7: ; preds = %21, %1
%8 = load i8*, i8** %6
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %24
11: ; preds = %7
%12 = load i8*, i8** %6
%13 = load i8, i8* %12
store i8 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @open_pty_master.ptyname, i64 0, i64 10)
%14 = load i32, i32* @O_RDWR
%15 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @open_pty_master.ptyname, i64 0, i64 0), i32 %14, i32 0)
store i32 %15, i32* %4
%16 = icmp sge i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %11
store i8 115, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @open_pty_master.ptyname, i64 0, i64 9)
%18 = load i8**, i8*** %3
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @open_pty_master.ptyname, i64 0, i64 0), i8** %18
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %87
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i8*, i8** %6
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %6
br label %7
24: ; preds = %7
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @open_pty_master.majorchars, i64 0, i64 0), i8** %5
br label %25
25: ; preds = %54, %24
%26 = load i8*, i8** %5
%27 = load i8, i8* %26
%28 = icmp ne i8 %27, 0
br i1 %28, label %29, label %57
29: ; preds = %25
%30 = load i8*, i8** %5
%31 = load i8, i8* %30
store i8 %31, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @open_pty_master.ptyname.1, i64 0, i64 13)
store i8* getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 0), i8** %6
br label %32
32: ; preds = %50, %29
%33 = load i8*, i8** %6
%34 = load i8, i8* %33
%35 = icmp ne i8 %34, 0
br i1 %35, label %36, label %53
36: ; preds = %32
%37 = load i8*, i8** %6
%38 = load i8, i8* %37
store i8 %38, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @open_pty_master.ptyname.1, i64 0, i64 14)
%39 = load i32, i32* @O_RDWR
%40 = call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @open_pty_master.ptyname.1, i64 0, i64 0), i32 %39, i32 0)
store i32 %40, i32* %4
%41 = icmp sge i32 %40, 0
br i1 %41, label %42, label %49
42: ; preds = %36
%43 = load i8*, i8** %5
%44 = load i8, i8* %43
store i8 %44, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @open_pty_master.ttyname, i64 0, i64 12)
%45 = load i8*, i8** %6
%46 = load i8, i8* %45
store i8 %46, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @open_pty_master.ttyname, i64 0, i64 13)
%47 = load i8**, i8*** %3
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @open_pty_master.ttyname, i64 0, i64 0), i8** %47
%48 = load i32, i32* %4
store i32 %48, i32* %2
br label %87
49: ; preds = %36
br label %50
50: ; preds = %49
%51 = load i8*, i8** %6
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %6
br label %32
53: ; preds = %32
br label %54
54: ; preds = %53
%55 = load i8*, i8** %5
%56 = getelementptr inbounds i8, i8* %55, i32 1
store i8* %56, i8** %5
br label %25
57: ; preds = %25
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @open_pty_master.majorchars, i64 0, i64 0), i8** %5
br label %58
58: ; preds = %83, %57
%59 = load i8*, i8** %5
%60 = load i8, i8* %59
%61 = icmp ne i8 %60, 0
br i1 %61, label %62, label %86
62: ; preds = %58
%63 = load i8*, i8** %5
%64 = load i8, i8* %63
store i8 %64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 8)
store i8* getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 0), i8** %6
br label %65
65: ; preds = %79, %62
%66 = load i8*, i8** %6
%67 = load i8, i8* %66
%68 = icmp ne i8 %67, 0
br i1 %68, label %69, label %82
69: ; preds = %65
%70 = load i8*, i8** %6
%71 = load i8, i8* %70
store i8 %71, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 9)
%72 = load i32, i32* @O_RDWR
%73 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 0), i32 %72, i32 0)
store i32 %73, i32* %4
%74 = icmp sge i32 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %69
store i8 116, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 5)
%76 = load i8**, i8*** %3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 0), i8** %76
%77 = load i32, i32* %4
store i32 %77, i32* %2
br label %87
78: ; preds = %69
br label %79
79: ; preds = %78
%80 = load i8*, i8** %6
%81 = getelementptr inbounds i8, i8* %80, i32 1
store i8* %81, i8** %6
br label %65
82: ; preds = %65
br label %83
83: ; preds = %82
%84 = load i8*, i8** %5
%85 = getelementptr inbounds i8, i8* %84, i32 1
store i8* %85, i8** %5
br label %58
86: ; preds = %58
store i32 -1, i32* %2
br label %87
87: ; preds = %86, %75, %42, %17
%88 = load i32, i32* %2
ret i32 %88
}

LLVM IR (-O2):
@open_pty_master.majorchars = internal unnamed_addr constant [33 x i8] c"pqrstuvwxyzabcdePQRSTUVWXYZABCDE\00"
@open_pty_master.minorchars = internal unnamed_addr constant [65 x i8] c"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_+\00"
@open_pty_master.ptyname = internal global [12 x i8] c"/dev/pty/mX\00"
@O_RDWR = global i32 0
@open_pty_master.ptyname.1 = internal global [16 x i8] c"/dev/ptym/ptyXY\00"
@open_pty_master.ttyname = internal global [15 x i8] c"/dev/pty/ttyXY\00"
@open_pty_master.ptyname.2 = internal global [11 x i8] c"/dev/ptyXY\00"
define i32 @open_pty_master(i8** nocapture writeonly %0) {
br label %5
2: ; preds = %5
%3 = load i8, i8* %11
%4 = icmp eq i8* %11, getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 64)
br i1 %4, label %13, label %5
5: ; preds = %1, %2
%6 = phi i8 [ 48, %1 ], [ %3, %2 ]
%7 = phi i8* [ getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 0), %1 ], [ %11, %2 ]
store i8 %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @open_pty_master.ptyname, i64 0, i64 10)
%8 = load i32, i32* @O_RDWR
%9 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @open_pty_master.ptyname, i64 0, i64 0), i32 %8, i32 0)
%10 = icmp sgt i32 %9, -1
%11 = getelementptr inbounds i8, i8* %7, i64 1
br i1 %10, label %12, label %2
12: ; preds = %5
store i8 115, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @open_pty_master.ptyname, i64 0, i64 9)
br label %51
13: ; preds = %2, %29
%14 = phi i8 [ %31, %29 ], [ 112, %2 ]
%15 = phi i8* [ %30, %29 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @open_pty_master.majorchars, i64 0, i64 0), %2 ]
store i8 %14, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @open_pty_master.ptyname.1, i64 0, i64 13)
br label %16
16: ; preds = %13, %25
%17 = phi i8 [ 48, %13 ], [ %27, %25 ]
%18 = phi i8* [ getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 0), %13 ], [ %26, %25 ]
store i8 %17, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @open_pty_master.ptyname.1, i64 0, i64 14)
%19 = load i32, i32* @O_RDWR
%20 = tail call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @open_pty_master.ptyname.1, i64 0, i64 0), i32 %19, i32 0)
%21 = icmp sgt i32 %20, -1
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = load i8, i8* %15
store i8 %23, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @open_pty_master.ttyname, i64 0, i64 12)
%24 = load i8, i8* %18
store i8 %24, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @open_pty_master.ttyname, i64 0, i64 13)
br label %51
25: ; preds = %16
%26 = getelementptr inbounds i8, i8* %18, i64 1
%27 = load i8, i8* %26
%28 = icmp eq i8* %26, getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 64)
br i1 %28, label %29, label %16
29: ; preds = %25
%30 = getelementptr inbounds i8, i8* %15, i64 1
%31 = load i8, i8* %30
%32 = icmp eq i8* %30, getelementptr inbounds ([33 x i8], [33 x i8]* @open_pty_master.majorchars, i64 0, i64 32)
br i1 %32, label %33, label %13
33: ; preds = %29, %47
%34 = phi i8 [ %49, %47 ], [ 112, %29 ]
%35 = phi i8* [ %48, %47 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @open_pty_master.majorchars, i64 0, i64 0), %29 ]
store i8 %34, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 8)
br label %39
36: ; preds = %39
%37 = load i8, i8* %45
%38 = icmp eq i8* %45, getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 64)
br i1 %38, label %47, label %39
39: ; preds = %33, %36
%40 = phi i8 [ 48, %33 ], [ %37, %36 ]
%41 = phi i8* [ getelementptr inbounds ([65 x i8], [65 x i8]* @open_pty_master.minorchars, i64 0, i64 0), %33 ], [ %45, %36 ]
store i8 %40, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 9)
%42 = load i32, i32* @O_RDWR
%43 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 0), i32 %42, i32 0)
%44 = icmp sgt i32 %43, -1
%45 = getelementptr inbounds i8, i8* %41, i64 1
br i1 %44, label %46, label %36
46: ; preds = %39
store i8 116, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 5)
br label %51
47: ; preds = %36
%48 = getelementptr inbounds i8, i8* %35, i64 1
%49 = load i8, i8* %48
%50 = icmp eq i8* %48, getelementptr inbounds ([33 x i8], [33 x i8]* @open_pty_master.majorchars, i64 0, i64 32)
br i1 %50, label %54, label %33
51: ; preds = %12, %22, %46
%52 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @open_pty_master.ptyname.2, i64 0, i64 0), %46 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @open_pty_master.ttyname, i64 0, i64 0), %22 ], [ getelementptr inbounds ([12 x i8], [12 x i8]* @open_pty_master.ptyname, i64 0, i64 0), %12 ]
%53 = phi i32 [ %43, %46 ], [ %20, %22 ], [ %9, %12 ]
store i8* %52, i8** %0
br label %54
54: ; preds = %47, %51
%55 = phi i32 [ %53, %51 ], [ -1, %47 ]
ret i32 %55
}