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

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

@stderr = external global ptr, align 8
@.str.27 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__.RcsJoint_fprintXML = external hidden unnamed_addr constant [19 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @RcsJoint_isRotation(ptr noundef) #0

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

declare void @print_trace() #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @RcsJoint_fprintXML(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [256 x i8], align 16
  %6 = alloca double, align 8
  %7 = alloca [6 x double], align 16
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = call zeroext i1 @RcsJoint_isRotation(ptr noundef %9)
  %11 = zext i1 %10 to i64
  %12 = select i1 %10, double 0x404CA5DC1A63C1F8, double 1.000000e+00
  store double %12, ptr %6, align 8, !tbaa !9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef @.str.33) #5
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct._RcsJoint, ptr %16, i32 0, i32 0
  %18 = load ptr, ptr %17, align 8, !tbaa !11
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef @.str.34, ptr noundef %18) #5
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %22 = load double, ptr %6, align 8, !tbaa !9
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._RcsJoint, ptr %23, i32 0, i32 3
  %25 = load double, ptr %24, align 8, !tbaa !16
  %26 = fmul double %22, %25
  %27 = call ptr @String_fromDouble(ptr noundef %21, double noundef %26, i32 noundef 6)
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef @.str.35, ptr noundef %27) #5
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %31 = load double, ptr %6, align 8, !tbaa !9
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._RcsJoint, ptr %32, i32 0, i32 2
  %34 = load double, ptr %33, align 8, !tbaa !17
  %35 = fmul double %31, %34
  %36 = call ptr @String_fromDouble(ptr noundef %30, double noundef %35, i32 noundef 6)
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef @.str.36, ptr noundef %36) #5
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %40 = load double, ptr %6, align 8, !tbaa !9
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._RcsJoint, ptr %41, i32 0, i32 4
  %43 = load double, ptr %42, align 8, !tbaa !18
  %44 = fmul double %40, %43
  %45 = call ptr @String_fromDouble(ptr noundef %39, double noundef %44, i32 noundef 6)
  %46 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %38, ptr noundef @.str.37, ptr noundef %45) #5
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._RcsJoint, ptr %47, i32 0, i32 5
  %49 = load double, ptr %48, align 8, !tbaa !19
  %50 = fcmp une double %49, 1.000000e+00
  br i1 %50, label %51, label %59

51:                                               ; preds = %2
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._RcsJoint, ptr %54, i32 0, i32 5
  %56 = load double, ptr %55, align 8, !tbaa !19
  %57 = call ptr @String_fromDouble(ptr noundef %53, double noundef %56, i32 noundef 6)
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str.38, ptr noundef %57) #5
  br label %59

59:                                               ; preds = %51, %2
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct._RcsJoint, ptr %60, i32 0, i32 6
  %62 = load double, ptr %61, align 8, !tbaa !20
  %63 = fcmp une double %62, 1.000000e+00
  br i1 %63, label %64, label %72

64:                                               ; preds = %59
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._RcsJoint, ptr %67, i32 0, i32 6
  %69 = load double, ptr %68, align 8, !tbaa !20
  %70 = call ptr @String_fromDouble(ptr noundef %66, double noundef %69, i32 noundef 6)
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.39, ptr noundef %70) #5
  br label %72

72:                                               ; preds = %64, %59
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._RcsJoint, ptr %73, i32 0, i32 7
  %75 = load double, ptr %74, align 8, !tbaa !21
  %76 = fcmp une double %75, 1.000000e+00
  br i1 %76, label %77, label %85

77:                                               ; preds = %72
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct._RcsJoint, ptr %80, i32 0, i32 7
  %82 = load double, ptr %81, align 8, !tbaa !21
  %83 = call ptr @String_fromDouble(ptr noundef %79, double noundef %82, i32 noundef 6)
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.40, ptr noundef %83) #5
  br label %85

85:                                               ; preds = %77, %72
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct._RcsJoint, ptr %86, i32 0, i32 8
  %88 = load i8, ptr %87, align 8, !tbaa !22, !range !23, !noundef !24
  %89 = trunc i8 %88 to i1
  %90 = zext i1 %89 to i32
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %92, label %95

92:                                               ; preds = %85
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %93, ptr noundef @.str.41) #5
  br label %95

95:                                               ; preds = %92, %85
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct._RcsJoint, ptr %96, i32 0, i32 9
  %98 = load i32, ptr %97, align 4, !tbaa !25
  switch i32 %98, label %117 [
    i32 3, label %99
    i32 4, label %102
    i32 5, label %105
    i32 0, label %108
    i32 1, label %111
    i32 2, label %114
  ]

99:                                               ; preds = %95
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.42) #5
  br label %130

102:                                              ; preds = %95
  %103 = load ptr, ptr %3, align 8, !tbaa !5
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.43) #5
  br label %130

105:                                              ; preds = %95
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.44) #5
  br label %130

108:                                              ; preds = %95
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str.45) #5
  br label %130

111:                                              ; preds = %95
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %112, ptr noundef @.str.46) #5
  br label %130

114:                                              ; preds = %95
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.47) #5
  br label %130

117:                                              ; preds = %95
  br label %118

118:                                              ; preds = %117
  %119 = load ptr, ptr @stderr, align 8, !tbaa !5
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str.48, ptr noundef @.str.27, ptr noundef @__func__.RcsJoint_fprintXML, i32 noundef 529) #5
  %121 = load ptr, ptr @stderr, align 8, !tbaa !5
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct._RcsJoint, ptr %122, i32 0, i32 19
  %124 = load i32, ptr %123, align 8, !tbaa !26
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.49, i32 noundef %124) #5
  %126 = load ptr, ptr @stderr, align 8, !tbaa !5
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.32) #5
  call void @print_trace()
  call void @exit(i32 noundef 1) #6
  unreachable

128:                                              ; No predecessors!
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129, %114, %111, %108, %105, %102, %99
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._RcsJoint, ptr %131, i32 0, i32 13
  %133 = load ptr, ptr %132, align 8, !tbaa !27
  %134 = icmp ne ptr %133, null
  br i1 %134, label %135, label %190

135:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 48, ptr %7) #5
  %136 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 0
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct._RcsJoint, ptr %137, i32 0, i32 13
  %139 = load ptr, ptr %138, align 8, !tbaa !27
  %140 = getelementptr inbounds %struct.HTr, ptr %139, i32 0, i32 0
  %141 = getelementptr inbounds [3 x double], ptr %140, i64 0, i64 0
  call void @Vec3d_copy(ptr noundef %136, ptr noundef %141)
  %142 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 3
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._RcsJoint, ptr %143, i32 0, i32 13
  %145 = load ptr, ptr %144, align 8, !tbaa !27
  %146 = getelementptr inbounds %struct.HTr, ptr %145, i32 0, i32 1
  %147 = getelementptr inbounds [3 x [3 x double]], ptr %146, i64 0, i64 0
  call void @Mat3d_toEulerAngles(ptr noundef %142, ptr noundef %147)
  %148 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 3
  call void @Vec3d_constMulSelf(ptr noundef %148, double noundef 0x404CA5DC1A63C1F8)
  %149 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 0
  %150 = call double @VecNd_maxAbsEle(ptr noundef %149, i32 noundef 6)
  %151 = fcmp ogt double %150, 1.000000e-08
  br i1 %151, label %152, label %189

152:                                              ; preds = %135
  %153 = load ptr, ptr %3, align 8, !tbaa !5
  %154 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %155 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 0
  %156 = load double, ptr %155, align 16, !tbaa !9
  %157 = call ptr @String_fromDouble(ptr noundef %154, double noundef %156, i32 noundef 6)
  %158 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef @.str.50, ptr noundef %157) #5
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %161 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 1
  %162 = load double, ptr %161, align 8, !tbaa !9
  %163 = call ptr @String_fromDouble(ptr noundef %160, double noundef %162, i32 noundef 6)
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %159, ptr noundef @.str.36, ptr noundef %163) #5
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %167 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 2
  %168 = load double, ptr %167, align 16, !tbaa !9
  %169 = call ptr @String_fromDouble(ptr noundef %166, double noundef %168, i32 noundef 6)
  %170 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef @.str.36, ptr noundef %169) #5
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %173 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 3
  %174 = load double, ptr %173, align 8, !tbaa !9
  %175 = call ptr @String_fromDouble(ptr noundef %172, double noundef %174, i32 noundef 6)
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %171, ptr noundef @.str.36, ptr noundef %175) #5
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %179 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 4
  %180 = load double, ptr %179, align 16, !tbaa !9
  %181 = call ptr @String_fromDouble(ptr noundef %178, double noundef %180, i32 noundef 6)
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef @.str.36, ptr noundef %181) #5
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %185 = getelementptr inbounds [6 x double], ptr %7, i64 0, i64 5
  %186 = load double, ptr %185, align 8, !tbaa !9
  %187 = call ptr @String_fromDouble(ptr noundef %184, double noundef %186, i32 noundef 6)
  %188 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %183, ptr noundef @.str.37, ptr noundef %187) #5
  br label %189

189:                                              ; preds = %152, %135
  call void @llvm.lifetime.end.p0(i64 48, ptr %7) #5
  br label %190

190:                                              ; preds = %189, %130
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct._RcsJoint, ptr %191, i32 0, i32 15
  %193 = load double, ptr %192, align 8, !tbaa !28
  %194 = fcmp une double %193, 0x7FEFFFFFFFFFFFFF
  br i1 %194, label %195, label %213

195:                                              ; preds = %190
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct._RcsJoint, ptr %196, i32 0, i32 19
  %198 = load i32, ptr %197, align 8, !tbaa !26
  %199 = icmp eq i32 %198, 2
  br i1 %199, label %200, label %205

200:                                              ; preds = %195
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._RcsJoint, ptr %201, i32 0, i32 15
  %203 = load double, ptr %202, align 8, !tbaa !28
  %204 = fcmp une double %203, 1.000000e+00
  br i1 %204, label %213, label %205

205:                                              ; preds = %200, %195
  %206 = load ptr, ptr %3, align 8, !tbaa !5
  %207 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %208 = load ptr, ptr %4, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct._RcsJoint, ptr %208, i32 0, i32 15
  %210 = load double, ptr %209, align 8, !tbaa !28
  %211 = call ptr @String_fromDouble(ptr noundef %207, double noundef %210, i32 noundef 6)
  %212 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef @.str.51, ptr noundef %211) #5
  br label %213

213:                                              ; preds = %205, %200, %190
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct._RcsJoint, ptr %214, i32 0, i32 16
  %216 = load double, ptr %215, align 8, !tbaa !29
  %217 = fcmp olt double %216, 0x7FEFFFFFFFFFFFFF
  br i1 %217, label %218, label %228

218:                                              ; preds = %213
  %219 = load ptr, ptr %3, align 8, !tbaa !5
  %220 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %221 = load double, ptr %6, align 8, !tbaa !9
  %222 = load ptr, ptr %4, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct._RcsJoint, ptr %222, i32 0, i32 16
  %224 = load double, ptr %223, align 8, !tbaa !29
  %225 = fmul double %221, %224
  %226 = call ptr @String_fromDouble(ptr noundef %220, double noundef %225, i32 noundef 6)
  %227 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %219, ptr noundef @.str.52, ptr noundef %226) #5
  br label %228

228:                                              ; preds = %218, %213
  %229 = load ptr, ptr %4, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct._RcsJoint, ptr %229, i32 0, i32 17
  %231 = load double, ptr %230, align 8, !tbaa !30
  %232 = fcmp olt double %231, 0x7FEFFFFFFFFFFFFF
  br i1 %232, label %233, label %243

233:                                              ; preds = %228
  %234 = load ptr, ptr %3, align 8, !tbaa !5
  %235 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %236 = load double, ptr %6, align 8, !tbaa !9
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct._RcsJoint, ptr %237, i32 0, i32 17
  %239 = load double, ptr %238, align 8, !tbaa !30
  %240 = fmul double %236, %239
  %241 = call ptr @String_fromDouble(ptr noundef %235, double noundef %240, i32 noundef 6)
  %242 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %234, ptr noundef @.str.53, ptr noundef %241) #5
  br label %243

243:                                              ; preds = %233, %228
  %244 = load ptr, ptr %4, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct._RcsJoint, ptr %244, i32 0, i32 18
  %246 = load double, ptr %245, align 8, !tbaa !31
  %247 = fcmp olt double %246, 0x7FEFFFFFFFFFFFFF
  br i1 %247, label %248, label %266

248:                                              ; preds = %243
  %249 = load ptr, ptr %4, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct._RcsJoint, ptr %249, i32 0, i32 18
  %251 = load double, ptr %250, align 8, !tbaa !31
  %252 = load ptr, ptr %4, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct._RcsJoint, ptr %252, i32 0, i32 17
  %254 = load double, ptr %253, align 8, !tbaa !30
  %255 = fcmp une double %251, %254
  br i1 %255, label %256, label %266

256:                                              ; preds = %248
  %257 = load ptr, ptr %3, align 8, !tbaa !5
  %258 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %259 = load double, ptr %6, align 8, !tbaa !9
  %260 = load ptr, ptr %4, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct._RcsJoint, ptr %260, i32 0, i32 18
  %262 = load double, ptr %261, align 8, !tbaa !31
  %263 = fmul double %259, %262
  %264 = call ptr @String_fromDouble(ptr noundef %258, double noundef %263, i32 noundef 6)
  %265 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %257, ptr noundef @.str.54, ptr noundef %264) #5
  br label %266

266:                                              ; preds = %256, %248, %243
  %267 = load ptr, ptr %4, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct._RcsJoint, ptr %267, i32 0, i32 19
  %269 = load i32, ptr %268, align 8, !tbaa !26
  switch i32 %269, label %276 [
    i32 0, label %289
    i32 1, label %270
    i32 2, label %273
  ]

270:                                              ; preds = %266
  %271 = load ptr, ptr %3, align 8, !tbaa !5
  %272 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %271, ptr noundef @.str.55) #5
  br label %289

273:                                              ; preds = %266
  %274 = load ptr, ptr %3, align 8, !tbaa !5
  %275 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %274, ptr noundef @.str.56) #5
  br label %289

276:                                              ; preds = %266
  br label %277

277:                                              ; preds = %276
  %278 = load ptr, ptr @stderr, align 8, !tbaa !5
  %279 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %278, ptr noundef @.str.48, ptr noundef @.str.27, ptr noundef @__func__.RcsJoint_fprintXML, i32 noundef 589) #5
  %280 = load ptr, ptr @stderr, align 8, !tbaa !5
  %281 = load ptr, ptr %4, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct._RcsJoint, ptr %281, i32 0, i32 19
  %283 = load i32, ptr %282, align 8, !tbaa !26
  %284 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %280, ptr noundef @.str.49, i32 noundef %283) #5
  %285 = load ptr, ptr @stderr, align 8, !tbaa !5
  %286 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %285, ptr noundef @.str.32) #5
  call void @print_trace()
  call void @exit(i32 noundef 1) #6
  unreachable

287:                                              ; No predecessors!
  br label %288

288:                                              ; preds = %287
  br label %289

289:                                              ; preds = %288, %273, %270, %266
  %290 = load ptr, ptr %4, align 8, !tbaa !5
  %291 = getelementptr inbounds %struct._RcsJoint, ptr %290, i32 0, i32 24
  %292 = load ptr, ptr %291, align 8, !tbaa !32
  %293 = icmp ne ptr %292, null
  br i1 %293, label %294, label %302

294:                                              ; preds = %289
  %295 = load ptr, ptr %3, align 8, !tbaa !5
  %296 = load ptr, ptr %4, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct._RcsJoint, ptr %296, i32 0, i32 24
  %298 = load ptr, ptr %297, align 8, !tbaa !32
  %299 = getelementptr inbounds %struct._RcsJoint, ptr %298, i32 0, i32 0
  %300 = load ptr, ptr %299, align 8, !tbaa !11
  %301 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %295, ptr noundef @.str.57, ptr noundef %300) #5
  br label %302

302:                                              ; preds = %294, %289
  %303 = load ptr, ptr %4, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct._RcsJoint, ptr %303, i32 0, i32 21
  %305 = load ptr, ptr %304, align 8, !tbaa !33
  %306 = icmp ne ptr %305, null
  br i1 %306, label %307, label %335

307:                                              ; preds = %302
  %308 = load ptr, ptr %3, align 8, !tbaa !5
  %309 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %308, ptr noundef @.str.58) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !34
  br label %310

310:                                              ; preds = %329, %307
  %311 = load i32, ptr %8, align 4, !tbaa !34
  %312 = load ptr, ptr %4, align 8, !tbaa !5
  %313 = getelementptr inbounds %struct._RcsJoint, ptr %312, i32 0, i32 21
  %314 = load ptr, ptr %313, align 8, !tbaa !33
  %315 = getelementptr inbounds %struct._MatNd, ptr %314, i32 0, i32 1
  %316 = load i32, ptr %315, align 8, !tbaa !35
  %317 = icmp ult i32 %311, %316
  br i1 %317, label %319, label %318

318:                                              ; preds = %310
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %332

319:                                              ; preds = %310
  %320 = load ptr, ptr %3, align 8, !tbaa !5
  %321 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %322 = load ptr, ptr %4, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct._RcsJoint, ptr %322, i32 0, i32 21
  %324 = load ptr, ptr %323, align 8, !tbaa !33
  %325 = load i32, ptr %8, align 4, !tbaa !34
  %326 = call double @MatNd_get(ptr noundef %324, i32 noundef %325, i32 noundef 0)
  %327 = call ptr @String_fromDouble(ptr noundef %321, double noundef %326, i32 noundef 6)
  %328 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %320, ptr noundef @.str.36, ptr noundef %327) #5
  br label %329

329:                                              ; preds = %319
  %330 = load i32, ptr %8, align 4, !tbaa !34
  %331 = add i32 %330, 1
  store i32 %331, ptr %8, align 4, !tbaa !34
  br label %310, !llvm.loop !37

332:                                              ; preds = %318
  %333 = load ptr, ptr %3, align 8, !tbaa !5
  %334 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %333, ptr noundef @.str.59) #5
  br label %335

335:                                              ; preds = %332, %302
  %336 = load ptr, ptr %3, align 8, !tbaa !5
  %337 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %336, ptr noundef @.str.60) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %5) #5
  ret void
}

declare ptr @String_fromDouble(ptr noundef, double noundef, i32 noundef) #2

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

declare void @Vec3d_copy(ptr noundef, ptr noundef) #2

declare void @Mat3d_toEulerAngles(ptr noundef, ptr noundef) #2

declare void @Vec3d_constMulSelf(ptr noundef, double noundef) #2

declare double @VecNd_maxAbsEle(ptr noundef, i32 noundef) #2

declare double @MatNd_get(ptr noundef, i32 noundef, i32 noundef) #2

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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 }
attributes #6 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_RcsJoint", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !13, i64 64, !14, i64 68, !14, i64 72, !14, i64 76, !14, i64 80, !6, i64 88, !15, i64 96, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !14, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 24}
!16 = !{!12, !10, i64 24}
!17 = !{!12, !10, i64 16}
!18 = !{!12, !10, i64 32}
!19 = !{!12, !10, i64 40}
!20 = !{!12, !10, i64 48}
!21 = !{!12, !10, i64 56}
!22 = !{!12, !13, i64 64}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!12, !14, i64 68}
!26 = !{!12, !14, i64 224}
!27 = !{!12, !6, i64 88}
!28 = !{!12, !10, i64 192}
!29 = !{!12, !10, i64 200}
!30 = !{!12, !10, i64 208}
!31 = !{!12, !10, i64 216}
!32 = !{!12, !6, i64 264}
!33 = !{!12, !6, i64 240}
!34 = !{!14, !14, i64 0}
!35 = !{!36, !14, i64 8}
!36 = !{!"_MatNd", !6, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !13, i64 20}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.27 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [26 x i8], align 1
@__func__.RcsJoint_fprintXML = external hidden unnamed_addr constant [19 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [4 x i8], align 1
@switch.table.RcsJoint_fprintXML = private unnamed_addr constant [6 x ptr] [ptr @.str.45, ptr @.str.46, ptr @.str.47, ptr @.str.42, ptr @.str.43, ptr @.str.44], align 8

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @RcsJoint_isRotation(ptr noundef) local_unnamed_addr #0

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

declare void @print_trace() local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @RcsJoint_fprintXML(ptr nocapture noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [256 x i8], align 16
  %4 = alloca [6 x double], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #5
  %5 = tail call zeroext i1 @RcsJoint_isRotation(ptr noundef %1)
  %6 = select i1 %5, double 0x404CA5DC1A63C1F8, double 1.000000e+00
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.33) #5
  %8 = load ptr, ptr %1, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.34, ptr noundef %8) #5
  %10 = getelementptr inbounds i8, ptr %1, i64 24
  %11 = load double, ptr %10, align 8, !tbaa !14
  %12 = fmul double %6, %11
  %13 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %12, i32 noundef 6) #5
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.35, ptr noundef %13) #5
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = load double, ptr %15, align 8, !tbaa !15
  %17 = fmul double %6, %16
  %18 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %17, i32 noundef 6) #5
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.36, ptr noundef %18) #5
  %20 = getelementptr inbounds i8, ptr %1, i64 32
  %21 = load double, ptr %20, align 8, !tbaa !16
  %22 = fmul double %6, %21
  %23 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %22, i32 noundef 6) #5
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.37, ptr noundef %23) #5
  %25 = getelementptr inbounds i8, ptr %1, i64 40
  %26 = load double, ptr %25, align 8, !tbaa !17
  %27 = fcmp une double %26, 1.000000e+00
  br i1 %27, label %28, label %31

28:                                               ; preds = %2
  %29 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %26, i32 noundef 6) #5
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.38, ptr noundef %29) #5
  br label %31

31:                                               ; preds = %28, %2
  %32 = getelementptr inbounds i8, ptr %1, i64 48
  %33 = load double, ptr %32, align 8, !tbaa !18
  %34 = fcmp une double %33, 1.000000e+00
  br i1 %34, label %35, label %38

35:                                               ; preds = %31
  %36 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %33, i32 noundef 6) #5
  %37 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.39, ptr noundef %36) #5
  br label %38

38:                                               ; preds = %35, %31
  %39 = getelementptr inbounds i8, ptr %1, i64 56
  %40 = load double, ptr %39, align 8, !tbaa !19
  %41 = fcmp une double %40, 1.000000e+00
  br i1 %41, label %42, label %45

42:                                               ; preds = %38
  %43 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %40, i32 noundef 6) #5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.40, ptr noundef %43) #5
  br label %45

45:                                               ; preds = %42, %38
  %46 = getelementptr inbounds i8, ptr %1, i64 64
  %47 = load i8, ptr %46, align 8, !tbaa !20, !range !21, !noundef !22
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %51

49:                                               ; preds = %45
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.41) #5
  br label %51

51:                                               ; preds = %49, %45
  %52 = getelementptr inbounds i8, ptr %1, i64 68
  %53 = load i32, ptr %52, align 4, !tbaa !23
  %54 = icmp ult i32 %53, 6
  br i1 %54, label %switch.lookup, label %55

55:                                               ; preds = %51
  %56 = load ptr, ptr @stderr, align 8, !tbaa !24
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str.48, ptr noundef nonnull @.str.27, ptr noundef nonnull @__func__.RcsJoint_fprintXML, i32 noundef 529) #6
  %58 = load ptr, ptr @stderr, align 8, !tbaa !24
  %59 = getelementptr inbounds i8, ptr %1, i64 224
  %60 = load i32, ptr %59, align 8, !tbaa !25
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.49, i32 noundef %60) #6
  %62 = load ptr, ptr @stderr, align 8, !tbaa !24
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.32) #6
  call void @print_trace() #5
  call void @exit(i32 noundef 1) #7
  unreachable

switch.lookup:                                    ; preds = %51
  %64 = zext nneg i32 %53 to i64
  %switch.gep = getelementptr inbounds [6 x ptr], ptr @switch.table.RcsJoint_fprintXML, i64 0, i64 %64
  %switch.load = load ptr, ptr %switch.gep, align 8
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull %switch.load) #5
  %66 = getelementptr inbounds i8, ptr %1, i64 88
  %67 = load ptr, ptr %66, align 8, !tbaa !26
  %.not = icmp eq ptr %67, null
  br i1 %.not, label %98, label %68

68:                                               ; preds = %switch.lookup
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %4) #5
  call void @Vec3d_copy(ptr noundef nonnull %4, ptr noundef nonnull %67) #5
  %69 = getelementptr inbounds i8, ptr %4, i64 24
  %70 = load ptr, ptr %66, align 8, !tbaa !26
  %71 = getelementptr inbounds i8, ptr %70, i64 24
  call void @Mat3d_toEulerAngles(ptr noundef nonnull %69, ptr noundef nonnull %71) #5
  call void @Vec3d_constMulSelf(ptr noundef nonnull %69, double noundef 0x404CA5DC1A63C1F8) #5
  %72 = call double @VecNd_maxAbsEle(ptr noundef nonnull %4, i32 noundef 6) #5
  %73 = fcmp ogt double %72, 1.000000e-08
  br i1 %73, label %74, label %97

74:                                               ; preds = %68
  %75 = load double, ptr %4, align 16, !tbaa !27
  %76 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %75, i32 noundef 6) #5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.50, ptr noundef %76) #5
  %78 = getelementptr inbounds i8, ptr %4, i64 8
  %79 = load double, ptr %78, align 8, !tbaa !27
  %80 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %79, i32 noundef 6) #5
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.36, ptr noundef %80) #5
  %82 = getelementptr inbounds i8, ptr %4, i64 16
  %83 = load double, ptr %82, align 16, !tbaa !27
  %84 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %83, i32 noundef 6) #5
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.36, ptr noundef %84) #5
  %86 = load double, ptr %69, align 8, !tbaa !27
  %87 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %86, i32 noundef 6) #5
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.36, ptr noundef %87) #5
  %89 = getelementptr inbounds i8, ptr %4, i64 32
  %90 = load double, ptr %89, align 16, !tbaa !27
  %91 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %90, i32 noundef 6) #5
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.36, ptr noundef %91) #5
  %93 = getelementptr inbounds i8, ptr %4, i64 40
  %94 = load double, ptr %93, align 8, !tbaa !27
  %95 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %94, i32 noundef 6) #5
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.37, ptr noundef %95) #5
  br label %97

97:                                               ; preds = %74, %68
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %4) #5
  br label %98

98:                                               ; preds = %97, %switch.lookup
  %99 = getelementptr inbounds i8, ptr %1, i64 192
  %100 = load double, ptr %99, align 8, !tbaa !28
  %101 = fcmp une double %100, 0x7FEFFFFFFFFFFFFF
  br i1 %101, label %102, label %110

102:                                              ; preds = %98
  %103 = getelementptr inbounds i8, ptr %1, i64 224
  %104 = load i32, ptr %103, align 8, !tbaa !25
  %105 = icmp eq i32 %104, 2
  %106 = fcmp une double %100, 1.000000e+00
  %or.cond = and i1 %106, %105
  br i1 %or.cond, label %110, label %107

107:                                              ; preds = %102
  %108 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %100, i32 noundef 6) #5
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.51, ptr noundef %108) #5
  br label %110

110:                                              ; preds = %102, %107, %98
  %111 = getelementptr inbounds i8, ptr %1, i64 200
  %112 = load double, ptr %111, align 8, !tbaa !29
  %113 = fcmp olt double %112, 0x7FEFFFFFFFFFFFFF
  br i1 %113, label %114, label %118

114:                                              ; preds = %110
  %115 = fmul double %6, %112
  %116 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %115, i32 noundef 6) #5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.52, ptr noundef %116) #5
  br label %118

118:                                              ; preds = %114, %110
  %119 = getelementptr inbounds i8, ptr %1, i64 208
  %120 = load double, ptr %119, align 8, !tbaa !30
  %121 = fcmp olt double %120, 0x7FEFFFFFFFFFFFFF
  br i1 %121, label %122, label %126

122:                                              ; preds = %118
  %123 = fmul double %6, %120
  %124 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %123, i32 noundef 6) #5
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.53, ptr noundef %124) #5
  br label %126

126:                                              ; preds = %122, %118
  %127 = getelementptr inbounds i8, ptr %1, i64 216
  %128 = load double, ptr %127, align 8, !tbaa !31
  %129 = fcmp olt double %128, 0x7FEFFFFFFFFFFFFF
  br i1 %129, label %130, label %137

130:                                              ; preds = %126
  %131 = load double, ptr %119, align 8, !tbaa !30
  %132 = fcmp une double %128, %131
  br i1 %132, label %133, label %137

133:                                              ; preds = %130
  %134 = fmul double %6, %128
  %135 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %134, i32 noundef 6) #5
  %136 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.54, ptr noundef %135) #5
  br label %137

137:                                              ; preds = %133, %130, %126
  %138 = getelementptr inbounds i8, ptr %1, i64 224
  %139 = load i32, ptr %138, align 8, !tbaa !25
  switch i32 %139, label %141 [
    i32 0, label %150
    i32 1, label %.sink.split
    i32 2, label %140
  ]

140:                                              ; preds = %137
  br label %.sink.split

141:                                              ; preds = %137
  %142 = load ptr, ptr @stderr, align 8, !tbaa !24
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef nonnull @.str.48, ptr noundef nonnull @.str.27, ptr noundef nonnull @__func__.RcsJoint_fprintXML, i32 noundef 589) #6
  %144 = load ptr, ptr @stderr, align 8, !tbaa !24
  %145 = load i32, ptr %138, align 8, !tbaa !25
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef nonnull @.str.49, i32 noundef %145) #6
  %147 = load ptr, ptr @stderr, align 8, !tbaa !24
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef nonnull @.str.32) #6
  call void @print_trace() #5
  call void @exit(i32 noundef 1) #7
  unreachable

.sink.split:                                      ; preds = %137, %140
  %.str.56.sink = phi ptr [ @.str.56, %140 ], [ @.str.55, %137 ]
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull %.str.56.sink) #5
  br label %150

150:                                              ; preds = %.sink.split, %137
  %151 = getelementptr inbounds i8, ptr %1, i64 264
  %152 = load ptr, ptr %151, align 8, !tbaa !32
  %.not84 = icmp eq ptr %152, null
  br i1 %.not84, label %156, label %153

153:                                              ; preds = %150
  %154 = load ptr, ptr %152, align 8, !tbaa !5
  %155 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.57, ptr noundef %154) #5
  br label %156

156:                                              ; preds = %153, %150
  %157 = getelementptr inbounds i8, ptr %1, i64 240
  %158 = load ptr, ptr %157, align 8, !tbaa !33
  %.not85 = icmp eq ptr %158, null
  br i1 %.not85, label %174, label %159

159:                                              ; preds = %156
  %160 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.58) #5
  %161 = load ptr, ptr %157, align 8, !tbaa !33
  %162 = getelementptr inbounds i8, ptr %161, i64 8
  %163 = load i32, ptr %162, align 8, !tbaa !34
  %.not87 = icmp eq i32 %163, 0
  br i1 %.not87, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %159
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.59) #5
  br label %174

.lr.ph:                                           ; preds = %159, %.lr.ph
  %165 = phi ptr [ %170, %.lr.ph ], [ %161, %159 ]
  %.086 = phi i32 [ %169, %.lr.ph ], [ 0, %159 ]
  %166 = call double @MatNd_get(ptr noundef nonnull %165, i32 noundef %.086, i32 noundef 0) #5
  %167 = call ptr @String_fromDouble(ptr noundef nonnull %3, double noundef %166, i32 noundef 6) #5
  %168 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.36, ptr noundef %167) #5
  %169 = add nuw i32 %.086, 1
  %170 = load ptr, ptr %157, align 8, !tbaa !33
  %171 = getelementptr inbounds i8, ptr %170, i64 8
  %172 = load i32, ptr %171, align 8, !tbaa !34
  %173 = icmp ult i32 %169, %172
  br i1 %173, label %.lr.ph, label %._crit_edge, !llvm.loop !36

174:                                              ; preds = %._crit_edge, %156
  %175 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.60) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #5
  ret void
}

declare ptr @String_fromDouble(ptr noundef, double noundef, i32 noundef) local_unnamed_addr #2

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

declare void @Vec3d_copy(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @Mat3d_toEulerAngles(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @Vec3d_constMulSelf(ptr noundef, double noundef) local_unnamed_addr #2

declare double @VecNd_maxAbsEle(ptr noundef, i32 noundef) local_unnamed_addr #2

declare double @MatNd_get(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 }
attributes #6 = { cold 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, !7, i64 0}
!6 = !{!"_RcsJoint", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !11, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !7, i64 88, !13, i64 96, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !12, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"", !8, i64 0, !8, i64 24}
!14 = !{!6, !10, i64 24}
!15 = !{!6, !10, i64 16}
!16 = !{!6, !10, i64 32}
!17 = !{!6, !10, i64 40}
!18 = !{!6, !10, i64 48}
!19 = !{!6, !10, i64 56}
!20 = !{!6, !11, i64 64}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!6, !12, i64 68}
!24 = !{!7, !7, i64 0}
!25 = !{!6, !12, i64 224}
!26 = !{!6, !7, i64 88}
!27 = !{!10, !10, i64 0}
!28 = !{!6, !10, i64 192}
!29 = !{!6, !10, i64 200}
!30 = !{!6, !10, i64 208}
!31 = !{!6, !10, i64 216}
!32 = !{!6, !7, i64 264}
!33 = !{!6, !7, i64 240}
!34 = !{!35, !12, i64 8}
!35 = !{!"_MatNd", !7, i64 0, !12, i64 8, !12, i64 12, !12, i64 16, !11, i64 20}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}


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