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

; 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_____Tag__ = type { ptr, ptr }
%struct.tag_____StringBuilder__ = type { ptr, i32, i32 }
%struct.Node__ = type { i32, ptr }
%struct.tag_____BinaryOperatorExpression__ = type { ptr, %struct.Node__, %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_____Namespace__ = type { %struct.string__, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.tag_____Token__ = type { i32, %struct.string__, %struct.tag_____IntRange__, %struct.tag_____IntRange__, i32 }

@mu_____string263 = external dso_local global %struct.string__, align 8
@top_____abandonFn__ = external dso_local thread_local global ptr, align 8
@__const.TypeChecker__checkDeclareStatement__.local2 = external hidden unnamed_addr constant %struct.string__, align 8
@__const.TypeChecker__checkDeclareStatement__.local3 = 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 zeroext i8 @Map__tryAdd__string__Tag____(ptr noundef, ptr, i32, ptr, 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__checkDeclareStatement__(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.tag_____Tag__, align 8
  %6 = alloca %struct.tag_____Error__, align 8
  %7 = alloca %struct.tag_____IntRange__, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca %struct.tag_____StringBuilder__, align 8
  %11 = alloca %struct.string__, align 8
  %12 = alloca %struct.string__, align 8
  %13 = alloca %struct.string__, align 8
  %14 = alloca %struct.tag_____Error__, align 8
  %15 = alloca %struct.string__, align 8
  %16 = alloca %struct.tag_____Tag__, align 8
  %17 = alloca %struct.Node__, align 8
  %18 = alloca %struct.string__, align 8
  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 16, ptr %5) #5
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.tag_____BinaryOperatorExpression__, ptr %20, i32 0, i32 2
  %22 = getelementptr inbounds { i32, ptr }, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8
  %24 = getelementptr inbounds { i32, ptr }, ptr %21, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8
  %26 = call { ptr, ptr } @TypeChecker__checkExpression__(ptr noundef %19, i32 %23, ptr %25)
  %27 = getelementptr inbounds { ptr, ptr }, ptr %5, i32 0, i32 0
  %28 = extractvalue { ptr, ptr } %26, 0
  store ptr %28, ptr %27, align 8
  %29 = getelementptr inbounds { ptr, ptr }, ptr %5, i32 0, i32 1
  %30 = extractvalue { ptr, ptr } %26, 1
  store ptr %30, ptr %29, align 8
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.tag_____BinaryOperatorExpression__, ptr %31, i32 0, i32 1
  %33 = getelementptr inbounds %struct.Node__, ptr %32, i32 0, i32 0
  %34 = load i32, ptr %33, align 8, !tbaa !9
  %35 = icmp eq i32 %34, 21
  br i1 %35, label %53, label %36

36:                                               ; preds = %2
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %37, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !13
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %40, i32 0, i32 5
  %42 = load ptr, ptr %41, align 8, !tbaa !15
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.tag_____BinaryOperatorExpression__, ptr %43, i32 0, i32 1
  %45 = getelementptr inbounds { i32, ptr }, ptr %44, i32 0, i32 0
  %46 = load i32, ptr %45, align 8
  %47 = getelementptr inbounds { i32, ptr }, ptr %44, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8
  %49 = call i64 @RangeFinder__find__(i32 %46, ptr %48)
  store i64 %49, ptr %7, align 4
  %50 = load i64, ptr %7, align 4
  %51 = load ptr, ptr @mu_____string263, align 8
  %52 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string263, i32 0, i32 1), align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %6, ptr noundef %42, i64 %50, ptr %51, i32 %52)
  call void @List__add__Error____(ptr noundef %39, ptr noundef byval(%struct.tag_____Error__) align 8 %6)
  store i32 1, ptr %8, align 4
  br label %162

53:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %54 = getelementptr inbounds %struct.tag_____Tag__, ptr %5, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  %56 = icmp ne ptr %55, null
  %57 = zext i1 %56 to i32
  %58 = trunc i32 %57 to i8
  store i8 %58, ptr %9, align 1, !tbaa !18
  %59 = load i8, ptr %9, align 1, !tbaa !18
  %60 = icmp ne i8 %59, 0
  br i1 %60, label %61, label %70

61:                                               ; preds = %53
  %62 = getelementptr inbounds %struct.tag_____Tag__, ptr %5, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !16
  %64 = getelementptr inbounds %struct.tag_____Namespace__, ptr %63, i32 0, i32 3
  %65 = load i32, ptr %64, align 4, !tbaa !19
  %66 = and i32 %65, 223741
  %67 = icmp eq i32 %66, 0
  %68 = zext i1 %67 to i32
  %69 = trunc i32 %68 to i8
  store i8 %69, ptr %9, align 1, !tbaa !18
  br label %70

70:                                               ; preds = %61, %53
  %71 = load i8, ptr %9, align 1, !tbaa !18
  %72 = icmp ne i8 %71, 0
  br i1 %72, label %73, label %115

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 @__const.TypeChecker__checkDeclareStatement__.local2, i64 16, i1 false)
  %74 = getelementptr inbounds { ptr, i32 }, ptr %11, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8
  %76 = getelementptr inbounds { ptr, i32 }, ptr %11, i32 0, i32 1
  %77 = load i32, ptr %76, align 8
  call void @StringBuilder__write__(ptr noundef %10, ptr %75, i32 %77)
  %78 = getelementptr inbounds { ptr, ptr }, ptr %5, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8
  %80 = getelementptr inbounds { ptr, ptr }, ptr %5, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8
  %82 = call { ptr, i32 } @Tag__toString__(ptr %79, ptr %81)
  %83 = getelementptr inbounds { ptr, i32 }, ptr %12, i32 0, i32 0
  %84 = extractvalue { ptr, i32 } %82, 0
  store ptr %84, ptr %83, align 8
  %85 = getelementptr inbounds { ptr, i32 }, ptr %12, i32 0, i32 1
  %86 = extractvalue { ptr, i32 } %82, 1
  store i32 %86, ptr %85, align 8
  %87 = getelementptr inbounds { ptr, i32 }, ptr %12, i32 0, i32 0
  %88 = load ptr, ptr %87, align 8
  %89 = getelementptr inbounds { ptr, i32 }, ptr %12, i32 0, i32 1
  %90 = load i32, ptr %89, align 8
  call void @StringBuilder__write__(ptr noundef %10, ptr %88, i32 %90)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 @__const.TypeChecker__checkDeclareStatement__.local3, i64 16, i1 false)
  %91 = getelementptr inbounds { ptr, i32 }, ptr %13, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8
  %93 = getelementptr inbounds { ptr, i32 }, ptr %13, i32 0, i32 1
  %94 = load i32, ptr %93, align 8
  call void @StringBuilder__write__(ptr noundef %10, ptr %92, i32 %94)
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !13
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %98, i32 0, i32 5
  %100 = load ptr, ptr %99, align 8, !tbaa !15
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.tag_____BinaryOperatorExpression__, ptr %101, i32 0, i32 0
  %103 = load ptr, ptr %102, align 8, !tbaa !22
  %104 = getelementptr inbounds %struct.tag_____Token__, ptr %103, i32 0, i32 2
  %105 = call { ptr, i32 } @StringBuilder__compactToString__(ptr noundef %10)
  %106 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 0
  %107 = extractvalue { ptr, i32 } %105, 0
  store ptr %107, ptr %106, align 8
  %108 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 1
  %109 = extractvalue { ptr, i32 } %105, 1
  store i32 %109, ptr %108, align 8
  %110 = load i64, ptr %104, align 8
  %111 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8
  %113 = getelementptr inbounds { ptr, i32 }, ptr %15, i32 0, i32 1
  %114 = load i32, ptr %113, align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %14, ptr noundef %100, i64 %110, ptr %112, i32 %114)
  call void @List__add__Error____(ptr noundef %97, ptr noundef byval(%struct.tag_____Error__) align 8 %14)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 16, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %16, i64 16, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  br label %115

115:                                              ; preds = %73, %70
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.tag_____BinaryOperatorExpression__, ptr %116, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %117, i64 16, i1 false), !tbaa.struct !24
  %118 = getelementptr inbounds %struct.Node__, ptr %17, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !26
  %120 = icmp eq i32 %119, 21
  br i1 %120, label %124, label %121

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

124:                                              ; preds = %121, %115
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  %125 = getelementptr inbounds %struct.Node__, ptr %17, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !27
  %127 = getelementptr inbounds %struct.tag_____Token__, ptr %126, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %127, i64 16, i1 false), !tbaa.struct !28
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %128, i32 0, i32 10
  %130 = load ptr, ptr %129, align 8, !tbaa !29
  %131 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8
  %133 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 1
  %134 = load i32, ptr %133, align 8
  %135 = getelementptr inbounds { ptr, ptr }, ptr %5, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8
  %137 = getelementptr inbounds { ptr, ptr }, ptr %5, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8
  %139 = call zeroext i8 @Map__tryAdd__string__Tag____(ptr noundef %130, ptr %132, i32 %134, ptr %136, ptr %138)
  %140 = icmp ne i8 %139, 0
  br i1 %140, label %153, label %141

141:                                              ; preds = %124
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.tag_____BinaryOperatorExpression__, ptr %143, i32 0, i32 1
  %145 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 0
  %146 = load ptr, ptr %145, align 8
  %147 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 1
  %148 = load i32, ptr %147, align 8
  %149 = getelementptr inbounds { i32, ptr }, ptr %144, i32 0, i32 0
  %150 = load i32, ptr %149, align 8
  %151 = getelementptr inbounds { i32, ptr }, ptr %144, i32 0, i32 1
  %152 = load ptr, ptr %151, align 8
  call void @TypeChecker__badLocalVar__(ptr noundef %142, ptr %146, i32 %148, i32 %150, ptr %152)
  store i32 1, ptr %8, align 4
  br label %161

153:                                              ; preds = %124
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %154, i32 0, i32 11
  %156 = load ptr, ptr %155, align 8, !tbaa !30
  %157 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8
  %159 = getelementptr inbounds { ptr, i32 }, ptr %18, i32 0, i32 1
  %160 = load i32, ptr %159, align 8
  call void @List__add__string____(ptr noundef %156, ptr %158, i32 %160)
  store i32 0, ptr %8, align 4
  br label %161

161:                                              ; preds = %153, %141
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %162

162:                                              ; preds = %161, %36
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #5
  %163 = load i32, ptr %8, align 4
  switch i32 %163, label %165 [
    i32 0, label %164
    i32 1, label %164
  ]

164:                                              ; preds = %162, %162
  ret void

165:                                              ; preds = %162
  unreachable
}

; Function Attrs: nounwind uwtable
declare dso_local void @TypeChecker__badLocalVar__(ptr noundef, ptr, i32, i32, ptr) #4

; Function Attrs: nounwind uwtable
declare dso_local void @List__add__string____(ptr noundef, ptr, i32) #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, !12, i64 8}
!10 = !{!"tag_____BinaryOperatorExpression__", !6, i64 0, !11, i64 8, !11, i64 24}
!11 = !{!"", !12, i64 0, !6, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 16}
!14 = !{!"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, !12, i64 120, !12, i64 124, !6, i64 128, !12, i64 136, !7, i64 140}
!15 = !{!14, !6, i64 40}
!16 = !{!17, !6, i64 0}
!17 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !12, i64 28}
!20 = !{!"tag_____Namespace__", !21, i64 0, !6, i64 16, !12, i64 24, !12, 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, !12, i64 104}
!21 = !{!"", !6, i64 0, !12, i64 8}
!22 = !{!10, !6, i64 0}
!23 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!24 = !{i64 0, i64 4, !25, i64 8, i64 8, !5}
!25 = !{!12, !12, i64 0}
!26 = !{!11, !12, i64 0}
!27 = !{!11, !6, i64 8}
!28 = !{i64 0, i64 8, !5, i64 8, i64 4, !25}
!29 = !{!14, !6, i64 80}
!30 = !{!14, !6, i64 88}


; 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_____StringBuilder__ = type { ptr, i32, i32 }

@mu_____string263 = 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
@__const.TypeChecker__checkDeclareStatement__.local2 = external hidden unnamed_addr constant %struct.string__, align 8
@__const.TypeChecker__checkDeclareStatement__.local3 = 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: nounwind uwtable
declare dso_local void @StringBuilder__write__(ptr noundef, ptr, i32) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local { ptr, i32 } @StringBuilder__compactToString__(ptr noundef) local_unnamed_addr #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 #3

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @Map__tryAdd__string__Tag____(ptr noundef, ptr, i32, ptr, ptr) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local void @TypeChecker__checkDeclareStatement__(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = alloca %struct.tag_____Error__, align 8
  %4 = alloca %struct.tag_____StringBuilder__, align 8
  %5 = alloca %struct.tag_____Error__, align 8
  %6 = getelementptr inbounds i8, ptr %1, i64 24
  %7 = load i32, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr %1, i64 32
  %9 = load ptr, ptr %8, align 8
  %10 = tail call { ptr, ptr } @TypeChecker__checkExpression__(ptr noundef %0, i32 %7, ptr %9)
  %11 = extractvalue { ptr, ptr } %10, 0
  %12 = extractvalue { ptr, ptr } %10, 1
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load i32, ptr %13, align 8
  %15 = icmp eq i32 %14, 21
  br i1 %15, label %26, label %16

16:                                               ; preds = %2
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 40
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %1, i64 16
  %22 = load ptr, ptr %21, align 8
  %23 = tail call i64 @RangeFinder__find__(i32 %14, ptr %22)
  %24 = load ptr, ptr @mu_____string263, align 8
  %25 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string263, i64 8), align 8
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %3, ptr noundef %20, i64 %23, ptr %24, i32 %25)
  call void @List__add__Error____(ptr noundef %18, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %3)
  br label %59

26:                                               ; preds = %2
  %.not = icmp eq ptr %11, null
  br i1 %.not, label %.critedge.thread, label %27

.critedge.thread:                                 ; preds = %26
  %.sroa.46.0..sroa_idx44 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.46.0.copyload45 = load ptr, ptr %.sroa.46.0..sroa_idx44, align 8, !tbaa !12
  br label %48

27:                                               ; preds = %26
  %28 = getelementptr inbounds i8, ptr %11, i64 28
  %29 = load i32, ptr %28, align 4, !tbaa !13
  %30 = and i32 %29, 223741
  %.not50 = icmp eq i32 %30, 0
  br i1 %.not50, label %.critedge, label %.critedge.thread52

.critedge.thread52:                               ; preds = %27
  %.sroa.46.0..sroa_idx56 = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.46.0.copyload57 = load ptr, ptr %.sroa.46.0..sroa_idx56, align 8, !tbaa !12
  br label %48

.critedge:                                        ; preds = %27
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  %.sroa.012.0.copyload = load ptr, ptr @__const.TypeChecker__checkDeclareStatement__.local2, align 8
  %.sroa.413.0.copyload = load i32, ptr getelementptr inbounds (i8, ptr @__const.TypeChecker__checkDeclareStatement__.local2, i64 8), align 8
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %.sroa.012.0.copyload, i32 %.sroa.413.0.copyload)
  %31 = call { ptr, i32 } @Tag__toString__(ptr nonnull %11, ptr %12)
  %32 = extractvalue { ptr, i32 } %31, 0
  %33 = extractvalue { ptr, i32 } %31, 1
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %32, i32 %33)
  %.sroa.08.0.copyload = load ptr, ptr @__const.TypeChecker__checkDeclareStatement__.local3, align 8
  %.sroa.49.0.copyload = load i32, ptr getelementptr inbounds (i8, ptr @__const.TypeChecker__checkDeclareStatement__.local3, i64 8), align 8
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %.sroa.08.0.copyload, i32 %.sroa.49.0.copyload)
  %34 = getelementptr inbounds i8, ptr %0, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %0, i64 40
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = load ptr, ptr %1, align 8, !tbaa !16
  %39 = getelementptr inbounds i8, ptr %38, i64 24
  %40 = call { ptr, i32 } @StringBuilder__compactToString__(ptr noundef nonnull %4)
  %41 = extractvalue { ptr, i32 } %40, 0
  %42 = extractvalue { ptr, i32 } %40, 1
  %43 = load i64, ptr %39, align 8
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %5, ptr noundef %37, i64 %43, ptr %41, i32 %42)
  call void @List__add__Error____(ptr noundef %35, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  %.sroa.05.0.copyload.pr.pre = load i32, ptr %13, align 8, !tbaa !19
  %44 = icmp eq i32 %.sroa.05.0.copyload.pr.pre, 21
  %.sroa.46.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 16
  %.sroa.46.0.copyload = load ptr, ptr %.sroa.46.0..sroa_idx, align 8, !tbaa !12
  br i1 %44, label %48, label %45

45:                                               ; preds = %.critedge
  %46 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %47 = load ptr, ptr %46, align 8, !tbaa !12
  call void %47(i32 noundef -4) #4
  br label %48

48:                                               ; preds = %.critedge.thread52, %.critedge.thread, %45, %.critedge
  %.sroa.46.0.copyload49 = phi ptr [ %.sroa.46.0.copyload45, %.critedge.thread ], [ %.sroa.46.0.copyload, %45 ], [ %.sroa.46.0.copyload, %.critedge ], [ %.sroa.46.0.copyload57, %.critedge.thread52 ]
  %.sroa.46.0..sroa_idx48 = phi ptr [ %.sroa.46.0..sroa_idx44, %.critedge.thread ], [ %.sroa.46.0..sroa_idx, %45 ], [ %.sroa.46.0..sroa_idx, %.critedge ], [ %.sroa.46.0..sroa_idx56, %.critedge.thread52 ]
  %.sroa.8.047 = phi ptr [ %12, %.critedge.thread ], [ null, %45 ], [ null, %.critedge ], [ %12, %.critedge.thread52 ]
  %.sroa.017.046 = phi ptr [ null, %.critedge.thread ], [ null, %45 ], [ null, %.critedge ], [ %11, %.critedge.thread52 ]
  %49 = getelementptr inbounds i8, ptr %.sroa.46.0.copyload49, i64 8
  %.sroa.0.0.copyload = load ptr, ptr %49, align 8, !tbaa !12
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %.sroa.46.0.copyload49, i64 16
  %.sroa.6.0.copyload = load i32, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !19
  %50 = getelementptr inbounds i8, ptr %0, i64 80
  %51 = load ptr, ptr %50, align 8, !tbaa !20
  %52 = call zeroext i8 @Map__tryAdd__string__Tag____(ptr noundef %51, ptr %.sroa.0.0.copyload, i32 %.sroa.6.0.copyload, ptr %.sroa.017.046, ptr %.sroa.8.047)
  %.not40 = icmp eq i8 %52, 0
  br i1 %.not40, label %53, label %56

53:                                               ; preds = %48
  %54 = load i32, ptr %13, align 8
  %55 = load ptr, ptr %.sroa.46.0..sroa_idx48, align 8
  call void @TypeChecker__badLocalVar__(ptr noundef nonnull %0, ptr %.sroa.0.0.copyload, i32 %.sroa.6.0.copyload, i32 %54, ptr %55)
  br label %59

56:                                               ; preds = %48
  %57 = getelementptr inbounds i8, ptr %0, i64 88
  %58 = load ptr, ptr %57, align 8, !tbaa !21
  call void @List__add__string____(ptr noundef %58, ptr %.sroa.0.0.copyload, i32 %.sroa.6.0.copyload)
  br label %59

59:                                               ; preds = %53, %56, %16
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @TypeChecker__badLocalVar__(ptr noundef, ptr, i32, i32, ptr) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @List__add__string____(ptr noundef, ptr, i32) local_unnamed_addr #3

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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 16}
!6 = !{!"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, !10, i64 120, !10, i64 124, !7, i64 128, !10, i64 136, !8, i64 140}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 40}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !10, i64 28}
!14 = !{!"tag_____Namespace__", !15, i64 0, !7, i64 16, !10, i64 24, !10, 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, !10, i64 104}
!15 = !{!"", !7, i64 0, !10, i64 8}
!16 = !{!17, !7, i64 0}
!17 = !{!"tag_____BinaryOperatorExpression__", !7, i64 0, !18, i64 8, !18, i64 24}
!18 = !{!"", !10, i64 0, !7, i64 8}
!19 = !{!10, !10, i64 0}
!20 = !{!6, !7, i64 80}
!21 = !{!6, !7, i64 88}


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