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

; 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_____Tag__ = type { ptr, ptr }
%struct.Node__ = type { i32, ptr }
%struct.tag_____Array__Tag____ = type { ptr, i32 }
%struct.tag_____FunctionDef__ = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct.Node__, ptr, ptr, ptr, ptr, i32, ptr, %struct.string__, %struct.string__, %struct.tag_____Tag__, i32, ptr, ptr, ptr, ptr, %struct.string__ }
%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_____List__Ptr__Param______ = type { ptr, i32, i32 }
%struct.tag_____Param__ = type { ptr, %struct.Node__, ptr, %struct.tag_____Tag__, i32, %struct.string__ }
%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_____string179 = external dso_local global %struct.string__, align 8
@mu_____string178 = 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

; 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 i32 @Tag__argsAnyFlags__(ptr noundef) #4

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

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__getFunctionPointerTag__(ptr noundef %0, ptr noundef %1, i8 noundef zeroext %2, i32 %3, ptr %4) #4 {
  %6 = alloca %struct.tag_____Tag__, align 8
  %7 = alloca %struct.Node__, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca %struct.tag_____Error__, align 8
  %12 = alloca %struct.tag_____IntRange__, align 4
  %13 = alloca %struct.tag_____Error__, align 8
  %14 = alloca %struct.tag_____IntRange__, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %struct.tag_____Array__Tag____, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 0
  store i32 %3, ptr %25, align 8
  %26 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 1
  store ptr %4, ptr %26, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i8 %2, ptr %10, align 1, !tbaa !9
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %27, i32 0, i32 13
  %29 = load ptr, ptr %28, align 8, !tbaa !10
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %46

31:                                               ; preds = %5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %32, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !16
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %35, i32 0, i32 5
  %37 = load ptr, ptr %36, align 8, !tbaa !18
  %38 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 0
  %39 = load i32, ptr %38, align 8
  %40 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8
  %42 = call i64 @RangeFinder__find__(i32 %39, ptr %41)
  store i64 %42, ptr %12, align 4
  %43 = load i64, ptr %12, align 4
  %44 = load ptr, ptr @mu_____string178, align 8
  %45 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string178, i32 0, i32 1), align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %11, ptr noundef %37, i64 %43, ptr %44, i32 %45)
  call void @List__add__Error____(ptr noundef %34, ptr noundef byval(%struct.tag_____Error__) align 8 %11)
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 16, i1 false)
  br label %177

46:                                               ; preds = %5
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %47, i32 0, i32 12
  %49 = load i32, ptr %48, align 8, !tbaa !19
  %50 = and i32 %49, 2
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %67

52:                                               ; preds = %46
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %56, i32 0, i32 5
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 0
  %60 = load i32, ptr %59, align 8
  %61 = getelementptr inbounds { i32, ptr }, ptr %7, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8
  %63 = call i64 @RangeFinder__find__(i32 %60, ptr %62)
  store i64 %63, ptr %14, align 4
  %64 = load i64, ptr %14, align 4
  %65 = load ptr, ptr @mu_____string179, align 8
  %66 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string179, i32 0, i32 1), align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %13, ptr noundef %58, i64 %64, ptr %65, i32 %66)
  call void @List__add__Error____(ptr noundef %55, ptr noundef byval(%struct.tag_____Error__) align 8 %13)
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 16, i1 false)
  br label %177

67:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %68 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %69 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !20
  %71 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %72 = getelementptr inbounds %struct.tag_____IAllocator__, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !22
  %74 = call ptr %70(ptr noundef %73, i64 noundef 16)
  store ptr %74, ptr %15, align 8, !tbaa !5
  %75 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %76, i32 0, i32 4
  %78 = load ptr, ptr %77, align 8, !tbaa !23
  %79 = getelementptr inbounds %struct.tag_____List__Ptr__Param______, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 8, !tbaa !24
  %81 = add nsw i32 %80, 1
  %82 = call { ptr, i32 } @Array__cons__Tag____(i32 noundef %81)
  %83 = getelementptr inbounds { ptr, i32 }, ptr %16, i32 0, i32 0
  %84 = extractvalue { ptr, i32 } %82, 0
  store ptr %84, ptr %83, align 8
  %85 = getelementptr inbounds { ptr, i32 }, ptr %16, i32 0, i32 1
  %86 = extractvalue { ptr, i32 } %82, 1
  store i32 %86, ptr %85, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %75, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %87, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %88, i32 0, i32 4
  %90 = load ptr, ptr %89, align 8, !tbaa !23
  store ptr %90, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !27
  br label %91

91:                                               ; preds = %115, %67
  %92 = load i32, ptr %19, align 4, !tbaa !27
  %93 = load ptr, ptr %18, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.tag_____List__Ptr__Param______, ptr %93, i32 0, i32 1
  %95 = load i32, ptr %94, align 8, !tbaa !24
  %96 = icmp slt i32 %92, %95
  br i1 %96, label %97, label %126

97:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %98 = load ptr, ptr %18, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.tag_____List__Ptr__Param______, ptr %98, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !28
  %101 = load i32, ptr %19, align 4, !tbaa !27
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !5
  store ptr %104, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %105, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %106 = load i32, ptr %19, align 4, !tbaa !27
  store i32 %106, ptr %22, align 4, !tbaa !27
  %107 = load i32, ptr %22, align 4, !tbaa !27
  %108 = load ptr, ptr %21, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %108, i32 0, i32 1
  %110 = load i32, ptr %109, align 8, !tbaa !29
  %111 = icmp ult i32 %107, %110
  br i1 %111, label %115, label %112

112:                                              ; preds = %97
  %113 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  call void %114(i32 noundef -3)
  br label %115

115:                                              ; preds = %112, %97
  %116 = load ptr, ptr %21, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !31
  %119 = load i32, ptr %22, align 4, !tbaa !27
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds %struct.tag_____Tag__, ptr %118, i64 %120
  %122 = load ptr, ptr %20, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.tag_____Param__, ptr %122, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %121, ptr align 8 %123, i64 16, i1 false), !tbaa.struct !32
  %124 = load i32, ptr %19, align 4, !tbaa !27
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %19, align 4, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %91, !llvm.loop !33

126:                                              ; preds = %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  %127 = load i8, ptr %10, align 1, !tbaa !9
  %128 = icmp ne i8 %127, 0
  br i1 %128, label %168, label %129

129:                                              ; preds = %126
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %130 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %130, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %131, i32 0, i32 4
  %133 = load ptr, ptr %132, align 8, !tbaa !23
  %134 = getelementptr inbounds %struct.tag_____List__Ptr__Param______, ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 8, !tbaa !24
  store i32 %135, ptr %24, align 4, !tbaa !27
  %136 = load i32, ptr %24, align 4, !tbaa !27
  %137 = load ptr, ptr %23, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %137, i32 0, i32 1
  %139 = load i32, ptr %138, align 8, !tbaa !29
  %140 = icmp ult i32 %136, %139
  br i1 %140, label %144, label %141

141:                                              ; preds = %129
  %142 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %143 = load ptr, ptr %142, align 8, !tbaa !5
  call void %143(i32 noundef -3)
  br label %144

144:                                              ; preds = %141, %129
  %145 = load ptr, ptr %23, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !31
  %148 = load i32, ptr %24, align 4, !tbaa !27
  %149 = zext i32 %148 to i64
  %150 = getelementptr inbounds %struct.tag_____Tag__, ptr %147, i64 %149
  %151 = load ptr, ptr %9, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.tag_____FunctionDef__, ptr %151, i32 0, i32 16
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %150, ptr align 8 %152, i64 16, i1 false), !tbaa.struct !32
  %153 = load ptr, ptr %17, align 8, !tbaa !5
  %154 = call i32 @Tag__argsAnyFlags__(ptr noundef %153)
  %155 = and i32 %154, 1048576
  %156 = icmp eq i32 %155, 0
  br i1 %156, label %157, label %167

157:                                              ; preds = %144
  %158 = load ptr, ptr %8, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %158, i32 0, i32 4
  %160 = load ptr, ptr %159, align 8, !tbaa !35
  %161 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %160, i32 0, i32 20
  %162 = load ptr, ptr %161, align 8, !tbaa !36
  %163 = getelementptr inbounds %struct.tag_____Namespace__, ptr %162, i32 0, i32 10
  %164 = load ptr, ptr %163, align 8, !tbaa !38
  %165 = load ptr, ptr %17, align 8, !tbaa !5
  %166 = call zeroext i8 @CustomSet__tryAdd__Ptr__Array__Tag________(ptr noundef %164, ptr noundef %165)
  br label %167

167:                                              ; preds = %157, %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %168

168:                                              ; preds = %167, %126
  call void @llvm.memset.p0.i64(ptr align 8 %6, i8 0, i64 16, i1 false)
  %169 = load ptr, ptr %8, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %169, i32 0, i32 4
  %171 = load ptr, ptr %170, align 8, !tbaa !35
  %172 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %171, i32 0, i32 20
  %173 = load ptr, ptr %172, align 8, !tbaa !36
  %174 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 0
  store ptr %173, ptr %174, align 8, !tbaa !40
  %175 = load ptr, ptr %17, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 1
  store ptr %175, ptr %176, align 8, !tbaa !41
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %177

177:                                              ; preds = %168, %52, %31
  %178 = load { ptr, ptr }, ptr %6, align 8
  ret { ptr, ptr } %178
}

; Function Attrs: nounwind uwtable
declare dso_local { ptr, i32 } @Array__cons__Tag____(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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 112}
!11 = !{!"tag_____FunctionDef__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !13, i64 104, !6, i64 112, !14, i64 120, !14, i64 136, !15, i64 152, !13, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !14, i64 208}
!12 = !{!"", !13, i64 0, !6, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!"", !6, i64 0, !13, i64 8}
!15 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!16 = !{!17, !6, i64 16}
!17 = !{!"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, !13, i64 120, !13, i64 124, !6, i64 128, !13, i64 136, !7, i64 140}
!18 = !{!17, !6, i64 40}
!19 = !{!11, !13, i64 104}
!20 = !{!21, !6, i64 8}
!21 = !{!"tag_____IAllocator__", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!21, !6, i64 0}
!23 = !{!11, !6, i64 32}
!24 = !{!25, !13, i64 8}
!25 = !{!"tag_____List__Ptr__Param______", !6, i64 0, !13, i64 8, !13, i64 12}
!26 = !{i64 0, i64 8, !5, i64 8, i64 4, !27}
!27 = !{!13, !13, i64 0}
!28 = !{!25, !6, i64 0}
!29 = !{!30, !13, i64 8}
!30 = !{!"tag_____Array__Tag____", !6, i64 0, !13, i64 8}
!31 = !{!30, !6, i64 0}
!32 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!17, !6, i64 32}
!36 = !{!37, !6, i64 312}
!37 = !{!"tag_____CommonTags__", !15, i64 0, !15, i64 16, !15, i64 32, !15, i64 48, !15, i64 64, !15, i64 80, !15, i64 96, !15, i64 112, !15, i64 128, !15, i64 144, !15, i64 160, !15, i64 176, !15, i64 192, !15, i64 208, !15, i64 224, !15, i64 240, !15, i64 256, !15, i64 272, !15, 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}
!38 = !{!39, !6, i64 80}
!39 = !{!"tag_____Namespace__", !14, i64 0, !6, i64 16, !13, i64 24, !13, 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, !13, i64 104}
!40 = !{!15, !6, i64 0}
!41 = !{!15, !6, 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_____Tag__ = type { ptr, ptr }

@mu_____string179 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string178 = 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

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

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

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

; 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 #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @Tag__argsAnyFlags__(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__getFunctionPointerTag__(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i8 noundef zeroext %2, i32 %3, ptr %4) local_unnamed_addr #2 {
  %6 = alloca %struct.tag_____Error__, align 8
  %7 = alloca %struct.tag_____Error__, align 8
  %8 = getelementptr inbounds i8, ptr %1, i64 112
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %18, label %10

10:                                               ; preds = %5
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !14
  %13 = getelementptr inbounds i8, ptr %0, i64 40
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = tail call i64 @RangeFinder__find__(i32 %3, ptr %4)
  %16 = load ptr, ptr @mu_____string178, align 8
  %17 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string178, i64 8), align 8
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %6, ptr noundef %14, i64 %15, ptr %16, i32 %17)
  call void @List__add__Error____(ptr noundef %12, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %6)
  br label %95

18:                                               ; preds = %5
  %19 = getelementptr inbounds i8, ptr %1, i64 104
  %20 = load i32, ptr %19, align 8, !tbaa !17
  %21 = and i32 %20, 2
  %.not45 = icmp eq i32 %21, 0
  br i1 %.not45, label %30, label %22

22:                                               ; preds = %18
  %23 = getelementptr inbounds i8, ptr %0, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = getelementptr inbounds i8, ptr %0, i64 40
  %26 = load ptr, ptr %25, align 8, !tbaa !16
  %27 = tail call i64 @RangeFinder__find__(i32 %3, ptr %4)
  %28 = load ptr, ptr @mu_____string179, align 8
  %29 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string179, i64 8), align 8
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %7, ptr noundef %26, i64 %27, ptr %28, i32 %29)
  call void @List__add__Error____(ptr noundef %24, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %7)
  br label %95

30:                                               ; preds = %18
  %31 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____currentAllocator__)
  %32 = getelementptr inbounds i8, ptr %31, i64 8
  %33 = load ptr, ptr %32, align 8, !tbaa !18
  %34 = load ptr, ptr %31, align 8, !tbaa !20
  %35 = tail call ptr %33(ptr noundef %34, i64 noundef 16) #3
  %36 = getelementptr inbounds i8, ptr %1, i64 32
  %37 = load ptr, ptr %36, align 8, !tbaa !21
  %38 = getelementptr inbounds i8, ptr %37, i64 8
  %39 = load i32, ptr %38, align 8, !tbaa !22
  %40 = add nsw i32 %39, 1
  %41 = tail call { ptr, i32 } @Array__cons__Tag____(i32 noundef %40)
  %42 = extractvalue { ptr, i32 } %41, 0
  %43 = extractvalue { ptr, i32 } %41, 1
  store ptr %42, ptr %35, align 8, !tbaa !24
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %35, i64 8
  store i32 %43, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !25
  %44 = load ptr, ptr %36, align 8, !tbaa !21
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load i32, ptr %45, align 8, !tbaa !22
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %30
  %48 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  br label %49

49:                                               ; preds = %.lr.ph, %58
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %58 ]
  %50 = load ptr, ptr %44, align 8, !tbaa !26
  %51 = getelementptr inbounds ptr, ptr %50, i64 %indvars.iv
  %52 = load ptr, ptr %51, align 8, !tbaa !24
  %53 = load i32, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !27
  %54 = zext i32 %53 to i64
  %55 = icmp ult i64 %indvars.iv, %54
  br i1 %55, label %58, label %56

56:                                               ; preds = %49
  %57 = load ptr, ptr %48, align 8, !tbaa !24
  tail call void %57(i32 noundef -3) #3
  br label %58

58:                                               ; preds = %56, %49
  %59 = load ptr, ptr %35, align 8, !tbaa !29
  %60 = getelementptr inbounds %struct.tag_____Tag__, ptr %59, i64 %indvars.iv
  %61 = getelementptr inbounds i8, ptr %52, i64 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 8 dereferenceable(16) %61, i64 16, i1 false), !tbaa.struct !30
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %62 = load i32, ptr %45, align 8, !tbaa !22
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next, %63
  br i1 %64, label %49, label %._crit_edge, !llvm.loop !31

._crit_edge:                                      ; preds = %58, %30
  %.not46 = icmp eq i8 %2, 0
  br i1 %.not46, label %65, label %90

65:                                               ; preds = %._crit_edge
  %66 = load ptr, ptr %36, align 8, !tbaa !21
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load i32, ptr %67, align 8, !tbaa !22
  %69 = load i32, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !27
  %70 = icmp ult i32 %68, %69
  br i1 %70, label %74, label %71

71:                                               ; preds = %65
  %72 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %73 = load ptr, ptr %72, align 8, !tbaa !24
  tail call void %73(i32 noundef -3) #3
  br label %74

74:                                               ; preds = %71, %65
  %75 = load ptr, ptr %35, align 8, !tbaa !29
  %76 = zext i32 %68 to i64
  %77 = getelementptr inbounds %struct.tag_____Tag__, ptr %75, i64 %76
  %78 = getelementptr inbounds i8, ptr %1, i64 152
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %77, ptr noundef nonnull align 8 dereferenceable(16) %78, i64 16, i1 false), !tbaa.struct !30
  %79 = tail call i32 @Tag__argsAnyFlags__(ptr noundef nonnull %35)
  %80 = and i32 %79, 1048576
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %90

82:                                               ; preds = %74
  %83 = getelementptr inbounds i8, ptr %0, i64 32
  %84 = load ptr, ptr %83, align 8, !tbaa !33
  %85 = getelementptr inbounds i8, ptr %84, i64 312
  %86 = load ptr, ptr %85, align 8, !tbaa !34
  %87 = getelementptr inbounds i8, ptr %86, i64 80
  %88 = load ptr, ptr %87, align 8, !tbaa !36
  %89 = tail call zeroext i8 @CustomSet__tryAdd__Ptr__Array__Tag________(ptr noundef %88, ptr noundef nonnull %35)
  br label %90

90:                                               ; preds = %74, %82, %._crit_edge
  %91 = getelementptr inbounds i8, ptr %0, i64 32
  %92 = load ptr, ptr %91, align 8, !tbaa !33
  %93 = getelementptr inbounds i8, ptr %92, i64 312
  %94 = load ptr, ptr %93, align 8, !tbaa !34
  br label %95

95:                                               ; preds = %90, %22, %10
  %.sroa.540.0 = phi ptr [ null, %10 ], [ null, %22 ], [ %35, %90 ]
  %.sroa.039.0 = phi ptr [ null, %10 ], [ null, %22 ], [ %94, %90 ]
  %.fca.0.insert = insertvalue { ptr, ptr } poison, ptr %.sroa.039.0, 0
  %.fca.1.insert = insertvalue { ptr, ptr } %.fca.0.insert, ptr %.sroa.540.0, 1
  ret { ptr, ptr } %.fca.1.insert
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 112}
!6 = !{!"tag_____FunctionDef__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !11, i64 104, !7, i64 112, !12, i64 120, !12, i64 136, !13, i64 152, !11, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !12, i64 208}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !7, i64 8}
!11 = !{!"int", !8, i64 0}
!12 = !{!"", !7, i64 0, !11, i64 8}
!13 = !{!"tag_____Tag__", !7, i64 0, !7, i64 8}
!14 = !{!15, !7, i64 16}
!15 = !{!"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, !11, i64 120, !11, i64 124, !7, i64 128, !11, i64 136, !8, i64 140}
!16 = !{!15, !7, i64 40}
!17 = !{!6, !11, i64 104}
!18 = !{!19, !7, i64 8}
!19 = !{!"tag_____IAllocator__", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!20 = !{!19, !7, i64 0}
!21 = !{!6, !7, i64 32}
!22 = !{!23, !11, i64 8}
!23 = !{!"tag_____List__Ptr__Param______", !7, i64 0, !11, i64 8, !11, i64 12}
!24 = !{!7, !7, i64 0}
!25 = !{!11, !11, i64 0}
!26 = !{!23, !7, i64 0}
!27 = !{!28, !11, i64 8}
!28 = !{!"tag_____Array__Tag____", !7, i64 0, !11, i64 8}
!29 = !{!28, !7, i64 0}
!30 = !{i64 0, i64 8, !24, i64 8, i64 8, !24}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!15, !7, i64 32}
!34 = !{!35, !7, i64 312}
!35 = !{!"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, !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}
!36 = !{!37, !7, i64 80}
!37 = !{!"tag_____Namespace__", !12, i64 0, !7, i64 16, !11, i64 24, !11, 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, !11, i64 104}


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