; LLVM IR from microsoft/LightAIMD :: src (molecule)

; 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.molecule = type { i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, i64, ptr }
%struct.vec3d = type { double, double, double }

@.str.10 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [78 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: nounwind uwtable
define dso_local void @print_molecule(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.molecule, ptr %5, i32 0, i32 0
  %7 = load i64, ptr %6, align 8, !tbaa !9
  %8 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i64 noundef %7)
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.molecule, ptr %9, i32 0, i32 1
  %11 = load i64, ptr %10, align 8, !tbaa !12
  %12 = call i32 (ptr, ...) @printf(ptr noundef @.str.12, i64 noundef %11)
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.molecule, ptr %13, i32 0, i32 8
  %15 = load i64, ptr %14, align 8, !tbaa !13
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, i64 noundef %15)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  store i64 0, ptr %3, align 8, !tbaa !14
  br label %17

17:                                               ; preds = %107, %1
  %18 = load i64, ptr %3, align 8, !tbaa !14
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.molecule, ptr %19, i32 0, i32 0
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = icmp ult i64 %18, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  br label %110

24:                                               ; preds = %17
  %25 = load i64, ptr %3, align 8, !tbaa !14
  %26 = add i64 %25, 1
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.molecule, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !15
  %30 = load i64, ptr %3, align 8, !tbaa !14
  %31 = getelementptr inbounds i64, ptr %29, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !14
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.molecule, ptr %33, i32 0, i32 3
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = load i64, ptr %3, align 8, !tbaa !14
  %37 = getelementptr inbounds double, ptr %35, i64 %36
  %38 = load double, ptr %37, align 8, !tbaa !17
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i64 noundef %26, i64 noundef %32, double noundef %38)
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.molecule, ptr %40, i32 0, i32 4
  %42 = load ptr, ptr %41, align 8, !tbaa !19
  %43 = load i64, ptr %3, align 8, !tbaa !14
  %44 = getelementptr inbounds %struct.vec3d, ptr %42, i64 %43
  %45 = getelementptr inbounds %struct.vec3d, ptr %44, i32 0, i32 0
  %46 = load double, ptr %45, align 8, !tbaa !20
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.molecule, ptr %47, i32 0, i32 4
  %49 = load ptr, ptr %48, align 8, !tbaa !19
  %50 = load i64, ptr %3, align 8, !tbaa !14
  %51 = getelementptr inbounds %struct.vec3d, ptr %49, i64 %50
  %52 = getelementptr inbounds %struct.vec3d, ptr %51, i32 0, i32 1
  %53 = load double, ptr %52, align 8, !tbaa !22
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.molecule, ptr %54, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !19
  %57 = load i64, ptr %3, align 8, !tbaa !14
  %58 = getelementptr inbounds %struct.vec3d, ptr %56, i64 %57
  %59 = getelementptr inbounds %struct.vec3d, ptr %58, i32 0, i32 2
  %60 = load double, ptr %59, align 8, !tbaa !23
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, double noundef %46, double noundef %53, double noundef %60)
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.molecule, ptr %62, i32 0, i32 5
  %64 = load ptr, ptr %63, align 8, !tbaa !24
  %65 = load i64, ptr %3, align 8, !tbaa !14
  %66 = getelementptr inbounds %struct.vec3d, ptr %64, i64 %65
  %67 = getelementptr inbounds %struct.vec3d, ptr %66, i32 0, i32 0
  %68 = load double, ptr %67, align 8, !tbaa !20
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.molecule, ptr %69, i32 0, i32 5
  %71 = load ptr, ptr %70, align 8, !tbaa !24
  %72 = load i64, ptr %3, align 8, !tbaa !14
  %73 = getelementptr inbounds %struct.vec3d, ptr %71, i64 %72
  %74 = getelementptr inbounds %struct.vec3d, ptr %73, i32 0, i32 1
  %75 = load double, ptr %74, align 8, !tbaa !22
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.molecule, ptr %76, i32 0, i32 5
  %78 = load ptr, ptr %77, align 8, !tbaa !24
  %79 = load i64, ptr %3, align 8, !tbaa !14
  %80 = getelementptr inbounds %struct.vec3d, ptr %78, i64 %79
  %81 = getelementptr inbounds %struct.vec3d, ptr %80, i32 0, i32 2
  %82 = load double, ptr %81, align 8, !tbaa !23
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef %68, double noundef %75, double noundef %82)
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.molecule, ptr %84, i32 0, i32 7
  %86 = load ptr, ptr %85, align 8, !tbaa !25
  %87 = load i64, ptr %3, align 8, !tbaa !14
  %88 = getelementptr inbounds %struct.vec3d, ptr %86, i64 %87
  %89 = getelementptr inbounds %struct.vec3d, ptr %88, i32 0, i32 0
  %90 = load double, ptr %89, align 8, !tbaa !20
  %91 = load ptr, ptr %2, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.molecule, ptr %91, i32 0, i32 7
  %93 = load ptr, ptr %92, align 8, !tbaa !25
  %94 = load i64, ptr %3, align 8, !tbaa !14
  %95 = getelementptr inbounds %struct.vec3d, ptr %93, i64 %94
  %96 = getelementptr inbounds %struct.vec3d, ptr %95, i32 0, i32 1
  %97 = load double, ptr %96, align 8, !tbaa !22
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.molecule, ptr %98, i32 0, i32 7
  %100 = load ptr, ptr %99, align 8, !tbaa !25
  %101 = load i64, ptr %3, align 8, !tbaa !14
  %102 = getelementptr inbounds %struct.vec3d, ptr %100, i64 %101
  %103 = getelementptr inbounds %struct.vec3d, ptr %102, i32 0, i32 2
  %104 = load double, ptr %103, align 8, !tbaa !23
  %105 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, double noundef %90, double noundef %97, double noundef %104)
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  br label %107

107:                                              ; preds = %24
  %108 = load i64, ptr %3, align 8, !tbaa !14
  %109 = add i64 %108, 1
  store i64 %109, ptr %3, align 8, !tbaa !14
  br label %17, !llvm.loop !26

110:                                              ; preds = %23
  %111 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  ret void
}

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

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

!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, !11, i64 0}
!10 = !{!"molecule", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64, !6, i64 72}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !11, i64 64}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !6, i64 16}
!16 = !{!10, !6, i64 24}
!17 = !{!18, !18, i64 0}
!18 = !{!"double", !7, i64 0}
!19 = !{!10, !6, i64 32}
!20 = !{!21, !18, i64 0}
!21 = !{!"vec3d", !18, i64 0, !18, i64 8, !18, i64 16}
!22 = !{!21, !18, i64 8}
!23 = !{!21, !18, i64 16}
!24 = !{!10, !6, i64 40}
!25 = !{!10, !6, i64 56}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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

@.str.10 = external hidden unnamed_addr constant [78 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [78 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @print_molecule(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %3 = load i64, ptr %0, align 8, !tbaa !5
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i64 noundef %3)
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load i64, ptr %5, align 8, !tbaa !11
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12, i64 noundef %6)
  %8 = getelementptr inbounds i8, ptr %0, i64 64
  %9 = load i64, ptr %8, align 8, !tbaa !12
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, i64 noundef %9)
  %11 = load i64, ptr %0, align 8, !tbaa !5
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %12 = getelementptr inbounds i8, ptr %0, i64 16
  %13 = getelementptr inbounds i8, ptr %0, i64 24
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  %16 = getelementptr inbounds i8, ptr %0, i64 56
  br label %18

._crit_edge:                                      ; preds = %18, %1
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  ret void

18:                                               ; preds = %.lr.ph, %18
  %.028 = phi i64 [ 0, %.lr.ph ], [ %19, %18 ]
  %19 = add nuw i64 %.028, 1
  %20 = load ptr, ptr %12, align 8, !tbaa !13
  %21 = getelementptr inbounds i64, ptr %20, i64 %.028
  %22 = load i64, ptr %21, align 8, !tbaa !14
  %23 = load ptr, ptr %13, align 8, !tbaa !15
  %24 = getelementptr inbounds double, ptr %23, i64 %.028
  %25 = load double, ptr %24, align 8, !tbaa !16
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i64 noundef %19, i64 noundef %22, double noundef %25)
  %27 = load ptr, ptr %14, align 8, !tbaa !18
  %28 = getelementptr inbounds %struct.vec3d, ptr %27, i64 %.028
  %29 = load double, ptr %28, align 8, !tbaa !19
  %30 = getelementptr inbounds i8, ptr %28, i64 8
  %31 = load double, ptr %30, align 8, !tbaa !21
  %32 = getelementptr inbounds i8, ptr %28, i64 16
  %33 = load double, ptr %32, align 8, !tbaa !22
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, double noundef %29, double noundef %31, double noundef %33)
  %35 = load ptr, ptr %15, align 8, !tbaa !23
  %36 = getelementptr inbounds %struct.vec3d, ptr %35, i64 %.028
  %37 = load double, ptr %36, align 8, !tbaa !19
  %38 = getelementptr inbounds i8, ptr %36, i64 8
  %39 = load double, ptr %38, align 8, !tbaa !21
  %40 = getelementptr inbounds i8, ptr %36, i64 16
  %41 = load double, ptr %40, align 8, !tbaa !22
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef %37, double noundef %39, double noundef %41)
  %43 = load ptr, ptr %16, align 8, !tbaa !24
  %44 = getelementptr inbounds %struct.vec3d, ptr %43, i64 %.028
  %45 = load double, ptr %44, align 8, !tbaa !19
  %46 = getelementptr inbounds i8, ptr %44, i64 8
  %47 = load double, ptr %46, align 8, !tbaa !21
  %48 = getelementptr inbounds i8, ptr %44, i64 16
  %49 = load double, ptr %48, align 8, !tbaa !22
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, double noundef %45, double noundef %47, double noundef %49)
  %51 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  %52 = load i64, ptr %0, align 8, !tbaa !5
  %53 = icmp ult i64 %19, %52
  br i1 %53, label %18, label %._crit_edge, !llvm.loop !25
}

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

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

!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 = !{!"molecule", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !10, i64 72}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!6, !7, i64 64}
!13 = !{!6, !10, i64 16}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !10, i64 24}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = !{!6, !10, i64 32}
!19 = !{!20, !17, i64 0}
!20 = !{!"vec3d", !17, i64 0, !17, i64 8, !17, i64 16}
!21 = !{!20, !17, i64 8}
!22 = !{!20, !17, i64 16}
!23 = !{!6, !10, i64 40}
!24 = !{!6, !10, i64 56}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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