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

; 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.string__ = type { ptr, i32 }
%struct.tag_____Error__ = type { ptr, %struct.tag_____IntRange__, %struct.string__ }
%struct.tag_____IntRange__ = type { i32, i32 }
%struct.tag_____ResolveResult__ = type { %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.Node__, i8 }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.Node__ = type { i32, ptr }
%struct.tag_____TypeCheckerContext__ = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i8 }
%struct.tag_____CommonTags__ = type { %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.tag_____Tag__, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.tag_____Array__Tag____ = type { ptr, i32 }
%struct.tag_____Namespace__ = type { %struct.string__, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }

@mu_____string203 = external dso_local global %struct.string__, align 8
@mu_____string202 = external dso_local global %struct.string__, 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: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; 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) #3

; Function Attrs: nounwind uwtable
declare dso_local void @List__add__Error____(ptr noundef, ptr noundef byval(%struct.tag_____Error__) align 8) #4

; Function Attrs: nounwind uwtable
declare dso_local void @Error__at__(ptr dead_on_unwind noalias writable sret(%struct.tag_____Error__) align 8, ptr noundef, i64, ptr, i32) #4

; Function Attrs: nounwind uwtable
declare dso_local i64 @RangeFinder__find__(i32, ptr) #4

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

; Function Attrs: nounwind uwtable
define dso_local void @TypeChecker__resolveIndex__(ptr dead_on_unwind noalias writable sret(%struct.tag_____ResolveResult__) align 8 %0, ptr noundef %1, i32 %2, ptr %3, i32 %4, ptr %5) #4 {
  %7 = alloca %struct.Node__, align 8
  %8 = alloca %struct.Node__, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.tag_____ResolveResult__, align 8
  %11 = alloca %struct.tag_____Tag__, align 8
  %12 = alloca %struct.tag_____Tag__, align 8
  %13 = alloca i8, align 1
  %14 = alloca %struct.tag_____Tag__, align 8
  %15 = alloca %struct.tag_____Tag__, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %struct.tag_____Tag__, align 8
  %19 = alloca i8, align 1
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %struct.tag_____Error__, align 8
  %25 = alloca %struct.tag_____IntRange__, align 4
  %26 = alloca %struct.tag_____Tag__, align 8
  %27 = alloca i8, align 1
  %28 = alloca %struct.tag_____Error__, align 8
  %29 = alloca %struct.tag_____IntRange__, align 4
  %30 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 0
  store i32 %2, ptr %30, align 8
  %31 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 1
  store ptr %3, ptr %31, align 8
  %32 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 0
  store i32 %4, ptr %32, align 8
  %33 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 1
  store ptr %5, ptr %33, align 8
  store ptr %1, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %10) #5
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 0
  %36 = load i32, ptr %35, align 8
  %37 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8
  call void @TypeChecker__resolveExpression__(ptr dead_on_unwind writable sret(%struct.tag_____ResolveResult__) align 8 %10, ptr noundef %34, i32 %36, ptr %38, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %11, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #5
  store i8 0, ptr %13, align 1, !tbaa !10
  %39 = getelementptr inbounds %struct.tag_____ResolveResult__, ptr %10, i32 0, i32 0
  %40 = getelementptr inbounds %struct.tag_____Tag__, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !11
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %176

43:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  %44 = getelementptr inbounds %struct.tag_____ResolveResult__, ptr %10, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %44, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  %45 = getelementptr inbounds %struct.tag_____Tag__, ptr %14, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !16
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %47, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !17
  %50 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %49, i32 0, i32 19
  %51 = load ptr, ptr %50, align 8, !tbaa !19
  %52 = icmp eq ptr %46, %51
  br i1 %52, label %53, label %71

53:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %54 = getelementptr inbounds %struct.tag_____Tag__, ptr %14, i32 0, i32 1
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  store ptr %55, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !22
  %56 = load i32, ptr %17, align 4, !tbaa !22
  %57 = load ptr, ptr %16, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 8, !tbaa !23
  %60 = icmp ult i32 %56, %59
  br i1 %60, label %64, label %61

61:                                               ; preds = %53
  %62 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  call void %63(i32 noundef -3)
  br label %64

64:                                               ; preds = %61, %53
  %65 = load ptr, ptr %16, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !25
  %68 = load i32, ptr %17, align 4, !tbaa !22
  %69 = zext i32 %68 to i64
  %70 = getelementptr inbounds %struct.tag_____Tag__, ptr %67, i64 %69
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %70, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %72

71:                                               ; preds = %43
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %14, i64 16, i1 false), !tbaa.struct !9
  br label %72

72:                                               ; preds = %71, %64
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %15, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  %73 = getelementptr inbounds %struct.tag_____Tag__, ptr %18, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !16
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %75, i32 0, i32 4
  %77 = load ptr, ptr %76, align 8, !tbaa !17
  %78 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %77, i32 0, i32 21
  %79 = load ptr, ptr %78, align 8, !tbaa !26
  %80 = icmp eq ptr %74, %79
  %81 = zext i1 %80 to i32
  %82 = trunc i32 %81 to i8
  store i8 %82, ptr %19, align 1, !tbaa !10
  %83 = load i8, ptr %19, align 1, !tbaa !10
  %84 = icmp ne i8 %83, 0
  br i1 %84, label %96, label %85

85:                                               ; preds = %72
  %86 = getelementptr inbounds %struct.tag_____Tag__, ptr %18, i32 0, i32 0
  %87 = load ptr, ptr %86, align 8, !tbaa !16
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %88, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !17
  %91 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %90, i32 0, i32 22
  %92 = load ptr, ptr %91, align 8, !tbaa !27
  %93 = icmp eq ptr %87, %92
  %94 = zext i1 %93 to i32
  %95 = trunc i32 %94 to i8
  store i8 %95, ptr %19, align 1, !tbaa !10
  br label %96

96:                                               ; preds = %85, %72
  %97 = load i8, ptr %19, align 1, !tbaa !10
  %98 = icmp ne i8 %97, 0
  br i1 %98, label %99, label %117

99:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %100 = getelementptr inbounds %struct.tag_____Tag__, ptr %18, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !21
  store ptr %101, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 0, ptr %21, align 4, !tbaa !22
  %102 = load i32, ptr %21, align 4, !tbaa !22
  %103 = load ptr, ptr %20, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 8, !tbaa !23
  %106 = icmp ult i32 %102, %105
  br i1 %106, label %110, label %107

107:                                              ; preds = %99
  %108 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  call void %109(i32 noundef -3)
  br label %110

110:                                              ; preds = %107, %99
  %111 = load ptr, ptr %20, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %111, i32 0, i32 0
  %113 = load ptr, ptr %112, align 8, !tbaa !25
  %114 = load i32, ptr %21, align 4, !tbaa !22
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds %struct.tag_____Tag__, ptr %113, i64 %115
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %116, i64 16, i1 false), !tbaa.struct !9
  store i8 1, ptr %13, align 1, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %175

117:                                              ; preds = %96
  %118 = getelementptr inbounds %struct.tag_____ResolveResult__, ptr %10, i32 0, i32 0
  %119 = getelementptr inbounds %struct.tag_____Tag__, ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !11
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %121, i32 0, i32 4
  %123 = load ptr, ptr %122, align 8, !tbaa !17
  %124 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %123, i32 0, i32 16
  %125 = getelementptr inbounds %struct.tag_____Tag__, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !28
  %127 = icmp eq ptr %120, %126
  br i1 %127, label %128, label %133

128:                                              ; preds = %117
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %129, i32 0, i32 4
  %131 = load ptr, ptr %130, align 8, !tbaa !17
  %132 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %131, i32 0, i32 15
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %132, i64 16, i1 false), !tbaa.struct !9
  br label %174

133:                                              ; preds = %117
  %134 = getelementptr inbounds %struct.tag_____Tag__, ptr %18, i32 0, i32 0
  %135 = load ptr, ptr %134, align 8, !tbaa !16
  %136 = getelementptr inbounds %struct.tag_____Namespace__, ptr %135, i32 0, i32 3
  %137 = load i32, ptr %136, align 4, !tbaa !29
  %138 = and i32 %137, 1024
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %158

140:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %141 = getelementptr inbounds %struct.tag_____Tag__, ptr %18, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8, !tbaa !21
  store ptr %142, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  store i32 0, ptr %23, align 4, !tbaa !22
  %143 = load i32, ptr %23, align 4, !tbaa !22
  %144 = load ptr, ptr %22, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %144, i32 0, i32 1
  %146 = load i32, ptr %145, align 8, !tbaa !23
  %147 = icmp ult i32 %143, %146
  br i1 %147, label %151, label %148

148:                                              ; preds = %140
  %149 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %150 = load ptr, ptr %149, align 8, !tbaa !5
  call void %150(i32 noundef -3)
  br label %151

151:                                              ; preds = %148, %140
  %152 = load ptr, ptr %22, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !25
  %155 = load i32, ptr %23, align 4, !tbaa !22
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds %struct.tag_____Tag__, ptr %154, i64 %156
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %157, i64 16, i1 false), !tbaa.struct !9
  store i8 1, ptr %13, align 1, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  br label %173

158:                                              ; preds = %133
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %159, i32 0, i32 2
  %161 = load ptr, ptr %160, align 8, !tbaa !32
  %162 = load ptr, ptr %9, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %162, i32 0, i32 5
  %164 = load ptr, ptr %163, align 8, !tbaa !33
  %165 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 0
  %166 = load i32, ptr %165, align 8
  %167 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 1
  %168 = load ptr, ptr %167, align 8
  %169 = call i64 @RangeFinder__find__(i32 %166, ptr %168)
  store i64 %169, ptr %25, align 4
  %170 = load i64, ptr %25, align 4
  %171 = load ptr, ptr @mu_____string202, align 8
  %172 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string202, i32 0, i32 1), align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %24, ptr noundef %164, i64 %170, ptr %171, i32 %172)
  call void @List__add__Error____(ptr noundef %161, ptr noundef byval(%struct.tag_____Error__) align 8 %24)
  br label %173

173:                                              ; preds = %158, %151
  br label %174

174:                                              ; preds = %173, %128
  br label %175

175:                                              ; preds = %174, %110
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  br label %176

176:                                              ; preds = %175, %6
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #5
  %177 = load ptr, ptr %9, align 8, !tbaa !5
  %178 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 0
  %179 = load i32, ptr %178, align 8
  %180 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 1
  %181 = load ptr, ptr %180, align 8
  %182 = call { ptr, ptr } @TypeChecker__checkExpression__(ptr noundef %177, i32 %179, ptr %181)
  %183 = getelementptr inbounds { ptr, ptr }, ptr %26, i32 0, i32 0
  %184 = extractvalue { ptr, ptr } %182, 0
  store ptr %184, ptr %183, align 8
  %185 = getelementptr inbounds { ptr, ptr }, ptr %26, i32 0, i32 1
  %186 = extractvalue { ptr, ptr } %182, 1
  store ptr %186, ptr %185, align 8
  %187 = getelementptr inbounds %struct.tag_____Tag__, ptr %26, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !16
  %189 = icmp ne ptr %188, null
  br i1 %189, label %190, label %228

190:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #5
  %191 = getelementptr inbounds %struct.tag_____Tag__, ptr %26, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8, !tbaa !16
  %193 = getelementptr inbounds %struct.tag_____Namespace__, ptr %192, i32 0, i32 3
  %194 = load i32, ptr %193, align 4, !tbaa !29
  %195 = and i32 %194, 1
  %196 = icmp eq i32 %195, 0
  %197 = zext i1 %196 to i32
  %198 = trunc i32 %197 to i8
  store i8 %198, ptr %27, align 1, !tbaa !10
  %199 = load i8, ptr %27, align 1, !tbaa !10
  %200 = icmp ne i8 %199, 0
  br i1 %200, label %209, label %201

201:                                              ; preds = %190
  %202 = getelementptr inbounds %struct.tag_____Tag__, ptr %26, i32 0, i32 0
  %203 = load ptr, ptr %202, align 8, !tbaa !16
  %204 = getelementptr inbounds %struct.tag_____Namespace__, ptr %203, i32 0, i32 13
  %205 = load i32, ptr %204, align 8, !tbaa !34
  %206 = icmp sgt i32 %205, 4
  %207 = zext i1 %206 to i32
  %208 = trunc i32 %207 to i8
  store i8 %208, ptr %27, align 1, !tbaa !10
  br label %209

209:                                              ; preds = %201, %190
  %210 = load i8, ptr %27, align 1, !tbaa !10
  %211 = icmp ne i8 %210, 0
  br i1 %211, label %212, label %227

212:                                              ; preds = %209
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %213, i32 0, i32 2
  %215 = load ptr, ptr %214, align 8, !tbaa !32
  %216 = load ptr, ptr %9, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %216, i32 0, i32 5
  %218 = load ptr, ptr %217, align 8, !tbaa !33
  %219 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 0
  %220 = load i32, ptr %219, align 8
  %221 = getelementptr inbounds { i32, ptr }, ptr %8, i32 0, i32 1
  %222 = load ptr, ptr %221, align 8
  %223 = call i64 @RangeFinder__find__(i32 %220, ptr %222)
  store i64 %223, ptr %29, align 4
  %224 = load i64, ptr %29, align 4
  %225 = load ptr, ptr @mu_____string203, align 8
  %226 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string203, i32 0, i32 1), align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %28, ptr noundef %218, i64 %224, ptr %225, i32 %226)
  call void @List__add__Error____(ptr noundef %215, ptr noundef byval(%struct.tag_____Error__) align 8 %28)
  br label %227

227:                                              ; preds = %212, %209
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #5
  br label %228

228:                                              ; preds = %227, %176
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 56, i1 false)
  %229 = getelementptr inbounds %struct.tag_____ResolveResult__, ptr %0, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %229, ptr align 8 %12, i64 16, i1 false), !tbaa.struct !9
  %230 = load i8, ptr %13, align 1, !tbaa !10
  %231 = getelementptr inbounds %struct.tag_____ResolveResult__, ptr %0, i32 0, i32 3
  store i8 %230, ptr %231, align 8, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %10) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @TypeChecker__resolveExpression__(ptr dead_on_unwind noalias writable sret(%struct.tag_____ResolveResult__) align 8, ptr noundef, i32, ptr, i32 noundef) #4

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: write) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"tag_____ResolveResult__", !13, i64 0, !13, i64 16, !14, i64 32, !7, i64 48}
!13 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!14 = !{!"", !15, i64 0, !6, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!13, !6, i64 0}
!17 = !{!18, !6, i64 32}
!18 = !{!"tag_____TypeCheckerContext__", !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, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !15, i64 120, !15, i64 124, !6, i64 128, !15, i64 136, !7, i64 140}
!19 = !{!20, !6, i64 304}
!20 = !{!"tag_____CommonTags__", !13, i64 0, !13, i64 16, !13, i64 32, !13, i64 48, !13, i64 64, !13, i64 80, !13, i64 96, !13, i64 112, !13, i64 128, !13, i64 144, !13, i64 160, !13, i64 176, !13, i64 192, !13, i64 208, !13, i64 224, !13, i64 240, !13, i64 256, !13, i64 272, !13, i64 288, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376}
!21 = !{!13, !6, i64 8}
!22 = !{!15, !15, i64 0}
!23 = !{!24, !15, i64 8}
!24 = !{!"tag_____Array__Tag____", !6, i64 0, !15, i64 8}
!25 = !{!24, !6, i64 0}
!26 = !{!20, !6, i64 320}
!27 = !{!20, !6, i64 328}
!28 = !{!20, !6, i64 256}
!29 = !{!30, !15, i64 28}
!30 = !{!"tag_____Namespace__", !31, i64 0, !6, i64 16, !15, i64 24, !15, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !15, i64 104}
!31 = !{!"", !6, i64 0, !15, i64 8}
!32 = !{!18, !6, i64 16}
!33 = !{!18, !6, i64 40}
!34 = !{!30, !15, i64 104}
!35 = !{!12, !7, i64 48}


; 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.string__ = type { ptr, i32 }
%struct.tag_____Error__ = type { ptr, %struct.tag_____IntRange__, %struct.string__ }
%struct.tag_____IntRange__ = type { i32, i32 }
%struct.tag_____ResolveResult__ = type { %struct.tag_____Tag__, %struct.tag_____Tag__, %struct.Node__, i8 }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.Node__ = type { i32, ptr }

@mu_____string203 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string202 = external dso_local local_unnamed_addr global %struct.string__, align 8
@top_____abandonFn__ = external dso_local thread_local local_unnamed_addr global ptr, align 8

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; 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) #3

; Function Attrs: nounwind uwtable
declare dso_local void @List__add__Error____(ptr noundef, ptr noundef byval(%struct.tag_____Error__) align 8) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @Error__at__(ptr dead_on_unwind noalias writable sret(%struct.tag_____Error__) align 8, ptr noundef, i64, ptr, i32) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i64 @RangeFinder__find__(i32, ptr) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local void @TypeChecker__resolveIndex__(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.tag_____ResolveResult__) align 8 %0, ptr noundef %1, i32 %2, ptr %3, i32 %4, ptr %5) local_unnamed_addr #4 {
  %7 = alloca %struct.tag_____ResolveResult__, align 8
  %8 = alloca %struct.tag_____Tag__, align 8
  %9 = alloca %struct.tag_____Error__, align 8
  %10 = alloca %struct.tag_____Error__, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #5
  call void @TypeChecker__resolveExpression__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____ResolveResult__) align 8 %7, ptr noundef %1, i32 %2, ptr %3, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, i8 0, i64 16, i1 false)
  %11 = load ptr, ptr %7, align 8, !tbaa !5
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %68, label %12

12:                                               ; preds = %6
  %.sroa.529.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  %.sroa.529.0.copyload = load ptr, ptr %.sroa.529.0..sroa_idx, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 32
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %14, i64 304
  %16 = load ptr, ptr %15, align 8, !tbaa !12
  %17 = icmp eq ptr %11, %16
  br i1 %17, label %18, label %26

18:                                               ; preds = %12
  %19 = getelementptr inbounds i8, ptr %.sroa.529.0.copyload, i64 8
  %20 = load i32, ptr %19, align 8, !tbaa !15
  %.not55 = icmp eq i32 %20, 0
  br i1 %.not55, label %21, label %24

21:                                               ; preds = %18
  %22 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  call void %23(i32 noundef -3) #5
  %.pre.pre = load ptr, ptr %13, align 8, !tbaa !9
  br label %24

24:                                               ; preds = %21, %18
  %.pre = phi ptr [ %.pre.pre, %21 ], [ %14, %18 ]
  %25 = load ptr, ptr %.sroa.529.0.copyload, align 8, !tbaa !17
  %.sroa.024.0.copyload = load ptr, ptr %25, align 8, !tbaa !5
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %25, i64 8
  %.sroa.5.0.copyload = load ptr, ptr %.sroa.5.0..sroa_idx, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %12, %24
  %27 = phi ptr [ %.pre, %24 ], [ %14, %12 ]
  %.sroa.024.0 = phi ptr [ %.sroa.024.0.copyload, %24 ], [ %11, %12 ]
  %.sroa.5.0 = phi ptr [ %.sroa.5.0.copyload, %24 ], [ %.sroa.529.0.copyload, %12 ]
  %28 = getelementptr inbounds i8, ptr %27, i64 320
  %29 = load ptr, ptr %28, align 8, !tbaa !18
  %30 = icmp eq ptr %.sroa.024.0, %29
  br i1 %30, label %.critedge, label %31

31:                                               ; preds = %26
  %32 = getelementptr inbounds i8, ptr %27, i64 328
  %33 = load ptr, ptr %32, align 8, !tbaa !19
  %.not65 = icmp eq ptr %.sroa.024.0, %33
  br i1 %.not65, label %.critedge, label %41

.critedge:                                        ; preds = %26, %31
  %34 = getelementptr inbounds i8, ptr %.sroa.5.0, i64 8
  %35 = load i32, ptr %34, align 8, !tbaa !15
  %.not59 = icmp eq i32 %35, 0
  br i1 %.not59, label %36, label %39

36:                                               ; preds = %.critedge
  %37 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  call void %38(i32 noundef -3) #5
  br label %39

39:                                               ; preds = %36, %.critedge
  %40 = load ptr, ptr %.sroa.5.0, align 8, !tbaa !17
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %40, i64 16, i1 false), !tbaa.struct !20
  br label %68

41:                                               ; preds = %31
  %42 = load ptr, ptr %7, align 8, !tbaa !21
  %43 = getelementptr inbounds i8, ptr %27, i64 256
  %44 = load ptr, ptr %43, align 8, !tbaa !24
  %45 = icmp eq ptr %42, %44
  br i1 %45, label %46, label %48

46:                                               ; preds = %41
  %47 = getelementptr inbounds i8, ptr %27, i64 240
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %47, i64 16, i1 false), !tbaa.struct !20
  br label %68

48:                                               ; preds = %41
  %49 = getelementptr inbounds i8, ptr %.sroa.024.0, i64 28
  %50 = load i32, ptr %49, align 4, !tbaa !25
  %51 = and i32 %50, 1024
  %.not57 = icmp eq i32 %51, 0
  br i1 %.not57, label %60, label %52

52:                                               ; preds = %48
  %53 = getelementptr inbounds i8, ptr %.sroa.5.0, i64 8
  %54 = load i32, ptr %53, align 8, !tbaa !15
  %.not58 = icmp eq i32 %54, 0
  br i1 %.not58, label %55, label %58

55:                                               ; preds = %52
  %56 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %57 = load ptr, ptr %56, align 8, !tbaa !5
  call void %57(i32 noundef -3) #5
  br label %58

58:                                               ; preds = %55, %52
  %59 = load ptr, ptr %.sroa.5.0, align 8, !tbaa !17
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %59, i64 16, i1 false), !tbaa.struct !20
  br label %68

60:                                               ; preds = %48
  %61 = getelementptr inbounds i8, ptr %1, i64 16
  %62 = load ptr, ptr %61, align 8, !tbaa !28
  %63 = getelementptr inbounds i8, ptr %1, i64 40
  %64 = load ptr, ptr %63, align 8, !tbaa !29
  %65 = call i64 @RangeFinder__find__(i32 %2, ptr %3)
  %66 = load ptr, ptr @mu_____string202, align 8
  %67 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string202, i64 8), align 8
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %9, ptr noundef %64, i64 %65, ptr %66, i32 %67)
  call void @List__add__Error____(ptr noundef %62, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %9)
  br label %68

68:                                               ; preds = %39, %58, %60, %46, %6
  %.1 = phi i8 [ 0, %6 ], [ 1, %39 ], [ 0, %46 ], [ 1, %58 ], [ 0, %60 ]
  %69 = call { ptr, ptr } @TypeChecker__checkExpression__(ptr noundef %1, i32 %4, ptr %5)
  %70 = extractvalue { ptr, ptr } %69, 0
  %.not60 = icmp eq ptr %70, null
  br i1 %.not60, label %86, label %71

71:                                               ; preds = %68
  %72 = getelementptr inbounds i8, ptr %70, i64 28
  %73 = load i32, ptr %72, align 4, !tbaa !25
  %74 = and i32 %73, 1
  %.not61.not = icmp eq i32 %74, 0
  br i1 %.not61.not, label %.critedge64, label %75

75:                                               ; preds = %71
  %76 = getelementptr inbounds i8, ptr %70, i64 104
  %77 = load i32, ptr %76, align 8, !tbaa !30
  %78 = icmp slt i32 %77, 5
  br i1 %78, label %86, label %.critedge64

.critedge64:                                      ; preds = %71, %75
  %79 = getelementptr inbounds i8, ptr %1, i64 16
  %80 = load ptr, ptr %79, align 8, !tbaa !28
  %81 = getelementptr inbounds i8, ptr %1, i64 40
  %82 = load ptr, ptr %81, align 8, !tbaa !29
  %83 = call i64 @RangeFinder__find__(i32 %4, ptr %5)
  %84 = load ptr, ptr @mu_____string203, align 8
  %85 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string203, i64 8), align 8
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %10, ptr noundef %82, i64 %83, ptr %84, i32 %85)
  call void @List__add__Error____(ptr noundef %80, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %10)
  br label %86

86:                                               ; preds = %75, %.critedge64, %68
  %87 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %87, i8 0, i64 40, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %8, i64 16, i1 false), !tbaa.struct !20
  %88 = getelementptr inbounds i8, ptr %0, i64 48
  store i8 %.1, ptr %88, align 8, !tbaa !31
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8)
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @TypeChecker__resolveExpression__(ptr dead_on_unwind noalias writable sret(%struct.tag_____ResolveResult__) align 8, ptr noundef, i32, ptr, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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, !6, i64 32}
!10 = !{!"tag_____TypeCheckerContext__", !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, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !11, i64 120, !11, i64 124, !6, i64 128, !11, i64 136, !7, i64 140}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 304}
!13 = !{!"tag_____CommonTags__", !14, i64 0, !14, i64 16, !14, i64 32, !14, i64 48, !14, i64 64, !14, i64 80, !14, i64 96, !14, i64 112, !14, i64 128, !14, i64 144, !14, i64 160, !14, i64 176, !14, i64 192, !14, i64 208, !14, i64 224, !14, i64 240, !14, i64 256, !14, i64 272, !14, i64 288, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376}
!14 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!15 = !{!16, !11, i64 8}
!16 = !{!"tag_____Array__Tag____", !6, i64 0, !11, i64 8}
!17 = !{!16, !6, i64 0}
!18 = !{!13, !6, i64 320}
!19 = !{!13, !6, i64 328}
!20 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!21 = !{!22, !6, i64 0}
!22 = !{!"tag_____ResolveResult__", !14, i64 0, !14, i64 16, !23, i64 32, !7, i64 48}
!23 = !{!"", !11, i64 0, !6, i64 8}
!24 = !{!13, !6, i64 256}
!25 = !{!26, !11, i64 28}
!26 = !{!"tag_____Namespace__", !27, i64 0, !6, i64 16, !11, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !11, i64 104}
!27 = !{!"", !6, i64 0, !11, i64 8}
!28 = !{!10, !6, i64 16}
!29 = !{!10, !6, i64 40}
!30 = !{!26, !11, i64 104}
!31 = !{!22, !7, i64 48}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass