; LLVM IR from Shah-Shishir/Codeforces-Solutions :: 505A. Mr. Kitayuta's Gift (main)

; 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_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 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5isPalPc(ptr noundef) #0

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca [12 x i8], align 1
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #6
  br label %10

10:                                               ; preds = %159, %0
  %11 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 0
  %12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %11)
  %13 = icmp ne i32 %12, -1
  br i1 %13, label %14, label %160

14:                                               ; preds = %10
  %15 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 0
  %16 = call i64 @strlen(ptr noundef %15) #7
  %17 = trunc i64 %16 to i32
  store i32 %17, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %19 = sdiv i32 %18, 2
  store i32 %19, ptr %4, align 4, !tbaa !5
  %20 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 0
  %21 = call noundef zeroext i1 @_Z5isPalPc(ptr noundef %20)
  br i1 %21, label %22, label %62

22:                                               ; preds = %14
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %35, %22
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = sub nsw i32 %25, 1
  %27 = icmp sle i32 %24, %26
  br i1 %27, label %28, label %38

28:                                               ; preds = %23
  %29 = load i32, ptr %5, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %30
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = sext i8 %32 to i32
  %34 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %33)
  br label %35

35:                                               ; preds = %28
  %36 = load i32, ptr %5, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %5, align 4, !tbaa !5
  br label %23, !llvm.loop !10

38:                                               ; preds = %23
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = sext i8 %42 to i32
  %44 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %43)
  %45 = load i32, ptr %4, align 4, !tbaa !5
  store i32 %45, ptr %5, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %57, %38
  %47 = load i32, ptr %5, align 4, !tbaa !5
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = icmp slt i32 %47, %48
  br i1 %49, label %50, label %60

50:                                               ; preds = %46
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %55)
  br label %57

57:                                               ; preds = %50
  %58 = load i32, ptr %5, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %5, align 4, !tbaa !5
  br label %46, !llvm.loop !12

60:                                               ; preds = %46
  %61 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %159

62:                                               ; preds = %14
  store i32 0, ptr %5, align 4, !tbaa !5
  %63 = load i32, ptr %3, align 4, !tbaa !5
  %64 = sub nsw i32 %63, 1
  store i32 %64, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %8, align 4, !tbaa !5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %115, %62
  %66 = load i32, ptr %5, align 4, !tbaa !5
  %67 = load i32, ptr %6, align 4, !tbaa !5
  %68 = icmp sle i32 %66, %67
  br i1 %68, label %69, label %118

69:                                               ; preds = %65
  %70 = load i32, ptr %5, align 4, !tbaa !5
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %70)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef @.str.3)
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !9
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %72, i8 noundef signext %76)
  %78 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef @.str.3)
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %78, i32 noundef %79)
  %81 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %80, ptr noundef @.str.3)
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !9
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %81, i8 noundef signext %85)
  %87 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %86, ptr noundef @.str.2)
  %88 = load i32, ptr %7, align 4, !tbaa !5
  %89 = icmp sgt i32 %88, 1
  br i1 %89, label %90, label %92

90:                                               ; preds = %69
  %91 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %118

92:                                               ; preds = %69
  %93 = load i32, ptr %5, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %94
  %96 = load i8, ptr %95, align 1, !tbaa !9
  %97 = sext i8 %96 to i32
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %99
  %101 = load i8, ptr %100, align 1, !tbaa !9
  %102 = sext i8 %101 to i32
  %103 = icmp ne i32 %97, %102
  br i1 %103, label %104, label %112

104:                                              ; preds = %92
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %7, align 4, !tbaa !5
  %107 = load i32, ptr %6, align 4, !tbaa !5
  store i32 %107, ptr %8, align 4, !tbaa !5
  %108 = load i32, ptr %5, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !9
  store i8 %111, ptr %9, align 1, !tbaa !9
  br label %115

112:                                              ; preds = %92
  %113 = load i32, ptr %6, align 4, !tbaa !5
  %114 = add nsw i32 %113, -1
  store i32 %114, ptr %6, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %112, %104
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %5, align 4, !tbaa !5
  br label %65, !llvm.loop !13

118:                                              ; preds = %90, %65
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = icmp eq i32 %119, 1
  br i1 %120, label %121, label %158

121:                                              ; preds = %118
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %122

122:                                              ; preds = %133, %121
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = icmp sle i32 %123, %124
  br i1 %125, label %126, label %136

126:                                              ; preds = %122
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !9
  %131 = sext i8 %130 to i32
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %131)
  br label %133

133:                                              ; preds = %126
  %134 = load i32, ptr %5, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %5, align 4, !tbaa !5
  br label %122, !llvm.loop !14

136:                                              ; preds = %122
  %137 = load i8, ptr %9, align 1, !tbaa !9
  %138 = sext i8 %137 to i32
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %138)
  %140 = load i32, ptr %8, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %5, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %153, %136
  %143 = load i32, ptr %5, align 4, !tbaa !5
  %144 = load i32, ptr %3, align 4, !tbaa !5
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %146, label %156

146:                                              ; preds = %142
  %147 = load i32, ptr %5, align 4, !tbaa !5
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [12 x i8], ptr %2, i64 0, i64 %148
  %150 = load i8, ptr %149, align 1, !tbaa !9
  %151 = sext i8 %150 to i32
  %152 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %151)
  br label %153

153:                                              ; preds = %146
  %154 = load i32, ptr %5, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %5, align 4, !tbaa !5
  br label %142, !llvm.loop !15

156:                                              ; preds = %142
  %157 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %158

158:                                              ; preds = %156, %118
  br label %159

159:                                              ; preds = %158, %60
  br label %10, !llvm.loop !16

160:                                              ; preds = %10
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %2) #6
  ret i32 0
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

declare i32 @printf(ptr noundef, ...) #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) #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

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

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

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}


; 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_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 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z5isPalPc(ptr noundef) local_unnamed_addr #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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca [12 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #7
  %2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %.not80 = icmp eq i32 %2, -1
  br i1 %.not80, label %._crit_edge84, label %.lr.ph83

.lr.ph83:                                         ; preds = %0, %._crit_edge.thread
  %.081 = phi i8 [ %.3, %._crit_edge.thread ], [ undef, %0 ]
  %3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %1) #8
  %4 = trunc i64 %3 to i32
  %5 = sdiv i32 %4, 2
  %6 = call noundef zeroext i1 @_Z5isPalPc(ptr noundef nonnull %1)
  br i1 %6, label %.preheader, label %23

.preheader:                                       ; preds = %.lr.ph83
  %.not50.not72 = icmp sgt i32 %4, 1
  br i1 %.not50.not72, label %.lr.ph74.preheader, label %._crit_edge75

.lr.ph74.preheader:                               ; preds = %.preheader
  %wide.trip.count96 = zext nneg i32 %5 to i64
  br label %.lr.ph74

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %.lr.ph74
  %indvars.iv93 = phi i64 [ 0, %.lr.ph74.preheader ], [ %indvars.iv.next94, %.lr.ph74 ]
  %7 = getelementptr inbounds [12 x i8], ptr %1, i64 0, i64 %indvars.iv93
  %8 = load i8, ptr %7, align 1, !tbaa !5
  %9 = sext i8 %8 to i32
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
  br i1 %exitcond97.not, label %._crit_edge75, label %.lr.ph74, !llvm.loop !8

._crit_edge75:                                    ; preds = %.lr.ph74, %.preheader
  %11 = sext i32 %5 to i64
  %12 = getelementptr inbounds [12 x i8], ptr %1, i64 0, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %14 = sext i8 %13 to i32
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
  %16 = icmp sgt i32 %4, 0
  br i1 %16, label %.lr.ph78.preheader, label %._crit_edge.thread.sink.split

.lr.ph78.preheader:                               ; preds = %._crit_edge75
  %17 = and i64 %3, 2147483647
  br label %.lr.ph78

.lr.ph78:                                         ; preds = %.lr.ph78.preheader, %.lr.ph78
  %indvars.iv98 = phi i64 [ %11, %.lr.ph78.preheader ], [ %indvars.iv.next99, %.lr.ph78 ]
  %18 = getelementptr inbounds [12 x i8], ptr %1, i64 0, i64 %indvars.iv98
  %19 = load i8, ptr %18, align 1, !tbaa !5
  %20 = sext i8 %19 to i32
  %21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %20)
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %22 = icmp slt i64 %indvars.iv.next99, %17
  br i1 %22, label %.lr.ph78, label %._crit_edge.thread.sink.split, !llvm.loop !10

23:                                               ; preds = %.lr.ph83
  %.not4755 = icmp slt i32 %4, 1
  br i1 %.not4755, label %._crit_edge.thread, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %23
  %24 = add nsw i32 %4, -1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %47
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %47 ]
  %.160 = phi i8 [ %.081, %.lr.ph.preheader ], [ %.2, %47 ]
  %.03759 = phi i32 [ 0, %.lr.ph.preheader ], [ %.138, %47 ]
  %.03958 = phi i32 [ 0, %.lr.ph.preheader ], [ %.140, %47 ]
  %.04157 = phi i32 [ %24, %.lr.ph.preheader ], [ %.142, %47 ]
  %25 = trunc nuw nsw i64 %indvars.iv to i32
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %25)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef nonnull @.str.3)
  %28 = getelementptr inbounds [12 x i8], ptr %1, i64 0, i64 %indvars.iv
  %29 = load i8, ptr %28, align 1, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %27, i8 noundef signext %29)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @.str.3)
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %31, i32 noundef %.04157)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull @.str.3)
  %34 = sext i32 %.04157 to i64
  %35 = getelementptr inbounds [12 x i8], ptr %1, i64 0, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !5
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %33, i8 noundef signext %36)
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull @.str.2)
  %39 = icmp sgt i32 %.03958, 1
  br i1 %39, label %._crit_edge.thread.sink.split, label %40

40:                                               ; preds = %.lr.ph
  %41 = load i8, ptr %28, align 1, !tbaa !5
  %42 = load i8, ptr %35, align 1, !tbaa !5
  %.not48 = icmp eq i8 %41, %42
  br i1 %.not48, label %45, label %43

43:                                               ; preds = %40
  %44 = add nsw i32 %.03958, 1
  br label %47

45:                                               ; preds = %40
  %46 = add nsw i32 %.04157, -1
  %.pre = sext i32 %46 to i64
  br label %47

47:                                               ; preds = %45, %43
  %.pre-phi = phi i64 [ %.pre, %45 ], [ %34, %43 ]
  %.142 = phi i32 [ %46, %45 ], [ %.04157, %43 ]
  %.140 = phi i32 [ %.03958, %45 ], [ %44, %43 ]
  %.138 = phi i32 [ %.03759, %45 ], [ %.04157, %43 ]
  %.2 = phi i8 [ %.160, %45 ], [ %41, %43 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not47.not = icmp slt i64 %indvars.iv, %.pre-phi
  br i1 %.not47.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %47
  %48 = icmp eq i32 %.140, 1
  br i1 %48, label %.preheader51, label %._crit_edge.thread

.preheader51:                                     ; preds = %._crit_edge
  %.not4963 = icmp slt i32 %.138, 0
  %.pre101 = add nsw i32 %.138, 1
  br i1 %.not4963, label %._crit_edge66, label %.lr.ph65.preheader

.lr.ph65.preheader:                               ; preds = %.preheader51
  %wide.trip.count = zext nneg i32 %.pre101 to i64
  br label %.lr.ph65

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %.lr.ph65
  %indvars.iv86 = phi i64 [ 0, %.lr.ph65.preheader ], [ %indvars.iv.next87, %.lr.ph65 ]
  %49 = getelementptr inbounds [12 x i8], ptr %1, i64 0, i64 %indvars.iv86
  %50 = load i8, ptr %49, align 1, !tbaa !5
  %51 = sext i8 %50 to i32
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %51)
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge66, label %.lr.ph65, !llvm.loop !12

._crit_edge66:                                    ; preds = %.lr.ph65, %.preheader51
  %53 = sext i8 %.2 to i32
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %53)
  %55 = icmp slt i32 %.pre101, %4
  br i1 %55, label %.lr.ph70.preheader, label %._crit_edge.thread.sink.split

.lr.ph70.preheader:                               ; preds = %._crit_edge66
  %56 = sext i32 %.pre101 to i64
  br label %.lr.ph70

.lr.ph70:                                         ; preds = %.lr.ph70.preheader, %.lr.ph70
  %indvars.iv89 = phi i64 [ %56, %.lr.ph70.preheader ], [ %indvars.iv.next90, %.lr.ph70 ]
  %57 = getelementptr inbounds [12 x i8], ptr %1, i64 0, i64 %indvars.iv89
  %58 = load i8, ptr %57, align 1, !tbaa !5
  %59 = sext i8 %58 to i32
  %60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %59)
  %indvars.iv.next90 = add nsw i64 %indvars.iv89, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next90 to i32
  %exitcond92.not = icmp eq i32 %lftr.wideiv, %4
  br i1 %exitcond92.not, label %._crit_edge.thread.sink.split, label %.lr.ph70, !llvm.loop !13

._crit_edge.thread.sink.split:                    ; preds = %.lr.ph, %.lr.ph70, %.lr.ph78, %._crit_edge66, %._crit_edge75
  %.str.4.sink = phi ptr [ @.str.2, %._crit_edge75 ], [ @.str.2, %._crit_edge66 ], [ @.str.2, %.lr.ph78 ], [ @.str.2, %.lr.ph70 ], [ @.str.4, %.lr.ph ]
  %.3.ph = phi i8 [ %.081, %._crit_edge75 ], [ %.2, %._crit_edge66 ], [ %.081, %.lr.ph78 ], [ %.2, %.lr.ph70 ], [ %.160, %.lr.ph ]
  %61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.4.sink)
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %._crit_edge.thread.sink.split, %23, %._crit_edge
  %.3 = phi i8 [ %.2, %._crit_edge ], [ %.081, %23 ], [ %.3.ph, %._crit_edge.thread.sink.split ]
  %62 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1)
  %.not = icmp eq i32 %62, -1
  br i1 %.not, label %._crit_edge84, label %.lr.ph83, !llvm.loop !14

._crit_edge84:                                    ; preds = %._crit_edge.thread, %0
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %1) #7
  ret i32 0
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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 #5

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #5

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

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

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


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