; LLVM IR from unitreerobotics/kinect_teleoperate :: src/extern/glfw/src/examples (particles)

; 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.anon = type { double, float, i32, i32, %union.pthread_cond_t, %union.pthread_cond_t, %union.pthread_mutex_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.GLFWvidmode = type { i32, i32, i32, i32, i32, i32 }

@glad_glBindTexture = external dso_local global ptr, align 8
@glad_glGenTextures = external dso_local global ptr, align 8
@glad_glLightModeli = external dso_local global ptr, align 8
@glad_glPixelStorei = external dso_local global ptr, align 8
@glad_glPolygonMode = external dso_local global ptr, align 8
@glad_glTexImage2D = external dso_local global ptr, align 8
@glad_glTexParameteri = external dso_local global ptr, align 8
@particle_texture = external dso_local constant <{ [54 x i8], [10 x i8] }>, align 16
@floor_texture = external dso_local constant [256 x i8], align 16
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@particle_tex_id = external dso_local global i32, align 4
@floor_tex_id = external dso_local global i32, align 4
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@wireframe = external dso_local global i32, align 4
@thread_sync = external dso_local global %struct.anon, align 8

; 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 i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, 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) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store ptr null, ptr %11, align 8, !tbaa !9
  %13 = call i32 @glfwInit()
  %14 = icmp ne i32 %13, 0
  br i1 %14, label %18, label %15

15:                                               ; preds = %2
  %16 = load ptr, ptr @stderr, align 8, !tbaa !9
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef @.str.1) #5
  call void @exit(i32 noundef 1) #6
  unreachable

18:                                               ; preds = %2
  br label %19

19:                                               ; preds = %29, %18
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  %22 = call i32 @getopt(i32 noundef %20, ptr noundef %21, ptr noundef @.str.2)
  store i32 %22, ptr %6, align 4, !tbaa !5
  %23 = icmp ne i32 %22, -1
  br i1 %23, label %24, label %30

24:                                               ; preds = %19
  %25 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %25, label %29 [
    i32 102, label %26
    i32 104, label %28
  ]

26:                                               ; preds = %24
  %27 = call ptr @glfwGetPrimaryMonitor()
  store ptr %27, ptr %11, align 8, !tbaa !9
  br label %29

28:                                               ; preds = %24
  call void @usage()
  call void @exit(i32 noundef 0) #6
  unreachable

29:                                               ; preds = %26, %24
  br label %19, !llvm.loop !13

30:                                               ; preds = %19
  %31 = load ptr, ptr %11, align 8, !tbaa !9
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %54

33:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %34 = load ptr, ptr %11, align 8, !tbaa !9
  %35 = call ptr @glfwGetVideoMode(ptr noundef %34)
  store ptr %35, ptr %12, align 8, !tbaa !9
  %36 = load ptr, ptr %12, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.GLFWvidmode, ptr %36, i32 0, i32 2
  %38 = load i32, ptr %37, align 4, !tbaa !15
  call void @glfwWindowHint(i32 noundef 135169, i32 noundef %38)
  %39 = load ptr, ptr %12, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.GLFWvidmode, ptr %39, i32 0, i32 3
  %41 = load i32, ptr %40, align 4, !tbaa !17
  call void @glfwWindowHint(i32 noundef 135170, i32 noundef %41)
  %42 = load ptr, ptr %12, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct.GLFWvidmode, ptr %42, i32 0, i32 4
  %44 = load i32, ptr %43, align 4, !tbaa !18
  call void @glfwWindowHint(i32 noundef 135171, i32 noundef %44)
  %45 = load ptr, ptr %12, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.GLFWvidmode, ptr %45, i32 0, i32 5
  %47 = load i32, ptr %46, align 4, !tbaa !19
  call void @glfwWindowHint(i32 noundef 135183, i32 noundef %47)
  %48 = load ptr, ptr %12, align 8, !tbaa !9
  %49 = getelementptr inbounds %struct.GLFWvidmode, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 4, !tbaa !20
  store i32 %50, ptr %7, align 4, !tbaa !5
  %51 = load ptr, ptr %12, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.GLFWvidmode, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !21
  store i32 %53, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  br label %55

54:                                               ; preds = %30
  store i32 640, ptr %7, align 4, !tbaa !5
  store i32 480, ptr %8, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %54, %33
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = load i32, ptr %8, align 4, !tbaa !5
  %58 = load ptr, ptr %11, align 8, !tbaa !9
  %59 = call ptr @glfwCreateWindow(i32 noundef %56, i32 noundef %57, ptr noundef @.str.3, ptr noundef %58, ptr noundef null)
  store ptr %59, ptr %10, align 8, !tbaa !9
  %60 = load ptr, ptr %10, align 8, !tbaa !9
  %61 = icmp ne ptr %60, null
  br i1 %61, label %65, label %62

62:                                               ; preds = %55
  %63 = load ptr, ptr @stderr, align 8, !tbaa !9
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.4) #5
  call void @glfwTerminate()
  call void @exit(i32 noundef 1) #6
  unreachable

65:                                               ; preds = %55
  %66 = load ptr, ptr %11, align 8, !tbaa !9
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %70

68:                                               ; preds = %65
  %69 = load ptr, ptr %10, align 8, !tbaa !9
  call void @glfwSetInputMode(ptr noundef %69, i32 noundef 208897, i32 noundef 212995)
  br label %70

70:                                               ; preds = %68, %65
  %71 = load ptr, ptr %10, align 8, !tbaa !9
  call void @glfwMakeContextCurrent(ptr noundef %71)
  %72 = call i32 @gladLoadGL(ptr noundef @glfwGetProcAddress)
  call void @glfwSwapInterval(i32 noundef 1)
  %73 = load ptr, ptr %10, align 8, !tbaa !9
  %74 = call ptr @glfwSetFramebufferSizeCallback(ptr noundef %73, ptr noundef @resize_callback)
  %75 = load ptr, ptr %10, align 8, !tbaa !9
  %76 = call ptr @glfwSetKeyCallback(ptr noundef %75, ptr noundef @key_callback)
  %77 = load ptr, ptr %10, align 8, !tbaa !9
  call void @glfwGetFramebufferSize(ptr noundef %77, ptr noundef %7, ptr noundef %8)
  %78 = load ptr, ptr %10, align 8, !tbaa !9
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = load i32, ptr %8, align 4, !tbaa !5
  call void @resize_callback(ptr noundef %78, i32 noundef %79, i32 noundef %80)
  %81 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !9
  call void %81(i32 noundef 1, ptr noundef @particle_tex_id)
  %82 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !9
  %83 = load i32, ptr @particle_tex_id, align 4, !tbaa !5
  call void %82(i32 noundef 3553, i32 noundef %83)
  %84 = load ptr, ptr @glad_glPixelStorei, align 8, !tbaa !9
  call void %84(i32 noundef 3317, i32 noundef 1)
  %85 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %85(i32 noundef 3553, i32 noundef 10242, i32 noundef 10496)
  %86 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %86(i32 noundef 3553, i32 noundef 10243, i32 noundef 10496)
  %87 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %87(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  %88 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %88(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  %89 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !9
  call void %89(i32 noundef 3553, i32 noundef 0, i32 noundef 6409, i32 noundef 8, i32 noundef 8, i32 noundef 0, i32 noundef 6409, i32 noundef 5121, ptr noundef @particle_texture)
  %90 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !9
  call void %90(i32 noundef 1, ptr noundef @floor_tex_id)
  %91 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !9
  %92 = load i32, ptr @floor_tex_id, align 4, !tbaa !5
  call void %91(i32 noundef 3553, i32 noundef %92)
  %93 = load ptr, ptr @glad_glPixelStorei, align 8, !tbaa !9
  call void %93(i32 noundef 3317, i32 noundef 1)
  %94 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %94(i32 noundef 3553, i32 noundef 10242, i32 noundef 10497)
  %95 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %95(i32 noundef 3553, i32 noundef 10243, i32 noundef 10497)
  %96 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %96(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729)
  %97 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %97(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729)
  %98 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !9
  call void %98(i32 noundef 3553, i32 noundef 0, i32 noundef 6409, i32 noundef 16, i32 noundef 16, i32 noundef 0, i32 noundef 6409, i32 noundef 5121, ptr noundef @floor_texture)
  %99 = call i32 @glfwExtensionSupported(ptr noundef @.str.5)
  %100 = icmp ne i32 %99, 0
  br i1 %100, label %101, label %103

101:                                              ; preds = %70
  %102 = load ptr, ptr @glad_glLightModeli, align 8, !tbaa !9
  call void %102(i32 noundef 33272, i32 noundef 33274)
  br label %103

103:                                              ; preds = %101, %70
  %104 = load ptr, ptr @glad_glPolygonMode, align 8, !tbaa !9
  call void %104(i32 noundef 1032, i32 noundef 6914)
  store i32 0, ptr @wireframe, align 4, !tbaa !5
  store double 0.000000e+00, ptr @thread_sync, align 8, !tbaa !22
  store float 0x3F50624DE0000000, ptr getelementptr inbounds (%struct.anon, ptr @thread_sync, i32 0, i32 1), align 8, !tbaa !26
  store i32 0, ptr getelementptr inbounds (%struct.anon, ptr @thread_sync, i32 0, i32 2), align 4, !tbaa !27
  store i32 0, ptr getelementptr inbounds (%struct.anon, ptr @thread_sync, i32 0, i32 3), align 8, !tbaa !28
  %105 = call i32 @mtx_init(ptr noundef getelementptr inbounds (%struct.anon, ptr @thread_sync, i32 0, i32 6), i32 noundef 2)
  %106 = call i32 @cnd_init(ptr noundef getelementptr inbounds (%struct.anon, ptr @thread_sync, i32 0, i32 4))
  %107 = call i32 @cnd_init(ptr noundef getelementptr inbounds (%struct.anon, ptr @thread_sync, i32 0, i32 5))
  %108 = load ptr, ptr %10, align 8, !tbaa !9
  %109 = call i32 @thrd_create(ptr noundef %9, ptr noundef @physics_thread_main, ptr noundef %108)
  %110 = icmp ne i32 %109, 1
  br i1 %110, label %111, label %112

111:                                              ; preds = %103
  call void @glfwTerminate()
  call void @exit(i32 noundef 1) #6
  unreachable

112:                                              ; preds = %103
  call void @glfwSetTime(double noundef 0.000000e+00)
  br label %113

113:                                              ; preds = %118, %112
  %114 = load ptr, ptr %10, align 8, !tbaa !9
  %115 = call i32 @glfwWindowShouldClose(ptr noundef %114)
  %116 = icmp ne i32 %115, 0
  %117 = xor i1 %116, true
  br i1 %117, label %118, label %122

118:                                              ; preds = %113
  %119 = load ptr, ptr %10, align 8, !tbaa !9
  %120 = call double @glfwGetTime()
  call void @draw_scene(ptr noundef %119, double noundef %120)
  %121 = load ptr, ptr %10, align 8, !tbaa !9
  call void @glfwSwapBuffers(ptr noundef %121)
  call void @glfwPollEvents()
  br label %113, !llvm.loop !29

122:                                              ; preds = %113
  %123 = load i64, ptr %9, align 8, !tbaa !11
  %124 = call i32 @thrd_join(i64 noundef %123, ptr noundef null)
  %125 = load ptr, ptr %10, align 8, !tbaa !9
  call void @glfwDestroyWindow(ptr noundef %125)
  call void @glfwTerminate()
  call void @exit(i32 noundef 0) #6
  unreachable
}

declare i32 @glfwInit() #2

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

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

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

declare ptr @glfwGetPrimaryMonitor() #2

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

declare ptr @glfwGetVideoMode(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 void @glfwSetInputMode(ptr noundef, i32 noundef, i32 noundef) #2

declare void @glfwMakeContextCurrent(ptr noundef) #2

declare ptr @glfwGetProcAddress(ptr noundef) #2

declare void @glfwSwapInterval(i32 noundef) #2

declare ptr @glfwSetFramebufferSizeCallback(ptr noundef, ptr noundef) #2

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

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

declare i32 @glfwExtensionSupported(ptr noundef) #2

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

declare i32 @cnd_init(ptr noundef) #2

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

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

declare void @glfwSetTime(double noundef) #2

declare i32 @glfwWindowShouldClose(ptr noundef) #2

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

declare double @glfwGetTime() #2

declare void @glfwSwapBuffers(ptr noundef) #2

declare void @glfwPollEvents() #2

declare i32 @thrd_join(i64 noundef, ptr noundef) #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 = { 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 = { 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 }
attributes #6 = { 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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 8}
!16 = !{!"GLFWvidmode", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!17 = !{!16, !6, i64 12}
!18 = !{!16, !6, i64 16}
!19 = !{!16, !6, i64 20}
!20 = !{!16, !6, i64 0}
!21 = !{!16, !6, i64 4}
!22 = !{!23, !24, i64 0}
!23 = !{!"", !24, i64 0, !25, i64 8, !6, i64 12, !6, i64 16, !7, i64 24, !7, i64 72, !7, i64 120}
!24 = !{!"double", !7, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{!23, !25, i64 8}
!27 = !{!23, !6, i64 12}
!28 = !{!23, !6, i64 16}
!29 = distinct !{!29, !14}


; 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.anon = type { double, float, i32, i32, %union.pthread_cond_t, %union.pthread_cond_t, %union.pthread_mutex_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }

@glad_glBindTexture = external dso_local local_unnamed_addr global ptr, align 8
@glad_glGenTextures = external dso_local local_unnamed_addr global ptr, align 8
@glad_glLightModeli = external dso_local local_unnamed_addr global ptr, align 8
@glad_glPixelStorei = external dso_local local_unnamed_addr global ptr, align 8
@glad_glPolygonMode = external dso_local local_unnamed_addr global ptr, align 8
@glad_glTexImage2D = external dso_local local_unnamed_addr global ptr, align 8
@glad_glTexParameteri = external dso_local local_unnamed_addr global ptr, align 8
@particle_texture = external dso_local constant <{ [54 x i8], [10 x i8] }>, align 16
@floor_texture = external dso_local constant [256 x i8], align 16
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@particle_tex_id = external dso_local global i32, align 4
@floor_tex_id = external dso_local global i32, align 4
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@wireframe = external dso_local local_unnamed_addr global i32, align 4
@thread_sync = external dso_local global %struct.anon, align 8

; 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(i32 noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store i64 0, ptr %5, align 8, !tbaa !5
  %6 = tail call i32 @glfwInit() #6
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %7, label %.preheader.outer

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !9
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.1) #7
  tail call void @exit(i32 noundef 1) #8
  unreachable

.preheader:                                       ; preds = %.preheader.outer, %.preheader
  %10 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.2) #6
  switch i32 %10, label %.preheader [
    i32 -1, label %14
    i32 102, label %11
    i32 104, label %13
  ], !llvm.loop !11

11:                                               ; preds = %.preheader
  %12 = tail call ptr @glfwGetPrimaryMonitor() #6
  br label %.preheader.outer, !llvm.loop !11

.preheader.outer:                                 ; preds = %2, %11
  %.0.ph = phi ptr [ %12, %11 ], [ null, %2 ]
  br label %.preheader

13:                                               ; preds = %.preheader
  tail call void @usage()
  tail call void @exit(i32 noundef 0) #8
  unreachable

14:                                               ; preds = %.preheader
  %.not27 = icmp eq ptr %.0.ph, null
  br i1 %.not27, label %28, label %15

15:                                               ; preds = %14
  %16 = tail call ptr @glfwGetVideoMode(ptr noundef nonnull %.0.ph) #6
  %17 = getelementptr inbounds i8, ptr %16, i64 8
  %18 = load i32, ptr %17, align 4, !tbaa !13
  tail call void @glfwWindowHint(i32 noundef 135169, i32 noundef %18) #6
  %19 = getelementptr inbounds i8, ptr %16, i64 12
  %20 = load i32, ptr %19, align 4, !tbaa !16
  tail call void @glfwWindowHint(i32 noundef 135170, i32 noundef %20) #6
  %21 = getelementptr inbounds i8, ptr %16, i64 16
  %22 = load i32, ptr %21, align 4, !tbaa !17
  tail call void @glfwWindowHint(i32 noundef 135171, i32 noundef %22) #6
  %23 = getelementptr inbounds i8, ptr %16, i64 20
  %24 = load i32, ptr %23, align 4, !tbaa !18
  tail call void @glfwWindowHint(i32 noundef 135183, i32 noundef %24) #6
  %25 = load i32, ptr %16, align 4, !tbaa !19
  %26 = getelementptr inbounds i8, ptr %16, i64 4
  %27 = load i32, ptr %26, align 4, !tbaa !20
  br label %28

28:                                               ; preds = %14, %15
  %.sink = phi i32 [ %25, %15 ], [ 640, %14 ]
  %storemerge = phi i32 [ %27, %15 ], [ 480, %14 ]
  store i32 %.sink, ptr %3, align 4
  store i32 %storemerge, ptr %4, align 4, !tbaa !21
  %29 = tail call ptr @glfwCreateWindow(i32 noundef %.sink, i32 noundef %storemerge, ptr noundef nonnull @.str.3, ptr noundef %.0.ph, ptr noundef null) #6
  %.not28 = icmp eq ptr %29, null
  br i1 %.not28, label %30, label %33

30:                                               ; preds = %28
  %31 = load ptr, ptr @stderr, align 8, !tbaa !9
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.4) #7
  tail call void @glfwTerminate() #6
  tail call void @exit(i32 noundef 1) #8
  unreachable

33:                                               ; preds = %28
  br i1 %.not27, label %35, label %34

34:                                               ; preds = %33
  tail call void @glfwSetInputMode(ptr noundef nonnull %29, i32 noundef 208897, i32 noundef 212995) #6
  br label %35

35:                                               ; preds = %34, %33
  tail call void @glfwMakeContextCurrent(ptr noundef nonnull %29) #6
  %36 = tail call i32 @gladLoadGL(ptr noundef nonnull @glfwGetProcAddress)
  tail call void @glfwSwapInterval(i32 noundef 1) #6
  %37 = tail call ptr @glfwSetFramebufferSizeCallback(ptr noundef nonnull %29, ptr noundef nonnull @resize_callback) #6
  %38 = tail call ptr @glfwSetKeyCallback(ptr noundef nonnull %29, ptr noundef nonnull @key_callback) #6
  call void @glfwGetFramebufferSize(ptr noundef nonnull %29, ptr noundef nonnull %3, ptr noundef nonnull %4) #6
  %39 = load i32, ptr %3, align 4, !tbaa !21
  %40 = load i32, ptr %4, align 4, !tbaa !21
  call void @resize_callback(ptr noundef nonnull %29, i32 noundef %39, i32 noundef %40)
  %41 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !9
  call void %41(i32 noundef 1, ptr noundef nonnull @particle_tex_id) #6
  %42 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !9
  %43 = load i32, ptr @particle_tex_id, align 4, !tbaa !21
  call void %42(i32 noundef 3553, i32 noundef %43) #6
  %44 = load ptr, ptr @glad_glPixelStorei, align 8, !tbaa !9
  call void %44(i32 noundef 3317, i32 noundef 1) #6
  %45 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %45(i32 noundef 3553, i32 noundef 10242, i32 noundef 10496) #6
  %46 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %46(i32 noundef 3553, i32 noundef 10243, i32 noundef 10496) #6
  %47 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %47(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729) #6
  %48 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %48(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729) #6
  %49 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !9
  call void %49(i32 noundef 3553, i32 noundef 0, i32 noundef 6409, i32 noundef 8, i32 noundef 8, i32 noundef 0, i32 noundef 6409, i32 noundef 5121, ptr noundef nonnull @particle_texture) #6
  %50 = load ptr, ptr @glad_glGenTextures, align 8, !tbaa !9
  call void %50(i32 noundef 1, ptr noundef nonnull @floor_tex_id) #6
  %51 = load ptr, ptr @glad_glBindTexture, align 8, !tbaa !9
  %52 = load i32, ptr @floor_tex_id, align 4, !tbaa !21
  call void %51(i32 noundef 3553, i32 noundef %52) #6
  %53 = load ptr, ptr @glad_glPixelStorei, align 8, !tbaa !9
  call void %53(i32 noundef 3317, i32 noundef 1) #6
  %54 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %54(i32 noundef 3553, i32 noundef 10242, i32 noundef 10497) #6
  %55 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %55(i32 noundef 3553, i32 noundef 10243, i32 noundef 10497) #6
  %56 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %56(i32 noundef 3553, i32 noundef 10240, i32 noundef 9729) #6
  %57 = load ptr, ptr @glad_glTexParameteri, align 8, !tbaa !9
  call void %57(i32 noundef 3553, i32 noundef 10241, i32 noundef 9729) #6
  %58 = load ptr, ptr @glad_glTexImage2D, align 8, !tbaa !9
  call void %58(i32 noundef 3553, i32 noundef 0, i32 noundef 6409, i32 noundef 16, i32 noundef 16, i32 noundef 0, i32 noundef 6409, i32 noundef 5121, ptr noundef nonnull @floor_texture) #6
  %59 = call i32 @glfwExtensionSupported(ptr noundef nonnull @.str.5) #6
  %.not29 = icmp eq i32 %59, 0
  br i1 %.not29, label %62, label %60

60:                                               ; preds = %35
  %61 = load ptr, ptr @glad_glLightModeli, align 8, !tbaa !9
  call void %61(i32 noundef 33272, i32 noundef 33274) #6
  br label %62

62:                                               ; preds = %60, %35
  %63 = load ptr, ptr @glad_glPolygonMode, align 8, !tbaa !9
  call void %63(i32 noundef 1032, i32 noundef 6914) #6
  store i32 0, ptr @wireframe, align 4, !tbaa !21
  store double 0.000000e+00, ptr @thread_sync, align 8, !tbaa !22
  store float 0x3F50624DE0000000, ptr getelementptr inbounds (i8, ptr @thread_sync, i64 8), align 8, !tbaa !26
  store i32 0, ptr getelementptr inbounds (i8, ptr @thread_sync, i64 12), align 4, !tbaa !27
  store i32 0, ptr getelementptr inbounds (i8, ptr @thread_sync, i64 16), align 8, !tbaa !28
  %64 = call i32 @mtx_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @thread_sync, i64 120), i32 noundef 2) #6
  %65 = call i32 @cnd_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @thread_sync, i64 24)) #6
  %66 = call i32 @cnd_init(ptr noundef nonnull getelementptr inbounds (i8, ptr @thread_sync, i64 72)) #6
  %67 = call i32 @thrd_create(ptr noundef nonnull %5, ptr noundef nonnull @physics_thread_main, ptr noundef nonnull %29) #6
  %.not30 = icmp eq i32 %67, 1
  br i1 %.not30, label %69, label %68

68:                                               ; preds = %62
  call void @glfwTerminate() #6
  call void @exit(i32 noundef 1) #8
  unreachable

69:                                               ; preds = %62
  call void @glfwSetTime(double noundef 0.000000e+00) #6
  %70 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %29) #6
  %.not3133 = icmp eq i32 %70, 0
  br i1 %.not3133, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %69, %.lr.ph
  %71 = call double @glfwGetTime() #6
  call void @draw_scene(ptr noundef nonnull %29, double noundef %71)
  call void @glfwSwapBuffers(ptr noundef nonnull %29) #6
  call void @glfwPollEvents() #6
  %72 = call i32 @glfwWindowShouldClose(ptr noundef nonnull %29) #6
  %.not31 = icmp eq i32 %72, 0
  br i1 %.not31, label %.lr.ph, label %._crit_edge, !llvm.loop !29

._crit_edge:                                      ; preds = %.lr.ph, %69
  %73 = load i64, ptr %5, align 8, !tbaa !5
  %74 = call i32 @thrd_join(i64 noundef %73, ptr noundef null) #6
  call void @glfwDestroyWindow(ptr noundef nonnull %29) #6
  call void @glfwTerminate() #6
  call void @exit(i32 noundef 0) #8
  unreachable
}

declare i32 @glfwInit() local_unnamed_addr #3

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

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

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

declare ptr @glfwGetPrimaryMonitor() local_unnamed_addr #3

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

declare ptr @glfwGetVideoMode(ptr noundef) local_unnamed_addr #3

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

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

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

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

declare i32 @glfwExtensionSupported(ptr noundef) local_unnamed_addr #3

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

declare i32 @cnd_init(ptr noundef) local_unnamed_addr #3

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

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

declare void @glfwSetTime(double noundef) local_unnamed_addr #3

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @draw_scene(ptr noundef, double noundef) local_unnamed_addr #1

declare double @glfwGetTime() local_unnamed_addr #3

declare void @glfwSwapBuffers(ptr noundef) local_unnamed_addr #3

declare void @glfwPollEvents() local_unnamed_addr #3

declare i32 @thrd_join(i64 noundef, ptr noundef) 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 = { 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 #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 = { nounwind }
attributes #7 = { cold nounwind }
attributes #8 = { 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 = !{!"long", !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, !15, i64 8}
!14 = !{!"GLFWvidmode", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!15 = !{!"int", !7, i64 0}
!16 = !{!14, !15, i64 12}
!17 = !{!14, !15, i64 16}
!18 = !{!14, !15, i64 20}
!19 = !{!14, !15, i64 0}
!20 = !{!14, !15, i64 4}
!21 = !{!15, !15, i64 0}
!22 = !{!23, !24, i64 0}
!23 = !{!"", !24, i64 0, !25, i64 8, !15, i64 12, !15, i64 16, !7, i64 24, !7, i64 72, !7, i64 120}
!24 = !{!"double", !7, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{!23, !25, i64 8}
!27 = !{!23, !15, i64 12}
!28 = !{!23, !15, i64 16}
!29 = distinct !{!29, !12}


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