; LLVM IR from kalininalab/rinminer :: rinminer (rinminer)

; 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.config_t = type { i32, i32, i32, i32, i32, float, %struct.mismatch_matrix_t }
%struct.mismatch_matrix_t = type { ptr, i32 }
%struct.subgraph_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i16, i32, ptr }
%struct.db_mapping_t = type { ptr, i32, i16, i32 }
%struct.mapping_t = type { ptr, ptr, i32, %struct.mapping_info_t }
%struct.mapping_info_t = type { i32, float }

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @calc_subgraph_score(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %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 ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.config_t, ptr %19, i32 0, i32 2
  %21 = load i32, ptr %20, align 8, !tbaa !11
  store i32 %21, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = zext i32 %22 to i64
  %24 = mul i64 %23, 4
  %25 = call noalias ptr @malloc(i64 noundef %24) #5
  store ptr %25, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %26

26:                                               ; preds = %36, %2
  %27 = load i32, ptr %8, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp ult i32 %27, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %39

31:                                               ; preds = %26
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load i32, ptr %8, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds i32, ptr %32, i64 %34
  store i32 0, ptr %35, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %31
  %37 = load i32, ptr %8, align 4, !tbaa !9
  %38 = add i32 %37, 1
  store i32 %38, ptr %8, align 4, !tbaa !9
  br label %26, !llvm.loop !15

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load i32, ptr %9, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds i32, ptr %40, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !9
  store i32 %44, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %124, %39
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.subgraph_t, ptr %47, i32 0, i32 10
  %49 = load i32, ptr %48, align 8, !tbaa !17
  %50 = icmp ult i32 %46, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %45
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %127

52:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.subgraph_t, ptr %53, i32 0, i32 3
  %55 = load ptr, ptr %54, align 8, !tbaa !20
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = zext i32 %56 to i64
  %58 = getelementptr inbounds %struct.db_mapping_t, ptr %55, i64 %57
  store ptr %58, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %59 = load ptr, ptr %13, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.db_mapping_t, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !21
  store ptr %61, ptr %15, align 8, !tbaa !5
  br label %62

62:                                               ; preds = %79, %52
  %63 = load ptr, ptr %15, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %66, label %65

65:                                               ; preds = %62
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %83

66:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %67 = load ptr, ptr %15, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.mapping_t, ptr %67, i32 0, i32 3
  store ptr %68, ptr %16, align 8, !tbaa !5
  %69 = load ptr, ptr %16, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.mapping_info_t, ptr %69, i32 0, i32 0
  %71 = load i32, ptr %70, align 4, !tbaa !23
  %72 = load i32, ptr %14, align 4, !tbaa !9
  %73 = icmp sgt i32 %71, %72
  br i1 %73, label %74, label %78

74:                                               ; preds = %66
  %75 = load ptr, ptr %16, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.mapping_info_t, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 4, !tbaa !23
  store i32 %77, ptr %14, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %74, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %79

79:                                               ; preds = %78
  %80 = load ptr, ptr %15, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.mapping_t, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !25
  store ptr %82, ptr %15, align 8, !tbaa !5
  br label %62, !llvm.loop !27

83:                                               ; preds = %65
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = load i32, ptr %10, align 4, !tbaa !9
  %86 = icmp sgt i32 %84, %85
  br i1 %86, label %87, label %123

87:                                               ; preds = %83
  %88 = load i32, ptr %14, align 4, !tbaa !9
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = load i32, ptr %9, align 4, !tbaa !9
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds i32, ptr %89, i64 %91
  store i32 %88, ptr %92, align 4, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !9
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i32, ptr %93, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !9
  store i32 %97, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %119, %87
  %99 = load i32, ptr %17, align 4, !tbaa !9
  %100 = load i32, ptr %6, align 4, !tbaa !9
  %101 = icmp ult i32 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %98
  store i32 11, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %122

103:                                              ; preds = %98
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = load i32, ptr %17, align 4, !tbaa !9
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds i32, ptr %104, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !9
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = icmp slt i32 %108, %109
  br i1 %110, label %111, label %118

111:                                              ; preds = %103
  %112 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %112, ptr %9, align 4, !tbaa !9
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = load i32, ptr %17, align 4, !tbaa !9
  %115 = zext i32 %114 to i64
  %116 = getelementptr inbounds i32, ptr %113, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !9
  store i32 %117, ptr %10, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %111, %103
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %17, align 4, !tbaa !9
  %121 = add i32 %120, 1
  store i32 %121, ptr %17, align 4, !tbaa !9
  br label %98, !llvm.loop !28

122:                                              ; preds = %102
  br label %123

123:                                              ; preds = %122, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %124

124:                                              ; preds = %123
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = add i32 %125, 1
  store i32 %126, ptr %11, align 4, !tbaa !9
  br label %45, !llvm.loop !29

127:                                              ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %141, %127
  %129 = load i32, ptr %18, align 4, !tbaa !9
  %130 = load i32, ptr %6, align 4, !tbaa !9
  %131 = icmp ult i32 %129, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %128
  store i32 14, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %144

133:                                              ; preds = %128
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  %135 = load i32, ptr %18, align 4, !tbaa !9
  %136 = zext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %134, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = load i32, ptr %5, align 4, !tbaa !9
  %140 = add nsw i32 %139, %138
  store i32 %140, ptr %5, align 4, !tbaa !9
  br label %141

141:                                              ; preds = %133
  %142 = load i32, ptr %18, align 4, !tbaa !9
  %143 = add i32 %142, 1
  store i32 %143, ptr %18, align 4, !tbaa !9
  br label %128, !llvm.loop !30

144:                                              ; preds = %132
  %145 = load i32, ptr %6, align 4, !tbaa !9
  %146 = load i32, ptr %5, align 4, !tbaa !9
  %147 = udiv i32 %146, %145
  store i32 %147, ptr %5, align 4, !tbaa !9
  %148 = load i32, ptr %5, align 4, !tbaa !9
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.subgraph_t, ptr %149, i32 0, i32 11
  store i32 %148, ptr %150, align 4, !tbaa !31
  %151 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %151) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !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 8}
!12 = !{!"config_t", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20, !14, i64 24}
!13 = !{!"float", !7, i64 0}
!14 = !{!"mismatch_matrix_t", !6, i64 0, !10, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !10, i64 72}
!18 = !{!"subgraph_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !19, i64 104, !10, i64 108, !6, i64 112}
!19 = !{!"short", !7, i64 0}
!20 = !{!18, !6, i64 24}
!21 = !{!22, !6, i64 0}
!22 = !{!"db_mapping_t", !6, i64 0, !10, i64 8, !19, i64 12, !10, i64 16}
!23 = !{!24, !10, i64 0}
!24 = !{!"mapping_info_t", !10, i64 0, !13, i64 4}
!25 = !{!26, !6, i64 0}
!26 = !{!"mapping_t", !6, i64 0, !6, i64 8, !10, i64 16, !24, i64 20}
!27 = distinct !{!27, !16}
!28 = distinct !{!28, !16}
!29 = distinct !{!29, !16}
!30 = distinct !{!30, !16}
!31 = !{!18, !10, i64 76}


; 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.db_mapping_t = type { ptr, i32, i16, i32 }

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

; Function Attrs: nounwind uwtable
define dso_local void @calc_subgraph_score(ptr nocapture noundef readonly %0, ptr nocapture noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !5
  %.fr91 = freeze i32 %4
  %5 = zext i32 %.fr91 to i64
  %6 = shl nuw nsw i64 %5, 2
  %7 = tail call noalias ptr @malloc(i64 noundef %6) #5
  %.not89 = icmp eq i32 %.fr91, 0
  br i1 %.not89, label %._crit_edge, label %._crit_edge.thread

._crit_edge:                                      ; preds = %2
  %8 = getelementptr inbounds i8, ptr %1, i64 72
  %9 = load i32, ptr %8, align 8, !tbaa !13
  %.not90 = icmp eq i32 %9, 0
  br i1 %.not90, label %.preheader, label %.lr.ph83.split.preheader

._crit_edge.thread:                               ; preds = %2
  tail call void @llvm.memset.p0.i64(ptr align 4 %7, i8 0, i64 %6, i1 false), !tbaa !16
  %10 = getelementptr inbounds i8, ptr %1, i64 72
  %11 = load i32, ptr %10, align 8, !tbaa !13
  %.not90112 = icmp eq i32 %11, 0
  br i1 %.not90112, label %.lr.ph86.preheader, label %.lr.ph83.split.us.preheader

.lr.ph83.split.us.preheader:                      ; preds = %._crit_edge.thread
  %12 = load i32, ptr %7, align 4, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %1, i64 24
  %14 = load ptr, ptr %13, align 8, !tbaa !17
  %wide.trip.count100 = zext i32 %11 to i64
  %xtraiter = and i64 %5, 3
  %15 = icmp ult i32 %.fr91, 4
  %unroll_iter = and i64 %5, 4294967292
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.lr.ph83.split.us

.lr.ph83.split.preheader:                         ; preds = %._crit_edge
  %16 = load i32, ptr %7, align 4, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %1, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !17
  %wide.trip.count105 = zext i32 %9 to i64
  br label %.lr.ph83.split

.lr.ph83.split.us:                                ; preds = %.lr.ph83.split.us.preheader, %..loopexit_crit_edge.us
  %indvars.iv97 = phi i64 [ 0, %.lr.ph83.split.us.preheader ], [ %indvars.iv.next98, %..loopexit_crit_edge.us ]
  %.05380.us = phi i32 [ %12, %.lr.ph83.split.us.preheader ], [ %.3.us, %..loopexit_crit_edge.us ]
  %.05579.us = phi i32 [ 0, %.lr.ph83.split.us.preheader ], [ %.358.us, %..loopexit_crit_edge.us ]
  %19 = getelementptr inbounds %struct.db_mapping_t, ptr %14, i64 %indvars.iv97
  %.04965.us = load ptr, ptr %19, align 8, !tbaa !18
  %.not66.us = icmp eq ptr %.04965.us, null
  br i1 %.not66.us, label %._crit_edge71.us, label %.lr.ph70.us

.lr.ph70.us:                                      ; preds = %.lr.ph83.split.us, %.lr.ph70.us
  %.04968.us = phi ptr [ %.049.us, %.lr.ph70.us ], [ %.04965.us, %.lr.ph83.split.us ]
  %.05067.us = phi i32 [ %spec.select.us, %.lr.ph70.us ], [ 0, %.lr.ph83.split.us ]
  %20 = getelementptr inbounds i8, ptr %.04968.us, i64 20
  %21 = load i32, ptr %20, align 4, !tbaa !19
  %spec.select.us = tail call i32 @llvm.smax.i32(i32 %21, i32 %.05067.us)
  %.049.us = load ptr, ptr %.04968.us, align 8, !tbaa !18
  %.not.us = icmp eq ptr %.049.us, null
  br i1 %.not.us, label %._crit_edge71.us, label %.lr.ph70.us, !llvm.loop !21

._crit_edge71.us:                                 ; preds = %.lr.ph70.us, %.lr.ph83.split.us
  %.050.lcssa.us = phi i32 [ 0, %.lr.ph83.split.us ], [ %spec.select.us, %.lr.ph70.us ]
  %22 = icmp sgt i32 %.050.lcssa.us, %.05380.us
  br i1 %22, label %.lr.ph76.us, label %..loopexit_crit_edge.us

.lr.ph76.us:                                      ; preds = %._crit_edge71.us
  %23 = sext i32 %.05579.us to i64
  %24 = getelementptr inbounds i32, ptr %7, i64 %23
  store i32 %.050.lcssa.us, ptr %24, align 4, !tbaa !16
  %25 = load i32, ptr %7, align 4, !tbaa !16
  br i1 %15, label %..loopexit_crit_edge.us.loopexit.unr-lcssa, label %.lr.ph76.us.new

..loopexit_crit_edge.us.loopexit.unr-lcssa:       ; preds = %.lr.ph76.us.new, %.lr.ph76.us
  %spec.select62.us.lcssa.ph = phi i32 [ poison, %.lr.ph76.us ], [ %spec.select62.us.3, %.lr.ph76.us.new ]
  %spec.select63.us.lcssa.ph = phi i32 [ poison, %.lr.ph76.us ], [ %spec.select63.us.3, %.lr.ph76.us.new ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph76.us ], [ %indvars.iv.next.3, %.lr.ph76.us.new ]
  %.15473.us.unr = phi i32 [ %25, %.lr.ph76.us ], [ %spec.select63.us.3, %.lr.ph76.us.new ]
  %.15672.us.unr = phi i32 [ 0, %.lr.ph76.us ], [ %spec.select62.us.3, %.lr.ph76.us.new ]
  br i1 %lcmp.mod.not, label %..loopexit_crit_edge.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %..loopexit_crit_edge.us.loopexit.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %..loopexit_crit_edge.us.loopexit.unr-lcssa ]
  %.15473.us.epil = phi i32 [ %spec.select63.us.epil, %.epil.preheader ], [ %.15473.us.unr, %..loopexit_crit_edge.us.loopexit.unr-lcssa ]
  %.15672.us.epil = phi i32 [ %spec.select62.us.epil, %.epil.preheader ], [ %.15672.us.unr, %..loopexit_crit_edge.us.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %..loopexit_crit_edge.us.loopexit.unr-lcssa ]
  %26 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.epil
  %27 = load i32, ptr %26, align 4, !tbaa !16
  %28 = icmp slt i32 %27, %.15473.us.epil
  %29 = trunc nuw i64 %indvars.iv.epil to i32
  %spec.select62.us.epil = select i1 %28, i32 %29, i32 %.15672.us.epil
  %spec.select63.us.epil = tail call i32 @llvm.smin.i32(i32 %27, i32 %.15473.us.epil)
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %..loopexit_crit_edge.us, label %.epil.preheader, !llvm.loop !23

..loopexit_crit_edge.us:                          ; preds = %..loopexit_crit_edge.us.loopexit.unr-lcssa, %.epil.preheader, %._crit_edge71.us
  %.358.us = phi i32 [ %.05579.us, %._crit_edge71.us ], [ %spec.select62.us.lcssa.ph, %..loopexit_crit_edge.us.loopexit.unr-lcssa ], [ %spec.select62.us.epil, %.epil.preheader ]
  %.3.us = phi i32 [ %.05380.us, %._crit_edge71.us ], [ %spec.select63.us.lcssa.ph, %..loopexit_crit_edge.us.loopexit.unr-lcssa ], [ %spec.select63.us.epil, %.epil.preheader ]
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %exitcond101.not = icmp eq i64 %indvars.iv.next98, %wide.trip.count100
  br i1 %exitcond101.not, label %.preheader, label %.lr.ph83.split.us, !llvm.loop !25

.lr.ph76.us.new:                                  ; preds = %.lr.ph76.us, %.lr.ph76.us.new
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph76.us.new ], [ 0, %.lr.ph76.us ]
  %.15473.us = phi i32 [ %spec.select63.us.3, %.lr.ph76.us.new ], [ %25, %.lr.ph76.us ]
  %.15672.us = phi i32 [ %spec.select62.us.3, %.lr.ph76.us.new ], [ 0, %.lr.ph76.us ]
  %niter = phi i64 [ %niter.next.3, %.lr.ph76.us.new ], [ 0, %.lr.ph76.us ]
  %30 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv
  %31 = load i32, ptr %30, align 4, !tbaa !16
  %32 = icmp slt i32 %31, %.15473.us
  %33 = trunc nuw i64 %indvars.iv to i32
  %spec.select62.us = select i1 %32, i32 %33, i32 %.15672.us
  %spec.select63.us = tail call i32 @llvm.smin.i32(i32 %31, i32 %.15473.us)
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %34 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.next
  %35 = load i32, ptr %34, align 4, !tbaa !16
  %36 = icmp slt i32 %35, %spec.select63.us
  %37 = trunc nuw i64 %indvars.iv.next to i32
  %spec.select62.us.1 = select i1 %36, i32 %37, i32 %spec.select62.us
  %spec.select63.us.1 = tail call i32 @llvm.smin.i32(i32 %35, i32 %spec.select63.us)
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %38 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.next.1
  %39 = load i32, ptr %38, align 4, !tbaa !16
  %40 = icmp slt i32 %39, %spec.select63.us.1
  %41 = trunc nuw i64 %indvars.iv.next.1 to i32
  %spec.select62.us.2 = select i1 %40, i32 %41, i32 %spec.select62.us.1
  %spec.select63.us.2 = tail call i32 @llvm.smin.i32(i32 %39, i32 %spec.select63.us.1)
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %42 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv.next.2
  %43 = load i32, ptr %42, align 4, !tbaa !16
  %44 = icmp slt i32 %43, %spec.select63.us.2
  %45 = trunc nuw i64 %indvars.iv.next.2 to i32
  %spec.select62.us.3 = select i1 %44, i32 %45, i32 %spec.select62.us.2
  %spec.select63.us.3 = tail call i32 @llvm.smin.i32(i32 %43, i32 %spec.select63.us.2)
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %..loopexit_crit_edge.us.loopexit.unr-lcssa, label %.lr.ph76.us.new, !llvm.loop !26

.preheader:                                       ; preds = %..loopexit_crit_edge.us, %56, %._crit_edge
  br i1 %.not89, label %._crit_edge87, label %.lr.ph86.preheader

.lr.ph86.preheader:                               ; preds = %._crit_edge.thread, %.preheader
  %min.iters.check = icmp ult i32 %.fr91, 8
  br i1 %min.iters.check, label %.lr.ph86.preheader117, label %vector.ph

.lr.ph86.preheader117:                            ; preds = %middle.block, %.lr.ph86.preheader
  %indvars.iv107.ph = phi i64 [ 0, %.lr.ph86.preheader ], [ %n.vec, %middle.block ]
  %.04884.ph = phi i32 [ 0, %.lr.ph86.preheader ], [ %51, %middle.block ]
  br label %.lr.ph86

vector.ph:                                        ; preds = %.lr.ph86.preheader
  %n.vec = and i64 %5, 4294967288
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %48, %vector.body ]
  %vec.phi115 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %49, %vector.body ]
  %46 = getelementptr inbounds i32, ptr %7, i64 %index
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %wide.load = load <4 x i32>, ptr %46, align 4, !tbaa !16
  %wide.load116 = load <4 x i32>, ptr %47, align 4, !tbaa !16
  %48 = add <4 x i32> %wide.load, %vec.phi
  %49 = add <4 x i32> %wide.load116, %vec.phi115
  %index.next = add nuw i64 %index, 8
  %50 = icmp eq i64 %index.next, %n.vec
  br i1 %50, label %middle.block, label %vector.body, !llvm.loop !27

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %49, %48
  %51 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i64 %n.vec, %5
  br i1 %cmp.n, label %._crit_edge87, label %.lr.ph86.preheader117

.lr.ph83.split:                                   ; preds = %.lr.ph83.split.preheader, %56
  %indvars.iv102 = phi i64 [ 0, %.lr.ph83.split.preheader ], [ %indvars.iv.next103, %56 ]
  %.05380 = phi i32 [ %16, %.lr.ph83.split.preheader ], [ %.3, %56 ]
  %52 = getelementptr inbounds %struct.db_mapping_t, ptr %18, i64 %indvars.iv102
  %.04965 = load ptr, ptr %52, align 8, !tbaa !18
  %.not66 = icmp eq ptr %.04965, null
  br i1 %.not66, label %._crit_edge71, label %.lr.ph70

._crit_edge71:                                    ; preds = %.lr.ph70, %.lr.ph83.split
  %.050.lcssa = phi i32 [ 0, %.lr.ph83.split ], [ %spec.select, %.lr.ph70 ]
  %53 = icmp sgt i32 %.050.lcssa, %.05380
  br i1 %53, label %.loopexit, label %56

.lr.ph70:                                         ; preds = %.lr.ph83.split, %.lr.ph70
  %.04968 = phi ptr [ %.049, %.lr.ph70 ], [ %.04965, %.lr.ph83.split ]
  %.05067 = phi i32 [ %spec.select, %.lr.ph70 ], [ 0, %.lr.ph83.split ]
  %54 = getelementptr inbounds i8, ptr %.04968, i64 20
  %55 = load i32, ptr %54, align 4, !tbaa !19
  %spec.select = tail call i32 @llvm.smax.i32(i32 %55, i32 %.05067)
  %.049 = load ptr, ptr %.04968, align 8, !tbaa !18
  %.not = icmp eq ptr %.049, null
  br i1 %.not, label %._crit_edge71, label %.lr.ph70, !llvm.loop !21

.loopexit:                                        ; preds = %._crit_edge71
  store i32 %.050.lcssa, ptr %7, align 4, !tbaa !16
  br label %56

56:                                               ; preds = %.loopexit, %._crit_edge71
  %.3 = phi i32 [ %.05380, %._crit_edge71 ], [ %.050.lcssa, %.loopexit ]
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %exitcond106.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count105
  br i1 %exitcond106.not, label %.preheader, label %.lr.ph83.split, !llvm.loop !25

._crit_edge87:                                    ; preds = %.lr.ph86, %middle.block, %.preheader
  %.048.lcssa = phi i32 [ 0, %.preheader ], [ %51, %middle.block ], [ %61, %.lr.ph86 ]
  %57 = udiv i32 %.048.lcssa, %.fr91
  %58 = getelementptr inbounds i8, ptr %1, i64 76
  store i32 %57, ptr %58, align 4, !tbaa !30
  tail call void @free(ptr noundef %7) #6
  ret void

.lr.ph86:                                         ; preds = %.lr.ph86.preheader117, %.lr.ph86
  %indvars.iv107 = phi i64 [ %indvars.iv.next108, %.lr.ph86 ], [ %indvars.iv107.ph, %.lr.ph86.preheader117 ]
  %.04884 = phi i32 [ %61, %.lr.ph86 ], [ %.04884.ph, %.lr.ph86.preheader117 ]
  %59 = getelementptr inbounds i32, ptr %7, i64 %indvars.iv107
  %60 = load i32, ptr %59, align 4, !tbaa !16
  %61 = add nsw i32 %60, %.04884
  %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
  %exitcond111.not = icmp eq i64 %indvars.iv.next108, %5
  br i1 %exitcond111.not, label %._crit_edge87, label %.lr.ph86, !llvm.loop !31
}

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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 nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3

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

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

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


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