; LLVM IR from lichen-community-systems/signaletic :: hosts/daisy/vendor/libDaisy/Drivers/STM32H7xx_HAL_Driver/Src (Encrypt)

; 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.CRYP_HandleTypeDef = type { ptr, %struct.CRYP_ConfigTypeDef, ptr, ptr, i16, i16, i16, i16, i32, ptr, ptr, i32, i32, i32, i32 }
%struct.CRYP_ConfigTypeDef = type { i32, i32, ptr, ptr, i32, ptr, i32, ptr, i32 }
%struct.CRYP_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_CRYP_Encrypt(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, ptr noundef %3, i32 noundef %4) #0 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i16, align 2
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i16 %2, ptr %9, align 2, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  %15 = load ptr, ptr %7, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %15, i32 0, i32 12
  %17 = load volatile i32, ptr %16, align 4, !tbaa !13
  %18 = icmp eq i32 %17, 1
  br i1 %18, label %19, label %233

19:                                               ; preds = %5
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %20, i32 0, i32 12
  store volatile i32 2, ptr %21, align 4, !tbaa !13
  br label %22

22:                                               ; preds = %19
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %23, i32 0, i32 11
  %25 = load i32, ptr %24, align 8, !tbaa !16
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  store i32 2, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %245

28:                                               ; preds = %22
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %29, i32 0, i32 11
  store i32 1, ptr %30, align 8, !tbaa !16
  br label %31

31:                                               ; preds = %28
  br label %32

32:                                               ; preds = %31
  br label %33

33:                                               ; preds = %32
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %34, i32 0, i32 5
  store volatile i16 0, ptr %35, align 2, !tbaa !17
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %36, i32 0, i32 6
  store volatile i16 0, ptr %37, align 4, !tbaa !18
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %39, i32 0, i32 2
  store ptr %38, ptr %40, align 8, !tbaa !19
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %42, i32 0, i32 3
  store ptr %41, ptr %43, align 8, !tbaa !20
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %44, i32 0, i32 1
  %46 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %45, i32 0, i32 8
  %47 = load i32, ptr %46, align 8, !tbaa !21
  %48 = icmp eq i32 %47, 0
  br i1 %48, label %49, label %56

49:                                               ; preds = %33
  %50 = load i16, ptr %9, align 2, !tbaa !9
  %51 = zext i16 %50 to i32
  %52 = mul i32 %51, 4
  %53 = trunc i32 %52 to i16
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %54, i32 0, i32 7
  store i16 %53, ptr %55, align 2, !tbaa !22
  br label %60

56:                                               ; preds = %33
  %57 = load i16, ptr %9, align 2, !tbaa !9
  %58 = load ptr, ptr %7, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %58, i32 0, i32 7
  store i16 %57, ptr %59, align 2, !tbaa !22
  br label %60

60:                                               ; preds = %56, %49
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !23
  %64 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %63, i32 0, i32 0
  %65 = load volatile i32, ptr %64, align 4, !tbaa !24
  %66 = zext i32 %65 to i64
  %67 = and i64 %66, -5
  %68 = or i64 %67, 0
  %69 = trunc i64 %68 to i32
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %70, i32 0, i32 0
  %72 = load ptr, ptr %71, align 8, !tbaa !23
  %73 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %72, i32 0, i32 0
  store volatile i32 %69, ptr %73, align 4, !tbaa !24
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !23
  %77 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %76, i32 0, i32 0
  %78 = load volatile i32, ptr %77, align 4, !tbaa !24
  %79 = zext i32 %78 to i64
  %80 = and i64 %79, 524344
  %81 = trunc i64 %80 to i32
  store i32 %81, ptr %12, align 4, !tbaa !11
  %82 = load i32, ptr %12, align 4, !tbaa !11
  switch i32 %82, label %216 [
    i32 16, label %83
    i32 24, label %83
    i32 0, label %83
    i32 8, label %83
    i32 32, label %204
    i32 40, label %204
    i32 48, label %204
    i32 524288, label %208
    i32 524296, label %212
  ]

83:                                               ; preds = %60, %60, %60, %60
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %84, i32 0, i32 1
  %86 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %85, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !26
  %88 = load i32, ptr %87, align 4, !tbaa !11
  %89 = load ptr, ptr %7, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %89, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !23
  %92 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %91, i32 0, i32 10
  store volatile i32 %88, ptr %92, align 4, !tbaa !27
  %93 = load ptr, ptr %7, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %93, i32 0, i32 1
  %95 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %94, i32 0, i32 2
  %96 = load ptr, ptr %95, align 8, !tbaa !26
  %97 = getelementptr inbounds i32, ptr %96, i64 1
  %98 = load i32, ptr %97, align 4, !tbaa !11
  %99 = load ptr, ptr %7, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %99, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !23
  %102 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %101, i32 0, i32 11
  store volatile i32 %98, ptr %102, align 4, !tbaa !28
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %103, i32 0, i32 1
  %105 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %104, i32 0, i32 4
  %106 = load i32, ptr %105, align 8, !tbaa !29
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %115, label %108

108:                                              ; preds = %83
  %109 = load ptr, ptr %7, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %109, i32 0, i32 1
  %111 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %110, i32 0, i32 4
  %112 = load i32, ptr %111, align 8, !tbaa !29
  %113 = zext i32 %112 to i64
  %114 = icmp eq i64 %113, 8
  br i1 %114, label %115, label %156

115:                                              ; preds = %108, %83
  %116 = load ptr, ptr %7, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %116, i32 0, i32 1
  %118 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %117, i32 0, i32 2
  %119 = load ptr, ptr %118, align 8, !tbaa !26
  %120 = getelementptr inbounds i32, ptr %119, i64 2
  %121 = load i32, ptr %120, align 4, !tbaa !11
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !23
  %125 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %124, i32 0, i32 12
  store volatile i32 %121, ptr %125, align 4, !tbaa !30
  %126 = load ptr, ptr %7, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %126, i32 0, i32 1
  %128 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %127, i32 0, i32 2
  %129 = load ptr, ptr %128, align 8, !tbaa !26
  %130 = getelementptr inbounds i32, ptr %129, i64 3
  %131 = load i32, ptr %130, align 4, !tbaa !11
  %132 = load ptr, ptr %7, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %132, i32 0, i32 0
  %134 = load ptr, ptr %133, align 8, !tbaa !23
  %135 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %134, i32 0, i32 13
  store volatile i32 %131, ptr %135, align 4, !tbaa !31
  %136 = load ptr, ptr %7, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %136, i32 0, i32 1
  %138 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %137, i32 0, i32 2
  %139 = load ptr, ptr %138, align 8, !tbaa !26
  %140 = getelementptr inbounds i32, ptr %139, i64 4
  %141 = load i32, ptr %140, align 4, !tbaa !11
  %142 = load ptr, ptr %7, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !23
  %145 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %144, i32 0, i32 14
  store volatile i32 %141, ptr %145, align 4, !tbaa !32
  %146 = load ptr, ptr %7, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %146, i32 0, i32 1
  %148 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %148, align 8, !tbaa !26
  %150 = getelementptr inbounds i32, ptr %149, i64 5
  %151 = load i32, ptr %150, align 4, !tbaa !11
  %152 = load ptr, ptr %7, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !23
  %155 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %154, i32 0, i32 15
  store volatile i32 %151, ptr %155, align 4, !tbaa !33
  br label %156

156:                                              ; preds = %115, %108
  %157 = load ptr, ptr %7, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %157, i32 0, i32 1
  %159 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %158, i32 0, i32 4
  %160 = load i32, ptr %159, align 8, !tbaa !29
  %161 = zext i32 %160 to i64
  %162 = icmp eq i64 %161, 24
  br i1 %162, label %170, label %163

163:                                              ; preds = %156
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %164, i32 0, i32 1
  %166 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %165, i32 0, i32 4
  %167 = load i32, ptr %166, align 8, !tbaa !29
  %168 = zext i32 %167 to i64
  %169 = icmp eq i64 %168, 8
  br i1 %169, label %170, label %190

170:                                              ; preds = %163, %156
  %171 = load ptr, ptr %7, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %171, i32 0, i32 1
  %173 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %172, i32 0, i32 3
  %174 = load ptr, ptr %173, align 8, !tbaa !34
  %175 = load i32, ptr %174, align 4, !tbaa !11
  %176 = load ptr, ptr %7, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %176, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !23
  %179 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %178, i32 0, i32 16
  store volatile i32 %175, ptr %179, align 4, !tbaa !35
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %180, i32 0, i32 1
  %182 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %181, i32 0, i32 3
  %183 = load ptr, ptr %182, align 8, !tbaa !34
  %184 = getelementptr inbounds i32, ptr %183, i64 1
  %185 = load i32, ptr %184, align 4, !tbaa !11
  %186 = load ptr, ptr %7, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %186, i32 0, i32 0
  %188 = load ptr, ptr %187, align 8, !tbaa !23
  %189 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %188, i32 0, i32 17
  store volatile i32 %185, ptr %189, align 4, !tbaa !36
  br label %190

190:                                              ; preds = %170, %163
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %191, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8, !tbaa !23
  %194 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %193, i32 0, i32 0
  %195 = load volatile i32, ptr %194, align 4, !tbaa !24
  %196 = zext i32 %195 to i64
  %197 = or i64 %196, 16384
  %198 = trunc i64 %197 to i32
  store volatile i32 %198, ptr %194, align 4, !tbaa !24
  %199 = load ptr, ptr %7, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %199, i32 0, i32 8
  store i32 2, ptr %200, align 8, !tbaa !37
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = load i32, ptr %11, align 4, !tbaa !11
  %203 = call i32 @CRYP_TDES_Process(ptr noundef %201, i32 noundef %202)
  store i32 %203, ptr %13, align 4, !tbaa !11
  br label %221

204:                                              ; preds = %60, %60, %60
  %205 = load ptr, ptr %7, align 8, !tbaa !5
  %206 = load i32, ptr %11, align 4, !tbaa !11
  %207 = call i32 @CRYP_AES_Encrypt(ptr noundef %205, i32 noundef %206)
  store i32 %207, ptr %13, align 4, !tbaa !11
  br label %221

208:                                              ; preds = %60
  %209 = load ptr, ptr %7, align 8, !tbaa !5
  %210 = load i32, ptr %11, align 4, !tbaa !11
  %211 = call i32 @CRYP_AESGCM_Process(ptr noundef %209, i32 noundef %210)
  store i32 %211, ptr %13, align 4, !tbaa !11
  br label %221

212:                                              ; preds = %60
  %213 = load ptr, ptr %7, align 8, !tbaa !5
  %214 = load i32, ptr %11, align 4, !tbaa !11
  %215 = call i32 @CRYP_AESCCM_Process(ptr noundef %213, i32 noundef %214)
  store i32 %215, ptr %13, align 4, !tbaa !11
  br label %221

216:                                              ; preds = %60
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %217, i32 0, i32 13
  %219 = load volatile i32, ptr %218, align 8, !tbaa !38
  %220 = or i32 %219, 32
  store volatile i32 %220, ptr %218, align 8, !tbaa !38
  store i32 1, ptr %13, align 4, !tbaa !11
  br label %221

221:                                              ; preds = %216, %212, %208, %204, %190
  %222 = load i32, ptr %13, align 4, !tbaa !11
  %223 = icmp eq i32 %222, 0
  br i1 %223, label %224, label %232

224:                                              ; preds = %221
  %225 = load ptr, ptr %7, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %225, i32 0, i32 12
  store volatile i32 1, ptr %226, align 4, !tbaa !13
  br label %227

227:                                              ; preds = %224
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %228, i32 0, i32 11
  store i32 0, ptr %229, align 8, !tbaa !16
  br label %230

230:                                              ; preds = %227
  br label %231

231:                                              ; preds = %230
  br label %232

232:                                              ; preds = %231, %221
  br label %243

233:                                              ; preds = %5
  br label %234

234:                                              ; preds = %233
  %235 = load ptr, ptr %7, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %235, i32 0, i32 11
  store i32 0, ptr %236, align 8, !tbaa !16
  br label %237

237:                                              ; preds = %234
  br label %238

238:                                              ; preds = %237
  %239 = load ptr, ptr %7, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %239, i32 0, i32 13
  %241 = load volatile i32, ptr %240, align 8, !tbaa !38
  %242 = or i32 %241, 8
  store volatile i32 %242, ptr %240, align 8, !tbaa !38
  store i32 1, ptr %13, align 4, !tbaa !11
  br label %243

243:                                              ; preds = %238, %232
  %244 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %244, ptr %6, align 4
  store i32 1, ptr %14, align 4
  br label %245

245:                                              ; preds = %243, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  %246 = load i32, ptr %6, align 4
  ret i32 %246
}

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

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

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

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

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

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

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 = { 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 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 124}
!14 = !{!"", !6, i64 0, !15, i64 8, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 90, !10, i64 92, !10, i64 94, !12, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132}
!15 = !{!"", !12, i64 0, !12, i64 4, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 32, !12, i64 40, !6, i64 48, !12, i64 56}
!16 = !{!14, !12, i64 120}
!17 = !{!14, !10, i64 90}
!18 = !{!14, !10, i64 92}
!19 = !{!14, !6, i64 72}
!20 = !{!14, !6, i64 80}
!21 = !{!14, !12, i64 64}
!22 = !{!14, !10, i64 94}
!23 = !{!14, !6, i64 0}
!24 = !{!25, !12, i64 0}
!25 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140}
!26 = !{!14, !6, i64 16}
!27 = !{!25, !12, i64 40}
!28 = !{!25, !12, i64 44}
!29 = !{!14, !12, i64 32}
!30 = !{!25, !12, i64 48}
!31 = !{!25, !12, i64 52}
!32 = !{!25, !12, i64 56}
!33 = !{!25, !12, i64 60}
!34 = !{!14, !6, i64 24}
!35 = !{!25, !12, i64 64}
!36 = !{!25, !12, i64 68}
!37 = !{!14, !12, i64 96}
!38 = !{!14, !12, i64 128}


; 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 i32 @HAL_CRYP_Encrypt(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %0, i64 124
  %7 = load volatile i32, ptr %6, align 4, !tbaa !5
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %9, label %76

9:                                                ; preds = %5
  store volatile i32 2, ptr %6, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 120
  %11 = load i32, ptr %10, align 8, !tbaa !13
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %81, label %13

13:                                               ; preds = %9
  store i32 1, ptr %10, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %0, i64 90
  store volatile i16 0, ptr %14, align 2, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %0, i64 92
  store volatile i16 0, ptr %15, align 4, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  store ptr %1, ptr %16, align 8, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %0, i64 80
  store ptr %3, ptr %17, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %0, i64 64
  %19 = load i32, ptr %18, align 8, !tbaa !18
  %20 = icmp eq i32 %19, 0
  %21 = shl i16 %2, 2
  %spec.select = select i1 %20, i16 %21, i16 %2
  %22 = getelementptr inbounds i8, ptr %0, i64 94
  store i16 %spec.select, ptr %22, align 2
  %23 = load ptr, ptr %0, align 8, !tbaa !19
  %24 = load volatile i32, ptr %23, align 4, !tbaa !20
  %25 = and i32 %24, -5
  store volatile i32 %25, ptr %23, align 4, !tbaa !20
  %26 = load volatile i32, ptr %23, align 4, !tbaa !20
  %27 = and i32 %26, 524344
  switch i32 %27, label %.thread [
    i32 16, label %28
    i32 24, label %28
    i32 0, label %28
    i32 8, label %28
    i32 32, label %64
    i32 40, label %64
    i32 48, label %64
    i32 524288, label %66
    i32 524296, label %68
  ]

28:                                               ; preds = %13, %13, %13, %13
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  %30 = load ptr, ptr %29, align 8, !tbaa !22
  %31 = load i32, ptr %30, align 4, !tbaa !23
  %32 = getelementptr inbounds i8, ptr %23, i64 40
  store volatile i32 %31, ptr %32, align 4, !tbaa !24
  %33 = getelementptr inbounds i8, ptr %30, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !23
  %35 = getelementptr inbounds i8, ptr %23, i64 44
  store volatile i32 %34, ptr %35, align 4, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %0, i64 32
  %37 = load i32, ptr %36, align 8, !tbaa !26
  switch i32 %37, label %59 [
    i32 0, label %38
    i32 8, label %38
    i32 24, label %51
  ]

38:                                               ; preds = %28, %28
  %39 = getelementptr inbounds i8, ptr %30, i64 8
  %40 = load i32, ptr %39, align 4, !tbaa !23
  %41 = getelementptr inbounds i8, ptr %23, i64 48
  store volatile i32 %40, ptr %41, align 4, !tbaa !27
  %42 = getelementptr inbounds i8, ptr %30, i64 12
  %43 = load i32, ptr %42, align 4, !tbaa !23
  %44 = getelementptr inbounds i8, ptr %23, i64 52
  store volatile i32 %43, ptr %44, align 4, !tbaa !28
  %45 = getelementptr inbounds i8, ptr %30, i64 16
  %46 = load i32, ptr %45, align 4, !tbaa !23
  %47 = getelementptr inbounds i8, ptr %23, i64 56
  store volatile i32 %46, ptr %47, align 4, !tbaa !29
  %48 = getelementptr inbounds i8, ptr %30, i64 20
  %49 = load i32, ptr %48, align 4, !tbaa !23
  %50 = getelementptr inbounds i8, ptr %23, i64 60
  store volatile i32 %49, ptr %50, align 4, !tbaa !30
  %cond = icmp eq i32 %37, 8
  br i1 %cond, label %51, label %59

51:                                               ; preds = %38, %28
  %52 = getelementptr inbounds i8, ptr %0, i64 24
  %53 = load ptr, ptr %52, align 8, !tbaa !31
  %54 = load i32, ptr %53, align 4, !tbaa !23
  %55 = getelementptr inbounds i8, ptr %23, i64 64
  store volatile i32 %54, ptr %55, align 4, !tbaa !32
  %56 = getelementptr inbounds i8, ptr %53, i64 4
  %57 = load i32, ptr %56, align 4, !tbaa !23
  %58 = getelementptr inbounds i8, ptr %23, i64 68
  store volatile i32 %57, ptr %58, align 4, !tbaa !33
  br label %59

59:                                               ; preds = %38, %28, %51
  %60 = load volatile i32, ptr %23, align 4, !tbaa !20
  %61 = or i32 %60, 16384
  store volatile i32 %61, ptr %23, align 4, !tbaa !20
  %62 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 2, ptr %62, align 8, !tbaa !34
  %63 = tail call i32 @CRYP_TDES_Process(ptr noundef nonnull %0, i32 noundef %4)
  br label %73

64:                                               ; preds = %13, %13, %13
  %65 = tail call i32 @CRYP_AES_Encrypt(ptr noundef nonnull %0, i32 noundef %4)
  br label %73

66:                                               ; preds = %13
  %67 = tail call i32 @CRYP_AESGCM_Process(ptr noundef nonnull %0, i32 noundef %4)
  br label %73

68:                                               ; preds = %13
  %69 = tail call i32 @CRYP_AESCCM_Process(ptr noundef nonnull %0, i32 noundef %4)
  br label %73

.thread:                                          ; preds = %13
  %70 = getelementptr inbounds i8, ptr %0, i64 128
  %71 = load volatile i32, ptr %70, align 8, !tbaa !35
  %72 = or i32 %71, 32
  store volatile i32 %72, ptr %70, align 8, !tbaa !35
  br label %81

73:                                               ; preds = %68, %66, %64, %59
  %.0 = phi i32 [ %69, %68 ], [ %67, %66 ], [ %65, %64 ], [ %63, %59 ]
  %74 = icmp eq i32 %.0, 0
  br i1 %74, label %75, label %81

75:                                               ; preds = %73
  store volatile i32 1, ptr %6, align 4, !tbaa !5
  store i32 0, ptr %10, align 8, !tbaa !13
  br label %81

76:                                               ; preds = %5
  %77 = getelementptr inbounds i8, ptr %0, i64 120
  store i32 0, ptr %77, align 8, !tbaa !13
  %78 = getelementptr inbounds i8, ptr %0, i64 128
  %79 = load volatile i32, ptr %78, align 8, !tbaa !35
  %80 = or i32 %79, 8
  store volatile i32 %80, ptr %78, align 8, !tbaa !35
  br label %81

81:                                               ; preds = %.thread, %76, %75, %73, %9
  %.056 = phi i32 [ 2, %9 ], [ 0, %75 ], [ %.0, %73 ], [ 1, %76 ], [ 1, %.thread ]
  ret i32 %.056
}

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @CRYP_AESCCM_Process(ptr noundef, i32 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" }

!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, !11, i64 124}
!6 = !{!"", !7, i64 0, !10, i64 8, !7, i64 72, !7, i64 80, !12, i64 88, !12, i64 90, !12, i64 92, !12, i64 94, !11, i64 96, !7, i64 104, !7, i64 112, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 16, !11, i64 24, !7, i64 32, !11, i64 40, !7, i64 48, !11, i64 56}
!11 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !11, i64 120}
!14 = !{!6, !12, i64 90}
!15 = !{!6, !12, i64 92}
!16 = !{!6, !7, i64 72}
!17 = !{!6, !7, i64 80}
!18 = !{!6, !11, i64 64}
!19 = !{!6, !7, i64 0}
!20 = !{!21, !11, i64 0}
!21 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140}
!22 = !{!6, !7, i64 16}
!23 = !{!11, !11, i64 0}
!24 = !{!21, !11, i64 40}
!25 = !{!21, !11, i64 44}
!26 = !{!6, !11, i64 32}
!27 = !{!21, !11, i64 48}
!28 = !{!21, !11, i64 52}
!29 = !{!21, !11, i64 56}
!30 = !{!21, !11, i64 60}
!31 = !{!6, !7, i64 24}
!32 = !{!21, !11, i64 64}
!33 = !{!21, !11, i64 68}
!34 = !{!6, !11, i64 96}
!35 = !{!6, !11, i64 128}


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