; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/examples (triangle-opengl)

; 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.Vertex = type { [2 x float], [3 x float] }

@glad_glAttachShader = external dso_local global ptr, align 8
@glad_glBindBuffer = external dso_local global ptr, align 8
@glad_glBindVertexArray = 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_glGenVertexArrays = 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 [16 x i8], align 1
@vertices = external hidden constant [3 x %struct.Vertex], align 16
@vertex_shader_text = external hidden global ptr, align 8
@fragment_shader_text = external hidden global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = 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() #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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca float, align 4
  %14 = alloca [4 x [4 x float]], align 16
  %15 = alloca [4 x [4 x float]], align 16
  %16 = alloca [4 x [4 x float]], align 16
  store i32 0, ptr %1, align 4
  %17 = call ptr @glfwSetErrorCallback(ptr noundef @error_callback)
  %18 = call i32 @glfwInit()
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %21, label %20

20:                                               ; preds = %0
  call void @exit(i32 noundef 1) #5
  unreachable

21:                                               ; preds = %0
  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
  %22 = call ptr @glfwCreateWindow(i32 noundef 640, i32 noundef 480, ptr noundef @.str.1, ptr noundef null, ptr noundef null)
  store ptr %22, ptr %2, align 8, !tbaa !5
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @glfwTerminate()
  call void @exit(i32 noundef 1) #5
  unreachable

26:                                               ; preds = %21
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = call ptr @glfwSetKeyCallback(ptr noundef %27, ptr noundef @key_callback)
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  call void @glfwMakeContextCurrent(ptr noundef %29)
  %30 = call i32 @gladLoadGL(ptr noundef @glfwGetProcAddress)
  call void @glfwSwapInterval(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %31 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %31(i32 noundef 1, ptr noundef %3)
  %32 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %33 = load i32, ptr %3, align 4, !tbaa !9
  call void %32(i32 noundef 34962, i32 noundef %33)
  %34 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %34(i32 noundef 34962, i64 noundef 60, ptr noundef @vertices, i32 noundef 35044)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %35 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %36 = call i32 %35(i32 noundef 35633)
  store i32 %36, ptr %4, align 4, !tbaa !9
  %37 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  %38 = load i32, ptr %4, align 4, !tbaa !9
  call void %37(i32 noundef %38, i32 noundef 1, ptr noundef @vertex_shader_text, ptr noundef null)
  %39 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  %40 = load i32, ptr %4, align 4, !tbaa !9
  call void %39(i32 noundef %40)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %41 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %42 = call i32 %41(i32 noundef 35632)
  store i32 %42, ptr %5, align 4, !tbaa !9
  %43 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  %44 = load i32, ptr %5, align 4, !tbaa !9
  call void %43(i32 noundef %44, i32 noundef 1, ptr noundef @fragment_shader_text, ptr noundef null)
  %45 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !9
  call void %45(i32 noundef %46)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %47 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !5
  %48 = call i32 %47()
  store i32 %48, ptr %6, align 4, !tbaa !9
  %49 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = load i32, ptr %4, align 4, !tbaa !9
  call void %49(i32 noundef %50, i32 noundef %51)
  %52 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !9
  %54 = load i32, ptr %5, align 4, !tbaa !9
  call void %52(i32 noundef %53, i32 noundef %54)
  %55 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !5
  %56 = load i32, ptr %6, align 4, !tbaa !9
  call void %55(i32 noundef %56)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %57 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %58 = load i32, ptr %6, align 4, !tbaa !9
  %59 = call i32 %57(i32 noundef %58, ptr noundef @.str.2)
  store i32 %59, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %60 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = call i32 %60(i32 noundef %61, ptr noundef @.str.3)
  store i32 %62, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %63 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = call i32 %63(i32 noundef %64, ptr noundef @.str.4)
  store i32 %65, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %66 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  call void %66(i32 noundef 1, ptr noundef %10)
  %67 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %68 = load i32, ptr %10, align 4, !tbaa !9
  call void %67(i32 noundef %68)
  %69 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  %70 = load i32, ptr %8, align 4, !tbaa !9
  call void %69(i32 noundef %70)
  %71 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %72 = load i32, ptr %8, align 4, !tbaa !9
  call void %71(i32 noundef %72, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 20, ptr noundef null)
  %73 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  %74 = load i32, ptr %9, align 4, !tbaa !9
  call void %73(i32 noundef %74)
  %75 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  %76 = load i32, ptr %9, align 4, !tbaa !9
  call void %75(i32 noundef %76, i32 noundef 3, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 20, ptr noundef inttoptr (i64 8 to ptr))
  br label %77

77:                                               ; preds = %82, %26
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = call i32 @glfwWindowShouldClose(ptr noundef %78)
  %80 = icmp ne i32 %79, 0
  %81 = xor i1 %80, true
  br i1 %81, label %82, label %113

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  call void @glfwGetFramebufferSize(ptr noundef %83, ptr noundef %11, ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = sitofp i32 %84 to float
  %86 = load i32, ptr %12, align 4, !tbaa !9
  %87 = sitofp i32 %86 to float
  %88 = fdiv float %85, %87
  store float %88, ptr %13, align 4, !tbaa !11
  %89 = load ptr, ptr @glad_glViewport, align 8, !tbaa !5
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = load i32, ptr %12, align 4, !tbaa !9
  call void %89(i32 noundef 0, i32 noundef 0, i32 noundef %90, i32 noundef %91)
  %92 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  call void %92(i32 noundef 16384)
  call void @llvm.lifetime.start.p0(i64 64, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %16) #6
  %93 = getelementptr inbounds [4 x [4 x float]], ptr %14, i64 0, i64 0
  call void @mat4x4_identity(ptr noundef %93)
  %94 = getelementptr inbounds [4 x [4 x float]], ptr %14, i64 0, i64 0
  %95 = getelementptr inbounds [4 x [4 x float]], ptr %14, i64 0, i64 0
  %96 = call double @glfwGetTime()
  %97 = fptrunc double %96 to float
  call void @mat4x4_rotate_Z(ptr noundef %94, ptr noundef %95, float noundef %97)
  %98 = getelementptr inbounds [4 x [4 x float]], ptr %15, i64 0, i64 0
  %99 = load float, ptr %13, align 4, !tbaa !11
  %100 = fneg float %99
  %101 = load float, ptr %13, align 4, !tbaa !11
  call void @mat4x4_ortho(ptr noundef %98, float noundef %100, float noundef %101, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef -1.000000e+00)
  %102 = getelementptr inbounds [4 x [4 x float]], ptr %16, i64 0, i64 0
  %103 = getelementptr inbounds [4 x [4 x float]], ptr %15, i64 0, i64 0
  %104 = getelementptr inbounds [4 x [4 x float]], ptr %14, i64 0, i64 0
  call void @mat4x4_mul(ptr noundef %102, ptr noundef %103, ptr noundef %104)
  %105 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  %106 = load i32, ptr %6, align 4, !tbaa !9
  call void %105(i32 noundef %106)
  %107 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  %108 = load i32, ptr %7, align 4, !tbaa !9
  call void %107(i32 noundef %108, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %16)
  %109 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %110 = load i32, ptr %10, align 4, !tbaa !9
  call void %109(i32 noundef %110)
  %111 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !5
  call void %111(i32 noundef 4, i32 noundef 0, i32 noundef 3)
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  call void @glfwSwapBuffers(ptr noundef %112)
  call void @glfwPollEvents()
  call void @llvm.lifetime.end.p0(i64 64, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %77, !llvm.loop !13

113:                                              ; preds = %77
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  call void @glfwDestroyWindow(ptr noundef %114)
  call void @glfwTerminate()
  call void @exit(i32 noundef 0) #5
  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 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 void @glfwMakeContextCurrent(ptr noundef) #2

declare ptr @glfwGetProcAddress(ptr noundef) #2

declare void @glfwSwapInterval(i32 noundef) #2

declare i32 @glfwWindowShouldClose(ptr noundef) #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mat4x4_identity(ptr noundef) #4

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

declare double @glfwGetTime() #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) #4

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

declare void @glfwSwapBuffers(ptr noundef) #2

declare void @glfwPollEvents() #2

declare void @glfwDestroyWindow(ptr noundef) #2

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 = { 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 #5 = { noreturn nounwind }
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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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.Vertex = type { [2 x float], [3 x 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_glBindVertexArray = 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_glGenVertexArrays = 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 [16 x i8], align 1
@vertices = external hidden constant [3 x %struct.Vertex], align 16
@vertex_shader_text = external hidden global ptr, align 8
@fragment_shader_text = external hidden global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = 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() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [4 x [4 x float]], align 16
  %6 = alloca [4 x [4 x float]], align 16
  %7 = alloca [4 x [4 x float]], align 16
  %8 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @error_callback) #6
  %9 = tail call i32 @glfwInit() #6
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %10, label %11

10:                                               ; preds = %0
  tail call void @exit(i32 noundef 1) #7
  unreachable

11:                                               ; preds = %0
  tail call void @glfwWindowHint(i32 noundef 139266, i32 noundef 3) #6
  tail call void @glfwWindowHint(i32 noundef 139267, i32 noundef 3) #6
  tail call void @glfwWindowHint(i32 noundef 139272, i32 noundef 204801) #6
  %12 = tail call ptr @glfwCreateWindow(i32 noundef 640, i32 noundef 480, ptr noundef nonnull @.str.1, ptr noundef null, ptr noundef null) #6
  %.not26 = icmp eq ptr %12, null
  br i1 %.not26, label %13, label %14

13:                                               ; preds = %11
  tail call void @glfwTerminate() #6
  tail call void @exit(i32 noundef 1) #7
  unreachable

14:                                               ; preds = %11
  %15 = tail call ptr @glfwSetKeyCallback(ptr noundef nonnull %12, ptr noundef nonnull @key_callback) #6
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %12) #6
  %16 = tail call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  tail call void @glfwSwapInterval(i32 noundef 1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %17 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %17(i32 noundef 1, ptr noundef nonnull %1) #6
  %18 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %19 = load i32, ptr %1, align 4, !tbaa !9
  call void %18(i32 noundef 34962, i32 noundef %19) #6
  %20 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %20(i32 noundef 34962, i64 noundef 60, ptr noundef nonnull @vertices, i32 noundef 35044) #6
  %21 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %22 = call i32 %21(i32 noundef 35633) #6
  %23 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  call void %23(i32 noundef %22, i32 noundef 1, ptr noundef nonnull @vertex_shader_text, ptr noundef null) #6
  %24 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  call void %24(i32 noundef %22) #6
  %25 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %26 = call i32 %25(i32 noundef 35632) #6
  %27 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  call void %27(i32 noundef %26, i32 noundef 1, ptr noundef nonnull @fragment_shader_text, ptr noundef null) #6
  %28 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  call void %28(i32 noundef %26) #6
  %29 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !5
  %30 = call i32 %29() #6
  %31 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  call void %31(i32 noundef %30, i32 noundef %22) #6
  %32 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  call void %32(i32 noundef %30, i32 noundef %26) #6
  %33 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !5
  call void %33(i32 noundef %30) #6
  %34 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %35 = call i32 %34(i32 noundef %30, ptr noundef nonnull @.str.2) #6
  %36 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %37 = call i32 %36(i32 noundef %30, ptr noundef nonnull @.str.3) #6
  %38 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %39 = call i32 %38(i32 noundef %30, ptr noundef nonnull @.str.4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %40 = load ptr, ptr @glad_glGenVertexArrays, align 8, !tbaa !5
  call void %40(i32 noundef 1, ptr noundef nonnull %2) #6
  %41 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %42 = load i32, ptr %2, align 4, !tbaa !9
  call void %41(i32 noundef %42) #6
  %43 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %43(i32 noundef %37) #6
  %44 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %44(i32 noundef %37, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 20, ptr noundef null) #6
  %45 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %45(i32 noundef %39) #6
  %46 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %46(i32 noundef %39, i32 noundef 3, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 20, ptr noundef nonnull inttoptr (i64 8 to ptr)) #6
  %47 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %12) #6
  %.not2728 = icmp eq i32 %47, 0
  br i1 %.not2728, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %14, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @glfwGetFramebufferSize(ptr noundef nonnull %12, ptr noundef nonnull %3, ptr noundef nonnull %4) #6
  %48 = load i32, ptr %3, align 4, !tbaa !9
  %49 = sitofp i32 %48 to float
  %50 = load i32, ptr %4, align 4, !tbaa !9
  %51 = sitofp i32 %50 to float
  %52 = fdiv float %49, %51
  %53 = load ptr, ptr @glad_glViewport, align 8, !tbaa !5
  call void %53(i32 noundef 0, i32 noundef 0, i32 noundef %48, i32 noundef %50) #6
  %54 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  call void %54(i32 noundef 16384) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #6
  call void @mat4x4_identity(ptr noundef nonnull %5)
  %55 = call double @glfwGetTime() #6
  %56 = fptrunc double %55 to float
  call void @mat4x4_rotate_Z(ptr noundef nonnull %5, ptr noundef nonnull %5, float noundef %56)
  %57 = fneg float %52
  call void @mat4x4_ortho(ptr noundef nonnull %6, float noundef %57, float noundef %52, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef -1.000000e+00)
  call void @mat4x4_mul(ptr noundef nonnull %7, ptr noundef nonnull %6, ptr noundef nonnull %5)
  %58 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  call void %58(i32 noundef %30) #6
  %59 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  call void %59(i32 noundef %35, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %7) #6
  %60 = load ptr, ptr @glad_glBindVertexArray, align 8, !tbaa !5
  %61 = load i32, ptr %2, align 4, !tbaa !9
  call void %60(i32 noundef %61) #6
  %62 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !5
  call void %62(i32 noundef 4, i32 noundef 0, i32 noundef 3) #6
  call void @glfwSwapBuffers(ptr noundef nonnull %12) #6
  call void @glfwPollEvents() #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %63 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %12) #6
  %.not27 = icmp eq i32 %63, 0
  br i1 %.not27, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %14
  call void @glfwDestroyWindow(ptr noundef nonnull %12) #6
  call void @glfwTerminate() #6
  call void @exit(i32 noundef 0) #7
  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 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 void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #3

declare ptr @glfwGetProcAddress(ptr noundef) #3

declare void @glfwSwapInterval(i32 noundef) local_unnamed_addr #3

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #3

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

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

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

declare double @glfwGetTime() 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 #5

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

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #3

declare void @glfwPollEvents() local_unnamed_addr #3

declare void @glfwDestroyWindow(ptr noundef) local_unnamed_addr #3

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 = { 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 = !{!"any pointer", !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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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