; LLVM IR from bjourne/fast_snn_fpga :: src (synapse_index)

; 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.synapse = type { i32, float }
%struct.synapse_index = type { ptr, ptr, i32, i32, i32 }
%struct.var_vector = type { ptr, i64, i64, i64 }

@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__.synapse_index_align_delay_classes = external hidden unnamed_addr constant [86 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1

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

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

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

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

declare ptr @var_vec_init(i64 noundef, i64 noundef) #3

declare ptr @aligned_calloc(i64 noundef, i64 noundef) #3

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #6

declare void @var_vec_add_sparse(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #3

declare void @var_vec_add(ptr noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
define dso_local ptr @synapse_index_align_delay_classes(ptr noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.synapse, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca [64 x i32], align 16
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca %struct.synapse, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca %struct.synapse, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %29 = load i32, ptr %6, align 4, !tbaa !9
  %30 = icmp ugt i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %3
  br label %33

32:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.1, i32 noundef 105, ptr noundef @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #7
  unreachable

33:                                               ; preds = %31
  %34 = load i32, ptr %5, align 4, !tbaa !9
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = sub i32 %34, %35
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.synapse_index, ptr %37, i32 0, i32 3
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = icmp ugt i32 %36, %39
  br i1 %40, label %41, label %42

41:                                               ; preds = %33
  br label %43

42:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.1, i32 noundef 106, ptr noundef @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #7
  unreachable

43:                                               ; preds = %41
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %44)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  %46 = call ptr @var_vec_init(i64 noundef 4, i64 noundef 8)
  store ptr %46, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.synapse_index, ptr %47, i32 0, i32 3
  %49 = load i32, ptr %48, align 4, !tbaa !11
  %50 = mul i32 64, %49
  %51 = add i32 %50, 1
  %52 = zext i32 %51 to i64
  store i64 %52, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %53 = load i64, ptr %8, align 8, !tbaa !13
  %54 = call ptr @aligned_calloc(i64 noundef %53, i64 noundef 4)
  store ptr %54, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !9
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = add i32 %56, 1
  store i32 %57, ptr %10, align 4, !tbaa !9
  %58 = zext i32 %56 to i64
  %59 = getelementptr inbounds i32, ptr %55, i64 %58
  store i32 0, ptr %59, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %60 = load i32, ptr %5, align 4, !tbaa !9
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = sub i32 %60, %61
  %63 = load i32, ptr %6, align 4, !tbaa !9
  %64 = udiv i32 %62, %63
  store i32 %64, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %65 = getelementptr inbounds %struct.synapse, ptr %12, i32 0, i32 0
  %66 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %66, ptr %65, align 4, !tbaa !15
  %67 = getelementptr inbounds %struct.synapse, ptr %12, i32 0, i32 1
  store float 0.000000e+00, ptr %67, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %241, %43
  %69 = load i32, ptr %13, align 4, !tbaa !9
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.synapse_index, ptr %70, i32 0, i32 3
  %72 = load i32, ptr %71, align 4, !tbaa !11
  %73 = icmp ult i32 %69, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %68
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %244

75:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %76

76:                                               ; preds = %237, %75
  %77 = load i32, ptr %15, align 4, !tbaa !9
  %78 = icmp ult i32 %77, 64
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %240

80:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.synapse_index, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !19
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = mul i32 64, %84
  %86 = load i32, ptr %15, align 4, !tbaa !9
  %87 = add i32 %85, %86
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds i32, ptr %83, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  store i32 %90, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.synapse_index, ptr %91, i32 0, i32 1
  %93 = load ptr, ptr %92, align 8, !tbaa !19
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = mul i32 64, %94
  %96 = load i32, ptr %15, align 4, !tbaa !9
  %97 = add i32 %95, %96
  %98 = add i32 %97, 1
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %93, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !9
  store i32 %101, ptr %17, align 4, !tbaa !9
  %102 = load i32, ptr %17, align 4, !tbaa !9
  %103 = load i32, ptr %16, align 4, !tbaa !9
  %104 = icmp ugt i32 %102, %103
  br i1 %104, label %105, label %107

105:                                              ; preds = %80
  %106 = load i32, ptr %17, align 4, !tbaa !9
  br label %109

107:                                              ; preds = %80
  %108 = load i32, ptr %16, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %107, %105
  %110 = phi i32 [ %106, %105 ], [ %108, %107 ]
  store i32 %110, ptr %17, align 4, !tbaa !9
  %111 = load i32, ptr %16, align 4, !tbaa !9
  %112 = load i32, ptr %17, align 4, !tbaa !9
  %113 = icmp ule i32 %111, %112
  br i1 %113, label %114, label %115

114:                                              ; preds = %109
  br label %116

115:                                              ; preds = %109
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 127, ptr noundef @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #7
  unreachable

116:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 256, ptr %18) #8
  call void @llvm.memset.p0.i64(ptr align 16 %18, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.var_vector, ptr %117, i32 0, i32 2
  %119 = load i64, ptr %118, align 8, !tbaa !20
  %120 = trunc i64 %119 to i32
  store i32 %120, ptr %19, align 4, !tbaa !9
  %121 = load i32, ptr %19, align 4, !tbaa !9
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = urem i32 %121, %122
  %124 = icmp eq i32 %123, 0
  br i1 %124, label %125, label %126

125:                                              ; preds = %116
  br label %127

126:                                              ; preds = %116
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 132, ptr noundef @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #7
  unreachable

127:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %128 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %128, ptr %20, align 4, !tbaa !9
  br label %129

129:                                              ; preds = %172, %127
  %130 = load i32, ptr %20, align 4, !tbaa !9
  %131 = load i32, ptr %17, align 4, !tbaa !9
  %132 = icmp ult i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %175

134:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.synapse_index, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !22
  %138 = load i32, ptr %20, align 4, !tbaa !9
  %139 = zext i32 %138 to i64
  %140 = getelementptr inbounds %struct.synapse, ptr %137, i64 %139
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %140, i64 8, i1 false), !tbaa.struct !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  %141 = getelementptr inbounds %struct.synapse, ptr %21, i32 0, i32 0
  %142 = load i32, ptr %141, align 4, !tbaa !15
  %143 = load i32, ptr %6, align 4, !tbaa !9
  %144 = urem i32 %142, %143
  store i32 %144, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  %145 = load i32, ptr %6, align 4, !tbaa !9
  %146 = load i32, ptr %22, align 4, !tbaa !9
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds [64 x i32], ptr %18, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !9
  %150 = mul i32 %145, %149
  %151 = load i32, ptr %22, align 4, !tbaa !9
  %152 = add i32 %150, %151
  store i32 %152, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #8
  %153 = load i32, ptr %19, align 4, !tbaa !9
  %154 = load i32, ptr %23, align 4, !tbaa !9
  %155 = add i32 %153, %154
  store i32 %155, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #8
  %156 = getelementptr inbounds %struct.synapse, ptr %25, i32 0, i32 0
  %157 = getelementptr inbounds %struct.synapse, ptr %21, i32 0, i32 0
  %158 = load i32, ptr %157, align 4, !tbaa !15
  %159 = load i32, ptr %6, align 4, !tbaa !9
  %160 = udiv i32 %158, %159
  store i32 %160, ptr %156, align 4, !tbaa !15
  %161 = getelementptr inbounds %struct.synapse, ptr %25, i32 0, i32 1
  %162 = getelementptr inbounds %struct.synapse, ptr %21, i32 0, i32 1
  %163 = load float, ptr %162, align 4, !tbaa !18
  store float %163, ptr %161, align 4, !tbaa !18
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = load i32, ptr %24, align 4, !tbaa !9
  %166 = zext i32 %165 to i64
  call void @var_vec_add_sparse(ptr noundef %164, i64 noundef %166, ptr noundef %25, ptr noundef %12)
  %167 = load i32, ptr %22, align 4, !tbaa !9
  %168 = zext i32 %167 to i64
  %169 = getelementptr inbounds [64 x i32], ptr %18, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !9
  %171 = add i32 %170, 1
  store i32 %171, ptr %169, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  br label %172

172:                                              ; preds = %134
  %173 = load i32, ptr %20, align 4, !tbaa !9
  %174 = add i32 %173, 1
  store i32 %174, ptr %20, align 4, !tbaa !9
  br label %129, !llvm.loop !25

175:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  %176 = load i32, ptr %6, align 4, !tbaa !9
  %177 = zext i32 %176 to i64
  %178 = load ptr, ptr %7, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.var_vector, ptr %178, i32 0, i32 2
  %180 = load i64, ptr %179, align 8, !tbaa !20
  %181 = load i32, ptr %6, align 4, !tbaa !9
  %182 = zext i32 %181 to i64
  %183 = urem i64 %180, %182
  %184 = sub i64 %177, %183
  %185 = trunc i64 %184 to i32
  store i32 %185, ptr %26, align 4, !tbaa !9
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.var_vector, ptr %186, i32 0, i32 2
  %188 = load i64, ptr %187, align 8, !tbaa !20
  %189 = load i32, ptr %26, align 4, !tbaa !9
  %190 = load i32, ptr %6, align 4, !tbaa !9
  %191 = icmp eq i32 %189, %190
  br i1 %191, label %192, label %193

192:                                              ; preds = %175
  br label %195

193:                                              ; preds = %175
  %194 = load i32, ptr %26, align 4, !tbaa !9
  br label %195

195:                                              ; preds = %193, %192
  %196 = phi i32 [ 0, %192 ], [ %194, %193 ]
  %197 = zext i32 %196 to i64
  %198 = add i64 %188, %197
  %199 = trunc i64 %198 to i32
  store i32 %199, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  %200 = load ptr, ptr %7, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.var_vector, ptr %200, i32 0, i32 2
  %202 = load i64, ptr %201, align 8, !tbaa !20
  %203 = trunc i64 %202 to i32
  store i32 %203, ptr %27, align 4, !tbaa !9
  br label %204

204:                                              ; preds = %211, %195
  %205 = load i32, ptr %27, align 4, !tbaa !9
  %206 = load i32, ptr %26, align 4, !tbaa !9
  %207 = icmp ult i32 %205, %206
  br i1 %207, label %209, label %208

208:                                              ; preds = %204
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %214

209:                                              ; preds = %204
  %210 = load ptr, ptr %7, align 8, !tbaa !5
  call void @var_vec_add(ptr noundef %210, ptr noundef %12)
  br label %211

211:                                              ; preds = %209
  %212 = load i32, ptr %27, align 4, !tbaa !9
  %213 = add i32 %212, 1
  store i32 %213, ptr %27, align 4, !tbaa !9
  br label %204, !llvm.loop !27

214:                                              ; preds = %208
  %215 = load ptr, ptr %7, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.var_vector, ptr %215, i32 0, i32 2
  %217 = load i64, ptr %216, align 8, !tbaa !20
  %218 = load i32, ptr %6, align 4, !tbaa !9
  %219 = zext i32 %218 to i64
  %220 = urem i64 %217, %219
  %221 = icmp eq i64 %220, 0
  br i1 %221, label %222, label %223

222:                                              ; preds = %214
  br label %224

223:                                              ; preds = %214
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 148, ptr noundef @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #7
  unreachable

224:                                              ; preds = %222
  %225 = load ptr, ptr %7, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.var_vector, ptr %225, i32 0, i32 2
  %227 = load i64, ptr %226, align 8, !tbaa !20
  %228 = load i32, ptr %6, align 4, !tbaa !9
  %229 = zext i32 %228 to i64
  %230 = udiv i64 %227, %229
  %231 = trunc i64 %230 to i32
  %232 = load ptr, ptr %9, align 8, !tbaa !5
  %233 = load i32, ptr %10, align 4, !tbaa !9
  %234 = add i32 %233, 1
  store i32 %234, ptr %10, align 4, !tbaa !9
  %235 = zext i32 %233 to i64
  %236 = getelementptr inbounds i32, ptr %232, i64 %235
  store i32 %231, ptr %236, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 256, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %237

237:                                              ; preds = %224
  %238 = load i32, ptr %15, align 4, !tbaa !9
  %239 = add i32 %238, 1
  store i32 %239, ptr %15, align 4, !tbaa !9
  br label %76, !llvm.loop !28

240:                                              ; preds = %79
  br label %241

241:                                              ; preds = %240
  %242 = load i32, ptr %13, align 4, !tbaa !9
  %243 = add i32 %242, 1
  store i32 %243, ptr %13, align 4, !tbaa !9
  br label %68, !llvm.loop !29

244:                                              ; preds = %74
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = load ptr, ptr %7, align 8, !tbaa !5
  %247 = load i64, ptr %8, align 8, !tbaa !13
  %248 = load i32, ptr %6, align 4, !tbaa !9
  call void @print_index_info(ptr noundef %245, ptr noundef %246, i32 noundef 1, i64 noundef %247, i32 noundef %248)
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #8
  %249 = load ptr, ptr %7, align 8, !tbaa !5
  %250 = getelementptr inbounds %struct.var_vector, ptr %249, i32 0, i32 0
  %251 = load ptr, ptr %250, align 8, !tbaa !30
  %252 = load ptr, ptr %9, align 8, !tbaa !5
  %253 = load ptr, ptr %4, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.synapse_index, ptr %253, i32 0, i32 3
  %255 = load i32, ptr %254, align 4, !tbaa !11
  %256 = load ptr, ptr %7, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.var_vector, ptr %256, i32 0, i32 2
  %258 = load i64, ptr %257, align 8, !tbaa !20
  %259 = trunc i64 %258 to i32
  %260 = call ptr @synapse_index_init(ptr noundef %251, ptr noundef %252, i32 noundef 64, i32 noundef %255, i32 noundef %259)
  store ptr %260, ptr %28, align 8, !tbaa !5
  %261 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %261) #8
  %262 = load ptr, ptr %28, align 8, !tbaa !5
  store i32 1, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  ret ptr %262
}

declare i32 @printf(ptr noundef, ...) #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 = { 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { noreturn nounwind }
attributes #8 = { nounwind }

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

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


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

%struct.synapse = type { i32, float }

@.str.1 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [14 x i8], align 1
@__PRETTY_FUNCTION__.synapse_index_align_delay_classes = external hidden unnamed_addr constant [86 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @synapse_index_init(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

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

declare ptr @var_vec_init(i64 noundef, i64 noundef) local_unnamed_addr #3

declare ptr @aligned_calloc(i64 noundef, i64 noundef) local_unnamed_addr #3

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

declare void @var_vec_add_sparse(ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @var_vec_add(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @print_index_info(ptr noundef, ptr noundef, i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @synapse_index_align_delay_classes(ptr noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.synapse, align 4
  %5 = alloca [64 x i32], align 16
  %6 = alloca %struct.synapse, align 4
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %7, label %8

7:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i32 noundef 105, ptr noundef nonnull @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #8
  unreachable

8:                                                ; preds = %3
  %9 = sub i32 %1, %2
  %10 = getelementptr inbounds i8, ptr %0, i64 20
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %12 = icmp ugt i32 %9, %11
  br i1 %12, label %14, label %13

13:                                               ; preds = %8
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.1, i32 noundef 106, ptr noundef nonnull @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #8
  unreachable

14:                                               ; preds = %8
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %2)
  %16 = tail call ptr @var_vec_init(i64 noundef 4, i64 noundef 8) #9
  %17 = load i32, ptr %10, align 4, !tbaa !5
  %18 = shl i32 %17, 6
  %19 = or disjoint i32 %18, 1
  %20 = zext i32 %19 to i64
  %21 = tail call ptr @aligned_calloc(i64 noundef %20, i64 noundef 4) #9
  store i32 0, ptr %21, align 4, !tbaa !11
  %22 = udiv i32 %9, %2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  store i32 %22, ptr %4, align 4, !tbaa !12
  %23 = getelementptr inbounds i8, ptr %4, i64 4
  store float 0.000000e+00, ptr %23, align 4, !tbaa !15
  %24 = load i32, ptr %10, align 4, !tbaa !5
  %.not96 = icmp eq i32 %24, 0
  br i1 %.not96, label %._crit_edge95, label %.preheader83.lr.ph

.preheader83.lr.ph:                               ; preds = %14
  %25 = getelementptr inbounds i8, ptr %0, i64 8
  %26 = getelementptr inbounds i8, ptr %16, i64 16
  %27 = getelementptr inbounds i8, ptr %6, i64 4
  %28 = zext i32 %2 to i64
  %.pre.pre = load i64, ptr %26, align 8, !tbaa !16
  br label %.preheader83

.preheader83:                                     ; preds = %.preheader83.lr.ph, %37
  %.pre = phi i64 [ %.pre.pre, %.preheader83.lr.ph ], [ %.pre108, %37 ]
  %indvars.iv103 = phi i64 [ 0, %.preheader83.lr.ph ], [ %indvars.iv.next104, %37 ]
  %.094 = phi i32 [ 1, %.preheader83.lr.ph ], [ %88, %37 ]
  %29 = shl nuw nsw i64 %indvars.iv103, 6
  %30 = and i64 %29, 4294967232
  br label %41

._crit_edge95:                                    ; preds = %37, %14
  call void @print_index_info(ptr noundef nonnull %0, ptr noundef %16, i32 noundef 1, i64 noundef %20, i32 noundef %2)
  %31 = load ptr, ptr %16, align 8, !tbaa !19
  %32 = load i32, ptr %10, align 4, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %16, i64 16
  %34 = load i64, ptr %33, align 8, !tbaa !16
  %35 = trunc i64 %34 to i32
  %36 = call ptr @synapse_index_init(ptr noundef %31, ptr noundef nonnull %21, i32 noundef 64, i32 noundef %32, i32 noundef %35)
  call void @free(ptr noundef %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  ret ptr %36

37:                                               ; preds = %86
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
  %38 = load i32, ptr %10, align 4, !tbaa !5
  %39 = zext i32 %38 to i64
  %40 = icmp ult i64 %indvars.iv.next104, %39
  br i1 %40, label %.preheader83, label %._crit_edge95, !llvm.loop !20

41:                                               ; preds = %.preheader83, %86
  %.pre110 = phi i64 [ %.pre, %.preheader83 ], [ %.pre108, %86 ]
  %42 = phi i64 [ %.pre, %.preheader83 ], [ %80, %86 ]
  %indvars.iv99 = phi i64 [ 0, %.preheader83 ], [ %indvars.iv.next100, %86 ]
  %.192 = phi i32 [ %.094, %.preheader83 ], [ %88, %86 ]
  %43 = load ptr, ptr %25, align 8, !tbaa !22
  %44 = add nuw nsw i64 %indvars.iv99, %30
  %45 = getelementptr inbounds i32, ptr %43, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = add nuw i64 %44, 1
  %48 = and i64 %47, 4294967295
  %49 = getelementptr inbounds i32, ptr %43, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !11
  %51 = call i32 @llvm.umax.i32(i32 %50, i32 %46)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %5, i8 0, i64 256, i1 false)
  %52 = trunc i64 %42 to i32
  %53 = urem i32 %52, %2
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %.preheader, label %57

.preheader:                                       ; preds = %41
  %55 = icmp ugt i32 %50, %46
  br i1 %55, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %56 = zext i32 %46 to i64
  br label %.lr.ph

57:                                               ; preds = %41
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 132, ptr noundef nonnull @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #8
  unreachable

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %.pre106 = load i64, ptr %26, align 8, !tbaa !16
  %.pre112 = trunc i64 %.pre106 to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %.pre-phi = phi i32 [ %.pre112, %._crit_edge.loopexit ], [ %52, %.preheader ]
  %.pre109 = phi i64 [ %.pre106, %._crit_edge.loopexit ], [ %.pre110, %.preheader ]
  %58 = phi i64 [ %.pre106, %._crit_edge.loopexit ], [ %42, %.preheader ]
  %59 = urem i64 %58, %28
  %60 = trunc nuw i64 %59 to i32
  %61 = sub i32 %2, %60
  %62 = icmp eq i64 %59, 0
  %63 = zext i32 %61 to i64
  %64 = select i1 %62, i64 0, i64 %63
  %65 = add i64 %64, %58
  %66 = trunc i64 %65 to i32
  %67 = icmp ult i32 %.pre-phi, %66
  br i1 %67, label %.lr.ph89, label %._crit_edge90

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %56, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %68 = load ptr, ptr %0, align 8, !tbaa !23
  %69 = getelementptr inbounds %struct.synapse, ptr %68, i64 %indvars.iv
  %.sroa.0.0.copyload = load i32, ptr %69, align 4, !tbaa !11
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %69, i64 4
  %.sroa.5.0.copyload = load float, ptr %.sroa.5.0..sroa_idx, align 4, !tbaa !24
  %70 = urem i32 %.sroa.0.0.copyload, %2
  %71 = zext i32 %70 to i64
  %72 = getelementptr inbounds [64 x i32], ptr %5, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !11
  %74 = mul i32 %73, %2
  %75 = add i32 %70, %52
  %76 = add i32 %75, %74
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %77 = udiv i32 %.sroa.0.0.copyload, %2
  store i32 %77, ptr %6, align 4, !tbaa !12
  store float %.sroa.5.0.copyload, ptr %27, align 4, !tbaa !15
  %78 = zext i32 %76 to i64
  call void @var_vec_add_sparse(ptr noundef %16, i64 noundef %78, ptr noundef nonnull %6, ptr noundef nonnull %4) #9
  %79 = add i32 %73, 1
  store i32 %79, ptr %72, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %51, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !25

._crit_edge90.loopexit:                           ; preds = %.lr.ph89
  %.pre107 = load i64, ptr %26, align 8, !tbaa !16
  br label %._crit_edge90

._crit_edge90:                                    ; preds = %._crit_edge90.loopexit, %._crit_edge
  %.pre108 = phi i64 [ %.pre107, %._crit_edge90.loopexit ], [ %.pre109, %._crit_edge ]
  %80 = phi i64 [ %.pre107, %._crit_edge90.loopexit ], [ %58, %._crit_edge ]
  %81 = urem i64 %80, %28
  %82 = udiv i64 %80, %28
  %83 = icmp eq i64 %81, 0
  br i1 %83, label %86, label %85

.lr.ph89:                                         ; preds = %._crit_edge, %.lr.ph89
  %.07787 = phi i32 [ %84, %.lr.ph89 ], [ %.pre-phi, %._crit_edge ]
  call void @var_vec_add(ptr noundef %16, ptr noundef nonnull %4) #9
  %84 = add i32 %.07787, 1
  %exitcond98.not = icmp eq i32 %84, %66
  br i1 %exitcond98.not, label %._crit_edge90.loopexit, label %.lr.ph89, !llvm.loop !26

85:                                               ; preds = %._crit_edge90
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 148, ptr noundef nonnull @__PRETTY_FUNCTION__.synapse_index_align_delay_classes) #8
  unreachable

86:                                               ; preds = %._crit_edge90
  %87 = trunc i64 %82 to i32
  %88 = add i32 %.192, 1
  %89 = zext i32 %.192 to i64
  %90 = getelementptr inbounds i32, ptr %21, i64 %89
  store i32 %87, ptr %90, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #9
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %exitcond102.not = icmp eq i64 %indvars.iv.next100, 64
  br i1 %exitcond102.not, label %37, label %41, !llvm.loop !27
}

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }

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

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


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