#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*/ KeySym;
typedef int /*<<< orphan*/ Bool;

/* Variables and functions */
int /*<<< orphan*/ badheader();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ parse_keysym(char const *, int, char **,
                                int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/);
scalar_t__ realloc(int /*<<< orphan*/ *, int);
int skip_chars(char const *, int);
int skip_space(char const *, int);
int /*<<< orphan*/ stderr;
int get_keysym_list(const char *line, int len, int *np, KeySym **kslistp) {
  int havesofar, maxcanhave;
  KeySym *keysymlist;
  *np = 0;
  *kslistp = NULL;
  if (len == 0)
    return (0);
  havesofar = 0;
  maxcanhave = 4;
  keysymlist = (KeySym *)malloc(maxcanhave * sizeof(KeySym));
  if (!keysymlist) {
    {
      badheader();
      fprintf(stderr, "attempt to allocate %ld byte initial keysymlist",
              (long)(maxcanhave * sizeof(KeySym)));
      putc('\n', stderr);
    };
    return (-1);
  }
  while (len > 0) {
    KeySym keysym;
    int n;
    char *tmpname;
    Bool ok;
    n = skip_space(line, len);
    line += n, len -= n;
    n = skip_chars(line, len);
    if (n < 0) {
      {
        badheader();
        fprintf(stderr, "keysym name list");
        putc('\n', stderr);
      };
      free(keysymlist);
      return (-1);
    }
    ok = parse_keysym(line, n, &tmpname, &keysym);
    line += n, len -= n;
    if (!ok) {
      {
        badheader();
        fprintf(stderr, "keysym name '%s' in keysym list", tmpname);
        putc('\n', stderr);
      };
      continue;
    }
    if (havesofar >= maxcanhave) {
      KeySym *origkeysymlist = keysymlist;
      maxcanhave *= 2;
      keysymlist = (KeySym *)realloc(keysymlist, maxcanhave * sizeof(KeySym));
      if (!keysymlist) {
        {
          badheader();
          fprintf(stderr, "attempt to grow keysym list to %ld bytes",
                  (long)(maxcanhave * sizeof(KeySym)));
          putc('\n', stderr);
        };
        free(origkeysymlist);
        return (-1);
      }
    }
    keysymlist[havesofar++] = keysym;
  }
  *kslistp = keysymlist;
  *np = havesofar;
  return (0);
}


x86 assembly (clang, -O0):
<get_keysym_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
cmpl   $0x0,-0x14(%rbp)
jne    11d2 <get_keysym_list+0x42>
movl   $0x0,-0x4(%rbp)
jmp    141d <get_keysym_list+0x28d>
movl   $0x0,-0x2c(%rbp)
movl   $0x4,-0x30(%rbp)
movslq -0x30(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1243 <get_keysym_list+0xb3>
mov    $0x0,%al
call   1080 <badheader@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
movslq -0x30(%rbp),%rdx
shl    $0x2,%rdx
lea    0xde3(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2db5(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    141d <get_keysym_list+0x28d>
jmp    1248 <get_keysym_list+0xb8>
cmpl   $0x0,-0x14(%rbp)
jle    1402 <get_keysym_list+0x272>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <skip_space@plt>
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1090 <skip_chars@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x0,-0x40(%rbp)
jge    12dc <get_keysym_list+0x14c>
mov    $0x0,%al
call   1080 <badheader@plt>
mov    0x2d3c(%rip),%rax
mov    (%rax),%edi
lea    0xd83(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2d25(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    141d <get_keysym_list+0x28d>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%esi
lea    -0x48(%rbp),%rdx
lea    -0x3c(%rbp),%rcx
call   1050 <parse_keysym@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x14(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jne    1353 <get_keysym_list+0x1c3>
mov    $0x0,%al
call   1080 <badheader@plt>
mov    0x2cb9(%rip),%rax
mov    (%rax),%edi
mov    -0x48(%rbp),%rdx
lea    0xd0d(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2c9e(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
jmp    1248 <get_keysym_list+0xb8>
mov    -0x2c(%rbp),%eax
cmp    -0x30(%rbp),%eax
jl     13e5 <get_keysym_list+0x255>
mov    -0x38(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x38(%rbp),%rdi
movslq -0x30(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%esi
call   10b0 <realloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    13e0 <get_keysym_list+0x250>
mov    $0x0,%al
call   1080 <badheader@plt>
mov    0x2c40(%rip),%rax
mov    (%rax),%edi
movslq -0x30(%rbp),%rdx
shl    $0x2,%rdx
lea    0xcb0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    0x2c21(%rip),%rax
mov    (%rax),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    141d <get_keysym_list+0x28d>
jmp    13e5 <get_keysym_list+0x255>
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x2c(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1248 <get_keysym_list+0xb8>
mov    -0x38(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_keysym_list>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movl   $0x0,(%rdx)
movq   $0x0,(%rcx)
test   %esi,%esi
je     1321 <get_keysym_list+0x191>
mov    %rcx,%r12
mov    %rdx,%r15
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x10,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     12dd <get_keysym_list+0x14d>
mov    %rax,%r14
test   %ebp,%ebp
mov    %r15,0x18(%rsp)
mov    %r12,0x10(%rsp)
jle    130e <get_keysym_list+0x17e>
movl   $0x4,0x8(%rsp)
xor    %r13d,%r13d
jmp    124b <get_keysym_list+0xbb>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1080 <badheader@plt>
mov    0x2dd2(%rip),%rax
mov    %r13d,%r15d
mov    %rax,%r13
mov    (%rax),%edi
mov    0x20(%rsp),%rdx
lea    0xe1f(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    0x0(%r13),%esi
mov    %r15d,%r13d
mov    $0xa,%edi
call   1060 <putc@plt>
mov    %r12d,%eax
add    %rax,%rbx
sub    %r12d,%ebp
test   %ebp,%ebp
jle    1311 <get_keysym_list+0x181>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <skip_space@plt>
cltq
add    %rax,%rbx
sub    %eax,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1090 <skip_chars@plt>
test   %eax,%eax
js     1325 <get_keysym_list+0x195>
mov    %eax,%r12d
mov    %rbx,%rdi
mov    %eax,%esi
lea    0x20(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <parse_keysym@plt>
test   %eax,%eax
je     1200 <get_keysym_list+0x70>
mov    %r13d,%r15d
mov    0x8(%rsp),%eax
cmp    %eax,%r13d
jge    12a0 <get_keysym_list+0x110>
mov    %r14,%rax
jmp    12c4 <get_keysym_list+0x134>
xchg   %ax,%ax
add    %eax,%eax
mov    %r14,%r13
mov    %eax,0x8(%rsp)
movslq %eax,%r14
shl    $0x2,%r14
mov    %r13,%rdi
mov    %r14d,%esi
call   10b0 <realloc@plt>
test   %rax,%rax
je     1345 <get_keysym_list+0x1b5>
mov    0xc(%rsp),%ecx
mov    %r15d,%r13d
movslq %r15d,%rdx
add    $0x1,%r13d
mov    %ecx,(%rax,%rdx,4)
mov    %rax,%r14
jmp    123a <get_keysym_list+0xaa>
xor    %eax,%eax
call   1080 <badheader@plt>
mov    0x2cf5(%rip),%rbx
mov    (%rbx),%edi
lea    0xd0c(%rip),%rsi
mov    $0x10,%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    (%rbx),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
jmp    137d <get_keysym_list+0x1ed>
xor    %r13d,%r13d
mov    0x10(%rsp),%rax
mov    %r14,(%rax)
mov    0x18(%rsp),%rax
mov    %r13d,(%rax)
xor    %eax,%eax
jmp    1382 <get_keysym_list+0x1f2>
xor    %eax,%eax
call   1080 <badheader@plt>
mov    0x2cad(%rip),%rbx
mov    (%rbx),%edi
lea    0xcf4(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1369 <get_keysym_list+0x1d9>
xor    %eax,%eax
call   1080 <badheader@plt>
mov    0x2c8d(%rip),%rbx
mov    (%rbx),%edi
lea    0xd05(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r13,%r14
mov    (%rbx),%esi
mov    $0xa,%edi
call   1060 <putc@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    $0xffffffff,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"attempt to allocate %ld byte initial keysymlist\00"
@.str.1 = [17 x i8] c"keysym name list\00"
@.str.2 = [32 x i8] c"keysym name '%s' in keysym list\00"
@.str.3 = [41 x i8] c"attempt to grow keysym list to %ld bytes\00"
define i32 @get_keysym_list(i8* %0, i32 %1, i32* %2, i32** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32**
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32*
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32** %3, i32*** %9
%18 = load i32*, i32** %8
store i32 0, i32* %18
%19 = load i32**, i32*** %9
store i32* null, i32** %19
%20 = load i32, i32* %7
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %4
store i32 0, i32* %5
br label %130
23: ; preds = %4
store i32 0, i32* %10
store i32 4, i32* %11
%24 = load i32, i32* %11
%25 = sext i32 %24 to i64
%26 = mul i64 %25, 4
%27 = trunc i64 %26 to i32
%28 = call i64 @malloc(i32 %27)
%29 = inttoptr i64 %28 to i32*
store i32* %29, i32** %12
%30 = load i32*, i32** %12
%31 = icmp ne i32* %30, null
br i1 %31, label %41, label %32
32: ; preds = %23
%33 = call i32 (...) @badheader()
%34 = load i32, i32* @stderr
%35 = load i32, i32* %11
%36 = sext i32 %35 to i64
%37 = mul i64 %36, 4
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 %37)
%39 = load i32, i32* @stderr
%40 = call i32 @putc(i8 signext 10, i32 %39)
store i32 -1, i32* %5
br label %130
41: ; preds = %23
br label %42
42: ; preds = %118, %82, %41
%43 = load i32, i32* %7
%44 = icmp sgt i32 %43, 0
br i1 %44, label %45, label %125
45: ; preds = %42
%46 = load i8*, i8** %6
%47 = load i32, i32* %7
%48 = call i32 @skip_space(i8* %46, i32 %47)
store i32 %48, i32* %14
%49 = load i32, i32* %14
%50 = load i8*, i8** %6
%51 = sext i32 %49 to i64
%52 = getelementptr inbounds i8, i8* %50, i64 %51
store i8* %52, i8** %6
%53 = load i32, i32* %14
%54 = load i32, i32* %7
%55 = sub nsw i32 %54, %53
store i32 %55, i32* %7
%56 = load i8*, i8** %6
%57 = load i32, i32* %7
%58 = call i32 @skip_chars(i8* %56, i32 %57)
store i32 %58, i32* %14
%59 = load i32, i32* %14
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %69
61: ; preds = %45
%62 = call i32 (...) @badheader()
%63 = load i32, i32* @stderr
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%65 = load i32, i32* @stderr
%66 = call i32 @putc(i8 signext 10, i32 %65)
%67 = load i32*, i32** %12
%68 = call i32 @free(i32* %67)
store i32 -1, i32* %5
br label %130
69: ; preds = %45
%70 = load i8*, i8** %6
%71 = load i32, i32* %14
%72 = call i32 @parse_keysym(i8* %70, i32 %71, i8** %15, i32* %13)
store i32 %72, i32* %16
%73 = load i32, i32* %14
%74 = load i8*, i8** %6
%75 = sext i32 %73 to i64
%76 = getelementptr inbounds i8, i8* %74, i64 %75
store i8* %76, i8** %6
%77 = load i32, i32* %14
%78 = load i32, i32* %7
%79 = sub nsw i32 %78, %77
store i32 %79, i32* %7
%80 = load i32, i32* %16
%81 = icmp ne i32 %80, 0
br i1 %81, label %89, label %82
82: ; preds = %69
%83 = call i32 (...) @badheader()
%84 = load i32, i32* @stderr
%85 = load i8*, i8** %15
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %85)
%87 = load i32, i32* @stderr
%88 = call i32 @putc(i8 signext 10, i32 %87)
br label %42
89: ; preds = %69
%90 = load i32, i32* %10
%91 = load i32, i32* %11
%92 = icmp sge i32 %90, %91
br i1 %92, label %93, label %118
93: ; preds = %89
%94 = load i32*, i32** %12
store i32* %94, i32** %17
%95 = load i32, i32* %11
%96 = mul nsw i32 %95, 2
store i32 %96, i32* %11
%97 = load i32*, i32** %12
%98 = load i32, i32* %11
%99 = sext i32 %98 to i64
%100 = mul i64 %99, 4
%101 = trunc i64 %100 to i32
%102 = call i64 @realloc(i32* %97, i32 %101)
%103 = inttoptr i64 %102 to i32*
store i32* %103, i32** %12
%104 = load i32*, i32** %12
%105 = icmp ne i32* %104, null
br i1 %105, label %117, label %106
106: ; preds = %93
%107 = call i32 (...) @badheader()
%108 = load i32, i32* @stderr
%109 = load i32, i32* %11
%110 = sext i32 %109 to i64
%111 = mul i64 %110, 4
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i64 %111)
%113 = load i32, i32* @stderr
%114 = call i32 @putc(i8 signext 10, i32 %113)
%115 = load i32*, i32** %17
%116 = call i32 @free(i32* %115)
store i32 -1, i32* %5
br label %130
117: ; preds = %93
br label %118
118: ; preds = %117, %89
%119 = load i32, i32* %13
%120 = load i32*, i32** %12
%121 = load i32, i32* %10
%122 = add nsw i32 %121, 1
store i32 %122, i32* %10
%123 = sext i32 %121 to i64
%124 = getelementptr inbounds i32, i32* %120, i64 %123
store i32 %119, i32* %124
br label %42
125: ; preds = %42
%126 = load i32*, i32** %12
%127 = load i32**, i32*** %9
store i32* %126, i32** %127
%128 = load i32, i32* %10
%129 = load i32*, i32** %8
store i32 %128, i32* %129
store i32 0, i32* %5
br label %130
130: ; preds = %125, %106, %61, %32, %22
%131 = load i32, i32* %5
ret i32 %131
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"attempt to allocate %ld byte initial keysymlist\00"
@.str.1 = [17 x i8] c"keysym name list\00"
@.str.2 = [32 x i8] c"keysym name '%s' in keysym list\00"
@.str.3 = [41 x i8] c"attempt to grow keysym list to %ld bytes\00"
define i32 @get_keysym_list(i8* %0, i32 %1, i32* nocapture writeonly %2, i32** nocapture writeonly %3) {
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %2
store i32* null, i32** %3
%7 = icmp eq i32 %1, 0
br i1 %7, label %85, label %8
8: ; preds = %4
%9 = tail call i64 @malloc(i32 16)
%10 = inttoptr i64 %9 to i32*
%11 = icmp eq i64 %9, 0
br i1 %11, label %17, label %12
12: ; preds = %8
%13 = icmp sgt i32 %1, 0
br i1 %13, label %14, label %82
14: ; preds = %12
%15 = bitcast i32* %5 to i8*
%16 = bitcast i8** %6 to i8*
br label %23
17: ; preds = %8
%18 = tail call i32 (...) @badheader()
%19 = load i32, i32* @stderr
%20 = tail call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i64 16)
%21 = load i32, i32* @stderr
%22 = tail call i32 @putc(i8 signext 10, i32 %21)
br label %85
23: ; preds = %14, %77
%24 = phi i8* [ %0, %14 ], [ %42, %77 ]
%25 = phi i32* [ %10, %14 ], [ %80, %77 ]
%26 = phi i32 [ 4, %14 ], [ %79, %77 ]
%27 = phi i32 [ 0, %14 ], [ %78, %77 ]
%28 = phi i32 [ %1, %14 ], [ %43, %77 ]
%29 = call i32 @skip_space(i8* %24, i32 %28)
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %24, i64 %30
%32 = sub nsw i32 %28, %29
%33 = call i32 @skip_chars(i8* %31, i32 %32)
%34 = icmp slt i32 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %23
%36 = call i32 (...) @badheader()
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %73
39: ; preds = %23
%40 = call i32 @parse_keysym(i8* %31, i32 %33, i8** %6, i32* %5)
%41 = zext i32 %33 to i64
%42 = getelementptr inbounds i8, i8* %31, i64 %41
%43 = sub nsw i32 %32, %33
%44 = icmp eq i32 %40, 0
br i1 %44, label %45, label %52
45: ; preds = %39
%46 = call i32 (...) @badheader()
%47 = load i32, i32* @stderr
%48 = load i8*, i8** %6
%49 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %48)
%50 = load i32, i32* @stderr
%51 = call i32 @putc(i8 signext 10, i32 %50)
br label %77
52: ; preds = %39
%53 = icmp slt i32 %27, %26
br i1 %53, label %66, label %54
54: ; preds = %52
%55 = shl nsw i32 %26, 1
%56 = sext i32 %55 to i64
%57 = shl nsw i64 %56, 2
%58 = trunc i64 %57 to i32
%59 = call i64 @realloc(i32* %25, i32 %58)
%60 = inttoptr i64 %59 to i32*
%61 = icmp eq i64 %59, 0
br i1 %61, label %62, label %66
62: ; preds = %54
%63 = call i32 (...) @badheader()
%64 = load i32, i32* @stderr
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0), i64 %57)
br label %73
66: ; preds = %54, %52
%67 = phi i32 [ %26, %52 ], [ %55, %54 ]
%68 = phi i32* [ %25, %52 ], [ %60, %54 ]
%69 = load i32, i32* %5
%70 = add nsw i32 %27, 1
%71 = sext i32 %27 to i64
%72 = getelementptr inbounds i32, i32* %68, i64 %71
store i32 %69, i32* %72
br label %77
73: ; preds = %35, %62
%74 = load i32, i32* @stderr
%75 = call i32 @putc(i8 signext 10, i32 %74)
%76 = call i32 @free(i32* %25)
br label %85
77: ; preds = %66, %45
%78 = phi i32 [ %70, %66 ], [ %27, %45 ]
%79 = phi i32 [ %67, %66 ], [ %26, %45 ]
%80 = phi i32* [ %68, %66 ], [ %25, %45 ]
%81 = icmp sgt i32 %43, 0
br i1 %81, label %23, label %82
82: ; preds = %77, %12
%83 = phi i32 [ 0, %12 ], [ %78, %77 ]
%84 = phi i32* [ %10, %12 ], [ %80, %77 ]
store i32* %84, i32** %3
store i32 %83, i32* %2
br label %85
85: ; preds = %73, %4, %82, %17
%86 = phi i32 [ 0, %82 ], [ -1, %17 ], [ 0, %4 ], [ -1, %73 ]
ret i32 %86
}