; LLVM IR from bqi343/cp-notebook :: Contests/USACO Training/Ch 5/5.5 twofive/Z6solve2NSt7/cxx1112basic_stringIcSt_8f7f9bfe/Z6solve2NSt7 (traitsIcESaIcEEE)

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

%struct.state = type { i32, [5 x %"struct.std::pair"], [5 x %"struct.std::pair"] }
%"struct.std::pair" = type <{ i32, i8, [3 x i8] }>

@cur = external dso_local global %struct.state, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3get5state(ptr noundef byval(%struct.state) align 8) #0

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6solve2NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %struct.state, align 4
  %12 = alloca %struct.state, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 1, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %144, %1
  %14 = load i32, ptr %4, align 4, !tbaa !9
  %15 = icmp slt i32 %14, 25
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %147

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %18 = load i32, ptr %4, align 4, !tbaa !9
  %19 = sdiv i32 %18, 5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [5 x %"struct.std::pair"], ptr getelementptr inbounds (%struct.state, ptr @cur, i32 0, i32 1), i64 0, i64 %20
  %22 = getelementptr inbounds %"struct.std::pair", ptr %21, i32 0, i32 1
  %23 = load i8, ptr %22, align 4, !tbaa !11
  %24 = sext i8 %23 to i32
  %25 = sub nsw i32 %24, 65
  store i32 %25, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %26 = load i32, ptr %4, align 4, !tbaa !9
  %27 = srem i32 %26, 5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [5 x %"struct.std::pair"], ptr getelementptr inbounds (%struct.state, ptr @cur, i32 0, i32 2), i64 0, i64 %28
  %30 = getelementptr inbounds %"struct.std::pair", ptr %29, i32 0, i32 1
  %31 = load i8, ptr %30, align 4, !tbaa !11
  %32 = sext i8 %31 to i32
  %33 = sub nsw i32 %32, 65
  store i32 %33, ptr %10, align 4, !tbaa !9
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  store i32 %36, ptr %8, align 4, !tbaa !9
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %38 = load i32, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  store i32 %38, ptr %6, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %99, %17
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = load i32, ptr %4, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %42)
  %44 = load i8, ptr %43, align 1, !tbaa !13
  %45 = sext i8 %44 to i32
  %46 = sub nsw i32 %45, 65
  %47 = icmp slt i32 %40, %46
  br i1 %47, label %49, label %48

48:                                               ; preds = %39
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %102

49:                                               ; preds = %39
  %50 = load i32, ptr @cur, align 4, !tbaa !14
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = shl i32 1, %51
  %53 = and i32 %50, %52
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %98

55:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 84, ptr %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 @cur, i64 84, i1 false), !tbaa.struct !16
  %56 = getelementptr inbounds %struct.state, ptr %11, i32 0, i32 1
  %57 = load i32, ptr %4, align 4, !tbaa !9
  %58 = sdiv i32 %57, 5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [5 x %"struct.std::pair"], ptr %56, i64 0, i64 %59
  %61 = getelementptr inbounds %"struct.std::pair", ptr %60, i32 0, i32 0
  %62 = load i32, ptr %61, align 4, !tbaa !17
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %61, align 4, !tbaa !17
  %64 = getelementptr inbounds %struct.state, ptr %11, i32 0, i32 2
  %65 = load i32, ptr %4, align 4, !tbaa !9
  %66 = srem i32 %65, 5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [5 x %"struct.std::pair"], ptr %64, i64 0, i64 %67
  %69 = getelementptr inbounds %"struct.std::pair", ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 4, !tbaa !17
  %71 = add nsw i32 %70, 1
  store i32 %71, ptr %69, align 4, !tbaa !17
  %72 = load i32, ptr %6, align 4, !tbaa !9
  %73 = add nsw i32 65, %72
  %74 = trunc i32 %73 to i8
  %75 = getelementptr inbounds %struct.state, ptr %11, i32 0, i32 1
  %76 = load i32, ptr %4, align 4, !tbaa !9
  %77 = sdiv i32 %76, 5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [5 x %"struct.std::pair"], ptr %75, i64 0, i64 %78
  %80 = getelementptr inbounds %"struct.std::pair", ptr %79, i32 0, i32 1
  store i8 %74, ptr %80, align 4, !tbaa !11
  %81 = load i32, ptr %6, align 4, !tbaa !9
  %82 = add nsw i32 65, %81
  %83 = trunc i32 %82 to i8
  %84 = getelementptr inbounds %struct.state, ptr %11, i32 0, i32 2
  %85 = load i32, ptr %4, align 4, !tbaa !9
  %86 = srem i32 %85, 5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [5 x %"struct.std::pair"], ptr %84, i64 0, i64 %87
  %89 = getelementptr inbounds %"struct.std::pair", ptr %88, i32 0, i32 1
  store i8 %83, ptr %89, align 4, !tbaa !11
  %90 = load i32, ptr %6, align 4, !tbaa !9
  %91 = shl i32 1, %90
  %92 = getelementptr inbounds %struct.state, ptr %11, i32 0, i32 0
  %93 = load i32, ptr %92, align 4, !tbaa !14
  %94 = xor i32 %93, %91
  store i32 %94, ptr %92, align 4, !tbaa !14
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %11, i64 84, i1 false), !tbaa.struct !16
  %95 = call noundef i32 @_Z3get5state(ptr noundef byval(%struct.state) align 8 %12)
  %96 = load i32, ptr %3, align 4, !tbaa !9
  %97 = add nsw i32 %96, %95
  store i32 %97, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 84, ptr %11) #5
  br label %98

98:                                               ; preds = %55, %49
  br label %99

99:                                               ; preds = %98
  %100 = load i32, ptr %6, align 4, !tbaa !9
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %6, align 4, !tbaa !9
  br label %39, !llvm.loop !18

102:                                              ; preds = %48
  %103 = load i32, ptr %4, align 4, !tbaa !9
  %104 = sdiv i32 %103, 5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [5 x %"struct.std::pair"], ptr getelementptr inbounds (%struct.state, ptr @cur, i32 0, i32 1), i64 0, i64 %105
  %107 = getelementptr inbounds %"struct.std::pair", ptr %106, i32 0, i32 0
  %108 = load i32, ptr %107, align 4, !tbaa !17
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %107, align 4, !tbaa !17
  %110 = load i32, ptr %4, align 4, !tbaa !9
  %111 = srem i32 %110, 5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [5 x %"struct.std::pair"], ptr getelementptr inbounds (%struct.state, ptr @cur, i32 0, i32 2), i64 0, i64 %112
  %114 = getelementptr inbounds %"struct.std::pair", ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 4, !tbaa !17
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %114, align 4, !tbaa !17
  %117 = load i32, ptr %4, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %118)
  %120 = load i8, ptr %119, align 1, !tbaa !13
  %121 = load i32, ptr %4, align 4, !tbaa !9
  %122 = sdiv i32 %121, 5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [5 x %"struct.std::pair"], ptr getelementptr inbounds (%struct.state, ptr @cur, i32 0, i32 1), i64 0, i64 %123
  %125 = getelementptr inbounds %"struct.std::pair", ptr %124, i32 0, i32 1
  store i8 %120, ptr %125, align 4, !tbaa !11
  %126 = load i32, ptr %4, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %127)
  %129 = load i8, ptr %128, align 1, !tbaa !13
  %130 = load i32, ptr %4, align 4, !tbaa !9
  %131 = srem i32 %130, 5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [5 x %"struct.std::pair"], ptr getelementptr inbounds (%struct.state, ptr @cur, i32 0, i32 2), i64 0, i64 %132
  %134 = getelementptr inbounds %"struct.std::pair", ptr %133, i32 0, i32 1
  store i8 %129, ptr %134, align 4, !tbaa !11
  %135 = load i32, ptr %4, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %136)
  %138 = load i8, ptr %137, align 1, !tbaa !13
  %139 = sext i8 %138 to i32
  %140 = sub nsw i32 %139, 65
  %141 = shl i32 1, %140
  %142 = load i32, ptr @cur, align 4, !tbaa !14
  %143 = xor i32 %142, %141
  store i32 %143, ptr @cur, align 4, !tbaa !14
  br label %144

144:                                              ; preds = %102
  %145 = load i32, ptr %4, align 4, !tbaa !9
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %4, align 4, !tbaa !9
  br label %13, !llvm.loop !20

147:                                              ; preds = %16
  %148 = load i32, ptr %3, align 4, !tbaa !9
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret i32 %148
}

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 4}
!12 = !{!"_ZTSSt4pairIicE", !10, i64 0, !7, i64 4}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !10, i64 0}
!15 = !{!"_ZTS5state", !10, i64 0, !7, i64 4, !7, i64 44}
!16 = !{i64 0, i64 4, !9, i64 4, i64 40, !13, i64 44, i64 40, !13}
!17 = !{!12, !10, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}


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

%struct.state = type { i32, [5 x %"struct.std::pair"], [5 x %"struct.std::pair"] }
%"struct.std::pair" = type <{ i32, i8, [3 x i8] }>

@cur = external dso_local local_unnamed_addr global %struct.state, align 4

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z3get5state(ptr noundef byval(%struct.state) align 8) 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress 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) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z6solve2NSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %struct.state, align 8
  %7 = getelementptr inbounds i8, ptr %6, i64 4
  %8 = getelementptr inbounds i8, ptr %6, i64 44
  br label %10

9:                                                ; preds = %._crit_edge
  ret i32 %.1.lcssa

10:                                               ; preds = %1, %._crit_edge
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %._crit_edge ]
  %.02531 = phi i32 [ 1, %1 ], [ %.1.lcssa, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  %.lhs.trunc = trunc i64 %indvars.iv to i8
  %11 = udiv i8 %.lhs.trunc, 5
  %12 = zext nneg i8 %11 to i64
  %13 = getelementptr inbounds [5 x %"struct.std::pair"], ptr getelementptr inbounds (i8, ptr @cur, i64 4), i64 0, i64 %12
  %14 = getelementptr inbounds i8, ptr %13, i64 4
  %15 = load i8, ptr %14, align 4, !tbaa !9
  %16 = sext i8 %15 to i32
  %17 = add nsw i32 %16, -65
  store i32 %17, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %18 = urem i8 %.lhs.trunc, 5
  %19 = zext nneg i8 %18 to i64
  %20 = getelementptr inbounds [5 x %"struct.std::pair"], ptr getelementptr inbounds (i8, ptr @cur, i64 44), i64 0, i64 %19
  %21 = getelementptr inbounds i8, ptr %20, i64 4
  %22 = load i8, ptr %21, align 4, !tbaa !9
  %23 = sext i8 %22 to i32
  %24 = add nsw i32 %23, -65
  store i32 %24, ptr %5, align 4, !tbaa !5
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %3, align 4, !tbaa !5
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %29 = load i32, ptr %28, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = sext i8 %31 to i32
  %33 = add nsw i32 %32, -65
  %34 = icmp slt i32 %29, %33
  br i1 %34, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %10
  %35 = getelementptr inbounds [5 x %"struct.std::pair"], ptr %7, i64 0, i64 %12
  %36 = getelementptr inbounds [5 x %"struct.std::pair"], ptr %8, i64 0, i64 %19
  %37 = getelementptr inbounds i8, ptr %35, i64 4
  %38 = getelementptr inbounds i8, ptr %36, i64 4
  br label %54

._crit_edge:                                      ; preds = %69, %10
  %.1.lcssa = phi i32 [ %.02531, %10 ], [ %.2, %69 ]
  %39 = load i32, ptr %13, align 4, !tbaa !12
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %13, align 4, !tbaa !12
  %41 = load i32, ptr %20, align 4, !tbaa !12
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %20, align 4, !tbaa !12
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %44 = load i8, ptr %43, align 1, !tbaa !11
  store i8 %44, ptr %14, align 4, !tbaa !9
  %45 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %46 = load i8, ptr %45, align 1, !tbaa !11
  store i8 %46, ptr %21, align 4, !tbaa !9
  %47 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %48 = load i8, ptr %47, align 1, !tbaa !11
  %49 = sext i8 %48 to i32
  %50 = add nsw i32 %49, -65
  %51 = shl nuw i32 1, %50
  %52 = load i32, ptr @cur, align 4, !tbaa !13
  %53 = xor i32 %51, %52
  store i32 %53, ptr @cur, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 25
  br i1 %exitcond.not, label %9, label %10, !llvm.loop !15

54:                                               ; preds = %.lr.ph, %69
  %.029 = phi i32 [ %29, %.lr.ph ], [ %70, %69 ]
  %.128 = phi i32 [ %.02531, %.lr.ph ], [ %.2, %69 ]
  %55 = load i32, ptr @cur, align 4, !tbaa !13
  %56 = shl nuw i32 1, %.029
  %57 = and i32 %55, %56
  %.not = icmp eq i32 %57, 0
  br i1 %.not, label %69, label %58

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 84, ptr nonnull %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(84) %6, ptr noundef nonnull align 4 dereferenceable(84) @cur, i64 84, i1 false), !tbaa.struct !17
  %59 = load i32, ptr %35, align 4, !tbaa !12
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %35, align 4, !tbaa !12
  %61 = load i32, ptr %36, align 4, !tbaa !12
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %36, align 4, !tbaa !12
  %63 = trunc i32 %.029 to i8
  %64 = add i8 %63, 65
  store i8 %64, ptr %37, align 8, !tbaa !9
  store i8 %64, ptr %38, align 8, !tbaa !9
  %65 = load i32, ptr %6, align 8, !tbaa !13
  %66 = xor i32 %65, %56
  store i32 %66, ptr %6, align 8, !tbaa !13
  %67 = call noundef i32 @_Z3get5state(ptr noundef nonnull byval(%struct.state) align 8 %6)
  %68 = add nsw i32 %67, %.128
  call void @llvm.lifetime.end.p0(i64 84, ptr nonnull %6) #5
  br label %69

69:                                               ; preds = %54, %58
  %.2 = phi i32 [ %68, %58 ], [ %.128, %54 ]
  %70 = add nsw i32 %.029, 1
  %71 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %indvars.iv)
  %72 = load i8, ptr %71, align 1, !tbaa !11
  %73 = sext i8 %72 to i32
  %74 = add nsw i32 %73, -65
  %75 = icmp slt i32 %70, %74
  br i1 %75, label %54, label %._crit_edge, !llvm.loop !18
}

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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, !7, i64 4}
!10 = !{!"_ZTSSt4pairIicE", !6, i64 0, !7, i64 4}
!11 = !{!7, !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!14, !6, i64 0}
!14 = !{!"_ZTS5state", !6, i64 0, !7, i64 4, !7, i64 44}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{i64 0, i64 4, !5, i64 4, i64 40, !11, i64 44, i64 40, !11}
!18 = distinct !{!18, !16}


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