; LLVM IR from Erkaman/fluid_sim :: deps/glfw-3.2/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.3 = external hidden unnamed_addr constant [35 x i8], align 1
@running = external hidden global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %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
  call void @glfwWindowHint(i32 noundef 131076, i32 noundef 0)
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %11

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

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

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

32:                                               ; preds = %14
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %34
  %36 = getelementptr inbounds %struct.Thread, ptr %35, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !14
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = mul nsw i32 250, %38
  %40 = add nsw i32 200, %39
  call void @glfwSetWindowPos(ptr noundef %37, i32 noundef %40, i32 noundef 200)
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [3 x %struct.Thread], ptr %4, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.Thread, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !14
  call void @glfwShowWindow(ptr noundef %45)
  br label %46

46:                                               ; preds = %32
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %2, align 4, !tbaa !5
  br label %11, !llvm.loop !15

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

54:                                               ; preds = %72, %49
  %55 = load i32, ptr %2, align 4, !tbaa !5
  %56 = icmp slt i32 %55, 3
  br i1 %56, label %57, label %75

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

68:                                               ; preds = %57
  %69 = load ptr, ptr @stderr, align 8, !tbaa !17
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef @.str.3) #6
  call void @glfwTerminate()
  call void @exit(i32 noundef 1) #7
  unreachable

71:                                               ; preds = %57
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %2, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %2, align 4, !tbaa !5
  br label %54, !llvm.loop !18

75:                                               ; preds = %54
  br label %76

76:                                               ; preds = %96, %75
  %77 = load volatile i32, ptr @running, align 4, !tbaa !5
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %97

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

80:                                               ; preds = %93, %79
  %81 = load i32, ptr %2, align 4, !tbaa !5
  %82 = icmp slt i32 %81, 3
  br i1 %82, label %83, label %96

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

91:                                               ; preds = %83
  store volatile i32 0, ptr @running, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %91, %83
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %2, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %2, align 4, !tbaa !5
  br label %80, !llvm.loop !19

96:                                               ; preds = %80
  br label %76, !llvm.loop !20

97:                                               ; preds = %76
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %98

98:                                               ; preds = %107, %97
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = icmp slt i32 %99, 3
  br i1 %100, label %101, label %110

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

107:                                              ; preds = %101
  %108 = load i32, ptr %2, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %2, align 4, !tbaa !5
  br label %98, !llvm.loop !21

110:                                              ; preds = %98
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %111

111:                                              ; preds = %121, %110
  %112 = load i32, ptr %2, align 4, !tbaa !5
  %113 = icmp slt i32 %112, 3
  br i1 %113, label %114, label %124

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

121:                                              ; preds = %114
  %122 = load i32, ptr %2, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %2, align 4, !tbaa !5
  br label %111, !llvm.loop !23

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

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

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

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

declare void @glfwShowWindow(ptr noundef) #3

declare void @glfwMakeContextCurrent(ptr noundef) #3

declare i32 @gladLoadGLLoader(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) #0

; 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 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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.3 = external hidden unnamed_addr constant [35 x i8], align 1
@running = external hidden global i32, align 4

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %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 %5, label %6

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

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

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

11:                                               ; preds = %6
  tail call void @glfwSetWindowPos(ptr noundef nonnull %9, i32 noundef 200, i32 noundef 200) #7
  tail call void @glfwShowWindow(ptr noundef nonnull %9) #7
  %12 = getelementptr inbounds i8, ptr %2, i64 40
  %13 = getelementptr inbounds i8, ptr %2, i64 48
  %14 = load ptr, ptr %13, align 16, !tbaa !5
  %15 = tail call ptr @glfwCreateWindow(i32 noundef 200, i32 noundef 200, ptr noundef %14, ptr noundef null, ptr noundef null) #7
  store ptr %15, ptr %12, align 8, !tbaa !12
  %.not25.1 = icmp eq ptr %15, null
  br i1 %.not25.1, label %10, label %16

16:                                               ; preds = %11
  tail call void @glfwSetWindowPos(ptr noundef nonnull %15, i32 noundef 450, i32 noundef 200) #7
  tail call void @glfwShowWindow(ptr noundef nonnull %15) #7
  %17 = getelementptr inbounds i8, ptr %2, i64 80
  %18 = getelementptr inbounds i8, ptr %2, i64 88
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = tail call ptr @glfwCreateWindow(i32 noundef 200, i32 noundef 200, ptr noundef %19, ptr noundef null, ptr noundef null) #7
  store ptr %20, ptr %17, align 16, !tbaa !12
  %.not25.2 = icmp eq ptr %20, null
  br i1 %.not25.2, label %10, label %21

21:                                               ; preds = %16
  tail call void @glfwSetWindowPos(ptr noundef nonnull %20, i32 noundef 700, i32 noundef 200) #7
  tail call void @glfwShowWindow(ptr noundef nonnull %20) #7
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %9) #7
  %22 = tail call i32 @gladLoadGLLoader(ptr noundef nonnull @glfwGetProcAddress) #7
  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
  %.not24 = icmp eq i32 %24, 1
  br i1 %.not24, label %25, label %32

25:                                               ; preds = %21
  %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 %12) #7
  %.not24.1 = icmp eq i32 %27, 1
  br i1 %.not24.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 %17) #7
  %.not24.2 = icmp eq i32 %30, 1
  br i1 %.not24.2, label %.preheader27, label %32

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

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

.preheader26:                                     ; preds = %.loopexit, %.preheader27
  %35 = load ptr, ptr %2, align 16, !tbaa !12
  call void @glfwHideWindow(ptr noundef %35) #7
  %36 = load ptr, ptr %12, align 8, !tbaa !12
  call void @glfwHideWindow(ptr noundef %36) #7
  %37 = load ptr, ptr %17, 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 = %.preheader27, %.loopexit
  call void @glfwWaitEvents() #7
  %44 = load ptr, ptr %2, align 16, !tbaa !12
  %45 = call i32 @glfwWindowShouldClose(ptr noundef %44) #7
  %.not23 = icmp eq i32 %45, 0
  br i1 %.not23, 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 %12, align 8, !tbaa !12
  %49 = call i32 @glfwWindowShouldClose(ptr noundef %48) #7
  %.not23.1 = icmp eq i32 %49, 0
  br i1 %.not23.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 %17, align 16, !tbaa !12
  %53 = call i32 @glfwWindowShouldClose(ptr noundef %52) #7
  %.not23.2 = icmp eq i32 %53, 0
  br i1 %.not23.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
  %.not22 = icmp eq i32 %55, 0
  br i1 %.not22, label %.preheader26, label %.lr.ph, !llvm.loop !17
}

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

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

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #3

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

declare i32 @glfwInit() local_unnamed_addr #3

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

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

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

declare void @glfwTerminate() local_unnamed_addr #3

declare void @glfwSetWindowPos(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @glfwShowWindow(ptr noundef) local_unnamed_addr #3

declare void @glfwMakeContextCurrent(ptr noundef) local_unnamed_addr #3

declare i32 @gladLoadGLLoader(ptr noundef) local_unnamed_addr #3

declare ptr @glfwGetProcAddress(ptr noundef) #3

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

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

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

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #3

declare void @glfwHideWindow(ptr noundef) local_unnamed_addr #3

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn nounwind "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