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

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

; 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 noundef i32 @_Z18ImAlphaBlendColorsjj(i32 noundef %0, i32 noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %9 = load i32, ptr %4, align 4, !tbaa !5
  %10 = lshr i32 %9, 24
  %11 = and i32 %10, 255
  %12 = uitofp i32 %11 to float
  %13 = fdiv float %12, 2.550000e+02
  store float %13, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %14 = load i32, ptr %3, align 4, !tbaa !5
  %15 = lshr i32 %14, 0
  %16 = and i32 %15, 255
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = lshr i32 %17, 0
  %19 = and i32 %18, 255
  %20 = load float, ptr %5, align 4, !tbaa !9
  %21 = call noundef i32 @_ZL6ImLerpIiET_S0_S0_f(i32 noundef %16, i32 noundef %19, float noundef %20)
  store i32 %21, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = lshr i32 %22, 8
  %24 = and i32 %23, 255
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = lshr i32 %25, 8
  %27 = and i32 %26, 255
  %28 = load float, ptr %5, align 4, !tbaa !9
  %29 = call noundef i32 @_ZL6ImLerpIiET_S0_S0_f(i32 noundef %24, i32 noundef %27, float noundef %28)
  store i32 %29, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = lshr i32 %30, 16
  %32 = and i32 %31, 255
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = lshr i32 %33, 16
  %35 = and i32 %34, 255
  %36 = load float, ptr %5, align 4, !tbaa !9
  %37 = call noundef i32 @_ZL6ImLerpIiET_S0_S0_f(i32 noundef %32, i32 noundef %35, float noundef %36)
  store i32 %37, ptr %8, align 4, !tbaa !5
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = shl i32 %38, 16
  %40 = or i32 -16777216, %39
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = shl i32 %41, 8
  %43 = or i32 %40, %42
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = shl i32 %44, 0
  %46 = or i32 %43, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret i32 %46
}

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

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 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}


; 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
define dso_local noundef range(i32 -16777216, 0) i32 @_Z18ImAlphaBlendColorsjj(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = lshr i32 %1, 24
  %4 = uitofp nneg i32 %3 to float
  %5 = fdiv float %4, 2.550000e+02
  %6 = and i32 %0, 255
  %7 = and i32 %1, 255
  %8 = tail call noundef i32 @_ZL6ImLerpIiET_S0_S0_f(i32 noundef %6, i32 noundef %7, float noundef %5)
  %9 = lshr i32 %0, 8
  %10 = and i32 %9, 255
  %11 = lshr i32 %1, 8
  %12 = and i32 %11, 255
  %13 = tail call noundef i32 @_ZL6ImLerpIiET_S0_S0_f(i32 noundef %10, i32 noundef %12, float noundef %5)
  %14 = lshr i32 %0, 16
  %15 = and i32 %14, 255
  %16 = lshr i32 %1, 16
  %17 = and i32 %16, 255
  %18 = tail call noundef i32 @_ZL6ImLerpIiET_S0_S0_f(i32 noundef %15, i32 noundef %17, float noundef %5)
  %19 = shl i32 %18, 16
  %20 = shl i32 %13, 8
  %21 = or i32 %8, %20
  %22 = or i32 %21, %19
  %23 = or i32 %22, -16777216
  ret i32 %23
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL6ImLerpIiET_S0_S0_f(i32 noundef, i32 noundef, float 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)"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass