; LLVM IR from attractivechaos/klib :: ksw (ksw_i16)

; 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.kswr_t = type { i32, i32, i32, i32, i32, i32, i32 }
%struct._kswq_t = type { i32, i32, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr }

@g_defr = external dso_local constant %struct.kswr_t, align 4

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

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_set1_epi32(i32 noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @_mm_store_si128(ptr noundef, <2 x i64> noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_load_si128(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @_mm_movemask_epi8(<2 x i64> noundef) #2

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #4

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

; Function Attrs: nounwind uwtable
define dso_local void @ksw_i16(ptr dead_on_unwind noalias writable sret(%struct.kswr_t) align 4 %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) #6 {
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %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
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca <2 x i64>, align 16
  %24 = alloca <2 x i64>, align 16
  %25 = alloca <2 x i64>, align 16
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca <2 x i64>, align 16
  %34 = alloca <2 x i64>, align 16
  %35 = alloca <2 x i64>, align 16
  %36 = alloca <2 x i64>, align 16
  %37 = alloca ptr, align 8
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca i32, align 4
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  store i32 %6, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 -1, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %0, ptr align 4 @g_defr, i64 28, i1 false), !tbaa.struct !11
  %45 = load i32, ptr %13, align 4, !tbaa !9
  %46 = and i32 %45, 262144
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %51

48:                                               ; preds = %7
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = and i32 %49, 65535
  br label %52

51:                                               ; preds = %7
  br label %52

52:                                               ; preds = %51, %48
  %53 = phi i32 [ %50, %48 ], [ 65536, %51 ]
  store i32 %53, ptr %20, align 4, !tbaa !9
  %54 = load i32, ptr %13, align 4, !tbaa !9
  %55 = and i32 %54, 131072
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %52
  %58 = load i32, ptr %13, align 4, !tbaa !9
  %59 = and i32 %58, 65535
  br label %61

60:                                               ; preds = %52
  br label %61

61:                                               ; preds = %60, %57
  %62 = phi i32 [ %59, %57 ], [ 65536, %60 ]
  store i32 %62, ptr %21, align 4, !tbaa !9
  store i32 0, ptr %17, align 4, !tbaa !9
  store i32 0, ptr %16, align 4, !tbaa !9
  store ptr null, ptr %22, align 8, !tbaa !5
  %63 = call <2 x i64> @_mm_set1_epi32(i32 noundef 0)
  store <2 x i64> %63, ptr %23, align 16, !tbaa !12
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = load i32, ptr %12, align 4, !tbaa !9
  %66 = add nsw i32 %64, %65
  %67 = trunc i32 %66 to i16
  %68 = call <2 x i64> @_mm_set1_epi16(i16 noundef signext %67)
  store <2 x i64> %68, ptr %24, align 16, !tbaa !12
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = trunc i32 %69 to i16
  %71 = call <2 x i64> @_mm_set1_epi16(i16 noundef signext %70)
  store <2 x i64> %71, ptr %25, align 16, !tbaa !12
  %72 = load ptr, ptr %8, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct._kswq_t, ptr %72, i32 0, i32 7
  %74 = load ptr, ptr %73, align 8, !tbaa !13
  store ptr %74, ptr %26, align 8, !tbaa !5
  %75 = load ptr, ptr %8, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct._kswq_t, ptr %75, i32 0, i32 8
  %77 = load ptr, ptr %76, align 8, !tbaa !15
  store ptr %77, ptr %27, align 8, !tbaa !5
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._kswq_t, ptr %78, i32 0, i32 9
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  store ptr %80, ptr %28, align 8, !tbaa !5
  %81 = load ptr, ptr %8, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._kswq_t, ptr %81, i32 0, i32 10
  %83 = load ptr, ptr %82, align 8, !tbaa !17
  store ptr %83, ptr %29, align 8, !tbaa !5
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct._kswq_t, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !18
  store i32 %86, ptr %14, align 4, !tbaa !9
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %107, %61
  %88 = load i32, ptr %15, align 4, !tbaa !9
  %89 = load i32, ptr %14, align 4, !tbaa !9
  %90 = icmp slt i32 %88, %89
  br i1 %90, label %91, label %110

91:                                               ; preds = %87
  %92 = load ptr, ptr %28, align 8, !tbaa !5
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds <2 x i64>, ptr %92, i64 %94
  %96 = load <2 x i64>, ptr %23, align 16, !tbaa !12
  call void @_mm_store_si128(ptr noundef %95, <2 x i64> noundef %96)
  %97 = load ptr, ptr %26, align 8, !tbaa !5
  %98 = load i32, ptr %15, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds <2 x i64>, ptr %97, i64 %99
  %101 = load <2 x i64>, ptr %23, align 16, !tbaa !12
  call void @_mm_store_si128(ptr noundef %100, <2 x i64> noundef %101)
  %102 = load ptr, ptr %29, align 8, !tbaa !5
  %103 = load i32, ptr %15, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds <2 x i64>, ptr %102, i64 %104
  %106 = load <2 x i64>, ptr %23, align 16, !tbaa !12
  call void @_mm_store_si128(ptr noundef %105, <2 x i64> noundef %106)
  br label %107

107:                                              ; preds = %91
  %108 = load i32, ptr %15, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %15, align 4, !tbaa !9
  br label %87, !llvm.loop !19

110:                                              ; preds = %87
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %111

111:                                              ; preds = %402, %110
  %112 = load i32, ptr %15, align 4, !tbaa !9
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = icmp slt i32 %112, %113
  br i1 %114, label %115, label %405

115:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %35) #7
  %116 = load <2 x i64>, ptr %23, align 16, !tbaa !12
  store <2 x i64> %116, ptr %35, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #7
  %117 = load <2 x i64>, ptr %23, align 16, !tbaa !12
  store <2 x i64> %117, ptr %36, align 16, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct._kswq_t, ptr %118, i32 0, i32 6
  %120 = load ptr, ptr %119, align 8, !tbaa !21
  %121 = load ptr, ptr %10, align 8, !tbaa !5
  %122 = load i32, ptr %15, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds i8, ptr %121, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !12
  %126 = zext i8 %125 to i32
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = mul nsw i32 %126, %127
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds <2 x i64>, ptr %120, i64 %129
  store ptr %130, ptr %37, align 8, !tbaa !5
  %131 = load ptr, ptr %26, align 8, !tbaa !5
  %132 = load i32, ptr %14, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds <2 x i64>, ptr %131, i64 %133
  %135 = getelementptr inbounds <2 x i64>, ptr %134, i64 -1
  %136 = call <2 x i64> @_mm_load_si128(ptr noundef %135)
  store <2 x i64> %136, ptr %34, align 16, !tbaa !12
  %137 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %138 = bitcast <2 x i64> %137 to <16 x i8>
  %139 = shufflevector <16 x i8> zeroinitializer, <16 x i8> %138, <16 x i32> <i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29>
  %140 = bitcast <16 x i8> %139 to <2 x i64>
  store <2 x i64> %140, ptr %34, align 16, !tbaa !12
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %199, %115
  %142 = load i32, ptr %30, align 4, !tbaa !9
  %143 = load i32, ptr %14, align 4, !tbaa !9
  %144 = icmp slt i32 %142, %143
  %145 = zext i1 %144 to i32
  %146 = sext i32 %145 to i64
  %147 = call i64 @llvm.expect.i64(i64 %146, i64 1)
  %148 = icmp ne i64 %147, 0
  br i1 %148, label %149, label %202

149:                                              ; preds = %141
  %150 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %151 = load ptr, ptr %37, align 8, !tbaa !5
  %152 = getelementptr inbounds <2 x i64>, ptr %151, i32 1
  store ptr %152, ptr %37, align 8, !tbaa !5
  %153 = load <2 x i64>, ptr %151, align 16, !tbaa !12
  %154 = call <2 x i64> @_mm_adds_epi16(<2 x i64> noundef %150, <2 x i64> noundef %153)
  store <2 x i64> %154, ptr %34, align 16, !tbaa !12
  %155 = load ptr, ptr %28, align 8, !tbaa !5
  %156 = load i32, ptr %30, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds <2 x i64>, ptr %155, i64 %157
  %159 = call <2 x i64> @_mm_load_si128(ptr noundef %158)
  store <2 x i64> %159, ptr %33, align 16, !tbaa !12
  %160 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %161 = load <2 x i64>, ptr %33, align 16, !tbaa !12
  %162 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %160, <2 x i64> noundef %161)
  store <2 x i64> %162, ptr %34, align 16, !tbaa !12
  %163 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %164 = load <2 x i64>, ptr %35, align 16, !tbaa !12
  %165 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %163, <2 x i64> noundef %164)
  store <2 x i64> %165, ptr %34, align 16, !tbaa !12
  %166 = load <2 x i64>, ptr %36, align 16, !tbaa !12
  %167 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %168 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %166, <2 x i64> noundef %167)
  store <2 x i64> %168, ptr %36, align 16, !tbaa !12
  %169 = load ptr, ptr %27, align 8, !tbaa !5
  %170 = load i32, ptr %30, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds <2 x i64>, ptr %169, i64 %171
  %173 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  call void @_mm_store_si128(ptr noundef %172, <2 x i64> noundef %173)
  %174 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %175 = load <2 x i64>, ptr %24, align 16, !tbaa !12
  %176 = call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %174, <2 x i64> noundef %175)
  store <2 x i64> %176, ptr %34, align 16, !tbaa !12
  %177 = load <2 x i64>, ptr %33, align 16, !tbaa !12
  %178 = load <2 x i64>, ptr %25, align 16, !tbaa !12
  %179 = call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %177, <2 x i64> noundef %178)
  store <2 x i64> %179, ptr %33, align 16, !tbaa !12
  %180 = load <2 x i64>, ptr %33, align 16, !tbaa !12
  %181 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %182 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %180, <2 x i64> noundef %181)
  store <2 x i64> %182, ptr %33, align 16, !tbaa !12
  %183 = load ptr, ptr %28, align 8, !tbaa !5
  %184 = load i32, ptr %30, align 4, !tbaa !9
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds <2 x i64>, ptr %183, i64 %185
  %187 = load <2 x i64>, ptr %33, align 16, !tbaa !12
  call void @_mm_store_si128(ptr noundef %186, <2 x i64> noundef %187)
  %188 = load <2 x i64>, ptr %35, align 16, !tbaa !12
  %189 = load <2 x i64>, ptr %25, align 16, !tbaa !12
  %190 = call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %188, <2 x i64> noundef %189)
  store <2 x i64> %190, ptr %35, align 16, !tbaa !12
  %191 = load <2 x i64>, ptr %35, align 16, !tbaa !12
  %192 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %193 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %191, <2 x i64> noundef %192)
  store <2 x i64> %193, ptr %35, align 16, !tbaa !12
  %194 = load ptr, ptr %26, align 8, !tbaa !5
  %195 = load i32, ptr %30, align 4, !tbaa !9
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds <2 x i64>, ptr %194, i64 %196
  %198 = call <2 x i64> @_mm_load_si128(ptr noundef %197)
  store <2 x i64> %198, ptr %34, align 16, !tbaa !12
  br label %199

199:                                              ; preds = %149
  %200 = load i32, ptr %30, align 4, !tbaa !9
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %30, align 4, !tbaa !9
  br label %141, !llvm.loop !22

202:                                              ; preds = %141
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %203

203:                                              ; preds = %259, %202
  %204 = load i32, ptr %31, align 4, !tbaa !9
  %205 = icmp slt i32 %204, 16
  %206 = zext i1 %205 to i32
  %207 = sext i32 %206 to i64
  %208 = call i64 @llvm.expect.i64(i64 %207, i64 1)
  %209 = icmp ne i64 %208, 0
  br i1 %209, label %210, label %262

210:                                              ; preds = %203
  %211 = load <2 x i64>, ptr %35, align 16, !tbaa !12
  %212 = bitcast <2 x i64> %211 to <16 x i8>
  %213 = shufflevector <16 x i8> zeroinitializer, <16 x i8> %212, <16 x i32> <i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29>
  %214 = bitcast <16 x i8> %213 to <2 x i64>
  store <2 x i64> %214, ptr %35, align 16, !tbaa !12
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %215

215:                                              ; preds = %255, %210
  %216 = load i32, ptr %30, align 4, !tbaa !9
  %217 = load i32, ptr %14, align 4, !tbaa !9
  %218 = icmp slt i32 %216, %217
  %219 = zext i1 %218 to i32
  %220 = sext i32 %219 to i64
  %221 = call i64 @llvm.expect.i64(i64 %220, i64 1)
  %222 = icmp ne i64 %221, 0
  br i1 %222, label %223, label %258

223:                                              ; preds = %215
  %224 = load ptr, ptr %27, align 8, !tbaa !5
  %225 = load i32, ptr %30, align 4, !tbaa !9
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds <2 x i64>, ptr %224, i64 %226
  %228 = call <2 x i64> @_mm_load_si128(ptr noundef %227)
  store <2 x i64> %228, ptr %34, align 16, !tbaa !12
  %229 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %230 = load <2 x i64>, ptr %35, align 16, !tbaa !12
  %231 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %229, <2 x i64> noundef %230)
  store <2 x i64> %231, ptr %34, align 16, !tbaa !12
  %232 = load ptr, ptr %27, align 8, !tbaa !5
  %233 = load i32, ptr %30, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds <2 x i64>, ptr %232, i64 %234
  %236 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  call void @_mm_store_si128(ptr noundef %235, <2 x i64> noundef %236)
  %237 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %238 = load <2 x i64>, ptr %24, align 16, !tbaa !12
  %239 = call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %237, <2 x i64> noundef %238)
  store <2 x i64> %239, ptr %34, align 16, !tbaa !12
  %240 = load <2 x i64>, ptr %35, align 16, !tbaa !12
  %241 = load <2 x i64>, ptr %25, align 16, !tbaa !12
  %242 = call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %240, <2 x i64> noundef %241)
  store <2 x i64> %242, ptr %35, align 16, !tbaa !12
  %243 = load <2 x i64>, ptr %35, align 16, !tbaa !12
  %244 = load <2 x i64>, ptr %34, align 16, !tbaa !12
  %245 = call <2 x i64> @_mm_cmpgt_epi16(<2 x i64> noundef %243, <2 x i64> noundef %244)
  %246 = call i32 @_mm_movemask_epi8(<2 x i64> noundef %245)
  %247 = icmp ne i32 %246, 0
  %248 = xor i1 %247, true
  %249 = zext i1 %248 to i32
  %250 = sext i32 %249 to i64
  %251 = call i64 @llvm.expect.i64(i64 %250, i64 0)
  %252 = icmp ne i64 %251, 0
  br i1 %252, label %253, label %254

253:                                              ; preds = %223
  br label %263

254:                                              ; preds = %223
  br label %255

255:                                              ; preds = %254
  %256 = load i32, ptr %30, align 4, !tbaa !9
  %257 = add nsw i32 %256, 1
  store i32 %257, ptr %30, align 4, !tbaa !9
  br label %215, !llvm.loop !23

258:                                              ; preds = %215
  br label %259

259:                                              ; preds = %258
  %260 = load i32, ptr %31, align 4, !tbaa !9
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %31, align 4, !tbaa !9
  br label %203, !llvm.loop !24

262:                                              ; preds = %203
  br label %263

263:                                              ; preds = %262, %253
  br label %264

264:                                              ; preds = %263
  %265 = load <2 x i64>, ptr %36, align 16, !tbaa !12
  %266 = load <2 x i64>, ptr %36, align 16, !tbaa !12
  %267 = bitcast <2 x i64> %266 to <16 x i8>
  %268 = shufflevector <16 x i8> %267, <16 x i8> zeroinitializer, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23>
  %269 = bitcast <16 x i8> %268 to <2 x i64>
  %270 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %265, <2 x i64> noundef %269)
  store <2 x i64> %270, ptr %36, align 16, !tbaa !12
  %271 = load <2 x i64>, ptr %36, align 16, !tbaa !12
  %272 = load <2 x i64>, ptr %36, align 16, !tbaa !12
  %273 = bitcast <2 x i64> %272 to <16 x i8>
  %274 = shufflevector <16 x i8> %273, <16 x i8> zeroinitializer, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19>
  %275 = bitcast <16 x i8> %274 to <2 x i64>
  %276 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %271, <2 x i64> noundef %275)
  store <2 x i64> %276, ptr %36, align 16, !tbaa !12
  %277 = load <2 x i64>, ptr %36, align 16, !tbaa !12
  %278 = load <2 x i64>, ptr %36, align 16, !tbaa !12
  %279 = bitcast <2 x i64> %278 to <16 x i8>
  %280 = shufflevector <16 x i8> %279, <16 x i8> zeroinitializer, <16 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17>
  %281 = bitcast <16 x i8> %280 to <2 x i64>
  %282 = call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %277, <2 x i64> noundef %281)
  store <2 x i64> %282, ptr %36, align 16, !tbaa !12
  %283 = load <2 x i64>, ptr %36, align 16, !tbaa !12
  %284 = bitcast <2 x i64> %283 to <8 x i16>
  %285 = extractelement <8 x i16> %284, i64 0
  %286 = zext i16 %285 to i32
  store i32 %286, ptr %32, align 4, !tbaa !9
  br label %287

287:                                              ; preds = %264
  br label %288

288:                                              ; preds = %287
  %289 = load i32, ptr %32, align 4, !tbaa !9
  %290 = load i32, ptr %20, align 4, !tbaa !9
  %291 = icmp sge i32 %289, %290
  br i1 %291, label %292, label %361

292:                                              ; preds = %288
  %293 = load i32, ptr %17, align 4, !tbaa !9
  %294 = icmp eq i32 %293, 0
  br i1 %294, label %306, label %295

295:                                              ; preds = %292
  %296 = load ptr, ptr %22, align 8, !tbaa !5
  %297 = load i32, ptr %17, align 4, !tbaa !9
  %298 = sub nsw i32 %297, 1
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds i64, ptr %296, i64 %299
  %301 = load i64, ptr %300, align 8, !tbaa !25
  %302 = trunc i64 %301 to i32
  %303 = add nsw i32 %302, 1
  %304 = load i32, ptr %15, align 4, !tbaa !9
  %305 = icmp ne i32 %303, %304
  br i1 %305, label %306, label %336

306:                                              ; preds = %295, %292
  %307 = load i32, ptr %17, align 4, !tbaa !9
  %308 = load i32, ptr %16, align 4, !tbaa !9
  %309 = icmp eq i32 %307, %308
  br i1 %309, label %310, label %324

310:                                              ; preds = %306
  %311 = load i32, ptr %16, align 4, !tbaa !9
  %312 = icmp ne i32 %311, 0
  br i1 %312, label %313, label %316

313:                                              ; preds = %310
  %314 = load i32, ptr %16, align 4, !tbaa !9
  %315 = shl i32 %314, 1
  br label %317

316:                                              ; preds = %310
  br label %317

317:                                              ; preds = %316, %313
  %318 = phi i32 [ %315, %313 ], [ 8, %316 ]
  store i32 %318, ptr %16, align 4, !tbaa !9
  %319 = load ptr, ptr %22, align 8, !tbaa !5
  %320 = load i32, ptr %16, align 4, !tbaa !9
  %321 = mul nsw i32 8, %320
  %322 = sext i32 %321 to i64
  %323 = call ptr @realloc(ptr noundef %319, i64 noundef %322) #8
  store ptr %323, ptr %22, align 8, !tbaa !5
  br label %324

324:                                              ; preds = %317, %306
  %325 = load i32, ptr %32, align 4, !tbaa !9
  %326 = sext i32 %325 to i64
  %327 = shl i64 %326, 32
  %328 = load i32, ptr %15, align 4, !tbaa !9
  %329 = sext i32 %328 to i64
  %330 = or i64 %327, %329
  %331 = load ptr, ptr %22, align 8, !tbaa !5
  %332 = load i32, ptr %17, align 4, !tbaa !9
  %333 = add nsw i32 %332, 1
  store i32 %333, ptr %17, align 4, !tbaa !9
  %334 = sext i32 %332 to i64
  %335 = getelementptr inbounds i64, ptr %331, i64 %334
  store i64 %330, ptr %335, align 8, !tbaa !25
  br label %360

336:                                              ; preds = %295
  %337 = load ptr, ptr %22, align 8, !tbaa !5
  %338 = load i32, ptr %17, align 4, !tbaa !9
  %339 = sub nsw i32 %338, 1
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds i64, ptr %337, i64 %340
  %342 = load i64, ptr %341, align 8, !tbaa !25
  %343 = lshr i64 %342, 32
  %344 = trunc i64 %343 to i32
  %345 = load i32, ptr %32, align 4, !tbaa !9
  %346 = icmp slt i32 %344, %345
  br i1 %346, label %347, label %359

347:                                              ; preds = %336
  %348 = load i32, ptr %32, align 4, !tbaa !9
  %349 = sext i32 %348 to i64
  %350 = shl i64 %349, 32
  %351 = load i32, ptr %15, align 4, !tbaa !9
  %352 = sext i32 %351 to i64
  %353 = or i64 %350, %352
  %354 = load ptr, ptr %22, align 8, !tbaa !5
  %355 = load i32, ptr %17, align 4, !tbaa !9
  %356 = sub nsw i32 %355, 1
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds i64, ptr %354, i64 %357
  store i64 %353, ptr %358, align 8, !tbaa !25
  br label %359

359:                                              ; preds = %347, %336
  br label %360

360:                                              ; preds = %359, %324
  br label %361

361:                                              ; preds = %360, %288
  %362 = load i32, ptr %32, align 4, !tbaa !9
  %363 = load i32, ptr %19, align 4, !tbaa !9
  %364 = icmp sgt i32 %362, %363
  br i1 %364, label %365, label %395

365:                                              ; preds = %361
  %366 = load i32, ptr %32, align 4, !tbaa !9
  store i32 %366, ptr %19, align 4, !tbaa !9
  %367 = load i32, ptr %15, align 4, !tbaa !9
  store i32 %367, ptr %18, align 4, !tbaa !9
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %368

368:                                              ; preds = %386, %365
  %369 = load i32, ptr %30, align 4, !tbaa !9
  %370 = load i32, ptr %14, align 4, !tbaa !9
  %371 = icmp slt i32 %369, %370
  %372 = zext i1 %371 to i32
  %373 = sext i32 %372 to i64
  %374 = call i64 @llvm.expect.i64(i64 %373, i64 1)
  %375 = icmp ne i64 %374, 0
  br i1 %375, label %376, label %389

376:                                              ; preds = %368
  %377 = load ptr, ptr %29, align 8, !tbaa !5
  %378 = load i32, ptr %30, align 4, !tbaa !9
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds <2 x i64>, ptr %377, i64 %379
  %381 = load ptr, ptr %27, align 8, !tbaa !5
  %382 = load i32, ptr %30, align 4, !tbaa !9
  %383 = sext i32 %382 to i64
  %384 = getelementptr inbounds <2 x i64>, ptr %381, i64 %383
  %385 = call <2 x i64> @_mm_load_si128(ptr noundef %384)
  call void @_mm_store_si128(ptr noundef %380, <2 x i64> noundef %385)
  br label %386

386:                                              ; preds = %376
  %387 = load i32, ptr %30, align 4, !tbaa !9
  %388 = add nsw i32 %387, 1
  store i32 %388, ptr %30, align 4, !tbaa !9
  br label %368, !llvm.loop !27

389:                                              ; preds = %368
  %390 = load i32, ptr %19, align 4, !tbaa !9
  %391 = load i32, ptr %21, align 4, !tbaa !9
  %392 = icmp sge i32 %390, %391
  br i1 %392, label %393, label %394

393:                                              ; preds = %389
  store i32 5, ptr %38, align 4
  br label %399

394:                                              ; preds = %389
  br label %395

395:                                              ; preds = %394, %361
  %396 = load ptr, ptr %27, align 8, !tbaa !5
  store ptr %396, ptr %37, align 8, !tbaa !5
  %397 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %397, ptr %27, align 8, !tbaa !5
  %398 = load ptr, ptr %37, align 8, !tbaa !5
  store ptr %398, ptr %26, align 8, !tbaa !5
  store i32 0, ptr %38, align 4
  br label %399

399:                                              ; preds = %395, %393
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  %400 = load i32, ptr %38, align 4
  switch i32 %400, label %512 [
    i32 0, label %401
    i32 5, label %405
  ]

401:                                              ; preds = %399
  br label %402

402:                                              ; preds = %401
  %403 = load i32, ptr %15, align 4, !tbaa !9
  %404 = add nsw i32 %403, 1
  store i32 %404, ptr %15, align 4, !tbaa !9
  br label %111, !llvm.loop !28

405:                                              ; preds = %399, %111
  %406 = load i32, ptr %19, align 4, !tbaa !9
  %407 = getelementptr inbounds %struct.kswr_t, ptr %0, i32 0, i32 0
  store i32 %406, ptr %407, align 4, !tbaa !29
  %408 = load i32, ptr %18, align 4, !tbaa !9
  %409 = getelementptr inbounds %struct.kswr_t, ptr %0, i32 0, i32 1
  store i32 %408, ptr %409, align 4, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  store i32 -1, ptr %39, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %42) #7
  %410 = load i32, ptr %14, align 4, !tbaa !9
  %411 = mul nsw i32 %410, 8
  store i32 %411, ptr %42, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #7
  %412 = load ptr, ptr %29, align 8, !tbaa !5
  store ptr %412, ptr %43, align 8, !tbaa !5
  store i32 0, ptr %15, align 4, !tbaa !9
  %413 = getelementptr inbounds %struct.kswr_t, ptr %0, i32 0, i32 2
  store i32 -1, ptr %413, align 4, !tbaa !32
  br label %414

414:                                              ; preds = %437, %405
  %415 = load i32, ptr %15, align 4, !tbaa !9
  %416 = load i32, ptr %42, align 4, !tbaa !9
  %417 = icmp slt i32 %415, %416
  br i1 %417, label %418, label %442

418:                                              ; preds = %414
  %419 = load ptr, ptr %43, align 8, !tbaa !5
  %420 = load i16, ptr %419, align 2, !tbaa !33
  %421 = zext i16 %420 to i32
  %422 = load i32, ptr %39, align 4, !tbaa !9
  %423 = icmp sgt i32 %421, %422
  br i1 %423, label %424, label %436

424:                                              ; preds = %418
  %425 = load ptr, ptr %43, align 8, !tbaa !5
  %426 = load i16, ptr %425, align 2, !tbaa !33
  %427 = zext i16 %426 to i32
  store i32 %427, ptr %39, align 4, !tbaa !9
  %428 = load i32, ptr %15, align 4, !tbaa !9
  %429 = sdiv i32 %428, 8
  %430 = load i32, ptr %15, align 4, !tbaa !9
  %431 = srem i32 %430, 8
  %432 = load i32, ptr %14, align 4, !tbaa !9
  %433 = mul nsw i32 %431, %432
  %434 = add nsw i32 %429, %433
  %435 = getelementptr inbounds %struct.kswr_t, ptr %0, i32 0, i32 2
  store i32 %434, ptr %435, align 4, !tbaa !32
  br label %436

436:                                              ; preds = %424, %418
  br label %437

437:                                              ; preds = %436
  %438 = load i32, ptr %15, align 4, !tbaa !9
  %439 = add nsw i32 %438, 1
  store i32 %439, ptr %15, align 4, !tbaa !9
  %440 = load ptr, ptr %43, align 8, !tbaa !5
  %441 = getelementptr inbounds i16, ptr %440, i32 1
  store ptr %441, ptr %43, align 8, !tbaa !5
  br label %414, !llvm.loop !35

442:                                              ; preds = %414
  %443 = load ptr, ptr %22, align 8, !tbaa !5
  %444 = icmp ne ptr %443, null
  br i1 %444, label %445, label %510

445:                                              ; preds = %442
  %446 = getelementptr inbounds %struct.kswr_t, ptr %0, i32 0, i32 0
  %447 = load i32, ptr %446, align 4, !tbaa !29
  %448 = load ptr, ptr %8, align 8, !tbaa !5
  %449 = getelementptr inbounds %struct._kswq_t, ptr %448, i32 0, i32 4
  %450 = load i8, ptr %449, align 2, !tbaa !36
  %451 = zext i8 %450 to i32
  %452 = add nsw i32 %447, %451
  %453 = sub nsw i32 %452, 1
  %454 = load ptr, ptr %8, align 8, !tbaa !5
  %455 = getelementptr inbounds %struct._kswq_t, ptr %454, i32 0, i32 4
  %456 = load i8, ptr %455, align 2, !tbaa !36
  %457 = zext i8 %456 to i32
  %458 = sdiv i32 %453, %457
  store i32 %458, ptr %15, align 4, !tbaa !9
  %459 = load i32, ptr %18, align 4, !tbaa !9
  %460 = load i32, ptr %15, align 4, !tbaa !9
  %461 = sub nsw i32 %459, %460
  store i32 %461, ptr %40, align 4, !tbaa !9
  %462 = load i32, ptr %18, align 4, !tbaa !9
  %463 = load i32, ptr %15, align 4, !tbaa !9
  %464 = add nsw i32 %462, %463
  store i32 %464, ptr %41, align 4, !tbaa !9
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %465

465:                                              ; preds = %506, %445
  %466 = load i32, ptr %15, align 4, !tbaa !9
  %467 = load i32, ptr %17, align 4, !tbaa !9
  %468 = icmp slt i32 %466, %467
  br i1 %468, label %469, label %509

469:                                              ; preds = %465
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #7
  %470 = load ptr, ptr %22, align 8, !tbaa !5
  %471 = load i32, ptr %15, align 4, !tbaa !9
  %472 = sext i32 %471 to i64
  %473 = getelementptr inbounds i64, ptr %470, i64 %472
  %474 = load i64, ptr %473, align 8, !tbaa !25
  %475 = trunc i64 %474 to i32
  store i32 %475, ptr %44, align 4, !tbaa !9
  %476 = load i32, ptr %44, align 4, !tbaa !9
  %477 = load i32, ptr %40, align 4, !tbaa !9
  %478 = icmp slt i32 %476, %477
  br i1 %478, label %483, label %479

479:                                              ; preds = %469
  %480 = load i32, ptr %44, align 4, !tbaa !9
  %481 = load i32, ptr %41, align 4, !tbaa !9
  %482 = icmp sgt i32 %480, %481
  br i1 %482, label %483, label %505

483:                                              ; preds = %479, %469
  %484 = load ptr, ptr %22, align 8, !tbaa !5
  %485 = load i32, ptr %15, align 4, !tbaa !9
  %486 = sext i32 %485 to i64
  %487 = getelementptr inbounds i64, ptr %484, i64 %486
  %488 = load i64, ptr %487, align 8, !tbaa !25
  %489 = lshr i64 %488, 32
  %490 = trunc i64 %489 to i32
  %491 = getelementptr inbounds %struct.kswr_t, ptr %0, i32 0, i32 3
  %492 = load i32, ptr %491, align 4, !tbaa !37
  %493 = icmp sgt i32 %490, %492
  br i1 %493, label %494, label %505

494:                                              ; preds = %483
  %495 = load ptr, ptr %22, align 8, !tbaa !5
  %496 = load i32, ptr %15, align 4, !tbaa !9
  %497 = sext i32 %496 to i64
  %498 = getelementptr inbounds i64, ptr %495, i64 %497
  %499 = load i64, ptr %498, align 8, !tbaa !25
  %500 = lshr i64 %499, 32
  %501 = trunc i64 %500 to i32
  %502 = getelementptr inbounds %struct.kswr_t, ptr %0, i32 0, i32 3
  store i32 %501, ptr %502, align 4, !tbaa !37
  %503 = load i32, ptr %44, align 4, !tbaa !9
  %504 = getelementptr inbounds %struct.kswr_t, ptr %0, i32 0, i32 4
  store i32 %503, ptr %504, align 4, !tbaa !38
  br label %505

505:                                              ; preds = %494, %483, %479
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #7
  br label %506

506:                                              ; preds = %505
  %507 = load i32, ptr %15, align 4, !tbaa !9
  %508 = add nsw i32 %507, 1
  store i32 %508, ptr %15, align 4, !tbaa !9
  br label %465, !llvm.loop !39

509:                                              ; preds = %465
  br label %510

510:                                              ; preds = %509, %442
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %42) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  %511 = load ptr, ptr %22, align 8, !tbaa !5
  call void @free(ptr noundef %511) #7
  store i32 1, ptr %38, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  ret void

512:                                              ; preds = %399
  unreachable
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_set1_epi16(i16 noundef signext) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_adds_epi16(<2 x i64> noundef, <2 x i64> noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_max_epi16(<2 x i64> noundef, <2 x i64> noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_subs_epu16(<2 x i64> noundef, <2 x i64> noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_cmpgt_epi16(<2 x i64> noundef, <2 x i64> noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { alwaysinline nounwind uwtable "min-legal-vector-width"="128" "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 nosync nounwind willreturn memory(none) }
attributes #4 = { nounwind allocsize(1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind uwtable "min-legal-vector-width"="128" "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 #7 = { nounwind }
attributes #8 = { nounwind allocsize(1) }

!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 = !{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}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !6, i64 24}
!14 = !{!"_kswq_t", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!14, !6, i64 32}
!16 = !{!14, !6, i64 40}
!17 = !{!14, !6, i64 48}
!18 = !{!14, !10, i64 4}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!14, !6, i64 16}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}
!24 = distinct !{!24, !20}
!25 = !{!26, !26, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = distinct !{!27, !20}
!28 = distinct !{!28, !20}
!29 = !{!30, !10, i64 0}
!30 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!31 = !{!30, !10, i64 4}
!32 = !{!30, !10, i64 8}
!33 = !{!34, !34, i64 0}
!34 = !{!"short", !7, i64 0}
!35 = distinct !{!35, !20}
!36 = !{!14, !7, i64 10}
!37 = !{!30, !10, i64 12}
!38 = !{!30, !10, i64 16}
!39 = distinct !{!39, !20}


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

%struct.kswr_t = type { i32, i32, i32, i32, i32, i32, i32 }

@g_defr = external dso_local local_unnamed_addr constant %struct.kswr_t, align 4

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_set1_epi32(i32 noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @_mm_store_si128(ptr noundef, <2 x i64> noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_load_si128(ptr noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden i32 @_mm_movemask_epi8(<2 x i64> noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 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
define dso_local void @ksw_i16(ptr dead_on_unwind noalias nocapture writable sret(%struct.kswr_t) align 4 %0, ptr nocapture noundef readonly %1, i32 noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4, i32 noundef %5, i32 noundef %6) local_unnamed_addr #4 {
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %0, ptr noundef nonnull align 4 dereferenceable(28) @g_defr, i64 28, i1 false), !tbaa.struct !5
  %8 = and i32 %6, 262144
  %.not = icmp eq i32 %8, 0
  %9 = and i32 %6, 65535
  %10 = and i32 %6, 131072
  %.not210 = icmp eq i32 %10, 0
  %11 = tail call <2 x i64> @_mm_set1_epi32(i32 noundef 0)
  %12 = add nsw i32 %5, %4
  %13 = trunc i32 %12 to i16
  %14 = tail call <2 x i64> @_mm_set1_epi16(i16 noundef signext %13)
  %15 = trunc i32 %5 to i16
  %16 = tail call <2 x i64> @_mm_set1_epi16(i16 noundef signext %15)
  %17 = getelementptr inbounds i8, ptr %1, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !10
  %19 = getelementptr inbounds i8, ptr %1, i64 32
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %1, i64 40
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  %23 = getelementptr inbounds i8, ptr %1, i64 48
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %1, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !16
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph.preheader, label %.preheader232

.lr.ph.preheader:                                 ; preds = %7
  %wide.trip.count = zext nneg i32 %26 to i64
  br label %.lr.ph

.preheader232:                                    ; preds = %.lr.ph, %7
  %28 = icmp sgt i32 %2, 0
  br i1 %28, label %.lr.ph259, label %._crit_edge260

.lr.ph259:                                        ; preds = %.preheader232
  %29 = getelementptr inbounds i8, ptr %1, i64 16
  %30 = sext i32 %26 to i64
  %wide.trip.count314 = zext nneg i32 %2 to i64
  %wide.trip.count298 = zext nneg i32 %26 to i64
  %wide.trip.count303 = zext nneg i32 %26 to i64
  %wide.trip.count309 = zext nneg i32 %26 to i64
  br label %34

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %31 = getelementptr inbounds <2 x i64>, ptr %22, i64 %indvars.iv
  tail call void @_mm_store_si128(ptr noundef %31, <2 x i64> noundef %11)
  %32 = getelementptr inbounds <2 x i64>, ptr %18, i64 %indvars.iv
  tail call void @_mm_store_si128(ptr noundef %32, <2 x i64> noundef %11)
  %33 = getelementptr inbounds <2 x i64>, ptr %24, i64 %indvars.iv
  tail call void @_mm_store_si128(ptr noundef %33, <2 x i64> noundef %11)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader232, label %.lr.ph, !llvm.loop !17

34:                                               ; preds = %.lr.ph259, %128
  %indvars.iv311 = phi i64 [ 0, %.lr.ph259 ], [ %indvars.iv.next312, %128 ]
  %.0169257 = phi i32 [ 0, %.lr.ph259 ], [ %.2171, %128 ]
  %.0172256 = phi i32 [ 0, %.lr.ph259 ], [ %.1173, %128 ]
  %.0175255 = phi i32 [ -1, %.lr.ph259 ], [ %.2177.ph, %128 ]
  %.0188254 = phi i32 [ 0, %.lr.ph259 ], [ %.2190.ph, %128 ]
  %.0192253 = phi ptr [ null, %.lr.ph259 ], [ %.2194, %128 ]
  %.0200252 = phi ptr [ %18, %.lr.ph259 ], [ %.0202250, %128 ]
  %.0202250 = phi ptr [ %20, %.lr.ph259 ], [ %.0200252, %128 ]
  %35 = load ptr, ptr %29, align 8, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %3, i64 %indvars.iv311
  %37 = load i8, ptr %36, align 1, !tbaa !20
  %38 = getelementptr inbounds <2 x i64>, ptr %.0200252, i64 %30
  %39 = getelementptr inbounds i8, ptr %38, i64 -16
  %40 = tail call <2 x i64> @_mm_load_si128(ptr noundef nonnull %39)
  br i1 %27, label %.lr.ph240.preheader, label %.loopexit229.split.us, !prof !21

.lr.ph240.preheader:                              ; preds = %34
  %41 = bitcast <2 x i64> %40 to <16 x i8>
  %42 = shufflevector <16 x i8> <i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 0, i8 0>, <16 x i8> %41, <16 x i32> <i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29>
  %43 = bitcast <16 x i8> %42 to <2 x i64>
  %44 = zext i8 %37 to i32
  %45 = mul nuw nsw i32 %26, %44
  %46 = zext nneg i32 %45 to i64
  %47 = getelementptr inbounds <2 x i64>, ptr %35, i64 %46
  br label %.lr.ph240

.preheader230:                                    ; preds = %.lr.ph240
  br i1 %27, label %.lr.ph244.us, label %.loopexit229.split.us, !prof !22

.lr.ph244.us:                                     ; preds = %.preheader230, %._crit_edge.us
  %.1185247.us = phi <2 x i64> [ %57, %._crit_edge.us ], [ %74, %.preheader230 ]
  %.0196246.us = phi i32 [ %60, %._crit_edge.us ], [ 0, %.preheader230 ]
  %48 = bitcast <2 x i64> %.1185247.us to <16 x i8>
  %49 = shufflevector <16 x i8> <i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 0, i8 0>, <16 x i8> %48, <16 x i32> <i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29>
  %50 = bitcast <16 x i8> %49 to <2 x i64>
  br label %52

51:                                               ; preds = %52
  %indvars.iv.next301 = add nuw nsw i64 %indvars.iv300, 1
  %exitcond304.not = icmp eq i64 %indvars.iv.next301, %wide.trip.count303
  br i1 %exitcond304.not, label %._crit_edge.us, label %52, !prof !23, !llvm.loop !24

52:                                               ; preds = %.lr.ph244.us, %51
  %indvars.iv300 = phi i64 [ 0, %.lr.ph244.us ], [ %indvars.iv.next301, %51 ]
  %.2186243.us = phi <2 x i64> [ %50, %.lr.ph244.us ], [ %57, %51 ]
  %53 = getelementptr inbounds <2 x i64>, ptr %.0202250, i64 %indvars.iv300
  %54 = tail call <2 x i64> @_mm_load_si128(ptr noundef %53)
  %55 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %54, <2 x i64> noundef %.2186243.us)
  tail call void @_mm_store_si128(ptr noundef %53, <2 x i64> noundef %55)
  %56 = tail call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %55, <2 x i64> noundef %14)
  %57 = tail call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %.2186243.us, <2 x i64> noundef %16)
  %58 = tail call <2 x i64> @_mm_cmpgt_epi16(<2 x i64> noundef %57, <2 x i64> noundef %56)
  %59 = tail call i32 @_mm_movemask_epi8(<2 x i64> noundef %58)
  %.not211.us = icmp eq i32 %59, 0
  br i1 %.not211.us, label %.loopexit229.split.us, label %51, !prof !25

._crit_edge.us:                                   ; preds = %51
  %60 = add nuw nsw i32 %.0196246.us, 1
  %exitcond305.not = icmp eq i32 %60, 16
  br i1 %exitcond305.not, label %.loopexit229.split.us, label %.lr.ph244.us, !prof !26, !llvm.loop !27

.lr.ph240:                                        ; preds = %.lr.ph240.preheader, %.lr.ph240
  %indvars.iv295 = phi i64 [ 0, %.lr.ph240.preheader ], [ %indvars.iv.next296, %.lr.ph240 ]
  %.0182239 = phi ptr [ %47, %.lr.ph240.preheader ], [ %61, %.lr.ph240 ]
  %.0183238 = phi <2 x i64> [ %11, %.lr.ph240.preheader ], [ %68, %.lr.ph240 ]
  %.0184237 = phi <2 x i64> [ %11, %.lr.ph240.preheader ], [ %74, %.lr.ph240 ]
  %.0187236 = phi <2 x i64> [ %43, %.lr.ph240.preheader ], [ %76, %.lr.ph240 ]
  %61 = getelementptr inbounds i8, ptr %.0182239, i64 16
  %62 = load <2 x i64>, ptr %.0182239, align 16, !tbaa !20
  %63 = tail call <2 x i64> @_mm_adds_epi16(<2 x i64> noundef %.0187236, <2 x i64> noundef %62)
  %64 = getelementptr inbounds <2 x i64>, ptr %22, i64 %indvars.iv295
  %65 = tail call <2 x i64> @_mm_load_si128(ptr noundef %64)
  %66 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %63, <2 x i64> noundef %65)
  %67 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %66, <2 x i64> noundef %.0184237)
  %68 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %.0183238, <2 x i64> noundef %67)
  %69 = getelementptr inbounds <2 x i64>, ptr %.0202250, i64 %indvars.iv295
  tail call void @_mm_store_si128(ptr noundef %69, <2 x i64> noundef %67)
  %70 = tail call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %67, <2 x i64> noundef %14)
  %71 = tail call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %65, <2 x i64> noundef %16)
  %72 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %71, <2 x i64> noundef %70)
  tail call void @_mm_store_si128(ptr noundef %64, <2 x i64> noundef %72)
  %73 = tail call <2 x i64> @_mm_subs_epu16(<2 x i64> noundef %.0184237, <2 x i64> noundef %16)
  %74 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %73, <2 x i64> noundef %70)
  %75 = getelementptr inbounds <2 x i64>, ptr %.0200252, i64 %indvars.iv295
  %76 = tail call <2 x i64> @_mm_load_si128(ptr noundef %75)
  %indvars.iv.next296 = add nuw nsw i64 %indvars.iv295, 1
  %exitcond299.not = icmp eq i64 %indvars.iv.next296, %wide.trip.count298
  br i1 %exitcond299.not, label %.preheader230, label %.lr.ph240, !prof !23, !llvm.loop !28

.loopexit229.split.us:                            ; preds = %._crit_edge.us, %52, %34, %.preheader230
  %.0183.lcssa324 = phi <2 x i64> [ %68, %.preheader230 ], [ %11, %34 ], [ %68, %52 ], [ %68, %._crit_edge.us ]
  %77 = shufflevector <2 x i64> %.0183.lcssa324, <2 x i64> <i64 0, i64 poison>, <2 x i32> <i32 1, i32 2>
  %78 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %.0183.lcssa324, <2 x i64> noundef %77)
  %79 = bitcast <2 x i64> %78 to <16 x i8>
  %80 = shufflevector <16 x i8> %79, <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison>, <16 x i32> <i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19>
  %81 = bitcast <16 x i8> %80 to <2 x i64>
  %82 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %78, <2 x i64> noundef %81)
  %83 = bitcast <2 x i64> %82 to <16 x i8>
  %84 = shufflevector <16 x i8> %83, <16 x i8> <i8 0, i8 0, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison>, <16 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17>
  %85 = bitcast <16 x i8> %84 to <2 x i64>
  %86 = tail call <2 x i64> @_mm_max_epi16(<2 x i64> noundef %82, <2 x i64> noundef %85)
  %87 = bitcast <2 x i64> %86 to <8 x i16>
  %88 = extractelement <8 x i16> %87, i64 0
  %89 = zext i16 %88 to i32
  %.not212213 = icmp ugt i32 %9, %89
  %.not212 = select i1 %.not, i1 true, i1 %.not212213
  br i1 %.not212, label %122, label %90

90:                                               ; preds = %.loopexit229.split.us
  %91 = icmp eq i32 %.0172256, 0
  br i1 %91, label %99, label %92

92:                                               ; preds = %90
  %93 = add nsw i32 %.0172256, -1
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds i64, ptr %.0192253, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !29
  %97 = add i64 %96, 1
  %98 = and i64 %97, 4294967295
  %.not214 = icmp eq i64 %98, %indvars.iv311
  br i1 %.not214, label %114, label %99

99:                                               ; preds = %92, %90
  %100 = icmp eq i32 %.0172256, %.0169257
  br i1 %100, label %101, label %107

101:                                              ; preds = %99
  %.not215 = icmp eq i32 %.0169257, 0
  %102 = shl i32 %.0169257, 1
  %103 = select i1 %.not215, i32 8, i32 %102
  %104 = shl nsw i32 %103, 3
  %105 = sext i32 %104 to i64
  %106 = tail call ptr @realloc(ptr noundef %.0192253, i64 noundef %105) #6
  br label %107

107:                                              ; preds = %101, %99
  %.1193 = phi ptr [ %106, %101 ], [ %.0192253, %99 ]
  %.1170 = phi i32 [ %103, %101 ], [ %.0169257, %99 ]
  %108 = zext i16 %88 to i64
  %109 = shl nuw nsw i64 %108, 32
  %110 = or disjoint i64 %109, %indvars.iv311
  %111 = add nsw i32 %.0172256, 1
  %112 = sext i32 %.0172256 to i64
  %113 = getelementptr inbounds i64, ptr %.1193, i64 %112
  store i64 %110, ptr %113, align 8, !tbaa !29
  br label %122

114:                                              ; preds = %92
  %115 = lshr i64 %96, 32
  %116 = trunc nuw i64 %115 to i32
  %117 = icmp slt i32 %116, %89
  br i1 %117, label %118, label %122

118:                                              ; preds = %114
  %119 = zext i16 %88 to i64
  %120 = shl nuw nsw i64 %119, 32
  %121 = or disjoint i64 %120, %indvars.iv311
  store i64 %121, ptr %95, align 8, !tbaa !29
  br label %122

122:                                              ; preds = %107, %118, %114, %.loopexit229.split.us
  %.2194 = phi ptr [ %.1193, %107 ], [ %.0192253, %118 ], [ %.0192253, %114 ], [ %.0192253, %.loopexit229.split.us ]
  %.1173 = phi i32 [ %111, %107 ], [ %.0172256, %118 ], [ %.0172256, %114 ], [ %.0172256, %.loopexit229.split.us ]
  %.2171 = phi i32 [ %.1170, %107 ], [ %.0169257, %118 ], [ %.0169257, %114 ], [ %.0169257, %.loopexit229.split.us ]
  %123 = icmp ult i32 %.0188254, %89
  br i1 %123, label %.preheader, label %128

.preheader:                                       ; preds = %122
  br i1 %27, label %.lr.ph249, label %._crit_edge, !prof !21

.lr.ph249:                                        ; preds = %.preheader, %.lr.ph249
  %indvars.iv306 = phi i64 [ %indvars.iv.next307, %.lr.ph249 ], [ 0, %.preheader ]
  %124 = getelementptr inbounds <2 x i64>, ptr %24, i64 %indvars.iv306
  %125 = getelementptr inbounds <2 x i64>, ptr %.0202250, i64 %indvars.iv306
  %126 = tail call <2 x i64> @_mm_load_si128(ptr noundef %125)
  tail call void @_mm_store_si128(ptr noundef %124, <2 x i64> noundef %126)
  %indvars.iv.next307 = add nuw nsw i64 %indvars.iv306, 1
  %exitcond310.not = icmp eq i64 %indvars.iv.next307, %wide.trip.count309
  br i1 %exitcond310.not, label %._crit_edge, label %.lr.ph249, !prof !23, !llvm.loop !31

._crit_edge:                                      ; preds = %.lr.ph249, %.preheader
  %.not216 = select i1 %.not210, i1 true, i1 %.not212213
  %127 = trunc nuw nsw i64 %indvars.iv311 to i32
  br i1 %.not216, label %128, label %._crit_edge260

128:                                              ; preds = %._crit_edge, %122
  %.2190.ph = phi i32 [ %.0188254, %122 ], [ %89, %._crit_edge ]
  %.2177.ph = phi i32 [ %.0175255, %122 ], [ %127, %._crit_edge ]
  %indvars.iv.next312 = add nuw nsw i64 %indvars.iv311, 1
  %exitcond315.not = icmp eq i64 %indvars.iv.next312, %wide.trip.count314
  br i1 %exitcond315.not, label %._crit_edge260, label %34, !llvm.loop !32

._crit_edge260:                                   ; preds = %128, %._crit_edge, %.preheader232
  %.3195 = phi ptr [ null, %.preheader232 ], [ %.2194, %._crit_edge ], [ %.2194, %128 ]
  %.3191 = phi i32 [ 0, %.preheader232 ], [ %.2190.ph, %128 ], [ %89, %._crit_edge ]
  %.3178 = phi i32 [ -1, %.preheader232 ], [ %.2177.ph, %128 ], [ %127, %._crit_edge ]
  %.2174 = phi i32 [ 0, %.preheader232 ], [ %.1173, %._crit_edge ], [ %.1173, %128 ]
  store i32 %.3191, ptr %0, align 4, !tbaa !33
  %129 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %.3178, ptr %129, align 4, !tbaa !35
  %130 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %27, label %.lr.ph274.preheader, label %._crit_edge275

.lr.ph274.preheader:                              ; preds = %._crit_edge260
  %131 = shl i32 %26, 3
  %smax = tail call i32 @llvm.smax.i32(i32 %131, i32 1)
  %xtraiter = and i32 %smax, 1
  %132 = icmp eq i32 %smax, 1
  br i1 %132, label %._crit_edge275.loopexit.unr-lcssa, label %.lr.ph274.preheader.new

.lr.ph274.preheader.new:                          ; preds = %.lr.ph274.preheader
  %unroll_iter = and i32 %smax, 2147483640
  br label %.lr.ph274

.lr.ph274:                                        ; preds = %.lr.ph274, %.lr.ph274.preheader.new
  %.2272 = phi i32 [ 0, %.lr.ph274.preheader.new ], [ %152, %.lr.ph274 ]
  %.0168271 = phi ptr [ %24, %.lr.ph274.preheader.new ], [ %153, %.lr.ph274 ]
  %.0179270 = phi i32 [ -1, %.lr.ph274.preheader.new ], [ %.1180.1, %.lr.ph274 ]
  %133 = phi i32 [ -1, %.lr.ph274.preheader.new ], [ %151, %.lr.ph274 ]
  %niter = phi i32 [ 0, %.lr.ph274.preheader.new ], [ %niter.next.1, %.lr.ph274 ]
  %134 = load i16, ptr %.0168271, align 2, !tbaa !36
  %135 = zext i16 %134 to i32
  %136 = icmp slt i32 %.0179270, %135
  %137 = lshr i32 %.2272, 3
  %138 = and i32 %.2272, 6
  %139 = mul nuw nsw i32 %138, %26
  %140 = add nuw nsw i32 %139, %137
  %141 = select i1 %136, i32 %140, i32 %133
  %.1180 = tail call i32 @llvm.smax.i32(i32 %.0179270, i32 %135)
  %142 = getelementptr inbounds i8, ptr %.0168271, i64 2
  %143 = load i16, ptr %142, align 2, !tbaa !36
  %144 = zext i16 %143 to i32
  %145 = icmp ult i32 %.1180, %144
  %146 = lshr i32 %.2272, 3
  %147 = and i32 %.2272, 6
  %148 = or disjoint i32 %147, 1
  %149 = mul nuw nsw i32 %148, %26
  %150 = add nuw nsw i32 %149, %146
  %151 = select i1 %145, i32 %150, i32 %141
  %.1180.1 = tail call i32 @llvm.smax.i32(i32 %.1180, i32 %144)
  %152 = add nuw nsw i32 %.2272, 2
  %153 = getelementptr inbounds i8, ptr %.0168271, i64 4
  %niter.next.1 = add i32 %niter, 2
  %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge275.loopexit.unr-lcssa, label %.lr.ph274, !llvm.loop !38

._crit_edge275.loopexit.unr-lcssa:                ; preds = %.lr.ph274, %.lr.ph274.preheader
  %.lcssa344.ph = phi i32 [ poison, %.lr.ph274.preheader ], [ %151, %.lr.ph274 ]
  %.2272.unr = phi i32 [ 0, %.lr.ph274.preheader ], [ %152, %.lr.ph274 ]
  %.0168271.unr = phi ptr [ %24, %.lr.ph274.preheader ], [ %153, %.lr.ph274 ]
  %.0179270.unr = phi i32 [ -1, %.lr.ph274.preheader ], [ %.1180.1, %.lr.ph274 ]
  %.unr = phi i32 [ -1, %.lr.ph274.preheader ], [ %151, %.lr.ph274 ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge275, label %.lr.ph274.epil

.lr.ph274.epil:                                   ; preds = %._crit_edge275.loopexit.unr-lcssa
  %154 = load i16, ptr %.0168271.unr, align 2, !tbaa !36
  %155 = zext i16 %154 to i32
  %156 = icmp slt i32 %.0179270.unr, %155
  %157 = lshr i32 %.2272.unr, 3
  %158 = and i32 %.2272.unr, 7
  %159 = mul nuw nsw i32 %158, %26
  %160 = add nuw nsw i32 %159, %157
  %161 = select i1 %156, i32 %160, i32 %.unr
  br label %._crit_edge275

._crit_edge275:                                   ; preds = %.lr.ph274.epil, %._crit_edge275.loopexit.unr-lcssa, %._crit_edge260
  %.lcssa = phi i32 [ -1, %._crit_edge260 ], [ %.lcssa344.ph, %._crit_edge275.loopexit.unr-lcssa ], [ %161, %.lr.ph274.epil ]
  store i32 %.lcssa, ptr %130, align 4, !tbaa !39
  %.not218 = icmp eq ptr %.3195, null
  br i1 %.not218, label %.loopexit, label %162

162:                                              ; preds = %._crit_edge275
  %163 = getelementptr inbounds i8, ptr %1, i64 10
  %164 = load i8, ptr %163, align 2, !tbaa !40
  %165 = zext i8 %164 to i32
  %166 = add nsw i32 %.3191, -1
  %167 = add nsw i32 %166, %165
  %168 = sdiv i32 %167, %165
  %169 = sub nsw i32 %.3178, %168
  %170 = add nsw i32 %168, %.3178
  %171 = icmp sgt i32 %.2174, 0
  br i1 %171, label %.lr.ph279, label %.loopexit

.lr.ph279:                                        ; preds = %162
  %172 = getelementptr inbounds i8, ptr %0, i64 12
  %173 = getelementptr inbounds i8, ptr %0, i64 16
  %.promoted280 = load i32, ptr %172, align 4, !tbaa !41
  %.promoted282 = load i32, ptr %173, align 4, !tbaa !42
  %wide.trip.count320 = zext nneg i32 %.2174 to i64
  %xtraiter351 = and i64 %wide.trip.count320, 1
  %174 = icmp eq i32 %.2174, 1
  br i1 %174, label %..loopexit_crit_edge.unr-lcssa, label %.lr.ph279.new

.lr.ph279.new:                                    ; preds = %.lr.ph279
  %unroll_iter357 = and i64 %wide.trip.count320, 2147483646
  br label %175

175:                                              ; preds = %175, %.lr.ph279.new
  %indvars.iv317 = phi i64 [ 0, %.lr.ph279.new ], [ %indvars.iv.next318.1, %175 ]
  %176 = phi i32 [ %.promoted282, %.lr.ph279.new ], [ %198, %175 ]
  %177 = phi i32 [ %.promoted280, %.lr.ph279.new ], [ %199, %175 ]
  %niter358 = phi i64 [ 0, %.lr.ph279.new ], [ %niter358.next.1, %175 ]
  %178 = getelementptr inbounds i64, ptr %.3195, i64 %indvars.iv317
  %179 = load i64, ptr %178, align 8, !tbaa !29
  %180 = trunc i64 %179 to i32
  %181 = icmp sgt i32 %169, %180
  %182 = icmp slt i32 %170, %180
  %or.cond = select i1 %181, i1 true, i1 %182
  %183 = lshr i64 %179, 32
  %184 = trunc nuw i64 %183 to i32
  %185 = icmp slt i32 %177, %184
  %spec.select284 = tail call i32 @llvm.smax.i32(i32 %177, i32 %184)
  %186 = select i1 %or.cond, i1 %185, i1 false
  %187 = select i1 %186, i32 %180, i32 %176
  %188 = select i1 %or.cond, i32 %spec.select284, i32 %177
  %indvars.iv.next318 = or disjoint i64 %indvars.iv317, 1
  %189 = getelementptr inbounds i64, ptr %.3195, i64 %indvars.iv.next318
  %190 = load i64, ptr %189, align 8, !tbaa !29
  %191 = trunc i64 %190 to i32
  %192 = icmp sgt i32 %169, %191
  %193 = icmp slt i32 %170, %191
  %or.cond.1 = select i1 %192, i1 true, i1 %193
  %194 = lshr i64 %190, 32
  %195 = trunc nuw i64 %194 to i32
  %196 = icmp slt i32 %188, %195
  %spec.select284.1 = tail call i32 @llvm.smax.i32(i32 %188, i32 %195)
  %197 = select i1 %or.cond.1, i1 %196, i1 false
  %198 = select i1 %197, i32 %191, i32 %187
  %199 = select i1 %or.cond.1, i32 %spec.select284.1, i32 %188
  %indvars.iv.next318.1 = add nuw nsw i64 %indvars.iv317, 2
  %niter358.next.1 = add i64 %niter358, 2
  %niter358.ncmp.1 = icmp eq i64 %niter358.next.1, %unroll_iter357
  br i1 %niter358.ncmp.1, label %..loopexit_crit_edge.unr-lcssa, label %175, !llvm.loop !43

..loopexit_crit_edge.unr-lcssa:                   ; preds = %175, %.lr.ph279
  %.lcssa343.ph = phi i32 [ poison, %.lr.ph279 ], [ %198, %175 ]
  %.lcssa342.ph = phi i32 [ poison, %.lr.ph279 ], [ %199, %175 ]
  %indvars.iv317.unr = phi i64 [ 0, %.lr.ph279 ], [ %indvars.iv.next318.1, %175 ]
  %.unr352 = phi i32 [ %.promoted282, %.lr.ph279 ], [ %198, %175 ]
  %.unr353 = phi i32 [ %.promoted280, %.lr.ph279 ], [ %199, %175 ]
  %lcmp.mod354.not = icmp eq i64 %xtraiter351, 0
  br i1 %lcmp.mod354.not, label %..loopexit_crit_edge, label %..loopexit_crit_edge.epilog-lcssa

..loopexit_crit_edge.epilog-lcssa:                ; preds = %..loopexit_crit_edge.unr-lcssa
  %200 = getelementptr inbounds i64, ptr %.3195, i64 %indvars.iv317.unr
  %201 = load i64, ptr %200, align 8, !tbaa !29
  %202 = trunc i64 %201 to i32
  %203 = icmp sgt i32 %169, %202
  %204 = icmp slt i32 %170, %202
  %or.cond.epil = select i1 %203, i1 true, i1 %204
  %205 = lshr i64 %201, 32
  %206 = trunc nuw i64 %205 to i32
  %207 = icmp slt i32 %.unr353, %206
  %spec.select284.epil = tail call i32 @llvm.smax.i32(i32 %.unr353, i32 %206)
  %208 = select i1 %or.cond.epil, i1 %207, i1 false
  %209 = select i1 %208, i32 %202, i32 %.unr352
  %210 = select i1 %or.cond.epil, i32 %spec.select284.epil, i32 %.unr353
  br label %..loopexit_crit_edge

..loopexit_crit_edge:                             ; preds = %..loopexit_crit_edge.unr-lcssa, %..loopexit_crit_edge.epilog-lcssa
  %.lcssa343 = phi i32 [ %.lcssa343.ph, %..loopexit_crit_edge.unr-lcssa ], [ %209, %..loopexit_crit_edge.epilog-lcssa ]
  %.lcssa342 = phi i32 [ %.lcssa342.ph, %..loopexit_crit_edge.unr-lcssa ], [ %210, %..loopexit_crit_edge.epilog-lcssa ]
  store i32 %.lcssa342, ptr %172, align 4, !tbaa !41
  store i32 %.lcssa343, ptr %173, align 4, !tbaa !42
  br label %.loopexit

.loopexit:                                        ; preds = %162, %..loopexit_crit_edge, %._crit_edge275
  tail call void @free(ptr noundef %.3195) #7
  ret void
}

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_set1_epi16(i16 noundef signext) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_adds_epi16(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_max_epi16(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_subs_epu16(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline nounwind uwtable
declare hidden <2 x i64> @_mm_cmpgt_epi16(<2 x i64> noundef, <2 x i64> noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { alwaysinline nounwind uwtable "min-legal-vector-width"="128" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = { nounwind uwtable "min-legal-vector-width"="128" "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 nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind allocsize(1) }
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 = !{i64 0, i64 4, !6, i64 4, i64 4, !6, i64 8, i64 4, !6, i64 12, i64 4, !6, i64 16, i64 4, !6, i64 20, i64 4, !6, i64 24, i64 4, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !12, i64 24}
!11 = !{!"_kswq_t", !7, i64 0, !7, i64 4, !8, i64 8, !8, i64 9, !8, i64 10, !8, i64 11, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!11, !12, i64 32}
!14 = !{!11, !12, i64 40}
!15 = !{!11, !12, i64 48}
!16 = !{!11, !7, i64 4}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!11, !12, i64 16}
!20 = !{!8, !8, i64 0}
!21 = !{!"branch_weights", i32 127, i32 1}
!22 = !{!"branch_weights", i32 -2147483648, i32 0}
!23 = !{!"branch_weights", i32 127, i32 255873}
!24 = distinct !{!24, !18}
!25 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!26 = !{!"branch_weights", i32 1, i32 1999}
!27 = distinct !{!27, !18}
!28 = distinct !{!28, !18}
!29 = !{!30, !30, i64 0}
!30 = !{!"long", !8, i64 0}
!31 = distinct !{!31, !18}
!32 = distinct !{!32, !18}
!33 = !{!34, !7, i64 0}
!34 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!35 = !{!34, !7, i64 4}
!36 = !{!37, !37, i64 0}
!37 = !{!"short", !8, i64 0}
!38 = distinct !{!38, !18}
!39 = !{!34, !7, i64 8}
!40 = !{!11, !8, i64 10}
!41 = !{!34, !7, i64 12}
!42 = !{!34, !7, i64 16}
!43 = distinct !{!43, !18}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass