; LLVM IR from Samson-Mano/EM_Propogation_simulation :: EM_Propogation_simulation/src/ImGui (imgui)

; 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.ImGuiOldColumns = type { i32, i32, i8, i8, i32, i32, float, float, float, float, float, float, %struct.ImRect, %struct.ImRect, %struct.ImRect, %struct.ImVector.46, %struct.ImDrawListSplitter }
%struct.ImRect = type { %struct.ImVec2, %struct.ImVec2 }
%struct.ImVec2 = type { float, float }
%struct.ImVector.46 = type { i32, i32, ptr }
%struct.ImDrawListSplitter = type { i32, i32, %struct.ImVector.19 }
%struct.ImVector.19 = type { i32, i32, ptr }
%struct.ImGuiOldColumnData = type { float, float, i32, %struct.ImRect }

@.str.474 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.475 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.476 = external hidden unnamed_addr constant [41 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

declare void @_ZN5ImGui7TreePopEv() #1

declare void @_ZN5ImGui10BulletTextEPKcz(ptr noundef, ...) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImGui16DebugNodeColumnsEP15ImGuiOldColumns(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %4, i32 0, i32 0
  %6 = load i32, ptr %5, align 8, !tbaa !9
  %7 = zext i32 %6 to i64
  %8 = inttoptr i64 %7 to ptr
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %9, i32 0, i32 0
  %11 = load i32, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %12, i32 0, i32 5
  %14 = load i32, ptr %13, align 8, !tbaa !19
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %15, i32 0, i32 1
  %17 = load i32, ptr %16, align 4, !tbaa !20
  %18 = call noundef zeroext i1 (ptr, ptr, ...) @_ZN5ImGui8TreeNodeEPKvPKcz(ptr noundef %8, ptr noundef @.str.474, i32 noundef %11, i32 noundef %14, i32 noundef %17)
  br i1 %18, label %20, label %19

19:                                               ; preds = %1
  br label %67

20:                                               ; preds = %1
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %21, i32 0, i32 7
  %23 = load float, ptr %22, align 8, !tbaa !21
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %24, i32 0, i32 6
  %26 = load float, ptr %25, align 4, !tbaa !22
  %27 = fsub float %23, %26
  %28 = fpext float %27 to double
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %29, i32 0, i32 6
  %31 = load float, ptr %30, align 4, !tbaa !22
  %32 = fpext float %31 to double
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %33, i32 0, i32 7
  %35 = load float, ptr %34, align 8, !tbaa !21
  %36 = fpext float %35 to double
  call void (ptr, ...) @_ZN5ImGui10BulletTextEPKcz(ptr noundef @.str.475, double noundef %28, double noundef %32, double noundef %36)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !23
  br label %37

37:                                               ; preds = %63, %20
  %38 = load i32, ptr %3, align 4, !tbaa !23
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %39, i32 0, i32 15
  %41 = getelementptr inbounds %struct.ImVector.46, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !24
  %43 = icmp slt i32 %38, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %66

45:                                               ; preds = %37
  %46 = load i32, ptr %3, align 4, !tbaa !23
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %47, i32 0, i32 15
  %49 = load i32, ptr %3, align 4, !tbaa !23
  %50 = call noundef nonnull align 4 dereferenceable(28) ptr @_ZN8ImVectorI18ImGuiOldColumnDataEixEi(ptr noundef nonnull align 8 dereferenceable(16) %48, i32 noundef %49)
  %51 = getelementptr inbounds %struct.ImGuiOldColumnData, ptr %50, i32 0, i32 0
  %52 = load float, ptr %51, align 4, !tbaa !25
  %53 = fpext float %52 to double
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ImGuiOldColumns, ptr %55, i32 0, i32 15
  %57 = load i32, ptr %3, align 4, !tbaa !23
  %58 = call noundef nonnull align 4 dereferenceable(28) ptr @_ZN8ImVectorI18ImGuiOldColumnDataEixEi(ptr noundef nonnull align 8 dereferenceable(16) %56, i32 noundef %57)
  %59 = getelementptr inbounds %struct.ImGuiOldColumnData, ptr %58, i32 0, i32 0
  %60 = load float, ptr %59, align 4, !tbaa !25
  %61 = call noundef float @_ZN5ImGui23GetColumnOffsetFromNormEPK15ImGuiOldColumnsf(ptr noundef %54, float noundef %60)
  %62 = fpext float %61 to double
  call void (ptr, ...) @_ZN5ImGui10BulletTextEPKcz(ptr noundef @.str.476, i32 noundef %46, double noundef %53, double noundef %62)
  br label %63

63:                                               ; preds = %45
  %64 = load i32, ptr %3, align 4, !tbaa !23
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %3, align 4, !tbaa !23
  br label %37, !llvm.loop !27

66:                                               ; preds = %44
  call void @_ZN5ImGui7TreePopEv()
  br label %67

67:                                               ; preds = %66, %19
  ret void
}

declare noundef zeroext i1 @_ZN5ImGui8TreeNodeEPKvPKcz(ptr noundef, ptr noundef, ...) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(28) ptr @_ZN8ImVectorI18ImGuiOldColumnDataEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #3 align 2

declare noundef float @_ZN5ImGui23GetColumnOffsetFromNormEPK15ImGuiOldColumnsf(ptr noundef, float noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 #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++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS15ImGuiOldColumns", !11, i64 0, !11, i64 4, !12, i64 8, !12, i64 9, !11, i64 12, !11, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !14, i64 44, !14, i64 60, !14, i64 76, !16, i64 96, !17, i64 112}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"float", !7, i64 0}
!14 = !{!"_ZTS6ImRect", !15, i64 0, !15, i64 8}
!15 = !{!"_ZTS6ImVec2", !13, i64 0, !13, i64 4}
!16 = !{!"_ZTS8ImVectorI18ImGuiOldColumnDataE", !11, i64 0, !11, i64 4, !6, i64 8}
!17 = !{!"_ZTS18ImDrawListSplitter", !11, i64 0, !11, i64 4, !18, i64 8}
!18 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !11, i64 0, !11, i64 4, !6, i64 8}
!19 = !{!10, !11, i64 16}
!20 = !{!10, !11, i64 4}
!21 = !{!10, !13, i64 24}
!22 = !{!10, !13, i64 20}
!23 = !{!11, !11, i64 0}
!24 = !{!10, !11, i64 96}
!25 = !{!26, !13, i64 0}
!26 = !{!"_ZTS18ImGuiOldColumnData", !13, i64 0, !13, i64 4, !11, i64 8, !14, i64 12}
!27 = distinct !{!27, !28}
!28 = !{!"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"

@.str.474 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.475 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.476 = external hidden unnamed_addr constant [41 x i8], align 1

declare void @_ZN5ImGui7TreePopEv() local_unnamed_addr #0

declare void @_ZN5ImGui10BulletTextEPKcz(ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5ImGui16DebugNodeColumnsEP15ImGuiOldColumns(ptr noundef %0) local_unnamed_addr #1 {
  %2 = load i32, ptr %0, align 8, !tbaa !5
  %3 = zext i32 %2 to i64
  %4 = inttoptr i64 %3 to ptr
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = load i32, ptr %5, align 8, !tbaa !18
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  %8 = load i32, ptr %7, align 4, !tbaa !19
  %9 = tail call noundef zeroext i1 (ptr, ptr, ...) @_ZN5ImGui8TreeNodeEPKvPKcz(ptr noundef %4, ptr noundef nonnull @.str.474, i32 noundef %2, i32 noundef %6, i32 noundef %8)
  br i1 %9, label %10, label %32

10:                                               ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = load float, ptr %11, align 8, !tbaa !20
  %13 = getelementptr inbounds i8, ptr %0, i64 20
  %14 = load float, ptr %13, align 4, !tbaa !21
  %15 = fsub float %12, %14
  %16 = fpext float %15 to double
  %17 = fpext float %14 to double
  %18 = fpext float %12 to double
  tail call void (ptr, ...) @_ZN5ImGui10BulletTextEPKcz(ptr noundef nonnull @.str.475, double noundef %16, double noundef %17, double noundef %18)
  %19 = getelementptr inbounds i8, ptr %0, i64 96
  %20 = load i32, ptr %19, align 8, !tbaa !22
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %10
  tail call void @_ZN5ImGui7TreePopEv()
  br label %32

.lr.ph:                                           ; preds = %10, %.lr.ph
  %.016 = phi i32 [ %29, %.lr.ph ], [ 0, %10 ]
  %22 = tail call noundef nonnull align 4 dereferenceable(28) ptr @_ZN8ImVectorI18ImGuiOldColumnDataEixEi(ptr noundef nonnull align 8 dereferenceable(16) %19, i32 noundef %.016)
  %23 = load float, ptr %22, align 4, !tbaa !23
  %24 = fpext float %23 to double
  %25 = tail call noundef nonnull align 4 dereferenceable(28) ptr @_ZN8ImVectorI18ImGuiOldColumnDataEixEi(ptr noundef nonnull align 8 dereferenceable(16) %19, i32 noundef %.016)
  %26 = load float, ptr %25, align 4, !tbaa !23
  %27 = tail call noundef float @_ZN5ImGui23GetColumnOffsetFromNormEPK15ImGuiOldColumnsf(ptr noundef nonnull %0, float noundef %26)
  %28 = fpext float %27 to double
  tail call void (ptr, ...) @_ZN5ImGui10BulletTextEPKcz(ptr noundef nonnull @.str.476, i32 noundef %.016, double noundef %24, double noundef %28)
  %29 = add nuw nsw i32 %.016, 1
  %30 = load i32, ptr %19, align 8, !tbaa !22
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %.lr.ph, label %._crit_edge, !llvm.loop !25

32:                                               ; preds = %1, %._crit_edge
  ret void
}

declare noundef zeroext i1 @_ZN5ImGui8TreeNodeEPKvPKcz(ptr noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(28) ptr @_ZN8ImVectorI18ImGuiOldColumnDataEixEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #2 align 2

declare noundef float @_ZN5ImGui23GetColumnOffsetFromNormEPK15ImGuiOldColumnsf(ptr noundef, float noundef) local_unnamed_addr #0

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

!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 = !{!"_ZTS15ImGuiOldColumns", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 9, !7, i64 12, !7, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !12, i64 44, !12, i64 60, !12, i64 76, !14, i64 96, !16, i64 112}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!"_ZTS6ImRect", !13, i64 0, !13, i64 8}
!13 = !{!"_ZTS6ImVec2", !11, i64 0, !11, i64 4}
!14 = !{!"_ZTS8ImVectorI18ImGuiOldColumnDataE", !7, i64 0, !7, i64 4, !15, i64 8}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"_ZTS18ImDrawListSplitter", !7, i64 0, !7, i64 4, !17, i64 8}
!17 = !{!"_ZTS8ImVectorI13ImDrawChannelE", !7, i64 0, !7, i64 4, !15, i64 8}
!18 = !{!6, !7, i64 16}
!19 = !{!6, !7, i64 4}
!20 = !{!6, !11, i64 24}
!21 = !{!6, !11, i64 20}
!22 = !{!6, !7, i64 96}
!23 = !{!24, !11, i64 0}
!24 = !{!"_ZTS18ImGuiOldColumnData", !11, i64 0, !11, i64 4, !7, i64 8, !12, i64 12}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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