; LLVM IR from clangen/musikcube :: src/3rdparty/win32_src/pdcurses (window)

; 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.SCREEN = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i16, i32, i32, i32, i32, i32, i32, i64, i32, i32, ptr, i32, i32, i32, i8, i32, i64, i8, i8, %struct.MOUSE_STATUS, i16, i64, ptr, ptr, i8, i8, i32, i32, ptr, i32, i32, ptr, i32, i32, ptr }
%struct.MOUSE_STATUS = type { i32, i32, [9 x i16], i32 }
%struct._opaque_screen_t = type { ptr, i32, i32, i8, ptr, i32, i32, i32, ptr, i32, i8, ptr, ptr }
%struct._win = type { i32, i32, i32, i32, i32, i32, i32, i64, i64, i8, i8, i8, i8, i8, i8, i8, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32 }

@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@SP = external global ptr, align 8
@__PRETTY_FUNCTION__.delwin = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @delwin(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = icmp ne ptr %6, null
  br i1 %7, label %8, label %9

8:                                                ; preds = %1
  br label %10

9:                                                ; preds = %1
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 287, ptr noundef @__PRETTY_FUNCTION__.delwin) #5
  unreachable

10:                                               ; preds = %8
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = icmp ne ptr %11, null
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %189

14:                                               ; preds = %10
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %55, %14
  %16 = load i32, ptr %4, align 4, !tbaa !9
  %17 = load ptr, ptr @SP, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.SCREEN, ptr %17, i32 0, i32 45
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %struct._opaque_screen_t, ptr %19, i32 0, i32 7
  %21 = load i32, ptr %20, align 8, !tbaa !17
  %22 = icmp slt i32 %16, %21
  br i1 %22, label %23, label %58

23:                                               ; preds = %15
  %24 = load ptr, ptr @SP, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.SCREEN, ptr %24, i32 0, i32 45
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = getelementptr inbounds %struct._opaque_screen_t, ptr %26, i32 0, i32 8
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = load i32, ptr %4, align 4, !tbaa !9
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds ptr, ptr %28, i64 %30
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._win, ptr %32, i32 0, i32 24
  %34 = load ptr, ptr %33, align 8, !tbaa !20
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = icmp ne ptr %34, %35
  br i1 %36, label %37, label %38

37:                                               ; preds = %23
  br label %39

38:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 294, ptr noundef @__PRETTY_FUNCTION__.delwin) #5
  unreachable

39:                                               ; preds = %37
  %40 = load ptr, ptr @SP, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.SCREEN, ptr %40, i32 0, i32 45
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct._opaque_screen_t, ptr %42, i32 0, i32 8
  %44 = load ptr, ptr %43, align 8, !tbaa !19
  %45 = load i32, ptr %4, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds ptr, ptr %44, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct._win, ptr %48, i32 0, i32 24
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = icmp eq ptr %50, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %39
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %189

54:                                               ; preds = %39
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %4, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %4, align 4, !tbaa !9
  br label %15, !llvm.loop !22

58:                                               ; preds = %15
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._win, ptr %59, i32 0, i32 17
  %61 = load ptr, ptr %60, align 8, !tbaa !24
  %62 = icmp ne ptr %61, null
  br i1 %62, label %63, label %149

63:                                               ; preds = %58
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._win, ptr %64, i32 0, i32 16
  %66 = load ptr, ptr %65, align 8, !tbaa !25
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %149

68:                                               ; preds = %63
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._win, ptr %69, i32 0, i32 16
  %71 = load ptr, ptr %70, align 8, !tbaa !25
  %72 = getelementptr inbounds ptr, ptr %71, i64 0
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %149

75:                                               ; preds = %68
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %98, %75
  %77 = load i32, ptr %4, align 4, !tbaa !9
  %78 = load ptr, ptr @SP, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.SCREEN, ptr %78, i32 0, i32 45
  %80 = load ptr, ptr %79, align 8, !tbaa !11
  %81 = getelementptr inbounds %struct._opaque_screen_t, ptr %80, i32 0, i32 7
  %82 = load i32, ptr %81, align 8, !tbaa !17
  %83 = icmp slt i32 %77, %82
  br i1 %83, label %84, label %96

84:                                               ; preds = %76
  %85 = load ptr, ptr @SP, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.SCREEN, ptr %85, i32 0, i32 45
  %87 = load ptr, ptr %86, align 8, !tbaa !11
  %88 = getelementptr inbounds %struct._opaque_screen_t, ptr %87, i32 0, i32 8
  %89 = load ptr, ptr %88, align 8, !tbaa !19
  %90 = load i32, ptr %4, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds ptr, ptr %89, i64 %91
  %93 = load ptr, ptr %92, align 8, !tbaa !5
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = icmp ne ptr %93, %94
  br label %96

96:                                               ; preds = %84, %76
  %97 = phi i1 [ false, %76 ], [ %95, %84 ]
  br i1 %97, label %98, label %101

98:                                               ; preds = %96
  %99 = load i32, ptr %4, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %4, align 4, !tbaa !9
  br label %76, !llvm.loop !26

101:                                              ; preds = %96
  %102 = load i32, ptr %4, align 4, !tbaa !9
  %103 = load ptr, ptr @SP, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.SCREEN, ptr %103, i32 0, i32 45
  %105 = load ptr, ptr %104, align 8, !tbaa !11
  %106 = getelementptr inbounds %struct._opaque_screen_t, ptr %105, i32 0, i32 7
  %107 = load i32, ptr %106, align 8, !tbaa !17
  %108 = icmp slt i32 %102, %107
  br i1 %108, label %109, label %110

109:                                              ; preds = %101
  br label %111

110:                                              ; preds = %101
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.1, i32 noundef 304, ptr noundef @__PRETTY_FUNCTION__.delwin) #5
  unreachable

111:                                              ; preds = %109
  %112 = load i32, ptr %4, align 4, !tbaa !9
  %113 = load ptr, ptr @SP, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.SCREEN, ptr %113, i32 0, i32 45
  %115 = load ptr, ptr %114, align 8, !tbaa !11
  %116 = getelementptr inbounds %struct._opaque_screen_t, ptr %115, i32 0, i32 7
  %117 = load i32, ptr %116, align 8, !tbaa !17
  %118 = icmp eq i32 %112, %117
  br i1 %118, label %119, label %120

119:                                              ; preds = %111
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %189

120:                                              ; preds = %111
  %121 = load ptr, ptr @SP, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.SCREEN, ptr %121, i32 0, i32 45
  %123 = load ptr, ptr %122, align 8, !tbaa !11
  %124 = getelementptr inbounds %struct._opaque_screen_t, ptr %123, i32 0, i32 7
  %125 = load i32, ptr %124, align 8, !tbaa !17
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %124, align 8, !tbaa !17
  %127 = load ptr, ptr @SP, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.SCREEN, ptr %127, i32 0, i32 45
  %129 = load ptr, ptr %128, align 8, !tbaa !11
  %130 = getelementptr inbounds %struct._opaque_screen_t, ptr %129, i32 0, i32 8
  %131 = load ptr, ptr %130, align 8, !tbaa !19
  %132 = load ptr, ptr @SP, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.SCREEN, ptr %132, i32 0, i32 45
  %134 = load ptr, ptr %133, align 8, !tbaa !11
  %135 = getelementptr inbounds %struct._opaque_screen_t, ptr %134, i32 0, i32 7
  %136 = load i32, ptr %135, align 8, !tbaa !17
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds ptr, ptr %131, i64 %137
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %140 = load ptr, ptr @SP, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.SCREEN, ptr %140, i32 0, i32 45
  %142 = load ptr, ptr %141, align 8, !tbaa !11
  %143 = getelementptr inbounds %struct._opaque_screen_t, ptr %142, i32 0, i32 8
  %144 = load ptr, ptr %143, align 8, !tbaa !19
  %145 = load i32, ptr %4, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %144, i64 %146
  store ptr %139, ptr %147, align 8, !tbaa !5
  %148 = load ptr, ptr @SP, align 8, !tbaa !5
  call void @_resize_window_list(ptr noundef %148)
  br label %149

149:                                              ; preds = %120, %68, %63, %58
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct._win, ptr %150, i32 0, i32 6
  %152 = load i32, ptr %151, align 8, !tbaa !27
  %153 = and i32 %152, 33
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %169, label %155

155:                                              ; preds = %149
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct._win, ptr %156, i32 0, i32 16
  %158 = load ptr, ptr %157, align 8, !tbaa !25
  %159 = getelementptr inbounds ptr, ptr %158, i64 0
  %160 = load ptr, ptr %159, align 8, !tbaa !5
  %161 = icmp ne ptr %160, null
  br i1 %161, label %162, label %168

162:                                              ; preds = %155
  %163 = load ptr, ptr %3, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._win, ptr %163, i32 0, i32 16
  %165 = load ptr, ptr %164, align 8, !tbaa !25
  %166 = getelementptr inbounds ptr, ptr %165, i64 0
  %167 = load ptr, ptr %166, align 8, !tbaa !5
  call void @free(ptr noundef %167) #4
  br label %168

168:                                              ; preds = %162, %155
  br label %169

169:                                              ; preds = %168, %149
  %170 = load ptr, ptr %3, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct._win, ptr %170, i32 0, i32 17
  %172 = load ptr, ptr %171, align 8, !tbaa !24
  %173 = icmp ne ptr %172, null
  br i1 %173, label %174, label %178

174:                                              ; preds = %169
  %175 = load ptr, ptr %3, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._win, ptr %175, i32 0, i32 17
  %177 = load ptr, ptr %176, align 8, !tbaa !24
  call void @free(ptr noundef %177) #4
  br label %178

178:                                              ; preds = %174, %169
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._win, ptr %179, i32 0, i32 16
  %181 = load ptr, ptr %180, align 8, !tbaa !25
  %182 = icmp ne ptr %181, null
  br i1 %182, label %183, label %187

183:                                              ; preds = %178
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._win, ptr %184, i32 0, i32 16
  %186 = load ptr, ptr %185, align 8, !tbaa !25
  call void @free(ptr noundef %186) #4
  br label %187

187:                                              ; preds = %183, %178
  %188 = load ptr, ptr %3, align 8, !tbaa !5
  call void @free(ptr noundef %188) #4
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %189

189:                                              ; preds = %187, %119, %53, %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %190 = load i32, ptr %2, align 4
  ret i32 %190
}

; 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 hidden void @_resize_window_list(ptr noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { 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 }
attributes #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 208}
!12 = !{!"", !13, i64 0, !13, i64 1, !13, i64 2, !13, i64 3, !13, i64 4, !13, i64 5, !13, i64 6, !13, i64 7, !13, i64 8, !13, i64 9, !14, i64 10, !14, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !15, i64 40, !10, i64 48, !10, i64 52, !6, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !13, i64 76, !10, i64 80, !15, i64 88, !13, i64 96, !13, i64 97, !16, i64 100, !14, i64 132, !15, i64 136, !6, i64 144, !6, i64 152, !13, i64 160, !13, i64 161, !10, i64 164, !10, i64 168, !6, i64 176, !10, i64 184, !10, i64 188, !6, i64 192, !10, i64 200, !10, i64 204, !6, i64 208}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"", !10, i64 0, !10, i64 4, !7, i64 8, !10, i64 28}
!17 = !{!18, !10, i64 40}
!18 = !{!"_opaque_screen_t", !6, i64 0, !10, i64 8, !10, i64 12, !13, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !10, i64 40, !6, i64 48, !10, i64 56, !13, i64 60, !6, i64 64, !6, i64 72}
!19 = !{!18, !6, i64 48}
!20 = !{!21, !6, i64 104}
!21 = !{!"_win", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !15, i64 32, !15, i64 40, !13, i64 48, !13, i64 49, !13, i64 50, !13, i64 51, !13, i64 52, !13, i64 53, !13, i64 54, !6, i64 56, !6, i64 64, !6, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!21, !6, i64 64}
!25 = !{!21, !6, i64 56}
!26 = distinct !{!26, !23}
!27 = !{!21, !10, i64 24}


; 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.1 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@SP = external local_unnamed_addr global ptr, align 8
@__PRETTY_FUNCTION__.delwin = external hidden unnamed_addr constant [21 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @delwin(ptr noundef %0) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %10, label %.preheader42

.preheader42:                                     ; preds = %1
  %2 = load ptr, ptr @SP, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %2, i64 208
  %4 = load ptr, ptr %3, align 8, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %4, i64 40
  %6 = load i32, ptr %5, align 8, !tbaa !16
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader42
  %8 = getelementptr inbounds i8, ptr %4, i64 48
  %9 = load ptr, ptr %8, align 8, !tbaa !18
  %wide.trip.count = zext nneg i32 %6 to i64
  br label %12

10:                                               ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 287, ptr noundef nonnull @__PRETTY_FUNCTION__.delwin) #3
  unreachable

11:                                               ; preds = %12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %12, !llvm.loop !19

12:                                               ; preds = %.lr.ph, %11
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %11 ]
  %13 = getelementptr inbounds ptr, ptr %9, i64 %indvars.iv
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 104
  %16 = load ptr, ptr %15, align 8, !tbaa !21
  %.not41 = icmp eq ptr %16, %0
  br i1 %.not41, label %17, label %11

17:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 294, ptr noundef nonnull @__PRETTY_FUNCTION__.delwin) #3
  unreachable

._crit_edge:                                      ; preds = %11, %.preheader42
  %18 = getelementptr inbounds i8, ptr %0, i64 64
  %19 = load ptr, ptr %18, align 8, !tbaa !23
  %.not33 = icmp eq ptr %19, null
  br i1 %.not33, label %39, label %20

20:                                               ; preds = %._crit_edge
  %21 = getelementptr inbounds i8, ptr %0, i64 56
  %22 = load ptr, ptr %21, align 8, !tbaa !24
  %.not34 = icmp eq ptr %22, null
  br i1 %.not34, label %39, label %23

23:                                               ; preds = %20
  %24 = load ptr, ptr %22, align 8, !tbaa !5
  %.not35 = icmp eq ptr %24, null
  br i1 %.not35, label %39, label %.preheader

.preheader:                                       ; preds = %23
  br i1 %7, label %.lr.ph54, label %.critedge

.lr.ph54:                                         ; preds = %.preheader
  %25 = getelementptr inbounds i8, ptr %4, i64 48
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %wide.trip.count60 = zext nneg i32 %6 to i64
  br label %27

27:                                               ; preds = %.lr.ph54, %30
  %indvars.iv57 = phi i64 [ 0, %.lr.ph54 ], [ %indvars.iv.next58, %30 ]
  %28 = getelementptr inbounds ptr, ptr %26, i64 %indvars.iv57
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %.not36 = icmp eq ptr %29, %0
  br i1 %.not36, label %31, label %30

30:                                               ; preds = %27
  %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
  %exitcond61.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count60
  br i1 %exitcond61.not, label %.critedge, label %27, !llvm.loop !25

.critedge:                                        ; preds = %30, %.preheader
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.1, i32 noundef 304, ptr noundef nonnull @__PRETTY_FUNCTION__.delwin) #3
  unreachable

31:                                               ; preds = %27
  %32 = add nsw i32 %6, -1
  store i32 %32, ptr %5, align 8, !tbaa !16
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds ptr, ptr %26, i64 %33
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = and i64 %indvars.iv57, 4294967295
  %37 = getelementptr inbounds ptr, ptr %26, i64 %36
  store ptr %35, ptr %37, align 8, !tbaa !5
  %38 = load ptr, ptr @SP, align 8, !tbaa !5
  tail call void @_resize_window_list(ptr noundef %38)
  br label %39

39:                                               ; preds = %31, %23, %20, %._crit_edge
  %40 = getelementptr inbounds i8, ptr %0, i64 24
  %41 = load i32, ptr %40, align 8, !tbaa !26
  %42 = and i32 %41, 33
  %.not37 = icmp eq i32 %42, 0
  br i1 %.not37, label %43, label %48

43:                                               ; preds = %39
  %44 = getelementptr inbounds i8, ptr %0, i64 56
  %45 = load ptr, ptr %44, align 8, !tbaa !24
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %.not38 = icmp eq ptr %46, null
  br i1 %.not38, label %48, label %47

47:                                               ; preds = %43
  tail call void @free(ptr noundef nonnull %46) #4
  br label %48

48:                                               ; preds = %43, %47, %39
  %49 = load ptr, ptr %18, align 8, !tbaa !23
  %.not39 = icmp eq ptr %49, null
  br i1 %.not39, label %51, label %50

50:                                               ; preds = %48
  tail call void @free(ptr noundef nonnull %49) #4
  br label %51

51:                                               ; preds = %50, %48
  %52 = getelementptr inbounds i8, ptr %0, i64 56
  %53 = load ptr, ptr %52, align 8, !tbaa !24
  %.not40 = icmp eq ptr %53, null
  br i1 %.not40, label %55, label %54

54:                                               ; preds = %51
  tail call void @free(ptr noundef nonnull %53) #4
  br label %55

55:                                               ; preds = %54, %51
  tail call void @free(ptr noundef nonnull %0) #4
  ret i32 0
}

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, 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 #3 = { noreturn nounwind }
attributes #4 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 208}
!10 = !{!"", !11, i64 0, !11, i64 1, !11, i64 2, !11, i64 3, !11, i64 4, !11, i64 5, !11, i64 6, !11, i64 7, !11, i64 8, !11, i64 9, !12, i64 10, !12, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !14, i64 40, !13, i64 48, !13, i64 52, !6, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !11, i64 76, !13, i64 80, !14, i64 88, !11, i64 96, !11, i64 97, !15, i64 100, !12, i64 132, !14, i64 136, !6, i64 144, !6, i64 152, !11, i64 160, !11, i64 161, !13, i64 164, !13, i64 168, !6, i64 176, !13, i64 184, !13, i64 188, !6, i64 192, !13, i64 200, !13, i64 204, !6, i64 208}
!11 = !{!"_Bool", !7, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!"", !13, i64 0, !13, i64 4, !7, i64 8, !13, i64 28}
!16 = !{!17, !13, i64 40}
!17 = !{!"_opaque_screen_t", !6, i64 0, !13, i64 8, !13, i64 12, !11, i64 16, !6, i64 24, !13, i64 32, !13, i64 36, !13, i64 40, !6, i64 48, !13, i64 56, !11, i64 60, !6, i64 64, !6, i64 72}
!18 = !{!17, !6, i64 48}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!22, !6, i64 104}
!22 = !{!"_win", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !14, i64 32, !14, i64 40, !11, i64 48, !11, i64 49, !11, i64 50, !11, i64 51, !11, i64 52, !11, i64 53, !11, i64 54, !6, i64 56, !6, i64 64, !6, i64 72, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !13, i64 96, !6, i64 104, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124, !13, i64 128, !13, i64 132}
!23 = !{!22, !6, i64 64}
!24 = !{!22, !6, i64 56}
!25 = distinct !{!25, !20}
!26 = !{!22, !13, i64 24}


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