; LLVM IR from rweather/lightweight-crypto :: src/combined (forkae)

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

; Function Attrs: nounwind uwtable
define dso_local i32 @forkae_paef_128_192_aead_encrypt(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8) #0 {
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca [32 x i8], align 16
  %21 = alloca [16 x i8], align 16
  %22 = alloca [16 x i8], align 16
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca ptr, align 8
  %33 = alloca ptr, align 8
  %34 = alloca i32, align 4
  %35 = alloca ptr, align 8
  %36 = alloca ptr, align 8
  %37 = alloca i32, align 4
  %38 = alloca ptr, align 8
  %39 = alloca ptr, align 8
  %40 = alloca i32, align 4
  %41 = alloca i32, align 4
  %42 = alloca ptr, align 8
  %43 = alloca ptr, align 8
  %44 = alloca i32, align 4
  store ptr %0, ptr %11, align 8, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !5
  store ptr %2, ptr %13, align 8, !tbaa !5
  store i64 %3, ptr %14, align 8, !tbaa !9
  store ptr %4, ptr %15, align 8, !tbaa !5
  store i64 %5, ptr %16, align 8, !tbaa !9
  store ptr %6, ptr %17, align 8, !tbaa !5
  store ptr %7, ptr %18, align 8, !tbaa !5
  store ptr %8, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %45 = load ptr, ptr %17, align 8, !tbaa !5
  %46 = load i64, ptr %14, align 8, !tbaa !9
  %47 = add i64 %46, 16
  %48 = load ptr, ptr %12, align 8, !tbaa !5
  store i64 %47, ptr %48, align 8, !tbaa !9
  %49 = load i64, ptr %16, align 8, !tbaa !9
  %50 = icmp ugt i64 %49, 131056
  br i1 %50, label %54, label %51

51:                                               ; preds = %9
  %52 = load i64, ptr %14, align 8, !tbaa !9
  %53 = icmp ugt i64 %52, 131056
  br i1 %53, label %54, label %55

54:                                               ; preds = %51, %9
  store i32 -2, ptr %10, align 4
  store i32 1, ptr %24, align 4
  br label %321

55:                                               ; preds = %51
  %56 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %57 = load ptr, ptr %19, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %56, ptr align 1 %57, i64 16, i1 false)
  %58 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %60 = load ptr, ptr %18, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %59, ptr align 1 %60, i64 6, i1 false)
  %61 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %62 = getelementptr inbounds i8, ptr %61, i64 16
  %63 = getelementptr inbounds i8, ptr %62, i64 6
  call void @llvm.memset.p0.i64(ptr align 1 %63, i8 0, i64 10, i1 false)
  %64 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %64, i8 0, i64 16, i1 false)
  store i64 1, ptr %23, align 8, !tbaa !9
  br label %65

65:                                               ; preds = %95, %55
  %66 = load i64, ptr %16, align 8, !tbaa !9
  %67 = icmp ugt i64 %66, 16
  br i1 %67, label %68, label %102

68:                                               ; preds = %65
  %69 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %70 = load i64, ptr %23, align 8, !tbaa !9
  call void @forkae_paef_128_192_set_counter(ptr noundef %69, i64 noundef %70, i8 noundef zeroext 0)
  %71 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %72 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  call void @forkskinny_128_256_encrypt(ptr noundef %71, ptr noundef null, ptr noundef %72, ptr noundef %73)
  br label %74

74:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %75 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  store ptr %75, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %76 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  store ptr %76, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store i32 16, ptr %27, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %80, %74
  %78 = load i32, ptr %27, align 4, !tbaa !11
  %79 = icmp ugt i32 %78, 0
  br i1 %79, label %80, label %93

80:                                               ; preds = %77
  %81 = load ptr, ptr %26, align 8, !tbaa !5
  %82 = getelementptr inbounds i8, ptr %81, i32 1
  store ptr %82, ptr %26, align 8, !tbaa !5
  %83 = load i8, ptr %81, align 1, !tbaa !13
  %84 = zext i8 %83 to i32
  %85 = load ptr, ptr %25, align 8, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %85, i32 1
  store ptr %86, ptr %25, align 8, !tbaa !5
  %87 = load i8, ptr %85, align 1, !tbaa !13
  %88 = zext i8 %87 to i32
  %89 = xor i32 %88, %84
  %90 = trunc i32 %89 to i8
  store i8 %90, ptr %85, align 1, !tbaa !13
  %91 = load i32, ptr %27, align 4, !tbaa !11
  %92 = add i32 %91, -1
  store i32 %92, ptr %27, align 4, !tbaa !11
  br label %77, !llvm.loop !14

93:                                               ; preds = %77
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  %96 = load ptr, ptr %15, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 16
  store ptr %97, ptr %15, align 8, !tbaa !5
  %98 = load i64, ptr %16, align 8, !tbaa !9
  %99 = sub i64 %98, 16
  store i64 %99, ptr %16, align 8, !tbaa !9
  %100 = load i64, ptr %23, align 8, !tbaa !9
  %101 = add i64 %100, 1
  store i64 %101, ptr %23, align 8, !tbaa !9
  br label %65, !llvm.loop !16

102:                                              ; preds = %65
  %103 = load i64, ptr %16, align 8, !tbaa !9
  %104 = icmp eq i64 %103, 16
  br i1 %104, label %105, label %133

105:                                              ; preds = %102
  %106 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %107 = load i64, ptr %23, align 8, !tbaa !9
  call void @forkae_paef_128_192_set_counter(ptr noundef %106, i64 noundef %107, i8 noundef zeroext 1)
  %108 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %109 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %110 = load ptr, ptr %15, align 8, !tbaa !5
  call void @forkskinny_128_256_encrypt(ptr noundef %108, ptr noundef null, ptr noundef %109, ptr noundef %110)
  br label %111

111:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %112 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  store ptr %112, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %113 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  store ptr %113, ptr %29, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store i32 16, ptr %30, align 4, !tbaa !11
  br label %114

114:                                              ; preds = %117, %111
  %115 = load i32, ptr %30, align 4, !tbaa !11
  %116 = icmp ugt i32 %115, 0
  br i1 %116, label %117, label %130

117:                                              ; preds = %114
  %118 = load ptr, ptr %29, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %118, i32 1
  store ptr %119, ptr %29, align 8, !tbaa !5
  %120 = load i8, ptr %118, align 1, !tbaa !13
  %121 = zext i8 %120 to i32
  %122 = load ptr, ptr %28, align 8, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %122, i32 1
  store ptr %123, ptr %28, align 8, !tbaa !5
  %124 = load i8, ptr %122, align 1, !tbaa !13
  %125 = zext i8 %124 to i32
  %126 = xor i32 %125, %121
  %127 = trunc i32 %126 to i8
  store i8 %127, ptr %122, align 1, !tbaa !13
  %128 = load i32, ptr %30, align 4, !tbaa !11
  %129 = add i32 %128, -1
  store i32 %129, ptr %30, align 4, !tbaa !11
  br label %114, !llvm.loop !17

130:                                              ; preds = %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  br label %186

133:                                              ; preds = %102
  %134 = load i64, ptr %16, align 8, !tbaa !9
  %135 = icmp ne i64 %134, 0
  br i1 %135, label %139, label %136

136:                                              ; preds = %133
  %137 = load i64, ptr %14, align 8, !tbaa !9
  %138 = icmp eq i64 %137, 0
  br i1 %138, label %139, label %185

139:                                              ; preds = %136, %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %140 = load i64, ptr %16, align 8, !tbaa !9
  %141 = trunc i64 %140 to i32
  store i32 %141, ptr %31, align 4, !tbaa !11
  %142 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %143 = load ptr, ptr %15, align 8, !tbaa !5
  %144 = load i32, ptr %31, align 4, !tbaa !11
  %145 = zext i32 %144 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %142, ptr align 1 %143, i64 %145, i1 false)
  %146 = load i32, ptr %31, align 4, !tbaa !11
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 %147
  store i8 -128, ptr %148, align 1, !tbaa !13
  %149 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %150 = load i32, ptr %31, align 4, !tbaa !11
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds i8, ptr %149, i64 %151
  %153 = getelementptr inbounds i8, ptr %152, i64 1
  %154 = load i32, ptr %31, align 4, !tbaa !11
  %155 = zext i32 %154 to i64
  %156 = sub i64 16, %155
  %157 = sub i64 %156, 1
  call void @llvm.memset.p0.i64(ptr align 1 %153, i8 0, i64 %157, i1 false)
  %158 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %159 = load i64, ptr %23, align 8, !tbaa !9
  call void @forkae_paef_128_192_set_counter(ptr noundef %158, i64 noundef %159, i8 noundef zeroext 3)
  %160 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %161 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %162 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  call void @forkskinny_128_256_encrypt(ptr noundef %160, ptr noundef null, ptr noundef %161, ptr noundef %162)
  br label %163

163:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #5
  %164 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  store ptr %164, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  %165 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  store ptr %165, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  store i32 16, ptr %34, align 4, !tbaa !11
  br label %166

166:                                              ; preds = %169, %163
  %167 = load i32, ptr %34, align 4, !tbaa !11
  %168 = icmp ugt i32 %167, 0
  br i1 %168, label %169, label %182

169:                                              ; preds = %166
  %170 = load ptr, ptr %33, align 8, !tbaa !5
  %171 = getelementptr inbounds i8, ptr %170, i32 1
  store ptr %171, ptr %33, align 8, !tbaa !5
  %172 = load i8, ptr %170, align 1, !tbaa !13
  %173 = zext i8 %172 to i32
  %174 = load ptr, ptr %32, align 8, !tbaa !5
  %175 = getelementptr inbounds i8, ptr %174, i32 1
  store ptr %175, ptr %32, align 8, !tbaa !5
  %176 = load i8, ptr %174, align 1, !tbaa !13
  %177 = zext i8 %176 to i32
  %178 = xor i32 %177, %173
  %179 = trunc i32 %178 to i8
  store i8 %179, ptr %174, align 1, !tbaa !13
  %180 = load i32, ptr %34, align 4, !tbaa !11
  %181 = add i32 %180, -1
  store i32 %181, ptr %34, align 4, !tbaa !11
  br label %166, !llvm.loop !18

182:                                              ; preds = %166
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #5
  br label %183

183:                                              ; preds = %182
  br label %184

184:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %185

185:                                              ; preds = %184, %136
  br label %186

186:                                              ; preds = %185, %132
  %187 = load i64, ptr %14, align 8, !tbaa !9
  %188 = icmp ne i64 %187, 0
  br i1 %188, label %192, label %189

189:                                              ; preds = %186
  %190 = load ptr, ptr %11, align 8, !tbaa !5
  %191 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %190, ptr align 16 %191, i64 16, i1 false)
  store i32 0, ptr %10, align 4
  store i32 1, ptr %24, align 4
  br label %321

192:                                              ; preds = %186
  store i64 1, ptr %23, align 8, !tbaa !9
  br label %193

193:                                              ; preds = %224, %192
  %194 = load i64, ptr %14, align 8, !tbaa !9
  %195 = icmp ugt i64 %194, 16
  br i1 %195, label %196, label %233

196:                                              ; preds = %193
  %197 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %198 = load i64, ptr %23, align 8, !tbaa !9
  call void @forkae_paef_128_192_set_counter(ptr noundef %197, i64 noundef %198, i8 noundef zeroext 4)
  %199 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %200 = load ptr, ptr %11, align 8, !tbaa !5
  %201 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %202 = load ptr, ptr %13, align 8, !tbaa !5
  call void @forkskinny_128_256_encrypt(ptr noundef %199, ptr noundef %200, ptr noundef %201, ptr noundef %202)
  br label %203

203:                                              ; preds = %196
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %204 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  store ptr %204, ptr %35, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #5
  %205 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  store ptr %205, ptr %36, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #5
  store i32 16, ptr %37, align 4, !tbaa !11
  br label %206

206:                                              ; preds = %209, %203
  %207 = load i32, ptr %37, align 4, !tbaa !11
  %208 = icmp ugt i32 %207, 0
  br i1 %208, label %209, label %222

209:                                              ; preds = %206
  %210 = load ptr, ptr %36, align 8, !tbaa !5
  %211 = getelementptr inbounds i8, ptr %210, i32 1
  store ptr %211, ptr %36, align 8, !tbaa !5
  %212 = load i8, ptr %210, align 1, !tbaa !13
  %213 = zext i8 %212 to i32
  %214 = load ptr, ptr %35, align 8, !tbaa !5
  %215 = getelementptr inbounds i8, ptr %214, i32 1
  store ptr %215, ptr %35, align 8, !tbaa !5
  %216 = load i8, ptr %214, align 1, !tbaa !13
  %217 = zext i8 %216 to i32
  %218 = xor i32 %217, %213
  %219 = trunc i32 %218 to i8
  store i8 %219, ptr %214, align 1, !tbaa !13
  %220 = load i32, ptr %37, align 4, !tbaa !11
  %221 = add i32 %220, -1
  store i32 %221, ptr %37, align 4, !tbaa !11
  br label %206, !llvm.loop !19

222:                                              ; preds = %206
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br label %223

223:                                              ; preds = %222
  br label %224

224:                                              ; preds = %223
  %225 = load ptr, ptr %11, align 8, !tbaa !5
  %226 = getelementptr inbounds i8, ptr %225, i64 16
  store ptr %226, ptr %11, align 8, !tbaa !5
  %227 = load ptr, ptr %13, align 8, !tbaa !5
  %228 = getelementptr inbounds i8, ptr %227, i64 16
  store ptr %228, ptr %13, align 8, !tbaa !5
  %229 = load i64, ptr %14, align 8, !tbaa !9
  %230 = sub i64 %229, 16
  store i64 %230, ptr %14, align 8, !tbaa !9
  %231 = load i64, ptr %23, align 8, !tbaa !9
  %232 = add i64 %231, 1
  store i64 %232, ptr %23, align 8, !tbaa !9
  br label %193, !llvm.loop !20

233:                                              ; preds = %193
  %234 = load i64, ptr %14, align 8, !tbaa !9
  %235 = icmp eq i64 %234, 16
  br i1 %235, label %236, label %268

236:                                              ; preds = %233
  %237 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %238 = load i64, ptr %23, align 8, !tbaa !9
  call void @forkae_paef_128_192_set_counter(ptr noundef %237, i64 noundef %238, i8 noundef zeroext 5)
  %239 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %240 = load ptr, ptr %11, align 8, !tbaa !5
  %241 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %242 = load ptr, ptr %13, align 8, !tbaa !5
  call void @forkskinny_128_256_encrypt(ptr noundef %239, ptr noundef %240, ptr noundef %241, ptr noundef %242)
  br label %243

243:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #5
  %244 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %244, ptr %38, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #5
  %245 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  store ptr %245, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %40) #5
  store i32 16, ptr %40, align 4, !tbaa !11
  br label %246

246:                                              ; preds = %249, %243
  %247 = load i32, ptr %40, align 4, !tbaa !11
  %248 = icmp ugt i32 %247, 0
  br i1 %248, label %249, label %262

249:                                              ; preds = %246
  %250 = load ptr, ptr %39, align 8, !tbaa !5
  %251 = getelementptr inbounds i8, ptr %250, i32 1
  store ptr %251, ptr %39, align 8, !tbaa !5
  %252 = load i8, ptr %250, align 1, !tbaa !13
  %253 = zext i8 %252 to i32
  %254 = load ptr, ptr %38, align 8, !tbaa !5
  %255 = getelementptr inbounds i8, ptr %254, i32 1
  store ptr %255, ptr %38, align 8, !tbaa !5
  %256 = load i8, ptr %254, align 1, !tbaa !13
  %257 = zext i8 %256 to i32
  %258 = xor i32 %257, %253
  %259 = trunc i32 %258 to i8
  store i8 %259, ptr %254, align 1, !tbaa !13
  %260 = load i32, ptr %40, align 4, !tbaa !11
  %261 = add i32 %260, -1
  store i32 %261, ptr %40, align 4, !tbaa !11
  br label %246, !llvm.loop !21

262:                                              ; preds = %246
  call void @llvm.lifetime.end.p0(i64 4, ptr %40) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  br label %263

263:                                              ; preds = %262
  br label %264

264:                                              ; preds = %263
  %265 = load ptr, ptr %11, align 8, !tbaa !5
  %266 = getelementptr inbounds i8, ptr %265, i64 16
  %267 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %266, ptr align 16 %267, i64 16, i1 false)
  br label %320

268:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 4, ptr %41) #5
  %269 = load i64, ptr %14, align 8, !tbaa !9
  %270 = trunc i64 %269 to i32
  store i32 %270, ptr %41, align 4, !tbaa !11
  %271 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %272 = load ptr, ptr %13, align 8, !tbaa !5
  %273 = load i32, ptr %41, align 4, !tbaa !11
  %274 = zext i32 %273 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %271, ptr align 1 %272, i64 %274, i1 false)
  %275 = load i32, ptr %41, align 4, !tbaa !11
  %276 = zext i32 %275 to i64
  %277 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 %276
  store i8 -128, ptr %277, align 1, !tbaa !13
  %278 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %279 = load i32, ptr %41, align 4, !tbaa !11
  %280 = zext i32 %279 to i64
  %281 = getelementptr inbounds i8, ptr %278, i64 %280
  %282 = getelementptr inbounds i8, ptr %281, i64 1
  %283 = load i32, ptr %41, align 4, !tbaa !11
  %284 = zext i32 %283 to i64
  %285 = sub i64 16, %284
  %286 = sub i64 %285, 1
  call void @llvm.memset.p0.i64(ptr align 1 %282, i8 0, i64 %286, i1 false)
  %287 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %288 = load i64, ptr %23, align 8, !tbaa !9
  call void @forkae_paef_128_192_set_counter(ptr noundef %287, i64 noundef %288, i8 noundef zeroext 7)
  %289 = getelementptr inbounds [32 x i8], ptr %20, i64 0, i64 0
  %290 = load ptr, ptr %11, align 8, !tbaa !5
  %291 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %292 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  call void @forkskinny_128_256_encrypt(ptr noundef %289, ptr noundef %290, ptr noundef %291, ptr noundef %292)
  br label %293

293:                                              ; preds = %268
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #5
  %294 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %294, ptr %42, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #5
  %295 = getelementptr inbounds [16 x i8], ptr %21, i64 0, i64 0
  store ptr %295, ptr %43, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %44) #5
  store i32 16, ptr %44, align 4, !tbaa !11
  br label %296

296:                                              ; preds = %299, %293
  %297 = load i32, ptr %44, align 4, !tbaa !11
  %298 = icmp ugt i32 %297, 0
  br i1 %298, label %299, label %312

299:                                              ; preds = %296
  %300 = load ptr, ptr %43, align 8, !tbaa !5
  %301 = getelementptr inbounds i8, ptr %300, i32 1
  store ptr %301, ptr %43, align 8, !tbaa !5
  %302 = load i8, ptr %300, align 1, !tbaa !13
  %303 = zext i8 %302 to i32
  %304 = load ptr, ptr %42, align 8, !tbaa !5
  %305 = getelementptr inbounds i8, ptr %304, i32 1
  store ptr %305, ptr %42, align 8, !tbaa !5
  %306 = load i8, ptr %304, align 1, !tbaa !13
  %307 = zext i8 %306 to i32
  %308 = xor i32 %307, %303
  %309 = trunc i32 %308 to i8
  store i8 %309, ptr %304, align 1, !tbaa !13
  %310 = load i32, ptr %44, align 4, !tbaa !11
  %311 = add i32 %310, -1
  store i32 %311, ptr %44, align 4, !tbaa !11
  br label %296, !llvm.loop !22

312:                                              ; preds = %296
  call void @llvm.lifetime.end.p0(i64 4, ptr %44) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #5
  br label %313

313:                                              ; preds = %312
  br label %314

314:                                              ; preds = %313
  %315 = load ptr, ptr %11, align 8, !tbaa !5
  %316 = getelementptr inbounds i8, ptr %315, i64 16
  %317 = getelementptr inbounds [16 x i8], ptr %22, i64 0, i64 0
  %318 = load i32, ptr %41, align 4, !tbaa !11
  %319 = zext i32 %318 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %316, ptr align 16 %317, i64 %319, i1 false)
  call void @llvm.lifetime.end.p0(i64 4, ptr %41) #5
  br label %320

320:                                              ; preds = %314, %264
  store i32 0, ptr %10, align 4
  store i32 1, ptr %24, align 4
  br label %321

321:                                              ; preds = %320, %189, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #5
  %322 = load i32, ptr %10, align 4
  ret i32 %322
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @forkae_paef_128_192_set_counter(ptr noundef, i64 noundef, i8 noundef zeroext) #4

; Function Attrs: nounwind uwtable
declare dso_local void @forkskinny_128_256_encrypt(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

attributes #0 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -2, 1) i32 @forkae_paef_128_192_aead_encrypt(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr noundef %2, i64 noundef %3, ptr noundef %4, i64 noundef %5, ptr nocapture noundef readnone %6, ptr nocapture noundef readonly %7, ptr nocapture noundef readonly %8) local_unnamed_addr #0 {
  %10 = alloca [32 x i8], align 16
  %11 = alloca [16 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #5
  %12 = add i64 %3, 16
  store i64 %12, ptr %1, align 8, !tbaa !5
  %13 = icmp ugt i64 %5, 131056
  %14 = icmp ugt i64 %3, 131056
  %or.cond = or i1 %14, %13
  br i1 %or.cond, label %64, label %15

15:                                               ; preds = %9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %10, ptr noundef nonnull align 1 dereferenceable(16) %8, i64 16, i1 false)
  %16 = getelementptr inbounds i8, ptr %10, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(6) %16, ptr noundef nonnull align 1 dereferenceable(6) %7, i64 6, i1 false)
  %17 = getelementptr inbounds i8, ptr %10, i64 22
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(10) %17, i8 0, i64 10, i1 false)
  %18 = icmp ugt i64 %5, 16
  br i1 %18, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %15
  %19 = add nsw i64 %5, -17
  %20 = lshr i64 %19, 4
  %21 = add nuw nsw i64 %20, 2
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.098117 = phi i64 [ 1, %.lr.ph.preheader ], [ %27, %.lr.ph ]
  %.0101116 = phi ptr [ %4, %.lr.ph.preheader ], [ %25, %.lr.ph ]
  %.0102115 = phi i64 [ %5, %.lr.ph.preheader ], [ %26, %.lr.ph ]
  %22 = phi <16 x i8> [ zeroinitializer, %.lr.ph.preheader ], [ %24, %.lr.ph ]
  call void @forkae_paef_128_192_set_counter(ptr noundef nonnull %10, i64 noundef %.098117, i8 noundef zeroext 0)
  call void @forkskinny_128_256_encrypt(ptr noundef nonnull %10, ptr noundef null, ptr noundef nonnull %11, ptr noundef %.0101116)
  %23 = load <16 x i8>, ptr %11, align 16, !tbaa !9
  %24 = xor <16 x i8> %22, %23
  %25 = getelementptr inbounds i8, ptr %.0101116, i64 16
  %26 = add nsw i64 %.0102115, -16
  %27 = add nuw nsw i64 %.098117, 1
  %exitcond.not = icmp eq i64 %27, %21
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph, %15
  %.0102.lcssa = phi i64 [ %5, %15 ], [ %26, %.lr.ph ]
  %.0101.lcssa = phi ptr [ %4, %15 ], [ %25, %.lr.ph ]
  %.098.lcssa = phi i64 [ 1, %15 ], [ %21, %.lr.ph ]
  %28 = phi <16 x i8> [ zeroinitializer, %15 ], [ %24, %.lr.ph ]
  %29 = icmp eq i64 %.0102.lcssa, 16
  br i1 %29, label %.loopexit.loopexit, label %30

.loopexit.loopexit:                               ; preds = %._crit_edge
  call void @forkae_paef_128_192_set_counter(ptr noundef nonnull %10, i64 noundef %.098.lcssa, i8 noundef zeroext 1)
  call void @forkskinny_128_256_encrypt(ptr noundef nonnull %10, ptr noundef null, ptr noundef nonnull %11, ptr noundef %.0101.lcssa)
  br label %.loopexit

30:                                               ; preds = %._crit_edge
  %31 = icmp ne i64 %.0102.lcssa, 0
  %32 = icmp eq i64 %3, 0
  %or.cond3 = or i1 %32, %31
  br i1 %or.cond3, label %.loopexit.loopexit145, label %.preheader

.loopexit.loopexit145:                            ; preds = %30
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %11, ptr align 1 %.0101.lcssa, i64 %.0102.lcssa, i1 false)
  %33 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 %.0102.lcssa
  store i8 -128, ptr %33, align 1, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %33, i64 1
  %35 = sub nuw nsw i64 15, %.0102.lcssa
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %34, i8 0, i64 %35, i1 false)
  call void @forkae_paef_128_192_set_counter(ptr noundef nonnull %10, i64 noundef %.098.lcssa, i8 noundef zeroext 3)
  call void @forkskinny_128_256_encrypt(ptr noundef nonnull %10, ptr noundef null, ptr noundef nonnull %11, ptr noundef nonnull %11)
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit145, %.loopexit.loopexit
  %36 = load <16 x i8>, ptr %11, align 16, !tbaa !9
  %37 = xor <16 x i8> %28, %36
  %.not106 = icmp eq i64 %3, 0
  br i1 %.not106, label %43, label %.preheader

.preheader:                                       ; preds = %30, %.loopexit
  %38 = phi <16 x i8> [ %37, %.loopexit ], [ %28, %30 ]
  %39 = icmp ugt i64 %3, 16
  br i1 %39, label %.lr.ph133.preheader, label %._crit_edge134

.lr.ph133.preheader:                              ; preds = %.preheader
  %40 = add nsw i64 %3, -17
  %41 = lshr i64 %40, 4
  %42 = add nuw nsw i64 %41, 2
  br label %.lr.ph133

43:                                               ; preds = %.loopexit
  store <16 x i8> %37, ptr %0, align 1
  br label %64

.lr.ph133:                                        ; preds = %.lr.ph133.preheader, %.lr.ph133
  %.091132 = phi ptr [ %0, %.lr.ph133.preheader ], [ %47, %.lr.ph133 ]
  %.1131 = phi i64 [ 1, %.lr.ph133.preheader ], [ %50, %.lr.ph133 ]
  %.099130 = phi ptr [ %2, %.lr.ph133.preheader ], [ %48, %.lr.ph133 ]
  %.0100129 = phi i64 [ %3, %.lr.ph133.preheader ], [ %49, %.lr.ph133 ]
  %44 = phi <16 x i8> [ %38, %.lr.ph133.preheader ], [ %46, %.lr.ph133 ]
  call void @forkae_paef_128_192_set_counter(ptr noundef nonnull %10, i64 noundef %.1131, i8 noundef zeroext 4)
  call void @forkskinny_128_256_encrypt(ptr noundef nonnull %10, ptr noundef %.091132, ptr noundef nonnull %11, ptr noundef %.099130)
  %45 = load <16 x i8>, ptr %11, align 16, !tbaa !9
  %46 = xor <16 x i8> %44, %45
  %47 = getelementptr inbounds i8, ptr %.091132, i64 16
  %48 = getelementptr inbounds i8, ptr %.099130, i64 16
  %49 = add nsw i64 %.0100129, -16
  %50 = add nuw nsw i64 %.1131, 1
  %exitcond152.not = icmp eq i64 %50, %42
  br i1 %exitcond152.not, label %._crit_edge134, label %.lr.ph133, !llvm.loop !12

._crit_edge134:                                   ; preds = %.lr.ph133, %.preheader
  %.0100.lcssa = phi i64 [ %3, %.preheader ], [ %49, %.lr.ph133 ]
  %.099.lcssa = phi ptr [ %2, %.preheader ], [ %48, %.lr.ph133 ]
  %.1.lcssa = phi i64 [ 1, %.preheader ], [ %42, %.lr.ph133 ]
  %.091.lcssa = phi ptr [ %0, %.preheader ], [ %47, %.lr.ph133 ]
  %51 = phi <16 x i8> [ %38, %.preheader ], [ %46, %.lr.ph133 ]
  %52 = icmp eq i64 %.0100.lcssa, 16
  br i1 %52, label %53, label %57

53:                                               ; preds = %._crit_edge134
  call void @forkae_paef_128_192_set_counter(ptr noundef nonnull %10, i64 noundef %.1.lcssa, i8 noundef zeroext 5)
  call void @forkskinny_128_256_encrypt(ptr noundef nonnull %10, ptr noundef %.091.lcssa, ptr noundef nonnull %11, ptr noundef %.099.lcssa)
  %54 = load <16 x i8>, ptr %.091.lcssa, align 1, !tbaa !9
  %55 = xor <16 x i8> %54, %51
  store <16 x i8> %55, ptr %.091.lcssa, align 1, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %.091.lcssa, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(16) %56, ptr noundef nonnull align 16 dereferenceable(16) %11, i64 16, i1 false)
  br label %64

57:                                               ; preds = %._crit_edge134
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %11, ptr align 1 %.099.lcssa, i64 %.0100.lcssa, i1 false)
  %58 = getelementptr inbounds [16 x i8], ptr %11, i64 0, i64 %.0100.lcssa
  store i8 -128, ptr %58, align 1, !tbaa !9
  %59 = getelementptr inbounds i8, ptr %58, i64 1
  %60 = sub nuw nsw i64 15, %.0100.lcssa
  call void @llvm.memset.p0.i64(ptr nonnull align 1 %59, i8 0, i64 %60, i1 false)
  call void @forkae_paef_128_192_set_counter(ptr noundef nonnull %10, i64 noundef %.1.lcssa, i8 noundef zeroext 7)
  call void @forkskinny_128_256_encrypt(ptr noundef nonnull %10, ptr noundef %.091.lcssa, ptr noundef nonnull %11, ptr noundef nonnull %11)
  %61 = load <16 x i8>, ptr %.091.lcssa, align 1, !tbaa !9
  %62 = xor <16 x i8> %61, %51
  store <16 x i8> %62, ptr %.091.lcssa, align 1, !tbaa !9
  %63 = getelementptr inbounds i8, ptr %.091.lcssa, i64 16
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %63, ptr nonnull align 16 %11, i64 %.0100.lcssa, i1 false)
  br label %64

64:                                               ; preds = %53, %57, %9, %43
  %.081 = phi i32 [ 0, %43 ], [ -2, %9 ], [ 0, %57 ], [ 0, %53 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  ret i32 %.081
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @forkae_paef_128_192_set_counter(ptr noundef, i64 noundef, i8 noundef zeroext) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @forkskinny_128_256_encrypt(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #0 = { 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { inlinehint nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


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