; LLVM IR from HRI-EU/Rcs :: external (EulerAngles)

; 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.EulerAngles = type { double, double, double, i32 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @Eul_FromHMatrix(ptr dead_on_unwind noalias writable sret(%struct.EulerAngles) align 8 %0, ptr noundef %1, i32 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store i32 %2, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %17 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %18 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %18, ptr %13, align 4, !tbaa !9
  %19 = load i32, ptr %13, align 4, !tbaa !9
  %20 = and i32 %19, 1
  store i32 %20, ptr %12, align 4, !tbaa !9
  %21 = load i32, ptr %13, align 4, !tbaa !9
  %22 = lshr i32 %21, 1
  store i32 %22, ptr %13, align 4, !tbaa !9
  %23 = load i32, ptr %13, align 4, !tbaa !9
  %24 = and i32 %23, 1
  store i32 %24, ptr %11, align 4, !tbaa !9
  %25 = load i32, ptr %13, align 4, !tbaa !9
  %26 = lshr i32 %25, 1
  store i32 %26, ptr %13, align 4, !tbaa !9
  %27 = load i32, ptr %13, align 4, !tbaa !9
  %28 = and i32 %27, 1
  store i32 %28, ptr %10, align 4, !tbaa !9
  %29 = load i32, ptr %13, align 4, !tbaa !9
  %30 = lshr i32 %29, 1
  store i32 %30, ptr %13, align 4, !tbaa !9
  %31 = load i32, ptr %13, align 4, !tbaa !9
  %32 = and i32 %31, 3
  %33 = zext i32 %32 to i64
  %34 = getelementptr inbounds [5 x i8], ptr @.str, i64 0, i64 %33
  %35 = load i8, ptr %34, align 1, !tbaa !11
  %36 = sext i8 %35 to i32
  store i32 %36, ptr %6, align 4, !tbaa !9
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = load i32, ptr %10, align 4, !tbaa !9
  %39 = add nsw i32 %37, %38
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [5 x i8], ptr @.str.1, i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !11
  %43 = sext i8 %42 to i32
  store i32 %43, ptr %7, align 4, !tbaa !9
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  %46 = load i32, ptr %10, align 4, !tbaa !9
  %47 = sub nsw i32 %45, %46
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [5 x i8], ptr @.str.1, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  store i32 %51, ptr %8, align 4, !tbaa !9
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %56

54:                                               ; preds = %3
  %55 = load i32, ptr %8, align 4, !tbaa !9
  br label %58

56:                                               ; preds = %3
  %57 = load i32, ptr %6, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %56, %54
  %59 = phi i32 [ %55, %54 ], [ %57, %56 ]
  store i32 %59, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  %60 = load i32, ptr %11, align 4, !tbaa !9
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %182

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [4 x double], ptr %63, i64 %65
  %67 = load i32, ptr %7, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [4 x double], ptr %66, i64 0, i64 %68
  %70 = load double, ptr %69, align 8, !tbaa !12
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [4 x double], ptr %71, i64 %73
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [4 x double], ptr %74, i64 0, i64 %76
  %78 = load double, ptr %77, align 8, !tbaa !12
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [4 x double], ptr %79, i64 %81
  %83 = load i32, ptr %8, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [4 x double], ptr %82, i64 0, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !12
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load i32, ptr %6, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [4 x double], ptr %87, i64 %89
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4 x double], ptr %90, i64 0, i64 %92
  %94 = load double, ptr %93, align 8, !tbaa !12
  %95 = fmul double %86, %94
  %96 = call double @llvm.fmuladd.f64(double %70, double %78, double %95)
  %97 = call double @sqrt(double noundef %96) #4
  store double %97, ptr %14, align 8, !tbaa !12
  %98 = load double, ptr %14, align 8, !tbaa !12
  %99 = fcmp ogt double %98, 0x3EC0000000000000
  br i1 %99, label %100, label %149

100:                                              ; preds = %62
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = load i32, ptr %6, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [4 x double], ptr %101, i64 %103
  %105 = load i32, ptr %7, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [4 x double], ptr %104, i64 0, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !12
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = load i32, ptr %6, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [4 x double], ptr %109, i64 %111
  %113 = load i32, ptr %8, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [4 x double], ptr %112, i64 0, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !12
  %117 = call double @atan2(double noundef %108, double noundef %116) #4
  %118 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 0
  store double %117, ptr %118, align 8, !tbaa !14
  %119 = load double, ptr %14, align 8, !tbaa !12
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = load i32, ptr %6, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [4 x double], ptr %120, i64 %122
  %124 = load i32, ptr %6, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [4 x double], ptr %123, i64 0, i64 %125
  %127 = load double, ptr %126, align 8, !tbaa !12
  %128 = call double @atan2(double noundef %119, double noundef %127) #4
  %129 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 1
  store double %128, ptr %129, align 8, !tbaa !16
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = load i32, ptr %7, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [4 x double], ptr %130, i64 %132
  %134 = load i32, ptr %6, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [4 x double], ptr %133, i64 0, i64 %135
  %137 = load double, ptr %136, align 8, !tbaa !12
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = load i32, ptr %8, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [4 x double], ptr %138, i64 %140
  %142 = load i32, ptr %6, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [4 x double], ptr %141, i64 0, i64 %143
  %145 = load double, ptr %144, align 8, !tbaa !12
  %146 = fneg double %145
  %147 = call double @atan2(double noundef %137, double noundef %146) #4
  %148 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 2
  store double %147, ptr %148, align 8, !tbaa !17
  br label %181

149:                                              ; preds = %62
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = load i32, ptr %7, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [4 x double], ptr %150, i64 %152
  %154 = load i32, ptr %8, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [4 x double], ptr %153, i64 0, i64 %155
  %157 = load double, ptr %156, align 8, !tbaa !12
  %158 = fneg double %157
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = load i32, ptr %7, align 4, !tbaa !9
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [4 x double], ptr %159, i64 %161
  %163 = load i32, ptr %7, align 4, !tbaa !9
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [4 x double], ptr %162, i64 0, i64 %164
  %166 = load double, ptr %165, align 8, !tbaa !12
  %167 = call double @atan2(double noundef %158, double noundef %166) #4
  %168 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 0
  store double %167, ptr %168, align 8, !tbaa !14
  %169 = load double, ptr %14, align 8, !tbaa !12
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = load i32, ptr %6, align 4, !tbaa !9
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [4 x double], ptr %170, i64 %172
  %174 = load i32, ptr %6, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [4 x double], ptr %173, i64 0, i64 %175
  %177 = load double, ptr %176, align 8, !tbaa !12
  %178 = call double @atan2(double noundef %169, double noundef %177) #4
  %179 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 1
  store double %178, ptr %179, align 8, !tbaa !16
  %180 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 2
  store double 0.000000e+00, ptr %180, align 8, !tbaa !17
  br label %181

181:                                              ; preds = %149, %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %303

182:                                              ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  %184 = load i32, ptr %6, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [4 x double], ptr %183, i64 %185
  %187 = load i32, ptr %6, align 4, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [4 x double], ptr %186, i64 0, i64 %188
  %190 = load double, ptr %189, align 8, !tbaa !12
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  %192 = load i32, ptr %6, align 4, !tbaa !9
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [4 x double], ptr %191, i64 %193
  %195 = load i32, ptr %6, align 4, !tbaa !9
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [4 x double], ptr %194, i64 0, i64 %196
  %198 = load double, ptr %197, align 8, !tbaa !12
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = load i32, ptr %7, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  %202 = getelementptr inbounds [4 x double], ptr %199, i64 %201
  %203 = load i32, ptr %6, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [4 x double], ptr %202, i64 0, i64 %204
  %206 = load double, ptr %205, align 8, !tbaa !12
  %207 = load ptr, ptr %4, align 8, !tbaa !5
  %208 = load i32, ptr %7, align 4, !tbaa !9
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [4 x double], ptr %207, i64 %209
  %211 = load i32, ptr %6, align 4, !tbaa !9
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [4 x double], ptr %210, i64 0, i64 %212
  %214 = load double, ptr %213, align 8, !tbaa !12
  %215 = fmul double %206, %214
  %216 = call double @llvm.fmuladd.f64(double %190, double %198, double %215)
  %217 = call double @sqrt(double noundef %216) #4
  store double %217, ptr %15, align 8, !tbaa !12
  %218 = load double, ptr %15, align 8, !tbaa !12
  %219 = fcmp ogt double %218, 0x3EC0000000000000
  br i1 %219, label %220, label %269

220:                                              ; preds = %182
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = load i32, ptr %8, align 4, !tbaa !9
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [4 x double], ptr %221, i64 %223
  %225 = load i32, ptr %7, align 4, !tbaa !9
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [4 x double], ptr %224, i64 0, i64 %226
  %228 = load double, ptr %227, align 8, !tbaa !12
  %229 = load ptr, ptr %4, align 8, !tbaa !5
  %230 = load i32, ptr %8, align 4, !tbaa !9
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [4 x double], ptr %229, i64 %231
  %233 = load i32, ptr %8, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [4 x double], ptr %232, i64 0, i64 %234
  %236 = load double, ptr %235, align 8, !tbaa !12
  %237 = call double @atan2(double noundef %228, double noundef %236) #4
  %238 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 0
  store double %237, ptr %238, align 8, !tbaa !14
  %239 = load ptr, ptr %4, align 8, !tbaa !5
  %240 = load i32, ptr %8, align 4, !tbaa !9
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds [4 x double], ptr %239, i64 %241
  %243 = load i32, ptr %6, align 4, !tbaa !9
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [4 x double], ptr %242, i64 0, i64 %244
  %246 = load double, ptr %245, align 8, !tbaa !12
  %247 = fneg double %246
  %248 = load double, ptr %15, align 8, !tbaa !12
  %249 = call double @atan2(double noundef %247, double noundef %248) #4
  %250 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 1
  store double %249, ptr %250, align 8, !tbaa !16
  %251 = load ptr, ptr %4, align 8, !tbaa !5
  %252 = load i32, ptr %7, align 4, !tbaa !9
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [4 x double], ptr %251, i64 %253
  %255 = load i32, ptr %6, align 4, !tbaa !9
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [4 x double], ptr %254, i64 0, i64 %256
  %258 = load double, ptr %257, align 8, !tbaa !12
  %259 = load ptr, ptr %4, align 8, !tbaa !5
  %260 = load i32, ptr %6, align 4, !tbaa !9
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [4 x double], ptr %259, i64 %261
  %263 = load i32, ptr %6, align 4, !tbaa !9
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [4 x double], ptr %262, i64 0, i64 %264
  %266 = load double, ptr %265, align 8, !tbaa !12
  %267 = call double @atan2(double noundef %258, double noundef %266) #4
  %268 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 2
  store double %267, ptr %268, align 8, !tbaa !17
  br label %302

269:                                              ; preds = %182
  %270 = load ptr, ptr %4, align 8, !tbaa !5
  %271 = load i32, ptr %7, align 4, !tbaa !9
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [4 x double], ptr %270, i64 %272
  %274 = load i32, ptr %8, align 4, !tbaa !9
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [4 x double], ptr %273, i64 0, i64 %275
  %277 = load double, ptr %276, align 8, !tbaa !12
  %278 = fneg double %277
  %279 = load ptr, ptr %4, align 8, !tbaa !5
  %280 = load i32, ptr %7, align 4, !tbaa !9
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [4 x double], ptr %279, i64 %281
  %283 = load i32, ptr %7, align 4, !tbaa !9
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [4 x double], ptr %282, i64 0, i64 %284
  %286 = load double, ptr %285, align 8, !tbaa !12
  %287 = call double @atan2(double noundef %278, double noundef %286) #4
  %288 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 0
  store double %287, ptr %288, align 8, !tbaa !14
  %289 = load ptr, ptr %4, align 8, !tbaa !5
  %290 = load i32, ptr %8, align 4, !tbaa !9
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [4 x double], ptr %289, i64 %291
  %293 = load i32, ptr %6, align 4, !tbaa !9
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [4 x double], ptr %292, i64 0, i64 %294
  %296 = load double, ptr %295, align 8, !tbaa !12
  %297 = fneg double %296
  %298 = load double, ptr %15, align 8, !tbaa !12
  %299 = call double @atan2(double noundef %297, double noundef %298) #4
  %300 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 1
  store double %299, ptr %300, align 8, !tbaa !16
  %301 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 2
  store double 0.000000e+00, ptr %301, align 8, !tbaa !17
  br label %302

302:                                              ; preds = %269, %220
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %303

303:                                              ; preds = %302, %181
  %304 = load i32, ptr %10, align 4, !tbaa !9
  %305 = icmp eq i32 %304, 1
  br i1 %305, label %306, label %319

306:                                              ; preds = %303
  %307 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 0
  %308 = load double, ptr %307, align 8, !tbaa !14
  %309 = fneg double %308
  %310 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 0
  store double %309, ptr %310, align 8, !tbaa !14
  %311 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 1
  %312 = load double, ptr %311, align 8, !tbaa !16
  %313 = fneg double %312
  %314 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 1
  store double %313, ptr %314, align 8, !tbaa !16
  %315 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 2
  %316 = load double, ptr %315, align 8, !tbaa !17
  %317 = fneg double %316
  %318 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 2
  store double %317, ptr %318, align 8, !tbaa !17
  br label %319

319:                                              ; preds = %306, %303
  %320 = load i32, ptr %12, align 4, !tbaa !9
  %321 = icmp eq i32 %320, 1
  br i1 %321, label %322, label %330

322:                                              ; preds = %319
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %323 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 0
  %324 = load double, ptr %323, align 8, !tbaa !14
  store double %324, ptr %16, align 8, !tbaa !12
  %325 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 2
  %326 = load double, ptr %325, align 8, !tbaa !17
  %327 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 0
  store double %326, ptr %327, align 8, !tbaa !14
  %328 = load double, ptr %16, align 8, !tbaa !12
  %329 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 2
  store double %328, ptr %329, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %330

330:                                              ; preds = %322, %319
  %331 = load i32, ptr %5, align 4, !tbaa !9
  %332 = getelementptr inbounds %struct.EulerAngles, ptr %0, i32 0, i32 3
  store i32 %331, ptr %332, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  ret void
}

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

; Function Attrs: nounwind
declare double @atan2(double noundef, double noundef) #3

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!15, !13, i64 0}
!15 = !{!"", !13, i64 0, !13, i64 8, !13, i64 16, !10, i64 24}
!16 = !{!15, !13, i64 8}
!17 = !{!15, !13, i64 16}
!18 = !{!15, !10, i64 24}


; 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.EulerAngles = type { double, double, double, i32 }

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) uwtable
define dso_local void @Eul_FromHMatrix(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.EulerAngles) align 8 %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = and i32 %2, 1
  %5 = lshr i32 %2, 2
  %6 = and i32 %5, 1
  %7 = lshr i32 %2, 3
  %8 = and i32 %7, 3
  %9 = zext nneg i32 %8 to i64
  %10 = getelementptr inbounds [5 x i8], ptr @.str, i64 0, i64 %9
  %11 = load i8, ptr %10, align 1, !tbaa !5
  %12 = sext i8 %11 to i32
  %13 = add nsw i32 %6, %12
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [5 x i8], ptr @.str.1, i64 0, i64 %14
  %16 = load i8, ptr %15, align 1, !tbaa !5
  %17 = xor i32 %6, 1
  %18 = add nsw i32 %17, %12
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [5 x i8], ptr @.str.1, i64 0, i64 %19
  %21 = load i8, ptr %20, align 1, !tbaa !5
  %22 = and i32 %2, 2
  %.not = icmp eq i32 %22, 0
  %23 = sext i8 %11 to i64
  br i1 %.not, label %57, label %24

24:                                               ; preds = %3
  %25 = sext i8 %16 to i64
  %26 = getelementptr inbounds [4 x double], ptr %1, i64 %23, i64 %25
  %27 = load double, ptr %26, align 8, !tbaa !8
  %28 = sext i8 %21 to i64
  %29 = getelementptr inbounds [4 x double], ptr %1, i64 %23, i64 %28
  %30 = load double, ptr %29, align 8, !tbaa !8
  %31 = fmul double %30, %30
  %32 = tail call double @llvm.fmuladd.f64(double %27, double %27, double %31)
  %sqrt = tail call double @llvm.sqrt.f64(double %32)
  %33 = fcmp ogt double %sqrt, 0x3EC0000000000000
  br i1 %33, label %34, label %46

34:                                               ; preds = %24
  %35 = tail call double @atan2(double noundef %27, double noundef %30) #4
  store double %35, ptr %0, align 8, !tbaa !10
  %36 = getelementptr inbounds [4 x double], ptr %1, i64 %23, i64 %23
  %37 = load double, ptr %36, align 8, !tbaa !8
  %38 = tail call double @atan2(double noundef %sqrt, double noundef %37) #4
  %39 = getelementptr inbounds i8, ptr %0, i64 8
  store double %38, ptr %39, align 8, !tbaa !13
  %40 = getelementptr inbounds [4 x double], ptr %1, i64 %25, i64 %23
  %41 = load double, ptr %40, align 8, !tbaa !8
  %42 = getelementptr inbounds [4 x double], ptr %1, i64 %28, i64 %23
  %43 = load double, ptr %42, align 8, !tbaa !8
  %44 = fneg double %43
  %45 = tail call double @atan2(double noundef %41, double noundef %44) #4
  br label %93

46:                                               ; preds = %24
  %47 = getelementptr inbounds [4 x double], ptr %1, i64 %25, i64 %28
  %48 = load double, ptr %47, align 8, !tbaa !8
  %49 = fneg double %48
  %50 = getelementptr inbounds [4 x double], ptr %1, i64 %25, i64 %25
  %51 = load double, ptr %50, align 8, !tbaa !8
  %52 = tail call double @atan2(double noundef %49, double noundef %51) #4
  store double %52, ptr %0, align 8, !tbaa !10
  %53 = getelementptr inbounds [4 x double], ptr %1, i64 %23, i64 %23
  %54 = load double, ptr %53, align 8, !tbaa !8
  %55 = tail call double @atan2(double noundef %sqrt, double noundef %54) #4
  %56 = getelementptr inbounds i8, ptr %0, i64 8
  store double %55, ptr %56, align 8, !tbaa !13
  br label %93

57:                                               ; preds = %3
  %58 = getelementptr inbounds [4 x double], ptr %1, i64 %23, i64 %23
  %59 = load double, ptr %58, align 8, !tbaa !8
  %60 = sext i8 %16 to i64
  %61 = getelementptr inbounds [4 x double], ptr %1, i64 %60, i64 %23
  %62 = load double, ptr %61, align 8, !tbaa !8
  %63 = fmul double %62, %62
  %64 = tail call double @llvm.fmuladd.f64(double %59, double %59, double %63)
  %sqrt102 = tail call double @llvm.sqrt.f64(double %64)
  %65 = fcmp ogt double %sqrt102, 0x3EC0000000000000
  %66 = sext i8 %21 to i64
  br i1 %65, label %67, label %81

67:                                               ; preds = %57
  %68 = getelementptr inbounds [4 x double], ptr %1, i64 %66, i64 %60
  %69 = load double, ptr %68, align 8, !tbaa !8
  %70 = getelementptr inbounds [4 x double], ptr %1, i64 %66, i64 %66
  %71 = load double, ptr %70, align 8, !tbaa !8
  %72 = tail call double @atan2(double noundef %69, double noundef %71) #4
  store double %72, ptr %0, align 8, !tbaa !10
  %73 = getelementptr inbounds [4 x double], ptr %1, i64 %66, i64 %23
  %74 = load double, ptr %73, align 8, !tbaa !8
  %75 = fneg double %74
  %76 = tail call double @atan2(double noundef %75, double noundef %sqrt102) #4
  %77 = getelementptr inbounds i8, ptr %0, i64 8
  store double %76, ptr %77, align 8, !tbaa !13
  %78 = load double, ptr %61, align 8, !tbaa !8
  %79 = load double, ptr %58, align 8, !tbaa !8
  %80 = tail call double @atan2(double noundef %78, double noundef %79) #4
  br label %93

81:                                               ; preds = %57
  %82 = getelementptr inbounds [4 x double], ptr %1, i64 %60, i64 %66
  %83 = load double, ptr %82, align 8, !tbaa !8
  %84 = fneg double %83
  %85 = getelementptr inbounds [4 x double], ptr %1, i64 %60, i64 %60
  %86 = load double, ptr %85, align 8, !tbaa !8
  %87 = tail call double @atan2(double noundef %84, double noundef %86) #4
  store double %87, ptr %0, align 8, !tbaa !10
  %88 = getelementptr inbounds [4 x double], ptr %1, i64 %66, i64 %23
  %89 = load double, ptr %88, align 8, !tbaa !8
  %90 = fneg double %89
  %91 = tail call double @atan2(double noundef %90, double noundef %sqrt102) #4
  %92 = getelementptr inbounds i8, ptr %0, i64 8
  store double %91, ptr %92, align 8, !tbaa !13
  br label %93

93:                                               ; preds = %67, %81, %34, %46
  %.sink = phi double [ %80, %67 ], [ 0.000000e+00, %81 ], [ %45, %34 ], [ 0.000000e+00, %46 ]
  %94 = phi double [ %76, %67 ], [ %91, %81 ], [ %38, %34 ], [ %55, %46 ]
  %95 = phi double [ %72, %67 ], [ %87, %81 ], [ %35, %34 ], [ %52, %46 ]
  %96 = getelementptr inbounds i8, ptr %0, i64 16
  store double %.sink, ptr %96, align 8, !tbaa !14
  %.not100 = icmp eq i32 %6, 0
  br i1 %.not100, label %103, label %97

97:                                               ; preds = %93
  %98 = fneg double %95
  store double %98, ptr %0, align 8, !tbaa !10
  %99 = getelementptr inbounds i8, ptr %0, i64 8
  %100 = fneg double %94
  store double %100, ptr %99, align 8, !tbaa !13
  %101 = getelementptr inbounds i8, ptr %0, i64 16
  %102 = fneg double %.sink
  store double %102, ptr %101, align 8, !tbaa !14
  br label %103

103:                                              ; preds = %97, %93
  %104 = phi double [ %102, %97 ], [ %.sink, %93 ]
  %105 = phi double [ %98, %97 ], [ %95, %93 ]
  %.not101 = icmp eq i32 %4, 0
  br i1 %.not101, label %108, label %106

106:                                              ; preds = %103
  %107 = getelementptr inbounds i8, ptr %0, i64 16
  store double %104, ptr %0, align 8, !tbaa !10
  store double %105, ptr %107, align 8, !tbaa !14
  br label %108

108:                                              ; preds = %106, %103
  %109 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %2, ptr %109, align 8, !tbaa !15
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @atan2(double noundef, double noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"double", !6, i64 0}
!10 = !{!11, !9, i64 0}
!11 = !{!"", !9, i64 0, !9, i64 8, !9, i64 16, !12, i64 24}
!12 = !{!"int", !6, i64 0}
!13 = !{!11, !9, i64 8}
!14 = !{!11, !9, i64 16}
!15 = !{!11, !12, i64 24}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass