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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.tag_____Tag__ = type { ptr, ptr }
%struct.tag_____Namespace__ = type { %struct.string__, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.string__ = type { ptr, i32 }
%struct.tag_____Array__Tag____ = type { ptr, i32 }
%struct.tag_____CallExpression__ = type { %struct.Node__, ptr, ptr, ptr, ptr, ptr }
%struct.Node__ = type { i32, ptr }
%struct.tag_____List__Node____ = type { ptr, i32, i32 }

@top_____abandonFn__ = external dso_local thread_local global ptr, align 8
@Tag__null___ = external hidden global %struct.tag_____Tag__, 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 zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) #4

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

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

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__checkAs__(ptr noundef %0, ptr noundef %1, ptr %2, ptr %3) #4 {
  %5 = alloca %struct.tag_____Tag__, align 8
  %6 = alloca %struct.tag_____Tag__, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.tag_____Tag__, align 8
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  store ptr %2, ptr %21, align 8
  %22 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  store ptr %3, ptr %22, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = call { ptr, ptr } @TypeChecker__getTypeArg__(ptr noundef %23, ptr noundef %24, i32 noundef 0)
  %26 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 0
  %27 = extractvalue { ptr, ptr } %25, 0
  store ptr %27, ptr %26, align 8
  %28 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 1
  %29 = extractvalue { ptr, ptr } %25, 1
  store ptr %29, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = call zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef %30, ptr noundef %31, i32 noundef 1, i8 noundef zeroext 1)
  %33 = icmp ne i8 %32, 0
  %34 = xor i1 %33, true
  %35 = zext i1 %34 to i32
  %36 = trunc i32 %35 to i8
  store i8 %36, ptr %10, align 1, !tbaa !9
  %37 = load i8, ptr %10, align 1, !tbaa !9
  %38 = icmp ne i8 %37, 0
  br i1 %38, label %45, label %39

39:                                               ; preds = %4
  %40 = getelementptr inbounds %struct.tag_____Tag__, ptr %9, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !10
  %42 = icmp eq ptr %41, null
  %43 = zext i1 %42 to i32
  %44 = trunc i32 %43 to i8
  store i8 %44, ptr %10, align 1, !tbaa !9
  br label %45

45:                                               ; preds = %39, %4
  %46 = load i8, ptr %10, align 1, !tbaa !9
  %47 = icmp ne i8 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 16, i1 false)
  store i32 1, ptr %11, align 4
  br label %224

49:                                               ; preds = %45
  %50 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 0
  %51 = load ptr, ptr %50, align 8, !tbaa !10
  %52 = getelementptr inbounds %struct.tag_____Namespace__, ptr %51, i32 0, i32 3
  %53 = load i32, ptr %52, align 4, !tbaa !12
  %54 = and i32 %53, 65536
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %74

56:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %57 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 1
  %58 = load ptr, ptr %57, align 8, !tbaa !16
  store ptr %58, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !17
  %59 = load i32, ptr %13, align 4, !tbaa !17
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %60, i32 0, i32 1
  %62 = load i32, ptr %61, align 8, !tbaa !18
  %63 = icmp ult i32 %59, %62
  br i1 %63, label %67, label %64

64:                                               ; preds = %56
  %65 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  call void %66(i32 noundef -3)
  br label %67

67:                                               ; preds = %64, %56
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.tag_____Array__Tag____, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !20
  %71 = load i32, ptr %13, align 4, !tbaa !17
  %72 = zext i32 %71 to i64
  %73 = getelementptr inbounds %struct.tag_____Tag__, ptr %70, i64 %72
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %6, ptr align 8 %73, i64 16, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %74

74:                                               ; preds = %67, %49
  %75 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !10
  %77 = load ptr, ptr @Tag__null___, align 8, !tbaa !10
  %78 = icmp eq ptr %76, %77
  br i1 %78, label %79, label %115

79:                                               ; preds = %74
  %80 = getelementptr inbounds %struct.tag_____Tag__, ptr %9, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !10
  %82 = getelementptr inbounds %struct.tag_____Namespace__, ptr %81, i32 0, i32 3
  %83 = load i32, ptr %82, align 4, !tbaa !12
  %84 = and i32 %83, 204992
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %114

86:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %87 = load ptr, ptr %8, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.tag_____CallExpression__, ptr %87, i32 0, i32 2
  %89 = load ptr, ptr %88, align 8, !tbaa !22
  store ptr %89, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !17
  %90 = load i32, ptr %15, align 4, !tbaa !17
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.tag_____List__Node____, ptr %91, i32 0, i32 1
  %93 = load i32, ptr %92, align 8, !tbaa !25
  %94 = icmp ult i32 %90, %93
  br i1 %94, label %98, label %95

95:                                               ; preds = %86
  %96 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %97 = load ptr, ptr %96, align 8, !tbaa !5
  call void %97(i32 noundef -3)
  br label %98

98:                                               ; preds = %95, %86
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.tag_____List__Node____, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !27
  %103 = load i32, ptr %15, align 4, !tbaa !17
  %104 = zext i32 %103 to i64
  %105 = getelementptr inbounds %struct.Node__, ptr %102, i64 %104
  %106 = getelementptr inbounds { i32, ptr }, ptr %105, i32 0, i32 0
  %107 = load i32, ptr %106, align 8
  %108 = getelementptr inbounds { i32, ptr }, ptr %105, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8
  %110 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8
  %112 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %113 = load ptr, ptr %112, align 8
  call void @TypeChecker__badConversion__(ptr noundef %99, i32 %107, ptr %109, ptr %111, ptr %113, ptr noundef byval(%struct.tag_____Tag__) align 8 %9)
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 16, i1 false)
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %224

114:                                              ; preds = %79
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !21
  store i32 1, ptr %11, align 4
  br label %224

115:                                              ; preds = %74
  %116 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !10
  %118 = getelementptr inbounds %struct.tag_____Namespace__, ptr %117, i32 0, i32 3
  %119 = load i32, ptr %118, align 4, !tbaa !12
  %120 = and i32 %119, 8192
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %162

122:                                              ; preds = %115
  %123 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !10
  %125 = getelementptr inbounds %struct.tag_____Namespace__, ptr %124, i32 0, i32 8
  %126 = load ptr, ptr %125, align 8, !tbaa !28
  %127 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8
  %129 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8
  %131 = call zeroext i8 @Set__contains__Tag____(ptr noundef %126, ptr %128, ptr %130)
  %132 = icmp ne i8 %131, 0
  br i1 %132, label %161, label %133

133:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.tag_____CallExpression__, ptr %134, i32 0, i32 2
  %136 = load ptr, ptr %135, align 8, !tbaa !22
  store ptr %136, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !17
  %137 = load i32, ptr %17, align 4, !tbaa !17
  %138 = load ptr, ptr %16, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.tag_____List__Node____, ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 8, !tbaa !25
  %141 = icmp ult i32 %137, %140
  br i1 %141, label %145, label %142

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

145:                                              ; preds = %142, %133
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = load ptr, ptr %16, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.tag_____List__Node____, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !27
  %150 = load i32, ptr %17, align 4, !tbaa !17
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds %struct.Node__, ptr %149, i64 %151
  %153 = getelementptr inbounds { i32, ptr }, ptr %152, i32 0, i32 0
  %154 = load i32, ptr %153, align 8
  %155 = getelementptr inbounds { i32, ptr }, ptr %152, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8
  %157 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8
  %159 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %160 = load ptr, ptr %159, align 8
  call void @TypeChecker__badConversion__(ptr noundef %146, i32 %154, ptr %156, ptr %158, ptr %160, ptr noundef byval(%struct.tag_____Tag__) align 8 %9)
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 16, i1 false)
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %224

161:                                              ; preds = %122
  br label %222

162:                                              ; preds = %115
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  %163 = getelementptr inbounds %struct.tag_____Tag__, ptr %9, i32 0, i32 0
  %164 = load ptr, ptr %163, align 8, !tbaa !10
  %165 = getelementptr inbounds %struct.tag_____Namespace__, ptr %164, i32 0, i32 3
  %166 = load i32, ptr %165, align 4, !tbaa !12
  %167 = and i32 %166, 8192
  %168 = icmp eq i32 %167, 0
  %169 = zext i1 %168 to i32
  %170 = trunc i32 %169 to i8
  store i8 %170, ptr %18, align 1, !tbaa !9
  %171 = load i8, ptr %18, align 1, !tbaa !9
  %172 = icmp ne i8 %171, 0
  br i1 %172, label %187, label %173

173:                                              ; preds = %162
  %174 = getelementptr inbounds %struct.tag_____Tag__, ptr %9, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !10
  %176 = getelementptr inbounds %struct.tag_____Namespace__, ptr %175, i32 0, i32 8
  %177 = load ptr, ptr %176, align 8, !tbaa !28
  %178 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8
  %180 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %181 = load ptr, ptr %180, align 8
  %182 = call zeroext i8 @Set__contains__Tag____(ptr noundef %177, ptr %179, ptr %181)
  %183 = icmp ne i8 %182, 0
  %184 = xor i1 %183, true
  %185 = zext i1 %184 to i32
  %186 = trunc i32 %185 to i8
  store i8 %186, ptr %18, align 1, !tbaa !9
  br label %187

187:                                              ; preds = %173, %162
  %188 = load i8, ptr %18, align 1, !tbaa !9
  %189 = icmp ne i8 %188, 0
  br i1 %189, label %190, label %218

190:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %191 = load ptr, ptr %8, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.tag_____CallExpression__, ptr %191, i32 0, i32 2
  %193 = load ptr, ptr %192, align 8, !tbaa !22
  store ptr %193, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !17
  %194 = load i32, ptr %20, align 4, !tbaa !17
  %195 = load ptr, ptr %19, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.tag_____List__Node____, ptr %195, i32 0, i32 1
  %197 = load i32, ptr %196, align 8, !tbaa !25
  %198 = icmp ult i32 %194, %197
  br i1 %198, label %202, label %199

199:                                              ; preds = %190
  %200 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %201 = load ptr, ptr %200, align 8, !tbaa !5
  call void %201(i32 noundef -3)
  br label %202

202:                                              ; preds = %199, %190
  %203 = load ptr, ptr %7, align 8, !tbaa !5
  %204 = load ptr, ptr %19, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.tag_____List__Node____, ptr %204, i32 0, i32 0
  %206 = load ptr, ptr %205, align 8, !tbaa !27
  %207 = load i32, ptr %20, align 4, !tbaa !17
  %208 = zext i32 %207 to i64
  %209 = getelementptr inbounds %struct.Node__, ptr %206, i64 %208
  %210 = getelementptr inbounds { i32, ptr }, ptr %209, i32 0, i32 0
  %211 = load i32, ptr %210, align 8
  %212 = getelementptr inbounds { i32, ptr }, ptr %209, i32 0, i32 1
  %213 = load ptr, ptr %212, align 8
  %214 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %215 = load ptr, ptr %214, align 8
  %216 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %217 = load ptr, ptr %216, align 8
  call void @TypeChecker__badConversion__(ptr noundef %203, i32 %211, ptr %213, ptr %215, ptr %217, ptr noundef byval(%struct.tag_____Tag__) align 8 %9)
  call void @llvm.memset.p0.i64(ptr align 8 %5, i8 0, i64 16, i1 false)
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  br label %219

218:                                              ; preds = %187
  store i32 0, ptr %11, align 4
  br label %219

219:                                              ; preds = %218, %202
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  %220 = load i32, ptr %11, align 4
  switch i32 %220, label %224 [
    i32 0, label %221
  ]

221:                                              ; preds = %219
  br label %222

222:                                              ; preds = %221, %161
  br label %223

223:                                              ; preds = %222
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %5, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !21
  store i32 1, ptr %11, align 4
  br label %224

224:                                              ; preds = %223, %219, %145, %114, %98, %48
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  %225 = load { ptr, ptr }, ptr %5, align 8
  ret { ptr, ptr } %225
}

; Function Attrs: nounwind uwtable
declare dso_local { ptr, ptr } @TypeChecker__getTypeArg__(ptr noundef, ptr noundef, 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 0}
!11 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!12 = !{!13, !15, i64 28}
!13 = !{!"tag_____Namespace__", !14, i64 0, !6, i64 16, !15, i64 24, !15, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !15, i64 104}
!14 = !{!"", !6, i64 0, !15, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!11, !6, i64 8}
!17 = !{!15, !15, i64 0}
!18 = !{!19, !15, i64 8}
!19 = !{!"tag_____Array__Tag____", !6, i64 0, !15, i64 8}
!20 = !{!19, !6, i64 0}
!21 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!22 = !{!23, !6, i64 24}
!23 = !{!"tag_____CallExpression__", !24, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!24 = !{!"", !15, i64 0, !6, i64 8}
!25 = !{!26, !15, i64 8}
!26 = !{!"tag_____List__Node____", !6, i64 0, !15, i64 8, !15, i64 12}
!27 = !{!26, !6, i64 0}
!28 = !{!13, !6, i64 64}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.tag_____Tag__ = type { ptr, ptr }

@top_____abandonFn__ = external dso_local thread_local local_unnamed_addr global ptr, align 8
@Tag__null___ = external hidden local_unnamed_addr global %struct.tag_____Tag__, 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: nounwind uwtable
declare dso_local zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef, ptr noundef, i32 noundef, i8 noundef zeroext) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__checkAs__(ptr noundef %0, ptr noundef %1, ptr %2, ptr %3) local_unnamed_addr #2 {
  %5 = alloca %struct.tag_____Tag__, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #3
  %6 = tail call { ptr, ptr } @TypeChecker__getTypeArg__(ptr noundef %0, ptr noundef %1, i32 noundef 0)
  %7 = extractvalue { ptr, ptr } %6, 0
  store ptr %7, ptr %5, align 8
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  %9 = extractvalue { ptr, ptr } %6, 1
  store ptr %9, ptr %8, align 8
  %10 = tail call zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef %0, ptr noundef %1, i32 noundef 1, i8 noundef zeroext 1)
  %.not = icmp ne i8 %10, 0
  %11 = icmp ne ptr %7, null
  %.051 = select i1 %.not, i1 %11, i1 false
  br i1 %.051, label %12, label %.critedge

12:                                               ; preds = %4
  %13 = getelementptr inbounds i8, ptr %2, i64 28
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = and i32 %14, 65536
  %.not56 = icmp eq i32 %15, 0
  br i1 %.not56, label %24, label %16

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %3, i64 8
  %18 = load i32, ptr %17, align 8, !tbaa !12
  %.not57 = icmp eq i32 %18, 0
  br i1 %.not57, label %19, label %22

19:                                               ; preds = %16
  %20 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %21 = load ptr, ptr %20, align 8, !tbaa !14
  tail call void %21(i32 noundef -3) #3
  br label %22

22:                                               ; preds = %19, %16
  %23 = load ptr, ptr %3, align 8, !tbaa !15
  %.sroa.0.0.copyload = load ptr, ptr %23, align 8, !tbaa !14
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %23, i64 8
  %.sroa.10.0.copyload = load ptr, ptr %.sroa.10.0..sroa_idx, align 8, !tbaa !14
  br label %24

24:                                               ; preds = %22, %12
  %.sroa.0.0 = phi ptr [ %.sroa.0.0.copyload, %22 ], [ %2, %12 ]
  %.sroa.10.0 = phi ptr [ %.sroa.10.0.copyload, %22 ], [ %3, %12 ]
  %25 = load ptr, ptr @Tag__null___, align 8, !tbaa !16
  %26 = icmp eq ptr %.sroa.0.0, %25
  br i1 %26, label %27, label %45

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %7, i64 28
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = and i32 %29, 204992
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %.critedge

32:                                               ; preds = %27
  %33 = getelementptr inbounds i8, ptr %1, i64 24
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = load i32, ptr %35, align 8, !tbaa !21
  %.not64 = icmp eq i32 %36, 0
  br i1 %.not64, label %37, label %40

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

40:                                               ; preds = %37, %32
  %41 = load ptr, ptr %34, align 8, !tbaa !23
  %42 = load i32, ptr %41, align 8
  %43 = getelementptr inbounds i8, ptr %41, i64 8
  %44 = load ptr, ptr %43, align 8
  tail call void @TypeChecker__badConversion__(ptr noundef %0, i32 %42, ptr %44, ptr %.sroa.0.0, ptr %.sroa.10.0, ptr noundef nonnull byval(%struct.tag_____Tag__) align 8 %5)
  br label %.critedge

45:                                               ; preds = %24
  %46 = getelementptr inbounds i8, ptr %.sroa.0.0, i64 28
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = and i32 %47, 8192
  %.not58 = icmp eq i32 %48, 0
  br i1 %.not58, label %66, label %49

49:                                               ; preds = %45
  %50 = getelementptr inbounds i8, ptr %.sroa.0.0, i64 64
  %51 = load ptr, ptr %50, align 8, !tbaa !24
  %52 = tail call zeroext i8 @Set__contains__Tag____(ptr noundef %51, ptr nonnull %7, ptr %9)
  %.not62 = icmp eq i8 %52, 0
  br i1 %.not62, label %53, label %.critedge

53:                                               ; preds = %49
  %54 = getelementptr inbounds i8, ptr %1, i64 24
  %55 = load ptr, ptr %54, align 8, !tbaa !18
  %56 = getelementptr inbounds i8, ptr %55, i64 8
  %57 = load i32, ptr %56, align 8, !tbaa !21
  %.not63 = icmp eq i32 %57, 0
  br i1 %.not63, label %58, label %61

58:                                               ; preds = %53
  %59 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  tail call void %60(i32 noundef -3) #3
  br label %61

61:                                               ; preds = %58, %53
  %62 = load ptr, ptr %55, align 8, !tbaa !23
  %63 = load i32, ptr %62, align 8
  %64 = getelementptr inbounds i8, ptr %62, i64 8
  %65 = load ptr, ptr %64, align 8
  tail call void @TypeChecker__badConversion__(ptr noundef %0, i32 %63, ptr %65, ptr nonnull %.sroa.0.0, ptr %.sroa.10.0, ptr noundef nonnull byval(%struct.tag_____Tag__) align 8 %5)
  br label %.critedge

66:                                               ; preds = %45
  %67 = getelementptr inbounds i8, ptr %7, i64 28
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = and i32 %68, 8192
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %.thread, label %71

71:                                               ; preds = %66
  %72 = getelementptr inbounds i8, ptr %7, i64 64
  %73 = load ptr, ptr %72, align 8, !tbaa !24
  %74 = tail call zeroext i8 @Set__contains__Tag____(ptr noundef %73, ptr nonnull %.sroa.0.0, ptr %.sroa.10.0)
  %.not59.not = icmp eq i8 %74, 0
  br i1 %.not59.not, label %.thread, label %.critedge

.thread:                                          ; preds = %66, %71
  %75 = getelementptr inbounds i8, ptr %1, i64 24
  %76 = load ptr, ptr %75, align 8, !tbaa !18
  %77 = getelementptr inbounds i8, ptr %76, i64 8
  %78 = load i32, ptr %77, align 8, !tbaa !21
  %.not61 = icmp eq i32 %78, 0
  br i1 %.not61, label %79, label %82

79:                                               ; preds = %.thread
  %80 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %81 = load ptr, ptr %80, align 8, !tbaa !14
  tail call void %81(i32 noundef -3) #3
  br label %82

82:                                               ; preds = %79, %.thread
  %83 = load ptr, ptr %76, align 8, !tbaa !23
  %84 = load i32, ptr %83, align 8
  %85 = getelementptr inbounds i8, ptr %83, i64 8
  %86 = load ptr, ptr %85, align 8
  tail call void @TypeChecker__badConversion__(ptr noundef %0, i32 %84, ptr %86, ptr nonnull %.sroa.0.0, ptr %.sroa.10.0, ptr noundef nonnull byval(%struct.tag_____Tag__) align 8 %5)
  br label %.critedge

.critedge:                                        ; preds = %49, %71, %27, %82, %4, %61, %40
  %.sroa.7.1 = phi ptr [ null, %40 ], [ null, %61 ], [ null, %82 ], [ null, %4 ], [ %9, %27 ], [ %9, %71 ], [ %9, %49 ]
  %.sroa.041.1 = phi ptr [ null, %40 ], [ null, %61 ], [ null, %82 ], [ null, %4 ], [ %7, %27 ], [ %7, %71 ], [ %7, %49 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #3
  %.fca.0.insert = insertvalue { ptr, ptr } poison, ptr %.sroa.041.1, 0
  %.fca.1.insert = insertvalue { ptr, ptr } %.fca.0.insert, ptr %.sroa.7.1, 1
  ret { ptr, ptr } %.fca.1.insert
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11, i64 28}
!6 = !{!"tag_____Namespace__", !7, i64 0, !8, i64 16, !11, i64 24, !11, i64 28, !8, i64 32, !8, i64 40, !8, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !8, i64 80, !8, i64 88, !8, i64 96, !11, i64 104}
!7 = !{!"", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!13, !11, i64 8}
!13 = !{!"tag_____Array__Tag____", !8, i64 0, !11, i64 8}
!14 = !{!8, !8, i64 0}
!15 = !{!13, !8, i64 0}
!16 = !{!17, !8, i64 0}
!17 = !{!"tag_____Tag__", !8, i64 0, !8, i64 8}
!18 = !{!19, !8, i64 24}
!19 = !{!"tag_____CallExpression__", !20, i64 0, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48}
!20 = !{!"", !11, i64 0, !8, i64 8}
!21 = !{!22, !11, i64 8}
!22 = !{!"tag_____List__Node____", !8, i64 0, !11, i64 8, !11, i64 12}
!23 = !{!22, !8, i64 0}
!24 = !{!6, !8, i64 64}


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