; LLVM IR from marcobambini/gravity :: src/shared (gravity_value)

; 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.gravity_value_t = type { ptr, %union.anon }
%union.anon = type { i64 }
%struct.gravity_string_t = type { ptr, %struct.gravity_gc_s, ptr, i32, i32, i32 }
%struct.gravity_gc_s = type { i8, i8, ptr, ptr, ptr, ptr }
%struct.gravity_range_t = type { ptr, %struct.gravity_gc_s, i64, i64 }
%struct.gravity_list_t = type { ptr, %struct.gravity_gc_s, %struct.gravity_value_r }
%struct.gravity_value_r = type { i64, i64, ptr }
%struct.gravity_map_t = type { ptr, %struct.gravity_gc_s, ptr }
%struct.gravity_class_s = type { ptr, %struct.gravity_gc_s, ptr, ptr, i8, i8, i8, i8, ptr, ptr, ptr, ptr, i32, ptr }

@gravity_class_null = external global ptr, align 8
@gravity_class_string = external global ptr, align 8
@gravity_class_int = external global ptr, align 8
@gravity_class_float = external global ptr, align 8
@gravity_class_bool = external global ptr, align 8
@gravity_class_range = external global ptr, align 8
@gravity_class_list = external global ptr, align 8
@gravity_class_map = external global ptr, 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: nounwind uwtable
define dso_local zeroext i1 @gravity_value_equals(ptr %0, i64 %1, ptr %2, i64 %3) #1 {
  %5 = alloca i1, align 1
  %6 = alloca %struct.gravity_value_t, align 8
  %7 = alloca %struct.gravity_value_t, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %struct.gravity_value_t, align 8
  %18 = alloca %struct.gravity_value_t, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 0
  store ptr %0, ptr %23, align 8
  %24 = getelementptr inbounds { ptr, i64 }, ptr %6, i32 0, i32 1
  store i64 %1, ptr %24, align 8
  %25 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 0
  store ptr %2, ptr %25, align 8
  %26 = getelementptr inbounds { ptr, i64 }, ptr %7, i32 0, i32 1
  store i64 %3, ptr %26, align 8
  %27 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.gravity_value_t, ptr %7, i32 0, i32 0
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = icmp ne ptr %28, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %4
  store i1 false, ptr %5, align 1
  br label %240

33:                                               ; preds = %4
  %34 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = load ptr, ptr @gravity_class_int, align 8, !tbaa !10
  %37 = icmp eq ptr %35, %36
  br i1 %37, label %48, label %38

38:                                               ; preds = %33
  %39 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !5
  %41 = load ptr, ptr @gravity_class_bool, align 8, !tbaa !10
  %42 = icmp eq ptr %40, %41
  br i1 %42, label %48, label %43

43:                                               ; preds = %38
  %44 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  %46 = load ptr, ptr @gravity_class_null, align 8, !tbaa !10
  %47 = icmp eq ptr %45, %46
  br i1 %47, label %48, label %54

48:                                               ; preds = %43, %38, %33
  %49 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 1
  %50 = load i64, ptr %49, align 8, !tbaa !11
  %51 = getelementptr inbounds %struct.gravity_value_t, ptr %7, i32 0, i32 1
  %52 = load i64, ptr %51, align 8, !tbaa !11
  %53 = icmp eq i64 %50, %52
  store i1 %53, ptr %5, align 1
  br label %240

54:                                               ; preds = %43
  %55 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  %57 = load ptr, ptr @gravity_class_float, align 8, !tbaa !10
  %58 = icmp eq ptr %56, %57
  br i1 %58, label %59, label %67

59:                                               ; preds = %54
  %60 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 1
  %61 = load double, ptr %60, align 8, !tbaa !11
  %62 = getelementptr inbounds %struct.gravity_value_t, ptr %7, i32 0, i32 1
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = fsub double %61, %63
  %65 = call double @llvm.fabs.f64(double %64)
  %66 = fcmp olt double %65, 0x3EB0C6F7A0B5ED8D
  store i1 %66, ptr %5, align 1
  br label %240

67:                                               ; preds = %54
  %68 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = load ptr, ptr @gravity_class_string, align 8, !tbaa !10
  %71 = icmp eq ptr %69, %70
  br i1 %71, label %72, label %108

72:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %73 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 1
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  store ptr %74, ptr %8, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %75 = getelementptr inbounds %struct.gravity_value_t, ptr %7, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  store ptr %76, ptr %9, align 8, !tbaa !10
  %77 = load ptr, ptr %8, align 8, !tbaa !10
  %78 = getelementptr inbounds %struct.gravity_string_t, ptr %77, i32 0, i32 3
  %79 = load i32, ptr %78, align 8, !tbaa !12
  %80 = load ptr, ptr %9, align 8, !tbaa !10
  %81 = getelementptr inbounds %struct.gravity_string_t, ptr %80, i32 0, i32 3
  %82 = load i32, ptr %81, align 8, !tbaa !12
  %83 = icmp ne i32 %79, %82
  br i1 %83, label %84, label %85

84:                                               ; preds = %72
  store i1 false, ptr %5, align 1
  store i32 1, ptr %10, align 4
  br label %107

85:                                               ; preds = %72
  %86 = load ptr, ptr %8, align 8, !tbaa !10
  %87 = getelementptr inbounds %struct.gravity_string_t, ptr %86, i32 0, i32 4
  %88 = load i32, ptr %87, align 4, !tbaa !17
  %89 = load ptr, ptr %9, align 8, !tbaa !10
  %90 = getelementptr inbounds %struct.gravity_string_t, ptr %89, i32 0, i32 4
  %91 = load i32, ptr %90, align 4, !tbaa !17
  %92 = icmp ne i32 %88, %91
  br i1 %92, label %93, label %94

93:                                               ; preds = %85
  store i1 false, ptr %5, align 1
  store i32 1, ptr %10, align 4
  br label %107

94:                                               ; preds = %85
  %95 = load ptr, ptr %8, align 8, !tbaa !10
  %96 = getelementptr inbounds %struct.gravity_string_t, ptr %95, i32 0, i32 2
  %97 = load ptr, ptr %96, align 8, !tbaa !18
  %98 = load ptr, ptr %9, align 8, !tbaa !10
  %99 = getelementptr inbounds %struct.gravity_string_t, ptr %98, i32 0, i32 2
  %100 = load ptr, ptr %99, align 8, !tbaa !18
  %101 = load ptr, ptr %8, align 8, !tbaa !10
  %102 = getelementptr inbounds %struct.gravity_string_t, ptr %101, i32 0, i32 4
  %103 = load i32, ptr %102, align 4, !tbaa !17
  %104 = zext i32 %103 to i64
  %105 = call i32 @memcmp(ptr noundef %97, ptr noundef %100, i64 noundef %104) #7
  %106 = icmp eq i32 %105, 0
  store i1 %106, ptr %5, align 1
  store i32 1, ptr %10, align 4
  br label %107

107:                                              ; preds = %94, %93, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %240

108:                                              ; preds = %67
  %109 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = load ptr, ptr @gravity_class_range, align 8, !tbaa !10
  %112 = icmp eq ptr %110, %111
  br i1 %112, label %113, label %135

113:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %114 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !11
  store ptr %115, ptr %11, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %116 = getelementptr inbounds %struct.gravity_value_t, ptr %7, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !11
  store ptr %117, ptr %12, align 8, !tbaa !10
  %118 = load ptr, ptr %11, align 8, !tbaa !10
  %119 = getelementptr inbounds %struct.gravity_range_t, ptr %118, i32 0, i32 2
  %120 = load i64, ptr %119, align 8, !tbaa !19
  %121 = load ptr, ptr %12, align 8, !tbaa !10
  %122 = getelementptr inbounds %struct.gravity_range_t, ptr %121, i32 0, i32 2
  %123 = load i64, ptr %122, align 8, !tbaa !19
  %124 = icmp eq i64 %120, %123
  br i1 %124, label %125, label %133

125:                                              ; preds = %113
  %126 = load ptr, ptr %11, align 8, !tbaa !10
  %127 = getelementptr inbounds %struct.gravity_range_t, ptr %126, i32 0, i32 3
  %128 = load i64, ptr %127, align 8, !tbaa !22
  %129 = load ptr, ptr %12, align 8, !tbaa !10
  %130 = getelementptr inbounds %struct.gravity_range_t, ptr %129, i32 0, i32 3
  %131 = load i64, ptr %130, align 8, !tbaa !22
  %132 = icmp eq i64 %128, %131
  br label %133

133:                                              ; preds = %125, %113
  %134 = phi i1 [ false, %113 ], [ %132, %125 ]
  store i1 %134, ptr %5, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %240

135:                                              ; preds = %108
  %136 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !5
  %138 = load ptr, ptr @gravity_class_list, align 8, !tbaa !10
  %139 = icmp eq ptr %137, %138
  br i1 %139, label %140, label %200

140:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %141 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 1
  %142 = load ptr, ptr %141, align 8, !tbaa !11
  store ptr %142, ptr %13, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %143 = getelementptr inbounds %struct.gravity_value_t, ptr %7, i32 0, i32 1
  %144 = load ptr, ptr %143, align 8, !tbaa !11
  store ptr %144, ptr %14, align 8, !tbaa !10
  %145 = load ptr, ptr %13, align 8, !tbaa !10
  %146 = getelementptr inbounds %struct.gravity_list_t, ptr %145, i32 0, i32 2
  %147 = getelementptr inbounds %struct.gravity_value_r, ptr %146, i32 0, i32 0
  %148 = load i64, ptr %147, align 8, !tbaa !23
  %149 = load ptr, ptr %14, align 8, !tbaa !10
  %150 = getelementptr inbounds %struct.gravity_list_t, ptr %149, i32 0, i32 2
  %151 = getelementptr inbounds %struct.gravity_value_r, ptr %150, i32 0, i32 0
  %152 = load i64, ptr %151, align 8, !tbaa !23
  %153 = icmp ne i64 %148, %152
  br i1 %153, label %154, label %155

154:                                              ; preds = %140
  store i1 false, ptr %5, align 1
  store i32 1, ptr %10, align 4
  br label %199

155:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %156 = load ptr, ptr %13, align 8, !tbaa !10
  %157 = getelementptr inbounds %struct.gravity_list_t, ptr %156, i32 0, i32 2
  %158 = getelementptr inbounds %struct.gravity_value_r, ptr %157, i32 0, i32 0
  %159 = load i64, ptr %158, align 8, !tbaa !23
  store i64 %159, ptr %15, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  store i64 0, ptr %16, align 8, !tbaa !26
  br label %160

160:                                              ; preds = %192, %155
  %161 = load i64, ptr %16, align 8, !tbaa !26
  %162 = load i64, ptr %15, align 8, !tbaa !26
  %163 = icmp ult i64 %161, %162
  br i1 %163, label %165, label %164

164:                                              ; preds = %160
  store i32 2, ptr %10, align 4
  br label %195

165:                                              ; preds = %160
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %166 = load ptr, ptr %13, align 8, !tbaa !10
  %167 = getelementptr inbounds %struct.gravity_list_t, ptr %166, i32 0, i32 2
  %168 = getelementptr inbounds %struct.gravity_value_r, ptr %167, i32 0, i32 2
  %169 = load ptr, ptr %168, align 8, !tbaa !27
  %170 = load i64, ptr %16, align 8, !tbaa !26
  %171 = getelementptr inbounds %struct.gravity_value_t, ptr %169, i64 %170
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %17, ptr align 8 %171, i64 16, i1 false), !tbaa.struct !28
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #6
  %172 = load ptr, ptr %14, align 8, !tbaa !10
  %173 = getelementptr inbounds %struct.gravity_list_t, ptr %172, i32 0, i32 2
  %174 = getelementptr inbounds %struct.gravity_value_r, ptr %173, i32 0, i32 2
  %175 = load ptr, ptr %174, align 8, !tbaa !27
  %176 = load i64, ptr %16, align 8, !tbaa !26
  %177 = getelementptr inbounds %struct.gravity_value_t, ptr %175, i64 %176
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %18, ptr align 8 %177, i64 16, i1 false), !tbaa.struct !28
  %178 = getelementptr inbounds { ptr, i64 }, ptr %17, i32 0, i32 0
  %179 = load ptr, ptr %178, align 8
  %180 = getelementptr inbounds { ptr, i64 }, ptr %17, i32 0, i32 1
  %181 = load i64, ptr %180, align 8
  %182 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 0
  %183 = load ptr, ptr %182, align 8
  %184 = getelementptr inbounds { ptr, i64 }, ptr %18, i32 0, i32 1
  %185 = load i64, ptr %184, align 8
  %186 = call zeroext i1 @gravity_value_equals(ptr %179, i64 %181, ptr %183, i64 %185)
  br i1 %186, label %188, label %187

187:                                              ; preds = %165
  store i1 false, ptr %5, align 1
  store i32 1, ptr %10, align 4
  br label %189

188:                                              ; preds = %165
  store i32 0, ptr %10, align 4
  br label %189

189:                                              ; preds = %188, %187
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  %190 = load i32, ptr %10, align 4
  switch i32 %190, label %195 [
    i32 0, label %191
  ]

191:                                              ; preds = %189
  br label %192

192:                                              ; preds = %191
  %193 = load i64, ptr %16, align 8, !tbaa !26
  %194 = add i64 %193, 1
  store i64 %194, ptr %16, align 8, !tbaa !26
  br label %160, !llvm.loop !29

195:                                              ; preds = %189, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  %196 = load i32, ptr %10, align 4
  switch i32 %196, label %198 [
    i32 2, label %197
  ]

197:                                              ; preds = %195
  store i1 true, ptr %5, align 1
  store i32 1, ptr %10, align 4
  br label %198

198:                                              ; preds = %197, %195
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %199

199:                                              ; preds = %198, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  br label %240

200:                                              ; preds = %135
  %201 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 0
  %202 = load ptr, ptr %201, align 8, !tbaa !5
  %203 = load ptr, ptr @gravity_class_map, align 8, !tbaa !10
  %204 = icmp eq ptr %202, %203
  br i1 %204, label %205, label %217

205:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %206 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 1
  %207 = load ptr, ptr %206, align 8, !tbaa !11
  store ptr %207, ptr %19, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %208 = getelementptr inbounds %struct.gravity_value_t, ptr %7, i32 0, i32 1
  %209 = load ptr, ptr %208, align 8, !tbaa !11
  store ptr %209, ptr %20, align 8, !tbaa !10
  %210 = load ptr, ptr %19, align 8, !tbaa !10
  %211 = getelementptr inbounds %struct.gravity_map_t, ptr %210, i32 0, i32 2
  %212 = load ptr, ptr %211, align 8, !tbaa !31
  %213 = load ptr, ptr %20, align 8, !tbaa !10
  %214 = getelementptr inbounds %struct.gravity_map_t, ptr %213, i32 0, i32 2
  %215 = load ptr, ptr %214, align 8, !tbaa !31
  %216 = call zeroext i1 @gravity_hash_compare(ptr noundef %212, ptr noundef %215, ptr noundef @hash_value_compare_cb, ptr noundef null)
  store i1 %216, ptr %5, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %240

217:                                              ; preds = %200
  br label %218

218:                                              ; preds = %217
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  br label %221

221:                                              ; preds = %220
  br label %222

222:                                              ; preds = %221
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %223 = getelementptr inbounds %struct.gravity_value_t, ptr %6, i32 0, i32 1
  %224 = load ptr, ptr %223, align 8, !tbaa !11
  store ptr %224, ptr %21, align 8, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %225 = getelementptr inbounds %struct.gravity_value_t, ptr %7, i32 0, i32 1
  %226 = load ptr, ptr %225, align 8, !tbaa !11
  store ptr %226, ptr %22, align 8, !tbaa !10
  %227 = load ptr, ptr %21, align 8, !tbaa !10
  %228 = getelementptr inbounds %struct.gravity_class_s, ptr %227, i32 0, i32 0
  %229 = load ptr, ptr %228, align 8, !tbaa !33
  %230 = load ptr, ptr %22, align 8, !tbaa !10
  %231 = getelementptr inbounds %struct.gravity_class_s, ptr %230, i32 0, i32 0
  %232 = load ptr, ptr %231, align 8, !tbaa !33
  %233 = icmp ne ptr %229, %232
  br i1 %233, label %234, label %235

234:                                              ; preds = %222
  store i1 false, ptr %5, align 1
  store i32 1, ptr %10, align 4
  br label %239

235:                                              ; preds = %222
  %236 = load ptr, ptr %21, align 8, !tbaa !10
  %237 = load ptr, ptr %22, align 8, !tbaa !10
  %238 = icmp eq ptr %236, %237
  store i1 %238, ptr %5, align 1
  store i32 1, ptr %10, align 4
  br label %239

239:                                              ; preds = %235, %234
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  br label %240

240:                                              ; preds = %239, %205, %199, %133, %107, %59, %48, %32
  %241 = load i1, ptr %5, align 1
  ret i1 %241
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #4

declare zeroext i1 @gravity_hash_compare(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @hash_value_compare_cb(ptr, i64, ptr, i64, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind willreturn memory(read) "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 = { "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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !8, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !16, i64 56}
!13 = !{!"", !7, i64 0, !14, i64 8, !7, i64 48, !16, i64 56, !16, i64 60, !16, i64 64}
!14 = !{!"gravity_gc_s", !15, i64 0, !15, i64 1, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!15 = !{!"_Bool", !8, i64 0}
!16 = !{!"int", !8, i64 0}
!17 = !{!13, !16, i64 60}
!18 = !{!13, !7, i64 48}
!19 = !{!20, !21, i64 48}
!20 = !{!"", !7, i64 0, !14, i64 8, !21, i64 48, !21, i64 56}
!21 = !{!"long", !8, i64 0}
!22 = !{!20, !21, i64 56}
!23 = !{!24, !21, i64 48}
!24 = !{!"", !7, i64 0, !14, i64 8, !25, i64 48}
!25 = !{!"", !21, i64 0, !21, i64 8, !7, i64 16}
!26 = !{!21, !21, i64 0}
!27 = !{!24, !7, i64 64}
!28 = !{i64 0, i64 8, !10, i64 8, i64 8, !11}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !7, i64 48}
!32 = !{!"", !7, i64 0, !14, i64 8, !7, i64 48}
!33 = !{!34, !7, i64 0}
!34 = !{!"gravity_class_s", !7, i64 0, !14, i64 8, !7, i64 48, !7, i64 56, !15, i64 64, !15, i64 65, !15, i64 66, !15, i64 67, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !16, i64 104, !7, i64 112}


; 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.gravity_value_t = type { ptr, %union.anon }
%union.anon = type { i64 }

@gravity_class_null = external local_unnamed_addr global ptr, align 8
@gravity_class_string = external local_unnamed_addr global ptr, align 8
@gravity_class_int = external local_unnamed_addr global ptr, align 8
@gravity_class_float = external local_unnamed_addr global ptr, align 8
@gravity_class_bool = external local_unnamed_addr global ptr, align 8
@gravity_class_range = external local_unnamed_addr global ptr, align 8
@gravity_class_list = external local_unnamed_addr global ptr, align 8
@gravity_class_map = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @gravity_value_equals(ptr readnone %0, i64 %1, ptr readnone %2, i64 %3) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, %2
  br i1 %.not, label %5, label %.critedge

5:                                                ; preds = %4
  %6 = load ptr, ptr @gravity_class_int, align 8, !tbaa !5
  %7 = icmp eq ptr %6, %0
  %8 = load ptr, ptr @gravity_class_bool, align 8
  %9 = icmp eq ptr %8, %0
  %or.cond = select i1 %7, i1 true, i1 %9
  %10 = load ptr, ptr @gravity_class_null, align 8
  %11 = icmp eq ptr %10, %0
  %or.cond65 = select i1 %or.cond, i1 true, i1 %11
  br i1 %or.cond65, label %12, label %14

12:                                               ; preds = %5
  %13 = icmp eq i64 %1, %3
  br label %.critedge

14:                                               ; preds = %5
  %15 = load ptr, ptr @gravity_class_float, align 8, !tbaa !5
  %16 = icmp eq ptr %15, %0
  br i1 %16, label %17, label %23

17:                                               ; preds = %14
  %18 = bitcast i64 %1 to double
  %19 = bitcast i64 %3 to double
  %20 = fsub double %18, %19
  %21 = tail call double @llvm.fabs.f64(double %20)
  %22 = fcmp olt double %21, 0x3EB0C6F7A0B5ED8D
  br label %.critedge

23:                                               ; preds = %14
  %24 = load ptr, ptr @gravity_class_string, align 8, !tbaa !5
  %25 = icmp eq ptr %24, %0
  br i1 %25, label %26, label %45

26:                                               ; preds = %23
  %27 = inttoptr i64 %1 to ptr
  %28 = inttoptr i64 %3 to ptr
  %29 = getelementptr inbounds i8, ptr %27, i64 56
  %30 = load i32, ptr %29, align 8, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %28, i64 56
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %.not61 = icmp eq i32 %30, %32
  br i1 %.not61, label %33, label %.critedge

33:                                               ; preds = %26
  %34 = getelementptr inbounds i8, ptr %27, i64 60
  %35 = load i32, ptr %34, align 4, !tbaa !14
  %36 = getelementptr inbounds i8, ptr %28, i64 60
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %.not62 = icmp eq i32 %35, %37
  br i1 %.not62, label %38, label %.critedge

38:                                               ; preds = %33
  %39 = getelementptr inbounds i8, ptr %27, i64 48
  %40 = load ptr, ptr %39, align 8, !tbaa !15
  %41 = getelementptr inbounds i8, ptr %28, i64 48
  %42 = load ptr, ptr %41, align 8, !tbaa !15
  %43 = zext i32 %35 to i64
  %bcmp = tail call i32 @bcmp(ptr %40, ptr %42, i64 %43)
  %44 = icmp eq i32 %bcmp, 0
  br label %.critedge

45:                                               ; preds = %23
  %46 = load ptr, ptr @gravity_class_range, align 8, !tbaa !5
  %47 = icmp eq ptr %46, %0
  br i1 %47, label %48, label %62

48:                                               ; preds = %45
  %49 = inttoptr i64 %1 to ptr
  %50 = inttoptr i64 %3 to ptr
  %51 = getelementptr inbounds i8, ptr %49, i64 48
  %52 = load i64, ptr %51, align 8, !tbaa !16
  %53 = getelementptr inbounds i8, ptr %50, i64 48
  %54 = load i64, ptr %53, align 8, !tbaa !16
  %55 = icmp eq i64 %52, %54
  br i1 %55, label %56, label %.critedge

56:                                               ; preds = %48
  %57 = getelementptr inbounds i8, ptr %49, i64 56
  %58 = load i64, ptr %57, align 8, !tbaa !19
  %59 = getelementptr inbounds i8, ptr %50, i64 56
  %60 = load i64, ptr %59, align 8, !tbaa !19
  %61 = icmp eq i64 %58, %60
  br label %.critedge

62:                                               ; preds = %45
  %63 = load ptr, ptr @gravity_class_list, align 8, !tbaa !5
  %64 = icmp eq ptr %63, %0
  br i1 %64, label %65, label %81

65:                                               ; preds = %62
  %66 = inttoptr i64 %1 to ptr
  %67 = inttoptr i64 %3 to ptr
  %68 = getelementptr inbounds i8, ptr %66, i64 48
  %69 = load i64, ptr %68, align 8, !tbaa !20
  %70 = getelementptr inbounds i8, ptr %67, i64 48
  %71 = load i64, ptr %70, align 8, !tbaa !20
  %.not59 = icmp eq i64 %69, %71
  br i1 %.not59, label %.preheader, label %.critedge

.preheader:                                       ; preds = %65
  %.not60.not66.not = icmp eq i64 %69, 0
  br i1 %.not60.not66.not, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %72 = getelementptr inbounds i8, ptr %66, i64 64
  %73 = getelementptr inbounds i8, ptr %67, i64 64
  br label %74

74:                                               ; preds = %74, %.lr.ph
  %.05467 = phi i64 [ 0, %.lr.ph ], [ %80, %74 ]
  %75 = load ptr, ptr %72, align 8, !tbaa !23
  %76 = getelementptr inbounds %struct.gravity_value_t, ptr %75, i64 %.05467
  %.sroa.07.0.copyload = load ptr, ptr %76, align 8, !tbaa !5
  %.sroa.48.0..sroa_idx = getelementptr inbounds i8, ptr %76, i64 8
  %.sroa.48.0.copyload = load i64, ptr %.sroa.48.0..sroa_idx, align 8, !tbaa !24
  %77 = load ptr, ptr %73, align 8, !tbaa !23
  %78 = getelementptr inbounds %struct.gravity_value_t, ptr %77, i64 %.05467
  %.sroa.0.0.copyload = load ptr, ptr %78, align 8, !tbaa !5
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %78, i64 8
  %.sroa.4.0.copyload = load i64, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !24
  %79 = tail call zeroext i1 @gravity_value_equals(ptr %.sroa.07.0.copyload, i64 %.sroa.48.0.copyload, ptr %.sroa.0.0.copyload, i64 %.sroa.4.0.copyload)
  %80 = add nuw i64 %.05467, 1
  %exitcond.not = icmp ne i64 %80, %69
  %or.cond71.not = select i1 %79, i1 %exitcond.not, i1 false
  br i1 %or.cond71.not, label %74, label %.critedge, !llvm.loop !25

81:                                               ; preds = %62
  %82 = load ptr, ptr @gravity_class_map, align 8, !tbaa !5
  %83 = icmp eq ptr %82, %0
  %84 = inttoptr i64 %1 to ptr
  %85 = inttoptr i64 %3 to ptr
  br i1 %83, label %86, label %92

86:                                               ; preds = %81
  %87 = getelementptr inbounds i8, ptr %84, i64 48
  %88 = load ptr, ptr %87, align 8, !tbaa !27
  %89 = getelementptr inbounds i8, ptr %85, i64 48
  %90 = load ptr, ptr %89, align 8, !tbaa !27
  %91 = tail call zeroext i1 @gravity_hash_compare(ptr noundef %88, ptr noundef %90, ptr noundef nonnull @hash_value_compare_cb, ptr noundef null) #4
  br label %.critedge

92:                                               ; preds = %81
  %93 = load ptr, ptr %84, align 8, !tbaa !29
  %94 = load ptr, ptr %85, align 8, !tbaa !29
  %.not58 = icmp eq ptr %93, %94
  %95 = icmp eq ptr %84, %85
  %.6 = and i1 %95, %.not58
  br label %.critedge

.critedge:                                        ; preds = %74, %.preheader, %65, %48, %56, %38, %26, %33, %4, %92, %86, %17, %12
  %.7 = phi i1 [ %13, %12 ], [ %22, %17 ], [ %91, %86 ], [ %.6, %92 ], [ false, %4 ], [ %44, %38 ], [ false, %26 ], [ false, %33 ], [ false, %48 ], [ %61, %56 ], [ false, %65 ], [ true, %.preheader ], [ %79, %74 ]
  ret i1 %.7
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #1

declare zeroext i1 @gravity_hash_compare(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @hash_value_compare_cb(ptr, i64, ptr, i64, ptr noundef) #0

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #3

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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { "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 = { nofree nounwind willreturn memory(argmem: read) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !13, i64 56}
!10 = !{!"", !6, i64 0, !11, i64 8, !6, i64 48, !13, i64 56, !13, i64 60, !13, i64 64}
!11 = !{!"gravity_gc_s", !12, i64 0, !12, i64 1, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!10, !13, i64 60}
!15 = !{!10, !6, i64 48}
!16 = !{!17, !18, i64 48}
!17 = !{!"", !6, i64 0, !11, i64 8, !18, i64 48, !18, i64 56}
!18 = !{!"long", !7, i64 0}
!19 = !{!17, !18, i64 56}
!20 = !{!21, !18, i64 48}
!21 = !{!"", !6, i64 0, !11, i64 8, !22, i64 48}
!22 = !{!"", !18, i64 0, !18, i64 8, !6, i64 16}
!23 = !{!21, !6, i64 64}
!24 = !{!7, !7, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!28, !6, i64 48}
!28 = !{!"", !6, i64 0, !11, i64 8, !6, i64 48}
!29 = !{!30, !6, i64 0}
!30 = !{!"gravity_class_s", !6, i64 0, !11, i64 8, !6, i64 48, !6, i64 56, !12, i64 64, !12, i64 65, !12, i64 66, !12, i64 67, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !13, i64 104, !6, i64 112}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass