; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 05. Searching (binary_search_in_matrix)

; 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
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i8, align 1
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %19 = getelementptr i8, ptr %18, i64 -24
  %20 = load i64, ptr %19, align 8
  %21 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %20
  %22 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %21, ptr noundef null)
  %23 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %24 = getelementptr i8, ptr %23, i64 -24
  %25 = load i64, ptr %24, align 8
  %26 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %25
  %27 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %26, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 1, ptr %2, align 8, !tbaa !8
  br label %28

28:                                               ; preds = %119, %0
  %29 = load i64, ptr %2, align 8, !tbaa !8
  %30 = add nsw i64 %29, -1
  store i64 %30, ptr %2, align 8, !tbaa !8
  %31 = icmp ne i64 %29, 0
  br i1 %31, label %32, label %121

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %35 = load i64, ptr %3, align 8, !tbaa !8
  %36 = load i64, ptr %4, align 8, !tbaa !8
  %37 = call ptr @llvm.stacksave.p0()
  store ptr %37, ptr %5, align 8
  %38 = mul nuw i64 %35, %36
  %39 = alloca i64, i64 %38, align 16
  store i64 %35, ptr %6, align 8
  store i64 %36, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  br label %40

40:                                               ; preds = %62, %32
  %41 = load i64, ptr %8, align 8, !tbaa !8
  %42 = load i64, ptr %3, align 8, !tbaa !8
  %43 = icmp slt i64 %41, %42
  br i1 %43, label %45, label %44

44:                                               ; preds = %40
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %65

45:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  br label %46

46:                                               ; preds = %58, %45
  %47 = load i64, ptr %10, align 8, !tbaa !8
  %48 = load i64, ptr %4, align 8, !tbaa !8
  %49 = icmp slt i64 %47, %48
  br i1 %49, label %51, label %50

50:                                               ; preds = %46
  store i32 7, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %61

51:                                               ; preds = %46
  %52 = load i64, ptr %8, align 8, !tbaa !8
  %53 = mul nsw i64 %52, %36
  %54 = getelementptr inbounds i64, ptr %39, i64 %53
  %55 = load i64, ptr %10, align 8, !tbaa !8
  %56 = getelementptr inbounds i64, ptr %54, i64 %55
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %56)
  br label %58

58:                                               ; preds = %51
  %59 = load i64, ptr %10, align 8, !tbaa !8
  %60 = add nsw i64 %59, 1
  store i64 %60, ptr %10, align 8, !tbaa !8
  br label %46, !llvm.loop !11

61:                                               ; preds = %50
  br label %62

62:                                               ; preds = %61
  %63 = load i64, ptr %8, align 8, !tbaa !8
  %64 = add nsw i64 %63, 1
  store i64 %64, ptr %8, align 8, !tbaa !8
  br label %40, !llvm.loop !13

65:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %11)
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  store i8 0, ptr %12, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 0, ptr %13, align 8, !tbaa !8
  br label %67

67:                                               ; preds = %107, %65
  %68 = load i64, ptr %13, align 8, !tbaa !8
  %69 = load i64, ptr %3, align 8, !tbaa !8
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %72, label %71

71:                                               ; preds = %67
  store i32 10, ptr %9, align 4
  br label %110

72:                                               ; preds = %67
  %73 = load i64, ptr %4, align 8, !tbaa !8
  %74 = call ptr @llvm.stacksave.p0()
  store ptr %74, ptr %14, align 8
  %75 = alloca i64, i64 %73, align 16
  store i64 %73, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !8
  br label %76

76:                                               ; preds = %90, %72
  %77 = load i64, ptr %16, align 8, !tbaa !8
  %78 = load i64, ptr %4, align 8, !tbaa !8
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 13, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %93

81:                                               ; preds = %76
  %82 = load i64, ptr %13, align 8, !tbaa !8
  %83 = mul nsw i64 %82, %36
  %84 = getelementptr inbounds i64, ptr %39, i64 %83
  %85 = load i64, ptr %16, align 8, !tbaa !8
  %86 = getelementptr inbounds i64, ptr %84, i64 %85
  %87 = load i64, ptr %86, align 8, !tbaa !8
  %88 = load i64, ptr %16, align 8, !tbaa !8
  %89 = getelementptr inbounds i64, ptr %75, i64 %88
  store i64 %87, ptr %89, align 8, !tbaa !8
  br label %90

90:                                               ; preds = %81
  %91 = load i64, ptr %16, align 8, !tbaa !8
  %92 = add nsw i64 %91, 1
  store i64 %92, ptr %16, align 8, !tbaa !8
  br label %76, !llvm.loop !16

93:                                               ; preds = %80
  %94 = load i64, ptr %4, align 8, !tbaa !8
  %95 = getelementptr inbounds i64, ptr %75, i64 %94
  %96 = call noundef zeroext i1 @_ZSt13binary_searchIPxxEbT_S1_RKT0_(ptr noundef %75, ptr noundef %95, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %97 = zext i1 %96 to i32
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %99, label %102

99:                                               ; preds = %93
  %100 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %101 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef @.str)
  store i8 1, ptr %12, align 1, !tbaa !14
  store i32 10, ptr %9, align 4
  br label %103

102:                                              ; preds = %93
  store i32 0, ptr %9, align 4
  br label %103

103:                                              ; preds = %102, %99
  %104 = load ptr, ptr %14, align 8
  call void @llvm.stackrestore.p0(ptr %104)
  %105 = load i32, ptr %9, align 4
  switch i32 %105, label %110 [
    i32 0, label %106
  ]

106:                                              ; preds = %103
  br label %107

107:                                              ; preds = %106
  %108 = load i64, ptr %13, align 8, !tbaa !8
  %109 = add nsw i64 %108, 1
  store i64 %109, ptr %13, align 8, !tbaa !8
  br label %67, !llvm.loop !17

110:                                              ; preds = %103, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %111

111:                                              ; preds = %110
  %112 = load i8, ptr %12, align 1, !tbaa !14, !range !18, !noundef !19
  %113 = trunc i8 %112 to i1
  %114 = zext i1 %113 to i32
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %116, label %119

116:                                              ; preds = %111
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %117, ptr noundef @.str)
  br label %119

119:                                              ; preds = %116, %111
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  %120 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %120)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %28, !llvm.loop !20

121:                                              ; preds = %28
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %122 = load i32, ptr %1, align 4
  ret i32 %122
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

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

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

; 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)) #4 align 2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt13binary_searchIPxxEbT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) #4

; 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) #6

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind 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 willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"bool", !10, i64 0}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !12}


; 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
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; 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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %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) %1)
  %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) %2)
  %17 = load i64, ptr %1, align 8, !tbaa !8
  %18 = load i64, ptr %2, align 8, !tbaa !8
  %19 = call ptr @llvm.stacksave.p0()
  %20 = mul nuw i64 %18, %17
  %21 = alloca i64, i64 %20, align 16
  %22 = load i64, ptr %1, align 8, !tbaa !8
  %23 = icmp sgt i64 %22, 0
  %24 = load i64, ptr %2, align 8
  %25 = icmp sgt i64 %24, 0
  %or.cond = select i1 %23, i1 %25, i1 false
  br i1 %or.cond, label %.preheader, label %._crit_edge31

.preheader:                                       ; preds = %0, %._crit_edge
  %26 = phi i64 [ %35, %._crit_edge ], [ %22, %0 ]
  %27 = phi i64 [ %36, %._crit_edge ], [ %24, %0 ]
  %.02330 = phi i64 [ %37, %._crit_edge ], [ 0, %0 ]
  %28 = icmp sgt i64 %27, 0
  br i1 %28, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %29 = mul nsw i64 %.02330, %18
  %30 = getelementptr inbounds i64, ptr %21, i64 %29
  br label %39

._crit_edge31:                                    ; preds = %._crit_edge, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %32 = load i64, ptr %1, align 8, !tbaa !8
  %33 = icmp sgt i64 %32, 0
  br i1 %33, label %.lr.ph38.preheader, label %._crit_edge39

.lr.ph38.preheader:                               ; preds = %._crit_edge31
  %34 = shl i64 %18, 3
  br label %.lr.ph38

._crit_edge.loopexit:                             ; preds = %39
  %.pre = load i64, ptr %1, align 8, !tbaa !8
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %35 = phi i64 [ %.pre, %._crit_edge.loopexit ], [ %26, %.preheader ]
  %36 = phi i64 [ %43, %._crit_edge.loopexit ], [ %27, %.preheader ]
  %37 = add nuw nsw i64 %.02330, 1
  %38 = icmp slt i64 %37, %35
  br i1 %38, label %.preheader, label %._crit_edge31, !llvm.loop !11

39:                                               ; preds = %.lr.ph, %39
  %.02129 = phi i64 [ 0, %.lr.ph ], [ %42, %39 ]
  %40 = getelementptr inbounds i64, ptr %30, i64 %.02129
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %40)
  %42 = add nuw nsw i64 %.02129, 1
  %43 = load i64, ptr %2, align 8, !tbaa !8
  %44 = icmp slt i64 %42, %43
  br i1 %44, label %39, label %._crit_edge.loopexit, !llvm.loop !14

.lr.ph38:                                         ; preds = %.lr.ph38.preheader, %56
  %.01936 = phi i64 [ %57, %56 ], [ 0, %.lr.ph38.preheader ]
  %45 = load i64, ptr %2, align 8, !tbaa !8
  %46 = call ptr @llvm.stacksave.p0()
  %47 = alloca i64, i64 %45, align 16
  %48 = load i64, ptr %2, align 8, !tbaa !8
  %49 = icmp sgt i64 %48, 0
  br i1 %49, label %.lr.ph34, label %._crit_edge35

.lr.ph34:                                         ; preds = %.lr.ph38
  %50 = mul i64 %34, %.01936
  %scevgep = getelementptr i8, ptr %21, i64 %50
  %51 = shl nuw i64 %48, 3
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %47, ptr align 8 %scevgep, i64 %51, i1 false), !tbaa !8
  br label %._crit_edge35

._crit_edge35:                                    ; preds = %.lr.ph34, %.lr.ph38
  %52 = getelementptr inbounds i64, ptr %47, i64 %48
  %53 = call noundef zeroext i1 @_ZSt13binary_searchIPxxEbT_S1_RKT0_(ptr noundef nonnull %47, ptr noundef nonnull %52, ptr noundef nonnull align 8 dereferenceable(8) %3)
  br i1 %53, label %.thread26, label %56

.thread26:                                        ; preds = %._crit_edge35
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull @.str)
  call void @llvm.stackrestore.p0(ptr %46)
  br label %62

56:                                               ; preds = %._crit_edge35
  call void @llvm.stackrestore.p0(ptr %46)
  %57 = add nuw nsw i64 %.01936, 1
  %58 = load i64, ptr %1, align 8, !tbaa !8
  %59 = icmp slt i64 %57, %58
  br i1 %59, label %.lr.ph38, label %._crit_edge39, !llvm.loop !15

._crit_edge39:                                    ; preds = %56, %._crit_edge31
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef nonnull @.str)
  br label %62

62:                                               ; preds = %.thread26, %._crit_edge39
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.stackrestore.p0(ptr %19)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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

; 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 #4 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZSt13binary_searchIPxxEbT_S1_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; 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 #6

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12, !13}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


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