; LLVM IR from Dragons-Lake/REI :: sources/REI_Integration/3rdParty/nanovg (nanovg)

; 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.NVGcolor = type { %union.anon }
%union.anon = type { [4 x float] }
%struct.anon = type { float, float, float, float }

; Function Attrs: nounwind uwtable
define dso_local { <2 x float>, <2 x float> } @nvgRGBA(i8 noundef zeroext %0, i8 noundef zeroext %1, i8 noundef zeroext %2, i8 noundef zeroext %3) #0 {
  %5 = alloca %struct.NVGcolor, align 4
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  store i8 %0, ptr %6, align 1, !tbaa !5
  store i8 %1, ptr %7, align 1, !tbaa !5
  store i8 %2, ptr %8, align 1, !tbaa !5
  store i8 %3, ptr %9, align 1, !tbaa !5
  %10 = load i8, ptr %6, align 1, !tbaa !5
  %11 = zext i8 %10 to i32
  %12 = sitofp i32 %11 to float
  %13 = fdiv float %12, 2.550000e+02
  %14 = getelementptr inbounds %struct.NVGcolor, ptr %5, i32 0, i32 0
  %15 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 0
  store float %13, ptr %15, align 4, !tbaa !5
  %16 = load i8, ptr %7, align 1, !tbaa !5
  %17 = zext i8 %16 to i32
  %18 = sitofp i32 %17 to float
  %19 = fdiv float %18, 2.550000e+02
  %20 = getelementptr inbounds %struct.NVGcolor, ptr %5, i32 0, i32 0
  %21 = getelementptr inbounds %struct.anon, ptr %20, i32 0, i32 1
  store float %19, ptr %21, align 4, !tbaa !5
  %22 = load i8, ptr %8, align 1, !tbaa !5
  %23 = zext i8 %22 to i32
  %24 = sitofp i32 %23 to float
  %25 = fdiv float %24, 2.550000e+02
  %26 = getelementptr inbounds %struct.NVGcolor, ptr %5, i32 0, i32 0
  %27 = getelementptr inbounds %struct.anon, ptr %26, i32 0, i32 2
  store float %25, ptr %27, align 4, !tbaa !5
  %28 = load i8, ptr %9, align 1, !tbaa !5
  %29 = zext i8 %28 to i32
  %30 = sitofp i32 %29 to float
  %31 = fdiv float %30, 2.550000e+02
  %32 = getelementptr inbounds %struct.NVGcolor, ptr %5, i32 0, i32 0
  %33 = getelementptr inbounds %struct.anon, ptr %32, i32 0, i32 3
  store float %31, ptr %33, align 4, !tbaa !5
  %34 = getelementptr inbounds %struct.NVGcolor, ptr %5, i32 0, i32 0
  %35 = getelementptr inbounds %union.anon, ptr %34, i32 0, i32 0
  %36 = load { <2 x float>, <2 x float> }, ptr %35, align 4
  ret { <2 x float>, <2 x float> } %36
}

attributes #0 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}


; 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 nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { <2 x float>, <2 x float> } @nvgRGBA(i8 noundef zeroext %0, i8 noundef zeroext %1, i8 noundef zeroext %2, i8 noundef zeroext %3) local_unnamed_addr #0 {
  %5 = insertelement <4 x i8> poison, i8 %0, i64 0
  %6 = insertelement <4 x i8> %5, i8 %1, i64 1
  %7 = insertelement <4 x i8> %6, i8 %2, i64 2
  %8 = insertelement <4 x i8> %7, i8 %3, i64 3
  %9 = uitofp <4 x i8> %8 to <4 x float>
  %10 = fdiv <4 x float> %9, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %11 = shufflevector <4 x float> %10, <4 x float> poison, <2 x i32> <i32 0, i32 1>
  %12 = shufflevector <4 x float> %10, <4 x float> poison, <2 x i32> <i32 2, i32 3>
  %.fca.0.insert = insertvalue { <2 x float>, <2 x float> } poison, <2 x float> %11, 0
  %.fca.1.insert = insertvalue { <2 x float>, <2 x float> } %.fca.0.insert, <2 x float> %12, 1
  ret { <2 x float>, <2 x float> } %.fca.1.insert
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) 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: GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass