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

; 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.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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 }

@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@_ZL11duplex_bits = external hidden constant [33 x i16], align 16

declare void @_ZN4Code20prologue_permutationEPKcj(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef, i32 noundef) #0

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

declare void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

declare void @_ZN4Code11allocateRegEj(ptr dead_on_unwind writable sret(%class.Reg) align 8, ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) #0

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

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

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

declare void @_ZN4Code7bit_getERK3Regi(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #0

declare void @_ZN4Code7bit_putERK3Regi(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) #0

declare void @_ZN4Code4moveERK3Regy(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23gen_subterranean_absorbR4Codei(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef %1) #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca %class.Reg, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %class.Reg, align 8
  %9 = alloca %class.Reg, align 8
  %10 = alloca %class.Reg, align 8
  %11 = alloca [257 x i16], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %class.Reg, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %5) #4
  call void @_ZN3RegC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5)
  %20 = load i32, ptr %4, align 4, !tbaa !9
  %21 = icmp eq i32 %20, 1
  br i1 %21, label %22, label %54

22:                                               ; preds = %2
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4Code20prologue_permutationEPKcj(ptr noundef nonnull align 8 dereferenceable(200) %23, ptr noundef @.str.1, i32 noundef 0)
          to label %24 unwind label %32

24:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #4
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4Code3argEj(ptr dead_on_unwind writable sret(%class.Reg) align 8 %8, ptr noundef nonnull align 8 dereferenceable(200) %25, i32 noundef 2)
          to label %26 unwind label %36

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %28 unwind label %40

28:                                               ; preds = %26
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #4
  invoke void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %5, i8 noundef zeroext 1, i8 noundef zeroext 1)
          to label %30 unwind label %45

30:                                               ; preds = %28
  invoke void @_ZN4Code4moveERK3Regy(ptr noundef nonnull align 8 dereferenceable(200) %29, ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 1)
          to label %31 unwind label %49

31:                                               ; preds = %30
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  br label %70

32:                                               ; preds = %70, %54, %22
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %6, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %7, align 4
  br label %175

36:                                               ; preds = %24
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %6, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %7, align 4
  br label %44

40:                                               ; preds = %26
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %6, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %7, align 4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  br label %44

44:                                               ; preds = %40, %36
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #4
  br label %175

45:                                               ; preds = %28
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %6, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %7, align 4
  br label %53

49:                                               ; preds = %30
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %6, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %7, align 4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  br label %53

53:                                               ; preds = %49, %45
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #4
  br label %175

54:                                               ; preds = %2
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4Code20prologue_permutationEPKcj(ptr noundef nonnull align 8 dereferenceable(200) %55, ptr noundef @.str.2, i32 noundef 0)
          to label %56 unwind label %32

56:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4Code3argEj(ptr dead_on_unwind writable sret(%class.Reg) align 8 %10, ptr noundef nonnull align 8 dereferenceable(200) %57, i32 noundef 4)
          to label %58 unwind label %61

58:                                               ; preds = %56
  %59 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %60 unwind label %65

60:                                               ; preds = %58
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  br label %70

61:                                               ; preds = %56
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %6, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %7, align 4
  br label %69

65:                                               ; preds = %58
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %6, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %7, align 4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  br label %69

69:                                               ; preds = %65, %61
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  br label %175

70:                                               ; preds = %60, %31
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4Code7setFlagENS_4FlagE(ptr noundef nonnull align 8 dereferenceable(200) %71, i32 noundef 32)
          to label %72 unwind label %32

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 514, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %81, %72
  %74 = load i32, ptr %12, align 4, !tbaa !9
  %75 = icmp slt i32 %74, 257
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %84

77:                                               ; preds = %73
  %78 = load i32, ptr %12, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [257 x i16], ptr %11, i64 0, i64 %79
  store i16 -1, ptr %80, align 2, !tbaa !11
  br label %81

81:                                               ; preds = %77
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %12, align 4, !tbaa !9
  br label %73, !llvm.loop !13

84:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %85

85:                                               ; preds = %105, %84
  %86 = load i32, ptr %13, align 4, !tbaa !9
  %87 = icmp slt i32 %86, 32
  br i1 %87, label %89, label %88

88:                                               ; preds = %85
  store i32 5, ptr %14, align 4
  br label %108

89:                                               ; preds = %85
  %90 = load i32, ptr %4, align 4, !tbaa !9
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %92, label %96

92:                                               ; preds = %89
  %93 = load i32, ptr %13, align 4, !tbaa !9
  %94 = icmp sge i32 %93, 9
  br i1 %94, label %95, label %96

95:                                               ; preds = %92
  store i32 5, ptr %14, align 4
  br label %108

96:                                               ; preds = %92, %89
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = trunc i32 %97 to i16
  %99 = load i32, ptr %13, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [33 x i16], ptr @_ZL11duplex_bits, i64 0, i64 %100
  %102 = load i16, ptr %101, align 2, !tbaa !11
  %103 = zext i16 %102 to i64
  %104 = getelementptr inbounds [257 x i16], ptr %11, i64 0, i64 %103
  store i16 %98, ptr %104, align 2, !tbaa !11
  br label %105

105:                                              ; preds = %96
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %13, align 4, !tbaa !9
  br label %85, !llvm.loop !15

108:                                              ; preds = %95, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %109

109:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #4
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4Code11allocateRegEj(ptr dead_on_unwind writable sret(%class.Reg) align 8 %15, ptr noundef nonnull align 8 dereferenceable(200) %110, i32 noundef 1)
          to label %111 unwind label %116

111:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 -1, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 -1, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %112

112:                                              ; preds = %162, %111
  %113 = load i32, ptr %18, align 4, !tbaa !9
  %114 = icmp slt i32 %113, 257
  br i1 %114, label %120, label %115

115:                                              ; preds = %112
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %165

116:                                              ; preds = %109
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %6, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %7, align 4
  br label %174

120:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %121 = load i32, ptr %18, align 4, !tbaa !9
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [257 x i16], ptr %11, i64 0, i64 %122
  %124 = load i16, ptr %123, align 2, !tbaa !11
  %125 = sext i16 %124 to i32
  store i32 %125, ptr %19, align 4, !tbaa !9
  %126 = load i32, ptr %19, align 4, !tbaa !9
  %127 = icmp slt i32 %126, 0
  br i1 %127, label %128, label %129

128:                                              ; preds = %120
  store i32 10, ptr %14, align 4
  br label %159

129:                                              ; preds = %120
  %130 = load i32, ptr %16, align 4, !tbaa !9
  %131 = load i32, ptr %18, align 4, !tbaa !9
  %132 = sdiv i32 %131, 8
  %133 = icmp ne i32 %130, %132
  br i1 %133, label %134, label %151

134:                                              ; preds = %129
  %135 = load i32, ptr %18, align 4, !tbaa !9
  %136 = sdiv i32 %135, 8
  store i32 %136, ptr %16, align 4, !tbaa !9
  %137 = load i32, ptr %17, align 4, !tbaa !9
  %138 = icmp ne i32 %137, -1
  br i1 %138, label %139, label %147

139:                                              ; preds = %134
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = load i32, ptr %17, align 4, !tbaa !9
  invoke void @_ZN4Code10ldz_xor_inERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %140, ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %141)
          to label %142 unwind label %143

142:                                              ; preds = %139
  br label %147

143:                                              ; preds = %154, %151, %147, %139
  %144 = landingpad { ptr, i32 }
          cleanup
  %145 = extractvalue { ptr, i32 } %144, 0
  store ptr %145, ptr %6, align 8
  %146 = extractvalue { ptr, i32 } %144, 1
  store i32 %146, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %173

147:                                              ; preds = %142, %134
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  invoke void @_ZN4Code4moveERK3Regy(ptr noundef nonnull align 8 dereferenceable(200) %148, ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef 0)
          to label %149 unwind label %143

149:                                              ; preds = %147
  %150 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %150, ptr %17, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %149, %129
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = load i32, ptr %19, align 4, !tbaa !9
  invoke void @_ZN4Code7bit_getERK3Regi(ptr noundef nonnull align 8 dereferenceable(200) %152, ptr noundef nonnull align 8 dereferenceable(24) %5, i32 noundef %153)
          to label %154 unwind label %143

154:                                              ; preds = %151
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = load i32, ptr %18, align 4, !tbaa !9
  %157 = srem i32 %156, 8
  invoke void @_ZN4Code7bit_putERK3Regi(ptr noundef nonnull align 8 dereferenceable(200) %155, ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %157)
          to label %158 unwind label %143

158:                                              ; preds = %154
  store i32 0, ptr %14, align 4
  br label %159

159:                                              ; preds = %158, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  %160 = load i32, ptr %14, align 4
  switch i32 %160, label %181 [
    i32 0, label %161
    i32 10, label %162
  ]

161:                                              ; preds = %159
  br label %162

162:                                              ; preds = %161, %159
  %163 = load i32, ptr %18, align 4, !tbaa !9
  %164 = add nsw i32 %163, 1
  store i32 %164, ptr %18, align 4, !tbaa !9
  br label %112, !llvm.loop !16

165:                                              ; preds = %115
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = load i32, ptr %17, align 4, !tbaa !9
  invoke void @_ZN4Code10ldz_xor_inERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %166, ptr noundef nonnull align 8 dereferenceable(24) %15, i32 noundef %167)
          to label %168 unwind label %169

168:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 514, ptr %11) #4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  ret void

169:                                              ; preds = %165
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %6, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %7, align 4
  br label %173

173:                                              ; preds = %169, %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #4
  br label %174

174:                                              ; preds = %173, %116
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 514, ptr %11) #4
  br label %175

175:                                              ; preds = %174, %69, %53, %44, %32
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %5) #4
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr %6, align 8
  %178 = load i32, ptr %7, align 4
  %179 = insertvalue { ptr, i32 } poison, ptr %177, 0
  %180 = insertvalue { ptr, i32 } %179, i32 %178, 1
  resume { ptr, i32 } %180

181:                                              ; preds = %159
  unreachable
}

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

declare void @_ZN4Code3argEj(ptr dead_on_unwind writable sret(%class.Reg) align 8, ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) #0

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

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

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

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

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


; 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.5" }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = 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 }

@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [25 x i8], align 1
@_ZL11duplex_bits = external hidden local_unnamed_addr constant [33 x i16], align 16

declare void @_ZN4Code20prologue_permutationEPKcj(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef, i32 noundef) local_unnamed_addr #0

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

declare void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i8 noundef zeroext, i8 noundef zeroext) unnamed_addr #0

declare i32 @__gxx_personality_v0(...)

declare void @_ZN4Code11allocateRegEj(ptr dead_on_unwind writable sret(%class.Reg) align 8, ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: 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 #3 align 2

declare void @_ZN4Code7bit_getERK3Regi(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0

declare void @_ZN4Code7bit_putERK3Regi(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24), i32 noundef) local_unnamed_addr #0

declare void @_ZN4Code4moveERK3Regy(ptr noundef nonnull align 8 dereferenceable(200), ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z23gen_subterranean_absorbR4Codei(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef %1) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.Reg, align 8
  %4 = alloca %class.Reg, align 8
  %5 = alloca %class.Reg, align 8
  %6 = alloca %class.Reg, align 8
  %7 = alloca [257 x i16], align 16
  %8 = alloca %class.Reg, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #5
  call void @_ZN3RegC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3)
  %9 = icmp eq i32 %1, 1
  br i1 %9, label %10, label %29

10:                                               ; preds = %2
  invoke void @_ZN4Code20prologue_permutationEPKcj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull @.str.1, i32 noundef 0)
          to label %11 unwind label %17

11:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  invoke void @_ZN4Code3argEj(ptr dead_on_unwind nonnull writable sret(%class.Reg) align 8 %4, ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 2)
          to label %12 unwind label %19

12:                                               ; preds = %11
  %13 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %14 unwind label %21

14:                                               ; preds = %12
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  invoke void @_ZN3RegC1ERKS_hh(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 8 dereferenceable(24) %3, i8 noundef zeroext 1, i8 noundef zeroext 1)
          to label %15 unwind label %24

15:                                               ; preds = %14
  invoke void @_ZN4Code4moveERK3Regy(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 1)
          to label %16 unwind label %26

16:                                               ; preds = %15
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %39

17:                                               ; preds = %39, %29, %10
  %18 = landingpad { ptr, i32 }
          cleanup
  br label %72

19:                                               ; preds = %11
  %20 = landingpad { ptr, i32 }
          cleanup
  br label %23

21:                                               ; preds = %12
  %22 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #5
  br label %23

23:                                               ; preds = %21, %19
  %.pn55 = phi { ptr, i32 } [ %22, %21 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  br label %72

24:                                               ; preds = %14
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %28

26:                                               ; preds = %15
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %28

28:                                               ; preds = %26, %24
  %.pn57 = phi { ptr, i32 } [ %27, %26 ], [ %25, %24 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br label %72

29:                                               ; preds = %2
  invoke void @_ZN4Code20prologue_permutationEPKcj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull @.str.2, i32 noundef 0)
          to label %30 unwind label %17

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  invoke void @_ZN4Code3argEj(ptr dead_on_unwind nonnull writable sret(%class.Reg) align 8 %6, ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 4)
          to label %31 unwind label %34

31:                                               ; preds = %30
  %32 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZN3RegaSERKS_(ptr noundef nonnull align 8 dereferenceable(24) %3, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %33 unwind label %36

33:                                               ; preds = %31
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %39

34:                                               ; preds = %30
  %35 = landingpad { ptr, i32 }
          cleanup
  br label %38

36:                                               ; preds = %31
  %37 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  br label %38

38:                                               ; preds = %36, %34
  %.pn = phi { ptr, i32 } [ %37, %36 ], [ %35, %34 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %72

39:                                               ; preds = %33, %16
  invoke void @_ZN4Code7setFlagENS_4FlagE(ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 32)
          to label %.preheader65.preheader unwind label %17

.preheader65.preheader:                           ; preds = %39
  call void @llvm.lifetime.start.p0(i64 514, ptr nonnull %7) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(514) %7, i8 -1, i64 514, i1 false), !tbaa !5
  br label %.preheader65

.preheader65:                                     ; preds = %.preheader65.preheader, %.preheader65
  %indvars.iv = phi i64 [ 0, %.preheader65.preheader ], [ %indvars.iv.next, %.preheader65 ]
  %40 = trunc i64 %indvars.iv to i16
  %41 = getelementptr inbounds [33 x i16], ptr @_ZL11duplex_bits, i64 0, i64 %indvars.iv
  %42 = load i16, ptr %41, align 2, !tbaa !5
  %43 = zext i16 %42 to i64
  %44 = getelementptr inbounds [257 x i16], ptr %7, i64 0, i64 %43
  store i16 %40, ptr %44, align 2, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %45 = icmp ugt i64 %indvars.iv, 30
  %46 = icmp ugt i64 %indvars.iv, 7
  %or.cond = and i1 %9, %46
  %or.cond64 = or i1 %45, %or.cond
  br i1 %or.cond64, label %47, label %.preheader65, !llvm.loop !9

47:                                               ; preds = %.preheader65
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #5
  invoke void @_ZN4Code11allocateRegEj(ptr dead_on_unwind nonnull writable sret(%class.Reg) align 8 %8, ptr noundef nonnull align 8 dereferenceable(200) %0, i32 noundef 1)
          to label %.preheader unwind label %49

48:                                               ; preds = %66
  invoke void @_ZN4Code10ldz_xor_inERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %8, i32 noundef %.240)
          to label %67 unwind label %68

49:                                               ; preds = %47
  %50 = landingpad { ptr, i32 }
          cleanup
  br label %71

.preheader:                                       ; preds = %47, %66
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %66 ], [ 0, %47 ]
  %.03870 = phi i32 [ %.240, %66 ], [ -1, %47 ]
  %.04169 = phi i32 [ %.243, %66 ], [ -1, %47 ]
  %51 = getelementptr inbounds [257 x i16], ptr %7, i64 0, i64 %indvars.iv74
  %52 = load i16, ptr %51, align 2, !tbaa !5
  %53 = sext i16 %52 to i32
  %54 = icmp slt i16 %52, 0
  br i1 %54, label %66, label %55

55:                                               ; preds = %.preheader
  %56 = trunc nuw nsw i64 %indvars.iv74 to i32
  %57 = lshr i32 %56, 3
  %.not = icmp eq i32 %.04169, %57
  br i1 %.not, label %63, label %58

58:                                               ; preds = %55
  %.not59 = icmp eq i32 %.03870, -1
  br i1 %.not59, label %62, label %59

59:                                               ; preds = %58
  invoke void @_ZN4Code10ldz_xor_inERK3Regj(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %8, i32 noundef %.03870)
          to label %62 unwind label %60

60:                                               ; preds = %64, %63, %62, %59
  %61 = landingpad { ptr, i32 }
          cleanup
  br label %70

62:                                               ; preds = %59, %58
  invoke void @_ZN4Code4moveERK3Regy(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %8, i64 noundef 0)
          to label %63 unwind label %60

63:                                               ; preds = %62, %55
  %.142 = phi i32 [ %.04169, %55 ], [ %57, %62 ]
  %.139 = phi i32 [ %.03870, %55 ], [ %57, %62 ]
  invoke void @_ZN4Code7bit_getERK3Regi(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %53)
          to label %64 unwind label %60

64:                                               ; preds = %63
  %65 = and i32 %56, 7
  invoke void @_ZN4Code7bit_putERK3Regi(ptr noundef nonnull align 8 dereferenceable(200) %0, ptr noundef nonnull align 8 dereferenceable(24) %8, i32 noundef %65)
          to label %66 unwind label %60

66:                                               ; preds = %64, %.preheader
  %.243 = phi i32 [ %.04169, %.preheader ], [ %.142, %64 ]
  %.240 = phi i32 [ %.03870, %.preheader ], [ %.139, %64 ]
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next75, 257
  br i1 %exitcond.not, label %48, label %.preheader, !llvm.loop !11

67:                                               ; preds = %48
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 514, ptr nonnull %7) #5
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  ret void

68:                                               ; preds = %48
  %69 = landingpad { ptr, i32 }
          cleanup
  br label %70

70:                                               ; preds = %68, %60
  %.pn60 = phi { ptr, i32 } [ %61, %60 ], [ %69, %68 ]
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #5
  br label %71

71:                                               ; preds = %70, %49
  %.pn60.pn = phi { ptr, i32 } [ %.pn60, %70 ], [ %50, %49 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 514, ptr nonnull %7) #5
  br label %72

72:                                               ; preds = %71, %38, %28, %23, %17
  %.pn60.pn.pn = phi { ptr, i32 } [ %.pn60.pn, %71 ], [ %18, %17 ], [ %.pn57, %28 ], [ %.pn55, %23 ], [ %.pn, %38 ]
  call void @_ZN3RegD2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn60.pn.pn
}

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

declare void @_ZN4Code3argEj(ptr dead_on_unwind writable sret(%class.Reg) align 8, ptr noundef nonnull align 8 dereferenceable(200), i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

attributes #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 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 #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

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

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


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