; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_TypeChecker (closeTagArgs__)

; 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.tag_____IAllocator__ = type { ptr, ptr, ptr, ptr }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.tag_____Array__Tag____ = type { ptr, i32 }

@top_____currentAllocator__ = external dso_local thread_local global %struct.tag_____IAllocator__, align 8
@top_____abandonFn__ = external dso_local thread_local global ptr, align 8

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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) #2

; Function Attrs: nounwind uwtable
declare dso_local { ptr, ptr } @TypeChecker__closeTag__(ptr, ptr, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @TypeChecker__closeTagArgs__(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.tag_____Tag__, align 8
  %12 = alloca %struct.tag_____Tag__, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %struct.tag_____Array__Tag____, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca %struct.tag_____Tag__, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %80, %3
  br label %28

28:                                               ; preds = %27
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %30, i32 0, i32 1
  %32 = load i32, ptr %31, align 8, !tbaa !11
  %33 = icmp slt i32 %29, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %28
  br label %81

35:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %36, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %37 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %37, ptr %10, align 4, !tbaa !9
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %39, i32 0, i32 1
  %41 = load i32, ptr %40, align 8, !tbaa !11
  %42 = icmp ult i32 %38, %41
  br i1 %42, label %46, label %43

43:                                               ; preds = %35
  %44 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  call void %45(i32 noundef -3)
  br label %46

46:                                               ; preds = %43, %35
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !13
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = getelementptr inbounds %struct.tag_____Tag__, ptr %49, i64 %51
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %52, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #4
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds { ptr, ptr }, ptr %11, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8
  %57 = getelementptr inbounds { ptr, ptr }, ptr %11, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8
  %59 = call { ptr, ptr } @TypeChecker__closeTag__(ptr %56, ptr %58, ptr noundef %53, ptr noundef %54)
  %60 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %61 = extractvalue { ptr, ptr } %59, 0
  store ptr %61, ptr %60, align 8
  %62 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %63 = extractvalue { ptr, ptr } %59, 1
  store ptr %63, ptr %62, align 8
  %64 = getelementptr inbounds { ptr, ptr }, ptr %11, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8
  %66 = getelementptr inbounds { ptr, ptr }, ptr %11, i32 0, i32 1
  %67 = load ptr, ptr %66, align 8
  %68 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8
  %70 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8
  %72 = call zeroext i8 @Tag__equals__(ptr %65, ptr %67, ptr %69, ptr %71)
  %73 = icmp ne i8 %72, 0
  br i1 %73, label %75, label %74

74:                                               ; preds = %46
  store i32 4, ptr %13, align 4
  br label %78

75:                                               ; preds = %46
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %8, align 4, !tbaa !9
  store i32 0, ptr %13, align 4
  br label %78

78:                                               ; preds = %75, %74
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %79 = load i32, ptr %13, align 4
  switch i32 %79, label %211 [
    i32 0, label %80
    i32 4, label %82
  ]

80:                                               ; preds = %78
  br label %27

81:                                               ; preds = %34
  br label %82

82:                                               ; preds = %81, %78
  %83 = load i32, ptr %8, align 4, !tbaa !9
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 8, !tbaa !11
  %87 = icmp eq i32 %83, %86
  br i1 %87, label %88, label %90

88:                                               ; preds = %82
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %89, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %211

90:                                               ; preds = %82
  %91 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %92 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %91, i32 0, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !15
  %94 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %95 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !17
  %97 = call ptr %93(ptr noundef %96, i64 noundef 16)
  store ptr %97, ptr %14, align 8, !tbaa !5
  %98 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #4
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %99, i32 0, i32 1
  %101 = load i32, ptr %100, align 8, !tbaa !11
  %102 = call { ptr, i32 } @Array__cons__Tag____(i32 noundef %101)
  %103 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 0
  %104 = extractvalue { ptr, i32 } %102, 0
  store ptr %104, ptr %103, align 8
  %105 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 1
  %106 = extractvalue { ptr, i32 } %102, 1
  store i32 %106, ptr %105, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %98, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #4
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %107, ptr %16, align 8, !tbaa !5
  %108 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %108, ptr %17, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %137, %90
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %8, align 4, !tbaa !9
  %112 = load i32, ptr %17, align 4, !tbaa !9
  %113 = icmp slt i32 %111, %112
  br i1 %113, label %115, label %114

114:                                              ; preds = %110
  br label %152

115:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %116 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %116, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %117 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %117, ptr %19, align 4, !tbaa !9
  %118 = load i32, ptr %19, align 4, !tbaa !9
  %119 = load ptr, ptr %18, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %119, i32 0, i32 1
  %121 = load i32, ptr %120, align 8, !tbaa !11
  %122 = icmp ult i32 %118, %121
  br i1 %122, label %126, label %123

123:                                              ; preds = %115
  %124 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %125 = load ptr, ptr %124, align 8, !tbaa !5
  call void %125(i32 noundef -3)
  br label %126

126:                                              ; preds = %123, %115
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %127, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %128 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %128, ptr %21, align 4, !tbaa !9
  %129 = load i32, ptr %21, align 4, !tbaa !9
  %130 = load ptr, ptr %20, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %130, i32 0, i32 1
  %132 = load i32, ptr %131, align 8, !tbaa !11
  %133 = icmp ult i32 %129, %132
  br i1 %133, label %137, label %134

134:                                              ; preds = %126
  %135 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %136 = load ptr, ptr %135, align 8, !tbaa !5
  call void %136(i32 noundef -3)
  br label %137

137:                                              ; preds = %134, %126
  %138 = load ptr, ptr %18, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !13
  %141 = load i32, ptr %19, align 4, !tbaa !9
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds %struct.tag_____Tag__, ptr %140, i64 %142
  %144 = load ptr, ptr %20, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %144, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8, !tbaa !13
  %147 = load i32, ptr %21, align 4, !tbaa !9
  %148 = zext i32 %147 to i64
  %149 = getelementptr inbounds %struct.tag_____Tag__, ptr %146, i64 %148
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %143, ptr align 8 %149, i64 16, i1 false), !tbaa.struct !14
  %150 = load i32, ptr %8, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %109

152:                                              ; preds = %114
  br label %153

153:                                              ; preds = %183, %152
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %8, align 4, !tbaa !9
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 8, !tbaa !11
  %159 = icmp slt i32 %155, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %154
  br label %209

161:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %162 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %162, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %163 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %163, ptr %23, align 4, !tbaa !9
  %164 = load i32, ptr %23, align 4, !tbaa !9
  %165 = load ptr, ptr %22, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %165, i32 0, i32 1
  %167 = load i32, ptr %166, align 8, !tbaa !11
  %168 = icmp ult i32 %164, %167
  br i1 %168, label %172, label %169

169:                                              ; preds = %161
  %170 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %171 = load ptr, ptr %170, align 8, !tbaa !5
  call void %171(i32 noundef -3)
  br label %172

172:                                              ; preds = %169, %161
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %173, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %174 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %174, ptr %25, align 4, !tbaa !9
  %175 = load i32, ptr %25, align 4, !tbaa !9
  %176 = load ptr, ptr %24, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %176, i32 0, i32 1
  %178 = load i32, ptr %177, align 8, !tbaa !11
  %179 = icmp ult i32 %175, %178
  br i1 %179, label %183, label %180

180:                                              ; preds = %172
  %181 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %182 = load ptr, ptr %181, align 8, !tbaa !5
  call void %182(i32 noundef -3)
  br label %183

183:                                              ; preds = %180, %172
  %184 = load ptr, ptr %22, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %184, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8, !tbaa !13
  %187 = load i32, ptr %23, align 4, !tbaa !9
  %188 = zext i32 %187 to i64
  %189 = getelementptr inbounds %struct.tag_____Tag__, ptr %186, i64 %188
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #4
  %190 = load ptr, ptr %24, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %190, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8, !tbaa !13
  %193 = load i32, ptr %25, align 4, !tbaa !9
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds %struct.tag_____Tag__, ptr %192, i64 %194
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = load ptr, ptr %7, align 8, !tbaa !5
  %198 = getelementptr inbounds { ptr, ptr }, ptr %195, i32 0, i32 0
  %199 = load ptr, ptr %198, align 8
  %200 = getelementptr inbounds { ptr, ptr }, ptr %195, i32 0, i32 1
  %201 = load ptr, ptr %200, align 8
  %202 = call { ptr, ptr } @TypeChecker__closeTag__(ptr %199, ptr %201, ptr noundef %196, ptr noundef %197)
  %203 = getelementptr inbounds { ptr, ptr }, ptr %26, i32 0, i32 0
  %204 = extractvalue { ptr, ptr } %202, 0
  store ptr %204, ptr %203, align 8
  %205 = getelementptr inbounds { ptr, ptr }, ptr %26, i32 0, i32 1
  %206 = extractvalue { ptr, ptr } %202, 1
  store ptr %206, ptr %205, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %189, ptr align 8 %26, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #4
  %207 = load i32, ptr %8, align 4, !tbaa !9
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  br label %153

209:                                              ; preds = %160
  %210 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %210, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %211

211:                                              ; preds = %209, %88, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %212 = load ptr, ptr %4, align 8
  ret ptr %212
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Tag__equals__(ptr, ptr, ptr, ptr) #3

; Function Attrs: nounwind uwtable
declare dso_local { ptr, i32 } @Array__cons__Tag____(i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"tag_____Array__Tag____", !6, i64 0, !10, i64 8}
!13 = !{!12, !6, i64 0}
!14 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!15 = !{!16, !6, i64 8}
!16 = !{!"tag_____IAllocator__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!16, !6, i64 0}
!18 = !{i64 0, i64 8, !5, i64 8, i64 4, !9}


; 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.tag_____IAllocator__ = type { ptr, ptr, ptr, ptr }
%struct.tag_____Tag__ = type { ptr, ptr }

@top_____currentAllocator__ = external dso_local thread_local local_unnamed_addr global %struct.tag_____IAllocator__, align 8
@top_____abandonFn__ = external dso_local thread_local local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #0

; Function Attrs: nounwind uwtable
declare dso_local { ptr, ptr } @TypeChecker__closeTag__(ptr, ptr, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local ptr @TypeChecker__closeTagArgs__(ptr noundef readonly %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  br label %5

5:                                                ; preds = %9, %3
  %indvars.iv = phi i64 [ %indvars.iv.next, %9 ], [ 0, %3 ]
  %6 = load i32, ptr %4, align 8, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = icmp slt i64 %indvars.iv, %7
  br i1 %8, label %9, label %split

9:                                                ; preds = %5
  %10 = load ptr, ptr %0, align 8, !tbaa !11
  %11 = getelementptr inbounds %struct.tag_____Tag__, ptr %10, i64 %indvars.iv
  %.sroa.026.0.copyload = load ptr, ptr %11, align 8, !tbaa !12
  %.sroa.528.0..sroa_idx = getelementptr inbounds i8, ptr %11, i64 8
  %.sroa.528.0.copyload = load ptr, ptr %.sroa.528.0..sroa_idx, align 8, !tbaa !12
  %12 = tail call { ptr, ptr } @TypeChecker__closeTag__(ptr %.sroa.026.0.copyload, ptr %.sroa.528.0.copyload, ptr noundef %1, ptr noundef %2)
  %13 = extractvalue { ptr, ptr } %12, 0
  %14 = extractvalue { ptr, ptr } %12, 1
  %15 = tail call zeroext i8 @Tag__equals__(ptr %.sroa.026.0.copyload, ptr %.sroa.528.0.copyload, ptr %13, ptr %14)
  %.not = icmp eq i8 %15, 0
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br i1 %.not, label %._crit_edge, label %5

._crit_edge:                                      ; preds = %9
  %.pre = load i32, ptr %4, align 8, !tbaa !5
  br label %split

split:                                            ; preds = %5, %._crit_edge
  %16 = phi i32 [ %.pre, %._crit_edge ], [ %6, %5 ]
  %17 = trunc i64 %indvars.iv to i32
  %18 = icmp eq i32 %16, %17
  br i1 %18, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %split
  %19 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %20 = getelementptr inbounds i8, ptr %19, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  %22 = load ptr, ptr %19, align 8, !tbaa !15
  %23 = tail call ptr %21(ptr noundef %22, i64 noundef 16) #2
  %24 = load i32, ptr %4, align 8, !tbaa !5
  %25 = tail call { ptr, i32 } @Array__cons__Tag____(i32 noundef %24)
  %26 = extractvalue { ptr, i32 } %25, 0
  %27 = extractvalue { ptr, i32 } %25, 1
  store ptr %26, ptr %23, align 8, !tbaa !12
  %.sroa.420.0..sroa_idx = getelementptr inbounds i8, ptr %23, i64 8
  store i32 %27, ptr %.sroa.420.0..sroa_idx, align 8, !tbaa !16
  %28 = load i32, ptr %4, align 8, !tbaa !5
  %29 = icmp sgt i32 %28, %17
  br i1 %29, label %.lr.ph65, label %.loopexit

.lr.ph65:                                         ; preds = %.preheader
  %30 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  br label %31

31:                                               ; preds = %.lr.ph65, %44
  %32 = phi i32 [ %28, %.lr.ph65 ], [ %55, %44 ]
  %indvars.iv67 = phi i64 [ %indvars.iv, %.lr.ph65 ], [ %indvars.iv.next68, %44 ]
  %33 = load i32, ptr %.sroa.420.0..sroa_idx, align 8, !tbaa !5
  %34 = zext i32 %33 to i64
  %35 = icmp ult i64 %indvars.iv67, %34
  br i1 %35, label %38, label %36

36:                                               ; preds = %31
  %37 = load ptr, ptr %30, align 8, !tbaa !12
  tail call void %37(i32 noundef -3) #2
  %.pre70 = load i32, ptr %4, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %36, %31
  %39 = phi i32 [ %.pre70, %36 ], [ %32, %31 ]
  %40 = zext i32 %39 to i64
  %41 = icmp ult i64 %indvars.iv67, %40
  br i1 %41, label %44, label %42

42:                                               ; preds = %38
  %43 = load ptr, ptr %30, align 8, !tbaa !12
  tail call void %43(i32 noundef -3) #2
  br label %44

44:                                               ; preds = %42, %38
  %45 = load ptr, ptr %23, align 8, !tbaa !11
  %46 = getelementptr inbounds %struct.tag_____Tag__, ptr %45, i64 %indvars.iv67
  %47 = load ptr, ptr %0, align 8, !tbaa !11
  %48 = getelementptr inbounds %struct.tag_____Tag__, ptr %47, i64 %indvars.iv67
  %49 = load ptr, ptr %48, align 8
  %50 = getelementptr inbounds i8, ptr %48, i64 8
  %51 = load ptr, ptr %50, align 8
  %52 = tail call { ptr, ptr } @TypeChecker__closeTag__(ptr %49, ptr %51, ptr noundef %1, ptr noundef %2)
  %53 = extractvalue { ptr, ptr } %52, 0
  %54 = extractvalue { ptr, ptr } %52, 1
  store ptr %53, ptr %46, align 8, !tbaa !12
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %46, i64 8
  store ptr %54, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !12
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %55 = load i32, ptr %4, align 8, !tbaa !5
  %56 = trunc nuw i64 %indvars.iv.next68 to i32
  %57 = icmp sgt i32 %55, %56
  br i1 %57, label %31, label %.loopexit

.loopexit:                                        ; preds = %44, %.preheader, %split
  %.0 = phi ptr [ %0, %split ], [ %23, %.preheader ], [ %23, %44 ]
  ret ptr %.0
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Tag__equals__(ptr, ptr, ptr, ptr) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local { ptr, i32 } @Array__cons__Tag____(i32 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { 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 8}
!6 = !{!"tag_____Array__Tag____", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !7, i64 8}
!14 = !{!"tag_____IAllocator__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!15 = !{!14, !7, i64 0}
!16 = !{!10, !10, i64 0}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass