; LLVM IR from ElsevierSoftwareX/SOFTX-D-20-00016 :: GameplayFootball/src/misc (hungarian)

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

@stderr = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@__FUNCTION__.hungarian_init = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [66 x i8], align 1

; 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,1)
declare noalias ptr @calloc(i64 noundef, 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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @hungarian_imax(i32 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @hungarian_init(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #3 {
  %6 = alloca ptr, align 8
  %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 i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  %16 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %16, ptr %13, align 4, !tbaa !9
  %17 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %17, ptr %14, align 4, !tbaa !9
  %18 = load i32, ptr %9, align 4, !tbaa !9
  %19 = load i32, ptr %8, align 4, !tbaa !9
  %20 = call i32 @hungarian_imax(i32 noundef %18, i32 noundef %19)
  store i32 %20, ptr %8, align 4, !tbaa !9
  %21 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %21, ptr %9, align 4, !tbaa !9
  %22 = load i32, ptr %8, align 4, !tbaa !9
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.hungarian_problem_t, ptr %23, i32 0, i32 0
  store i32 %22, ptr %24, align 8, !tbaa !11
  %25 = load i32, ptr %9, align 4, !tbaa !9
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.hungarian_problem_t, ptr %26, i32 0, i32 1
  store i32 %25, ptr %27, align 4, !tbaa !13
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = call noalias ptr @calloc(i64 noundef %29, i64 noundef 8) #5
  %31 = load ptr, ptr %6, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.hungarian_problem_t, ptr %31, i32 0, i32 2
  store ptr %30, ptr %32, align 8, !tbaa !14
  br label %33

33:                                               ; preds = %5
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.hungarian_problem_t, ptr %34, i32 0, i32 2
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = icmp eq ptr %36, null
  br i1 %37, label %38, label %41

38:                                               ; preds = %33
  %39 = load ptr, ptr @stderr, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.6, ptr noundef @__FUNCTION__.hungarian_init, ptr noundef @.str.7, i32 noundef 102) #4
  br label %41

41:                                               ; preds = %38, %33
  br label %42

42:                                               ; preds = %41
  br label %43

43:                                               ; preds = %42
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = call noalias ptr @calloc(i64 noundef %45, i64 noundef 8) #5
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.hungarian_problem_t, ptr %47, i32 0, i32 3
  store ptr %46, ptr %48, align 8, !tbaa !15
  br label %49

49:                                               ; preds = %43
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.hungarian_problem_t, ptr %50, i32 0, i32 3
  %52 = load ptr, ptr %51, align 8, !tbaa !15
  %53 = icmp eq ptr %52, null
  br i1 %53, label %54, label %57

54:                                               ; preds = %49
  %55 = load ptr, ptr @stderr, align 8, !tbaa !5
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef @.str.6, ptr noundef @__FUNCTION__.hungarian_init, ptr noundef @.str.7, i32 noundef 104) #4
  br label %57

57:                                               ; preds = %54, %49
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %192, %59
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.hungarian_problem_t, ptr %62, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !11
  %65 = icmp slt i32 %61, %64
  br i1 %65, label %66, label %195

66:                                               ; preds = %60
  %67 = load i32, ptr %9, align 4, !tbaa !9
  %68 = sext i32 %67 to i64
  %69 = call noalias ptr @calloc(i64 noundef %68, i64 noundef 4) #5
  %70 = load ptr, ptr %6, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.hungarian_problem_t, ptr %70, i32 0, i32 2
  %72 = load ptr, ptr %71, align 8, !tbaa !14
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds ptr, ptr %72, i64 %74
  store ptr %69, ptr %75, align 8, !tbaa !5
  br label %76

76:                                               ; preds = %66
  %77 = load ptr, ptr %6, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.hungarian_problem_t, ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !14
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds ptr, ptr %79, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %84 = icmp eq ptr %83, null
  br i1 %84, label %85, label %88

85:                                               ; preds = %76
  %86 = load ptr, ptr @stderr, align 8, !tbaa !5
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str.6, ptr noundef @__FUNCTION__.hungarian_init, ptr noundef @.str.7, i32 noundef 108) #4
  br label %88

88:                                               ; preds = %85, %76
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %9, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = call noalias ptr @calloc(i64 noundef %92, i64 noundef 4) #5
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.hungarian_problem_t, ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %95, align 8, !tbaa !15
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds ptr, ptr %96, i64 %98
  store ptr %93, ptr %99, align 8, !tbaa !5
  br label %100

100:                                              ; preds = %90
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.hungarian_problem_t, ptr %101, i32 0, i32 3
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds ptr, ptr %103, i64 %105
  %107 = load ptr, ptr %106, align 8, !tbaa !5
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %112

109:                                              ; preds = %100
  %110 = load ptr, ptr @stderr, align 8, !tbaa !5
  %111 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef @.str.6, ptr noundef @__FUNCTION__.hungarian_init, ptr noundef @.str.7, i32 noundef 110) #4
  br label %112

112:                                              ; preds = %109, %100
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %188, %114
  %116 = load i32, ptr %12, align 4, !tbaa !9
  %117 = load ptr, ptr %6, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.hungarian_problem_t, ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 4, !tbaa !13
  %120 = icmp slt i32 %116, %119
  br i1 %120, label %121, label %191

121:                                              ; preds = %115
  %122 = load i32, ptr %11, align 4, !tbaa !9
  %123 = load i32, ptr %14, align 4, !tbaa !9
  %124 = icmp slt i32 %122, %123
  br i1 %124, label %125, label %139

125:                                              ; preds = %121
  %126 = load i32, ptr %12, align 4, !tbaa !9
  %127 = load i32, ptr %13, align 4, !tbaa !9
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %129, label %139

129:                                              ; preds = %125
  %130 = load ptr, ptr %7, align 8, !tbaa !5
  %131 = load i32, ptr %11, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds ptr, ptr %130, i64 %132
  %134 = load ptr, ptr %133, align 8, !tbaa !5
  %135 = load i32, ptr %12, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i32, ptr %134, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !9
  br label %140

139:                                              ; preds = %125, %121
  br label %140

140:                                              ; preds = %139, %129
  %141 = phi i32 [ %138, %129 ], [ 0, %139 ]
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.hungarian_problem_t, ptr %142, i32 0, i32 2
  %144 = load ptr, ptr %143, align 8, !tbaa !14
  %145 = load i32, ptr %11, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds ptr, ptr %144, i64 %146
  %148 = load ptr, ptr %147, align 8, !tbaa !5
  %149 = load i32, ptr %12, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds i32, ptr %148, i64 %150
  store i32 %141, ptr %151, align 4, !tbaa !9
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.hungarian_problem_t, ptr %152, i32 0, i32 3
  %154 = load ptr, ptr %153, align 8, !tbaa !15
  %155 = load i32, ptr %11, align 4, !tbaa !9
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds ptr, ptr %154, i64 %156
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = load i32, ptr %12, align 4, !tbaa !9
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds i32, ptr %158, i64 %160
  store i32 0, ptr %161, align 4, !tbaa !9
  %162 = load i32, ptr %15, align 4, !tbaa !9
  %163 = load ptr, ptr %6, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.hungarian_problem_t, ptr %163, i32 0, i32 2
  %165 = load ptr, ptr %164, align 8, !tbaa !14
  %166 = load i32, ptr %11, align 4, !tbaa !9
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds ptr, ptr %165, i64 %167
  %169 = load ptr, ptr %168, align 8, !tbaa !5
  %170 = load i32, ptr %12, align 4, !tbaa !9
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds i32, ptr %169, i64 %171
  %173 = load i32, ptr %172, align 4, !tbaa !9
  %174 = icmp slt i32 %162, %173
  br i1 %174, label %175, label %187

175:                                              ; preds = %140
  %176 = load ptr, ptr %6, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.hungarian_problem_t, ptr %176, i32 0, i32 2
  %178 = load ptr, ptr %177, align 8, !tbaa !14
  %179 = load i32, ptr %11, align 4, !tbaa !9
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds ptr, ptr %178, i64 %180
  %182 = load ptr, ptr %181, align 8, !tbaa !5
  %183 = load i32, ptr %12, align 4, !tbaa !9
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds i32, ptr %182, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !9
  store i32 %186, ptr %15, align 4, !tbaa !9
  br label %187

187:                                              ; preds = %175, %140
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %12, align 4, !tbaa !9
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %12, align 4, !tbaa !9
  br label %115, !llvm.loop !16

191:                                              ; preds = %115
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr %11, align 4, !tbaa !9
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %11, align 4, !tbaa !9
  br label %60, !llvm.loop !18

195:                                              ; preds = %60
  %196 = load i32, ptr %10, align 4, !tbaa !9
  %197 = icmp eq i32 %196, 1
  br i1 %197, label %198, label %244

198:                                              ; preds = %195
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %199

199:                                              ; preds = %240, %198
  %200 = load i32, ptr %11, align 4, !tbaa !9
  %201 = load ptr, ptr %6, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.hungarian_problem_t, ptr %201, i32 0, i32 0
  %203 = load i32, ptr %202, align 8, !tbaa !11
  %204 = icmp slt i32 %200, %203
  br i1 %204, label %205, label %243

205:                                              ; preds = %199
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %206

206:                                              ; preds = %236, %205
  %207 = load i32, ptr %12, align 4, !tbaa !9
  %208 = load ptr, ptr %6, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.hungarian_problem_t, ptr %208, i32 0, i32 1
  %210 = load i32, ptr %209, align 4, !tbaa !13
  %211 = icmp slt i32 %207, %210
  br i1 %211, label %212, label %239

212:                                              ; preds = %206
  %213 = load i32, ptr %15, align 4, !tbaa !9
  %214 = load ptr, ptr %6, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.hungarian_problem_t, ptr %214, i32 0, i32 2
  %216 = load ptr, ptr %215, align 8, !tbaa !14
  %217 = load i32, ptr %11, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds ptr, ptr %216, i64 %218
  %220 = load ptr, ptr %219, align 8, !tbaa !5
  %221 = load i32, ptr %12, align 4, !tbaa !9
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds i32, ptr %220, i64 %222
  %224 = load i32, ptr %223, align 4, !tbaa !9
  %225 = sub nsw i32 %213, %224
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.hungarian_problem_t, ptr %226, i32 0, i32 2
  %228 = load ptr, ptr %227, align 8, !tbaa !14
  %229 = load i32, ptr %11, align 4, !tbaa !9
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds ptr, ptr %228, i64 %230
  %232 = load ptr, ptr %231, align 8, !tbaa !5
  %233 = load i32, ptr %12, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds i32, ptr %232, i64 %234
  store i32 %225, ptr %235, align 4, !tbaa !9
  br label %236

236:                                              ; preds = %212
  %237 = load i32, ptr %12, align 4, !tbaa !9
  %238 = add nsw i32 %237, 1
  store i32 %238, ptr %12, align 4, !tbaa !9
  br label %206, !llvm.loop !19

239:                                              ; preds = %206
  br label %240

240:                                              ; preds = %239
  %241 = load i32, ptr %11, align 4, !tbaa !9
  %242 = add nsw i32 %241, 1
  store i32 %242, ptr %11, align 4, !tbaa !9
  br label %199, !llvm.loop !20

243:                                              ; preds = %199
  br label %252

244:                                              ; preds = %195
  %245 = load i32, ptr %10, align 4, !tbaa !9
  %246 = icmp eq i32 %245, 0
  br i1 %246, label %247, label %248

247:                                              ; preds = %244
  br label %251

248:                                              ; preds = %244
  %249 = load ptr, ptr @stderr, align 8, !tbaa !5
  %250 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %249, ptr noundef @.str.8, ptr noundef @__FUNCTION__.hungarian_init) #4
  br label %251

251:                                              ; preds = %248, %247
  br label %252

252:                                              ; preds = %251, %243
  %253 = load i32, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret i32 %253
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0,1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #4 = { nounwind }
attributes #5 = { nounwind allocsize(0,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 0}
!12 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16}
!13 = !{!12, !10, i64 4}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !6, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [37 x i8], align 1
@__FUNCTION__.hungarian_init = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [66 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @hungarian_imax(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @hungarian_init(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #2 {
  %6 = tail call i32 @hungarian_imax(i32 noundef %3, i32 noundef %2)
  store i32 %6, ptr %0, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %6, ptr %7, align 4, !tbaa !11
  %8 = sext i32 %6 to i64
  %9 = tail call noalias ptr @calloc(i64 noundef %8, i64 noundef 8) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %9, ptr %10, align 8, !tbaa !12
  %11 = icmp eq ptr %9, null
  br i1 %11, label %12, label %15

12:                                               ; preds = %5
  %13 = load ptr, ptr @stderr, align 8, !tbaa !13
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.6, ptr noundef nonnull @__FUNCTION__.hungarian_init, ptr noundef nonnull @.str.7, i32 noundef 102) #5
  br label %15

15:                                               ; preds = %12, %5
  %16 = tail call noalias ptr @calloc(i64 noundef %8, i64 noundef 8) #4
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %16, ptr %17, align 8, !tbaa !14
  %18 = icmp eq ptr %16, null
  br i1 %18, label %19, label %22

19:                                               ; preds = %15
  %20 = load ptr, ptr @stderr, align 8, !tbaa !13
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str.6, ptr noundef nonnull @__FUNCTION__.hungarian_init, ptr noundef nonnull @.str.7, i32 noundef 104) #5
  br label %22

22:                                               ; preds = %19, %15
  %23 = load i32, ptr %0, align 8, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph78.preheader, label %._crit_edge79

.lr.ph78.preheader:                               ; preds = %22
  %25 = sext i32 %3 to i64
  %26 = sext i32 %2 to i64
  br label %.lr.ph78

.lr.ph78:                                         ; preds = %.lr.ph78.preheader, %._crit_edge
  %indvars.iv91 = phi i64 [ 0, %.lr.ph78.preheader ], [ %indvars.iv.next92, %._crit_edge ]
  %.076 = phi i32 [ 0, %.lr.ph78.preheader ], [ %.1.lcssa, %._crit_edge ]
  %27 = tail call noalias ptr @calloc(i64 noundef %8, i64 noundef 4) #4
  %28 = load ptr, ptr %10, align 8, !tbaa !12
  %29 = getelementptr inbounds ptr, ptr %28, i64 %indvars.iv91
  store ptr %27, ptr %29, align 8, !tbaa !13
  %30 = load ptr, ptr %10, align 8, !tbaa !12
  %31 = getelementptr inbounds ptr, ptr %30, i64 %indvars.iv91
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %37

34:                                               ; preds = %.lr.ph78
  %35 = load ptr, ptr @stderr, align 8, !tbaa !13
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.6, ptr noundef nonnull @__FUNCTION__.hungarian_init, ptr noundef nonnull @.str.7, i32 noundef 108) #5
  br label %37

37:                                               ; preds = %34, %.lr.ph78
  %38 = tail call noalias ptr @calloc(i64 noundef %8, i64 noundef 4) #4
  %39 = load ptr, ptr %17, align 8, !tbaa !14
  %40 = getelementptr inbounds ptr, ptr %39, i64 %indvars.iv91
  store ptr %38, ptr %40, align 8, !tbaa !13
  %41 = load ptr, ptr %17, align 8, !tbaa !14
  %42 = getelementptr inbounds ptr, ptr %41, i64 %indvars.iv91
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %48

45:                                               ; preds = %37
  %46 = load ptr, ptr @stderr, align 8, !tbaa !13
  %47 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.6, ptr noundef nonnull @__FUNCTION__.hungarian_init, ptr noundef nonnull @.str.7, i32 noundef 110) #5
  br label %48

48:                                               ; preds = %45, %37
  %49 = load i32, ptr %7, align 4, !tbaa !11
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %48
  %51 = icmp slt i64 %indvars.iv91, %26
  %52 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv91
  %53 = load ptr, ptr %10, align 8, !tbaa !12
  %54 = getelementptr inbounds ptr, ptr %53, i64 %indvars.iv91
  %55 = load ptr, ptr %54, align 8, !tbaa !13
  %56 = load ptr, ptr %17, align 8, !tbaa !14
  %57 = getelementptr inbounds ptr, ptr %56, i64 %indvars.iv91
  %58 = load ptr, ptr %57, align 8, !tbaa !13
  br i1 %51, label %.lr.ph.split, label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.lr.ph.split.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph.split.us ], [ 0, %.lr.ph ]
  %.174.us = phi i32 [ %spec.select.us, %.lr.ph.split.us ], [ %.076, %.lr.ph ]
  %59 = getelementptr inbounds i32, ptr %55, i64 %indvars.iv
  store i32 0, ptr %59, align 4, !tbaa !15
  %60 = getelementptr inbounds i32, ptr %58, i64 %indvars.iv
  store i32 0, ptr %60, align 4, !tbaa !15
  %61 = load i32, ptr %59, align 4, !tbaa !15
  %spec.select.us = tail call i32 @llvm.smax.i32(i32 %.174.us, i32 %61)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %62 = load i32, ptr %7, align 4, !tbaa !11
  %63 = sext i32 %62 to i64
  %64 = icmp slt i64 %indvars.iv.next, %63
  br i1 %64, label %.lr.ph.split.us, label %._crit_edge, !llvm.loop !16

.lr.ph.split:                                     ; preds = %.lr.ph, %70
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %70 ], [ 0, %.lr.ph ]
  %.174 = phi i32 [ %spec.select, %70 ], [ %.076, %.lr.ph ]
  %65 = icmp slt i64 %indvars.iv88, %25
  br i1 %65, label %66, label %70

66:                                               ; preds = %.lr.ph.split
  %67 = load ptr, ptr %52, align 8, !tbaa !13
  %68 = getelementptr inbounds i32, ptr %67, i64 %indvars.iv88
  %69 = load i32, ptr %68, align 4, !tbaa !15
  br label %70

70:                                               ; preds = %.lr.ph.split, %66
  %71 = phi i32 [ %69, %66 ], [ 0, %.lr.ph.split ]
  %72 = getelementptr inbounds i32, ptr %55, i64 %indvars.iv88
  store i32 %71, ptr %72, align 4, !tbaa !15
  %73 = getelementptr inbounds i32, ptr %58, i64 %indvars.iv88
  store i32 0, ptr %73, align 4, !tbaa !15
  %74 = load i32, ptr %72, align 4, !tbaa !15
  %spec.select = tail call i32 @llvm.smax.i32(i32 %.174, i32 %74)
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %75 = load i32, ptr %7, align 4, !tbaa !11
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next89, %76
  br i1 %77, label %.lr.ph.split, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph.split.us, %70, %48
  %.1.lcssa = phi i32 [ %.076, %48 ], [ %spec.select, %70 ], [ %spec.select.us, %.lr.ph.split.us ]
  %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
  %78 = load i32, ptr %0, align 8, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = icmp slt i64 %indvars.iv.next92, %79
  br i1 %80, label %.lr.ph78, label %._crit_edge79, !llvm.loop !18

._crit_edge79:                                    ; preds = %._crit_edge, %22
  %81 = phi i32 [ %23, %22 ], [ %78, %._crit_edge ]
  %.0.lcssa = phi i32 [ 0, %22 ], [ %.1.lcssa, %._crit_edge ]
  switch i32 %4, label %102 [
    i32 1, label %.preheader72
    i32 0, label %.loopexit
  ]

.preheader72:                                     ; preds = %._crit_edge79
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %.preheader.lr.ph, label %.loopexit

.preheader.lr.ph:                                 ; preds = %.preheader72
  %83 = load i32, ptr %7, align 4, !tbaa !11
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge83
  %85 = phi i32 [ %98, %._crit_edge83 ], [ %81, %.preheader.lr.ph ]
  %86 = phi i32 [ %99, %._crit_edge83 ], [ %83, %.preheader.lr.ph ]
  %indvars.iv97 = phi i64 [ %indvars.iv.next98, %._crit_edge83 ], [ 0, %.preheader.lr.ph ]
  %87 = icmp sgt i32 %86, 0
  br i1 %87, label %.lr.ph82, label %._crit_edge83

.lr.ph82:                                         ; preds = %.preheader
  %88 = load ptr, ptr %10, align 8, !tbaa !12
  %89 = getelementptr inbounds ptr, ptr %88, i64 %indvars.iv97
  %90 = load ptr, ptr %89, align 8, !tbaa !13
  br label %91

91:                                               ; preds = %.lr.ph82, %91
  %indvars.iv94 = phi i64 [ 0, %.lr.ph82 ], [ %indvars.iv.next95, %91 ]
  %92 = getelementptr inbounds i32, ptr %90, i64 %indvars.iv94
  %93 = load i32, ptr %92, align 4, !tbaa !15
  %94 = sub nsw i32 %.0.lcssa, %93
  store i32 %94, ptr %92, align 4, !tbaa !15
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %95 = load i32, ptr %7, align 4, !tbaa !11
  %96 = sext i32 %95 to i64
  %97 = icmp slt i64 %indvars.iv.next95, %96
  br i1 %97, label %91, label %._crit_edge83.loopexit, !llvm.loop !19

._crit_edge83.loopexit:                           ; preds = %91
  %.pre = load i32, ptr %0, align 8, !tbaa !5
  br label %._crit_edge83

._crit_edge83:                                    ; preds = %._crit_edge83.loopexit, %.preheader
  %98 = phi i32 [ %.pre, %._crit_edge83.loopexit ], [ %85, %.preheader ]
  %99 = phi i32 [ %95, %._crit_edge83.loopexit ], [ %86, %.preheader ]
  %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
  %100 = sext i32 %98 to i64
  %101 = icmp slt i64 %indvars.iv.next98, %100
  br i1 %101, label %.preheader, label %.loopexit, !llvm.loop !20

102:                                              ; preds = %._crit_edge79
  %103 = load ptr, ptr @stderr, align 8, !tbaa !13
  %104 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef nonnull @.str.8, ptr noundef nonnull @__FUNCTION__.hungarian_init) #5
  br label %.loopexit

.loopexit:                                        ; preds = %._crit_edge83, %.preheader.lr.ph, %.preheader72, %._crit_edge79, %102
  ret i32 %6
}

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) 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 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind allocsize(0,1) }
attributes #5 = { cold 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 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 8}
!13 = !{!10, !10, i64 0}
!14 = !{!6, !10, i64 16}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17, !21}
!21 = !{!"llvm.loop.unswitch.partial.disable"}


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