; LLVM IR from recp/cglm :: test/src (tests)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.895 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.920 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.921 = 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @glm_rotate(ptr noundef, float noundef, ptr noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @glm_translate(ptr noundef, ptr noundef) #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @glm_scale_make(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local { ptr, i32 } @test_glm_uniscaled() #4 {
  %1 = alloca %struct.test_status_t, align 8
  %2 = alloca [4 x [4 x float]], align 16
  %3 = alloca [3 x float], align 4
  %4 = alloca i32, align 4
  %5 = alloca [3 x float], align 4
  %6 = alloca [3 x float], align 4
  %7 = alloca [3 x float], align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr %2) #5
  %8 = getelementptr inbounds [4 x [4 x float]], ptr %2, i64 0, i64 0
  store float 7.000000e+00, ptr %3, align 4, !tbaa !5
  %9 = getelementptr inbounds float, ptr %3, i64 1
  store float 8.000000e+00, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds float, ptr %3, i64 2
  store float 9.000000e+00, ptr %10, align 4, !tbaa !5
  %11 = getelementptr inbounds [3 x float], ptr %3, i64 0, i64 0
  call void @glm_scale_make(ptr noundef %8, ptr noundef %11)
  br label %12

12:                                               ; preds = %0
  %13 = getelementptr inbounds [4 x [4 x float]], ptr %2, i64 0, i64 0
  %14 = call zeroext i1 @glm_uniscaled(ptr noundef %13)
  br i1 %14, label %15, label %20

15:                                               ; preds = %12
  %16 = load ptr, ptr @stderr, align 8, !tbaa !9
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef @.str, ptr noundef @.str.895, i32 noundef 530, ptr noundef @.str.920) #5
  %18 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %18, align 8, !tbaa !11
  %19 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %19, align 8, !tbaa !14
  store i32 1, ptr %4, align 4
  br label %70

20:                                               ; preds = %12
  br label %21

21:                                               ; preds = %20
  br label %22

22:                                               ; preds = %21
  %23 = getelementptr inbounds [4 x [4 x float]], ptr %2, i64 0, i64 0
  store float 7.000000e+00, ptr %5, align 4, !tbaa !5
  %24 = getelementptr inbounds float, ptr %5, i64 1
  store float 7.000000e+00, ptr %24, align 4, !tbaa !5
  %25 = getelementptr inbounds float, ptr %5, i64 2
  store float 7.000000e+00, ptr %25, align 4, !tbaa !5
  %26 = getelementptr inbounds [3 x float], ptr %5, i64 0, i64 0
  call void @glm_scale_make(ptr noundef %23, ptr noundef %26)
  br label %27

27:                                               ; preds = %22
  %28 = getelementptr inbounds [4 x [4 x float]], ptr %2, i64 0, i64 0
  %29 = call zeroext i1 @glm_uniscaled(ptr noundef %28)
  br i1 %29, label %35, label %30

30:                                               ; preds = %27
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str, ptr noundef @.str.895, i32 noundef 533, ptr noundef @.str.921) #5
  %33 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %33, align 8, !tbaa !11
  %34 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %34, align 8, !tbaa !14
  store i32 1, ptr %4, align 4
  br label %70

35:                                               ; preds = %27
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  %38 = getelementptr inbounds [4 x [4 x float]], ptr %2, i64 0, i64 0
  store float 2.300000e+01, ptr %6, align 4, !tbaa !5
  %39 = getelementptr inbounds float, ptr %6, i64 1
  store float 4.500000e+01, ptr %39, align 4, !tbaa !5
  %40 = getelementptr inbounds float, ptr %6, i64 2
  store float 6.600000e+01, ptr %40, align 4, !tbaa !5
  %41 = getelementptr inbounds [3 x float], ptr %6, i64 0, i64 0
  call void @glm_rotate(ptr noundef %38, float noundef 0x3FE921FB60000000, ptr noundef %41)
  br label %42

42:                                               ; preds = %37
  %43 = getelementptr inbounds [4 x [4 x float]], ptr %2, i64 0, i64 0
  %44 = call zeroext i1 @glm_uniscaled(ptr noundef %43)
  br i1 %44, label %50, label %45

45:                                               ; preds = %42
  %46 = load ptr, ptr @stderr, align 8, !tbaa !9
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str, ptr noundef @.str.895, i32 noundef 536, ptr noundef @.str.921) #5
  %48 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %48, align 8, !tbaa !11
  %49 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %49, align 8, !tbaa !14
  store i32 1, ptr %4, align 4
  br label %70

50:                                               ; preds = %42
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = getelementptr inbounds [4 x [4 x float]], ptr %2, i64 0, i64 0
  store float 4.000000e+00, ptr %7, align 4, !tbaa !5
  %54 = getelementptr inbounds float, ptr %7, i64 1
  store float 5.000000e+00, ptr %54, align 4, !tbaa !5
  %55 = getelementptr inbounds float, ptr %7, i64 2
  store float 6.000000e+00, ptr %55, align 4, !tbaa !5
  %56 = getelementptr inbounds [3 x float], ptr %7, i64 0, i64 0
  call void @glm_translate(ptr noundef %53, ptr noundef %56)
  br label %57

57:                                               ; preds = %52
  %58 = getelementptr inbounds [4 x [4 x float]], ptr %2, i64 0, i64 0
  %59 = call zeroext i1 @glm_uniscaled(ptr noundef %58)
  br i1 %59, label %65, label %60

60:                                               ; preds = %57
  %61 = load ptr, ptr @stderr, align 8, !tbaa !9
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str, ptr noundef @.str.895, i32 noundef 539, ptr noundef @.str.921) #5
  %63 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %63, align 8, !tbaa !11
  %64 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %64, align 8, !tbaa !14
  store i32 1, ptr %4, align 4
  br label %70

65:                                               ; preds = %57
  br label %66

66:                                               ; preds = %65
  br label %67

67:                                               ; preds = %66
  %68 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %68, align 8, !tbaa !11
  %69 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 1, ptr %69, align 8, !tbaa !14
  store i32 1, ptr %4, align 4
  br label %70

70:                                               ; preds = %67, %60, %45, %30, %15
  call void @llvm.lifetime.end.p0(i64 64, ptr %2) #5
  %71 = load { ptr, i32 }, ptr %1, align 8
  ret { ptr, i32 } %71
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden zeroext i1 @glm_uniscaled(ptr noundef) #2

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 = { alwaysinline 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 = { alwaysinline nounwind 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 = { 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 #5 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"test_status_t", !10, i64 0, !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 8}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.895 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.920 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.921 = external hidden unnamed_addr constant [20 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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @glm_rotate(ptr noundef, float noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @glm_translate(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @glm_scale_make(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local { ptr, i32 } @test_glm_uniscaled() local_unnamed_addr #4 {
  %1 = alloca [4 x [4 x float]], align 16
  %2 = alloca [3 x float], align 8
  %3 = alloca [3 x float], align 8
  %4 = alloca [3 x float], align 8
  %5 = alloca [3 x float], align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %1) #5
  store <2 x float> <float 7.000000e+00, float 8.000000e+00>, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %2, i64 8
  store float 9.000000e+00, ptr %6, align 8, !tbaa !5
  call void @glm_scale_make(ptr noundef nonnull %1, ptr noundef nonnull %2)
  %7 = call zeroext i1 @glm_uniscaled(ptr noundef nonnull %1)
  br i1 %7, label %8, label %11

8:                                                ; preds = %0
  %9 = load ptr, ptr @stderr, align 8, !tbaa !9
  %10 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str, ptr noundef nonnull @.str.895, i32 noundef 530, ptr noundef nonnull @.str.920) #6
  br label %29

11:                                               ; preds = %0
  store <2 x float> <float 7.000000e+00, float 7.000000e+00>, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  store float 7.000000e+00, ptr %12, align 8, !tbaa !5
  call void @glm_scale_make(ptr noundef nonnull %1, ptr noundef nonnull %3)
  %13 = call zeroext i1 @glm_uniscaled(ptr noundef nonnull %1)
  br i1 %13, label %17, label %14

14:                                               ; preds = %11
  %15 = load ptr, ptr @stderr, align 8, !tbaa !9
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str, ptr noundef nonnull @.str.895, i32 noundef 533, ptr noundef nonnull @.str.921) #6
  br label %29

17:                                               ; preds = %11
  store <2 x float> <float 2.300000e+01, float 4.500000e+01>, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  store float 6.600000e+01, ptr %18, align 8, !tbaa !5
  call void @glm_rotate(ptr noundef nonnull %1, float noundef 0x3FE921FB60000000, ptr noundef nonnull %4)
  %19 = call zeroext i1 @glm_uniscaled(ptr noundef nonnull %1)
  br i1 %19, label %23, label %20

20:                                               ; preds = %17
  %21 = load ptr, ptr @stderr, align 8, !tbaa !9
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str, ptr noundef nonnull @.str.895, i32 noundef 536, ptr noundef nonnull @.str.921) #6
  br label %29

23:                                               ; preds = %17
  store <2 x float> <float 4.000000e+00, float 5.000000e+00>, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %5, i64 8
  store float 6.000000e+00, ptr %24, align 8, !tbaa !5
  call void @glm_translate(ptr noundef nonnull %1, ptr noundef nonnull %5)
  %25 = call zeroext i1 @glm_uniscaled(ptr noundef nonnull %1)
  br i1 %25, label %29, label %26

26:                                               ; preds = %23
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef nonnull @.str, ptr noundef nonnull @.str.895, i32 noundef 539, ptr noundef nonnull @.str.921) #6
  br label %29

29:                                               ; preds = %23, %26, %20, %14, %8
  %.sroa.6.0 = phi i32 [ 0, %8 ], [ 0, %26 ], [ 0, %20 ], [ 0, %14 ], [ 1, %23 ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %1) #5
  %.fca.1.insert = insertvalue { ptr, i32 } { ptr null, i32 poison }, i32 %.sroa.6.0, 1
  ret { ptr, i32 } %.fca.1.insert
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden zeroext i1 @glm_uniscaled(ptr noundef) local_unnamed_addr #2

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 = { alwaysinline 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 = { alwaysinline nounwind 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 = { 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 #5 = { nounwind }
attributes #6 = { cold 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}


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