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

; 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.Node__ = type { i32, 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_____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 }

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; 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) #1

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__tryUnifyNumbers__(ptr noundef %0, ptr %1, ptr %2, i32 %3, ptr %4, ptr noundef byval(%struct.tag_____Tag__) align 8 %5, ptr noundef byval(%struct.Node__) align 8 %6) #2 {
  %8 = alloca %struct.tag_____Tag__, align 8
  %9 = alloca %struct.tag_____Tag__, align 8
  %10 = alloca %struct.Node__, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  %21 = alloca i8, align 1
  %22 = alloca i32, align 4
  %23 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 0
  store ptr %1, ptr %23, align 8
  %24 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 1
  store ptr %2, ptr %24, align 8
  %25 = getelementptr inbounds { i32, ptr }, ptr %10, i32 0, i32 0
  store i32 %3, ptr %25, align 8
  %26 = getelementptr inbounds { i32, ptr }, ptr %10, i32 0, i32 1
  store ptr %4, ptr %26, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  %27 = getelementptr inbounds %struct.tag_____Tag__, ptr %9, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.tag_____Namespace__, ptr %28, i32 0, i32 3
  %30 = load i32, ptr %29, align 4, !tbaa !11
  %31 = and i32 %30, 4
  %32 = icmp ne i32 %31, 0
  %33 = zext i1 %32 to i32
  %34 = trunc i32 %33 to i8
  store i8 %34, ptr %12, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #3
  %35 = getelementptr inbounds %struct.tag_____Tag__, ptr %9, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.tag_____Namespace__, ptr %36, i32 0, i32 3
  %38 = load i32, ptr %37, align 4, !tbaa !11
  %39 = and i32 %38, 1
  %40 = icmp ne i32 %39, 0
  %41 = zext i1 %40 to i32
  %42 = trunc i32 %41 to i8
  store i8 %42, ptr %13, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #3
  %43 = getelementptr inbounds %struct.tag_____Tag__, ptr %5, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.tag_____Namespace__, ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = and i32 %46, 4
  %48 = icmp ne i32 %47, 0
  %49 = zext i1 %48 to i32
  %50 = trunc i32 %49 to i8
  store i8 %50, ptr %14, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #3
  %51 = getelementptr inbounds %struct.tag_____Tag__, ptr %5, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.tag_____Namespace__, ptr %52, i32 0, i32 3
  %54 = load i32, ptr %53, align 4, !tbaa !11
  %55 = and i32 %54, 1
  %56 = icmp ne i32 %55, 0
  %57 = zext i1 %56 to i32
  %58 = trunc i32 %57 to i8
  store i8 %58, ptr %15, align 1, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #3
  %59 = load i8, ptr %12, align 1, !tbaa !15
  store i8 %59, ptr %16, align 1, !tbaa !15
  %60 = load i8, ptr %16, align 1, !tbaa !15
  %61 = icmp ne i8 %60, 0
  br i1 %61, label %62, label %64

62:                                               ; preds = %7
  %63 = load i8, ptr %14, align 1, !tbaa !15
  store i8 %63, ptr %16, align 1, !tbaa !15
  br label %64

64:                                               ; preds = %62, %7
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #3
  %65 = load i8, ptr %16, align 1, !tbaa !15
  store i8 %65, ptr %17, align 1, !tbaa !15
  %66 = load i8, ptr %17, align 1, !tbaa !15
  %67 = icmp ne i8 %66, 0
  br i1 %67, label %76, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #3
  %69 = load i8, ptr %13, align 1, !tbaa !15
  store i8 %69, ptr %18, align 1, !tbaa !15
  %70 = load i8, ptr %18, align 1, !tbaa !15
  %71 = icmp ne i8 %70, 0
  br i1 %71, label %72, label %74

72:                                               ; preds = %68
  %73 = load i8, ptr %14, align 1, !tbaa !15
  store i8 %73, ptr %18, align 1, !tbaa !15
  br label %74

74:                                               ; preds = %72, %68
  %75 = load i8, ptr %18, align 1, !tbaa !15
  store i8 %75, ptr %17, align 1, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #3
  br label %76

76:                                               ; preds = %74, %64
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #3
  %77 = load i8, ptr %17, align 1, !tbaa !15
  store i8 %77, ptr %19, align 1, !tbaa !15
  %78 = load i8, ptr %19, align 1, !tbaa !15
  %79 = icmp ne i8 %78, 0
  br i1 %79, label %88, label %80

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #3
  %81 = load i8, ptr %12, align 1, !tbaa !15
  store i8 %81, ptr %20, align 1, !tbaa !15
  %82 = load i8, ptr %20, align 1, !tbaa !15
  %83 = icmp ne i8 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %80
  %85 = load i8, ptr %15, align 1, !tbaa !15
  store i8 %85, ptr %20, align 1, !tbaa !15
  br label %86

86:                                               ; preds = %84, %80
  %87 = load i8, ptr %20, align 1, !tbaa !15
  store i8 %87, ptr %19, align 1, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #3
  br label %88

88:                                               ; preds = %86, %76
  %89 = load i8, ptr %19, align 1, !tbaa !15
  %90 = icmp ne i8 %89, 0
  br i1 %90, label %91, label %123

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #3
  %92 = getelementptr inbounds %struct.tag_____Tag__, ptr %9, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !9
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %94, i32 0, i32 13
  %96 = getelementptr inbounds %struct.tag_____Tag__, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !16
  %98 = icmp eq ptr %93, %97
  %99 = zext i1 %98 to i32
  %100 = trunc i32 %99 to i8
  store i8 %100, ptr %21, align 1, !tbaa !15
  %101 = load i8, ptr %21, align 1, !tbaa !15
  %102 = icmp ne i8 %101, 0
  br i1 %102, label %113, label %103

103:                                              ; preds = %91
  %104 = getelementptr inbounds %struct.tag_____Tag__, ptr %5, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !9
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %106, i32 0, i32 13
  %108 = getelementptr inbounds %struct.tag_____Tag__, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !16
  %110 = icmp eq ptr %105, %109
  %111 = zext i1 %110 to i32
  %112 = trunc i32 %111 to i8
  store i8 %112, ptr %21, align 1, !tbaa !15
  br label %113

113:                                              ; preds = %103, %91
  %114 = load i8, ptr %21, align 1, !tbaa !15
  %115 = icmp ne i8 %114, 0
  br i1 %115, label %116, label %119

116:                                              ; preds = %113
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %117, i32 0, i32 13
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %118, i64 16, i1 false), !tbaa.struct !18
  br label %122

119:                                              ; preds = %113
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.tag_____CommonTags__, ptr %120, i32 0, i32 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %8, ptr align 8 %121, i64 16, i1 false), !tbaa.struct !18
  br label %122

122:                                              ; preds = %119, %116
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #3
  br label %138

123:                                              ; preds = %88
  %124 = load ptr, ptr %11, align 8, !tbaa !5
  %125 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8
  %127 = getelementptr inbounds { ptr, ptr }, ptr %9, i32 0, i32 1
  %128 = load ptr, ptr %127, align 8
  %129 = getelementptr inbounds { i32, ptr }, ptr %10, i32 0, i32 0
  %130 = load i32, ptr %129, align 8
  %131 = getelementptr inbounds { i32, ptr }, ptr %10, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8
  %133 = call { ptr, ptr } @TypeChecker__tryUnifyIntvals__(ptr noundef %124, ptr %126, ptr %128, i32 %130, ptr %132, ptr noundef byval(%struct.tag_____Tag__) align 8 %5, ptr noundef byval(%struct.Node__) align 8 %6)
  %134 = getelementptr inbounds { ptr, ptr }, ptr %8, i32 0, i32 0
  %135 = extractvalue { ptr, ptr } %133, 0
  store ptr %135, ptr %134, align 8
  %136 = getelementptr inbounds { ptr, ptr }, ptr %8, i32 0, i32 1
  %137 = extractvalue { ptr, ptr } %133, 1
  store ptr %137, ptr %136, align 8
  store i32 1, ptr %22, align 4
  br label %138

138:                                              ; preds = %123, %122
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  %139 = load { ptr, ptr }, ptr %8, align 8
  ret { ptr, ptr } %139
}

; Function Attrs: nounwind uwtable
declare dso_local { ptr, ptr } @TypeChecker__tryUnifyIntvals__(ptr noundef, ptr, ptr, i32, ptr, ptr noundef byval(%struct.tag_____Tag__) align 8, ptr noundef byval(%struct.Node__) align 8) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"tag_____Tag__", !6, i64 0, !6, i64 8}
!11 = !{!12, !14, i64 28}
!12 = !{!"tag_____Namespace__", !13, i64 0, !6, i64 16, !14, i64 24, !14, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !14, i64 104}
!13 = !{!"", !6, i64 0, !14, i64 8}
!14 = !{!"int", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !6, i64 208}
!17 = !{!"tag_____CommonTags__", !10, i64 0, !10, i64 16, !10, i64 32, !10, i64 48, !10, i64 64, !10, i64 80, !10, i64 96, !10, i64 112, !10, i64 128, !10, i64 144, !10, i64 160, !10, i64 176, !10, i64 192, !10, i64 208, !10, i64 224, !10, i64 240, !10, i64 256, !10, i64 272, !10, 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}
!18 = !{i64 0, i64 8, !5, i64 8, i64 8, !5}


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

; Function Attrs: nounwind uwtable
define dso_local { ptr, ptr } @TypeChecker__tryUnifyNumbers__(ptr noundef %0, ptr %1, ptr %2, i32 %3, ptr %4, ptr noundef byval(%struct.tag_____Tag__) align 8 %5, ptr noundef byval(%struct.Node__) align 8 %6) local_unnamed_addr #0 {
  %8 = getelementptr inbounds i8, ptr %1, i64 28
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = load ptr, ptr %5, align 8
  %11 = getelementptr inbounds i8, ptr %10, i64 28
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = and i32 %9, 4
  %.not = icmp eq i32 %13, 0
  %14 = and i32 %12, 4
  %15 = icmp eq i32 %14, 0
  %spec.select = select i1 %.not, i1 true, i1 %15
  br i1 %spec.select, label %16, label %.critedge44

16:                                               ; preds = %7
  %17 = and i32 %9, 1
  %.not39 = icmp eq i32 %17, 0
  %spec.select43 = select i1 %.not39, i1 true, i1 %15
  br i1 %spec.select43, label %.critedge, label %.critedge44

.critedge:                                        ; preds = %16
  %18 = and i32 %12, 1
  %19 = icmp eq i32 %18, 0
  %.030 = select i1 %.not, i1 true, i1 %19
  br i1 %.030, label %25, label %.critedge44

.critedge44:                                      ; preds = %16, %7, %.critedge
  %20 = getelementptr inbounds i8, ptr %0, i64 208
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = icmp ne ptr %21, %1
  %23 = icmp ne ptr %10, %21
  %.0 = and i1 %22, %23
  %24 = getelementptr inbounds i8, ptr %0, i64 192
  %.sroa.026.0.in = select i1 %.0, ptr %24, ptr %20
  %.sroa.4.0.in.v = select i1 %.0, i64 200, i64 216
  %.sroa.4.0.in = getelementptr inbounds i8, ptr %0, i64 %.sroa.4.0.in.v
  %.sroa.4.0 = load ptr, ptr %.sroa.4.0.in, align 8, !tbaa !15
  %.sroa.026.0 = load ptr, ptr %.sroa.026.0.in, align 8, !tbaa !15
  br label %29

25:                                               ; preds = %.critedge
  %26 = tail call { ptr, ptr } @TypeChecker__tryUnifyIntvals__(ptr noundef %0, ptr nonnull %1, ptr %2, i32 %3, ptr %4, ptr noundef nonnull byval(%struct.tag_____Tag__) align 8 %5, ptr noundef nonnull byval(%struct.Node__) align 8 %6)
  %27 = extractvalue { ptr, ptr } %26, 0
  %28 = extractvalue { ptr, ptr } %26, 1
  br label %29

29:                                               ; preds = %25, %.critedge44
  %.sroa.026.1 = phi ptr [ %.sroa.026.0, %.critedge44 ], [ %27, %25 ]
  %.sroa.4.1 = phi ptr [ %.sroa.4.0, %.critedge44 ], [ %28, %25 ]
  %.fca.0.insert = insertvalue { ptr, ptr } poison, ptr %.sroa.026.1, 0
  %.fca.1.insert = insertvalue { ptr, ptr } %.fca.0.insert, ptr %.sroa.4.1, 1
  ret { ptr, ptr } %.fca.1.insert
}

; Function Attrs: nounwind uwtable
declare dso_local { ptr, ptr } @TypeChecker__tryUnifyIntvals__(ptr noundef, ptr, ptr, i32, ptr, ptr noundef byval(%struct.tag_____Tag__) align 8, ptr noundef byval(%struct.Node__) align 8) local_unnamed_addr #0

attributes #0 = { 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" }

!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, !8, i64 208}
!13 = !{!"tag_____CommonTags__", !14, i64 0, !14, i64 16, !14, i64 32, !14, i64 48, !14, i64 64, !14, i64 80, !14, i64 96, !14, i64 112, !14, i64 128, !14, i64 144, !14, i64 160, !14, i64 176, !14, i64 192, !14, i64 208, !14, i64 224, !14, i64 240, !14, i64 256, !14, i64 272, !14, i64 288, !8, i64 304, !8, i64 312, !8, i64 320, !8, i64 328, !8, i64 336, !8, i64 344, !8, i64 352, !8, i64 360, !8, i64 368, !8, i64 376}
!14 = !{!"tag_____Tag__", !8, i64 0, !8, i64 8}
!15 = !{!8, !8, i64 0}


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