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

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

; Function Attrs: nounwind uwtable
declare dso_local void @initNoiseTable() #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @noise3D(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @Create3DNoiseTexture(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca float, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca [3 x float], align 4
  %17 = alloca float, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ESContext, ptr %18, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !9
  store ptr %20, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 64, ptr %4, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store float 5.000000e+00, ptr %5, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %21 = load i32, ptr %4, align 4, !tbaa !13
  %22 = sext i32 %21 to i64
  %23 = mul i64 4, %22
  %24 = load i32, ptr %4, align 4, !tbaa !13
  %25 = sext i32 %24 to i64
  %26 = mul i64 %23, %25
  %27 = load i32, ptr %4, align 4, !tbaa !13
  %28 = sext i32 %27 to i64
  %29 = mul i64 %26, %28
  %30 = call noalias ptr @malloc(i64 noundef %29) #6
  store ptr %30, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %31 = load i32, ptr %4, align 4, !tbaa !13
  %32 = sext i32 %31 to i64
  %33 = mul i64 1, %32
  %34 = load i32, ptr %4, align 4, !tbaa !13
  %35 = sext i32 %34 to i64
  %36 = mul i64 %33, %35
  %37 = load i32, ptr %4, align 4, !tbaa !13
  %38 = sext i32 %37 to i64
  %39 = mul i64 %36, %38
  %40 = call noalias ptr @malloc(i64 noundef %39) #6
  store ptr %40, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store float 1.000000e+03, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store float -1.000000e+03, ptr %13, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @initNoiseTable()
  store i32 0, ptr %10, align 4, !tbaa !13
  br label %41

41:                                               ; preds = %113, %1
  %42 = load i32, ptr %10, align 4, !tbaa !13
  %43 = load i32, ptr %4, align 4, !tbaa !13
  %44 = icmp slt i32 %42, %43
  br i1 %44, label %45, label %116

45:                                               ; preds = %41
  store i32 0, ptr %9, align 4, !tbaa !13
  br label %46

46:                                               ; preds = %109, %45
  %47 = load i32, ptr %9, align 4, !tbaa !13
  %48 = load i32, ptr %4, align 4, !tbaa !13
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %50, label %112

50:                                               ; preds = %46
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %51

51:                                               ; preds = %105, %50
  %52 = load i32, ptr %8, align 4, !tbaa !13
  %53 = load i32, ptr %4, align 4, !tbaa !13
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %55, label %108

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #5
  %56 = load i32, ptr %8, align 4, !tbaa !13
  %57 = sitofp i32 %56 to float
  %58 = load i32, ptr %4, align 4, !tbaa !13
  %59 = sitofp i32 %58 to float
  %60 = fdiv float %57, %59
  store float %60, ptr %16, align 4, !tbaa !14
  %61 = getelementptr inbounds float, ptr %16, i64 1
  %62 = load i32, ptr %9, align 4, !tbaa !13
  %63 = sitofp i32 %62 to float
  %64 = load i32, ptr %4, align 4, !tbaa !13
  %65 = sitofp i32 %64 to float
  %66 = fdiv float %63, %65
  store float %66, ptr %61, align 4, !tbaa !14
  %67 = getelementptr inbounds float, ptr %16, i64 2
  %68 = load i32, ptr %10, align 4, !tbaa !13
  %69 = sitofp i32 %68 to float
  %70 = load i32, ptr %4, align 4, !tbaa !13
  %71 = sitofp i32 %70 to float
  %72 = fdiv float %69, %71
  store float %72, ptr %67, align 4, !tbaa !14
  %73 = load float, ptr %5, align 4, !tbaa !14
  %74 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 0
  %75 = load float, ptr %74, align 4, !tbaa !14
  %76 = fmul float %75, %73
  store float %76, ptr %74, align 4, !tbaa !14
  %77 = load float, ptr %5, align 4, !tbaa !14
  %78 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 1
  %79 = load float, ptr %78, align 4, !tbaa !14
  %80 = fmul float %79, %77
  store float %80, ptr %78, align 4, !tbaa !14
  %81 = load float, ptr %5, align 4, !tbaa !14
  %82 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 2
  %83 = load float, ptr %82, align 4, !tbaa !14
  %84 = fmul float %83, %81
  store float %84, ptr %82, align 4, !tbaa !14
  %85 = getelementptr inbounds [3 x float], ptr %16, i64 0, i64 0
  %86 = call float @noise3D(ptr noundef %85)
  store float %86, ptr %15, align 4, !tbaa !14
  %87 = load float, ptr %15, align 4, !tbaa !14
  %88 = load float, ptr %12, align 4, !tbaa !14
  %89 = fcmp olt float %87, %88
  br i1 %89, label %90, label %92

90:                                               ; preds = %55
  %91 = load float, ptr %15, align 4, !tbaa !14
  store float %91, ptr %12, align 4, !tbaa !14
  br label %92

92:                                               ; preds = %90, %55
  %93 = load float, ptr %15, align 4, !tbaa !14
  %94 = load float, ptr %13, align 4, !tbaa !14
  %95 = fcmp ogt float %93, %94
  br i1 %95, label %96, label %98

96:                                               ; preds = %92
  %97 = load float, ptr %15, align 4, !tbaa !14
  store float %97, ptr %13, align 4, !tbaa !14
  br label %98

98:                                               ; preds = %96, %92
  %99 = load float, ptr %15, align 4, !tbaa !14
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  %101 = load i32, ptr %11, align 4, !tbaa !13
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %11, align 4, !tbaa !13
  %103 = sext i32 %101 to i64
  %104 = getelementptr inbounds float, ptr %100, i64 %103
  store float %99, ptr %104, align 4, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %105

105:                                              ; preds = %98
  %106 = load i32, ptr %8, align 4, !tbaa !13
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %8, align 4, !tbaa !13
  br label %51, !llvm.loop !16

108:                                              ; preds = %51
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %9, align 4, !tbaa !13
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !13
  br label %46, !llvm.loop !18

112:                                              ; preds = %46
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %10, align 4, !tbaa !13
  %115 = add nsw i32 %114, 1
  store i32 %115, ptr %10, align 4, !tbaa !13
  br label %41, !llvm.loop !19

116:                                              ; preds = %41
  %117 = load float, ptr %13, align 4, !tbaa !14
  %118 = load float, ptr %12, align 4, !tbaa !14
  %119 = fsub float %117, %118
  store float %119, ptr %14, align 4, !tbaa !14
  store i32 0, ptr %11, align 4, !tbaa !13
  store i32 0, ptr %10, align 4, !tbaa !13
  br label %120

120:                                              ; preds = %161, %116
  %121 = load i32, ptr %10, align 4, !tbaa !13
  %122 = load i32, ptr %4, align 4, !tbaa !13
  %123 = icmp slt i32 %121, %122
  br i1 %123, label %124, label %164

124:                                              ; preds = %120
  store i32 0, ptr %9, align 4, !tbaa !13
  br label %125

125:                                              ; preds = %157, %124
  %126 = load i32, ptr %9, align 4, !tbaa !13
  %127 = load i32, ptr %4, align 4, !tbaa !13
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %129, label %160

129:                                              ; preds = %125
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %130

130:                                              ; preds = %153, %129
  %131 = load i32, ptr %8, align 4, !tbaa !13
  %132 = load i32, ptr %4, align 4, !tbaa !13
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %156

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  %136 = load i32, ptr %11, align 4, !tbaa !13
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds float, ptr %135, i64 %137
  %139 = load float, ptr %138, align 4, !tbaa !14
  store float %139, ptr %17, align 4, !tbaa !14
  %140 = load float, ptr %17, align 4, !tbaa !14
  %141 = load float, ptr %12, align 4, !tbaa !14
  %142 = fsub float %140, %141
  %143 = load float, ptr %14, align 4, !tbaa !14
  %144 = fdiv float %142, %143
  store float %144, ptr %17, align 4, !tbaa !14
  %145 = load float, ptr %17, align 4, !tbaa !14
  %146 = fmul float %145, 2.550000e+02
  %147 = fptoui float %146 to i8
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = load i32, ptr %11, align 4, !tbaa !13
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %11, align 4, !tbaa !13
  %151 = sext i32 %149 to i64
  %152 = getelementptr inbounds i8, ptr %148, i64 %151
  store i8 %147, ptr %152, align 1, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %153

153:                                              ; preds = %134
  %154 = load i32, ptr %8, align 4, !tbaa !13
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %8, align 4, !tbaa !13
  br label %130, !llvm.loop !21

156:                                              ; preds = %130
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %9, align 4, !tbaa !13
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %9, align 4, !tbaa !13
  br label %125, !llvm.loop !22

160:                                              ; preds = %125
  br label %161

161:                                              ; preds = %160
  %162 = load i32, ptr %10, align 4, !tbaa !13
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %10, align 4, !tbaa !13
  br label %120, !llvm.loop !23

164:                                              ; preds = %120
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.UserData, ptr %165, i32 0, i32 16
  call void @glGenTextures(i32 noundef 1, ptr noundef %166)
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.UserData, ptr %167, i32 0, i32 16
  %169 = load i32, ptr %168, align 4, !tbaa !24
  call void @glBindTexture(i32 noundef 32879, i32 noundef %169)
  %170 = load i32, ptr %4, align 4, !tbaa !13
  %171 = load i32, ptr %4, align 4, !tbaa !13
  %172 = load i32, ptr %4, align 4, !tbaa !13
  %173 = load ptr, ptr %7, align 8, !tbaa !5
  call void @glTexImage3D(i32 noundef 32879, i32 noundef 0, i32 noundef 33321, i32 noundef %170, i32 noundef %171, i32 noundef %172, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef %173)
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 10241, i32 noundef 9729)
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 10240, i32 noundef 9729)
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 10242, i32 noundef 33648)
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 10243, i32 noundef 33648)
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 32882, i32 noundef 33648)
  call void @glBindTexture(i32 noundef 32879, i32 noundef 0)
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  call void @free(ptr noundef %174) #5
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %175) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void
}

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

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

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

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

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

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

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

!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 = !{!11, !11, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = !{!7, !7, i64 0}
!21 = distinct !{!21, !17}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}
!24 = !{!25, !11, i64 196}
!25 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56, !15, i64 60, !26, i64 64, !26, i64 128, !15, i64 192, !11, i64 196}
!26 = !{!"", !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"

; Function Attrs: nounwind uwtable
declare dso_local void @initNoiseTable() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @noise3D(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @Create3DNoiseTexture(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca [3 x float], align 4
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call noalias dereferenceable_or_null(1048576) ptr @malloc(i64 noundef 1048576) #5
  %6 = tail call noalias dereferenceable_or_null(262144) ptr @malloc(i64 noundef 262144) #5
  tail call void @initNoiseTable()
  %7 = getelementptr inbounds i8, ptr %2, i64 4
  %8 = getelementptr inbounds i8, ptr %2, i64 8
  br label %.preheader78

.preheader78:                                     ; preds = %1, %27
  %.06290 = phi i32 [ 0, %1 ], [ %28, %27 ]
  %.06489 = phi float [ -1.000000e+03, %1 ], [ %.3, %27 ]
  %.06688 = phi float [ 1.000000e+03, %1 ], [ %.369, %27 ]
  %.07087 = phi i64 [ 0, %1 ], [ %indvars.iv.next, %27 ]
  %9 = uitofp nneg i32 %.06290 to float
  %10 = fmul float %9, 1.562500e-02
  %11 = fmul float %10, 5.000000e+00
  br label %.preheader77

.preheader77:                                     ; preds = %.preheader78, %25
  %.06086 = phi i32 [ 0, %.preheader78 ], [ %26, %25 ]
  %.16585 = phi float [ %.06489, %.preheader78 ], [ %.3, %25 ]
  %.16784 = phi float [ %.06688, %.preheader78 ], [ %.369, %25 ]
  %.17183 = phi i64 [ %.07087, %.preheader78 ], [ %indvars.iv.next, %25 ]
  %12 = uitofp nneg i32 %.06086 to float
  %13 = fmul float %12, 1.562500e-02
  %14 = fmul float %13, 5.000000e+00
  %sext = shl i64 %.17183, 32
  %15 = ashr exact i64 %sext, 32
  br label %16

16:                                               ; preds = %.preheader77, %16
  %indvars.iv = phi i64 [ %15, %.preheader77 ], [ %indvars.iv.next, %16 ]
  %.082 = phi i32 [ 0, %.preheader77 ], [ %24, %16 ]
  %.281 = phi float [ %.16585, %.preheader77 ], [ %.3, %16 ]
  %.26880 = phi float [ %.16784, %.preheader77 ], [ %.369, %16 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %2) #6
  %17 = uitofp nneg i32 %.082 to float
  %18 = fmul float %17, 1.562500e-02
  %19 = fmul float %18, 5.000000e+00
  store float %19, ptr %2, align 4, !tbaa !12
  store float %14, ptr %7, align 4, !tbaa !12
  store float %11, ptr %8, align 4, !tbaa !12
  %20 = call float @noise3D(ptr noundef nonnull %2)
  %21 = fcmp olt float %20, %.26880
  %.369 = select i1 %21, float %20, float %.26880
  %22 = fcmp ogt float %20, %.281
  %.3 = select i1 %22, float %20, float %.281
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %23 = getelementptr inbounds float, ptr %5, i64 %indvars.iv
  store float %20, ptr %23, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %2) #6
  %24 = add nuw nsw i32 %.082, 1
  %exitcond.not = icmp eq i32 %24, 64
  br i1 %exitcond.not, label %25, label %16, !llvm.loop !14

25:                                               ; preds = %16
  %26 = add nuw nsw i32 %.06086, 1
  %exitcond99.not = icmp eq i32 %26, 64
  br i1 %exitcond99.not, label %27, label %.preheader77, !llvm.loop !16

27:                                               ; preds = %25
  %28 = add nuw nsw i32 %.06290, 1
  %exitcond100.not = icmp eq i32 %28, 64
  br i1 %exitcond100.not, label %29, label %.preheader78, !llvm.loop !17

29:                                               ; preds = %27
  %30 = fsub float %.3, %.369
  %broadcast.splatinsert109 = insertelement <4 x float> poison, float %30, i64 0
  %broadcast.splat110 = shufflevector <4 x float> %broadcast.splatinsert109, <4 x float> poison, <4 x i32> zeroinitializer
  %broadcast.splatinsert = insertelement <4 x float> poison, float %.369, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  br label %.preheader76

.preheader76:                                     ; preds = %29, %129
  %.16396 = phi i32 [ 0, %29 ], [ %130, %129 ]
  %.37395 = phi i64 [ 0, %29 ], [ %ind.end, %129 ]
  br label %.preheader

.preheader:                                       ; preds = %.preheader76, %.preheader
  %.16194 = phi i32 [ 0, %.preheader76 ], [ %128, %.preheader ]
  %.493 = phi i64 [ %.37395, %.preheader76 ], [ %ind.end, %.preheader ]
  %sext107 = shl i64 %.493, 32
  %31 = ashr exact i64 %sext107, 32
  %ind.end = add nsw i64 %31, 64
  %32 = getelementptr inbounds float, ptr %5, i64 %31
  %wide.load = load <4 x float>, ptr %32, align 4, !tbaa !12
  %33 = fsub <4 x float> %wide.load, %broadcast.splat
  %34 = fdiv <4 x float> %33, %broadcast.splat110
  %35 = fmul <4 x float> %34, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %36 = fptoui <4 x float> %35 to <4 x i8>
  %37 = getelementptr inbounds i8, ptr %6, i64 %31
  store <4 x i8> %36, ptr %37, align 1, !tbaa !18
  %offset.idx.1 = add nsw i64 %31, 4
  %38 = getelementptr inbounds float, ptr %5, i64 %offset.idx.1
  %wide.load.1 = load <4 x float>, ptr %38, align 4, !tbaa !12
  %39 = fsub <4 x float> %wide.load.1, %broadcast.splat
  %40 = fdiv <4 x float> %39, %broadcast.splat110
  %41 = fmul <4 x float> %40, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %42 = fptoui <4 x float> %41 to <4 x i8>
  %43 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.1
  store <4 x i8> %42, ptr %43, align 1, !tbaa !18
  %offset.idx.2 = add nsw i64 %31, 8
  %44 = getelementptr inbounds float, ptr %5, i64 %offset.idx.2
  %wide.load.2 = load <4 x float>, ptr %44, align 4, !tbaa !12
  %45 = fsub <4 x float> %wide.load.2, %broadcast.splat
  %46 = fdiv <4 x float> %45, %broadcast.splat110
  %47 = fmul <4 x float> %46, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %48 = fptoui <4 x float> %47 to <4 x i8>
  %49 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.2
  store <4 x i8> %48, ptr %49, align 1, !tbaa !18
  %offset.idx.3 = add nsw i64 %31, 12
  %50 = getelementptr inbounds float, ptr %5, i64 %offset.idx.3
  %wide.load.3 = load <4 x float>, ptr %50, align 4, !tbaa !12
  %51 = fsub <4 x float> %wide.load.3, %broadcast.splat
  %52 = fdiv <4 x float> %51, %broadcast.splat110
  %53 = fmul <4 x float> %52, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %54 = fptoui <4 x float> %53 to <4 x i8>
  %55 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.3
  store <4 x i8> %54, ptr %55, align 1, !tbaa !18
  %offset.idx.4 = add nsw i64 %31, 16
  %56 = getelementptr inbounds float, ptr %5, i64 %offset.idx.4
  %wide.load.4 = load <4 x float>, ptr %56, align 4, !tbaa !12
  %57 = fsub <4 x float> %wide.load.4, %broadcast.splat
  %58 = fdiv <4 x float> %57, %broadcast.splat110
  %59 = fmul <4 x float> %58, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %60 = fptoui <4 x float> %59 to <4 x i8>
  %61 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.4
  store <4 x i8> %60, ptr %61, align 1, !tbaa !18
  %offset.idx.5 = add nsw i64 %31, 20
  %62 = getelementptr inbounds float, ptr %5, i64 %offset.idx.5
  %wide.load.5 = load <4 x float>, ptr %62, align 4, !tbaa !12
  %63 = fsub <4 x float> %wide.load.5, %broadcast.splat
  %64 = fdiv <4 x float> %63, %broadcast.splat110
  %65 = fmul <4 x float> %64, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %66 = fptoui <4 x float> %65 to <4 x i8>
  %67 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.5
  store <4 x i8> %66, ptr %67, align 1, !tbaa !18
  %offset.idx.6 = add nsw i64 %31, 24
  %68 = getelementptr inbounds float, ptr %5, i64 %offset.idx.6
  %wide.load.6 = load <4 x float>, ptr %68, align 4, !tbaa !12
  %69 = fsub <4 x float> %wide.load.6, %broadcast.splat
  %70 = fdiv <4 x float> %69, %broadcast.splat110
  %71 = fmul <4 x float> %70, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %72 = fptoui <4 x float> %71 to <4 x i8>
  %73 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.6
  store <4 x i8> %72, ptr %73, align 1, !tbaa !18
  %offset.idx.7 = add nsw i64 %31, 28
  %74 = getelementptr inbounds float, ptr %5, i64 %offset.idx.7
  %wide.load.7 = load <4 x float>, ptr %74, align 4, !tbaa !12
  %75 = fsub <4 x float> %wide.load.7, %broadcast.splat
  %76 = fdiv <4 x float> %75, %broadcast.splat110
  %77 = fmul <4 x float> %76, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %78 = fptoui <4 x float> %77 to <4 x i8>
  %79 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.7
  store <4 x i8> %78, ptr %79, align 1, !tbaa !18
  %offset.idx.8 = add nsw i64 %31, 32
  %80 = getelementptr inbounds float, ptr %5, i64 %offset.idx.8
  %wide.load.8 = load <4 x float>, ptr %80, align 4, !tbaa !12
  %81 = fsub <4 x float> %wide.load.8, %broadcast.splat
  %82 = fdiv <4 x float> %81, %broadcast.splat110
  %83 = fmul <4 x float> %82, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %84 = fptoui <4 x float> %83 to <4 x i8>
  %85 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.8
  store <4 x i8> %84, ptr %85, align 1, !tbaa !18
  %offset.idx.9 = add nsw i64 %31, 36
  %86 = getelementptr inbounds float, ptr %5, i64 %offset.idx.9
  %wide.load.9 = load <4 x float>, ptr %86, align 4, !tbaa !12
  %87 = fsub <4 x float> %wide.load.9, %broadcast.splat
  %88 = fdiv <4 x float> %87, %broadcast.splat110
  %89 = fmul <4 x float> %88, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %90 = fptoui <4 x float> %89 to <4 x i8>
  %91 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.9
  store <4 x i8> %90, ptr %91, align 1, !tbaa !18
  %offset.idx.10 = add nsw i64 %31, 40
  %92 = getelementptr inbounds float, ptr %5, i64 %offset.idx.10
  %wide.load.10 = load <4 x float>, ptr %92, align 4, !tbaa !12
  %93 = fsub <4 x float> %wide.load.10, %broadcast.splat
  %94 = fdiv <4 x float> %93, %broadcast.splat110
  %95 = fmul <4 x float> %94, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %96 = fptoui <4 x float> %95 to <4 x i8>
  %97 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.10
  store <4 x i8> %96, ptr %97, align 1, !tbaa !18
  %offset.idx.11 = add nsw i64 %31, 44
  %98 = getelementptr inbounds float, ptr %5, i64 %offset.idx.11
  %wide.load.11 = load <4 x float>, ptr %98, align 4, !tbaa !12
  %99 = fsub <4 x float> %wide.load.11, %broadcast.splat
  %100 = fdiv <4 x float> %99, %broadcast.splat110
  %101 = fmul <4 x float> %100, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %102 = fptoui <4 x float> %101 to <4 x i8>
  %103 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.11
  store <4 x i8> %102, ptr %103, align 1, !tbaa !18
  %offset.idx.12 = add nsw i64 %31, 48
  %104 = getelementptr inbounds float, ptr %5, i64 %offset.idx.12
  %wide.load.12 = load <4 x float>, ptr %104, align 4, !tbaa !12
  %105 = fsub <4 x float> %wide.load.12, %broadcast.splat
  %106 = fdiv <4 x float> %105, %broadcast.splat110
  %107 = fmul <4 x float> %106, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %108 = fptoui <4 x float> %107 to <4 x i8>
  %109 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.12
  store <4 x i8> %108, ptr %109, align 1, !tbaa !18
  %offset.idx.13 = add nsw i64 %31, 52
  %110 = getelementptr inbounds float, ptr %5, i64 %offset.idx.13
  %wide.load.13 = load <4 x float>, ptr %110, align 4, !tbaa !12
  %111 = fsub <4 x float> %wide.load.13, %broadcast.splat
  %112 = fdiv <4 x float> %111, %broadcast.splat110
  %113 = fmul <4 x float> %112, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %114 = fptoui <4 x float> %113 to <4 x i8>
  %115 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.13
  store <4 x i8> %114, ptr %115, align 1, !tbaa !18
  %offset.idx.14 = add nsw i64 %31, 56
  %116 = getelementptr inbounds float, ptr %5, i64 %offset.idx.14
  %wide.load.14 = load <4 x float>, ptr %116, align 4, !tbaa !12
  %117 = fsub <4 x float> %wide.load.14, %broadcast.splat
  %118 = fdiv <4 x float> %117, %broadcast.splat110
  %119 = fmul <4 x float> %118, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %120 = fptoui <4 x float> %119 to <4 x i8>
  %121 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.14
  store <4 x i8> %120, ptr %121, align 1, !tbaa !18
  %offset.idx.15 = add nsw i64 %31, 60
  %122 = getelementptr inbounds float, ptr %5, i64 %offset.idx.15
  %wide.load.15 = load <4 x float>, ptr %122, align 4, !tbaa !12
  %123 = fsub <4 x float> %wide.load.15, %broadcast.splat
  %124 = fdiv <4 x float> %123, %broadcast.splat110
  %125 = fmul <4 x float> %124, <float 2.550000e+02, float 2.550000e+02, float 2.550000e+02, float 2.550000e+02>
  %126 = fptoui <4 x float> %125 to <4 x i8>
  %127 = getelementptr inbounds i8, ptr %6, i64 %offset.idx.15
  store <4 x i8> %126, ptr %127, align 1, !tbaa !18
  %128 = add nuw nsw i32 %.16194, 1
  %exitcond105.not = icmp eq i32 %128, 64
  br i1 %exitcond105.not, label %129, label %.preheader, !llvm.loop !19

129:                                              ; preds = %.preheader
  %130 = add nuw nsw i32 %.16396, 1
  %exitcond106.not = icmp eq i32 %130, 64
  br i1 %exitcond106.not, label %131, label %.preheader76, !llvm.loop !20

131:                                              ; preds = %129
  %132 = getelementptr inbounds i8, ptr %4, i64 196
  call void @glGenTextures(i32 noundef 1, ptr noundef nonnull %132) #6
  %133 = load i32, ptr %132, align 4, !tbaa !21
  call void @glBindTexture(i32 noundef 32879, i32 noundef %133) #6
  call void @glTexImage3D(i32 noundef 32879, i32 noundef 0, i32 noundef 33321, i32 noundef 64, i32 noundef 64, i32 noundef 64, i32 noundef 0, i32 noundef 6403, i32 noundef 5121, ptr noundef nonnull %6) #6
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 10241, i32 noundef 9729) #6
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 10240, i32 noundef 9729) #6
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 10242, i32 noundef 33648) #6
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 10243, i32 noundef 33648) #6
  call void @glTexParameteri(i32 noundef 32879, i32 noundef 32882, i32 noundef 33648) #6
  call void @glBindTexture(i32 noundef 32879, i32 noundef 0) #6
  call void @free(ptr noundef nonnull %5) #6
  call void @free(ptr noundef nonnull %6) #6
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

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

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

declare void @glTexParameteri(i32 noundef, i32 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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #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 allocsize(0) }
attributes #6 = { 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, !13, i64 0}
!13 = !{!"float", !8, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = !{!8, !8, i64 0}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = !{!22, !10, i64 196}
!22 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !7, i64 32, !7, i64 40, !7, i64 48, !10, i64 56, !13, i64 60, !23, i64 64, !23, i64 128, !13, i64 192, !10, i64 196}
!23 = !{!"", !8, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass