#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 */
struct ic_type_ref {
  int dummy;
};
struct ic_type_param {
  int dummy;
};
struct ic_symbol {
  int dummy;
};
struct ic_pvector {
  int dummy;
};
struct ic_kludge {
  int dummy;
};
struct ic_decl_type {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
struct ic_decl_type *ic_analyse_resolve_type_ref(struct ic_kludge *, char *,
                                                 char *, struct ic_pvector *,
                                                 struct ic_type_ref *);
struct ic_type_ref *ic_pvector_get(struct ic_pvector *, unsigned int);
unsigned int ic_pvector_length(struct ic_pvector *);
char *ic_symbol_contents(struct ic_symbol *);
int /*<<< orphan*/ ic_type_param_check_set(struct ic_type_param *);
struct ic_type_param *ic_type_param_search(struct ic_pvector *, char *);
struct ic_symbol *ic_type_ref_get_symbol(struct ic_type_ref *);
scalar_t__ ic_type_ref_is_resolved(struct ic_type_ref *);
int /*<<< orphan*/ ic_type_ref_print(int /*<<< orphan*/, struct ic_type_ref *);
int /*<<< orphan*/ ic_type_ref_set_type_param(struct ic_type_ref *,
                                              struct ic_type_param *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
unsigned int ic_resolve_type_ref_list(struct ic_kludge *kludge,
                                      struct ic_pvector *type_params,
                                      struct ic_pvector *type_refs) {
  unsigned int i = 0;
  unsigned int len = 0;
  struct ic_type_ref *tref = 0;
  struct ic_symbol *tref_sym = 0;
  char *tref_ch = 0;
  struct ic_decl_type *tdecl = 0;
  struct ic_type_param *type_param = 0;
  if (!kludge) {
    puts("ic_anlyse_type_ref_list: kludge was null");
    return 0;
  }
  if (!type_refs) {
    puts("ic_anlyse_type_ref_list: type_refs was null");
    return 0;
  }
  len = ic_pvector_length(type_refs);
  for (i = 0; i < len; ++i) {
    tref = ic_pvector_get(type_refs, i);
    if (!tref) {
      puts("ic_anlyse_type_ref_list: call to ic_pvector_get failed");
      return 0;
    }
    if (ic_type_ref_is_resolved(tref)) {
      continue;
    }
    tref_sym = ic_type_ref_get_symbol(tref);
    if (!tref_sym) {
      puts("ic_resolve_type_ref_list: call to ic_type_ref_get_symbol failed");
      return 0;
    }
    tref_ch = ic_symbol_contents(tref_sym);
    if (!tref_ch) {
      puts("ic_resolve_type_ref_list: call to ic_symbol_contents failed");
      return 0;
    }
    if (type_params &&
        (type_param = ic_type_param_search(type_params, tref_ch))) {
      if (!ic_type_param_check_set(type_param)) {
        puts("ic_resolve_type_ref_list: found param was not yet set");
        return 0;
      }
      if (!ic_type_ref_set_type_param(tref, type_param)) {
        puts("ic_resolve_type_ref_list: call to ic_type_ref_set_type_decl "
             "failed");
        return 0;
      }
      continue;
    }
    tdecl = ic_analyse_resolve_type_ref(kludge, "ic_resolve_type_ref_list",
                                        "this message isn't super helpful",
                                        type_params, tref);
    if (!tdecl) {
      fputs("ic_anlyse_type_ref_list: call to ic_analyse_resolve_type_ref "
            "failed for typeref: ",
            stdout);
      ic_type_ref_print(stdout, tref);
      puts("");
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<ic_resolve_type_ref_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    122d <ic_resolve_type_ref_list+0x6d>
lea    0xde4(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1424 <ic_resolve_type_ref_list+0x264>
cmpq   $0x0,-0x20(%rbp)
jne    1250 <ic_resolve_type_ref_list+0x90>
lea    0xdea(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1424 <ic_resolve_type_ref_list+0x264>
mov    -0x20(%rbp),%rdi
call   10d0 <ic_pvector_length@plt>
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jae    141d <ic_resolve_type_ref_list+0x25d>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   10b0 <ic_pvector_get@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    12a2 <ic_resolve_type_ref_list+0xe2>
lea    0xdc4(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1424 <ic_resolve_type_ref_list+0x264>
mov    -0x30(%rbp),%rdi
call   10a0 <ic_type_ref_is_resolved@plt>
cmp    $0x0,%rax
je     12ba <ic_resolve_type_ref_list+0xfa>
jmp    140f <ic_resolve_type_ref_list+0x24f>
mov    -0x30(%rbp),%rdi
call   1080 <ic_type_ref_get_symbol@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    12ea <ic_resolve_type_ref_list+0x12a>
lea    0xdb3(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1424 <ic_resolve_type_ref_list+0x264>
mov    -0x38(%rbp),%rdi
call   1090 <ic_symbol_contents@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    131a <ic_resolve_type_ref_list+0x15a>
lea    0xdc3(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1424 <ic_resolve_type_ref_list+0x264>
cmpq   $0x0,-0x18(%rbp)
je     139d <ic_resolve_type_ref_list+0x1dd>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <ic_type_param_search@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
je     139d <ic_resolve_type_ref_list+0x1dd>
mov    -0x50(%rbp),%rdi
call   10c0 <ic_type_param_check_set@plt>
cmp    $0x0,%eax
jne    136a <ic_resolve_type_ref_list+0x1aa>
lea    0xdaf(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1424 <ic_resolve_type_ref_list+0x264>
mov    -0x30(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   10e0 <ic_type_ref_set_type_param@plt>
cmp    $0x0,%eax
jne    1398 <ic_resolve_type_ref_list+0x1d8>
lea    0xdb7(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1424 <ic_resolve_type_ref_list+0x264>
jmp    140f <ic_resolve_type_ref_list+0x24f>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    -0x30(%rbp),%r8
lea    0xdd1(%rip),%rsi
lea    0xde3(%rip),%rdx
call   1030 <ic_analyse_resolve_type_ref@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    140a <ic_resolve_type_ref_list+0x24a>
mov    0x2c0e(%rip),%rax
mov    (%rax),%esi
lea    0xde0(%rip),%rdi
call   1070 <fputs@plt>
mov    0x2bf9(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rsi
call   1060 <ic_type_ref_print@plt>
lea    0xe13(%rip),%rdi
call   1050 <puts@plt>
movl   $0x0,-0x4(%rbp)
jmp    1424 <ic_resolve_type_ref_list+0x264>
jmp    140f <ic_resolve_type_ref_list+0x24f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1263 <ic_resolve_type_ref_list+0xa3>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ic_resolve_type_ref_list>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rdi,%rdi
je     12c7 <ic_resolve_type_ref_list+0xf7>
mov    %rdx,%rbx
test   %rdx,%rdx
je     12d0 <ic_resolve_type_ref_list+0x100>
mov    %rsi,%r12
mov    %rdi,%rbp
mov    %rbx,%rdi
call   10e0 <ic_pvector_length@plt>
mov    %eax,%r13d
mov    $0x1,%eax
test   %r13d,%r13d
je     1334 <ic_resolve_type_ref_list+0x164>
mov    %rbp,(%rsp)
xor    %ebp,%ebp
jmp    1252 <ic_resolve_type_ref_list+0x82>
nopw   0x0(%rax,%rax,1)
mov    (%rsp),%rdi
lea    0xf56(%rip),%rsi
lea    0xf68(%rip),%rdx
mov    %r12,%rcx
mov    %r14,%r8
call   1030 <ic_analyse_resolve_type_ref@plt>
test   %rax,%rax
je     12fb <ic_resolve_type_ref_list+0x12b>
add    $0x1,%ebp
cmp    %ebp,%r13d
je     12e2 <ic_resolve_type_ref_list+0x112>
mov    %rbx,%rdi
mov    %ebp,%esi
call   10c0 <ic_pvector_get@plt>
test   %rax,%rax
je     12d9 <ic_resolve_type_ref_list+0x109>
mov    %rax,%r14
mov    %rax,%rdi
call   10b0 <ic_type_ref_is_resolved@plt>
test   %rax,%rax
jne    1246 <ic_resolve_type_ref_list+0x76>
mov    %r14,%rdi
call   1090 <ic_type_ref_get_symbol@plt>
test   %rax,%rax
je     12e9 <ic_resolve_type_ref_list+0x119>
mov    %rax,%rdi
call   10a0 <ic_symbol_contents@plt>
test   %rax,%rax
je     12f2 <ic_resolve_type_ref_list+0x122>
test   %r12,%r12
je     1220 <ic_resolve_type_ref_list+0x50>
mov    %r12,%rdi
mov    %rax,%rsi
call   1040 <ic_type_param_search@plt>
test   %rax,%rax
je     1220 <ic_resolve_type_ref_list+0x50>
mov    %rax,%r15
mov    %rax,%rdi
call   10d0 <ic_type_param_check_set@plt>
test   %eax,%eax
je     1326 <ic_resolve_type_ref_list+0x156>
mov    %r14,%rdi
mov    %r15,%rsi
call   10f0 <ic_type_ref_set_type_param@plt>
test   %eax,%eax
jne    1246 <ic_resolve_type_ref_list+0x76>
lea    0xe79(%rip),%rdi
jmp    132d <ic_resolve_type_ref_list+0x15d>
lea    0xd32(%rip),%rdi
jmp    132d <ic_resolve_type_ref_list+0x15d>
lea    0xd52(%rip),%rdi
jmp    132d <ic_resolve_type_ref_list+0x15d>
lea    0xd75(%rip),%rdi
jmp    132d <ic_resolve_type_ref_list+0x15d>
mov    $0x1,%eax
jmp    1334 <ic_resolve_type_ref_list+0x164>
lea    0xd9c(%rip),%rdi
jmp    132d <ic_resolve_type_ref_list+0x15d>
lea    0xdd3(%rip),%rdi
jmp    132d <ic_resolve_type_ref_list+0x15d>
mov    0x2cde(%rip),%rbx
mov    (%rbx),%esi
lea    0xeb0(%rip),%rdi
call   1080 <fputs@plt>
mov    (%rbx),%edi
mov    %r14,%rsi
call   1070 <ic_type_ref_print@plt>
mov    $0xa,%edi
call   1050 <putchar@plt>
jmp    1332 <ic_resolve_type_ref_list+0x162>
lea    0xddb(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ic_kludge = type { i32 }
%struct.ic_pvector = type { i32 }
%struct.ic_type_ref = type { i32 }
%struct.ic_symbol = type { i32 }
%struct.ic_decl_type = type { i32 }
%struct.ic_type_param = type { i32 }
@.str = [41 x i8] c"ic_anlyse_type_ref_list: kludge was null\00"
@.str.1 = [44 x i8] c"ic_anlyse_type_ref_list: type_refs was null\00"
@.str.2 = [55 x i8] c"ic_anlyse_type_ref_list: call to ic_pvector_get failed\00"
@.str.3 = [64 x i8] c"ic_resolve_type_ref_list: call to ic_type_ref_get_symbol failed\00"
@.str.4 = [60 x i8] c"ic_resolve_type_ref_list: call to ic_symbol_contents failed\00"
@.str.5 = [54 x i8] c"ic_resolve_type_ref_list: found param was not yet set\00"
@.str.6 = [67 x i8] c"ic_resolve_type_ref_list: call to ic_type_ref_set_type_decl failed\00"
@.str.7 = [25 x i8] c"ic_resolve_type_ref_list\00"
@.str.8 = [33 x i8] c"this message isn't super helpful\00"
@.str.9 = [82 x i8] c"ic_anlyse_type_ref_list: call to ic_analyse_resolve_type_ref failed for typeref: \00"
@stdout = global i32 0
@.str.10 = [1 x i8] zeroinitializer
define i32 @ic_resolve_type_ref_list(%struct.ic_kludge* %0, %struct.ic_pvector* %1, %struct.ic_pvector* %2) {
%4 = alloca i32
%5 = alloca %struct.ic_kludge*
%6 = alloca %struct.ic_pvector*
%7 = alloca %struct.ic_pvector*
%8 = alloca i32
%9 = alloca i32
%10 = alloca %struct.ic_type_ref*
%11 = alloca %struct.ic_symbol*
%12 = alloca i8*
%13 = alloca %struct.ic_decl_type*
%14 = alloca %struct.ic_type_param*
store %struct.ic_kludge* %0, %struct.ic_kludge** %5
store %struct.ic_pvector* %1, %struct.ic_pvector** %6
store %struct.ic_pvector* %2, %struct.ic_pvector** %7
store i32 0, i32* %8
store i32 0, i32* %9
store %struct.ic_type_ref* null, %struct.ic_type_ref** %10
store %struct.ic_symbol* null, %struct.ic_symbol** %11
store i8* null, i8** %12
store %struct.ic_decl_type* null, %struct.ic_decl_type** %13
store %struct.ic_type_param* null, %struct.ic_type_param** %14
%15 = load %struct.ic_kludge*, %struct.ic_kludge** %5
%16 = icmp ne %struct.ic_kludge* %15, null
br i1 %16, label %19, label %17
17: ; preds = %3
%18 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %99
19: ; preds = %3
%20 = load %struct.ic_pvector*, %struct.ic_pvector** %7
%21 = icmp ne %struct.ic_pvector* %20, null
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %99
24: ; preds = %19
%25 = load %struct.ic_pvector*, %struct.ic_pvector** %7
%26 = call i32 @ic_pvector_length(%struct.ic_pvector* %25)
store i32 %26, i32* %9
store i32 0, i32* %8
br label %27
27: ; preds = %95, %24
%28 = load i32, i32* %8
%29 = load i32, i32* %9
%30 = icmp ult i32 %28, %29
br i1 %30, label %31, label %98
31: ; preds = %27
%32 = load %struct.ic_pvector*, %struct.ic_pvector** %7
%33 = load i32, i32* %8
%34 = call %struct.ic_type_ref* @ic_pvector_get(%struct.ic_pvector* %32, i32 %33)
store %struct.ic_type_ref* %34, %struct.ic_type_ref** %10
%35 = load %struct.ic_type_ref*, %struct.ic_type_ref** %10
%36 = icmp ne %struct.ic_type_ref* %35, null
br i1 %36, label %39, label %37
37: ; preds = %31
%38 = call i32 @puts(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %99
39: ; preds = %31
%40 = load %struct.ic_type_ref*, %struct.ic_type_ref** %10
%41 = call i64 @ic_type_ref_is_resolved(%struct.ic_type_ref* %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %39
br label %95
44: ; preds = %39
%45 = load %struct.ic_type_ref*, %struct.ic_type_ref** %10
%46 = call %struct.ic_symbol* @ic_type_ref_get_symbol(%struct.ic_type_ref* %45)
store %struct.ic_symbol* %46, %struct.ic_symbol** %11
%47 = load %struct.ic_symbol*, %struct.ic_symbol** %11
%48 = icmp ne %struct.ic_symbol* %47, null
br i1 %48, label %51, label %49
49: ; preds = %44
%50 = call i32 @puts(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %4
br label %99
51: ; preds = %44
%52 = load %struct.ic_symbol*, %struct.ic_symbol** %11
%53 = call i8* @ic_symbol_contents(%struct.ic_symbol* %52)
store i8* %53, i8** %12
%54 = load i8*, i8** %12
%55 = icmp ne i8* %54, null
br i1 %55, label %58, label %56
56: ; preds = %51
%57 = call i32 @puts(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %4
br label %99
58: ; preds = %51
%59 = load %struct.ic_pvector*, %struct.ic_pvector** %6
%60 = icmp ne %struct.ic_pvector* %59, null
br i1 %60, label %61, label %80
61: ; preds = %58
%62 = load %struct.ic_pvector*, %struct.ic_pvector** %6
%63 = load i8*, i8** %12
%64 = call %struct.ic_type_param* @ic_type_param_search(%struct.ic_pvector* %62, i8* %63)
store %struct.ic_type_param* %64, %struct.ic_type_param** %14
%65 = icmp ne %struct.ic_type_param* %64, null
br i1 %65, label %66, label %80
66: ; preds = %61
%67 = load %struct.ic_type_param*, %struct.ic_type_param** %14
%68 = call i32 @ic_type_param_check_set(%struct.ic_type_param* %67)
%69 = icmp ne i32 %68, 0
br i1 %69, label %72, label %70
70: ; preds = %66
%71 = call i32 @puts(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %4
br label %99
72: ; preds = %66
%73 = load %struct.ic_type_ref*, %struct.ic_type_ref** %10
%74 = load %struct.ic_type_param*, %struct.ic_type_param** %14
%75 = call i32 @ic_type_ref_set_type_param(%struct.ic_type_ref* %73, %struct.ic_type_param* %74)
%76 = icmp ne i32 %75, 0
br i1 %76, label %79, label %77
77: ; preds = %72
%78 = call i32 @puts(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %4
br label %99
79: ; preds = %72
br label %95
80: ; preds = %61, %58
%81 = load %struct.ic_kludge*, %struct.ic_kludge** %5
%82 = load %struct.ic_pvector*, %struct.ic_pvector** %6
%83 = load %struct.ic_type_ref*, %struct.ic_type_ref** %10
%84 = call %struct.ic_decl_type* @ic_analyse_resolve_type_ref(%struct.ic_kludge* %81, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), %struct.ic_pvector* %82, %struct.ic_type_ref* %83)
store %struct.ic_decl_type* %84, %struct.ic_decl_type** %13
%85 = load %struct.ic_decl_type*, %struct.ic_decl_type** %13
%86 = icmp ne %struct.ic_decl_type* %85, null
br i1 %86, label %94, label %87
87: ; preds = %80
%88 = load i32, i32* @stdout
%89 = call i32 @fputs(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.9, i64 0, i64 0), i32 %88)
%90 = load i32, i32* @stdout
%91 = load %struct.ic_type_ref*, %struct.ic_type_ref** %10
%92 = call i32 @ic_type_ref_print(i32 %90, %struct.ic_type_ref* %91)
%93 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %4
br label %99
94: ; preds = %80
br label %95
95: ; preds = %94, %79, %43
%96 = load i32, i32* %8
%97 = add i32 %96, 1
store i32 %97, i32* %8
br label %27
98: ; preds = %27
store i32 1, i32* %4
br label %99
99: ; preds = %98, %87, %77, %70, %56, %49, %37, %22, %17
%100 = load i32, i32* %4
ret i32 %100
}

LLVM IR (-O2):
%struct.ic_kludge = type { i32 }
%struct.ic_pvector = type { i32 }
%struct.ic_type_ref = type { i32 }
%struct.ic_symbol = type { i32 }
%struct.ic_decl_type = type { i32 }
%struct.ic_type_param = type { i32 }
@.str = [41 x i8] c"ic_anlyse_type_ref_list: kludge was null\00"
@.str.1 = [44 x i8] c"ic_anlyse_type_ref_list: type_refs was null\00"
@.str.2 = [55 x i8] c"ic_anlyse_type_ref_list: call to ic_pvector_get failed\00"
@.str.3 = [64 x i8] c"ic_resolve_type_ref_list: call to ic_type_ref_get_symbol failed\00"
@.str.4 = [60 x i8] c"ic_resolve_type_ref_list: call to ic_symbol_contents failed\00"
@.str.5 = [54 x i8] c"ic_resolve_type_ref_list: found param was not yet set\00"
@.str.6 = [67 x i8] c"ic_resolve_type_ref_list: call to ic_type_ref_set_type_decl failed\00"
@.str.7 = [25 x i8] c"ic_resolve_type_ref_list\00"
@.str.8 = [33 x i8] c"this message isn't super helpful\00"
@.str.9 = [82 x i8] c"ic_anlyse_type_ref_list: call to ic_analyse_resolve_type_ref failed for typeref: \00"
@stdout = global i32 0
define i32 @ic_resolve_type_ref_list(%struct.ic_kludge* %0, %struct.ic_pvector* %1, %struct.ic_pvector* %2) {
%4 = icmp eq %struct.ic_kludge* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
br label %61
7: ; preds = %3
%8 = icmp eq %struct.ic_pvector* %2, null
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
br label %61
11: ; preds = %7
%12 = tail call i32 @ic_pvector_length(%struct.ic_pvector* %2)
%13 = icmp eq i32 %12, 0
br i1 %13, label %61, label %14
14: ; preds = %11
%15 = icmp eq %struct.ic_pvector* %1, null
br label %16
16: ; preds = %14, %58
%17 = phi i32 [ 0, %14 ], [ %59, %58 ]
%18 = tail call %struct.ic_type_ref* @ic_pvector_get(%struct.ic_pvector* %2, i32 %17)
%19 = icmp eq %struct.ic_type_ref* %18, null
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0))
br label %61
22: ; preds = %16
%23 = tail call i64 @ic_type_ref_is_resolved(%struct.ic_type_ref* %18)
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %58
25: ; preds = %22
%26 = tail call %struct.ic_symbol* @ic_type_ref_get_symbol(%struct.ic_type_ref* %18)
%27 = icmp eq %struct.ic_symbol* %26, null
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0))
br label %61
30: ; preds = %25
%31 = tail call i8* @ic_symbol_contents(%struct.ic_symbol* %26)
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.4, i64 0, i64 0))
br label %61
35: ; preds = %30
br i1 %15, label %49, label %36
36: ; preds = %35
%37 = tail call %struct.ic_type_param* @ic_type_param_search(%struct.ic_pvector* %1, i8* %31)
%38 = icmp eq %struct.ic_type_param* %37, null
br i1 %38, label %49, label %39
39: ; preds = %36
%40 = tail call i32 @ic_type_param_check_set(%struct.ic_type_param* %37)
%41 = icmp eq i32 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %39
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.5, i64 0, i64 0))
br label %61
44: ; preds = %39
%45 = tail call i32 @ic_type_ref_set_type_param(%struct.ic_type_ref* %18, %struct.ic_type_param* %37)
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %58
47: ; preds = %44
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.6, i64 0, i64 0))
br label %61
49: ; preds = %36, %35
%50 = tail call %struct.ic_decl_type* @ic_analyse_resolve_type_ref(%struct.ic_kludge* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.8, i64 0, i64 0), %struct.ic_pvector* %1, %struct.ic_type_ref* %18)
%51 = icmp eq %struct.ic_decl_type* %50, null
br i1 %51, label %52, label %58
52: ; preds = %49
%53 = load i32, i32* @stdout
%54 = tail call i32 @fputs(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.9, i64 0, i64 0), i32 %53)
%55 = load i32, i32* @stdout
%56 = tail call i32 @ic_type_ref_print(i32 %55, %struct.ic_type_ref* %18)
%57 = tail call i32 @putchar(i32 10)
br label %61
58: ; preds = %49, %44, %22
%59 = add nuw i32 %17, 1
%60 = icmp eq i32 %59, %12
br i1 %60, label %61, label %16
61: ; preds = %58, %11, %52, %47, %42, %33, %28, %20, %9, %5
%62 = phi i32 [ 0, %47 ], [ 0, %42 ], [ 0, %52 ], [ 0, %33 ], [ 0, %28 ], [ 0, %20 ], [ 0, %9 ], [ 0, %5 ], [ 1, %11 ], [ 1, %58 ]
ret i32 %62
}