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