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

; 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_____IAllocator__ = type { ptr, ptr, ptr, ptr }
%struct.tag_____Error__ = type { ptr, %struct.tag_____IntRange__, %struct.string__ }
%struct.tag_____IntRange__ = type { i32, i32 }
%struct.tag_____Set__Tag____ = type { %struct.tag_____Array__SetEntry__Tag______, i32, i32, i32 }
%struct.tag_____Array__SetEntry__Tag______ = type { ptr, i32 }
%struct.Node__ = type { i32, ptr }
%struct.tag_____Tag__ = type { ptr, ptr }
%struct.tag_____StringBuilder__ = type { ptr, i32, i32 }
%struct.tag_____NamespaceDef__ = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr }
%struct.tag_____List__Node____ = type { ptr, i32, i32 }
%struct.tag_____TaggedPointerOptionDef__ = type { %struct.Node__ }
%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_____Namespace__ = type { %struct.string__, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }

@mu_____string172 = external dso_local global %struct.string__, align 8
@top_____currentAllocator__ = external dso_local thread_local global %struct.tag_____IAllocator__, align 8
@top_____abandonFn__ = external dso_local thread_local global ptr, align 8
@__const.TypeChecker__checkTaggedPointerOptions__.local5 = external hidden unnamed_addr constant %struct.string__, 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 @StringBuilder__write__(ptr noundef, ptr, i32) #4

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

; 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, i32 } @Tag__toString__(ptr, ptr) #4

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

; Function Attrs: nounwind uwtable
define dso_local void @TypeChecker__checkTaggedPointerOptions__(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.tag_____Set__Tag____, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %struct.Node__, align 8
  %11 = alloca ptr, align 8
  %12 = alloca %struct.tag_____Tag__, align 8
  %13 = alloca %struct.tag_____StringBuilder__, align 8
  %14 = alloca %struct.string__, align 8
  %15 = alloca %struct.string__, align 8
  %16 = alloca %struct.tag_____Error__, align 8
  %17 = alloca %struct.tag_____IntRange__, align 4
  %18 = alloca %struct.string__, align 8
  %19 = alloca %struct.tag_____Error__, align 8
  %20 = alloca %struct.tag_____IntRange__, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %21 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %22 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %25 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %24, i32 0, i32 0
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = call ptr %23(ptr noundef %26, i64 noundef 32)
  store ptr %27, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #5
  call void @Set__create__Tag____(ptr dead_on_unwind writable sret(%struct.tag_____Set__Tag____) align 8 %6)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %6, i64 32, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %29, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.tag_____NamespaceDef__, ptr %30, i32 0, i32 7
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  store ptr %32, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !13
  br label %33

33:                                               ; preds = %148, %2
  %34 = load i32, ptr %9, align 4, !tbaa !13
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.tag_____List__Node____, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !17
  %38 = icmp slt i32 %34, %37
  br i1 %38, label %39, label %151

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.tag_____List__Node____, ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = load i32, ptr %9, align 4, !tbaa !13
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %struct.Node__, ptr %42, i64 %44
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 %45, i64 16, i1 false), !tbaa.struct !20
  %46 = getelementptr inbounds %struct.Node__, ptr %10, i32 0, i32 0
  %47 = load i32, ptr %46, align 8, !tbaa !21
  switch i32 %47, label %144 [
    i32 2, label %48
    i32 0, label %145
  ]

48:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %49 = getelementptr inbounds %struct.Node__, ptr %10, i32 0, i32 1
  %50 = load ptr, ptr %49, align 8, !tbaa !23
  store ptr %50, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #5
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.tag_____TaggedPointerOptionDef__, ptr %52, i32 0, i32 0
  %54 = getelementptr inbounds { i32, ptr }, ptr %53, i32 0, i32 0
  %55 = load i32, ptr %54, align 8
  %56 = getelementptr inbounds { i32, ptr }, ptr %53, i32 0, i32 1
  %57 = load ptr, ptr %56, align 8
  %58 = call { ptr, ptr } @TypeChecker__resolveType__(ptr noundef %51, i32 %55, ptr %57, i32 noundef 0)
  %59 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %60 = extractvalue { ptr, ptr } %58, 0
  store ptr %60, ptr %59, align 8
  %61 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %62 = extractvalue { ptr, ptr } %58, 1
  store ptr %62, ptr %61, align 8
  %63 = getelementptr inbounds %struct.tag_____Tag__, ptr %12, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !24
  %65 = icmp ne ptr %64, null
  br i1 %65, label %66, label %143

66:                                               ; preds = %48
  %67 = getelementptr inbounds %struct.tag_____Tag__, ptr %12, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !24
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %69, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !26
  %72 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %71, i32 0, i32 19
  %73 = load ptr, ptr %72, align 8, !tbaa !28
  %74 = icmp eq ptr %68, %73
  br i1 %74, label %75, label %125

75:                                               ; preds = %66
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8
  %79 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %80 = load ptr, ptr %79, align 8
  %81 = call zeroext i8 @Set__tryAdd__Tag____(ptr noundef %76, ptr %78, ptr %80)
  %82 = icmp ne i8 %81, 0
  br i1 %82, label %124, label %83

83:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 @__const.TypeChecker__checkTaggedPointerOptions__.local5, i64 16, i1 false)
  %84 = getelementptr inbounds { ptr, i32 }, ptr %14, i32 0, i32 0
  %85 = load ptr, ptr %84, align 8
  %86 = getelementptr inbounds { ptr, i32 }, ptr %14, i32 0, i32 1
  %87 = load i32, ptr %86, align 8
  call void @StringBuilder__write__(ptr noundef %13, ptr %85, i32 %87)
  %88 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8
  %90 = getelementptr inbounds { ptr, ptr }, ptr %12, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8
  %92 = call { ptr, i32 } @Tag__toString__(ptr %89, ptr %91)
  %93 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 0
  %94 = extractvalue { ptr, i32 } %92, 0
  store ptr %94, ptr %93, align 8
  %95 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 1
  %96 = extractvalue { ptr, i32 } %92, 1
  store i32 %96, ptr %95, align 8
  %97 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8
  %99 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 1
  %100 = load i32, ptr %99, align 8
  call void @StringBuilder__write__(ptr noundef %13, ptr %98, i32 %100)
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !30
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.tag_____NamespaceDef__, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !31
  %107 = load ptr, ptr %11, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.tag_____TaggedPointerOptionDef__, ptr %107, i32 0, i32 0
  %109 = getelementptr inbounds { i32, ptr }, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8
  %111 = getelementptr inbounds { i32, ptr }, ptr %108, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8
  %113 = call i64 @RangeFinder__find__(i32 %110, ptr %112)
  store i64 %113, ptr %17, align 4
  %114 = call { ptr, i32 } @StringBuilder__compactToString__(ptr noundef %13)
  %115 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 0
  %116 = extractvalue { ptr, i32 } %114, 0
  store ptr %116, ptr %115, align 8
  %117 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 1
  %118 = extractvalue { ptr, i32 } %114, 1
  store i32 %118, ptr %117, align 8
  %119 = load i64, ptr %17, align 4
  %120 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8
  %122 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 1
  %123 = load i32, ptr %122, align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %16, ptr noundef %106, i64 %119, ptr %121, i32 %123)
  call void @List__add__Error____(ptr noundef %103, ptr noundef byval(%struct.tag_____Error__) align 8 %16)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  br label %124

124:                                              ; preds = %83, %75
  br label %142

125:                                              ; preds = %66
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !30
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.tag_____NamespaceDef__, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !31
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.tag_____TaggedPointerOptionDef__, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds { i32, ptr }, ptr %133, i32 0, i32 0
  %135 = load i32, ptr %134, align 8
  %136 = getelementptr inbounds { i32, ptr }, ptr %133, i32 0, i32 1
  %137 = load ptr, ptr %136, align 8
  %138 = call i64 @RangeFinder__find__(i32 %135, ptr %137)
  store i64 %138, ptr %20, align 4
  %139 = load i64, ptr %20, align 4
  %140 = load ptr, ptr @mu_____string172, align 8
  %141 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string172, i32 0, i32 1), align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %19, ptr noundef %131, i64 %139, ptr %140, i32 %141)
  call void @List__add__Error____(ptr noundef %128, ptr noundef byval(%struct.tag_____Error__) align 8 %19)
  br label %142

142:                                              ; preds = %125, %124
  br label %143

143:                                              ; preds = %142, %48
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %148

144:                                              ; preds = %39
  br label %148

145:                                              ; preds = %39
  %146 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %147 = load ptr, ptr %146, align 8, !tbaa !5
  call void %147(i32 noundef -5)
  br label %148

148:                                              ; preds = %145, %144, %143
  %149 = load i32, ptr %9, align 4, !tbaa !13
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %33, !llvm.loop !32

151:                                              ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.tag_____NamespaceDef__, ptr %153, i32 0, i32 10
  %155 = load ptr, ptr %154, align 8, !tbaa !34
  %156 = getelementptr inbounds %struct.tag_____Namespace__, ptr %155, i32 0, i32 8
  store ptr %152, ptr %156, align 8, !tbaa !35
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Set__tryAdd__Tag____(ptr noundef, ptr, ptr) #4

; Function Attrs: nounwind uwtable
declare dso_local void @Set__create__Tag____(ptr dead_on_unwind noalias writable sret(%struct.tag_____Set__Tag____) align 8) #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 = !{!10, !6, i64 8}
!10 = !{!"tag_____IAllocator__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!11 = !{!10, !6, i64 0}
!12 = !{i64 0, i64 8, !5, i64 8, i64 4, !13, i64 16, i64 4, !13, i64 20, i64 4, !13, i64 24, i64 4, !13}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !6, i64 56}
!16 = !{!"tag_____NamespaceDef__", !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, !14, i64 72, !6, i64 80}
!17 = !{!18, !14, i64 8}
!18 = !{!"tag_____List__Node____", !6, i64 0, !14, i64 8, !14, i64 12}
!19 = !{!18, !6, i64 0}
!20 = !{i64 0, i64 4, !13, i64 8, i64 8, !5}
!21 = !{!22, !14, i64 0}
!22 = !{!"", !14, i64 0, !6, i64 8}
!23 = !{!22, !6, i64 8}
!24 = !{!25, !6, i64 0}
!25 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!26 = !{!27, !6, i64 32}
!27 = !{!"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, !14, i64 120, !14, i64 124, !6, i64 128, !14, i64 136, !7, i64 140}
!28 = !{!29, !6, i64 304}
!29 = !{!"tag_____CommonTags__", !25, i64 0, !25, i64 16, !25, i64 32, !25, i64 48, !25, i64 64, !25, i64 80, !25, i64 96, !25, i64 112, !25, i64 128, !25, i64 144, !25, i64 160, !25, i64 176, !25, i64 192, !25, i64 208, !25, i64 224, !25, i64 240, !25, i64 256, !25, i64 272, !25, 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}
!30 = !{!27, !6, i64 16}
!31 = !{!16, !6, i64 0}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!16, !6, i64 80}
!35 = !{!36, !6, i64 64}
!36 = !{!"tag_____Namespace__", !37, i64 0, !6, i64 16, !14, i64 24, !14, 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, !14, i64 104}
!37 = !{!"", !6, i64 0, !14, i64 8}


; 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_____IAllocator__ = type { ptr, ptr, ptr, ptr }
%struct.tag_____Error__ = type { ptr, %struct.tag_____IntRange__, %struct.string__ }
%struct.tag_____IntRange__ = type { i32, i32 }
%struct.tag_____Set__Tag____ = type { %struct.tag_____Array__SetEntry__Tag______, i32, i32, i32 }
%struct.tag_____Array__SetEntry__Tag______ = type { ptr, i32 }
%struct.tag_____StringBuilder__ = type { ptr, i32, i32 }
%struct.Node__ = type { i32, ptr }

@mu_____string172 = external dso_local local_unnamed_addr global %struct.string__, align 8
@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
@__const.TypeChecker__checkTaggedPointerOptions__.local5 = external hidden unnamed_addr constant %struct.string__, 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 @StringBuilder__write__(ptr noundef, ptr, i32) local_unnamed_addr #4

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

; 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, i32 } @Tag__toString__(ptr, ptr) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
define dso_local void @TypeChecker__checkTaggedPointerOptions__(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #4 {
  %3 = alloca %struct.tag_____Set__Tag____, align 8
  %4 = alloca %struct.tag_____StringBuilder__, align 8
  %5 = alloca %struct.tag_____Error__, align 8
  %6 = alloca %struct.tag_____Error__, align 8
  %7 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %8 = getelementptr inbounds i8, ptr %7, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = load ptr, ptr %7, align 8, !tbaa !10
  %11 = tail call ptr %9(ptr noundef %10, i64 noundef 32) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @Set__create__Tag____(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Set__Tag____) align 8 %3)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef nonnull align 8 dereferenceable(32) %3, i64 32, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  %12 = getelementptr inbounds i8, ptr %1, i64 56
  %13 = load ptr, ptr %12, align 8, !tbaa !15
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  %15 = load i32, ptr %14, align 8, !tbaa !17
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %17 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %18 = getelementptr inbounds i8, ptr %0, i64 32
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %.sroa.05.0.copyload = load ptr, ptr @__const.TypeChecker__checkTaggedPointerOptions__.local5, align 8
  %.sroa.4.0.copyload = load i32, ptr getelementptr inbounds (i8, ptr @__const.TypeChecker__checkTaggedPointerOptions__.local5, i64 8), align 8
  br label %20

20:                                               ; preds = %.lr.ph, %59
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %59 ]
  %21 = load ptr, ptr %13, align 8, !tbaa !19
  %22 = getelementptr inbounds %struct.Node__, ptr %21, i64 %indvars.iv
  %.sroa.013.0.copyload = load i32, ptr %22, align 8, !tbaa !13
  %.sroa.415.0..sroa_idx = getelementptr inbounds i8, ptr %22, i64 8
  %.sroa.415.0.copyload = load ptr, ptr %.sroa.415.0..sroa_idx, align 8, !tbaa !12
  switch i32 %.sroa.013.0.copyload, label %59 [
    i32 2, label %23
    i32 0, label %57
  ]

23:                                               ; preds = %20
  %24 = load i32, ptr %.sroa.415.0.copyload, align 8
  %25 = getelementptr inbounds i8, ptr %.sroa.415.0.copyload, i64 8
  %26 = load ptr, ptr %25, align 8
  %27 = call { ptr, ptr } @TypeChecker__resolveType__(ptr noundef %0, i32 %24, ptr %26, i32 noundef 0)
  %28 = extractvalue { ptr, ptr } %27, 0
  %29 = extractvalue { ptr, ptr } %27, 1
  %.not = icmp eq ptr %28, null
  br i1 %.not, label %59, label %30

30:                                               ; preds = %23
  %31 = load ptr, ptr %18, align 8, !tbaa !20
  %32 = getelementptr inbounds i8, ptr %31, i64 304
  %33 = load ptr, ptr %32, align 8, !tbaa !22
  %34 = icmp eq ptr %28, %33
  br i1 %34, label %35, label %49

35:                                               ; preds = %30
  %36 = call zeroext i8 @Set__tryAdd__Tag____(ptr noundef %11, ptr nonnull %28, ptr %29)
  %.not33 = icmp eq i8 %36, 0
  br i1 %.not33, label %37, label %59

37:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %.sroa.05.0.copyload, i32 %.sroa.4.0.copyload)
  %38 = call { ptr, i32 } @Tag__toString__(ptr nonnull %28, ptr %29)
  %39 = extractvalue { ptr, i32 } %38, 0
  %40 = extractvalue { ptr, i32 } %38, 1
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %39, i32 %40)
  %41 = load ptr, ptr %19, align 8, !tbaa !25
  %42 = load ptr, ptr %1, align 8, !tbaa !26
  %43 = load i32, ptr %.sroa.415.0.copyload, align 8
  %44 = load ptr, ptr %25, align 8
  %45 = call i64 @RangeFinder__find__(i32 %43, ptr %44)
  %46 = call { ptr, i32 } @StringBuilder__compactToString__(ptr noundef nonnull %4)
  %47 = extractvalue { ptr, i32 } %46, 0
  %48 = extractvalue { ptr, i32 } %46, 1
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %5, ptr noundef %42, i64 %45, ptr %47, i32 %48)
  call void @List__add__Error____(ptr noundef %41, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #5
  br label %59

49:                                               ; preds = %30
  %50 = load ptr, ptr %19, align 8, !tbaa !25
  %51 = load ptr, ptr %1, align 8, !tbaa !26
  %52 = load i32, ptr %.sroa.415.0.copyload, align 8
  %53 = load ptr, ptr %25, align 8
  %54 = call i64 @RangeFinder__find__(i32 %52, ptr %53)
  %55 = load ptr, ptr @mu_____string172, align 8
  %56 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string172, i64 8), align 8
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %6, ptr noundef %51, i64 %54, ptr %55, i32 %56)
  call void @List__add__Error____(ptr noundef %50, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %6)
  br label %59

57:                                               ; preds = %20
  %58 = load ptr, ptr %17, align 8, !tbaa !12
  call void %58(i32 noundef -5) #5
  br label %59

59:                                               ; preds = %23, %35, %37, %49, %20, %57
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %60 = load i32, ptr %14, align 8, !tbaa !17
  %61 = sext i32 %60 to i64
  %62 = icmp slt i64 %indvars.iv.next, %61
  br i1 %62, label %20, label %._crit_edge, !llvm.loop !27

._crit_edge:                                      ; preds = %59, %2
  %63 = getelementptr inbounds i8, ptr %1, i64 80
  %64 = load ptr, ptr %63, align 8, !tbaa !29
  %65 = getelementptr inbounds i8, ptr %64, i64 64
  store ptr %11, ptr %65, align 8, !tbaa !30
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Set__tryAdd__Tag____(ptr noundef, ptr, ptr) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @Set__create__Tag____(ptr dead_on_unwind noalias writable sret(%struct.tag_____Set__Tag____) align 8) 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, !7, i64 8}
!6 = !{!"tag_____IAllocator__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{i64 0, i64 8, !12, i64 8, i64 4, !13, i64 16, i64 4, !13, i64 20, i64 4, !13, i64 24, i64 4, !13}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!16, !7, i64 56}
!16 = !{!"tag_____NamespaceDef__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !14, i64 72, !7, i64 80}
!17 = !{!18, !14, i64 8}
!18 = !{!"tag_____List__Node____", !7, i64 0, !14, i64 8, !14, i64 12}
!19 = !{!18, !7, i64 0}
!20 = !{!21, !7, i64 32}
!21 = !{!"tag_____TypeCheckerContext__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !14, i64 120, !14, i64 124, !7, i64 128, !14, i64 136, !8, i64 140}
!22 = !{!23, !7, i64 304}
!23 = !{!"tag_____CommonTags__", !24, i64 0, !24, i64 16, !24, i64 32, !24, i64 48, !24, i64 64, !24, i64 80, !24, i64 96, !24, i64 112, !24, i64 128, !24, i64 144, !24, i64 160, !24, i64 176, !24, i64 192, !24, i64 208, !24, i64 224, !24, i64 240, !24, i64 256, !24, i64 272, !24, i64 288, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376}
!24 = !{!"tag_____Tag__", !7, i64 0, !7, i64 8}
!25 = !{!21, !7, i64 16}
!26 = !{!16, !7, i64 0}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!16, !7, i64 80}
!30 = !{!31, !7, i64 64}
!31 = !{!"tag_____Namespace__", !32, i64 0, !7, i64 16, !14, i64 24, !14, i64 28, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !14, i64 104}
!32 = !{!"", !7, i64 0, !14, i64 8}


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