; LLVM IR from blat-blatnik/Painted-Portal-Ray-Tracing :: src (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"

%struct.gladGLversionStruct = type { i32, i32 }

@GLVersion = external dso_local global %struct.gladGLversionStruct, align 4
@glad_glDebugMessageCallback = external dso_local global ptr, align 8
@glad_glEnable = external dso_local global ptr, align 8
@glad_glGetError = external dso_local global ptr, align 8
@glad_glGetString = external dso_local global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [36 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  %17 = call ptr @glfwSetErrorCallback(ptr noundef @_ZL11onGlfwErroriPKc)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %18 = call i32 @glfwInit()
  store i32 %18, ptr %6, align 4, !tbaa !5
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %22

21:                                               ; preds = %2
  br label %24

22:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 47, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

23:                                               ; No predecessors!
  br label %24

24:                                               ; preds = %23, %21
  call void @glfwWindowHint(i32 noundef 135173, i32 noundef 0)
  call void @glfwWindowHint(i32 noundef 135174, i32 noundef 0)
  call void @glfwWindowHint(i32 noundef 139266, i32 noundef 4)
  call void @glfwWindowHint(i32 noundef 139267, i32 noundef 3)
  call void @glfwWindowHint(i32 noundef 139270, i32 noundef 1)
  call void @glfwWindowHint(i32 noundef 139272, i32 noundef 204801)
  call void @glfwWindowHint(i32 noundef 139271, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %25 = call ptr @glfwCreateWindow(i32 noundef 1280, i32 noundef 720, ptr noundef @.str.3, ptr noundef null, ptr noundef null)
  store ptr %25, ptr %7, align 8, !tbaa !9
  %26 = load ptr, ptr %7, align 8, !tbaa !9
  %27 = icmp ne ptr %26, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  br label %31

29:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.2, i32 noundef 63, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

30:                                               ; No predecessors!
  br label %31

31:                                               ; preds = %30, %28
  %32 = load ptr, ptr %7, align 8, !tbaa !9
  call void @glfwMakeContextCurrent(ptr noundef %32)
  call void @glfwSwapInterval(i32 noundef 1)
  %33 = load ptr, ptr %7, align 8, !tbaa !9
  call void @glfwSetInputMode(ptr noundef %33, i32 noundef 208897, i32 noundef 212995)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %34 = call i32 @gladLoadGLLoader(ptr noundef @glfwGetProcAddress)
  store i32 %34, ptr %8, align 4, !tbaa !5
  %35 = load i32, ptr %8, align 4, !tbaa !5
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %31
  br label %40

38:                                               ; preds = %31
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 73, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

39:                                               ; No predecessors!
  br label %40

40:                                               ; preds = %39, %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %41 = load ptr, ptr @glad_glGetString, align 8, !tbaa !9
  %42 = call ptr %41(i32 noundef 7937)
  store ptr %42, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %43 = load ptr, ptr @glad_glGetString, align 8, !tbaa !9
  %44 = call ptr %43(i32 noundef 7938)
  store ptr %44, ptr %10, align 8, !tbaa !9
  %45 = load ptr, ptr %10, align 8, !tbaa !9
  %46 = load ptr, ptr %9, align 8, !tbaa !9
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %45, ptr noundef %46)
  %48 = load i32, ptr @GLVersion, align 4, !tbaa !11
  %49 = icmp slt i32 %48, 4
  br i1 %49, label %56, label %50

50:                                               ; preds = %40
  %51 = load i32, ptr @GLVersion, align 4, !tbaa !11
  %52 = icmp eq i32 %51, 4
  br i1 %52, label %53, label %58

53:                                               ; preds = %50
  %54 = load i32, ptr getelementptr inbounds (%struct.gladGLversionStruct, ptr @GLVersion, i32 0, i32 1), align 4, !tbaa !13
  %55 = icmp slt i32 %54, 6
  br i1 %55, label %56, label %58

56:                                               ; preds = %53, %40
  %57 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  call void @abort() #6
  unreachable

58:                                               ; preds = %53, %50
  %59 = load ptr, ptr @glad_glEnable, align 8, !tbaa !9
  call void %59(i32 noundef 36281)
  %60 = load ptr, ptr @glad_glEnable, align 8, !tbaa !9
  call void %60(i32 noundef 37600)
  %61 = load ptr, ptr @glad_glDebugMessageCallback, align 8, !tbaa !9
  call void %61(ptr noundef @_ZL9onGlErrorjjjjiPKcPKv, ptr noundef null)
  br label %62

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %63 = load ptr, ptr @glad_glGetError, align 8, !tbaa !9
  %64 = call i32 %63()
  store i32 %64, ptr %11, align 4, !tbaa !5
  %65 = load i32, ptr %11, align 4, !tbaa !5
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %81

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %68 = load i32, ptr %11, align 4, !tbaa !5
  switch i32 %68, label %76 [
    i32 1280, label %69
    i32 1281, label %70
    i32 1282, label %71
    i32 1283, label %72
    i32 1284, label %73
    i32 1285, label %74
    i32 1286, label %75
  ]

69:                                               ; preds = %67
  store ptr @.str.8, ptr %12, align 8, !tbaa !9
  br label %77

70:                                               ; preds = %67
  store ptr @.str.9, ptr %12, align 8, !tbaa !9
  br label %77

71:                                               ; preds = %67
  store ptr @.str.10, ptr %12, align 8, !tbaa !9
  br label %77

72:                                               ; preds = %67
  store ptr @.str.11, ptr %12, align 8, !tbaa !9
  br label %77

73:                                               ; preds = %67
  store ptr @.str.12, ptr %12, align 8, !tbaa !9
  br label %77

74:                                               ; preds = %67
  store ptr @.str.13, ptr %12, align 8, !tbaa !9
  br label %77

75:                                               ; preds = %67
  store ptr @.str.14, ptr %12, align 8, !tbaa !9
  br label %77

76:                                               ; preds = %67
  store ptr @.str.15, ptr %12, align 8, !tbaa !9
  br label %77

77:                                               ; preds = %76, %75, %74, %73, %72, %71, %70, %69
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = load ptr, ptr %12, align 8, !tbaa !9
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %78, ptr noundef %79, ptr noundef @.str.2, i32 noundef 93, ptr noundef @__func__.main)
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.2, i32 noundef 93, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

81:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %82

82:                                               ; preds = %81
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %7, align 8, !tbaa !9
  %85 = call ptr @glfwSetKeyCallback(ptr noundef %84, ptr noundef @_Z9gameOnKeyP10GLFWwindowiiii)
  %86 = load ptr, ptr %7, align 8, !tbaa !9
  %87 = call ptr @glfwSetCursorPosCallback(ptr noundef %86, ptr noundef @_Z15gameOnMouseMoveP10GLFWwindowdd)
  %88 = load ptr, ptr %7, align 8, !tbaa !9
  %89 = call ptr @glfwSetMouseButtonCallback(ptr noundef %88, ptr noundef @_Z17gameOnMouseButtonP10GLFWwindowiii)
  %90 = load ptr, ptr %7, align 8, !tbaa !9
  %91 = call ptr @glfwSetScrollCallback(ptr noundef %90, ptr noundef @_Z16gameOnMouseWheelP10GLFWwindowdd)
  %92 = load ptr, ptr %7, align 8, !tbaa !9
  call void @_Z8gameInitP10GLFWwindow(ptr noundef %92)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %93 = call i64 @glfwGetTimerValue()
  store i64 %93, ptr %13, align 8, !tbaa !14
  br label %94

94:                                               ; preds = %129, %83
  %95 = load ptr, ptr %7, align 8, !tbaa !9
  %96 = call i32 @glfwWindowShouldClose(ptr noundef %95)
  %97 = icmp ne i32 %96, 0
  %98 = xor i1 %97, true
  br i1 %98, label %99, label %131

99:                                               ; preds = %94
  call void @glfwPollEvents()
  call void @_Z17checkTrackedFilesv()
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %100 = call i64 @glfwGetTimerValue()
  store i64 %100, ptr %14, align 8, !tbaa !14
  %101 = load i64, ptr %14, align 8, !tbaa !14
  %102 = load i64, ptr %13, align 8, !tbaa !14
  %103 = sub i64 %101, %102
  %104 = uitofp i64 %103 to double
  %105 = call i64 @glfwGetTimerFrequency()
  %106 = uitofp i64 %105 to double
  %107 = fdiv double %104, %106
  call void @_Z10gameUpdated(double noundef %107)
  br label %108

108:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %109 = load ptr, ptr @glad_glGetError, align 8, !tbaa !9
  %110 = call i32 %109()
  store i32 %110, ptr %15, align 4, !tbaa !5
  %111 = load i32, ptr %15, align 4, !tbaa !5
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %127

113:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %114 = load i32, ptr %15, align 4, !tbaa !5
  switch i32 %114, label %122 [
    i32 1280, label %115
    i32 1281, label %116
    i32 1282, label %117
    i32 1283, label %118
    i32 1284, label %119
    i32 1285, label %120
    i32 1286, label %121
  ]

115:                                              ; preds = %113
  store ptr @.str.8, ptr %16, align 8, !tbaa !9
  br label %123

116:                                              ; preds = %113
  store ptr @.str.9, ptr %16, align 8, !tbaa !9
  br label %123

117:                                              ; preds = %113
  store ptr @.str.10, ptr %16, align 8, !tbaa !9
  br label %123

118:                                              ; preds = %113
  store ptr @.str.11, ptr %16, align 8, !tbaa !9
  br label %123

119:                                              ; preds = %113
  store ptr @.str.12, ptr %16, align 8, !tbaa !9
  br label %123

120:                                              ; preds = %113
  store ptr @.str.13, ptr %16, align 8, !tbaa !9
  br label %123

121:                                              ; preds = %113
  store ptr @.str.14, ptr %16, align 8, !tbaa !9
  br label %123

122:                                              ; preds = %113
  store ptr @.str.15, ptr %16, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %122, %121, %120, %119, %118, %117, %116, %115
  %124 = load i32, ptr %15, align 4, !tbaa !5
  %125 = load ptr, ptr %16, align 8, !tbaa !9
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %124, ptr noundef %125, ptr noundef @.str.2, i32 noundef 110, ptr noundef @__func__.main)
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.2, i32 noundef 110, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

127:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %128

128:                                              ; preds = %127
  br label %129

129:                                              ; preds = %128
  %130 = load i64, ptr %14, align 8, !tbaa !14
  store i64 %130, ptr %13, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %94, !llvm.loop !16

131:                                              ; preds = %94
  call void @_Z13gameTerminatev()
  %132 = load ptr, ptr %7, align 8, !tbaa !9
  call void @glfwDestroyWindow(ptr noundef %132)
  call void @glfwTerminate()
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %6) #5
  ret i32 0
}

declare ptr @glfwSetErrorCallback(ptr noundef) #2

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

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

declare i32 @glfwInit() #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

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

declare void @glfwMakeContextCurrent(ptr noundef) #2

declare void @glfwSwapInterval(i32 noundef) #2

declare void @glfwSetInputMode(ptr noundef, i32 noundef, i32 noundef) #2

declare ptr @glfwGetProcAddress(ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: noreturn nounwind
declare void @abort() #4

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

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

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

declare void @_Z9gameOnKeyP10GLFWwindowiiii(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

declare void @_Z15gameOnMouseMoveP10GLFWwindowdd(ptr noundef, double noundef, double noundef) #2

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

declare void @_Z17gameOnMouseButtonP10GLFWwindowiii(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

declare void @_Z16gameOnMouseWheelP10GLFWwindowdd(ptr noundef, double noundef, double noundef) #2

declare void @_Z8gameInitP10GLFWwindow(ptr noundef) #2

declare i64 @glfwGetTimerValue() #2

declare i32 @glfwWindowShouldClose(ptr noundef) #2

declare void @glfwPollEvents() #2

declare void @_Z17checkTrackedFilesv() #2

declare void @_Z10gameUpdated(double noundef) #2

declare i64 @glfwGetTimerFrequency() #2

declare void @_Z13gameTerminatev() #2

declare void @glfwDestroyWindow(ptr noundef) #2

declare void @glfwTerminate() #2

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 = { noreturn 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 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"_ZTS19gladGLversionStruct", !6, i64 0, !6, i64 4}
!13 = !{!12, !6, i64 4}
!14 = !{!15, !15, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"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"

%struct.gladGLversionStruct = type { i32, i32 }

@GLVersion = external dso_local local_unnamed_addr global %struct.gladGLversionStruct, align 4
@glad_glDebugMessageCallback = external dso_local local_unnamed_addr global ptr, align 8
@glad_glEnable = external dso_local local_unnamed_addr global ptr, align 8
@glad_glGetError = external dso_local local_unnamed_addr global ptr, align 8
@glad_glGetString = external dso_local local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [86 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [23 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [36 x i8], align 1
@__func__.main = external hidden unnamed_addr constant [5 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #1 {
  %3 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @_ZL11onGlfwErroriPKc)
  %4 = tail call i32 @glfwInit()
  %5 = icmp eq i32 %4, 1
  br i1 %5, label %7, label %6

6:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 47, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

7:                                                ; preds = %2
  tail call void @glfwWindowHint(i32 noundef 135173, i32 noundef 0)
  tail call void @glfwWindowHint(i32 noundef 135174, i32 noundef 0)
  tail call void @glfwWindowHint(i32 noundef 139266, i32 noundef 4)
  tail call void @glfwWindowHint(i32 noundef 139267, i32 noundef 3)
  tail call void @glfwWindowHint(i32 noundef 139270, i32 noundef 1)
  tail call void @glfwWindowHint(i32 noundef 139272, i32 noundef 204801)
  tail call void @glfwWindowHint(i32 noundef 139271, i32 noundef 1)
  %8 = tail call ptr @glfwCreateWindow(i32 noundef 1280, i32 noundef 720, ptr noundef nonnull @.str.3, ptr noundef null, ptr noundef null)
  %.not = icmp eq ptr %8, null
  br i1 %.not, label %9, label %10

9:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.2, i32 noundef 63, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

10:                                               ; preds = %7
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %8)
  tail call void @glfwSwapInterval(i32 noundef 1)
  tail call void @glfwSetInputMode(ptr noundef nonnull %8, i32 noundef 208897, i32 noundef 212995)
  %11 = tail call i32 @gladLoadGLLoader(ptr noundef nonnull @glfwGetProcAddress)
  %.not31 = icmp eq i32 %11, 0
  br i1 %.not31, label %12, label %13

12:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 73, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

13:                                               ; preds = %10
  %14 = load ptr, ptr @glad_glGetString, align 8, !tbaa !5
  %15 = tail call ptr %14(i32 noundef 7937)
  %16 = load ptr, ptr @glad_glGetString, align 8, !tbaa !5
  %17 = tail call ptr %16(i32 noundef 7938)
  %18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %17, ptr noundef %15)
  %19 = load i32, ptr @GLVersion, align 4, !tbaa !9
  %20 = icmp slt i32 %19, 4
  br i1 %20, label %25, label %21

21:                                               ; preds = %13
  %22 = icmp eq i32 %19, 4
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @GLVersion, i64 4), align 4
  %24 = icmp slt i32 %23, 6
  %or.cond = select i1 %22, i1 %24, i1 false
  br i1 %or.cond, label %25, label %27

25:                                               ; preds = %21, %13
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  tail call void @abort() #5
  unreachable

27:                                               ; preds = %21
  %28 = load ptr, ptr @glad_glEnable, align 8, !tbaa !5
  tail call void %28(i32 noundef 36281)
  %29 = load ptr, ptr @glad_glEnable, align 8, !tbaa !5
  tail call void %29(i32 noundef 37600)
  %30 = load ptr, ptr @glad_glDebugMessageCallback, align 8, !tbaa !5
  tail call void %30(ptr noundef nonnull @_ZL9onGlErrorjjjjiPKcPKv, ptr noundef null)
  %31 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %32 = tail call i32 %31()
  switch i32 %32, label %39 [
    i32 0, label %42
    i32 1280, label %40
    i32 1281, label %33
    i32 1282, label %34
    i32 1283, label %35
    i32 1284, label %36
    i32 1285, label %37
    i32 1286, label %38
  ]

33:                                               ; preds = %27
  br label %40

34:                                               ; preds = %27
  br label %40

35:                                               ; preds = %27
  br label %40

36:                                               ; preds = %27
  br label %40

37:                                               ; preds = %27
  br label %40

38:                                               ; preds = %27
  br label %40

39:                                               ; preds = %27
  br label %40

40:                                               ; preds = %27, %39, %38, %37, %36, %35, %34, %33
  %.025 = phi ptr [ @.str.15, %39 ], [ @.str.14, %38 ], [ @.str.13, %37 ], [ @.str.12, %36 ], [ @.str.11, %35 ], [ @.str.10, %34 ], [ @.str.9, %33 ], [ @.str.8, %27 ]
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef %32, ptr noundef nonnull %.025, ptr noundef nonnull @.str.2, i32 noundef 93, ptr noundef nonnull @__func__.main)
  tail call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.2, i32 noundef 93, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

42:                                               ; preds = %27
  %43 = tail call ptr @glfwSetKeyCallback(ptr noundef nonnull %8, ptr noundef nonnull @_Z9gameOnKeyP10GLFWwindowiiii)
  %44 = tail call ptr @glfwSetCursorPosCallback(ptr noundef nonnull %8, ptr noundef nonnull @_Z15gameOnMouseMoveP10GLFWwindowdd)
  %45 = tail call ptr @glfwSetMouseButtonCallback(ptr noundef nonnull %8, ptr noundef nonnull @_Z17gameOnMouseButtonP10GLFWwindowiii)
  %46 = tail call ptr @glfwSetScrollCallback(ptr noundef nonnull %8, ptr noundef nonnull @_Z16gameOnMouseWheelP10GLFWwindowdd)
  tail call void @_Z8gameInitP10GLFWwindow(ptr noundef nonnull %8)
  %47 = tail call i64 @glfwGetTimerValue()
  br label %48

48:                                               ; preds = %50, %42
  %.026 = phi i64 [ %47, %42 ], [ %51, %50 ]
  %49 = tail call i32 @glfwWindowShouldClose(ptr noundef nonnull %8)
  %.not33 = icmp eq i32 %49, 0
  br i1 %.not33, label %50, label %63

50:                                               ; preds = %48
  tail call void @glfwPollEvents()
  tail call void @_Z17checkTrackedFilesv()
  %51 = tail call i64 @glfwGetTimerValue()
  %52 = sub i64 %51, %.026
  %53 = uitofp i64 %52 to double
  %54 = tail call i64 @glfwGetTimerFrequency()
  %55 = uitofp i64 %54 to double
  %56 = fdiv double %53, %55
  tail call void @_Z10gameUpdated(double noundef %56)
  %57 = load ptr, ptr @glad_glGetError, align 8, !tbaa !5
  %58 = tail call i32 %57()
  switch i32 %58, label %60 [
    i32 0, label %48
    i32 1280, label %.loopexit
    i32 1281, label %.loopexit42
    i32 1282, label %.loopexit50
    i32 1283, label %.loopexit58
    i32 1284, label %.loopexit66
    i32 1285, label %61
    i32 1286, label %59
  ], !llvm.loop !12

59:                                               ; preds = %50
  br label %61

60:                                               ; preds = %50
  br label %61

.loopexit:                                        ; preds = %50
  br label %61

.loopexit42:                                      ; preds = %50
  br label %61

.loopexit50:                                      ; preds = %50
  br label %61

.loopexit58:                                      ; preds = %50
  br label %61

.loopexit66:                                      ; preds = %50
  br label %61

61:                                               ; preds = %50, %.loopexit66, %.loopexit58, %.loopexit50, %.loopexit42, %.loopexit, %60, %59
  %.0 = phi ptr [ @.str.15, %60 ], [ @.str.14, %59 ], [ @.str.8, %.loopexit ], [ @.str.9, %.loopexit42 ], [ @.str.10, %.loopexit50 ], [ @.str.11, %.loopexit58 ], [ @.str.12, %.loopexit66 ], [ @.str.13, %50 ]
  %62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, i32 noundef %58, ptr noundef nonnull %.0, ptr noundef nonnull @.str.2, i32 noundef 110, ptr noundef nonnull @__func__.main)
  tail call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.2, i32 noundef 110, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #5
  unreachable

63:                                               ; preds = %48
  tail call void @_Z13gameTerminatev()
  tail call void @glfwDestroyWindow(ptr noundef nonnull %8)
  tail call void @glfwTerminate()
  ret i32 0
}

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #2

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

declare i32 @glfwInit() local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

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

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #2

declare void @glfwSwapInterval(i32 noundef) local_unnamed_addr #2

declare void @glfwSetInputMode(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare ptr @glfwGetProcAddress(ptr noundef) #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #3

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

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

declare void @_Z9gameOnKeyP10GLFWwindowiiii(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

declare void @_Z15gameOnMouseMoveP10GLFWwindowdd(ptr noundef, double noundef, double noundef) #2

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

declare void @_Z17gameOnMouseButtonP10GLFWwindowiii(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

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

declare void @_Z16gameOnMouseWheelP10GLFWwindowdd(ptr noundef, double noundef, double noundef) #2

declare void @_Z8gameInitP10GLFWwindow(ptr noundef) local_unnamed_addr #2

declare i64 @glfwGetTimerValue() local_unnamed_addr #2

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #2

declare void @glfwPollEvents() local_unnamed_addr #2

declare void @_Z17checkTrackedFilesv() local_unnamed_addr #2

declare void @_Z10gameUpdated(double noundef) local_unnamed_addr #2

declare i64 @glfwGetTimerFrequency() local_unnamed_addr #2

declare void @_Z13gameTerminatev() local_unnamed_addr #2

declare void @glfwDestroyWindow(ptr noundef) local_unnamed_addr #2

declare void @glfwTerminate() local_unnamed_addr #2

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 = { noreturn 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 #4 = { nofree 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 = { noreturn 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, !11, i64 0}
!10 = !{!"_ZTS19gladGLversionStruct", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass