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

; 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.ImGuiMenuColumns = type <{ i32, i32, i16, i16, i16, i16, i16, [4 x i16], [2 x i8] }>

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16ImGuiMenuColumns18CalcNextTotalWidthEb(ptr noundef nonnull align 4 dereferenceable(26), i1 noundef zeroext) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef float @_ZN16ImGuiMenuColumns11DeclColumnsEffff(ptr noundef nonnull align 4 dereferenceable(26) %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4) #1 align 2 {
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store float %1, ptr %7, align 4, !tbaa !9
  store float %2, ptr %8, align 4, !tbaa !9
  store float %3, ptr %9, align 4, !tbaa !9
  store float %4, ptr %10, align 4, !tbaa !9
  %11 = load ptr, ptr %6, align 8
  %12 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 7
  %13 = getelementptr inbounds [4 x i16], ptr %12, i64 0, i64 0
  %14 = load i16, ptr %13, align 2, !tbaa !11
  %15 = load float, ptr %7, align 4, !tbaa !9
  %16 = fptoui float %15 to i16
  %17 = call noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext %14, i16 noundef zeroext %16)
  %18 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 7
  %19 = getelementptr inbounds [4 x i16], ptr %18, i64 0, i64 0
  store i16 %17, ptr %19, align 2, !tbaa !11
  %20 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 7
  %21 = getelementptr inbounds [4 x i16], ptr %20, i64 0, i64 1
  %22 = load i16, ptr %21, align 2, !tbaa !11
  %23 = load float, ptr %8, align 4, !tbaa !9
  %24 = fptoui float %23 to i16
  %25 = call noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext %22, i16 noundef zeroext %24)
  %26 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 7
  %27 = getelementptr inbounds [4 x i16], ptr %26, i64 0, i64 1
  store i16 %25, ptr %27, align 2, !tbaa !11
  %28 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 7
  %29 = getelementptr inbounds [4 x i16], ptr %28, i64 0, i64 2
  %30 = load i16, ptr %29, align 2, !tbaa !11
  %31 = load float, ptr %9, align 4, !tbaa !9
  %32 = fptoui float %31 to i16
  %33 = call noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext %30, i16 noundef zeroext %32)
  %34 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 7
  %35 = getelementptr inbounds [4 x i16], ptr %34, i64 0, i64 2
  store i16 %33, ptr %35, align 2, !tbaa !11
  %36 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 7
  %37 = getelementptr inbounds [4 x i16], ptr %36, i64 0, i64 3
  %38 = load i16, ptr %37, align 2, !tbaa !11
  %39 = load float, ptr %10, align 4, !tbaa !9
  %40 = fptoui float %39 to i16
  %41 = call noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext %38, i16 noundef zeroext %40)
  %42 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 7
  %43 = getelementptr inbounds [4 x i16], ptr %42, i64 0, i64 3
  store i16 %41, ptr %43, align 2, !tbaa !11
  call void @_ZN16ImGuiMenuColumns18CalcNextTotalWidthEb(ptr noundef nonnull align 4 dereferenceable(26) %11, i1 noundef zeroext false)
  %44 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 0
  %45 = load i32, ptr %44, align 4, !tbaa !13
  %46 = getelementptr inbounds %struct.ImGuiMenuColumns, ptr %11, i32 0, i32 1
  %47 = load i32, ptr %46, align 4, !tbaa !16
  %48 = call noundef i32 @_ZL5ImMaxIjET_S0_S0_(i32 noundef %45, i32 noundef %47)
  %49 = uitofp i32 %48 to float
  ret float %49
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext, i16 noundef zeroext) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL5ImMaxIjET_S0_S0_(i32 noundef, i32 noundef) #2

attributes #0 = { 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 #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, !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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS16ImGuiMenuColumns", !15, i64 0, !15, i64 4, !12, i64 8, !12, i64 10, !12, i64 12, !12, i64 14, !12, i64 16, !7, i64 18}
!15 = !{!"int", !7, i64 0}
!16 = !{!14, !15, 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"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16ImGuiMenuColumns18CalcNextTotalWidthEb(ptr noundef nonnull align 4 dereferenceable(26), i1 noundef zeroext) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef float @_ZN16ImGuiMenuColumns11DeclColumnsEffff(ptr noundef nonnull align 4 dereferenceable(26) %0, float noundef %1, float noundef %2, float noundef %3, float noundef %4) local_unnamed_addr #0 align 2 {
  %6 = getelementptr inbounds i8, ptr %0, i64 18
  %7 = load i16, ptr %6, align 2, !tbaa !5
  %8 = fptoui float %1 to i16
  %9 = tail call noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext %7, i16 noundef zeroext %8)
  store i16 %9, ptr %6, align 2, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 20
  %11 = load i16, ptr %10, align 4, !tbaa !5
  %12 = fptoui float %2 to i16
  %13 = tail call noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext %11, i16 noundef zeroext %12)
  store i16 %13, ptr %10, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 22
  %15 = load i16, ptr %14, align 2, !tbaa !5
  %16 = fptoui float %3 to i16
  %17 = tail call noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext %15, i16 noundef zeroext %16)
  store i16 %17, ptr %14, align 2, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 24
  %19 = load i16, ptr %18, align 4, !tbaa !5
  %20 = fptoui float %4 to i16
  %21 = tail call noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext %19, i16 noundef zeroext %20)
  store i16 %21, ptr %18, align 4, !tbaa !5
  tail call void @_ZN16ImGuiMenuColumns18CalcNextTotalWidthEb(ptr noundef nonnull align 4 dereferenceable(26) %0, i1 noundef zeroext false)
  %22 = load i32, ptr %0, align 4, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %0, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !12
  %25 = tail call noundef i32 @_ZL5ImMaxIjET_S0_S0_(i32 noundef %22, i32 noundef %24)
  %26 = uitofp i32 %25 to float
  ret float %26
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL5ImMaxItET_S0_S0_(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL5ImMaxIjET_S0_S0_(i32 noundef, i32 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { 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, !6, i64 0}
!6 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS16ImGuiMenuColumns", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 10, !6, i64 12, !6, i64 14, !6, i64 16, !7, i64 18}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass