; LLVM IR from UtkarshPathrabe/Competitive-Coding :: Codeforces/Codeforces Round 325 (Div 2) (Gennady the Dentist)

; 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" }
%struct.patient = type { i64, i64, i64, i8 }

@_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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = zext i32 %15 to i64
  %17 = call ptr @llvm.stacksave.p0()
  store ptr %17, ptr %4, align 8
  %18 = alloca %struct.patient, i64 %16, align 16
  store i64 %16, ptr %5, align 8
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = zext i32 %19 to i64
  %21 = alloca i8, i64 %20, align 16
  store i64 %20, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %50, %0
  %23 = load i32, ptr %7, align 4, !tbaa !5
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %53

27:                                               ; preds = %22
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds %struct.patient, ptr %18, i64 %29
  %31 = getelementptr inbounds %struct.patient, ptr %30, i32 0, i32 0
  %32 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %31)
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds %struct.patient, ptr %18, i64 %34
  %36 = getelementptr inbounds %struct.patient, ptr %35, i32 0, i32 1
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %32, ptr noundef nonnull align 8 dereferenceable(8) %36)
  %38 = load i32, ptr %7, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds %struct.patient, ptr %18, i64 %39
  %41 = getelementptr inbounds %struct.patient, ptr %40, i32 0, i32 2
  %42 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 8 dereferenceable(8) %41)
  %43 = load i32, ptr %7, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %struct.patient, ptr %18, i64 %44
  %46 = getelementptr inbounds %struct.patient, ptr %45, i32 0, i32 3
  store i8 1, ptr %46, align 8, !tbaa !9
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %21, i64 %48
  store i8 0, ptr %49, align 1, !tbaa !13
  br label %50

50:                                               ; preds = %27
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %7, align 4, !tbaa !5
  br label %22, !llvm.loop !14

53:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %132, %53
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %135

59:                                               ; preds = %54
  %60 = load i32, ptr %8, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds %struct.patient, ptr %18, i64 %61
  %63 = getelementptr inbounds %struct.patient, ptr %62, i32 0, i32 3
  %64 = load i8, ptr %63, align 8, !tbaa !9, !range !16, !noundef !17
  %65 = trunc i8 %64 to i1
  br i1 %65, label %67, label %66

66:                                               ; preds = %59
  br label %132

67:                                               ; preds = %59
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds i8, ptr %21, i64 %69
  store i8 1, ptr %70, align 1, !tbaa !13
  %71 = load i32, ptr %3, align 4, !tbaa !5
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  store i64 0, ptr %10, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds %struct.patient, ptr %18, i64 %74
  %76 = getelementptr inbounds %struct.patient, ptr %75, i32 0, i32 0
  %77 = load i64, ptr %76, align 16, !tbaa !19
  store i64 %77, ptr %11, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %78 = load i32, ptr %8, align 4, !tbaa !5
  %79 = add nsw i32 %78, 1
  store i32 %79, ptr %12, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %128, %67
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = load i32, ptr %2, align 4, !tbaa !5
  %83 = icmp slt i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %131

85:                                               ; preds = %80
  %86 = load i32, ptr %12, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.patient, ptr %18, i64 %87
  %89 = getelementptr inbounds %struct.patient, ptr %88, i32 0, i32 3
  %90 = load i8, ptr %89, align 8, !tbaa !9, !range !16, !noundef !17
  %91 = trunc i8 %90 to i1
  br i1 %91, label %93, label %92

92:                                               ; preds = %85
  br label %128

93:                                               ; preds = %85
  %94 = load i64, ptr %10, align 8, !tbaa !18
  %95 = load i64, ptr %11, align 8, !tbaa !18
  %96 = add nsw i64 %94, %95
  %97 = load i32, ptr %12, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds %struct.patient, ptr %18, i64 %98
  %100 = getelementptr inbounds %struct.patient, ptr %99, i32 0, i32 2
  %101 = load i64, ptr %100, align 16, !tbaa !20
  %102 = sub nsw i64 %101, %96
  store i64 %102, ptr %100, align 16, !tbaa !20
  %103 = load i32, ptr %12, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds %struct.patient, ptr %18, i64 %104
  %106 = getelementptr inbounds %struct.patient, ptr %105, i32 0, i32 2
  %107 = load i64, ptr %106, align 16, !tbaa !20
  %108 = icmp slt i64 %107, 0
  br i1 %108, label %109, label %121

109:                                              ; preds = %93
  %110 = load i32, ptr %12, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds %struct.patient, ptr %18, i64 %111
  %113 = getelementptr inbounds %struct.patient, ptr %112, i32 0, i32 3
  store i8 0, ptr %113, align 8, !tbaa !9
  %114 = load i32, ptr %12, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds %struct.patient, ptr %18, i64 %115
  %117 = getelementptr inbounds %struct.patient, ptr %116, i32 0, i32 1
  %118 = load i64, ptr %117, align 8, !tbaa !21
  %119 = load i64, ptr %10, align 8, !tbaa !18
  %120 = add nsw i64 %119, %118
  store i64 %120, ptr %10, align 8, !tbaa !18
  br label %121

121:                                              ; preds = %109, %93
  %122 = load i64, ptr %11, align 8, !tbaa !18
  %123 = icmp sgt i64 %122, 0
  br i1 %123, label %124, label %127

124:                                              ; preds = %121
  %125 = load i64, ptr %11, align 8, !tbaa !18
  %126 = add nsw i64 %125, -1
  store i64 %126, ptr %11, align 8, !tbaa !18
  br label %127

127:                                              ; preds = %124, %121
  br label %128

128:                                              ; preds = %127, %92
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %12, align 4, !tbaa !5
  br label %80, !llvm.loop !22

131:                                              ; preds = %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %132

132:                                              ; preds = %131, %66
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %8, align 4, !tbaa !5
  br label %54, !llvm.loop !23

135:                                              ; preds = %58
  %136 = load i32, ptr %3, align 4, !tbaa !5
  %137 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %136)
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %137, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %156, %135
  %140 = load i32, ptr %13, align 4, !tbaa !5
  %141 = load i32, ptr %2, align 4, !tbaa !5
  %142 = icmp slt i32 %140, %141
  br i1 %142, label %144, label %143

143:                                              ; preds = %139
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %159

144:                                              ; preds = %139
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i8, ptr %21, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !13, !range !16, !noundef !17
  %149 = trunc i8 %148 to i1
  br i1 %149, label %150, label %155

150:                                              ; preds = %144
  %151 = load i32, ptr %13, align 4, !tbaa !5
  %152 = add nsw i32 %151, 1
  %153 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %152)
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %153, ptr noundef @.str)
  br label %155

155:                                              ; preds = %150, %144
  br label %156

156:                                              ; preds = %155
  %157 = load i32, ptr %13, align 4, !tbaa !5
  %158 = add nsw i32 %157, 1
  store i32 %158, ptr %13, align 4, !tbaa !5
  br label %139, !llvm.loop !24

159:                                              ; preds = %143
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  %161 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %161)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %162 = load i32, ptr %1, align 4
  ret i32 %162
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 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

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

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

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 = { "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 }
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 = { 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, !12, i64 24}
!10 = !{!"_ZTS7patient", !11, i64 0, !11, i64 8, !11, i64 16, !12, i64 24}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!11, !11, i64 0}
!19 = !{!10, !11, i64 0}
!20 = !{!10, !11, i64 16}
!21 = !{!10, !11, i64 8}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}
!24 = distinct !{!24, !15}


; 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" }
%struct.patient = type { i64, i64, i64, i8 }

@_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 i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %2 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %4 = zext i32 %3 to i64
  %5 = call ptr @llvm.stacksave.p0()
  %6 = alloca %struct.patient, i64 %4, align 16
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = zext i32 %7 to i64
  %9 = alloca i8, i64 %8, align 16
  %10 = icmp sgt i32 %7, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.preheader:                                       ; preds = %.lr.ph
  %11 = icmp sgt i32 %21, 0
  br i1 %11, label %.lr.ph48.preheader, label %._crit_edge

.lr.ph48.preheader:                               ; preds = %.preheader
  %12 = zext nneg i32 %21 to i64
  %wide.trip.count65 = zext nneg i32 %21 to i64
  br label %.lr.ph48

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %13 = getelementptr inbounds %struct.patient, ptr %6, i64 %indvars.iv
  %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) %13)
  %15 = getelementptr inbounds i8, ptr %13, i64 8
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) %15)
  %17 = getelementptr inbounds i8, ptr %13, i64 16
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %19 = getelementptr inbounds i8, ptr %13, i64 24
  store i8 1, ptr %19, align 8, !tbaa !9
  %20 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv
  store i8 0, ptr %20, align 1, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %21 = load i32, ptr %1, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = icmp slt i64 %indvars.iv.next, %22
  br i1 %23, label %.lr.ph, label %.preheader, !llvm.loop !14

._crit_edge:                                      ; preds = %.loopexit, %0, %.preheader
  %.038.lcssa = phi i32 [ 0, %.preheader ], [ 0, %0 ], [ %.139, %.loopexit ]
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.038.lcssa)
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %26 = load i32, ptr %1, align 4, !tbaa !5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph52, label %._crit_edge53

.lr.ph48:                                         ; preds = %.lr.ph48.preheader, %.loopexit
  %indvars.iv61 = phi i64 [ 0, %.lr.ph48.preheader ], [ %indvars.iv.next62.pre-phi, %.loopexit ]
  %indvars.iv56 = phi i64 [ 1, %.lr.ph48.preheader ], [ %indvars.iv.next57, %.loopexit ]
  %.03846 = phi i32 [ 0, %.lr.ph48.preheader ], [ %.139, %.loopexit ]
  %28 = getelementptr inbounds %struct.patient, ptr %6, i64 %indvars.iv61
  %29 = getelementptr inbounds i8, ptr %28, i64 24
  %30 = load i8, ptr %29, align 8, !tbaa !9, !range !16, !noundef !17
  %31 = trunc nuw i8 %30 to i1
  br i1 %31, label %32, label %.lr.ph48..loopexit_crit_edge

.lr.ph48..loopexit_crit_edge:                     ; preds = %.lr.ph48
  %.pre70 = add nuw nsw i64 %indvars.iv61, 1
  br label %.loopexit

32:                                               ; preds = %.lr.ph48
  %33 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv61
  store i8 1, ptr %33, align 1, !tbaa !13
  %34 = add nsw i32 %.03846, 1
  %35 = add nuw nsw i64 %indvars.iv61, 1
  %36 = icmp slt i64 %35, %12
  br i1 %36, label %.lr.ph45.preheader, label %.loopexit

.lr.ph45.preheader:                               ; preds = %32
  %37 = load i64, ptr %28, align 16, !tbaa !18
  br label %.lr.ph45

.lr.ph45:                                         ; preds = %.lr.ph45.preheader, %55
  %indvars.iv58 = phi i64 [ %indvars.iv56, %.lr.ph45.preheader ], [ %indvars.iv.next59, %55 ]
  %.03343 = phi i64 [ %37, %.lr.ph45.preheader ], [ %.1, %55 ]
  %.03442 = phi i64 [ 0, %.lr.ph45.preheader ], [ %.2, %55 ]
  %38 = getelementptr inbounds %struct.patient, ptr %6, i64 %indvars.iv58
  %39 = getelementptr inbounds i8, ptr %38, i64 24
  %40 = load i8, ptr %39, align 8, !tbaa !9, !range !16, !noundef !17
  %41 = trunc nuw i8 %40 to i1
  br i1 %41, label %42, label %55

42:                                               ; preds = %.lr.ph45
  %43 = getelementptr inbounds i8, ptr %38, i64 16
  %44 = load i64, ptr %43, align 16, !tbaa !19
  %45 = add i64 %.03343, %.03442
  %46 = sub i64 %44, %45
  store i64 %46, ptr %43, align 16, !tbaa !19
  %47 = icmp slt i64 %46, 0
  br i1 %47, label %48, label %52

48:                                               ; preds = %42
  store i8 0, ptr %39, align 8, !tbaa !9
  %49 = getelementptr inbounds i8, ptr %38, i64 8
  %50 = load i64, ptr %49, align 8, !tbaa !20
  %51 = add nsw i64 %50, %.03442
  br label %52

52:                                               ; preds = %48, %42
  %.135 = phi i64 [ %51, %48 ], [ %.03442, %42 ]
  %53 = icmp sgt i64 %.03343, 0
  %54 = sext i1 %53 to i64
  %spec.select = add nsw i64 %.03343, %54
  br label %55

55:                                               ; preds = %52, %.lr.ph45
  %.2 = phi i64 [ %.03442, %.lr.ph45 ], [ %.135, %52 ]
  %.1 = phi i64 [ %.03343, %.lr.ph45 ], [ %spec.select, %52 ]
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count65
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph45, !llvm.loop !21

.loopexit:                                        ; preds = %55, %.lr.ph48..loopexit_crit_edge, %32
  %indvars.iv.next62.pre-phi = phi i64 [ %.pre70, %.lr.ph48..loopexit_crit_edge ], [ %35, %32 ], [ %35, %55 ]
  %.139 = phi i32 [ %.03846, %.lr.ph48..loopexit_crit_edge ], [ %34, %32 ], [ %34, %55 ]
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next62.pre-phi, %wide.trip.count65
  br i1 %exitcond66.not, label %._crit_edge, label %.lr.ph48, !llvm.loop !22

._crit_edge53:                                    ; preds = %.lr.ph52._crit_edge, %._crit_edge
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.stackrestore.p0(ptr %5)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0

.lr.ph52:                                         ; preds = %._crit_edge, %.lr.ph52._crit_edge
  %57 = phi i32 [ %66, %.lr.ph52._crit_edge ], [ %26, %._crit_edge ]
  %indvars.iv67 = phi i64 [ %61, %.lr.ph52._crit_edge ], [ 0, %._crit_edge ]
  %58 = getelementptr inbounds i8, ptr %9, i64 %indvars.iv67
  %59 = load i8, ptr %58, align 1, !tbaa !13, !range !16, !noundef !17
  %60 = trunc nuw i8 %59 to i1
  %61 = add nuw nsw i64 %indvars.iv67, 1
  br i1 %60, label %62, label %.lr.ph52._crit_edge

62:                                               ; preds = %.lr.ph52
  %63 = trunc nuw nsw i64 %61 to i32
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %63)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef nonnull @.str)
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %.lr.ph52._crit_edge

.lr.ph52._crit_edge:                              ; preds = %.lr.ph52, %62
  %66 = phi i32 [ %.pre, %62 ], [ %57, %.lr.ph52 ]
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %61, %67
  br i1 %68, label %.lr.ph52, label %._crit_edge53, !llvm.loop !23
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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 = { "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 }
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 = { 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, !12, i64 24}
!10 = !{!"_ZTS7patient", !11, i64 0, !11, i64 8, !11, i64 16, !12, i64 24}
!11 = !{!"long long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{i8 0, i8 2}
!17 = !{}
!18 = !{!10, !11, i64 0}
!19 = !{!10, !11, i64 16}
!20 = !{!10, !11, i64 8}
!21 = distinct !{!21, !15}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass