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

; 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 uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

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

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

; 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 noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #1 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) #1 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Code3lsrERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2) #1 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 i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca %class.Reg, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca %class.Reg, align 8
  %15 = alloca %class.Reg, align 8
  %16 = alloca %class.Reg, align 8
  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
  %17 = load ptr, ptr %4, align 8
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %24, label %20

20:                                               ; preds = %3
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21)
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %20, %3
  br label %191

25:                                               ; preds = %20
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = icmp eq i32 %26, 1
  br i1 %27, label %28, label %55

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29)
  %31 = sub nsw i32 %30, 1
  store i32 %31, ptr %7, align 4, !tbaa !9
  br label %32

32:                                               ; preds = %51, %28
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = icmp sge i32 %33, 0
  br i1 %34, label %36, label %35

35:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %54

36:                                               ; preds = %32
  %37 = load i32, ptr %7, align 4, !tbaa !9
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %38)
  %40 = sub nsw i32 %39, 1
  %41 = icmp eq i32 %37, %40
  br i1 %41, label %42, label %46

42:                                               ; preds = %36
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = load i32, ptr %7, align 4, !tbaa !9
  %45 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %43, i32 noundef %44)
  call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %17, i32 noundef 33, i8 noundef zeroext %45)
  br label %50

46:                                               ; preds = %36
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %47, i32 noundef %48)
  call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %17, i32 noundef 47, i8 noundef zeroext %49)
  br label %50

50:                                               ; preds = %46, %42
  br label %51

51:                                               ; preds = %50
  %52 = load i32, ptr %7, align 4, !tbaa !9
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %7, align 4, !tbaa !9
  br label %32, !llvm.loop !11

54:                                               ; preds = %35
  br label %190

55:                                               ; preds = %25
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = urem i32 %56, 8
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %63

59:                                               ; preds = %55
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = udiv i32 %61, 8
  call void @_ZN4Code9lsr_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %17, ptr noundef nonnull align 8 dereferenceable(24) %60, i32 noundef %62)
  br label %189

63:                                               ; preds = %55
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = icmp eq i32 %64, 4
  br i1 %65, label %66, label %86

66:                                               ; preds = %63
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %67)
  %69 = icmp eq i32 %68, 1
  br i1 %69, label %70, label %86

70:                                               ; preds = %66
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %71, i32 noundef 0)
  call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %17, i32 noundef 56, i8 noundef zeroext %72)
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %73, i32 noundef 0)
  %75 = zext i8 %74 to i32
  %76 = icmp sge i32 %75, 16
  br i1 %76, label %77, label %80

77:                                               ; preds = %70
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %78, i32 noundef 0)
  call void @_ZN4Code6immregEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %17, i32 noundef 4, i8 noundef zeroext %79, i8 noundef zeroext 15)
  br label %85

80:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  %81 = call noundef zeroext i8 @_ZN4Code7immtempEh(ptr noundef nonnull align 8 dereferenceable(200) %17, i8 noundef zeroext 15)
  store i8 %81, ptr %8, align 1, !tbaa !13
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %82, i32 noundef 0)
  %84 = load i8, ptr %8, align 1, !tbaa !13
  call void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %17, i32 noundef 3, i8 noundef zeroext %83, i8 noundef zeroext %84)
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  br label %85

85:                                               ; preds = %80, %77
  br label %188

86:                                               ; preds = %66, %63
  %87 = load i32, ptr %6, align 4, !tbaa !9
  %88 = urem i32 %87, 8
  %89 = icmp ule i32 %88, 4
  br i1 %89, label %92, label %90

90:                                               ; preds = %86
  %91 = call noundef zeroext i1 @_ZN4Code12have_tempregEv(ptr noundef nonnull align 8 dereferenceable(200) %17)
  br i1 %91, label %106, label %92

92:                                               ; preds = %90, %86
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load i32, ptr %6, align 4, !tbaa !9
  %95 = udiv i32 %94, 8
  call void @_ZN4Code9lsr_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %17, ptr noundef nonnull align 8 dereferenceable(24) %93, i32 noundef %95)
  %96 = load i32, ptr %6, align 4, !tbaa !9
  %97 = urem i32 %96, 8
  store i32 %97, ptr %6, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %101, %92
  %99 = load i32, ptr %6, align 4, !tbaa !9
  %100 = icmp ugt i32 %99, 0
  br i1 %100, label %101, label %105

101:                                              ; preds = %98
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4Code3lsrERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %17, ptr noundef nonnull align 8 dereferenceable(24) %102, i32 noundef 1)
  %103 = load i32, ptr %6, align 4, !tbaa !9
  %104 = add i32 %103, -1
  store i32 %104, ptr %6, align 4, !tbaa !9
  br label %98, !llvm.loop !14

105:                                              ; preds = %98
  br label %187

106:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = udiv i32 %107, 8
  store i32 %108, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  %109 = call noundef zeroext i8 @_ZN4Code7tempregEv(ptr noundef nonnull align 8 dereferenceable(200) %17)
  store i8 %109, ptr %10, align 1, !tbaa !13
  %110 = load i32, ptr %6, align 4, !tbaa !9
  %111 = urem i32 %110, 8
  %112 = sub i32 8, %111
  store i32 %112, ptr %6, align 4, !tbaa !9
  %113 = load i8, ptr %10, align 1, !tbaa !13
  call void @_ZN4Code7zeroregEhb(ptr noundef nonnull align 8 dereferenceable(200) %17, i8 noundef zeroext %113, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #3
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = load i32, ptr %9, align 4, !tbaa !9
  %116 = trunc i32 %115 to i8
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %117)
  %119 = load i32, ptr %9, align 4, !tbaa !9
  %120 = sub i32 %118, %119
  %121 = trunc i32 %120 to i8
  call void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef nonnull align 8 dereferenceable(24) %114, i8 noundef zeroext %116, i8 noundef zeroext %121)
  %122 = getelementptr inbounds %class.Reg, ptr %11, i32 0, i32 0
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %122, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %123 unwind label %131

123:                                              ; preds = %106
  br label %124

124:                                              ; preds = %128, %123
  %125 = load i32, ptr %6, align 4, !tbaa !9
  %126 = icmp ugt i32 %125, 0
  br i1 %126, label %127, label %135

127:                                              ; preds = %124
  invoke void @_ZN4Code3lslERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %17, ptr noundef nonnull align 8 dereferenceable(24) %11, i32 noundef 1)
          to label %128 unwind label %131

128:                                              ; preds = %127
  %129 = load i32, ptr %6, align 4, !tbaa !9
  %130 = add i32 %129, -1
  store i32 %130, ptr %6, align 4, !tbaa !9
  br label %124, !llvm.loop !15

131:                                              ; preds = %127, %106
  %132 = landingpad { ptr, i32 }
          cleanup
  %133 = extractvalue { ptr, i32 } %132, 0
  store ptr %133, ptr %12, align 8
  %134 = extractvalue { ptr, i32 } %132, 1
  store i32 %134, ptr %13, align 4
  br label %186

135:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #3
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = invoke noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %137)
          to label %139 unwind label %163

139:                                              ; preds = %135
  %140 = load i32, ptr %9, align 4, !tbaa !9
  %141 = sub i32 %138, %140
  %142 = trunc i32 %141 to i8
  invoke void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %136, i8 noundef zeroext 0, i8 noundef zeroext %142)
          to label %143 unwind label %163

143:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #3
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = invoke noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %144)
          to label %146 unwind label %167

146:                                              ; preds = %143
  %147 = load i32, ptr %9, align 4, !tbaa !9
  %148 = sub i32 %145, %147
  %149 = trunc i32 %148 to i8
  invoke void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %11, i8 noundef zeroext 1, i8 noundef zeroext %149)
          to label %150 unwind label %167

150:                                              ; preds = %146
  invoke void @_ZN4Code4moveERK3RegS2_b(ptr noundef nonnull align 8 dereferenceable(200) %17, ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %15, i1 noundef zeroext false)
          to label %151 unwind label %171

151:                                              ; preds = %150
  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 @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #3
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = invoke noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %153)
          to label %155 unwind label %177

155:                                              ; preds = %151
  %156 = load i32, ptr %9, align 4, !tbaa !9
  %157 = sub i32 %154, %156
  %158 = trunc i32 %157 to i8
  %159 = load i32, ptr %9, align 4, !tbaa !9
  %160 = trunc i32 %159 to i8
  invoke void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 8 dereferenceable(24) %152, i8 noundef zeroext %158, i8 noundef zeroext %160)
          to label %161 unwind label %177

161:                                              ; preds = %155
  invoke void @_ZN4Code4moveERK3Regy(ptr noundef nonnull align 8 dereferenceable(200) %17, ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0)
          to label %162 unwind label %181

162:                                              ; preds = %161
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #3
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %187

163:                                              ; preds = %139, %135
  %164 = landingpad { ptr, i32 }
          cleanup
  %165 = extractvalue { ptr, i32 } %164, 0
  store ptr %165, ptr %12, align 8
  %166 = extractvalue { ptr, i32 } %164, 1
  store i32 %166, ptr %13, align 4
  br label %176

167:                                              ; preds = %146, %143
  %168 = landingpad { ptr, i32 }
          cleanup
  %169 = extractvalue { ptr, i32 } %168, 0
  store ptr %169, ptr %12, align 8
  %170 = extractvalue { ptr, i32 } %168, 1
  store i32 %170, ptr %13, align 4
  br label %175

171:                                              ; preds = %150
  %172 = landingpad { ptr, i32 }
          cleanup
  %173 = extractvalue { ptr, i32 } %172, 0
  store ptr %173, ptr %12, align 8
  %174 = extractvalue { ptr, i32 } %172, 1
  store i32 %174, ptr %13, align 4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #3
  br label %175

175:                                              ; preds = %171, %167
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #3
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #3
  br label %176

176:                                              ; preds = %175, %163
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #3
  br label %186

177:                                              ; preds = %155, %151
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %12, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %13, align 4
  br label %185

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

185:                                              ; preds = %181, %177
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #3
  br label %186

186:                                              ; preds = %185, %176, %131
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %192

187:                                              ; preds = %162, %105
  br label %188

188:                                              ; preds = %187, %85
  br label %189

189:                                              ; preds = %188, %59
  br label %190

190:                                              ; preds = %189, %54
  br label %191

191:                                              ; preds = %190, %24
  ret void

192:                                              ; preds = %186
  %193 = load ptr, ptr %12, align 8
  %194 = load i32, ptr %13, align 4
  %195 = insertvalue { ptr, i32 } poison, ptr %193, 0
  %196 = insertvalue { ptr, i32 } %195, i32 %194, 1
  resume { ptr, i32 } %196
}

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

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

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

declare void @_ZN3RegC1ERKS_hh(ptr, ptr, i8, i8)

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 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 #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}


; 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 uwtable
declare dso_local void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

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

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

; 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 noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #1 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 #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN4Code7immtempEh(ptr noundef nonnull align 8 dereferenceable(200), i8 noundef zeroext) local_unnamed_addr #1 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 #1 align 2

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Code3lsrERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i8, align 1
  %5 = alloca %class.Reg, align 8
  %6 = alloca %class.Reg, align 8
  %7 = alloca %class.Reg, align 8
  %8 = alloca %class.Reg, align 8
  %9 = icmp eq i32 %2, 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 = icmp eq i32 %11, 0
  br i1 %12, label %.loopexit, label %13

13:                                               ; preds = %10
  %14 = icmp eq i32 %2, 1
  br i1 %14, label %15, label %22

15:                                               ; preds = %13
  %16 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %15, %.lr.ph
  %.054.in69 = phi i32 [ %.05470, %.lr.ph ], [ %16, %15 ]
  %.05470 = add nsw i32 %.054.in69, -1
  %18 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %19 = icmp eq i32 %.054.in69, %18
  %20 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %.05470)
  %. = select i1 %19, i32 33, i32 47
  tail call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef %., i8 noundef zeroext %20)
  %21 = icmp ugt i32 %.054.in69, 1
  br i1 %21, label %.lr.ph, label %.loopexit, !llvm.loop !5

22:                                               ; preds = %13
  %23 = and i32 %2, 7
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = lshr exact i32 %2, 3
  tail call void @_ZN4Code9lsr_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %26)
  br label %.loopexit

27:                                               ; preds = %22
  %28 = icmp eq i32 %2, 4
  br i1 %28, label %29, label %41

29:                                               ; preds = %27
  %30 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %.thread

32:                                               ; preds = %29
  %33 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 0)
  tail call void @_ZN4Code6oneregEN4Insn4TypeEh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 56, i8 noundef zeroext %33)
  %34 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 0)
  %35 = icmp ugt i8 %34, 15
  br i1 %35, label %36, label %38

36:                                               ; preds = %32
  %37 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 0)
  tail call void @_ZN4Code6immregEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 4, i8 noundef zeroext %37, i8 noundef zeroext 15)
  br label %.loopexit

38:                                               ; preds = %32
  %39 = tail call noundef zeroext i8 @_ZN4Code7immtempEh(ptr noundef nonnull align 8 dereferenceable(200) %0, i8 noundef zeroext 15)
  %40 = tail call noundef zeroext i8 @_ZNK3Reg3regEi(ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 0)
  tail call void @_ZN4Code6tworegEN4Insn4TypeEhh(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 3, i8 noundef zeroext %40, i8 noundef zeroext %39)
  br label %.loopexit

41:                                               ; preds = %27
  %42 = icmp ult i32 %23, 5
  br i1 %42, label %.thread, label %43

43:                                               ; preds = %41
  %44 = tail call noundef zeroext i1 @_ZN4Code12have_tempregEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  br i1 %44, label %48, label %.thread

.thread:                                          ; preds = %29, %43, %41
  %45 = lshr i32 %2, 3
  tail call void @_ZN4Code9lsr_bytesERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %45)
  br label %46

46:                                               ; preds = %.thread, %46
  %.05267 = phi i32 [ %23, %.thread ], [ %47, %46 ]
  tail call void @_ZN4Code3lsrERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef 1)
  %47 = add nsw i32 %.05267, -1
  %.not63 = icmp eq i32 %47, 0
  br i1 %.not63, label %.loopexit, label %46, !llvm.loop !7

48:                                               ; preds = %43
  %49 = lshr i32 %2, 3
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  %50 = tail call noundef zeroext i8 @_ZN4Code7tempregEv(ptr noundef nonnull align 8 dereferenceable(200) %0)
  store i8 %50, ptr %4, align 1, !tbaa !8
  tail call void @_ZN4Code7zeroregEhb(ptr noundef nonnull align 8 dereferenceable(200) %0, i8 noundef zeroext %50, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #3
  %51 = trunc i32 %49 to i8
  %52 = tail call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %53 = sub i32 %52, %49
  %54 = trunc i32 %53 to i8
  call void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %1, i8 noundef zeroext %51, i8 noundef zeroext %54)
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %.preheader.preheader unwind label %.loopexit.split-lp

.preheader.preheader:                             ; preds = %48
  %55 = sub nuw nsw i32 8, %23
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %56
  %.15366 = phi i32 [ %57, %56 ], [ %55, %.preheader.preheader ]
  invoke void @_ZN4Code3lslERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef 1)
          to label %56 unwind label %.loopexit65

56:                                               ; preds = %.preheader
  %57 = add nsw i32 %.15366, -1
  %.not = icmp eq i32 %57, 0
  br i1 %.not, label %58, label %.preheader, !llvm.loop !11

.loopexit65:                                      ; preds = %.preheader
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %86

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

58:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  %59 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %60 = sub i32 %59, %49
  %61 = trunc i32 %60 to i8
  invoke void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %1, i8 noundef zeroext 0, i8 noundef zeroext %61)
          to label %62 unwind label %73

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #3
  %63 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %64 = sub i32 %63, %49
  %65 = trunc i32 %64 to i8
  invoke void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %5, i8 noundef zeroext 1, i8 noundef zeroext %65)
          to label %66 unwind label %75

66:                                               ; preds = %62
  invoke void @_ZN4Code4moveERK3RegS2_b(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) %7, i1 noundef zeroext false)
          to label %67 unwind label %77

67:                                               ; preds = %66
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #3
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #3
  %68 = call noundef i32 @_ZNK3Reg4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %1)
  %69 = sub i32 %68, %49
  %70 = trunc i32 %69 to i8
  invoke void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %8, ptr noundef nonnull align 8 dereferenceable(24) %1, i8 noundef zeroext %70, i8 noundef zeroext %51)
          to label %71 unwind label %81

71:                                               ; preds = %67
  invoke void @_ZN4Code4moveERK3Regy(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0)
          to label %72 unwind label %83

72:                                               ; preds = %71
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #3
  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.end.p0(i64 1, ptr nonnull %4) #3
  br label %.loopexit

73:                                               ; preds = %58
  %74 = landingpad { ptr, i32 }
          cleanup
  br label %80

75:                                               ; preds = %62
  %76 = landingpad { ptr, i32 }
          cleanup
  br label %79

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

79:                                               ; preds = %77, %75
  %.pn = phi { ptr, i32 } [ %78, %77 ], [ %76, %75 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #3
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  br label %80

80:                                               ; preds = %79, %73
  %.pn.pn = phi { ptr, i32 } [ %.pn, %79 ], [ %74, %73 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  br label %86

81:                                               ; preds = %67
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %85

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

85:                                               ; preds = %83, %81
  %.pn59 = phi { ptr, i32 } [ %84, %83 ], [ %82, %81 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #3
  br label %86

86:                                               ; preds = %.loopexit65, %.loopexit.split-lp, %85, %80
  %.pn61 = phi { ptr, i32 } [ %.pn59, %85 ], [ %.pn.pn, %80 ], [ %lpad.loopexit, %.loopexit65 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  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.end.p0(i64 1, ptr nonnull %4) #3
  resume { ptr, i32 } %.pn61

.loopexit:                                        ; preds = %46, %.lr.ph, %15, %38, %36, %72, %25, %3, %10
  ret void
}

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

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

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

declare void @_ZN3RegC1ERKS_hh(ptr, ptr, i8, i8) local_unnamed_addr

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


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