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

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

25:                                               ; preds = %20
  store i32 2, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %303

26:                                               ; preds = %20
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %27, i32 0, i32 11
  store i32 1, ptr %28, align 8, !tbaa !16
  br label %29

29:                                               ; preds = %26
  br label %30

30:                                               ; preds = %29
  br label %31

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

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

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

58:                                               ; preds = %54, %47
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !23
  %62 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %61, i32 0, i32 0
  %63 = load volatile i32, ptr %62, align 4, !tbaa !24
  %64 = zext i32 %63 to i64
  %65 = and i64 %64, -5
  %66 = or i64 %65, 0
  %67 = trunc i64 %66 to i32
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %68, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !23
  %71 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %70, i32 0, i32 0
  store volatile i32 %67, ptr %71, align 4, !tbaa !24
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !23
  %75 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %74, i32 0, i32 0
  %76 = load volatile i32, ptr %75, align 4, !tbaa !24
  %77 = zext i32 %76 to i64
  %78 = and i64 %77, 524344
  %79 = trunc i64 %78 to i32
  store i32 %79, ptr %10, align 4, !tbaa !11
  %80 = load i32, ptr %10, align 4, !tbaa !11
  switch i32 %80, label %290 [
    i32 16, label %81
    i32 24, label %81
    i32 0, label %81
    i32 8, label %81
    i32 32, label %214
    i32 40, label %214
    i32 48, label %214
    i32 524288, label %284
    i32 524296, label %287
  ]

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

106:                                              ; preds = %81
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %107, i32 0, i32 1
  %109 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %108, i32 0, i32 4
  %110 = load i32, ptr %109, align 8, !tbaa !29
  %111 = zext i32 %110 to i64
  %112 = icmp eq i64 %111, 8
  br i1 %112, label %113, label %154

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

154:                                              ; preds = %113, %106
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %155, i32 0, i32 1
  %157 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %156, i32 0, i32 4
  %158 = load i32, ptr %157, align 8, !tbaa !29
  %159 = zext i32 %158 to i64
  %160 = icmp eq i64 %159, 24
  br i1 %160, label %168, label %161

161:                                              ; preds = %154
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %162, i32 0, i32 1
  %164 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %163, i32 0, i32 4
  %165 = load i32, ptr %164, align 8, !tbaa !29
  %166 = zext i32 %165 to i64
  %167 = icmp eq i64 %166, 8
  br i1 %167, label %168, label %188

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

188:                                              ; preds = %168, %161
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !23
  %192 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %191, i32 0, i32 0
  %193 = load volatile i32, ptr %192, align 4, !tbaa !24
  %194 = zext i32 %193 to i64
  %195 = or i64 %194, 16384
  %196 = trunc i64 %195 to i32
  store volatile i32 %196, ptr %192, align 4, !tbaa !24
  %197 = load ptr, ptr %6, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %197, i32 0, i32 8
  store i32 2, ptr %198, align 8, !tbaa !37
  %199 = load ptr, ptr %6, align 8, !tbaa !5
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %200, i32 0, i32 2
  %202 = load ptr, ptr %201, align 8, !tbaa !19
  %203 = ptrtoint ptr %202 to i32
  %204 = load ptr, ptr %6, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %204, i32 0, i32 7
  %206 = load i16, ptr %205, align 2, !tbaa !22
  %207 = zext i16 %206 to i32
  %208 = udiv i32 %207, 4
  %209 = trunc i32 %208 to i16
  %210 = load ptr, ptr %6, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %210, i32 0, i32 3
  %212 = load ptr, ptr %211, align 8, !tbaa !20
  %213 = ptrtoint ptr %212 to i32
  call void @CRYP_SetDMAConfig(ptr noundef %199, i32 noundef %203, i16 noundef zeroext %209, i32 noundef %213)
  br label %295

214:                                              ; preds = %58, %58, %58
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = load ptr, ptr %6, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %216, i32 0, i32 1
  %218 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 4, !tbaa !38
  call void @CRYP_SetKey(ptr noundef %215, i32 noundef %219)
  %220 = load ptr, ptr %6, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %220, i32 0, i32 1
  %222 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %221, i32 0, i32 4
  %223 = load i32, ptr %222, align 8, !tbaa !29
  %224 = zext i32 %223 to i64
  %225 = icmp ne i64 %224, 32
  br i1 %225, label %226, label %266

226:                                              ; preds = %214
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %227, i32 0, i32 1
  %229 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %228, i32 0, i32 3
  %230 = load ptr, ptr %229, align 8, !tbaa !34
  %231 = load i32, ptr %230, align 4, !tbaa !11
  %232 = load ptr, ptr %6, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %232, i32 0, i32 0
  %234 = load ptr, ptr %233, align 8, !tbaa !23
  %235 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %234, i32 0, i32 16
  store volatile i32 %231, ptr %235, align 4, !tbaa !35
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %236, i32 0, i32 1
  %238 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %237, i32 0, i32 3
  %239 = load ptr, ptr %238, align 8, !tbaa !34
  %240 = getelementptr inbounds i32, ptr %239, i64 1
  %241 = load i32, ptr %240, align 4, !tbaa !11
  %242 = load ptr, ptr %6, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %242, i32 0, i32 0
  %244 = load ptr, ptr %243, align 8, !tbaa !23
  %245 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %244, i32 0, i32 17
  store volatile i32 %241, ptr %245, align 4, !tbaa !36
  %246 = load ptr, ptr %6, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %246, i32 0, i32 1
  %248 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %247, i32 0, i32 3
  %249 = load ptr, ptr %248, align 8, !tbaa !34
  %250 = getelementptr inbounds i32, ptr %249, i64 2
  %251 = load i32, ptr %250, align 4, !tbaa !11
  %252 = load ptr, ptr %6, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %252, i32 0, i32 0
  %254 = load ptr, ptr %253, align 8, !tbaa !23
  %255 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %254, i32 0, i32 18
  store volatile i32 %251, ptr %255, align 4, !tbaa !39
  %256 = load ptr, ptr %6, align 8, !tbaa !5
  %257 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %256, i32 0, i32 1
  %258 = getelementptr inbounds %struct.CRYP_ConfigTypeDef, ptr %257, i32 0, i32 3
  %259 = load ptr, ptr %258, align 8, !tbaa !34
  %260 = getelementptr inbounds i32, ptr %259, i64 3
  %261 = load i32, ptr %260, align 4, !tbaa !11
  %262 = load ptr, ptr %6, align 8, !tbaa !5
  %263 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %262, i32 0, i32 0
  %264 = load ptr, ptr %263, align 8, !tbaa !23
  %265 = getelementptr inbounds %struct.CRYP_TypeDef, ptr %264, i32 0, i32 19
  store volatile i32 %261, ptr %265, align 4, !tbaa !40
  br label %266

266:                                              ; preds = %226, %214
  %267 = load ptr, ptr %6, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %267, i32 0, i32 8
  store i32 2, ptr %268, align 8, !tbaa !37
  %269 = load ptr, ptr %6, align 8, !tbaa !5
  %270 = load ptr, ptr %6, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %270, i32 0, i32 2
  %272 = load ptr, ptr %271, align 8, !tbaa !19
  %273 = ptrtoint ptr %272 to i32
  %274 = load ptr, ptr %6, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %274, i32 0, i32 7
  %276 = load i16, ptr %275, align 2, !tbaa !22
  %277 = zext i16 %276 to i32
  %278 = udiv i32 %277, 4
  %279 = trunc i32 %278 to i16
  %280 = load ptr, ptr %6, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %280, i32 0, i32 3
  %282 = load ptr, ptr %281, align 8, !tbaa !20
  %283 = ptrtoint ptr %282 to i32
  call void @CRYP_SetDMAConfig(ptr noundef %269, i32 noundef %273, i16 noundef zeroext %279, i32 noundef %283)
  br label %295

284:                                              ; preds = %58
  %285 = load ptr, ptr %6, align 8, !tbaa !5
  %286 = call i32 @CRYP_AESGCM_Process_DMA(ptr noundef %285)
  store i32 %286, ptr %11, align 4, !tbaa !11
  br label %295

287:                                              ; preds = %58
  %288 = load ptr, ptr %6, align 8, !tbaa !5
  %289 = call i32 @CRYP_AESCCM_Process_DMA(ptr noundef %288)
  store i32 %289, ptr %11, align 4, !tbaa !11
  br label %295

290:                                              ; preds = %58
  %291 = load ptr, ptr %6, align 8, !tbaa !5
  %292 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %291, i32 0, i32 13
  %293 = load volatile i32, ptr %292, align 8, !tbaa !41
  %294 = or i32 %293, 32
  store volatile i32 %294, ptr %292, align 8, !tbaa !41
  store i32 1, ptr %11, align 4, !tbaa !11
  br label %295

295:                                              ; preds = %290, %287, %284, %266, %188
  br label %301

296:                                              ; preds = %4
  %297 = load ptr, ptr %6, align 8, !tbaa !5
  %298 = getelementptr inbounds %struct.CRYP_HandleTypeDef, ptr %297, i32 0, i32 13
  %299 = load volatile i32, ptr %298, align 8, !tbaa !41
  %300 = or i32 %299, 8
  store volatile i32 %300, ptr %298, align 8, !tbaa !41
  store i32 1, ptr %11, align 4, !tbaa !11
  br label %301

301:                                              ; preds = %296, %295
  %302 = load i32, ptr %11, align 4, !tbaa !11
  store i32 %302, ptr %5, align 4
  store i32 1, ptr %12, align 4
  br label %303

303:                                              ; preds = %301, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  %304 = load i32, ptr %5, align 4
  ret i32 %304
}

; Function Attrs: nounwind uwtable
declare hidden void @CRYP_SetDMAConfig(ptr noundef, i32 noundef, i16 noundef zeroext, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @CRYP_AESGCM_Process_DMA(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @CRYP_AESCCM_Process_DMA(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 12}
!39 = !{!25, !12, i64 72}
!40 = !{!25, !12, i64 76}
!41 = !{!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_DMA(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 124
  %6 = load volatile i32, ptr %5, align 4, !tbaa !5
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %8, label %105

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

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

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

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

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

58:                                               ; preds = %37, %27, %50
  %59 = load volatile i32, ptr %22, align 4, !tbaa !20
  %60 = or i32 %59, 16384
  store volatile i32 %60, ptr %22, align 4, !tbaa !20
  %61 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 2, ptr %61, align 8, !tbaa !34
  %62 = ptrtoint ptr %1 to i64
  %63 = trunc i64 %62 to i32
  %64 = lshr i16 %spec.select, 2
  %65 = ptrtoint ptr %3 to i64
  %66 = trunc i64 %65 to i32
  tail call void @CRYP_SetDMAConfig(ptr noundef nonnull %0, i32 noundef %63, i16 noundef zeroext %64, i32 noundef %66)
  br label %109

67:                                               ; preds = %12, %12, %12
  %68 = getelementptr inbounds i8, ptr %0, i64 12
  %69 = load i32, ptr %68, align 4, !tbaa !35
  tail call void @CRYP_SetKey(ptr noundef nonnull %0, i32 noundef %69)
  %70 = getelementptr inbounds i8, ptr %0, i64 32
  %71 = load i32, ptr %70, align 8, !tbaa !26
  %.not = icmp eq i32 %71, 32
  br i1 %.not, label %87, label %72

72:                                               ; preds = %67
  %73 = getelementptr inbounds i8, ptr %0, i64 24
  %74 = load ptr, ptr %73, align 8, !tbaa !31
  %75 = load i32, ptr %74, align 4, !tbaa !23
  %76 = load ptr, ptr %0, align 8, !tbaa !19
  %77 = getelementptr inbounds i8, ptr %76, i64 64
  store volatile i32 %75, ptr %77, align 4, !tbaa !32
  %78 = getelementptr inbounds i8, ptr %74, i64 4
  %79 = load i32, ptr %78, align 4, !tbaa !23
  %80 = getelementptr inbounds i8, ptr %76, i64 68
  store volatile i32 %79, ptr %80, align 4, !tbaa !33
  %81 = getelementptr inbounds i8, ptr %74, i64 8
  %82 = load i32, ptr %81, align 4, !tbaa !23
  %83 = getelementptr inbounds i8, ptr %76, i64 72
  store volatile i32 %82, ptr %83, align 4, !tbaa !36
  %84 = getelementptr inbounds i8, ptr %74, i64 12
  %85 = load i32, ptr %84, align 4, !tbaa !23
  %86 = getelementptr inbounds i8, ptr %76, i64 76
  store volatile i32 %85, ptr %86, align 4, !tbaa !37
  br label %87

87:                                               ; preds = %72, %67
  %88 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 2, ptr %88, align 8, !tbaa !34
  %89 = load ptr, ptr %15, align 8, !tbaa !16
  %90 = ptrtoint ptr %89 to i64
  %91 = trunc i64 %90 to i32
  %92 = load i16, ptr %21, align 2, !tbaa !38
  %93 = lshr i16 %92, 2
  %94 = load ptr, ptr %16, align 8, !tbaa !17
  %95 = ptrtoint ptr %94 to i64
  %96 = trunc i64 %95 to i32
  tail call void @CRYP_SetDMAConfig(ptr noundef nonnull %0, i32 noundef %91, i16 noundef zeroext %93, i32 noundef %96)
  br label %109

97:                                               ; preds = %12
  %98 = tail call i32 @CRYP_AESGCM_Process_DMA(ptr noundef nonnull %0)
  br label %109

99:                                               ; preds = %12
  %100 = tail call i32 @CRYP_AESCCM_Process_DMA(ptr noundef nonnull %0)
  br label %109

101:                                              ; preds = %12
  %102 = getelementptr inbounds i8, ptr %0, i64 128
  %103 = load volatile i32, ptr %102, align 8, !tbaa !39
  %104 = or i32 %103, 32
  store volatile i32 %104, ptr %102, align 8, !tbaa !39
  br label %109

105:                                              ; preds = %4
  %106 = getelementptr inbounds i8, ptr %0, i64 128
  %107 = load volatile i32, ptr %106, align 8, !tbaa !39
  %108 = or i32 %107, 8
  store volatile i32 %108, ptr %106, align 8, !tbaa !39
  br label %109

109:                                              ; preds = %105, %101, %99, %97, %87, %58, %8
  %.066 = phi i32 [ 2, %8 ], [ 1, %101 ], [ %100, %99 ], [ %98, %97 ], [ 0, %87 ], [ 0, %58 ], [ 1, %105 ]
  ret i32 %.066
}

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

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

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

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

!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 12}
!36 = !{!21, !11, i64 72}
!37 = !{!21, !11, i64 76}
!38 = !{!6, !12, i64 94}
!39 = !{!6, !11, i64 128}


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