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

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

@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_glDisable = external dso_local global ptr, align 8
@glad_glDrawArrays = external dso_local global ptr, align 8
@glad_glEnable = 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_glGetIntegerv = 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 [4 x i8], align 1
@optarg = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@vertices = external hidden constant [4 x [2 x float]], align 16
@vertex_shader_text = external hidden global ptr, align 8
@fragment_shader_text = external hidden global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.8 = 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %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 float, 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 double, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 4, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  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 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
  br label %22

22:                                               ; preds = %34, %2
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = call i32 @getopt(i32 noundef %23, ptr noundef %24, ptr noundef @.str.1)
  store i32 %25, ptr %6, align 4, !tbaa !5
  %26 = icmp ne i32 %25, -1
  br i1 %26, label %27, label %35

27:                                               ; preds = %22
  %28 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %28, label %33 [
    i32 104, label %29
    i32 115, label %30
  ]

29:                                               ; preds = %27
  call void @usage()
  call void @exit(i32 noundef 0) #7
  unreachable

30:                                               ; preds = %27
  %31 = load ptr, ptr @optarg, align 8, !tbaa !9
  %32 = call i32 @atoi(ptr noundef %31) #8
  store i32 %32, ptr %7, align 4, !tbaa !5
  br label %34

33:                                               ; preds = %27
  call void @usage()
  call void @exit(i32 noundef 1) #7
  unreachable

34:                                               ; preds = %30
  br label %22, !llvm.loop !11

35:                                               ; preds = %22
  %36 = call ptr @glfwSetErrorCallback(ptr noundef @error_callback)
  %37 = call i32 @glfwInit()
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %35
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %40
  %44 = load i32, ptr %7, align 4, !tbaa !5
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %44)
  br label %48

46:                                               ; preds = %40
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %48

48:                                               ; preds = %46, %43
  %49 = load i32, ptr %7, align 4, !tbaa !5
  call void @glfwWindowHint(i32 noundef 135181, i32 noundef %49)
  call void @glfwWindowHint(i32 noundef 139266, i32 noundef 2)
  call void @glfwWindowHint(i32 noundef 139267, i32 noundef 0)
  %50 = call ptr @glfwCreateWindow(i32 noundef 800, i32 noundef 400, ptr noundef @.str.4, ptr noundef null, ptr noundef null)
  store ptr %50, ptr %8, align 8, !tbaa !9
  %51 = load ptr, ptr %8, align 8, !tbaa !9
  %52 = icmp ne ptr %51, null
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %48
  %55 = load ptr, ptr %8, align 8, !tbaa !9
  %56 = call ptr @glfwSetKeyCallback(ptr noundef %55, ptr noundef @key_callback)
  %57 = load ptr, ptr %8, align 8, !tbaa !9
  call void @glfwMakeContextCurrent(ptr noundef %57)
  %58 = call i32 @gladLoadGL(ptr noundef @glfwGetProcAddress)
  call void @glfwSwapInterval(i32 noundef 1)
  %59 = load ptr, ptr @glad_glGetIntegerv, align 8, !tbaa !9
  call void %59(i32 noundef 32937, ptr noundef %7)
  %60 = load i32, ptr %7, align 4, !tbaa !5
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %65

62:                                               ; preds = %54
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %63)
  br label %67

65:                                               ; preds = %54
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %67

67:                                               ; preds = %65, %62
  %68 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !9
  call void %68(i32 noundef 1, ptr noundef %9)
  %69 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !9
  %70 = load i32, ptr %9, align 4, !tbaa !5
  call void %69(i32 noundef 34962, i32 noundef %70)
  %71 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !9
  call void %71(i32 noundef 34962, i64 noundef 32, ptr noundef @vertices, i32 noundef 35044)
  %72 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !9
  %73 = call i32 %72(i32 noundef 35633)
  store i32 %73, ptr %10, align 4, !tbaa !5
  %74 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !5
  call void %74(i32 noundef %75, i32 noundef 1, ptr noundef @vertex_shader_text, ptr noundef null)
  %76 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !9
  %77 = load i32, ptr %10, align 4, !tbaa !5
  call void %76(i32 noundef %77)
  %78 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !9
  %79 = call i32 %78(i32 noundef 35632)
  store i32 %79, ptr %11, align 4, !tbaa !5
  %80 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !9
  %81 = load i32, ptr %11, align 4, !tbaa !5
  call void %80(i32 noundef %81, i32 noundef 1, ptr noundef @fragment_shader_text, ptr noundef null)
  %82 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !5
  call void %82(i32 noundef %83)
  %84 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !9
  %85 = call i32 %84()
  store i32 %85, ptr %12, align 4, !tbaa !5
  %86 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !9
  %87 = load i32, ptr %12, align 4, !tbaa !5
  %88 = load i32, ptr %10, align 4, !tbaa !5
  call void %86(i32 noundef %87, i32 noundef %88)
  %89 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !9
  %90 = load i32, ptr %12, align 4, !tbaa !5
  %91 = load i32, ptr %11, align 4, !tbaa !5
  call void %89(i32 noundef %90, i32 noundef %91)
  %92 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !9
  %93 = load i32, ptr %12, align 4, !tbaa !5
  call void %92(i32 noundef %93)
  %94 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !9
  %95 = load i32, ptr %12, align 4, !tbaa !5
  %96 = call i32 %94(i32 noundef %95, ptr noundef @.str.7)
  store i32 %96, ptr %13, align 4, !tbaa !5
  %97 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !9
  %98 = load i32, ptr %12, align 4, !tbaa !5
  %99 = call i32 %97(i32 noundef %98, ptr noundef @.str.8)
  store i32 %99, ptr %14, align 4, !tbaa !5
  %100 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !9
  %101 = load i32, ptr %14, align 4, !tbaa !5
  call void %100(i32 noundef %101)
  %102 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !9
  %103 = load i32, ptr %14, align 4, !tbaa !5
  call void %102(i32 noundef %103, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null)
  br label %104

104:                                              ; preds = %109, %67
  %105 = load ptr, ptr %8, align 8, !tbaa !9
  %106 = call i32 @glfwWindowShouldClose(ptr noundef %105)
  %107 = icmp ne i32 %106, 0
  %108 = xor i1 %107, true
  br i1 %108, label %109, label %156

109:                                              ; preds = %104
  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
  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 8, ptr %21) #6
  %110 = call double @glfwGetTime()
  %111 = fmul double %110, 0x400921FB54442D18
  %112 = fdiv double %111, 1.800000e+02
  store double %112, ptr %21, align 8, !tbaa !13
  %113 = load ptr, ptr %8, align 8, !tbaa !9
  call void @glfwGetFramebufferSize(ptr noundef %113, ptr noundef %16, ptr noundef %17)
  %114 = load i32, ptr %16, align 4, !tbaa !5
  %115 = sitofp i32 %114 to float
  %116 = load i32, ptr %17, align 4, !tbaa !5
  %117 = sitofp i32 %116 to float
  %118 = fdiv float %115, %117
  store float %118, ptr %15, align 4, !tbaa !15
  %119 = load ptr, ptr @glad_glViewport, align 8, !tbaa !9
  %120 = load i32, ptr %16, align 4, !tbaa !5
  %121 = load i32, ptr %17, align 4, !tbaa !5
  call void %119(i32 noundef 0, i32 noundef 0, i32 noundef %120, i32 noundef %121)
  %122 = load ptr, ptr @glad_glClear, align 8, !tbaa !9
  call void %122(i32 noundef 16384)
  %123 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !9
  %124 = load i32, ptr %12, align 4, !tbaa !5
  call void %123(i32 noundef %124)
  %125 = getelementptr inbounds [4 x [4 x float]], ptr %19, i64 0, i64 0
  %126 = load float, ptr %15, align 4, !tbaa !15
  %127 = fneg float %126
  %128 = load float, ptr %15, align 4, !tbaa !15
  call void @mat4x4_ortho(ptr noundef %125, float noundef %127, float noundef %128, float noundef -1.000000e+00, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %129 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  call void @mat4x4_translate(ptr noundef %129, float noundef -1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %130 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  %131 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  %132 = load double, ptr %21, align 8, !tbaa !13
  %133 = fptrunc double %132 to float
  call void @mat4x4_rotate_Z(ptr noundef %130, ptr noundef %131, float noundef %133)
  %134 = getelementptr inbounds [4 x [4 x float]], ptr %20, i64 0, i64 0
  %135 = getelementptr inbounds [4 x [4 x float]], ptr %19, i64 0, i64 0
  %136 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  call void @mat4x4_mul(ptr noundef %134, ptr noundef %135, ptr noundef %136)
  %137 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !9
  %138 = load i32, ptr %13, align 4, !tbaa !5
  %139 = getelementptr inbounds [4 x [4 x float]], ptr %20, i64 0, i64 0
  call void %137(i32 noundef %138, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %139)
  %140 = load ptr, ptr @glad_glDisable, align 8, !tbaa !9
  call void %140(i32 noundef 32925)
  %141 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !9
  call void %141(i32 noundef 6, i32 noundef 0, i32 noundef 4)
  %142 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  call void @mat4x4_translate(ptr noundef %142, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %143 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  %144 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  %145 = load double, ptr %21, align 8, !tbaa !13
  %146 = fptrunc double %145 to float
  call void @mat4x4_rotate_Z(ptr noundef %143, ptr noundef %144, float noundef %146)
  %147 = getelementptr inbounds [4 x [4 x float]], ptr %20, i64 0, i64 0
  %148 = getelementptr inbounds [4 x [4 x float]], ptr %19, i64 0, i64 0
  %149 = getelementptr inbounds [4 x [4 x float]], ptr %18, i64 0, i64 0
  call void @mat4x4_mul(ptr noundef %147, ptr noundef %148, ptr noundef %149)
  %150 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !9
  %151 = load i32, ptr %13, align 4, !tbaa !5
  %152 = getelementptr inbounds [4 x [4 x float]], ptr %20, i64 0, i64 0
  call void %150(i32 noundef %151, i32 noundef 1, i8 noundef zeroext 0, ptr noundef %152)
  %153 = load ptr, ptr @glad_glEnable, align 8, !tbaa !9
  call void %153(i32 noundef 32925)
  %154 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !9
  call void %154(i32 noundef 6, i32 noundef 0, i32 noundef 4)
  %155 = load ptr, ptr %8, align 8, !tbaa !9
  call void @glfwSwapBuffers(ptr noundef %155)
  call void @glfwPollEvents()
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %104, !llvm.loop !17

156:                                              ; preds = %104
  %157 = load ptr, ptr %8, align 8, !tbaa !9
  call void @glfwDestroyWindow(ptr noundef %157)
  call void @glfwTerminate()
  call void @exit(i32 noundef 0) #7
  unreachable
}

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

; Function Attrs: nounwind uwtable
declare hidden void @usage() #1

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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #4

declare ptr @glfwSetErrorCallback(ptr noundef) #2

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

declare i32 @glfwInit() #2

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

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

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_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) #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 willreturn memory(read) 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 = { 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 }
attributes #8 = { nounwind willreturn memory(read) }

!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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = distinct !{!17, !12}


; 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_glDisable = external dso_local local_unnamed_addr global ptr, align 8
@glad_glDrawArrays = external dso_local local_unnamed_addr global ptr, align 8
@glad_glEnable = 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_glGetIntegerv = 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 [4 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@vertices = external hidden constant [4 x [2 x float]], align 16
@vertex_shader_text = external hidden global ptr, align 8
@fragment_shader_text = external hidden global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.8 = 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 noundef %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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  br label %10

10:                                               ; preds = %14, %2
  %11 = phi i32 [ %16, %14 ], [ 4, %2 ]
  %12 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.1) #8
  switch i32 %12, label %17 [
    i32 -1, label %18
    i32 104, label %13
    i32 115, label %14
  ]

13:                                               ; preds = %10
  tail call void @usage()
  tail call void @exit(i32 noundef 0) #9
  unreachable

14:                                               ; preds = %10
  %15 = load ptr, ptr @optarg, align 8, !tbaa !5
  %16 = tail call i32 @atoi(ptr nocapture noundef %15) #10
  br label %10, !llvm.loop !9

17:                                               ; preds = %10
  tail call void @usage()
  tail call void @exit(i32 noundef 1) #9
  unreachable

18:                                               ; preds = %10
  store i32 %11, ptr %3, align 4, !tbaa !11
  %19 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @error_callback) #8
  %20 = tail call i32 @glfwInit() #8
  %.not32 = icmp eq i32 %20, 0
  br i1 %.not32, label %21, label %22

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

22:                                               ; preds = %18
  %.not33 = icmp eq i32 %11, 0
  br i1 %.not33, label %25, label %23

23:                                               ; preds = %22
  %24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
  br label %27

25:                                               ; preds = %22
  %26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %27

27:                                               ; preds = %25, %23
  tail call void @glfwWindowHint(i32 noundef 135181, i32 noundef %11) #8
  tail call void @glfwWindowHint(i32 noundef 139266, i32 noundef 2) #8
  tail call void @glfwWindowHint(i32 noundef 139267, i32 noundef 0) #8
  %28 = tail call ptr @glfwCreateWindow(i32 noundef 800, i32 noundef 400, ptr noundef nonnull @.str.4, ptr noundef null, ptr noundef null) #8
  %.not34 = icmp eq ptr %28, null
  br i1 %.not34, label %29, label %30

29:                                               ; preds = %27
  tail call void @glfwTerminate() #8
  tail call void @exit(i32 noundef 1) #9
  unreachable

30:                                               ; preds = %27
  %31 = tail call ptr @glfwSetKeyCallback(ptr noundef nonnull %28, ptr noundef nonnull @key_callback) #8
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %28) #8
  %32 = tail call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  tail call void @glfwSwapInterval(i32 noundef 1) #8
  %33 = load ptr, ptr @glad_glGetIntegerv, align 8, !tbaa !5
  call void %33(i32 noundef 32937, ptr noundef nonnull %3) #8
  %34 = load i32, ptr %3, align 4, !tbaa !11
  %.not35 = icmp eq i32 %34, 0
  br i1 %.not35, label %37, label %35

35:                                               ; preds = %30
  %36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %34)
  br label %39

37:                                               ; preds = %30
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  br label %39

39:                                               ; preds = %37, %35
  %40 = load ptr, ptr @glad_glGenBuffers, align 8, !tbaa !5
  call void %40(i32 noundef 1, ptr noundef nonnull %4) #8
  %41 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %42 = load i32, ptr %4, align 4, !tbaa !11
  call void %41(i32 noundef 34962, i32 noundef %42) #8
  %43 = load ptr, ptr @glad_glBufferData, align 8, !tbaa !5
  call void %43(i32 noundef 34962, i64 noundef 32, ptr noundef nonnull @vertices, i32 noundef 35044) #8
  %44 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %45 = call i32 %44(i32 noundef 35633) #8
  %46 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  call void %46(i32 noundef %45, i32 noundef 1, ptr noundef nonnull @vertex_shader_text, ptr noundef null) #8
  %47 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  call void %47(i32 noundef %45) #8
  %48 = load ptr, ptr @glad_glCreateShader, align 8, !tbaa !5
  %49 = call i32 %48(i32 noundef 35632) #8
  %50 = load ptr, ptr @glad_glShaderSource, align 8, !tbaa !5
  call void %50(i32 noundef %49, i32 noundef 1, ptr noundef nonnull @fragment_shader_text, ptr noundef null) #8
  %51 = load ptr, ptr @glad_glCompileShader, align 8, !tbaa !5
  call void %51(i32 noundef %49) #8
  %52 = load ptr, ptr @glad_glCreateProgram, align 8, !tbaa !5
  %53 = call i32 %52() #8
  %54 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  call void %54(i32 noundef %53, i32 noundef %45) #8
  %55 = load ptr, ptr @glad_glAttachShader, align 8, !tbaa !5
  call void %55(i32 noundef %53, i32 noundef %49) #8
  %56 = load ptr, ptr @glad_glLinkProgram, align 8, !tbaa !5
  call void %56(i32 noundef %53) #8
  %57 = load ptr, ptr @glad_glGetUniformLocation, align 8, !tbaa !5
  %58 = call i32 %57(i32 noundef %53, ptr noundef nonnull @.str.7) #8
  %59 = load ptr, ptr @glad_glGetAttribLocation, align 8, !tbaa !5
  %60 = call i32 %59(i32 noundef %53, ptr noundef nonnull @.str.8) #8
  %61 = load ptr, ptr @glad_glEnableVertexAttribArray, align 8, !tbaa !5
  call void %61(i32 noundef %60) #8
  %62 = load ptr, ptr @glad_glVertexAttribPointer, align 8, !tbaa !5
  call void %62(i32 noundef %60, i32 noundef 2, i32 noundef 5126, i8 noundef zeroext 0, i32 noundef 8, ptr noundef null) #8
  %63 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %28) #8
  %.not3639 = icmp eq i32 %63, 0
  br i1 %.not3639, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %39, %.lr.ph
  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
  %64 = call double @glfwGetTime() #8
  %65 = fmul double %64, 0x400921FB54442D18
  %66 = fdiv double %65, 1.800000e+02
  call void @glfwGetFramebufferSize(ptr noundef nonnull %28, ptr noundef nonnull %5, ptr noundef nonnull %6) #8
  %67 = load i32, ptr %5, align 4, !tbaa !11
  %68 = sitofp i32 %67 to float
  %69 = load i32, ptr %6, align 4, !tbaa !11
  %70 = sitofp i32 %69 to float
  %71 = fdiv float %68, %70
  %72 = load ptr, ptr @glad_glViewport, align 8, !tbaa !5
  call void %72(i32 noundef 0, i32 noundef 0, i32 noundef %67, i32 noundef %69) #8
  %73 = load ptr, ptr @glad_glClear, align 8, !tbaa !5
  call void %73(i32 noundef 16384) #8
  %74 = load ptr, ptr @glad_glUseProgram, align 8, !tbaa !5
  call void %74(i32 noundef %53) #8
  %75 = fneg float %71
  call void @mat4x4_ortho(ptr noundef nonnull %8, float noundef %75, float noundef %71, 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 %7, float noundef -1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %76 = fptrunc double %66 to float
  call void @mat4x4_rotate_Z(ptr noundef nonnull %7, ptr noundef nonnull %7, float noundef %76)
  call void @mat4x4_mul(ptr noundef nonnull %9, ptr noundef nonnull %8, ptr noundef nonnull %7)
  %77 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  call void %77(i32 noundef %58, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %9) #8
  %78 = load ptr, ptr @glad_glDisable, align 8, !tbaa !5
  call void %78(i32 noundef 32925) #8
  %79 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !5
  call void %79(i32 noundef 6, i32 noundef 0, i32 noundef 4) #8
  call void @mat4x4_translate(ptr noundef nonnull %7, float noundef 1.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @mat4x4_rotate_Z(ptr noundef nonnull %7, ptr noundef nonnull %7, float noundef %76)
  call void @mat4x4_mul(ptr noundef nonnull %9, ptr noundef nonnull %8, ptr noundef nonnull %7)
  %80 = load ptr, ptr @glad_glUniformMatrix4fv, align 8, !tbaa !5
  call void %80(i32 noundef %58, i32 noundef 1, i8 noundef zeroext 0, ptr noundef nonnull %9) #8
  %81 = load ptr, ptr @glad_glEnable, align 8, !tbaa !5
  call void %81(i32 noundef 32925) #8
  %82 = load ptr, ptr @glad_glDrawArrays, align 8, !tbaa !5
  call void %82(i32 noundef 6, i32 noundef 0, i32 noundef 4) #8
  call void @glfwSwapBuffers(ptr noundef nonnull %28) #8
  call void @glfwPollEvents() #8
  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
  %83 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %28) #8
  %.not36 = icmp eq i32 %83, 0
  br i1 %.not36, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %39
  call void @glfwDestroyWindow(ptr noundef nonnull %28) #8
  call void @glfwTerminate() #8
  call void @exit(i32 noundef 0) #9
  unreachable
}

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

; Function Attrs: nounwind uwtable
declare hidden void @usage() local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #5

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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6

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 double @glfwGetTime() 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_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_translate(ptr noundef, float noundef, float noundef, float 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 #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 mustprogress nofree nounwind willreturn memory(read) 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 = { 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 }
attributes #10 = { nounwind willreturn memory(read) }

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


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