; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/tests (tearing)

; 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.anon = type { float, float }

@glad_glAttachShader = external dso_local global ptr, align 8
@glad_glBindBuffer = external dso_local global ptr, align 8
@glad_glBufferData = external dso_local global ptr, align 8
@glad_glClear = external dso_local global ptr, align 8
@glad_glCompileShader = external dso_local global ptr, align 8
@glad_glCreateProgram = external dso_local global ptr, align 8
@glad_glCreateShader = external dso_local global ptr, align 8
@glad_glDrawArrays = external dso_local global ptr, align 8
@glad_glEnableVertexAttribArray = external dso_local global ptr, align 8
@glad_glGenBuffers = external dso_local global ptr, align 8
@glad_glGetAttribLocation = external dso_local global ptr, align 8
@glad_glGetUniformLocation = external dso_local global ptr, align 8
@glad_glLinkProgram = external dso_local global ptr, align 8
@glad_glShaderSource = external dso_local global ptr, align 8
@glad_glUniformMatrix4fv = external dso_local global ptr, align 8
@glad_glUseProgram = external dso_local global ptr, align 8
@glad_glVertexAttribPointer = external dso_local global ptr, align 8
@glad_glViewport = external dso_local global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@frame_rate = external hidden global double, align 8
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@swap_tear = external hidden global i32, align 4
@vertices = external hidden constant [4 x %struct.anon], align 16
@vertex_shader_text = external hidden global ptr, align 8
@fragment_shader_text = external hidden global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local 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 i64, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca [4 x [4 x float]], align 16
  %19 = alloca [4 x [4 x float]], align 16
  %20 = alloca [4 x [4 x float]], align 16
  %21 = alloca float, align 4
  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
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %22 = call ptr @glfwSetErrorCallback(ptr noundef @error_callback)
  %23 = call i32 @glfwInit()
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %2
  call void @exit(i32 noundef 1) #7
  unreachable

26:                                               ; preds = %2
  call void @glfwWindowHint(i32 noundef 139266, i32 noundef 2)
  call void @glfwWindowHint(i32 noundef 139267, i32 noundef 0)
  %27 = call ptr @glfwCreateWindow(i32 noundef 640, i32 noundef 480, ptr noundef @.str.1, ptr noundef null, ptr noundef null)
  store ptr %27, ptr %9, align 8, !tbaa !9
  %28 = load ptr, ptr %9, align 8, !tbaa !9
  %29 = icmp ne ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @glfwTerminate()
  call void @exit(i32 noundef 1) #7
  unreachable

31:                                               ; preds = %26
  %32 = load ptr, ptr %9, align 8, !tbaa !9
  call void @glfwMakeContextCurrent(ptr noundef %32)
  %33 = call i32 @gladLoadGL(ptr noundef @glfwGetProcAddress)
  %34 = load ptr, ptr %9, align 8, !tbaa !9
  call void @set_swap_interval(ptr noundef %34, i32 noundef 0)
  %35 = call double @glfwGetTime()
  store double %35, ptr %7, align 8, !tbaa !13
  store double 0.000000e+00, ptr @frame_rate, align 8, !tbaa !13
  %36 = call i32 @glfwExtensionSupported(ptr noundef @.str.2)
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %41, label %38

38:                                               ; preds = %31
  %39 = call i32 @glfwExtensionSupported(ptr noundef @.str.3)
  %40 = icmp ne i32 %39, 0
  br label %41

41:                                               ; preds = %38, %31
  %42 = phi i1 [ true, %31 ], [ %40, %38 ]
  %43 = zext i1 %42 to i32
  store i32 %43, ptr @swap_tear, align 4, !tbaa !5
  %44 = load ptr, ptr %9, align 8, !tbaa !9
  %45 = call ptr @glfwSetKeyCallback(ptr noundef %44, ptr noundef @key_callback)
  %46 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !9
  call void %46(i32 noundef 1, ptr noundef %10)
  %47 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !9
  %48 = load i32, ptr %10, align 4, !tbaa !5
  call void %47(i32 noundef 34962, i32 noundef %48)
  %49 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !9
  call void %49(i32 noundef 34962, i64 noundef 32, ptr noundef @vertices, i32 noundef 35044)
  %50 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !9
  %51 = call i32 %50(i32 noundef 35633)
  store i32 %51, ptr %11, align 4, !tbaa !5
  %52 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !9
  %53 = load i32, ptr %11, align 4, !tbaa !5
  call void %52(i32 noundef %53, i32 noundef 1, ptr noundef @vertex_shader_text, ptr noundef null)
  %54 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !9
  %55 = load i32, ptr %11, align 4, !tbaa !5
  call void %54(i32 noundef %55)
  %56 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !9
  %57 = call i32 %56(i32 noundef 35632)
  store i32 %57, ptr %12, align 4, !tbaa !5
  %58 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !9
  %59 = load i32, ptr %12, align 4, !tbaa !5
  call void %58(i32 noundef %59, i32 noundef 1, ptr noundef @fragment_shader_text, ptr noundef null)
  %60 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !9
  %61 = load i32, ptr %12, align 4, !tbaa !5
  call void %60(i32 noundef %61)
  %62 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !9
  %63 = call i32 %62()
  store i32 %63, ptr %13, align 4, !tbaa !5
  %64 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !9
  %65 = load i32, ptr %13, align 4, !tbaa !5
  %66 = load i32, ptr %11, align 4, !tbaa !5
  call void %64(i32 noundef %65, i32 noundef %66)
  %67 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !9
  %68 = load i32, ptr %13, align 4, !tbaa !5
  %69 = load i32, ptr %12, align 4, !tbaa !5
  call void %67(i32 noundef %68, i32 noundef %69)
  %70 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !9
  %71 = load i32, ptr %13, align 4, !tbaa !5
  call void %70(i32 noundef %71)
  %72 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = call i32 %72(i32 noundef %73, ptr noundef @.str.4)
  store i32 %74, ptr %14, align 4, !tbaa !5
  %75 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !9
  %76 = load i32, ptr %13, align 4, !tbaa !5
  %77 = call i32 %75(i32 noundef %76, ptr noundef @.str.5)
  store i32 %77, ptr %15, align 4, !tbaa !5
  %78 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !9
  %79 = load i32, ptr %15, align 4, !tbaa !5
  call void %78(i32 noundef %79)
  %80 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !9
  %81 = load i32, ptr %15, align 4, !tbaa !5
  call void %80(i32 noundef %81, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  br label %82

82:                                               ; preds = %127, %41
  %83 = load ptr, ptr %9, align 8, !tbaa !9
  %84 = call i32 @glfwWindowShouldClose(ptr noundef %83)
  %85 = icmp ne i32 %84, 0
  %86 = xor i1 %85, true
  br i1 %86, label %87, label %128

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %88 = call double @glfwGetTime()
  %89 = fptrunc double %88 to float
  %90 = fmul float %89, 4.000000e+00
  %91 = call float @cosf(float noundef %90) #6
  %92 = fmul float %91, 7.500000e-01
  store float %92, ptr %21, align 4, !tbaa !15
  %93 = load ptr, ptr %9, align 8, !tbaa !9
  call void @glfwGetFramebufferSize(ptr noundef %93, ptr noundef %16, ptr noundef %17)
  %94 = load ptr, ptr @glad_glViewport, align 8, !tbaa !9
  %95 = load i32, ptr %16, align 4, !tbaa !5
  %96 = load i32, ptr %17, align 4, !tbaa !5
  call void %94(i32 noundef 0, i32 noundef 0, i32 noundef %95, i32 noundef %96)
  %97 = load ptr, ptr @glad_glClear, align 8, !tbaa !9
  call void %97(i32 noundef 16384)
  %98 = getelementptr inbounds [4 x [4 x float]], ptr %19, i64 0, i64 0
  call void @mat4x4_ortho(ptr noundef %98, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %99 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  %100 = load float, ptr %21, align 4, !tbaa !15
  call void @mat4x4_translate(ptr noundef %99, float noundef %100, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %101 = getelementptr inbounds [4 x [4 x float]], ptr %20, i64 0, i64 0
  %102 = getelementptr inbounds [4 x [4 x float]], ptr %19, i64 0, i64 0
  %103 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  call void @mat4x4_mul(ptr noundef %101, ptr noundef %102, ptr noundef %103)
  %104 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !9
  %105 = load i32, ptr %13, align 4, !tbaa !5
  call void %104(i32 noundef %105)
  %106 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !9
  %107 = load i32, ptr %14, align 4, !tbaa !5
  %108 = getelementptr inbounds [4 x [4 x float]], ptr %20, i64 0, i64 0
  call void %106(i32 noundef %107, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %108)
  %109 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !9
  call void %109(i32 noundef 6, i32 noundef 0, i32 noundef 4)
  %110 = load ptr, ptr %9, align 8, !tbaa !9
  call void @glfwSwapBuffers(ptr noundef %110)
  call void @glfwPollEvents()
  %111 = load i64, ptr %6, align 8, !tbaa !11
  %112 = add i64 %111, 1
  store i64 %112, ptr %6, align 8, !tbaa !11
  %113 = call double @glfwGetTime()
  store double %113, ptr %8, align 8, !tbaa !13
  %114 = load double, ptr %8, align 8, !tbaa !13
  %115 = load double, ptr %7, align 8, !tbaa !13
  %116 = fsub double %114, %115
  %117 = fcmp ogt double %116, 1.000000e+00
  br i1 %117, label %118, label %127

118:                                              ; preds = %87
  %119 = load i64, ptr %6, align 8, !tbaa !11
  %120 = uitofp i64 %119 to double
  %121 = load double, ptr %8, align 8, !tbaa !13
  %122 = load double, ptr %7, align 8, !tbaa !13
  %123 = fsub double %121, %122
  %124 = fdiv double %120, %123
  store double %124, ptr @frame_rate, align 8, !tbaa !13
  store i64 0, ptr %6, align 8, !tbaa !11
  %125 = load double, ptr %8, align 8, !tbaa !13
  store double %125, ptr %7, align 8, !tbaa !13
  %126 = load ptr, ptr %9, align 8, !tbaa !9
  call void @update_window_title(ptr noundef %126)
  br label %127

127:                                              ; preds = %118, %87
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %82, !llvm.loop !17

128:                                              ; preds = %82
  call void @glfwTerminate()
  call void @exit(i32 noundef 0) #7
  unreachable
}

declare ptr @glfwSetErrorCallback(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @error_callback(i32 noundef, ptr noundef) #1

declare i32 @glfwInit() #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

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

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

declare void @glfwTerminate() #2

declare void @glfwMakeContextCurrent(ptr noundef) #2

declare ptr @glfwGetProcAddress(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @set_swap_interval(ptr noundef, i32 noundef) #1

declare double @glfwGetTime() #2

declare i32 @glfwExtensionSupported(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
declare hidden void @key_callback(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare i32 @glfwWindowShouldClose(ptr noundef) #2

; Function Attrs: nounwind
declare float @cosf(float noundef) #4

declare void @glfwGetFramebufferSize(ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mat4x4_ortho(ptr noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mat4x4_translate(ptr noundef, float noundef, float noundef, float noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mat4x4_mul(ptr noundef, ptr noundef, ptr noundef) #5

declare void @glfwSwapBuffers(ptr noundef) #2

declare void @glfwPollEvents() #2

; Function Attrs: nounwind uwtable
declare hidden void @update_window_title(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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 = { 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 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"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.anon = type { float, float }

@glad_glAttachShader = external dso_local local_unnamed_addr global ptr, align 8
@glad_glBindBuffer = external dso_local local_unnamed_addr global ptr, align 8
@glad_glBufferData = external dso_local local_unnamed_addr global ptr, align 8
@glad_glClear = external dso_local local_unnamed_addr global ptr, align 8
@glad_glCompileShader = external dso_local local_unnamed_addr global ptr, align 8
@glad_glCreateProgram = external dso_local local_unnamed_addr global ptr, align 8
@glad_glCreateShader = external dso_local local_unnamed_addr global ptr, align 8
@glad_glDrawArrays = external dso_local local_unnamed_addr global ptr, align 8
@glad_glEnableVertexAttribArray = external dso_local local_unnamed_addr global ptr, align 8
@glad_glGenBuffers = external dso_local local_unnamed_addr global ptr, align 8
@glad_glGetAttribLocation = external dso_local local_unnamed_addr global ptr, align 8
@glad_glGetUniformLocation = external dso_local local_unnamed_addr global ptr, align 8
@glad_glLinkProgram = external dso_local local_unnamed_addr global ptr, align 8
@glad_glShaderSource = external dso_local local_unnamed_addr global ptr, align 8
@glad_glUniformMatrix4fv = external dso_local local_unnamed_addr global ptr, align 8
@glad_glUseProgram = external dso_local local_unnamed_addr global ptr, align 8
@glad_glVertexAttribPointer = external dso_local local_unnamed_addr global ptr, align 8
@glad_glViewport = external dso_local local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@frame_rate = external hidden local_unnamed_addr global double, align 8
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [26 x i8], align 1
@swap_tear = external hidden local_unnamed_addr global i32, align 4
@vertices = external hidden constant [4 x %struct.anon], align 16
@vertex_shader_text = external hidden global ptr, align 8
@fragment_shader_text = external hidden global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1

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

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

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

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [4 x [4 x float]], align 16
  %7 = alloca [4 x [4 x float]], align 16
  %8 = alloca [4 x [4 x float]], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %9 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @error_callback) #7
  %10 = tail call i32 @glfwInit() #7
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %11, label %12

11:                                               ; preds = %2
  tail call void @exit(i32 noundef 1) #8
  unreachable

12:                                               ; preds = %2
  tail call void @glfwWindowHint(i32 noundef 139266, i32 noundef 2) #7
  tail call void @glfwWindowHint(i32 noundef 139267, i32 noundef 0) #7
  %13 = tail call ptr @glfwCreateWindow(i32 noundef 640, i32 noundef 480, ptr noundef nonnull @.str.1, ptr noundef null, ptr noundef null) #7
  %.not34 = icmp eq ptr %13, null
  br i1 %.not34, label %14, label %15

14:                                               ; preds = %12
  tail call void @glfwTerminate() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

15:                                               ; preds = %12
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %13) #7
  %16 = tail call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  tail call void @set_swap_interval(ptr noundef nonnull %13, i32 noundef 0)
  %17 = tail call double @glfwGetTime() #7
  store double 0.000000e+00, ptr @frame_rate, align 8, !tbaa !5
  %18 = tail call i32 @glfwExtensionSupported(ptr noundef nonnull @.str.2) #7
  %.not35 = icmp eq i32 %18, 0
  br i1 %.not35, label %19, label %23

19:                                               ; preds = %15
  %20 = tail call i32 @glfwExtensionSupported(ptr noundef nonnull @.str.3) #7
  %21 = icmp ne i32 %20, 0
  %22 = zext i1 %21 to i32
  br label %23

23:                                               ; preds = %19, %15
  %24 = phi i32 [ 1, %15 ], [ %22, %19 ]
  store i32 %24, ptr @swap_tear, align 4, !tbaa !9
  %25 = tail call ptr @glfwSetKeyCallback(ptr noundef nonnull %13, ptr noundef nonnull @key_callback) #7
  %26 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !11
  call void %26(i32 noundef 1, ptr noundef nonnull %3) #7
  %27 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !11
  %28 = load i32, ptr %3, align 4, !tbaa !9
  call void %27(i32 noundef 34962, i32 noundef %28) #7
  %29 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !11
  call void %29(i32 noundef 34962, i64 noundef 32, ptr noundef nonnull @vertices, i32 noundef 35044) #7
  %30 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !11
  %31 = call i32 %30(i32 noundef 35633) #7
  %32 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !11
  call void %32(i32 noundef %31, i32 noundef 1, ptr noundef nonnull @vertex_shader_text, ptr noundef null) #7
  %33 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !11
  call void %33(i32 noundef %31) #7
  %34 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !11
  %35 = call i32 %34(i32 noundef 35632) #7
  %36 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !11
  call void %36(i32 noundef %35, i32 noundef 1, ptr noundef nonnull @fragment_shader_text, ptr noundef null) #7
  %37 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !11
  call void %37(i32 noundef %35) #7
  %38 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !11
  %39 = call i32 %38() #7
  %40 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !11
  call void %40(i32 noundef %39, i32 noundef %31) #7
  %41 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !11
  call void %41(i32 noundef %39, i32 noundef %35) #7
  %42 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !11
  call void %42(i32 noundef %39) #7
  %43 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !11
  %44 = call i32 %43(i32 noundef %39, ptr noundef nonnull @.str.4) #7
  %45 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !11
  %46 = call i32 %45(i32 noundef %39, ptr noundef nonnull @.str.5) #7
  %47 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !11
  call void %47(i32 noundef %46) #7
  %48 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !11
  call void %48(i32 noundef %46, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null) #7
  %49 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %13) #7
  %.not3637 = icmp eq i32 %49, 0
  br i1 %.not3637, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %23, %69
  %.039 = phi i64 [ %.1, %69 ], [ 0, %23 ]
  %.03038 = phi double [ %.131, %69 ], [ %17, %23 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #7
  %50 = call double @glfwGetTime() #7
  %51 = fptrunc double %50 to float
  %52 = fmul float %51, 4.000000e+00
  %53 = call float @cosf(float noundef %52) #7
  %54 = fmul float %53, 7.500000e-01
  call void @glfwGetFramebufferSize(ptr noundef nonnull %13, ptr noundef nonnull %4, ptr noundef nonnull %5) #7
  %55 = load ptr, ptr @glad_glViewport, align 8, !tbaa !11
  %56 = load i32, ptr %4, align 4, !tbaa !9
  %57 = load i32, ptr %5, align 4, !tbaa !9
  call void %55(i32 noundef 0, i32 noundef 0, i32 noundef %56, i32 noundef %57) #7
  %58 = load ptr, ptr @glad_glClear, align 8, !tbaa !11
  call void %58(i32 noundef 16384) #7
  call void @mat4x4_ortho(ptr noundef nonnull %7, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @mat4x4_translate(ptr noundef nonnull %6, float noundef %54, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @mat4x4_mul(ptr noundef nonnull %8, ptr noundef nonnull %7, ptr noundef nonnull %6)
  %59 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !11
  call void %59(i32 noundef %39) #7
  %60 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !11
  call void %60(i32 noundef %44, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %8) #7
  %61 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !11
  call void %61(i32 noundef 6, i32 noundef 0, i32 noundef 4) #7
  call void @glfwSwapBuffers(ptr noundef nonnull %13) #7
  call void @glfwPollEvents() #7
  %62 = add i64 %.039, 1
  %63 = call double @glfwGetTime() #7
  %64 = fsub double %63, %.03038
  %65 = fcmp ogt double %64, 1.000000e+00
  br i1 %65, label %66, label %69

66:                                               ; preds = %.lr.ph
  %67 = uitofp i64 %62 to double
  %68 = fdiv double %67, %64
  store double %68, ptr @frame_rate, align 8, !tbaa !5
  call void @update_window_title(ptr noundef nonnull %13)
  br label %69

69:                                               ; preds = %66, %.lr.ph
  %.131 = phi double [ %63, %66 ], [ %.03038, %.lr.ph ]
  %.1 = phi i64 [ 0, %66 ], [ %62, %.lr.ph ]
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  %70 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %13) #7
  %.not36 = icmp eq i32 %70, 0
  br i1 %.not36, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %69, %23
  call void @glfwTerminate() #7
  call void @exit(i32 noundef 0) #8
  unreachable
}

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @error_callback(i32 noundef, ptr noundef) #1

declare i32 @glfwInit() local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

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

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

declare void @glfwTerminate() local_unnamed_addr #3

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #3

declare ptr @glfwGetProcAddress(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @set_swap_interval(ptr noundef, i32 noundef) local_unnamed_addr #1

declare double @glfwGetTime() local_unnamed_addr #3

declare i32 @glfwExtensionSupported(ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare hidden void @key_callback(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @cosf(float noundef) local_unnamed_addr #5

declare void @glfwGetFramebufferSize(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mat4x4_ortho(ptr noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mat4x4_translate(ptr noundef, float noundef, float noundef, float noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mat4x4_mul(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #3

declare void @glfwPollEvents() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @update_window_title(ptr noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { inlinehint 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 #7 = { nounwind }
attributes #8 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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