; 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.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 @_Z10DrawPointsP18FluidRenderBuffersiiffff8XVector3IfES2_9XMatrix44IfEP9ShadowMapb(ptr noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6, <2 x float> %7, float %8, <2 x float> %9, float %10, ptr noundef byval(%class.XMatrix44) align 8 %11, ptr noundef %12, i1 noundef zeroext %13) #1 {
  %15 = alloca %class.XVector3, align 4
  %16 = alloca { <2 x float>, float }, align 4
  %17 = alloca %class.XVector3, align 4
  %18 = alloca { <2 x float>, float }, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca ptr, align 8
  %27 = alloca i8, align 1
  %28 = alloca %class.XVector3, align 4
  %29 = alloca %class.XVector3, align 4
  %30 = alloca %class.XMatrix44, align 8
  %31 = alloca { <2 x float>, float }, align 4
  %32 = alloca { <2 x float>, float }, align 4
  %33 = getelementptr inbounds { <2 x float>, float }, ptr %16, i32 0, i32 0
  store <2 x float> %7, ptr %33, align 4
  %34 = getelementptr inbounds { <2 x float>, float }, ptr %16, i32 0, i32 1
  store float %8, ptr %34, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %16, i64 12, i1 false)
  %35 = getelementptr inbounds { <2 x float>, float }, ptr %18, i32 0, i32 0
  store <2 x float> %9, ptr %35, align 4
  %36 = getelementptr inbounds { <2 x float>, float }, ptr %18, i32 0, i32 1
  store float %10, ptr %36, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %18, i64 12, i1 false)
  store ptr %0, ptr %19, align 8, !tbaa !5
  store i32 %1, ptr %20, align 4, !tbaa !9
  store i32 %2, ptr %21, align 4, !tbaa !9
  store float %3, ptr %22, align 4, !tbaa !11
  store float %4, ptr %23, align 4, !tbaa !11
  store float %5, ptr %24, align 4, !tbaa !11
  store float %6, ptr %25, align 4, !tbaa !11
  store ptr %12, ptr %26, align 8, !tbaa !5
  %37 = zext i1 %13 to i8
  store i8 %37, ptr %27, align 1, !tbaa !13
  %38 = load ptr, ptr @s_context, align 8, !tbaa !5
  %39 = load ptr, ptr %19, align 8, !tbaa !5
  %40 = load i32, ptr %20, align 4, !tbaa !9
  %41 = load i32, ptr %21, align 4, !tbaa !9
  %42 = load float, ptr %22, align 4, !tbaa !11
  %43 = load float, ptr %23, align 4, !tbaa !11
  %44 = load float, ptr %24, align 4, !tbaa !11
  %45 = load float, ptr %25, align 4, !tbaa !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %15, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 8 %11, i64 64, i1 false), !tbaa.struct !16
  %46 = load ptr, ptr %26, align 8, !tbaa !5
  %47 = load i8, ptr %27, align 1, !tbaa !13, !range !18, !noundef !19
  %48 = trunc i8 %47 to i1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %28, i64 12, i1 false)
  %49 = getelementptr inbounds { <2 x float>, float }, ptr %31, i32 0, i32 0
  %50 = load <2 x float>, ptr %49, align 4
  %51 = getelementptr inbounds { <2 x float>, float }, ptr %31, i32 0, i32 1
  %52 = load float, ptr %51, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %29, i64 12, i1 false)
  %53 = getelementptr inbounds { <2 x float>, float }, ptr %32, i32 0, i32 0
  %54 = load <2 x float>, ptr %53, align 4
  %55 = getelementptr inbounds { <2 x float>, float }, ptr %32, i32 0, i32 1
  %56 = load float, ptr %55, align 4
  %57 = load ptr, ptr %38, align 8, !tbaa !20
  %58 = getelementptr inbounds ptr, ptr %57, i64 25
  %59 = load ptr, ptr %58, align 8
  call void %59(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef %39, i32 noundef %40, i32 noundef %41, float noundef %42, float noundef %43, float noundef %44, float noundef %45, <2 x float> %50, float %52, <2 x float> %54, float %56, ptr noundef byval(%class.XMatrix44) align 8 %30, ptr noundef %46, i1 noundef zeroext %48)
  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 = !{i8 0, i8 2}
!19 = !{}
!20 = !{!21, !21, i64 0}
!21 = !{!"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]] }

@s_context = external dso_local local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z10DrawPointsP18FluidRenderBuffersiiffff8XVector3IfES2_9XMatrix44IfEP9ShadowMapb(ptr noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6, <2 x float> %7, float %8, <2 x float> %9, float %10, ptr nocapture noundef readonly byval(%class.XMatrix44) align 8 %11, ptr noundef %12, i1 noundef zeroext %13) local_unnamed_addr #0 {
  %15 = load ptr, ptr @s_context, align 8, !tbaa !5
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %16, i64 200
  %18 = load ptr, ptr %17, align 8
  tail call void %18(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %0, i32 noundef %1, i32 noundef %2, float noundef %3, float noundef %4, float noundef %5, float noundef %6, <2 x float> %7, float %8, <2 x float> %9, float %10, ptr noundef nonnull byval(%class.XMatrix44) align 8 %11, ptr noundef %12, i1 noundef zeroext %13)
  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