; 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.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.database_t = type { ptr, i32, i32, i32 }
%struct.config_t = type { i32, i32, i32, i32, i32, float, %struct.mismatch_matrix_t }
%struct.mismatch_matrix_t = type { ptr, i32 }

; 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 allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @canonical_subgraph_template(ptr dead_on_unwind noalias writable sret(%struct.subgraph_t) align 8, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @free_canonical_subgraph(ptr noundef) #4

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

; Function Attrs: nounwind uwtable
declare dso_local void @find_removable_edges(ptr noundef, ptr noundef, ptr noundef) #4

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

34:                                               ; preds = %9
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.database_t, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !11
  br label %46

38:                                               ; preds = %9
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.subgraph_t, ptr %39, i32 0, i32 10
  %41 = load i32, ptr %40, align 8, !tbaa !13
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.config_t, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !16
  %45 = add i32 %41, %44
  br label %46

46:                                               ; preds = %38, %34
  %47 = phi i32 [ %37, %34 ], [ %45, %38 ]
  store i32 %47, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.subgraph_t, ptr %48, i32 0, i32 11
  %50 = load i32, ptr %49, align 4, !tbaa !20
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.config_t, ptr %51, i32 0, i32 4
  %53 = load i32, ptr %52, align 8, !tbaa !21
  %54 = sub i32 %50, %53
  store i32 %54, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 120, ptr %21) #5
  %55 = load ptr, ptr %12, align 8, !tbaa !5
  call void @canonical_subgraph_template(ptr dead_on_unwind writable sret(%struct.subgraph_t) align 8 %21, ptr noundef %55)
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.subgraph_t, ptr %56, i32 0, i32 14
  %58 = load i32, ptr %57, align 8, !tbaa !22
  %59 = zext i32 %58 to i64
  %60 = mul i64 %59, 8
  %61 = call noalias ptr @malloc(i64 noundef %60) #6
  store ptr %61, ptr %25, align 8, !tbaa !5
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = load ptr, ptr %17, align 8, !tbaa !5
  call void @find_removable_edges(ptr noundef %62, ptr noundef %63, ptr noundef %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %146, %46
  %65 = load i32, ptr %26, align 4, !tbaa !9
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.subgraph_t, ptr %66, i32 0, i32 14
  %68 = load i32, ptr %67, align 8, !tbaa !22
  %69 = icmp ult i32 %65, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %64
  store i32 2, ptr %27, align 4
  br label %149

71:                                               ; preds = %64
  %72 = load ptr, ptr %23, align 8, !tbaa !5
  %73 = load i32, ptr %26, align 4, !tbaa !9
  %74 = zext i32 %73 to i64
  %75 = getelementptr inbounds i8, ptr %72, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !23
  %77 = icmp ne i8 %76, 0
  br i1 %77, label %78, label %141

78:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = load i32, ptr %26, align 4, !tbaa !9
  %82 = load ptr, ptr %14, align 8, !tbaa !5
  %83 = load i32, ptr %15, align 4, !tbaa !9
  %84 = load ptr, ptr %16, align 8, !tbaa !5
  %85 = call ptr @find_canonical_parent(ptr noundef %79, ptr noundef %80, ptr noundef %21, i32 noundef %81, ptr noundef %82, i32 noundef %83, ptr noundef %84)
  store ptr %85, ptr %28, align 8, !tbaa !5
  %86 = load ptr, ptr %28, align 8, !tbaa !5
  %87 = icmp ne ptr %86, null
  br i1 %87, label %88, label %136

88:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  store i32 0, ptr %29, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store i32 0, ptr %30, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %104, %88
  %90 = load i32, ptr %30, align 4, !tbaa !9
  %91 = load i32, ptr %24, align 4, !tbaa !9
  %92 = icmp ult i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 5, ptr %27, align 4
  br label %107

94:                                               ; preds = %89
  %95 = load ptr, ptr %25, align 8, !tbaa !5
  %96 = load i32, ptr %30, align 4, !tbaa !9
  %97 = zext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %95, i64 %97
  %99 = load ptr, ptr %98, align 8, !tbaa !5
  %100 = load ptr, ptr %28, align 8, !tbaa !5
  %101 = icmp eq ptr %99, %100
  br i1 %101, label %102, label %103

102:                                              ; preds = %94
  store i32 1, ptr %29, align 4, !tbaa !9
  store i32 5, ptr %27, align 4
  br label %107

103:                                              ; preds = %94
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %30, align 4, !tbaa !9
  %106 = add i32 %105, 1
  store i32 %106, ptr %30, align 4, !tbaa !9
  br label %89, !llvm.loop !24

107:                                              ; preds = %102, %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %29, align 4, !tbaa !9
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %132, label %111

111:                                              ; preds = %108
  %112 = load ptr, ptr %28, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.subgraph_t, ptr %112, i32 0, i32 10
  %114 = load i32, ptr %113, align 8, !tbaa !13
  %115 = load i32, ptr %19, align 4, !tbaa !9
  %116 = icmp ule i32 %114, %115
  br i1 %116, label %117, label %130

117:                                              ; preds = %111
  %118 = load ptr, ptr %28, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.subgraph_t, ptr %118, i32 0, i32 11
  %120 = load i32, ptr %119, align 4, !tbaa !20
  %121 = load i32, ptr %20, align 4, !tbaa !9
  %122 = icmp ule i32 %120, %121
  br i1 %122, label %123, label %130

123:                                              ; preds = %117
  %124 = load ptr, ptr %28, align 8, !tbaa !5
  %125 = load ptr, ptr %25, align 8, !tbaa !5
  %126 = load i32, ptr %24, align 4, !tbaa !9
  %127 = add i32 %126, 1
  store i32 %127, ptr %24, align 4, !tbaa !9
  %128 = zext i32 %126 to i64
  %129 = getelementptr inbounds ptr, ptr %125, i64 %128
  store ptr %124, ptr %129, align 8, !tbaa !5
  br label %131

130:                                              ; preds = %117, %111
  store i32 1, ptr %22, align 4, !tbaa !9
  store i32 2, ptr %27, align 4
  br label %133

131:                                              ; preds = %123
  br label %132

132:                                              ; preds = %131, %108
  store i32 0, ptr %27, align 4
  br label %133

133:                                              ; preds = %132, %130
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  %134 = load i32, ptr %27, align 4
  switch i32 %134, label %138 [
    i32 0, label %135
  ]

135:                                              ; preds = %133
  br label %137

136:                                              ; preds = %78
  store i32 1, ptr %22, align 4, !tbaa !9
  store i32 2, ptr %27, align 4
  br label %138

137:                                              ; preds = %135
  store i32 0, ptr %27, align 4
  br label %138

138:                                              ; preds = %137, %136, %133
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  %139 = load i32, ptr %27, align 4
  switch i32 %139, label %149 [
    i32 0, label %140
  ]

140:                                              ; preds = %138
  br label %141

141:                                              ; preds = %140, %71
  %142 = load i32, ptr %22, align 4, !tbaa !9
  %143 = icmp ne i32 %142, 0
  br i1 %143, label %144, label %145

144:                                              ; preds = %141
  store i32 2, ptr %27, align 4
  br label %149

145:                                              ; preds = %141
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %26, align 4, !tbaa !9
  %148 = add i32 %147, 1
  store i32 %148, ptr %26, align 4, !tbaa !9
  br label %64, !llvm.loop !26

149:                                              ; preds = %144, %138, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %22, align 4, !tbaa !9
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %159, label %153

153:                                              ; preds = %150
  %154 = load ptr, ptr %25, align 8, !tbaa !5
  %155 = load i32, ptr %24, align 4, !tbaa !9
  %156 = zext i32 %155 to i64
  %157 = mul i64 %156, 8
  %158 = call ptr @realloc(ptr noundef %154, i64 noundef %157) #7
  store ptr %158, ptr %25, align 8, !tbaa !5
  br label %159

159:                                              ; preds = %153, %150
  call void @free_canonical_subgraph(ptr noundef %21)
  %160 = load ptr, ptr %25, align 8, !tbaa !5
  %161 = load ptr, ptr %12, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.subgraph_t, ptr %161, i32 0, i32 6
  store ptr %160, ptr %162, align 8, !tbaa !27
  %163 = load i32, ptr %24, align 4, !tbaa !9
  %164 = load ptr, ptr %12, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.subgraph_t, ptr %164, i32 0, i32 15
  store i32 %163, ptr %165, align 4, !tbaa !28
  %166 = load i32, ptr %24, align 4, !tbaa !9
  %167 = zext i32 %166 to i64
  %168 = mul i64 %167, 4
  %169 = call noalias ptr @malloc(i64 noundef %168) #6
  %170 = load ptr, ptr %12, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.subgraph_t, ptr %170, i32 0, i32 7
  store ptr %169, ptr %171, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %172

172:                                              ; preds = %191, %159
  %173 = load i32, ptr %31, align 4, !tbaa !9
  %174 = load i32, ptr %24, align 4, !tbaa !9
  %175 = icmp ult i32 %173, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %172
  store i32 8, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %194

177:                                              ; preds = %172
  %178 = load ptr, ptr %25, align 8, !tbaa !5
  %179 = load i32, ptr %31, align 4, !tbaa !9
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds ptr, ptr %178, i64 %180
  %182 = load ptr, ptr %181, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.subgraph_t, ptr %182, i32 0, i32 8
  %184 = load i32, ptr %183, align 8, !tbaa !30
  %185 = load ptr, ptr %12, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.subgraph_t, ptr %185, i32 0, i32 7
  %187 = load ptr, ptr %186, align 8, !tbaa !29
  %188 = load i32, ptr %31, align 4, !tbaa !9
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %187, i64 %189
  store i32 %184, ptr %190, align 4, !tbaa !9
  br label %191

191:                                              ; preds = %177
  %192 = load i32, ptr %31, align 4, !tbaa !9
  %193 = add i32 %192, 1
  store i32 %193, ptr %31, align 4, !tbaa !9
  br label %172, !llvm.loop !31

194:                                              ; preds = %176
  %195 = load ptr, ptr %23, align 8, !tbaa !5
  call void @free(ptr noundef %195) #5
  %196 = load i32, ptr %22, align 4, !tbaa !9
  %197 = icmp ne i32 %196, 0
  %198 = xor i1 %197, true
  %199 = zext i1 %198 to i32
  store i32 1, ptr %27, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 120, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  ret i32 %199
}

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

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

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


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

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

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @canonical_subgraph_template(ptr dead_on_unwind noalias writable sret(%struct.subgraph_t) align 8, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @free_canonical_subgraph(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare dso_local void @find_removable_edges(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @parent_check(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i32 noundef %5, ptr noundef %6, ptr noundef %7, i32 noundef %8) local_unnamed_addr #4 {
  %10 = alloca %struct.subgraph_t, align 8
  %11 = alloca ptr, align 8
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %15, label %12

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = load i32, ptr %13, align 8, !tbaa !5
  br label %21

15:                                               ; preds = %9
  %16 = getelementptr inbounds i8, ptr %2, i64 72
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %0, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = add i32 %19, %17
  br label %21

21:                                               ; preds = %15, %12
  %22 = phi i32 [ %14, %12 ], [ %20, %15 ]
  %23 = getelementptr inbounds i8, ptr %2, i64 76
  %24 = load i32, ptr %23, align 4, !tbaa !18
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  %26 = load i32, ptr %25, align 8, !tbaa !19
  %27 = sub i32 %24, %26
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %10) #5
  call void @canonical_subgraph_template(ptr dead_on_unwind nonnull writable sret(%struct.subgraph_t) align 8 %10, ptr noundef %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %28 = getelementptr inbounds i8, ptr %2, i64 88
  %29 = load i32, ptr %28, align 8, !tbaa !20
  %30 = zext i32 %29 to i64
  %31 = shl nuw nsw i64 %30, 3
  %32 = call noalias ptr @malloc(i64 noundef %31) #6
  call void @find_removable_edges(ptr noundef %2, ptr noundef %7, ptr noundef nonnull %11)
  %33 = load i32, ptr %28, align 8, !tbaa !20
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %._crit_edge, label %.lr.ph93

.lr.ph93:                                         ; preds = %21, %.loopexit
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.loopexit ], [ 0, %21 ]
  %.06291 = phi i32 [ %.466, %.loopexit ], [ 0, %21 ]
  %35 = load ptr, ptr %11, align 8, !tbaa !21
  %36 = getelementptr inbounds i8, ptr %35, i64 %indvars.iv105
  %37 = load i8, ptr %36, align 1, !tbaa !22
  %.not68 = icmp eq i8 %37, 0
  br i1 %.not68, label %.loopexit, label %38

38:                                               ; preds = %.lr.ph93
  %39 = trunc nuw i64 %indvars.iv105 to i32
  %40 = call ptr @find_canonical_parent(ptr noundef nonnull %2, ptr noundef %3, ptr noundef nonnull %10, i32 noundef %39, ptr noundef %4, i32 noundef %5, ptr noundef %6)
  %.not69 = icmp eq ptr %40, null
  br i1 %.not69, label %.loopexit85.loopexit, label %.preheader

.preheader:                                       ; preds = %38
  %.not7189.not = icmp eq i32 %.06291, 0
  br i1 %.not7189.not, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext i32 %.06291 to i64
  br label %.lr.ph

41:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge, label %.lr.ph, !llvm.loop !23

.lr.ph:                                           ; preds = %.lr.ph.preheader, %41
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %41 ]
  %42 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv
  %43 = load ptr, ptr %42, align 8, !tbaa !21
  %44 = icmp eq ptr %43, %40
  br i1 %44, label %.loopexit, label %41

.critedge:                                        ; preds = %41, %.preheader
  %45 = getelementptr inbounds i8, ptr %40, i64 72
  %46 = load i32, ptr %45, align 8, !tbaa !11
  %.not72 = icmp ugt i32 %46, %22
  br i1 %.not72, label %.loopexit85.loopexit, label %47

47:                                               ; preds = %.critedge
  %48 = getelementptr inbounds i8, ptr %40, i64 76
  %49 = load i32, ptr %48, align 4, !tbaa !18
  %.not73 = icmp ugt i32 %49, %27
  br i1 %.not73, label %.loopexit85.loopexit, label %50

50:                                               ; preds = %47
  %51 = add i32 %.06291, 1
  %52 = zext i32 %.06291 to i64
  %53 = getelementptr inbounds ptr, ptr %32, i64 %52
  store ptr %40, ptr %53, align 8, !tbaa !21
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph93, %50
  %.466 = phi i32 [ %.06291, %.lr.ph93 ], [ %51, %50 ], [ %.06291, %.lr.ph ]
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %54 = load i32, ptr %28, align 8, !tbaa !20
  %55 = zext i32 %54 to i64
  %.not112 = icmp ult i64 %indvars.iv.next106, %55
  br i1 %.not112, label %.lr.ph93, label %._crit_edge, !llvm.loop !25

._crit_edge:                                      ; preds = %.loopexit, %21
  %.062.lcssa = phi i32 [ 0, %21 ], [ %.466, %.loopexit ]
  %56 = zext i32 %.062.lcssa to i64
  %57 = shl nuw nsw i64 %56, 3
  %58 = call ptr @realloc(ptr noundef %32, i64 noundef %57) #7
  br label %.loopexit85

.loopexit85.loopexit:                             ; preds = %47, %.critedge, %38
  %.pre = zext i32 %.06291 to i64
  br label %.loopexit85

.loopexit85:                                      ; preds = %.loopexit85.loopexit, %._crit_edge
  %.pre-phi = phi i64 [ %.pre, %.loopexit85.loopexit ], [ %56, %._crit_edge ]
  %.06288 = phi i32 [ %.06291, %.loopexit85.loopexit ], [ %.062.lcssa, %._crit_edge ]
  %59 = phi i32 [ 0, %.loopexit85.loopexit ], [ 1, %._crit_edge ]
  %.061 = phi ptr [ %32, %.loopexit85.loopexit ], [ %58, %._crit_edge ]
  call void @free_canonical_subgraph(ptr noundef nonnull %10)
  %60 = getelementptr inbounds i8, ptr %2, i64 48
  store ptr %.061, ptr %60, align 8, !tbaa !26
  %61 = getelementptr inbounds i8, ptr %2, i64 92
  store i32 %.06288, ptr %61, align 4, !tbaa !27
  %62 = shl nuw nsw i64 %.pre-phi, 2
  %63 = call noalias ptr @malloc(i64 noundef %62) #6
  %64 = getelementptr inbounds i8, ptr %2, i64 56
  store ptr %63, ptr %64, align 8, !tbaa !28
  %.not99 = icmp eq i32 %.06288, 0
  br i1 %.not99, label %._crit_edge98, label %.lr.ph97.preheader

.lr.ph97.preheader:                               ; preds = %.loopexit85
  %65 = add nsw i64 %.pre-phi, -1
  %xtraiter = and i64 %.pre-phi, 3
  %66 = icmp ult i64 %65, 3
  br i1 %66, label %._crit_edge98.loopexit.unr-lcssa, label %.lr.ph97.preheader.new

.lr.ph97.preheader.new:                           ; preds = %.lr.ph97.preheader
  %unroll_iter = and i64 %.pre-phi, 4294967292
  br label %.lr.ph97

._crit_edge98.loopexit.unr-lcssa:                 ; preds = %.lr.ph97, %.lr.ph97.preheader
  %indvars.iv107.unr = phi i64 [ 0, %.lr.ph97.preheader ], [ %indvars.iv.next108.3, %.lr.ph97 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge98, label %.lr.ph97.epil

.lr.ph97.epil:                                    ; preds = %._crit_edge98.loopexit.unr-lcssa, %.lr.ph97.epil
  %indvars.iv107.epil = phi i64 [ %indvars.iv.next108.epil, %.lr.ph97.epil ], [ %indvars.iv107.unr, %._crit_edge98.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph97.epil ], [ 0, %._crit_edge98.loopexit.unr-lcssa ]
  %67 = getelementptr inbounds ptr, ptr %.061, i64 %indvars.iv107.epil
  %68 = load ptr, ptr %67, align 8, !tbaa !21
  %69 = getelementptr inbounds i8, ptr %68, i64 64
  %70 = load i32, ptr %69, align 8, !tbaa !29
  %71 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv107.epil
  store i32 %70, ptr %71, align 4, !tbaa !30
  %indvars.iv.next108.epil = add nuw nsw i64 %indvars.iv107.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 %._crit_edge98, label %.lr.ph97.epil, !llvm.loop !31

._crit_edge98:                                    ; preds = %._crit_edge98.loopexit.unr-lcssa, %.lr.ph97.epil, %.loopexit85
  %72 = load ptr, ptr %11, align 8, !tbaa !21
  call void @free(ptr noundef %72) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %10) #5
  ret i32 %59

.lr.ph97:                                         ; preds = %.lr.ph97, %.lr.ph97.preheader.new
  %indvars.iv107 = phi i64 [ 0, %.lr.ph97.preheader.new ], [ %indvars.iv.next108.3, %.lr.ph97 ]
  %niter = phi i64 [ 0, %.lr.ph97.preheader.new ], [ %niter.next.3, %.lr.ph97 ]
  %73 = getelementptr inbounds ptr, ptr %.061, i64 %indvars.iv107
  %74 = load ptr, ptr %73, align 8, !tbaa !21
  %75 = getelementptr inbounds i8, ptr %74, i64 64
  %76 = load i32, ptr %75, align 8, !tbaa !29
  %77 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv107
  store i32 %76, ptr %77, align 4, !tbaa !30
  %indvars.iv.next108 = or disjoint i64 %indvars.iv107, 1
  %78 = getelementptr inbounds ptr, ptr %.061, i64 %indvars.iv.next108
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = getelementptr inbounds i8, ptr %79, i64 64
  %81 = load i32, ptr %80, align 8, !tbaa !29
  %82 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.next108
  store i32 %81, ptr %82, align 4, !tbaa !30
  %indvars.iv.next108.1 = or disjoint i64 %indvars.iv107, 2
  %83 = getelementptr inbounds ptr, ptr %.061, i64 %indvars.iv.next108.1
  %84 = load ptr, ptr %83, align 8, !tbaa !21
  %85 = getelementptr inbounds i8, ptr %84, i64 64
  %86 = load i32, ptr %85, align 8, !tbaa !29
  %87 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.next108.1
  store i32 %86, ptr %87, align 4, !tbaa !30
  %indvars.iv.next108.2 = or disjoint i64 %indvars.iv107, 3
  %88 = getelementptr inbounds ptr, ptr %.061, i64 %indvars.iv.next108.2
  %89 = load ptr, ptr %88, align 8, !tbaa !21
  %90 = getelementptr inbounds i8, ptr %89, i64 64
  %91 = load i32, ptr %90, align 8, !tbaa !29
  %92 = getelementptr inbounds i32, ptr %63, i64 %indvars.iv.next108.2
  store i32 %91, ptr %92, align 4, !tbaa !30
  %indvars.iv.next108.3 = add nuw nsw i64 %indvars.iv107, 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 %._crit_edge98.loopexit.unr-lcssa, label %.lr.ph97, !llvm.loop !33
}

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

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

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


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