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

; 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._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 [89 x i8], align 1
@LINES = external global i32, align 4
@COLS = external global i32, align 4
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__.pnoutrefresh = external hidden unnamed_addr constant [57 x i8], align 1
@curscr = external global ptr, 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, 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 @pnoutrefresh(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) #2 {
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  store i32 %6, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %20 = load ptr, ptr %9, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %7
  br label %24

23:                                               ; preds = %7
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 192, ptr noundef @__PRETTY_FUNCTION__.pnoutrefresh) #6
  unreachable

24:                                               ; preds = %22
  %25 = load i32, ptr %10, align 4, !tbaa !9
  %26 = icmp slt i32 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %24
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %27, %24
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = icmp slt i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %31, %28
  %33 = load i32, ptr %12, align 4, !tbaa !9
  %34 = icmp slt i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %32
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %35, %32
  %37 = load i32, ptr %13, align 4, !tbaa !9
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %39, %36
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  br i1 %42, label %43, label %65

43:                                               ; preds = %40
  %44 = load ptr, ptr %9, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._win, ptr %44, i32 0, i32 6
  %46 = load i32, ptr %45, align 8, !tbaa !11
  %47 = and i32 %46, 48
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %65

49:                                               ; preds = %43
  %50 = load i32, ptr %14, align 4, !tbaa !9
  %51 = load i32, ptr @LINES, align 4, !tbaa !9
  %52 = icmp sge i32 %50, %51
  br i1 %52, label %65, label %53

53:                                               ; preds = %49
  %54 = load i32, ptr %15, align 4, !tbaa !9
  %55 = load i32, ptr @COLS, align 4, !tbaa !9
  %56 = icmp sge i32 %54, %55
  br i1 %56, label %65, label %57

57:                                               ; preds = %53
  %58 = load i32, ptr %14, align 4, !tbaa !9
  %59 = load i32, ptr %12, align 4, !tbaa !9
  %60 = icmp slt i32 %58, %59
  br i1 %60, label %65, label %61

61:                                               ; preds = %57
  %62 = load i32, ptr %15, align 4, !tbaa !9
  %63 = load i32, ptr %13, align 4, !tbaa !9
  %64 = icmp slt i32 %62, %63
  br i1 %64, label %65, label %66

65:                                               ; preds = %61, %57, %53, %49, %43, %40
  store i32 -1, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %222

66:                                               ; preds = %61
  %67 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %67, ptr %17, align 4, !tbaa !9
  %68 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %68, ptr %18, align 4, !tbaa !9
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = sub nsw i32 %69, %70
  %72 = add nsw i32 %71, 1
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct._win, ptr %73, i32 0, i32 3
  %75 = load i32, ptr %74, align 4, !tbaa !15
  %76 = load i32, ptr %11, align 4, !tbaa !9
  %77 = sub nsw i32 %75, %76
  %78 = icmp slt i32 %72, %77
  br i1 %78, label %79, label %84

79:                                               ; preds = %66
  %80 = load i32, ptr %15, align 4, !tbaa !9
  %81 = load i32, ptr %13, align 4, !tbaa !9
  %82 = sub nsw i32 %80, %81
  %83 = add nsw i32 %82, 1
  br label %90

84:                                               ; preds = %66
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct._win, ptr %85, i32 0, i32 3
  %87 = load i32, ptr %86, align 4, !tbaa !15
  %88 = load i32, ptr %11, align 4, !tbaa !9
  %89 = sub nsw i32 %87, %88
  br label %90

90:                                               ; preds = %84, %79
  %91 = phi i32 [ %83, %79 ], [ %89, %84 ]
  store i32 %91, ptr %16, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %132, %90
  %93 = load i32, ptr %17, align 4, !tbaa !9
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = icmp sle i32 %93, %94
  br i1 %95, label %96, label %137

96:                                               ; preds = %92
  %97 = load i32, ptr %18, align 4, !tbaa !9
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._win, ptr %98, i32 0, i32 2
  %100 = load i32, ptr %99, align 8, !tbaa !16
  %101 = icmp slt i32 %97, %100
  br i1 %101, label %102, label %132

102:                                              ; preds = %96
  %103 = load ptr, ptr @curscr, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct._win, ptr %103, i32 0, i32 16
  %105 = load ptr, ptr %104, align 8, !tbaa !17
  %106 = load i32, ptr %17, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds ptr, ptr %105, i64 %107
  %109 = load ptr, ptr %108, align 8, !tbaa !5
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i64, ptr %109, i64 %111
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct._win, ptr %113, i32 0, i32 16
  %115 = load ptr, ptr %114, align 8, !tbaa !17
  %116 = load i32, ptr %18, align 4, !tbaa !9
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %115, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = load i32, ptr %11, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds i64, ptr %119, i64 %121
  %123 = load i32, ptr %16, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = mul i64 %124, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %112, ptr align 8 %122, i64 %125, i1 false)
  %126 = load ptr, ptr @curscr, align 8, !tbaa !5
  %127 = load i32, ptr %17, align 4, !tbaa !9
  %128 = load i32, ptr %13, align 4, !tbaa !9
  %129 = load i32, ptr %15, align 4, !tbaa !9
  call void @PDC_mark_cells_as_changed(ptr noundef %126, i32 noundef %127, i32 noundef %128, i32 noundef %129)
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = load i32, ptr %18, align 4, !tbaa !9
  call void @PDC_set_changed_cells_range(ptr noundef %130, i32 noundef %131, i32 noundef -1, i32 noundef -1)
  br label %132

132:                                              ; preds = %102, %96
  %133 = load i32, ptr %17, align 4, !tbaa !9
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %17, align 4, !tbaa !9
  %135 = load i32, ptr %18, align 4, !tbaa !9
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %18, align 4, !tbaa !9
  br label %92, !llvm.loop !18

137:                                              ; preds = %92
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct._win, ptr %138, i32 0, i32 9
  %140 = load i8, ptr %139, align 8, !tbaa !20, !range !21, !noundef !22
  %141 = trunc i8 %140 to i1
  br i1 %141, label %142, label %147

142:                                              ; preds = %137
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct._win, ptr %143, i32 0, i32 9
  store i8 0, ptr %144, align 8, !tbaa !20
  %145 = load ptr, ptr @curscr, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._win, ptr %145, i32 0, i32 9
  store i8 1, ptr %146, align 8, !tbaa !20
  br label %147

147:                                              ; preds = %142, %137
  %148 = load ptr, ptr %9, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct._win, ptr %148, i32 0, i32 10
  %150 = load i8, ptr %149, align 1, !tbaa !23, !range !21, !noundef !22
  %151 = trunc i8 %150 to i1
  br i1 %151, label %203, label %152

152:                                              ; preds = %147
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._win, ptr %153, i32 0, i32 0
  %155 = load i32, ptr %154, align 8, !tbaa !24
  %156 = load i32, ptr %10, align 4, !tbaa !9
  %157 = icmp sge i32 %155, %156
  br i1 %157, label %158, label %203

158:                                              ; preds = %152
  %159 = load ptr, ptr %9, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct._win, ptr %159, i32 0, i32 1
  %161 = load i32, ptr %160, align 4, !tbaa !25
  %162 = load i32, ptr %11, align 4, !tbaa !9
  %163 = icmp sge i32 %161, %162
  br i1 %163, label %164, label %203

164:                                              ; preds = %158
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct._win, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 8, !tbaa !24
  %168 = load i32, ptr %10, align 4, !tbaa !9
  %169 = load i32, ptr %14, align 4, !tbaa !9
  %170 = load i32, ptr %12, align 4, !tbaa !9
  %171 = sub nsw i32 %169, %170
  %172 = add nsw i32 %168, %171
  %173 = icmp sle i32 %167, %172
  br i1 %173, label %174, label %203

174:                                              ; preds = %164
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct._win, ptr %175, i32 0, i32 1
  %177 = load i32, ptr %176, align 4, !tbaa !25
  %178 = load i32, ptr %11, align 4, !tbaa !9
  %179 = load i32, ptr %15, align 4, !tbaa !9
  %180 = load i32, ptr %13, align 4, !tbaa !9
  %181 = sub nsw i32 %179, %180
  %182 = add nsw i32 %178, %181
  %183 = icmp sle i32 %177, %182
  br i1 %183, label %184, label %203

184:                                              ; preds = %174
  %185 = load ptr, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct._win, ptr %185, i32 0, i32 0
  %187 = load i32, ptr %186, align 8, !tbaa !24
  %188 = load i32, ptr %10, align 4, !tbaa !9
  %189 = sub nsw i32 %187, %188
  %190 = load i32, ptr %12, align 4, !tbaa !9
  %191 = add nsw i32 %189, %190
  %192 = load ptr, ptr @curscr, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._win, ptr %192, i32 0, i32 0
  store i32 %191, ptr %193, align 8, !tbaa !24
  %194 = load ptr, ptr %9, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._win, ptr %194, i32 0, i32 1
  %196 = load i32, ptr %195, align 4, !tbaa !25
  %197 = load i32, ptr %11, align 4, !tbaa !9
  %198 = sub nsw i32 %196, %197
  %199 = load i32, ptr %13, align 4, !tbaa !9
  %200 = add nsw i32 %198, %199
  %201 = load ptr, ptr @curscr, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._win, ptr %201, i32 0, i32 1
  store i32 %200, ptr %202, align 4, !tbaa !25
  br label %203

203:                                              ; preds = %184, %174, %164, %158, %152, %147
  %204 = load i32, ptr %10, align 4, !tbaa !9
  %205 = load ptr, ptr %9, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct._win, ptr %205, i32 0, i32 25
  store i32 %204, ptr %206, align 8, !tbaa !26
  %207 = load i32, ptr %11, align 4, !tbaa !9
  %208 = load ptr, ptr %9, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct._win, ptr %208, i32 0, i32 26
  store i32 %207, ptr %209, align 4, !tbaa !27
  %210 = load i32, ptr %12, align 4, !tbaa !9
  %211 = load ptr, ptr %9, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct._win, ptr %211, i32 0, i32 27
  store i32 %210, ptr %212, align 8, !tbaa !28
  %213 = load i32, ptr %13, align 4, !tbaa !9
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct._win, ptr %214, i32 0, i32 29
  store i32 %213, ptr %215, align 8, !tbaa !29
  %216 = load i32, ptr %14, align 4, !tbaa !9
  %217 = load ptr, ptr %9, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct._win, ptr %217, i32 0, i32 28
  store i32 %216, ptr %218, align 4, !tbaa !30
  %219 = load i32, ptr %15, align 4, !tbaa !9
  %220 = load ptr, ptr %9, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct._win, ptr %220, i32 0, i32 30
  store i32 %219, ptr %221, align 4, !tbaa !31
  store i32 0, ptr %8, align 4
  store i32 1, ptr %19, align 4
  br label %222

222:                                              ; preds = %203, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  %223 = load i32, ptr %8, align 4
  ret i32 %223
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare void @PDC_mark_cells_as_changed(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #4

declare void @PDC_set_changed_cells_range(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #4

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = !{!"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, !10, i64 24}
!12 = !{!"_win", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !13, i64 32, !13, i64 40, !14, i64 48, !14, i64 49, !14, i64 50, !14, i64 51, !14, i64 52, !14, i64 53, !14, 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}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!12, !10, i64 12}
!16 = !{!12, !10, i64 8}
!17 = !{!12, !6, i64 56}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!12, !14, i64 48}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!12, !14, i64 49}
!24 = !{!12, !10, i64 0}
!25 = !{!12, !10, i64 4}
!26 = !{!12, !10, i64 112}
!27 = !{!12, !10, i64 116}
!28 = !{!12, !10, i64 120}
!29 = !{!12, !10, i64 128}
!30 = !{!12, !10, i64 124}
!31 = !{!12, !10, i64 132}


; 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 [89 x i8], align 1
@LINES = external local_unnamed_addr global i32, align 4
@COLS = external local_unnamed_addr global i32, align 4
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__.pnoutrefresh = external hidden unnamed_addr constant [57 x i8], align 1
@curscr = external local_unnamed_addr global ptr, align 8

; 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 range(i32 -1, 1) i32 @pnoutrefresh(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %8, label %9

8:                                                ; preds = %7
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 192, ptr noundef nonnull @__PRETTY_FUNCTION__.pnoutrefresh) #5
  unreachable

9:                                                ; preds = %7
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %1, i32 0)
  %spec.store.select2 = tail call i32 @llvm.smax.i32(i32 %2, i32 0)
  %spec.store.select1 = tail call i32 @llvm.smax.i32(i32 %3, i32 0)
  %spec.store.select3 = tail call i32 @llvm.smax.i32(i32 %4, i32 0)
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load i32, ptr %10, align 8, !tbaa !5
  %12 = and i32 %11, 48
  %.not85 = icmp eq i32 %12, 0
  %13 = load i32, ptr @LINES, align 4
  %.not86 = icmp sle i32 %13, %5
  %or.cond.not98 = select i1 %.not85, i1 true, i1 %.not86
  %14 = load i32, ptr @COLS, align 4
  %.not87 = icmp sle i32 %14, %6
  %or.cond93.not97 = select i1 %or.cond.not98, i1 true, i1 %.not87
  %15 = icmp sgt i32 %spec.store.select1, %5
  %or.cond94 = or i1 %15, %or.cond93.not97
  %16 = icmp sgt i32 %spec.store.select3, %6
  %or.cond95 = or i1 %16, %or.cond94
  br i1 %or.cond95, label %85, label %17

17:                                               ; preds = %9
  %18 = sub nsw i32 %6, %spec.store.select3
  %19 = add nsw i32 %18, 1
  %20 = getelementptr inbounds i8, ptr %0, i64 12
  %21 = load i32, ptr %20, align 4, !tbaa !13
  %22 = sub nsw i32 %21, %spec.store.select2
  %. = tail call i32 @llvm.smin.i32(i32 %19, i32 %22)
  %23 = getelementptr inbounds i8, ptr %0, i64 8
  %24 = zext nneg i32 %spec.store.select3 to i64
  %25 = getelementptr inbounds i8, ptr %0, i64 56
  %26 = zext nneg i32 %spec.store.select2 to i64
  %27 = sext i32 %. to i64
  %28 = shl nsw i64 %27, 3
  %29 = zext nneg i32 %spec.store.select to i64
  %30 = zext nneg i32 %spec.store.select1 to i64
  %31 = add nuw nsw i32 %5, 1
  %wide.trip.count = zext nneg i32 %31 to i64
  br label %32

32:                                               ; preds = %17, %50
  %indvars.iv101 = phi i64 [ %30, %17 ], [ %indvars.iv.next102, %50 ]
  %indvars.iv = phi i64 [ %29, %17 ], [ %indvars.iv.next, %50 ]
  %33 = load i32, ptr %23, align 8, !tbaa !14
  %34 = sext i32 %33 to i64
  %35 = icmp slt i64 %indvars.iv, %34
  br i1 %35, label %36, label %50

36:                                               ; preds = %32
  %37 = load ptr, ptr @curscr, align 8, !tbaa !15
  %38 = getelementptr inbounds i8, ptr %37, i64 56
  %39 = load ptr, ptr %38, align 8, !tbaa !16
  %40 = getelementptr inbounds ptr, ptr %39, i64 %indvars.iv101
  %41 = load ptr, ptr %40, align 8, !tbaa !15
  %42 = getelementptr inbounds i64, ptr %41, i64 %24
  %43 = load ptr, ptr %25, align 8, !tbaa !16
  %44 = getelementptr inbounds ptr, ptr %43, i64 %indvars.iv
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  %46 = getelementptr inbounds i64, ptr %45, i64 %26
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 8 %42, ptr align 8 %46, i64 %28, i1 false)
  %47 = load ptr, ptr @curscr, align 8, !tbaa !15
  %48 = trunc nuw nsw i64 %indvars.iv101 to i32
  tail call void @PDC_mark_cells_as_changed(ptr noundef %47, i32 noundef %48, i32 noundef %spec.store.select3, i32 noundef %6) #6
  %49 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @PDC_set_changed_cells_range(ptr noundef nonnull %0, i32 noundef %49, i32 noundef -1, i32 noundef -1) #6
  br label %50

50:                                               ; preds = %36, %32
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count
  br i1 %exitcond.not, label %51, label %32, !llvm.loop !17

51:                                               ; preds = %50
  %52 = getelementptr inbounds i8, ptr %0, i64 48
  %53 = load i8, ptr %52, align 8, !tbaa !19, !range !20, !noundef !21
  %54 = trunc nuw i8 %53 to i1
  br i1 %54, label %55, label %58

55:                                               ; preds = %51
  store i8 0, ptr %52, align 8, !tbaa !19
  %56 = load ptr, ptr @curscr, align 8, !tbaa !15
  %57 = getelementptr inbounds i8, ptr %56, i64 48
  store i8 1, ptr %57, align 8, !tbaa !19
  br label %58

58:                                               ; preds = %55, %51
  %59 = getelementptr inbounds i8, ptr %0, i64 49
  %60 = load i8, ptr %59, align 1, !tbaa !22, !range !20, !noundef !21
  %61 = trunc nuw i8 %60 to i1
  br i1 %61, label %78, label %62

62:                                               ; preds = %58
  %63 = load i32, ptr %0, align 8, !tbaa !23
  %.not89 = icmp slt i32 %63, %spec.store.select
  br i1 %.not89, label %78, label %64

64:                                               ; preds = %62
  %65 = getelementptr inbounds i8, ptr %0, i64 4
  %66 = load i32, ptr %65, align 4, !tbaa !24
  %.not90 = icmp slt i32 %66, %spec.store.select2
  br i1 %.not90, label %78, label %67

67:                                               ; preds = %64
  %68 = sub nsw i32 %spec.store.select, %spec.store.select1
  %69 = add i32 %68, %5
  %.not91 = icmp sgt i32 %63, %69
  %70 = add nsw i32 %18, %spec.store.select2
  %.not92 = icmp sgt i32 %66, %70
  %or.cond96 = select i1 %.not91, i1 true, i1 %.not92
  br i1 %or.cond96, label %78, label %71

71:                                               ; preds = %67
  %72 = sub nsw i32 %spec.store.select1, %spec.store.select
  %73 = add i32 %72, %63
  %74 = load ptr, ptr @curscr, align 8, !tbaa !15
  store i32 %73, ptr %74, align 8, !tbaa !23
  %75 = sub nsw i32 %spec.store.select3, %spec.store.select2
  %76 = add i32 %75, %66
  %77 = getelementptr inbounds i8, ptr %74, i64 4
  store i32 %76, ptr %77, align 4, !tbaa !24
  br label %78

78:                                               ; preds = %71, %67, %64, %62, %58
  %79 = getelementptr inbounds i8, ptr %0, i64 112
  store i32 %spec.store.select, ptr %79, align 8, !tbaa !25
  %80 = getelementptr inbounds i8, ptr %0, i64 116
  store i32 %spec.store.select2, ptr %80, align 4, !tbaa !26
  %81 = getelementptr inbounds i8, ptr %0, i64 120
  store i32 %spec.store.select1, ptr %81, align 8, !tbaa !27
  %82 = getelementptr inbounds i8, ptr %0, i64 128
  store i32 %spec.store.select3, ptr %82, align 8, !tbaa !28
  %83 = getelementptr inbounds i8, ptr %0, i64 124
  store i32 %5, ptr %83, align 4, !tbaa !29
  %84 = getelementptr inbounds i8, ptr %0, i64 132
  store i32 %6, ptr %84, align 4, !tbaa !30
  br label %85

85:                                               ; preds = %9, %78
  %.077 = phi i32 [ 0, %78 ], [ -1, %9 ]
  ret i32 %.077
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn nounwind }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 24}
!6 = !{!"_win", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !11, i64 48, !11, i64 49, !11, i64 50, !11, i64 51, !11, i64 52, !11, i64 53, !11, i64 54, !12, i64 56, !12, i64 64, !12, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !12, i64 104, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !7, i64 12}
!14 = !{!6, !7, i64 8}
!15 = !{!12, !12, i64 0}
!16 = !{!6, !12, i64 56}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!6, !11, i64 48}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!6, !11, i64 49}
!23 = !{!6, !7, i64 0}
!24 = !{!6, !7, i64 4}
!25 = !{!6, !7, i64 112}
!26 = !{!6, !7, i64 116}
!27 = !{!6, !7, i64 120}
!28 = !{!6, !7, i64 128}
!29 = !{!6, !7, i64 124}
!30 = !{!6, !7, i64 132}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass