; LLVM IR from introlab/odas :: src/init (scanning)

; 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.mics_obj = type { i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.scans_obj = type { i32, ptr, ptr, ptr, ptr, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local ptr @scanning_init_scans(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7, ptr noundef %8, float noundef %9, i32 noundef %10, i32 noundef %11, float noundef %12, i32 noundef %13) #0 {
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca float, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca float, align 4
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca ptr, align 8
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca ptr, align 8
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca ptr, align 8
  %38 = alloca ptr, align 8
  store ptr %0, ptr %15, align 8, !tbaa !5
  store ptr %1, ptr %16, align 8, !tbaa !5
  store i32 %2, ptr %17, align 4, !tbaa !9
  store ptr %3, ptr %18, align 8, !tbaa !5
  store i32 %4, ptr %19, align 4, !tbaa !9
  store ptr %5, ptr %20, align 8, !tbaa !5
  store i32 %6, ptr %21, align 4, !tbaa !9
  store i32 %7, ptr %22, align 4, !tbaa !9
  store ptr %8, ptr %23, align 8, !tbaa !5
  store float %9, ptr %24, align 4, !tbaa !11
  store i32 %10, ptr %25, align 4, !tbaa !9
  store i32 %11, ptr %26, align 4, !tbaa !9
  store float %12, ptr %27, align 4, !tbaa !11
  store i32 %13, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #5
  %39 = load i32, ptr %17, align 4, !tbaa !9
  %40 = call ptr @scans_construct_null(i32 noundef %39)
  store ptr %40, ptr %29, align 8, !tbaa !5
  %41 = load ptr, ptr %15, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.mics_obj, ptr %41, i32 0, i32 1
  %43 = load i32, ptr %42, align 4, !tbaa !13
  %44 = call ptr @pairs_construct_zero(i32 noundef %43)
  %45 = load ptr, ptr %29, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.scans_obj, ptr %45, i32 0, i32 5
  store ptr %44, ptr %46, align 8, !tbaa !15
  %47 = load ptr, ptr %15, align 8, !tbaa !5
  %48 = load i32, ptr %26, align 4, !tbaa !9
  %49 = call ptr @directivity_beampattern_mics(ptr noundef %47, i32 noundef %48)
  store ptr %49, ptr %31, align 8, !tbaa !5
  %50 = load ptr, ptr %16, align 8, !tbaa !5
  %51 = load i32, ptr %26, align 4, !tbaa !9
  %52 = call ptr @directivity_beampattern_spatialfilters(ptr noundef %50, i32 noundef %51)
  store ptr %52, ptr %32, align 8, !tbaa !5
  %53 = load i32, ptr %17, align 4, !tbaa !9
  %54 = zext i32 %53 to i64
  %55 = mul i64 8, %54
  %56 = call noalias ptr @malloc(i64 noundef %55) #6
  store ptr %56, ptr %34, align 8, !tbaa !5
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %205, %14
  %58 = load i32, ptr %30, align 4, !tbaa !9
  %59 = load ptr, ptr %29, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.scans_obj, ptr %59, i32 0, i32 0
  %61 = load i32, ptr %60, align 8, !tbaa !17
  %62 = icmp ult i32 %58, %61
  br i1 %62, label %63, label %208

63:                                               ; preds = %57
  %64 = load ptr, ptr %18, align 8, !tbaa !5
  %65 = load i32, ptr %30, align 4, !tbaa !9
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %64, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = call ptr @space_sphere(i32 noundef %68)
  %70 = load ptr, ptr %29, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.scans_obj, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !18
  %73 = load i32, ptr %30, align 4, !tbaa !9
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds ptr, ptr %72, i64 %74
  store ptr %69, ptr %75, align 8, !tbaa !5
  %76 = load ptr, ptr %29, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.scans_obj, ptr %76, i32 0, i32 1
  %78 = load ptr, ptr %77, align 8, !tbaa !18
  %79 = load i32, ptr %30, align 4, !tbaa !9
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds ptr, ptr %78, i64 %80
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  %84 = load ptr, ptr %20, align 8, !tbaa !5
  %85 = load i32, ptr %19, align 4, !tbaa !9
  %86 = load i32, ptr %22, align 4, !tbaa !9
  %87 = load i32, ptr %28, align 4, !tbaa !9
  %88 = call ptr @delay_tdoas(ptr noundef %82, ptr noundef %83, ptr noundef %84, i32 noundef %85, i32 noundef %86, i32 noundef %87)
  %89 = load ptr, ptr %29, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.scans_obj, ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !19
  %92 = load i32, ptr %30, align 4, !tbaa !9
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds ptr, ptr %91, i64 %93
  store ptr %88, ptr %94, align 8, !tbaa !5
  %95 = load ptr, ptr %15, align 8, !tbaa !5
  %96 = load ptr, ptr %31, align 8, !tbaa !5
  %97 = load ptr, ptr %16, align 8, !tbaa !5
  %98 = load ptr, ptr %32, align 8, !tbaa !5
  %99 = load ptr, ptr %29, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.scans_obj, ptr %99, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !18
  %102 = load i32, ptr %30, align 4, !tbaa !9
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds ptr, ptr %101, i64 %103
  %105 = load ptr, ptr %104, align 8, !tbaa !5
  %106 = call ptr @directivity_spatialgains(ptr noundef %95, ptr noundef %96, ptr noundef %97, ptr noundef %98, ptr noundef %105)
  store ptr %106, ptr %33, align 8, !tbaa !5
  %107 = load ptr, ptr %33, align 8, !tbaa !5
  %108 = load float, ptr %27, align 4, !tbaa !11
  %109 = call ptr @directivity_spatialmasks(ptr noundef %107, float noundef %108)
  %110 = load ptr, ptr %34, align 8, !tbaa !5
  %111 = load i32, ptr %30, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds ptr, ptr %110, i64 %112
  store ptr %109, ptr %113, align 8, !tbaa !5
  %114 = load ptr, ptr %33, align 8, !tbaa !5
  call void @spatialgains_destroy(ptr noundef %114)
  %115 = load ptr, ptr %34, align 8, !tbaa !5
  %116 = load i32, ptr %30, align 4, !tbaa !9
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds ptr, ptr %115, i64 %117
  %119 = load ptr, ptr %118, align 8, !tbaa !5
  %120 = call ptr @directivity_pairs(ptr noundef %119)
  store ptr %120, ptr %35, align 8, !tbaa !5
  %121 = load ptr, ptr %29, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.scans_obj, ptr %121, i32 0, i32 5
  %123 = load ptr, ptr %122, align 8, !tbaa !15
  %124 = load ptr, ptr %35, align 8, !tbaa !5
  call void @directivity_pairsadd(ptr noundef %123, ptr noundef %124)
  %125 = load ptr, ptr %35, align 8, !tbaa !5
  call void @pairs_destroy(ptr noundef %125)
  %126 = load ptr, ptr %34, align 8, !tbaa !5
  %127 = load i32, ptr %30, align 4, !tbaa !9
  %128 = zext i32 %127 to i64
  %129 = getelementptr inbounds ptr, ptr %126, i64 %128
  %130 = load ptr, ptr %129, align 8, !tbaa !5
  %131 = call ptr @directivity_spatialindexes(ptr noundef %130)
  %132 = load ptr, ptr %29, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.scans_obj, ptr %132, i32 0, i32 4
  %134 = load ptr, ptr %133, align 8, !tbaa !20
  %135 = load i32, ptr %30, align 4, !tbaa !9
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds ptr, ptr %134, i64 %136
  store ptr %131, ptr %137, align 8, !tbaa !5
  %138 = load ptr, ptr %23, align 8, !tbaa !5
  %139 = load i32, ptr %30, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = getelementptr inbounds i32, ptr %138, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !9
  %143 = icmp slt i32 %142, 0
  br i1 %143, label %144, label %184

144:                                              ; preds = %63
  %145 = load ptr, ptr %29, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.scans_obj, ptr %145, i32 0, i32 1
  %147 = load ptr, ptr %146, align 8, !tbaa !18
  %148 = load i32, ptr %30, align 4, !tbaa !9
  %149 = zext i32 %148 to i64
  %150 = getelementptr inbounds ptr, ptr %147, i64 %149
  %151 = load ptr, ptr %150, align 8, !tbaa !5
  %152 = load i32, ptr %25, align 4, !tbaa !9
  %153 = call ptr @space_points_fine(ptr noundef %151, i32 noundef %152)
  store ptr %153, ptr %36, align 8, !tbaa !5
  %154 = load ptr, ptr %36, align 8, !tbaa !5
  %155 = load ptr, ptr %15, align 8, !tbaa !5
  %156 = load ptr, ptr %20, align 8, !tbaa !5
  %157 = load i32, ptr %19, align 4, !tbaa !9
  %158 = load i32, ptr %22, align 4, !tbaa !9
  %159 = load i32, ptr %28, align 4, !tbaa !9
  %160 = call ptr @delay_taus(ptr noundef %154, ptr noundef %155, ptr noundef %156, i32 noundef %157, i32 noundef %158, i32 noundef %159)
  store ptr %160, ptr %37, align 8, !tbaa !5
  %161 = load ptr, ptr %37, align 8, !tbaa !5
  %162 = load ptr, ptr %29, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.scans_obj, ptr %162, i32 0, i32 2
  %164 = load ptr, ptr %163, align 8, !tbaa !19
  %165 = load i32, ptr %30, align 4, !tbaa !9
  %166 = zext i32 %165 to i64
  %167 = getelementptr inbounds ptr, ptr %164, i64 %166
  %168 = load ptr, ptr %167, align 8, !tbaa !5
  %169 = load ptr, ptr %34, align 8, !tbaa !5
  %170 = load i32, ptr %30, align 4, !tbaa !9
  %171 = zext i32 %170 to i64
  %172 = getelementptr inbounds ptr, ptr %169, i64 %171
  %173 = load ptr, ptr %172, align 8, !tbaa !5
  %174 = load float, ptr %24, align 4, !tbaa !11
  %175 = call ptr @hit_train(ptr noundef %161, ptr noundef %168, ptr noundef %173, float noundef %174)
  %176 = load ptr, ptr %29, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.scans_obj, ptr %176, i32 0, i32 3
  %178 = load ptr, ptr %177, align 8, !tbaa !21
  %179 = load i32, ptr %30, align 4, !tbaa !9
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds ptr, ptr %178, i64 %180
  store ptr %175, ptr %181, align 8, !tbaa !5
  %182 = load ptr, ptr %36, align 8, !tbaa !5
  call void @points_destroy(ptr noundef %182)
  %183 = load ptr, ptr %37, align 8, !tbaa !5
  call void @taus_destroy(ptr noundef %183)
  br label %204

184:                                              ; preds = %63
  %185 = load ptr, ptr %29, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.scans_obj, ptr %185, i32 0, i32 2
  %187 = load ptr, ptr %186, align 8, !tbaa !19
  %188 = load i32, ptr %30, align 4, !tbaa !9
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds ptr, ptr %187, i64 %189
  %191 = load ptr, ptr %190, align 8, !tbaa !5
  %192 = load ptr, ptr %23, align 8, !tbaa !5
  %193 = load i32, ptr %30, align 4, !tbaa !9
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds i32, ptr %192, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !9
  %197 = call ptr @hit_constant(ptr noundef %191, i32 noundef %196)
  %198 = load ptr, ptr %29, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.scans_obj, ptr %198, i32 0, i32 3
  %200 = load ptr, ptr %199, align 8, !tbaa !21
  %201 = load i32, ptr %30, align 4, !tbaa !9
  %202 = zext i32 %201 to i64
  %203 = getelementptr inbounds ptr, ptr %200, i64 %202
  store ptr %197, ptr %203, align 8, !tbaa !5
  br label %204

204:                                              ; preds = %184, %144
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr %30, align 4, !tbaa !9
  %207 = add i32 %206, 1
  store i32 %207, ptr %30, align 4, !tbaa !9
  br label %57, !llvm.loop !22

208:                                              ; preds = %57
  %209 = load ptr, ptr %31, align 8, !tbaa !5
  call void @beampatterns_destroy(ptr noundef %209)
  %210 = load ptr, ptr %32, align 8, !tbaa !5
  call void @beampatterns_destroy(ptr noundef %210)
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %211

211:                                              ; preds = %290, %208
  %212 = load i32, ptr %30, align 4, !tbaa !9
  %213 = load ptr, ptr %29, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.scans_obj, ptr %213, i32 0, i32 0
  %215 = load i32, ptr %214, align 8, !tbaa !17
  %216 = icmp ult i32 %212, %215
  br i1 %216, label %217, label %293

217:                                              ; preds = %211
  %218 = load i32, ptr %30, align 4, !tbaa !9
  %219 = icmp eq i32 %218, 0
  br i1 %219, label %220, label %236

220:                                              ; preds = %217
  %221 = load ptr, ptr %29, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.scans_obj, ptr %221, i32 0, i32 2
  %223 = load ptr, ptr %222, align 8, !tbaa !19
  %224 = getelementptr inbounds ptr, ptr %223, i64 0
  %225 = load ptr, ptr %224, align 8, !tbaa !5
  %226 = load ptr, ptr %29, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.scans_obj, ptr %226, i32 0, i32 3
  %228 = load ptr, ptr %227, align 8, !tbaa !21
  %229 = getelementptr inbounds ptr, ptr %228, i64 0
  %230 = load ptr, ptr %229, align 8, !tbaa !5
  %231 = load ptr, ptr %34, align 8, !tbaa !5
  %232 = getelementptr inbounds ptr, ptr %231, i64 0
  %233 = load ptr, ptr %232, align 8, !tbaa !5
  %234 = load i32, ptr %21, align 4, !tbaa !9
  %235 = call ptr @linking_maps(ptr noundef null, ptr noundef %225, ptr noundef null, ptr noundef %230, ptr noundef null, ptr noundef %233, i32 noundef %234)
  store ptr %235, ptr %38, align 8, !tbaa !5
  br label %280

236:                                              ; preds = %217
  %237 = load ptr, ptr %29, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.scans_obj, ptr %237, i32 0, i32 2
  %239 = load ptr, ptr %238, align 8, !tbaa !19
  %240 = load i32, ptr %30, align 4, !tbaa !9
  %241 = sub i32 %240, 1
  %242 = zext i32 %241 to i64
  %243 = getelementptr inbounds ptr, ptr %239, i64 %242
  %244 = load ptr, ptr %243, align 8, !tbaa !5
  %245 = load ptr, ptr %29, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.scans_obj, ptr %245, i32 0, i32 2
  %247 = load ptr, ptr %246, align 8, !tbaa !19
  %248 = load i32, ptr %30, align 4, !tbaa !9
  %249 = zext i32 %248 to i64
  %250 = getelementptr inbounds ptr, ptr %247, i64 %249
  %251 = load ptr, ptr %250, align 8, !tbaa !5
  %252 = load ptr, ptr %29, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.scans_obj, ptr %252, i32 0, i32 3
  %254 = load ptr, ptr %253, align 8, !tbaa !21
  %255 = load i32, ptr %30, align 4, !tbaa !9
  %256 = sub i32 %255, 1
  %257 = zext i32 %256 to i64
  %258 = getelementptr inbounds ptr, ptr %254, i64 %257
  %259 = load ptr, ptr %258, align 8, !tbaa !5
  %260 = load ptr, ptr %29, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.scans_obj, ptr %260, i32 0, i32 3
  %262 = load ptr, ptr %261, align 8, !tbaa !21
  %263 = load i32, ptr %30, align 4, !tbaa !9
  %264 = zext i32 %263 to i64
  %265 = getelementptr inbounds ptr, ptr %262, i64 %264
  %266 = load ptr, ptr %265, align 8, !tbaa !5
  %267 = load ptr, ptr %34, align 8, !tbaa !5
  %268 = load i32, ptr %30, align 4, !tbaa !9
  %269 = sub i32 %268, 1
  %270 = zext i32 %269 to i64
  %271 = getelementptr inbounds ptr, ptr %267, i64 %270
  %272 = load ptr, ptr %271, align 8, !tbaa !5
  %273 = load ptr, ptr %34, align 8, !tbaa !5
  %274 = load i32, ptr %30, align 4, !tbaa !9
  %275 = zext i32 %274 to i64
  %276 = getelementptr inbounds ptr, ptr %273, i64 %275
  %277 = load ptr, ptr %276, align 8, !tbaa !5
  %278 = load i32, ptr %21, align 4, !tbaa !9
  %279 = call ptr @linking_maps(ptr noundef %244, ptr noundef %251, ptr noundef %259, ptr noundef %266, ptr noundef %272, ptr noundef %277, i32 noundef %278)
  store ptr %279, ptr %38, align 8, !tbaa !5
  br label %280

280:                                              ; preds = %236, %220
  %281 = load ptr, ptr %38, align 8, !tbaa !5
  %282 = call ptr @linking_indexes(ptr noundef %281)
  %283 = load ptr, ptr %29, align 8, !tbaa !5
  %284 = getelementptr inbounds %struct.scans_obj, ptr %283, i32 0, i32 6
  %285 = load ptr, ptr %284, align 8, !tbaa !24
  %286 = load i32, ptr %30, align 4, !tbaa !9
  %287 = zext i32 %286 to i64
  %288 = getelementptr inbounds ptr, ptr %285, i64 %287
  store ptr %282, ptr %288, align 8, !tbaa !5
  %289 = load ptr, ptr %38, align 8, !tbaa !5
  call void @maps_destroy(ptr noundef %289)
  br label %290

290:                                              ; preds = %280
  %291 = load i32, ptr %30, align 4, !tbaa !9
  %292 = add i32 %291, 1
  store i32 %292, ptr %30, align 4, !tbaa !9
  br label %211, !llvm.loop !25

293:                                              ; preds = %211
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %294

294:                                              ; preds = %306, %293
  %295 = load i32, ptr %30, align 4, !tbaa !9
  %296 = load ptr, ptr %29, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.scans_obj, ptr %296, i32 0, i32 0
  %298 = load i32, ptr %297, align 8, !tbaa !17
  %299 = icmp ult i32 %295, %298
  br i1 %299, label %300, label %309

300:                                              ; preds = %294
  %301 = load ptr, ptr %34, align 8, !tbaa !5
  %302 = load i32, ptr %30, align 4, !tbaa !9
  %303 = zext i32 %302 to i64
  %304 = getelementptr inbounds ptr, ptr %301, i64 %303
  %305 = load ptr, ptr %304, align 8, !tbaa !5
  call void @spatialmasks_destroy(ptr noundef %305)
  br label %306

306:                                              ; preds = %300
  %307 = load i32, ptr %30, align 4, !tbaa !9
  %308 = add i32 %307, 1
  store i32 %308, ptr %30, align 4, !tbaa !9
  br label %294, !llvm.loop !26

309:                                              ; preds = %294
  %310 = load ptr, ptr %34, align 8, !tbaa !5
  call void @free(ptr noundef %310) #5
  %311 = load ptr, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  ret ptr %311
}

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

declare ptr @scans_construct_null(i32 noundef) #2

declare ptr @pairs_construct_zero(i32 noundef) #2

declare ptr @directivity_beampattern_mics(ptr noundef, i32 noundef) #2

declare ptr @directivity_beampattern_spatialfilters(ptr noundef, i32 noundef) #2

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

declare ptr @space_sphere(i32 noundef) #2

declare ptr @delay_tdoas(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare ptr @directivity_spatialgains(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @directivity_spatialmasks(ptr noundef, float noundef) #2

declare void @spatialgains_destroy(ptr noundef) #2

declare ptr @directivity_pairs(ptr noundef) #2

declare void @directivity_pairsadd(ptr noundef, ptr noundef) #2

declare void @pairs_destroy(ptr noundef) #2

declare ptr @directivity_spatialindexes(ptr noundef) #2

declare ptr @space_points_fine(ptr noundef, i32 noundef) #2

declare ptr @delay_taus(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare ptr @hit_train(ptr noundef, ptr noundef, ptr noundef, float noundef) #2

declare void @points_destroy(ptr noundef) #2

declare void @taus_destroy(ptr noundef) #2

declare ptr @hit_constant(ptr noundef, i32 noundef) #2

declare void @beampatterns_destroy(ptr noundef) #2

declare ptr @linking_maps(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @linking_indexes(ptr noundef) #2

declare void @maps_destroy(ptr noundef) #2

declare void @spatialmasks_destroy(ptr noundef) #2

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

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

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 = { "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 = { 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 #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

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

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


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

; Function Attrs: nounwind uwtable
define dso_local ptr @scanning_init_scans(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr nocapture noundef readonly %3, i32 noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7, ptr nocapture noundef readonly %8, float noundef %9, i32 noundef %10, i32 noundef %11, float noundef %12, i32 noundef %13) local_unnamed_addr #0 {
  %15 = tail call ptr @scans_construct_null(i32 noundef %2) #4
  %16 = getelementptr inbounds i8, ptr %0, i64 4
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = tail call ptr @pairs_construct_zero(i32 noundef %17) #4
  %19 = getelementptr inbounds i8, ptr %15, i64 40
  store ptr %18, ptr %19, align 8, !tbaa !11
  %20 = tail call ptr @directivity_beampattern_mics(ptr noundef %0, i32 noundef %11) #4
  %21 = tail call ptr @directivity_beampattern_spatialfilters(ptr noundef %1, i32 noundef %11) #4
  %22 = zext i32 %2 to i64
  %23 = shl nuw nsw i64 %22, 3
  %24 = tail call noalias ptr @malloc(i64 noundef %23) #5
  %25 = load i32, ptr %15, align 8, !tbaa !13
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %14
  %26 = getelementptr inbounds i8, ptr %15, i64 8
  %27 = getelementptr inbounds i8, ptr %15, i64 16
  %28 = getelementptr inbounds i8, ptr %15, i64 32
  %29 = getelementptr inbounds i8, ptr %15, i64 24
  br label %30

30:                                               ; preds = %.lr.ph, %75
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %75 ]
  %31 = getelementptr inbounds i32, ptr %3, i64 %indvars.iv
  %32 = load i32, ptr %31, align 4, !tbaa !14
  %33 = tail call ptr @space_sphere(i32 noundef %32) #4
  %34 = load ptr, ptr %26, align 8, !tbaa !15
  %35 = getelementptr inbounds ptr, ptr %34, i64 %indvars.iv
  store ptr %33, ptr %35, align 8, !tbaa !16
  %36 = load ptr, ptr %26, align 8, !tbaa !15
  %37 = getelementptr inbounds ptr, ptr %36, i64 %indvars.iv
  %38 = load ptr, ptr %37, align 8, !tbaa !16
  %39 = tail call ptr @delay_tdoas(ptr noundef %38, ptr noundef %0, ptr noundef %5, i32 noundef %4, i32 noundef %7, i32 noundef %13) #4
  %40 = load ptr, ptr %27, align 8, !tbaa !17
  %41 = getelementptr inbounds ptr, ptr %40, i64 %indvars.iv
  store ptr %39, ptr %41, align 8, !tbaa !16
  %42 = load ptr, ptr %26, align 8, !tbaa !15
  %43 = getelementptr inbounds ptr, ptr %42, i64 %indvars.iv
  %44 = load ptr, ptr %43, align 8, !tbaa !16
  %45 = tail call ptr @directivity_spatialgains(ptr noundef %0, ptr noundef %20, ptr noundef %1, ptr noundef %21, ptr noundef %44) #4
  %46 = tail call ptr @directivity_spatialmasks(ptr noundef %45, float noundef %12) #4
  %47 = getelementptr inbounds ptr, ptr %24, i64 %indvars.iv
  store ptr %46, ptr %47, align 8, !tbaa !16
  tail call void @spatialgains_destroy(ptr noundef %45) #4
  %48 = tail call ptr @directivity_pairs(ptr noundef %46) #4
  %49 = load ptr, ptr %19, align 8, !tbaa !11
  tail call void @directivity_pairsadd(ptr noundef %49, ptr noundef %48) #4
  tail call void @pairs_destroy(ptr noundef %48) #4
  %50 = tail call ptr @directivity_spatialindexes(ptr noundef %46) #4
  %51 = load ptr, ptr %28, align 8, !tbaa !18
  %52 = getelementptr inbounds ptr, ptr %51, i64 %indvars.iv
  store ptr %50, ptr %52, align 8, !tbaa !16
  %53 = getelementptr inbounds i32, ptr %8, i64 %indvars.iv
  %54 = load i32, ptr %53, align 4, !tbaa !14
  %55 = icmp slt i32 %54, 0
  br i1 %55, label %56, label %68

56:                                               ; preds = %30
  %57 = load ptr, ptr %26, align 8, !tbaa !15
  %58 = getelementptr inbounds ptr, ptr %57, i64 %indvars.iv
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = tail call ptr @space_points_fine(ptr noundef %59, i32 noundef %10) #4
  %61 = tail call ptr @delay_taus(ptr noundef %60, ptr noundef %0, ptr noundef %5, i32 noundef %4, i32 noundef %7, i32 noundef %13) #4
  %62 = load ptr, ptr %27, align 8, !tbaa !17
  %63 = getelementptr inbounds ptr, ptr %62, i64 %indvars.iv
  %64 = load ptr, ptr %63, align 8, !tbaa !16
  %65 = tail call ptr @hit_train(ptr noundef %61, ptr noundef %64, ptr noundef %46, float noundef %9) #4
  %66 = load ptr, ptr %29, align 8, !tbaa !19
  %67 = getelementptr inbounds ptr, ptr %66, i64 %indvars.iv
  store ptr %65, ptr %67, align 8, !tbaa !16
  tail call void @points_destroy(ptr noundef %60) #4
  tail call void @taus_destroy(ptr noundef %61) #4
  br label %75

68:                                               ; preds = %30
  %69 = load ptr, ptr %27, align 8, !tbaa !17
  %70 = getelementptr inbounds ptr, ptr %69, i64 %indvars.iv
  %71 = load ptr, ptr %70, align 8, !tbaa !16
  %72 = tail call ptr @hit_constant(ptr noundef %71, i32 noundef %54) #4
  %73 = load ptr, ptr %29, align 8, !tbaa !19
  %74 = getelementptr inbounds ptr, ptr %73, i64 %indvars.iv
  store ptr %72, ptr %74, align 8, !tbaa !16
  br label %75

75:                                               ; preds = %56, %68
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %76 = load i32, ptr %15, align 8, !tbaa !13
  %77 = zext i32 %76 to i64
  %78 = icmp ult i64 %indvars.iv.next, %77
  br i1 %78, label %30, label %._crit_edge, !llvm.loop !20

._crit_edge:                                      ; preds = %75, %14
  tail call void @beampatterns_destroy(ptr noundef %20) #4
  tail call void @beampatterns_destroy(ptr noundef %21) #4
  %79 = load i32, ptr %15, align 8, !tbaa !13
  %.not113 = icmp eq i32 %79, 0
  br i1 %.not113, label %._crit_edge112, label %80

80:                                               ; preds = %._crit_edge
  %81 = getelementptr inbounds i8, ptr %15, i64 16
  %82 = getelementptr inbounds i8, ptr %15, i64 24
  %83 = getelementptr inbounds i8, ptr %15, i64 48
  %84 = load ptr, ptr %81, align 8, !tbaa !17
  %85 = load ptr, ptr %84, align 8, !tbaa !16
  %86 = load ptr, ptr %82, align 8, !tbaa !19
  %87 = load ptr, ptr %86, align 8, !tbaa !16
  %88 = load ptr, ptr %24, align 8, !tbaa !16
  %89 = tail call ptr @linking_maps(ptr noundef null, ptr noundef %85, ptr noundef null, ptr noundef %87, ptr noundef null, ptr noundef %88, i32 noundef %6) #4
  %90 = tail call ptr @linking_indexes(ptr noundef %89) #4
  %91 = load ptr, ptr %83, align 8, !tbaa !22
  store ptr %90, ptr %91, align 8, !tbaa !16
  tail call void @maps_destroy(ptr noundef %89) #4
  %92 = load i32, ptr %15, align 8, !tbaa !13
  %93 = icmp ugt i32 %92, 1
  br i1 %93, label %.peel.next, label %.preheader

.preheader:                                       ; preds = %.peel.next, %80
  %94 = phi i32 [ %92, %80 ], [ %115, %.peel.next ]
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %._crit_edge112, label %.lr.ph111

.peel.next:                                       ; preds = %80, %.peel.next
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.peel.next ], [ 1, %80 ]
  %96 = load ptr, ptr %81, align 8, !tbaa !17
  %97 = add nsw i64 %indvars.iv116, -1
  %98 = getelementptr inbounds ptr, ptr %96, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !16
  %100 = getelementptr inbounds ptr, ptr %96, i64 %indvars.iv116
  %101 = load ptr, ptr %100, align 8, !tbaa !16
  %102 = load ptr, ptr %82, align 8, !tbaa !19
  %103 = getelementptr inbounds ptr, ptr %102, i64 %97
  %104 = load ptr, ptr %103, align 8, !tbaa !16
  %105 = getelementptr inbounds ptr, ptr %102, i64 %indvars.iv116
  %106 = load ptr, ptr %105, align 8, !tbaa !16
  %107 = getelementptr inbounds ptr, ptr %24, i64 %97
  %108 = load ptr, ptr %107, align 8, !tbaa !16
  %109 = getelementptr inbounds ptr, ptr %24, i64 %indvars.iv116
  %110 = load ptr, ptr %109, align 8, !tbaa !16
  %111 = tail call ptr @linking_maps(ptr noundef %99, ptr noundef %101, ptr noundef %104, ptr noundef %106, ptr noundef %108, ptr noundef %110, i32 noundef %6) #4
  %112 = tail call ptr @linking_indexes(ptr noundef %111) #4
  %113 = load ptr, ptr %83, align 8, !tbaa !22
  %114 = getelementptr inbounds ptr, ptr %113, i64 %indvars.iv116
  store ptr %112, ptr %114, align 8, !tbaa !16
  tail call void @maps_destroy(ptr noundef %111) #4
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %115 = load i32, ptr %15, align 8, !tbaa !13
  %116 = zext i32 %115 to i64
  %117 = icmp ult i64 %indvars.iv.next117, %116
  br i1 %117, label %.peel.next, label %.preheader, !llvm.loop !23

.lr.ph111:                                        ; preds = %.preheader, %.lr.ph111
  %indvars.iv120 = phi i64 [ %indvars.iv.next121, %.lr.ph111 ], [ 0, %.preheader ]
  %118 = getelementptr inbounds ptr, ptr %24, i64 %indvars.iv120
  %119 = load ptr, ptr %118, align 8, !tbaa !16
  tail call void @spatialmasks_destroy(ptr noundef %119) #4
  %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
  %120 = load i32, ptr %15, align 8, !tbaa !13
  %121 = zext i32 %120 to i64
  %122 = icmp ult i64 %indvars.iv.next121, %121
  br i1 %122, label %.lr.ph111, label %._crit_edge112, !llvm.loop !25

._crit_edge112:                                   ; preds = %.lr.ph111, %._crit_edge, %.preheader
  tail call void @free(ptr noundef %24) #4
  ret ptr %15
}

declare ptr @scans_construct_null(i32 noundef) local_unnamed_addr #1

declare ptr @pairs_construct_zero(i32 noundef) local_unnamed_addr #1

declare ptr @directivity_beampattern_mics(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @directivity_beampattern_spatialfilters(ptr noundef, i32 noundef) local_unnamed_addr #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 #2

declare ptr @space_sphere(i32 noundef) local_unnamed_addr #1

declare ptr @delay_tdoas(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare ptr @directivity_spatialgains(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @directivity_spatialmasks(ptr noundef, float noundef) local_unnamed_addr #1

declare void @spatialgains_destroy(ptr noundef) local_unnamed_addr #1

declare ptr @directivity_pairs(ptr noundef) local_unnamed_addr #1

declare void @directivity_pairsadd(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @pairs_destroy(ptr noundef) local_unnamed_addr #1

declare ptr @directivity_spatialindexes(ptr noundef) local_unnamed_addr #1

declare ptr @space_points_fine(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @delay_taus(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare ptr @hit_train(ptr noundef, ptr noundef, ptr noundef, float noundef) local_unnamed_addr #1

declare void @points_destroy(ptr noundef) local_unnamed_addr #1

declare void @taus_destroy(ptr noundef) local_unnamed_addr #1

declare ptr @hit_constant(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @beampatterns_destroy(ptr noundef) local_unnamed_addr #1

declare ptr @linking_maps(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @linking_indexes(ptr noundef) local_unnamed_addr #1

declare void @maps_destroy(ptr noundef) local_unnamed_addr #1

declare void @spatialmasks_destroy(ptr noundef) local_unnamed_addr #1

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }

!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 4}
!6 = !{!"mics_obj", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !10, i64 40}
!12 = !{!"scans_obj", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!13 = !{!12, !7, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!12, !10, i64 8}
!16 = !{!10, !10, i64 0}
!17 = !{!12, !10, i64 16}
!18 = !{!12, !10, i64 32}
!19 = !{!12, !10, i64 24}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!12, !10, i64 48}
!23 = distinct !{!23, !21, !24}
!24 = !{!"llvm.loop.peeled.count", i32 1}
!25 = distinct !{!25, !21}


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