; LLVM IR from Xingyu-Lin/softgym :: PyFlex/bindings/demo (shadersDemoContext)

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

%class.XMatrix44 = type { [4 x [4 x float]] }
%class.XVector4 = type { float, float, float, float }
%class.XVector3 = type { float, float, float }

@s_context = external dso_local global ptr, align 8

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16RenderEllipsoidsP13FluidRendererP18FluidRenderBuffersiiffff8XVector3IfES4_9XMatrix44IfEP9ShadowMap8XVector4IfEffb(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, float noundef %4, float noundef %5, float noundef %6, float noundef %7, <2 x float> %8, float %9, <2 x float> %10, float %11, ptr noundef byval(%class.XMatrix44) align 8 %12, ptr noundef %13, ptr noundef byval(%class.XVector4) align 8 %14, float noundef %15, float noundef %16, i1 noundef zeroext %17) #1 {
  %19 = alloca %class.XVector3, align 4
  %20 = alloca { <2 x float>, float }, align 4
  %21 = alloca %class.XVector3, align 4
  %22 = alloca { <2 x float>, float }, align 4
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca ptr, align 8
  %32 = alloca float, align 4
  %33 = alloca float, align 4
  %34 = alloca i8, align 1
  %35 = alloca %class.XVector3, align 4
  %36 = alloca %class.XVector3, align 4
  %37 = alloca %class.XMatrix44, align 8
  %38 = alloca %class.XVector4, align 8
  %39 = alloca { <2 x float>, float }, align 4
  %40 = alloca { <2 x float>, float }, align 4
  %41 = getelementptr inbounds { <2 x float>, float }, ptr %20, i32 0, i32 0
  store <2 x float> %8, ptr %41, align 4
  %42 = getelementptr inbounds { <2 x float>, float }, ptr %20, i32 0, i32 1
  store float %9, ptr %42, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %20, i64 12, i1 false)
  %43 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 0
  store <2 x float> %10, ptr %43, align 4
  %44 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 1
  store float %11, ptr %44, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %22, i64 12, i1 false)
  store ptr %0, ptr %23, align 8, !tbaa !5
  store ptr %1, ptr %24, align 8, !tbaa !5
  store i32 %2, ptr %25, align 4, !tbaa !9
  store i32 %3, ptr %26, align 4, !tbaa !9
  store float %4, ptr %27, align 4, !tbaa !11
  store float %5, ptr %28, align 4, !tbaa !11
  store float %6, ptr %29, align 4, !tbaa !11
  store float %7, ptr %30, align 4, !tbaa !11
  store ptr %13, ptr %31, align 8, !tbaa !5
  store float %15, ptr %32, align 4, !tbaa !11
  store float %16, ptr %33, align 4, !tbaa !11
  %45 = zext i1 %17 to i8
  store i8 %45, ptr %34, align 1, !tbaa !13
  %46 = load ptr, ptr @s_context, align 8, !tbaa !5
  %47 = load ptr, ptr %23, align 8, !tbaa !5
  %48 = load ptr, ptr %24, align 8, !tbaa !5
  %49 = load i32, ptr %25, align 4, !tbaa !9
  %50 = load i32, ptr %26, align 4, !tbaa !9
  %51 = load float, ptr %27, align 4, !tbaa !11
  %52 = load float, ptr %28, align 4, !tbaa !11
  %53 = load float, ptr %29, align 4, !tbaa !11
  %54 = load float, ptr %30, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %36, ptr align 4 %21, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %37, ptr align 8 %12, i64 64, i1 false), !tbaa.struct !16
  %55 = load ptr, ptr %31, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %38, ptr align 8 %14, i64 16, i1 false), !tbaa.struct !18
  %56 = load float, ptr %32, align 4, !tbaa !11
  %57 = load float, ptr %33, align 4, !tbaa !11
  %58 = load i8, ptr %34, align 1, !tbaa !13, !range !19, !noundef !20
  %59 = trunc i8 %58 to i1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %39, ptr align 4 %35, i64 12, i1 false)
  %60 = getelementptr inbounds { <2 x float>, float }, ptr %39, i32 0, i32 0
  %61 = load <2 x float>, ptr %60, align 4
  %62 = getelementptr inbounds { <2 x float>, float }, ptr %39, i32 0, i32 1
  %63 = load float, ptr %62, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %40, ptr align 4 %36, i64 12, i1 false)
  %64 = getelementptr inbounds { <2 x float>, float }, ptr %40, i32 0, i32 0
  %65 = load <2 x float>, ptr %64, align 4
  %66 = getelementptr inbounds { <2 x float>, float }, ptr %40, i32 0, i32 1
  %67 = load float, ptr %66, align 4
  %68 = load ptr, ptr %46, align 8, !tbaa !21
  %69 = getelementptr inbounds ptr, ptr %68, i64 7
  %70 = load ptr, ptr %69, align 8
  call void %70(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef %47, ptr noundef %48, i32 noundef %49, i32 noundef %50, float noundef %51, float noundef %52, float noundef %53, float noundef %54, <2 x float> %61, float %63, <2 x float> %65, float %67, ptr noundef byval(%class.XMatrix44) align 8 %37, ptr noundef %55, ptr noundef byval(%class.XVector4) align 8 %38, float noundef %56, float noundef %57, i1 noundef zeroext %59)
  ret void
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11}
!16 = !{i64 0, i64 64, !17}
!17 = !{!7, !7, i64 0}
!18 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11, i64 12, i64 4, !11}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !22, i64 0}
!22 = !{!"vtable pointer", !8, 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"

%class.XMatrix44 = type { [4 x [4 x float]] }
%class.XVector4 = type { float, float, float, float }

@s_context = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z16RenderEllipsoidsP13FluidRendererP18FluidRenderBuffersiiffff8XVector3IfES4_9XMatrix44IfEP9ShadowMap8XVector4IfEffb(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, float noundef %4, float noundef %5, float noundef %6, float noundef %7, <2 x float> %8, float %9, <2 x float> %10, float %11, ptr nocapture noundef readonly byval(%class.XMatrix44) align 8 %12, ptr noundef %13, ptr nocapture noundef readonly byval(%class.XVector4) align 8 %14, float noundef %15, float noundef %16, i1 noundef zeroext %17) local_unnamed_addr #0 {
  %19 = load ptr, ptr @s_context, align 8, !tbaa !5
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  %21 = getelementptr inbounds i8, ptr %20, i64 56
  %22 = load ptr, ptr %21, align 8
  tail call void %22(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, float noundef %4, float noundef %5, float noundef %6, float noundef %7, <2 x float> %8, float %9, <2 x float> %10, float %11, ptr noundef nonnull byval(%class.XMatrix44) align 8 %12, ptr noundef %13, ptr noundef nonnull byval(%class.XVector4) align 8 %14, float noundef %15, float noundef %16, i1 noundef zeroext %17)
  ret void
}

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = !{!"vtable pointer", !8, i64 0}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass