; LLVM IR from danginsburg/opengles3-book :: Chapter_14/Shadows (Shadows)

; 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.ESContext = type { ptr, ptr, i32, i32, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.UserData = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.ESMatrix, %struct.ESMatrix, %struct.ESMatrix, %struct.ESMatrix, [3 x float], [3 x float] }
%struct.ESMatrix = type { [4 x [4 x float]] }

@__const.Init.vShadowMapShaderStr = external hidden unnamed_addr constant [401 x i8], align 16
@__const.Init.fShadowMapShaderStr = external hidden unnamed_addr constant [251 x i8], align 16
@__const.Init.vSceneShaderStr = external hidden unnamed_addr constant [817 x i8], align 16
@__const.Init.fSceneShaderStr = external hidden unnamed_addr constant [1857 x i8], align 16
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @InitShadowMap(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @Init(ptr noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca [401 x i8], align 16
  %8 = alloca [251 x i8], align 16
  %9 = alloca [817 x i8], align 16
  %10 = alloca [1857 x i8], align 16
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.ESContext, ptr %12, i32 0, i32 1
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  store ptr %14, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 401, ptr %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %7, ptr align 16 @__const.Init.vShadowMapShaderStr, i64 401, i1 false)
  call void @llvm.lifetime.start.p0(i64 251, ptr %8) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 @__const.Init.fShadowMapShaderStr, i64 251, i1 false)
  call void @llvm.lifetime.start.p0(i64 817, ptr %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 @__const.Init.vSceneShaderStr, i64 817, i1 false)
  call void @llvm.lifetime.start.p0(i64 1857, ptr %10) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 @__const.Init.fSceneShaderStr, i64 1857, i1 false)
  %15 = getelementptr inbounds [401 x i8], ptr %7, i64 0, i64 0
  %16 = getelementptr inbounds [251 x i8], ptr %8, i64 0, i64 0
  %17 = call i32 @esLoadProgram(ptr noundef %15, ptr noundef %16)
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.UserData, ptr %18, i32 0, i32 1
  store i32 %17, ptr %19, align 4, !tbaa !13
  %20 = getelementptr inbounds [817 x i8], ptr %9, i64 0, i64 0
  %21 = getelementptr inbounds [1857 x i8], ptr %10, i64 0, i64 0
  %22 = call i32 @esLoadProgram(ptr noundef %20, ptr noundef %21)
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.UserData, ptr %23, i32 0, i32 0
  store i32 %22, ptr %24, align 4, !tbaa !16
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.UserData, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %26, align 4, !tbaa !16
  %28 = call i32 @glGetUniformLocation(i32 noundef %27, ptr noundef @.str)
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.UserData, ptr %29, i32 0, i32 2
  store i32 %28, ptr %30, align 4, !tbaa !17
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.UserData, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 4, !tbaa !13
  %34 = call i32 @glGetUniformLocation(i32 noundef %33, ptr noundef @.str)
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.UserData, ptr %35, i32 0, i32 3
  store i32 %34, ptr %36, align 4, !tbaa !18
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.UserData, ptr %37, i32 0, i32 0
  %39 = load i32, ptr %38, align 4, !tbaa !16
  %40 = call i32 @glGetUniformLocation(i32 noundef %39, ptr noundef @.str.1)
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.UserData, ptr %41, i32 0, i32 4
  store i32 %40, ptr %42, align 4, !tbaa !19
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.UserData, ptr %43, i32 0, i32 1
  %45 = load i32, ptr %44, align 4, !tbaa !13
  %46 = call i32 @glGetUniformLocation(i32 noundef %45, ptr noundef @.str.1)
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.UserData, ptr %47, i32 0, i32 5
  store i32 %46, ptr %48, align 4, !tbaa !20
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.UserData, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 4, !tbaa !16
  %52 = call i32 @glGetUniformLocation(i32 noundef %51, ptr noundef @.str.2)
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.UserData, ptr %53, i32 0, i32 6
  store i32 %52, ptr %54, align 4, !tbaa !21
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.UserData, ptr %55, i32 0, i32 17
  store i32 3, ptr %56, align 4, !tbaa !22
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.UserData, ptr %57, i32 0, i32 17
  %59 = load i32, ptr %58, align 4, !tbaa !22
  %60 = call i32 @esGenSquareGrid(i32 noundef %59, ptr noundef %4, ptr noundef %5)
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.UserData, ptr %61, i32 0, i32 15
  store i32 %60, ptr %62, align 4, !tbaa !23
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.UserData, ptr %63, i32 0, i32 12
  call void @glGenBuffers(i32 noundef 1, ptr noundef %64)
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.UserData, ptr %65, i32 0, i32 12
  %67 = load i32, ptr %66, align 4, !tbaa !24
  call void @glBindBuffer(i32 noundef 34963, i32 noundef %67)
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.UserData, ptr %68, i32 0, i32 15
  %70 = load i32, ptr %69, align 4, !tbaa !23
  %71 = sext i32 %70 to i64
  %72 = mul i64 %71, 4
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  call void @glBufferData(i32 noundef 34963, i64 noundef %72, ptr noundef %73, i32 noundef 35044)
  call void @glBindBuffer(i32 noundef 34963, i32 noundef 0)
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %74) #5
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.UserData, ptr %75, i32 0, i32 11
  call void @glGenBuffers(i32 noundef 1, ptr noundef %76)
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.UserData, ptr %77, i32 0, i32 11
  %79 = load i32, ptr %78, align 4, !tbaa !25
  call void @glBindBuffer(i32 noundef 34962, i32 noundef %79)
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.UserData, ptr %80, i32 0, i32 17
  %82 = load i32, ptr %81, align 4, !tbaa !22
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.UserData, ptr %83, i32 0, i32 17
  %85 = load i32, ptr %84, align 4, !tbaa !22
  %86 = mul nsw i32 %82, %85
  %87 = sext i32 %86 to i64
  %88 = mul i64 %87, 4
  %89 = mul i64 %88, 3
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  call void @glBufferData(i32 noundef 34962, i64 noundef %89, ptr noundef %90, i32 noundef 35044)
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %91) #5
  %92 = call i32 @esGenCube(float noundef 1.000000e+00, ptr noundef %4, ptr noundef null, ptr noundef null, ptr noundef %5)
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.UserData, ptr %93, i32 0, i32 16
  store i32 %92, ptr %94, align 4, !tbaa !26
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.UserData, ptr %95, i32 0, i32 14
  call void @glGenBuffers(i32 noundef 1, ptr noundef %96)
  %97 = load ptr, ptr %6, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.UserData, ptr %97, i32 0, i32 14
  %99 = load i32, ptr %98, align 4, !tbaa !27
  call void @glBindBuffer(i32 noundef 34963, i32 noundef %99)
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.UserData, ptr %100, i32 0, i32 16
  %102 = load i32, ptr %101, align 4, !tbaa !26
  %103 = sext i32 %102 to i64
  %104 = mul i64 4, %103
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  call void @glBufferData(i32 noundef 34963, i64 noundef %104, ptr noundef %105, i32 noundef 35044)
  call void @glBindBuffer(i32 noundef 34963, i32 noundef 0)
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %106) #5
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.UserData, ptr %107, i32 0, i32 13
  call void @glGenBuffers(i32 noundef 1, ptr noundef %108)
  %109 = load ptr, ptr %6, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.UserData, ptr %109, i32 0, i32 13
  %111 = load i32, ptr %110, align 4, !tbaa !28
  call void @glBindBuffer(i32 noundef 34962, i32 noundef %111)
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  call void @glBufferData(i32 noundef 34962, i64 noundef 288, ptr noundef %112, i32 noundef 35044)
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %113) #5
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.UserData, ptr %114, i32 0, i32 22
  %116 = getelementptr inbounds [3 x float], ptr %115, i64 0, i64 0
  store float -5.000000e+00, ptr %116, align 4, !tbaa !29
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.UserData, ptr %117, i32 0, i32 22
  %119 = getelementptr inbounds [3 x float], ptr %118, i64 0, i64 1
  store float 3.000000e+00, ptr %119, align 4, !tbaa !29
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.UserData, ptr %120, i32 0, i32 22
  %122 = getelementptr inbounds [3 x float], ptr %121, i64 0, i64 2
  store float 5.000000e+00, ptr %122, align 4, !tbaa !29
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.UserData, ptr %123, i32 0, i32 23
  %125 = getelementptr inbounds [3 x float], ptr %124, i64 0, i64 0
  store float 1.000000e+01, ptr %125, align 4, !tbaa !29
  %126 = load ptr, ptr %6, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.UserData, ptr %126, i32 0, i32 23
  %128 = getelementptr inbounds [3 x float], ptr %127, i64 0, i64 1
  store float 5.000000e+00, ptr %128, align 4, !tbaa !29
  %129 = load ptr, ptr %6, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.UserData, ptr %129, i32 0, i32 23
  %131 = getelementptr inbounds [3 x float], ptr %130, i64 0, i64 2
  store float 2.000000e+00, ptr %131, align 4, !tbaa !29
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = call i32 @InitShadowMap(ptr noundef %132)
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %136, label %135

135:                                              ; preds = %1
  store i32 0, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %137

136:                                              ; preds = %1
  call void @glClearColor(float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00)
  call void @glDisable(i32 noundef 2884)
  call void @glEnable(i32 noundef 2929)
  store i32 1, ptr %2, align 4
  store i32 1, ptr %11, align 4
  br label %137

137:                                              ; preds = %136, %135
  call void @llvm.lifetime.end.p0(i64 1857, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 817, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 251, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 401, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %138 = load i32, ptr %2, align 4
  ret i32 %138
}

; 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) #2

declare i32 @esLoadProgram(ptr noundef, ptr noundef) #3

declare i32 @glGetUniformLocation(i32 noundef, ptr noundef) #3

declare i32 @esGenSquareGrid(i32 noundef, ptr noundef, ptr noundef) #3

declare void @glGenBuffers(i32 noundef, ptr noundef) #3

declare void @glBindBuffer(i32 noundef, i32 noundef) #3

declare void @glBufferData(i32 noundef, i64 noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

declare i32 @esGenCube(float noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare void @glClearColor(float noundef, float noundef, float noundef, float noundef) #3

declare void @glDisable(i32 noundef) #3

declare void @glEnable(i32 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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" }
attributes #4 = { nounwind "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" }
attributes #5 = { nounwind }

!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/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"ESContext", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24, !12, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !11, i64 4}
!14 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !15, i64 72, !15, i64 136, !15, i64 200, !15, i64 264, !7, i64 328, !7, i64 340}
!15 = !{!"", !7, i64 0}
!16 = !{!14, !11, i64 0}
!17 = !{!14, !11, i64 8}
!18 = !{!14, !11, i64 12}
!19 = !{!14, !11, i64 16}
!20 = !{!14, !11, i64 20}
!21 = !{!14, !11, i64 24}
!22 = !{!14, !11, i64 68}
!23 = !{!14, !11, i64 60}
!24 = !{!14, !11, i64 48}
!25 = !{!14, !11, i64 44}
!26 = !{!14, !11, i64 64}
!27 = !{!14, !11, i64 56}
!28 = !{!14, !11, i64 52}
!29 = !{!30, !30, i64 0}
!30 = !{!"float", !7, 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"

@__const.Init.vShadowMapShaderStr = external hidden unnamed_addr constant [401 x i8], align 16
@__const.Init.fShadowMapShaderStr = external hidden unnamed_addr constant [251 x i8], align 16
@__const.Init.vSceneShaderStr = external hidden unnamed_addr constant [817 x i8], align 16
@__const.Init.fSceneShaderStr = external hidden unnamed_addr constant [1857 x i8], align 16
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @InitShadowMap(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @Init(ptr noundef %0) local_unnamed_addr #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [401 x i8], align 16
  %5 = alloca [251 x i8], align 16
  %6 = alloca [817 x i8], align 16
  %7 = alloca [1857 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 401, ptr nonnull %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(401) %4, ptr noundef nonnull align 16 dereferenceable(401) @__const.Init.vShadowMapShaderStr, i64 401, i1 false)
  call void @llvm.lifetime.start.p0(i64 251, ptr nonnull %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(251) %5, ptr noundef nonnull align 16 dereferenceable(251) @__const.Init.fShadowMapShaderStr, i64 251, i1 false)
  call void @llvm.lifetime.start.p0(i64 817, ptr nonnull %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(817) %6, ptr noundef nonnull align 16 dereferenceable(817) @__const.Init.vSceneShaderStr, i64 817, i1 false)
  call void @llvm.lifetime.start.p0(i64 1857, ptr nonnull %7) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1857) %7, ptr noundef nonnull align 16 dereferenceable(1857) @__const.Init.fSceneShaderStr, i64 1857, i1 false)
  %10 = call i32 @esLoadProgram(ptr noundef nonnull %4, ptr noundef nonnull %5) #5
  %11 = getelementptr inbounds i8, ptr %9, i64 4
  store i32 %10, ptr %11, align 4, !tbaa !12
  %12 = call i32 @esLoadProgram(ptr noundef nonnull %6, ptr noundef nonnull %7) #5
  store i32 %12, ptr %9, align 4, !tbaa !15
  %13 = call i32 @glGetUniformLocation(i32 noundef %12, ptr noundef nonnull @.str) #5
  %14 = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %13, ptr %14, align 4, !tbaa !16
  %15 = load i32, ptr %11, align 4, !tbaa !12
  %16 = call i32 @glGetUniformLocation(i32 noundef %15, ptr noundef nonnull @.str) #5
  %17 = getelementptr inbounds i8, ptr %9, i64 12
  store i32 %16, ptr %17, align 4, !tbaa !17
  %18 = load i32, ptr %9, align 4, !tbaa !15
  %19 = call i32 @glGetUniformLocation(i32 noundef %18, ptr noundef nonnull @.str.1) #5
  %20 = getelementptr inbounds i8, ptr %9, i64 16
  store i32 %19, ptr %20, align 4, !tbaa !18
  %21 = load i32, ptr %11, align 4, !tbaa !12
  %22 = call i32 @glGetUniformLocation(i32 noundef %21, ptr noundef nonnull @.str.1) #5
  %23 = getelementptr inbounds i8, ptr %9, i64 20
  store i32 %22, ptr %23, align 4, !tbaa !19
  %24 = load i32, ptr %9, align 4, !tbaa !15
  %25 = call i32 @glGetUniformLocation(i32 noundef %24, ptr noundef nonnull @.str.2) #5
  %26 = getelementptr inbounds i8, ptr %9, i64 24
  store i32 %25, ptr %26, align 4, !tbaa !20
  %27 = getelementptr inbounds i8, ptr %9, i64 68
  store i32 3, ptr %27, align 4, !tbaa !21
  %28 = call i32 @esGenSquareGrid(i32 noundef 3, ptr noundef nonnull %2, ptr noundef nonnull %3) #5
  %29 = getelementptr inbounds i8, ptr %9, i64 60
  store i32 %28, ptr %29, align 4, !tbaa !22
  %30 = getelementptr inbounds i8, ptr %9, i64 48
  call void @glGenBuffers(i32 noundef 1, ptr noundef nonnull %30) #5
  %31 = load i32, ptr %30, align 4, !tbaa !23
  call void @glBindBuffer(i32 noundef 34963, i32 noundef %31) #5
  %32 = load i32, ptr %29, align 4, !tbaa !22
  %33 = sext i32 %32 to i64
  %34 = shl nsw i64 %33, 2
  %35 = load ptr, ptr %3, align 8, !tbaa !24
  call void @glBufferData(i32 noundef 34963, i64 noundef %34, ptr noundef %35, i32 noundef 35044) #5
  call void @glBindBuffer(i32 noundef 34963, i32 noundef 0) #5
  %36 = load ptr, ptr %3, align 8, !tbaa !24
  call void @free(ptr noundef %36) #5
  %37 = getelementptr inbounds i8, ptr %9, i64 44
  call void @glGenBuffers(i32 noundef 1, ptr noundef nonnull %37) #5
  %38 = load i32, ptr %37, align 4, !tbaa !25
  call void @glBindBuffer(i32 noundef 34962, i32 noundef %38) #5
  %39 = load i32, ptr %27, align 4, !tbaa !21
  %40 = mul nsw i32 %39, %39
  %41 = zext nneg i32 %40 to i64
  %42 = mul nuw nsw i64 %41, 12
  %43 = load ptr, ptr %2, align 8, !tbaa !24
  call void @glBufferData(i32 noundef 34962, i64 noundef %42, ptr noundef %43, i32 noundef 35044) #5
  %44 = load ptr, ptr %2, align 8, !tbaa !24
  call void @free(ptr noundef %44) #5
  %45 = call i32 @esGenCube(float noundef 1.000000e+00, ptr noundef nonnull %2, ptr noundef null, ptr noundef null, ptr noundef nonnull %3) #5
  %46 = getelementptr inbounds i8, ptr %9, i64 64
  store i32 %45, ptr %46, align 4, !tbaa !26
  %47 = getelementptr inbounds i8, ptr %9, i64 56
  call void @glGenBuffers(i32 noundef 1, ptr noundef nonnull %47) #5
  %48 = load i32, ptr %47, align 4, !tbaa !27
  call void @glBindBuffer(i32 noundef 34963, i32 noundef %48) #5
  %49 = load i32, ptr %46, align 4, !tbaa !26
  %50 = sext i32 %49 to i64
  %51 = shl nsw i64 %50, 2
  %52 = load ptr, ptr %3, align 8, !tbaa !24
  call void @glBufferData(i32 noundef 34963, i64 noundef %51, ptr noundef %52, i32 noundef 35044) #5
  call void @glBindBuffer(i32 noundef 34963, i32 noundef 0) #5
  %53 = load ptr, ptr %3, align 8, !tbaa !24
  call void @free(ptr noundef %53) #5
  %54 = getelementptr inbounds i8, ptr %9, i64 52
  call void @glGenBuffers(i32 noundef 1, ptr noundef nonnull %54) #5
  %55 = load i32, ptr %54, align 4, !tbaa !28
  call void @glBindBuffer(i32 noundef 34962, i32 noundef %55) #5
  %56 = load ptr, ptr %2, align 8, !tbaa !24
  call void @glBufferData(i32 noundef 34962, i64 noundef 288, ptr noundef %56, i32 noundef 35044) #5
  %57 = load ptr, ptr %2, align 8, !tbaa !24
  call void @free(ptr noundef %57) #5
  %58 = getelementptr inbounds i8, ptr %9, i64 328
  store <4 x float> <float -5.000000e+00, float 3.000000e+00, float 5.000000e+00, float 1.000000e+01>, ptr %58, align 4, !tbaa !29
  %59 = getelementptr inbounds i8, ptr %9, i64 344
  store <2 x float> <float 5.000000e+00, float 2.000000e+00>, ptr %59, align 4, !tbaa !29
  %60 = call i32 @InitShadowMap(ptr noundef %0)
  %.not = icmp eq i32 %60, 0
  br i1 %.not, label %62, label %61

61:                                               ; preds = %1
  call void @glClearColor(float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00) #5
  call void @glDisable(i32 noundef 2884) #5
  call void @glEnable(i32 noundef 2929) #5
  br label %62

62:                                               ; preds = %1, %61
  %.0 = phi i32 [ 1, %61 ], [ 0, %1 ]
  call void @llvm.lifetime.end.p0(i64 1857, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 817, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 251, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 401, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  ret i32 %.0
}

; Function Attrs: mustprogress 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) #2

declare i32 @esLoadProgram(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @glGetUniformLocation(i32 noundef, ptr noundef) local_unnamed_addr #3

declare i32 @esGenSquareGrid(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @glGenBuffers(i32 noundef, ptr noundef) local_unnamed_addr #3

declare void @glBindBuffer(i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @glBufferData(i32 noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

declare i32 @esGenCube(float noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @glClearColor(float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #3

declare void @glDisable(i32 noundef) local_unnamed_addr #3

declare void @glEnable(i32 noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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" }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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" }
attributes #5 = { nounwind }

!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, !7, i64 8}
!6 = !{!"ESContext", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !7, i64 24, !11, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!13, !10, i64 4}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !14, i64 72, !14, i64 136, !14, i64 200, !14, i64 264, !8, i64 328, !8, i64 340}
!14 = !{!"", !8, i64 0}
!15 = !{!13, !10, i64 0}
!16 = !{!13, !10, i64 8}
!17 = !{!13, !10, i64 12}
!18 = !{!13, !10, i64 16}
!19 = !{!13, !10, i64 20}
!20 = !{!13, !10, i64 24}
!21 = !{!13, !10, i64 68}
!22 = !{!13, !10, i64 60}
!23 = !{!13, !10, i64 48}
!24 = !{!7, !7, i64 0}
!25 = !{!13, !10, i64 44}
!26 = !{!13, !10, i64 64}
!27 = !{!13, !10, i64 56}
!28 = !{!13, !10, i64 52}
!29 = !{!30, !30, i64 0}
!30 = !{!"float", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass