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

; 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 }
%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 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@__PRETTY_FUNCTION__.winsch = external hidden unnamed_addr constant [29 x i8], align 1
@SP = external global ptr, align 8
@TABSIZE = external global i32, align 4

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

16:                                               ; preds = %2
  br label %18

17:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 75, ptr noundef @__PRETTY_FUNCTION__.winsch) #6
  unreachable

18:                                               ; preds = %16
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %22, label %21

21:                                               ; preds = %18
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %202

22:                                               ; preds = %18
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._win, ptr %23, i32 0, i32 1
  %25 = load i32, ptr %24, align 4, !tbaa !11
  store i32 %25, ptr %6, align 4, !tbaa !15
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct._win, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !16
  store i32 %28, ptr %7, align 4, !tbaa !15
  %29 = load i32, ptr %7, align 4, !tbaa !15
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._win, ptr %30, i32 0, i32 2
  %32 = load i32, ptr %31, align 8, !tbaa !17
  %33 = icmp sgt i32 %29, %32
  br i1 %33, label %46, label %34

34:                                               ; preds = %22
  %35 = load i32, ptr %6, align 4, !tbaa !15
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._win, ptr %36, i32 0, i32 3
  %38 = load i32, ptr %37, align 4, !tbaa !18
  %39 = icmp sgt i32 %35, %38
  br i1 %39, label %46, label %40

40:                                               ; preds = %34
  %41 = load i32, ptr %7, align 4, !tbaa !15
  %42 = icmp slt i32 %41, 0
  br i1 %42, label %46, label %43

43:                                               ; preds = %40
  %44 = load i32, ptr %6, align 4, !tbaa !15
  %45 = icmp slt i32 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %43, %40, %34, %22
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %202

47:                                               ; preds = %43
  %48 = load ptr, ptr @SP, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.SCREEN, ptr %48, i32 0, i32 5
  %50 = load i8, ptr %49, align 1, !tbaa !19, !range !23, !noundef !24
  %51 = trunc i8 %50 to i1
  br i1 %51, label %57, label %52

52:                                               ; preds = %47
  %53 = load i64, ptr %5, align 8, !tbaa !9
  %54 = and i64 %53, 2097152
  %55 = icmp ne i64 %54, 0
  %56 = xor i1 %55, true
  br label %57

57:                                               ; preds = %52, %47
  %58 = phi i1 [ false, %47 ], [ %56, %52 ]
  %59 = zext i1 %58 to i8
  store i8 %59, ptr %9, align 1, !tbaa !25
  %60 = load i64, ptr %5, align 8, !tbaa !9
  %61 = and i64 %60, 9007199252643840
  store i64 %61, ptr %8, align 8, !tbaa !9
  %62 = load i64, ptr %5, align 8, !tbaa !9
  %63 = and i64 %62, 2097151
  store i64 %63, ptr %5, align 8, !tbaa !9
  %64 = load i8, ptr %9, align 1, !tbaa !25, !range !23, !noundef !24
  %65 = trunc i8 %64 to i1
  br i1 %65, label %66, label %131

66:                                               ; preds = %57
  %67 = load i64, ptr %5, align 8, !tbaa !9
  %68 = icmp ult i64 %67, 32
  br i1 %68, label %72, label %69

69:                                               ; preds = %66
  %70 = load i64, ptr %5, align 8, !tbaa !9
  %71 = icmp eq i64 %70, 127
  br i1 %71, label %72, label %131

72:                                               ; preds = %69, %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %73 = load i64, ptr %5, align 8, !tbaa !9
  %74 = trunc i64 %73 to i32
  switch i32 %74, label %113 [
    i32 9, label %75
    i32 10, label %98
    i32 127, label %101
  ]

75:                                               ; preds = %72
  %76 = load i32, ptr %6, align 4, !tbaa !15
  %77 = load i32, ptr @TABSIZE, align 4, !tbaa !15
  %78 = sdiv i32 %76, %77
  %79 = add nsw i32 %78, 1
  %80 = load i32, ptr @TABSIZE, align 4, !tbaa !15
  %81 = mul nsw i32 %79, %80
  store i32 %81, ptr %11, align 4, !tbaa !15
  br label %82

82:                                               ; preds = %94, %75
  %83 = load i32, ptr %6, align 4, !tbaa !15
  %84 = load i32, ptr %11, align 4, !tbaa !15
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %86, label %97

86:                                               ; preds = %82
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load i64, ptr %8, align 8, !tbaa !9
  %89 = or i64 %88, 32
  %90 = call i32 @winsch(ptr noundef %87, i64 noundef %89)
  %91 = icmp eq i32 %90, -1
  br i1 %91, label %92, label %93

92:                                               ; preds = %86
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %128

93:                                               ; preds = %86
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %6, align 4, !tbaa !15
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %6, align 4, !tbaa !15
  br label %82, !llvm.loop !26

97:                                               ; preds = %82
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %128

98:                                               ; preds = %72
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = call i32 @wclrtoeol(ptr noundef %99)
  br label %127

101:                                              ; preds = %72
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = load i64, ptr %8, align 8, !tbaa !9
  %104 = or i64 %103, 63
  %105 = call i32 @winsch(ptr noundef %102, i64 noundef %104)
  %106 = icmp eq i32 %105, -1
  br i1 %106, label %107, label %108

107:                                              ; preds = %101
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %128

108:                                              ; preds = %101
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = load i64, ptr %8, align 8, !tbaa !9
  %111 = or i64 %110, 94
  %112 = call i32 @winsch(ptr noundef %109, i64 noundef %111)
  store i32 %112, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %128

113:                                              ; preds = %72
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = load i64, ptr %8, align 8, !tbaa !9
  %116 = load i64, ptr %5, align 8, !tbaa !9
  %117 = add i64 %116, 64
  %118 = or i64 %115, %117
  %119 = call i32 @winsch(ptr noundef %114, i64 noundef %118)
  %120 = icmp eq i32 %119, -1
  br i1 %120, label %121, label %122

121:                                              ; preds = %113
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %128

122:                                              ; preds = %113
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = load i64, ptr %8, align 8, !tbaa !9
  %125 = or i64 %124, 94
  %126 = call i32 @winsch(ptr noundef %123, i64 noundef %125)
  store i32 %126, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %128

127:                                              ; preds = %98
  store i32 0, ptr %10, align 4
  br label %128

128:                                              ; preds = %127, %122, %121, %108, %107, %97, %92
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %129 = load i32, ptr %10, align 4
  switch i32 %129, label %202 [
    i32 0, label %130
  ]

130:                                              ; preds = %128
  br label %200

131:                                              ; preds = %69, %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %132 = load i64, ptr %8, align 8, !tbaa !9
  %133 = and i64 %132, 9007190664806400
  %134 = icmp ne i64 %133, 0
  br i1 %134, label %141, label %135

135:                                              ; preds = %131
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._win, ptr %136, i32 0, i32 7
  %138 = load i64, ptr %137, align 8, !tbaa !28
  %139 = load i64, ptr %8, align 8, !tbaa !9
  %140 = or i64 %139, %138
  store i64 %140, ptr %8, align 8, !tbaa !9
  br label %141

141:                                              ; preds = %135, %131
  %142 = load i64, ptr %8, align 8, !tbaa !9
  %143 = and i64 %142, 9007190664806400
  %144 = icmp ne i64 %143, 0
  br i1 %144, label %152, label %145

145:                                              ; preds = %141
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct._win, ptr %146, i32 0, i32 8
  %148 = load i64, ptr %147, align 8, !tbaa !29
  %149 = and i64 %148, 9007199252643840
  %150 = load i64, ptr %8, align 8, !tbaa !9
  %151 = or i64 %150, %149
  store i64 %151, ptr %8, align 8, !tbaa !9
  br label %159

152:                                              ; preds = %141
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct._win, ptr %153, i32 0, i32 8
  %155 = load i64, ptr %154, align 8, !tbaa !29
  %156 = and i64 %155, 8587837440
  %157 = load i64, ptr %8, align 8, !tbaa !9
  %158 = or i64 %157, %156
  store i64 %158, ptr %8, align 8, !tbaa !9
  br label %159

159:                                              ; preds = %152, %145
  %160 = load i64, ptr %5, align 8, !tbaa !9
  %161 = icmp eq i64 %160, 32
  br i1 %161, label %162, label %167

162:                                              ; preds = %159
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._win, ptr %163, i32 0, i32 8
  %165 = load i64, ptr %164, align 8, !tbaa !29
  %166 = and i64 %165, 2097151
  store i64 %166, ptr %5, align 8, !tbaa !9
  br label %167

167:                                              ; preds = %162, %159
  %168 = load i64, ptr %8, align 8, !tbaa !9
  %169 = load i64, ptr %5, align 8, !tbaa !9
  %170 = or i64 %169, %168
  store i64 %170, ptr %5, align 8, !tbaa !9
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._win, ptr %171, i32 0, i32 3
  %173 = load i32, ptr %172, align 4, !tbaa !18
  store i32 %173, ptr %12, align 4, !tbaa !15
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct._win, ptr %174, i32 0, i32 16
  %176 = load ptr, ptr %175, align 8, !tbaa !30
  %177 = load i32, ptr %7, align 4, !tbaa !15
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds ptr, ptr %176, i64 %178
  %180 = load ptr, ptr %179, align 8, !tbaa !5
  %181 = load i32, ptr %6, align 4, !tbaa !15
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i64, ptr %180, i64 %182
  store ptr %183, ptr %13, align 8, !tbaa !5
  %184 = load ptr, ptr %13, align 8, !tbaa !5
  %185 = getelementptr inbounds i64, ptr %184, i64 1
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  %187 = load i32, ptr %12, align 4, !tbaa !15
  %188 = load i32, ptr %6, align 4, !tbaa !15
  %189 = sub nsw i32 %187, %188
  %190 = sub nsw i32 %189, 1
  %191 = sext i32 %190 to i64
  %192 = mul i64 %191, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %185, ptr align 8 %186, i64 %192, i1 false)
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = load i32, ptr %7, align 4, !tbaa !15
  %195 = load i32, ptr %6, align 4, !tbaa !15
  %196 = load i32, ptr %12, align 4, !tbaa !15
  %197 = sub nsw i32 %196, 1
  call void @PDC_mark_cells_as_changed(ptr noundef %193, i32 noundef %194, i32 noundef %195, i32 noundef %197)
  %198 = load i64, ptr %5, align 8, !tbaa !9
  %199 = load ptr, ptr %13, align 8, !tbaa !5
  store i64 %198, ptr %199, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %200

200:                                              ; preds = %167, %130
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PDC_sync(ptr noundef %201)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %202

202:                                              ; preds = %200, %128, %46, %21
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %203 = load i32, ptr %3, align 4
  ret i32 %203
}

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

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

declare i32 @wclrtoeol(ptr noundef) #3

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

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

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

declare void @PDC_sync(ptr noundef) #3

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 = { 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 #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 nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"_win", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !10, i64 32, !10, 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, !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}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!12, !13, i64 0}
!17 = !{!12, !13, i64 8}
!18 = !{!12, !13, i64 12}
!19 = !{!20, !14, i64 5}
!20 = !{!"", !14, i64 0, !14, i64 1, !14, i64 2, !14, i64 3, !14, i64 4, !14, i64 5, !14, i64 6, !14, i64 7, !14, i64 8, !14, i64 9, !21, i64 10, !21, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !10, i64 40, !13, i64 48, !13, i64 52, !6, i64 56, !13, i64 64, !13, i64 68, !13, i64 72, !14, i64 76, !13, i64 80, !10, i64 88, !14, i64 96, !14, i64 97, !22, i64 100, !21, i64 132, !10, i64 136, !6, i64 144, !6, i64 152, !14, i64 160, !14, 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}
!21 = !{!"short", !7, i64 0}
!22 = !{!"", !13, i64 0, !13, i64 4, !7, i64 8, !13, i64 28}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!14, !14, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!12, !10, i64 32}
!29 = !{!12, !10, i64 40}
!30 = !{!12, !6, i64 56}


; 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 [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [91 x i8], align 1
@__PRETTY_FUNCTION__.winsch = external hidden unnamed_addr constant [29 x i8], align 1
@SP = external local_unnamed_addr global ptr, align 8
@TABSIZE = external local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @winsch(ptr noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %9, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  %6 = load i32, ptr %0, align 8, !tbaa !5
  %7 = load i32, ptr %4, align 8, !tbaa !13
  %8 = icmp sgt i32 %6, %7
  br i1 %8, label %.thread, label %.lr.ph116

9:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 75, ptr noundef nonnull @__PRETTY_FUNCTION__.winsch) #4
  unreachable

.lr.ph116:                                        ; preds = %.lr.ph, %tailrecurse.backedge
  %10 = phi i32 [ %43, %tailrecurse.backedge ], [ %6, %.lr.ph ]
  %.tr81103115 = phi i64 [ %.tr81.be, %tailrecurse.backedge ], [ %1, %.lr.ph ]
  %11 = load i32, ptr %3, align 4, !tbaa !14
  %12 = load i32, ptr %5, align 4, !tbaa !15
  %13 = icmp sgt i32 %11, %12
  %14 = or i32 %10, %11
  %15 = icmp slt i32 %14, 0
  %or.cond3 = or i1 %15, %13
  br i1 %or.cond3, label %.thread, label %16

16:                                               ; preds = %.lr.ph116
  %17 = load ptr, ptr @SP, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %17, i64 5
  %19 = load i8, ptr %18, align 1, !tbaa !17, !range !21, !noundef !22
  %20 = trunc nuw i8 %19 to i1
  %21 = and i64 %.tr81103115, 2097152
  %.not75 = icmp ne i64 %21, 0
  %.not76 = or i1 %.not75, %20
  %22 = and i64 %.tr81103115, 9007199252643840
  %23 = and i64 %.tr81103115, 2097151
  br i1 %.not76, label %.split, label %24

24:                                               ; preds = %16
  %25 = icmp ult i64 %23, 32
  %26 = icmp eq i64 %23, 127
  %or.cond5 = or i1 %25, %26
  br i1 %or.cond5, label %27, label %.split

27:                                               ; preds = %24
  %28 = trunc nuw nsw i64 %23 to i32
  switch i32 %28, label %46 [
    i32 9, label %.split110
    i32 10, label %.split114
    i32 127, label %39
  ]

.split110:                                        ; preds = %27
  %29 = load i32, ptr @TABSIZE, align 4, !tbaa !23
  %30 = sdiv i32 %11, %29
  %31 = add nsw i32 %30, 1
  %32 = mul nsw i32 %31, %29
  %33 = or disjoint i64 %22, 32
  %34 = icmp slt i32 %11, %32
  br i1 %34, label %.lr.ph121, label %.thread

35:                                               ; preds = %.lr.ph121
  %36 = add nsw i32 %.067120, 1
  %exitcond.not = icmp eq i32 %36, %32
  br i1 %exitcond.not, label %.thread, label %.lr.ph121, !llvm.loop !24

.lr.ph121:                                        ; preds = %.split110, %35
  %.067120 = phi i32 [ %36, %35 ], [ %11, %.split110 ]
  %37 = tail call i32 @winsch(ptr noundef nonnull %0, i64 noundef %33)
  %38 = icmp eq i32 %37, -1
  br i1 %38, label %.thread, label %35

39:                                               ; preds = %27
  %40 = or disjoint i64 %22, 63
  %41 = tail call i32 @winsch(ptr noundef nonnull %0, i64 noundef %40)
  %42 = icmp eq i32 %41, -1
  br i1 %42, label %.thread, label %tailrecurse.backedge

tailrecurse.backedge:                             ; preds = %46, %39
  %.tr81.be = or disjoint i64 %22, 94
  %43 = load i32, ptr %0, align 8, !tbaa !5
  %44 = load i32, ptr %4, align 8, !tbaa !13
  %45 = icmp sgt i32 %43, %44
  br i1 %45, label %.thread, label %.lr.ph116

46:                                               ; preds = %27
  %47 = add nuw nsw i64 %23, 64
  %48 = or disjoint i64 %47, %22
  %49 = tail call i32 @winsch(ptr noundef nonnull %0, i64 noundef %48)
  %50 = icmp eq i32 %49, -1
  br i1 %50, label %.thread, label %tailrecurse.backedge

.split114:                                        ; preds = %27
  %51 = tail call i32 @wclrtoeol(ptr noundef nonnull %0) #5
  br label %79

.split:                                           ; preds = %16, %24
  %52 = and i64 %.tr81103115, 9007190664806400
  %.not77 = icmp eq i64 %52, 0
  br i1 %.not77, label %53, label %57

53:                                               ; preds = %.split
  %54 = getelementptr inbounds i8, ptr %0, i64 32
  %55 = load i64, ptr %54, align 8, !tbaa !26
  %56 = or i64 %55, %22
  br label %57

57:                                               ; preds = %53, %.split
  %.069 = phi i64 [ %22, %.split ], [ %56, %53 ]
  %58 = and i64 %.069, 9007190664806400
  %.not78 = icmp eq i64 %58, 0
  %59 = getelementptr inbounds i8, ptr %0, i64 40
  %60 = load i64, ptr %59, align 8, !tbaa !27
  %. = select i1 %.not78, i64 9007199252643840, i64 8587837440
  %61 = and i64 %60, %.
  %62 = icmp eq i64 %23, 32
  %63 = and i64 %60, 2097151
  %.066 = select i1 %62, i64 %63, i64 %23
  %64 = or disjoint i64 %61, %.066
  %65 = or i64 %64, %.069
  %66 = getelementptr inbounds i8, ptr %0, i64 56
  %67 = load ptr, ptr %66, align 8, !tbaa !28
  %68 = zext nneg i32 %10 to i64
  %69 = getelementptr inbounds ptr, ptr %67, i64 %68
  %70 = load ptr, ptr %69, align 8, !tbaa !16
  %71 = zext nneg i32 %11 to i64
  %72 = getelementptr inbounds i64, ptr %70, i64 %71
  %73 = getelementptr inbounds i8, ptr %72, i64 8
  %74 = xor i32 %11, -1
  %75 = add i32 %12, %74
  %76 = sext i32 %75 to i64
  %77 = shl nsw i64 %76, 3
  tail call void @llvm.memmove.p0.p0.i64(ptr nonnull align 8 %73, ptr align 8 %72, i64 %77, i1 false)
  %78 = add nsw i32 %12, -1
  tail call void @PDC_mark_cells_as_changed(ptr noundef nonnull %0, i32 noundef %10, i32 noundef %11, i32 noundef %78) #5
  store i64 %65, ptr %72, align 8, !tbaa !29
  br label %79

79:                                               ; preds = %.split114, %57
  tail call void @PDC_sync(ptr noundef nonnull %0) #5
  br label %.thread

.thread:                                          ; preds = %46, %39, %tailrecurse.backedge, %.lr.ph116, %.lr.ph121, %35, %.lr.ph, %.split110, %79
  %.1 = phi i32 [ 0, %79 ], [ 0, %.split110 ], [ -1, %.lr.ph ], [ -1, %.lr.ph121 ], [ 0, %35 ], [ -1, %.lr.ph116 ], [ -1, %tailrecurse.backedge ], [ -1, %39 ], [ -1, %46 ]
  ret i32 %.1
}

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

declare i32 @wclrtoeol(ptr noundef) local_unnamed_addr #2

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

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

declare void @PDC_sync(ptr noundef) local_unnamed_addr #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 = { 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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { noreturn nounwind }
attributes #5 = { 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 0}
!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 8}
!14 = !{!6, !7, i64 4}
!15 = !{!6, !7, i64 12}
!16 = !{!12, !12, i64 0}
!17 = !{!18, !11, i64 5}
!18 = !{!"", !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, !19, i64 10, !19, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !10, i64 40, !7, i64 48, !7, i64 52, !12, i64 56, !7, i64 64, !7, i64 68, !7, i64 72, !11, i64 76, !7, i64 80, !10, i64 88, !11, i64 96, !11, i64 97, !20, i64 100, !19, i64 132, !10, i64 136, !12, i64 144, !12, i64 152, !11, i64 160, !11, i64 161, !7, i64 164, !7, i64 168, !12, i64 176, !7, i64 184, !7, i64 188, !12, i64 192, !7, i64 200, !7, i64 204, !12, i64 208}
!19 = !{!"short", !8, i64 0}
!20 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 28}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!6, !10, i64 32}
!27 = !{!6, !10, i64 40}
!28 = !{!6, !12, i64 56}
!29 = !{!10, !10, i64 0}


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