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

; 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.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }

@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
@.str.2 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1
@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
@vertices = external hidden constant [4 x [2 x float]], align 16
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 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 i32, align 4
  %7 = alloca double, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %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 i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca float, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca [4 x [4 x float]], align 16
  %25 = alloca [4 x [4 x float]], align 16
  %26 = alloca [4 x [4 x float]], align 16
  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 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %27 = call i64 @time(ptr noundef null) #6
  %28 = trunc i64 %27 to i32
  call void @srand(i32 noundef %28) #6
  %29 = call ptr @glfwSetErrorCallback(ptr noundef @error_callback)
  %30 = call i32 @glfwInit()
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %33, label %32

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

33:                                               ; preds = %2
  call void @glfwWindowHint(i32 noundef 139266, i32 noundef 2)
  call void @glfwWindowHint(i32 noundef 139267, i32 noundef 0)
  br label %34

34:                                               ; preds = %167, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store ptr null, ptr %11, align 8, !tbaa !9
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = and i32 %35, 1
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %47

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %39 = call ptr @glfwGetMonitors(ptr noundef %18)
  store ptr %39, ptr %19, align 8, !tbaa !9
  %40 = load ptr, ptr %19, align 8, !tbaa !9
  %41 = call i32 @rand() #6
  %42 = load i32, ptr %18, align 4, !tbaa !5
  %43 = srem i32 %41, %42
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %40, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  store ptr %46, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %47

47:                                               ; preds = %38, %34
  %48 = load ptr, ptr %11, align 8, !tbaa !9
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %59

50:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %51 = load ptr, ptr %11, align 8, !tbaa !9
  %52 = call ptr @glfwGetVideoMode(ptr noundef %51)
  store ptr %52, ptr %20, align 8, !tbaa !9
  %53 = load ptr, ptr %20, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.GLFWvidmode, ptr %53, i32 0, i32 0
  %55 = load i32, ptr %54, align 4, !tbaa !11
  store i32 %55, ptr %9, align 4, !tbaa !5
  %56 = load ptr, ptr %20, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.GLFWvidmode, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 4, !tbaa !13
  store i32 %58, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  br label %60

59:                                               ; preds = %47
  store i32 640, ptr %9, align 4, !tbaa !5
  store i32 480, ptr %10, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %59, %50
  %61 = call double @glfwGetTime()
  store double %61, ptr %7, align 8, !tbaa !14
  %62 = load i32, ptr %9, align 4, !tbaa !5
  %63 = load i32, ptr %10, align 4, !tbaa !5
  %64 = load ptr, ptr %11, align 8, !tbaa !9
  %65 = call ptr @glfwCreateWindow(i32 noundef %62, i32 noundef %63, ptr noundef @.str.1, ptr noundef %64, ptr noundef null)
  store ptr %65, ptr %8, align 8, !tbaa !9
  %66 = load ptr, ptr %8, align 8, !tbaa !9
  %67 = icmp ne ptr %66, null
  br i1 %67, label %69, label %68

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

69:                                               ; preds = %60
  %70 = load ptr, ptr %11, align 8, !tbaa !9
  %71 = icmp ne ptr %70, null
  br i1 %71, label %72, label %79

72:                                               ; preds = %69
  %73 = load ptr, ptr %11, align 8, !tbaa !9
  %74 = call ptr @glfwGetMonitorName(ptr noundef %73)
  %75 = call double @glfwGetTime()
  %76 = load double, ptr %7, align 8, !tbaa !14
  %77 = fsub double %75, %76
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, ptr noundef %74, double noundef %77)
  br label %84

79:                                               ; preds = %69
  %80 = call double @glfwGetTime()
  %81 = load double, ptr %7, align 8, !tbaa !14
  %82 = fsub double %80, %81
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, double noundef %82)
  br label %84

84:                                               ; preds = %79, %72
  %85 = load ptr, ptr %8, align 8, !tbaa !9
  %86 = call ptr @glfwSetWindowCloseCallback(ptr noundef %85, ptr noundef @window_close_callback)
  %87 = load ptr, ptr %8, align 8, !tbaa !9
  %88 = call ptr @glfwSetKeyCallback(ptr noundef %87, ptr noundef @key_callback)
  %89 = load ptr, ptr %8, align 8, !tbaa !9
  call void @glfwMakeContextCurrent(ptr noundef %89)
  %90 = call i32 @gladLoadGL(ptr noundef @glfwGetProcAddress)
  call void @glfwSwapInterval(i32 noundef 1)
  %91 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !9
  %92 = call i32 %91(i32 noundef 35633)
  store i32 %92, ptr %12, align 4, !tbaa !5
  %93 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !9
  %94 = load i32, ptr %12, align 4, !tbaa !5
  call void %93(i32 noundef %94, i32 noundef 1, ptr noundef @vertex_shader_text, ptr noundef null)
  %95 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !9
  %96 = load i32, ptr %12, align 4, !tbaa !5
  call void %95(i32 noundef %96)
  %97 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !9
  %98 = call i32 %97(i32 noundef 35632)
  store i32 %98, ptr %13, align 4, !tbaa !5
  %99 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !9
  %100 = load i32, ptr %13, align 4, !tbaa !5
  call void %99(i32 noundef %100, i32 noundef 1, ptr noundef @fragment_shader_text, ptr noundef null)
  %101 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !9
  %102 = load i32, ptr %13, align 4, !tbaa !5
  call void %101(i32 noundef %102)
  %103 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !9
  %104 = call i32 %103()
  store i32 %104, ptr %14, align 4, !tbaa !5
  %105 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !9
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = load i32, ptr %12, align 4, !tbaa !5
  call void %105(i32 noundef %106, i32 noundef %107)
  %108 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !9
  %109 = load i32, ptr %14, align 4, !tbaa !5
  %110 = load i32, ptr %13, align 4, !tbaa !5
  call void %108(i32 noundef %109, i32 noundef %110)
  %111 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !9
  %112 = load i32, ptr %14, align 4, !tbaa !5
  call void %111(i32 noundef %112)
  %113 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %114 = load i32, ptr %14, align 4, !tbaa !5
  %115 = call i32 %113(i32 noundef %114, ptr noundef @.str.4)
  store i32 %115, ptr %16, align 4, !tbaa !5
  %116 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !9
  %117 = load i32, ptr %14, align 4, !tbaa !5
  %118 = call i32 %116(i32 noundef %117, ptr noundef @.str.5)
  store i32 %118, ptr %17, align 4, !tbaa !5
  %119 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !9
  call void %119(i32 noundef 1, ptr noundef %15)
  %120 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !9
  %121 = load i32, ptr %15, align 4, !tbaa !5
  call void %120(i32 noundef 34962, i32 noundef %121)
  %122 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !9
  call void %122(i32 noundef 34962, i64 noundef 32, ptr noundef @vertices, i32 noundef 35044)
  %123 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !9
  %124 = load i32, ptr %17, align 4, !tbaa !5
  call void %123(i32 noundef %124)
  %125 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !9
  %126 = load i32, ptr %17, align 4, !tbaa !5
  call void %125(i32 noundef %126, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  call void @glfwSetTime(double noundef 0.000000e+00)
  br label %127

127:                                              ; preds = %166, %84
  %128 = call double @glfwGetTime()
  %129 = fcmp olt double %128, 5.000000e+00
  br i1 %129, label %130, label %167

130:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 64, ptr %26) #6
  %131 = load ptr, ptr %8, align 8, !tbaa !9
  call void @glfwGetFramebufferSize(ptr noundef %131, ptr noundef %22, ptr noundef %23)
  %132 = load i32, ptr %22, align 4, !tbaa !5
  %133 = sitofp i32 %132 to float
  %134 = load i32, ptr %23, align 4, !tbaa !5
  %135 = sitofp i32 %134 to float
  %136 = fdiv float %133, %135
  store float %136, ptr %21, align 4, !tbaa !16
  %137 = load ptr, ptr @glad_glViewport, align 8, !tbaa !9
  %138 = load i32, ptr %22, align 4, !tbaa !5
  %139 = load i32, ptr %23, align 4, !tbaa !5
  call void %137(i32 noundef 0, i32 noundef 0, i32 noundef %138, i32 noundef %139)
  %140 = load ptr, ptr @glad_glClear, align 8, !tbaa !9
  call void %140(i32 noundef 16384)
  %141 = getelementptr inbounds [4 x [4 x float]], ptr %25, i64 0, i64 0
  %142 = load float, ptr %21, align 4, !tbaa !16
  %143 = fneg float %142
  %144 = load float, ptr %21, align 4, !tbaa !16
  call void @mat4x4_ortho(ptr noundef %141, float noundef %143, float noundef %144, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %145 = getelementptr inbounds [4 x [4 x float]], ptr %24, i64 0, i64 0
  call void @mat4x4_identity(ptr noundef %145)
  %146 = getelementptr inbounds [4 x [4 x float]], ptr %24, i64 0, i64 0
  %147 = getelementptr inbounds [4 x [4 x float]], ptr %24, i64 0, i64 0
  %148 = call double @glfwGetTime()
  %149 = fptrunc double %148 to float
  call void @mat4x4_rotate_Z(ptr noundef %146, ptr noundef %147, float noundef %149)
  %150 = getelementptr inbounds [4 x [4 x float]], ptr %26, i64 0, i64 0
  %151 = getelementptr inbounds [4 x [4 x float]], ptr %25, i64 0, i64 0
  %152 = getelementptr inbounds [4 x [4 x float]], ptr %24, i64 0, i64 0
  call void @mat4x4_mul(ptr noundef %150, ptr noundef %151, ptr noundef %152)
  %153 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !9
  %154 = load i32, ptr %14, align 4, !tbaa !5
  call void %153(i32 noundef %154)
  %155 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !9
  %156 = load i32, ptr %16, align 4, !tbaa !5
  %157 = getelementptr inbounds [4 x [4 x float]], ptr %26, i64 0, i64 0
  call void %155(i32 noundef %156, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %157)
  %158 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !9
  call void %158(i32 noundef 6, i32 noundef 0, i32 noundef 4)
  %159 = load ptr, ptr %8, align 8, !tbaa !9
  call void @glfwSwapBuffers(ptr noundef %159)
  call void @glfwPollEvents()
  %160 = load ptr, ptr %8, align 8, !tbaa !9
  %161 = call i32 @glfwWindowShouldClose(ptr noundef %160)
  %162 = icmp ne i32 %161, 0
  br i1 %162, label %163, label %166

163:                                              ; preds = %130
  %164 = load ptr, ptr %8, align 8, !tbaa !9
  call void @close_window(ptr noundef %164)
  %165 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  call void @glfwTerminate()
  call void @exit(i32 noundef 0) #7
  unreachable

166:                                              ; preds = %130
  call void @llvm.lifetime.end.p0(i64 64, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %127, !llvm.loop !18

167:                                              ; preds = %127
  %168 = call i32 (ptr, ...) @printf(ptr noundef @.str.7)
  %169 = load ptr, ptr %8, align 8, !tbaa !9
  call void @close_window(ptr noundef %169)
  %170 = load i32, ptr %6, align 4, !tbaa !5
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, 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 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %34
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) #2

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #2

declare ptr @glfwSetErrorCallback(ptr noundef) #3

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

declare i32 @glfwInit() #3

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

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

declare ptr @glfwGetMonitors(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @rand() #2

declare ptr @glfwGetVideoMode(ptr noundef) #3

declare double @glfwGetTime() #3

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

declare void @glfwTerminate() #3

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

declare ptr @glfwGetMonitorName(ptr noundef) #3

declare ptr @glfwSetWindowCloseCallback(ptr noundef, ptr noundef) #3

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

declare ptr @glfwSetKeyCallback(ptr noundef, ptr noundef) #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) #3

declare ptr @glfwGetProcAddress(ptr noundef) #3

declare void @glfwSwapInterval(i32 noundef) #3

declare void @glfwSetTime(double noundef) #3

declare void @glfwGetFramebufferSize(ptr noundef, ptr noundef, ptr noundef) #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) #5

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @mat4x4_rotate_Z(ptr noundef, ptr 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) #3

declare void @glfwPollEvents() #3

declare i32 @glfwWindowShouldClose(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @close_window(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 = { 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 #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 = !{!"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, !6, i64 0}
!12 = !{!"GLFWvidmode", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!13 = !{!12, !6, i64 4}
!14 = !{!15, !15, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"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"

@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
@.str.2 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [43 x i8], align 1
@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
@vertices = external hidden constant [4 x [2 x float]], align 16
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 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 i32, align 4
  %7 = alloca [4 x [4 x float]], align 16
  %8 = alloca [4 x [4 x float]], align 16
  %9 = alloca [4 x [4 x float]], align 16
  %10 = tail call i64 @time(ptr noundef null) #8
  %11 = trunc i64 %10 to i32
  tail call void @srand(i32 noundef %11) #8
  %12 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @error_callback) #8
  %13 = tail call i32 @glfwInit() #8
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %15

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

15:                                               ; preds = %2
  tail call void @glfwWindowHint(i32 noundef 139266, i32 noundef 2) #8
  tail call void @glfwWindowHint(i32 noundef 139267, i32 noundef 0) #8
  br label %16

16:                                               ; preds = %._crit_edge, %15
  %.0 = phi i32 [ 0, %15 ], [ %93, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %17 = and i32 %.0, 1
  %.not43 = icmp eq i32 %17, 0
  br i1 %.not43, label %.thread, label %18

18:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %19 = call ptr @glfwGetMonitors(ptr noundef nonnull %4) #8
  %20 = call i32 @rand() #8
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = srem i32 %20, %21
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds ptr, ptr %19, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %.not44 = icmp eq ptr %25, null
  br i1 %.not44, label %.thread, label %26

26:                                               ; preds = %18
  %27 = call ptr @glfwGetVideoMode(ptr noundef nonnull %25) #8
  %28 = load i32, ptr %27, align 4, !tbaa !11
  %29 = getelementptr inbounds i8, ptr %27, i64 4
  %30 = load i32, ptr %29, align 4, !tbaa !13
  br label %.thread

.thread:                                          ; preds = %16, %18, %26
  %.not4450 = phi i1 [ false, %26 ], [ true, %18 ], [ true, %16 ]
  %.04149 = phi ptr [ %25, %26 ], [ null, %18 ], [ null, %16 ]
  %.040 = phi i32 [ %30, %26 ], [ 480, %18 ], [ 480, %16 ]
  %.039 = phi i32 [ %28, %26 ], [ 640, %18 ], [ 640, %16 ]
  %31 = call double @glfwGetTime() #8
  %32 = call ptr @glfwCreateWindow(i32 noundef %.039, i32 noundef %.040, ptr noundef nonnull @.str.1, ptr noundef %.04149, ptr noundef null) #8
  %.not45 = icmp eq ptr %32, null
  br i1 %.not45, label %33, label %34

33:                                               ; preds = %.thread
  call void @glfwTerminate() #8
  call void @exit(i32 noundef 1) #9
  unreachable

34:                                               ; preds = %.thread
  br i1 %.not4450, label %40, label %35

35:                                               ; preds = %34
  %36 = call ptr @glfwGetMonitorName(ptr noundef nonnull %.04149) #8
  %37 = call double @glfwGetTime() #8
  %38 = fsub double %37, %31
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %36, double noundef %38)
  br label %44

40:                                               ; preds = %34
  %41 = call double @glfwGetTime() #8
  %42 = fsub double %41, %31
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %42)
  br label %44

44:                                               ; preds = %40, %35
  %45 = call ptr @glfwSetWindowCloseCallback(ptr noundef nonnull %32, ptr noundef nonnull @window_close_callback) #8
  %46 = call ptr @glfwSetKeyCallback(ptr noundef nonnull %32, ptr noundef nonnull @key_callback) #8
  call void @glfwMakeContextCurrent(ptr noundef nonnull %32) #8
  %47 = call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  call void @glfwSwapInterval(i32 noundef 1) #8
  %48 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !9
  %49 = call i32 %48(i32 noundef 35633) #8
  %50 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !9
  call void %50(i32 noundef %49, i32 noundef 1, ptr noundef nonnull @vertex_shader_text, ptr noundef null) #8
  %51 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !9
  call void %51(i32 noundef %49) #8
  %52 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !9
  %53 = call i32 %52(i32 noundef 35632) #8
  %54 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !9
  call void %54(i32 noundef %53, i32 noundef 1, ptr noundef nonnull @fragment_shader_text, ptr noundef null) #8
  %55 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !9
  call void %55(i32 noundef %53) #8
  %56 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !9
  %57 = call i32 %56() #8
  %58 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !9
  call void %58(i32 noundef %57, i32 noundef %49) #8
  %59 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !9
  call void %59(i32 noundef %57, i32 noundef %53) #8
  %60 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !9
  call void %60(i32 noundef %57) #8
  %61 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %62 = call i32 %61(i32 noundef %57, ptr noundef nonnull @.str.4) #8
  %63 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !9
  %64 = call i32 %63(i32 noundef %57, ptr noundef nonnull @.str.5) #8
  %65 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !9
  call void %65(i32 noundef 1, ptr noundef nonnull %3) #8
  %66 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !9
  %67 = load i32, ptr %3, align 4, !tbaa !5
  call void %66(i32 noundef 34962, i32 noundef %67) #8
  %68 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !9
  call void %68(i32 noundef 34962, i64 noundef 32, ptr noundef nonnull @vertices, i32 noundef 35044) #8
  %69 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !9
  call void %69(i32 noundef %64) #8
  %70 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !9
  call void %70(i32 noundef %64, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null) #8
  call void @glfwSetTime(double noundef 0.000000e+00) #8
  %71 = call double @glfwGetTime() #8
  %72 = fcmp olt double %71, 5.000000e+00
  br i1 %72, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %44, %89
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %9) #8
  call void @glfwGetFramebufferSize(ptr noundef nonnull %32, ptr noundef nonnull %5, ptr noundef nonnull %6) #8
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sitofp i32 %73 to float
  %75 = load i32, ptr %6, align 4, !tbaa !5
  %76 = sitofp i32 %75 to float
  %77 = fdiv float %74, %76
  %78 = load ptr, ptr @glad_glViewport, align 8, !tbaa !9
  call void %78(i32 noundef 0, i32 noundef 0, i32 noundef %73, i32 noundef %75) #8
  %79 = load ptr, ptr @glad_glClear, align 8, !tbaa !9
  call void %79(i32 noundef 16384) #8
  %80 = fneg float %77
  call void @mat4x4_ortho(ptr noundef nonnull %8, float noundef %80, float noundef %77, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  call void @mat4x4_identity(ptr noundef nonnull %7)
  %81 = call double @glfwGetTime() #8
  %82 = fptrunc double %81 to float
  call void @mat4x4_rotate_Z(ptr noundef nonnull %7, ptr noundef nonnull %7, float noundef %82)
  call void @mat4x4_mul(ptr noundef nonnull %9, ptr noundef nonnull %8, ptr noundef nonnull %7)
  %83 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !9
  call void %83(i32 noundef %57) #8
  %84 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !9
  call void %84(i32 noundef %62, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %9) #8
  %85 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !9
  call void %85(i32 noundef 6, i32 noundef 0, i32 noundef 4) #8
  call void @glfwSwapBuffers(ptr noundef nonnull %32) #8
  call void @glfwPollEvents() #8
  %86 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %32) #8
  %.not46 = icmp eq i32 %86, 0
  br i1 %.not46, label %89, label %87

87:                                               ; preds = %.lr.ph
  call void @close_window(ptr noundef nonnull %32)
  %88 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  call void @glfwTerminate() #8
  call void @exit(i32 noundef 0) #9
  unreachable

89:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  %90 = call double @glfwGetTime() #8
  %91 = fcmp olt double %90, 5.000000e+00
  br i1 %91, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %89, %44
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7)
  call void @close_window(ptr noundef nonnull %32)
  %93 = add nuw nsw i32 %.0, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  br label %16
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #3

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #4

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

declare i32 @glfwInit() local_unnamed_addr #4

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

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

declare ptr @glfwGetMonitors(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #3

declare ptr @glfwGetVideoMode(ptr noundef) local_unnamed_addr #4

declare double @glfwGetTime() local_unnamed_addr #4

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

declare void @glfwTerminate() local_unnamed_addr #4

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

declare ptr @glfwGetMonitorName(ptr noundef) local_unnamed_addr #4

declare ptr @glfwSetWindowCloseCallback(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

; 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 #4

declare ptr @glfwGetProcAddress(ptr noundef) #4

declare void @glfwSwapInterval(i32 noundef) local_unnamed_addr #4

declare void @glfwSetTime(double noundef) local_unnamed_addr #4

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

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

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

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

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

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #4

declare void @glfwPollEvents() local_unnamed_addr #4

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @close_window(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 = { 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 = { "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 "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 = { 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { 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, !6, i64 0}
!12 = !{!"GLFWvidmode", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!13 = !{!12, !6, i64 4}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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