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

; 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.HTr = type { [3 x double], [3 x [3 x double]] }

@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@RcsLogLevel = external global i32, align 4
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [39 x i8], align 1
@__func__.HTr_computeChaslesPole = external hidden unnamed_addr constant [23 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [51 x i8], align 1

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

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

declare void @Mat3d_setIdentity(ptr noundef) #2

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

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

declare double @Vec3d_diffAngle(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @HTr_computeChaslesPole(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #3 {
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca %struct.HTr, align 8
  %15 = alloca %struct.HTr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca [3 x double], align 16
  %19 = alloca ptr, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  %23 = alloca double, align 8
  %24 = alloca [3 x double], align 16
  %25 = alloca [3 x [3 x double]], align 16
  %26 = alloca [3 x [3 x double]], align 16
  %27 = alloca [3 x double], align 16
  %28 = alloca i8, align 1
  %29 = alloca double, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 96, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 96, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %30, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %31, ptr %17, align 8, !tbaa !5
  %32 = load ptr, ptr %16, align 8, !tbaa !5
  %33 = load ptr, ptr %17, align 8, !tbaa !5
  call void @HTr_invTransform(ptr noundef %14, ptr noundef %32, ptr noundef %33)
  %34 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %35 = getelementptr inbounds [3 x [3 x double]], ptr %34, i64 0, i64 0
  %36 = getelementptr inbounds %struct.HTr, ptr %14, i32 0, i32 1
  %37 = getelementptr inbounds [3 x [3 x double]], ptr %36, i64 0, i64 0
  call void @Mat3d_transpose(ptr noundef %35, ptr noundef %37)
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %38 = getelementptr inbounds %struct.HTr, ptr %14, i32 0, i32 0
  %39 = getelementptr inbounds [3 x double], ptr %38, i64 0, i64 0
  store ptr %39, ptr %19, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %41 = getelementptr inbounds [3 x [3 x double]], ptr %40, i64 0, i64 2
  %42 = getelementptr inbounds [3 x double], ptr %41, i64 0, i64 1
  %43 = load double, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %45 = getelementptr inbounds [3 x [3 x double]], ptr %44, i64 0, i64 1
  %46 = getelementptr inbounds [3 x double], ptr %45, i64 0, i64 2
  %47 = load double, ptr %46, align 8, !tbaa !9
  %48 = fsub double %43, %47
  %49 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  store double %48, ptr %49, align 16, !tbaa !9
  %50 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %51 = getelementptr inbounds [3 x [3 x double]], ptr %50, i64 0, i64 0
  %52 = getelementptr inbounds [3 x double], ptr %51, i64 0, i64 2
  %53 = load double, ptr %52, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %55 = getelementptr inbounds [3 x [3 x double]], ptr %54, i64 0, i64 2
  %56 = getelementptr inbounds [3 x double], ptr %55, i64 0, i64 0
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = fsub double %53, %57
  %59 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 1
  store double %58, ptr %59, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %61 = getelementptr inbounds [3 x [3 x double]], ptr %60, i64 0, i64 1
  %62 = getelementptr inbounds [3 x double], ptr %61, i64 0, i64 0
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %65 = getelementptr inbounds [3 x [3 x double]], ptr %64, i64 0, i64 0
  %66 = getelementptr inbounds [3 x double], ptr %65, i64 0, i64 1
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = fsub double %63, %67
  %69 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 2
  store double %68, ptr %69, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %70 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %71 = load ptr, ptr %19, align 8, !tbaa !5
  %72 = call double @Vec3d_innerProduct(ptr noundef %70, ptr noundef %71)
  %73 = call double @Math_dsign(double noundef %72)
  %74 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %75 = getelementptr inbounds [3 x [3 x double]], ptr %74, i64 0, i64 0
  %76 = getelementptr inbounds [3 x double], ptr %75, i64 0, i64 0
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %79 = getelementptr inbounds [3 x [3 x double]], ptr %78, i64 0, i64 1
  %80 = getelementptr inbounds [3 x double], ptr %79, i64 0, i64 1
  %81 = load double, ptr %80, align 8, !tbaa !9
  %82 = fadd double %77, %81
  %83 = getelementptr inbounds %struct.HTr, ptr %15, i32 0, i32 1
  %84 = getelementptr inbounds [3 x [3 x double]], ptr %83, i64 0, i64 2
  %85 = getelementptr inbounds [3 x double], ptr %84, i64 0, i64 2
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = fadd double %82, %86
  %88 = fsub double %87, 1.000000e+00
  %89 = fmul double 5.000000e-01, %88
  %90 = call double @Math_acos(double noundef %89)
  %91 = call double @llvm.fabs.f64(double %90)
  %92 = fmul double %73, %91
  store double %92, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %93 = load double, ptr %20, align 8, !tbaa !9
  %94 = call double @sin(double noundef %93) #6
  store double %94, ptr %21, align 8, !tbaa !9
  %95 = load double, ptr %21, align 8, !tbaa !9
  %96 = fcmp oeq double %95, 0.000000e+00
  br i1 %96, label %97, label %98

97:                                               ; preds = %6
  store i1 false, ptr %7, align 1
  store i32 1, ptr %22, align 4
  br label %227

98:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %99 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %100 = load ptr, ptr %19, align 8, !tbaa !5
  %101 = call double @Vec3d_innerProduct(ptr noundef %99, ptr noundef %100)
  %102 = load double, ptr %20, align 8, !tbaa !9
  %103 = fmul double 2.000000e+00, %102
  %104 = load double, ptr %21, align 8, !tbaa !9
  %105 = fmul double %103, %104
  %106 = fdiv double %101, %105
  store double %106, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 72, ptr %26) #6
  %107 = getelementptr inbounds [3 x [3 x double]], ptr %26, i64 0, i64 0
  call void @Mat3d_setIdentity(ptr noundef %107)
  %108 = getelementptr inbounds [3 x [3 x double]], ptr %25, i64 0, i64 0
  %109 = getelementptr inbounds [3 x [3 x double]], ptr %26, i64 0, i64 0
  %110 = getelementptr inbounds %struct.HTr, ptr %14, i32 0, i32 1
  %111 = getelementptr inbounds [3 x [3 x double]], ptr %110, i64 0, i64 0
  call void @Mat3d_sub(ptr noundef %108, ptr noundef %109, ptr noundef %111)
  %112 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %113 = getelementptr inbounds [3 x [3 x double]], ptr %25, i64 0, i64 0
  %114 = load ptr, ptr %19, align 8, !tbaa !5
  call void @Vec3d_rotate(ptr noundef %112, ptr noundef %113, ptr noundef %114)
  %115 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %116 = load double, ptr %20, align 8, !tbaa !9
  %117 = call double @cos(double noundef %116) #6
  %118 = fsub double 1.000000e+00, %117
  %119 = fmul double 2.000000e+00, %118
  %120 = fdiv double 1.000000e+00, %119
  call void @Vec3d_constMulSelf(ptr noundef %115, double noundef %120)
  call void @llvm.lifetime.start.p0(i64 24, ptr %27) #6
  %121 = getelementptr inbounds [3 x double], ptr %27, i64 0, i64 0
  %122 = getelementptr inbounds [3 x double], ptr %18, i64 0, i64 0
  %123 = load double, ptr %21, align 8, !tbaa !9
  %124 = fmul double 2.000000e+00, %123
  %125 = fdiv double 1.000000e+00, %124
  call void @Vec3d_constMul(ptr noundef %121, ptr noundef %122, double noundef %125)
  %126 = getelementptr inbounds [3 x double], ptr %27, i64 0, i64 0
  %127 = call double @Vec3d_sqrLength(ptr noundef %126)
  %128 = fsub double %127, 1.000000e+00
  %129 = call double @llvm.fabs.f64(double %128)
  %130 = fcmp ogt double %129, 1.000000e-08
  br i1 %130, label %131, label %132

131:                                              ; preds = %98
  store i1 false, ptr %7, align 1
  store i32 1, ptr %22, align 4
  br label %226

132:                                              ; preds = %98
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.HTr, ptr %134, i32 0, i32 1
  %136 = getelementptr inbounds [3 x [3 x double]], ptr %135, i64 0, i64 0
  %137 = getelementptr inbounds [3 x double], ptr %27, i64 0, i64 0
  call void @Vec3d_transRotate(ptr noundef %133, ptr noundef %136, ptr noundef %137)
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  call void @Vec3d_transform(ptr noundef %138, ptr noundef %139, ptr noundef %140)
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  %142 = icmp ne ptr %141, null
  br i1 %142, label %143, label %146

143:                                              ; preds = %132
  %144 = load double, ptr %23, align 8, !tbaa !9
  %145 = load ptr, ptr %12, align 8, !tbaa !5
  store double %144, ptr %145, align 8, !tbaa !9
  br label %146

146:                                              ; preds = %143, %132
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %152

149:                                              ; preds = %146
  %150 = load double, ptr %20, align 8, !tbaa !9
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  store double %150, ptr %151, align 8, !tbaa !9
  br label %152

152:                                              ; preds = %149, %146
  %153 = load i32, ptr @RcsLogLevel, align 4, !tbaa !11
  %154 = icmp sle i32 5, %153
  br i1 %154, label %155, label %225

155:                                              ; preds = %152
  call void @llvm.lifetime.start.p0(i64 1, ptr %28) #6
  store i8 0, ptr %28, align 1, !tbaa !13
  %156 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %157 = call double @Vec3d_getLength(ptr noundef %156)
  %158 = fcmp ogt double %157, 1.000000e-08
  br i1 %158, label %159, label %196

159:                                              ; preds = %155
  %160 = getelementptr inbounds [3 x double], ptr %27, i64 0, i64 0
  %161 = call double @Vec3d_getLength(ptr noundef %160)
  %162 = fcmp ogt double %161, 1.000000e-08
  br i1 %162, label %163, label %196

163:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  %164 = getelementptr inbounds [3 x double], ptr %27, i64 0, i64 0
  %165 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %166 = call double @Vec3d_diffAngle(ptr noundef %164, ptr noundef %165)
  store double %166, ptr %29, align 8, !tbaa !9
  %167 = load double, ptr %29, align 8, !tbaa !9
  %168 = fsub double %167, 0x3FF921FB54442D18
  %169 = call double @llvm.fabs.f64(double %168)
  %170 = fcmp olt double %169, 0x3EB0C6F7A0B5ED8D
  %171 = zext i1 %170 to i64
  %172 = select i1 %170, i32 1, i32 0
  %173 = icmp ne i32 %172, 0
  %174 = zext i1 %173 to i8
  store i8 %174, ptr %28, align 1, !tbaa !13
  br label %175

175:                                              ; preds = %163
  %176 = load i8, ptr %28, align 1, !tbaa !13, !range !15, !noundef !16
  %177 = trunc i8 %176 to i1
  br i1 %177, label %193, label %178

178:                                              ; preds = %175
  %179 = load ptr, ptr @stderr, align 8, !tbaa !5
  %180 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.19, ptr noundef @.str.1, ptr noundef @__func__.HTr_computeChaslesPole, i32 noundef 605, ptr noundef @.str.20) #6
  %181 = load ptr, ptr @stderr, align 8, !tbaa !5
  %182 = load i8, ptr %28, align 1, !tbaa !13, !range !15, !noundef !16
  %183 = trunc i8 %182 to i1
  %184 = zext i1 %183 to i64
  %185 = select i1 %183, ptr @.str.22, ptr @.str.23
  %186 = getelementptr inbounds [3 x double], ptr %27, i64 0, i64 0
  %187 = getelementptr inbounds [3 x double], ptr %24, i64 0, i64 0
  %188 = call double @Vec3d_diffAngle(ptr noundef %186, ptr noundef %187)
  %189 = fmul double 0x404CA5DC1A63C1F8, %188
  %190 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.21, ptr noundef %185, double noundef %189) #6
  %191 = load ptr, ptr @stderr, align 8, !tbaa !5
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef @.str.6) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

193:                                              ; preds = %175
  br label %194

194:                                              ; preds = %193
  br label %195

195:                                              ; preds = %194
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  br label %196

196:                                              ; preds = %195, %159, %155
  %197 = getelementptr inbounds [3 x double], ptr %27, i64 0, i64 0
  %198 = call double @Vec3d_sqrLength(ptr noundef %197)
  %199 = fsub double %198, 1.000000e+00
  %200 = call double @llvm.fabs.f64(double %199)
  %201 = fcmp olt double %200, 1.000000e-08
  %202 = zext i1 %201 to i64
  %203 = select i1 %201, i32 1, i32 0
  %204 = icmp ne i32 %203, 0
  %205 = zext i1 %204 to i8
  store i8 %205, ptr %28, align 1, !tbaa !13
  br label %206

206:                                              ; preds = %196
  %207 = load i8, ptr %28, align 1, !tbaa !13, !range !15, !noundef !16
  %208 = trunc i8 %207 to i1
  br i1 %208, label %222, label %209

209:                                              ; preds = %206
  %210 = load ptr, ptr @stderr, align 8, !tbaa !5
  %211 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.19, ptr noundef @.str.1, ptr noundef @__func__.HTr_computeChaslesPole, i32 noundef 613, ptr noundef @.str.20) #6
  %212 = load ptr, ptr @stderr, align 8, !tbaa !5
  %213 = load i8, ptr %28, align 1, !tbaa !13, !range !15, !noundef !16
  %214 = trunc i8 %213 to i1
  %215 = zext i1 %214 to i64
  %216 = select i1 %214, ptr @.str.22, ptr @.str.23
  %217 = getelementptr inbounds [3 x double], ptr %27, i64 0, i64 0
  %218 = call double @Vec3d_sqrLength(ptr noundef %217)
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %212, ptr noundef @.str.24, ptr noundef %216, double noundef %218) #6
  %220 = load ptr, ptr @stderr, align 8, !tbaa !5
  %221 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %220, ptr noundef @.str.6) #6
  call void @print_trace()
  call void @exit(i32 noundef 1) #7
  unreachable

222:                                              ; preds = %206
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223
  call void @llvm.lifetime.end.p0(i64 1, ptr %28) #6
  br label %225

225:                                              ; preds = %224, %152
  store i1 true, ptr %7, align 1
  store i32 1, ptr %22, align 4
  br label %226

226:                                              ; preds = %225, %131
  call void @llvm.lifetime.end.p0(i64 24, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %227

227:                                              ; preds = %226, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 96, ptr %14) #6
  %228 = load i1, ptr %7, align 1
  ret i1 %228
}

declare double @Math_dsign(double noundef) #2

declare double @Vec3d_innerProduct(ptr noundef, ptr noundef) #2

declare double @Math_acos(double noundef) #2

; Function Attrs: nounwind
declare double @sin(double noundef) #1

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

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

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

; Function Attrs: nounwind
declare double @cos(double noundef) #1

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

declare double @Vec3d_sqrLength(ptr noundef) #2

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

declare double @Vec3d_getLength(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}


; 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.HTr = type { [3 x double], [3 x [3 x double]] }

@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [66 x i8], align 1
@RcsLogLevel = external local_unnamed_addr global i32, align 4
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [39 x i8], align 1
@__func__.HTr_computeChaslesPole = external hidden unnamed_addr constant [23 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [51 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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.end.p0(i64 immarg, ptr nocapture) #0

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

declare void @Mat3d_setIdentity(ptr noundef) local_unnamed_addr #2

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

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

declare double @Vec3d_diffAngle(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @HTr_computeChaslesPole(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef writeonly %4, ptr noundef writeonly %5) local_unnamed_addr #3 {
  %7 = alloca %struct.HTr, align 8
  %8 = alloca %struct.HTr, align 8
  %9 = alloca [3 x double], align 16
  %10 = alloca [3 x double], align 16
  %11 = alloca [3 x [3 x double]], align 16
  %12 = alloca [3 x [3 x double]], align 16
  %13 = alloca [3 x double], align 16
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %8) #7
  call void @HTr_invTransform(ptr noundef nonnull %7, ptr noundef %1, ptr noundef %0)
  %14 = getelementptr inbounds i8, ptr %8, i64 24
  %15 = getelementptr inbounds i8, ptr %7, i64 24
  call void @Mat3d_transpose(ptr noundef nonnull %14, ptr noundef nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  %16 = getelementptr inbounds i8, ptr %8, i64 80
  %17 = load <2 x double>, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr %8, i64 48
  %19 = getelementptr inbounds i8, ptr %8, i64 64
  %20 = getelementptr inbounds i8, ptr %8, i64 40
  %21 = load double, ptr %20, align 8, !tbaa !5
  %22 = load <2 x double>, ptr %19, align 8, !tbaa !5
  %23 = insertelement <2 x double> %17, double %21, i64 1
  %24 = fsub <2 x double> %23, %22
  store <2 x double> %24, ptr %9, align 16, !tbaa !5
  %25 = load double, ptr %18, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %8, i64 32
  %27 = load double, ptr %26, align 8, !tbaa !5
  %28 = fsub double %25, %27
  %29 = getelementptr inbounds i8, ptr %9, i64 16
  store double %28, ptr %29, align 16, !tbaa !5
  %30 = call double @Vec3d_innerProduct(ptr noundef nonnull %9, ptr noundef nonnull %7) #7
  %31 = call double @Math_dsign(double noundef %30) #7
  %32 = load double, ptr %14, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %8, i64 56
  %34 = load double, ptr %33, align 8, !tbaa !5
  %35 = fadd double %32, %34
  %36 = getelementptr inbounds i8, ptr %8, i64 88
  %37 = load double, ptr %36, align 8, !tbaa !5
  %38 = fadd double %35, %37
  %39 = fadd double %38, -1.000000e+00
  %40 = fmul double %39, 5.000000e-01
  %41 = call double @Math_acos(double noundef %40) #7
  %42 = call double @llvm.fabs.f64(double %41)
  %43 = fmul double %31, %42
  %44 = call double @sin(double noundef %43) #7
  %45 = fcmp oeq double %44, 0.000000e+00
  br i1 %45, label %103, label %46

46:                                               ; preds = %6
  %47 = call double @Vec3d_innerProduct(ptr noundef nonnull %9, ptr noundef nonnull %7) #7
  %48 = fmul double %43, 2.000000e+00
  %49 = fmul double %44, %48
  %50 = fdiv double %47, %49
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %12) #7
  call void @Mat3d_setIdentity(ptr noundef nonnull %12) #7
  call void @Mat3d_sub(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %15) #7
  call void @Vec3d_rotate(ptr noundef nonnull %10, ptr noundef nonnull %11, ptr noundef nonnull %7) #7
  %51 = call double @cos(double noundef %43) #7
  %52 = fsub double 1.000000e+00, %51
  %53 = fmul double %52, 2.000000e+00
  %54 = fdiv double 1.000000e+00, %53
  call void @Vec3d_constMulSelf(ptr noundef nonnull %10, double noundef %54) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  %55 = fmul double %44, 2.000000e+00
  %56 = fdiv double 1.000000e+00, %55
  call void @Vec3d_constMul(ptr noundef nonnull %13, ptr noundef nonnull %9, double noundef %56) #7
  %57 = call double @Vec3d_sqrLength(ptr noundef nonnull %13) #7
  %58 = fadd double %57, -1.000000e+00
  %59 = call double @llvm.fabs.f64(double %58)
  %60 = fcmp ule double %59, 1.000000e-08
  br i1 %60, label %61, label %102

61:                                               ; preds = %46
  %62 = getelementptr inbounds i8, ptr %0, i64 24
  call void @Vec3d_transRotate(ptr noundef %3, ptr noundef nonnull %62, ptr noundef nonnull %13) #7
  call void @Vec3d_transform(ptr noundef %2, ptr noundef %0, ptr noundef nonnull %10) #7
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %64, label %63

63:                                               ; preds = %61
  store double %50, ptr %4, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %63, %61
  %.not31 = icmp eq ptr %5, null
  br i1 %.not31, label %66, label %65

65:                                               ; preds = %64
  store double %43, ptr %5, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %65, %64
  %67 = load i32, ptr @RcsLogLevel, align 4, !tbaa !9
  %68 = icmp sgt i32 %67, 4
  br i1 %68, label %69, label %102

69:                                               ; preds = %66
  %70 = call double @Vec3d_getLength(ptr noundef nonnull %10) #7
  %71 = fcmp ogt double %70, 1.000000e-08
  br i1 %71, label %72, label %89

72:                                               ; preds = %69
  %73 = call double @Vec3d_getLength(ptr noundef nonnull %13) #7
  %74 = fcmp ogt double %73, 1.000000e-08
  br i1 %74, label %75, label %89

75:                                               ; preds = %72
  %76 = call double @Vec3d_diffAngle(ptr noundef nonnull %13, ptr noundef nonnull %10) #7
  %77 = fadd double %76, 0xBFF921FB54442D18
  %78 = call double @llvm.fabs.f64(double %77)
  %79 = fcmp olt double %78, 0x3EB0C6F7A0B5ED8D
  br i1 %79, label %89, label %80

80:                                               ; preds = %75
  %81 = load ptr, ptr @stderr, align 8, !tbaa !11
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.HTr_computeChaslesPole, i32 noundef 605, ptr noundef nonnull @.str.20) #8
  %83 = load ptr, ptr @stderr, align 8, !tbaa !11
  %84 = call double @Vec3d_diffAngle(ptr noundef nonnull %13, ptr noundef nonnull %10) #7
  %85 = fmul double %84, 0x404CA5DC1A63C1F8
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef nonnull @.str.21, ptr noundef nonnull @.str.23, double noundef %85) #8
  %87 = load ptr, ptr @stderr, align 8, !tbaa !11
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef nonnull @.str.6) #8
  call void @print_trace() #7
  call void @exit(i32 noundef 1) #9
  unreachable

89:                                               ; preds = %75, %72, %69
  %90 = call double @Vec3d_sqrLength(ptr noundef nonnull %13) #7
  %91 = fadd double %90, -1.000000e+00
  %92 = call double @llvm.fabs.f64(double %91)
  %93 = fcmp olt double %92, 1.000000e-08
  br i1 %93, label %102, label %94

94:                                               ; preds = %89
  %95 = load ptr, ptr @stderr, align 8, !tbaa !11
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.1, ptr noundef nonnull @__func__.HTr_computeChaslesPole, i32 noundef 613, ptr noundef nonnull @.str.20) #8
  %97 = load ptr, ptr @stderr, align 8, !tbaa !11
  %98 = call double @Vec3d_sqrLength(ptr noundef nonnull %13) #7
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %97, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.23, double noundef %98) #8
  %100 = load ptr, ptr @stderr, align 8, !tbaa !11
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.6) #8
  call void @print_trace() #7
  call void @exit(i32 noundef 1) #9
  unreachable

102:                                              ; preds = %66, %89, %46
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  br label %103

103:                                              ; preds = %6, %102
  %.1 = phi i1 [ %60, %102 ], [ false, %6 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %7) #7
  ret i1 %.1
}

declare double @Math_dsign(double noundef) local_unnamed_addr #2

declare double @Vec3d_innerProduct(ptr noundef, ptr noundef) local_unnamed_addr #2

declare double @Math_acos(double noundef) local_unnamed_addr #2

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

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

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

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

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

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

declare double @Vec3d_sqrLength(ptr noundef) local_unnamed_addr #2

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

declare double @Vec3d_getLength(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { 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 #7 = { nounwind }
attributes #8 = { cold nounwind }
attributes #9 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass