; LLVM IR from SourajitaDewasi/ComputerNetworks :: MAC (SlottedALOHA)

; 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.Process = type { i32, i32, i32 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@i = external dso_local global i32, align 4
@j = external dso_local global i32, align 4
@check = external dso_local global i32, align 4
@P = external dso_local global [5 x %struct.Process], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z13SlottedAlohaCii(i32 noundef, i32 noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %2 = call i64 @time(ptr noundef null) #5
  %3 = trunc i64 %2 to i32
  call void @srand(i32 noundef %3) #5
  store i32 0, ptr @P, align 16, !tbaa !5
  store i32 1, ptr getelementptr inbounds ([5 x %struct.Process], ptr @P, i64 0, i64 1), align 4, !tbaa !5
  store i32 2, ptr getelementptr inbounds ([5 x %struct.Process], ptr @P, i64 0, i64 2), align 8, !tbaa !5
  store i32 4, ptr getelementptr inbounds ([5 x %struct.Process], ptr @P, i64 0, i64 3), align 4, !tbaa !5
  store i32 0, ptr @i, align 4, !tbaa !10
  br label %4

4:                                                ; preds = %41, %0
  %5 = load i32, ptr @i, align 4, !tbaa !10
  %6 = icmp slt i32 %5, 5
  br i1 %6, label %7, label %44

7:                                                ; preds = %4
  %8 = load i32, ptr @i, align 4, !tbaa !10
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %9
  %11 = getelementptr inbounds %struct.Process, ptr %10, i32 0, i32 1
  store i32 0, ptr %11, align 4, !tbaa !11
  %12 = load i32, ptr @i, align 4, !tbaa !10
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %13
  %15 = getelementptr inbounds %struct.Process, ptr %14, i32 0, i32 2
  store i32 0, ptr %15, align 4, !tbaa !12
  %16 = load i32, ptr @i, align 4, !tbaa !10
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %17
  %19 = getelementptr inbounds %struct.Process, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = srem i32 %20, 3
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %40

23:                                               ; preds = %7
  %24 = load i32, ptr @i, align 4, !tbaa !10
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %25
  %27 = getelementptr inbounds %struct.Process, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = load i32, ptr @i, align 4, !tbaa !10
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %30
  %32 = getelementptr inbounds %struct.Process, ptr %31, i32 0, i32 0
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = srem i32 %33, 3
  %35 = add nsw i32 %28, %34
  %36 = load i32, ptr @i, align 4, !tbaa !10
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %37
  %39 = getelementptr inbounds %struct.Process, ptr %38, i32 0, i32 0
  store i32 %35, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %23, %7
  br label %41

41:                                               ; preds = %40
  %42 = load i32, ptr @i, align 4, !tbaa !10
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr @i, align 4, !tbaa !10
  br label %4, !llvm.loop !13

44:                                               ; preds = %4
  store i32 0, ptr @i, align 4, !tbaa !10
  br label %45

45:                                               ; preds = %123, %44
  %46 = load i32, ptr @i, align 4, !tbaa !10
  %47 = icmp slt i32 %46, 5
  br i1 %47, label %48, label %126

48:                                               ; preds = %45
  %49 = load i32, ptr @i, align 4, !tbaa !10
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr @j, align 4, !tbaa !10
  br label %51

51:                                               ; preds = %119, %48
  %52 = load i32, ptr @j, align 4, !tbaa !10
  %53 = icmp slt i32 %52, 5
  br i1 %53, label %54, label %122

54:                                               ; preds = %51
  %55 = load i32, ptr @i, align 4, !tbaa !10
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %56
  %58 = getelementptr inbounds %struct.Process, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 4, !tbaa !5
  %60 = load i32, ptr @j, align 4, !tbaa !10
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %61
  %63 = getelementptr inbounds %struct.Process, ptr %62, i32 0, i32 0
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = icmp eq i32 %59, %64
  br i1 %65, label %66, label %109

66:                                               ; preds = %54
  %67 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.3)
  %68 = load i32, ptr @i, align 4, !tbaa !10
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %69
  %71 = getelementptr inbounds %struct.Process, ptr %70, i32 0, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !11
  %73 = load i32, ptr @j, align 4, !tbaa !10
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.Process, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !11
  %78 = call noundef i32 @_Z13SlottedAlohaCii(i32 noundef %72, i32 noundef %77)
  %79 = load i32, ptr @check, align 4, !tbaa !10
  %80 = icmp eq i32 %79, 0
  br i1 %80, label %81, label %93

81:                                               ; preds = %66
  %82 = load i32, ptr @j, align 4, !tbaa !10
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.Process, ptr %84, i32 0, i32 0
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %85, align 4, !tbaa !5
  %88 = load i32, ptr @j, align 4, !tbaa !10
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %89
  %91 = getelementptr inbounds %struct.Process, ptr %90, i32 0, i32 2
  store i32 1, ptr %91, align 4, !tbaa !12
  %92 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.4)
  br label %93

93:                                               ; preds = %81, %66
  %94 = load i32, ptr @check, align 4, !tbaa !10
  %95 = icmp eq i32 %94, 1
  br i1 %95, label %96, label %108

96:                                               ; preds = %93
  %97 = load i32, ptr @i, align 4, !tbaa !10
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %98
  %100 = getelementptr inbounds %struct.Process, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 4, !tbaa !5
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %100, align 4, !tbaa !5
  %103 = load i32, ptr @i, align 4, !tbaa !10
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %104
  %106 = getelementptr inbounds %struct.Process, ptr %105, i32 0, i32 2
  store i32 1, ptr %106, align 4, !tbaa !12
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.5)
  br label %108

108:                                              ; preds = %96, %93
  br label %118

109:                                              ; preds = %54
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.6)
  %111 = load i32, ptr @i, align 4, !tbaa !10
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %110, i32 noundef %111)
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %112, ptr noundef @.str.7)
  %114 = load i32, ptr @i, align 4, !tbaa !10
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.Process, ptr %116, i32 0, i32 2
  store i32 1, ptr %117, align 4, !tbaa !12
  br label %118

118:                                              ; preds = %109, %108
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr @j, align 4, !tbaa !10
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr @j, align 4, !tbaa !10
  br label %51, !llvm.loop !15

122:                                              ; preds = %51
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr @i, align 4, !tbaa !10
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr @i, align 4, !tbaa !10
  br label %45, !llvm.loop !16

126:                                              ; preds = %45
  store i32 0, ptr @i, align 4, !tbaa !10
  br label %127

127:                                              ; preds = %143, %126
  %128 = load i32, ptr @i, align 4, !tbaa !10
  %129 = icmp slt i32 %128, 5
  br i1 %129, label %130, label %146

130:                                              ; preds = %127
  %131 = load i32, ptr @i, align 4, !tbaa !10
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %132
  %134 = getelementptr inbounds %struct.Process, ptr %133, i32 0, i32 2
  %135 = load i32, ptr %134, align 4, !tbaa !12
  %136 = icmp eq i32 %135, 1
  br i1 %136, label %137, label %142

137:                                              ; preds = %130
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.8)
  %139 = load i32, ptr @i, align 4, !tbaa !10
  %140 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %138, i32 noundef %139)
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %140, ptr noundef @.str.9)
  br label %142

142:                                              ; preds = %137, %130
  br label %143

143:                                              ; preds = %142
  %144 = load i32, ptr @i, align 4, !tbaa !10
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr @i, align 4, !tbaa !10
  br label %127, !llvm.loop !17

146:                                              ; preds = %127
  ret i32 0
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

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

!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 = !{!"_ZTS7Process", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!7, !7, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


; 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.Process = type { i32, i32, i32 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }

@i = external dso_local local_unnamed_addr global i32, align 4
@j = external dso_local local_unnamed_addr global i32, align 4
@check = external dso_local local_unnamed_addr global i32, align 4
@P = external dso_local local_unnamed_addr global [5 x %struct.Process], align 16
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [84 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z13SlottedAlohaCii(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
.preheader9:
  %0 = tail call i64 @time(ptr noundef null) #5
  %1 = trunc i64 %0 to i32
  tail call void @srand(i32 noundef %1) #5
  store <4 x i32> <i32 0, i32 0, i32 0, i32 1>, ptr @P, align 16, !tbaa !5
  store <4 x i32> <i32 0, i32 0, i32 2, i32 0>, ptr getelementptr inbounds (i8, ptr @P, i64 16), align 16, !tbaa !5
  store <4 x i32> <i32 0, i32 4, i32 0, i32 0>, ptr getelementptr inbounds (i8, ptr @P, i64 32), align 16, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @P, i64 52), align 4, !tbaa !9
  store i32 0, ptr getelementptr inbounds (i8, ptr @P, i64 56), align 8, !tbaa !11
  store i32 0, ptr @i, align 4, !tbaa !5
  br label %.preheader8

.preheader8:                                      ; preds = %.preheader9, %._crit_edge
  %storemerge513 = phi i32 [ 0, %.preheader9 ], [ %.pre17, %._crit_edge ]
  %storemerge711 = add nsw i32 %storemerge513, 1
  store i32 %storemerge711, ptr @j, align 4, !tbaa !5
  %2 = icmp slt i32 %storemerge513, 4
  br i1 %2, label %.lr.ph, label %.preheader

.preheader:                                       ; preds = %._crit_edge, %.preheader8
  store i32 0, ptr @i, align 4, !tbaa !5
  br label %55

.lr.ph:                                           ; preds = %.preheader8, %51
  %storemerge712 = phi i32 [ %storemerge7, %51 ], [ %storemerge711, %.preheader8 ]
  %3 = load i32, ptr @i, align 4, !tbaa !5
  %4 = sext i32 %3 to i64
  %5 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %4
  %6 = load i32, ptr %5, align 4, !tbaa !12
  %7 = sext i32 %storemerge712 to i64
  %8 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %7
  %9 = load i32, ptr %8, align 4, !tbaa !12
  %10 = icmp eq i32 %6, %9
  br i1 %10, label %11, label %43

11:                                               ; preds = %.lr.ph
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.3)
  %13 = load i32, ptr @i, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %14, i32 1
  %16 = load i32, ptr %15, align 4, !tbaa !9
  %17 = load i32, ptr @j, align 4, !tbaa !5
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %18, i32 1
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = tail call noundef i32 @_Z13SlottedAlohaCii(i32 noundef %16, i32 noundef %20)
  %22 = load i32, ptr @check, align 4, !tbaa !5
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %32

24:                                               ; preds = %11
  %25 = load i32, ptr @j, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %26
  %28 = load i32, ptr %27, align 4, !tbaa !12
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %27, align 4, !tbaa !12
  %30 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %26, i32 2
  store i32 1, ptr %30, align 4, !tbaa !11
  %31 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.4)
  %.pr = load i32, ptr @check, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %24, %11
  %33 = phi i32 [ %.pr, %24 ], [ %22, %11 ]
  %34 = icmp eq i32 %33, 1
  br i1 %34, label %35, label %51

35:                                               ; preds = %32
  %36 = load i32, ptr @i, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %37
  %39 = load i32, ptr %38, align 4, !tbaa !12
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %38, align 4, !tbaa !12
  %41 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %37, i32 2
  store i32 1, ptr %41, align 4, !tbaa !11
  %42 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.5)
  br label %51

43:                                               ; preds = %.lr.ph
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.6)
  %45 = load i32, ptr @i, align 4, !tbaa !5
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %44, i32 noundef %45)
  %47 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @.str.7)
  %48 = load i32, ptr @i, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %49, i32 2
  store i32 1, ptr %50, align 4, !tbaa !11
  br label %51

51:                                               ; preds = %43, %35, %32
  %52 = load i32, ptr @j, align 4, !tbaa !5
  %storemerge7 = add nsw i32 %52, 1
  store i32 %storemerge7, ptr @j, align 4, !tbaa !5
  %53 = icmp slt i32 %52, 4
  br i1 %53, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %51
  %.pre = load i32, ptr @i, align 4, !tbaa !5
  %.pre17 = add nsw i32 %.pre, 1
  store i32 %.pre17, ptr @i, align 4, !tbaa !5
  %54 = icmp slt i32 %.pre, 4
  br i1 %54, label %.preheader8, label %.preheader, !llvm.loop !15

55:                                               ; preds = %.preheader, %65
  %storemerge614 = phi i32 [ 0, %.preheader ], [ %67, %65 ]
  %56 = sext i32 %storemerge614 to i64
  %57 = getelementptr inbounds [5 x %struct.Process], ptr @P, i64 0, i64 %56, i32 2
  %58 = load i32, ptr %57, align 4, !tbaa !11
  %59 = icmp eq i32 %58, 1
  br i1 %59, label %60, label %65

60:                                               ; preds = %55
  %61 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.8)
  %62 = load i32, ptr @i, align 4, !tbaa !5
  %63 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %61, i32 noundef %62)
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @.str.9)
  %.pre16 = load i32, ptr @i, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %55, %60
  %66 = phi i32 [ %storemerge614, %55 ], [ %.pre16, %60 ]
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr @i, align 4, !tbaa !5
  %68 = icmp slt i32 %66, 4
  br i1 %68, label %55, label %69, !llvm.loop !16

69:                                               ; preds = %65
  ret i32 0
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTS7Process", !6, i64 0, !6, i64 4, !6, i64 8}
!11 = !{!10, !6, i64 8}
!12 = !{!10, !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass