; LLVM IR from ctlst-tech/catpilot :: bsp/mcu/core/stm32/h753/hal/src (stm32h7xx_hal_i2c)

; 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.__I2C_HandleTypeDef = type { ptr, %struct.I2C_InitTypeDef, ptr, i16, i16, i32, i32, ptr, ptr, ptr, i32, i32, i32, i32, i32 }
%struct.I2C_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.I2C_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.__DMA_HandleTypeDef = type { ptr, %struct.DMA_InitTypeDef, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i32, ptr, ptr, i32 }
%struct.DMA_InitTypeDef = type { 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
declare hidden void @I2C_Enable_IRQ(ptr noundef, i16 noundef zeroext) #1

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

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

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

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

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

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

declare i32 @HAL_DMA_Abort_IT(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_I2C_Slave_Seq_Receive_DMA(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, i32 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 i32, align 4
  %10 = alloca i32, align 4
  %11 = 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 i32 %3, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %12 = load ptr, ptr %6, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %12, i32 0, i32 11
  %14 = load volatile i32, ptr %13, align 4, !tbaa !13
  %15 = and i32 %14, 40
  %16 = icmp eq i32 %15, 40
  br i1 %16, label %17, label %284

17:                                               ; preds = %4
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %24, label %20

20:                                               ; preds = %17
  %21 = load i16, ptr %8, align 2, !tbaa !9
  %22 = zext i16 %21 to i32
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %27

24:                                               ; preds = %20, %17
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %25, i32 0, i32 13
  store volatile i32 512, ptr %26, align 4, !tbaa !16
  store i32 1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

27:                                               ; preds = %20
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  call void @I2C_Disable_IRQ(ptr noundef %28, i16 noundef zeroext -32766)
  br label %29

29:                                               ; preds = %27
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %30, i32 0, i32 10
  %32 = load i32, ptr %31, align 8, !tbaa !17
  %33 = icmp eq i32 %32, 1
  br i1 %33, label %34, label %35

34:                                               ; preds = %29
  store i32 2, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

35:                                               ; preds = %29
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %36, i32 0, i32 10
  store i32 1, ptr %37, align 8, !tbaa !17
  br label %38

38:                                               ; preds = %35
  br label %39

39:                                               ; preds = %38
  br label %40

40:                                               ; preds = %39
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %41, i32 0, i32 11
  %43 = load volatile i32, ptr %42, align 4, !tbaa !13
  %44 = icmp eq i32 %43, 41
  br i1 %44, label %45, label %90

45:                                               ; preds = %40
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  call void @I2C_Disable_IRQ(ptr noundef %46, i16 noundef zeroext 1)
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !18
  %50 = getelementptr inbounds %struct.I2C_TypeDef, ptr %49, i32 0, i32 0
  %51 = load volatile i32, ptr %50, align 4, !tbaa !19
  %52 = zext i32 %51 to i64
  %53 = and i64 %52, 16384
  %54 = icmp eq i64 %53, 16384
  br i1 %54, label %55, label %89

55:                                               ; preds = %45
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %56, i32 0, i32 8
  %58 = load ptr, ptr %57, align 8, !tbaa !21
  %59 = icmp ne ptr %58, null
  br i1 %59, label %60, label %88

60:                                               ; preds = %55
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = getelementptr inbounds %struct.I2C_TypeDef, ptr %63, i32 0, i32 0
  %65 = load volatile i32, ptr %64, align 4, !tbaa !19
  %66 = zext i32 %65 to i64
  %67 = and i64 %66, -16385
  %68 = trunc i64 %67 to i32
  store volatile i32 %68, ptr %64, align 4, !tbaa !19
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %69, i32 0, i32 8
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %71, i32 0, i32 10
  store ptr @I2C_DMAAbort, ptr %72, align 8, !tbaa !22
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %73, i32 0, i32 8
  %75 = load ptr, ptr %74, align 8, !tbaa !21
  %76 = call i32 @HAL_DMA_Abort_IT(ptr noundef %75)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %87

78:                                               ; preds = %60
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %79, i32 0, i32 8
  %81 = load ptr, ptr %80, align 8, !tbaa !21
  %82 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %81, i32 0, i32 10
  %83 = load ptr, ptr %82, align 8, !tbaa !22
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %84, i32 0, i32 8
  %86 = load ptr, ptr %85, align 8, !tbaa !21
  call void %83(ptr noundef %86)
  br label %87

87:                                               ; preds = %78, %60
  br label %88

88:                                               ; preds = %87, %55
  br label %89

89:                                               ; preds = %88, %45
  br label %141

90:                                               ; preds = %40
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %91, i32 0, i32 11
  %93 = load volatile i32, ptr %92, align 4, !tbaa !13
  %94 = icmp eq i32 %93, 42
  br i1 %94, label %95, label %139

95:                                               ; preds = %90
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !18
  %99 = getelementptr inbounds %struct.I2C_TypeDef, ptr %98, i32 0, i32 0
  %100 = load volatile i32, ptr %99, align 4, !tbaa !19
  %101 = zext i32 %100 to i64
  %102 = and i64 %101, 32768
  %103 = icmp eq i64 %102, 32768
  br i1 %103, label %104, label %138

104:                                              ; preds = %95
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !18
  %108 = getelementptr inbounds %struct.I2C_TypeDef, ptr %107, i32 0, i32 0
  %109 = load volatile i32, ptr %108, align 4, !tbaa !19
  %110 = zext i32 %109 to i64
  %111 = and i64 %110, -32769
  %112 = trunc i64 %111 to i32
  store volatile i32 %112, ptr %108, align 4, !tbaa !19
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %113, i32 0, i32 9
  %115 = load ptr, ptr %114, align 8, !tbaa !25
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %137

117:                                              ; preds = %104
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %118, i32 0, i32 9
  %120 = load ptr, ptr %119, align 8, !tbaa !25
  %121 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %120, i32 0, i32 10
  store ptr @I2C_DMAAbort, ptr %121, align 8, !tbaa !22
  %122 = load ptr, ptr %6, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %122, i32 0, i32 9
  %124 = load ptr, ptr %123, align 8, !tbaa !25
  %125 = call i32 @HAL_DMA_Abort_IT(ptr noundef %124)
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %136

127:                                              ; preds = %117
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %128, i32 0, i32 9
  %130 = load ptr, ptr %129, align 8, !tbaa !25
  %131 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %130, i32 0, i32 10
  %132 = load ptr, ptr %131, align 8, !tbaa !22
  %133 = load ptr, ptr %6, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %133, i32 0, i32 9
  %135 = load ptr, ptr %134, align 8, !tbaa !25
  call void %132(ptr noundef %135)
  br label %136

136:                                              ; preds = %127, %117
  br label %137

137:                                              ; preds = %136, %104
  br label %138

138:                                              ; preds = %137, %95
  br label %140

139:                                              ; preds = %90
  br label %140

140:                                              ; preds = %139, %138
  br label %141

141:                                              ; preds = %140, %89
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %142, i32 0, i32 11
  store volatile i32 42, ptr %143, align 4, !tbaa !13
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %144, i32 0, i32 12
  store volatile i32 32, ptr %145, align 8, !tbaa !26
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %146, i32 0, i32 13
  store volatile i32 0, ptr %147, align 4, !tbaa !16
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %148, i32 0, i32 0
  %150 = load ptr, ptr %149, align 8, !tbaa !18
  %151 = getelementptr inbounds %struct.I2C_TypeDef, ptr %150, i32 0, i32 1
  %152 = load volatile i32, ptr %151, align 4, !tbaa !27
  %153 = zext i32 %152 to i64
  %154 = and i64 %153, -32769
  %155 = trunc i64 %154 to i32
  store volatile i32 %155, ptr %151, align 4, !tbaa !27
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %157, i32 0, i32 2
  store ptr %156, ptr %158, align 8, !tbaa !28
  %159 = load i16, ptr %8, align 2, !tbaa !9
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %160, i32 0, i32 4
  store volatile i16 %159, ptr %161, align 2, !tbaa !29
  %162 = load ptr, ptr %6, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %162, i32 0, i32 4
  %164 = load volatile i16, ptr %163, align 2, !tbaa !29
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %165, i32 0, i32 3
  store i16 %164, ptr %166, align 8, !tbaa !30
  %167 = load i32, ptr %9, align 4, !tbaa !11
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %168, i32 0, i32 5
  store volatile i32 %167, ptr %169, align 4, !tbaa !31
  %170 = load ptr, ptr %6, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %170, i32 0, i32 7
  store ptr @I2C_Slave_ISR_DMA, ptr %171, align 8, !tbaa !32
  %172 = load ptr, ptr %6, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %172, i32 0, i32 9
  %174 = load ptr, ptr %173, align 8, !tbaa !25
  %175 = icmp ne ptr %174, null
  br i1 %175, label %176, label %208

176:                                              ; preds = %141
  %177 = load ptr, ptr %6, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %177, i32 0, i32 9
  %179 = load ptr, ptr %178, align 8, !tbaa !25
  %180 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %179, i32 0, i32 5
  store ptr @I2C_DMASlaveReceiveCplt, ptr %180, align 8, !tbaa !33
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %181, i32 0, i32 9
  %183 = load ptr, ptr %182, align 8, !tbaa !25
  %184 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %183, i32 0, i32 9
  store ptr @I2C_DMAError, ptr %184, align 8, !tbaa !34
  %185 = load ptr, ptr %6, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %185, i32 0, i32 9
  %187 = load ptr, ptr %186, align 8, !tbaa !25
  %188 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %187, i32 0, i32 6
  store ptr null, ptr %188, align 8, !tbaa !35
  %189 = load ptr, ptr %6, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %189, i32 0, i32 9
  %191 = load ptr, ptr %190, align 8, !tbaa !25
  %192 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %191, i32 0, i32 10
  store ptr null, ptr %192, align 8, !tbaa !22
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %193, i32 0, i32 9
  %195 = load ptr, ptr %194, align 8, !tbaa !25
  %196 = load ptr, ptr %6, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %196, i32 0, i32 0
  %198 = load ptr, ptr %197, align 8, !tbaa !18
  %199 = getelementptr inbounds %struct.I2C_TypeDef, ptr %198, i32 0, i32 9
  %200 = ptrtoint ptr %199 to i32
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = ptrtoint ptr %201 to i32
  %203 = load ptr, ptr %6, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %203, i32 0, i32 3
  %205 = load i16, ptr %204, align 8, !tbaa !30
  %206 = zext i16 %205 to i32
  %207 = call i32 @HAL_DMA_Start_IT(ptr noundef %195, i32 noundef %200, i32 noundef %202, i32 noundef %206)
  store i32 %207, ptr %10, align 4, !tbaa !11
  br label %222

208:                                              ; preds = %141
  %209 = load ptr, ptr %6, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %209, i32 0, i32 11
  store volatile i32 40, ptr %210, align 4, !tbaa !13
  %211 = load ptr, ptr %6, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %211, i32 0, i32 12
  store volatile i32 0, ptr %212, align 8, !tbaa !26
  %213 = load ptr, ptr %6, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %213, i32 0, i32 13
  %215 = load volatile i32, ptr %214, align 4, !tbaa !16
  %216 = or i32 %215, 128
  store volatile i32 %216, ptr %214, align 4, !tbaa !16
  br label %217

217:                                              ; preds = %208
  %218 = load ptr, ptr %6, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %218, i32 0, i32 10
  store i32 0, ptr %219, align 8, !tbaa !17
  br label %220

220:                                              ; preds = %217
  br label %221

221:                                              ; preds = %220
  store i32 1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

222:                                              ; preds = %176
  %223 = load i32, ptr %10, align 4, !tbaa !11
  %224 = icmp eq i32 %223, 0
  br i1 %224, label %225, label %238

225:                                              ; preds = %222
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %226, i32 0, i32 3
  %228 = load i16, ptr %227, align 8, !tbaa !30
  %229 = zext i16 %228 to i32
  %230 = load ptr, ptr %6, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %230, i32 0, i32 4
  %232 = load volatile i16, ptr %231, align 2, !tbaa !29
  %233 = zext i16 %232 to i32
  %234 = sub nsw i32 %233, %229
  %235 = trunc i32 %234 to i16
  store volatile i16 %235, ptr %231, align 2, !tbaa !29
  %236 = load ptr, ptr %6, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %236, i32 0, i32 3
  store i16 0, ptr %237, align 8, !tbaa !30
  br label %252

238:                                              ; preds = %222
  %239 = load ptr, ptr %6, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %239, i32 0, i32 11
  store volatile i32 40, ptr %240, align 4, !tbaa !13
  %241 = load ptr, ptr %6, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %241, i32 0, i32 12
  store volatile i32 0, ptr %242, align 8, !tbaa !26
  %243 = load ptr, ptr %6, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %243, i32 0, i32 13
  %245 = load volatile i32, ptr %244, align 4, !tbaa !16
  %246 = or i32 %245, 16
  store volatile i32 %246, ptr %244, align 4, !tbaa !16
  br label %247

247:                                              ; preds = %238
  %248 = load ptr, ptr %6, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %248, i32 0, i32 10
  store i32 0, ptr %249, align 8, !tbaa !17
  br label %250

250:                                              ; preds = %247
  br label %251

251:                                              ; preds = %250
  store i32 1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

252:                                              ; preds = %225
  %253 = load ptr, ptr %6, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %253, i32 0, i32 0
  %255 = load ptr, ptr %254, align 8, !tbaa !18
  %256 = getelementptr inbounds %struct.I2C_TypeDef, ptr %255, i32 0, i32 6
  %257 = load volatile i32, ptr %256, align 4, !tbaa !36
  %258 = zext i32 %257 to i64
  %259 = and i64 %258, 65536
  %260 = lshr i64 %259, 16
  %261 = trunc i64 %260 to i8
  %262 = zext i8 %261 to i32
  %263 = icmp eq i32 %262, 0
  br i1 %263, label %264, label %269

264:                                              ; preds = %252
  %265 = load ptr, ptr %6, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %265, i32 0, i32 0
  %267 = load ptr, ptr %266, align 8, !tbaa !18
  %268 = getelementptr inbounds %struct.I2C_TypeDef, ptr %267, i32 0, i32 7
  store volatile i32 8, ptr %268, align 4, !tbaa !37
  br label %269

269:                                              ; preds = %264, %252
  br label %270

270:                                              ; preds = %269
  %271 = load ptr, ptr %6, align 8, !tbaa !5
  %272 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %271, i32 0, i32 10
  store i32 0, ptr %272, align 8, !tbaa !17
  br label %273

273:                                              ; preds = %270
  br label %274

274:                                              ; preds = %273
  %275 = load ptr, ptr %6, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %275, i32 0, i32 0
  %277 = load ptr, ptr %276, align 8, !tbaa !18
  %278 = getelementptr inbounds %struct.I2C_TypeDef, ptr %277, i32 0, i32 0
  %279 = load volatile i32, ptr %278, align 4, !tbaa !19
  %280 = zext i32 %279 to i64
  %281 = or i64 %280, 32768
  %282 = trunc i64 %281 to i32
  store volatile i32 %282, ptr %278, align 4, !tbaa !19
  %283 = load ptr, ptr %6, align 8, !tbaa !5
  call void @I2C_Enable_IRQ(ptr noundef %283, i16 noundef zeroext -32766)
  store i32 0, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

284:                                              ; preds = %4
  store i32 1, ptr %5, align 4
  store i32 1, ptr %11, align 4
  br label %285

285:                                              ; preds = %284, %274, %251, %221, %34, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %286 = load i32, ptr %5, align 4
  ret i32 %286
}

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 92}
!14 = !{!"__I2C_HandleTypeDef", !6, i64 0, !15, i64 8, !6, i64 40, !10, i64 48, !10, i64 50, !12, i64 52, !12, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104}
!15 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!16 = !{!14, !12, i64 100}
!17 = !{!14, !12, i64 88}
!18 = !{!14, !6, i64 0}
!19 = !{!20, !12, i64 0}
!20 = !{!"", !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}
!21 = !{!14, !6, i64 72}
!22 = !{!23, !6, i64 112}
!23 = !{!"__DMA_HandleTypeDef", !6, i64 0, !24, i64 8, !12, i64 56, !12, i64 60, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !12, i64 120, !12, i64 124, !12, i64 128, !6, i64 136, !6, i64 144, !12, i64 152, !6, i64 160, !6, i64 168, !12, i64 176}
!24 = !{!"", !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}
!25 = !{!14, !6, i64 80}
!26 = !{!14, !12, i64 96}
!27 = !{!20, !12, i64 4}
!28 = !{!14, !6, i64 40}
!29 = !{!14, !10, i64 50}
!30 = !{!14, !10, i64 48}
!31 = !{!14, !12, i64 52}
!32 = !{!14, !6, i64 64}
!33 = !{!23, !6, i64 72}
!34 = !{!23, !6, i64 104}
!35 = !{!23, !6, i64 80}
!36 = !{!20, !12, i64 24}
!37 = !{!20, !12, i64 28}


; 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
declare hidden void @I2C_Enable_IRQ(ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

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

declare i32 @HAL_DMA_Start_IT(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

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

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

declare i32 @HAL_DMA_Abort_IT(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @HAL_I2C_Slave_Seq_Receive_DMA(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 92
  %6 = load volatile i32, ptr %5, align 4, !tbaa !5
  %7 = and i32 %6, 40
  %8 = icmp eq i32 %7, 40
  br i1 %8, label %9, label %99

9:                                                ; preds = %4
  %10 = icmp eq ptr %1, null
  %11 = icmp eq i16 %2, 0
  %or.cond = or i1 %10, %11
  br i1 %or.cond, label %12, label %14

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 100
  store volatile i32 512, ptr %13, align 4, !tbaa !13
  br label %99

14:                                               ; preds = %9
  tail call void @I2C_Disable_IRQ(ptr noundef nonnull %0, i16 noundef zeroext -32766)
  %15 = getelementptr inbounds i8, ptr %0, i64 88
  %16 = load i32, ptr %15, align 8, !tbaa !14
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %99, label %18

18:                                               ; preds = %14
  store i32 1, ptr %15, align 8, !tbaa !14
  %19 = load volatile i32, ptr %5, align 4, !tbaa !5
  %20 = icmp eq i32 %19, 41
  br i1 %20, label %21, label %33

21:                                               ; preds = %18
  tail call void @I2C_Disable_IRQ(ptr noundef nonnull %0, i16 noundef zeroext 1)
  %22 = load ptr, ptr %0, align 8, !tbaa !15
  %23 = load volatile i32, ptr %22, align 4, !tbaa !16
  %24 = and i32 %23, 16384
  %.not70 = icmp eq i32 %24, 0
  br i1 %.not70, label %51, label %25

25:                                               ; preds = %21
  %26 = getelementptr inbounds i8, ptr %0, i64 72
  %27 = load ptr, ptr %26, align 8, !tbaa !18
  %.not71 = icmp eq ptr %27, null
  br i1 %.not71, label %51, label %28

28:                                               ; preds = %25
  %29 = load volatile i32, ptr %22, align 4, !tbaa !16
  %30 = and i32 %29, -16385
  store volatile i32 %30, ptr %22, align 4, !tbaa !16
  %31 = getelementptr inbounds i8, ptr %27, i64 112
  store ptr @I2C_DMAAbort, ptr %31, align 8, !tbaa !19
  %32 = tail call i32 @HAL_DMA_Abort_IT(ptr noundef nonnull %27) #2
  %.not72 = icmp eq i32 %32, 0
  br i1 %.not72, label %51, label %.sink.split

33:                                               ; preds = %18
  %34 = load volatile i32, ptr %5, align 4, !tbaa !5
  %35 = icmp eq i32 %34, 42
  br i1 %35, label %36, label %51

36:                                               ; preds = %33
  %37 = load ptr, ptr %0, align 8, !tbaa !15
  %38 = load volatile i32, ptr %37, align 4, !tbaa !16
  %39 = and i32 %38, 32768
  %.not = icmp eq i32 %39, 0
  br i1 %.not, label %51, label %40

40:                                               ; preds = %36
  %41 = load volatile i32, ptr %37, align 4, !tbaa !16
  %42 = and i32 %41, -32769
  store volatile i32 %42, ptr %37, align 4, !tbaa !16
  %43 = getelementptr inbounds i8, ptr %0, i64 80
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %.not68 = icmp eq ptr %44, null
  br i1 %.not68, label %51, label %45

45:                                               ; preds = %40
  %46 = getelementptr inbounds i8, ptr %44, i64 112
  store ptr @I2C_DMAAbort, ptr %46, align 8, !tbaa !19
  %47 = tail call i32 @HAL_DMA_Abort_IT(ptr noundef nonnull %44) #2
  %.not69 = icmp eq i32 %47, 0
  br i1 %.not69, label %51, label %.sink.split

.sink.split:                                      ; preds = %45, %28
  %.sink77 = phi ptr [ %26, %28 ], [ %43, %45 ]
  %48 = load ptr, ptr %.sink77, align 8, !tbaa !23
  %49 = getelementptr inbounds i8, ptr %48, i64 112
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  tail call void %50(ptr noundef %48) #2
  br label %51

51:                                               ; preds = %.sink.split, %40, %45, %36, %33, %21, %28, %25
  store volatile i32 42, ptr %5, align 4, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %0, i64 96
  store volatile i32 32, ptr %52, align 8, !tbaa !24
  %53 = getelementptr inbounds i8, ptr %0, i64 100
  store volatile i32 0, ptr %53, align 4, !tbaa !13
  %54 = load ptr, ptr %0, align 8, !tbaa !15
  %55 = getelementptr inbounds i8, ptr %54, i64 4
  %56 = load volatile i32, ptr %55, align 4, !tbaa !25
  %57 = and i32 %56, -32769
  store volatile i32 %57, ptr %55, align 4, !tbaa !25
  %58 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %1, ptr %58, align 8, !tbaa !26
  %59 = getelementptr inbounds i8, ptr %0, i64 50
  store volatile i16 %2, ptr %59, align 2, !tbaa !27
  %60 = load volatile i16, ptr %59, align 2, !tbaa !27
  %61 = getelementptr inbounds i8, ptr %0, i64 48
  store i16 %60, ptr %61, align 8, !tbaa !28
  %62 = getelementptr inbounds i8, ptr %0, i64 52
  store volatile i32 %3, ptr %62, align 4, !tbaa !29
  %63 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr @I2C_Slave_ISR_DMA, ptr %63, align 8, !tbaa !30
  %64 = getelementptr inbounds i8, ptr %0, i64 80
  %65 = load ptr, ptr %64, align 8, !tbaa !22
  %.not73 = icmp eq ptr %65, null
  br i1 %.not73, label %79, label %66

66:                                               ; preds = %51
  %67 = getelementptr inbounds i8, ptr %65, i64 72
  store ptr @I2C_DMASlaveReceiveCplt, ptr %67, align 8, !tbaa !31
  %68 = getelementptr inbounds i8, ptr %65, i64 104
  store ptr @I2C_DMAError, ptr %68, align 8, !tbaa !32
  %69 = getelementptr inbounds i8, ptr %65, i64 80
  store ptr null, ptr %69, align 8, !tbaa !33
  %70 = getelementptr inbounds i8, ptr %65, i64 112
  store ptr null, ptr %70, align 8, !tbaa !19
  %71 = getelementptr inbounds i8, ptr %54, i64 36
  %72 = ptrtoint ptr %71 to i64
  %73 = trunc i64 %72 to i32
  %74 = ptrtoint ptr %1 to i64
  %75 = trunc i64 %74 to i32
  %76 = zext i16 %60 to i32
  %77 = tail call i32 @HAL_DMA_Start_IT(ptr noundef nonnull %65, i32 noundef %73, i32 noundef %75, i32 noundef %76) #2
  %78 = icmp eq i32 %77, 0
  br i1 %78, label %82, label %91

79:                                               ; preds = %51
  store volatile i32 40, ptr %5, align 4, !tbaa !5
  store volatile i32 0, ptr %52, align 8, !tbaa !24
  %80 = load volatile i32, ptr %53, align 4, !tbaa !13
  %81 = or i32 %80, 128
  store volatile i32 %81, ptr %53, align 4, !tbaa !13
  store i32 0, ptr %15, align 8, !tbaa !14
  br label %99

82:                                               ; preds = %66
  %83 = load i16, ptr %61, align 8, !tbaa !28
  %84 = load volatile i16, ptr %59, align 2, !tbaa !27
  %85 = sub i16 %84, %83
  store volatile i16 %85, ptr %59, align 2, !tbaa !27
  store i16 0, ptr %61, align 8, !tbaa !28
  %86 = load ptr, ptr %0, align 8, !tbaa !15
  %87 = getelementptr inbounds i8, ptr %86, i64 24
  %88 = load volatile i32, ptr %87, align 4, !tbaa !34
  %89 = and i32 %88, 65536
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %94, label %96

91:                                               ; preds = %66
  store volatile i32 40, ptr %5, align 4, !tbaa !5
  store volatile i32 0, ptr %52, align 8, !tbaa !24
  %92 = load volatile i32, ptr %53, align 4, !tbaa !13
  %93 = or i32 %92, 16
  store volatile i32 %93, ptr %53, align 4, !tbaa !13
  store i32 0, ptr %15, align 8, !tbaa !14
  br label %99

94:                                               ; preds = %82
  %95 = getelementptr inbounds i8, ptr %86, i64 28
  store volatile i32 8, ptr %95, align 4, !tbaa !35
  br label %96

96:                                               ; preds = %82, %94
  store i32 0, ptr %15, align 8, !tbaa !14
  %97 = load volatile i32, ptr %86, align 4, !tbaa !16
  %98 = or i32 %97, 32768
  store volatile i32 %98, ptr %86, align 4, !tbaa !16
  tail call void @I2C_Enable_IRQ(ptr noundef nonnull %0, i16 noundef zeroext -32766)
  br label %99

99:                                               ; preds = %4, %14, %96, %91, %79, %12
  %.0 = phi i32 [ 1, %12 ], [ 0, %96 ], [ 1, %91 ], [ 1, %79 ], [ 2, %14 ], [ 1, %4 ]
  ret i32 %.0
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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, !11, i64 92}
!6 = !{!"__I2C_HandleTypeDef", !7, i64 0, !10, i64 8, !7, i64 40, !12, i64 48, !12, i64 50, !11, i64 52, !11, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104}
!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 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !11, i64 100}
!14 = !{!6, !11, i64 88}
!15 = !{!6, !7, i64 0}
!16 = !{!17, !11, i64 0}
!17 = !{!"", !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}
!18 = !{!6, !7, i64 72}
!19 = !{!20, !7, i64 112}
!20 = !{!"__DMA_HandleTypeDef", !7, i64 0, !21, i64 8, !11, i64 56, !11, i64 60, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !11, i64 120, !11, i64 124, !11, i64 128, !7, i64 136, !7, i64 144, !11, i64 152, !7, i64 160, !7, i64 168, !11, i64 176}
!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}
!22 = !{!6, !7, i64 80}
!23 = !{!7, !7, i64 0}
!24 = !{!6, !11, i64 96}
!25 = !{!17, !11, i64 4}
!26 = !{!6, !7, i64 40}
!27 = !{!6, !12, i64 50}
!28 = !{!6, !12, i64 48}
!29 = !{!6, !11, i64 52}
!30 = !{!6, !7, i64 64}
!31 = !{!20, !7, i64 72}
!32 = !{!20, !7, i64 104}
!33 = !{!20, !7, i64 80}
!34 = !{!17, !11, i64 24}
!35 = !{!17, !11, i64 28}


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