; LLVM IR from ravireddy07/cpp-book :: src/AtCoder (super-ryuma)

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

%"class.std::basic_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(8) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 3, ptr %6, align 4, !tbaa !5
  %19 = load i64, ptr %2, align 8, !tbaa !9
  %20 = load i64, ptr %4, align 8, !tbaa !9
  %21 = icmp eq i64 %19, %20
  br i1 %21, label %22, label %29

22:                                               ; preds = %0
  %23 = load i64, ptr %3, align 8, !tbaa !9
  %24 = load i64, ptr %5, align 8, !tbaa !9
  %25 = icmp eq i64 %23, %24
  br i1 %25, label %26, label %29

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  %27 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %28 = load i32, ptr %27, align 4, !tbaa !5
  store i32 %28, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %29

29:                                               ; preds = %26, %22, %0
  %30 = load i64, ptr %2, align 8, !tbaa !9
  %31 = load i64, ptr %3, align 8, !tbaa !9
  %32 = add nsw i64 %30, %31
  %33 = load i64, ptr %4, align 8, !tbaa !9
  %34 = load i64, ptr %5, align 8, !tbaa !9
  %35 = add nsw i64 %33, %34
  %36 = icmp eq i64 %32, %35
  br i1 %36, label %37, label %40

37:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  %38 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %39 = load i32, ptr %38, align 4, !tbaa !5
  store i32 %39, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %40

40:                                               ; preds = %37, %29
  %41 = load i64, ptr %2, align 8, !tbaa !9
  %42 = load i64, ptr %3, align 8, !tbaa !9
  %43 = sub nsw i64 %41, %42
  %44 = load i64, ptr %4, align 8, !tbaa !9
  %45 = load i64, ptr %5, align 8, !tbaa !9
  %46 = sub nsw i64 %44, %45
  %47 = icmp eq i64 %43, %46
  br i1 %47, label %48, label %51

48:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %50 = load i32, ptr %49, align 4, !tbaa !5
  store i32 %50, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %51

51:                                               ; preds = %48, %40
  %52 = load i64, ptr %2, align 8, !tbaa !9
  %53 = load i64, ptr %4, align 8, !tbaa !9
  %54 = sub nsw i64 %52, %53
  %55 = call noundef i64 @_ZSt3absx(i64 noundef %54)
  %56 = load i64, ptr %3, align 8, !tbaa !9
  %57 = load i64, ptr %5, align 8, !tbaa !9
  %58 = sub nsw i64 %56, %57
  %59 = call noundef i64 @_ZSt3absx(i64 noundef %58)
  %60 = add nsw i64 %55, %59
  %61 = icmp sle i64 %60, 3
  br i1 %61, label %62, label %65

62:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %64 = load i32, ptr %63, align 4, !tbaa !5
  store i32 %64, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %65

65:                                               ; preds = %62, %51
  %66 = load i64, ptr %2, align 8, !tbaa !9
  %67 = srem i64 %66, 2
  %68 = load i64, ptr %4, align 8, !tbaa !9
  %69 = srem i64 %68, 2
  %70 = icmp eq i64 %67, %69
  br i1 %70, label %71, label %80

71:                                               ; preds = %65
  %72 = load i64, ptr %3, align 8, !tbaa !9
  %73 = srem i64 %72, 2
  %74 = load i64, ptr %5, align 8, !tbaa !9
  %75 = srem i64 %74, 2
  %76 = icmp eq i64 %73, %75
  br i1 %76, label %77, label %80

77:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 2, ptr %11, align 4, !tbaa !5
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %79 = load i32, ptr %78, align 4, !tbaa !5
  store i32 %79, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %80

80:                                               ; preds = %77, %71, %65
  %81 = load i64, ptr %2, align 8, !tbaa !9
  %82 = srem i64 %81, 2
  %83 = load i64, ptr %4, align 8, !tbaa !9
  %84 = srem i64 %83, 2
  %85 = icmp ne i64 %82, %84
  br i1 %85, label %86, label %95

86:                                               ; preds = %80
  %87 = load i64, ptr %3, align 8, !tbaa !9
  %88 = srem i64 %87, 2
  %89 = load i64, ptr %5, align 8, !tbaa !9
  %90 = srem i64 %89, 2
  %91 = icmp ne i64 %88, %90
  br i1 %91, label %92, label %95

92:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 2, ptr %12, align 4, !tbaa !5
  %93 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %94 = load i32, ptr %93, align 4, !tbaa !5
  store i32 %94, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %95

95:                                               ; preds = %92, %86, %80
  %96 = load i64, ptr %2, align 8, !tbaa !9
  %97 = load i64, ptr %3, align 8, !tbaa !9
  %98 = add nsw i64 %96, %97
  %99 = load i64, ptr %4, align 8, !tbaa !9
  %100 = load i64, ptr %5, align 8, !tbaa !9
  %101 = add nsw i64 %99, %100
  %102 = sub nsw i64 %98, %101
  %103 = call noundef i64 @_ZSt3absx(i64 noundef %102)
  %104 = icmp sle i64 %103, 4
  br i1 %104, label %105, label %108

105:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 2, ptr %13, align 4, !tbaa !5
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %107 = load i32, ptr %106, align 4, !tbaa !5
  store i32 %107, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %108

108:                                              ; preds = %105, %95
  %109 = load i64, ptr %2, align 8, !tbaa !9
  %110 = load i64, ptr %3, align 8, !tbaa !9
  %111 = sub nsw i64 %109, %110
  %112 = load i64, ptr %4, align 8, !tbaa !9
  %113 = load i64, ptr %5, align 8, !tbaa !9
  %114 = sub nsw i64 %112, %113
  %115 = sub nsw i64 %111, %114
  %116 = call noundef i64 @_ZSt3absx(i64 noundef %115)
  %117 = icmp sle i64 %116, 4
  br i1 %117, label %118, label %121

118:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 2, ptr %14, align 4, !tbaa !5
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %120 = load i32, ptr %119, align 4, !tbaa !5
  store i32 %120, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %121

121:                                              ; preds = %118, %108
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %122)
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %123, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %125 = load i32, ptr %1, align 4
  ret i32 %125
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { inlinehint mustprogress 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 = { "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 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}


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

%"class.std::basic_istream" = type { ptr, i64, %"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 }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %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
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %17 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 3, ptr %5, align 4, !tbaa !5
  %18 = load i64, ptr %1, align 8, !tbaa !9
  %19 = load i64, ptr %3, align 8, !tbaa !9
  %20 = icmp eq i64 %18, %19
  %.pre8 = load i64, ptr %2, align 8, !tbaa !9
  %.pre11 = load i64, ptr %4, align 8, !tbaa !9
  br i1 %20, label %21, label %26

21:                                               ; preds = %0
  %22 = icmp eq i64 %.pre8, %.pre11
  br i1 %22, label %23, label %26

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %25 = load i32, ptr %24, align 4, !tbaa !5
  store i32 %25, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %.pre = load i64, ptr %1, align 8, !tbaa !9
  %.pre7 = load i64, ptr %2, align 8, !tbaa !9
  %.pre9 = load i64, ptr %3, align 8, !tbaa !9
  %.pre10 = load i64, ptr %4, align 8, !tbaa !9
  br label %26

26:                                               ; preds = %23, %21, %0
  %27 = phi i64 [ %.pre10, %23 ], [ %.pre11, %21 ], [ %.pre11, %0 ]
  %28 = phi i64 [ %.pre9, %23 ], [ %18, %21 ], [ %19, %0 ]
  %29 = phi i64 [ %.pre7, %23 ], [ %.pre8, %21 ], [ %.pre8, %0 ]
  %30 = phi i64 [ %.pre, %23 ], [ %18, %21 ], [ %18, %0 ]
  %31 = add nsw i64 %29, %30
  %32 = add nsw i64 %27, %28
  %33 = icmp eq i64 %31, %32
  br i1 %33, label %34, label %37

34:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %36 = load i32, ptr %35, align 4, !tbaa !5
  store i32 %36, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  %.pre12 = load i64, ptr %1, align 8, !tbaa !9
  %.pre13 = load i64, ptr %2, align 8, !tbaa !9
  %.pre14 = load i64, ptr %3, align 8, !tbaa !9
  %.pre15 = load i64, ptr %4, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %34, %26
  %38 = phi i64 [ %.pre15, %34 ], [ %27, %26 ]
  %39 = phi i64 [ %.pre14, %34 ], [ %28, %26 ]
  %40 = phi i64 [ %.pre13, %34 ], [ %29, %26 ]
  %41 = phi i64 [ %.pre12, %34 ], [ %30, %26 ]
  %42 = sub nsw i64 %41, %40
  %43 = sub nsw i64 %39, %38
  %44 = icmp eq i64 %42, %43
  br i1 %44, label %45, label %48

45:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  store i32 1, ptr %8, align 4, !tbaa !5
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %47 = load i32, ptr %46, align 4, !tbaa !5
  store i32 %47, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %.pre16 = load i64, ptr %1, align 8, !tbaa !9
  %.pre17 = load i64, ptr %3, align 8, !tbaa !9
  br label %48

48:                                               ; preds = %45, %37
  %49 = phi i64 [ %.pre17, %45 ], [ %39, %37 ]
  %50 = phi i64 [ %.pre16, %45 ], [ %41, %37 ]
  %51 = sub nsw i64 %50, %49
  %52 = call noundef i64 @_ZSt3absx(i64 noundef %51)
  %53 = load i64, ptr %2, align 8, !tbaa !9
  %54 = load i64, ptr %4, align 8, !tbaa !9
  %55 = sub nsw i64 %53, %54
  %56 = call noundef i64 @_ZSt3absx(i64 noundef %55)
  %57 = add nsw i64 %56, %52
  %58 = icmp slt i64 %57, 4
  br i1 %58, label %59, label %62

59:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %61 = load i32, ptr %60, align 4, !tbaa !5
  store i32 %61, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  br label %62

62:                                               ; preds = %59, %48
  %63 = load i64, ptr %1, align 8, !tbaa !9
  %64 = srem i64 %63, 2
  %65 = load i64, ptr %3, align 8, !tbaa !9
  %66 = srem i64 %65, 2
  %67 = icmp eq i64 %64, %66
  %.pre22.pre27 = load i64, ptr %2, align 8, !tbaa !9
  %.pre25.pre29 = load i64, ptr %4, align 8, !tbaa !9
  br i1 %67, label %68, label %75

68:                                               ; preds = %62
  %69 = srem i64 %.pre22.pre27, 2
  %70 = srem i64 %.pre25.pre29, 2
  %71 = icmp eq i64 %69, %70
  br i1 %71, label %72, label %75

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  store i32 2, ptr %10, align 4, !tbaa !5
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %74 = load i32, ptr %73, align 4, !tbaa !5
  store i32 %74, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  %.pre18 = load i64, ptr %1, align 8, !tbaa !9
  %.pre19 = load i64, ptr %3, align 8, !tbaa !9
  %.pre22.pre = load i64, ptr %2, align 8, !tbaa !9
  %.pre25.pre = load i64, ptr %4, align 8, !tbaa !9
  %.pre31 = srem i64 %.pre18, 2
  %.pre32 = srem i64 %.pre19, 2
  br label %75

75:                                               ; preds = %72, %68, %62
  %.pre-phi33 = phi i64 [ %.pre32, %72 ], [ %66, %68 ], [ %66, %62 ]
  %.pre-phi = phi i64 [ %.pre31, %72 ], [ %64, %68 ], [ %64, %62 ]
  %.pre25 = phi i64 [ %.pre25.pre, %72 ], [ %.pre25.pre29, %68 ], [ %.pre25.pre29, %62 ]
  %.pre22 = phi i64 [ %.pre22.pre, %72 ], [ %.pre22.pre27, %68 ], [ %.pre22.pre27, %62 ]
  %76 = phi i64 [ %.pre19, %72 ], [ %65, %68 ], [ %65, %62 ]
  %77 = phi i64 [ %.pre18, %72 ], [ %63, %68 ], [ %63, %62 ]
  %.not = icmp eq i64 %.pre-phi, %.pre-phi33
  br i1 %.not, label %84, label %78

78:                                               ; preds = %75
  %79 = srem i64 %.pre22, 2
  %80 = srem i64 %.pre25, 2
  %.not1 = icmp eq i64 %79, %80
  br i1 %.not1, label %84, label %81

81:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  store i32 2, ptr %11, align 4, !tbaa !5
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %83 = load i32, ptr %82, align 4, !tbaa !5
  store i32 %83, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  %.pre20 = load i64, ptr %1, align 8, !tbaa !9
  %.pre21 = load i64, ptr %2, align 8, !tbaa !9
  %.pre23 = load i64, ptr %3, align 8, !tbaa !9
  %.pre24 = load i64, ptr %4, align 8, !tbaa !9
  br label %84

84:                                               ; preds = %81, %78, %75
  %85 = phi i64 [ %.pre24, %81 ], [ %.pre25, %78 ], [ %.pre25, %75 ]
  %86 = phi i64 [ %.pre23, %81 ], [ %76, %78 ], [ %76, %75 ]
  %87 = phi i64 [ %.pre21, %81 ], [ %.pre22, %78 ], [ %.pre22, %75 ]
  %88 = phi i64 [ %.pre20, %81 ], [ %77, %78 ], [ %77, %75 ]
  %.neg4 = add i64 %87, %88
  %89 = add i64 %86, %85
  %90 = sub i64 %.neg4, %89
  %91 = call noundef i64 @_ZSt3absx(i64 noundef %90)
  %92 = icmp slt i64 %91, 5
  br i1 %92, label %93, label %96

93:                                               ; preds = %84
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  store i32 2, ptr %12, align 4, !tbaa !5
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %95 = load i32, ptr %94, align 4, !tbaa !5
  store i32 %95, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  br label %96

96:                                               ; preds = %93, %84
  %97 = load i64, ptr %1, align 8, !tbaa !9
  %98 = load i64, ptr %2, align 8, !tbaa !9
  %99 = load i64, ptr %3, align 8, !tbaa !9
  %100 = load i64, ptr %4, align 8, !tbaa !9
  %101 = add i64 %98, %99
  %102 = sub i64 %97, %101
  %103 = add i64 %102, %100
  %104 = call noundef i64 @_ZSt3absx(i64 noundef %103)
  %105 = icmp slt i64 %104, 5
  br i1 %105, label %106, label %._crit_edge

._crit_edge:                                      ; preds = %96
  %.pre26 = load i32, ptr %5, align 4, !tbaa !5
  br label %109

106:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  store i32 2, ptr %13, align 4, !tbaa !5
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %108 = load i32, ptr %107, align 4, !tbaa !5
  store i32 %108, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  br label %109

109:                                              ; preds = %._crit_edge, %106
  %110 = phi i32 [ %.pre26, %._crit_edge ], [ %108, %106 ]
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %110)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %111, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0
}

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { inlinehint mustprogress 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 = { "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 = { 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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass