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

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

@__const.main.threads = external hidden unnamed_addr constant [3 x %struct.Thread], align 16
@stderr = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@running = external hidden global i32, align 4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [3 x %struct.Thread], align 16
  %5 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.main.threads, i64 120, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 3, ptr %5, align 4, !tbaa !5
  %6 = call ptr @glfwSetErrorCallback(ptr noundef @error_callback)
  %7 = call i32 @glfwInit()
  %8 = icmp ne i32 %7, 0
  br i1 %8, label %10, label %9

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

10:                                               ; preds = %0
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %42, %10
  %12 = load i32, ptr %2, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 3
  br i1 %13, label %14, label %45

14:                                               ; preds = %11
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = mul nsw i32 250, %15
  %17 = add nsw i32 200, %16
  call void @glfwWindowHint(i32 noundef 131086, i32 noundef %17)
  call void @glfwWindowHint(i32 noundef 131087, i32 noundef 200)
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %19
  %21 = getelementptr inbounds %struct.Thread, ptr %20, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = call ptr @glfwCreateWindow(i32 noundef 200, i32 noundef 200, ptr noundef %22, ptr noundef null, ptr noundef null)
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.Thread, ptr %26, i32 0, i32 0
  store ptr %23, ptr %27, align 8, !tbaa !14
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %29
  %31 = getelementptr inbounds %struct.Thread, ptr %30, i32 0, i32 0
  %32 = load ptr, ptr %31, align 8, !tbaa !14
  %33 = icmp ne ptr %32, null
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %14
  %36 = load i32, ptr %2, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.Thread, ptr %38, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  %41 = call ptr @glfwSetKeyCallback(ptr noundef %40, ptr noundef @key_callback)
  br label %42

42:                                               ; preds = %35
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !15

45:                                               ; preds = %11
  %46 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 0
  %47 = getelementptr inbounds %struct.Thread, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 16, !tbaa !14
  call void @glfwMakeContextCurrent(ptr noundef %48)
  %49 = call i32 @gladLoadGL(ptr noundef @glfwGetProcAddress)
  call void @glfwMakeContextCurrent(ptr noundef null)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %68, %45
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = icmp slt i32 %51, 3
  br i1 %52, label %53, label %71

53:                                               ; preds = %50
  %54 = load i32, ptr %2, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %55
  %57 = getelementptr inbounds %struct.Thread, ptr %56, i32 0, i32 5
  %58 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 0
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds %struct.Thread, ptr %58, i64 %60
  %62 = call i32 @thrd_create(ptr noundef %57, ptr noundef @thread_main, ptr noundef %61)
  %63 = icmp ne i32 %62, 1
  br i1 %63, label %64, label %67

64:                                               ; preds = %53
  %65 = load ptr, ptr @stderr, align 8, !tbaa !17
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.4) #6
  call void @glfwTerminate()
  call void @exit(i32 noundef 1) #7
  unreachable

67:                                               ; preds = %53
  br label %68

68:                                               ; preds = %67
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %2, align 4, !tbaa !5
  br label %50, !llvm.loop !18

71:                                               ; preds = %50
  br label %72

72:                                               ; preds = %92, %71
  %73 = load volatile i32, ptr @running, align 4, !tbaa !5
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %93

75:                                               ; preds = %72
  call void @glfwWaitEvents()
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %76

76:                                               ; preds = %89, %75
  %77 = load i32, ptr %2, align 4, !tbaa !5
  %78 = icmp slt i32 %77, 3
  br i1 %78, label %79, label %92

79:                                               ; preds = %76
  %80 = load i32, ptr %2, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %81
  %83 = getelementptr inbounds %struct.Thread, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !14
  %85 = call i32 @glfwWindowShouldClose(ptr noundef %84)
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %79
  store volatile i32 0, ptr @running, align 4, !tbaa !5
  br label %88

88:                                               ; preds = %87, %79
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %2, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %2, align 4, !tbaa !5
  br label %76, !llvm.loop !19

92:                                               ; preds = %76
  br label %72, !llvm.loop !20

93:                                               ; preds = %72
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %103, %93
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = icmp slt i32 %95, 3
  br i1 %96, label %97, label %106

97:                                               ; preds = %94
  %98 = load i32, ptr %2, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %99
  %101 = getelementptr inbounds %struct.Thread, ptr %100, i32 0, i32 0
  %102 = load ptr, ptr %101, align 8, !tbaa !14
  call void @glfwHideWindow(ptr noundef %102)
  br label %103

103:                                              ; preds = %97
  %104 = load i32, ptr %2, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %2, align 4, !tbaa !5
  br label %94, !llvm.loop !21

106:                                              ; preds = %94
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %117, %106
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = icmp slt i32 %108, 3
  br i1 %109, label %110, label %120

110:                                              ; preds = %107
  %111 = load i32, ptr %2, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %112
  %114 = getelementptr inbounds %struct.Thread, ptr %113, i32 0, i32 5
  %115 = load i64, ptr %114, align 8, !tbaa !22
  %116 = call i32 @thrd_join(i64 noundef %115, ptr noundef %3)
  br label %117

117:                                              ; preds = %110
  %118 = load i32, ptr %2, align 4, !tbaa !5
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %2, align 4, !tbaa !5
  br label %107, !llvm.loop !23

120:                                              ; preds = %107
  call void @exit(i32 noundef 0) #7
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 @glfwCreateWindow(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare void @glfwTerminate() #3

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #5

declare void @glfwWaitEvents() #3

declare i32 @glfwWindowShouldClose(ptr noundef) #3

declare void @glfwHideWindow(ptr noundef) #3

declare i32 @thrd_join(i64 noundef, ptr noundef) #3

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { 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, !11, i64 8}
!10 = !{!"", !11, i64 0, !11, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !13, i64 32}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !11, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!11, !11, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}
!21 = distinct !{!21, !16}
!22 = !{!10, !13, i64 32}
!23 = distinct !{!23, !16}


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

@__const.main.threads = external hidden unnamed_addr constant [3 x %struct.Thread], align 16
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [35 x i8], align 1
@running = external hidden global i32, align 4

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.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 [3 x %struct.Thread], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %2) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %2, ptr noundef nonnull align 16 dereferenceable(120) @__const.main.threads, i64 120, i1 false)
  %3 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @error_callback) #7
  %4 = tail call i32 @glfwInit() #7
  %.not = icmp eq i32 %4, 0
  br i1 %.not, label %8, label %.preheader27.preheader

.preheader27.preheader:                           ; preds = %0
  tail call void @glfwWindowHint(i32 noundef 131086, i32 noundef 200) #7
  tail call void @glfwWindowHint(i32 noundef 131087, i32 noundef 200) #7
  %5 = getelementptr inbounds i8, ptr %2, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = tail call ptr @glfwCreateWindow(i32 noundef 200, i32 noundef 200, ptr noundef %6, ptr noundef null, ptr noundef null) #7
  store ptr %7, ptr %2, align 16, !tbaa !12
  %.not24 = icmp eq ptr %7, null
  br i1 %.not24, label %9, label %.preheader27.1

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

9:                                                ; preds = %.preheader27.2, %.preheader27.1, %.preheader27.preheader
  tail call void @glfwTerminate() #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

.preheader27.1:                                   ; preds = %.preheader27.preheader
  %10 = tail call ptr @glfwSetKeyCallback(ptr noundef nonnull %7, ptr noundef nonnull @key_callback) #7
  tail call void @glfwWindowHint(i32 noundef 131086, i32 noundef 450) #7
  tail call void @glfwWindowHint(i32 noundef 131087, i32 noundef 200) #7
  %11 = getelementptr inbounds i8, ptr %2, i64 40
  %12 = getelementptr inbounds i8, ptr %2, i64 48
  %13 = load ptr, ptr %12, align 16, !tbaa !5
  %14 = tail call ptr @glfwCreateWindow(i32 noundef 200, i32 noundef 200, ptr noundef %13, ptr noundef null, ptr noundef null) #7
  store ptr %14, ptr %11, align 8, !tbaa !12
  %.not24.1 = icmp eq ptr %14, null
  br i1 %.not24.1, label %9, label %.preheader27.2

.preheader27.2:                                   ; preds = %.preheader27.1
  %15 = tail call ptr @glfwSetKeyCallback(ptr noundef nonnull %14, ptr noundef nonnull @key_callback) #7
  tail call void @glfwWindowHint(i32 noundef 131086, i32 noundef 700) #7
  tail call void @glfwWindowHint(i32 noundef 131087, i32 noundef 200) #7
  %16 = getelementptr inbounds i8, ptr %2, i64 80
  %17 = getelementptr inbounds i8, ptr %2, i64 88
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = tail call ptr @glfwCreateWindow(i32 noundef 200, i32 noundef 200, ptr noundef %18, ptr noundef null, ptr noundef null) #7
  store ptr %19, ptr %16, align 16, !tbaa !12
  %.not24.2 = icmp eq ptr %19, null
  br i1 %.not24.2, label %9, label %20

20:                                               ; preds = %.preheader27.2
  %21 = tail call ptr @glfwSetKeyCallback(ptr noundef nonnull %19, ptr noundef nonnull @key_callback) #7
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %7) #7
  %22 = tail call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  tail call void @glfwMakeContextCurrent(ptr noundef null) #7
  %23 = getelementptr inbounds i8, ptr %2, i64 32
  %24 = call i32 @thrd_create(ptr noundef nonnull %23, ptr noundef nonnull @thread_main, ptr noundef nonnull %2) #7
  %.not23 = icmp eq i32 %24, 1
  br i1 %.not23, label %25, label %32

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %2, i64 72
  %27 = call i32 @thrd_create(ptr noundef nonnull %26, ptr noundef nonnull @thread_main, ptr noundef nonnull %11) #7
  %.not23.1 = icmp eq i32 %27, 1
  br i1 %.not23.1, label %28, label %32

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %2, i64 112
  %30 = call i32 @thrd_create(ptr noundef nonnull %29, ptr noundef nonnull @thread_main, ptr noundef nonnull %16) #7
  %.not23.2 = icmp eq i32 %30, 1
  br i1 %.not23.2, label %.preheader26, label %32

.preheader26:                                     ; preds = %28
  %31 = load volatile i32, ptr @running, align 4, !tbaa !13
  %.not2131 = icmp eq i32 %31, 0
  br i1 %.not2131, label %.preheader25, label %.lr.ph

32:                                               ; preds = %28, %25, %20
  %33 = load ptr, ptr @stderr, align 8, !tbaa !15
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef nonnull @.str.4) #9
  call void @glfwTerminate() #7
  call void @exit(i32 noundef 1) #8
  unreachable

.preheader25:                                     ; preds = %.loopexit, %.preheader26
  %35 = load ptr, ptr %2, align 16, !tbaa !12
  call void @glfwHideWindow(ptr noundef %35) #7
  %36 = load ptr, ptr %11, align 8, !tbaa !12
  call void @glfwHideWindow(ptr noundef %36) #7
  %37 = load ptr, ptr %16, align 16, !tbaa !12
  call void @glfwHideWindow(ptr noundef %37) #7
  %38 = load i64, ptr %23, align 16, !tbaa !16
  %39 = call i32 @thrd_join(i64 noundef %38, ptr noundef nonnull %1) #7
  %40 = load i64, ptr %26, align 8, !tbaa !16
  %41 = call i32 @thrd_join(i64 noundef %40, ptr noundef nonnull %1) #7
  %42 = load i64, ptr %29, align 16, !tbaa !16
  %43 = call i32 @thrd_join(i64 noundef %42, ptr noundef nonnull %1) #7
  call void @exit(i32 noundef 0) #8
  unreachable

.lr.ph:                                           ; preds = %.preheader26, %.loopexit
  call void @glfwWaitEvents() #7
  %44 = load ptr, ptr %2, align 16, !tbaa !12
  %45 = call i32 @glfwWindowShouldClose(ptr noundef %44) #7
  %.not22 = icmp eq i32 %45, 0
  br i1 %.not22, label %47, label %46

46:                                               ; preds = %.lr.ph
  store volatile i32 0, ptr @running, align 4, !tbaa !13
  br label %47

47:                                               ; preds = %.lr.ph, %46
  %48 = load ptr, ptr %11, align 8, !tbaa !12
  %49 = call i32 @glfwWindowShouldClose(ptr noundef %48) #7
  %.not22.1 = icmp eq i32 %49, 0
  br i1 %.not22.1, label %51, label %50

50:                                               ; preds = %47
  store volatile i32 0, ptr @running, align 4, !tbaa !13
  br label %51

51:                                               ; preds = %50, %47
  %52 = load ptr, ptr %16, align 16, !tbaa !12
  %53 = call i32 @glfwWindowShouldClose(ptr noundef %52) #7
  %.not22.2 = icmp eq i32 %53, 0
  br i1 %.not22.2, label %.loopexit, label %54

54:                                               ; preds = %51
  store volatile i32 0, ptr @running, align 4, !tbaa !13
  br label %.loopexit

.loopexit:                                        ; preds = %54, %51
  %55 = load volatile i32, ptr @running, align 4, !tbaa !13
  %.not21 = icmp eq i32 %55, 0
  br i1 %.not21, label %.preheader25, label %.lr.ph, !llvm.loop !17
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 @glfwCreateWindow(i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @glfwTerminate() local_unnamed_addr #4

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 i32 @thrd_create(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

declare void @glfwWaitEvents() local_unnamed_addr #4

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #4

declare void @glfwHideWindow(ptr noundef) local_unnamed_addr #4

declare i32 @thrd_join(i64 noundef, ptr noundef) local_unnamed_addr #4

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { cold 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, !7, i64 8}
!6 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !11, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !8, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!6, !11, i64 32}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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