; LLVM IR from DionysiosB/CodeForces :: 0400-0499 (486C-PalindromeTransformation)

; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 26, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %3, ptr noundef %4)
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  %14 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %5)
          to label %15 unwind label %28

15:                                               ; preds = %0
  %16 = load i64, ptr %3, align 8, !tbaa !9
  %17 = add nsw i64 %16, -1
  store i64 %17, ptr %3, align 8, !tbaa !9
  %18 = load i64, ptr %4, align 8, !tbaa !9
  %19 = add nsw i64 %18, -1
  store i64 %19, ptr %4, align 8, !tbaa !9
  %20 = load i64, ptr %4, align 8, !tbaa !9
  %21 = load i64, ptr %3, align 8, !tbaa !9
  %22 = sdiv i64 %21, 2
  %23 = icmp sgt i64 %20, %22
  br i1 %23, label %24, label %32

24:                                               ; preds = %15
  %25 = load i64, ptr %3, align 8, !tbaa !9
  %26 = load i64, ptr %4, align 8, !tbaa !9
  %27 = sub nsw i64 %25, %26
  store i64 %27, ptr %4, align 8, !tbaa !9
  br label %32

28:                                               ; preds = %0
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %6, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %7, align 4
  br label %194

32:                                               ; preds = %24, %15
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store i64 -1, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  store i64 0, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  store i64 0, ptr %11, align 8, !tbaa !9
  br label %33

33:                                               ; preds = %98, %32
  %34 = load i64, ptr %11, align 8, !tbaa !9
  %35 = load i64, ptr %3, align 8, !tbaa !9
  %36 = sdiv i64 %35, 2
  %37 = icmp sle i64 %34, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %102

39:                                               ; preds = %33
  %40 = load i64, ptr %11, align 8, !tbaa !9
  %41 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %40)
          to label %42 unwind label %72

42:                                               ; preds = %39
  %43 = load i8, ptr %41, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = load i64, ptr %3, align 8, !tbaa !9
  %46 = load i64, ptr %11, align 8, !tbaa !9
  %47 = sub nsw i64 %45, %46
  %48 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %47)
          to label %49 unwind label %72

49:                                               ; preds = %42
  %50 = load i8, ptr %48, align 1, !tbaa !11
  %51 = sext i8 %50 to i32
  %52 = icmp ne i32 %44, %51
  br i1 %52, label %53, label %97

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %54 = load i64, ptr %11, align 8, !tbaa !9
  %55 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %54)
          to label %56 unwind label %76

56:                                               ; preds = %53
  %57 = load i8, ptr %55, align 1, !tbaa !11
  %58 = sext i8 %57 to i32
  %59 = load i64, ptr %3, align 8, !tbaa !9
  %60 = load i64, ptr %11, align 8, !tbaa !9
  %61 = sub nsw i64 %59, %60
  %62 = invoke noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %5, i64 noundef %61)
          to label %63 unwind label %76

63:                                               ; preds = %56
  %64 = load i8, ptr %62, align 1, !tbaa !11
  %65 = sext i8 %64 to i32
  %66 = sub nsw i32 %58, %65
  store i32 %66, ptr %12, align 4, !tbaa !5
  %67 = load i32, ptr %12, align 4, !tbaa !5
  %68 = icmp slt i32 %67, 0
  br i1 %68, label %69, label %80

69:                                               ; preds = %63
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = add nsw i32 %70, 26
  store i32 %71, ptr %12, align 4, !tbaa !5
  br label %80

72:                                               ; preds = %42, %39
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %6, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %7, align 4
  br label %101

76:                                               ; preds = %56, %53
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %6, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %101

80:                                               ; preds = %69, %63
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = icmp sgt i32 %81, 13
  br i1 %82, label %83, label %86

83:                                               ; preds = %80
  %84 = load i32, ptr %12, align 4, !tbaa !5
  %85 = sub nsw i32 26, %84
  store i32 %85, ptr %12, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %83, %80
  %87 = load i32, ptr %12, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = load i64, ptr %10, align 8, !tbaa !9
  %90 = add nsw i64 %89, %88
  store i64 %90, ptr %10, align 8, !tbaa !9
  %91 = load i64, ptr %8, align 8, !tbaa !9
  %92 = icmp slt i64 %91, 0
  br i1 %92, label %93, label %95

93:                                               ; preds = %86
  %94 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %94, ptr %8, align 8, !tbaa !9
  br label %95

95:                                               ; preds = %93, %86
  %96 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %96, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %97

97:                                               ; preds = %95, %49
  br label %98

98:                                               ; preds = %97
  %99 = load i64, ptr %11, align 8, !tbaa !9
  %100 = add nsw i64 %99, 1
  store i64 %100, ptr %11, align 8, !tbaa !9
  br label %33, !llvm.loop !12

101:                                              ; preds = %76, %72
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %193

102:                                              ; preds = %38
  %103 = load i64, ptr %4, align 8, !tbaa !9
  %104 = load i64, ptr %8, align 8, !tbaa !9
  %105 = icmp sle i64 %103, %104
  br i1 %105, label %106, label %112

106:                                              ; preds = %102
  %107 = load i64, ptr %9, align 8, !tbaa !9
  %108 = load i64, ptr %4, align 8, !tbaa !9
  %109 = sub nsw i64 %107, %108
  %110 = load i64, ptr %10, align 8, !tbaa !9
  %111 = add nsw i64 %110, %109
  store i64 %111, ptr %10, align 8, !tbaa !9
  br label %177

112:                                              ; preds = %102
  %113 = load i64, ptr %8, align 8, !tbaa !9
  %114 = load i64, ptr %4, align 8, !tbaa !9
  %115 = icmp sle i64 %113, %114
  br i1 %115, label %116, label %138

116:                                              ; preds = %112
  %117 = load i64, ptr %4, align 8, !tbaa !9
  %118 = load i64, ptr %9, align 8, !tbaa !9
  %119 = icmp sle i64 %117, %118
  br i1 %119, label %120, label %138

120:                                              ; preds = %116
  %121 = load i64, ptr %4, align 8, !tbaa !9
  %122 = load i64, ptr %8, align 8, !tbaa !9
  %123 = sub nsw i64 %121, %122
  %124 = load i64, ptr %9, align 8, !tbaa !9
  %125 = load i64, ptr %4, align 8, !tbaa !9
  %126 = sub nsw i64 %124, %125
  %127 = icmp sle i64 %123, %126
  br i1 %127, label %128, label %138

128:                                              ; preds = %120
  %129 = load i64, ptr %4, align 8, !tbaa !9
  %130 = load i64, ptr %8, align 8, !tbaa !9
  %131 = sub nsw i64 %129, %130
  %132 = load i64, ptr %9, align 8, !tbaa !9
  %133 = load i64, ptr %8, align 8, !tbaa !9
  %134 = sub nsw i64 %132, %133
  %135 = add nsw i64 %131, %134
  %136 = load i64, ptr %10, align 8, !tbaa !9
  %137 = add nsw i64 %136, %135
  store i64 %137, ptr %10, align 8, !tbaa !9
  br label %176

138:                                              ; preds = %120, %116, %112
  %139 = load i64, ptr %8, align 8, !tbaa !9
  %140 = load i64, ptr %4, align 8, !tbaa !9
  %141 = icmp sle i64 %139, %140
  br i1 %141, label %142, label %164

142:                                              ; preds = %138
  %143 = load i64, ptr %4, align 8, !tbaa !9
  %144 = load i64, ptr %9, align 8, !tbaa !9
  %145 = icmp sle i64 %143, %144
  br i1 %145, label %146, label %164

146:                                              ; preds = %142
  %147 = load i64, ptr %9, align 8, !tbaa !9
  %148 = load i64, ptr %4, align 8, !tbaa !9
  %149 = sub nsw i64 %147, %148
  %150 = load i64, ptr %4, align 8, !tbaa !9
  %151 = load i64, ptr %8, align 8, !tbaa !9
  %152 = sub nsw i64 %150, %151
  %153 = icmp slt i64 %149, %152
  br i1 %153, label %154, label %164

154:                                              ; preds = %146
  %155 = load i64, ptr %9, align 8, !tbaa !9
  %156 = load i64, ptr %4, align 8, !tbaa !9
  %157 = sub nsw i64 %155, %156
  %158 = load i64, ptr %9, align 8, !tbaa !9
  %159 = load i64, ptr %8, align 8, !tbaa !9
  %160 = sub nsw i64 %158, %159
  %161 = add nsw i64 %157, %160
  %162 = load i64, ptr %10, align 8, !tbaa !9
  %163 = add nsw i64 %162, %161
  store i64 %163, ptr %10, align 8, !tbaa !9
  br label %175

164:                                              ; preds = %146, %142, %138
  %165 = load i64, ptr %9, align 8, !tbaa !9
  %166 = load i64, ptr %4, align 8, !tbaa !9
  %167 = icmp sle i64 %165, %166
  br i1 %167, label %168, label %174

168:                                              ; preds = %164
  %169 = load i64, ptr %4, align 8, !tbaa !9
  %170 = load i64, ptr %8, align 8, !tbaa !9
  %171 = sub nsw i64 %169, %170
  %172 = load i64, ptr %10, align 8, !tbaa !9
  %173 = add nsw i64 %172, %171
  store i64 %173, ptr %10, align 8, !tbaa !9
  br label %174

174:                                              ; preds = %168, %164
  br label %175

175:                                              ; preds = %174, %154
  br label %176

176:                                              ; preds = %175, %128
  br label %177

177:                                              ; preds = %176, %106
  %178 = load i64, ptr %8, align 8, !tbaa !9
  %179 = icmp slt i64 %178, 0
  br i1 %179, label %180, label %187

180:                                              ; preds = %177
  %181 = invoke i32 @puts(ptr noundef @.str.1)
          to label %182 unwind label %183

182:                                              ; preds = %180
  br label %191

183:                                              ; preds = %187, %180
  %184 = landingpad { ptr, i32 }
          cleanup
  %185 = extractvalue { ptr, i32 } %184, 0
  store ptr %185, ptr %6, align 8
  %186 = extractvalue { ptr, i32 } %184, 1
  store i32 %186, ptr %7, align 4
  br label %193

187:                                              ; preds = %177
  %188 = load i64, ptr %10, align 8, !tbaa !9
  %189 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.2, i64 noundef %188)
          to label %190 unwind label %183

190:                                              ; preds = %187
  br label %191

191:                                              ; preds = %190, %182
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %192 = load i32, ptr %1, align 4
  ret i32 %192

193:                                              ; preds = %183, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  br label %194

194:                                              ; preds = %193, %28
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %195

195:                                              ; preds = %194
  %196 = load ptr, ptr %6, align 8
  %197 = load i32, ptr %7, align 4
  %198 = insertvalue { ptr, i32 } poison, ptr %196, 0
  %199 = insertvalue { ptr, i32 } %198, i32 %197, 1
  resume { ptr, i32 } %199
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) #3 align 2

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

declare i32 @puts(ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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 = { 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 = { 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 #5 = { nounwind }

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

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


; 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::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #5
  %4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  %5 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %6 unwind label %14

6:                                                ; preds = %0
  %7 = load i64, ptr %1, align 8, !tbaa !5
  %8 = add nsw i64 %7, -1
  store i64 %8, ptr %1, align 8, !tbaa !5
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = add nsw i64 %9, -1
  %11 = sdiv i64 %8, 2
  %12 = icmp sgt i64 %10, %11
  %13 = sub i64 %7, %9
  %spec.select = select i1 %12, i64 %13, i64 %10
  store i64 %spec.select, ptr %2, align 8, !tbaa !5
  %.not69 = icmp slt i64 %7, 0
  br i1 %.not69, label %._crit_edge, label %.lr.ph

14:                                               ; preds = %0
  %15 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  resume { ptr, i32 } %15

._crit_edge.loopexit:                             ; preds = %40
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %6
  %16 = phi i64 [ %spec.select, %6 ], [ %.pre, %._crit_edge.loopexit ]
  %.046.lcssa68 = phi i64 [ -1, %6 ], [ %.248, %._crit_edge.loopexit ]
  %.044.lcssa = phi i64 [ 0, %6 ], [ %.145, %._crit_edge.loopexit ]
  %.042.lcssa = phi i64 [ 0, %6 ], [ %.143, %._crit_edge.loopexit ]
  %.not58 = icmp sgt i64 %16, %.046.lcssa68
  br i1 %.not58, label %47, label %44

.lr.ph:                                           ; preds = %6, %40
  %.04173 = phi i64 [ %41, %40 ], [ 0, %6 ]
  %.04272 = phi i64 [ %.143, %40 ], [ 0, %6 ]
  %.04471 = phi i64 [ %.145, %40 ], [ 0, %6 ]
  %.04670 = phi i64 [ %.248, %40 ], [ -1, %6 ]
  %17 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.04173)
  %18 = load i8, ptr %17, align 1, !tbaa !9
  %19 = load i64, ptr %1, align 8, !tbaa !5
  %20 = sub nsw i64 %19, %.04173
  %21 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %20)
  %22 = load i8, ptr %21, align 1, !tbaa !9
  %.not64 = icmp eq i8 %18, %22
  br i1 %.not64, label %40, label %23

23:                                               ; preds = %.lr.ph
  %24 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %.04173)
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  %27 = load i64, ptr %1, align 8, !tbaa !5
  %28 = sub nsw i64 %27, %.04173
  %29 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %3, i64 noundef %28)
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = sext i8 %30 to i32
  %32 = sub nsw i32 %26, %31
  %33 = icmp slt i32 %32, 0
  %34 = add nsw i32 %32, 26
  %spec.select65 = select i1 %33, i32 %34, i32 %32
  %35 = icmp sgt i32 %spec.select65, 13
  %36 = sub nsw i32 26, %spec.select65
  %.1 = select i1 %35, i32 %36, i32 %spec.select65
  %37 = sext i32 %.1 to i64
  %38 = add nsw i64 %.04272, %37
  %39 = icmp slt i64 %.04670, 0
  %.147 = select i1 %39, i64 %.04173, i64 %.04670
  br label %40

40:                                               ; preds = %.lr.ph, %23
  %.248 = phi i64 [ %.147, %23 ], [ %.04670, %.lr.ph ]
  %.145 = phi i64 [ %.04173, %23 ], [ %.04471, %.lr.ph ]
  %.143 = phi i64 [ %38, %23 ], [ %.04272, %.lr.ph ]
  %41 = add nuw nsw i64 %.04173, 1
  %42 = load i64, ptr %1, align 8, !tbaa !5
  %43 = sdiv i64 %42, 2
  %.not.not = icmp slt i64 %.04173, %43
  br i1 %.not.not, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !10

44:                                               ; preds = %._crit_edge
  %45 = add i64 %.042.lcssa, %.044.lcssa
  %46 = sub i64 %45, %16
  br label %59

47:                                               ; preds = %._crit_edge
  %.not59 = icmp sgt i64 %16, %.044.lcssa
  br i1 %.not59, label %.thread, label %48

48:                                               ; preds = %47
  %49 = sub nsw i64 %16, %.046.lcssa68
  %50 = sub nsw i64 %.044.lcssa, %16
  %.not60 = icmp sgt i64 %49, %50
  %51 = sub i64 %.044.lcssa, %.046.lcssa68
  %52 = add i64 %51, %.042.lcssa
  br i1 %.not60, label %55, label %53

53:                                               ; preds = %48
  %54 = add i64 %52, %49
  br label %59

55:                                               ; preds = %48
  %56 = add i64 %52, %50
  br label %59

.thread:                                          ; preds = %47
  %57 = sub i64 %.042.lcssa, %.046.lcssa68
  %58 = add i64 %57, %16
  br label %59

59:                                               ; preds = %53, %.thread, %55, %44
  %.2 = phi i64 [ %46, %44 ], [ %54, %53 ], [ %56, %55 ], [ %58, %.thread ]
  %60 = icmp slt i64 %.046.lcssa68, 0
  br i1 %60, label %61, label %63

61:                                               ; preds = %59
  %62 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %65

63:                                               ; preds = %59
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.2)
  br label %65

65:                                               ; preds = %63, %61
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZSt7getlineIcSt11char_traitsIcESaIcEERSt13basic_istreamIT_T0_ES7_RNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32), i64 noundef) local_unnamed_addr #3 align 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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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 = { 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 #3 = { 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 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !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"}


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