; LLVM IR from ponylang/ponyc :: src/libponyc/expr (array)

; 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"

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.expr_pre_array = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @expr_pre_array(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [3 x ptr], align 16
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  store ptr %29, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call i32 @ast_id(ptr noundef %30)
  %32 = icmp eq i32 %31, 179
  br i1 %32, label %33, label %34

33:                                               ; preds = %2
  br label %35

34:                                               ; preds = %2
  call void @ponyint_assert_fail(ptr noundef @.str, ptr noundef @.str.1, i64 noundef 363, ptr noundef @__func__.expr_pre_array)
  br label %35

35:                                               ; preds = %34, %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #3
  store ptr %7, ptr %9, align 8, !tbaa !5
  %36 = getelementptr inbounds ptr, ptr %9, i64 1
  store ptr %8, ptr %36, align 8, !tbaa !5
  %37 = getelementptr inbounds ptr, ptr %9, i64 2
  store ptr null, ptr %37, align 8, !tbaa !5
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds [3 x ptr], ptr %9, i64 0, i64 0
  call void @ast_get_children(ptr noundef %38, i64 noundef 2, ptr noundef %39)
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  store i8 0, ptr %10, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = call ptr @find_antecedent_type(ptr noundef %40, ptr noundef %41, ptr noundef %10)
  store ptr %42, ptr %11, align 8, !tbaa !5
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = call i32 @ast_id(ptr noundef %43)
  %45 = icmp eq i32 %44, 2
  br i1 %45, label %46, label %53

46:                                               ; preds = %35
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = call zeroext i1 @infer_element_type(ptr noundef %47, ptr noundef %48, ptr noundef %7, ptr noundef %49)
  br i1 %50, label %52, label %51

51:                                               ; preds = %46
  store i32 2, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %184

52:                                               ; preds = %46
  br label %53

53:                                               ; preds = %52, %35
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = call i32 @ast_id(ptr noundef %54)
  %56 = icmp eq i32 %55, 2
  br i1 %56, label %57, label %58

57:                                               ; preds = %53
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %184

58:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = call ptr @build_array_type(ptr noundef %59, ptr noundef %60, ptr noundef %61, i32 noundef 93, i32 noundef 2)
  store ptr %62, ptr %13, align 8, !tbaa !5
  %63 = load ptr, ptr %11, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %181

65:                                               ; preds = %58
  %66 = load i8, ptr %10, align 1, !tbaa !9, !range !11, !noundef !12
  %67 = trunc i8 %66 to i1
  br i1 %67, label %181, label %68

68:                                               ; preds = %65
  %69 = load ptr, ptr %13, align 8, !tbaa !5
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = call zeroext i1 @is_subtype(ptr noundef %69, ptr noundef %70, ptr noundef null, ptr noundef %71)
  br i1 %72, label %181, label %73

73:                                               ; preds = %68
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = load ptr, ptr %11, align 8, !tbaa !5
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = call zeroext i1 @is_subtype_ignore_cap(ptr noundef %74, ptr noundef %75, ptr noundef null, ptr noundef %76)
  br i1 %77, label %78, label %181

78:                                               ; preds = %73
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ast_free_unattached(ptr noundef %79)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %80, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  store ptr null, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  store ptr null, ptr %18, align 8, !tbaa !5
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = call ptr @ast_from(ptr noundef %81, i32 noundef 107)
  store ptr %82, ptr %18, align 8, !tbaa !5
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %87

85:                                               ; preds = %78
  %86 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %86, ptr %16, align 8, !tbaa !5
  br label %99

87:                                               ; preds = %78
  %88 = load ptr, ptr %17, align 8, !tbaa !5
  %89 = icmp eq ptr %88, null
  br i1 %89, label %90, label %94

90:                                               ; preds = %87
  %91 = load ptr, ptr %16, align 8, !tbaa !5
  %92 = load ptr, ptr %18, align 8, !tbaa !5
  %93 = call ptr @ast_add(ptr noundef %91, ptr noundef %92)
  store ptr %93, ptr %17, align 8, !tbaa !5
  br label %98

94:                                               ; preds = %87
  %95 = load ptr, ptr %17, align 8, !tbaa !5
  %96 = load ptr, ptr %18, align 8, !tbaa !5
  %97 = call ptr @ast_add_sibling(ptr noundef %95, ptr noundef %96)
  store ptr %97, ptr %17, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %94, %90
  br label %99

99:                                               ; preds = %98, %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %100 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %100, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  store ptr null, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  store ptr null, ptr %21, align 8, !tbaa !5
  %101 = load ptr, ptr %15, align 8, !tbaa !5
  %102 = call ptr @ast_from(ptr noundef %101, i32 noundef 91)
  store ptr %102, ptr %21, align 8, !tbaa !5
  %103 = load ptr, ptr %19, align 8, !tbaa !5
  %104 = icmp eq ptr %103, null
  br i1 %104, label %105, label %107

105:                                              ; preds = %99
  %106 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %106, ptr %19, align 8, !tbaa !5
  br label %119

107:                                              ; preds = %99
  %108 = load ptr, ptr %20, align 8, !tbaa !5
  %109 = icmp eq ptr %108, null
  br i1 %109, label %110, label %114

110:                                              ; preds = %107
  %111 = load ptr, ptr %19, align 8, !tbaa !5
  %112 = load ptr, ptr %21, align 8, !tbaa !5
  %113 = call ptr @ast_add(ptr noundef %111, ptr noundef %112)
  store ptr %113, ptr %20, align 8, !tbaa !5
  br label %118

114:                                              ; preds = %107
  %115 = load ptr, ptr %20, align 8, !tbaa !5
  %116 = load ptr, ptr %21, align 8, !tbaa !5
  %117 = call ptr @ast_add_sibling(ptr noundef %115, ptr noundef %116)
  store ptr %117, ptr %20, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %114, %110
  br label %119

119:                                              ; preds = %118, %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %120 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %120, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  store ptr null, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  store ptr null, ptr %24, align 8, !tbaa !5
  %121 = load ptr, ptr %22, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %121)
  %122 = load ptr, ptr %22, align 8, !tbaa !5
  %123 = load ptr, ptr %23, align 8, !tbaa !5
  %124 = load ptr, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  %125 = load ptr, ptr %15, align 8, !tbaa !5
  %126 = call ptr @ast_from(ptr noundef %125, i32 noundef 175)
  store ptr %126, ptr %21, align 8, !tbaa !5
  %127 = load ptr, ptr %19, align 8, !tbaa !5
  %128 = icmp eq ptr %127, null
  br i1 %128, label %129, label %131

129:                                              ; preds = %119
  %130 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %130, ptr %19, align 8, !tbaa !5
  br label %143

131:                                              ; preds = %119
  %132 = load ptr, ptr %20, align 8, !tbaa !5
  %133 = icmp eq ptr %132, null
  br i1 %133, label %134, label %138

134:                                              ; preds = %131
  %135 = load ptr, ptr %19, align 8, !tbaa !5
  %136 = load ptr, ptr %21, align 8, !tbaa !5
  %137 = call ptr @ast_add(ptr noundef %135, ptr noundef %136)
  store ptr %137, ptr %20, align 8, !tbaa !5
  br label %142

138:                                              ; preds = %131
  %139 = load ptr, ptr %20, align 8, !tbaa !5
  %140 = load ptr, ptr %21, align 8, !tbaa !5
  %141 = call ptr @ast_add_sibling(ptr noundef %139, ptr noundef %140)
  store ptr %141, ptr %20, align 8, !tbaa !5
  br label %142

142:                                              ; preds = %138, %134
  br label %143

143:                                              ; preds = %142, %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  %144 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %144, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #3
  store ptr null, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #3
  store ptr null, ptr %27, align 8, !tbaa !5
  %145 = load ptr, ptr %25, align 8, !tbaa !5
  call void @ast_scope(ptr noundef %145)
  %146 = load ptr, ptr %25, align 8, !tbaa !5
  %147 = icmp eq ptr %146, null
  br i1 %147, label %148, label %150

148:                                              ; preds = %143
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %149, ptr %25, align 8, !tbaa !5
  br label %162

150:                                              ; preds = %143
  %151 = load ptr, ptr %26, align 8, !tbaa !5
  %152 = icmp eq ptr %151, null
  br i1 %152, label %153, label %157

153:                                              ; preds = %150
  %154 = load ptr, ptr %25, align 8, !tbaa !5
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = call ptr @ast_add(ptr noundef %154, ptr noundef %155)
  store ptr %156, ptr %26, align 8, !tbaa !5
  br label %161

157:                                              ; preds = %150
  %158 = load ptr, ptr %26, align 8, !tbaa !5
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = call ptr @ast_add_sibling(ptr noundef %158, ptr noundef %159)
  store ptr %160, ptr %26, align 8, !tbaa !5
  br label %161

161:                                              ; preds = %157, %153
  br label %162

162:                                              ; preds = %161, %148
  %163 = load ptr, ptr %25, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %163)
  %164 = load ptr, ptr %25, align 8, !tbaa !5
  %165 = load ptr, ptr %26, align 8, !tbaa !5
  %166 = load ptr, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  %167 = load ptr, ptr %19, align 8, !tbaa !5
  call void @ast_inheritflags(ptr noundef %167)
  %168 = load ptr, ptr %19, align 8, !tbaa !5
  %169 = load ptr, ptr %20, align 8, !tbaa !5
  %170 = load ptr, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  %171 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %171, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = load ptr, ptr %14, align 8, !tbaa !5
  call void @ast_replace(ptr noundef %172, ptr noundef %173)
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = call i32 @ast_visit(ptr noundef %174, ptr noundef @pass_pre_expr, ptr noundef @pass_expr, ptr noundef %175, i32 noundef 10)
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %179

178:                                              ; preds = %162
  store i32 2, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %180

179:                                              ; preds = %162
  store i32 1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %180

180:                                              ; preds = %179, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  br label %183

181:                                              ; preds = %73, %68, %65, %58
  %182 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ast_free_unattached(ptr noundef %182)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %183

183:                                              ; preds = %181, %180
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %184

184:                                              ; preds = %183, %57, %51
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %185 = load i32, ptr %3, align 4
  ret i32 %185
}

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

declare i32 @ast_id(ptr noundef) #2

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

declare void @ast_get_children(ptr noundef, i64 noundef, ptr noundef) #2

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

declare ptr @find_antecedent_type(ptr noundef, ptr noundef, ptr noundef) #2

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

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

declare zeroext i1 @is_subtype(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare zeroext i1 @is_subtype_ignore_cap(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare void @ast_free_unattached(ptr noundef) #2

declare ptr @ast_from(ptr noundef, i32 noundef) #2

declare ptr @ast_add(ptr noundef, ptr noundef) #2

declare ptr @ast_add_sibling(ptr noundef, ptr noundef) #2

declare void @ast_inheritflags(ptr noundef) #2

declare void @ast_scope(ptr noundef) #2

declare void @ast_replace(ptr noundef, ptr noundef) #2

declare i32 @ast_visit(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare i32 @pass_pre_expr(ptr noundef, ptr noundef) #2

declare i32 @pass_expr(ptr noundef, ptr noundef) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 #3 = { 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, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


; 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"

@.str = external hidden unnamed_addr constant [24 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [74 x i8], align 1
@__func__.expr_pre_array = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @expr_pre_array(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [3 x ptr], align 16
  %6 = alloca i8, align 1
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = tail call i32 @ast_id(ptr noundef %7) #3
  %9 = icmp eq i32 %8, 179
  br i1 %9, label %11, label %10

10:                                               ; preds = %2
  tail call void @ponyint_assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i64 noundef 363, ptr noundef nonnull @__func__.expr_pre_array) #3
  br label %11

11:                                               ; preds = %2, %10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  store ptr %3, ptr %5, align 16, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %4, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr null, ptr %13, align 16, !tbaa !5
  call void @ast_get_children(ptr noundef %7, i64 noundef 2, ptr noundef nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #3
  store i8 0, ptr %6, align 1, !tbaa !9
  %14 = call ptr @find_antecedent_type(ptr noundef %0, ptr noundef %7, ptr noundef nonnull %6) #3
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = call i32 @ast_id(ptr noundef %15) #3
  %17 = icmp eq i32 %16, 2
  br i1 %17, label %18, label %20

18:                                               ; preds = %11
  %19 = call zeroext i1 @infer_element_type(ptr noundef %0, ptr noundef %7, ptr noundef nonnull %3, ptr noundef %14)
  br i1 %19, label %20, label %56

20:                                               ; preds = %18, %11
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call i32 @ast_id(ptr noundef %21) #3
  %23 = icmp eq i32 %22, 2
  br i1 %23, label %56, label %24

24:                                               ; preds = %20
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call ptr @build_array_type(ptr noundef %0, ptr noundef %7, ptr noundef %25, i32 noundef 93, i32 noundef 2)
  %.not = icmp eq ptr %14, null
  br i1 %.not, label %55, label %27

27:                                               ; preds = %24
  %28 = load i8, ptr %6, align 1, !tbaa !9, !range !11, !noundef !12
  %29 = trunc nuw i8 %28 to i1
  br i1 %29, label %55, label %30

30:                                               ; preds = %27
  %31 = call zeroext i1 @is_subtype(ptr noundef %26, ptr noundef nonnull %14, ptr noundef null, ptr noundef %0) #3
  br i1 %31, label %55, label %32

32:                                               ; preds = %30
  %33 = call zeroext i1 @is_subtype_ignore_cap(ptr noundef %26, ptr noundef nonnull %14, ptr noundef null, ptr noundef %0) #3
  br i1 %33, label %34, label %55

34:                                               ; preds = %32
  call void @ast_free_unattached(ptr noundef %26) #3
  %35 = call ptr @ast_from(ptr noundef %7, i32 noundef 107) #3
  %36 = call ptr @ast_from(ptr noundef %7, i32 noundef 91) #3
  %37 = icmp eq ptr %35, null
  br i1 %37, label %40, label %38

38:                                               ; preds = %34
  %39 = call ptr @ast_add(ptr noundef nonnull %35, ptr noundef %36) #3
  br label %40

40:                                               ; preds = %34, %38
  %.077 = phi ptr [ %35, %38 ], [ %36, %34 ]
  %.075 = phi ptr [ %39, %38 ], [ null, %34 ]
  call void @ast_inheritflags(ptr noundef %36) #3
  %41 = call ptr @ast_from(ptr noundef %7, i32 noundef 175) #3
  %42 = icmp eq ptr %.077, null
  br i1 %42, label %49, label %43

43:                                               ; preds = %40
  %44 = icmp eq ptr %.075, null
  br i1 %44, label %45, label %47

45:                                               ; preds = %43
  %46 = call ptr @ast_add(ptr noundef nonnull %.077, ptr noundef %41) #3
  br label %49

47:                                               ; preds = %43
  %48 = call ptr @ast_add_sibling(ptr noundef nonnull %.075, ptr noundef %41) #3
  br label %49

49:                                               ; preds = %40, %45, %47
  %.178 = phi ptr [ %.077, %45 ], [ %.077, %47 ], [ %41, %40 ]
  call void @ast_scope(ptr noundef %41) #3
  %50 = icmp eq ptr %41, null
  br i1 %50, label %53, label %51

51:                                               ; preds = %49
  %52 = call ptr @ast_add(ptr noundef nonnull %41, ptr noundef %7) #3
  br label %53

53:                                               ; preds = %49, %51
  %.073 = phi ptr [ %41, %51 ], [ %7, %49 ]
  call void @ast_inheritflags(ptr noundef %.073) #3
  call void @ast_inheritflags(ptr noundef %.178) #3
  call void @ast_replace(ptr noundef nonnull %1, ptr noundef %35) #3
  %54 = call i32 @ast_visit(ptr noundef nonnull %1, ptr noundef nonnull @pass_pre_expr, ptr noundef nonnull @pass_expr, ptr noundef %0, i32 noundef 10) #3
  %.not82 = icmp eq i32 %54, 0
  %. = select i1 %.not82, i32 1, i32 2
  br label %56

55:                                               ; preds = %32, %30, %27, %24
  call void @ast_free_unattached(ptr noundef %26) #3
  br label %56

56:                                               ; preds = %53, %55, %20, %18
  %.2 = phi i32 [ 2, %18 ], [ 0, %20 ], [ 0, %55 ], [ %., %53 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #3
  ret i32 %.2
}

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

declare i32 @ast_id(ptr noundef) local_unnamed_addr #2

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

declare void @ast_get_children(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @find_antecedent_type(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

declare zeroext i1 @is_subtype(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare zeroext i1 @is_subtype_ignore_cap(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ast_free_unattached(ptr noundef) local_unnamed_addr #2

declare ptr @ast_from(ptr noundef, i32 noundef) local_unnamed_addr #2

declare ptr @ast_add(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @ast_add_sibling(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @ast_inheritflags(ptr noundef) local_unnamed_addr #2

declare void @ast_scope(ptr noundef) local_unnamed_addr #2

declare void @ast_replace(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @ast_visit(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @pass_pre_expr(ptr noundef, ptr noundef) #2

declare i32 @pass_expr(ptr noundef, ptr noundef) #2

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 #3 = { 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, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass