; LLVM IR from Dovyski/opengl-demos :: src/shader-hello-world (main)

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@vertexShaderSource = external dso_local global ptr, align 8
@fragmentShaderSource = external dso_local global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@glad_glCreateShader = external global ptr, align 8
@glad_glShaderSource = external global ptr, align 8
@glad_glCompileShader = external global ptr, align 8
@glad_glGetShaderiv = external global ptr, align 8
@glad_glGetShaderInfoLog = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1
@glad_glCreateProgram = external global ptr, align 8
@glad_glAttachShader = external global ptr, align 8
@glad_glLinkProgram = external global ptr, align 8
@glad_glGetProgramiv = external global ptr, align 8
@glad_glGetProgramInfoLog = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1
@glad_glDeleteShader = external global ptr, align 8
@glad_glGenVertexArrays = external global ptr, align 8
@glad_glGenBuffers = external global ptr, align 8
@glad_glBindVertexArray = external global ptr, align 8
@glad_glBindBuffer = external global ptr, align 8
@glad_glBufferData = external global ptr, align 8
@glad_glVertexAttribPointer = external global ptr, align 8
@glad_glEnableVertexAttribArray = external global ptr, align 8
@glad_glClearColor = external global ptr, align 8
@glad_glClear = external global ptr, align 8
@glad_glUseProgram = external global ptr, align 8
@glad_glDrawArrays = external global ptr, align 8
@glad_glDeleteVertexArrays = external global ptr, align 8
@glad_glDeleteBuffers = external global ptr, align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12processInputP10GLFWwindow(ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z25framebuffer_size_callbackP10GLFWwindowii(ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [512 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [9 x float], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i32 @glfwInit()
  call void @glfwWindowHint(i32 noundef 139266, i32 noundef 3)
  call void @glfwWindowHint(i32 noundef 139267, i32 noundef 3)
  call void @glfwWindowHint(i32 noundef 139272, i32 noundef 204801)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %13 = call ptr @glfwCreateWindow(i32 noundef 800, i32 noundef 600, ptr noundef @.str.2, ptr noundef null, ptr noundef null)
  store ptr %13, ptr %2, align 8, !tbaa !5
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %16, label %19

16:                                               ; preds = %0
  %17 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @glfwTerminate()
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %129

19:                                               ; preds = %0
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  call void @glfwMakeContextCurrent(ptr noundef %20)
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = call ptr @glfwSetFramebufferSizeCallback(ptr noundef %21, ptr noundef @_Z25framebuffer_size_callbackP10GLFWwindowii)
  %23 = call i32 @gladLoadGLLoader(ptr noundef @glfwGetProcAddress)
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %28, label %25

25:                                               ; preds = %19
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 -1, ptr %1, align 4
  store i32 1, ptr %3, align 4
  br label %129

28:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %29 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %30 = call i32 %29(i32 noundef 35633)
  store i32 %30, ptr %4, align 4, !tbaa !9
  %31 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  %32 = load i32, ptr %4, align 4, !tbaa !9
  call void %31(i32 noundef %32, i32 noundef 1, ptr noundef @vertexShaderSource, ptr noundef null)
  %33 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !9
  call void %33(i32 noundef %34)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 512, ptr %6) #6
  %35 = load ptr, ptr @glad_glGetShaderiv, align 8, !tbaa !5
  %36 = load i32, ptr %4, align 4, !tbaa !9
  call void %35(i32 noundef %36, i32 noundef 35713, ptr noundef %5)
  %37 = load i32, ptr %5, align 4, !tbaa !9
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %47, label %39

39:                                               ; preds = %28
  %40 = load ptr, ptr @glad_glGetShaderInfoLog, align 8, !tbaa !5
  %41 = load i32, ptr %4, align 4, !tbaa !9
  %42 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  call void %40(i32 noundef %41, i32 noundef 512, ptr noundef null, ptr noundef %42)
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.5)
  %44 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef %44)
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %45, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %47

47:                                               ; preds = %39, %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %48 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %49 = call i32 %48(i32 noundef 35632)
  store i32 %49, ptr %7, align 4, !tbaa !9
  %50 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !9
  call void %50(i32 noundef %51, i32 noundef 1, ptr noundef @fragmentShaderSource, ptr noundef null)
  %52 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  %53 = load i32, ptr %7, align 4, !tbaa !9
  call void %52(i32 noundef %53)
  %54 = load ptr, ptr @glad_glGetShaderiv, align 8, !tbaa !5
  %55 = load i32, ptr %7, align 4, !tbaa !9
  call void %54(i32 noundef %55, i32 noundef 35713, ptr noundef %5)
  %56 = load i32, ptr %5, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %66, label %58

58:                                               ; preds = %47
  %59 = load ptr, ptr @glad_glGetShaderInfoLog, align 8, !tbaa !5
  %60 = load i32, ptr %7, align 4, !tbaa !9
  %61 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  call void %59(i32 noundef %60, i32 noundef 512, ptr noundef null, ptr noundef %61)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
  %63 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef %63)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %66

66:                                               ; preds = %58, %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %67 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !5
  %68 = call i32 %67()
  store i32 %68, ptr %8, align 4, !tbaa !9
  %69 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !9
  %71 = load i32, ptr %4, align 4, !tbaa !9
  call void %69(i32 noundef %70, i32 noundef %71)
  %72 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  %73 = load i32, ptr %8, align 4, !tbaa !9
  %74 = load i32, ptr %7, align 4, !tbaa !9
  call void %72(i32 noundef %73, i32 noundef %74)
  %75 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !9
  call void %75(i32 noundef %76)
  %77 = load ptr, ptr @glad_glGetProgramiv, align 8, !tbaa !5
  %78 = load i32, ptr %8, align 4, !tbaa !9
  call void %77(i32 noundef %78, i32 noundef 35714, ptr noundef %5)
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %89, label %81

81:                                               ; preds = %66
  %82 = load ptr, ptr @glad_glGetProgramInfoLog, align 8, !tbaa !5
  %83 = load i32, ptr %8, align 4, !tbaa !9
  %84 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  call void %82(i32 noundef %83, i32 noundef 512, ptr noundef null, ptr noundef %84)
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.7)
  %86 = getelementptr inbounds [512 x i8], ptr %6, i64 0, i64 0
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef %86)
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %87, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %89

89:                                               ; preds = %81, %66
  %90 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !5
  %91 = load i32, ptr %4, align 4, !tbaa !9
  call void %90(i32 noundef %91)
  %92 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !5
  %93 = load i32, ptr %7, align 4, !tbaa !9
  call void %92(i32 noundef %93)
  call void @llvm.lifetime.start.p0(i64 36, ptr %9) #6
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 36, i1 false)
  %94 = getelementptr inbounds [9 x float], ptr %9, i32 0, i32 0
  store float -5.000000e-01, ptr %94, align 16
  %95 = getelementptr inbounds [9 x float], ptr %9, i32 0, i32 1
  store float -5.000000e-01, ptr %95, align 4
  %96 = getelementptr inbounds [9 x float], ptr %9, i32 0, i32 3
  store float 5.000000e-01, ptr %96, align 4
  %97 = getelementptr inbounds [9 x float], ptr %9, i32 0, i32 4
  store float -5.000000e-01, ptr %97, align 16
  %98 = getelementptr inbounds [9 x float], ptr %9, i32 0, i32 7
  store float 5.000000e-01, ptr %98, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %99 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  call void %99(i32 noundef 1, ptr noundef %11)
  %100 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %100(i32 noundef 1, ptr noundef %10)
  %101 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %102 = load i32, ptr %11, align 4, !tbaa !9
  call void %101(i32 noundef %102)
  %103 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %104 = load i32, ptr %10, align 4, !tbaa !9
  call void %103(i32 noundef 34962, i32 noundef %104)
  %105 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  %106 = getelementptr inbounds [9 x float], ptr %9, i64 0, i64 0
  call void %105(i32 noundef 34962, i64 noundef 36, ptr noundef %106, i32 noundef 35044)
  %107 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %107(i32 noundef 0, i32 noundef 3, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 12, ptr noundef null)
  %108 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %108(i32 noundef 0)
  %109 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %109(i32 noundef 34962, i32 noundef 0)
  %110 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %110(i32 noundef 0)
  br label %111

111:                                              ; preds = %116, %89
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = call i32 @glfwWindowShouldClose(ptr noundef %112)
  %114 = icmp ne i32 %113, 0
  %115 = xor i1 %114, true
  br i1 %115, label %116, label %126

116:                                              ; preds = %111
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  call void @_Z12processInputP10GLFWwindow(ptr noundef %117)
  %118 = load ptr, ptr @glad_glClearColor, align 8, !tbaa !5
  call void %118(float noundef 0x3FC99999A0000000, float noundef 0x3FD3333340000000, float noundef 0x3FD3333340000000, float noundef 1.000000e+00)
  %119 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  call void %119(i32 noundef 16384)
  %120 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  %121 = load i32, ptr %8, align 4, !tbaa !9
  call void %120(i32 noundef %121)
  %122 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !9
  call void %122(i32 noundef %123)
  %124 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !5
  call void %124(i32 noundef 4, i32 noundef 0, i32 noundef 3)
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  call void @glfwSwapBuffers(ptr noundef %125)
  call void @glfwPollEvents()
  br label %111, !llvm.loop !11

126:                                              ; preds = %111
  %127 = load ptr, ptr @glad_glDeleteVertexArrays, align 8, !tbaa !5
  call void %127(i32 noundef 1, ptr noundef %11)
  %128 = load ptr, ptr @glad_glDeleteBuffers, align 8, !tbaa !5
  call void %128(i32 noundef 1, ptr noundef %10)
  call void @glfwTerminate()
  store i32 0, ptr %1, align 4
  store i32 1, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 36, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %129

129:                                              ; preds = %126, %25, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %130 = load i32, ptr %1, align 4
  ret i32 %130
}

declare i32 @glfwInit() #2

declare void @glfwWindowHint(i32 noundef, i32 noundef) #2

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

declare ptr @glfwCreateWindow(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

declare void @glfwTerminate() #2

declare void @glfwMakeContextCurrent(ptr noundef) #2

declare ptr @glfwSetFramebufferSizeCallback(ptr noundef, ptr noundef) #2

declare i32 @gladLoadGLLoader(ptr noundef) #2

declare ptr @glfwGetProcAddress(ptr noundef) #2

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

declare i32 @glfwWindowShouldClose(ptr noundef) #2

declare void @glfwSwapBuffers(ptr noundef) #2

declare void @glfwPollEvents() #2

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

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 = { mustprogress norecurse 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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@vertexShaderSource = external dso_local global ptr, align 8
@fragmentShaderSource = external dso_local global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [19 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [26 x i8], align 1
@glad_glCreateShader = external local_unnamed_addr global ptr, align 8
@glad_glShaderSource = external local_unnamed_addr global ptr, align 8
@glad_glCompileShader = external local_unnamed_addr global ptr, align 8
@glad_glGetShaderiv = external local_unnamed_addr global ptr, align 8
@glad_glGetShaderInfoLog = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1
@glad_glCreateProgram = external local_unnamed_addr global ptr, align 8
@glad_glAttachShader = external local_unnamed_addr global ptr, align 8
@glad_glLinkProgram = external local_unnamed_addr global ptr, align 8
@glad_glGetProgramiv = external local_unnamed_addr global ptr, align 8
@glad_glGetProgramInfoLog = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [40 x i8], align 1
@glad_glDeleteShader = external local_unnamed_addr global ptr, align 8
@glad_glGenVertexArrays = external local_unnamed_addr global ptr, align 8
@glad_glGenBuffers = external local_unnamed_addr global ptr, align 8
@glad_glBindVertexArray = external local_unnamed_addr global ptr, align 8
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@glad_glBufferData = external local_unnamed_addr global ptr, align 8
@glad_glVertexAttribPointer = external local_unnamed_addr global ptr, align 8
@glad_glEnableVertexAttribArray = external local_unnamed_addr global ptr, align 8
@glad_glClearColor = external local_unnamed_addr global ptr, align 8
@glad_glClear = external local_unnamed_addr global ptr, align 8
@glad_glUseProgram = external local_unnamed_addr global ptr, align 8
@glad_glDrawArrays = external local_unnamed_addr global ptr, align 8
@glad_glDeleteVertexArrays = external local_unnamed_addr global ptr, align 8
@glad_glDeleteBuffers = external local_unnamed_addr global ptr, align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z12processInputP10GLFWwindow(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z25framebuffer_size_callbackP10GLFWwindowii(ptr noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef range(i32 -1, 1) i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca [512 x i8], align 16
  %3 = alloca [9 x float], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call i32 @glfwInit()
  tail call void @glfwWindowHint(i32 noundef 139266, i32 noundef 3)
  tail call void @glfwWindowHint(i32 noundef 139267, i32 noundef 3)
  tail call void @glfwWindowHint(i32 noundef 139272, i32 noundef 204801)
  %7 = tail call ptr @glfwCreateWindow(i32 noundef 800, i32 noundef 600, ptr noundef nonnull @.str.2, ptr noundef null, ptr noundef null)
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %12

9:                                                ; preds = %0
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  tail call void @glfwTerminate()
  br label %81

12:                                               ; preds = %0
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %7)
  %13 = tail call ptr @glfwSetFramebufferSizeCallback(ptr noundef nonnull %7, ptr noundef nonnull @_Z25framebuffer_size_callbackP10GLFWwindowii)
  %14 = tail call i32 @gladLoadGLLoader(ptr noundef nonnull @glfwGetProcAddress)
  %.not = icmp eq i32 %14, 0
  br i1 %.not, label %15, label %18

15:                                               ; preds = %12
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %81

18:                                               ; preds = %12
  %19 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %20 = tail call i32 %19(i32 noundef 35633)
  %21 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  tail call void %21(i32 noundef %20, i32 noundef 1, ptr noundef nonnull @vertexShaderSource, ptr noundef null)
  %22 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  tail call void %22(i32 noundef %20)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #6
  %23 = load ptr, ptr @glad_glGetShaderiv, align 8, !tbaa !5
  call void %23(i32 noundef %20, i32 noundef 35713, ptr noundef nonnull %1)
  %24 = load i32, ptr %1, align 4, !tbaa !9
  %.not25 = icmp eq i32 %24, 0
  br i1 %.not25, label %25, label %30

25:                                               ; preds = %18
  %26 = load ptr, ptr @glad_glGetShaderInfoLog, align 8, !tbaa !5
  call void %26(i32 noundef %20, i32 noundef 512, ptr noundef null, ptr noundef nonnull %2)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.5)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull %2)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %30

30:                                               ; preds = %25, %18
  %31 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %32 = call i32 %31(i32 noundef 35632)
  %33 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  call void %33(i32 noundef %32, i32 noundef 1, ptr noundef nonnull @fragmentShaderSource, ptr noundef null)
  %34 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  call void %34(i32 noundef %32)
  %35 = load ptr, ptr @glad_glGetShaderiv, align 8, !tbaa !5
  call void %35(i32 noundef %32, i32 noundef 35713, ptr noundef nonnull %1)
  %36 = load i32, ptr %1, align 4, !tbaa !9
  %.not26 = icmp eq i32 %36, 0
  br i1 %.not26, label %37, label %42

37:                                               ; preds = %30
  %38 = load ptr, ptr @glad_glGetShaderInfoLog, align 8, !tbaa !5
  call void %38(i32 noundef %32, i32 noundef 512, ptr noundef null, ptr noundef nonnull %2)
  %39 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.6)
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull %2)
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %42

42:                                               ; preds = %37, %30
  %43 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !5
  %44 = call i32 %43()
  %45 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  call void %45(i32 noundef %44, i32 noundef %20)
  %46 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  call void %46(i32 noundef %44, i32 noundef %32)
  %47 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !5
  call void %47(i32 noundef %44)
  %48 = load ptr, ptr @glad_glGetProgramiv, align 8, !tbaa !5
  call void %48(i32 noundef %44, i32 noundef 35714, ptr noundef nonnull %1)
  %49 = load i32, ptr %1, align 4, !tbaa !9
  %.not27 = icmp eq i32 %49, 0
  br i1 %.not27, label %50, label %55

50:                                               ; preds = %42
  %51 = load ptr, ptr @glad_glGetProgramInfoLog, align 8, !tbaa !5
  call void %51(i32 noundef %44, i32 noundef 512, ptr noundef null, ptr noundef nonnull %2)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.7)
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull %2)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %55

55:                                               ; preds = %50, %42
  %56 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !5
  call void %56(i32 noundef %20)
  %57 = load ptr, ptr @glad_glDeleteShader, align 8, !tbaa !5
  call void %57(i32 noundef %32)
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(36) %3, i8 0, i64 36, i1 false)
  store <2 x float> <float -5.000000e-01, float -5.000000e-01>, ptr %3, align 16
  %58 = getelementptr inbounds i8, ptr %3, i64 12
  store <2 x float> <float 5.000000e-01, float -5.000000e-01>, ptr %58, align 4
  %59 = getelementptr inbounds i8, ptr %3, i64 28
  store float 5.000000e-01, ptr %59, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %60 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  call void %60(i32 noundef 1, ptr noundef nonnull %5)
  %61 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %61(i32 noundef 1, ptr noundef nonnull %4)
  %62 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %63 = load i32, ptr %5, align 4, !tbaa !9
  call void %62(i32 noundef %63)
  %64 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %65 = load i32, ptr %4, align 4, !tbaa !9
  call void %64(i32 noundef 34962, i32 noundef %65)
  %66 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %66(i32 noundef 34962, i64 noundef 36, ptr noundef nonnull %3, i32 noundef 35044)
  %67 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %67(i32 noundef 0, i32 noundef 3, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 12, ptr noundef null)
  %68 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %68(i32 noundef 0)
  %69 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  call void %69(i32 noundef 34962, i32 noundef 0)
  %70 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  call void %70(i32 noundef 0)
  %71 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %7)
  %.not2829 = icmp eq i32 %71, 0
  br i1 %.not2829, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %55, %.lr.ph
  call void @_Z12processInputP10GLFWwindow(ptr noundef nonnull %7)
  %72 = load ptr, ptr @glad_glClearColor, align 8, !tbaa !5
  call void %72(float noundef 0x3FC99999A0000000, float noundef 0x3FD3333340000000, float noundef 0x3FD3333340000000, float noundef 1.000000e+00)
  %73 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  call void %73(i32 noundef 16384)
  %74 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  call void %74(i32 noundef %44)
  %75 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !9
  call void %75(i32 noundef %76)
  %77 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !5
  call void %77(i32 noundef 4, i32 noundef 0, i32 noundef 3)
  call void @glfwSwapBuffers(ptr noundef nonnull %7)
  call void @glfwPollEvents()
  %78 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %7)
  %.not28 = icmp eq i32 %78, 0
  br i1 %.not28, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %55
  %79 = load ptr, ptr @glad_glDeleteVertexArrays, align 8, !tbaa !5
  call void %79(i32 noundef 1, ptr noundef nonnull %5)
  %80 = load ptr, ptr @glad_glDeleteBuffers, align 8, !tbaa !5
  call void %80(i32 noundef 1, ptr noundef nonnull %4)
  call void @glfwTerminate()
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  br label %81

81:                                               ; preds = %._crit_edge, %15, %9
  %.0 = phi i32 [ -1, %9 ], [ 0, %._crit_edge ], [ -1, %15 ]
  ret i32 %.0
}

declare i32 @glfwInit() local_unnamed_addr #2

declare void @glfwWindowHint(i32 noundef, i32 noundef) local_unnamed_addr #2

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

declare ptr @glfwCreateWindow(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

declare void @glfwTerminate() local_unnamed_addr #2

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #2

declare ptr @glfwSetFramebufferSizeCallback(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @gladLoadGLLoader(ptr noundef) local_unnamed_addr #2

declare ptr @glfwGetProcAddress(ptr noundef) #2

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

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #2

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #2

declare void @glfwPollEvents() local_unnamed_addr #2

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

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 = { mustprogress norecurse 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 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass