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

; 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.__SPI_HandleTypeDef = type { ptr, %struct.SPI_InitTypeDef, ptr, i16, i16, ptr, i16, i16, i32, ptr, ptr, ptr, ptr, i32, i32, i32 }
%struct.SPI_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.SPI_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, [3 x i32], i32, [3 x i32], i32, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_SPI_Init(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %1
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %296

10:                                               ; preds = %1
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %11, i32 0, i32 1
  %13 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %12, i32 0, i32 8
  %14 = load i32, ptr %13, align 8, !tbaa !11
  %15 = zext i32 %14 to i64
  %16 = icmp eq i64 %15, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %10
  br label %18

18:                                               ; preds = %17, %10
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %19, i32 0, i32 1
  %21 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %20, i32 0, i32 9
  store i32 0, ptr %21, align 4, !tbaa !15
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %22, i32 0, i32 0
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = icmp eq ptr %24, inttoptr (i64 1073819648 to ptr)
  br i1 %25, label %44, label %26

26:                                               ; preds = %18
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !16
  %30 = icmp eq ptr %29, inttoptr (i64 1073756160 to ptr)
  br i1 %30, label %44, label %31

31:                                               ; preds = %26
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !16
  %35 = icmp eq ptr %34, inttoptr (i64 1073757184 to ptr)
  br i1 %35, label %44, label %36

36:                                               ; preds = %31
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %37, i32 0, i32 1
  %39 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %38, i32 0, i32 2
  %40 = load i32, ptr %39, align 8, !tbaa !17
  %41 = zext i32 %40 to i64
  %42 = icmp ugt i64 %41, 15
  br i1 %42, label %43, label %44

43:                                               ; preds = %36
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %296

44:                                               ; preds = %36, %31, %26, %18
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = call i32 @SPI_GetPacketSize(ptr noundef %45)
  store i32 %46, ptr %5, align 4, !tbaa !9
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !16
  %50 = icmp eq ptr %49, inttoptr (i64 1073819648 to ptr)
  br i1 %50, label %65, label %51

51:                                               ; preds = %44
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %52, i32 0, i32 0
  %54 = load ptr, ptr %53, align 8, !tbaa !16
  %55 = icmp eq ptr %54, inttoptr (i64 1073756160 to ptr)
  br i1 %55, label %65, label %56

56:                                               ; preds = %51
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = icmp eq ptr %59, inttoptr (i64 1073757184 to ptr)
  br i1 %60, label %65, label %61

61:                                               ; preds = %56
  %62 = load i32, ptr %5, align 4, !tbaa !9
  %63 = zext i32 %62 to i64
  %64 = icmp ugt i64 %63, 8
  br i1 %64, label %84, label %65

65:                                               ; preds = %61, %56, %51, %44
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !16
  %69 = icmp eq ptr %68, inttoptr (i64 1073819648 to ptr)
  br i1 %69, label %80, label %70

70:                                               ; preds = %65
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !16
  %74 = icmp eq ptr %73, inttoptr (i64 1073756160 to ptr)
  br i1 %74, label %80, label %75

75:                                               ; preds = %70
  %76 = load ptr, ptr %3, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !16
  %79 = icmp eq ptr %78, inttoptr (i64 1073757184 to ptr)
  br i1 %79, label %80, label %85

80:                                               ; preds = %75, %70, %65
  %81 = load i32, ptr %5, align 4, !tbaa !9
  %82 = zext i32 %81 to i64
  %83 = icmp ugt i64 %82, 16
  br i1 %83, label %84, label %85

84:                                               ; preds = %80, %61
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %296

85:                                               ; preds = %80, %75
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %86, i32 0, i32 14
  %88 = load volatile i32, ptr %87, align 4, !tbaa !18
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %94

90:                                               ; preds = %85
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %91, i32 0, i32 13
  store i32 0, ptr %92, align 8, !tbaa !19
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  call void @HAL_SPI_MspInit(ptr noundef %93)
  br label %94

94:                                               ; preds = %90, %85
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %95, i32 0, i32 14
  store volatile i32 2, ptr %96, align 4, !tbaa !18
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !16
  %100 = getelementptr inbounds %struct.SPI_TypeDef, ptr %99, i32 0, i32 0
  %101 = load volatile i32, ptr %100, align 4, !tbaa !20
  %102 = zext i32 %101 to i64
  %103 = and i64 %102, -2
  %104 = trunc i64 %103 to i32
  store volatile i32 %104, ptr %100, align 4, !tbaa !20
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %105, i32 0, i32 1
  %107 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %106, i32 0, i32 5
  %108 = load i32, ptr %107, align 4, !tbaa !22
  %109 = zext i32 %108 to i64
  %110 = icmp eq i64 %109, 67108864
  br i1 %110, label %111, label %134

111:                                              ; preds = %94
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %112, i32 0, i32 1
  %114 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !23
  %116 = zext i32 %115 to i64
  %117 = icmp eq i64 %116, 4194304
  br i1 %117, label %118, label %134

118:                                              ; preds = %111
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %119, i32 0, i32 1
  %121 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %120, i32 0, i32 13
  %122 = load i32, ptr %121, align 4, !tbaa !24
  %123 = zext i32 %122 to i64
  %124 = icmp eq i64 %123, 0
  br i1 %124, label %125, label %134

125:                                              ; preds = %118
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %126, i32 0, i32 0
  %128 = load ptr, ptr %127, align 8, !tbaa !16
  %129 = getelementptr inbounds %struct.SPI_TypeDef, ptr %128, i32 0, i32 0
  %130 = load volatile i32, ptr %129, align 4, !tbaa !20
  %131 = zext i32 %130 to i64
  %132 = or i64 %131, 4096
  %133 = trunc i64 %132 to i32
  store volatile i32 %133, ptr %129, align 4, !tbaa !20
  br label %134

134:                                              ; preds = %125, %118, %111, %94
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %135, i32 0, i32 1
  %137 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %136, i32 0, i32 6
  %138 = load i32, ptr %137, align 8, !tbaa !25
  %139 = load ptr, ptr %3, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %139, i32 0, i32 1
  %141 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %140, i32 0, i32 9
  %142 = load i32, ptr %141, align 4, !tbaa !15
  %143 = or i32 %138, %142
  %144 = load i32, ptr %4, align 4, !tbaa !9
  %145 = or i32 %143, %144
  %146 = load ptr, ptr %3, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %146, i32 0, i32 1
  %148 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %147, i32 0, i32 14
  %149 = load i32, ptr %148, align 8, !tbaa !26
  %150 = or i32 %145, %149
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %151, i32 0, i32 1
  %153 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %152, i32 0, i32 2
  %154 = load i32, ptr %153, align 8, !tbaa !17
  %155 = or i32 %150, %154
  %156 = load ptr, ptr %3, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %156, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8, !tbaa !16
  %159 = getelementptr inbounds %struct.SPI_TypeDef, ptr %158, i32 0, i32 2
  store volatile i32 %155, ptr %159, align 4, !tbaa !27
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %160, i32 0, i32 1
  %162 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %161, i32 0, i32 12
  %163 = load i32, ptr %162, align 8, !tbaa !28
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %164, i32 0, i32 1
  %166 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %165, i32 0, i32 8
  %167 = load i32, ptr %166, align 8, !tbaa !11
  %168 = or i32 %163, %167
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %169, i32 0, i32 1
  %171 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %170, i32 0, i32 13
  %172 = load i32, ptr %171, align 4, !tbaa !24
  %173 = or i32 %168, %172
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %174, i32 0, i32 1
  %176 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %175, i32 0, i32 5
  %177 = load i32, ptr %176, align 4, !tbaa !22
  %178 = or i32 %173, %177
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %179, i32 0, i32 1
  %181 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %180, i32 0, i32 3
  %182 = load i32, ptr %181, align 4, !tbaa !29
  %183 = or i32 %178, %182
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %184, i32 0, i32 1
  %186 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %185, i32 0, i32 4
  %187 = load i32, ptr %186, align 8, !tbaa !30
  %188 = or i32 %183, %187
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %189, i32 0, i32 1
  %191 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %190, i32 0, i32 7
  %192 = load i32, ptr %191, align 4, !tbaa !31
  %193 = or i32 %188, %192
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %194, i32 0, i32 1
  %196 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %195, i32 0, i32 0
  %197 = load i32, ptr %196, align 8, !tbaa !23
  %198 = or i32 %193, %197
  %199 = load ptr, ptr %3, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %199, i32 0, i32 1
  %201 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %200, i32 0, i32 18
  %202 = load i32, ptr %201, align 8, !tbaa !32
  %203 = or i32 %198, %202
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %204, i32 0, i32 1
  %206 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %205, i32 0, i32 1
  %207 = load i32, ptr %206, align 4, !tbaa !33
  %208 = or i32 %203, %207
  %209 = load ptr, ptr %3, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %209, i32 0, i32 1
  %211 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %210, i32 0, i32 17
  %212 = load i32, ptr %211, align 4, !tbaa !34
  %213 = or i32 %208, %212
  %214 = load ptr, ptr %3, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %214, i32 0, i32 1
  %216 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %215, i32 0, i32 21
  %217 = load i32, ptr %216, align 4, !tbaa !35
  %218 = or i32 %213, %217
  %219 = load ptr, ptr %3, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %219, i32 0, i32 0
  %221 = load ptr, ptr %220, align 8, !tbaa !16
  %222 = getelementptr inbounds %struct.SPI_TypeDef, ptr %221, i32 0, i32 3
  store volatile i32 %218, ptr %222, align 4, !tbaa !36
  %223 = load ptr, ptr %3, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %223, i32 0, i32 1
  %225 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %224, i32 0, i32 0
  %226 = load i32, ptr %225, align 8, !tbaa !23
  %227 = zext i32 %226 to i64
  %228 = icmp eq i64 %227, 0
  br i1 %228, label %229, label %256

229:                                              ; preds = %134
  %230 = load ptr, ptr %3, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %230, i32 0, i32 0
  %232 = load ptr, ptr %231, align 8, !tbaa !16
  %233 = getelementptr inbounds %struct.SPI_TypeDef, ptr %232, i32 0, i32 2
  %234 = load volatile i32, ptr %233, align 4, !tbaa !27
  %235 = zext i32 %234 to i64
  %236 = and i64 %235, -6145
  %237 = or i64 %236, 2048
  %238 = trunc i64 %237 to i32
  %239 = load ptr, ptr %3, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %239, i32 0, i32 0
  %241 = load ptr, ptr %240, align 8, !tbaa !16
  %242 = getelementptr inbounds %struct.SPI_TypeDef, ptr %241, i32 0, i32 2
  store volatile i32 %238, ptr %242, align 4, !tbaa !27
  %243 = load ptr, ptr %3, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %243, i32 0, i32 0
  %245 = load ptr, ptr %244, align 8, !tbaa !16
  %246 = getelementptr inbounds %struct.SPI_TypeDef, ptr %245, i32 0, i32 2
  %247 = load volatile i32, ptr %246, align 4, !tbaa !27
  %248 = zext i32 %247 to i64
  %249 = and i64 %248, -1537
  %250 = or i64 %249, 1024
  %251 = trunc i64 %250 to i32
  %252 = load ptr, ptr %3, align 8, !tbaa !5
  %253 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %252, i32 0, i32 0
  %254 = load ptr, ptr %253, align 8, !tbaa !16
  %255 = getelementptr inbounds %struct.SPI_TypeDef, ptr %254, i32 0, i32 2
  store volatile i32 %251, ptr %255, align 4, !tbaa !27
  br label %256

256:                                              ; preds = %229, %134
  %257 = load ptr, ptr %3, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %257, i32 0, i32 0
  %259 = load ptr, ptr %258, align 8, !tbaa !16
  %260 = getelementptr inbounds %struct.SPI_TypeDef, ptr %259, i32 0, i32 16
  %261 = load volatile i32, ptr %260, align 4, !tbaa !37
  %262 = zext i32 %261 to i64
  %263 = and i64 %262, -2
  %264 = trunc i64 %263 to i32
  store volatile i32 %264, ptr %260, align 4, !tbaa !37
  %265 = load ptr, ptr %3, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %265, i32 0, i32 1
  %267 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %266, i32 0, i32 0
  %268 = load i32, ptr %267, align 8, !tbaa !23
  %269 = zext i32 %268 to i64
  %270 = and i64 %269, 4194304
  %271 = icmp eq i64 %270, 4194304
  br i1 %271, label %272, label %291

272:                                              ; preds = %256
  %273 = load ptr, ptr %3, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %273, i32 0, i32 0
  %275 = load ptr, ptr %274, align 8, !tbaa !16
  %276 = getelementptr inbounds %struct.SPI_TypeDef, ptr %275, i32 0, i32 3
  %277 = load volatile i32, ptr %276, align 4, !tbaa !36
  %278 = zext i32 %277 to i64
  %279 = and i64 %278, -2147483649
  %280 = load ptr, ptr %3, align 8, !tbaa !5
  %281 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %280, i32 0, i32 1
  %282 = getelementptr inbounds %struct.SPI_InitTypeDef, ptr %281, i32 0, i32 20
  %283 = load i32, ptr %282, align 8, !tbaa !38
  %284 = zext i32 %283 to i64
  %285 = or i64 %279, %284
  %286 = trunc i64 %285 to i32
  %287 = load ptr, ptr %3, align 8, !tbaa !5
  %288 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %287, i32 0, i32 0
  %289 = load ptr, ptr %288, align 8, !tbaa !16
  %290 = getelementptr inbounds %struct.SPI_TypeDef, ptr %289, i32 0, i32 3
  store volatile i32 %286, ptr %290, align 4, !tbaa !36
  br label %291

291:                                              ; preds = %272, %256
  %292 = load ptr, ptr %3, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %292, i32 0, i32 15
  store volatile i32 0, ptr %293, align 8, !tbaa !39
  %294 = load ptr, ptr %3, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.__SPI_HandleTypeDef, ptr %294, i32 0, i32 14
  store volatile i32 1, ptr %295, align 4, !tbaa !18
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %296

296:                                              ; preds = %291, %84, %43, %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  %297 = load i32, ptr %2, align 4
  ret i32 %297
}

; 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 @SPI_GetPacketSize(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_SPI_MspInit(ptr 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 40}
!12 = !{!"__SPI_HandleTypeDef", !6, i64 0, !13, i64 8, !6, i64 96, !14, i64 104, !14, i64 106, !6, i64 112, !14, i64 120, !14, i64 122, !10, i64 124, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !10, i64 160, !10, i64 164, !10, i64 168}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84}
!14 = !{!"short", !7, i64 0}
!15 = !{!12, !10, i64 44}
!16 = !{!12, !6, i64 0}
!17 = !{!12, !10, i64 16}
!18 = !{!12, !10, i64 164}
!19 = !{!12, !10, i64 160}
!20 = !{!21, !10, i64 0}
!21 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !7, i64 36, !10, i64 48, !7, i64 52, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80}
!22 = !{!12, !10, i64 28}
!23 = !{!12, !10, i64 8}
!24 = !{!12, !10, i64 60}
!25 = !{!12, !10, i64 32}
!26 = !{!12, !10, i64 64}
!27 = !{!21, !10, i64 8}
!28 = !{!12, !10, i64 56}
!29 = !{!12, !10, i64 20}
!30 = !{!12, !10, i64 24}
!31 = !{!12, !10, i64 36}
!32 = !{!12, !10, i64 80}
!33 = !{!12, !10, i64 12}
!34 = !{!12, !10, i64 76}
!35 = !{!12, !10, i64 92}
!36 = !{!21, !10, i64 12}
!37 = !{!21, !10, i64 80}
!38 = !{!12, !10, i64 88}
!39 = !{!12, !10, i64 168}


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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @HAL_SPI_Init(ptr noundef %0) local_unnamed_addr #0 {
  %2 = icmp eq ptr %0, null
  br i1 %2, label %113, label %3

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = getelementptr inbounds i8, ptr %0, i64 40
  %6 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 0, ptr %6, align 4, !tbaa !5
  %7 = load ptr, ptr %0, align 8, !tbaa !13
  %magicptr66 = ptrtoint ptr %7 to i64
  switch i64 %magicptr66, label %8 [
    i64 1073819648, label %12
    i64 1073756160, label %12
    i64 1073757184, label %12
  ]

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = load i32, ptr %9, align 8, !tbaa !14
  %11 = icmp ugt i32 %10, 15
  br i1 %11, label %113, label %12

12:                                               ; preds = %3, %3, %3, %8
  %13 = tail call i32 @SPI_GetPacketSize(ptr noundef nonnull %0)
  %14 = load ptr, ptr %0, align 8, !tbaa !13
  %magicptr = ptrtoint ptr %14 to i64
  switch i64 %magicptr, label %15 [
    i64 1073819648, label %22
    i64 1073756160, label %22
  ]

15:                                               ; preds = %12
  %16 = icmp ne ptr %14, inttoptr (i64 1073757184 to ptr)
  %17 = icmp ugt i32 %13, 8
  %or.cond = select i1 %16, i1 %17, i1 false
  br i1 %or.cond, label %113, label %18

18:                                               ; preds = %15
  %cond = icmp eq ptr %14, inttoptr (i64 1073819648 to ptr)
  br i1 %cond, label %22, label %19

19:                                               ; preds = %18
  %20 = icmp eq ptr %14, inttoptr (i64 1073757184 to ptr)
  %21 = icmp ugt i32 %13, 16
  %or.cond5 = select i1 %20, i1 %21, i1 false
  br i1 %or.cond5, label %113, label %23

22:                                               ; preds = %18, %12, %12
  %.old4 = icmp ugt i32 %13, 16
  br i1 %.old4, label %113, label %23

23:                                               ; preds = %22, %19
  %24 = getelementptr inbounds i8, ptr %0, i64 164
  %25 = load volatile i32, ptr %24, align 4, !tbaa !15
  %26 = icmp eq i32 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 0, ptr %28, align 8, !tbaa !16
  tail call void @HAL_SPI_MspInit(ptr noundef nonnull %0)
  br label %29

29:                                               ; preds = %27, %23
  store volatile i32 2, ptr %24, align 4, !tbaa !15
  %30 = load ptr, ptr %0, align 8, !tbaa !13
  %31 = load volatile i32, ptr %30, align 4, !tbaa !17
  %32 = and i32 %31, -2
  store volatile i32 %32, ptr %30, align 4, !tbaa !17
  %33 = getelementptr inbounds i8, ptr %0, i64 28
  %34 = load i32, ptr %33, align 4, !tbaa !19
  %35 = icmp eq i32 %34, 67108864
  br i1 %35, label %36, label %46

36:                                               ; preds = %29
  %37 = load i32, ptr %4, align 8, !tbaa !20
  %38 = icmp eq i32 %37, 4194304
  br i1 %38, label %39, label %46

39:                                               ; preds = %36
  %40 = getelementptr inbounds i8, ptr %0, i64 60
  %41 = load i32, ptr %40, align 4, !tbaa !21
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %46

43:                                               ; preds = %39
  %44 = load volatile i32, ptr %30, align 4, !tbaa !17
  %45 = or i32 %44, 4096
  store volatile i32 %45, ptr %30, align 4, !tbaa !17
  br label %46

46:                                               ; preds = %43, %39, %36, %29
  %47 = getelementptr inbounds i8, ptr %0, i64 32
  %48 = load i32, ptr %47, align 8, !tbaa !22
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = or i32 %49, %48
  %51 = getelementptr inbounds i8, ptr %0, i64 64
  %52 = load i32, ptr %51, align 8, !tbaa !23
  %53 = or i32 %50, %52
  %54 = getelementptr inbounds i8, ptr %0, i64 16
  %55 = load i32, ptr %54, align 8, !tbaa !14
  %56 = or i32 %53, %55
  %57 = getelementptr inbounds i8, ptr %30, i64 8
  store volatile i32 %56, ptr %57, align 4, !tbaa !24
  %58 = getelementptr inbounds i8, ptr %0, i64 56
  %59 = load i32, ptr %58, align 8, !tbaa !25
  %60 = load i32, ptr %5, align 8, !tbaa !26
  %61 = getelementptr inbounds i8, ptr %0, i64 60
  %62 = load i32, ptr %61, align 4, !tbaa !21
  %63 = getelementptr inbounds i8, ptr %0, i64 20
  %64 = load i32, ptr %63, align 4, !tbaa !27
  %65 = getelementptr inbounds i8, ptr %0, i64 24
  %66 = load i32, ptr %65, align 8, !tbaa !28
  %67 = getelementptr inbounds i8, ptr %0, i64 36
  %68 = load i32, ptr %67, align 4, !tbaa !29
  %69 = load i32, ptr %4, align 8, !tbaa !20
  %70 = getelementptr inbounds i8, ptr %0, i64 80
  %71 = load i32, ptr %70, align 8, !tbaa !30
  %72 = getelementptr inbounds i8, ptr %0, i64 12
  %73 = load i32, ptr %72, align 4, !tbaa !31
  %74 = getelementptr inbounds i8, ptr %0, i64 76
  %75 = load i32, ptr %74, align 4, !tbaa !32
  %76 = getelementptr inbounds i8, ptr %0, i64 92
  %77 = load i32, ptr %76, align 4, !tbaa !33
  %78 = or i32 %59, %60
  %79 = or i32 %78, %62
  %80 = or i32 %79, %64
  %81 = or i32 %80, %66
  %82 = or i32 %81, %68
  %83 = or i32 %82, %71
  %84 = or i32 %83, %73
  %85 = or i32 %84, %75
  %86 = or i32 %85, %77
  %87 = or i32 %86, %34
  %88 = or i32 %87, %69
  %89 = getelementptr inbounds i8, ptr %30, i64 12
  store volatile i32 %88, ptr %89, align 4, !tbaa !34
  %90 = icmp eq i32 %69, 0
  br i1 %90, label %.thread, label %100

.thread:                                          ; preds = %46
  %91 = load volatile i32, ptr %57, align 4, !tbaa !24
  %92 = and i32 %91, -6145
  %93 = or disjoint i32 %92, 2048
  store volatile i32 %93, ptr %57, align 4, !tbaa !24
  %94 = load volatile i32, ptr %57, align 4, !tbaa !24
  %95 = and i32 %94, -1537
  %96 = or disjoint i32 %95, 1024
  store volatile i32 %96, ptr %57, align 4, !tbaa !24
  %97 = getelementptr inbounds i8, ptr %30, i64 80
  %98 = load volatile i32, ptr %97, align 4, !tbaa !35
  %99 = and i32 %98, -2
  store volatile i32 %99, ptr %97, align 4, !tbaa !35
  br label %111

100:                                              ; preds = %46
  %101 = getelementptr inbounds i8, ptr %30, i64 80
  %102 = load volatile i32, ptr %101, align 4, !tbaa !35
  %103 = and i32 %102, -2
  store volatile i32 %103, ptr %101, align 4, !tbaa !35
  %104 = and i32 %69, 4194304
  %.not = icmp eq i32 %104, 0
  br i1 %.not, label %111, label %105

105:                                              ; preds = %100
  %106 = load volatile i32, ptr %89, align 4, !tbaa !34
  %107 = and i32 %106, 2147483647
  %108 = getelementptr inbounds i8, ptr %0, i64 88
  %109 = load i32, ptr %108, align 8, !tbaa !36
  %110 = or i32 %107, %109
  store volatile i32 %110, ptr %89, align 4, !tbaa !34
  br label %111

111:                                              ; preds = %.thread, %105, %100
  %112 = getelementptr inbounds i8, ptr %0, i64 168
  store volatile i32 0, ptr %112, align 8, !tbaa !37
  store volatile i32 1, ptr %24, align 4, !tbaa !15
  br label %113

113:                                              ; preds = %22, %15, %19, %8, %1, %111
  %.0 = phi i32 [ 0, %111 ], [ 1, %1 ], [ 1, %8 ], [ 1, %19 ], [ 1, %15 ], [ 1, %22 ]
  ret i32 %.0
}

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

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_SPI_MspInit(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 44}
!6 = !{!"__SPI_HandleTypeDef", !7, i64 0, !10, i64 8, !7, i64 96, !12, i64 104, !12, i64 106, !7, i64 112, !12, i64 120, !12, i64 122, !11, i64 124, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !11, i64 160, !11, i64 164, !11, i64 168}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !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 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !7, i64 0}
!14 = !{!6, !11, i64 16}
!15 = !{!6, !11, i64 164}
!16 = !{!6, !11, i64 160}
!17 = !{!18, !11, i64 0}
!18 = !{!"", !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, !8, i64 36, !11, i64 48, !8, i64 52, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !11, i64 80}
!19 = !{!6, !11, i64 28}
!20 = !{!6, !11, i64 8}
!21 = !{!6, !11, i64 60}
!22 = !{!6, !11, i64 32}
!23 = !{!6, !11, i64 64}
!24 = !{!18, !11, i64 8}
!25 = !{!6, !11, i64 56}
!26 = !{!6, !11, i64 40}
!27 = !{!6, !11, i64 20}
!28 = !{!6, !11, i64 24}
!29 = !{!6, !11, i64 36}
!30 = !{!6, !11, i64 80}
!31 = !{!6, !11, i64 12}
!32 = !{!6, !11, i64 76}
!33 = !{!6, !11, i64 92}
!34 = !{!18, !11, i64 12}
!35 = !{!18, !11, i64 80}
!36 = !{!6, !11, i64 88}
!37 = !{!6, !11, i64 168}


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