; LLVM IR from merpheus-dev/LavaEngine :: src/Platforms/OpenGL/PostProccessing (GLBloomPostProcess)

; 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.Lava::OpenGL::GLBloomPostProcess" = type { %"class.Lava::PostProcessingEffect.base", ptr, ptr, ptr, [2 x i32], [2 x i32] }
%"class.Lava::PostProcessingEffect.base" = type <{ ptr, i32, i32, i32 }>
%"class.Lava::PostProcessingEffect" = type <{ ptr, i32, i32, i32, [4 x i8] }>

@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@__glewGenFramebuffers = external global ptr, align 8
@__glewBindFramebuffer = external global ptr, align 8
@__glewFramebufferTexture2D = external global ptr, align 8
@__glewGenRenderbuffers = external global ptr, align 8
@__glewBindRenderbuffer = external global ptr, align 8
@__glewRenderbufferStorage = external global ptr, align 8
@__glewFramebufferRenderbuffer = external global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Lava6OpenGL18GLBloomPostProcess4InitEv(ptr noundef nonnull align 8 dereferenceable(64) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  %11 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
  call void @llvm.memset.p0.i64(ptr align 16 %11, i8 0, i64 40, i1 false)
  call void @_ZN4Lava6OpenGL12GLShaderBankC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %11) #8
  %12 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 1
  store ptr %11, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  %13 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
  %14 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  invoke void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36) %13, ptr noundef @.str, i32 noundef 0, ptr noundef %15)
          to label %16 unwind label %74

16:                                               ; preds = %1
  store ptr %13, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %17 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
  %18 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 3
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  invoke void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36) %17, ptr noundef %19, i32 noundef 1, ptr noundef %21)
          to label %22 unwind label %78

22:                                               ; preds = %16
  store ptr %17, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40) %24, ptr noundef %25)
  %26 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40) %27, ptr noundef %28)
  %29 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !9
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  %32 = getelementptr inbounds ptr, ptr %31, i64 5
  %33 = load ptr, ptr %32, align 8
  call void %33(ptr noundef nonnull align 8 dereferenceable(40) %30)
  %34 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = getelementptr inbounds ptr, ptr %36, i64 6
  %38 = load ptr, ptr %37, align 8
  call void %38(ptr noundef nonnull align 8 dereferenceable(40) %35, i32 noundef 0, ptr noundef @.str.1)
  %39 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
  call void @llvm.memset.p0.i64(ptr align 16 %39, i8 0, i64 40, i1 false)
  call void @_ZN4Lava6OpenGL12GLShaderBankC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %39) #8
  %40 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 2
  store ptr %39, ptr %40, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %41 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
  %42 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !16
  invoke void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36) %41, ptr noundef @.str, i32 noundef 0, ptr noundef %43)
          to label %44 unwind label %82

44:                                               ; preds = %22
  store ptr %41, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %45 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #7
  %46 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 2
  %47 = load ptr, ptr %46, align 8, !tbaa !16
  invoke void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36) %45, ptr noundef @.str.2, i32 noundef 1, ptr noundef %47)
          to label %48 unwind label %86

48:                                               ; preds = %44
  store ptr %45, ptr %8, align 8, !tbaa !5
  %49 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !16
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40) %50, ptr noundef %51)
  %52 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40) %53, ptr noundef %54)
  %55 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !16
  %57 = load ptr, ptr %56, align 8, !tbaa !14
  %58 = getelementptr inbounds ptr, ptr %57, i64 5
  %59 = load ptr, ptr %58, align 8
  call void %59(ptr noundef nonnull align 8 dereferenceable(40) %56)
  %60 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 2
  %61 = load ptr, ptr %60, align 8, !tbaa !16
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  %63 = getelementptr inbounds ptr, ptr %62, i64 6
  %64 = load ptr, ptr %63, align 8
  call void %64(ptr noundef nonnull align 8 dereferenceable(40) %61, i32 noundef 0, ptr noundef @.str.1)
  %65 = load ptr, ptr @__glewGenFramebuffers, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 4
  %67 = getelementptr inbounds [2 x i32], ptr %66, i64 0, i64 0
  call void %65(i32 noundef 2, ptr noundef %67)
  %68 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 5
  %69 = getelementptr inbounds [2 x i32], ptr %68, i64 0, i64 0
  call void @glGenTextures(i32 noundef 2, ptr noundef %69)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !17
  br label %70

70:                                               ; preds = %110, %48
  %71 = load i32, ptr %9, align 4, !tbaa !17
  %72 = icmp ult i32 %71, 2
  br i1 %72, label %90, label %73

73:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %113

74:                                               ; preds = %1
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %4, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %13, i64 noundef 40) #9
  br label %142

78:                                               ; preds = %16
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %4, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %17, i64 noundef 40) #9
  br label %141

82:                                               ; preds = %22
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %4, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %41, i64 noundef 40) #9
  br label %140

86:                                               ; preds = %44
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %4, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %5, align 4
  call void @_ZdlPvm(ptr noundef %45, i64 noundef 40) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %140

90:                                               ; preds = %70
  %91 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 4
  %93 = load i32, ptr %9, align 4, !tbaa !17
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds [2 x i32], ptr %92, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !17
  call void %91(i32 noundef 36160, i32 noundef %96)
  %97 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 5
  %98 = load i32, ptr %9, align 4, !tbaa !17
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds [2 x i32], ptr %97, i64 0, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !17
  call void @glBindTexture(i32 noundef 3553, i32 noundef %101)
  %102 = call noundef i32 @_ZN4Lava13WindowManager5WidthEv()
  %103 = call noundef i32 @_ZN4Lava13WindowManager6HeightEv()
  call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 34842, i32 noundef %102, i32 noundef %103, i32 noundef 0, i32 noundef 6408, i32 noundef 5126, ptr noundef null)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10242, i32 noundef 33071)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10243, i32 noundef 33071)
  %104 = load ptr, ptr @__glewFramebufferTexture2D, align 8, !tbaa !5
  %105 = getelementptr inbounds %"class.Lava::OpenGL::GLBloomPostProcess", ptr %10, i32 0, i32 5
  %106 = load i32, ptr %9, align 4, !tbaa !17
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds [2 x i32], ptr %105, i64 0, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !17
  call void %104(i32 noundef 36160, i32 noundef 36064, i32 noundef 3553, i32 noundef %109, i32 noundef 0)
  br label %110

110:                                              ; preds = %90
  %111 = load i32, ptr %9, align 4, !tbaa !17
  %112 = add i32 %111, 1
  store i32 %112, ptr %9, align 4, !tbaa !17
  br label %70, !llvm.loop !18

113:                                              ; preds = %73
  %114 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !5
  call void %114(i32 noundef 36160, i32 noundef 0)
  %115 = getelementptr inbounds %"class.Lava::PostProcessingEffect", ptr %10, i32 0, i32 1
  call void @glGenTextures(i32 noundef 1, ptr noundef %115)
  %116 = getelementptr inbounds %"class.Lava::PostProcessingEffect", ptr %10, i32 0, i32 1
  %117 = load i32, ptr %116, align 8, !tbaa !20
  call void @glBindTexture(i32 noundef 3553, i32 noundef %117)
  %118 = call noundef i32 @_ZN4Lava13WindowManager5WidthEv()
  %119 = call noundef i32 @_ZN4Lava13WindowManager6HeightEv()
  call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 34842, i32 noundef %118, i32 noundef %119, i32 noundef 0, i32 noundef 6408, i32 noundef 5126, ptr noundef null)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  %120 = load ptr, ptr @__glewGenFramebuffers, align 8, !tbaa !5
  %121 = getelementptr inbounds %"class.Lava::PostProcessingEffect", ptr %10, i32 0, i32 2
  call void %120(i32 noundef 1, ptr noundef %121)
  %122 = load ptr, ptr @__glewGenRenderbuffers, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.Lava::PostProcessingEffect", ptr %10, i32 0, i32 3
  call void %122(i32 noundef 1, ptr noundef %123)
  %124 = load ptr, ptr @__glewBindRenderbuffer, align 8, !tbaa !5
  %125 = getelementptr inbounds %"class.Lava::PostProcessingEffect", ptr %10, i32 0, i32 3
  %126 = load i32, ptr %125, align 8, !tbaa !21
  call void %124(i32 noundef 36161, i32 noundef %126)
  %127 = load ptr, ptr @__glewRenderbufferStorage, align 8, !tbaa !5
  %128 = call noundef i32 @_ZN4Lava13WindowManager5WidthEv()
  %129 = call noundef i32 @_ZN4Lava13WindowManager6HeightEv()
  call void %127(i32 noundef 36161, i32 noundef 6402, i32 noundef %128, i32 noundef %129)
  %130 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !5
  %131 = getelementptr inbounds %"class.Lava::PostProcessingEffect", ptr %10, i32 0, i32 2
  %132 = load i32, ptr %131, align 4, !tbaa !22
  call void %130(i32 noundef 36160, i32 noundef %132)
  %133 = load ptr, ptr @__glewFramebufferTexture2D, align 8, !tbaa !5
  %134 = getelementptr inbounds %"class.Lava::PostProcessingEffect", ptr %10, i32 0, i32 1
  %135 = load i32, ptr %134, align 8, !tbaa !20
  call void %133(i32 noundef 36160, i32 noundef 36064, i32 noundef 3553, i32 noundef %135, i32 noundef 0)
  %136 = load ptr, ptr @__glewFramebufferRenderbuffer, align 8, !tbaa !5
  %137 = getelementptr inbounds %"class.Lava::PostProcessingEffect", ptr %10, i32 0, i32 3
  %138 = load i32, ptr %137, align 8, !tbaa !21
  call void %136(i32 noundef 36160, i32 noundef 36096, i32 noundef 36161, i32 noundef %138)
  %139 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !5
  call void %139(i32 noundef 36160, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  ret void

140:                                              ; preds = %86, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  br label %141

141:                                              ; preds = %140, %78
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %142

142:                                              ; preds = %141, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %143

143:                                              ; preds = %142
  %144 = load ptr, ptr %4, align 8
  %145 = load i32, ptr %5, align 4
  %146 = insertvalue { ptr, i32 } poison, ptr %144, 0
  %147 = insertvalue { ptr, i32 } %146, i32 %145, 1
  resume { ptr, i32 } %147
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Lava6OpenGL12GLShaderBankC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

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

declare void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef, i32 noundef, ptr noundef) unnamed_addr #5

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #6

declare void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #5

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

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

declare void @glTexImage2D(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) #5

declare noundef i32 @_ZN4Lava13WindowManager5WidthEv() #5

declare noundef i32 @_ZN4Lava13WindowManager6HeightEv() #5

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

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

attributes #0 = { mustprogress 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 = { nobuiltin 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint mustprogress 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { "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 #6 = { nobuiltin 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 #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { builtin 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++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"_ZTSN4Lava6OpenGL18GLBloomPostProcessE", !11, i64 0, !6, i64 24, !6, i64 32, !6, i64 40, !7, i64 48, !7, i64 56}
!11 = !{!"_ZTSN4Lava20PostProcessingEffectE", !12, i64 8, !12, i64 12, !12, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!10, !6, i64 40}
!14 = !{!15, !15, i64 0}
!15 = !{!"vtable pointer", !8, i64 0}
!16 = !{!10, !6, i64 32}
!17 = !{!12, !12, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!11, !12, i64 8}
!21 = !{!11, !12, i64 16}
!22 = !{!11, !12, i64 12}


; 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"

@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@__glewGenFramebuffers = external local_unnamed_addr global ptr, align 8
@__glewBindFramebuffer = external local_unnamed_addr global ptr, align 8
@__glewFramebufferTexture2D = external local_unnamed_addr global ptr, align 8
@__glewGenRenderbuffers = external local_unnamed_addr global ptr, align 8
@__glewBindRenderbuffer = external local_unnamed_addr global ptr, align 8
@__glewRenderbufferStorage = external local_unnamed_addr global ptr, align 8
@__glewFramebufferRenderbuffer = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Lava6OpenGL18GLBloomPostProcess4InitEv(ptr noundef nonnull align 8 dereferenceable(64) %0) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %2, i8 0, i64 40, i1 false)
  tail call void @_ZN4Lava6OpenGL12GLShaderBankC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %2) #7
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %2, ptr %3, align 8, !tbaa !5
  %4 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #6
  invoke void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36) %4, ptr noundef nonnull @.str, i32 noundef 0, ptr noundef nonnull %2)
          to label %5 unwind label %78

5:                                                ; preds = %1
  %6 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = load ptr, ptr %7, align 8, !tbaa !12
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36) %6, ptr noundef %8, i32 noundef 1, ptr noundef %9)
          to label %10 unwind label %80

10:                                               ; preds = %5
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  tail call void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40) %11, ptr noundef nonnull %4)
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  tail call void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40) %12, ptr noundef nonnull %6)
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = load ptr, ptr %13, align 8, !tbaa !13
  %15 = getelementptr inbounds i8, ptr %14, i64 40
  %16 = load ptr, ptr %15, align 8
  tail call void %16(ptr noundef nonnull align 8 dereferenceable(40) %13)
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = getelementptr inbounds i8, ptr %18, i64 48
  %20 = load ptr, ptr %19, align 8
  tail call void %20(ptr noundef nonnull align 8 dereferenceable(40) %17, i32 noundef 0, ptr noundef nonnull @.str.1)
  %21 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %21, i8 0, i64 40, i1 false)
  tail call void @_ZN4Lava6OpenGL12GLShaderBankC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %21) #7
  %22 = getelementptr inbounds i8, ptr %0, i64 32
  store ptr %21, ptr %22, align 8, !tbaa !15
  %23 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #6
  invoke void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36) %23, ptr noundef nonnull @.str, i32 noundef 0, ptr noundef nonnull %21)
          to label %24 unwind label %82

24:                                               ; preds = %10
  %25 = tail call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #6
  %26 = load ptr, ptr %22, align 8, !tbaa !15
  invoke void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36) %25, ptr noundef nonnull @.str.2, i32 noundef 1, ptr noundef %26)
          to label %27 unwind label %84

27:                                               ; preds = %24
  %28 = load ptr, ptr %22, align 8, !tbaa !15
  tail call void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40) %28, ptr noundef nonnull %23)
  %29 = load ptr, ptr %22, align 8, !tbaa !15
  tail call void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40) %29, ptr noundef nonnull %25)
  %30 = load ptr, ptr %22, align 8, !tbaa !15
  %31 = load ptr, ptr %30, align 8, !tbaa !13
  %32 = getelementptr inbounds i8, ptr %31, i64 40
  %33 = load ptr, ptr %32, align 8
  tail call void %33(ptr noundef nonnull align 8 dereferenceable(40) %30)
  %34 = load ptr, ptr %22, align 8, !tbaa !15
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = getelementptr inbounds i8, ptr %35, i64 48
  %37 = load ptr, ptr %36, align 8
  tail call void %37(ptr noundef nonnull align 8 dereferenceable(40) %34, i32 noundef 0, ptr noundef nonnull @.str.1)
  %38 = load ptr, ptr @__glewGenFramebuffers, align 8, !tbaa !16
  %39 = getelementptr inbounds i8, ptr %0, i64 48
  tail call void %38(i32 noundef 2, ptr noundef nonnull %39)
  %40 = getelementptr inbounds i8, ptr %0, i64 56
  tail call void @glGenTextures(i32 noundef 2, ptr noundef nonnull %40)
  %41 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !16
  %42 = load i32, ptr %39, align 8, !tbaa !17
  tail call void %41(i32 noundef 36160, i32 noundef %42)
  %43 = load i32, ptr %40, align 8, !tbaa !17
  tail call void @glBindTexture(i32 noundef 3553, i32 noundef %43)
  %44 = tail call noundef i32 @_ZN4Lava13WindowManager5WidthEv()
  %45 = tail call noundef i32 @_ZN4Lava13WindowManager6HeightEv()
  tail call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 34842, i32 noundef %44, i32 noundef %45, i32 noundef 0, i32 noundef 6408, i32 noundef 5126, ptr noundef null)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10242, i32 noundef 33071)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10243, i32 noundef 33071)
  %46 = load ptr, ptr @__glewFramebufferTexture2D, align 8, !tbaa !16
  %47 = load i32, ptr %40, align 8, !tbaa !17
  tail call void %46(i32 noundef 36160, i32 noundef 36064, i32 noundef 3553, i32 noundef %47, i32 noundef 0)
  %48 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !16
  %49 = getelementptr inbounds i8, ptr %0, i64 52
  %50 = load i32, ptr %49, align 4, !tbaa !17
  tail call void %48(i32 noundef 36160, i32 noundef %50)
  %51 = getelementptr inbounds i8, ptr %0, i64 60
  %52 = load i32, ptr %51, align 4, !tbaa !17
  tail call void @glBindTexture(i32 noundef 3553, i32 noundef %52)
  %53 = tail call noundef i32 @_ZN4Lava13WindowManager5WidthEv()
  %54 = tail call noundef i32 @_ZN4Lava13WindowManager6HeightEv()
  tail call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 34842, i32 noundef %53, i32 noundef %54, i32 noundef 0, i32 noundef 6408, i32 noundef 5126, ptr noundef null)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10242, i32 noundef 33071)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10243, i32 noundef 33071)
  %55 = load ptr, ptr @__glewFramebufferTexture2D, align 8, !tbaa !16
  %56 = load i32, ptr %51, align 4, !tbaa !17
  tail call void %55(i32 noundef 36160, i32 noundef 36064, i32 noundef 3553, i32 noundef %56, i32 noundef 0)
  %57 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !16
  tail call void %57(i32 noundef 36160, i32 noundef 0)
  %58 = getelementptr inbounds i8, ptr %0, i64 8
  tail call void @glGenTextures(i32 noundef 1, ptr noundef nonnull %58)
  %59 = load i32, ptr %58, align 8, !tbaa !18
  tail call void @glBindTexture(i32 noundef 3553, i32 noundef %59)
  %60 = tail call noundef i32 @_ZN4Lava13WindowManager5WidthEv()
  %61 = tail call noundef i32 @_ZN4Lava13WindowManager6HeightEv()
  tail call void @glTexImage2D(i32 noundef 3553, i32 noundef 0, i32 noundef 34842, i32 noundef %60, i32 noundef %61, i32 noundef 0, i32 noundef 6408, i32 noundef 5126, ptr noundef null)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  tail call void @glTexParameteri(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  %62 = load ptr, ptr @__glewGenFramebuffers, align 8, !tbaa !16
  %63 = getelementptr inbounds i8, ptr %0, i64 12
  tail call void %62(i32 noundef 1, ptr noundef nonnull %63)
  %64 = load ptr, ptr @__glewGenRenderbuffers, align 8, !tbaa !16
  %65 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void %64(i32 noundef 1, ptr noundef nonnull %65)
  %66 = load ptr, ptr @__glewBindRenderbuffer, align 8, !tbaa !16
  %67 = load i32, ptr %65, align 8, !tbaa !19
  tail call void %66(i32 noundef 36161, i32 noundef %67)
  %68 = load ptr, ptr @__glewRenderbufferStorage, align 8, !tbaa !16
  %69 = tail call noundef i32 @_ZN4Lava13WindowManager5WidthEv()
  %70 = tail call noundef i32 @_ZN4Lava13WindowManager6HeightEv()
  tail call void %68(i32 noundef 36161, i32 noundef 6402, i32 noundef %69, i32 noundef %70)
  %71 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !16
  %72 = load i32, ptr %63, align 4, !tbaa !20
  tail call void %71(i32 noundef 36160, i32 noundef %72)
  %73 = load ptr, ptr @__glewFramebufferTexture2D, align 8, !tbaa !16
  %74 = load i32, ptr %58, align 8, !tbaa !18
  tail call void %73(i32 noundef 36160, i32 noundef 36064, i32 noundef 3553, i32 noundef %74, i32 noundef 0)
  %75 = load ptr, ptr @__glewFramebufferRenderbuffer, align 8, !tbaa !16
  %76 = load i32, ptr %65, align 8, !tbaa !19
  tail call void %75(i32 noundef 36160, i32 noundef 36096, i32 noundef 36161, i32 noundef %76)
  %77 = load ptr, ptr @__glewBindFramebuffer, align 8, !tbaa !16
  tail call void %77(i32 noundef 36160, i32 noundef 0)
  ret void

78:                                               ; preds = %1
  %79 = landingpad { ptr, i32 }
          cleanup
  br label %86

80:                                               ; preds = %5
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %86

82:                                               ; preds = %10
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %86

84:                                               ; preds = %24
  %85 = landingpad { ptr, i32 }
          cleanup
  br label %86

86:                                               ; preds = %80, %84, %82, %78
  %.sink = phi ptr [ %6, %80 ], [ %25, %84 ], [ %23, %82 ], [ %4, %78 ]
  %.pn.pn.pn = phi { ptr, i32 } [ %81, %80 ], [ %85, %84 ], [ %83, %82 ], [ %79, %78 ]
  tail call void @_ZdlPvm(ptr noundef nonnull %.sink, i64 noundef 40) #8
  resume { ptr, i32 } %.pn.pn.pn
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4Lava6OpenGL12GLShaderBankC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #3 align 2

declare void @_ZN4Lava6OpenGL8GLShaderC1EPKc10ShaderTypePNS0_12GLShaderBankE(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef, i32 noundef, ptr noundef) unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #5

declare void @_ZN4Lava6OpenGL12GLShaderBank9AddShaderEPNS0_8GLShaderE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #4

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

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

declare void @glTexImage2D(i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

declare noundef i32 @_ZN4Lava13WindowManager5WidthEv() local_unnamed_addr #4

declare noundef i32 @_ZN4Lava13WindowManager6HeightEv() local_unnamed_addr #4

declare void @glTexParameteri(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress 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 = { nobuiltin 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint mustprogress 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 #4 = { "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 = { nobuiltin 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 #6 = { builtin allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { builtin 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, !11, i64 24}
!6 = !{!"_ZTSN4Lava6OpenGL18GLBloomPostProcessE", !7, i64 0, !11, i64 24, !11, i64 32, !11, i64 40, !9, i64 48, !9, i64 56}
!7 = !{!"_ZTSN4Lava20PostProcessingEffectE", !8, i64 8, !8, i64 12, !8, i64 16}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!6, !11, i64 40}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !10, i64 0}
!15 = !{!6, !11, i64 32}
!16 = !{!11, !11, i64 0}
!17 = !{!8, !8, i64 0}
!18 = !{!7, !8, i64 8}
!19 = !{!7, !8, i64 16}
!20 = !{!7, !8, i64 12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass