; LLVM IR from gokcehan/pns :: generators/gridgen-patched (gridgen)

; 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.stat_para = type { i64, [5 x float] }
%struct.imbalance = type { i64, i64 }
%struct.arcs = type { i64, i64, i64, i64 }

@source_list = external dso_local global ptr, align 8
@sink_list = external dso_local global ptr, align 8
@arc_list = external dso_local global ptr, align 8
@arc_costs = external dso_local global %struct.stat_para, align 8
@n_source = external dso_local global i64, align 8
@n_sink = external dso_local global i64, align 8
@capacities = external dso_local global %struct.stat_para, align 8
@supply = external dso_local global i64, align 8
@n_arc = external dso_local global i64, align 8
@n_node = external dso_local global i64, align 8
@n1 = external dso_local global i64, align 8
@avg_degree = external dso_local global i64, align 8
@n2 = external dso_local global i64, align 8
@outfile = external dso_local global ptr, align 8
@seed_original = external dso_local global i64, align 8
@stdout = external global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [17 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: 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 @output() #1 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %4 = load ptr, ptr @outfile, align 8, !tbaa !5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %6, label %8

6:                                                ; preds = %0
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  store ptr %7, ptr @outfile, align 8, !tbaa !5
  br label %8

8:                                                ; preds = %6, %0
  %9 = load ptr, ptr @outfile, align 8, !tbaa !5
  %10 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef @.str.10) #4
  %11 = load ptr, ptr @outfile, align 8, !tbaa !5
  %12 = load i64, ptr @seed_original, align 8, !tbaa !9
  %13 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef @.str.11, i64 noundef %12) #4
  %14 = load ptr, ptr @outfile, align 8, !tbaa !5
  %15 = load i64, ptr @n_node, align 8, !tbaa !9
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef @.str.12, i64 noundef %15) #4
  %17 = load ptr, ptr @outfile, align 8, !tbaa !5
  %18 = load i64, ptr @n1, align 8, !tbaa !9
  %19 = load i64, ptr @n2, align 8, !tbaa !9
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.13, i64 noundef %18, i64 noundef %19) #4
  %21 = load ptr, ptr @outfile, align 8, !tbaa !5
  %22 = load i64, ptr @n_source, align 8, !tbaa !9
  %23 = load i64, ptr @n_sink, align 8, !tbaa !9
  %24 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef @.str.14, i64 noundef %22, i64 noundef %23) #4
  %25 = load ptr, ptr @outfile, align 8, !tbaa !5
  %26 = load i64, ptr @avg_degree, align 8, !tbaa !9
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef @.str.15, i64 noundef %26) #4
  %28 = load ptr, ptr @outfile, align 8, !tbaa !5
  %29 = load i64, ptr @supply, align 8, !tbaa !9
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.16, i64 noundef %29) #4
  %31 = load i64, ptr @arc_costs, align 8, !tbaa !11
  switch i64 %31, label %32 [
    i64 1, label %33
    i64 2, label %40
  ]

32:                                               ; preds = %8
  br label %45

33:                                               ; preds = %8
  %34 = load ptr, ptr @outfile, align 8, !tbaa !5
  %35 = load float, ptr getelementptr inbounds (%struct.stat_para, ptr @arc_costs, i32 0, i32 1), align 4, !tbaa !13
  %36 = fptosi float %35 to i64
  %37 = load float, ptr getelementptr inbounds (float, ptr getelementptr inbounds (%struct.stat_para, ptr @arc_costs, i32 0, i32 1), i64 1), align 4, !tbaa !13
  %38 = fptosi float %37 to i64
  %39 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef @.str.17, i64 noundef %36, i64 noundef %38) #4
  br label %45

40:                                               ; preds = %8
  %41 = load ptr, ptr @outfile, align 8, !tbaa !5
  %42 = load float, ptr getelementptr inbounds (%struct.stat_para, ptr @arc_costs, i32 0, i32 1), align 4, !tbaa !13
  %43 = fptosi float %42 to i64
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.18, i64 noundef %43) #4
  br label %45

45:                                               ; preds = %40, %33, %32
  %46 = load i64, ptr @capacities, align 8, !tbaa !11
  switch i64 %46, label %47 [
    i64 1, label %48
    i64 2, label %55
  ]

47:                                               ; preds = %45
  br label %60

48:                                               ; preds = %45
  %49 = load ptr, ptr @outfile, align 8, !tbaa !5
  %50 = load float, ptr getelementptr inbounds (%struct.stat_para, ptr @capacities, i32 0, i32 1), align 4, !tbaa !13
  %51 = fptosi float %50 to i64
  %52 = load float, ptr getelementptr inbounds (float, ptr getelementptr inbounds (%struct.stat_para, ptr @capacities, i32 0, i32 1), i64 1), align 4, !tbaa !13
  %53 = fptosi float %52 to i64
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef @.str.19, i64 noundef %51, i64 noundef %53) #4
  br label %60

55:                                               ; preds = %45
  %56 = load ptr, ptr @outfile, align 8, !tbaa !5
  %57 = load float, ptr getelementptr inbounds (%struct.stat_para, ptr @capacities, i32 0, i32 1), align 4, !tbaa !13
  %58 = fptosi float %57 to i64
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.20, i64 noundef %58) #4
  br label %60

60:                                               ; preds = %55, %48, %47
  %61 = load ptr, ptr @outfile, align 8, !tbaa !5
  %62 = load i64, ptr @n_node, align 8, !tbaa !9
  %63 = load i64, ptr @n_arc, align 8, !tbaa !9
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %61, ptr noundef @.str.21, i64 noundef %62, i64 noundef %63) #4
  store i64 0, ptr %3, align 8, !tbaa !9
  %65 = load ptr, ptr @source_list, align 8, !tbaa !5
  store ptr %65, ptr %2, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %79, %60
  %67 = load i64, ptr %3, align 8, !tbaa !9
  %68 = load i64, ptr @n_source, align 8, !tbaa !9
  %69 = icmp slt i64 %67, %68
  br i1 %69, label %70, label %84

70:                                               ; preds = %66
  %71 = load ptr, ptr @outfile, align 8, !tbaa !5
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.imbalance, ptr %72, i32 0, i32 0
  %74 = load i64, ptr %73, align 8, !tbaa !15
  %75 = load ptr, ptr %2, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.imbalance, ptr %75, i32 0, i32 1
  %77 = load i64, ptr %76, align 8, !tbaa !17
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str.22, i64 noundef %74, i64 noundef %77) #4
  br label %79

79:                                               ; preds = %70
  %80 = load i64, ptr %3, align 8, !tbaa !9
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %3, align 8, !tbaa !9
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.imbalance, ptr %82, i32 1
  store ptr %83, ptr %2, align 8, !tbaa !5
  br label %66, !llvm.loop !18

84:                                               ; preds = %66
  store i64 0, ptr %3, align 8, !tbaa !9
  %85 = load ptr, ptr @sink_list, align 8, !tbaa !5
  store ptr %85, ptr %2, align 8, !tbaa !5
  br label %86

86:                                               ; preds = %99, %84
  %87 = load i64, ptr %3, align 8, !tbaa !9
  %88 = load i64, ptr @n_sink, align 8, !tbaa !9
  %89 = icmp slt i64 %87, %88
  br i1 %89, label %90, label %104

90:                                               ; preds = %86
  %91 = load ptr, ptr @outfile, align 8, !tbaa !5
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.imbalance, ptr %92, i32 0, i32 0
  %94 = load i64, ptr %93, align 8, !tbaa !15
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.imbalance, ptr %95, i32 0, i32 1
  %97 = load i64, ptr %96, align 8, !tbaa !17
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.22, i64 noundef %94, i64 noundef %97) #4
  br label %99

99:                                               ; preds = %90
  %100 = load i64, ptr %3, align 8, !tbaa !9
  %101 = add nsw i64 %100, 1
  store i64 %101, ptr %3, align 8, !tbaa !9
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.imbalance, ptr %102, i32 1
  store ptr %103, ptr %2, align 8, !tbaa !5
  br label %86, !llvm.loop !20

104:                                              ; preds = %86
  store i64 0, ptr %3, align 8, !tbaa !9
  %105 = load ptr, ptr @arc_list, align 8, !tbaa !5
  store ptr %105, ptr %1, align 8, !tbaa !5
  br label %106

106:                                              ; preds = %125, %104
  %107 = load i64, ptr %3, align 8, !tbaa !9
  %108 = load i64, ptr @n_arc, align 8, !tbaa !9
  %109 = icmp slt i64 %107, %108
  br i1 %109, label %110, label %130

110:                                              ; preds = %106
  %111 = load ptr, ptr @outfile, align 8, !tbaa !5
  %112 = load ptr, ptr %1, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.arcs, ptr %112, i32 0, i32 0
  %114 = load i64, ptr %113, align 8, !tbaa !21
  %115 = load ptr, ptr %1, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.arcs, ptr %115, i32 0, i32 1
  %117 = load i64, ptr %116, align 8, !tbaa !23
  %118 = load ptr, ptr %1, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.arcs, ptr %118, i32 0, i32 3
  %120 = load i64, ptr %119, align 8, !tbaa !24
  %121 = load ptr, ptr %1, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.arcs, ptr %121, i32 0, i32 2
  %123 = load i64, ptr %122, align 8, !tbaa !25
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %111, ptr noundef @.str.23, i64 noundef %114, i64 noundef %117, i64 noundef %120, i64 noundef %123) #4
  br label %125

125:                                              ; preds = %110
  %126 = load i64, ptr %3, align 8, !tbaa !9
  %127 = add nsw i64 %126, 1
  store i64 %127, ptr %3, align 8, !tbaa !9
  %128 = load ptr, ptr %1, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.arcs, ptr %128, i32 1
  store ptr %129, ptr %1, align 8, !tbaa !5
  br label %106, !llvm.loop !26

130:                                              ; preds = %106
  %131 = load ptr, ptr @outfile, align 8, !tbaa !5
  %132 = load ptr, ptr @stdout, align 8, !tbaa !5
  %133 = icmp ne ptr %131, %132
  br i1 %133, label %134, label %137

134:                                              ; preds = %130
  %135 = load ptr, ptr @outfile, align 8, !tbaa !5
  %136 = call i32 @fclose(ptr noundef %135)
  br label %137

137:                                              ; preds = %134, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #4
  ret void
}

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

declare i32 @fclose(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

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


; 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.stat_para = type { i64, [5 x float] }

@source_list = external dso_local local_unnamed_addr global ptr, align 8
@sink_list = external dso_local local_unnamed_addr global ptr, align 8
@arc_list = external dso_local local_unnamed_addr global ptr, align 8
@arc_costs = external dso_local local_unnamed_addr global %struct.stat_para, align 8
@n_source = external dso_local local_unnamed_addr global i64, align 8
@n_sink = external dso_local local_unnamed_addr global i64, align 8
@capacities = external dso_local local_unnamed_addr global %struct.stat_para, align 8
@supply = external dso_local local_unnamed_addr global i64, align 8
@n_arc = external dso_local local_unnamed_addr global i64, align 8
@n_node = external dso_local local_unnamed_addr global i64, align 8
@n1 = external dso_local local_unnamed_addr global i64, align 8
@avg_degree = external dso_local local_unnamed_addr global i64, align 8
@n2 = external dso_local local_unnamed_addr global i64, align 8
@outfile = external dso_local local_unnamed_addr global ptr, align 8
@seed_original = external dso_local local_unnamed_addr global i64, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local void @output() local_unnamed_addr #0 {
  %1 = load ptr, ptr @outfile, align 8, !tbaa !5
  %2 = icmp eq ptr %1, null
  br i1 %2, label %3, label %5

3:                                                ; preds = %0
  %4 = load ptr, ptr @stdout, align 8, !tbaa !5
  store ptr %4, ptr @outfile, align 8, !tbaa !5
  br label %5

5:                                                ; preds = %3, %0
  %6 = phi ptr [ %4, %3 ], [ %1, %0 ]
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %6, ptr noundef nonnull @.str.10) #2
  %8 = load ptr, ptr @outfile, align 8, !tbaa !5
  %9 = load i64, ptr @seed_original, align 8, !tbaa !9
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.11, i64 noundef %9) #2
  %11 = load ptr, ptr @outfile, align 8, !tbaa !5
  %12 = load i64, ptr @n_node, align 8, !tbaa !9
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.12, i64 noundef %12) #2
  %14 = load ptr, ptr @outfile, align 8, !tbaa !5
  %15 = load i64, ptr @n1, align 8, !tbaa !9
  %16 = load i64, ptr @n2, align 8, !tbaa !9
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.13, i64 noundef %15, i64 noundef %16) #2
  %18 = load ptr, ptr @outfile, align 8, !tbaa !5
  %19 = load i64, ptr @n_source, align 8, !tbaa !9
  %20 = load i64, ptr @n_sink, align 8, !tbaa !9
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.14, i64 noundef %19, i64 noundef %20) #2
  %22 = load ptr, ptr @outfile, align 8, !tbaa !5
  %23 = load i64, ptr @avg_degree, align 8, !tbaa !9
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str.15, i64 noundef %23) #2
  %25 = load ptr, ptr @outfile, align 8, !tbaa !5
  %26 = load i64, ptr @supply, align 8, !tbaa !9
  %27 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.16, i64 noundef %26) #2
  %28 = load i64, ptr @arc_costs, align 8, !tbaa !11
  switch i64 %28, label %41 [
    i64 1, label %29
    i64 2, label %36
  ]

29:                                               ; preds = %5
  %30 = load ptr, ptr @outfile, align 8, !tbaa !5
  %31 = load float, ptr getelementptr inbounds (i8, ptr @arc_costs, i64 8), align 8, !tbaa !13
  %32 = fptosi float %31 to i64
  %33 = load float, ptr getelementptr inbounds (i8, ptr @arc_costs, i64 12), align 4, !tbaa !13
  %34 = fptosi float %33 to i64
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.17, i64 noundef %32, i64 noundef %34) #2
  br label %41

36:                                               ; preds = %5
  %37 = load ptr, ptr @outfile, align 8, !tbaa !5
  %38 = load float, ptr getelementptr inbounds (i8, ptr @arc_costs, i64 8), align 8, !tbaa !13
  %39 = fptosi float %38 to i64
  %40 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.18, i64 noundef %39) #2
  br label %41

41:                                               ; preds = %5, %36, %29
  %42 = load i64, ptr @capacities, align 8, !tbaa !11
  switch i64 %42, label %55 [
    i64 1, label %43
    i64 2, label %50
  ]

43:                                               ; preds = %41
  %44 = load ptr, ptr @outfile, align 8, !tbaa !5
  %45 = load float, ptr getelementptr inbounds (i8, ptr @capacities, i64 8), align 8, !tbaa !13
  %46 = fptosi float %45 to i64
  %47 = load float, ptr getelementptr inbounds (i8, ptr @capacities, i64 12), align 4, !tbaa !13
  %48 = fptosi float %47 to i64
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str.19, i64 noundef %46, i64 noundef %48) #2
  br label %55

50:                                               ; preds = %41
  %51 = load ptr, ptr @outfile, align 8, !tbaa !5
  %52 = load float, ptr getelementptr inbounds (i8, ptr @capacities, i64 8), align 8, !tbaa !13
  %53 = fptosi float %52 to i64
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.20, i64 noundef %53) #2
  br label %55

55:                                               ; preds = %41, %50, %43
  %56 = load ptr, ptr @outfile, align 8, !tbaa !5
  %57 = load i64, ptr @n_node, align 8, !tbaa !9
  %58 = load i64, ptr @n_arc, align 8, !tbaa !9
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef nonnull @.str.21, i64 noundef %57, i64 noundef %58) #2
  %60 = load i64, ptr @n_source, align 8, !tbaa !9
  %61 = icmp sgt i64 %60, 0
  br i1 %61, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %55
  %62 = load ptr, ptr @source_list, align 8, !tbaa !5
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.021 = phi i64 [ %68, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %.01620 = phi ptr [ %69, %.lr.ph ], [ %62, %.lr.ph.preheader ]
  %63 = load ptr, ptr @outfile, align 8, !tbaa !5
  %64 = load i64, ptr %.01620, align 8, !tbaa !15
  %65 = getelementptr inbounds i8, ptr %.01620, i64 8
  %66 = load i64, ptr %65, align 8, !tbaa !17
  %67 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef nonnull @.str.22, i64 noundef %64, i64 noundef %66) #2
  %68 = add nuw nsw i64 %.021, 1
  %69 = getelementptr inbounds i8, ptr %.01620, i64 16
  %70 = load i64, ptr @n_source, align 8, !tbaa !9
  %71 = icmp slt i64 %68, %70
  br i1 %71, label %.lr.ph, label %._crit_edge, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph, %55
  %72 = load i64, ptr @n_sink, align 8, !tbaa !9
  %73 = icmp sgt i64 %72, 0
  br i1 %73, label %.lr.ph25.preheader, label %._crit_edge26

.lr.ph25.preheader:                               ; preds = %._crit_edge
  %74 = load ptr, ptr @sink_list, align 8, !tbaa !5
  br label %.lr.ph25

.lr.ph25:                                         ; preds = %.lr.ph25.preheader, %.lr.ph25
  %.123 = phi i64 [ %80, %.lr.ph25 ], [ 0, %.lr.ph25.preheader ]
  %.11722 = phi ptr [ %81, %.lr.ph25 ], [ %74, %.lr.ph25.preheader ]
  %75 = load ptr, ptr @outfile, align 8, !tbaa !5
  %76 = load i64, ptr %.11722, align 8, !tbaa !15
  %77 = getelementptr inbounds i8, ptr %.11722, i64 8
  %78 = load i64, ptr %77, align 8, !tbaa !17
  %79 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef nonnull @.str.22, i64 noundef %76, i64 noundef %78) #2
  %80 = add nuw nsw i64 %.123, 1
  %81 = getelementptr inbounds i8, ptr %.11722, i64 16
  %82 = load i64, ptr @n_sink, align 8, !tbaa !9
  %83 = icmp slt i64 %80, %82
  br i1 %83, label %.lr.ph25, label %._crit_edge26, !llvm.loop !20

._crit_edge26:                                    ; preds = %.lr.ph25, %._crit_edge
  %84 = load i64, ptr @n_arc, align 8, !tbaa !9
  %85 = icmp sgt i64 %84, 0
  br i1 %85, label %.lr.ph30.preheader, label %._crit_edge31

.lr.ph30.preheader:                               ; preds = %._crit_edge26
  %86 = load ptr, ptr @arc_list, align 8, !tbaa !5
  br label %.lr.ph30

.lr.ph30:                                         ; preds = %.lr.ph30.preheader, %.lr.ph30
  %.228 = phi i64 [ %96, %.lr.ph30 ], [ 0, %.lr.ph30.preheader ]
  %.01827 = phi ptr [ %97, %.lr.ph30 ], [ %86, %.lr.ph30.preheader ]
  %87 = load ptr, ptr @outfile, align 8, !tbaa !5
  %88 = load i64, ptr %.01827, align 8, !tbaa !21
  %89 = getelementptr inbounds i8, ptr %.01827, i64 8
  %90 = load i64, ptr %89, align 8, !tbaa !23
  %91 = getelementptr inbounds i8, ptr %.01827, i64 24
  %92 = load i64, ptr %91, align 8, !tbaa !24
  %93 = getelementptr inbounds i8, ptr %.01827, i64 16
  %94 = load i64, ptr %93, align 8, !tbaa !25
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef nonnull @.str.23, i64 noundef %88, i64 noundef %90, i64 noundef %92, i64 noundef %94) #2
  %96 = add nuw nsw i64 %.228, 1
  %97 = getelementptr inbounds i8, ptr %.01827, i64 32
  %98 = load i64, ptr @n_arc, align 8, !tbaa !9
  %99 = icmp slt i64 %96, %98
  br i1 %99, label %.lr.ph30, label %._crit_edge31, !llvm.loop !26

._crit_edge31:                                    ; preds = %.lr.ph30, %._crit_edge26
  %100 = load ptr, ptr @outfile, align 8, !tbaa !5
  %101 = load ptr, ptr @stdout, align 8, !tbaa !5
  %.not = icmp eq ptr %100, %101
  br i1 %.not, label %104, label %102

102:                                              ; preds = %._crit_edge31
  %103 = tail call i32 @fclose(ptr noundef %100)
  br label %104

104:                                              ; preds = %102, %._crit_edge31
  ret void
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"stat_para", !10, i64 0, !7, i64 8}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"imbalance", !10, i64 0, !10, i64 8}
!17 = !{!16, !10, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = !{!22, !10, i64 0}
!22 = !{!"arcs", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!23 = !{!22, !10, i64 8}
!24 = !{!22, !10, i64 24}
!25 = !{!22, !10, i64 16}
!26 = distinct !{!26, !19}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass