; LLVM IR from huawei-noah/bolt :: compute/tensor/src (gather)

; 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.TensorDesc = type { i32, i32, i32, [20 x i32] }
%struct.GatherParamSpec = type { i32, i8, i32 }
%struct.ArchInfo = type { i32, ptr }

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z24gather_infer_output_sizeP6TensorS0_15GatherParamSpecS0_P8ArchInfo(ptr noundef %0, ptr noundef %1, i64 %2, i32 %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca i32, align 4
  %8 = alloca %struct.GatherParamSpec, align 4
  %9 = alloca { i64, i32 }, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.TensorDesc, align 4
  %17 = alloca %struct.TensorDesc, align 4
  %18 = alloca i32, align 4
  %19 = alloca %struct.TensorDesc, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.TensorDesc, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca %struct.TensorDesc, align 8
  %31 = getelementptr inbounds { i64, i32 }, ptr %9, i32 0, i32 0
  store i64 %2, ptr %31, align 4
  %32 = getelementptr inbounds { i64, i32 }, ptr %9, i32 0, i32 1
  store i32 %3, ptr %32, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %9, i64 12, i1 false)
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ArchInfo, ptr %33, i32 0, i32 0
  %35 = load i32, ptr %34, align 8, !tbaa !9
  store i32 %35, ptr %14, align 4, !tbaa !12
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = icmp eq ptr %36, null
  br i1 %37, label %41, label %38

38:                                               ; preds = %6
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %38, %6
  store i32 1, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %288

42:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 92, ptr %16) #4
  %43 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %16, ptr noundef nonnull align 8 dereferenceable(32) %43)
  call void @llvm.lifetime.start.p0(i64 92, ptr %17) #4
  %44 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind writable sret(%struct.TensorDesc) align 4 %17, ptr noundef nonnull align 8 dereferenceable(32) %44)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %45 = getelementptr inbounds %struct.GatherParamSpec, ptr %8, i32 0, i32 0
  %46 = load i32, ptr %45, align 4, !tbaa !13
  %47 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %48 = load i32, ptr %47, align 4, !tbaa !17
  %49 = add i32 %46, %48
  %50 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %51 = load i32, ptr %50, align 4, !tbaa !17
  %52 = urem i32 %49, %51
  store i32 %52, ptr %18, align 4, !tbaa !21
  %53 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %54 = load i32, ptr %53, align 4, !tbaa !17
  %55 = sub i32 %54, 1
  %56 = load i32, ptr %18, align 4, !tbaa !21
  %57 = sub i32 %55, %56
  store i32 %57, ptr %18, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 92, ptr %19) #4
  call void @_ZN10TensorDescC2Ev(ptr noundef nonnull align 4 dereferenceable(92) %19) #4
  %58 = getelementptr inbounds %struct.GatherParamSpec, ptr %8, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !13
  %60 = icmp eq i32 %59, 2147483647
  br i1 %60, label %61, label %140

61:                                               ; preds = %42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %16, i64 92, i1 false), !tbaa.struct !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %62 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %63 = load i32, ptr %62, align 4, !tbaa !17
  store i32 %63, ptr %20, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  %64 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 3
  %65 = getelementptr inbounds [20 x i32], ptr %64, i64 0, i64 0
  %66 = load i32, ptr %65, align 4, !tbaa !21
  store i32 %66, ptr %21, align 4, !tbaa !21
  %67 = load i32, ptr %21, align 4, !tbaa !21
  %68 = load i32, ptr %20, align 4, !tbaa !21
  %69 = icmp sle i32 %67, %68
  br i1 %69, label %70, label %135

70:                                               ; preds = %61
  %71 = load i32, ptr %20, align 4, !tbaa !21
  %72 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 2
  %73 = load i32, ptr %72, align 4, !tbaa !17
  %74 = add i32 %71, %73
  %75 = load i32, ptr %21, align 4, !tbaa !21
  %76 = sub i32 %74, %75
  %77 = sub i32 %76, 1
  %78 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 2
  store i32 %77, ptr %78, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %79 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %80 = load i32, ptr %79, align 4, !tbaa !17
  %81 = getelementptr inbounds %struct.GatherParamSpec, ptr %8, i32 0, i32 2
  %82 = load i32, ptr %81, align 4, !tbaa !26
  %83 = sub i32 %80, %82
  %84 = load i32, ptr %21, align 4, !tbaa !21
  %85 = sub i32 %83, %84
  store i32 %85, ptr %22, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 1, ptr %23, align 4, !tbaa !21
  br label %86

86:                                               ; preds = %103, %70
  %87 = load i32, ptr %23, align 4, !tbaa !21
  %88 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 2
  %89 = load i32, ptr %88, align 4, !tbaa !17
  %90 = icmp ult i32 %87, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %86
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  br label %106

92:                                               ; preds = %86
  %93 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 3
  %94 = load i32, ptr %23, align 4, !tbaa !21
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds [20 x i32], ptr %93, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !21
  %98 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 3
  %99 = load i32, ptr %22, align 4, !tbaa !21
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %22, align 4, !tbaa !21
  %101 = sext i32 %99 to i64
  %102 = getelementptr inbounds [20 x i32], ptr %98, i64 0, i64 %101
  store i32 %97, ptr %102, align 4, !tbaa !21
  br label %103

103:                                              ; preds = %92
  %104 = load i32, ptr %23, align 4, !tbaa !21
  %105 = add i32 %104, 1
  store i32 %105, ptr %23, align 4, !tbaa !21
  br label %86, !llvm.loop !27

106:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 0, ptr %24, align 4, !tbaa !21
  br label %107

107:                                              ; preds = %131, %106
  %108 = load i32, ptr %24, align 4, !tbaa !21
  %109 = getelementptr inbounds %struct.GatherParamSpec, ptr %8, i32 0, i32 2
  %110 = load i32, ptr %109, align 4, !tbaa !26
  %111 = icmp slt i32 %108, %110
  br i1 %111, label %113, label %112

112:                                              ; preds = %107
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  br label %134

113:                                              ; preds = %107
  %114 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 3
  %115 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 2
  %116 = load i32, ptr %115, align 4, !tbaa !17
  %117 = sub i32 %116, 1
  %118 = load i32, ptr %24, align 4, !tbaa !21
  %119 = sub i32 %117, %118
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds [20 x i32], ptr %114, i64 0, i64 %120
  %122 = load i32, ptr %121, align 4, !tbaa !21
  %123 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 3
  %124 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 2
  %125 = load i32, ptr %124, align 4, !tbaa !17
  %126 = sub i32 %125, 1
  %127 = load i32, ptr %24, align 4, !tbaa !21
  %128 = sub i32 %126, %127
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds [20 x i32], ptr %123, i64 0, i64 %129
  store i32 %122, ptr %130, align 4, !tbaa !21
  br label %131

131:                                              ; preds = %113
  %132 = load i32, ptr %24, align 4, !tbaa !21
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %24, align 4, !tbaa !21
  br label %107, !llvm.loop !29

134:                                              ; preds = %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  br label %136

135:                                              ; preds = %61
  store i32 2, ptr %7, align 4
  store i32 1, ptr %15, align 4
  br label %137

136:                                              ; preds = %134
  store i32 0, ptr %15, align 4
  br label %137

137:                                              ; preds = %136, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  %138 = load i32, ptr %15, align 4
  switch i32 %138, label %287 [
    i32 0, label %139
  ]

139:                                              ; preds = %137
  br label %244

140:                                              ; preds = %42
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %17, i64 92, i1 false), !tbaa.struct !22
  %141 = getelementptr inbounds %struct.GatherParamSpec, ptr %8, i32 0, i32 1
  %142 = load i8, ptr %141, align 4, !tbaa !30, !range !31, !noundef !32
  %143 = trunc i8 %142 to i1
  br i1 %143, label %243, label %144

144:                                              ; preds = %140
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %16, i64 92, i1 false), !tbaa.struct !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %17, i64 92, i1 false), !tbaa.struct !22
  %145 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8 %25)
  %146 = icmp eq i32 %145, 1
  br i1 %146, label %147, label %187

147:                                              ; preds = %144
  %148 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 1
  %149 = load i32, ptr %148, align 4, !tbaa !33
  %150 = icmp eq i32 %149, 43
  br i1 %150, label %151, label %187

151:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %152 = load i32, ptr %18, align 4, !tbaa !21
  store i32 %152, ptr %26, align 4, !tbaa !21
  br label %153

153:                                              ; preds = %171, %151
  %154 = load i32, ptr %26, align 4, !tbaa !21
  %155 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 2
  %156 = load i32, ptr %155, align 4, !tbaa !17
  %157 = sub nsw i32 %156, 1
  %158 = icmp slt i32 %154, %157
  br i1 %158, label %160, label %159

159:                                              ; preds = %153
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  br label %174

160:                                              ; preds = %153
  %161 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 3
  %162 = load i32, ptr %26, align 4, !tbaa !21
  %163 = add nsw i32 %162, 1
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [20 x i32], ptr %161, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !21
  %167 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 3
  %168 = load i32, ptr %26, align 4, !tbaa !21
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [20 x i32], ptr %167, i64 0, i64 %169
  store i32 %166, ptr %170, align 4, !tbaa !21
  br label %171

171:                                              ; preds = %160
  %172 = load i32, ptr %26, align 4, !tbaa !21
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %26, align 4, !tbaa !21
  br label %153, !llvm.loop !34

174:                                              ; preds = %159
  %175 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 2
  %176 = load i32, ptr %175, align 4, !tbaa !17
  %177 = icmp ugt i32 %176, 1
  br i1 %177, label %178, label %182

178:                                              ; preds = %174
  %179 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 2
  %180 = load i32, ptr %179, align 4, !tbaa !17
  %181 = add i32 %180, -1
  store i32 %181, ptr %179, align 4, !tbaa !17
  br label %186

182:                                              ; preds = %174
  %183 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 3
  %184 = getelementptr inbounds [20 x i32], ptr %183, i64 0, i64 0
  store i32 1, ptr %184, align 4, !tbaa !21
  %185 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 1
  store i32 43, ptr %185, align 4, !tbaa !33
  br label %186

186:                                              ; preds = %182, %178
  br label %242

187:                                              ; preds = %147, %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %188 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 2
  %189 = load i32, ptr %188, align 4, !tbaa !17
  %190 = sub nsw i32 %189, 1
  store i32 %190, ptr %27, align 4, !tbaa !21
  br label %191

191:                                              ; preds = %210, %187
  %192 = load i32, ptr %27, align 4, !tbaa !21
  %193 = load i32, ptr %18, align 4, !tbaa !21
  %194 = icmp sgt i32 %192, %193
  br i1 %194, label %196, label %195

195:                                              ; preds = %191
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  br label %213

196:                                              ; preds = %191
  %197 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 3
  %198 = load i32, ptr %27, align 4, !tbaa !21
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [20 x i32], ptr %197, i64 0, i64 %199
  %201 = load i32, ptr %200, align 4, !tbaa !21
  %202 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 3
  %203 = load i32, ptr %27, align 4, !tbaa !21
  %204 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 2
  %205 = load i32, ptr %204, align 4, !tbaa !17
  %206 = add i32 %203, %205
  %207 = sub i32 %206, 1
  %208 = zext i32 %207 to i64
  %209 = getelementptr inbounds [20 x i32], ptr %202, i64 0, i64 %208
  store i32 %201, ptr %209, align 4, !tbaa !21
  br label %210

210:                                              ; preds = %196
  %211 = load i32, ptr %27, align 4, !tbaa !21
  %212 = add nsw i32 %211, -1
  store i32 %212, ptr %27, align 4, !tbaa !21
  br label %191, !llvm.loop !35

213:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  store i32 0, ptr %28, align 4, !tbaa !21
  br label %214

214:                                              ; preds = %232, %213
  %215 = load i32, ptr %28, align 4, !tbaa !21
  %216 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 2
  %217 = load i32, ptr %216, align 4, !tbaa !17
  %218 = icmp ult i32 %215, %217
  br i1 %218, label %220, label %219

219:                                              ; preds = %214
  store i32 14, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  br label %235

220:                                              ; preds = %214
  %221 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 3
  %222 = load i32, ptr %28, align 4, !tbaa !21
  %223 = zext i32 %222 to i64
  %224 = getelementptr inbounds [20 x i32], ptr %221, i64 0, i64 %223
  %225 = load i32, ptr %224, align 4, !tbaa !21
  %226 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 3
  %227 = load i32, ptr %18, align 4, !tbaa !21
  %228 = load i32, ptr %28, align 4, !tbaa !21
  %229 = add i32 %227, %228
  %230 = zext i32 %229 to i64
  %231 = getelementptr inbounds [20 x i32], ptr %226, i64 0, i64 %230
  store i32 %225, ptr %231, align 4, !tbaa !21
  br label %232

232:                                              ; preds = %220
  %233 = load i32, ptr %28, align 4, !tbaa !21
  %234 = add i32 %233, 1
  store i32 %234, ptr %28, align 4, !tbaa !21
  br label %214, !llvm.loop !36

235:                                              ; preds = %219
  %236 = getelementptr inbounds %struct.TensorDesc, ptr %17, i32 0, i32 2
  %237 = load i32, ptr %236, align 4, !tbaa !17
  %238 = sub i32 %237, 1
  %239 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 2
  %240 = load i32, ptr %239, align 4, !tbaa !17
  %241 = add i32 %240, %238
  store i32 %241, ptr %239, align 4, !tbaa !17
  br label %242

242:                                              ; preds = %235, %186
  br label %243

243:                                              ; preds = %242, %140
  br label %244

244:                                              ; preds = %243, %139
  %245 = getelementptr inbounds %struct.TensorDesc, ptr %16, i32 0, i32 0
  %246 = load i32, ptr %245, align 4, !tbaa !37
  %247 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 0
  store i32 %246, ptr %247, align 4, !tbaa !37
  %248 = load i32, ptr %14, align 4, !tbaa !12
  %249 = icmp eq i32 %248, 1
  br i1 %249, label %277, label %250

250:                                              ; preds = %244
  %251 = load i32, ptr %14, align 4, !tbaa !12
  %252 = icmp eq i32 %251, 8
  br i1 %252, label %277, label %253

253:                                              ; preds = %250
  %254 = load i32, ptr %14, align 4, !tbaa !12
  %255 = icmp eq i32 %254, 9
  br i1 %255, label %277, label %256

256:                                              ; preds = %253
  %257 = load i32, ptr %14, align 4, !tbaa !12
  %258 = icmp eq i32 %257, 10
  br i1 %258, label %277, label %259

259:                                              ; preds = %256
  %260 = load i32, ptr %14, align 4, !tbaa !12
  %261 = icmp eq i32 %260, 9
  br i1 %261, label %277, label %262

262:                                              ; preds = %259
  %263 = load i32, ptr %14, align 4, !tbaa !12
  %264 = icmp eq i32 %263, 10
  br i1 %264, label %277, label %265

265:                                              ; preds = %262
  %266 = load i32, ptr %14, align 4, !tbaa !12
  %267 = icmp eq i32 %266, 5
  br i1 %267, label %277, label %268

268:                                              ; preds = %265
  %269 = load i32, ptr %14, align 4, !tbaa !12
  %270 = icmp eq i32 %269, 6
  br i1 %270, label %277, label %271

271:                                              ; preds = %268
  %272 = load i32, ptr %14, align 4, !tbaa !12
  %273 = icmp eq i32 %272, 4
  br i1 %273, label %277, label %274

274:                                              ; preds = %271
  %275 = load i32, ptr %14, align 4, !tbaa !12
  %276 = icmp eq i32 %275, 3
  br i1 %276, label %277, label %284

277:                                              ; preds = %274, %271, %268, %265, %262, %259, %256, %253, %250, %244
  %278 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 1
  %279 = load i32, ptr %278, align 4, !tbaa !33
  %280 = icmp eq i32 %279, 2
  br i1 %280, label %281, label %283

281:                                              ; preds = %277
  %282 = getelementptr inbounds %struct.TensorDesc, ptr %19, i32 0, i32 1
  store i32 0, ptr %282, align 4, !tbaa !33
  br label %283

283:                                              ; preds = %281, %277
  br label %284

284:                                              ; preds = %283, %274
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #4
  store i32 0, ptr %29, align 4, !tbaa !38
  %285 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %19, i64 92, i1 false), !tbaa.struct !22
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %285, ptr noundef byval(%struct.TensorDesc) align 8 %30)
  %286 = load i32, ptr %29, align 4, !tbaa !38
  store i32 %286, ptr %7, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #4
  br label %287

287:                                              ; preds = %284, %137
  call void @llvm.lifetime.end.p0(i64 92, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 92, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 92, ptr %16) #4
  br label %288

288:                                              ; preds = %287, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %289 = load i32, ptr %7, align 4
  ret i32 %289
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10TensorDescC2Ev(ptr noundef nonnull align 4 dereferenceable(92)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%struct.TensorDesc) align 8) #2 align 2

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS8ArchInfo", !11, i64 0, !6, i64 8}
!11 = !{!"_ZTS4Arch", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS15GatherParamSpec", !15, i64 0, !16, i64 4, !15, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !15, i64 8}
!18 = !{!"_ZTS10TensorDesc", !19, i64 0, !20, i64 4, !15, i64 8, !7, i64 12}
!19 = !{!"_ZTS8DataType", !7, i64 0}
!20 = !{!"_ZTS10DataFormat", !7, i64 0}
!21 = !{!15, !15, i64 0}
!22 = !{i64 0, i64 4, !23, i64 4, i64 4, !24, i64 8, i64 4, !21, i64 12, i64 80, !25}
!23 = !{!19, !19, i64 0}
!24 = !{!20, !20, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!14, !15, i64 8}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = !{!14, !16, i64 4}
!31 = !{i8 0, i8 2}
!32 = !{}
!33 = !{!18, !20, i64 4}
!34 = distinct !{!34, !28}
!35 = distinct !{!35, !28}
!36 = distinct !{!36, !28}
!37 = !{!18, !19, i64 0}
!38 = !{!39, !39, i64 0}
!39 = !{!"_ZTS2EE", !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.TensorDesc = type { i32, i32, i32, [20 x i32] }

; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor8get_descEv(ptr dead_on_unwind noalias writable sret(%struct.TensorDesc) align 4, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 3) i32 @_Z24gather_infer_output_sizeP6TensorS0_15GatherParamSpecS0_P8ArchInfo(ptr noundef %0, ptr noundef %1, i64 %2, i32 %3, ptr noundef %4, ptr nocapture noundef readonly %5) local_unnamed_addr #2 {
  %7 = alloca %struct.TensorDesc, align 4
  %8 = alloca %struct.TensorDesc, align 8
  %9 = alloca %struct.TensorDesc, align 8
  %10 = load i32, ptr %5, align 8, !tbaa !5
  %11 = icmp eq ptr %0, null
  %12 = icmp eq ptr %4, null
  %or.cond = or i1 %11, %12
  br i1 %or.cond, label %244, label %13

13:                                               ; preds = %6
  %.sroa.071.0.extract.trunc = trunc i64 %2 to i32
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %7) #5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %7, ptr noundef nonnull align 8 dereferenceable(32) %0)
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %8) #5
  call void @_ZN6Tensor8get_descEv(ptr dead_on_unwind nonnull writable sret(%struct.TensorDesc) align 4 %8, ptr noundef nonnull align 8 dereferenceable(32) %1)
  %14 = getelementptr inbounds i8, ptr %7, i64 8
  %15 = load i32, ptr %14, align 4, !tbaa !11
  %16 = add i32 %15, %.sroa.071.0.extract.trunc
  %17 = urem i32 %16, %15
  %18 = xor i32 %17, -1
  %19 = add i32 %15, %18
  call void @llvm.lifetime.start.p0(i64 92, ptr nonnull %9) #5
  call void @_ZN10TensorDescC2Ev(ptr noundef nonnull align 4 dereferenceable(92) %9) #5
  %20 = icmp eq i32 %.sroa.071.0.extract.trunc, 2147483647
  br i1 %20, label %21, label %97

21:                                               ; preds = %13
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %9, ptr noundef nonnull align 4 dereferenceable(92) %7, i64 92, i1 false), !tbaa.struct !16
  %22 = load i32, ptr %14, align 4, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %8, i64 12
  %24 = load i32, ptr %23, align 4, !tbaa !19
  %.not91.not = icmp sgt i32 %24, %22
  br i1 %.not91.not, label %.critedge, label %25

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %8, i64 8
  %27 = load i32, ptr %26, align 8, !tbaa !11
  %28 = xor i32 %24, -1
  %29 = add i32 %22, %28
  %30 = add i32 %29, %27
  %31 = getelementptr inbounds i8, ptr %9, i64 8
  store i32 %30, ptr %31, align 8, !tbaa !11
  %32 = icmp ugt i32 %27, 1
  br i1 %32, label %.lr.ph111, label %.preheader

.lr.ph111:                                        ; preds = %25
  %33 = add i32 %24, %3
  %34 = sub i32 %22, %33
  %35 = sext i32 %34 to i64
  %36 = shl nsw i64 %35, 2
  %37 = getelementptr i8, ptr %9, i64 %36
  %scevgep = getelementptr i8, ptr %37, i64 12
  %scevgep124 = getelementptr inbounds i8, ptr %8, i64 16
  %38 = add i32 %27, -1
  %39 = zext i32 %38 to i64
  %40 = shl nuw nsw i64 %39, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %scevgep, ptr nonnull align 8 %scevgep124, i64 %40, i1 false), !tbaa !19
  br label %.preheader

.preheader:                                       ; preds = %.lr.ph111, %25
  %41 = icmp sgt i32 %3, 0
  br i1 %41, label %.lr.ph113, label %.loopexit

.lr.ph113:                                        ; preds = %.preheader
  %42 = getelementptr inbounds i8, ptr %7, i64 12
  %43 = getelementptr inbounds i8, ptr %9, i64 12
  %44 = load i32, ptr %31, align 8, !tbaa !11
  %wide.trip.count135 = zext nneg i32 %3 to i64
  %min.iters.check177 = icmp ult i32 %3, 28
  br i1 %min.iters.check177, label %scalar.ph176.preheader, label %vector.scevcheck168

vector.scevcheck168:                              ; preds = %.lr.ph113
  %45 = add nsw i64 %wide.trip.count135, -1
  %46 = add i32 %22, -1
  %47 = trunc nsw i64 %45 to i32
  %48 = icmp ult i32 %46, %47
  %49 = add i32 %44, -1
  %50 = trunc nsw i64 %45 to i32
  %51 = icmp ult i32 %49, %50
  %52 = icmp ugt i64 %45, 4294967295
  %53 = or i1 %51, %52
  %54 = or i1 %48, %53
  br i1 %54, label %scalar.ph176.preheader, label %vector.ph178

vector.ph178:                                     ; preds = %vector.scevcheck168
  %n.vec180 = and i64 %wide.trip.count135, 2147483640
  br label %vector.body182

vector.body182:                                   ; preds = %vector.body182, %vector.ph178
  %index183 = phi i64 [ 0, %vector.ph178 ], [ %index.next190, %vector.body182 ]
  %55 = trunc i64 %index183 to i32
  %56 = xor i32 %55, -1
  %57 = add i32 %22, %56
  %58 = zext i32 %57 to i64
  %59 = getelementptr inbounds [20 x i32], ptr %42, i64 0, i64 %58
  %60 = getelementptr inbounds i8, ptr %59, i64 -12
  %61 = getelementptr inbounds i8, ptr %59, i64 -28
  %wide.load184 = load <4 x i32>, ptr %60, align 4, !tbaa !19
  %wide.load186 = load <4 x i32>, ptr %61, align 4, !tbaa !19
  %62 = add i32 %44, %56
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds [20 x i32], ptr %43, i64 0, i64 %63
  %65 = getelementptr inbounds i8, ptr %64, i64 -12
  %66 = getelementptr inbounds i8, ptr %64, i64 -28
  store <4 x i32> %wide.load184, ptr %65, align 4, !tbaa !19
  store <4 x i32> %wide.load186, ptr %66, align 4, !tbaa !19
  %index.next190 = add nuw i64 %index183, 8
  %67 = icmp eq i64 %index.next190, %n.vec180
  br i1 %67, label %middle.block175, label %vector.body182, !llvm.loop !21

middle.block175:                                  ; preds = %vector.body182
  %cmp.n191 = icmp eq i64 %n.vec180, %wide.trip.count135
  br i1 %cmp.n191, label %.loopexit, label %scalar.ph176.preheader

scalar.ph176.preheader:                           ; preds = %middle.block175, %vector.scevcheck168, %.lr.ph113
  %indvars.iv132.ph = phi i64 [ 0, %vector.scevcheck168 ], [ 0, %.lr.ph113 ], [ %n.vec180, %middle.block175 ]
  %xtraiter194 = and i64 %wide.trip.count135, 1
  %lcmp.mod195.not = icmp eq i64 %xtraiter194, 0
  br i1 %lcmp.mod195.not, label %scalar.ph176.prol.loopexit, label %scalar.ph176.prol

scalar.ph176.prol:                                ; preds = %scalar.ph176.preheader
  %68 = trunc nuw nsw i64 %indvars.iv132.ph to i32
  %69 = xor i32 %68, -1
  %70 = add i32 %22, %69
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds [20 x i32], ptr %42, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !19
  %74 = add i32 %44, %69
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds [20 x i32], ptr %43, i64 0, i64 %75
  store i32 %73, ptr %76, align 4, !tbaa !19
  %indvars.iv.next133.prol = or disjoint i64 %indvars.iv132.ph, 1
  br label %scalar.ph176.prol.loopexit

scalar.ph176.prol.loopexit:                       ; preds = %scalar.ph176.prol, %scalar.ph176.preheader
  %indvars.iv132.unr = phi i64 [ %indvars.iv132.ph, %scalar.ph176.preheader ], [ %indvars.iv.next133.prol, %scalar.ph176.prol ]
  %77 = add nsw i64 %wide.trip.count135, -1
  %78 = icmp eq i64 %indvars.iv132.ph, %77
  br i1 %78, label %.loopexit, label %scalar.ph176

scalar.ph176:                                     ; preds = %scalar.ph176.prol.loopexit, %scalar.ph176
  %indvars.iv132 = phi i64 [ %indvars.iv.next133.1, %scalar.ph176 ], [ %indvars.iv132.unr, %scalar.ph176.prol.loopexit ]
  %79 = trunc nuw nsw i64 %indvars.iv132 to i32
  %80 = xor i32 %79, -1
  %81 = add i32 %22, %80
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds [20 x i32], ptr %42, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !19
  %85 = add i32 %44, %80
  %86 = zext i32 %85 to i64
  %87 = getelementptr inbounds [20 x i32], ptr %43, i64 0, i64 %86
  store i32 %84, ptr %87, align 4, !tbaa !19
  %88 = trunc i64 %indvars.iv132 to i32
  %89 = sub i32 -2, %88
  %90 = add i32 %22, %89
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds [20 x i32], ptr %42, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !19
  %94 = add i32 %44, %89
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds [20 x i32], ptr %43, i64 0, i64 %95
  store i32 %93, ptr %96, align 4, !tbaa !19
  %indvars.iv.next133.1 = add nuw nsw i64 %indvars.iv132, 2
  %exitcond136.not.1 = icmp eq i64 %indvars.iv.next133.1, %wide.trip.count135
  br i1 %exitcond136.not.1, label %.loopexit, label %scalar.ph176, !llvm.loop !25

97:                                               ; preds = %13
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %9, ptr noundef nonnull align 8 dereferenceable(92) %8, i64 92, i1 false), !tbaa.struct !16
  %98 = and i64 %2, 4294967296
  %.not = icmp eq i64 %98, 0
  br i1 %.not, label %99, label %.loopexit

99:                                               ; preds = %97
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(92) %9, ptr noundef nonnull align 4 dereferenceable(92) %7, i64 92, i1 false), !tbaa.struct !16
  %100 = call noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef nonnull byval(%struct.TensorDesc) align 8 %8)
  %101 = icmp eq i32 %100, 1
  %102 = getelementptr inbounds i8, ptr %8, i64 4
  %103 = load i32, ptr %102, align 4
  %104 = icmp eq i32 %103, 43
  %or.cond4 = select i1 %101, i1 %104, i1 false
  %105 = getelementptr inbounds i8, ptr %9, i64 8
  %106 = load i32, ptr %105, align 8, !tbaa !11
  %107 = add i32 %106, -1
  br i1 %or.cond4, label %.preheader94, label %124

.preheader94:                                     ; preds = %99
  %108 = icmp slt i32 %19, %107
  br i1 %108, label %.lr.ph104, label %._crit_edge105

.lr.ph104:                                        ; preds = %.preheader94
  %109 = getelementptr inbounds i8, ptr %9, i64 12
  %110 = sext i32 %19 to i64
  br label %112

._crit_edge105:                                   ; preds = %112, %.preheader94
  %.lcssa96 = phi i32 [ %106, %.preheader94 ], [ %116, %112 ]
  %.lcssa = phi i32 [ %107, %.preheader94 ], [ %117, %112 ]
  %111 = icmp ugt i32 %.lcssa96, 1
  br i1 %111, label %120, label %121

112:                                              ; preds = %.lr.ph104, %112
  %indvars.iv121 = phi i64 [ %110, %.lr.ph104 ], [ %indvars.iv.next122, %112 ]
  %indvars.iv.next122 = add nsw i64 %indvars.iv121, 1
  %113 = getelementptr inbounds [20 x i32], ptr %109, i64 0, i64 %indvars.iv.next122
  %114 = load i32, ptr %113, align 4, !tbaa !19
  %115 = getelementptr inbounds [20 x i32], ptr %109, i64 0, i64 %indvars.iv121
  store i32 %114, ptr %115, align 4, !tbaa !19
  %116 = load i32, ptr %105, align 8, !tbaa !11
  %117 = add nsw i32 %116, -1
  %118 = sext i32 %117 to i64
  %119 = icmp slt i64 %indvars.iv.next122, %118
  br i1 %119, label %112, label %._crit_edge105, !llvm.loop !26

120:                                              ; preds = %._crit_edge105
  store i32 %.lcssa, ptr %105, align 8, !tbaa !11
  br label %.loopexit

121:                                              ; preds = %._crit_edge105
  %122 = getelementptr inbounds i8, ptr %9, i64 12
  store i32 1, ptr %122, align 4, !tbaa !19
  %123 = getelementptr inbounds i8, ptr %9, i64 4
  store i32 43, ptr %123, align 4, !tbaa !27
  br label %.loopexit

124:                                              ; preds = %99
  %125 = icmp sgt i32 %107, %19
  br i1 %125, label %.lr.ph, label %..preheader95_crit_edge

..preheader95_crit_edge:                          ; preds = %124
  %.phi.trans.insert = getelementptr inbounds i8, ptr %8, i64 8
  %.pre = load i32, ptr %.phi.trans.insert, align 8, !tbaa !11
  br label %.preheader95

.lr.ph:                                           ; preds = %124
  %126 = getelementptr inbounds i8, ptr %9, i64 12
  %127 = getelementptr inbounds i8, ptr %8, i64 8
  %128 = load i32, ptr %127, align 8, !tbaa !11
  %129 = sext i32 %106 to i64
  %130 = add nsw i64 %129, -1
  %131 = sext i32 %19 to i64
  %132 = add nsw i64 %129, -2
  %smin149 = call i64 @llvm.smin.i64(i64 %132, i64 %131)
  %133 = xor i64 %smin149, -1
  %134 = add i64 %133, %129
  %min.iters.check = icmp ult i64 %134, 72
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.scevcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %vector.scevcheck, %.lr.ph
  %indvars.iv.ph = phi i64 [ %130, %vector.memcheck ], [ %130, %vector.scevcheck ], [ %130, %.lr.ph ], [ %ind.end, %middle.block ]
  br label %scalar.ph

vector.scevcheck:                                 ; preds = %.lr.ph
  %135 = add nsw i64 %129, -2
  %136 = add nsw i64 %129, -2
  %smin = call i64 @llvm.smin.i64(i64 %136, i64 %131)
  %137 = sub i64 %135, %smin
  %138 = add i32 %106, %128
  %139 = add i32 %138, -2
  %140 = trunc i64 %137 to i32
  %141 = icmp ult i32 %139, %140
  %142 = icmp ugt i64 %137, 4294967295
  %143 = or i1 %141, %142
  %144 = zext i32 %139 to i64
  %145 = shl nuw nsw i64 %144, 2
  %146 = getelementptr i8, ptr %9, i64 %145
  %scevgep141 = getelementptr i8, ptr %146, i64 12
  %mul.result143.neg = mul i64 %137, -4
  %147 = getelementptr i8, ptr %scevgep141, i64 %mul.result143.neg
  %148 = icmp ugt ptr %147, %scevgep141
  %149 = shl nsw i64 %129, 2
  %150 = getelementptr i8, ptr %9, i64 %149
  %scevgep145 = getelementptr i8, ptr %150, i64 8
  %mul.result147.neg = mul i64 %137, -4
  %151 = getelementptr i8, ptr %scevgep145, i64 %mul.result147.neg
  %152 = icmp ugt ptr %151, %scevgep145
  %153 = or i1 %148, %143
  %154 = or i1 %152, %153
  br i1 %154, label %scalar.ph.preheader, label %vector.memcheck

vector.memcheck:                                  ; preds = %vector.scevcheck
  %155 = shl nsw i64 %129, 2
  %156 = add nsw i64 %155, -4
  %157 = add i32 %106, %128
  %158 = add i32 %157, -2
  %159 = zext i32 %158 to i64
  %160 = shl nuw nsw i64 %159, 2
  %161 = sub nsw i64 %156, %160
  %diff.check = icmp ult i64 %161, 32
  br i1 %diff.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %134, -8
  %ind.end = sub i64 %130, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = sub i64 %130, %index
  %162 = getelementptr inbounds [20 x i32], ptr %126, i64 0, i64 %offset.idx
  %163 = getelementptr inbounds i8, ptr %162, i64 -12
  %164 = getelementptr inbounds i8, ptr %162, i64 -28
  %wide.load = load <4 x i32>, ptr %163, align 4, !tbaa !19
  %wide.load150 = load <4 x i32>, ptr %164, align 4, !tbaa !19
  %165 = trunc i64 %offset.idx to i32
  %166 = add i32 %165, -1
  %167 = add i32 %128, %166
  %168 = zext i32 %167 to i64
  %169 = getelementptr inbounds [20 x i32], ptr %126, i64 0, i64 %168
  %170 = getelementptr inbounds i8, ptr %169, i64 -12
  %171 = getelementptr inbounds i8, ptr %169, i64 -28
  store <4 x i32> %wide.load, ptr %170, align 4, !tbaa !19
  store <4 x i32> %wide.load150, ptr %171, align 4, !tbaa !19
  %index.next = add nuw i64 %index, 8
  %172 = icmp eq i64 %index.next, %n.vec
  br i1 %172, label %middle.block, label %vector.body, !llvm.loop !28

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %134, %n.vec
  br i1 %cmp.n, label %.preheader95, label %scalar.ph.preheader

.preheader95:                                     ; preds = %scalar.ph, %middle.block, %..preheader95_crit_edge
  %173 = phi i32 [ %.pre, %..preheader95_crit_edge ], [ %128, %middle.block ], [ %128, %scalar.ph ]
  %.not114 = icmp eq i32 %173, 0
  br i1 %.not114, label %._crit_edge, label %.lr.ph102

.lr.ph102:                                        ; preds = %.preheader95
  %174 = getelementptr inbounds i8, ptr %8, i64 12
  %175 = getelementptr inbounds i8, ptr %9, i64 12
  %wide.trip.count = zext i32 %173 to i64
  %min.iters.check157 = icmp ult i32 %173, 12
  br i1 %min.iters.check157, label %scalar.ph156.preheader, label %vector.scevcheck154

scalar.ph156.preheader:                           ; preds = %middle.block155, %vector.scevcheck154, %.lr.ph102
  %indvars.iv118.ph = phi i64 [ 0, %vector.scevcheck154 ], [ 0, %.lr.ph102 ], [ %n.vec160, %middle.block155 ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph156.prol.loopexit, label %scalar.ph156.prol

scalar.ph156.prol:                                ; preds = %scalar.ph156.preheader, %scalar.ph156.prol
  %indvars.iv118.prol = phi i64 [ %indvars.iv.next119.prol, %scalar.ph156.prol ], [ %indvars.iv118.ph, %scalar.ph156.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph156.prol ], [ 0, %scalar.ph156.preheader ]
  %176 = getelementptr inbounds [20 x i32], ptr %174, i64 0, i64 %indvars.iv118.prol
  %177 = load i32, ptr %176, align 4, !tbaa !19
  %178 = trunc nuw i64 %indvars.iv118.prol to i32
  %179 = add i32 %19, %178
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds [20 x i32], ptr %175, i64 0, i64 %180
  store i32 %177, ptr %181, align 4, !tbaa !19
  %indvars.iv.next119.prol = add nuw nsw i64 %indvars.iv118.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph156.prol.loopexit, label %scalar.ph156.prol, !llvm.loop !29

scalar.ph156.prol.loopexit:                       ; preds = %scalar.ph156.prol, %scalar.ph156.preheader
  %indvars.iv118.unr = phi i64 [ %indvars.iv118.ph, %scalar.ph156.preheader ], [ %indvars.iv.next119.prol, %scalar.ph156.prol ]
  %182 = sub nsw i64 %indvars.iv118.ph, %wide.trip.count
  %183 = icmp ugt i64 %182, -4
  br i1 %183, label %._crit_edge, label %scalar.ph156

vector.scevcheck154:                              ; preds = %.lr.ph102
  %184 = add nsw i64 %wide.trip.count, -1
  %185 = trunc i64 %184 to i32
  %186 = sub i32 %17, %15
  %187 = icmp ult i32 %186, %185
  %188 = icmp ugt i64 %184, 4294967295
  %189 = or i1 %187, %188
  br i1 %189, label %scalar.ph156.preheader, label %vector.ph158

vector.ph158:                                     ; preds = %vector.scevcheck154
  %n.vec160 = and i64 %wide.trip.count, 4294967288
  br label %vector.body162

vector.body162:                                   ; preds = %vector.body162, %vector.ph158
  %index163 = phi i64 [ 0, %vector.ph158 ], [ %index.next166, %vector.body162 ]
  %190 = trunc i64 %index163 to i32
  %191 = getelementptr inbounds [20 x i32], ptr %174, i64 0, i64 %index163
  %192 = getelementptr inbounds i8, ptr %191, i64 16
  %wide.load164 = load <4 x i32>, ptr %191, align 4, !tbaa !19
  %wide.load165 = load <4 x i32>, ptr %192, align 4, !tbaa !19
  %193 = add i32 %19, %190
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds [20 x i32], ptr %175, i64 0, i64 %194
  %196 = getelementptr inbounds i8, ptr %195, i64 16
  store <4 x i32> %wide.load164, ptr %195, align 4, !tbaa !19
  store <4 x i32> %wide.load165, ptr %196, align 4, !tbaa !19
  %index.next166 = add nuw i64 %index163, 8
  %197 = icmp eq i64 %index.next166, %n.vec160
  br i1 %197, label %middle.block155, label %vector.body162, !llvm.loop !31

middle.block155:                                  ; preds = %vector.body162
  %cmp.n167 = icmp eq i64 %n.vec160, %wide.trip.count
  br i1 %cmp.n167, label %._crit_edge, label %scalar.ph156.preheader

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %198 = getelementptr inbounds [20 x i32], ptr %126, i64 0, i64 %indvars.iv
  %199 = load i32, ptr %198, align 4, !tbaa !19
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %200 = trunc nsw i64 %indvars.iv.next to i32
  %201 = add i32 %128, %200
  %202 = zext i32 %201 to i64
  %203 = getelementptr inbounds [20 x i32], ptr %126, i64 0, i64 %202
  store i32 %199, ptr %203, align 4, !tbaa !19
  %204 = icmp sgt i64 %indvars.iv.next, %131
  br i1 %204, label %scalar.ph, label %.preheader95, !llvm.loop !32

._crit_edge:                                      ; preds = %scalar.ph156.prol.loopexit, %scalar.ph156, %middle.block155, %.preheader95
  %205 = add i32 %107, %173
  store i32 %205, ptr %105, align 8, !tbaa !11
  br label %.loopexit

scalar.ph156:                                     ; preds = %scalar.ph156.prol.loopexit, %scalar.ph156
  %indvars.iv118 = phi i64 [ %indvars.iv.next119.3, %scalar.ph156 ], [ %indvars.iv118.unr, %scalar.ph156.prol.loopexit ]
  %206 = getelementptr inbounds [20 x i32], ptr %174, i64 0, i64 %indvars.iv118
  %207 = load i32, ptr %206, align 4, !tbaa !19
  %208 = trunc nuw i64 %indvars.iv118 to i32
  %209 = add i32 %19, %208
  %210 = zext i32 %209 to i64
  %211 = getelementptr inbounds [20 x i32], ptr %175, i64 0, i64 %210
  store i32 %207, ptr %211, align 4, !tbaa !19
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %212 = getelementptr inbounds [20 x i32], ptr %174, i64 0, i64 %indvars.iv.next119
  %213 = load i32, ptr %212, align 4, !tbaa !19
  %214 = trunc nuw i64 %indvars.iv.next119 to i32
  %215 = add i32 %19, %214
  %216 = zext i32 %215 to i64
  %217 = getelementptr inbounds [20 x i32], ptr %175, i64 0, i64 %216
  store i32 %213, ptr %217, align 4, !tbaa !19
  %indvars.iv.next119.1 = add nuw nsw i64 %indvars.iv118, 2
  %218 = getelementptr inbounds [20 x i32], ptr %174, i64 0, i64 %indvars.iv.next119.1
  %219 = load i32, ptr %218, align 4, !tbaa !19
  %220 = trunc nuw i64 %indvars.iv.next119.1 to i32
  %221 = add i32 %19, %220
  %222 = zext i32 %221 to i64
  %223 = getelementptr inbounds [20 x i32], ptr %175, i64 0, i64 %222
  store i32 %219, ptr %223, align 4, !tbaa !19
  %indvars.iv.next119.2 = add nuw nsw i64 %indvars.iv118, 3
  %224 = getelementptr inbounds [20 x i32], ptr %174, i64 0, i64 %indvars.iv.next119.2
  %225 = load i32, ptr %224, align 4, !tbaa !19
  %226 = trunc nuw i64 %indvars.iv.next119.2 to i32
  %227 = add i32 %19, %226
  %228 = zext i32 %227 to i64
  %229 = getelementptr inbounds [20 x i32], ptr %175, i64 0, i64 %228
  store i32 %225, ptr %229, align 4, !tbaa !19
  %indvars.iv.next119.3 = add nuw nsw i64 %indvars.iv118, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next119.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge, label %scalar.ph156, !llvm.loop !33

.loopexit:                                        ; preds = %scalar.ph176.prol.loopexit, %scalar.ph176, %middle.block175, %.preheader, %97, %120, %121, %._crit_edge
  %230 = load i32, ptr %7, align 4, !tbaa !34
  store i32 %230, ptr %9, align 8, !tbaa !34
  %231 = icmp eq i32 %10, 1
  %232 = and i32 %10, -2
  %233 = icmp eq i32 %232, 8
  %or.cond8 = or i1 %231, %233
  %234 = icmp eq i32 %10, 10
  %or.cond12 = or i1 %234, %or.cond8
  %235 = add i32 %10, -5
  %236 = icmp ult i32 %235, 2
  %or.cond18 = or i1 %236, %or.cond12
  %237 = add i32 %10, -3
  %238 = icmp ult i32 %237, 2
  %or.cond22 = select i1 %or.cond18, i1 true, i1 %238
  %239 = getelementptr inbounds i8, ptr %9, i64 4
  %240 = load i32, ptr %239, align 4
  %241 = icmp eq i32 %240, 2
  %or.cond25 = select i1 %or.cond22, i1 %241, i1 false
  br i1 %or.cond25, label %242, label %243

242:                                              ; preds = %.loopexit
  store i32 0, ptr %239, align 4, !tbaa !27
  br label %243

243:                                              ; preds = %242, %.loopexit
  call void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull byval(%struct.TensorDesc) align 8 %9)
  br label %.critedge

.critedge:                                        ; preds = %21, %243
  %.1 = phi i32 [ 0, %243 ], [ 2, %21 ]
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 92, ptr nonnull %7) #5
  br label %244

244:                                              ; preds = %6, %.critedge
  %.2 = phi i32 [ %.1, %.critedge ], [ 1, %6 ]
  ret i32 %.2
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN10TensorDescC2Ev(ptr noundef nonnull align 4 dereferenceable(92)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z17tensorNumElements10TensorDesc(ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6Tensor6resizeE10TensorDesc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef byval(%struct.TensorDesc) align 8) local_unnamed_addr #2 align 2

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS8ArchInfo", !7, i64 0, !10, i64 8}
!7 = !{!"_ZTS4Arch", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !15, i64 8}
!12 = !{!"_ZTS10TensorDesc", !13, i64 0, !14, i64 4, !15, i64 8, !8, i64 12}
!13 = !{!"_ZTS8DataType", !8, i64 0}
!14 = !{!"_ZTS10DataFormat", !8, i64 0}
!15 = !{!"int", !8, i64 0}
!16 = !{i64 0, i64 4, !17, i64 4, i64 4, !18, i64 8, i64 4, !19, i64 12, i64 80, !20}
!17 = !{!13, !13, i64 0}
!18 = !{!14, !14, i64 0}
!19 = !{!15, !15, i64 0}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !22, !23, !24}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!"llvm.loop.isvectorized", i32 1}
!24 = !{!"llvm.loop.unroll.runtime.disable"}
!25 = distinct !{!25, !22, !23}
!26 = distinct !{!26, !22}
!27 = !{!12, !14, i64 4}
!28 = distinct !{!28, !22, !23, !24}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.unroll.disable"}
!31 = distinct !{!31, !22, !23, !24}
!32 = distinct !{!32, !22, !23}
!33 = distinct !{!33, !22, !23}
!34 = !{!12, !13, i64 0}


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