; LLVM IR from rweather/lightweight-crypto :: src/genavr/code.ll (ZN4Code9rol_bytesERK3Regj)

; 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.Reg = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3RegC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE9push_backEOh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code19allocateOptionalRegEj(ptr dead_on_unwind noalias writable sret(%class.Reg) align 8, ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code10releaseRegERK3Reg(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200), i32 noundef, i8 noundef zeroext, i8 noundef zeroext) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Code7hasFlagENS_4FlagE(ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200), i32 noundef, i8 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN4Code7tempregEv(ptr noundef nonnull align 8 dereferenceable(200)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Code12have_tempregEv(ptr noundef nonnull align 8 dereferenceable(200)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Code9rol_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %class.Reg, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %class.Reg, align 8
  %19 = alloca i8, align 1
  %20 = alloca %class.Reg, align 8
  %21 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %22 = load ptr, ptr %4, align 8
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %23)
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %3
  br label %287

27:                                               ; preds = %3
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %28)
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = urem i32 %30, %29
  store i32 %31, ptr %6, align 4, !tbaa !9
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %35

34:                                               ; preds = %27
  br label %287

35:                                               ; preds = %27
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %37)
  %39 = sdiv i32 %38, 2
  %40 = icmp ugt i32 %36, %39
  br i1 %40, label %41, label %47

41:                                               ; preds = %35
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43)
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = sub i32 %44, %45
  call void @_ZN4Code9ror_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %22, ptr noundef nonnull align 8 dereferenceable(24) %42, i32 noundef %46)
  br label %286

47:                                               ; preds = %35
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %48)
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = urem i32 %49, %50
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %145

53:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54)
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = udiv i32 %55, %56
  store i32 %57, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  %58 = call noundef zeroext i1 @_ZN4Code12have_tempregEv(ptr noundef nonnull align 8 dereferenceable(200) %22)
  br i1 %58, label %59, label %62

59:                                               ; preds = %53
  %60 = call noundef zeroext i8 @_ZN4Code7tempregEv(ptr noundef nonnull align 8 dereferenceable(200) %22)
  %61 = zext i8 %60 to i32
  br label %63

62:                                               ; preds = %53
  br label %63

63:                                               ; preds = %62, %59
  %64 = phi i32 [ %61, %59 ], [ 255, %62 ]
  %65 = trunc i32 %64 to i8
  store i8 %65, ptr %10, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %141, %63
  %67 = load i32, ptr %11, align 4, !tbaa !9
  %68 = load i32, ptr %6, align 4, !tbaa !9
  %69 = icmp slt i32 %67, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %66
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  br label %144

71:                                               ; preds = %66
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = load i32, ptr %7, align 4, !tbaa !9
  %74 = sub nsw i32 %73, 1
  %75 = load i32, ptr %6, align 4, !tbaa !9
  %76 = mul i32 %74, %75
  %77 = add i32 %72, %76
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %78)
  %80 = urem i32 %77, %79
  store i32 %80, ptr %8, align 4, !tbaa !9
  %81 = load i8, ptr %10, align 1, !tbaa !11
  %82 = zext i8 %81 to i32
  %83 = icmp ne i32 %82, 255
  br i1 %83, label %84, label %89

84:                                               ; preds = %71
  %85 = load i8, ptr %10, align 1, !tbaa !11
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = load i32, ptr %8, align 4, !tbaa !9
  %88 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %86, i32 noundef %87)
  call void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 34, i8 noundef zeroext %85, i8 noundef zeroext %88)
  br label %93

89:                                               ; preds = %71
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %90, i32 noundef %91)
  call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 41, i8 noundef zeroext %92)
  br label %93

93:                                               ; preds = %89, %84
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %94 = load i32, ptr %7, align 4, !tbaa !9
  %95 = sub nsw i32 %94, 2
  store i32 %95, ptr %13, align 4, !tbaa !9
  br label %96

96:                                               ; preds = %124, %93
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = icmp sge i32 %97, 0
  br i1 %98, label %100, label %99

99:                                               ; preds = %96
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  br label %127

100:                                              ; preds = %96
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = load i32, ptr %13, align 4, !tbaa !9
  %103 = load i32, ptr %6, align 4, !tbaa !9
  %104 = mul i32 %102, %103
  %105 = add i32 %101, %104
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %106)
  %108 = urem i32 %105, %107
  store i32 %108, ptr %8, align 4, !tbaa !9
  %109 = load i32, ptr %11, align 4, !tbaa !9
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  %112 = load i32, ptr %6, align 4, !tbaa !9
  %113 = mul i32 %111, %112
  %114 = add i32 %109, %113
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %115)
  %117 = urem i32 %114, %116
  store i32 %117, ptr %9, align 4, !tbaa !9
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = load i32, ptr %9, align 4, !tbaa !9
  %120 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %118, i32 noundef %119)
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = load i32, ptr %8, align 4, !tbaa !9
  %123 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %121, i32 noundef %122)
  call void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 34, i8 noundef zeroext %120, i8 noundef zeroext %123)
  br label %124

124:                                              ; preds = %100
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = add nsw i32 %125, -1
  store i32 %126, ptr %13, align 4, !tbaa !9
  br label %96, !llvm.loop !12

127:                                              ; preds = %99
  %128 = load i8, ptr %10, align 1, !tbaa !11
  %129 = zext i8 %128 to i32
  %130 = icmp ne i32 %129, 255
  br i1 %130, label %131, label %136

131:                                              ; preds = %127
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = load i32, ptr %11, align 4, !tbaa !9
  %134 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %132, i32 noundef %133)
  %135 = load i8, ptr %10, align 1, !tbaa !11
  call void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 34, i8 noundef zeroext %134, i8 noundef zeroext %135)
  br label %140

136:                                              ; preds = %127
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = load i32, ptr %11, align 4, !tbaa !9
  %139 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %137, i32 noundef %138)
  call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 40, i8 noundef zeroext %139)
  br label %140

140:                                              ; preds = %136, %131
  br label %141

141:                                              ; preds = %140
  %142 = load i32, ptr %11, align 4, !tbaa !9
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %11, align 4, !tbaa !9
  br label %66, !llvm.loop !14

144:                                              ; preds = %70
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %285

145:                                              ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #3
  call void @_ZN3RegC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15)
  %146 = invoke noundef zeroext i1 @_ZNK4Code7hasFlagENS_4FlagE(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 64)
          to label %147 unwind label %156

147:                                              ; preds = %145
  br i1 %146, label %173, label %148

148:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 24, ptr %18) #3
  %149 = load i32, ptr %6, align 4, !tbaa !9
  %150 = sub i32 %149, 1
  invoke void @_ZN4Code19allocateOptionalRegEj(ptr dead_on_unwind writable sret(%class.Reg) align 8 %18, ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef %150)
          to label %151 unwind label %160

151:                                              ; preds = %148
  %152 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %18)
          to label %153 unwind label %164

153:                                              ; preds = %151
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #3
  %154 = getelementptr inbounds %class.Reg, ptr %15, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #3
  store i8 0, ptr %19, align 1, !tbaa !11
  invoke void @_ZNSt6vectorIhSaIhEE9push_backEOh(ptr noundef nonnull align 8 dereferenceable(24) %154, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %155 unwind label %169

155:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #3
  br label %187

156:                                              ; preds = %282, %276, %272, %270, %267, %263, %258, %247, %243, %237, %227, %145
  %157 = landingpad { ptr, i32 }
          cleanup
  %158 = extractvalue { ptr, i32 } %157, 0
  store ptr %158, ptr %16, align 8
  %159 = extractvalue { ptr, i32 } %157, 1
  store i32 %159, ptr %17, align 4
  br label %284

160:                                              ; preds = %148
  %161 = landingpad { ptr, i32 }
          cleanup
  %162 = extractvalue { ptr, i32 } %161, 0
  store ptr %162, ptr %16, align 8
  %163 = extractvalue { ptr, i32 } %161, 1
  store i32 %163, ptr %17, align 4
  br label %168

164:                                              ; preds = %151
  %165 = landingpad { ptr, i32 }
          cleanup
  %166 = extractvalue { ptr, i32 } %165, 0
  store ptr %166, ptr %16, align 8
  %167 = extractvalue { ptr, i32 } %165, 1
  store i32 %167, ptr %17, align 4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %18) #3
  br label %168

168:                                              ; preds = %164, %160
  call void @llvm.lifetime.end.p0(i64 24, ptr %18) #3
  br label %284

169:                                              ; preds = %153
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %16, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #3
  br label %284

173:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #3
  %174 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @_ZN4Code19allocateOptionalRegEj(ptr dead_on_unwind writable sret(%class.Reg) align 8 %20, ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef %174)
          to label %175 unwind label %178

175:                                              ; preds = %173
  %176 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %177 unwind label %182

177:                                              ; preds = %175
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #3
  br label %187

178:                                              ; preds = %173
  %179 = landingpad { ptr, i32 }
          cleanup
  %180 = extractvalue { ptr, i32 } %179, 0
  store ptr %180, ptr %16, align 8
  %181 = extractvalue { ptr, i32 } %179, 1
  store i32 %181, ptr %17, align 4
  br label %186

182:                                              ; preds = %175
  %183 = landingpad { ptr, i32 }
          cleanup
  %184 = extractvalue { ptr, i32 } %183, 0
  store ptr %184, ptr %16, align 8
  %185 = extractvalue { ptr, i32 } %183, 1
  store i32 %185, ptr %17, align 4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #3
  br label %186

186:                                              ; preds = %182, %178
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #3
  br label %284

187:                                              ; preds = %177, %155
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %224, %187
  %189 = load i32, ptr %14, align 4, !tbaa !9
  %190 = load i32, ptr %6, align 4, !tbaa !9
  %191 = icmp slt i32 %189, %190
  br i1 %191, label %192, label %227

192:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  %193 = load ptr, ptr %5, align 8, !tbaa !5
  %194 = invoke noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %193)
          to label %195 unwind label %213

195:                                              ; preds = %192
  %196 = load i32, ptr %6, align 4, !tbaa !9
  %197 = sub i32 %194, %196
  %198 = load i32, ptr %14, align 4, !tbaa !9
  %199 = add i32 %197, %198
  store i32 %199, ptr %21, align 4, !tbaa !9
  %200 = load i32, ptr %14, align 4, !tbaa !9
  %201 = invoke noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %202 unwind label %213

202:                                              ; preds = %195
  %203 = icmp slt i32 %200, %201
  br i1 %203, label %204, label %217

204:                                              ; preds = %202
  %205 = load i32, ptr %14, align 4, !tbaa !9
  %206 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %205)
          to label %207 unwind label %213

207:                                              ; preds = %204
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = load i32, ptr %21, align 4, !tbaa !9
  %210 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %208, i32 noundef %209)
          to label %211 unwind label %213

211:                                              ; preds = %207
  invoke void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 34, i8 noundef zeroext %206, i8 noundef zeroext %210)
          to label %212 unwind label %213

212:                                              ; preds = %211
  br label %223

213:                                              ; preds = %221, %217, %211, %207, %204, %195, %192
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %16, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  br label %284

217:                                              ; preds = %202
  %218 = load ptr, ptr %5, align 8, !tbaa !5
  %219 = load i32, ptr %21, align 4, !tbaa !9
  %220 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %218, i32 noundef %219)
          to label %221 unwind label %213

221:                                              ; preds = %217
  invoke void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 41, i8 noundef zeroext %220)
          to label %222 unwind label %213

222:                                              ; preds = %221
  br label %223

223:                                              ; preds = %222, %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  br label %224

224:                                              ; preds = %223
  %225 = load i32, ptr %14, align 4, !tbaa !9
  %226 = add nsw i32 %225, 1
  store i32 %226, ptr %14, align 4, !tbaa !9
  br label %188, !llvm.loop !15

227:                                              ; preds = %188
  %228 = load ptr, ptr %5, align 8, !tbaa !5
  %229 = invoke noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %228)
          to label %230 unwind label %156

230:                                              ; preds = %227
  %231 = load i32, ptr %6, align 4, !tbaa !9
  %232 = sub i32 %229, %231
  %233 = sub i32 %232, 1
  store i32 %233, ptr %14, align 4, !tbaa !9
  br label %234

234:                                              ; preds = %249, %230
  %235 = load i32, ptr %14, align 4, !tbaa !9
  %236 = icmp sge i32 %235, 0
  br i1 %236, label %237, label %252

237:                                              ; preds = %234
  %238 = load ptr, ptr %5, align 8, !tbaa !5
  %239 = load i32, ptr %14, align 4, !tbaa !9
  %240 = load i32, ptr %6, align 4, !tbaa !9
  %241 = add i32 %239, %240
  %242 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %238, i32 noundef %241)
          to label %243 unwind label %156

243:                                              ; preds = %237
  %244 = load ptr, ptr %5, align 8, !tbaa !5
  %245 = load i32, ptr %14, align 4, !tbaa !9
  %246 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %244, i32 noundef %245)
          to label %247 unwind label %156

247:                                              ; preds = %243
  invoke void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 34, i8 noundef zeroext %242, i8 noundef zeroext %246)
          to label %248 unwind label %156

248:                                              ; preds = %247
  br label %249

249:                                              ; preds = %248
  %250 = load i32, ptr %14, align 4, !tbaa !9
  %251 = add nsw i32 %250, -1
  store i32 %251, ptr %14, align 4, !tbaa !9
  br label %234, !llvm.loop !16

252:                                              ; preds = %234
  %253 = load i32, ptr %6, align 4, !tbaa !9
  %254 = sub i32 %253, 1
  store i32 %254, ptr %14, align 4, !tbaa !9
  br label %255

255:                                              ; preds = %279, %252
  %256 = load i32, ptr %14, align 4, !tbaa !9
  %257 = icmp sge i32 %256, 0
  br i1 %257, label %258, label %282

258:                                              ; preds = %255
  %259 = load i32, ptr %14, align 4, !tbaa !9
  %260 = invoke noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %261 unwind label %156

261:                                              ; preds = %258
  %262 = icmp slt i32 %259, %260
  br i1 %262, label %263, label %272

263:                                              ; preds = %261
  %264 = load ptr, ptr %5, align 8, !tbaa !5
  %265 = load i32, ptr %14, align 4, !tbaa !9
  %266 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %264, i32 noundef %265)
          to label %267 unwind label %156

267:                                              ; preds = %263
  %268 = load i32, ptr %14, align 4, !tbaa !9
  %269 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %268)
          to label %270 unwind label %156

270:                                              ; preds = %267
  invoke void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 34, i8 noundef zeroext %266, i8 noundef zeroext %269)
          to label %271 unwind label %156

271:                                              ; preds = %270
  br label %278

272:                                              ; preds = %261
  %273 = load ptr, ptr %5, align 8, !tbaa !5
  %274 = load i32, ptr %14, align 4, !tbaa !9
  %275 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %273, i32 noundef %274)
          to label %276 unwind label %156

276:                                              ; preds = %272
  invoke void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %22, i32 noundef 40, i8 noundef zeroext %275)
          to label %277 unwind label %156

277:                                              ; preds = %276
  br label %278

278:                                              ; preds = %277, %271
  br label %279

279:                                              ; preds = %278
  %280 = load i32, ptr %14, align 4, !tbaa !9
  %281 = add nsw i32 %280, -1
  store i32 %281, ptr %14, align 4, !tbaa !9
  br label %255, !llvm.loop !17

282:                                              ; preds = %255
  invoke void @_ZN4Code10releaseRegERK3Reg(ptr noundef nonnull align 8 dereferenceable(200) %22, ptr noundef nonnull align 8 dereferenceable(24) %15)
          to label %283 unwind label %156

283:                                              ; preds = %282
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %285

284:                                              ; preds = %213, %186, %169, %168, %156
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  br label %288

285:                                              ; preds = %283, %144
  br label %286

286:                                              ; preds = %285, %41
  br label %287

287:                                              ; preds = %286, %34, %26
  ret void

288:                                              ; preds = %284
  %289 = load ptr, ptr %16, align 8
  %290 = load i32, ptr %17, align 4
  %291 = insertvalue { ptr, i32 } poison, ptr %289, 0
  %292 = insertvalue { ptr, i32 } %291, i32 %290, 1
  resume { ptr, i32 } %292
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code9ror_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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


; 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.Reg = type { %"class.std::vector" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3RegC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; 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 nounwind uwtable
declare dso_local void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE9push_backEOh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code19allocateOptionalRegEj(ptr dead_on_unwind noalias writable sret(%class.Reg) align 8, ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code10releaseRegERK3Reg(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200), i32 noundef, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK4Code7hasFlagENS_4FlagE(ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200), i32 noundef, i8 noundef zeroext) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN4Code7tempregEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN4Code12have_tempregEv(ptr noundef nonnull align 8 dereferenceable(200)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Code9rol_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %class.Reg, align 8
  %5 = alloca %class.Reg, align 8
  %6 = alloca i8, align 1
  %7 = alloca %class.Reg, align 8
  %8 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %.loopexit, label %10

10:                                               ; preds = %3
  %11 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %12 = urem i32 %2, %11
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %10
  %15 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %16 = sdiv i32 %15, 2
  %17 = icmp ugt i32 %12, %16
  %18 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  br i1 %17, label %19, label %21

19:                                               ; preds = %14
  %20 = sub i32 %18, %12
  tail call void @_ZN4Code9ror_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %20)
  br label %.loopexit

21:                                               ; preds = %14
  %22 = urem i32 %18, %12
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %63

24:                                               ; preds = %21
  %25 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %26 = udiv i32 %25, %12
  %27 = tail call noundef zeroext i1 @_ZN4Code12have_tempregEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  br i1 %27, label %28, label %30

28:                                               ; preds = %24
  %29 = tail call noundef zeroext i8 @_ZN4Code7tempregEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  br label %30

30:                                               ; preds = %24, %28
  %31 = phi i8 [ %29, %28 ], [ -1, %24 ]
  %32 = icmp sgt i32 %12, 0
  br i1 %32, label %.lr.ph113, label %.loopexit

.lr.ph113:                                        ; preds = %30
  %33 = add nsw i32 %26, -1
  %34 = mul i32 %33, %12
  %.not = icmp eq i8 %31, -1
  %35 = add nsw i32 %26, -2
  %36 = icmp sgt i32 %26, 1
  br label %37

37:                                               ; preds = %.lr.ph113, %60
  %.088111 = phi i32 [ 0, %.lr.ph113 ], [ %61, %60 ]
  %38 = add i32 %.088111, %34
  %39 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %40 = urem i32 %38, %39
  %41 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %40)
  br i1 %.not, label %43, label %42

42:                                               ; preds = %37
  tail call void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 34, i8 noundef zeroext %31, i8 noundef zeroext %41)
  br label %44

43:                                               ; preds = %37
  tail call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 41, i8 noundef zeroext %41)
  br label %44

44:                                               ; preds = %43, %42
  br i1 %36, label %.lr.ph109, label %._crit_edge110

._crit_edge110:                                   ; preds = %.lr.ph109, %44
  %45 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.088111)
  br i1 %.not, label %59, label %58

.lr.ph109:                                        ; preds = %44, %.lr.ph109
  %.087107 = phi i32 [ %57, %.lr.ph109 ], [ %35, %44 ]
  %46 = mul i32 %.087107, %12
  %47 = add i32 %46, %.088111
  %48 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %49 = urem i32 %47, %48
  %50 = add nuw nsw i32 %.087107, 1
  %51 = mul i32 %50, %12
  %52 = add i32 %51, %.088111
  %53 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %54 = urem i32 %52, %53
  %55 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %54)
  %56 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %49)
  tail call void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 34, i8 noundef zeroext %55, i8 noundef zeroext %56)
  %57 = add nsw i32 %.087107, -1
  %.not114 = icmp eq i32 %.087107, 0
  br i1 %.not114, label %._crit_edge110, label %.lr.ph109, !llvm.loop !5

58:                                               ; preds = %._crit_edge110
  tail call void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 34, i8 noundef zeroext %45, i8 noundef zeroext %31)
  br label %60

59:                                               ; preds = %._crit_edge110
  tail call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 40, i8 noundef zeroext %45)
  br label %60

60:                                               ; preds = %58, %59
  %61 = add nuw nsw i32 %.088111, 1
  %62 = icmp slt i32 %61, %12
  br i1 %62, label %37, label %.loopexit, !llvm.loop !7

63:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #3
  call void @_ZN3RegC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %64 = call noundef zeroext i1 @_ZNK4Code7hasFlagENS_4FlagE(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 64)
  br i1 %64, label %78, label %65

65:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  %66 = add i32 %12, -1
  invoke void @_ZN4Code19allocateOptionalRegEj(ptr dead_on_unwind nonnull writable sret(%class.Reg) align 8 %5, ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef %66)
          to label %67 unwind label %71

67:                                               ; preds = %65
  %68 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %5)
          to label %69 unwind label %73

69:                                               ; preds = %67
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #3
  store i8 0, ptr %6, align 1, !tbaa !8
  invoke void @_ZNSt6vectorIhSaIhEE9push_backEOh(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 1 dereferenceable(1) %6)
          to label %70 unwind label %76

70:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #3
  br label %87

.loopexit95:                                      ; preds = %122, %124, %126, %127, %129
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %116, %114, %.lr.ph102
  %lpad.loopexit96 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %._crit_edge106
  %lpad.loopexit.split-lp97 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

71:                                               ; preds = %65
  %72 = landingpad { ptr, i32 }
          cleanup
  br label %75

73:                                               ; preds = %67
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #3
  br label %75

75:                                               ; preds = %73, %71
  %.pn = phi { ptr, i32 } [ %74, %73 ], [ %72, %71 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #3
  br label %.loopexit.split-lp

76:                                               ; preds = %69
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #3
  br label %.loopexit.split-lp

78:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #3
  invoke void @_ZN4Code19allocateOptionalRegEj(ptr dead_on_unwind nonnull writable sret(%class.Reg) align 8 %7, ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef %12)
          to label %79 unwind label %82

79:                                               ; preds = %78
  %80 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(24) %7)
          to label %81 unwind label %84

81:                                               ; preds = %79
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #3
  br label %87

82:                                               ; preds = %78
  %83 = landingpad { ptr, i32 }
          cleanup
  br label %86

84:                                               ; preds = %79
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  br label %86

86:                                               ; preds = %84, %82
  %.pn91 = phi { ptr, i32 } [ %85, %84 ], [ %83, %82 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #3
  br label %.loopexit.split-lp

87:                                               ; preds = %81, %70
  %88 = icmp sgt i32 %12, 0
  br i1 %88, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %87, %104
  %.08499 = phi i32 [ %105, %104 ], [ 0, %87 ]
  %89 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %90 = sub i32 %89, %12
  %91 = add i32 %90, %.08499
  %92 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %93 = icmp slt i32 %.08499, %92
  br i1 %93, label %94, label %101

94:                                               ; preds = %.lr.ph
  %95 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %.08499)
          to label %96 unwind label %99

96:                                               ; preds = %94
  %97 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %91)
          to label %98 unwind label %99

98:                                               ; preds = %96
  invoke void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 34, i8 noundef zeroext %95, i8 noundef zeroext %97)
          to label %104 unwind label %99

99:                                               ; preds = %103, %101, %98, %96, %94
  %100 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

101:                                              ; preds = %.lr.ph
  %102 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %91)
          to label %103 unwind label %99

103:                                              ; preds = %101
  invoke void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 41, i8 noundef zeroext %102)
          to label %104 unwind label %99

104:                                              ; preds = %103, %98
  %105 = add nuw nsw i32 %.08499, 1
  %106 = icmp slt i32 %105, %12
  br i1 %106, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %104, %87
  %107 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %108 = xor i32 %12, -1
  %109 = add i32 %107, %108
  %110 = icmp sgt i32 %109, -1
  br i1 %110, label %.lr.ph102, label %.preheader

.preheader:                                       ; preds = %117, %._crit_edge
  %.286103 = add i32 %12, -1
  %111 = icmp sgt i32 %.286103, -1
  br i1 %111, label %.lr.ph105, label %._crit_edge106

.lr.ph102:                                        ; preds = %._crit_edge, %117
  %.185100 = phi i32 [ %118, %117 ], [ %109, %._crit_edge ]
  %112 = add i32 %.185100, %12
  %113 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %112)
          to label %114 unwind label %.loopexit.split-lp.loopexit

114:                                              ; preds = %.lr.ph102
  %115 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.185100)
          to label %116 unwind label %.loopexit.split-lp.loopexit

116:                                              ; preds = %114
  invoke void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 34, i8 noundef zeroext %113, i8 noundef zeroext %115)
          to label %117 unwind label %.loopexit.split-lp.loopexit

117:                                              ; preds = %116
  %118 = add nsw i32 %.185100, -1
  %119 = icmp sgt i32 %.185100, 0
  br i1 %119, label %.lr.ph102, label %.preheader, !llvm.loop !12

.lr.ph105:                                        ; preds = %.preheader, %130
  %.286104 = phi i32 [ %.286, %130 ], [ %.286103, %.preheader ]
  %120 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %121 = icmp slt i32 %.286104, %120
  br i1 %121, label %122, label %127

122:                                              ; preds = %.lr.ph105
  %123 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.286104)
          to label %124 unwind label %.loopexit95

124:                                              ; preds = %122
  %125 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %4, i32 noundef %.286104)
          to label %126 unwind label %.loopexit95

126:                                              ; preds = %124
  invoke void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 34, i8 noundef zeroext %123, i8 noundef zeroext %125)
          to label %130 unwind label %.loopexit95

127:                                              ; preds = %.lr.ph105
  %128 = invoke noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.286104)
          to label %129 unwind label %.loopexit95

129:                                              ; preds = %127
  invoke void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 40, i8 noundef zeroext %128)
          to label %130 unwind label %.loopexit95

130:                                              ; preds = %126, %129
  %.286 = add nsw i32 %.286104, -1
  %131 = icmp sgt i32 %.286104, 0
  br i1 %131, label %.lr.ph105, label %._crit_edge106, !llvm.loop !13

._crit_edge106:                                   ; preds = %130, %.preheader
  invoke void @_ZN4Code10releaseRegERK3Reg(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %132 unwind label %.loopexit.split-lp.loopexit.split-lp

132:                                              ; preds = %._crit_edge106
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  br label %.loopexit

.loopexit.split-lp:                               ; preds = %.loopexit95, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %99, %86, %76, %75
  %.pn93 = phi { ptr, i32 } [ %100, %99 ], [ %.pn91, %86 ], [ %77, %76 ], [ %.pn, %75 ], [ %lpad.loopexit, %.loopexit95 ], [ %lpad.loopexit96, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp97, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #3
  resume { ptr, i32 } %.pn93

.loopexit:                                        ; preds = %60, %30, %19, %132, %10, %3
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Code9ror_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
!13 = distinct !{!13, !6}


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