; 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.9 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__.synapse_index_partition_by_delay = external hidden unnamed_addr constant [75 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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

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

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

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @synapse_index_partition_by_delay(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.synapse, align 4
  %16 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %17 = load i32, ptr %4, align 4, !tbaa !9
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i32 noundef %17)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %19 = load i32, ptr %4, align 4, !tbaa !9
  %20 = mul i32 %19, 64
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.synapse_index, ptr %21, i32 0, i32 3
  %23 = load i32, ptr %22, align 4, !tbaa !11
  %24 = mul i32 %20, %23
  %25 = add i32 %24, 1
  %26 = zext i32 %25 to i64
  %27 = call ptr @aligned_calloc(i64 noundef %26, i64 noundef 4)
  store ptr %27, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %28 = call ptr @var_vec_init(i64 noundef 4, i64 noundef 8)
  store ptr %28, ptr %7, align 8, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = add i32 %30, 1
  store i32 %31, ptr %6, align 4, !tbaa !9
  %32 = zext i32 %30 to i64
  %33 = getelementptr inbounds i32, ptr %29, i64 %32
  store i32 0, ptr %33, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %125, %2
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = load i32, ptr %4, align 4, !tbaa !9
  %37 = icmp ult i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %128

39:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %121, %39
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.synapse_index, ptr %42, i32 0, i32 3
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = icmp ult i32 %41, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %40
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %124

47:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %117, %47
  %49 = load i32, ptr %11, align 4, !tbaa !9
  %50 = icmp ult i32 %49, 64
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %120

52:                                               ; preds = %48
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = load i32, ptr %4, align 4, !tbaa !9
  %55 = urem i32 %53, %54
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = icmp eq i32 %55, %56
  br i1 %57, label %58, label %107

58:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.synapse_index, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !13
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = mul i32 64, %62
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = add i32 %63, %64
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds i32, ptr %61, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !9
  store i32 %68, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.synapse_index, ptr %69, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !13
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = mul i32 64, %72
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = add i32 %73, %74
  %76 = add i32 %75, 1
  %77 = zext i32 %76 to i64
  %78 = getelementptr inbounds i32, ptr %71, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !9
  store i32 %79, ptr %13, align 4, !tbaa !9
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = icmp ugt i32 %80, %81
  br i1 %82, label %83, label %85

83:                                               ; preds = %58
  %84 = load i32, ptr %13, align 4, !tbaa !9
  br label %87

85:                                               ; preds = %58
  %86 = load i32, ptr %12, align 4, !tbaa !9
  br label %87

87:                                               ; preds = %85, %83
  %88 = phi i32 [ %84, %83 ], [ %86, %85 ]
  store i32 %88, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %89 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %89, ptr %14, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %103, %87
  %91 = load i32, ptr %14, align 4, !tbaa !9
  %92 = load i32, ptr %13, align 4, !tbaa !9
  %93 = icmp ult i32 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %106

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.synapse_index, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !14
  %99 = load i32, ptr %14, align 4, !tbaa !9
  %100 = zext i32 %99 to i64
  %101 = getelementptr inbounds %struct.synapse, ptr %98, i64 %100
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %101, i64 8, i1 false), !tbaa.struct !15
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  call void @var_vec_add(ptr noundef %102, ptr noundef %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %103

103:                                              ; preds = %95
  %104 = load i32, ptr %14, align 4, !tbaa !9
  %105 = add i32 %104, 1
  store i32 %105, ptr %14, align 4, !tbaa !9
  br label %90, !llvm.loop !18

106:                                              ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %107

107:                                              ; preds = %106, %52
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.var_vector, ptr %108, i32 0, i32 2
  %110 = load i64, ptr %109, align 8, !tbaa !20
  %111 = trunc i64 %110 to i32
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = load i32, ptr %6, align 4, !tbaa !9
  %114 = add i32 %113, 1
  store i32 %114, ptr %6, align 4, !tbaa !9
  %115 = zext i32 %113 to i64
  %116 = getelementptr inbounds i32, ptr %112, i64 %115
  store i32 %111, ptr %116, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %107
  %118 = load i32, ptr %11, align 4, !tbaa !9
  %119 = add i32 %118, 1
  store i32 %119, ptr %11, align 4, !tbaa !9
  br label %48, !llvm.loop !23

120:                                              ; preds = %51
  br label %121

121:                                              ; preds = %120
  %122 = load i32, ptr %10, align 4, !tbaa !9
  %123 = add i32 %122, 1
  store i32 %123, ptr %10, align 4, !tbaa !9
  br label %40, !llvm.loop !24

124:                                              ; preds = %46
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %8, align 4, !tbaa !9
  %127 = add i32 %126, 1
  store i32 %127, ptr %8, align 4, !tbaa !9
  br label %34, !llvm.loop !25

128:                                              ; preds = %38
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.var_vector, ptr %129, i32 0, i32 2
  %131 = load i64, ptr %130, align 8, !tbaa !20
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.synapse_index, ptr %132, i32 0, i32 4
  %134 = load i32, ptr %133, align 8, !tbaa !26
  %135 = zext i32 %134 to i64
  %136 = icmp eq i64 %131, %135
  br i1 %136, label %137, label %138

137:                                              ; preds = %128
  br label %139

138:                                              ; preds = %128
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 193, ptr noundef @__PRETTY_FUNCTION__.synapse_index_partition_by_delay) #7
  unreachable

139:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %140 = load ptr, ptr %7, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.var_vector, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !27
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = load ptr, ptr %3, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.synapse_index, ptr %144, i32 0, i32 3
  %146 = load i32, ptr %145, align 4, !tbaa !11
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.var_vector, ptr %147, i32 0, i32 2
  %149 = load i64, ptr %148, align 8, !tbaa !20
  %150 = trunc i64 %149 to i32
  %151 = call ptr @synapse_index_init(ptr noundef %142, ptr noundef %143, i32 noundef 64, i32 noundef %146, i32 noundef %150)
  store ptr %151, ptr %16, align 8, !tbaa !5
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %152) #6
  %153 = load ptr, ptr %16, align 8, !tbaa !5
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret ptr %153
}

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: readwrite) }
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 = { nounwind }
attributes #7 = { noreturn 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 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 0}
!15 = !{i64 0, i64 4, !9, i64 4, i64 4, !16}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21, !22, i64 16}
!21 = !{!"", !6, i64 0, !22, i64 8, !22, i64 16, !22, i64 24}
!22 = !{!"long", !7, i64 0}
!23 = distinct !{!23, !19}
!24 = distinct !{!24, !19}
!25 = distinct !{!25, !19}
!26 = !{!12, !10, i64 24}
!27 = !{!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.9 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__.synapse_index_partition_by_delay = external hidden unnamed_addr constant [75 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @synapse_index_partition_by_delay(ptr nocapture noundef readonly %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.synapse, align 8
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %1)
  %5 = shl i32 %1, 6
  %6 = getelementptr inbounds i8, ptr %0, i64 20
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = mul i32 %5, %7
  %9 = or disjoint i32 %8, 1
  %10 = zext i32 %9 to i64
  %11 = tail call ptr @aligned_calloc(i64 noundef %10, i64 noundef 4) #7
  %12 = tail call ptr @var_vec_init(i64 noundef 4, i64 noundef 8) #7
  store i32 0, ptr %11, align 4, !tbaa !11
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %._crit_edge57, label %.preheader49.lr.ph

.preheader49.lr.ph:                               ; preds = %2
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = getelementptr inbounds i8, ptr %12, i64 16
  %15 = load i32, ptr %6, align 4, !tbaa !5
  %.not58 = icmp eq i32 %15, 0
  br i1 %.not58, label %._crit_edge57, label %.preheader49

.preheader49:                                     ; preds = %.preheader49.lr.ph, %._crit_edge
  %16 = phi i32 [ %25, %._crit_edge ], [ 1, %.preheader49.lr.ph ]
  %.056 = phi i32 [ %.1.lcssa, %._crit_edge ], [ 1, %.preheader49.lr.ph ]
  %.04455 = phi i32 [ %26, %._crit_edge ], [ 0, %.preheader49.lr.ph ]
  %.not59 = icmp eq i32 %16, 0
  br i1 %.not59, label %._crit_edge, label %.preheader

._crit_edge57:                                    ; preds = %._crit_edge, %.preheader49.lr.ph, %2
  %17 = getelementptr inbounds i8, ptr %12, i64 16
  %18 = load i64, ptr %17, align 8, !tbaa !12
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load i32, ptr %19, align 8, !tbaa !15
  %21 = zext i32 %20 to i64
  %22 = icmp eq i64 %18, %21
  br i1 %22, label %56, label %55

.preheader:                                       ; preds = %.preheader49, %27
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %27 ], [ 0, %.preheader49 ]
  %.154 = phi i32 [ %52, %27 ], [ %.056, %.preheader49 ]
  %23 = shl nuw nsw i64 %indvars.iv66, 6
  %24 = and i64 %23, 4294967232
  br label %31

._crit_edge:                                      ; preds = %27, %.preheader49
  %25 = phi i32 [ 0, %.preheader49 ], [ %28, %27 ]
  %.1.lcssa = phi i32 [ %.056, %.preheader49 ], [ %52, %27 ]
  %26 = add nuw i32 %.04455, 1
  %exitcond69.not = icmp eq i32 %26, %1
  br i1 %exitcond69.not, label %._crit_edge57, label %.preheader49, !llvm.loop !16

27:                                               ; preds = %.loopexit
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = zext i32 %28 to i64
  %30 = icmp ult i64 %indvars.iv.next67, %29
  br i1 %30, label %.preheader, label %._crit_edge, !llvm.loop !19

31:                                               ; preds = %.preheader, %.loopexit
  %indvars.iv62 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next63, %.loopexit ]
  %.252 = phi i32 [ %.154, %.preheader ], [ %52, %.loopexit ]
  %32 = trunc nuw nsw i64 %indvars.iv62 to i32
  %33 = urem i32 %32, %1
  %34 = icmp eq i32 %33, %.04455
  br i1 %34, label %35, label %.loopexit

35:                                               ; preds = %31
  %36 = load ptr, ptr %13, align 8, !tbaa !20
  %37 = add nuw nsw i64 %indvars.iv62, %24
  %38 = getelementptr inbounds i32, ptr %36, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = add nuw i64 %37, 1
  %41 = and i64 %40, 4294967295
  %42 = getelementptr inbounds i32, ptr %36, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !11
  %44 = call i32 @llvm.umax.i32(i32 %43, i32 %39)
  %45 = icmp ugt i32 %43, %39
  br i1 %45, label %.lr.ph.preheader, label %.loopexit

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

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %46, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %47 = load ptr, ptr %0, align 8, !tbaa !21
  %48 = getelementptr inbounds %struct.synapse, ptr %47, i64 %indvars.iv
  %49 = load i64, ptr %48, align 4
  store i64 %49, ptr %3, align 8
  call void @var_vec_add(ptr noundef %12, ptr noundef nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %44, %lftr.wideiv
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !22

.loopexit:                                        ; preds = %.lr.ph, %35, %31
  %50 = load i64, ptr %14, align 8, !tbaa !12
  %51 = trunc i64 %50 to i32
  %52 = add i32 %.252, 1
  %53 = zext i32 %.252 to i64
  %54 = getelementptr inbounds i32, ptr %11, i64 %53
  store i32 %51, ptr %54, align 4, !tbaa !11
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next63, 64
  br i1 %exitcond65.not, label %27, label %31, !llvm.loop !23

55:                                               ; preds = %._crit_edge57
  call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.1, i32 noundef 193, ptr noundef nonnull @__PRETTY_FUNCTION__.synapse_index_partition_by_delay) #8
  unreachable

56:                                               ; preds = %._crit_edge57
  %57 = load ptr, ptr %12, align 8, !tbaa !24
  %58 = load i32, ptr %6, align 4, !tbaa !5
  %59 = trunc nuw i64 %18 to i32
  %60 = call ptr @synapse_index_init(ptr noundef %57, ptr noundef nonnull %11, i32 noundef 64, i32 noundef %58, i32 noundef %59)
  call void @free(ptr noundef nonnull %12) #7
  ret ptr %60
}

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

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 = { 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { noreturn 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, !14, i64 16}
!13 = !{!"", !7, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!14 = !{!"long", !8, i64 0}
!15 = !{!6, !10, i64 24}
!16 = distinct !{!16, !17, !18}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!"llvm.loop.unswitch.partial.disable"}
!19 = distinct !{!19, !17}
!20 = !{!6, !7, i64 8}
!21 = !{!6, !7, i64 0}
!22 = distinct !{!22, !17}
!23 = distinct !{!23, !17}
!24 = !{!13, !7, i64 0}


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