; LLVM IR from intel/cryptography-primitives :: sources/ippcp (pcpaes_xtsencrypt_direct)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._cpRijndael128 = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, [124 x i32] }

@RijEncSbox = external constant [256 x i8], align 64

; Function Attrs: nounwind uwtable
define dso_local i32 @ippsAESEncryptXTS_Direct(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7) #0 {
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca %struct._cpRijndael128, align 16
  %25 = alloca [16 x i8], align 16
  %26 = alloca [512 x i8], align 16
  %27 = alloca [512 x i8], align 16
  %28 = alloca i32, align 4
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca [16 x i8], align 16
  %32 = alloca [16 x i8], align 16
  %33 = alloca i8, align 1
  %34 = alloca i8, align 1
  %35 = alloca i8, align 1
  store ptr %0, ptr %10, align 8, !tbaa !5
  store ptr %1, ptr %11, align 8, !tbaa !5
  store i32 %2, ptr %12, align 4, !tbaa !9
  store i32 %3, ptr %13, align 4, !tbaa !9
  store ptr %4, ptr %14, align 8, !tbaa !5
  store ptr %5, ptr %15, align 8, !tbaa !5
  store i32 %6, ptr %16, align 4, !tbaa !9
  store i32 %7, ptr %17, align 4, !tbaa !9
  %36 = load i32, ptr %17, align 4, !tbaa !9
  %37 = icmp slt i32 %36, 128
  br i1 %37, label %38, label %39

38:                                               ; preds = %8
  store i32 -15, ptr %9, align 4
  br label %273

39:                                               ; preds = %8
  %40 = load ptr, ptr %15, align 8, !tbaa !5
  %41 = icmp eq ptr null, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  store i32 -8, ptr %9, align 4
  br label %273

43:                                               ; preds = %39
  %44 = load i32, ptr %16, align 4, !tbaa !9
  %45 = icmp ne i32 256, %44
  br i1 %45, label %46, label %50

46:                                               ; preds = %43
  %47 = load i32, ptr %16, align 4, !tbaa !9
  %48 = icmp ne i32 512, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  store i32 -15, ptr %9, align 4
  br label %273

50:                                               ; preds = %46, %43
  %51 = load ptr, ptr %14, align 8, !tbaa !5
  %52 = icmp eq ptr null, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %50
  store i32 -8, ptr %9, align 4
  br label %273

54:                                               ; preds = %50
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = icmp eq ptr null, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  store i32 -8, ptr %9, align 4
  br label %273

58:                                               ; preds = %54
  %59 = load ptr, ptr %11, align 8, !tbaa !5
  %60 = icmp eq ptr null, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  store i32 -8, ptr %9, align 4
  br label %273

62:                                               ; preds = %58
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = icmp slt i32 %63, 128
  br i1 %64, label %65, label %66

65:                                               ; preds = %62
  store i32 -15, ptr %9, align 4
  br label %273

66:                                               ; preds = %62
  %67 = load i32, ptr %12, align 4, !tbaa !9
  %68 = icmp sgt i32 %67, 134217728
  br i1 %68, label %69, label %70

69:                                               ; preds = %66
  store i32 -5, ptr %9, align 4
  br label %273

70:                                               ; preds = %66
  %71 = load i32, ptr %17, align 4, !tbaa !9
  %72 = sdiv i32 %71, 128
  %73 = load i32, ptr %13, align 4, !tbaa !9
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %78, label %75

75:                                               ; preds = %70
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = icmp sgt i32 0, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %75, %70
  store i32 -5, ptr %9, align 4
  br label %273

79:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %80 = load i32, ptr %16, align 4, !tbaa !9
  %81 = sdiv i32 %80, 2
  %82 = sdiv i32 %81, 8
  store i32 %82, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %83 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %83, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %84 = load ptr, ptr %15, align 8, !tbaa !5
  %85 = load i32, ptr %18, align 4, !tbaa !9
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %84, i64 %86
  store ptr %87, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %89 = load i32, ptr %12, align 4, !tbaa !9
  %90 = sdiv i32 %89, 128
  store i32 %90, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = srem i32 %91, 128
  store i32 %92, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 568, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 512, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 512, ptr %27) #4
  %93 = load ptr, ptr %20, align 8, !tbaa !5
  %94 = load i32, ptr %18, align 4, !tbaa !9
  %95 = call i32 @ippsAESInit(ptr noundef %93, i32 noundef %94, ptr noundef %24, i32 noundef 568)
  store i32 %95, ptr %21, align 4, !tbaa !9
  %96 = load i32, ptr %21, align 4, !tbaa !9
  %97 = icmp ne i32 0, %96
  br i1 %97, label %98, label %99

98:                                               ; preds = %88
  store i32 2, ptr %28, align 4
  br label %267

99:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %100 = getelementptr inbounds %struct._cpRijndael128, ptr %24, i32 0, i32 4
  %101 = load ptr, ptr %100, align 16, !tbaa !11
  store ptr %101, ptr %29, align 8, !tbaa !5
  %102 = load ptr, ptr %29, align 8, !tbaa !5
  %103 = load ptr, ptr %14, align 8, !tbaa !5
  %104 = getelementptr inbounds [16 x i8], ptr %25, i64 0, i64 0
  %105 = getelementptr inbounds %struct._cpRijndael128, ptr %24, i32 0, i32 3
  %106 = load i32, ptr %105, align 4, !tbaa !13
  %107 = getelementptr inbounds %struct._cpRijndael128, ptr %24, i32 0, i32 8
  %108 = load ptr, ptr %107, align 16, !tbaa !14
  call void %102(ptr noundef %103, ptr noundef %104, i32 noundef %106, ptr noundef %108, ptr noundef @RijEncSbox)
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = load i32, ptr %18, align 4, !tbaa !9
  %111 = call i32 @ippsAESInit(ptr noundef %109, i32 noundef %110, ptr noundef %24, i32 noundef 568)
  store i32 %111, ptr %21, align 4, !tbaa !9
  %112 = load i32, ptr %21, align 4, !tbaa !9
  %113 = icmp ne i32 0, %112
  br i1 %113, label %114, label %115

114:                                              ; preds = %99
  store i32 2, ptr %28, align 4
  br label %267

115:                                              ; preds = %99
  br label %116

116:                                              ; preds = %121, %115
  %117 = load i32, ptr %13, align 4, !tbaa !9
  %118 = icmp sgt i32 %117, 0
  br i1 %118, label %119, label %124

119:                                              ; preds = %116
  %120 = getelementptr inbounds [16 x i8], ptr %25, i64 0, i64 0
  call void @gf_mul_by_primitive(ptr noundef %120)
  br label %121

121:                                              ; preds = %119
  %122 = load i32, ptr %13, align 4, !tbaa !9
  %123 = add nsw i32 %122, -1
  store i32 %123, ptr %13, align 4, !tbaa !9
  br label %116, !llvm.loop !15

124:                                              ; preds = %116
  %125 = load i32, ptr %23, align 4, !tbaa !9
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %130

127:                                              ; preds = %124
  %128 = load i32, ptr %22, align 4, !tbaa !9
  %129 = add nsw i32 %128, -1
  store i32 %129, ptr %22, align 4, !tbaa !9
  br label %130

130:                                              ; preds = %127, %124
  br label %131

131:                                              ; preds = %155, %130
  %132 = load i32, ptr %22, align 4, !tbaa !9
  %133 = icmp sge i32 %132, 32
  br i1 %133, label %134, label %137

134:                                              ; preds = %131
  %135 = load i32, ptr %21, align 4, !tbaa !9
  %136 = icmp eq i32 0, %135
  br label %137

137:                                              ; preds = %134, %131
  %138 = phi i1 [ false, %131 ], [ %136, %134 ]
  br i1 %138, label %139, label %158

139:                                              ; preds = %137
  %140 = getelementptr inbounds [512 x i8], ptr %26, i64 0, i64 0
  %141 = getelementptr inbounds [16 x i8], ptr %25, i64 0, i64 0
  call void @cpXTSwhitening(ptr noundef %140, i32 noundef 32, ptr noundef %141)
  %142 = getelementptr inbounds [512 x i8], ptr %27, i64 0, i64 0
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  %144 = getelementptr inbounds [512 x i8], ptr %26, i64 0, i64 0
  call void @cpXTSxor16(ptr noundef %142, ptr noundef %143, ptr noundef %144, i32 noundef 32)
  %145 = getelementptr inbounds [512 x i8], ptr %27, i64 0, i64 0
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = call i32 @ippsAESEncryptECB(ptr noundef %145, ptr noundef %146, i32 noundef 512, ptr noundef %24)
  store i32 %147, ptr %21, align 4, !tbaa !9
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = getelementptr inbounds [512 x i8], ptr %26, i64 0, i64 0
  call void @cpXTSxor16(ptr noundef %148, ptr noundef %149, ptr noundef %150, i32 noundef 32)
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  %152 = getelementptr inbounds i8, ptr %151, i64 512
  store ptr %152, ptr %10, align 8, !tbaa !5
  %153 = load ptr, ptr %11, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 512
  store ptr %154, ptr %11, align 8, !tbaa !5
  br label %155

155:                                              ; preds = %139
  %156 = load i32, ptr %22, align 4, !tbaa !9
  %157 = sub nsw i32 %156, 32
  store i32 %157, ptr %22, align 4, !tbaa !9
  br label %131, !llvm.loop !17

158:                                              ; preds = %137
  %159 = load i32, ptr %21, align 4, !tbaa !9
  %160 = icmp ne i32 0, %159
  br i1 %160, label %161, label %162

161:                                              ; preds = %158
  store i32 2, ptr %28, align 4
  br label %267

162:                                              ; preds = %158
  %163 = load i32, ptr %22, align 4, !tbaa !9
  %164 = icmp ne i32 %163, 0
  br i1 %164, label %165, label %192

165:                                              ; preds = %162
  %166 = getelementptr inbounds [512 x i8], ptr %26, i64 0, i64 0
  %167 = load i32, ptr %22, align 4, !tbaa !9
  %168 = getelementptr inbounds [16 x i8], ptr %25, i64 0, i64 0
  call void @cpXTSwhitening(ptr noundef %166, i32 noundef %167, ptr noundef %168)
  %169 = getelementptr inbounds [512 x i8], ptr %27, i64 0, i64 0
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = getelementptr inbounds [512 x i8], ptr %26, i64 0, i64 0
  %172 = load i32, ptr %22, align 4, !tbaa !9
  call void @cpXTSxor16(ptr noundef %169, ptr noundef %170, ptr noundef %171, i32 noundef %172)
  %173 = getelementptr inbounds [512 x i8], ptr %27, i64 0, i64 0
  %174 = load ptr, ptr %11, align 8, !tbaa !5
  %175 = load i32, ptr %22, align 4, !tbaa !9
  %176 = mul nsw i32 16, %175
  %177 = call i32 @ippsAESEncryptECB(ptr noundef %173, ptr noundef %174, i32 noundef %176, ptr noundef %24)
  %178 = load ptr, ptr %11, align 8, !tbaa !5
  %179 = load ptr, ptr %11, align 8, !tbaa !5
  %180 = getelementptr inbounds [512 x i8], ptr %26, i64 0, i64 0
  %181 = load i32, ptr %22, align 4, !tbaa !9
  call void @cpXTSxor16(ptr noundef %178, ptr noundef %179, ptr noundef %180, i32 noundef %181)
  %182 = load i32, ptr %22, align 4, !tbaa !9
  %183 = mul nsw i32 16, %182
  %184 = load ptr, ptr %10, align 8, !tbaa !5
  %185 = sext i32 %183 to i64
  %186 = getelementptr inbounds i8, ptr %184, i64 %185
  store ptr %186, ptr %10, align 8, !tbaa !5
  %187 = load i32, ptr %22, align 4, !tbaa !9
  %188 = mul nsw i32 16, %187
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = sext i32 %188 to i64
  %191 = getelementptr inbounds i8, ptr %189, i64 %190
  store ptr %191, ptr %11, align 8, !tbaa !5
  br label %192

192:                                              ; preds = %165, %162
  %193 = load i32, ptr %23, align 4, !tbaa !9
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %266

195:                                              ; preds = %192
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  %196 = load i32, ptr %23, align 4, !tbaa !9
  %197 = sdiv i32 %196, 8
  store i32 %197, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %31) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #4
  %198 = getelementptr inbounds [16 x i8], ptr %31, i64 0, i64 0
  %199 = load ptr, ptr %10, align 8, !tbaa !5
  %200 = getelementptr inbounds [16 x i8], ptr %25, i64 0, i64 0
  %201 = call i32 @cpAES_XTS_EncBlock(ptr noundef %198, ptr noundef %199, ptr noundef %200, ptr noundef %24)
  %202 = getelementptr inbounds [16 x i8], ptr %25, i64 0, i64 0
  call void @gf_mul_by_primitive(ptr noundef %202)
  %203 = getelementptr inbounds [16 x i8], ptr %31, i64 0, i64 0
  %204 = getelementptr inbounds [16 x i8], ptr %32, i64 0, i64 0
  call void @CopyBlock16(ptr noundef %203, ptr noundef %204)
  %205 = load ptr, ptr %10, align 8, !tbaa !5
  %206 = getelementptr inbounds i8, ptr %205, i64 16
  %207 = getelementptr inbounds [16 x i8], ptr %32, i64 0, i64 0
  %208 = load i32, ptr %30, align 4, !tbaa !9
  call void @CopyBlock(ptr noundef %206, ptr noundef %207, i32 noundef %208)
  %209 = load i32, ptr %23, align 4, !tbaa !9
  %210 = srem i32 %209, 8
  store i32 %210, ptr %23, align 4, !tbaa !9
  %211 = load i32, ptr %23, align 4, !tbaa !9
  %212 = icmp ne i32 %211, 0
  br i1 %212, label %213, label %257

213:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 1, ptr %33) #4
  %214 = load i32, ptr %23, align 4, !tbaa !9
  %215 = sub nsw i32 8, %214
  %216 = srem i32 %215, 8
  %217 = shl i32 255, %216
  %218 = trunc i32 %217 to i8
  store i8 %218, ptr %33, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 1, ptr %34) #4
  %219 = load ptr, ptr %10, align 8, !tbaa !5
  %220 = load i32, ptr %30, align 4, !tbaa !9
  %221 = add nsw i32 16, %220
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds i8, ptr %219, i64 %222
  %224 = load i8, ptr %223, align 1, !tbaa !18
  store i8 %224, ptr %34, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 1, ptr %35) #4
  %225 = load i32, ptr %30, align 4, !tbaa !9
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [16 x i8], ptr %31, i64 0, i64 %226
  %228 = load i8, ptr %227, align 1, !tbaa !18
  store i8 %228, ptr %35, align 1, !tbaa !18
  %229 = load i8, ptr %34, align 1, !tbaa !18
  %230 = zext i8 %229 to i32
  %231 = load i8, ptr %33, align 1, !tbaa !18
  %232 = zext i8 %231 to i32
  %233 = and i32 %230, %232
  %234 = load i8, ptr %35, align 1, !tbaa !18
  %235 = zext i8 %234 to i32
  %236 = load i8, ptr %33, align 1, !tbaa !18
  %237 = zext i8 %236 to i32
  %238 = xor i32 %237, -1
  %239 = and i32 %235, %238
  %240 = or i32 %233, %239
  %241 = trunc i32 %240 to i8
  store i8 %241, ptr %34, align 1, !tbaa !18
  %242 = load i8, ptr %34, align 1, !tbaa !18
  %243 = load i32, ptr %30, align 4, !tbaa !9
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [16 x i8], ptr %32, i64 0, i64 %244
  store i8 %242, ptr %245, align 1, !tbaa !18
  %246 = load i8, ptr %33, align 1, !tbaa !18
  %247 = zext i8 %246 to i32
  %248 = load i32, ptr %30, align 4, !tbaa !9
  %249 = sext i32 %248 to i64
  %250 = getelementptr inbounds [16 x i8], ptr %31, i64 0, i64 %249
  %251 = load i8, ptr %250, align 1, !tbaa !18
  %252 = zext i8 %251 to i32
  %253 = and i32 %252, %247
  %254 = trunc i32 %253 to i8
  store i8 %254, ptr %250, align 1, !tbaa !18
  %255 = load i32, ptr %30, align 4, !tbaa !9
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %30, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 1, ptr %35) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %34) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %33) #4
  br label %257

257:                                              ; preds = %213, %195
  %258 = load ptr, ptr %11, align 8, !tbaa !5
  %259 = getelementptr inbounds [16 x i8], ptr %32, i64 0, i64 0
  %260 = getelementptr inbounds [16 x i8], ptr %25, i64 0, i64 0
  %261 = call i32 @cpAES_XTS_EncBlock(ptr noundef %258, ptr noundef %259, ptr noundef %260, ptr noundef %24)
  %262 = getelementptr inbounds [16 x i8], ptr %31, i64 0, i64 0
  %263 = load ptr, ptr %11, align 8, !tbaa !5
  %264 = getelementptr inbounds i8, ptr %263, i64 16
  %265 = load i32, ptr %30, align 4, !tbaa !9
  call void @CopyBlock(ptr noundef %262, ptr noundef %264, i32 noundef %265)
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %31) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  br label %266

266:                                              ; preds = %257, %192
  store i32 0, ptr %28, align 4
  br label %267

267:                                              ; preds = %266, %161, %114, %98
  call void @llvm.lifetime.end.p0(i64 512, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 512, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 568, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  %268 = load i32, ptr %28, align 4
  switch i32 %268, label %275 [
    i32 0, label %269
    i32 2, label %271
  ]

269:                                              ; preds = %267
  br label %270

270:                                              ; preds = %269
  br label %271

271:                                              ; preds = %270, %267
  %272 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %272, ptr %9, align 4
  store i32 1, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %273

273:                                              ; preds = %271, %78, %69, %65, %61, %57, %53, %49, %42, %38
  %274 = load i32, ptr %9, align 4
  ret i32 %274

275:                                              ; preds = %267
  unreachable
}

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

declare i32 @ippsAESInit(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #2

; 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 @gf_mul_by_primitive(ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @cpXTSwhitening(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @cpXTSxor16(ptr noundef, ptr noundef, ptr noundef, i32 noundef) #0

declare i32 @ippsAESEncryptECB(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @cpAES_XTS_EncBlock(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock16(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock(ptr noundef, ptr noundef, i32 noundef) #3

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 = { "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 = { 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 #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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"_cpRijndael128", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !10, i64 64, !10, i64 68, !7, i64 72}
!13 = !{!12, !10, i64 12}
!14 = !{!12, !6, i64 48}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct._cpRijndael128 = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, [124 x i32] }

@RijEncSbox = external constant [256 x i8], align 64

; Function Attrs: nounwind uwtable
define dso_local i32 @ippsAESEncryptXTS_Direct(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4, ptr noundef %5, i32 noundef %6, i32 noundef %7) local_unnamed_addr #0 {
  %9 = alloca %struct._cpRijndael128, align 16
  %10 = alloca [16 x i8], align 16
  %11 = alloca [512 x i8], align 16
  %12 = alloca [512 x i8], align 16
  %13 = alloca [16 x i8], align 16
  %14 = alloca [16 x i8], align 16
  %15 = icmp slt i32 %7, 128
  br i1 %15, label %92, label %16

16:                                               ; preds = %8
  %17 = icmp eq ptr %5, null
  br i1 %17, label %92, label %18

18:                                               ; preds = %16
  switch i32 %6, label %92 [
    i32 512, label %19
    i32 256, label %19
  ]

19:                                               ; preds = %18, %18
  %20 = icmp eq ptr %4, null
  %21 = icmp eq ptr %0, null
  %or.cond = or i1 %21, %20
  %22 = icmp eq ptr %1, null
  %or.cond105 = or i1 %22, %or.cond
  br i1 %or.cond105, label %92, label %23

23:                                               ; preds = %19
  %24 = icmp slt i32 %2, 128
  br i1 %24, label %92, label %25

25:                                               ; preds = %23
  %26 = icmp ult i32 %2, 134217729
  %27 = lshr i32 %7, 7
  %or.cond3.not = icmp ugt i32 %27, %3
  %or.cond106 = and i1 %26, %or.cond3.not
  br i1 %or.cond106, label %28, label %92

28:                                               ; preds = %25
  %29 = lshr exact i32 %6, 4
  %30 = zext nneg i32 %29 to i64
  %31 = getelementptr inbounds i8, ptr %5, i64 %30
  %32 = lshr i32 %2, 7
  %33 = and i32 %2, 127
  call void @llvm.lifetime.start.p0(i64 568, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %12) #4
  %34 = call i32 @ippsAESInit(ptr noundef nonnull %31, i32 noundef %29, ptr noundef nonnull %9, i32 noundef 568) #4
  %.not = icmp eq i32 %34, 0
  br i1 %.not, label %35, label %91

35:                                               ; preds = %28
  %36 = getelementptr inbounds i8, ptr %9, i64 16
  %37 = load ptr, ptr %36, align 16, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %9, i64 12
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %9, i64 48
  %41 = load ptr, ptr %40, align 16, !tbaa !12
  call void %37(ptr noundef nonnull %4, ptr noundef nonnull %10, i32 noundef %39, ptr noundef %41, ptr noundef nonnull @RijEncSbox) #4
  %42 = call i32 @ippsAESInit(ptr noundef nonnull %5, i32 noundef %29, ptr noundef nonnull %9, i32 noundef 568) #4
  %.not100 = icmp eq i32 %42, 0
  br i1 %.not100, label %.preheader, label %91

.preheader:                                       ; preds = %35
  %.not135 = icmp eq i32 %3, 0
  br i1 %.not135, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.084107 = phi i32 [ %43, %.lr.ph ], [ %3, %.preheader ]
  call void @gf_mul_by_primitive(ptr noundef nonnull %10)
  %43 = add nsw i32 %.084107, -1
  %44 = icmp ugt i32 %.084107, 1
  br i1 %44, label %.lr.ph, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.not101 = icmp ne i32 %33, 0
  %45 = sext i1 %.not101 to i32
  %spec.select = add nsw i32 %32, %45
  %46 = icmp sgt i32 %spec.select, 31
  br i1 %46, label %.lr.ph112, label %._crit_edge113.thread

.lr.ph112:                                        ; preds = %._crit_edge, %.lr.ph112
  %.080110 = phi ptr [ %48, %.lr.ph112 ], [ %0, %._crit_edge ]
  %.081109 = phi ptr [ %49, %.lr.ph112 ], [ %1, %._crit_edge ]
  %.186108 = phi i32 [ %50, %.lr.ph112 ], [ %spec.select, %._crit_edge ]
  call void @cpXTSwhitening(ptr noundef nonnull %11, i32 noundef 32, ptr noundef nonnull %10)
  call void @cpXTSxor16(ptr noundef nonnull %12, ptr noundef nonnull %.080110, ptr noundef nonnull %11, i32 noundef 32)
  %47 = call i32 @ippsAESEncryptECB(ptr noundef nonnull %12, ptr noundef nonnull %.081109, i32 noundef 512, ptr noundef nonnull %9) #4
  call void @cpXTSxor16(ptr noundef nonnull %.081109, ptr noundef nonnull %.081109, ptr noundef nonnull %11, i32 noundef 32)
  %48 = getelementptr inbounds i8, ptr %.080110, i64 512
  %49 = getelementptr inbounds i8, ptr %.081109, i64 512
  %50 = add nsw i32 %.186108, -32
  %51 = icmp ugt i32 %.186108, 63
  %52 = icmp eq i32 %47, 0
  %53 = select i1 %51, i1 %52, i1 false
  br i1 %53, label %.lr.ph112, label %._crit_edge113, !llvm.loop !15

._crit_edge113:                                   ; preds = %.lr.ph112
  br i1 %52, label %._crit_edge113.thread, label %91

._crit_edge113.thread:                            ; preds = %._crit_edge, %._crit_edge113
  %.080.lcssa130 = phi ptr [ %48, %._crit_edge113 ], [ %0, %._crit_edge ]
  %.081.lcssa129 = phi ptr [ %49, %._crit_edge113 ], [ %1, %._crit_edge ]
  %.186.lcssa128 = phi i32 [ %50, %._crit_edge113 ], [ %spec.select, %._crit_edge ]
  %.not103 = icmp eq i32 %.186.lcssa128, 0
  br i1 %.not103, label %60, label %54

54:                                               ; preds = %._crit_edge113.thread
  call void @cpXTSwhitening(ptr noundef nonnull %11, i32 noundef %.186.lcssa128, ptr noundef nonnull %10)
  call void @cpXTSxor16(ptr noundef nonnull %12, ptr noundef nonnull %.080.lcssa130, ptr noundef nonnull %11, i32 noundef %.186.lcssa128)
  %55 = shl nuw nsw i32 %.186.lcssa128, 4
  %56 = call i32 @ippsAESEncryptECB(ptr noundef nonnull %12, ptr noundef nonnull %.081.lcssa129, i32 noundef %55, ptr noundef nonnull %9) #4
  call void @cpXTSxor16(ptr noundef nonnull %.081.lcssa129, ptr noundef nonnull %.081.lcssa129, ptr noundef nonnull %11, i32 noundef %.186.lcssa128)
  %57 = zext nneg i32 %55 to i64
  %58 = getelementptr inbounds i8, ptr %.080.lcssa130, i64 %57
  %59 = getelementptr inbounds i8, ptr %.081.lcssa129, i64 %57
  br label %60

60:                                               ; preds = %54, %._crit_edge113.thread
  %.182 = phi ptr [ %59, %54 ], [ %.081.lcssa129, %._crit_edge113.thread ]
  %.1 = phi ptr [ %58, %54 ], [ %.080.lcssa130, %._crit_edge113.thread ]
  br i1 %.not101, label %61, label %91

61:                                               ; preds = %60
  %62 = lshr i32 %33, 3
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #4
  %63 = call i32 @cpAES_XTS_EncBlock(ptr noundef nonnull %13, ptr noundef %.1, ptr noundef nonnull %10, ptr noundef nonnull %9)
  call void @gf_mul_by_primitive(ptr noundef nonnull %10)
  call void @CopyBlock16(ptr noundef nonnull %13, ptr noundef nonnull %14)
  %64 = getelementptr inbounds i8, ptr %.1, i64 16
  call void @CopyBlock(ptr noundef nonnull %64, ptr noundef nonnull %14, i32 noundef %62)
  %65 = and i32 %2, 7
  %.not104 = icmp eq i32 %65, 0
  br i1 %.not104, label %88, label %66

66:                                               ; preds = %61
  %67 = sub nsw i32 0, %2
  %68 = and i32 %67, 7
  %69 = shl nuw nsw i32 255, %68
  %70 = or disjoint i32 %62, 16
  %71 = zext nneg i32 %70 to i64
  %72 = getelementptr inbounds i8, ptr %.1, i64 %71
  %73 = load i8, ptr %72, align 1, !tbaa !16
  %74 = zext nneg i32 %62 to i64
  %75 = getelementptr inbounds [16 x i8], ptr %13, i64 0, i64 %74
  %76 = load i8, ptr %75, align 1, !tbaa !16
  %77 = zext i8 %73 to i32
  %78 = and i32 %69, %77
  %79 = zext i8 %76 to i32
  %80 = xor i32 %69, -1
  %81 = and i32 %79, %80
  %82 = or disjoint i32 %81, %78
  %83 = trunc nuw i32 %82 to i8
  %84 = getelementptr inbounds [16 x i8], ptr %14, i64 0, i64 %74
  store i8 %83, ptr %84, align 1, !tbaa !16
  %85 = trunc i32 %69 to i8
  %86 = and i8 %76, %85
  store i8 %86, ptr %75, align 1, !tbaa !16
  %87 = add nuw nsw i32 %62, 1
  br label %88

88:                                               ; preds = %66, %61
  %.083 = phi i32 [ %87, %66 ], [ %62, %61 ]
  %89 = call i32 @cpAES_XTS_EncBlock(ptr noundef %.182, ptr noundef nonnull %14, ptr noundef nonnull %10, ptr noundef nonnull %9)
  %90 = getelementptr inbounds i8, ptr %.182, i64 16
  call void @CopyBlock(ptr noundef nonnull %13, ptr noundef nonnull %90, i32 noundef %.083)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #4
  br label %91

91:                                               ; preds = %60, %88, %._crit_edge113, %35, %28
  %.188 = phi i32 [ %34, %28 ], [ %42, %35 ], [ %47, %._crit_edge113 ], [ 0, %88 ], [ 0, %60 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 568, ptr nonnull %9) #4
  br label %92

92:                                               ; preds = %25, %23, %19, %18, %16, %8, %91
  %.0 = phi i32 [ %.188, %91 ], [ -15, %8 ], [ -8, %16 ], [ -15, %18 ], [ -8, %19 ], [ -15, %23 ], [ -5, %25 ]
  ret i32 %.0
}

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

declare i32 @ippsAESInit(ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #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: inlinehint nounwind uwtable
declare hidden void @gf_mul_by_primitive(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @cpXTSwhitening(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @cpXTSxor16(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @ippsAESEncryptECB(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @cpAES_XTS_EncBlock(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock16(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @CopyBlock(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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 = { "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 = { 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 #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, !10, i64 16}
!6 = !{!"_cpRijndael128", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !7, i64 64, !7, i64 68, !8, i64 72}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 12}
!12 = !{!6, !10, i64 48}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!8, !8, i64 0}


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