; 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._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.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
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@__PRETTY_FUNCTION__.resize_window = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @PDC_makenew(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

; 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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @PDC_makelines(ptr noundef) #0

declare i32 @werase(ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @subwin(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #0

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

16:                                               ; preds = %3
  br label %18

17:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 506, ptr noundef @__PRETTY_FUNCTION__.resize_window) #7
  unreachable

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

21:                                               ; preds = %18
  br label %23

22:                                               ; preds = %18
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 507, ptr noundef @__PRETTY_FUNCTION__.resize_window) #7
  unreachable

23:                                               ; preds = %21
  %24 = load i32, ptr %6, align 4, !tbaa !9
  %25 = icmp sge i32 %24, 0
  br i1 %25, label %26, label %30

26:                                               ; preds = %23
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = icmp sge i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %26
  br label %31

30:                                               ; preds = %26, %23
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 508, ptr noundef @__PRETTY_FUNCTION__.resize_window) #7
  unreachable

31:                                               ; preds = %29
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %43

34:                                               ; preds = %31
  %35 = load ptr, ptr @SP, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %43

37:                                               ; preds = %34
  %38 = load i32, ptr %6, align 4, !tbaa !9
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %43, label %40

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

43:                                               ; preds = %40, %37, %34, %31
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %377

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

50:                                               ; preds = %44
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._win, ptr %51, i32 0, i32 24
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = load i32, ptr %6, align 4, !tbaa !9
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct._win, ptr %56, i32 0, i32 4
  %58 = load i32, ptr %57, align 8, !tbaa !16
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._win, ptr %59, i32 0, i32 5
  %61 = load i32, ptr %60, align 4, !tbaa !17
  %62 = call ptr @subpad(ptr noundef %53, i32 noundef %54, i32 noundef %55, i32 noundef %58, i32 noundef %61)
  store ptr %62, ptr %8, align 8, !tbaa !5
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %66, label %65

65:                                               ; preds = %50
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %377

66:                                               ; preds = %50
  br label %122

67:                                               ; preds = %44
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct._win, ptr %68, i32 0, i32 6
  %70 = load i32, ptr %69, align 8, !tbaa !11
  %71 = and i32 %70, 1
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %90

73:                                               ; preds = %67
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._win, ptr %74, i32 0, i32 24
  %76 = load ptr, ptr %75, align 8, !tbaa !15
  %77 = load i32, ptr %6, align 4, !tbaa !9
  %78 = load i32, ptr %7, align 4, !tbaa !9
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct._win, ptr %79, i32 0, i32 4
  %81 = load i32, ptr %80, align 8, !tbaa !16
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct._win, ptr %82, i32 0, i32 5
  %84 = load i32, ptr %83, align 4, !tbaa !17
  %85 = call ptr @subwin(ptr noundef %76, i32 noundef %77, i32 noundef %78, i32 noundef %81, i32 noundef %84)
  store ptr %85, ptr %8, align 8, !tbaa !5
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = icmp ne ptr %86, null
  br i1 %87, label %89, label %88

88:                                               ; preds = %73
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %377

89:                                               ; preds = %73
  br label %121

90:                                               ; preds = %67
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = load ptr, ptr @SP, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.SCREEN, ptr %92, i32 0, i32 21
  %94 = load ptr, ptr %93, align 8, !tbaa !18
  %95 = icmp eq ptr %91, %94
  br i1 %95, label %96, label %104

96:                                               ; preds = %90
  %97 = load ptr, ptr @SP, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.SCREEN, ptr %97, i32 0, i32 16
  %99 = load i32, ptr %98, align 8, !tbaa !22
  %100 = load ptr, ptr @SP, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.SCREEN, ptr %100, i32 0, i32 20
  %102 = load i32, ptr %101, align 4, !tbaa !23
  %103 = sub nsw i32 %99, %102
  store i32 %103, ptr %11, align 4, !tbaa !9
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %111

104:                                              ; preds = %90
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct._win, ptr %105, i32 0, i32 4
  %107 = load i32, ptr %106, align 8, !tbaa !16
  store i32 %107, ptr %11, align 4, !tbaa !9
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct._win, ptr %108, i32 0, i32 5
  %110 = load i32, ptr %109, align 4, !tbaa !17
  store i32 %110, ptr %12, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %104, %96
  %112 = load i32, ptr %6, align 4, !tbaa !9
  %113 = load i32, ptr %7, align 4, !tbaa !9
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = call ptr @PDC_makenew(i32 noundef %112, i32 noundef %113, i32 noundef %114, i32 noundef %115)
  store ptr %116, ptr %8, align 8, !tbaa !5
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = icmp ne ptr %117, null
  br i1 %118, label %120, label %119

119:                                              ; preds = %111
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %377

120:                                              ; preds = %111
  br label %121

121:                                              ; preds = %120, %89
  br label %122

122:                                              ; preds = %121, %66
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._win, ptr %123, i32 0, i32 1
  %125 = load i32, ptr %124, align 4, !tbaa !24
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct._win, ptr %126, i32 0, i32 3
  %128 = load i32, ptr %127, align 4, !tbaa !25
  %129 = sub nsw i32 %128, 1
  %130 = icmp slt i32 %125, %129
  br i1 %130, label %131, label %135

131:                                              ; preds = %122
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._win, ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !24
  br label %140

135:                                              ; preds = %122
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct._win, ptr %136, i32 0, i32 3
  %138 = load i32, ptr %137, align 4, !tbaa !25
  %139 = sub nsw i32 %138, 1
  br label %140

140:                                              ; preds = %135, %131
  %141 = phi i32 [ %134, %131 ], [ %139, %135 ]
  store i32 %141, ptr %10, align 4, !tbaa !9
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct._win, ptr %142, i32 0, i32 0
  %144 = load i32, ptr %143, align 8, !tbaa !26
  %145 = load ptr, ptr %8, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct._win, ptr %145, i32 0, i32 2
  %147 = load i32, ptr %146, align 8, !tbaa !27
  %148 = sub nsw i32 %147, 1
  %149 = icmp slt i32 %144, %148
  br i1 %149, label %150, label %154

150:                                              ; preds = %140
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct._win, ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 8, !tbaa !26
  br label %159

154:                                              ; preds = %140
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._win, ptr %155, i32 0, i32 2
  %157 = load i32, ptr %156, align 8, !tbaa !27
  %158 = sub nsw i32 %157, 1
  br label %159

159:                                              ; preds = %154, %150
  %160 = phi i32 [ %153, %150 ], [ %158, %154 ]
  store i32 %160, ptr %9, align 4, !tbaa !9
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct._win, ptr %161, i32 0, i32 6
  %163 = load i32, ptr %162, align 8, !tbaa !11
  %164 = and i32 %163, 33
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %232, label %166

166:                                              ; preds = %159
  %167 = load ptr, ptr %8, align 8, !tbaa !5
  %168 = call ptr @PDC_makelines(ptr noundef %167)
  store ptr %168, ptr %8, align 8, !tbaa !5
  %169 = load ptr, ptr %8, align 8, !tbaa !5
  %170 = icmp ne ptr %169, null
  br i1 %170, label %172, label %171

171:                                              ; preds = %166
  store ptr null, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %377

172:                                              ; preds = %166
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct._win, ptr %173, i32 0, i32 8
  %175 = load i64, ptr %174, align 8, !tbaa !28
  %176 = load ptr, ptr %8, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._win, ptr %176, i32 0, i32 8
  store i64 %175, ptr %177, align 8, !tbaa !28
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  %179 = call i32 @werase(ptr noundef %178)
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = load ptr, ptr %8, align 8, !tbaa !5
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct._win, ptr %182, i32 0, i32 2
  %184 = load i32, ptr %183, align 8, !tbaa !27
  %185 = load ptr, ptr %8, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct._win, ptr %185, i32 0, i32 2
  %187 = load i32, ptr %186, align 8, !tbaa !27
  %188 = icmp slt i32 %184, %187
  br i1 %188, label %189, label %193

189:                                              ; preds = %172
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct._win, ptr %190, i32 0, i32 2
  %192 = load i32, ptr %191, align 8, !tbaa !27
  br label %197

193:                                              ; preds = %172
  %194 = load ptr, ptr %8, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct._win, ptr %194, i32 0, i32 2
  %196 = load i32, ptr %195, align 8, !tbaa !27
  br label %197

197:                                              ; preds = %193, %189
  %198 = phi i32 [ %192, %189 ], [ %196, %193 ]
  %199 = sub nsw i32 %198, 1
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct._win, ptr %200, i32 0, i32 3
  %202 = load i32, ptr %201, align 4, !tbaa !25
  %203 = load ptr, ptr %8, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct._win, ptr %203, i32 0, i32 3
  %205 = load i32, ptr %204, align 4, !tbaa !25
  %206 = icmp slt i32 %202, %205
  br i1 %206, label %207, label %211

207:                                              ; preds = %197
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct._win, ptr %208, i32 0, i32 3
  %210 = load i32, ptr %209, align 4, !tbaa !25
  br label %215

211:                                              ; preds = %197
  %212 = load ptr, ptr %8, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct._win, ptr %212, i32 0, i32 3
  %214 = load i32, ptr %213, align 4, !tbaa !25
  br label %215

215:                                              ; preds = %211, %207
  %216 = phi i32 [ %210, %207 ], [ %214, %211 ]
  %217 = sub nsw i32 %216, 1
  %218 = call i32 @copywin(ptr noundef %180, ptr noundef %181, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %199, i32 noundef %217, i32 noundef 0)
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct._win, ptr %219, i32 0, i32 16
  %221 = load ptr, ptr %220, align 8, !tbaa !29
  %222 = getelementptr inbounds ptr, ptr %221, i64 0
  %223 = load ptr, ptr %222, align 8, !tbaa !5
  %224 = icmp ne ptr %223, null
  br i1 %224, label %225, label %231

225:                                              ; preds = %215
  %226 = load ptr, ptr %5, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct._win, ptr %226, i32 0, i32 16
  %228 = load ptr, ptr %227, align 8, !tbaa !29
  %229 = getelementptr inbounds ptr, ptr %228, i64 0
  %230 = load ptr, ptr %229, align 8, !tbaa !5
  call void @free(ptr noundef %230) #6
  br label %231

231:                                              ; preds = %225, %215
  br label %232

232:                                              ; preds = %231, %159
  %233 = load ptr, ptr %5, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct._win, ptr %233, i32 0, i32 6
  %235 = load i32, ptr %234, align 8, !tbaa !11
  %236 = load ptr, ptr %8, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct._win, ptr %236, i32 0, i32 6
  store i32 %235, ptr %237, align 8, !tbaa !11
  %238 = load ptr, ptr %5, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct._win, ptr %238, i32 0, i32 7
  %240 = load i64, ptr %239, align 8, !tbaa !30
  %241 = load ptr, ptr %8, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct._win, ptr %241, i32 0, i32 7
  store i64 %240, ptr %242, align 8, !tbaa !30
  %243 = load ptr, ptr %5, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct._win, ptr %243, i32 0, i32 9
  %245 = load i8, ptr %244, align 8, !tbaa !31, !range !32, !noundef !33
  %246 = trunc i8 %245 to i1
  %247 = load ptr, ptr %8, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct._win, ptr %247, i32 0, i32 9
  %249 = zext i1 %246 to i8
  store i8 %249, ptr %248, align 8, !tbaa !31
  %250 = load ptr, ptr %5, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct._win, ptr %250, i32 0, i32 10
  %252 = load i8, ptr %251, align 1, !tbaa !34, !range !32, !noundef !33
  %253 = trunc i8 %252 to i1
  %254 = load ptr, ptr %8, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct._win, ptr %254, i32 0, i32 10
  %256 = zext i1 %253 to i8
  store i8 %256, ptr %255, align 1, !tbaa !34
  %257 = load ptr, ptr %5, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct._win, ptr %257, i32 0, i32 11
  %259 = load i8, ptr %258, align 2, !tbaa !35, !range !32, !noundef !33
  %260 = trunc i8 %259 to i1
  %261 = load ptr, ptr %8, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct._win, ptr %261, i32 0, i32 11
  %263 = zext i1 %260 to i8
  store i8 %263, ptr %262, align 2, !tbaa !35
  %264 = load ptr, ptr %5, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct._win, ptr %264, i32 0, i32 12
  %266 = load i8, ptr %265, align 1, !tbaa !36, !range !32, !noundef !33
  %267 = trunc i8 %266 to i1
  %268 = load ptr, ptr %8, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct._win, ptr %268, i32 0, i32 12
  %270 = zext i1 %267 to i8
  store i8 %270, ptr %269, align 1, !tbaa !36
  %271 = load ptr, ptr %5, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct._win, ptr %271, i32 0, i32 21
  %273 = load i32, ptr %272, align 8, !tbaa !37
  %274 = load ptr, ptr %8, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct._win, ptr %274, i32 0, i32 21
  store i32 %273, ptr %275, align 8, !tbaa !37
  %276 = load ptr, ptr %5, align 8, !tbaa !5
  %277 = getelementptr inbounds %struct._win, ptr %276, i32 0, i32 15
  %278 = load i8, ptr %277, align 2, !tbaa !38, !range !32, !noundef !33
  %279 = trunc i8 %278 to i1
  %280 = load ptr, ptr %8, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct._win, ptr %280, i32 0, i32 15
  %282 = zext i1 %279 to i8
  store i8 %282, ptr %281, align 2, !tbaa !38
  %283 = load ptr, ptr %5, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct._win, ptr %283, i32 0, i32 19
  %285 = load i32, ptr %284, align 8, !tbaa !39
  %286 = load ptr, ptr %8, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct._win, ptr %286, i32 0, i32 2
  %288 = load i32, ptr %287, align 8, !tbaa !27
  %289 = sub nsw i32 %288, 1
  %290 = icmp sgt i32 %285, %289
  br i1 %290, label %291, label %292

291:                                              ; preds = %232
  br label %296

292:                                              ; preds = %232
  %293 = load ptr, ptr %5, align 8, !tbaa !5
  %294 = getelementptr inbounds %struct._win, ptr %293, i32 0, i32 19
  %295 = load i32, ptr %294, align 8, !tbaa !39
  br label %296

296:                                              ; preds = %292, %291
  %297 = phi i32 [ 0, %291 ], [ %295, %292 ]
  %298 = load ptr, ptr %8, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct._win, ptr %298, i32 0, i32 19
  store i32 %297, ptr %299, align 8, !tbaa !39
  %300 = load ptr, ptr %5, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct._win, ptr %300, i32 0, i32 20
  %302 = load i32, ptr %301, align 4, !tbaa !40
  %303 = load ptr, ptr %5, align 8, !tbaa !5
  %304 = getelementptr inbounds %struct._win, ptr %303, i32 0, i32 2
  %305 = load i32, ptr %304, align 8, !tbaa !27
  %306 = sub nsw i32 %305, 1
  %307 = icmp eq i32 %302, %306
  br i1 %307, label %308, label %313

308:                                              ; preds = %296
  %309 = load ptr, ptr %8, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct._win, ptr %309, i32 0, i32 2
  %311 = load i32, ptr %310, align 8, !tbaa !27
  %312 = sub nsw i32 %311, 1
  br label %333

313:                                              ; preds = %296
  %314 = load ptr, ptr %5, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct._win, ptr %314, i32 0, i32 20
  %316 = load i32, ptr %315, align 4, !tbaa !40
  %317 = load ptr, ptr %8, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct._win, ptr %317, i32 0, i32 2
  %319 = load i32, ptr %318, align 8, !tbaa !27
  %320 = sub nsw i32 %319, 1
  %321 = icmp slt i32 %316, %320
  br i1 %321, label %322, label %326

322:                                              ; preds = %313
  %323 = load ptr, ptr %5, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct._win, ptr %323, i32 0, i32 20
  %325 = load i32, ptr %324, align 4, !tbaa !40
  br label %331

326:                                              ; preds = %313
  %327 = load ptr, ptr %8, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct._win, ptr %327, i32 0, i32 2
  %329 = load i32, ptr %328, align 8, !tbaa !27
  %330 = sub nsw i32 %329, 1
  br label %331

331:                                              ; preds = %326, %322
  %332 = phi i32 [ %325, %322 ], [ %330, %326 ]
  br label %333

333:                                              ; preds = %331, %308
  %334 = phi i32 [ %312, %308 ], [ %332, %331 ]
  %335 = load ptr, ptr %8, align 8, !tbaa !5
  %336 = getelementptr inbounds %struct._win, ptr %335, i32 0, i32 20
  store i32 %334, ptr %336, align 4, !tbaa !40
  %337 = load ptr, ptr %5, align 8, !tbaa !5
  %338 = getelementptr inbounds %struct._win, ptr %337, i32 0, i32 24
  %339 = load ptr, ptr %338, align 8, !tbaa !15
  %340 = load ptr, ptr %8, align 8, !tbaa !5
  %341 = getelementptr inbounds %struct._win, ptr %340, i32 0, i32 24
  store ptr %339, ptr %341, align 8, !tbaa !15
  %342 = load ptr, ptr %5, align 8, !tbaa !5
  %343 = getelementptr inbounds %struct._win, ptr %342, i32 0, i32 13
  %344 = load i8, ptr %343, align 4, !tbaa !41, !range !32, !noundef !33
  %345 = trunc i8 %344 to i1
  %346 = load ptr, ptr %8, align 8, !tbaa !5
  %347 = getelementptr inbounds %struct._win, ptr %346, i32 0, i32 13
  %348 = zext i1 %345 to i8
  store i8 %348, ptr %347, align 4, !tbaa !41
  %349 = load ptr, ptr %5, align 8, !tbaa !5
  %350 = getelementptr inbounds %struct._win, ptr %349, i32 0, i32 14
  %351 = load i8, ptr %350, align 1, !tbaa !42, !range !32, !noundef !33
  %352 = trunc i8 %351 to i1
  %353 = load ptr, ptr %8, align 8, !tbaa !5
  %354 = getelementptr inbounds %struct._win, ptr %353, i32 0, i32 14
  %355 = zext i1 %352 to i8
  store i8 %355, ptr %354, align 1, !tbaa !42
  %356 = load ptr, ptr %5, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct._win, ptr %356, i32 0, i32 8
  %358 = load i64, ptr %357, align 8, !tbaa !28
  %359 = load ptr, ptr %8, align 8, !tbaa !5
  %360 = getelementptr inbounds %struct._win, ptr %359, i32 0, i32 8
  store i64 %358, ptr %360, align 8, !tbaa !28
  %361 = load i32, ptr %10, align 4, !tbaa !9
  %362 = load ptr, ptr %8, align 8, !tbaa !5
  %363 = getelementptr inbounds %struct._win, ptr %362, i32 0, i32 1
  store i32 %361, ptr %363, align 4, !tbaa !24
  %364 = load i32, ptr %9, align 4, !tbaa !9
  %365 = load ptr, ptr %8, align 8, !tbaa !5
  %366 = getelementptr inbounds %struct._win, ptr %365, i32 0, i32 0
  store i32 %364, ptr %366, align 8, !tbaa !26
  %367 = load ptr, ptr %5, align 8, !tbaa !5
  %368 = getelementptr inbounds %struct._win, ptr %367, i32 0, i32 17
  %369 = load ptr, ptr %368, align 8, !tbaa !43
  call void @free(ptr noundef %369) #6
  %370 = load ptr, ptr %5, align 8, !tbaa !5
  %371 = getelementptr inbounds %struct._win, ptr %370, i32 0, i32 16
  %372 = load ptr, ptr %371, align 8, !tbaa !29
  call void @free(ptr noundef %372) #6
  %373 = load ptr, ptr %5, align 8, !tbaa !5
  %374 = load ptr, ptr %8, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %373, ptr align 8 %374, i64 136, i1 false), !tbaa.struct !44
  %375 = load ptr, ptr %8, align 8, !tbaa !5
  call void @free(ptr noundef %375) #6
  %376 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %376, ptr %4, align 8
  store i32 1, ptr %13, align 4
  br label %377

377:                                              ; preds = %333, %171, %119, %88, %65, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %378 = load ptr, ptr %4, align 8
  ret ptr %378
}

declare ptr @subpad(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare i32 @copywin(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

; 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) #5

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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind }
attributes #7 = { 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, !6, i64 104}
!16 = !{!12, !10, i64 16}
!17 = !{!12, !10, i64 20}
!18 = !{!19, !6, i64 56}
!19 = !{!"", !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, !20, i64 10, !20, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !13, i64 40, !10, i64 48, !10, i64 52, !6, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !14, i64 76, !10, i64 80, !13, i64 88, !14, i64 96, !14, i64 97, !21, i64 100, !20, i64 132, !13, i64 136, !6, i64 144, !6, i64 152, !14, i64 160, !14, 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}
!20 = !{!"short", !7, i64 0}
!21 = !{!"", !10, i64 0, !10, i64 4, !7, i64 8, !10, i64 28}
!22 = !{!19, !10, i64 32}
!23 = !{!19, !10, i64 52}
!24 = !{!12, !10, i64 4}
!25 = !{!12, !10, i64 12}
!26 = !{!12, !10, i64 0}
!27 = !{!12, !10, i64 8}
!28 = !{!12, !13, i64 40}
!29 = !{!12, !6, i64 56}
!30 = !{!12, !13, i64 32}
!31 = !{!12, !14, i64 48}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!12, !14, i64 49}
!35 = !{!12, !14, i64 50}
!36 = !{!12, !14, i64 51}
!37 = !{!12, !10, i64 88}
!38 = !{!12, !14, i64 54}
!39 = !{!12, !10, i64 80}
!40 = !{!12, !10, i64 84}
!41 = !{!12, !14, i64 52}
!42 = !{!12, !14, i64 53}
!43 = !{!12, !6, i64 64}
!44 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4, !9, i64 20, i64 4, !9, i64 24, i64 4, !9, i64 32, i64 8, !45, i64 40, i64 8, !45, i64 48, i64 1, !46, i64 49, i64 1, !46, i64 50, i64 1, !46, i64 51, i64 1, !46, i64 52, i64 1, !46, i64 53, i64 1, !46, i64 54, i64 1, !46, i64 56, i64 8, !5, i64 64, i64 8, !5, i64 72, i64 8, !5, i64 80, i64 4, !9, i64 84, i64 4, !9, i64 88, i64 4, !9, i64 92, i64 4, !9, i64 96, i64 4, !9, i64 104, i64 8, !5, i64 112, i64 4, !9, i64 116, i64 4, !9, i64 120, i64 4, !9, i64 124, i64 4, !9, i64 128, i64 4, !9, i64 132, i64 4, !9}
!45 = !{!13, !13, i64 0}
!46 = !{!14, !14, i64 0}


; 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
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@__PRETTY_FUNCTION__.resize_window = external hidden unnamed_addr constant [42 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @PDC_makenew(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @PDC_makelines(ptr noundef) local_unnamed_addr #0

declare i32 @werase(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @subwin(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @resize_window(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = load ptr, ptr @SP, align 8
  %.not = icmp eq ptr %4, null
  br i1 %.not, label %5, label %6

5:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 506, ptr noundef nonnull @__PRETTY_FUNCTION__.resize_window) #6
  unreachable

6:                                                ; preds = %3
  %.not130 = icmp eq ptr %0, null
  br i1 %.not130, label %7, label %8

7:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 507, ptr noundef nonnull @__PRETTY_FUNCTION__.resize_window) #6
  unreachable

8:                                                ; preds = %6
  %9 = or i32 %2, %1
  %or.cond = icmp sgt i32 %9, -1
  br i1 %or.cond, label %11, label %10

10:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 508, ptr noundef nonnull @__PRETTY_FUNCTION__.resize_window) #6
  unreachable

11:                                               ; preds = %8
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  %13 = load i32, ptr %12, align 8, !tbaa !5
  %14 = and i32 %13, 32
  %.not131 = icmp eq i32 %14, 0
  br i1 %.not131, label %23, label %15

15:                                               ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 104
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %0, i64 16
  %19 = load i32, ptr %18, align 8, !tbaa !14
  %20 = getelementptr inbounds i8, ptr %0, i64 20
  %21 = load i32, ptr %20, align 4, !tbaa !15
  %22 = tail call ptr @subpad(ptr noundef %17, i32 noundef %1, i32 noundef %2, i32 noundef %19, i32 noundef %21) #7
  %.not135 = icmp eq ptr %22, null
  br i1 %.not135, label %126, label %50

23:                                               ; preds = %11
  %24 = and i32 %13, 1
  %.not132 = icmp eq i32 %24, 0
  br i1 %.not132, label %33, label %25

25:                                               ; preds = %23
  %26 = getelementptr inbounds i8, ptr %0, i64 104
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  %29 = load i32, ptr %28, align 8, !tbaa !14
  %30 = getelementptr inbounds i8, ptr %0, i64 20
  %31 = load i32, ptr %30, align 4, !tbaa !15
  %32 = tail call ptr @subwin(ptr noundef %27, i32 noundef %1, i32 noundef %2, i32 noundef %29, i32 noundef %31)
  %.not134 = icmp eq ptr %32, null
  br i1 %.not134, label %126, label %50

33:                                               ; preds = %23
  %34 = getelementptr inbounds i8, ptr %4, i64 56
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = icmp eq ptr %35, %0
  br i1 %36, label %37, label %43

37:                                               ; preds = %33
  %38 = getelementptr inbounds i8, ptr %4, i64 32
  %39 = load i32, ptr %38, align 8, !tbaa !20
  %40 = getelementptr inbounds i8, ptr %4, i64 52
  %41 = load i32, ptr %40, align 4, !tbaa !21
  %42 = sub nsw i32 %39, %41
  br label %48

43:                                               ; preds = %33
  %44 = getelementptr inbounds i8, ptr %0, i64 16
  %45 = load i32, ptr %44, align 8, !tbaa !14
  %46 = getelementptr inbounds i8, ptr %0, i64 20
  %47 = load i32, ptr %46, align 4, !tbaa !15
  br label %48

48:                                               ; preds = %43, %37
  %.0107 = phi i32 [ %42, %37 ], [ %45, %43 ]
  %.0 = phi i32 [ 0, %37 ], [ %47, %43 ]
  %49 = tail call ptr @PDC_makenew(i32 noundef %1, i32 noundef %2, i32 noundef %.0107, i32 noundef %.0)
  %.not133 = icmp eq ptr %49, null
  br i1 %.not133, label %126, label %50

50:                                               ; preds = %25, %48, %15
  %.0109 = phi ptr [ %22, %15 ], [ %32, %25 ], [ %49, %48 ]
  %51 = getelementptr inbounds i8, ptr %.0109, i64 8
  %52 = load <2 x i32>, ptr %0, align 8, !tbaa !22
  %53 = load <2 x i32>, ptr %51, align 8, !tbaa !22
  %54 = add nsw <2 x i32> %53, <i32 -1, i32 -1>
  %55 = tail call <2 x i32> @llvm.smin.v2i32(<2 x i32> %52, <2 x i32> %54)
  %56 = load i32, ptr %12, align 8, !tbaa !5
  %57 = and i32 %56, 33
  %.not136 = icmp eq i32 %57, 0
  br i1 %.not136, label %58, label %81

58:                                               ; preds = %50
  %59 = tail call ptr @PDC_makelines(ptr noundef nonnull %.0109)
  %.not137 = icmp eq ptr %59, null
  br i1 %.not137, label %126, label %60

60:                                               ; preds = %58
  %61 = getelementptr inbounds i8, ptr %0, i64 40
  %62 = load i64, ptr %61, align 8, !tbaa !23
  %63 = getelementptr inbounds i8, ptr %59, i64 40
  store i64 %62, ptr %63, align 8, !tbaa !23
  %64 = tail call i32 @werase(ptr noundef nonnull %59) #7
  %65 = getelementptr inbounds i8, ptr %0, i64 8
  %66 = load i32, ptr %65, align 8, !tbaa !24
  %67 = getelementptr inbounds i8, ptr %59, i64 8
  %68 = load i32, ptr %67, align 8, !tbaa !24
  %.140 = tail call i32 @llvm.smin.i32(i32 %66, i32 %68)
  %69 = add nsw i32 %.140, -1
  %70 = getelementptr inbounds i8, ptr %0, i64 12
  %71 = load i32, ptr %70, align 4, !tbaa !25
  %72 = getelementptr inbounds i8, ptr %59, i64 12
  %73 = load i32, ptr %72, align 4, !tbaa !25
  %74 = tail call i32 @llvm.smin.i32(i32 %71, i32 %73)
  %75 = add nsw i32 %74, -1
  %76 = tail call i32 @copywin(ptr noundef nonnull %0, ptr noundef nonnull %59, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef 0, i32 noundef %69, i32 noundef %75, i32 noundef 0) #7
  %77 = getelementptr inbounds i8, ptr %0, i64 56
  %78 = load ptr, ptr %77, align 8, !tbaa !26
  %79 = load ptr, ptr %78, align 8, !tbaa !27
  %.not138 = icmp eq ptr %79, null
  br i1 %.not138, label %81, label %80

80:                                               ; preds = %60
  tail call void @free(ptr noundef nonnull %79) #7
  br label %81

81:                                               ; preds = %60, %80, %50
  %.1 = phi ptr [ %.0109, %50 ], [ %59, %80 ], [ %59, %60 ]
  %82 = load i32, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %.1, i64 24
  store i32 %82, ptr %83, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %0, i64 32
  %85 = load i64, ptr %84, align 8, !tbaa !28
  %86 = getelementptr inbounds i8, ptr %.1, i64 32
  store i64 %85, ptr %86, align 8, !tbaa !28
  %87 = getelementptr inbounds i8, ptr %0, i64 48
  %88 = getelementptr inbounds i8, ptr %.1, i64 48
  %89 = load <4 x i8>, ptr %87, align 8, !tbaa !29
  store <4 x i8> %89, ptr %88, align 8, !tbaa !29
  %90 = getelementptr inbounds i8, ptr %0, i64 88
  %91 = load i32, ptr %90, align 8, !tbaa !30
  %92 = getelementptr inbounds i8, ptr %.1, i64 88
  store i32 %91, ptr %92, align 8, !tbaa !30
  %93 = getelementptr inbounds i8, ptr %0, i64 54
  %94 = load i8, ptr %93, align 2, !tbaa !31, !range !32, !noundef !33
  %95 = getelementptr inbounds i8, ptr %.1, i64 54
  store i8 %94, ptr %95, align 2, !tbaa !31
  %96 = getelementptr inbounds i8, ptr %0, i64 80
  %97 = load i32, ptr %96, align 8, !tbaa !34
  %98 = getelementptr inbounds i8, ptr %.1, i64 8
  %99 = load i32, ptr %98, align 8, !tbaa !24
  %.not139 = icmp slt i32 %97, %99
  %spec.select = select i1 %.not139, i32 %97, i32 0
  %100 = getelementptr inbounds i8, ptr %.1, i64 80
  store i32 %spec.select, ptr %100, align 8, !tbaa !34
  %101 = getelementptr inbounds i8, ptr %0, i64 84
  %102 = load i32, ptr %101, align 4, !tbaa !35
  %103 = getelementptr inbounds i8, ptr %0, i64 8
  %104 = load i32, ptr %103, align 8, !tbaa !24
  %105 = add nsw i32 %104, -1
  %106 = icmp eq i32 %102, %105
  %107 = add nsw i32 %99, -1
  %.141 = tail call i32 @llvm.smin.i32(i32 %102, i32 %107)
  %108 = select i1 %106, i32 %107, i32 %.141
  %109 = getelementptr inbounds i8, ptr %.1, i64 84
  store i32 %108, ptr %109, align 4, !tbaa !35
  %110 = getelementptr inbounds i8, ptr %0, i64 104
  %111 = load ptr, ptr %110, align 8, !tbaa !13
  %112 = getelementptr inbounds i8, ptr %.1, i64 104
  store ptr %111, ptr %112, align 8, !tbaa !13
  %113 = getelementptr inbounds i8, ptr %0, i64 52
  %114 = load i8, ptr %113, align 4, !tbaa !36, !range !32, !noundef !33
  %115 = getelementptr inbounds i8, ptr %.1, i64 52
  store i8 %114, ptr %115, align 4, !tbaa !36
  %116 = getelementptr inbounds i8, ptr %0, i64 53
  %117 = load i8, ptr %116, align 1, !tbaa !37, !range !32, !noundef !33
  %118 = getelementptr inbounds i8, ptr %.1, i64 53
  store i8 %117, ptr %118, align 1, !tbaa !37
  %119 = getelementptr inbounds i8, ptr %0, i64 40
  %120 = load i64, ptr %119, align 8, !tbaa !23
  %121 = getelementptr inbounds i8, ptr %.1, i64 40
  store i64 %120, ptr %121, align 8, !tbaa !23
  store <2 x i32> %55, ptr %.1, align 8, !tbaa !22
  %122 = getelementptr inbounds i8, ptr %0, i64 64
  %123 = load ptr, ptr %122, align 8, !tbaa !38
  tail call void @free(ptr noundef %123) #7
  %124 = getelementptr inbounds i8, ptr %0, i64 56
  %125 = load ptr, ptr %124, align 8, !tbaa !26
  tail call void @free(ptr noundef %125) #7
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(136) %0, ptr noundef nonnull align 8 dereferenceable(136) %.1, i64 136, i1 false), !tbaa.struct !39
  tail call void @free(ptr noundef nonnull %.1) #7
  br label %126

126:                                              ; preds = %58, %48, %25, %15, %81
  %.0108 = phi ptr [ %0, %81 ], [ null, %15 ], [ null, %25 ], [ null, %48 ], [ null, %58 ]
  ret ptr %.0108
}

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

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

; 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) #4

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i32> @llvm.smin.v2i32(<2 x i32>, <2 x i32>) #5

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 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { noreturn nounwind }
attributes #7 = { 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, !12, i64 104}
!14 = !{!6, !7, i64 16}
!15 = !{!6, !7, i64 20}
!16 = !{!17, !12, i64 56}
!17 = !{!"", !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, !18, i64 10, !18, 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, !19, i64 100, !18, 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}
!18 = !{!"short", !8, i64 0}
!19 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 28}
!20 = !{!17, !7, i64 32}
!21 = !{!17, !7, i64 52}
!22 = !{!7, !7, i64 0}
!23 = !{!6, !10, i64 40}
!24 = !{!6, !7, i64 8}
!25 = !{!6, !7, i64 12}
!26 = !{!6, !12, i64 56}
!27 = !{!12, !12, i64 0}
!28 = !{!6, !10, i64 32}
!29 = !{!11, !11, i64 0}
!30 = !{!6, !7, i64 88}
!31 = !{!6, !11, i64 54}
!32 = !{i8 0, i8 2}
!33 = !{}
!34 = !{!6, !7, i64 80}
!35 = !{!6, !7, i64 84}
!36 = !{!6, !11, i64 52}
!37 = !{!6, !11, i64 53}
!38 = !{!6, !12, i64 64}
!39 = !{i64 0, i64 4, !22, i64 4, i64 4, !22, i64 8, i64 4, !22, i64 12, i64 4, !22, i64 16, i64 4, !22, i64 20, i64 4, !22, i64 24, i64 4, !22, i64 32, i64 8, !40, i64 40, i64 8, !40, i64 48, i64 1, !29, i64 49, i64 1, !29, i64 50, i64 1, !29, i64 51, i64 1, !29, i64 52, i64 1, !29, i64 53, i64 1, !29, i64 54, i64 1, !29, i64 56, i64 8, !27, i64 64, i64 8, !27, i64 72, i64 8, !27, i64 80, i64 4, !22, i64 84, i64 4, !22, i64 88, i64 4, !22, i64 92, i64 4, !22, i64 96, i64 4, !22, i64 104, i64 8, !27, i64 112, i64 4, !22, i64 116, i64 4, !22, i64 120, i64 4, !22, i64 124, i64 4, !22, i64 128, i64 4, !22, i64 132, i64 4, !22}
!40 = !{!10, !10, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass