; LLVM IR from Erkaman/fluid_sim :: deps/glfw-3.2/tests (iconify)

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

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@stdout = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = 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 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  br label %16

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

21:                                               ; preds = %16
  %22 = load i32, ptr %6, align 4, !tbaa !5
  switch i32 %22, label %27 [
    i32 97, label %23
    i32 104, label %24
    i32 102, label %25
    i32 110, label %26
  ]

23:                                               ; preds = %21
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %28

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

25:                                               ; preds = %21
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %28

26:                                               ; preds = %21
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %28

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

28:                                               ; preds = %26, %25, %23
  br label %16, !llvm.loop !11

29:                                               ; preds = %16
  %30 = call ptr @glfwSetErrorCallback(ptr noundef @error_callback)
  %31 = call i32 @glfwInit()
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @exit(i32 noundef 1) #6
  unreachable

34:                                               ; preds = %29
  %35 = load i32, ptr %9, align 4, !tbaa !5
  call void @glfwWindowHint(i32 noundef 131078, i32 noundef %35)
  %36 = load i32, ptr %10, align 4, !tbaa !5
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %74

38:                                               ; preds = %34
  %39 = load i32, ptr %11, align 4, !tbaa !5
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %74

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %42 = call ptr @glfwGetMonitors(ptr noundef %13)
  store ptr %42, ptr %14, align 8, !tbaa !9
  %43 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %43, ptr %8, align 4, !tbaa !5
  %44 = load i32, ptr %8, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = call noalias ptr @calloc(i64 noundef %45, i64 noundef 8) #7
  store ptr %46, ptr %12, align 8, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %70, %41
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = load i32, ptr %13, align 4, !tbaa !5
  %50 = icmp slt i32 %48, %49
  br i1 %50, label %51, label %73

51:                                               ; preds = %47
  %52 = load ptr, ptr %14, align 8, !tbaa !9
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds ptr, ptr %52, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = call ptr @create_window(ptr noundef %56)
  %58 = load ptr, ptr %12, align 8, !tbaa !9
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds ptr, ptr %58, i64 %60
  store ptr %57, ptr %61, align 8, !tbaa !9
  %62 = load ptr, ptr %12, align 8, !tbaa !9
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds ptr, ptr %62, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = icmp ne ptr %66, null
  br i1 %67, label %69, label %68

68:                                               ; preds = %51
  br label %73

69:                                               ; preds = %51
  br label %70

70:                                               ; preds = %69
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %7, align 4, !tbaa !5
  br label %47, !llvm.loop !13

73:                                               ; preds = %68, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %87

74:                                               ; preds = %38, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %79

77:                                               ; preds = %74
  %78 = call ptr @glfwGetPrimaryMonitor()
  store ptr %78, ptr %15, align 8, !tbaa !9
  br label %79

79:                                               ; preds = %77, %74
  store i32 1, ptr %8, align 4, !tbaa !5
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = call noalias ptr @calloc(i64 noundef %81, i64 noundef 8) #7
  store ptr %82, ptr %12, align 8, !tbaa !9
  %83 = load ptr, ptr %15, align 8, !tbaa !9
  %84 = call ptr @create_window(ptr noundef %83)
  %85 = load ptr, ptr %12, align 8, !tbaa !9
  %86 = getelementptr inbounds ptr, ptr %85, i64 0
  store ptr %84, ptr %86, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %87

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

88:                                               ; preds = %153, %87
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = load i32, ptr %8, align 4, !tbaa !5
  %91 = icmp slt i32 %89, %90
  br i1 %91, label %92, label %156

92:                                               ; preds = %88
  %93 = load ptr, ptr %12, align 8, !tbaa !9
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds ptr, ptr %93, i64 %95
  %97 = load ptr, ptr %96, align 8, !tbaa !9
  %98 = call ptr @glfwSetKeyCallback(ptr noundef %97, ptr noundef @key_callback)
  %99 = load ptr, ptr %12, align 8, !tbaa !9
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds ptr, ptr %99, i64 %101
  %103 = load ptr, ptr %102, align 8, !tbaa !9
  %104 = call ptr @glfwSetFramebufferSizeCallback(ptr noundef %103, ptr noundef @framebuffer_size_callback)
  %105 = load ptr, ptr %12, align 8, !tbaa !9
  %106 = load i32, ptr %7, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds ptr, ptr %105, i64 %107
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = call ptr @glfwSetWindowSizeCallback(ptr noundef %109, ptr noundef @window_size_callback)
  %111 = load ptr, ptr %12, align 8, !tbaa !9
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds ptr, ptr %111, i64 %113
  %115 = load ptr, ptr %114, align 8, !tbaa !9
  %116 = call ptr @glfwSetWindowFocusCallback(ptr noundef %115, ptr noundef @window_focus_callback)
  %117 = load ptr, ptr %12, align 8, !tbaa !9
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds ptr, ptr %117, i64 %119
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = call ptr @glfwSetWindowIconifyCallback(ptr noundef %121, ptr noundef @window_iconify_callback)
  %123 = load ptr, ptr %12, align 8, !tbaa !9
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds ptr, ptr %123, i64 %125
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = call ptr @glfwSetWindowRefreshCallback(ptr noundef %127, ptr noundef @window_refresh_callback)
  %129 = load ptr, ptr %12, align 8, !tbaa !9
  %130 = load i32, ptr %7, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds ptr, ptr %129, i64 %131
  %133 = load ptr, ptr %132, align 8, !tbaa !9
  call void @window_refresh_callback(ptr noundef %133)
  %134 = load ptr, ptr %12, align 8, !tbaa !9
  %135 = load i32, ptr %7, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds ptr, ptr %134, i64 %136
  %138 = load ptr, ptr %137, align 8, !tbaa !9
  %139 = call i32 @glfwGetWindowAttrib(ptr noundef %138, i32 noundef 131074)
  %140 = icmp ne i32 %139, 0
  %141 = zext i1 %140 to i64
  %142 = select i1 %140, ptr @.str.2, ptr @.str.3
  %143 = load ptr, ptr %12, align 8, !tbaa !9
  %144 = load i32, ptr %7, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds ptr, ptr %143, i64 %145
  %147 = load ptr, ptr %146, align 8, !tbaa !9
  %148 = call i32 @glfwGetWindowAttrib(ptr noundef %147, i32 noundef 131073)
  %149 = icmp ne i32 %148, 0
  %150 = zext i1 %149 to i64
  %151 = select i1 %149, ptr @.str.4, ptr @.str.5
  %152 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %142, ptr noundef %151)
  br label %153

153:                                              ; preds = %92
  %154 = load i32, ptr %7, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %7, align 4, !tbaa !5
  br label %88, !llvm.loop !14

156:                                              ; preds = %88
  br label %157

157:                                              ; preds = %180, %156
  call void @glfwWaitEvents()
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %172, %157
  %159 = load i32, ptr %7, align 4, !tbaa !5
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %162, label %175

162:                                              ; preds = %158
  %163 = load ptr, ptr %12, align 8, !tbaa !9
  %164 = load i32, ptr %7, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds ptr, ptr %163, i64 %165
  %167 = load ptr, ptr %166, align 8, !tbaa !9
  %168 = call i32 @glfwWindowShouldClose(ptr noundef %167)
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %171

170:                                              ; preds = %162
  br label %175

171:                                              ; preds = %162
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %7, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %7, align 4, !tbaa !5
  br label %158, !llvm.loop !15

175:                                              ; preds = %170, %158
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = load i32, ptr %8, align 4, !tbaa !5
  %178 = icmp slt i32 %176, %177
  br i1 %178, label %179, label %180

179:                                              ; preds = %175
  br label %183

180:                                              ; preds = %175
  %181 = load ptr, ptr @stdout, align 8, !tbaa !9
  %182 = call i32 @fflush(ptr noundef %181)
  br label %157

183:                                              ; preds = %179
  call void @glfwTerminate()
  call void @exit(i32 noundef 0) #6
  unreachable
}

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

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

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

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

declare ptr @glfwSetErrorCallback(ptr noundef) #2

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

declare i32 @glfwInit() #2

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

declare ptr @glfwGetMonitors(ptr noundef) #2

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #4

; Function Attrs: nounwind uwtable
declare hidden ptr @create_window(ptr noundef) #0

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

declare ptr @glfwGetPrimaryMonitor() #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) #0

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

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

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

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden void @window_refresh_callback(ptr noundef) #0

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

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

declare void @glfwWaitEvents() #2

declare i32 @glfwWindowShouldClose(ptr noundef) #2

declare i32 @fflush(ptr noundef) #2

declare void @glfwTerminate() #2

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 = { "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 = { nounwind allocsize(0,1) "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 }
attributes #7 = { nounwind allocsize(0,1) }

!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 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !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"

@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [10 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  br label %.outer

.outer:                                           ; preds = %.loopexit128, %2
  %.053.ph = phi i32 [ 0, %.loopexit128 ], [ 1, %2 ]
  %.051.ph = phi i32 [ %.051.ph113, %.loopexit128 ], [ 0, %2 ]
  %.049.ph = phi i32 [ %.049.lcssa118, %.loopexit128 ], [ 0, %2 ]
  br label %.outer112

.outer112:                                        ; preds = %.outer, %.loopexit127
  %.051.ph113 = phi i32 [ %.051.ph, %.outer ], [ 1, %.loopexit127 ]
  %.049.ph114 = phi i32 [ %.049.ph, %.outer ], [ %.049.lcssa117, %.loopexit127 ]
  %4 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #7
  switch i32 %4, label %.loopexit [
    i32 -1, label %.loopexit130
    i32 97, label %.outer112.peel.newph
    i32 104, label %.loopexit126
    i32 102, label %.loopexit127
    i32 110, label %.loopexit128
  ]

.outer112.peel.newph:                             ; preds = %.outer112, %.outer112.peel.newph
  %5 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str) #7
  switch i32 %5, label %.loopexit [
    i32 -1, label %.loopexit125
    i32 97, label %.outer112.peel.newph
    i32 104, label %.loopexit126
    i32 102, label %.loopexit127
    i32 110, label %.loopexit128
  ], !llvm.loop !5

.loopexit126:                                     ; preds = %.outer112, %.outer112.peel.newph
  tail call void @usage()
  tail call void @exit(i32 noundef 0) #8
  unreachable

.loopexit127:                                     ; preds = %.outer112.peel.newph, %.outer112
  %.049.lcssa117 = phi i32 [ %.049.ph114, %.outer112 ], [ 1, %.outer112.peel.newph ]
  br label %.outer112, !llvm.loop !8

.loopexit128:                                     ; preds = %.outer112, %.outer112.peel.newph
  %.049.lcssa118 = phi i32 [ 1, %.outer112.peel.newph ], [ %.049.ph114, %.outer112 ]
  br label %.outer, !llvm.loop !8

.loopexit:                                        ; preds = %.outer112, %.outer112.peel.newph
  tail call void @usage()
  tail call void @exit(i32 noundef 1) #8
  unreachable

.loopexit130:                                     ; preds = %.outer112
  %6 = icmp ne i32 %.049.ph114, 0
  br label %.loopexit125

.loopexit125:                                     ; preds = %.outer112.peel.newph, %.loopexit130
  %.049.lcssa115 = phi i1 [ %6, %.loopexit130 ], [ true, %.outer112.peel.newph ]
  %7 = tail call ptr @glfwSetErrorCallback(ptr noundef nonnull @error_callback) #7
  %8 = tail call i32 @glfwInit() #7
  %.not57 = icmp eq i32 %8, 0
  br i1 %.not57, label %9, label %10

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

10:                                               ; preds = %.loopexit125
  tail call void @glfwWindowHint(i32 noundef 131078, i32 noundef %.053.ph) #7
  %11 = icmp ne i32 %.051.ph113, 0
  %or.cond = select i1 %11, i1 %.049.lcssa115, i1 false
  br i1 %or.cond, label %12, label %27

12:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %13 = call ptr @glfwGetMonitors(ptr noundef nonnull %3) #7
  %14 = load i32, ptr %3, align 4, !tbaa !9
  %15 = freeze i32 %14
  %16 = sext i32 %15 to i64
  %17 = call noalias ptr @calloc(i64 noundef %16, i64 noundef 8) #9
  %18 = icmp sgt i32 %15, 0
  br i1 %18, label %.lr.ph, label %.thread97

.thread97:                                        ; preds = %12
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %.critedge

19:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %32, !llvm.loop !13

.lr.ph:                                           ; preds = %12, %19
  %indvars.iv = phi i64 [ %indvars.iv.next, %19 ], [ 0, %12 ]
  %23 = getelementptr inbounds ptr, ptr %13, i64 %indvars.iv
  %24 = load ptr, ptr %23, align 8, !tbaa !14
  %25 = call ptr @create_window(ptr noundef %24)
  %26 = getelementptr inbounds ptr, ptr %17, i64 %indvars.iv
  store ptr %25, ptr %26, align 8, !tbaa !14
  %.not58 = icmp eq ptr %25, null
  br i1 %.not58, label %32, label %19

27:                                               ; preds = %10
  br i1 %11, label %28, label %.thread

28:                                               ; preds = %27
  %29 = tail call ptr @glfwGetPrimaryMonitor() #7
  br label %.thread

.thread:                                          ; preds = %27, %28
  %.0 = phi ptr [ %29, %28 ], [ null, %27 ]
  %30 = tail call noalias dereferenceable_or_null(8) ptr @calloc(i64 noundef 1, i64 noundef 8) #9
  %31 = tail call ptr @create_window(ptr noundef %.0)
  store ptr %31, ptr %30, align 8, !tbaa !14
  br label %.lr.ph72.preheader

32:                                               ; preds = %.lr.ph, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %33 = zext nneg i32 %15 to i64
  br label %.lr.ph72.preheader

.lr.ph72.preheader:                               ; preds = %32, %.thread
  %.04895 = phi ptr [ %30, %.thread ], [ %17, %32 ]
  %.05593 = phi i64 [ 1, %.thread ], [ %33, %32 ]
  br label %.lr.ph72

.lr.ph75.us:                                      ; preds = %.lr.ph72, %..critedge_crit_edge.us
  call void @glfwWaitEvents() #7
  br label %35

34:                                               ; preds = %35
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond90.not = icmp eq i64 %indvars.iv.next87, %.05593
  br i1 %exitcond90.not, label %..critedge_crit_edge.us, label %35, !llvm.loop !16

35:                                               ; preds = %.lr.ph75.us, %34
  %indvars.iv86 = phi i64 [ 0, %.lr.ph75.us ], [ %indvars.iv.next87, %34 ]
  %36 = getelementptr inbounds ptr, ptr %.04895, i64 %indvars.iv86
  %37 = load ptr, ptr %36, align 8, !tbaa !14
  %38 = call i32 @glfwWindowShouldClose(ptr noundef %37) #7
  %.not59.us = icmp eq i32 %38, 0
  br i1 %.not59.us, label %34, label %.split.us

..critedge_crit_edge.us:                          ; preds = %34
  %39 = load ptr, ptr @stdout, align 8, !tbaa !14
  %40 = call i32 @fflush(ptr noundef %39)
  br label %.lr.ph75.us

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %.lr.ph72
  %indvars.iv83 = phi i64 [ 0, %.lr.ph72.preheader ], [ %indvars.iv.next84, %.lr.ph72 ]
  %41 = getelementptr inbounds ptr, ptr %.04895, i64 %indvars.iv83
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  %43 = call ptr @glfwSetKeyCallback(ptr noundef %42, ptr noundef nonnull @key_callback) #7
  %44 = load ptr, ptr %41, align 8, !tbaa !14
  %45 = call ptr @glfwSetFramebufferSizeCallback(ptr noundef %44, ptr noundef nonnull @framebuffer_size_callback) #7
  %46 = load ptr, ptr %41, align 8, !tbaa !14
  %47 = call ptr @glfwSetWindowSizeCallback(ptr noundef %46, ptr noundef nonnull @window_size_callback) #7
  %48 = load ptr, ptr %41, align 8, !tbaa !14
  %49 = call ptr @glfwSetWindowFocusCallback(ptr noundef %48, ptr noundef nonnull @window_focus_callback) #7
  %50 = load ptr, ptr %41, align 8, !tbaa !14
  %51 = call ptr @glfwSetWindowIconifyCallback(ptr noundef %50, ptr noundef nonnull @window_iconify_callback) #7
  %52 = load ptr, ptr %41, align 8, !tbaa !14
  %53 = call ptr @glfwSetWindowRefreshCallback(ptr noundef %52, ptr noundef nonnull @window_refresh_callback) #7
  %54 = load ptr, ptr %41, align 8, !tbaa !14
  call void @window_refresh_callback(ptr noundef %54)
  %55 = load ptr, ptr %41, align 8, !tbaa !14
  %56 = call i32 @glfwGetWindowAttrib(ptr noundef %55, i32 noundef 131074) #7
  %.not60 = icmp eq i32 %56, 0
  %57 = select i1 %.not60, ptr @.str.3, ptr @.str.2
  %58 = load ptr, ptr %41, align 8, !tbaa !14
  %59 = call i32 @glfwGetWindowAttrib(ptr noundef %58, i32 noundef 131073) #7
  %.not61 = icmp eq i32 %59, 0
  %60 = select i1 %.not61, ptr @.str.5, ptr @.str.4
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %57, ptr noundef nonnull %60)
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next84, %.05593
  br i1 %exitcond.not, label %.lr.ph75.us, label %.lr.ph72, !llvm.loop !17

.critedge:                                        ; preds = %.thread97, %.critedge
  call void @glfwWaitEvents() #7
  %62 = load ptr, ptr @stdout, align 8, !tbaa !14
  %63 = call i32 @fflush(ptr noundef %62)
  br label %.critedge

.split.us:                                        ; preds = %35
  call void @glfwTerminate() #7
  call void @exit(i32 noundef 0) #8
  unreachable
}

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

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

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

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

declare ptr @glfwSetErrorCallback(ptr noundef) local_unnamed_addr #2

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

declare i32 @glfwInit() local_unnamed_addr #2

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

declare ptr @glfwGetMonitors(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
declare hidden ptr @create_window(ptr noundef) local_unnamed_addr #3

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

declare ptr @glfwGetPrimaryMonitor() local_unnamed_addr #2

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

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

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

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

declare ptr @glfwSetWindowSizeCallback(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @glfwSetWindowFocusCallback(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @glfwSetWindowIconifyCallback(ptr noundef, ptr noundef) local_unnamed_addr #2

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

declare ptr @glfwSetWindowRefreshCallback(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden void @window_refresh_callback(ptr noundef) #3

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

declare i32 @glfwGetWindowAttrib(ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @glfwWaitEvents() local_unnamed_addr #2

declare i32 @glfwWindowShouldClose(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #6

declare void @glfwTerminate() local_unnamed_addr #2

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 = { "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 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 #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 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nounwind allocsize(0,1) }

!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 = distinct !{!5, !6, !7}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!"llvm.loop.peeled.count", i32 1}
!8 = distinct !{!8, !6}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C/C++ TBAA"}
!13 = distinct !{!13, !6}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !11, i64 0}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}


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