; LLVM IR from HandmadeMath/HandmadeMath :: test/hmm_test.ll (Z33_hmt_test_QuaternionOps_NormalizeP21hmt_testresult_struct)

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

%union.HMM_Quat = type { <4 x float> }
%struct.hmt_testresult_struct = type { i32, i32 }
%struct.anon.18 = type { %union.anon.19, float }
%union.anon.19 = type { %union.HMM_Vec3 }
%union.HMM_Vec3 = type { %struct.anon.3 }
%struct.anon.3 = type { float, float, float }
%struct.anon.20 = type { float, float, float }

@.str.15 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [20 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: inlinehint mustprogress uwtable
declare hidden { double, double } @_ZL5HMM_Qffff(float noundef, float noundef, float noundef, float noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z33_hmt_test_QuaternionOps_NormalizeP21hmt_testresult_struct(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca %union.HMM_Quat, align 16
  %4 = alloca %union.HMM_Quat, align 16
  %5 = alloca %union.HMM_Quat, align 16
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca %union.HMM_Quat, align 16
  %15 = alloca %union.HMM_Quat, align 16
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #6
  %24 = call { double, double } @_ZL5HMM_Qffff(float noundef 1.000000e+00, float noundef 2.000000e+00, float noundef 3.000000e+00, float noundef 4.000000e+00)
  %25 = getelementptr inbounds %union.HMM_Quat, ptr %3, i32 0, i32 0
  %26 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 0
  %27 = extractvalue { double, double } %24, 0
  store double %27, ptr %26, align 16
  %28 = getelementptr inbounds { double, double }, ptr %25, i32 0, i32 1
  %29 = extractvalue { double, double } %24, 1
  store double %29, ptr %28, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 %3, i64 16, i1 false), !tbaa.struct !9
  %30 = getelementptr inbounds { double, double }, ptr %5, i32 0, i32 0
  %31 = load double, ptr %30, align 16
  %32 = getelementptr inbounds { double, double }, ptr %5, i32 0, i32 1
  %33 = load double, ptr %32, align 8
  %34 = call { double, double } @_ZL9HMM_NormQ8HMM_Quat(double %31, double %33)
  %35 = getelementptr inbounds %union.HMM_Quat, ptr %4, i32 0, i32 0
  %36 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 0
  %37 = extractvalue { double, double } %34, 0
  store double %37, ptr %36, align 16
  %38 = getelementptr inbounds { double, double }, ptr %35, i32 0, i32 1
  %39 = extractvalue { double, double } %34, 1
  store double %39, ptr %38, align 8
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %41, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %44 = getelementptr inbounds %struct.anon.18, ptr %4, i32 0, i32 0
  %45 = getelementptr inbounds %struct.anon.20, ptr %44, i32 0, i32 0
  %46 = load float, ptr %45, align 16, !tbaa !10
  store float %46, ptr %6, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %47 = load float, ptr %6, align 4, !tbaa !14
  %48 = fsub float %47, 0x3FC75E9740000000
  store float %48, ptr %7, align 4, !tbaa !14
  %49 = load float, ptr %7, align 4, !tbaa !14
  %50 = fcmp olt float %49, 0xBF50624DE0000000
  br i1 %50, label %54, label %51

51:                                               ; preds = %1
  %52 = load float, ptr %7, align 4, !tbaa !14
  %53 = fcmp olt float 0x3F50624DE0000000, %52
  br i1 %53, label %54, label %63

54:                                               ; preds = %51, %1
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !16
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %56, align 4, !tbaa !16
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef 39)
  %60 = load float, ptr %6, align 4, !tbaa !14
  %61 = fpext float %60 to double
  %62 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef 0x3FC75E9740000000, double noundef %61)
  br label %63

63:                                               ; preds = %54, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 4, !tbaa !11
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %65, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %68 = getelementptr inbounds %struct.anon.18, ptr %4, i32 0, i32 0
  %69 = getelementptr inbounds %struct.anon.20, ptr %68, i32 0, i32 1
  %70 = load float, ptr %69, align 4, !tbaa !10
  store float %70, ptr %8, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %71 = load float, ptr %8, align 4, !tbaa !14
  %72 = fsub float %71, 0x3FD75E9740000000
  store float %72, ptr %9, align 4, !tbaa !14
  %73 = load float, ptr %9, align 4, !tbaa !14
  %74 = fcmp olt float %73, 0xBF50624DE0000000
  br i1 %74, label %78, label %75

75:                                               ; preds = %63
  %76 = load float, ptr %9, align 4, !tbaa !14
  %77 = fcmp olt float 0x3F50624DE0000000, %76
  br i1 %77, label %78, label %87

78:                                               ; preds = %75, %63
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %79, i32 0, i32 1
  %81 = load i32, ptr %80, align 4, !tbaa !16
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %80, align 4, !tbaa !16
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef 40)
  %84 = load float, ptr %8, align 4, !tbaa !14
  %85 = fpext float %84 to double
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef 0x3FD75E9740000000, double noundef %85)
  br label %87

87:                                               ; preds = %78, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !11
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %89, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %92 = getelementptr inbounds %struct.anon.18, ptr %4, i32 0, i32 0
  %93 = getelementptr inbounds %struct.anon.20, ptr %92, i32 0, i32 2
  %94 = load float, ptr %93, align 8, !tbaa !10
  store float %94, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %95 = load float, ptr %10, align 4, !tbaa !14
  %96 = fsub float %95, 0x3FE186F180000000
  store float %96, ptr %11, align 4, !tbaa !14
  %97 = load float, ptr %11, align 4, !tbaa !14
  %98 = fcmp olt float %97, 0xBF50624DE0000000
  br i1 %98, label %102, label %99

99:                                               ; preds = %87
  %100 = load float, ptr %11, align 4, !tbaa !14
  %101 = fcmp olt float 0x3F50624DE0000000, %100
  br i1 %101, label %102, label %111

102:                                              ; preds = %99, %87
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %103, i32 0, i32 1
  %105 = load i32, ptr %104, align 4, !tbaa !16
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %104, align 4, !tbaa !16
  %107 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef 41)
  %108 = load float, ptr %10, align 4, !tbaa !14
  %109 = fpext float %108 to double
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef 0x3FE186F180000000, double noundef %109)
  br label %111

111:                                              ; preds = %102, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %112, i32 0, i32 0
  %114 = load i32, ptr %113, align 4, !tbaa !11
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %113, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %116 = getelementptr inbounds %struct.anon.18, ptr %4, i32 0, i32 1
  %117 = load float, ptr %116, align 4, !tbaa !10
  store float %117, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %118 = load float, ptr %12, align 4, !tbaa !14
  %119 = fsub float %118, 0x3FE75E9740000000
  store float %119, ptr %13, align 4, !tbaa !14
  %120 = load float, ptr %13, align 4, !tbaa !14
  %121 = fcmp olt float %120, 0xBF50624DE0000000
  br i1 %121, label %125, label %122

122:                                              ; preds = %111
  %123 = load float, ptr %13, align 4, !tbaa !14
  %124 = fcmp olt float 0x3F50624DE0000000, %123
  br i1 %124, label %125, label %134

125:                                              ; preds = %122, %111
  %126 = load ptr, ptr %2, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !16
  %129 = add nsw i32 %128, 1
  store i32 %129, ptr %127, align 4, !tbaa !16
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef 42)
  %131 = load float, ptr %12, align 4, !tbaa !14
  %132 = fpext float %131 to double
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef 0x3FE75E9740000000, double noundef %132)
  br label %134

134:                                              ; preds = %125, %122
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %15, ptr align 16 %3, i64 16, i1 false), !tbaa.struct !9
  %135 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 0
  %136 = load double, ptr %135, align 16
  %137 = getelementptr inbounds { double, double }, ptr %15, i32 0, i32 1
  %138 = load double, ptr %137, align 8
  %139 = call { double, double } @_ZL8HMM_Norm8HMM_Quat(double %136, double %138)
  %140 = getelementptr inbounds %union.HMM_Quat, ptr %14, i32 0, i32 0
  %141 = getelementptr inbounds { double, double }, ptr %140, i32 0, i32 0
  %142 = extractvalue { double, double } %139, 0
  store double %142, ptr %141, align 16
  %143 = getelementptr inbounds { double, double }, ptr %140, i32 0, i32 1
  %144 = extractvalue { double, double } %139, 1
  store double %144, ptr %143, align 8
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %145, i32 0, i32 0
  %147 = load i32, ptr %146, align 4, !tbaa !11
  %148 = add nsw i32 %147, 1
  store i32 %148, ptr %146, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %149 = getelementptr inbounds %struct.anon.18, ptr %14, i32 0, i32 0
  %150 = getelementptr inbounds %struct.anon.20, ptr %149, i32 0, i32 0
  %151 = load float, ptr %150, align 16, !tbaa !10
  store float %151, ptr %16, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %152 = load float, ptr %16, align 4, !tbaa !14
  %153 = fsub float %152, 0x3FC75E9740000000
  store float %153, ptr %17, align 4, !tbaa !14
  %154 = load float, ptr %17, align 4, !tbaa !14
  %155 = fcmp olt float %154, 0xBF50624DE0000000
  br i1 %155, label %159, label %156

156:                                              ; preds = %134
  %157 = load float, ptr %17, align 4, !tbaa !14
  %158 = fcmp olt float 0x3F50624DE0000000, %157
  br i1 %158, label %159, label %168

159:                                              ; preds = %156, %134
  %160 = load ptr, ptr %2, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !16
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %161, align 4, !tbaa !16
  %164 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef 47)
  %165 = load float, ptr %16, align 4, !tbaa !14
  %166 = fpext float %165 to double
  %167 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef 0x3FC75E9740000000, double noundef %166)
  br label %168

168:                                              ; preds = %159, %156
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %169, i32 0, i32 0
  %171 = load i32, ptr %170, align 4, !tbaa !11
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %170, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %173 = getelementptr inbounds %struct.anon.18, ptr %14, i32 0, i32 0
  %174 = getelementptr inbounds %struct.anon.20, ptr %173, i32 0, i32 1
  %175 = load float, ptr %174, align 4, !tbaa !10
  store float %175, ptr %18, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %176 = load float, ptr %18, align 4, !tbaa !14
  %177 = fsub float %176, 0x3FD75E9740000000
  store float %177, ptr %19, align 4, !tbaa !14
  %178 = load float, ptr %19, align 4, !tbaa !14
  %179 = fcmp olt float %178, 0xBF50624DE0000000
  br i1 %179, label %183, label %180

180:                                              ; preds = %168
  %181 = load float, ptr %19, align 4, !tbaa !14
  %182 = fcmp olt float 0x3F50624DE0000000, %181
  br i1 %182, label %183, label %192

183:                                              ; preds = %180, %168
  %184 = load ptr, ptr %2, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %184, i32 0, i32 1
  %186 = load i32, ptr %185, align 4, !tbaa !16
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %185, align 4, !tbaa !16
  %188 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef 48)
  %189 = load float, ptr %18, align 4, !tbaa !14
  %190 = fpext float %189 to double
  %191 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef 0x3FD75E9740000000, double noundef %190)
  br label %192

192:                                              ; preds = %183, %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  %193 = load ptr, ptr %2, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %193, i32 0, i32 0
  %195 = load i32, ptr %194, align 4, !tbaa !11
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %194, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %197 = getelementptr inbounds %struct.anon.18, ptr %14, i32 0, i32 0
  %198 = getelementptr inbounds %struct.anon.20, ptr %197, i32 0, i32 2
  %199 = load float, ptr %198, align 8, !tbaa !10
  store float %199, ptr %20, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %200 = load float, ptr %20, align 4, !tbaa !14
  %201 = fsub float %200, 0x3FE186F180000000
  store float %201, ptr %21, align 4, !tbaa !14
  %202 = load float, ptr %21, align 4, !tbaa !14
  %203 = fcmp olt float %202, 0xBF50624DE0000000
  br i1 %203, label %207, label %204

204:                                              ; preds = %192
  %205 = load float, ptr %21, align 4, !tbaa !14
  %206 = fcmp olt float 0x3F50624DE0000000, %205
  br i1 %206, label %207, label %216

207:                                              ; preds = %204, %192
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %208, i32 0, i32 1
  %210 = load i32, ptr %209, align 4, !tbaa !16
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %209, align 4, !tbaa !16
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef 49)
  %213 = load float, ptr %20, align 4, !tbaa !14
  %214 = fpext float %213 to double
  %215 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef 0x3FE186F180000000, double noundef %214)
  br label %216

216:                                              ; preds = %207, %204
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  %217 = load ptr, ptr %2, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %217, i32 0, i32 0
  %219 = load i32, ptr %218, align 4, !tbaa !11
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %218, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %221 = getelementptr inbounds %struct.anon.18, ptr %14, i32 0, i32 1
  %222 = load float, ptr %221, align 4, !tbaa !10
  store float %222, ptr %22, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %223 = load float, ptr %22, align 4, !tbaa !14
  %224 = fsub float %223, 0x3FE75E9740000000
  store float %224, ptr %23, align 4, !tbaa !14
  %225 = load float, ptr %23, align 4, !tbaa !14
  %226 = fcmp olt float %225, 0xBF50624DE0000000
  br i1 %226, label %230, label %227

227:                                              ; preds = %216
  %228 = load float, ptr %23, align 4, !tbaa !14
  %229 = fcmp olt float 0x3F50624DE0000000, %228
  br i1 %229, label %230, label %239

230:                                              ; preds = %227, %216
  %231 = load ptr, ptr %2, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.hmt_testresult_struct, ptr %231, i32 0, i32 1
  %233 = load i32, ptr %232, align 4, !tbaa !16
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %232, align 4, !tbaa !16
  %235 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef 50)
  %236 = load float, ptr %22, align 4, !tbaa !14
  %237 = fpext float %236 to double
  %238 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef 0x3FE75E9740000000, double noundef %237)
  br label %239

239:                                              ; preds = %230, %227
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #6
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden { double, double } @_ZL9HMM_NormQ8HMM_Quat(double, double) #5

; Function Attrs: inlinehint mustprogress uwtable
declare hidden { double, double } @_ZL8HMM_Norm8HMM_Quat(double, double) #5

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

!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++ TBAA"}
!9 = !{i64 0, i64 16, !10}
!10 = !{!7, !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTS21hmt_testresult_struct", !13, i64 0, !13, i64 4}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!12, !13, i64 4}


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

@.str.15 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [20 x i8], align 1

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden { double, double } @_ZL5HMM_Qffff(float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z33_hmt_test_QuaternionOps_NormalizeP21hmt_testresult_struct(ptr nocapture noundef %0) local_unnamed_addr #2 {
  %2 = tail call { double, double } @_ZL5HMM_Qffff(float noundef 1.000000e+00, float noundef 2.000000e+00, float noundef 3.000000e+00, float noundef 4.000000e+00)
  %3 = extractvalue { double, double } %2, 0
  %4 = extractvalue { double, double } %2, 1
  %5 = tail call { double, double } @_ZL9HMM_NormQ8HMM_Quat(double %3, double %4)
  %6 = extractvalue { double, double } %5, 0
  %7 = extractvalue { double, double } %5, 1
  %8 = load i32, ptr %0, align 4, !tbaa !5
  %9 = add nsw i32 %8, 1
  store i32 %9, ptr %0, align 4, !tbaa !5
  %10 = bitcast double %6 to i64
  %11 = trunc i64 %10 to i32
  %12 = bitcast i32 %11 to float
  %13 = fadd float %12, 0xBFC75E9740000000
  %14 = tail call float @llvm.fabs.f32(float %13)
  %or.cond = fcmp ogt float %14, 0x3F50624DE0000000
  %15 = lshr i64 %10, 32
  %16 = trunc nuw i64 %15 to i32
  %17 = bitcast i32 %16 to float
  %18 = bitcast double %7 to i64
  %19 = trunc i64 %18 to i32
  %20 = bitcast i32 %19 to float
  %21 = lshr i64 %18, 32
  %22 = trunc nuw i64 %21 to i32
  %23 = bitcast i32 %22 to float
  br i1 %or.cond, label %24, label %31

24:                                               ; preds = %1
  %25 = getelementptr inbounds i8, ptr %0, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !10
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %25, align 4, !tbaa !10
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 39)
  %29 = fpext float %12 to double
  %30 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef 0x3FC75E9740000000, double noundef %29)
  %.pre = load i32, ptr %0, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %1, %24
  %32 = phi i32 [ %9, %1 ], [ %.pre, %24 ]
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %0, align 4, !tbaa !5
  %34 = fadd float %17, 0xBFD75E9740000000
  %35 = tail call float @llvm.fabs.f32(float %34)
  %or.cond3 = fcmp ogt float %35, 0x3F50624DE0000000
  br i1 %or.cond3, label %36, label %43

36:                                               ; preds = %31
  %37 = getelementptr inbounds i8, ptr %0, i64 4
  %38 = load i32, ptr %37, align 4, !tbaa !10
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %37, align 4, !tbaa !10
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 40)
  %41 = fpext float %17 to double
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef 0x3FD75E9740000000, double noundef %41)
  %.pre76 = load i32, ptr %0, align 4, !tbaa !5
  br label %43

43:                                               ; preds = %31, %36
  %44 = phi i32 [ %33, %31 ], [ %.pre76, %36 ]
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %0, align 4, !tbaa !5
  %46 = fadd float %20, 0xBFE186F180000000
  %47 = tail call float @llvm.fabs.f32(float %46)
  %or.cond5 = fcmp ogt float %47, 0x3F50624DE0000000
  br i1 %or.cond5, label %48, label %55

48:                                               ; preds = %43
  %49 = getelementptr inbounds i8, ptr %0, i64 4
  %50 = load i32, ptr %49, align 4, !tbaa !10
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %49, align 4, !tbaa !10
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 41)
  %53 = fpext float %20 to double
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef 0x3FE186F180000000, double noundef %53)
  %.pre77 = load i32, ptr %0, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %43, %48
  %56 = phi i32 [ %45, %43 ], [ %.pre77, %48 ]
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %0, align 4, !tbaa !5
  %58 = fadd float %23, 0xBFE75E9740000000
  %59 = tail call float @llvm.fabs.f32(float %58)
  %or.cond7 = fcmp ogt float %59, 0x3F50624DE0000000
  br i1 %or.cond7, label %60, label %67

60:                                               ; preds = %55
  %61 = getelementptr inbounds i8, ptr %0, i64 4
  %62 = load i32, ptr %61, align 4, !tbaa !10
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %61, align 4, !tbaa !10
  %64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 42)
  %65 = fpext float %23 to double
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef 0x3FE75E9740000000, double noundef %65)
  br label %67

67:                                               ; preds = %55, %60
  %68 = tail call { double, double } @_ZL8HMM_Norm8HMM_Quat(double %3, double %4)
  %69 = extractvalue { double, double } %68, 0
  %70 = extractvalue { double, double } %68, 1
  %71 = load i32, ptr %0, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %0, align 4, !tbaa !5
  %73 = bitcast double %69 to i64
  %74 = trunc i64 %73 to i32
  %75 = bitcast i32 %74 to float
  %76 = fadd float %75, 0xBFC75E9740000000
  %77 = tail call float @llvm.fabs.f32(float %76)
  %or.cond9 = fcmp ogt float %77, 0x3F50624DE0000000
  %78 = lshr i64 %73, 32
  %79 = trunc nuw i64 %78 to i32
  %80 = bitcast i32 %79 to float
  %81 = bitcast double %70 to i64
  %82 = trunc i64 %81 to i32
  %83 = bitcast i32 %82 to float
  %84 = lshr i64 %81, 32
  %85 = trunc nuw i64 %84 to i32
  %86 = bitcast i32 %85 to float
  br i1 %or.cond9, label %87, label %94

87:                                               ; preds = %67
  %88 = getelementptr inbounds i8, ptr %0, i64 4
  %89 = load i32, ptr %88, align 4, !tbaa !10
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %88, align 4, !tbaa !10
  %91 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 47)
  %92 = fpext float %75 to double
  %93 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef 0x3FC75E9740000000, double noundef %92)
  %.pre78 = load i32, ptr %0, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %67, %87
  %95 = phi i32 [ %72, %67 ], [ %.pre78, %87 ]
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %0, align 4, !tbaa !5
  %97 = fadd float %80, 0xBFD75E9740000000
  %98 = tail call float @llvm.fabs.f32(float %97)
  %or.cond11 = fcmp ogt float %98, 0x3F50624DE0000000
  br i1 %or.cond11, label %99, label %106

99:                                               ; preds = %94
  %100 = getelementptr inbounds i8, ptr %0, i64 4
  %101 = load i32, ptr %100, align 4, !tbaa !10
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %100, align 4, !tbaa !10
  %103 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 48)
  %104 = fpext float %80 to double
  %105 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef 0x3FD75E9740000000, double noundef %104)
  %.pre79 = load i32, ptr %0, align 4, !tbaa !5
  br label %106

106:                                              ; preds = %94, %99
  %107 = phi i32 [ %96, %94 ], [ %.pre79, %99 ]
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %0, align 4, !tbaa !5
  %109 = fadd float %83, 0xBFE186F180000000
  %110 = tail call float @llvm.fabs.f32(float %109)
  %or.cond13 = fcmp ogt float %110, 0x3F50624DE0000000
  br i1 %or.cond13, label %111, label %118

111:                                              ; preds = %106
  %112 = getelementptr inbounds i8, ptr %0, i64 4
  %113 = load i32, ptr %112, align 4, !tbaa !10
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %112, align 4, !tbaa !10
  %115 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 49)
  %116 = fpext float %83 to double
  %117 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef 0x3FE186F180000000, double noundef %116)
  %.pre80 = load i32, ptr %0, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %106, %111
  %119 = phi i32 [ %108, %106 ], [ %.pre80, %111 ]
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %0, align 4, !tbaa !5
  %121 = fadd float %86, 0xBFE75E9740000000
  %122 = tail call float @llvm.fabs.f32(float %121)
  %or.cond15 = fcmp ogt float %122, 0x3F50624DE0000000
  br i1 %or.cond15, label %123, label %130

123:                                              ; preds = %118
  %124 = getelementptr inbounds i8, ptr %0, i64 4
  %125 = load i32, ptr %124, align 4, !tbaa !10
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %124, align 4, !tbaa !10
  %127 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef 50)
  %128 = fpext float %86 to double
  %129 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef 0x3FE75E9740000000, double noundef %128)
  br label %130

130:                                              ; preds = %118, %123
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden { double, double } @_ZL9HMM_NormQ8HMM_Quat(double, double) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare hidden { double, double } @_ZL8HMM_Norm8HMM_Quat(double, double) local_unnamed_addr #3

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

attributes #0 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { inlinehint mustprogress uwtable "min-legal-vector-width"="128" "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 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 = { inlinehint mustprogress 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) }

!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 = !{!"_ZTS21hmt_testresult_struct", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 4}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass