; LLVM IR from ponylang/ponyc :: src/libponyc/pass (docgen)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.docgen_opt_t = type { i8 }
%struct.docgen_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, ptr, ptr }
%struct.pass_opt_t = type { i32, i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i64, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.typecheck_t, ptr, ptr }
%struct.typecheck_t = type { ptr, %struct.typecheck_stats_t, ptr }
%struct.typecheck_stats_t = type { i64, i64, i64, i64 }
%struct.doc_sources_t = type { ptr, ptr, i64, ptr, i64, ptr, i64, ptr }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__func__.generate_docs = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [25 x i8], align 1
@__const.generate_docs.logo = external hidden unnamed_addr constant [15558 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local void @generate_docs(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.docgen_opt_t, align 1
  %6 = alloca %struct.docgen_t, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca [15558 x i8], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %17

16:                                               ; preds = %2
  br label %18

17:                                               ; preds = %2
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 1352, ptr noundef @__func__.generate_docs)
  br label %18

18:                                               ; preds = %17, %16
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = call i32 @ast_id(ptr noundef %19)
  %21 = icmp ne i32 %20, 136
  br i1 %21, label %22, label %23

22:                                               ; preds = %18
  br label %271

23:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.pass_opt_t, ptr %24, i32 0, i32 15
  %26 = load i8, ptr %25, align 1, !tbaa !9, !range !16, !noundef !17
  %27 = trunc i8 %26 to i1
  %28 = getelementptr inbounds %struct.docgen_opt_t, ptr %5, i32 0, i32 0
  %29 = zext i1 %27 to i8
  store i8 %29, ptr %28, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 120, ptr %6) #5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.pass_opt_t, ptr %30, i32 0, i32 36
  %32 = getelementptr inbounds %struct.typecheck_t, ptr %31, i32 0, i32 2
  %33 = load ptr, ptr %32, align 8, !tbaa !20
  %34 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 13
  store ptr %33, ptr %34, align 8, !tbaa !21
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  call void @doc_setup_dirs(ptr noundef %6, ptr noundef %35, ptr noundef %36)
  %37 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 6
  %38 = load ptr, ptr %37, align 8, !tbaa !23
  %39 = call ptr @doc_open_file(ptr noundef %6, ptr noundef %38, ptr noundef @.str.2, ptr noundef @.str.3)
  %40 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  store ptr %39, ptr %40, align 8, !tbaa !24
  %41 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 7
  %42 = load ptr, ptr %41, align 8, !tbaa !25
  %43 = call ptr @doc_open_file(ptr noundef %6, ptr noundef %42, ptr noundef @.str.4, ptr noundef @.str.5)
  %44 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  store ptr %43, ptr %44, align 8, !tbaa !26
  %45 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 5
  store ptr null, ptr %45, align 8, !tbaa !27
  %46 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 14
  store ptr null, ptr %46, align 8, !tbaa !28
  %47 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !24
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %149

50:                                               ; preds = %23
  %51 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !26
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %149

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = call ptr @ast_child(ptr noundef %55)
  store ptr %56, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = call ptr @package_filename(ptr noundef %57)
  store ptr %58, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !26
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.6) #5
  %62 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !26
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.7) #5
  %65 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  %66 = load ptr, ptr %65, align 8, !tbaa !26
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef @.str.8) #5
  %68 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !26
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef @.str.6) #5
  %71 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !26
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str.9) #5
  %74 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !24
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.10, ptr noundef %76) #5
  %78 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !24
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef @.str.11) #5
  %81 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !24
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.12) #5
  %84 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8, !tbaa !24
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef @.str.13, ptr noundef @.str.14, ptr noundef @.str.15) #5
  %87 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8, !tbaa !24
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %88, ptr noundef @.str.16, ptr noundef @.str.14, ptr noundef @.str.15) #5
  %90 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !24
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.17) #5
  %93 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %94 = load ptr, ptr %93, align 8, !tbaa !24
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str.18) #5
  %96 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !24
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef @.str.19) #5
  %99 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !24
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.20) #5
  %102 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !24
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.21) #5
  %105 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !24
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.22) #5
  %108 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !24
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str.23) #5
  %111 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !24
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %112, ptr noundef @.str.24, ptr noundef @.str.14, ptr noundef @.str.25) #5
  %114 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !24
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.26) #5
  %117 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !24
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.27) #5
  %120 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8, !tbaa !24
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.28) #5
  %123 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !24
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef @.str.29) #5
  %126 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !24
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.30) #5
  %129 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !24
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str.31) #5
  %132 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8, !tbaa !24
  %134 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.32) #5
  %135 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !24
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef @.str.33) #5
  %138 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %139 = load ptr, ptr %138, align 8, !tbaa !24
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.34) #5
  %141 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !24
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef @.str.35) #5
  %144 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !24
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str.36, ptr noundef %146) #5
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  call void @doc_packages(ptr noundef %6, ptr noundef %5, ptr noundef %148)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %149

149:                                              ; preds = %54, %50, %23
  %150 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 14
  %151 = load ptr, ptr %150, align 8, !tbaa !28
  %152 = icmp ne ptr %151, null
  br i1 %152, label %153, label %196

153:                                              ; preds = %149
  %154 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !24
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.37) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %157 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 14
  %158 = load ptr, ptr %157, align 8, !tbaa !28
  store ptr %158, ptr %9, align 8, !tbaa !5
  br label %159

159:                                              ; preds = %162, %153
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  %161 = icmp ne ptr %160, null
  br i1 %161, label %162, label %195

162:                                              ; preds = %159
  %163 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !24
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.doc_sources_t, ptr %165, i32 0, i32 1
  %167 = load ptr, ptr %166, align 8, !tbaa !29
  %168 = load ptr, ptr %9, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.doc_sources_t, ptr %168, i32 0, i32 3
  %170 = load ptr, ptr %169, align 8, !tbaa !31
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef @.str.38, ptr noundef %167, ptr noundef %170) #5
  %172 = load ptr, ptr %9, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.doc_sources_t, ptr %172, i32 0, i32 2
  %174 = load i64, ptr %173, align 8, !tbaa !32
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.doc_sources_t, ptr %175, i32 0, i32 1
  %177 = load ptr, ptr %176, align 8, !tbaa !29
  call void @ponyint_pool_free_size(i64 noundef %174, ptr noundef %177)
  %178 = load ptr, ptr %9, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.doc_sources_t, ptr %178, i32 0, i32 4
  %180 = load i64, ptr %179, align 8, !tbaa !33
  %181 = load ptr, ptr %9, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.doc_sources_t, ptr %181, i32 0, i32 3
  %183 = load ptr, ptr %182, align 8, !tbaa !31
  call void @ponyint_pool_free_size(i64 noundef %180, ptr noundef %183)
  %184 = load ptr, ptr %9, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.doc_sources_t, ptr %184, i32 0, i32 6
  %186 = load i64, ptr %185, align 8, !tbaa !34
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.doc_sources_t, ptr %187, i32 0, i32 5
  %189 = load ptr, ptr %188, align 8, !tbaa !35
  call void @ponyint_pool_free_size(i64 noundef %186, ptr noundef %189)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %190 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %190, ptr %10, align 8, !tbaa !5
  %191 = load ptr, ptr %9, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.doc_sources_t, ptr %191, i32 0, i32 7
  %193 = load ptr, ptr %192, align 8, !tbaa !36
  store ptr %193, ptr %9, align 8, !tbaa !5
  %194 = load ptr, ptr %10, align 8, !tbaa !5
  call void @ponyint_pool_free_size(i64 noundef 64, ptr noundef %194)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %159, !llvm.loop !37

195:                                              ; preds = %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %196

196:                                              ; preds = %195, %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %197 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 8
  %198 = load ptr, ptr %197, align 8, !tbaa !39
  %199 = call ptr @doc_open_file(ptr noundef %6, ptr noundef %198, ptr noundef @.str.25, ptr noundef @.str.39)
  store ptr %199, ptr %11, align 8, !tbaa !5
  %200 = load ptr, ptr %11, align 8, !tbaa !5
  %201 = icmp ne ptr %200, null
  br i1 %201, label %202, label %207

202:                                              ; preds = %196
  %203 = load ptr, ptr %11, align 8, !tbaa !5
  %204 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %203, ptr noundef @.str.40) #5
  %205 = load ptr, ptr %11, align 8, !tbaa !5
  %206 = call i32 @fclose(ptr noundef %205)
  br label %211

207:                                              ; preds = %196
  %208 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 8
  %209 = load ptr, ptr %208, align 8, !tbaa !39
  %210 = call i32 (ptr, ...) @printf(ptr noundef @.str.41, ptr noundef %209, ptr noundef @.str.25)
  br label %211

211:                                              ; preds = %207, %202
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %212 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 8
  %213 = load ptr, ptr %212, align 8, !tbaa !39
  %214 = call ptr @doc_open_binary_file(ptr noundef %6, ptr noundef %213, ptr noundef @.str.15, ptr noundef @.str.39)
  store ptr %214, ptr %12, align 8, !tbaa !5
  %215 = load ptr, ptr %12, align 8, !tbaa !5
  %216 = icmp ne ptr %215, null
  br i1 %216, label %217, label %223

217:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 15558, ptr %13) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 @__const.generate_docs.logo, i64 15558, i1 false)
  %218 = getelementptr inbounds [15558 x i8], ptr %13, i64 0, i64 0
  %219 = load ptr, ptr %12, align 8, !tbaa !5
  %220 = call i64 @fwrite(ptr noundef %218, i64 noundef 1, i64 noundef 15558, ptr noundef %219)
  %221 = load ptr, ptr %12, align 8, !tbaa !5
  %222 = call i32 @fclose(ptr noundef %221)
  call void @llvm.lifetime.end.p0(i64 15558, ptr %13) #5
  br label %227

223:                                              ; preds = %211
  %224 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 8
  %225 = load ptr, ptr %224, align 8, !tbaa !39
  %226 = call i32 (ptr, ...) @printf(ptr noundef @.str.41, ptr noundef %225, ptr noundef @.str.15)
  br label %227

227:                                              ; preds = %223, %217
  %228 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %229 = load ptr, ptr %228, align 8, !tbaa !24
  %230 = icmp ne ptr %229, null
  br i1 %230, label %231, label %235

231:                                              ; preds = %227
  %232 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 0
  %233 = load ptr, ptr %232, align 8, !tbaa !24
  %234 = call i32 @fclose(ptr noundef %233)
  br label %235

235:                                              ; preds = %231, %227
  %236 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  %237 = load ptr, ptr %236, align 8, !tbaa !26
  %238 = icmp ne ptr %237, null
  br i1 %238, label %239, label %243

239:                                              ; preds = %235
  %240 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 1
  %241 = load ptr, ptr %240, align 8, !tbaa !26
  %242 = call i32 @fclose(ptr noundef %241)
  br label %243

243:                                              ; preds = %239, %235
  %244 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 6
  %245 = load ptr, ptr %244, align 8, !tbaa !23
  %246 = icmp ne ptr %245, null
  br i1 %246, label %247, label %252

247:                                              ; preds = %243
  %248 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 10
  %249 = load i64, ptr %248, align 8, !tbaa !40
  %250 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 6
  %251 = load ptr, ptr %250, align 8, !tbaa !23
  call void @ponyint_pool_free_size(i64 noundef %249, ptr noundef %251)
  br label %252

252:                                              ; preds = %247, %243
  %253 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 7
  %254 = load ptr, ptr %253, align 8, !tbaa !25
  %255 = icmp ne ptr %254, null
  br i1 %255, label %256, label %261

256:                                              ; preds = %252
  %257 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 11
  %258 = load i64, ptr %257, align 8, !tbaa !41
  %259 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 7
  %260 = load ptr, ptr %259, align 8, !tbaa !25
  call void @ponyint_pool_free_size(i64 noundef %258, ptr noundef %260)
  br label %261

261:                                              ; preds = %256, %252
  %262 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 8
  %263 = load ptr, ptr %262, align 8, !tbaa !39
  %264 = icmp ne ptr %263, null
  br i1 %264, label %265, label %270

265:                                              ; preds = %261
  %266 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 12
  %267 = load i64, ptr %266, align 8, !tbaa !42
  %268 = getelementptr inbounds %struct.docgen_t, ptr %6, i32 0, i32 8
  %269 = load ptr, ptr %268, align 8, !tbaa !39
  call void @ponyint_pool_free_size(i64 noundef %267, ptr noundef %269)
  br label %270

270:                                              ; preds = %265, %261
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 120, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  br label %271

271:                                              ; preds = %270, %22
  ret void
}

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

declare i32 @ast_id(ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: nounwind uwtable
declare hidden void @doc_setup_dirs(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden ptr @doc_open_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

declare ptr @ast_child(ptr noundef) #1

declare ptr @package_filename(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
declare hidden void @doc_packages(ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

declare void @ponyint_pool_free_size(i64 noundef, ptr noundef) #1

declare i32 @fclose(ptr noundef) #1

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @doc_open_binary_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !12, i64 21}
!10 = !{!"pass_opt_t", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !12, i64 12, !12, i64 13, !12, i64 14, !12, i64 15, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !11, i64 24, !13, i64 32, !12, i64 40, !12, i64 41, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !14, i64 176, !6, i64 224, !6, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!"typecheck_t", !6, i64 0, !15, i64 8, !6, i64 40}
!15 = !{!"typecheck_stats_t", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!19, !12, i64 0}
!19 = !{!"docgen_opt_t", !12, i64 0}
!20 = !{!10, !6, i64 216}
!21 = !{!22, !6, i64 104}
!22 = !{!"docgen_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !13, i64 80, !13, i64 88, !13, i64 96, !6, i64 104, !6, i64 112}
!23 = !{!22, !6, i64 48}
!24 = !{!22, !6, i64 0}
!25 = !{!22, !6, i64 56}
!26 = !{!22, !6, i64 8}
!27 = !{!22, !6, i64 40}
!28 = !{!22, !6, i64 112}
!29 = !{!30, !6, i64 8}
!30 = !{!"doc_sources_t", !6, i64 0, !6, i64 8, !13, i64 16, !6, i64 24, !13, i64 32, !6, i64 40, !13, i64 48, !6, i64 56}
!31 = !{!30, !6, i64 24}
!32 = !{!30, !13, i64 16}
!33 = !{!30, !13, i64 32}
!34 = !{!30, !13, i64 48}
!35 = !{!30, !6, i64 40}
!36 = !{!30, !6, i64 56}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = !{!22, !6, i64 64}
!40 = !{!22, !13, i64 80}
!41 = !{!22, !13, i64 88}
!42 = !{!22, !13, i64 96}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.docgen_opt_t = type { i8 }
%struct.docgen_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, ptr, ptr }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@__func__.generate_docs = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [90 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [25 x i8], align 1
@__const.generate_docs.logo = external hidden unnamed_addr constant [15558 x i8], align 16

; Function Attrs: nounwind uwtable
define dso_local void @generate_docs(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.docgen_opt_t, align 1
  %4 = alloca %struct.docgen_t, align 8
  %5 = alloca [15558 x i8], align 16
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %6, label %7

6:                                                ; preds = %2
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 1352, ptr noundef nonnull @__func__.generate_docs) #5
  br label %7

7:                                                ; preds = %2, %6
  %8 = tail call i32 @ast_id(ptr noundef %0) #5
  %.not38 = icmp eq i32 %8, 136
  br i1 %.not38, label %9, label %152

9:                                                ; preds = %7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #5
  %10 = getelementptr inbounds i8, ptr %1, i64 21
  %11 = load i8, ptr %10, align 1, !tbaa !5, !range !15, !noundef !16
  store i8 %11, ptr %3, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %4) #5
  %12 = getelementptr inbounds i8, ptr %1, i64 216
  %13 = load ptr, ptr %12, align 8, !tbaa !19
  %14 = getelementptr inbounds i8, ptr %4, i64 104
  store ptr %13, ptr %14, align 8, !tbaa !20
  call void @doc_setup_dirs(ptr noundef nonnull %4, ptr noundef %0, ptr noundef %1)
  %15 = getelementptr inbounds i8, ptr %4, i64 48
  %16 = load ptr, ptr %15, align 8, !tbaa !22
  %17 = call ptr @doc_open_file(ptr noundef nonnull %4, ptr noundef %16, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3)
  store ptr %17, ptr %4, align 8, !tbaa !23
  %18 = getelementptr inbounds i8, ptr %4, i64 56
  %19 = load ptr, ptr %18, align 8, !tbaa !24
  %20 = call ptr @doc_open_file(ptr noundef nonnull %4, ptr noundef %19, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5)
  %21 = getelementptr inbounds i8, ptr %4, i64 8
  store ptr %20, ptr %21, align 8, !tbaa !25
  %22 = getelementptr inbounds i8, ptr %4, i64 40
  store ptr null, ptr %22, align 8, !tbaa !26
  %23 = getelementptr inbounds i8, ptr %4, i64 112
  store ptr null, ptr %23, align 8, !tbaa !27
  %24 = load ptr, ptr %4, align 8, !tbaa !23
  %25 = icmp ne ptr %24, null
  %26 = icmp ne ptr %20, null
  %or.cond = select i1 %25, i1 %26, i1 false
  br i1 %or.cond, label %27, label %.thread

27:                                               ; preds = %9
  %28 = call ptr @ast_child(ptr noundef %0) #5
  %29 = call ptr @package_filename(ptr noundef %28) #5
  %30 = load ptr, ptr %21, align 8, !tbaa !25
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.6) #5
  %32 = load ptr, ptr %21, align 8, !tbaa !25
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.7) #5
  %34 = load ptr, ptr %21, align 8, !tbaa !25
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.8) #5
  %36 = load ptr, ptr %21, align 8, !tbaa !25
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %36, ptr noundef nonnull @.str.6) #5
  %38 = load ptr, ptr %21, align 8, !tbaa !25
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef nonnull @.str.9) #5
  %40 = load ptr, ptr %4, align 8, !tbaa !23
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.10, ptr noundef %29) #5
  %42 = load ptr, ptr %4, align 8, !tbaa !23
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef nonnull @.str.11) #5
  %44 = load ptr, ptr %4, align 8, !tbaa !23
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.12) #5
  %46 = load ptr, ptr %4, align 8, !tbaa !23
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.15) #5
  %48 = load ptr, ptr %4, align 8, !tbaa !23
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.15) #5
  %50 = load ptr, ptr %4, align 8, !tbaa !23
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.17) #5
  %52 = load ptr, ptr %4, align 8, !tbaa !23
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.18) #5
  %54 = load ptr, ptr %4, align 8, !tbaa !23
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.19) #5
  %56 = load ptr, ptr %4, align 8, !tbaa !23
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str.20) #5
  %58 = load ptr, ptr %4, align 8, !tbaa !23
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.21) #5
  %60 = load ptr, ptr %4, align 8, !tbaa !23
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.22) #5
  %62 = load ptr, ptr %4, align 8, !tbaa !23
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.23) #5
  %64 = load ptr, ptr %4, align 8, !tbaa !23
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.25) #5
  %66 = load ptr, ptr %4, align 8, !tbaa !23
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %66, ptr noundef nonnull @.str.26) #5
  %68 = load ptr, ptr %4, align 8, !tbaa !23
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.27) #5
  %70 = load ptr, ptr %4, align 8, !tbaa !23
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str.28) #5
  %72 = load ptr, ptr %4, align 8, !tbaa !23
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.29) #5
  %74 = load ptr, ptr %4, align 8, !tbaa !23
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.30) #5
  %76 = load ptr, ptr %4, align 8, !tbaa !23
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str.31) #5
  %78 = load ptr, ptr %4, align 8, !tbaa !23
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef nonnull @.str.32) #5
  %80 = load ptr, ptr %4, align 8, !tbaa !23
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef nonnull @.str.33) #5
  %82 = load ptr, ptr %4, align 8, !tbaa !23
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef nonnull @.str.34) #5
  %84 = load ptr, ptr %4, align 8, !tbaa !23
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.35) #5
  %86 = load ptr, ptr %4, align 8, !tbaa !23
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef nonnull @.str.36, ptr noundef %29) #5
  call void @doc_packages(ptr noundef nonnull %4, ptr noundef nonnull %3, ptr noundef %0)
  %.pr = load ptr, ptr %23, align 8, !tbaa !27
  %.not39 = icmp eq ptr %.pr, null
  br i1 %.not39, label %.thread, label %88

88:                                               ; preds = %27
  %89 = load ptr, ptr %4, align 8, !tbaa !23
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %89, ptr noundef nonnull @.str.37) #5
  %91 = load ptr, ptr %23, align 8, !tbaa !27
  %.not4049 = icmp eq ptr %91, null
  br i1 %.not4049, label %.thread, label %.lr.ph

.lr.ph:                                           ; preds = %88, %.lr.ph
  %.050 = phi ptr [ %109, %.lr.ph ], [ %91, %88 ]
  %92 = load ptr, ptr %4, align 8, !tbaa !23
  %93 = getelementptr inbounds i8, ptr %.050, i64 8
  %94 = load ptr, ptr %93, align 8, !tbaa !28
  %95 = getelementptr inbounds i8, ptr %.050, i64 24
  %96 = load ptr, ptr %95, align 8, !tbaa !30
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef nonnull @.str.38, ptr noundef %94, ptr noundef %96) #5
  %98 = getelementptr inbounds i8, ptr %.050, i64 16
  %99 = load i64, ptr %98, align 8, !tbaa !31
  %100 = load ptr, ptr %93, align 8, !tbaa !28
  call void @ponyint_pool_free_size(i64 noundef %99, ptr noundef %100) #5
  %101 = getelementptr inbounds i8, ptr %.050, i64 32
  %102 = load i64, ptr %101, align 8, !tbaa !32
  %103 = load ptr, ptr %95, align 8, !tbaa !30
  call void @ponyint_pool_free_size(i64 noundef %102, ptr noundef %103) #5
  %104 = getelementptr inbounds i8, ptr %.050, i64 48
  %105 = load i64, ptr %104, align 8, !tbaa !33
  %106 = getelementptr inbounds i8, ptr %.050, i64 40
  %107 = load ptr, ptr %106, align 8, !tbaa !34
  call void @ponyint_pool_free_size(i64 noundef %105, ptr noundef %107) #5
  %108 = getelementptr inbounds i8, ptr %.050, i64 56
  %109 = load ptr, ptr %108, align 8, !tbaa !35
  call void @ponyint_pool_free_size(i64 noundef 64, ptr noundef nonnull %.050) #5
  %.not40 = icmp eq ptr %109, null
  br i1 %.not40, label %.thread, label %.lr.ph, !llvm.loop !36

.thread:                                          ; preds = %.lr.ph, %88, %9, %27
  %110 = getelementptr inbounds i8, ptr %4, i64 64
  %111 = load ptr, ptr %110, align 8, !tbaa !38
  %112 = call ptr @doc_open_file(ptr noundef nonnull %4, ptr noundef %111, ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.39)
  %.not41 = icmp eq ptr %112, null
  br i1 %.not41, label %116, label %113

113:                                              ; preds = %.thread
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %112, ptr noundef nonnull @.str.40) #5
  %115 = call i32 @fclose(ptr noundef nonnull %112)
  br label %119

116:                                              ; preds = %.thread
  %117 = load ptr, ptr %110, align 8, !tbaa !38
  %118 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.41, ptr noundef %117, ptr noundef nonnull @.str.25)
  br label %119

119:                                              ; preds = %116, %113
  %120 = load ptr, ptr %110, align 8, !tbaa !38
  %121 = call ptr @doc_open_binary_file(ptr noundef nonnull %4, ptr noundef %120, ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.39)
  %.not42 = icmp eq ptr %121, null
  br i1 %.not42, label %125, label %122

122:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 15558, ptr nonnull %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(15558) %5, ptr noundef nonnull align 16 dereferenceable(15558) @__const.generate_docs.logo, i64 15558, i1 false)
  %123 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 15558, ptr noundef nonnull %121)
  %124 = call i32 @fclose(ptr noundef nonnull %121)
  call void @llvm.lifetime.end.p0(i64 15558, ptr nonnull %5) #5
  br label %128

125:                                              ; preds = %119
  %126 = load ptr, ptr %110, align 8, !tbaa !38
  %127 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.41, ptr noundef %126, ptr noundef nonnull @.str.15)
  br label %128

128:                                              ; preds = %125, %122
  %129 = load ptr, ptr %4, align 8, !tbaa !23
  %.not43 = icmp eq ptr %129, null
  br i1 %.not43, label %132, label %130

130:                                              ; preds = %128
  %131 = call i32 @fclose(ptr noundef nonnull %129)
  br label %132

132:                                              ; preds = %130, %128
  %133 = load ptr, ptr %21, align 8, !tbaa !25
  %.not44 = icmp eq ptr %133, null
  br i1 %.not44, label %136, label %134

134:                                              ; preds = %132
  %135 = call i32 @fclose(ptr noundef nonnull %133)
  br label %136

136:                                              ; preds = %134, %132
  %137 = load ptr, ptr %15, align 8, !tbaa !22
  %.not45 = icmp eq ptr %137, null
  br i1 %.not45, label %141, label %138

138:                                              ; preds = %136
  %139 = getelementptr inbounds i8, ptr %4, i64 80
  %140 = load i64, ptr %139, align 8, !tbaa !39
  call void @ponyint_pool_free_size(i64 noundef %140, ptr noundef nonnull %137) #5
  br label %141

141:                                              ; preds = %138, %136
  %142 = load ptr, ptr %18, align 8, !tbaa !24
  %.not46 = icmp eq ptr %142, null
  br i1 %.not46, label %146, label %143

143:                                              ; preds = %141
  %144 = getelementptr inbounds i8, ptr %4, i64 88
  %145 = load i64, ptr %144, align 8, !tbaa !40
  call void @ponyint_pool_free_size(i64 noundef %145, ptr noundef nonnull %142) #5
  br label %146

146:                                              ; preds = %143, %141
  %147 = load ptr, ptr %110, align 8, !tbaa !38
  %.not47 = icmp eq ptr %147, null
  br i1 %.not47, label %151, label %148

148:                                              ; preds = %146
  %149 = getelementptr inbounds i8, ptr %4, i64 96
  %150 = load i64, ptr %149, align 8, !tbaa !41
  call void @ponyint_pool_free_size(i64 noundef %150, ptr noundef nonnull %147) #5
  br label %151

151:                                              ; preds = %148, %146
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #5
  br label %152

152:                                              ; preds = %7, %151
  ret void
}

declare void @ponyint_assert_fail(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare i32 @ast_id(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2

; Function Attrs: nounwind uwtable
declare hidden void @doc_setup_dirs(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden ptr @doc_open_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare ptr @ast_child(ptr noundef) local_unnamed_addr #1

declare ptr @package_filename(ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @doc_packages(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

declare void @ponyint_pool_free_size(i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden ptr @doc_open_binary_file(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 21}
!6 = !{!"pass_opt_t", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 9, !10, i64 10, !10, i64 11, !10, i64 12, !10, i64 13, !10, i64 14, !10, i64 15, !10, i64 16, !10, i64 17, !10, i64 18, !10, i64 19, !10, i64 20, !10, i64 21, !7, i64 24, !11, i64 32, !10, i64 40, !10, i64 41, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !13, i64 176, !12, i64 224, !12, i64 232}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Bool", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"typecheck_t", !12, i64 0, !14, i64 8, !12, i64 40}
!14 = !{!"typecheck_stats_t", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!18, !10, i64 0}
!18 = !{!"docgen_opt_t", !10, i64 0}
!19 = !{!6, !12, i64 216}
!20 = !{!21, !12, i64 104}
!21 = !{!"docgen_t", !12, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !12, i64 104, !12, i64 112}
!22 = !{!21, !12, i64 48}
!23 = !{!21, !12, i64 0}
!24 = !{!21, !12, i64 56}
!25 = !{!21, !12, i64 8}
!26 = !{!21, !12, i64 40}
!27 = !{!21, !12, i64 112}
!28 = !{!29, !12, i64 8}
!29 = !{!"doc_sources_t", !12, i64 0, !12, i64 8, !11, i64 16, !12, i64 24, !11, i64 32, !12, i64 40, !11, i64 48, !12, i64 56}
!30 = !{!29, !12, i64 24}
!31 = !{!29, !11, i64 16}
!32 = !{!29, !11, i64 32}
!33 = !{!29, !11, i64 48}
!34 = !{!29, !12, i64 40}
!35 = !{!29, !12, i64 56}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!21, !12, i64 64}
!39 = !{!21, !11, i64 80}
!40 = !{!21, !11, i64 88}
!41 = !{!21, !11, i64 96}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass