; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/code/PostProcessing (PretransformVertices)

; 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.aiNode = type { %struct.aiString, %class.aiMatrix4x4t, ptr, i32, ptr, i32, ptr, ptr }
%struct.aiString = type { i32, [1024 x i8] }
%class.aiMatrix4x4t = type { float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float }
%struct.aiScene = type { i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, ptr, %struct.aiString, i32, ptr, ptr }
%struct.aiMesh = type { i32, i32, i32, ptr, ptr, ptr, ptr, [8 x ptr], [8 x ptr], [8 x i32], ptr, i32, ptr, i32, %struct.aiString, i32, ptr, i32, %struct.aiAABB, ptr }
%struct.aiAABB = type { %class.aiVector3t, %class.aiVector3t }
%class.aiVector3t = type { float, float, float }

; 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: mustprogress uwtable
define dso_local void @_ZNK6Assimp20PretransformVertices21CountVerticesAndFacesEPK7aiScenePK6aiNodejjPjS7_(ptr noundef nonnull align 8 dereferenceable(93) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6) #1 align 2 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  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 i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  %18 = load ptr, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %64, %7
  %20 = load i32, ptr %15, align 4, !tbaa !9
  %21 = load ptr, ptr %10, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.aiNode, ptr %21, i32 0, i32 5
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = icmp ult i32 %20, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  br label %67

26:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.aiScene, ptr %27, i32 0, i32 3
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.aiNode, ptr %30, i32 0, i32 6
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %33 = load i32, ptr %15, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr %32, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds ptr, ptr %29, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  store ptr %39, ptr %16, align 8, !tbaa !5
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = load ptr, ptr %16, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.aiMesh, ptr %41, i32 0, i32 13
  %43 = load i32, ptr %42, align 8, !tbaa !19
  %44 = icmp eq i32 %40, %43
  br i1 %44, label %45, label %63

45:                                               ; preds = %26
  %46 = load i32, ptr %12, align 4, !tbaa !9
  %47 = load ptr, ptr %16, align 8, !tbaa !5
  %48 = call noundef i32 @_ZN12_GLOBAL__N_114GetMeshVFormatEP6aiMesh(ptr noundef %47)
  %49 = icmp eq i32 %46, %48
  br i1 %49, label %50, label %63

50:                                               ; preds = %45
  %51 = load ptr, ptr %16, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.aiMesh, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !24
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = add i32 %55, %53
  store i32 %56, ptr %54, align 4, !tbaa !9
  %57 = load ptr, ptr %16, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.aiMesh, ptr %57, i32 0, i32 2
  %59 = load i32, ptr %58, align 8, !tbaa !25
  %60 = load ptr, ptr %13, align 8, !tbaa !5
  %61 = load i32, ptr %60, align 4, !tbaa !9
  %62 = add i32 %61, %59
  store i32 %62, ptr %60, align 4, !tbaa !9
  br label %63

63:                                               ; preds = %50, %45, %26
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = add i32 %65, 1
  store i32 %66, ptr %15, align 4, !tbaa !9
  br label %19, !llvm.loop !26

67:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #2
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %88, %67
  %69 = load i32, ptr %17, align 4, !tbaa !9
  %70 = load ptr, ptr %10, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.aiNode, ptr %70, i32 0, i32 3
  %72 = load i32, ptr %71, align 8, !tbaa !28
  %73 = icmp ult i32 %69, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #2
  br label %91

75:                                               ; preds = %68
  %76 = load ptr, ptr %9, align 8, !tbaa !5
  %77 = load ptr, ptr %10, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.aiNode, ptr %77, i32 0, i32 4
  %79 = load ptr, ptr %78, align 8, !tbaa !29
  %80 = load i32, ptr %17, align 4, !tbaa !9
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds ptr, ptr %79, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = load i32, ptr %12, align 4, !tbaa !9
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZNK6Assimp20PretransformVertices21CountVerticesAndFacesEPK7aiScenePK6aiNodejjPjS7_(ptr noundef nonnull align 8 dereferenceable(93) %18, ptr noundef %76, ptr noundef %83, i32 noundef %84, i32 noundef %85, ptr noundef %86, ptr noundef %87)
  br label %88

88:                                               ; preds = %75
  %89 = load i32, ptr %17, align 4, !tbaa !9
  %90 = add i32 %89, 1
  store i32 %90, ptr %17, align 4, !tbaa !9
  br label %68, !llvm.loop !30

91:                                               ; preds = %74
  ret void
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_114GetMeshVFormatEP6aiMesh(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 1120}
!12 = !{!"_ZTS6aiNode", !13, i64 0, !14, i64 1028, !6, i64 1096, !10, i64 1104, !6, i64 1112, !10, i64 1120, !6, i64 1128, !6, i64 1136}
!13 = !{!"_ZTS8aiString", !10, i64 0, !7, i64 4}
!14 = !{!"_ZTS12aiMatrix4x4tIfE", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !15, i64 48, !15, i64 52, !15, i64 56, !15, i64 60}
!15 = !{!"float", !7, i64 0}
!16 = !{!17, !6, i64 24}
!17 = !{!"_ZTS7aiScene", !10, i64 0, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32, !6, i64 40, !10, i64 48, !6, i64 56, !10, i64 64, !6, i64 72, !10, i64 80, !6, i64 88, !10, i64 96, !6, i64 104, !6, i64 112, !13, i64 120, !10, i64 1148, !6, i64 1152, !6, i64 1160}
!18 = !{!12, !6, i64 1128}
!19 = !{!20, !10, i64 232}
!20 = !{!"_ZTS6aiMesh", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !7, i64 48, !7, i64 112, !7, i64 176, !6, i64 208, !10, i64 216, !6, i64 224, !10, i64 232, !13, i64 236, !10, i64 1264, !6, i64 1272, !21, i64 1280, !22, i64 1284, !6, i64 1312}
!21 = !{!"_ZTS16aiMorphingMethod", !7, i64 0}
!22 = !{!"_ZTS6aiAABB", !23, i64 0, !23, i64 12}
!23 = !{!"_ZTS10aiVector3tIfE", !15, i64 0, !15, i64 4, !15, i64 8}
!24 = !{!20, !10, i64 4}
!25 = !{!20, !10, i64 8}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!12, !10, i64 1104}
!29 = !{!12, !6, i64 1112}
!30 = distinct !{!30, !27}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK6Assimp20PretransformVertices21CountVerticesAndFacesEPK7aiScenePK6aiNodejjPjS7_(ptr nocapture noundef nonnull readnone align 8 dereferenceable(93) %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3, i32 noundef %4, ptr nocapture noundef %5, ptr nocapture noundef %6) local_unnamed_addr #0 align 2 {
  %8 = getelementptr inbounds i8, ptr %2, i64 1120
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %10 = getelementptr inbounds i8, ptr %1, i64 24
  %11 = getelementptr inbounds i8, ptr %2, i64 1128
  br label %15

.preheader:                                       ; preds = %38, %7
  %12 = getelementptr inbounds i8, ptr %2, i64 1104
  %13 = load i32, ptr %12, align 8, !tbaa !14
  %.not28 = icmp eq i32 %13, 0
  br i1 %.not28, label %._crit_edge, label %.lr.ph27

.lr.ph27:                                         ; preds = %.preheader
  %14 = getelementptr inbounds i8, ptr %2, i64 1112
  br label %42

15:                                               ; preds = %.lr.ph, %38
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %38 ]
  %16 = load ptr, ptr %10, align 8, !tbaa !15
  %17 = load ptr, ptr %11, align 8, !tbaa !17
  %18 = getelementptr inbounds i32, ptr %17, i64 %indvars.iv
  %19 = load i32, ptr %18, align 4, !tbaa !18
  %20 = zext i32 %19 to i64
  %21 = getelementptr inbounds ptr, ptr %16, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !19
  %23 = getelementptr inbounds i8, ptr %22, i64 232
  %24 = load i32, ptr %23, align 8, !tbaa !20
  %25 = icmp eq i32 %24, %3
  br i1 %25, label %26, label %38

26:                                               ; preds = %15
  %27 = tail call noundef i32 @_ZN12_GLOBAL__N_114GetMeshVFormatEP6aiMesh(ptr noundef nonnull %22)
  %28 = icmp eq i32 %27, %4
  br i1 %28, label %29, label %38

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %22, i64 4
  %31 = load i32, ptr %30, align 4, !tbaa !25
  %32 = load i32, ptr %6, align 4, !tbaa !18
  %33 = add i32 %32, %31
  store i32 %33, ptr %6, align 4, !tbaa !18
  %34 = getelementptr inbounds i8, ptr %22, i64 8
  %35 = load i32, ptr %34, align 8, !tbaa !26
  %36 = load i32, ptr %5, align 4, !tbaa !18
  %37 = add i32 %36, %35
  store i32 %37, ptr %5, align 4, !tbaa !18
  br label %38

38:                                               ; preds = %29, %26, %15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = load i32, ptr %8, align 8, !tbaa !5
  %40 = zext i32 %39 to i64
  %41 = icmp ult i64 %indvars.iv.next, %40
  br i1 %41, label %15, label %.preheader, !llvm.loop !27

._crit_edge:                                      ; preds = %42, %.preheader
  ret void

42:                                               ; preds = %.lr.ph27, %42
  %indvars.iv30 = phi i64 [ 0, %.lr.ph27 ], [ %indvars.iv.next31, %42 ]
  %43 = load ptr, ptr %14, align 8, !tbaa !29
  %44 = getelementptr inbounds ptr, ptr %43, i64 %indvars.iv30
  %45 = load ptr, ptr %44, align 8, !tbaa !19
  tail call void @_ZNK6Assimp20PretransformVertices21CountVerticesAndFacesEPK7aiScenePK6aiNodejjPjS7_(ptr noundef nonnull align 8 dereferenceable(93) %0, ptr noundef %1, ptr noundef %45, i32 noundef %3, i32 noundef %4, ptr noundef %5, ptr noundef %6)
  %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
  %46 = load i32, ptr %12, align 8, !tbaa !14
  %47 = zext i32 %46 to i64
  %48 = icmp ult i64 %indvars.iv.next31, %47
  br i1 %48, label %42, label %._crit_edge, !llvm.loop !30
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN12_GLOBAL__N_114GetMeshVFormatEP6aiMesh(ptr noundef) local_unnamed_addr #0

attributes #0 = { 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" }

!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, !8, i64 1120}
!6 = !{!"_ZTS6aiNode", !7, i64 0, !11, i64 1028, !13, i64 1096, !8, i64 1104, !13, i64 1112, !8, i64 1120, !13, i64 1128, !13, i64 1136}
!7 = !{!"_ZTS8aiString", !8, i64 0, !9, i64 4}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTS12aiMatrix4x4tIfE", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60}
!12 = !{!"float", !9, i64 0}
!13 = !{!"any pointer", !9, i64 0}
!14 = !{!6, !8, i64 1104}
!15 = !{!16, !13, i64 24}
!16 = !{!"_ZTS7aiScene", !8, i64 0, !13, i64 8, !8, i64 16, !13, i64 24, !8, i64 32, !13, i64 40, !8, i64 48, !13, i64 56, !8, i64 64, !13, i64 72, !8, i64 80, !13, i64 88, !8, i64 96, !13, i64 104, !13, i64 112, !7, i64 120, !8, i64 1148, !13, i64 1152, !13, i64 1160}
!17 = !{!6, !13, i64 1128}
!18 = !{!8, !8, i64 0}
!19 = !{!13, !13, i64 0}
!20 = !{!21, !8, i64 232}
!21 = !{!"_ZTS6aiMesh", !8, i64 0, !8, i64 4, !8, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !9, i64 48, !9, i64 112, !9, i64 176, !13, i64 208, !8, i64 216, !13, i64 224, !8, i64 232, !7, i64 236, !8, i64 1264, !13, i64 1272, !22, i64 1280, !23, i64 1284, !13, i64 1312}
!22 = !{!"_ZTS16aiMorphingMethod", !9, i64 0}
!23 = !{!"_ZTS6aiAABB", !24, i64 0, !24, i64 12}
!24 = !{!"_ZTS10aiVector3tIfE", !12, i64 0, !12, i64 4, !12, i64 8}
!25 = !{!21, !8, i64 4}
!26 = !{!21, !8, i64 8}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!6, !13, i64 1112}
!30 = distinct !{!30, !28}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass