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

; 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._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 }

@SP = external dso_local global ptr, align 8
@curscr = external dso_local global ptr, align 8
@stdscr = external dso_local global ptr, align 8
@LINES = external dso_local global i32, align 4
@COLS = external dso_local global i32, align 4

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

declare i32 @PDC_get_rows() #1

declare i32 @PDC_get_columns() #1

declare i32 @werase(ptr noundef) #1

declare void @PDC_slk_initialize() #1

declare i32 @wclrtobot(ptr noundef) #1

; 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
define dso_local i32 @resize_term(i32 noundef %0, i32 noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  store ptr null, ptr %6, align 8, !tbaa !9
  %8 = load i32, ptr %4, align 4, !tbaa !5
  %9 = load i32, ptr %5, align 4, !tbaa !5
  %10 = call i32 @PDC_resize_screen(i32 noundef %8, i32 noundef %9)
  %11 = icmp eq i32 %10, -1
  br i1 %11, label %12, label %13

12:                                               ; preds = %2
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %144

13:                                               ; preds = %2
  %14 = load ptr, ptr @stdscr, align 8, !tbaa !9
  %15 = icmp ne ptr %14, null
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %144

17:                                               ; preds = %13
  %18 = load ptr, ptr @SP, align 8, !tbaa !9
  %19 = getelementptr inbounds %struct.SCREEN, ptr %18, i32 0, i32 8
  store i8 0, ptr %19, align 8, !tbaa !11
  %20 = call i32 @PDC_get_rows()
  %21 = load ptr, ptr @SP, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct.SCREEN, ptr %21, i32 0, i32 16
  store i32 %20, ptr %22, align 8, !tbaa !17
  %23 = load ptr, ptr @SP, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.SCREEN, ptr %23, i32 0, i32 16
  %25 = load i32, ptr %24, align 8, !tbaa !17
  %26 = load ptr, ptr @SP, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.SCREEN, ptr %26, i32 0, i32 22
  %28 = load i32, ptr %27, align 8, !tbaa !18
  %29 = sub nsw i32 %25, %28
  %30 = load ptr, ptr @SP, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.SCREEN, ptr %30, i32 0, i32 20
  %32 = load i32, ptr %31, align 4, !tbaa !19
  %33 = sub nsw i32 %29, %32
  store i32 %33, ptr @LINES, align 4, !tbaa !5
  %34 = call i32 @PDC_get_columns()
  store i32 %34, ptr @COLS, align 4, !tbaa !5
  %35 = load ptr, ptr @SP, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.SCREEN, ptr %35, i32 0, i32 17
  store i32 %34, ptr %36, align 4, !tbaa !20
  %37 = load ptr, ptr @SP, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.SCREEN, ptr %37, i32 0, i32 12
  %39 = load i32, ptr %38, align 8, !tbaa !21
  %40 = load ptr, ptr @SP, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.SCREEN, ptr %40, i32 0, i32 16
  %42 = load i32, ptr %41, align 8, !tbaa !17
  %43 = icmp sge i32 %39, %42
  br i1 %43, label %44, label %51

44:                                               ; preds = %17
  %45 = load ptr, ptr @SP, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.SCREEN, ptr %45, i32 0, i32 16
  %47 = load i32, ptr %46, align 8, !tbaa !17
  %48 = sub nsw i32 %47, 1
  %49 = load ptr, ptr @SP, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.SCREEN, ptr %49, i32 0, i32 12
  store i32 %48, ptr %50, align 8, !tbaa !21
  br label %51

51:                                               ; preds = %44, %17
  %52 = load ptr, ptr @SP, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.SCREEN, ptr %52, i32 0, i32 13
  %54 = load i32, ptr %53, align 4, !tbaa !22
  %55 = load ptr, ptr @SP, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.SCREEN, ptr %55, i32 0, i32 17
  %57 = load i32, ptr %56, align 4, !tbaa !20
  %58 = icmp sge i32 %54, %57
  br i1 %58, label %59, label %66

59:                                               ; preds = %51
  %60 = load ptr, ptr @SP, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.SCREEN, ptr %60, i32 0, i32 17
  %62 = load i32, ptr %61, align 4, !tbaa !20
  %63 = sub nsw i32 %62, 1
  %64 = load ptr, ptr @SP, align 8, !tbaa !9
  %65 = getelementptr inbounds %struct.SCREEN, ptr %64, i32 0, i32 13
  store i32 %63, ptr %65, align 4, !tbaa !22
  br label %66

66:                                               ; preds = %59, %51
  %67 = load ptr, ptr @curscr, align 8, !tbaa !9
  %68 = load ptr, ptr @SP, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.SCREEN, ptr %68, i32 0, i32 16
  %70 = load i32, ptr %69, align 8, !tbaa !17
  %71 = load ptr, ptr @SP, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.SCREEN, ptr %71, i32 0, i32 17
  %73 = load i32, ptr %72, align 4, !tbaa !20
  %74 = call i32 @wresize(ptr noundef %67, i32 noundef %70, i32 noundef %73)
  %75 = icmp eq i32 %74, -1
  br i1 %75, label %94, label %76

76:                                               ; preds = %66
  %77 = load ptr, ptr @stdscr, align 8, !tbaa !9
  %78 = load i32, ptr @LINES, align 4, !tbaa !5
  %79 = load i32, ptr @COLS, align 4, !tbaa !5
  %80 = call i32 @wresize(ptr noundef %77, i32 noundef %78, i32 noundef %79)
  %81 = icmp eq i32 %80, -1
  br i1 %81, label %94, label %82

82:                                               ; preds = %76
  %83 = load ptr, ptr @SP, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.SCREEN, ptr %83, i32 0, i32 33
  %85 = load ptr, ptr %84, align 8, !tbaa !23
  %86 = load ptr, ptr @SP, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.SCREEN, ptr %86, i32 0, i32 16
  %88 = load i32, ptr %87, align 8, !tbaa !17
  %89 = load ptr, ptr @SP, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.SCREEN, ptr %89, i32 0, i32 17
  %91 = load i32, ptr %90, align 4, !tbaa !20
  %92 = call i32 @wresize(ptr noundef %85, i32 noundef %88, i32 noundef %91)
  %93 = icmp eq i32 %92, -1
  br i1 %93, label %94, label %95

94:                                               ; preds = %82, %76, %66
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %144

95:                                               ; preds = %82
  %96 = load ptr, ptr @SP, align 8, !tbaa !9
  %97 = getelementptr inbounds %struct.SCREEN, ptr %96, i32 0, i32 33
  %98 = load ptr, ptr %97, align 8, !tbaa !23
  %99 = call i32 @werase(ptr noundef %98)
  %100 = load ptr, ptr @curscr, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct._win, ptr %100, i32 0, i32 9
  store i8 1, ptr %101, align 8, !tbaa !24
  %102 = load ptr, ptr @SP, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.SCREEN, ptr %102, i32 0, i32 21
  %104 = load ptr, ptr %103, align 8, !tbaa !26
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %127

106:                                              ; preds = %95
  %107 = load ptr, ptr @SP, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.SCREEN, ptr %107, i32 0, i32 21
  %109 = load ptr, ptr %108, align 8, !tbaa !26
  %110 = load ptr, ptr @SP, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.SCREEN, ptr %110, i32 0, i32 20
  %112 = load i32, ptr %111, align 4, !tbaa !19
  %113 = load i32, ptr @COLS, align 4, !tbaa !5
  %114 = call i32 @wresize(ptr noundef %109, i32 noundef %112, i32 noundef %113)
  %115 = icmp eq i32 %114, -1
  br i1 %115, label %116, label %117

116:                                              ; preds = %106
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %144

117:                                              ; preds = %106
  %118 = load ptr, ptr @SP, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.SCREEN, ptr %118, i32 0, i32 21
  %120 = load ptr, ptr %119, align 8, !tbaa !26
  %121 = call i32 @wmove(ptr noundef %120, i32 noundef 0, i32 noundef 0)
  %122 = load ptr, ptr @SP, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.SCREEN, ptr %122, i32 0, i32 21
  %124 = load ptr, ptr %123, align 8, !tbaa !26
  %125 = call i32 @wclrtobot(ptr noundef %124)
  call void @PDC_slk_initialize()
  %126 = call i32 @slk_noutrefresh()
  br label %127

127:                                              ; preds = %117, %95
  %128 = load ptr, ptr @stdscr, align 8, !tbaa !9
  %129 = call i32 @touchwin(ptr noundef %128)
  %130 = load ptr, ptr @stdscr, align 8, !tbaa !9
  %131 = call i32 @wnoutrefresh(ptr noundef %130)
  br label %132

132:                                              ; preds = %136, %127
  %133 = load ptr, ptr %6, align 8, !tbaa !9
  %134 = call ptr @panel_above(ptr noundef %133)
  store ptr %134, ptr %6, align 8, !tbaa !9
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %143

136:                                              ; preds = %132
  %137 = load ptr, ptr %6, align 8, !tbaa !9
  %138 = call ptr @panel_window(ptr noundef %137)
  %139 = call i32 @touchwin(ptr noundef %138)
  %140 = load ptr, ptr %6, align 8, !tbaa !9
  %141 = call ptr @panel_window(ptr noundef %140)
  %142 = call i32 @wnoutrefresh(ptr noundef %141)
  br label %132, !llvm.loop !27

143:                                              ; preds = %132
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %144

144:                                              ; preds = %143, %116, %94, %16, %12
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  %145 = load i32, ptr %3, align 4
  ret i32 %145
}

declare i32 @PDC_resize_screen(i32 noundef, i32 noundef) #1

declare i32 @wresize(ptr noundef, i32 noundef, i32 noundef) #1

declare i32 @wmove(ptr noundef, i32 noundef, i32 noundef) #1

declare i32 @slk_noutrefresh() #1

declare i32 @touchwin(ptr noundef) #1

declare i32 @wnoutrefresh(ptr noundef) #1

declare ptr @panel_above(ptr noundef) #1

declare ptr @panel_window(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #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 #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 }

!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, !13, i64 8}
!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, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !15, i64 40, !6, i64 48, !6, i64 52, !10, i64 56, !6, i64 64, !6, i64 68, !6, i64 72, !13, i64 76, !6, i64 80, !15, i64 88, !13, i64 96, !13, i64 97, !16, i64 100, !14, i64 132, !15, i64 136, !10, i64 144, !10, i64 152, !13, i64 160, !13, i64 161, !6, i64 164, !6, i64 168, !10, i64 176, !6, i64 184, !6, i64 188, !10, i64 192, !6, i64 200, !6, i64 204, !10, i64 208}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"long", !7, i64 0}
!16 = !{!"", !6, i64 0, !6, i64 4, !7, i64 8, !6, i64 28}
!17 = !{!12, !6, i64 32}
!18 = !{!12, !6, i64 64}
!19 = !{!12, !6, i64 52}
!20 = !{!12, !6, i64 36}
!21 = !{!12, !6, i64 16}
!22 = !{!12, !6, i64 20}
!23 = !{!12, !10, i64 144}
!24 = !{!25, !13, i64 48}
!25 = !{!"_win", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, 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, !10, i64 56, !10, i64 64, !10, i64 72, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !10, i64 104, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132}
!26 = !{!12, !10, i64 56}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


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

@SP = external dso_local local_unnamed_addr global ptr, align 8
@curscr = external dso_local local_unnamed_addr global ptr, align 8
@stdscr = external dso_local local_unnamed_addr global ptr, align 8
@LINES = external dso_local local_unnamed_addr global i32, align 4
@COLS = external dso_local local_unnamed_addr global i32, align 4

declare i32 @PDC_get_rows() local_unnamed_addr #0

declare i32 @PDC_get_columns() local_unnamed_addr #0

declare i32 @werase(ptr noundef) local_unnamed_addr #0

declare void @PDC_slk_initialize() local_unnamed_addr #0

declare i32 @wclrtobot(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @resize_term(i32 noundef %0, i32 noundef %1) local_unnamed_addr #1 {
  %3 = tail call i32 @PDC_resize_screen(i32 noundef %0, i32 noundef %1) #2
  %4 = icmp eq i32 %3, -1
  br i1 %4, label %.loopexit, label %5

5:                                                ; preds = %2
  %6 = load ptr, ptr @stdscr, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %.loopexit, label %7

7:                                                ; preds = %5
  %8 = load ptr, ptr @SP, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 8
  store i8 0, ptr %9, align 8, !tbaa !9
  %10 = tail call i32 @PDC_get_rows() #2
  %11 = load ptr, ptr @SP, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 32
  store i32 %10, ptr %12, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %11, i64 64
  %14 = load i32, ptr %13, align 8, !tbaa !17
  %15 = getelementptr inbounds i8, ptr %11, i64 52
  %16 = load i32, ptr %15, align 4, !tbaa !18
  %17 = add i32 %14, %16
  %18 = sub i32 %10, %17
  store i32 %18, ptr @LINES, align 4, !tbaa !19
  %19 = tail call i32 @PDC_get_columns() #2
  store i32 %19, ptr @COLS, align 4, !tbaa !19
  %20 = load ptr, ptr @SP, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 36
  store i32 %19, ptr %21, align 4, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %20, i64 16
  %23 = load i32, ptr %22, align 8, !tbaa !21
  %24 = getelementptr inbounds i8, ptr %20, i64 32
  %25 = load i32, ptr %24, align 8, !tbaa !16
  %.not10 = icmp slt i32 %23, %25
  br i1 %.not10, label %28, label %26

26:                                               ; preds = %7
  %27 = add nsw i32 %25, -1
  store i32 %27, ptr %22, align 8, !tbaa !21
  br label %28

28:                                               ; preds = %26, %7
  %29 = getelementptr inbounds i8, ptr %20, i64 20
  %30 = load i32, ptr %29, align 4, !tbaa !22
  %.not11 = icmp slt i32 %30, %19
  br i1 %.not11, label %33, label %31

31:                                               ; preds = %28
  %32 = add nsw i32 %19, -1
  store i32 %32, ptr %29, align 4, !tbaa !22
  br label %33

33:                                               ; preds = %31, %28
  %34 = load ptr, ptr @curscr, align 8, !tbaa !5
  %35 = tail call i32 @wresize(ptr noundef %34, i32 noundef %25, i32 noundef %19) #2
  %36 = icmp eq i32 %35, -1
  br i1 %36, label %.loopexit, label %37

37:                                               ; preds = %33
  %38 = load ptr, ptr @stdscr, align 8, !tbaa !5
  %39 = load i32, ptr @LINES, align 4, !tbaa !19
  %40 = load i32, ptr @COLS, align 4, !tbaa !19
  %41 = tail call i32 @wresize(ptr noundef %38, i32 noundef %39, i32 noundef %40) #2
  %42 = icmp eq i32 %41, -1
  br i1 %42, label %.loopexit, label %43

43:                                               ; preds = %37
  %44 = load ptr, ptr @SP, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 144
  %46 = load ptr, ptr %45, align 8, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %44, i64 32
  %48 = load i32, ptr %47, align 8, !tbaa !16
  %49 = getelementptr inbounds i8, ptr %44, i64 36
  %50 = load i32, ptr %49, align 4, !tbaa !20
  %51 = tail call i32 @wresize(ptr noundef %46, i32 noundef %48, i32 noundef %50) #2
  %52 = icmp eq i32 %51, -1
  br i1 %52, label %.loopexit, label %53

53:                                               ; preds = %43
  %54 = load ptr, ptr @SP, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 144
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  %57 = tail call i32 @werase(ptr noundef %56) #2
  %58 = load ptr, ptr @curscr, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 48
  store i8 1, ptr %59, align 8, !tbaa !24
  %60 = load ptr, ptr @SP, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 56
  %62 = load ptr, ptr %61, align 8, !tbaa !26
  %.not12 = icmp eq ptr %62, null
  br i1 %.not12, label %79, label %63

63:                                               ; preds = %53
  %64 = getelementptr inbounds i8, ptr %60, i64 52
  %65 = load i32, ptr %64, align 4, !tbaa !18
  %66 = load i32, ptr @COLS, align 4, !tbaa !19
  %67 = tail call i32 @wresize(ptr noundef nonnull %62, i32 noundef %65, i32 noundef %66) #2
  %68 = icmp eq i32 %67, -1
  br i1 %68, label %.loopexit, label %69

69:                                               ; preds = %63
  %70 = load ptr, ptr @SP, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %70, i64 56
  %72 = load ptr, ptr %71, align 8, !tbaa !26
  %73 = tail call i32 @wmove(ptr noundef %72, i32 noundef 0, i32 noundef 0) #2
  %74 = load ptr, ptr @SP, align 8, !tbaa !5
  %75 = getelementptr inbounds i8, ptr %74, i64 56
  %76 = load ptr, ptr %75, align 8, !tbaa !26
  %77 = tail call i32 @wclrtobot(ptr noundef %76) #2
  tail call void @PDC_slk_initialize() #2
  %78 = tail call i32 @slk_noutrefresh() #2
  br label %79

79:                                               ; preds = %69, %53
  %80 = load ptr, ptr @stdscr, align 8, !tbaa !5
  %81 = tail call i32 @touchwin(ptr noundef %80) #2
  %82 = load ptr, ptr @stdscr, align 8, !tbaa !5
  %83 = tail call i32 @wnoutrefresh(ptr noundef %82) #2
  %84 = tail call ptr @panel_above(ptr noundef null) #2
  %.not1316 = icmp eq ptr %84, null
  br i1 %.not1316, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %79, %.lr.ph
  %85 = phi ptr [ %90, %.lr.ph ], [ %84, %79 ]
  %86 = tail call ptr @panel_window(ptr noundef nonnull %85) #2
  %87 = tail call i32 @touchwin(ptr noundef %86) #2
  %88 = tail call ptr @panel_window(ptr noundef nonnull %85) #2
  %89 = tail call i32 @wnoutrefresh(ptr noundef %88) #2
  %90 = tail call ptr @panel_above(ptr noundef nonnull %85) #2
  %.not13 = icmp eq ptr %90, null
  br i1 %.not13, label %.loopexit, label %.lr.ph, !llvm.loop !27

.loopexit:                                        ; preds = %.lr.ph, %79, %63, %33, %37, %43, %5, %2
  %.05 = phi i32 [ -1, %2 ], [ 0, %5 ], [ -1, %43 ], [ -1, %37 ], [ -1, %33 ], [ -1, %63 ], [ 0, %79 ], [ 0, %.lr.ph ]
  ret i32 %.05
}

declare i32 @PDC_resize_screen(i32 noundef, i32 noundef) local_unnamed_addr #0

declare i32 @wresize(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare i32 @wmove(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare i32 @slk_noutrefresh() local_unnamed_addr #0

declare i32 @touchwin(ptr noundef) local_unnamed_addr #0

declare i32 @wnoutrefresh(ptr noundef) local_unnamed_addr #0

declare ptr @panel_above(ptr noundef) local_unnamed_addr #0

declare ptr @panel_window(ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 = { 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, !11, i64 8}
!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 = !{!10, !13, i64 32}
!17 = !{!10, !13, i64 64}
!18 = !{!10, !13, i64 52}
!19 = !{!13, !13, i64 0}
!20 = !{!10, !13, i64 36}
!21 = !{!10, !13, i64 16}
!22 = !{!10, !13, i64 20}
!23 = !{!10, !6, i64 144}
!24 = !{!25, !11, i64 48}
!25 = !{!"_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}
!26 = !{!10, !6, i64 56}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass