; LLVM IR from marcobambini/gravity :: src/runtime (gravity_core)

; 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"

@gravity_class_int = external dso_local global ptr, align 8
@gravity_class_float = external dso_local global ptr, align 8
@gravity_class_bool = external dso_local global ptr, align 8
@gravity_class_null = external dso_local global ptr, align 8
@gravity_class_string = external dso_local global ptr, align 8
@gravity_class_class = external dso_local global ptr, align 8
@gravity_class_function = external dso_local global ptr, align 8
@gravity_class_closure = external dso_local global ptr, align 8
@gravity_class_list = external dso_local global ptr, align 8
@gravity_class_map = external dso_local global ptr, align 8
@gravity_class_range = external dso_local global ptr, align 8
@gravity_class_fiber = external dso_local global ptr, align 8
@gravity_class_instance = external dso_local global ptr, align 8
@gravity_class_object = external dso_local global ptr, align 8
@gravity_class_upvalue = external dso_local global ptr, align 8
@gravity_class_system = external dso_local global ptr, align 8

declare ptr @gravity_class_get_meta(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @gravity_iscore_class(ptr noundef %0) #1 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = load ptr, ptr @gravity_class_object, align 8, !tbaa !5
  %6 = icmp eq ptr %4, %5
  br i1 %6, label %67, label %7

7:                                                ; preds = %1
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = load ptr, ptr @gravity_class_class, align 8, !tbaa !5
  %10 = icmp eq ptr %8, %9
  br i1 %10, label %67, label %11

11:                                               ; preds = %7
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = load ptr, ptr @gravity_class_bool, align 8, !tbaa !5
  %14 = icmp eq ptr %12, %13
  br i1 %14, label %67, label %15

15:                                               ; preds = %11
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr @gravity_class_null, align 8, !tbaa !5
  %18 = icmp eq ptr %16, %17
  br i1 %18, label %67, label %19

19:                                               ; preds = %15
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = load ptr, ptr @gravity_class_int, align 8, !tbaa !5
  %22 = icmp eq ptr %20, %21
  br i1 %22, label %67, label %23

23:                                               ; preds = %19
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = load ptr, ptr @gravity_class_float, align 8, !tbaa !5
  %26 = icmp eq ptr %24, %25
  br i1 %26, label %67, label %27

27:                                               ; preds = %23
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = load ptr, ptr @gravity_class_function, align 8, !tbaa !5
  %30 = icmp eq ptr %28, %29
  br i1 %30, label %67, label %31

31:                                               ; preds = %27
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = load ptr, ptr @gravity_class_fiber, align 8, !tbaa !5
  %34 = icmp eq ptr %32, %33
  br i1 %34, label %67, label %35

35:                                               ; preds = %31
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = load ptr, ptr @gravity_class_string, align 8, !tbaa !5
  %38 = icmp eq ptr %36, %37
  br i1 %38, label %67, label %39

39:                                               ; preds = %35
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = load ptr, ptr @gravity_class_instance, align 8, !tbaa !5
  %42 = icmp eq ptr %40, %41
  br i1 %42, label %67, label %43

43:                                               ; preds = %39
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = load ptr, ptr @gravity_class_list, align 8, !tbaa !5
  %46 = icmp eq ptr %44, %45
  br i1 %46, label %67, label %47

47:                                               ; preds = %43
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = load ptr, ptr @gravity_class_map, align 8, !tbaa !5
  %50 = icmp eq ptr %48, %49
  br i1 %50, label %67, label %51

51:                                               ; preds = %47
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = load ptr, ptr @gravity_class_range, align 8, !tbaa !5
  %54 = icmp eq ptr %52, %53
  br i1 %54, label %67, label %55

55:                                               ; preds = %51
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = load ptr, ptr @gravity_class_system, align 8, !tbaa !5
  %58 = icmp eq ptr %56, %57
  br i1 %58, label %67, label %59

59:                                               ; preds = %55
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = load ptr, ptr @gravity_class_closure, align 8, !tbaa !5
  %62 = icmp eq ptr %60, %61
  br i1 %62, label %67, label %63

63:                                               ; preds = %59
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = load ptr, ptr @gravity_class_upvalue, align 8, !tbaa !5
  %66 = icmp eq ptr %64, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %63, %59, %55, %51, %47, %43, %39, %35, %31, %27, %23, %19, %15, %11, %7, %1
  store i1 true, ptr %2, align 1
  br label %150

68:                                               ; preds = %63
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = load ptr, ptr @gravity_class_object, align 8, !tbaa !5
  %71 = call ptr @gravity_class_get_meta(ptr noundef %70)
  %72 = icmp eq ptr %69, %71
  br i1 %72, label %148, label %73

73:                                               ; preds = %68
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = load ptr, ptr @gravity_class_class, align 8, !tbaa !5
  %76 = call ptr @gravity_class_get_meta(ptr noundef %75)
  %77 = icmp eq ptr %74, %76
  br i1 %77, label %148, label %78

78:                                               ; preds = %73
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = load ptr, ptr @gravity_class_bool, align 8, !tbaa !5
  %81 = call ptr @gravity_class_get_meta(ptr noundef %80)
  %82 = icmp eq ptr %79, %81
  br i1 %82, label %148, label %83

83:                                               ; preds = %78
  %84 = load ptr, ptr %3, align 8, !tbaa !5
  %85 = load ptr, ptr @gravity_class_null, align 8, !tbaa !5
  %86 = call ptr @gravity_class_get_meta(ptr noundef %85)
  %87 = icmp eq ptr %84, %86
  br i1 %87, label %148, label %88

88:                                               ; preds = %83
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = load ptr, ptr @gravity_class_int, align 8, !tbaa !5
  %91 = call ptr @gravity_class_get_meta(ptr noundef %90)
  %92 = icmp eq ptr %89, %91
  br i1 %92, label %148, label %93

93:                                               ; preds = %88
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = load ptr, ptr @gravity_class_float, align 8, !tbaa !5
  %96 = call ptr @gravity_class_get_meta(ptr noundef %95)
  %97 = icmp eq ptr %94, %96
  br i1 %97, label %148, label %98

98:                                               ; preds = %93
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = load ptr, ptr @gravity_class_function, align 8, !tbaa !5
  %101 = call ptr @gravity_class_get_meta(ptr noundef %100)
  %102 = icmp eq ptr %99, %101
  br i1 %102, label %148, label %103

103:                                              ; preds = %98
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = load ptr, ptr @gravity_class_fiber, align 8, !tbaa !5
  %106 = call ptr @gravity_class_get_meta(ptr noundef %105)
  %107 = icmp eq ptr %104, %106
  br i1 %107, label %148, label %108

108:                                              ; preds = %103
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = load ptr, ptr @gravity_class_string, align 8, !tbaa !5
  %111 = call ptr @gravity_class_get_meta(ptr noundef %110)
  %112 = icmp eq ptr %109, %111
  br i1 %112, label %148, label %113

113:                                              ; preds = %108
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = load ptr, ptr @gravity_class_instance, align 8, !tbaa !5
  %116 = call ptr @gravity_class_get_meta(ptr noundef %115)
  %117 = icmp eq ptr %114, %116
  br i1 %117, label %148, label %118

118:                                              ; preds = %113
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = load ptr, ptr @gravity_class_list, align 8, !tbaa !5
  %121 = call ptr @gravity_class_get_meta(ptr noundef %120)
  %122 = icmp eq ptr %119, %121
  br i1 %122, label %148, label %123

123:                                              ; preds = %118
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = load ptr, ptr @gravity_class_map, align 8, !tbaa !5
  %126 = call ptr @gravity_class_get_meta(ptr noundef %125)
  %127 = icmp eq ptr %124, %126
  br i1 %127, label %148, label %128

128:                                              ; preds = %123
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = load ptr, ptr @gravity_class_range, align 8, !tbaa !5
  %131 = call ptr @gravity_class_get_meta(ptr noundef %130)
  %132 = icmp eq ptr %129, %131
  br i1 %132, label %148, label %133

133:                                              ; preds = %128
  %134 = load ptr, ptr %3, align 8, !tbaa !5
  %135 = load ptr, ptr @gravity_class_system, align 8, !tbaa !5
  %136 = call ptr @gravity_class_get_meta(ptr noundef %135)
  %137 = icmp eq ptr %134, %136
  br i1 %137, label %148, label %138

138:                                              ; preds = %133
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = load ptr, ptr @gravity_class_closure, align 8, !tbaa !5
  %141 = call ptr @gravity_class_get_meta(ptr noundef %140)
  %142 = icmp eq ptr %139, %141
  br i1 %142, label %148, label %143

143:                                              ; preds = %138
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = load ptr, ptr @gravity_class_upvalue, align 8, !tbaa !5
  %146 = call ptr @gravity_class_get_meta(ptr noundef %145)
  %147 = icmp eq ptr %144, %146
  br label %148

148:                                              ; preds = %143, %138, %133, %128, %123, %118, %113, %108, %103, %98, %93, %88, %83, %78, %73, %68
  %149 = phi i1 [ true, %138 ], [ true, %133 ], [ true, %128 ], [ true, %123 ], [ true, %118 ], [ true, %113 ], [ true, %108 ], [ true, %103 ], [ true, %98 ], [ true, %93 ], [ true, %88 ], [ true, %83 ], [ true, %78 ], [ true, %73 ], [ true, %68 ], [ %147, %143 ]
  store i1 %149, ptr %2, align 1
  br label %150

150:                                              ; preds = %148, %67
  %151 = load i1, ptr %2, align 1
  ret i1 %151
}

attributes #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 #1 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; 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"

@gravity_class_int = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_float = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_bool = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_null = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_string = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_class = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_function = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_closure = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_list = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_map = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_range = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_fiber = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_instance = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_object = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_upvalue = external dso_local local_unnamed_addr global ptr, align 8
@gravity_class_system = external dso_local local_unnamed_addr global ptr, align 8

declare ptr @gravity_class_get_meta(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @gravity_iscore_class(ptr noundef readnone %0) local_unnamed_addr #1 {
  %2 = load ptr, ptr @gravity_class_object, align 8, !tbaa !5
  %3 = load ptr, ptr @gravity_class_class, align 8
  %4 = load ptr, ptr @gravity_class_bool, align 8
  %5 = load ptr, ptr @gravity_class_null, align 8
  %6 = load ptr, ptr @gravity_class_int, align 8
  %7 = load ptr, ptr @gravity_class_float, align 8
  %8 = load ptr, ptr @gravity_class_function, align 8
  %9 = load ptr, ptr @gravity_class_fiber, align 8
  %10 = load ptr, ptr @gravity_class_string, align 8
  %11 = load ptr, ptr @gravity_class_instance, align 8
  %12 = load ptr, ptr @gravity_class_list, align 8
  %13 = load ptr, ptr @gravity_class_map, align 8
  %14 = load ptr, ptr @gravity_class_range, align 8
  %15 = load ptr, ptr @gravity_class_system, align 8
  %16 = load ptr, ptr @gravity_class_closure, align 8
  %17 = load ptr, ptr @gravity_class_upvalue, align 8
  %18 = insertelement <16 x ptr> poison, ptr %2, i64 0
  %19 = insertelement <16 x ptr> %18, ptr %3, i64 1
  %20 = insertelement <16 x ptr> %19, ptr %4, i64 2
  %21 = insertelement <16 x ptr> %20, ptr %5, i64 3
  %22 = insertelement <16 x ptr> %21, ptr %6, i64 4
  %23 = insertelement <16 x ptr> %22, ptr %7, i64 5
  %24 = insertelement <16 x ptr> %23, ptr %8, i64 6
  %25 = insertelement <16 x ptr> %24, ptr %9, i64 7
  %26 = insertelement <16 x ptr> %25, ptr %10, i64 8
  %27 = insertelement <16 x ptr> %26, ptr %11, i64 9
  %28 = insertelement <16 x ptr> %27, ptr %12, i64 10
  %29 = insertelement <16 x ptr> %28, ptr %13, i64 11
  %30 = insertelement <16 x ptr> %29, ptr %14, i64 12
  %31 = insertelement <16 x ptr> %30, ptr %15, i64 13
  %32 = insertelement <16 x ptr> %31, ptr %16, i64 14
  %33 = insertelement <16 x ptr> %32, ptr %17, i64 15
  %34 = insertelement <16 x ptr> poison, ptr %0, i64 0
  %35 = shufflevector <16 x ptr> %34, <16 x ptr> poison, <16 x i32> zeroinitializer
  %36 = icmp eq <16 x ptr> %33, %35
  %37 = freeze <16 x i1> %36
  %38 = bitcast <16 x i1> %37 to i16
  %.not = icmp eq i16 %38, 0
  br i1 %.not, label %39, label %102

39:                                               ; preds = %1
  %40 = tail call ptr @gravity_class_get_meta(ptr noundef %2) #2
  %41 = icmp eq ptr %40, %0
  br i1 %41, label %102, label %42

42:                                               ; preds = %39
  %43 = load ptr, ptr @gravity_class_class, align 8, !tbaa !5
  %44 = tail call ptr @gravity_class_get_meta(ptr noundef %43) #2
  %45 = icmp eq ptr %44, %0
  br i1 %45, label %102, label %46

46:                                               ; preds = %42
  %47 = load ptr, ptr @gravity_class_bool, align 8, !tbaa !5
  %48 = tail call ptr @gravity_class_get_meta(ptr noundef %47) #2
  %49 = icmp eq ptr %48, %0
  br i1 %49, label %102, label %50

50:                                               ; preds = %46
  %51 = load ptr, ptr @gravity_class_null, align 8, !tbaa !5
  %52 = tail call ptr @gravity_class_get_meta(ptr noundef %51) #2
  %53 = icmp eq ptr %52, %0
  br i1 %53, label %102, label %54

54:                                               ; preds = %50
  %55 = load ptr, ptr @gravity_class_int, align 8, !tbaa !5
  %56 = tail call ptr @gravity_class_get_meta(ptr noundef %55) #2
  %57 = icmp eq ptr %56, %0
  br i1 %57, label %102, label %58

58:                                               ; preds = %54
  %59 = load ptr, ptr @gravity_class_float, align 8, !tbaa !5
  %60 = tail call ptr @gravity_class_get_meta(ptr noundef %59) #2
  %61 = icmp eq ptr %60, %0
  br i1 %61, label %102, label %62

62:                                               ; preds = %58
  %63 = load ptr, ptr @gravity_class_function, align 8, !tbaa !5
  %64 = tail call ptr @gravity_class_get_meta(ptr noundef %63) #2
  %65 = icmp eq ptr %64, %0
  br i1 %65, label %102, label %66

66:                                               ; preds = %62
  %67 = load ptr, ptr @gravity_class_fiber, align 8, !tbaa !5
  %68 = tail call ptr @gravity_class_get_meta(ptr noundef %67) #2
  %69 = icmp eq ptr %68, %0
  br i1 %69, label %102, label %70

70:                                               ; preds = %66
  %71 = load ptr, ptr @gravity_class_string, align 8, !tbaa !5
  %72 = tail call ptr @gravity_class_get_meta(ptr noundef %71) #2
  %73 = icmp eq ptr %72, %0
  br i1 %73, label %102, label %74

74:                                               ; preds = %70
  %75 = load ptr, ptr @gravity_class_instance, align 8, !tbaa !5
  %76 = tail call ptr @gravity_class_get_meta(ptr noundef %75) #2
  %77 = icmp eq ptr %76, %0
  br i1 %77, label %102, label %78

78:                                               ; preds = %74
  %79 = load ptr, ptr @gravity_class_list, align 8, !tbaa !5
  %80 = tail call ptr @gravity_class_get_meta(ptr noundef %79) #2
  %81 = icmp eq ptr %80, %0
  br i1 %81, label %102, label %82

82:                                               ; preds = %78
  %83 = load ptr, ptr @gravity_class_map, align 8, !tbaa !5
  %84 = tail call ptr @gravity_class_get_meta(ptr noundef %83) #2
  %85 = icmp eq ptr %84, %0
  br i1 %85, label %102, label %86

86:                                               ; preds = %82
  %87 = load ptr, ptr @gravity_class_range, align 8, !tbaa !5
  %88 = tail call ptr @gravity_class_get_meta(ptr noundef %87) #2
  %89 = icmp eq ptr %88, %0
  br i1 %89, label %102, label %90

90:                                               ; preds = %86
  %91 = load ptr, ptr @gravity_class_system, align 8, !tbaa !5
  %92 = tail call ptr @gravity_class_get_meta(ptr noundef %91) #2
  %93 = icmp eq ptr %92, %0
  br i1 %93, label %102, label %94

94:                                               ; preds = %90
  %95 = load ptr, ptr @gravity_class_closure, align 8, !tbaa !5
  %96 = tail call ptr @gravity_class_get_meta(ptr noundef %95) #2
  %97 = icmp eq ptr %96, %0
  br i1 %97, label %102, label %98

98:                                               ; preds = %94
  %99 = load ptr, ptr @gravity_class_upvalue, align 8, !tbaa !5
  %100 = tail call ptr @gravity_class_get_meta(ptr noundef %99) #2
  %101 = icmp eq ptr %100, %0
  br label %102

102:                                              ; preds = %39, %42, %46, %50, %54, %58, %62, %66, %70, %74, %78, %82, %86, %90, %94, %98, %1
  %.0 = phi i1 [ true, %1 ], [ true, %94 ], [ true, %90 ], [ true, %86 ], [ true, %82 ], [ true, %78 ], [ true, %74 ], [ true, %70 ], [ true, %66 ], [ true, %62 ], [ true, %58 ], [ true, %54 ], [ true, %50 ], [ true, %46 ], [ true, %42 ], [ true, %39 ], [ %101, %98 ]
  ret i1 %.0
}

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


; Effective O3 passes: EarlyCSEPass,GlobalDCEPass,GlobalOptPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass