; LLVM IR from tangjz/acm-icpc :: codeforces/gym/102028K.ll (Z11SuffixArrayiPcPi)

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

@_ZZ11SuffixArrayiPcPiE1x = external hidden global [100001 x i32], align 16
@_ZZ11SuffixArrayiPcPiE1y = external hidden global [100001 x i32], align 16
@_ZZ11SuffixArrayiPcPiE1c = external hidden global [100001 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z11SuffixArrayiPcPi(i32 noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 256, ptr %10, align 4, !tbaa !5
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = mul i64 %12, 4
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ11SuffixArrayiPcPiE1c, i8 0, i64 %13, i1 false)
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %32, %3
  %15 = load i32, ptr %7, align 4, !tbaa !5
  %16 = load i32, ptr %4, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %18, label %35

18:                                               ; preds = %14
  %19 = load ptr, ptr %5, align 8, !tbaa !9
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds i8, ptr %19, i64 %21
  %23 = load i8, ptr %22, align 1, !tbaa !11
  %24 = sext i8 %23 to i32
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %26
  store i32 %24, ptr %27, align 4, !tbaa !5
  %28 = sext i32 %24 to i64
  %29 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %28
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %29, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %18
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %7, align 4, !tbaa !5
  br label %14, !llvm.loop !12

35:                                               ; preds = %14
  %36 = load i32, ptr %10, align 4, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %38
  store i32 %36, ptr %39, align 4, !tbaa !5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %55, %35
  %41 = load i32, ptr %7, align 4, !tbaa !5
  %42 = load i32, ptr %10, align 4, !tbaa !5
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %44, label %58

44:                                               ; preds = %40
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = sub nsw i32 %45, 1
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load i32, ptr %7, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nsw i32 %53, %49
  store i32 %54, ptr %52, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %44
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %7, align 4, !tbaa !5
  br label %40, !llvm.loop !14

58:                                               ; preds = %40
  %59 = load i32, ptr %4, align 4, !tbaa !5
  %60 = sub nsw i32 %59, 1
  store i32 %60, ptr %7, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %77, %58
  %62 = load i32, ptr %7, align 4, !tbaa !5
  %63 = icmp sge i32 %62, 0
  br i1 %63, label %64, label %80

64:                                               ; preds = %61
  %65 = load i32, ptr %7, align 4, !tbaa !5
  %66 = load ptr, ptr %6, align 8, !tbaa !9
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !5
  %74 = add nsw i32 %73, -1
  store i32 %74, ptr %72, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i32, ptr %66, i64 %75
  store i32 %65, ptr %76, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %64
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  store i32 %79, ptr %7, align 4, !tbaa !5
  br label %61, !llvm.loop !15

80:                                               ; preds = %61
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %281, %80
  %82 = load i32, ptr %9, align 4, !tbaa !5
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = icmp sle i32 %82, %83
  br i1 %84, label %85, label %285

85:                                               ; preds = %81
  %86 = load i32, ptr %4, align 4, !tbaa !5
  %87 = load i32, ptr %9, align 4, !tbaa !5
  %88 = sub nsw i32 %86, %87
  store i32 %88, ptr %7, align 4, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %99, %85
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %93, label %102

93:                                               ; preds = %89
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = load i32, ptr %8, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %8, align 4, !tbaa !5
  %97 = sext i32 %95 to i64
  %98 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %97
  store i32 %94, ptr %98, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %93
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %7, align 4, !tbaa !5
  br label %89, !llvm.loop !16

102:                                              ; preds = %89
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %128, %102
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = load i32, ptr %4, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %131

107:                                              ; preds = %103
  %108 = load ptr, ptr %6, align 8, !tbaa !9
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds i32, ptr %108, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = icmp sge i32 %112, %113
  br i1 %114, label %115, label %127

115:                                              ; preds = %107
  %116 = load ptr, ptr %6, align 8, !tbaa !9
  %117 = load i32, ptr %7, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr %116, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !5
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sub nsw i32 %120, %121
  %123 = load i32, ptr %8, align 4, !tbaa !5
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %8, align 4, !tbaa !5
  %125 = sext i32 %123 to i64
  %126 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %125
  store i32 %122, ptr %126, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %115, %107
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %7, align 4, !tbaa !5
  br label %103, !llvm.loop !17

131:                                              ; preds = %103
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = mul i64 %133, 4
  call void @llvm.memset.p0.i64(ptr align 16 @_ZZ11SuffixArrayiPcPiE1c, i8 0, i64 %134, i1 false)
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %151, %131
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = load i32, ptr %4, align 4, !tbaa !5
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %139, label %154

139:                                              ; preds = %135
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %148, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %139
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %7, align 4, !tbaa !5
  br label %135, !llvm.loop !18

154:                                              ; preds = %135
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %155

155:                                              ; preds = %170, %154
  %156 = load i32, ptr %7, align 4, !tbaa !5
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = icmp slt i32 %156, %157
  br i1 %158, label %159, label %173

159:                                              ; preds = %155
  %160 = load i32, ptr %7, align 4, !tbaa !5
  %161 = sub nsw i32 %160, 1
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %162
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = load i32, ptr %7, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = add nsw i32 %168, %164
  store i32 %169, ptr %167, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %159
  %171 = load i32, ptr %7, align 4, !tbaa !5
  %172 = add nsw i32 %171, 1
  store i32 %172, ptr %7, align 4, !tbaa !5
  br label %155, !llvm.loop !19

173:                                              ; preds = %155
  %174 = load i32, ptr %4, align 4, !tbaa !5
  %175 = sub nsw i32 %174, 1
  store i32 %175, ptr %7, align 4, !tbaa !5
  br label %176

176:                                              ; preds = %198, %173
  %177 = load i32, ptr %7, align 4, !tbaa !5
  %178 = icmp sge i32 %177, 0
  br i1 %178, label %179, label %201

179:                                              ; preds = %176
  %180 = load i32, ptr %7, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = load ptr, ptr %6, align 8, !tbaa !9
  %185 = load i32, ptr %7, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !5
  %195 = add nsw i32 %194, -1
  store i32 %195, ptr %193, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds i32, ptr %184, i64 %196
  store i32 %183, ptr %197, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %179
  %199 = load i32, ptr %7, align 4, !tbaa !5
  %200 = add nsw i32 %199, -1
  store i32 %200, ptr %7, align 4, !tbaa !5
  br label %176, !llvm.loop !20

201:                                              ; preds = %176
  call void @_ZSt4swapIiLm100001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 4 dereferenceable(400004) @_ZZ11SuffixArrayiPcPiE1x, ptr noundef nonnull align 4 dereferenceable(400004) @_ZZ11SuffixArrayiPcPiE1y) #4
  store i32 1, ptr %8, align 4, !tbaa !5
  store i32 1, ptr %7, align 4, !tbaa !5
  %202 = load ptr, ptr %6, align 8, !tbaa !9
  %203 = getelementptr inbounds i32, ptr %202, i64 0
  %204 = load i32, ptr %203, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %205
  store i32 0, ptr %206, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %268, %201
  %208 = load i32, ptr %7, align 4, !tbaa !5
  %209 = load i32, ptr %4, align 4, !tbaa !5
  %210 = icmp slt i32 %208, %209
  br i1 %210, label %211, label %271

211:                                              ; preds = %207
  %212 = load ptr, ptr %6, align 8, !tbaa !9
  %213 = load i32, ptr %7, align 4, !tbaa !5
  %214 = sub nsw i32 %213, 1
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds i32, ptr %212, i64 %215
  %217 = load i32, ptr %216, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %218
  %220 = load i32, ptr %219, align 4, !tbaa !5
  %221 = load ptr, ptr %6, align 8, !tbaa !9
  %222 = load i32, ptr %7, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds i32, ptr %221, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  %229 = icmp eq i32 %220, %228
  br i1 %229, label %230, label %256

230:                                              ; preds = %211
  %231 = load ptr, ptr %6, align 8, !tbaa !9
  %232 = load i32, ptr %7, align 4, !tbaa !5
  %233 = sub nsw i32 %232, 1
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds i32, ptr %231, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = load i32, ptr %9, align 4, !tbaa !5
  %238 = add nsw i32 %236, %237
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = load ptr, ptr %6, align 8, !tbaa !9
  %243 = load i32, ptr %7, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds i32, ptr %242, i64 %244
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = load i32, ptr %9, align 4, !tbaa !5
  %248 = add nsw i32 %246, %247
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %249
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = icmp eq i32 %241, %251
  br i1 %252, label %253, label %256

253:                                              ; preds = %230
  %254 = load i32, ptr %8, align 4, !tbaa !5
  %255 = sub nsw i32 %254, 1
  br label %259

256:                                              ; preds = %230, %211
  %257 = load i32, ptr %8, align 4, !tbaa !5
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %8, align 4, !tbaa !5
  br label %259

259:                                              ; preds = %256, %253
  %260 = phi i32 [ %255, %253 ], [ %257, %256 ]
  %261 = load ptr, ptr %6, align 8, !tbaa !9
  %262 = load i32, ptr %7, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds i32, ptr %261, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %266
  store i32 %260, ptr %267, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %259
  %269 = load i32, ptr %7, align 4, !tbaa !5
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %7, align 4, !tbaa !5
  br label %207, !llvm.loop !21

271:                                              ; preds = %207
  %272 = load i32, ptr %8, align 4, !tbaa !5
  %273 = load i32, ptr %4, align 4, !tbaa !5
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %274
  store i32 %272, ptr %275, align 4, !tbaa !5
  %276 = load i32, ptr %8, align 4, !tbaa !5
  %277 = load i32, ptr %4, align 4, !tbaa !5
  %278 = icmp sge i32 %276, %277
  br i1 %278, label %279, label %280

279:                                              ; preds = %271
  br label %285

280:                                              ; preds = %271
  br label %281

281:                                              ; preds = %280
  %282 = load i32, ptr %9, align 4, !tbaa !5
  %283 = shl i32 %282, 1
  store i32 %283, ptr %9, align 4, !tbaa !5
  %284 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %284, ptr %10, align 4, !tbaa !5
  br label %81, !llvm.loop !22

285:                                              ; preds = %279, %81
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiLm100001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 4 dereferenceable(400004), ptr noundef nonnull align 4 dereferenceable(400004)) #3

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

attributes #0 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { inlinehint mustprogress 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}


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

@_ZZ11SuffixArrayiPcPiE1x = external hidden global [100001 x i32], align 16
@_ZZ11SuffixArrayiPcPiE1y = external hidden global [100001 x i32], align 16
@_ZZ11SuffixArrayiPcPiE1c = external hidden local_unnamed_addr global [100001 x i32], align 16

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z11SuffixArrayiPcPi(i32 noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef %2) local_unnamed_addr #0 {
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) @_ZZ11SuffixArrayiPcPiE1c, i8 0, i64 1024, i1 false)
  %4 = icmp sgt i32 %0, 0
  br i1 %4, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext nneg i32 %0 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %5 = icmp eq i32 %0, 1
  br i1 %5, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 2147483646
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %6 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv
  %7 = load i8, ptr %6, align 1, !tbaa !5
  %8 = sext i8 %7 to i32
  %9 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %indvars.iv
  store i32 %8, ptr %9, align 8, !tbaa !8
  %10 = sext i8 %7 to i64
  %11 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %10
  %12 = load i32, ptr %11, align 4, !tbaa !8
  %13 = add nsw i32 %12, 1
  store i32 %13, ptr %11, align 4, !tbaa !8
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %14 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.next
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %16 = sext i8 %15 to i32
  %17 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %indvars.iv.next
  store i32 %16, ptr %17, align 4, !tbaa !8
  %18 = sext i8 %15 to i64
  %19 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %18
  %20 = load i32, ptr %19, align 4, !tbaa !8
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %19, align 4, !tbaa !8
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !10

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa
  %22 = getelementptr inbounds i8, ptr %1, i64 %indvars.iv.unr
  %23 = load i8, ptr %22, align 1, !tbaa !5
  %24 = sext i8 %23 to i32
  %25 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %indvars.iv.unr
  store i32 %24, ptr %25, align 4, !tbaa !8
  %26 = sext i8 %23 to i64
  %27 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !8
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %27, align 4, !tbaa !8
  br label %._crit_edge.loopexit

._crit_edge.loopexit:                             ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %.pre.pre = load i32, ptr @_ZZ11SuffixArrayiPcPiE1c, align 16, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %3
  %.pre = phi i32 [ %.pre.pre, %._crit_edge.loopexit ], [ 0, %3 ]
  %30 = sext i32 %0 to i64
  %31 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %30
  store i32 256, ptr %31, align 4, !tbaa !8
  br label %32

32:                                               ; preds = %32, %._crit_edge
  %33 = phi i32 [ %.pre, %._crit_edge ], [ %48, %32 ]
  %indvars.iv127 = phi i64 [ 1, %._crit_edge ], [ %indvars.iv.next128.4, %32 ]
  %34 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv127
  %35 = load i32, ptr %34, align 4, !tbaa !8
  %36 = add nsw i32 %35, %33
  store i32 %36, ptr %34, align 4, !tbaa !8
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %37 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv.next128
  %38 = load i32, ptr %37, align 4, !tbaa !8
  %39 = add nsw i32 %38, %36
  store i32 %39, ptr %37, align 4, !tbaa !8
  %indvars.iv.next128.1 = add nuw nsw i64 %indvars.iv127, 2
  %40 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv.next128.1
  %41 = load i32, ptr %40, align 4, !tbaa !8
  %42 = add nsw i32 %41, %39
  store i32 %42, ptr %40, align 4, !tbaa !8
  %indvars.iv.next128.2 = add nuw nsw i64 %indvars.iv127, 3
  %43 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv.next128.2
  %44 = load i32, ptr %43, align 4, !tbaa !8
  %45 = add nsw i32 %44, %42
  store i32 %45, ptr %43, align 4, !tbaa !8
  %indvars.iv.next128.3 = add nuw nsw i64 %indvars.iv127, 4
  %46 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv.next128.3
  %47 = load i32, ptr %46, align 4, !tbaa !8
  %48 = add nsw i32 %47, %45
  store i32 %48, ptr %46, align 4, !tbaa !8
  %indvars.iv.next128.4 = add nuw nsw i64 %indvars.iv127, 5
  %exitcond130.not.4 = icmp eq i64 %indvars.iv.next128.4, 256
  br i1 %exitcond130.not.4, label %49, label %32, !llvm.loop !12

49:                                               ; preds = %32
  %50 = add i32 %0, -1
  br i1 %4, label %.lr.ph96.preheader, label %._crit_edge123

.lr.ph96.preheader:                               ; preds = %49
  %51 = zext i32 %50 to i64
  %52 = zext nneg i32 %0 to i64
  %xtraiter168 = and i64 %52, 1
  %lcmp.mod169.not = icmp eq i64 %xtraiter168, 0
  br i1 %lcmp.mod169.not, label %.lr.ph96.prol.loopexit, label %.lr.ph96.prol

.lr.ph96.prol:                                    ; preds = %.lr.ph96.preheader
  %53 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %51
  %54 = load i32, ptr %53, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !8
  %58 = add nsw i32 %57, -1
  store i32 %58, ptr %56, align 4, !tbaa !8
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds i32, ptr %2, i64 %59
  store i32 %50, ptr %60, align 4, !tbaa !8
  %indvars.iv.next132.prol = add nsw i64 %51, -1
  br label %.lr.ph96.prol.loopexit

.lr.ph96.prol.loopexit:                           ; preds = %.lr.ph96.prol, %.lr.ph96.preheader
  %indvars.iv131.unr = phi i64 [ %51, %.lr.ph96.preheader ], [ %indvars.iv.next132.prol, %.lr.ph96.prol ]
  %61 = icmp eq i32 %50, 0
  br i1 %61, label %.lr.ph122, label %.lr.ph96

.lr.ph122:                                        ; preds = %.lr.ph96, %.lr.ph96.prol.loopexit
  %.not125 = icmp eq i32 %0, 1
  %62 = zext nneg i32 %50 to i64
  %wide.trip.count140 = zext nneg i32 %0 to i64
  %wide.trip.count158 = zext nneg i32 %0 to i64
  %63 = xor i32 %0, -1
  %64 = add nuw i32 %0, 1
  %65 = add nsw i64 %wide.trip.count140, -1
  %xtraiter170 = and i64 %wide.trip.count140, 1
  %66 = icmp eq i64 %65, 0
  %unroll_iter172 = and i64 %wide.trip.count140, 2147483646
  %lcmp.mod171.not = icmp eq i64 %xtraiter170, 0
  %xtraiter174 = and i64 %wide.trip.count140, 1
  %67 = icmp eq i64 %65, 0
  %unroll_iter176 = and i64 %wide.trip.count140, 2147483646
  %lcmp.mod175.not = icmp eq i64 %xtraiter174, 0
  %xtraiter182 = and i64 %52, 1
  %lcmp.mod183.not = icmp eq i64 %xtraiter182, 0
  %68 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %62
  %indvars.iv.next153.prol = add nsw i64 %62, -1
  %69 = icmp eq i32 %50, 0
  br label %88

.lr.ph96:                                         ; preds = %.lr.ph96.prol.loopexit, %.lr.ph96
  %indvars.iv131 = phi i64 [ %indvars.iv.next132.1, %.lr.ph96 ], [ %indvars.iv131.unr, %.lr.ph96.prol.loopexit ]
  %70 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %indvars.iv131
  %71 = load i32, ptr %70, align 4, !tbaa !8
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !8
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %73, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr %2, i64 %76
  %78 = trunc nuw nsw i64 %indvars.iv131 to i32
  store i32 %78, ptr %77, align 4, !tbaa !8
  %indvars.iv.next132 = add nsw i64 %indvars.iv131, -1
  %79 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %indvars.iv.next132
  %80 = load i32, ptr %79, align 4, !tbaa !8
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !8
  %84 = add nsw i32 %83, -1
  store i32 %84, ptr %82, align 4, !tbaa !8
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i32, ptr %2, i64 %85
  %87 = trunc nuw nsw i64 %indvars.iv.next132 to i32
  store i32 %87, ptr %86, align 4, !tbaa !8
  %indvars.iv.next132.1 = add nsw i64 %indvars.iv131, -2
  %.not163.1 = icmp eq i64 %indvars.iv.next132, 0
  br i1 %.not163.1, label %.lr.ph122, label %.lr.ph96, !llvm.loop !13

88:                                               ; preds = %._crit_edge117, %.lr.ph122
  %.0121 = phi i32 [ 256, %.lr.ph122 ], [ %.3.lcssa, %._crit_edge117 ]
  %.078120 = phi i32 [ 1, %.lr.ph122 ], [ %238, %._crit_edge117 ]
  %89 = icmp sgt i32 %.078120, 0
  br i1 %89, label %.lr.ph100.preheader, label %.lr.ph103.preheader

.lr.ph100.preheader:                              ; preds = %88
  %90 = sub nsw i32 %0, %.078120
  %91 = add nsw i32 %.078120, %63
  %92 = sub i32 %64, %.078120
  %smax = tail call i32 @llvm.smax.i32(i32 %0, i32 %92)
  %93 = add i32 %91, %smax
  %94 = zext i32 %93 to i64
  %95 = add nuw nsw i64 %94, 1
  %min.iters.check = icmp ult i32 %93, 7
  br i1 %min.iters.check, label %.lr.ph100.preheader166, label %vector.ph

.lr.ph100.preheader166:                           ; preds = %middle.block, %.lr.ph100.preheader
  %indvars.iv134.ph = phi i64 [ 0, %.lr.ph100.preheader ], [ %n.vec, %middle.block ]
  %.38397.ph = phi i32 [ %90, %.lr.ph100.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph100

vector.ph:                                        ; preds = %.lr.ph100.preheader
  %n.vec = and i64 %95, 8589934584
  %.cast = trunc i64 %n.vec to i32
  %ind.end = add i32 %90, %.cast
  %.splatinsert = insertelement <4 x i32> poison, i32 %90, i64 0
  %.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  %induction = add <4 x i32> %.splat, <i32 0, i32 1, i32 2, i32 3>
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ %induction, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %96 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %index
  %97 = getelementptr inbounds i8, ptr %96, i64 16
  store <4 x i32> %vec.ind, ptr %96, align 16, !tbaa !8
  store <4 x i32> %step.add, ptr %97, align 16, !tbaa !8
  %index.next = add nuw i64 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %98 = icmp eq i64 %index.next, %n.vec
  br i1 %98, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %95, %n.vec
  br i1 %cmp.n, label %.preheader90.loopexit, label %.lr.ph100.preheader166

.preheader90.loopexit:                            ; preds = %.lr.ph100, %middle.block
  %indvars.iv.next135.lcssa = phi i64 [ %n.vec, %middle.block ], [ %indvars.iv.next135, %.lr.ph100 ]
  %99 = trunc nuw i64 %indvars.iv.next135.lcssa to i32
  br label %.lr.ph103.preheader

.lr.ph103.preheader:                              ; preds = %88, %.preheader90.loopexit
  %.1102.ph = phi i32 [ %99, %.preheader90.loopexit ], [ 0, %88 ]
  br i1 %66, label %.lr.ph107.preheader.unr-lcssa, label %.lr.ph103

.lr.ph100:                                        ; preds = %.lr.ph100.preheader166, %.lr.ph100
  %indvars.iv134 = phi i64 [ %indvars.iv.next135, %.lr.ph100 ], [ %indvars.iv134.ph, %.lr.ph100.preheader166 ]
  %.38397 = phi i32 [ %101, %.lr.ph100 ], [ %.38397.ph, %.lr.ph100.preheader166 ]
  %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1
  %100 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %indvars.iv134
  store i32 %.38397, ptr %100, align 4, !tbaa !8
  %101 = add nsw i32 %.38397, 1
  %102 = icmp slt i32 %101, %0
  br i1 %102, label %.lr.ph100, label %.preheader90.loopexit, !llvm.loop !17

.lr.ph103:                                        ; preds = %.lr.ph103.preheader, %117
  %indvars.iv137 = phi i64 [ %indvars.iv.next138.1, %117 ], [ 0, %.lr.ph103.preheader ]
  %.1102 = phi i32 [ %.2.1, %117 ], [ %.1102.ph, %.lr.ph103.preheader ]
  %niter173 = phi i64 [ %niter173.next.1, %117 ], [ 0, %.lr.ph103.preheader ]
  %103 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv137
  %104 = load i32, ptr %103, align 4, !tbaa !8
  %.not88 = icmp slt i32 %104, %.078120
  br i1 %.not88, label %.lr.ph103.1, label %105

105:                                              ; preds = %.lr.ph103
  %106 = sub nsw i32 %104, %.078120
  %107 = add nsw i32 %.1102, 1
  %108 = sext i32 %.1102 to i64
  %109 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %108
  store i32 %106, ptr %109, align 4, !tbaa !8
  br label %.lr.ph103.1

.lr.ph103.1:                                      ; preds = %.lr.ph103, %105
  %.2 = phi i32 [ %107, %105 ], [ %.1102, %.lr.ph103 ]
  %indvars.iv.next138 = or disjoint i64 %indvars.iv137, 1
  %110 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv.next138
  %111 = load i32, ptr %110, align 4, !tbaa !8
  %.not88.1 = icmp slt i32 %111, %.078120
  br i1 %.not88.1, label %117, label %112

112:                                              ; preds = %.lr.ph103.1
  %113 = sub nsw i32 %111, %.078120
  %114 = add nsw i32 %.2, 1
  %115 = sext i32 %.2 to i64
  %116 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %115
  store i32 %113, ptr %116, align 4, !tbaa !8
  br label %117

117:                                              ; preds = %112, %.lr.ph103.1
  %.2.1 = phi i32 [ %114, %112 ], [ %.2, %.lr.ph103.1 ]
  %indvars.iv.next138.1 = add nuw nsw i64 %indvars.iv137, 2
  %niter173.next.1 = add i64 %niter173, 2
  %niter173.ncmp.1 = icmp eq i64 %niter173.next.1, %unroll_iter172
  br i1 %niter173.ncmp.1, label %.lr.ph107.preheader.unr-lcssa, label %.lr.ph103, !llvm.loop !18

.lr.ph107.preheader.unr-lcssa:                    ; preds = %117, %.lr.ph103.preheader
  %indvars.iv137.unr = phi i64 [ 0, %.lr.ph103.preheader ], [ %indvars.iv.next138.1, %117 ]
  %.1102.unr = phi i32 [ %.1102.ph, %.lr.ph103.preheader ], [ %.2.1, %117 ]
  br i1 %lcmp.mod171.not, label %.lr.ph107.preheader, label %.lr.ph103.epil

.lr.ph103.epil:                                   ; preds = %.lr.ph107.preheader.unr-lcssa
  %118 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv137.unr
  %119 = load i32, ptr %118, align 4, !tbaa !8
  %.not88.epil = icmp slt i32 %119, %.078120
  br i1 %.not88.epil, label %.lr.ph107.preheader, label %120

120:                                              ; preds = %.lr.ph103.epil
  %121 = sub nsw i32 %119, %.078120
  %122 = sext i32 %.1102.unr to i64
  %123 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %122
  store i32 %121, ptr %123, align 4, !tbaa !8
  br label %.lr.ph107.preheader

.lr.ph107.preheader:                              ; preds = %.lr.ph103.epil, %120, %.lr.ph107.preheader.unr-lcssa
  %124 = sext i32 %.0121 to i64
  %125 = shl nsw i64 %124, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @_ZZ11SuffixArrayiPcPiE1c, i8 0, i64 %125, i1 false)
  br i1 %67, label %.preheader89.unr-lcssa, label %.lr.ph107

.preheader89.unr-lcssa:                           ; preds = %.lr.ph107, %.lr.ph107.preheader
  %indvars.iv142.unr = phi i64 [ 0, %.lr.ph107.preheader ], [ %indvars.iv.next143.1, %.lr.ph107 ]
  br i1 %lcmp.mod175.not, label %.preheader89, label %.lr.ph107.epil

.lr.ph107.epil:                                   ; preds = %.preheader89.unr-lcssa
  %126 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %indvars.iv142.unr
  %127 = load i32, ptr %126, align 4, !tbaa !8
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !8
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !8
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %132, align 4, !tbaa !8
  br label %.preheader89

.preheader89:                                     ; preds = %.preheader89.unr-lcssa, %.lr.ph107.epil
  %135 = icmp sgt i32 %.0121, 1
  br i1 %135, label %.lr.ph109.preheader, label %.lr.ph111.preheader

.lr.ph109.preheader:                              ; preds = %.preheader89
  %wide.trip.count150 = zext nneg i32 %.0121 to i64
  %.pre160 = load i32, ptr @_ZZ11SuffixArrayiPcPiE1c, align 16, !tbaa !8
  %136 = add nsw i64 %wide.trip.count150, -1
  %137 = add nsw i64 %wide.trip.count150, -2
  %xtraiter178 = and i64 %136, 3
  %138 = icmp ult i64 %137, 3
  br i1 %138, label %.lr.ph111.preheader.loopexit.unr-lcssa, label %.lr.ph109.preheader.new

.lr.ph109.preheader.new:                          ; preds = %.lr.ph109.preheader
  %unroll_iter180 = and i64 %136, -4
  br label %.lr.ph109

.lr.ph107:                                        ; preds = %.lr.ph107.preheader, %.lr.ph107
  %indvars.iv142 = phi i64 [ %indvars.iv.next143.1, %.lr.ph107 ], [ 0, %.lr.ph107.preheader ]
  %niter177 = phi i64 [ %niter177.next.1, %.lr.ph107 ], [ 0, %.lr.ph107.preheader ]
  %139 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %indvars.iv142
  %140 = load i32, ptr %139, align 8, !tbaa !8
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !8
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !8
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %145, align 4, !tbaa !8
  %indvars.iv.next143 = or disjoint i64 %indvars.iv142, 1
  %148 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %indvars.iv.next143
  %149 = load i32, ptr %148, align 4, !tbaa !8
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !8
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !8
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %154, align 4, !tbaa !8
  %indvars.iv.next143.1 = add nuw nsw i64 %indvars.iv142, 2
  %niter177.next.1 = add i64 %niter177, 2
  %niter177.ncmp.1 = icmp eq i64 %niter177.next.1, %unroll_iter176
  br i1 %niter177.ncmp.1, label %.preheader89.unr-lcssa, label %.lr.ph107, !llvm.loop !19

.lr.ph109:                                        ; preds = %.lr.ph109, %.lr.ph109.preheader.new
  %157 = phi i32 [ %.pre160, %.lr.ph109.preheader.new ], [ %169, %.lr.ph109 ]
  %indvars.iv147 = phi i64 [ 1, %.lr.ph109.preheader.new ], [ %indvars.iv.next148.3, %.lr.ph109 ]
  %niter181 = phi i64 [ 0, %.lr.ph109.preheader.new ], [ %niter181.next.3, %.lr.ph109 ]
  %158 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv147
  %159 = load i32, ptr %158, align 4, !tbaa !8
  %160 = add nsw i32 %159, %157
  store i32 %160, ptr %158, align 4, !tbaa !8
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %161 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv.next148
  %162 = load i32, ptr %161, align 4, !tbaa !8
  %163 = add nsw i32 %162, %160
  store i32 %163, ptr %161, align 4, !tbaa !8
  %indvars.iv.next148.1 = add nuw nsw i64 %indvars.iv147, 2
  %164 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv.next148.1
  %165 = load i32, ptr %164, align 4, !tbaa !8
  %166 = add nsw i32 %165, %163
  store i32 %166, ptr %164, align 4, !tbaa !8
  %indvars.iv.next148.2 = add nuw nsw i64 %indvars.iv147, 3
  %167 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv.next148.2
  %168 = load i32, ptr %167, align 4, !tbaa !8
  %169 = add nsw i32 %168, %166
  store i32 %169, ptr %167, align 4, !tbaa !8
  %indvars.iv.next148.3 = add nuw nsw i64 %indvars.iv147, 4
  %niter181.next.3 = add i64 %niter181, 4
  %niter181.ncmp.3 = icmp eq i64 %niter181.next.3, %unroll_iter180
  br i1 %niter181.ncmp.3, label %.lr.ph111.preheader.loopexit.unr-lcssa, label %.lr.ph109, !llvm.loop !20

.lr.ph111.preheader.loopexit.unr-lcssa:           ; preds = %.lr.ph109, %.lr.ph109.preheader
  %.unr = phi i32 [ %.pre160, %.lr.ph109.preheader ], [ %169, %.lr.ph109 ]
  %indvars.iv147.unr = phi i64 [ 1, %.lr.ph109.preheader ], [ %indvars.iv.next148.3, %.lr.ph109 ]
  %lcmp.mod179.not = icmp eq i64 %xtraiter178, 0
  br i1 %lcmp.mod179.not, label %.lr.ph111.preheader, label %.lr.ph109.epil

.lr.ph109.epil:                                   ; preds = %.lr.ph111.preheader.loopexit.unr-lcssa, %.lr.ph109.epil
  %170 = phi i32 [ %173, %.lr.ph109.epil ], [ %.unr, %.lr.ph111.preheader.loopexit.unr-lcssa ]
  %indvars.iv147.epil = phi i64 [ %indvars.iv.next148.epil, %.lr.ph109.epil ], [ %indvars.iv147.unr, %.lr.ph111.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph109.epil ], [ 0, %.lr.ph111.preheader.loopexit.unr-lcssa ]
  %171 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %indvars.iv147.epil
  %172 = load i32, ptr %171, align 4, !tbaa !8
  %173 = add nsw i32 %172, %170
  store i32 %173, ptr %171, align 4, !tbaa !8
  %indvars.iv.next148.epil = add nuw nsw i64 %indvars.iv147.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter178
  br i1 %epil.iter.cmp.not, label %.lr.ph111.preheader, label %.lr.ph109.epil, !llvm.loop !21

.lr.ph111.preheader:                              ; preds = %.lr.ph111.preheader.loopexit.unr-lcssa, %.lr.ph109.epil, %.preheader89
  br i1 %lcmp.mod183.not, label %.lr.ph111.prol.loopexit, label %.lr.ph111.prol

.lr.ph111.prol:                                   ; preds = %.lr.ph111.preheader
  %174 = load i32, ptr %68, align 4, !tbaa !8
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !8
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %178
  %180 = load i32, ptr %179, align 4, !tbaa !8
  %181 = add nsw i32 %180, -1
  store i32 %181, ptr %179, align 4, !tbaa !8
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds i32, ptr %2, i64 %182
  store i32 %174, ptr %183, align 4, !tbaa !8
  br label %.lr.ph111.prol.loopexit

.lr.ph111.prol.loopexit:                          ; preds = %.lr.ph111.prol, %.lr.ph111.preheader
  %indvars.iv152.unr = phi i64 [ %62, %.lr.ph111.preheader ], [ %indvars.iv.next153.prol, %.lr.ph111.prol ]
  br i1 %69, label %._crit_edge112, label %.lr.ph111

.lr.ph111:                                        ; preds = %.lr.ph111.prol.loopexit, %.lr.ph111
  %indvars.iv152 = phi i64 [ %indvars.iv.next153.1, %.lr.ph111 ], [ %indvars.iv152.unr, %.lr.ph111.prol.loopexit ]
  %184 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %indvars.iv152
  %185 = load i32, ptr %184, align 4, !tbaa !8
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !8
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !8
  %192 = add nsw i32 %191, -1
  store i32 %192, ptr %190, align 4, !tbaa !8
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i32, ptr %2, i64 %193
  store i32 %185, ptr %194, align 4, !tbaa !8
  %indvars.iv.next153 = add nsw i64 %indvars.iv152, -1
  %195 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %indvars.iv.next153
  %196 = load i32, ptr %195, align 4, !tbaa !8
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !8
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1c, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !8
  %203 = add nsw i32 %202, -1
  store i32 %203, ptr %201, align 4, !tbaa !8
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds i32, ptr %2, i64 %204
  store i32 %196, ptr %205, align 4, !tbaa !8
  %indvars.iv.next153.1 = add nsw i64 %indvars.iv152, -2
  %206 = icmp sgt i64 %indvars.iv152, 1
  br i1 %206, label %.lr.ph111, label %._crit_edge112, !llvm.loop !23

._crit_edge112:                                   ; preds = %.lr.ph111, %.lr.ph111.prol.loopexit
  tail call void @_ZSt4swapIiLm100001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 4 dereferenceable(400004) @_ZZ11SuffixArrayiPcPiE1x, ptr noundef nonnull align 4 dereferenceable(400004) @_ZZ11SuffixArrayiPcPiE1y) #4
  %207 = load i32, ptr %2, align 4, !tbaa !8
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %208
  store i32 0, ptr %209, align 4, !tbaa !8
  br i1 %.not125, label %._crit_edge117, label %.lr.ph116

.lr.ph116:                                        ; preds = %._crit_edge112, %235
  %indvars.iv155 = phi i64 [ %indvars.iv.next156, %235 ], [ 1, %._crit_edge112 ]
  %.3114 = phi i32 [ %.4, %235 ], [ 1, %._crit_edge112 ]
  %210 = getelementptr i32, ptr %2, i64 %indvars.iv155
  %211 = getelementptr i8, ptr %210, i64 -4
  %212 = load i32, ptr %211, align 4, !tbaa !8
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !8
  %216 = load i32, ptr %210, align 4, !tbaa !8
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %217
  %219 = load i32, ptr %218, align 4, !tbaa !8
  %220 = icmp eq i32 %215, %219
  br i1 %220, label %221, label %233

221:                                              ; preds = %.lr.ph116
  %222 = add nsw i32 %212, %.078120
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !8
  %226 = add nsw i32 %216, %.078120
  %227 = sext i32 %226 to i64
  %228 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1y, i64 0, i64 %227
  %229 = load i32, ptr %228, align 4, !tbaa !8
  %230 = icmp eq i32 %225, %229
  br i1 %230, label %231, label %233

231:                                              ; preds = %221
  %232 = add nsw i32 %.3114, -1
  br label %235

233:                                              ; preds = %221, %.lr.ph116
  %234 = add nsw i32 %.3114, 1
  br label %235

235:                                              ; preds = %233, %231
  %.4 = phi i32 [ %.3114, %231 ], [ %234, %233 ]
  %236 = phi i32 [ %232, %231 ], [ %.3114, %233 ]
  %237 = getelementptr inbounds [100001 x i32], ptr @_ZZ11SuffixArrayiPcPiE1x, i64 0, i64 %217
  store i32 %236, ptr %237, align 4, !tbaa !8
  %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
  %exitcond159.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count158
  br i1 %exitcond159.not, label %._crit_edge117, label %.lr.ph116, !llvm.loop !24

._crit_edge117:                                   ; preds = %235, %._crit_edge112
  %.3.lcssa = phi i32 [ 1, %._crit_edge112 ], [ %.4, %235 ]
  store i32 %.3.lcssa, ptr %31, align 4, !tbaa !8
  %.not87 = icmp sge i32 %.3.lcssa, %0
  %238 = shl i32 %.078120, 1
  %.not = icmp sgt i32 %238, %0
  %or.cond = or i1 %.not87, %.not
  br i1 %or.cond, label %._crit_edge123, label %88, !llvm.loop !25

._crit_edge123:                                   ; preds = %._crit_edge117, %49
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiLm100001EENSt9enable_ifIXsr14__is_swappableIT_EE5valueEvE4typeERAT0__S1_S5_(ptr noundef nonnull align 4 dereferenceable(400004), ptr noundef nonnull align 4 dereferenceable(400004)) local_unnamed_addr #2

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

attributes #0 = { mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !11, !16, !15}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
!20 = distinct !{!20, !11}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.unroll.disable"}
!23 = distinct !{!23, !11}
!24 = distinct !{!24, !11}
!25 = distinct !{!25, !11}


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