; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_shape)

; 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._RcsShape = type { i32, %struct.HTr, [3 x double], double, i8, i8, ptr, ptr, ptr, ptr, ptr }
%struct.HTr = type { [3 x double], [3 x [3 x double]] }

@RCS_GLOBAL_RLOG_CB = external global ptr, align 8
@RcsLogLevel = external global i32, align 4
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@__func__.RcsShape_boundingSphereDistance = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare void @print_trace() #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @RcsShape_computeLocalCOM(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local double @RcsShape_boundingSphereDistance(ptr noundef %0, ptr noundef %1, ptr noundef %2) #5 {
  %4 = alloca double, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [3 x double], align 16
  %9 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #6
  %10 = load ptr, ptr %7, align 8, !tbaa !5
  %11 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  call void @RcsShape_computeLocalCOM(ptr noundef %10, ptr noundef %11)
  %12 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  call void @Vec3d_transformSelf(ptr noundef %12, ptr noundef %13)
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._RcsShape, ptr %14, i32 0, i32 0
  %16 = load i32, ptr %15, align 8, !tbaa !9
  switch i32 %16, label %216 [
    i32 12, label %17
    i32 4, label %21
    i32 1, label %30
    i32 5, label %44
    i32 7, label %69
    i32 8, label %78
    i32 2, label %109
    i32 10, label %140
    i32 6, label %154
    i32 3, label %156
    i32 11, label %176
    i32 9, label %196
  ]

17:                                               ; preds = %3
  %18 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = call double @Vec3d_distance(ptr noundef %18, ptr noundef %19)
  store double %20, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

21:                                               ; preds = %3
  %22 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call double @Vec3d_distance(ptr noundef %22, ptr noundef %23)
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct._RcsShape, ptr %25, i32 0, i32 2
  %27 = getelementptr inbounds [3 x double], ptr %26, i64 0, i64 0
  %28 = call double @Vec3d_getLength(ptr noundef %27)
  %29 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %28, double %24)
  store double %29, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

30:                                               ; preds = %3
  %31 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = call double @Vec3d_distance(ptr noundef %31, ptr noundef %32)
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._RcsShape, ptr %34, i32 0, i32 2
  %36 = getelementptr inbounds [3 x double], ptr %35, i64 0, i64 2
  %37 = load double, ptr %36, align 8, !tbaa !15
  %38 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %37, double %33)
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._RcsShape, ptr %39, i32 0, i32 2
  %41 = getelementptr inbounds [3 x double], ptr %40, i64 0, i64 0
  %42 = load double, ptr %41, align 8, !tbaa !15
  %43 = fsub double %38, %42
  store double %43, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

44:                                               ; preds = %3
  %45 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = call double @Vec3d_distance(ptr noundef %45, ptr noundef %46)
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._RcsShape, ptr %48, i32 0, i32 2
  %50 = getelementptr inbounds [3 x double], ptr %49, i64 0, i64 2
  %51 = load double, ptr %50, align 8, !tbaa !15
  %52 = load ptr, ptr %7, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._RcsShape, ptr %52, i32 0, i32 2
  %54 = getelementptr inbounds [3 x double], ptr %53, i64 0, i64 2
  %55 = load double, ptr %54, align 8, !tbaa !15
  %56 = fmul double %51, %55
  %57 = fdiv double %56, 4.000000e+00
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct._RcsShape, ptr %58, i32 0, i32 2
  %60 = getelementptr inbounds [3 x double], ptr %59, i64 0, i64 0
  %61 = load double, ptr %60, align 8, !tbaa !15
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._RcsShape, ptr %62, i32 0, i32 2
  %64 = getelementptr inbounds [3 x double], ptr %63, i64 0, i64 0
  %65 = load double, ptr %64, align 8, !tbaa !15
  %66 = call double @llvm.fmuladd.f64(double %61, double %65, double %57)
  %67 = call double @sqrt(double noundef %66) #6
  %68 = fsub double %47, %67
  store double %68, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

69:                                               ; preds = %3
  %70 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = call double @Vec3d_distance(ptr noundef %70, ptr noundef %71)
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._RcsShape, ptr %73, i32 0, i32 2
  %75 = getelementptr inbounds [3 x double], ptr %74, i64 0, i64 0
  %76 = load double, ptr %75, align 8, !tbaa !15
  %77 = fsub double %72, %76
  store double %77, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

78:                                               ; preds = %3
  %79 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = call double @Vec3d_distance(ptr noundef %79, ptr noundef %80)
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._RcsShape, ptr %82, i32 0, i32 2
  %84 = getelementptr inbounds [3 x double], ptr %83, i64 0, i64 2
  %85 = load double, ptr %84, align 8, !tbaa !15
  %86 = fmul double 7.500000e-01, %85
  %87 = load ptr, ptr %7, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._RcsShape, ptr %87, i32 0, i32 2
  %89 = getelementptr inbounds [3 x double], ptr %88, i64 0, i64 2
  %90 = load double, ptr %89, align 8, !tbaa !15
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct._RcsShape, ptr %91, i32 0, i32 2
  %93 = getelementptr inbounds [3 x double], ptr %92, i64 0, i64 2
  %94 = load double, ptr %93, align 8, !tbaa !15
  %95 = fmul double %90, %94
  %96 = fdiv double %95, 1.600000e+01
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct._RcsShape, ptr %97, i32 0, i32 2
  %99 = getelementptr inbounds [3 x double], ptr %98, i64 0, i64 0
  %100 = load double, ptr %99, align 8, !tbaa !15
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct._RcsShape, ptr %101, i32 0, i32 2
  %103 = getelementptr inbounds [3 x double], ptr %102, i64 0, i64 0
  %104 = load double, ptr %103, align 8, !tbaa !15
  %105 = call double @llvm.fmuladd.f64(double %100, double %104, double %96)
  %106 = call double @sqrt(double noundef %105) #6
  %107 = call double @llvm.maxnum.f64(double %86, double %106)
  %108 = fsub double %81, %107
  store double %108, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

109:                                              ; preds = %3
  %110 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = call double @Vec3d_distance(ptr noundef %110, ptr noundef %111)
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._RcsShape, ptr %113, i32 0, i32 2
  %115 = getelementptr inbounds [3 x double], ptr %114, i64 0, i64 0
  %116 = load double, ptr %115, align 8, !tbaa !15
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct._RcsShape, ptr %117, i32 0, i32 2
  %119 = getelementptr inbounds [3 x double], ptr %118, i64 0, i64 0
  %120 = load double, ptr %119, align 8, !tbaa !15
  %121 = load ptr, ptr %7, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct._RcsShape, ptr %121, i32 0, i32 2
  %123 = getelementptr inbounds [3 x double], ptr %122, i64 0, i64 1
  %124 = load double, ptr %123, align 8, !tbaa !15
  %125 = load ptr, ptr %7, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct._RcsShape, ptr %125, i32 0, i32 2
  %127 = getelementptr inbounds [3 x double], ptr %126, i64 0, i64 1
  %128 = load double, ptr %127, align 8, !tbaa !15
  %129 = fmul double %124, %128
  %130 = call double @llvm.fmuladd.f64(double %116, double %120, double %129)
  %131 = call double @sqrt(double noundef %130) #6
  %132 = fdiv double %131, 2.000000e+00
  %133 = fsub double %112, %132
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct._RcsShape, ptr %134, i32 0, i32 2
  %136 = getelementptr inbounds [3 x double], ptr %135, i64 0, i64 2
  %137 = load double, ptr %136, align 8, !tbaa !15
  %138 = fdiv double %137, 2.000000e+00
  %139 = fsub double %133, %138
  store double %139, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

140:                                              ; preds = %3
  %141 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = call double @Vec3d_distance(ptr noundef %141, ptr noundef %142)
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct._RcsShape, ptr %144, i32 0, i32 2
  %146 = getelementptr inbounds [3 x double], ptr %145, i64 0, i64 0
  %147 = load double, ptr %146, align 8, !tbaa !15
  %148 = fsub double %143, %147
  %149 = load ptr, ptr %7, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct._RcsShape, ptr %149, i32 0, i32 2
  %151 = getelementptr inbounds [3 x double], ptr %150, i64 0, i64 2
  %152 = load double, ptr %151, align 8, !tbaa !15
  %153 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %152, double %148)
  store double %153, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

154:                                              ; preds = %3
  %155 = call double (...) @Math_infinity()
  store double %155, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

156:                                              ; preds = %3
  br label %157

157:                                              ; preds = %156
  %158 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %160, label %162

160:                                              ; preds = %157
  %161 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %161(i32 noundef 4, ptr noundef @.str.7, ptr noundef @__func__.RcsShape_boundingSphereDistance, i32 noundef 511, ptr noundef @.str.14)
  br label %162

162:                                              ; preds = %160, %157
  %163 = load i32, ptr @RcsLogLevel, align 4, !tbaa !16
  %164 = icmp sle i32 4, %163
  br i1 %164, label %165, label %172

165:                                              ; preds = %162
  %166 = load ptr, ptr @stderr, align 8, !tbaa !5
  %167 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %166, ptr noundef @.str.9, ptr noundef @.str.7, ptr noundef @__func__.RcsShape_boundingSphereDistance, i32 noundef 511) #6
  %168 = load ptr, ptr @stderr, align 8, !tbaa !5
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %168, ptr noundef @.str.14) #6
  %170 = load ptr, ptr @stderr, align 8, !tbaa !5
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef @.str.3) #6
  br label %172

172:                                              ; preds = %165, %162
  br label %173

173:                                              ; preds = %172
  br label %174

174:                                              ; preds = %173
  %175 = call double (...) @Math_infinity()
  store double %175, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

176:                                              ; preds = %3
  br label %177

177:                                              ; preds = %176
  %178 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %179 = icmp ne ptr %178, null
  br i1 %179, label %180, label %182

180:                                              ; preds = %177
  %181 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %181(i32 noundef 4, ptr noundef @.str.7, ptr noundef @__func__.RcsShape_boundingSphereDistance, i32 noundef 516, ptr noundef @.str.15)
  br label %182

182:                                              ; preds = %180, %177
  %183 = load i32, ptr @RcsLogLevel, align 4, !tbaa !16
  %184 = icmp sle i32 4, %183
  br i1 %184, label %185, label %192

185:                                              ; preds = %182
  %186 = load ptr, ptr @stderr, align 8, !tbaa !5
  %187 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %186, ptr noundef @.str.9, ptr noundef @.str.7, ptr noundef @__func__.RcsShape_boundingSphereDistance, i32 noundef 516) #6
  %188 = load ptr, ptr @stderr, align 8, !tbaa !5
  %189 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef @.str.15) #6
  %190 = load ptr, ptr @stderr, align 8, !tbaa !5
  %191 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %190, ptr noundef @.str.3) #6
  br label %192

192:                                              ; preds = %185, %182
  br label %193

193:                                              ; preds = %192
  br label %194

194:                                              ; preds = %193
  %195 = call double (...) @Math_infinity()
  store double %195, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

196:                                              ; preds = %3
  br label %197

197:                                              ; preds = %196
  %198 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  %199 = icmp ne ptr %198, null
  br i1 %199, label %200, label %202

200:                                              ; preds = %197
  %201 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !5
  call void (i32, ptr, ptr, i32, ptr, ...) %201(i32 noundef 4, ptr noundef @.str.7, ptr noundef @__func__.RcsShape_boundingSphereDistance, i32 noundef 521, ptr noundef @.str.16)
  br label %202

202:                                              ; preds = %200, %197
  %203 = load i32, ptr @RcsLogLevel, align 4, !tbaa !16
  %204 = icmp sle i32 4, %203
  br i1 %204, label %205, label %212

205:                                              ; preds = %202
  %206 = load ptr, ptr @stderr, align 8, !tbaa !5
  %207 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef @.str.9, ptr noundef @.str.7, ptr noundef @__func__.RcsShape_boundingSphereDistance, i32 noundef 521) #6
  %208 = load ptr, ptr @stderr, align 8, !tbaa !5
  %209 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %208, ptr noundef @.str.16) #6
  %210 = load ptr, ptr @stderr, align 8, !tbaa !5
  %211 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.3) #6
  br label %212

212:                                              ; preds = %205, %202
  br label %213

213:                                              ; preds = %212
  br label %214

214:                                              ; preds = %213
  %215 = call double (...) @Math_infinity()
  store double %215, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

216:                                              ; preds = %3
  br label %217

217:                                              ; preds = %216
  %218 = load ptr, ptr @stderr, align 8, !tbaa !5
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %218, ptr noundef @.str.10, ptr noundef @.str.7, ptr noundef @__func__.RcsShape_boundingSphereDistance, i32 noundef 526) #6
  %220 = load ptr, ptr @stderr, align 8, !tbaa !5
  %221 = load ptr, ptr %7, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct._RcsShape, ptr %221, i32 0, i32 0
  %223 = load i32, ptr %222, align 8, !tbaa !9
  %224 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %220, ptr noundef @.str.11, i32 noundef %223) #6
  %225 = load ptr, ptr @stderr, align 8, !tbaa !5
  %226 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %225, ptr noundef @.str.3) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

227:                                              ; No predecessors!
  br label %228

228:                                              ; preds = %227
  %229 = call double (...) @Math_infinity()
  store double %229, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %230

230:                                              ; preds = %228, %214, %194, %174, %154, %140, %109, %78, %69, %44, %30, %21, %17
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #6
  %231 = load double, ptr %4, align 8
  ret double %231
}

declare void @Vec3d_transformSelf(ptr noundef, ptr noundef) #3

declare double @Vec3d_distance(ptr noundef, ptr noundef) #3

declare double @Vec3d_getLength(ptr noundef) #3

; Function Attrs: nounwind
declare double @sqrt(double noundef) #0

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

declare double @Math_infinity(...) #3

attributes #0 = { nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { "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 = { noreturn nounwind "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 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 #6 = { nounwind }
attributes #7 = { noreturn 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, !11, i64 0}
!10 = !{!"_RcsShape", !11, i64 0, !12, i64 8, !7, i64 104, !13, i64 128, !14, i64 136, !7, i64 137, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !7, i64 0, !7, i64 24}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!11, !11, i64 0}


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

@RCS_GLOBAL_RLOG_CB = external local_unnamed_addr global ptr, align 8
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@__func__.RcsShape_boundingSphereDistance = external hidden unnamed_addr constant [32 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

declare void @print_trace() local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @RcsShape_computeLocalCOM(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local double @RcsShape_boundingSphereDistance(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #5 {
  %4 = alloca [3 x double], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  call void @RcsShape_computeLocalCOM(ptr noundef %2, ptr noundef nonnull %4)
  call void @Vec3d_transformSelf(ptr noundef nonnull %4, ptr noundef %1) #8
  %5 = load i32, ptr %2, align 8, !tbaa !5
  switch i32 %5, label %119 [
    i32 12, label %6
    i32 4, label %8
    i32 1, label %13
    i32 5, label %21
    i32 7, label %32
    i32 8, label %37
    i32 2, label %50
    i32 10, label %64
    i32 6, label %72
    i32 3, label %74
    i32 11, label %89
    i32 9, label %104
  ]

6:                                                ; preds = %3
  %7 = call double @Vec3d_distance(ptr noundef nonnull %4, ptr noundef %0) #8
  br label %127

8:                                                ; preds = %3
  %9 = call double @Vec3d_distance(ptr noundef nonnull %4, ptr noundef %0) #8
  %10 = getelementptr inbounds i8, ptr %2, i64 104
  %11 = call double @Vec3d_getLength(ptr noundef nonnull %10) #8
  %12 = call double @llvm.fmuladd.f64(double %11, double -5.000000e-01, double %9)
  br label %127

13:                                               ; preds = %3
  %14 = call double @Vec3d_distance(ptr noundef nonnull %4, ptr noundef %0) #8
  %15 = getelementptr inbounds i8, ptr %2, i64 104
  %16 = getelementptr inbounds i8, ptr %2, i64 120
  %17 = load double, ptr %16, align 8, !tbaa !14
  %18 = call double @llvm.fmuladd.f64(double %17, double -5.000000e-01, double %14)
  %19 = load double, ptr %15, align 8, !tbaa !14
  %20 = fsub double %18, %19
  br label %127

21:                                               ; preds = %3
  %22 = call double @Vec3d_distance(ptr noundef nonnull %4, ptr noundef %0) #8
  %23 = getelementptr inbounds i8, ptr %2, i64 104
  %24 = getelementptr inbounds i8, ptr %2, i64 120
  %25 = load double, ptr %24, align 8, !tbaa !14
  %26 = fmul double %25, %25
  %27 = fmul double %26, 2.500000e-01
  %28 = load double, ptr %23, align 8, !tbaa !14
  %29 = call double @llvm.fmuladd.f64(double %28, double %28, double %27)
  %30 = call double @sqrt(double noundef %29) #8
  %31 = fsub double %22, %30
  br label %127

32:                                               ; preds = %3
  %33 = call double @Vec3d_distance(ptr noundef nonnull %4, ptr noundef %0) #8
  %34 = getelementptr inbounds i8, ptr %2, i64 104
  %35 = load double, ptr %34, align 8, !tbaa !14
  %36 = fsub double %33, %35
  br label %127

37:                                               ; preds = %3
  %38 = call double @Vec3d_distance(ptr noundef nonnull %4, ptr noundef %0) #8
  %39 = getelementptr inbounds i8, ptr %2, i64 104
  %40 = getelementptr inbounds i8, ptr %2, i64 120
  %41 = load double, ptr %40, align 8, !tbaa !14
  %42 = fmul double %41, 7.500000e-01
  %43 = fmul double %41, %41
  %44 = fmul double %43, 6.250000e-02
  %45 = load double, ptr %39, align 8, !tbaa !14
  %46 = call double @llvm.fmuladd.f64(double %45, double %45, double %44)
  %47 = call double @sqrt(double noundef %46) #8
  %48 = call double @llvm.maxnum.f64(double %42, double %47)
  %49 = fsub double %38, %48
  br label %127

50:                                               ; preds = %3
  %51 = call double @Vec3d_distance(ptr noundef nonnull %4, ptr noundef %0) #8
  %52 = getelementptr inbounds i8, ptr %2, i64 104
  %53 = load double, ptr %52, align 8, !tbaa !14
  %54 = getelementptr inbounds i8, ptr %2, i64 112
  %55 = load double, ptr %54, align 8, !tbaa !14
  %56 = fmul double %55, %55
  %57 = call double @llvm.fmuladd.f64(double %53, double %53, double %56)
  %sqrt = call double @llvm.sqrt.f64(double %57)
  %58 = fmul double %sqrt, 5.000000e-01
  %59 = fsub double %51, %58
  %60 = getelementptr inbounds i8, ptr %2, i64 120
  %61 = load double, ptr %60, align 8, !tbaa !14
  %62 = fmul double %61, 5.000000e-01
  %63 = fsub double %59, %62
  br label %127

64:                                               ; preds = %3
  %65 = call double @Vec3d_distance(ptr noundef nonnull %4, ptr noundef %0) #8
  %66 = getelementptr inbounds i8, ptr %2, i64 104
  %67 = load double, ptr %66, align 8, !tbaa !14
  %68 = fsub double %65, %67
  %69 = getelementptr inbounds i8, ptr %2, i64 120
  %70 = load double, ptr %69, align 8, !tbaa !14
  %71 = call double @llvm.fmuladd.f64(double %70, double -5.000000e-01, double %68)
  br label %127

72:                                               ; preds = %3
  %73 = call double (...) @Math_infinity() #8
  br label %127

74:                                               ; preds = %3
  %75 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !15
  %.not37 = icmp eq ptr %75, null
  br i1 %.not37, label %77, label %76

76:                                               ; preds = %74
  call void (i32, ptr, ptr, i32, ptr, ...) %75(i32 noundef 4, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.RcsShape_boundingSphereDistance, i32 noundef 511, ptr noundef nonnull @.str.14) #8
  br label %77

77:                                               ; preds = %76, %74
  %78 = load i32, ptr @RcsLogLevel, align 4, !tbaa !16
  %79 = icmp sgt i32 %78, 3
  br i1 %79, label %80, label %87

80:                                               ; preds = %77
  %81 = load ptr, ptr @stderr, align 8, !tbaa !15
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.RcsShape_boundingSphereDistance, i32 noundef 511) #9
  %83 = load ptr, ptr @stderr, align 8, !tbaa !15
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef nonnull @.str.14) #9
  %85 = load ptr, ptr @stderr, align 8, !tbaa !15
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %85, ptr noundef nonnull @.str.3) #9
  br label %87

87:                                               ; preds = %80, %77
  %88 = call double (...) @Math_infinity() #8
  br label %127

89:                                               ; preds = %3
  %90 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !15
  %.not36 = icmp eq ptr %90, null
  br i1 %.not36, label %92, label %91

91:                                               ; preds = %89
  call void (i32, ptr, ptr, i32, ptr, ...) %90(i32 noundef 4, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.RcsShape_boundingSphereDistance, i32 noundef 516, ptr noundef nonnull @.str.15) #8
  br label %92

92:                                               ; preds = %91, %89
  %93 = load i32, ptr @RcsLogLevel, align 4, !tbaa !16
  %94 = icmp sgt i32 %93, 3
  br i1 %94, label %95, label %102

95:                                               ; preds = %92
  %96 = load ptr, ptr @stderr, align 8, !tbaa !15
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.RcsShape_boundingSphereDistance, i32 noundef 516) #9
  %98 = load ptr, ptr @stderr, align 8, !tbaa !15
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.15) #9
  %100 = load ptr, ptr @stderr, align 8, !tbaa !15
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.3) #9
  br label %102

102:                                              ; preds = %95, %92
  %103 = call double (...) @Math_infinity() #8
  br label %127

104:                                              ; preds = %3
  %105 = load ptr, ptr @RCS_GLOBAL_RLOG_CB, align 8, !tbaa !15
  %.not = icmp eq ptr %105, null
  br i1 %.not, label %107, label %106

106:                                              ; preds = %104
  call void (i32, ptr, ptr, i32, ptr, ...) %105(i32 noundef 4, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.RcsShape_boundingSphereDistance, i32 noundef 521, ptr noundef nonnull @.str.16) #8
  br label %107

107:                                              ; preds = %106, %104
  %108 = load i32, ptr @RcsLogLevel, align 4, !tbaa !16
  %109 = icmp sgt i32 %108, 3
  br i1 %109, label %110, label %117

110:                                              ; preds = %107
  %111 = load ptr, ptr @stderr, align 8, !tbaa !15
  %112 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.RcsShape_boundingSphereDistance, i32 noundef 521) #9
  %113 = load ptr, ptr @stderr, align 8, !tbaa !15
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef nonnull @.str.16) #9
  %115 = load ptr, ptr @stderr, align 8, !tbaa !15
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef nonnull @.str.3) #9
  br label %117

117:                                              ; preds = %110, %107
  %118 = call double (...) @Math_infinity() #8
  br label %127

119:                                              ; preds = %3
  %120 = load ptr, ptr @stderr, align 8, !tbaa !15
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.7, ptr noundef nonnull @__func__.RcsShape_boundingSphereDistance, i32 noundef 526) #9
  %122 = load ptr, ptr @stderr, align 8, !tbaa !15
  %123 = load i32, ptr %2, align 8, !tbaa !5
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef nonnull @.str.11, i32 noundef %123) #9
  %125 = load ptr, ptr @stderr, align 8, !tbaa !15
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef nonnull @.str.3) #9
  call void @print_trace() #8
  call void @exit(i32 noundef 1) #10
  unreachable

127:                                              ; preds = %117, %102, %87, %72, %64, %50, %37, %32, %21, %13, %8, %6
  %.0 = phi double [ %118, %117 ], [ %103, %102 ], [ %88, %87 ], [ %73, %72 ], [ %71, %64 ], [ %63, %50 ], [ %49, %37 ], [ %36, %32 ], [ %31, %21 ], [ %20, %13 ], [ %12, %8 ], [ %7, %6 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  ret double %.0
}

declare void @Vec3d_transformSelf(ptr noundef, ptr noundef) local_unnamed_addr #3

declare double @Vec3d_distance(ptr noundef, ptr noundef) local_unnamed_addr #3

declare double @Vec3d_getLength(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #6

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

declare double @Math_infinity(...) local_unnamed_addr #3

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

attributes #0 = { nofree nounwind "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 willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { "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 = { noreturn nounwind "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 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 #6 = { mustprogress nofree nounwind willreturn memory(write) "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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn 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, !7, i64 0}
!6 = !{!"_RcsShape", !7, i64 0, !10, i64 8, !8, i64 104, !11, i64 128, !12, i64 136, !8, i64 137, !13, i64 144, !13, i64 152, !13, i64 160, !13, i64 168, !13, i64 176}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !8, i64 0, !8, i64 24}
!11 = !{!"double", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!7, !7, i64 0}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass