; LLVM IR from reworks-org/galaxy :: deps/sfml_deps/vorbis-src/vq (latticetune)

; 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.codebook = type { i64, i64, i64, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32 }
%struct.static_codebook = type { i64, i64, ptr, i32, i64, i64, i32, i32, ptr, i32 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [46 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@stdout = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [62 x i8], align 1

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

34:                                               ; preds = %2
  %35 = load ptr, ptr @stderr, align 8, !tbaa !9
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str) #10
  call void @exit(i32 noundef 1) #11
  unreachable

37:                                               ; preds = %2
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds ptr, ptr %38, i64 2
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %45

42:                                               ; preds = %37
  %43 = load ptr, ptr @stderr, align 8, !tbaa !9
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.1) #10
  call void @exit(i32 noundef 1) #11
  unreachable

45:                                               ; preds = %37
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  %47 = getelementptr inbounds ptr, ptr %46, i64 3
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = icmp ne ptr %48, null
  br i1 %49, label %50, label %51

50:                                               ; preds = %45
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %50, %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #10
  %52 = load ptr, ptr %5, align 8, !tbaa !9
  %53 = getelementptr inbounds ptr, ptr %52, i64 1
  %54 = load ptr, ptr %53, align 8, !tbaa !9
  %55 = call noalias ptr @strdup(ptr noundef %54) #10
  store ptr %55, ptr %18, align 8, !tbaa !9
  %56 = load ptr, ptr %18, align 8, !tbaa !9
  %57 = call ptr @codebook_load(ptr noundef %56)
  store ptr %57, ptr %6, align 8, !tbaa !9
  %58 = load ptr, ptr %6, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.codebook, ptr %58, i32 0, i32 3
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  store ptr %60, ptr %7, align 8, !tbaa !9
  %61 = load ptr, ptr %18, align 8, !tbaa !9
  %62 = call ptr @strrchr(ptr noundef %61, i32 noundef 46) #12
  store ptr %62, ptr %17, align 8, !tbaa !9
  %63 = load ptr, ptr %17, align 8, !tbaa !9
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %69

65:                                               ; preds = %51
  %66 = load ptr, ptr %17, align 8, !tbaa !9
  store i8 0, ptr %66, align 1, !tbaa !14
  %67 = load ptr, ptr %18, align 8, !tbaa !9
  %68 = call noalias ptr @strdup(ptr noundef %67) #10
  store ptr %68, ptr %15, align 8, !tbaa !9
  br label %72

69:                                               ; preds = %51
  %70 = load ptr, ptr %18, align 8, !tbaa !9
  %71 = call noalias ptr @strdup(ptr noundef %70) #10
  store ptr %71, ptr %15, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %69, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #10
  %73 = load ptr, ptr %7, align 8, !tbaa !9
  %74 = getelementptr inbounds %struct.static_codebook, ptr %73, i32 0, i32 3
  %75 = load i32, ptr %74, align 8, !tbaa !15
  %76 = icmp ne i32 %75, 1
  br i1 %76, label %77, label %80

77:                                               ; preds = %72
  %78 = load ptr, ptr @stderr, align 8, !tbaa !9
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.2) #10
  call void @exit(i32 noundef 1) #11
  unreachable

80:                                               ; preds = %72
  %81 = load ptr, ptr %6, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.codebook, ptr %81, i32 0, i32 1
  %83 = load i64, ptr %82, align 8, !tbaa !17
  %84 = trunc i64 %83 to i32
  store i32 %84, ptr %10, align 4, !tbaa !5
  %85 = load ptr, ptr %6, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.codebook, ptr %85, i32 0, i32 0
  %87 = load i64, ptr %86, align 8, !tbaa !18
  %88 = trunc i64 %87 to i32
  store i32 %88, ptr %11, align 4, !tbaa !5
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = mul i64 %90, 8
  %92 = call noalias ptr @malloc(i64 noundef %91) #13
  store ptr %92, ptr %9, align 8, !tbaa !9
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = call noalias ptr @calloc(i64 noundef %94, i64 noundef 8) #14
  store ptr %95, ptr %8, align 8, !tbaa !9
  store i64 0, ptr %16, align 8, !tbaa !19
  br label %96

96:                                               ; preds = %107, %80
  %97 = load i64, ptr %16, align 8, !tbaa !19
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = icmp slt i64 %97, %99
  br i1 %100, label %101, label %110

101:                                              ; preds = %96
  %102 = load i32, ptr %12, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = load ptr, ptr %9, align 8, !tbaa !9
  %105 = load i64, ptr %16, align 8, !tbaa !19
  %106 = getelementptr inbounds i64, ptr %104, i64 %105
  store i64 %103, ptr %106, align 8, !tbaa !19
  br label %107

107:                                              ; preds = %101
  %108 = load i64, ptr %16, align 8, !tbaa !19
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %16, align 8, !tbaa !19
  br label %96, !llvm.loop !20

110:                                              ; preds = %96
  %111 = load ptr, ptr %5, align 8, !tbaa !9
  %112 = getelementptr inbounds ptr, ptr %111, i64 2
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  %114 = call noalias ptr @fopen(ptr noundef %113, ptr noundef @.str.3)
  store ptr %114, ptr %13, align 8, !tbaa !9
  %115 = load ptr, ptr %13, align 8, !tbaa !9
  %116 = icmp ne ptr %115, null
  br i1 %116, label %123, label %117

117:                                              ; preds = %110
  %118 = load ptr, ptr @stderr, align 8, !tbaa !9
  %119 = load ptr, ptr %5, align 8, !tbaa !9
  %120 = getelementptr inbounds ptr, ptr %119, i64 2
  %121 = load ptr, ptr %120, align 8, !tbaa !9
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.4, ptr noundef %121) #10
  call void @exit(i32 noundef 1) #11
  unreachable

123:                                              ; preds = %110
  %124 = load ptr, ptr %5, align 8, !tbaa !9
  %125 = getelementptr inbounds ptr, ptr %124, i64 0
  %126 = load ptr, ptr %125, align 8, !tbaa !9
  %127 = call i32 @strrcmp_i(ptr noundef %126, ptr noundef @.str.5)
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %158, label %129

129:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #10
  store i64 0, ptr %19, align 8, !tbaa !19
  %130 = load ptr, ptr %13, align 8, !tbaa !9
  %131 = call ptr @setup_line(ptr noundef %130)
  store ptr %131, ptr %14, align 8, !tbaa !9
  br label %132

132:                                              ; preds = %154, %129
  %133 = load ptr, ptr %14, align 8, !tbaa !9
  %134 = icmp ne ptr %133, null
  br i1 %134, label %135, label %157

135:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #10
  %136 = load i64, ptr %19, align 8, !tbaa !19
  %137 = add nsw i64 %136, 1
  store i64 %137, ptr %19, align 8, !tbaa !19
  %138 = load i64, ptr %19, align 8, !tbaa !19
  %139 = and i64 %138, 4095
  %140 = icmp ne i64 %139, 0
  br i1 %140, label %144, label %141

141:                                              ; preds = %135
  %142 = load i64, ptr %19, align 8, !tbaa !19
  %143 = trunc i64 %142 to i32
  call void @spinnit(ptr noundef @.str.6, i32 noundef %143)
  br label %144

144:                                              ; preds = %141, %135
  %145 = load ptr, ptr %14, align 8, !tbaa !9
  %146 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %145, ptr noundef @.str.7, ptr noundef %20) #10
  %147 = icmp eq i32 %146, 1
  br i1 %147, label %148, label %154

148:                                              ; preds = %144
  %149 = load ptr, ptr %9, align 8, !tbaa !9
  %150 = load i64, ptr %20, align 8, !tbaa !19
  %151 = getelementptr inbounds i64, ptr %149, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !19
  %153 = add nsw i64 %152, 1
  store i64 %153, ptr %151, align 8, !tbaa !19
  br label %154

154:                                              ; preds = %148, %144
  %155 = load ptr, ptr %13, align 8, !tbaa !9
  %156 = call ptr @setup_line(ptr noundef %155)
  store ptr %156, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #10
  br label %132, !llvm.loop !22

157:                                              ; preds = %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #10
  br label %158

158:                                              ; preds = %157, %123
  %159 = load ptr, ptr %5, align 8, !tbaa !9
  %160 = getelementptr inbounds ptr, ptr %159, i64 0
  %161 = load ptr, ptr %160, align 8, !tbaa !9
  %162 = call i32 @strrcmp_i(ptr noundef %161, ptr noundef @.str.8)
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %170

164:                                              ; preds = %158
  %165 = load ptr, ptr %5, align 8, !tbaa !9
  %166 = getelementptr inbounds ptr, ptr %165, i64 0
  %167 = load ptr, ptr %166, align 8, !tbaa !9
  %168 = call i32 @strrcmp_i(ptr noundef %167, ptr noundef @.str.9)
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %197, label %170

170:                                              ; preds = %164, %158
  %171 = load ptr, ptr %13, align 8, !tbaa !9
  %172 = call ptr @setup_line(ptr noundef %171)
  store ptr %172, ptr %14, align 8, !tbaa !9
  br label %173

173:                                              ; preds = %193, %170
  %174 = load ptr, ptr %14, align 8, !tbaa !9
  %175 = icmp ne ptr %174, null
  br i1 %175, label %176, label %196

176:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #10
  %177 = load ptr, ptr %14, align 8, !tbaa !9
  %178 = call ptr @strchr(ptr noundef %177, i32 noundef 58) #12
  store ptr %178, ptr %21, align 8, !tbaa !9
  %179 = load ptr, ptr %21, align 8, !tbaa !9
  %180 = icmp ne ptr %179, null
  br i1 %180, label %181, label %193

181:                                              ; preds = %176
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %182 = load ptr, ptr %14, align 8, !tbaa !9
  %183 = call i64 @atol(ptr noundef %182) #12
  store i64 %183, ptr %22, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %184 = load ptr, ptr %21, align 8, !tbaa !9
  %185 = getelementptr inbounds i8, ptr %184, i64 1
  %186 = call i64 @atol(ptr noundef %185) #12
  store i64 %186, ptr %23, align 8, !tbaa !19
  %187 = load i64, ptr %23, align 8, !tbaa !19
  %188 = load ptr, ptr %9, align 8, !tbaa !9
  %189 = load i64, ptr %22, align 8, !tbaa !19
  %190 = getelementptr inbounds i64, ptr %188, i64 %189
  %191 = load i64, ptr %190, align 8, !tbaa !19
  %192 = add nsw i64 %191, %187
  store i64 %192, ptr %190, align 8, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  br label %193

193:                                              ; preds = %181, %176
  %194 = load ptr, ptr %13, align 8, !tbaa !9
  %195 = call ptr @setup_line(ptr noundef %194)
  store ptr %195, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  br label %173, !llvm.loop !23

196:                                              ; preds = %173
  br label %197

197:                                              ; preds = %196, %164
  %198 = load ptr, ptr %13, align 8, !tbaa !9
  %199 = call i32 @fclose(ptr noundef %198)
  %200 = load i32, ptr %10, align 4, !tbaa !5
  %201 = load ptr, ptr %9, align 8, !tbaa !9
  %202 = load ptr, ptr %8, align 8, !tbaa !9
  call void @build_tree_from_lengths0(i32 noundef %200, ptr noundef %201, ptr noundef %202)
  %203 = load ptr, ptr %8, align 8, !tbaa !9
  %204 = load ptr, ptr %7, align 8, !tbaa !9
  %205 = getelementptr inbounds %struct.static_codebook, ptr %204, i32 0, i32 2
  store ptr %203, ptr %205, align 8, !tbaa !24
  %206 = load ptr, ptr @stdout, align 8, !tbaa !9
  %207 = load ptr, ptr %15, align 8, !tbaa !9
  %208 = load ptr, ptr %7, align 8, !tbaa !9
  call void @write_codebook(ptr noundef %206, ptr noundef %207, ptr noundef %208)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #10
  %209 = load ptr, ptr %7, align 8, !tbaa !9
  %210 = call i64 @_book_maptype1_quantvals(ptr noundef %209)
  store i64 %210, ptr %24, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #10
  %211 = load ptr, ptr %7, align 8, !tbaa !9
  %212 = getelementptr inbounds %struct.static_codebook, ptr %211, i32 0, i32 2
  %213 = load ptr, ptr %212, align 8, !tbaa !24
  %214 = getelementptr inbounds i64, ptr %213, i64 0
  %215 = load i64, ptr %214, align 8, !tbaa !19
  store i64 %215, ptr %27, align 8, !tbaa !19
  store i64 0, ptr %25, align 8, !tbaa !19
  br label %216

216:                                              ; preds = %238, %197
  %217 = load i64, ptr %25, align 8, !tbaa !19
  %218 = load i32, ptr %10, align 4, !tbaa !5
  %219 = sext i32 %218 to i64
  %220 = icmp slt i64 %217, %219
  br i1 %220, label %221, label %241

221:                                              ; preds = %216
  %222 = load ptr, ptr %7, align 8, !tbaa !9
  %223 = getelementptr inbounds %struct.static_codebook, ptr %222, i32 0, i32 2
  %224 = load ptr, ptr %223, align 8, !tbaa !24
  %225 = load i64, ptr %25, align 8, !tbaa !19
  %226 = getelementptr inbounds i64, ptr %224, i64 %225
  %227 = load i64, ptr %226, align 8, !tbaa !19
  %228 = load i64, ptr %27, align 8, !tbaa !19
  %229 = icmp sgt i64 %227, %228
  br i1 %229, label %230, label %237

230:                                              ; preds = %221
  %231 = load ptr, ptr %7, align 8, !tbaa !9
  %232 = getelementptr inbounds %struct.static_codebook, ptr %231, i32 0, i32 2
  %233 = load ptr, ptr %232, align 8, !tbaa !24
  %234 = load i64, ptr %25, align 8, !tbaa !19
  %235 = getelementptr inbounds i64, ptr %233, i64 %234
  %236 = load i64, ptr %235, align 8, !tbaa !19
  store i64 %236, ptr %27, align 8, !tbaa !19
  br label %237

237:                                              ; preds = %230, %221
  br label %238

238:                                              ; preds = %237
  %239 = load i64, ptr %25, align 8, !tbaa !19
  %240 = add nsw i64 %239, 1
  store i64 %240, ptr %25, align 8, !tbaa !19
  br label %216, !llvm.loop !25

241:                                              ; preds = %216
  store i64 0, ptr %16, align 8, !tbaa !19
  br label %242

242:                                              ; preds = %325, %241
  %243 = load i64, ptr %16, align 8, !tbaa !19
  %244 = load i32, ptr %10, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = icmp slt i64 %243, %245
  br i1 %246, label %247, label %328

247:                                              ; preds = %242
  %248 = load ptr, ptr %7, align 8, !tbaa !9
  %249 = getelementptr inbounds %struct.static_codebook, ptr %248, i32 0, i32 2
  %250 = load ptr, ptr %249, align 8, !tbaa !24
  %251 = load i64, ptr %16, align 8, !tbaa !19
  %252 = getelementptr inbounds i64, ptr %250, i64 %251
  %253 = load i64, ptr %252, align 8, !tbaa !19
  %254 = icmp ne i64 %253, 0
  br i1 %254, label %255, label %324

255:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #10
  store i32 1, ptr %28, align 4, !tbaa !5
  %256 = load ptr, ptr @stderr, align 8, !tbaa !9
  %257 = load i64, ptr %16, align 8, !tbaa !19
  %258 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %256, ptr noundef @.str.10, i64 noundef %257) #10
  store i64 0, ptr %26, align 8, !tbaa !19
  br label %259

259:                                              ; preds = %298, %255
  %260 = load i64, ptr %26, align 8, !tbaa !19
  %261 = load ptr, ptr %7, align 8, !tbaa !9
  %262 = getelementptr inbounds %struct.static_codebook, ptr %261, i32 0, i32 0
  %263 = load i64, ptr %262, align 8, !tbaa !26
  %264 = icmp slt i64 %260, %263
  br i1 %264, label %265, label %301

265:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #10
  %266 = load i64, ptr %16, align 8, !tbaa !19
  %267 = load i32, ptr %28, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = sdiv i64 %266, %268
  %270 = load i64, ptr %24, align 8, !tbaa !19
  %271 = srem i64 %269, %270
  %272 = trunc i64 %271 to i32
  store i32 %272, ptr %29, align 4, !tbaa !5
  %273 = load ptr, ptr @stderr, align 8, !tbaa !9
  %274 = load ptr, ptr %7, align 8, !tbaa !9
  %275 = getelementptr inbounds %struct.static_codebook, ptr %274, i32 0, i32 8
  %276 = load ptr, ptr %275, align 8, !tbaa !27
  %277 = load i32, ptr %29, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds i64, ptr %276, i64 %278
  %280 = load i64, ptr %279, align 8, !tbaa !19
  %281 = sitofp i64 %280 to float
  %282 = load ptr, ptr %7, align 8, !tbaa !9
  %283 = getelementptr inbounds %struct.static_codebook, ptr %282, i32 0, i32 5
  %284 = load i64, ptr %283, align 8, !tbaa !28
  %285 = call float @_float32_unpack(i64 noundef %284)
  %286 = load ptr, ptr %7, align 8, !tbaa !9
  %287 = getelementptr inbounds %struct.static_codebook, ptr %286, i32 0, i32 4
  %288 = load i64, ptr %287, align 8, !tbaa !29
  %289 = call float @_float32_unpack(i64 noundef %288)
  %290 = call float @llvm.fmuladd.f32(float %281, float %285, float %289)
  %291 = fpext float %290 to double
  %292 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %273, ptr noundef @.str.11, double noundef %291) #10
  %293 = load i64, ptr %24, align 8, !tbaa !19
  %294 = load i32, ptr %28, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = mul nsw i64 %295, %293
  %297 = trunc i64 %296 to i32
  store i32 %297, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #10
  br label %298

298:                                              ; preds = %265
  %299 = load i64, ptr %26, align 8, !tbaa !19
  %300 = add nsw i64 %299, 1
  store i64 %300, ptr %26, align 8, !tbaa !19
  br label %259, !llvm.loop !30

301:                                              ; preds = %259
  %302 = load ptr, ptr @stderr, align 8, !tbaa !9
  %303 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %302, ptr noundef @.str.12) #10
  store i64 0, ptr %26, align 8, !tbaa !19
  br label %304

304:                                              ; preds = %318, %301
  %305 = load i64, ptr %26, align 8, !tbaa !19
  %306 = load i64, ptr %27, align 8, !tbaa !19
  %307 = load ptr, ptr %7, align 8, !tbaa !9
  %308 = getelementptr inbounds %struct.static_codebook, ptr %307, i32 0, i32 2
  %309 = load ptr, ptr %308, align 8, !tbaa !24
  %310 = load i64, ptr %16, align 8, !tbaa !19
  %311 = getelementptr inbounds i64, ptr %309, i64 %310
  %312 = load i64, ptr %311, align 8, !tbaa !19
  %313 = sub nsw i64 %306, %312
  %314 = icmp slt i64 %305, %313
  br i1 %314, label %315, label %321

315:                                              ; preds = %304
  %316 = load ptr, ptr @stderr, align 8, !tbaa !9
  %317 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %316, ptr noundef @.str.13) #10
  br label %318

318:                                              ; preds = %315
  %319 = load i64, ptr %26, align 8, !tbaa !19
  %320 = add nsw i64 %319, 1
  store i64 %320, ptr %26, align 8, !tbaa !19
  br label %304, !llvm.loop !31

321:                                              ; preds = %304
  %322 = load ptr, ptr @stderr, align 8, !tbaa !9
  %323 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %322, ptr noundef @.str.14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #10
  br label %324

324:                                              ; preds = %321, %247
  br label %325

325:                                              ; preds = %324
  %326 = load i64, ptr %16, align 8, !tbaa !19
  %327 = add nsw i64 %326, 1
  store i64 %327, ptr %16, align 8, !tbaa !19
  br label %242, !llvm.loop !32

328:                                              ; preds = %242
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  %329 = load ptr, ptr @stderr, align 8, !tbaa !9
  %330 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %329, ptr noundef @.str.15) #10
  call void @exit(i32 noundef 0) #11
  unreachable
}

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #2

declare ptr @codebook_load(ptr noundef) #4

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strrchr(ptr noundef, i32 noundef) #5

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #6

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #7

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

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

declare ptr @setup_line(ptr noundef) #4

declare void @spinnit(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strchr(ptr noundef, i32 noundef) #5

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr noundef nonnull) #8

declare i32 @fclose(ptr noundef) #4

declare void @build_tree_from_lengths0(i32 noundef, ptr noundef, ptr noundef) #4

declare void @write_codebook(ptr noundef, ptr noundef, ptr noundef) #4

declare i64 @_book_maptype1_quantvals(ptr noundef) #4

declare float @_float32_unpack(i64 noundef) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #9

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"codebook", !13, i64 0, !13, i64 8, !13, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88}
!13 = !{!"long", !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !6, i64 24}
!16 = !{!"static_codebook", !13, i64 0, !13, i64 8, !10, i64 16, !6, i64 24, !13, i64 32, !13, i64 40, !6, i64 48, !6, i64 52, !10, i64 56, !6, i64 64}
!17 = !{!12, !13, i64 8}
!18 = !{!12, !13, i64 0}
!19 = !{!13, !13, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = !{!16, !10, i64 16}
!25 = distinct !{!25, !21}
!26 = !{!16, !13, i64 0}
!27 = !{!16, !10, i64 56}
!28 = !{!16, !13, i64 40}
!29 = !{!16, !13, i64 32}
!30 = distinct !{!30, !21}
!31 = distinct !{!31, !21}
!32 = distinct !{!32, !21}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [46 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [9 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [62 x i8], align 1

; Function Attrs: noreturn nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %10

7:                                                ; preds = %2
  %8 = load ptr, ptr @stderr, align 8, !tbaa !5
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str) #13
  tail call void @exit(i32 noundef 1) #14
  unreachable

10:                                               ; preds = %2
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %17

14:                                               ; preds = %10
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str.1) #13
  tail call void @exit(i32 noundef 1) #14
  unreachable

17:                                               ; preds = %10
  %18 = getelementptr inbounds i8, ptr %1, i64 24
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %.not = icmp eq ptr %19, null
  %spec.select = zext i1 %.not to i64
  %20 = tail call noalias ptr @strdup(ptr noundef nonnull %5) #15
  %21 = tail call ptr @codebook_load(ptr noundef %20) #15
  %22 = getelementptr inbounds i8, ptr %21, i64 24
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  %24 = tail call ptr @strrchr(ptr noundef nonnull dereferenceable(1) %20, i32 noundef 46) #16
  %.not102 = icmp eq ptr %24, null
  br i1 %.not102, label %26, label %25

25:                                               ; preds = %17
  store i8 0, ptr %24, align 1, !tbaa !13
  br label %26

26:                                               ; preds = %17, %25
  %27 = tail call noalias ptr @strdup(ptr noundef %20) #15
  %28 = getelementptr inbounds i8, ptr %23, i64 24
  %29 = load i32, ptr %28, align 8, !tbaa !14
  %.not103 = icmp eq i32 %29, 1
  br i1 %.not103, label %33, label %30

30:                                               ; preds = %26
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.2) #13
  tail call void @exit(i32 noundef 1) #14
  unreachable

33:                                               ; preds = %26
  %34 = getelementptr inbounds i8, ptr %21, i64 8
  %35 = load i64, ptr %34, align 8, !tbaa !16
  %36 = trunc i64 %35 to i32
  %sext = shl i64 %35, 32
  %37 = ashr exact i64 %sext, 32
  %38 = ashr exact i64 %sext, 29
  %39 = tail call noalias ptr @malloc(i64 noundef %38) #17
  %40 = tail call noalias ptr @calloc(i64 noundef %37, i64 noundef 8) #18
  %41 = icmp sgt i64 %37, 0
  br i1 %41, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %33
  %min.iters.check = icmp ult i64 %37, 4
  br i1 %min.iters.check, label %.lr.ph.preheader163, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.mod.vf = and i64 %35, 3
  %n.vec = sub nsw i64 %37, %n.mod.vf
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %spec.select, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %42 = getelementptr inbounds i64, ptr %39, i64 %index
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store <2 x i64> %broadcast.splat, ptr %42, align 8, !tbaa !17
  store <2 x i64> %broadcast.splat, ptr %43, align 8, !tbaa !17
  %index.next = add nuw i64 %index, 4
  %44 = icmp eq i64 %index.next, %n.vec
  br i1 %44, label %middle.block, label %vector.body, !llvm.loop !18

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.mod.vf, 0
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader163

.lr.ph.preheader163:                              ; preds = %middle.block, %.lr.ph.preheader
  %.095117.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader163, %.lr.ph
  %.095117 = phi i64 [ %46, %.lr.ph ], [ %.095117.ph, %.lr.ph.preheader163 ]
  %45 = getelementptr inbounds i64, ptr %39, i64 %.095117
  store i64 %spec.select, ptr %45, align 8, !tbaa !17
  %46 = add nuw nsw i64 %.095117, 1
  %exitcond.not = icmp eq i64 %46, %37
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %33
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = tail call noalias ptr @fopen(ptr noundef %47, ptr noundef nonnull @.str.3)
  %.not104 = icmp eq ptr %48, null
  br i1 %.not104, label %49, label %53

49:                                               ; preds = %._crit_edge
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = load ptr, ptr %11, align 8, !tbaa !5
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.4, ptr noundef %51) #13
  tail call void @exit(i32 noundef 1) #14
  unreachable

53:                                               ; preds = %._crit_edge
  %54 = load ptr, ptr %1, align 8, !tbaa !5
  %55 = tail call i32 @strrcmp_i(ptr noundef %54, ptr noundef nonnull @.str.5)
  %.not105 = icmp eq i32 %55, 0
  br i1 %.not105, label %56, label %.loopexit116

56:                                               ; preds = %53
  %57 = tail call ptr @setup_line(ptr noundef nonnull %48) #15
  %.not106118 = icmp eq ptr %57, null
  br i1 %.not106118, label %.loopexit116, label %.lr.ph122

.lr.ph122:                                        ; preds = %56, %70
  %.091120 = phi ptr [ %71, %70 ], [ %57, %56 ]
  %.093119 = phi i64 [ %58, %70 ], [ 0, %56 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #15
  %58 = add nuw nsw i64 %.093119, 1
  %59 = and i64 %58, 4095
  %.not107 = icmp eq i64 %59, 0
  br i1 %.not107, label %60, label %62

60:                                               ; preds = %.lr.ph122
  %61 = trunc i64 %58 to i32
  call void @spinnit(ptr noundef nonnull @.str.6, i32 noundef %61) #15
  br label %62

62:                                               ; preds = %60, %.lr.ph122
  %63 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %.091120, ptr noundef nonnull @.str.7, ptr noundef nonnull %3) #15
  %64 = icmp eq i32 %63, 1
  br i1 %64, label %65, label %70

65:                                               ; preds = %62
  %66 = load i64, ptr %3, align 8, !tbaa !17
  %67 = getelementptr inbounds i64, ptr %39, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !17
  %69 = add nsw i64 %68, 1
  store i64 %69, ptr %67, align 8, !tbaa !17
  br label %70

70:                                               ; preds = %65, %62
  %71 = call ptr @setup_line(ptr noundef nonnull %48) #15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #15
  %.not106 = icmp eq ptr %71, null
  br i1 %.not106, label %.loopexit116, label %.lr.ph122, !llvm.loop !23

.loopexit116:                                     ; preds = %70, %56, %53
  %72 = load ptr, ptr %1, align 8, !tbaa !5
  %73 = call i32 @strrcmp_i(ptr noundef %72, ptr noundef nonnull @.str.8)
  %.not108 = icmp eq i32 %73, 0
  br i1 %.not108, label %77, label %74

74:                                               ; preds = %.loopexit116
  %75 = load ptr, ptr %1, align 8, !tbaa !5
  %76 = call i32 @strrcmp_i(ptr noundef %75, ptr noundef nonnull @.str.9)
  %.not109 = icmp eq i32 %76, 0
  br i1 %.not109, label %77, label %.loopexit

77:                                               ; preds = %74, %.loopexit116
  %78 = call ptr @setup_line(ptr noundef nonnull %48) #15
  %.not110123 = icmp eq ptr %78, null
  br i1 %.not110123, label %.loopexit, label %.lr.ph126

.lr.ph126:                                        ; preds = %77, %87
  %.192124 = phi ptr [ %88, %87 ], [ %78, %77 ]
  %79 = call ptr @strchr(ptr noundef nonnull dereferenceable(1) %.192124, i32 noundef 58) #16
  %.not111 = icmp eq ptr %79, null
  br i1 %.not111, label %87, label %80

80:                                               ; preds = %.lr.ph126
  %81 = call i64 @atol(ptr nocapture noundef %.192124) #16
  %82 = getelementptr inbounds i8, ptr %79, i64 1
  %83 = call i64 @atol(ptr nocapture noundef %82) #16
  %84 = getelementptr inbounds i64, ptr %39, i64 %81
  %85 = load i64, ptr %84, align 8, !tbaa !17
  %86 = add nsw i64 %85, %83
  store i64 %86, ptr %84, align 8, !tbaa !17
  br label %87

87:                                               ; preds = %80, %.lr.ph126
  %88 = call ptr @setup_line(ptr noundef nonnull %48) #15
  %.not110 = icmp eq ptr %88, null
  br i1 %.not110, label %.loopexit, label %.lr.ph126, !llvm.loop !24

.loopexit:                                        ; preds = %87, %77, %74
  %89 = call i32 @fclose(ptr noundef nonnull %48)
  call void @build_tree_from_lengths0(i32 noundef %36, ptr noundef %39, ptr noundef %40) #15
  %90 = getelementptr inbounds i8, ptr %23, i64 16
  store ptr %40, ptr %90, align 8, !tbaa !25
  %91 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @write_codebook(ptr noundef %91, ptr noundef %27, ptr noundef %23) #15
  %92 = call i64 @_book_maptype1_quantvals(ptr noundef %23) #15
  %93 = load ptr, ptr %90, align 8, !tbaa !25
  %94 = load i64, ptr %93, align 8, !tbaa !17
  br i1 %41, label %.lr.ph130.preheader, label %._crit_edge143

.lr.ph130.preheader:                              ; preds = %.loopexit
  %min.iters.check149 = icmp ult i64 %37, 4
  br i1 %min.iters.check149, label %.lr.ph130.preheader160, label %vector.ph150

.lr.ph130.preheader160:                           ; preds = %middle.block147, %.lr.ph130.preheader
  %.086128.ph = phi i64 [ %94, %.lr.ph130.preheader ], [ %100, %middle.block147 ]
  %.089127.ph = phi i64 [ 0, %.lr.ph130.preheader ], [ %n.vec152, %middle.block147 ]
  br label %.lr.ph130

vector.ph150:                                     ; preds = %.lr.ph130.preheader
  %n.mod.vf151 = and i64 %35, 3
  %n.vec152 = sub nsw i64 %37, %n.mod.vf151
  %minmax.ident.splatinsert = insertelement <2 x i64> poison, i64 %94, i64 0
  %minmax.ident.splat = shufflevector <2 x i64> %minmax.ident.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body154

vector.body154:                                   ; preds = %vector.body154, %vector.ph150
  %index155 = phi i64 [ 0, %vector.ph150 ], [ %index.next158, %vector.body154 ]
  %vec.phi = phi <2 x i64> [ %minmax.ident.splat, %vector.ph150 ], [ %97, %vector.body154 ]
  %vec.phi156 = phi <2 x i64> [ %minmax.ident.splat, %vector.ph150 ], [ %98, %vector.body154 ]
  %95 = getelementptr inbounds i64, ptr %93, i64 %index155
  %96 = getelementptr inbounds i8, ptr %95, i64 16
  %wide.load = load <2 x i64>, ptr %95, align 8, !tbaa !17
  %wide.load157 = load <2 x i64>, ptr %96, align 8, !tbaa !17
  %97 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load, <2 x i64> %vec.phi)
  %98 = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %wide.load157, <2 x i64> %vec.phi156)
  %index.next158 = add nuw i64 %index155, 4
  %99 = icmp eq i64 %index.next158, %n.vec152
  br i1 %99, label %middle.block147, label %vector.body154, !llvm.loop !26

middle.block147:                                  ; preds = %vector.body154
  %rdx.minmax = call <2 x i64> @llvm.smax.v2i64(<2 x i64> %97, <2 x i64> %98)
  %100 = call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
  %cmp.n159 = icmp eq i64 %n.mod.vf151, 0
  br i1 %cmp.n159, label %.preheader, label %.lr.ph130.preheader160

.preheader:                                       ; preds = %.lr.ph130, %middle.block147
  %spec.select115.lcssa = phi i64 [ %100, %middle.block147 ], [ %spec.select115, %.lr.ph130 ]
  br i1 %41, label %.lr.ph142, label %._crit_edge143

.lr.ph142:                                        ; preds = %.preheader
  %101 = getelementptr inbounds i8, ptr %23, i64 56
  %102 = getelementptr inbounds i8, ptr %23, i64 40
  %103 = getelementptr inbounds i8, ptr %23, i64 32
  br label %107

.lr.ph130:                                        ; preds = %.lr.ph130.preheader160, %.lr.ph130
  %.086128 = phi i64 [ %spec.select115, %.lr.ph130 ], [ %.086128.ph, %.lr.ph130.preheader160 ]
  %.089127 = phi i64 [ %106, %.lr.ph130 ], [ %.089127.ph, %.lr.ph130.preheader160 ]
  %104 = getelementptr inbounds i64, ptr %93, i64 %.089127
  %105 = load i64, ptr %104, align 8, !tbaa !17
  %spec.select115 = call i64 @llvm.smax.i64(i64 %105, i64 %.086128)
  %106 = add nuw nsw i64 %.089127, 1
  %exitcond144.not = icmp eq i64 %106, %37
  br i1 %exitcond144.not, label %.preheader, label %.lr.ph130, !llvm.loop !27

107:                                              ; preds = %.lr.ph142, %152
  %.196140 = phi i64 [ 0, %.lr.ph142 ], [ %153, %152 ]
  %108 = load ptr, ptr %90, align 8, !tbaa !25
  %109 = getelementptr inbounds i64, ptr %108, i64 %.196140
  %110 = load i64, ptr %109, align 8, !tbaa !17
  %.not112 = icmp eq i64 %110, 0
  br i1 %.not112, label %152, label %111

111:                                              ; preds = %107
  %112 = load ptr, ptr @stderr, align 8, !tbaa !5
  %113 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %112, ptr noundef nonnull @.str.10, i64 noundef %.196140) #13
  %114 = load i64, ptr %23, align 8, !tbaa !28
  %115 = icmp sgt i64 %114, 0
  br i1 %115, label %.lr.ph134, label %._crit_edge135

.lr.ph134:                                        ; preds = %111, %.lr.ph134
  %.0132 = phi i64 [ %132, %.lr.ph134 ], [ 1, %111 ]
  %.087131 = phi i64 [ %133, %.lr.ph134 ], [ 0, %111 ]
  %sext113 = shl i64 %.0132, 32
  %116 = ashr exact i64 %sext113, 32
  %117 = sdiv i64 %.196140, %116
  %118 = srem i64 %117, %92
  %119 = load ptr, ptr @stderr, align 8, !tbaa !5
  %120 = load ptr, ptr %101, align 8, !tbaa !29
  %sext114 = shl i64 %118, 32
  %121 = ashr exact i64 %sext114, 29
  %122 = getelementptr inbounds i8, ptr %120, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !17
  %124 = sitofp i64 %123 to float
  %125 = load i64, ptr %102, align 8, !tbaa !30
  %126 = call float @_float32_unpack(i64 noundef %125) #15
  %127 = load i64, ptr %103, align 8, !tbaa !31
  %128 = call float @_float32_unpack(i64 noundef %127) #15
  %129 = call float @llvm.fmuladd.f32(float %124, float %126, float %128)
  %130 = fpext float %129 to double
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef nonnull @.str.11, double noundef %130) #13
  %132 = mul nsw i64 %116, %92
  %133 = add nuw nsw i64 %.087131, 1
  %134 = load i64, ptr %23, align 8, !tbaa !28
  %135 = icmp slt i64 %133, %134
  br i1 %135, label %.lr.ph134, label %._crit_edge135, !llvm.loop !32

._crit_edge135:                                   ; preds = %.lr.ph134, %111
  %136 = load ptr, ptr @stderr, align 8, !tbaa !5
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef nonnull @.str.12) #13
  %138 = load ptr, ptr %90, align 8, !tbaa !25
  %139 = getelementptr inbounds i64, ptr %138, i64 %.196140
  %140 = load i64, ptr %139, align 8, !tbaa !17
  %141 = icmp slt i64 %140, %spec.select115.lcssa
  br i1 %141, label %.lr.ph138, label %._crit_edge139

.lr.ph138:                                        ; preds = %._crit_edge135, %.lr.ph138
  %.188136 = phi i64 [ %144, %.lr.ph138 ], [ 0, %._crit_edge135 ]
  %142 = load ptr, ptr @stderr, align 8, !tbaa !5
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef nonnull @.str.13) #13
  %144 = add nuw nsw i64 %.188136, 1
  %145 = load ptr, ptr %90, align 8, !tbaa !25
  %146 = getelementptr inbounds i64, ptr %145, i64 %.196140
  %147 = load i64, ptr %146, align 8, !tbaa !17
  %148 = sub nsw i64 %spec.select115.lcssa, %147
  %149 = icmp slt i64 %144, %148
  br i1 %149, label %.lr.ph138, label %._crit_edge139, !llvm.loop !33

._crit_edge139:                                   ; preds = %.lr.ph138, %._crit_edge135
  %150 = load ptr, ptr @stderr, align 8, !tbaa !5
  %151 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %150, ptr noundef nonnull @.str.14) #13
  br label %152

152:                                              ; preds = %107, %._crit_edge139
  %153 = add nuw nsw i64 %.196140, 1
  %exitcond145.not = icmp eq i64 %153, %37
  br i1 %exitcond145.not, label %._crit_edge143, label %107, !llvm.loop !34

._crit_edge143:                                   ; preds = %152, %.loopexit, %.preheader
  %154 = load ptr, ptr @stderr, align 8, !tbaa !5
  %155 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %154, ptr noundef nonnull @.str.15) #13
  call void @exit(i32 noundef 0) #14
  unreachable
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #4

declare ptr @codebook_load(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #6

; 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #8

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @strrcmp_i(ptr noundef, ptr noundef) local_unnamed_addr #9

declare ptr @setup_line(ptr noundef) local_unnamed_addr #5

declare void @spinnit(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strchr(ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr nocapture noundef nonnull) local_unnamed_addr #10

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

declare void @build_tree_from_lengths0(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare void @write_codebook(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare i64 @_book_maptype1_quantvals(ptr noundef) local_unnamed_addr #5

declare float @_float32_unpack(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #11

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #12

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #12

attributes #0 = { noreturn 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { 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 #10 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #11 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #13 = { cold nounwind }
attributes #14 = { noreturn nounwind }
attributes #15 = { nounwind }
attributes #16 = { nounwind willreturn memory(read) }
attributes #17 = { nounwind allocsize(0) }
attributes #18 = { nounwind allocsize(0,1) }

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

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


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