; 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 }
%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 @_Z15BindSolidShader8XVector3IfES0_9XMatrix44IfEP9ShadowMapf8XVector4IfE(<2 x float> %0, float %1, <2 x float> %2, float %3, ptr noundef byval(%class.XMatrix44) align 8 %4, ptr noundef %5, float noundef %6, <2 x float> %7, <2 x float> %8) #1 {
  %10 = alloca %class.XVector3, align 4
  %11 = alloca { <2 x float>, float }, align 4
  %12 = alloca %class.XVector3, align 4
  %13 = alloca { <2 x float>, float }, align 4
  %14 = alloca %class.XVector4, align 4
  %15 = alloca ptr, align 8
  %16 = alloca float, align 4
  %17 = alloca %class.XVector3, align 4
  %18 = alloca %class.XVector3, align 4
  %19 = alloca %class.XMatrix44, align 8
  %20 = alloca %class.XVector4, align 4
  %21 = alloca { <2 x float>, float }, align 4
  %22 = alloca { <2 x float>, float }, align 4
  %23 = getelementptr inbounds { <2 x float>, float }, ptr %11, i32 0, i32 0
  store <2 x float> %0, ptr %23, align 4
  %24 = getelementptr inbounds { <2 x float>, float }, ptr %11, i32 0, i32 1
  store float %1, ptr %24, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %11, i64 12, i1 false)
  %25 = getelementptr inbounds { <2 x float>, float }, ptr %13, i32 0, i32 0
  store <2 x float> %2, ptr %25, align 4
  %26 = getelementptr inbounds { <2 x float>, float }, ptr %13, i32 0, i32 1
  store float %3, ptr %26, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %13, i64 12, i1 false)
  %27 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %14, i32 0, i32 0
  store <2 x float> %7, ptr %27, align 4
  %28 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %14, i32 0, i32 1
  store <2 x float> %8, ptr %28, align 4
  store ptr %5, ptr %15, align 8, !tbaa !5
  store float %6, ptr %16, align 4, !tbaa !9
  %29 = load ptr, ptr @s_context, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %10, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %12, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 8 %4, i64 64, i1 false), !tbaa.struct !12
  %30 = load ptr, ptr %15, align 8, !tbaa !5
  %31 = load float, ptr %16, align 4, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %20, ptr align 4 %14, i64 16, i1 false), !tbaa.struct !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %17, i64 12, i1 false)
  %32 = getelementptr inbounds { <2 x float>, float }, ptr %21, i32 0, i32 0
  %33 = load <2 x float>, ptr %32, align 4
  %34 = getelementptr inbounds { <2 x float>, float }, ptr %21, i32 0, i32 1
  %35 = load float, ptr %34, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %18, i64 12, i1 false)
  %36 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 0
  %37 = load <2 x float>, ptr %36, align 4
  %38 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 1
  %39 = load float, ptr %38, align 4
  %40 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %20, i32 0, i32 0
  %41 = load <2 x float>, ptr %40, align 4
  %42 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %20, i32 0, i32 1
  %43 = load <2 x float>, ptr %42, align 4
  %44 = load ptr, ptr %29, align 8, !tbaa !15
  %45 = getelementptr inbounds ptr, ptr %44, i64 16
  %46 = load ptr, ptr %45, align 8
  call void %46(ptr noundef nonnull align 8 dereferenceable(8) %29, <2 x float> %33, float %35, <2 x float> %37, float %39, ptr noundef byval(%class.XMatrix44) align 8 %19, ptr noundef %30, float noundef %31, <2 x float> %41, <2 x float> %43)
  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 = !{!"float", !7, i64 0}
!11 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!12 = !{i64 0, i64 64, !13}
!13 = !{!7, !7, i64 0}
!14 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9}
!15 = !{!16, !16, i64 0}
!16 = !{!"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 @_Z15BindSolidShader8XVector3IfES0_9XMatrix44IfEP9ShadowMapf8XVector4IfE(<2 x float> %0, float %1, <2 x float> %2, float %3, ptr nocapture noundef readonly byval(%class.XMatrix44) align 8 %4, ptr noundef %5, float noundef %6, <2 x float> %7, <2 x float> %8) local_unnamed_addr #0 {
  %10 = load ptr, ptr @s_context, align 8, !tbaa !5
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = getelementptr inbounds i8, ptr %11, i64 128
  %13 = load ptr, ptr %12, align 8
  tail call void %13(ptr noundef nonnull align 8 dereferenceable(8) %10, <2 x float> %0, float %1, <2 x float> %2, float %3, ptr noundef nonnull byval(%class.XMatrix44) align 8 %4, ptr noundef %5, float noundef %6, <2 x float> %7, <2 x float> %8)
  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,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,TailCallElimPass