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

; 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.Node__ = type { i32, ptr }
%struct.tag_____StringBuilder__ = type { ptr, i32, i32 }
%struct.tag_____CallExpression__ = type { %struct.Node__, ptr, ptr, ptr, ptr, ptr }
%struct.tag_____List__Node____ = type { ptr, i32, i32 }
%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_____Token__ = type { i32, %struct.string__, %struct.tag_____IntRange__, %struct.tag_____IntRange__, i32 }

@mu_____string224 = external dso_local global %struct.string__, align 8
@top_____abandonFn__ = external dso_local thread_local global ptr, align 8
@__const.TypeChecker__checkMinMax__.local8 = external hidden unnamed_addr constant %struct.string__, align 8
@__const.TypeChecker__checkMinMax__.local9 = 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 { ptr, ptr } @TypeChecker__tryUnifyNumbers__(ptr noundef, ptr, ptr, i32, ptr, ptr noundef byval(%struct.tag_____Tag__) align 8, ptr noundef byval(%struct.Node__) align 8) #4

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

; Function Attrs: nounwind uwtable
declare dso_local { ptr, ptr } @TypeChecker__getArgWithTypeFlags__(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef byval(%struct.string__) align 8) #4

; 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
define dso_local { ptr, ptr } @TypeChecker__checkMinMax__(ptr noundef %0, ptr noundef %1) #4 {
  %3 = alloca %struct.tag_____Tag__, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.tag_____Tag__, align 8
  %7 = alloca %struct.tag_____Tag__, align 8
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %struct.tag_____StringBuilder__, align 8
  %16 = alloca %struct.string__, align 8
  %17 = alloca %struct.string__, align 8
  %18 = alloca %struct.string__, align 8
  %19 = alloca %struct.string__, align 8
  %20 = alloca %struct.tag_____Error__, align 8
  %21 = alloca %struct.string__, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #5
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call { ptr, ptr } @TypeChecker__getArgWithTypeFlags__(ptr noundef %22, ptr noundef %23, i32 noundef 0, i32 noundef 5, i8 noundef zeroext 0, ptr noundef byval(%struct.string__) align 8 @mu_____string224)
  %25 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %26 = extractvalue { ptr, ptr } %24, 0
  store ptr %26, ptr %25, align 8
  %27 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %28 = extractvalue { ptr, ptr } %24, 1
  store ptr %28, ptr %27, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #5
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call { ptr, ptr } @TypeChecker__getArgWithTypeFlags__(ptr noundef %29, ptr noundef %30, i32 noundef 1, i32 noundef 5, i8 noundef zeroext 0, ptr noundef byval(%struct.string__) align 8 @mu_____string224)
  %32 = getelementptr inbounds { ptr, ptr }, ptr %7, i32 0, i32 0
  %33 = extractvalue { ptr, ptr } %31, 0
  store ptr %33, ptr %32, align 8
  %34 = getelementptr inbounds { ptr, ptr }, ptr %7, i32 0, i32 1
  %35 = extractvalue { ptr, ptr } %31, 1
  store ptr %35, ptr %34, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef %36, ptr noundef %37, i32 noundef 2, i8 noundef zeroext 0)
  %39 = icmp ne i8 %38, 0
  %40 = xor i1 %39, true
  %41 = zext i1 %40 to i32
  %42 = trunc i32 %41 to i8
  store i8 %42, ptr %8, align 1, !tbaa !9
  %43 = load i8, ptr %8, align 1, !tbaa !9
  %44 = icmp ne i8 %43, 0
  br i1 %44, label %51, label %45

45:                                               ; preds = %2
  %46 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 0
  %47 = load ptr, ptr %46, align 8, !tbaa !10
  %48 = icmp eq ptr %47, null
  %49 = zext i1 %48 to i32
  %50 = trunc i32 %49 to i8
  store i8 %50, ptr %8, align 1, !tbaa !9
  br label %51

51:                                               ; preds = %45, %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %52 = load i8, ptr %8, align 1, !tbaa !9
  store i8 %52, ptr %9, align 1, !tbaa !9
  %53 = load i8, ptr %9, align 1, !tbaa !9
  %54 = icmp ne i8 %53, 0
  br i1 %54, label %61, label %55

55:                                               ; preds = %51
  %56 = getelementptr inbounds %struct.tag_____Tag__, ptr %7, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !10
  %58 = icmp eq ptr %57, null
  %59 = zext i1 %58 to i32
  %60 = trunc i32 %59 to i8
  store i8 %60, ptr %9, align 1, !tbaa !9
  br label %61

61:                                               ; preds = %55, %51
  %62 = load i8, ptr %9, align 1, !tbaa !9
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %64, label %71

64:                                               ; preds = %61
  %65 = getelementptr inbounds %struct.tag_____Tag__, ptr %6, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !10
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %69

68:                                               ; preds = %64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %6, i64 16, i1 false), !tbaa.struct !12
  br label %70

69:                                               ; preds = %64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %3, ptr align 8 %7, i64 16, i1 false), !tbaa.struct !12
  br label %70

70:                                               ; preds = %69, %68
  store i32 1, ptr %10, align 4
  br label %183

71:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.tag_____CallExpression__, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  store ptr %74, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !17
  %75 = load i32, ptr %12, align 4, !tbaa !17
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.tag_____List__Node____, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !18
  %79 = icmp ult i32 %75, %78
  br i1 %79, label %83, label %80

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

83:                                               ; preds = %80, %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.tag_____CallExpression__, ptr %84, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !13
  store ptr %86, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !17
  %87 = load i32, ptr %14, align 4, !tbaa !17
  %88 = load ptr, ptr %13, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.tag_____List__Node____, ptr %88, i32 0, i32 1
  %90 = load i32, ptr %89, align 8, !tbaa !18
  %91 = icmp ult i32 %87, %90
  br i1 %91, label %95, label %92

92:                                               ; preds = %83
  %93 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %94 = load ptr, ptr %93, align 8, !tbaa !5
  call void %94(i32 noundef -3)
  br label %95

95:                                               ; preds = %92, %83
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %96, i32 0, i32 4
  %98 = load ptr, ptr %97, align 8, !tbaa !20
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.tag_____List__Node____, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !22
  %102 = load i32, ptr %12, align 4, !tbaa !17
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds %struct.Node__, ptr %101, i64 %103
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.tag_____List__Node____, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !22
  %108 = load i32, ptr %14, align 4, !tbaa !17
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds %struct.Node__, ptr %107, i64 %109
  %111 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8
  %113 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %114 = load ptr, ptr %113, align 8
  %115 = getelementptr inbounds { i32, ptr }, ptr %104, i32 0, i32 0
  %116 = load i32, ptr %115, align 8
  %117 = getelementptr inbounds { i32, ptr }, ptr %104, i32 0, i32 1
  %118 = load ptr, ptr %117, align 8
  %119 = call { ptr, ptr } @TypeChecker__tryUnifyNumbers__(ptr noundef %98, ptr %112, ptr %114, i32 %116, ptr %118, ptr noundef byval(%struct.tag_____Tag__) align 8 %7, ptr noundef byval(%struct.Node__) align 8 %110)
  %120 = getelementptr inbounds { ptr, ptr }, ptr %3, i32 0, i32 0
  %121 = extractvalue { ptr, ptr } %119, 0
  store ptr %121, ptr %120, align 8
  %122 = getelementptr inbounds { ptr, ptr }, ptr %3, i32 0, i32 1
  %123 = extractvalue { ptr, ptr } %119, 1
  store ptr %123, ptr %122, align 8
  %124 = getelementptr inbounds %struct.tag_____Tag__, ptr %3, i32 0, i32 0
  %125 = load ptr, ptr %124, align 8, !tbaa !10
  %126 = icmp eq ptr %125, null
  br i1 %126, label %127, label %182

127:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 @__const.TypeChecker__checkMinMax__.local8, i64 16, i1 false)
  %128 = getelementptr inbounds { ptr, i32 }, ptr %16, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8
  %130 = getelementptr inbounds { ptr, i32 }, ptr %16, i32 0, i32 1
  %131 = load i32, ptr %130, align 8
  call void @StringBuilder__write__(ptr noundef %15, ptr %129, i32 %131)
  %132 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 0
  %133 = load ptr, ptr %132, align 8
  %134 = getelementptr inbounds { ptr, ptr }, ptr %6, i32 0, i32 1
  %135 = load ptr, ptr %134, align 8
  %136 = call { ptr, i32 } @Tag__toString__(ptr %133, ptr %135)
  %137 = getelementptr inbounds { ptr, i32 }, ptr %17, i32 0, i32 0
  %138 = extractvalue { ptr, i32 } %136, 0
  store ptr %138, ptr %137, align 8
  %139 = getelementptr inbounds { ptr, i32 }, ptr %17, i32 0, i32 1
  %140 = extractvalue { ptr, i32 } %136, 1
  store i32 %140, ptr %139, align 8
  %141 = getelementptr inbounds { ptr, i32 }, ptr %17, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8
  %143 = getelementptr inbounds { ptr, i32 }, ptr %17, i32 0, i32 1
  %144 = load i32, ptr %143, align 8
  call void @StringBuilder__write__(ptr noundef %15, ptr %142, i32 %144)
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 @__const.TypeChecker__checkMinMax__.local9, i64 16, i1 false)
  %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
  call void @StringBuilder__write__(ptr noundef %15, ptr %146, i32 %148)
  %149 = getelementptr inbounds { ptr, ptr }, ptr %7, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8
  %151 = getelementptr inbounds { ptr, ptr }, ptr %7, i32 0, i32 1
  %152 = load ptr, ptr %151, align 8
  %153 = call { ptr, i32 } @Tag__toString__(ptr %150, ptr %152)
  %154 = getelementptr inbounds { ptr, i32 }, ptr %19, i32 0, i32 0
  %155 = extractvalue { ptr, i32 } %153, 0
  store ptr %155, ptr %154, align 8
  %156 = getelementptr inbounds { ptr, i32 }, ptr %19, i32 0, i32 1
  %157 = extractvalue { ptr, i32 } %153, 1
  store i32 %157, ptr %156, align 8
  %158 = getelementptr inbounds { ptr, i32 }, ptr %19, i32 0, i32 0
  %159 = load ptr, ptr %158, align 8
  %160 = getelementptr inbounds { ptr, i32 }, ptr %19, i32 0, i32 1
  %161 = load i32, ptr %160, align 8
  call void @StringBuilder__write__(ptr noundef %15, ptr %159, i32 %161)
  %162 = load ptr, ptr %4, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %162, i32 0, i32 2
  %164 = load ptr, ptr %163, align 8, !tbaa !23
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.tag_____TypeCheckerContext__, ptr %165, i32 0, i32 5
  %167 = load ptr, ptr %166, align 8, !tbaa !24
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.tag_____CallExpression__, ptr %168, i32 0, i32 1
  %170 = load ptr, ptr %169, align 8, !tbaa !25
  %171 = getelementptr inbounds %struct.tag_____Token__, ptr %170, i32 0, i32 2
  %172 = call { ptr, i32 } @StringBuilder__compactToString__(ptr noundef %15)
  %173 = getelementptr inbounds { ptr, i32 }, ptr %21, i32 0, i32 0
  %174 = extractvalue { ptr, i32 } %172, 0
  store ptr %174, ptr %173, align 8
  %175 = getelementptr inbounds { ptr, i32 }, ptr %21, i32 0, i32 1
  %176 = extractvalue { ptr, i32 } %172, 1
  store i32 %176, ptr %175, align 8
  %177 = load i64, ptr %171, align 8
  %178 = getelementptr inbounds { ptr, i32 }, ptr %21, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8
  %180 = getelementptr inbounds { ptr, i32 }, ptr %21, i32 0, i32 1
  %181 = load i32, ptr %180, align 8
  call void @Error__at__(ptr dead_on_unwind writable sret(%struct.tag_____Error__) align 8 %20, ptr noundef %167, i64 %177, ptr %179, i32 %181)
  call void @List__add__Error____(ptr noundef %164, ptr noundef byval(%struct.tag_____Error__) align 8 %20)
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  br label %182

182:                                              ; preds = %127, %95
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %183

183:                                              ; preds = %182, %70
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #5
  %184 = load { ptr, ptr }, ptr %3, align 8
  ret { ptr, ptr } %184
}

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 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}
!13 = !{!14, !6, i64 24}
!14 = !{!"tag_____CallExpression__", !15, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!"", !16, i64 0, !6, i64 8}
!16 = !{!"int", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!19, !16, i64 8}
!19 = !{!"tag_____List__Node____", !6, i64 0, !16, i64 8, !16, i64 12}
!20 = !{!21, !6, i64 32}
!21 = !{!"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, !16, i64 120, !16, i64 124, !6, i64 128, !16, i64 136, !7, i64 140}
!22 = !{!19, !6, i64 0}
!23 = !{!21, !6, i64 16}
!24 = !{!21, !6, i64 40}
!25 = !{!14, !6, i64 16}


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

@mu_____string224 = external dso_local global %struct.string__, align 8
@top_____abandonFn__ = external dso_local thread_local local_unnamed_addr global ptr, align 8
@__const.TypeChecker__checkMinMax__.local8 = external hidden unnamed_addr constant %struct.string__, align 8
@__const.TypeChecker__checkMinMax__.local9 = 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 { ptr, ptr } @TypeChecker__tryUnifyNumbers__(ptr noundef, ptr, ptr, i32, ptr, ptr noundef byval(%struct.tag_____Tag__) align 8, ptr noundef byval(%struct.Node__) align 8) 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 { ptr, ptr } @TypeChecker__getArgWithTypeFlags__(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef byval(%struct.string__) align 8) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__checkMinMax__(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca %struct.tag_____Tag__, align 8
  %4 = alloca %struct.tag_____StringBuilder__, align 8
  %5 = alloca %struct.tag_____Error__, align 8
  %6 = tail call { ptr, ptr } @TypeChecker__getArgWithTypeFlags__(ptr noundef %0, ptr noundef %1, i32 noundef 0, i32 noundef 5, i8 noundef zeroext 0, ptr noundef nonnull byval(%struct.string__) align 8 @mu_____string224)
  %7 = extractvalue { ptr, ptr } %6, 0
  %8 = extractvalue { ptr, ptr } %6, 1
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  %9 = tail call { ptr, ptr } @TypeChecker__getArgWithTypeFlags__(ptr noundef %0, ptr noundef %1, i32 noundef 1, i32 noundef 5, i8 noundef zeroext 0, ptr noundef nonnull byval(%struct.string__) align 8 @mu_____string224)
  %10 = extractvalue { ptr, ptr } %9, 0
  store ptr %10, ptr %3, align 8
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  %12 = extractvalue { ptr, ptr } %9, 1
  store ptr %12, ptr %11, align 8
  %13 = tail call zeroext i8 @TypeChecker__checkRemainingArgs__(ptr noundef %0, ptr noundef %1, i32 noundef 2, i8 noundef zeroext 0)
  %.not = icmp ne i8 %13, 0
  %14 = icmp ne ptr %7, null
  %spec.select = select i1 %.not, i1 %14, i1 false
  %15 = icmp ne ptr %10, null
  %or.cond = select i1 %spec.select, i1 %15, i1 false
  br i1 %or.cond, label %16, label %.critedge

.critedge:                                        ; preds = %2
  %.not44 = icmp eq ptr %7, null
  %.sroa.036.0 = select i1 %.not44, ptr %10, ptr %7
  %.sroa.537.0 = select i1 %.not44, ptr %12, ptr %8
  br label %64

16:                                               ; preds = %2
  %17 = getelementptr inbounds i8, ptr %1, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 8
  %20 = load i32, ptr %19, align 8, !tbaa !12
  %.not43 = icmp eq i32 %20, 0
  br i1 %.not43, label %21, label %24

21:                                               ; preds = %16
  %22 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %23 = load ptr, ptr %22, align 8, !tbaa !14
  tail call void %23(i32 noundef -3) #4
  %.pre = load ptr, ptr %17, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 8
  %.pre46 = load i32, ptr %.phi.trans.insert, align 8, !tbaa !12
  br label %24

24:                                               ; preds = %21, %16
  %25 = phi i32 [ %.pre46, %21 ], [ %20, %16 ]
  %26 = phi ptr [ %.pre, %21 ], [ %18, %16 ]
  %27 = icmp ugt i32 %25, 1
  br i1 %27, label %31, label %28

28:                                               ; preds = %24
  %29 = tail call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @top_____abandonFn__)
  %30 = load ptr, ptr %29, align 8, !tbaa !14
  tail call void %30(i32 noundef -3) #4
  br label %31

31:                                               ; preds = %28, %24
  %32 = getelementptr inbounds i8, ptr %0, i64 32
  %33 = load ptr, ptr %32, align 8, !tbaa !15
  %34 = load ptr, ptr %18, align 8, !tbaa !17
  %35 = load ptr, ptr %26, align 8, !tbaa !17
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  %37 = load i32, ptr %34, align 8
  %38 = getelementptr inbounds i8, ptr %34, i64 8
  %39 = load ptr, ptr %38, align 8
  %40 = tail call { ptr, ptr } @TypeChecker__tryUnifyNumbers__(ptr noundef %33, ptr nonnull %7, ptr %8, i32 %37, ptr %39, ptr noundef nonnull byval(%struct.tag_____Tag__) align 8 %3, ptr noundef nonnull byval(%struct.Node__) align 8 %36)
  %41 = extractvalue { ptr, ptr } %40, 0
  %42 = extractvalue { ptr, ptr } %40, 1
  %43 = icmp eq ptr %41, null
  br i1 %43, label %44, label %64

44:                                               ; preds = %31
  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.06.0.copyload = load ptr, ptr @__const.TypeChecker__checkMinMax__.local8, align 8
  %.sroa.47.0.copyload = load i32, ptr getelementptr inbounds (i8, ptr @__const.TypeChecker__checkMinMax__.local8, i64 8), align 8
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %.sroa.06.0.copyload, i32 %.sroa.47.0.copyload)
  %45 = call { ptr, i32 } @Tag__toString__(ptr nonnull %7, ptr %8)
  %46 = extractvalue { ptr, i32 } %45, 0
  %47 = extractvalue { ptr, i32 } %45, 1
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %46, i32 %47)
  %.sroa.03.0.copyload = load ptr, ptr @__const.TypeChecker__checkMinMax__.local9, align 8
  %.sroa.4.0.copyload = load i32, ptr getelementptr inbounds (i8, ptr @__const.TypeChecker__checkMinMax__.local9, i64 8), align 8
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %.sroa.03.0.copyload, i32 %.sroa.4.0.copyload)
  %48 = load ptr, ptr %3, align 8
  %49 = load ptr, ptr %11, align 8
  %50 = call { ptr, i32 } @Tag__toString__(ptr %48, ptr %49)
  %51 = extractvalue { ptr, i32 } %50, 0
  %52 = extractvalue { ptr, i32 } %50, 1
  call void @StringBuilder__write__(ptr noundef nonnull %4, ptr %51, i32 %52)
  %53 = getelementptr inbounds i8, ptr %0, i64 16
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = getelementptr inbounds i8, ptr %0, i64 40
  %56 = load ptr, ptr %55, align 8, !tbaa !19
  %57 = getelementptr inbounds i8, ptr %1, i64 16
  %58 = load ptr, ptr %57, align 8, !tbaa !20
  %59 = getelementptr inbounds i8, ptr %58, i64 24
  %60 = call { ptr, i32 } @StringBuilder__compactToString__(ptr noundef nonnull %4)
  %61 = extractvalue { ptr, i32 } %60, 0
  %62 = extractvalue { ptr, i32 } %60, 1
  %63 = load i64, ptr %59, align 8
  call void @Error__at__(ptr dead_on_unwind nonnull writable sret(%struct.tag_____Error__) align 8 %5, ptr noundef %56, i64 %63, ptr %61, i32 %62)
  call void @List__add__Error____(ptr noundef %54, ptr noundef nonnull byval(%struct.tag_____Error__) align 8 %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br label %64

64:                                               ; preds = %31, %44, %.critedge
  %.sroa.036.1 = phi ptr [ %.sroa.036.0, %.critedge ], [ null, %44 ], [ %41, %31 ]
  %.sroa.537.1 = phi ptr [ %.sroa.537.0, %.critedge ], [ %42, %44 ], [ %42, %31 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  %.fca.0.insert = insertvalue { ptr, ptr } poison, ptr %.sroa.036.1, 0
  %.fca.1.insert = insertvalue { ptr, ptr } %.fca.0.insert, ptr %.sroa.537.1, 1
  ret { ptr, ptr } %.fca.1.insert
}

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, !11, i64 24}
!6 = !{!"tag_____CallExpression__", !7, i64 0, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48}
!7 = !{!"", !8, i64 0, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!13, !8, i64 8}
!13 = !{!"tag_____List__Node____", !11, i64 0, !8, i64 8, !8, i64 12}
!14 = !{!11, !11, i64 0}
!15 = !{!16, !11, i64 32}
!16 = !{!"tag_____TypeCheckerContext__", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !11, i64 96, !11, i64 104, !11, i64 112, !8, i64 120, !8, i64 124, !11, i64 128, !8, i64 136, !9, i64 140}
!17 = !{!13, !11, i64 0}
!18 = !{!16, !11, i64 16}
!19 = !{!16, !11, i64 40}
!20 = !{!6, !11, i64 16}


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