; 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.__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.__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 }
%struct.I2C_TypeDef = type { 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: nounwind uwtable
declare hidden void @I2C_TransferConfig(ptr noundef, i16 noundef zeroext, i8 noundef zeroext, i32 noundef, i32 noundef) #1

; 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 i32 @I2C_Master_ISR_IT(ptr noundef, i32 noundef, i32 noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare hidden void @I2C_DMAMasterTransmitCplt(ptr noundef) #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 void @I2C_ConvertOtherXferOptions(ptr noundef) #1

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

20:                                               ; preds = %5
  br label %21

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

26:                                               ; preds = %21
  store i32 2, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %220

27:                                               ; preds = %21
  %28 = load ptr, ptr %7, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %28, i32 0, i32 10
  store i32 1, ptr %29, align 8, !tbaa !16
  br label %30

30:                                               ; preds = %27
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %33, i32 0, i32 11
  store volatile i32 33, ptr %34, align 4, !tbaa !13
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %35, i32 0, i32 12
  store volatile i32 16, ptr %36, align 8, !tbaa !17
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %37, i32 0, i32 13
  store volatile i32 0, ptr %38, align 4, !tbaa !18
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %40, i32 0, i32 2
  store ptr %39, ptr %41, align 8, !tbaa !19
  %42 = load i16, ptr %10, align 2, !tbaa !9
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %43, i32 0, i32 4
  store volatile i16 %42, ptr %44, align 2, !tbaa !20
  %45 = load i32, ptr %11, align 4, !tbaa !11
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %46, i32 0, i32 5
  store volatile i32 %45, ptr %47, align 4, !tbaa !21
  %48 = load ptr, ptr %7, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %48, i32 0, i32 7
  store ptr @I2C_Master_ISR_DMA, ptr %49, align 8, !tbaa !22
  %50 = load ptr, ptr %7, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %50, i32 0, i32 4
  %52 = load volatile i16, ptr %51, align 2, !tbaa !20
  %53 = zext i16 %52 to i32
  %54 = icmp ugt i32 %53, 255
  br i1 %54, label %55, label %58

55:                                               ; preds = %32
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %56, i32 0, i32 3
  store i16 255, ptr %57, align 8, !tbaa !23
  store i32 16777216, ptr %12, align 4, !tbaa !11
  br label %67

58:                                               ; preds = %32
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %59, i32 0, i32 4
  %61 = load volatile i16, ptr %60, align 2, !tbaa !20
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %62, i32 0, i32 3
  store i16 %61, ptr %63, align 8, !tbaa !23
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %64, i32 0, i32 5
  %66 = load volatile i32, ptr %65, align 4, !tbaa !21
  store i32 %66, ptr %12, align 4, !tbaa !11
  br label %67

67:                                               ; preds = %58, %55
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %68, i32 0, i32 6
  %70 = load volatile i32, ptr %69, align 8, !tbaa !24
  %71 = icmp eq i32 %70, 17
  br i1 %71, label %72, label %83

72:                                               ; preds = %67
  %73 = load i32, ptr %11, align 4, !tbaa !11
  %74 = icmp eq i32 %73, 170
  br i1 %74, label %78, label %75

75:                                               ; preds = %72
  %76 = load i32, ptr %11, align 4, !tbaa !11
  %77 = icmp eq i32 %76, 43520
  br label %78

78:                                               ; preds = %75, %72
  %79 = phi i1 [ true, %72 ], [ %77, %75 ]
  %80 = zext i1 %79 to i32
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %78
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %95

83:                                               ; preds = %78, %67
  %84 = load ptr, ptr %7, align 8, !tbaa !5
  call void @I2C_ConvertOtherXferOptions(ptr noundef %84)
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %85, i32 0, i32 4
  %87 = load volatile i16, ptr %86, align 2, !tbaa !20
  %88 = zext i16 %87 to i32
  %89 = icmp ult i32 %88, 255
  br i1 %89, label %90, label %94

90:                                               ; preds = %83
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %91, i32 0, i32 5
  %93 = load volatile i32, ptr %92, align 4, !tbaa !21
  store i32 %93, ptr %12, align 4, !tbaa !11
  br label %94

94:                                               ; preds = %90, %83
  br label %95

95:                                               ; preds = %94, %82
  %96 = load ptr, ptr %7, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %96, i32 0, i32 3
  %98 = load i16, ptr %97, align 8, !tbaa !23
  %99 = zext i16 %98 to i32
  %100 = icmp ugt i32 %99, 0
  br i1 %100, label %101, label %203

101:                                              ; preds = %95
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %102, i32 0, i32 8
  %104 = load ptr, ptr %103, align 8, !tbaa !25
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %138

106:                                              ; preds = %101
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %107, i32 0, i32 8
  %109 = load ptr, ptr %108, align 8, !tbaa !25
  %110 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %109, i32 0, i32 5
  store ptr @I2C_DMAMasterTransmitCplt, ptr %110, align 8, !tbaa !26
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %111, i32 0, i32 8
  %113 = load ptr, ptr %112, align 8, !tbaa !25
  %114 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %113, i32 0, i32 9
  store ptr @I2C_DMAError, ptr %114, align 8, !tbaa !29
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %115, i32 0, i32 8
  %117 = load ptr, ptr %116, align 8, !tbaa !25
  %118 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %117, i32 0, i32 6
  store ptr null, ptr %118, align 8, !tbaa !30
  %119 = load ptr, ptr %7, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %119, i32 0, i32 8
  %121 = load ptr, ptr %120, align 8, !tbaa !25
  %122 = getelementptr inbounds %struct.__DMA_HandleTypeDef, ptr %121, i32 0, i32 10
  store ptr null, ptr %122, align 8, !tbaa !31
  %123 = load ptr, ptr %7, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %123, i32 0, i32 8
  %125 = load ptr, ptr %124, align 8, !tbaa !25
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = ptrtoint ptr %126 to i32
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %128, i32 0, i32 0
  %130 = load ptr, ptr %129, align 8, !tbaa !32
  %131 = getelementptr inbounds %struct.I2C_TypeDef, ptr %130, i32 0, i32 10
  %132 = ptrtoint ptr %131 to i32
  %133 = load ptr, ptr %7, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %133, i32 0, i32 3
  %135 = load i16, ptr %134, align 8, !tbaa !23
  %136 = zext i16 %135 to i32
  %137 = call i32 @HAL_DMA_Start_IT(ptr noundef %125, i32 noundef %127, i32 noundef %132, i32 noundef %136)
  store i32 %137, ptr %14, align 4, !tbaa !11
  br label %152

138:                                              ; preds = %101
  %139 = load ptr, ptr %7, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %139, i32 0, i32 11
  store volatile i32 32, ptr %140, align 4, !tbaa !13
  %141 = load ptr, ptr %7, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %141, i32 0, i32 12
  store volatile i32 0, ptr %142, align 8, !tbaa !17
  %143 = load ptr, ptr %7, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %143, i32 0, i32 13
  %145 = load volatile i32, ptr %144, align 4, !tbaa !18
  %146 = or i32 %145, 128
  store volatile i32 %146, ptr %144, align 4, !tbaa !18
  br label %147

147:                                              ; preds = %138
  %148 = load ptr, ptr %7, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %148, i32 0, i32 10
  store i32 0, ptr %149, align 8, !tbaa !16
  br label %150

150:                                              ; preds = %147
  br label %151

151:                                              ; preds = %150
  store i32 1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %220

152:                                              ; preds = %106
  %153 = load i32, ptr %14, align 4, !tbaa !11
  %154 = icmp eq i32 %153, 0
  br i1 %154, label %155, label %188

155:                                              ; preds = %152
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = load i16, ptr %8, align 2, !tbaa !9
  %158 = load ptr, ptr %7, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %158, i32 0, i32 3
  %160 = load i16, ptr %159, align 8, !tbaa !23
  %161 = trunc i16 %160 to i8
  %162 = load i32, ptr %12, align 4, !tbaa !11
  %163 = load i32, ptr %13, align 4, !tbaa !11
  call void @I2C_TransferConfig(ptr noundef %156, i16 noundef zeroext %157, i8 noundef zeroext %161, i32 noundef %162, i32 noundef %163)
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %164, i32 0, i32 3
  %166 = load i16, ptr %165, align 8, !tbaa !23
  %167 = zext i16 %166 to i32
  %168 = load ptr, ptr %7, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %168, i32 0, i32 4
  %170 = load volatile i16, ptr %169, align 2, !tbaa !20
  %171 = zext i16 %170 to i32
  %172 = sub nsw i32 %171, %167
  %173 = trunc i32 %172 to i16
  store volatile i16 %173, ptr %169, align 2, !tbaa !20
  br label %174

174:                                              ; preds = %155
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %175, i32 0, i32 10
  store i32 0, ptr %176, align 8, !tbaa !16
  br label %177

177:                                              ; preds = %174
  br label %178

178:                                              ; preds = %177
  %179 = load ptr, ptr %7, align 8, !tbaa !5
  call void @I2C_Enable_IRQ(ptr noundef %179, i16 noundef zeroext 17)
  %180 = load ptr, ptr %7, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %180, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !32
  %183 = getelementptr inbounds %struct.I2C_TypeDef, ptr %182, i32 0, i32 0
  %184 = load volatile i32, ptr %183, align 4, !tbaa !33
  %185 = zext i32 %184 to i64
  %186 = or i64 %185, 16384
  %187 = trunc i64 %186 to i32
  store volatile i32 %187, ptr %183, align 4, !tbaa !33
  br label %202

188:                                              ; preds = %152
  %189 = load ptr, ptr %7, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %189, i32 0, i32 11
  store volatile i32 32, ptr %190, align 4, !tbaa !13
  %191 = load ptr, ptr %7, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %191, i32 0, i32 12
  store volatile i32 0, ptr %192, align 8, !tbaa !17
  %193 = load ptr, ptr %7, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %193, i32 0, i32 13
  %195 = load volatile i32, ptr %194, align 4, !tbaa !18
  %196 = or i32 %195, 16
  store volatile i32 %196, ptr %194, align 4, !tbaa !18
  br label %197

197:                                              ; preds = %188
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %198, i32 0, i32 10
  store i32 0, ptr %199, align 8, !tbaa !16
  br label %200

200:                                              ; preds = %197
  br label %201

201:                                              ; preds = %200
  store i32 1, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %220

202:                                              ; preds = %178
  br label %218

203:                                              ; preds = %95
  %204 = load ptr, ptr %7, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %204, i32 0, i32 7
  store ptr @I2C_Master_ISR_IT, ptr %205, align 8, !tbaa !22
  %206 = load ptr, ptr %7, align 8, !tbaa !5
  %207 = load i16, ptr %8, align 2, !tbaa !9
  %208 = load ptr, ptr %7, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %208, i32 0, i32 3
  %210 = load i16, ptr %209, align 8, !tbaa !23
  %211 = trunc i16 %210 to i8
  call void @I2C_TransferConfig(ptr noundef %206, i16 noundef zeroext %207, i8 noundef zeroext %211, i32 noundef 33554432, i32 noundef -2147475456)
  br label %212

212:                                              ; preds = %203
  %213 = load ptr, ptr %7, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.__I2C_HandleTypeDef, ptr %213, i32 0, i32 10
  store i32 0, ptr %214, align 8, !tbaa !16
  br label %215

215:                                              ; preds = %212
  br label %216

216:                                              ; preds = %215
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  call void @I2C_Enable_IRQ(ptr noundef %217, i16 noundef zeroext 1)
  br label %218

218:                                              ; preds = %216, %202
  store i32 0, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %220

219:                                              ; preds = %5
  store i32 2, ptr %6, align 4
  store i32 1, ptr %15, align 4
  br label %220

220:                                              ; preds = %219, %218, %201, %151, %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %221 = load i32, ptr %6, align 4
  ret i32 %221
}

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 88}
!17 = !{!14, !12, i64 96}
!18 = !{!14, !12, i64 100}
!19 = !{!14, !6, i64 40}
!20 = !{!14, !10, i64 50}
!21 = !{!14, !12, i64 52}
!22 = !{!14, !6, i64 64}
!23 = !{!14, !10, i64 48}
!24 = !{!14, !12, i64 56}
!25 = !{!14, !6, i64 72}
!26 = !{!27, !6, i64 72}
!27 = !{!"__DMA_HandleTypeDef", !6, i64 0, !28, 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}
!28 = !{!"", !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}
!29 = !{!27, !6, i64 104}
!30 = !{!27, !6, i64 80}
!31 = !{!27, !6, i64 112}
!32 = !{!14, !6, i64 0}
!33 = !{!34, !12, i64 0}
!34 = !{!"", !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}


; 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_TransferConfig(ptr noundef, i16 noundef zeroext, i8 noundef zeroext, i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare hidden void @I2C_DMAMasterTransmitCplt(ptr noundef) #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 void @I2C_ConvertOtherXferOptions(ptr noundef) local_unnamed_addr #0

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

9:                                                ; preds = %5
  %10 = getelementptr inbounds i8, ptr %0, i64 88
  %11 = load i32, ptr %10, align 8, !tbaa !13
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %71, label %13

13:                                               ; preds = %9
  store i32 1, ptr %10, align 8, !tbaa !13
  store volatile i32 33, ptr %6, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 96
  store volatile i32 16, ptr %14, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %0, i64 100
  store volatile i32 0, ptr %15, align 4, !tbaa !15
  %16 = getelementptr inbounds i8, ptr %0, i64 40
  store ptr %2, ptr %16, align 8, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %0, i64 50
  store volatile i16 %3, ptr %17, align 2, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %0, i64 52
  store volatile i32 %4, ptr %18, align 4, !tbaa !18
  %19 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr @I2C_Master_ISR_DMA, ptr %19, align 8, !tbaa !19
  %20 = load volatile i16, ptr %17, align 2, !tbaa !17
  %21 = icmp ugt i16 %20, 255
  br i1 %21, label %25, label %22

22:                                               ; preds = %13
  %23 = load volatile i16, ptr %17, align 2, !tbaa !17
  %24 = load volatile i32, ptr %18, align 4, !tbaa !18
  br label %25

25:                                               ; preds = %13, %22
  %.sink = phi i16 [ %23, %22 ], [ 255, %13 ]
  %.060 = phi i32 [ %24, %22 ], [ 16777216, %13 ]
  %26 = getelementptr inbounds i8, ptr %0, i64 48
  store i16 %.sink, ptr %26, align 8
  %27 = getelementptr inbounds i8, ptr %0, i64 56
  %28 = load volatile i32, ptr %27, align 8, !tbaa !20
  %29 = icmp eq i32 %28, 17
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  switch i32 %4, label %36 [
    i32 43520, label %31
    i32 170, label %31
  ]

31:                                               ; preds = %30, %30, %25
  tail call void @I2C_ConvertOtherXferOptions(ptr noundef nonnull %0)
  %32 = load volatile i16, ptr %17, align 2, !tbaa !17
  %33 = icmp ult i16 %32, 255
  br i1 %33, label %34, label %thread-pre-split

34:                                               ; preds = %31
  %35 = load volatile i32, ptr %18, align 4, !tbaa !18
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %34, %31
  %.1.ph = phi i32 [ %.060, %31 ], [ %35, %34 ]
  %.pr = load i16, ptr %26, align 8, !tbaa !21
  br label %36

36:                                               ; preds = %thread-pre-split, %30
  %37 = phi i16 [ %.pr, %thread-pre-split ], [ %.sink, %30 ]
  %.1 = phi i32 [ %.1.ph, %thread-pre-split ], [ %.060, %30 ]
  %.059 = phi i32 [ -2147475456, %thread-pre-split ], [ 0, %30 ]
  %.not = icmp eq i16 %37, 0
  br i1 %.not, label %70, label %38

38:                                               ; preds = %36
  %39 = getelementptr inbounds i8, ptr %0, i64 72
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %.not64 = icmp eq ptr %40, null
  br i1 %.not64, label %55, label %41

41:                                               ; preds = %38
  %42 = getelementptr inbounds i8, ptr %40, i64 72
  store ptr @I2C_DMAMasterTransmitCplt, ptr %42, align 8, !tbaa !23
  %43 = getelementptr inbounds i8, ptr %40, i64 104
  store ptr @I2C_DMAError, ptr %43, align 8, !tbaa !26
  %44 = getelementptr inbounds i8, ptr %40, i64 80
  store ptr null, ptr %44, align 8, !tbaa !27
  %45 = getelementptr inbounds i8, ptr %40, i64 112
  store ptr null, ptr %45, align 8, !tbaa !28
  %46 = ptrtoint ptr %2 to i64
  %47 = trunc i64 %46 to i32
  %48 = load ptr, ptr %0, align 8, !tbaa !29
  %49 = getelementptr inbounds i8, ptr %48, i64 40
  %50 = ptrtoint ptr %49 to i64
  %51 = trunc i64 %50 to i32
  %52 = zext i16 %37 to i32
  %53 = tail call i32 @HAL_DMA_Start_IT(ptr noundef nonnull %40, i32 noundef %47, i32 noundef %51, i32 noundef %52) #2
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %58, label %67

55:                                               ; preds = %38
  store volatile i32 32, ptr %6, align 4, !tbaa !5
  store volatile i32 0, ptr %14, align 8, !tbaa !14
  %56 = load volatile i32, ptr %15, align 4, !tbaa !15
  %57 = or i32 %56, 128
  store volatile i32 %57, ptr %15, align 4, !tbaa !15
  store i32 0, ptr %10, align 8, !tbaa !13
  br label %71

58:                                               ; preds = %41
  %59 = load i16, ptr %26, align 8, !tbaa !21
  %60 = trunc i16 %59 to i8
  tail call void @I2C_TransferConfig(ptr noundef nonnull %0, i16 noundef zeroext %1, i8 noundef zeroext %60, i32 noundef %.1, i32 noundef %.059)
  %61 = load i16, ptr %26, align 8, !tbaa !21
  %62 = load volatile i16, ptr %17, align 2, !tbaa !17
  %63 = sub i16 %62, %61
  store volatile i16 %63, ptr %17, align 2, !tbaa !17
  store i32 0, ptr %10, align 8, !tbaa !13
  tail call void @I2C_Enable_IRQ(ptr noundef nonnull %0, i16 noundef zeroext 17)
  %64 = load ptr, ptr %0, align 8, !tbaa !29
  %65 = load volatile i32, ptr %64, align 4, !tbaa !30
  %66 = or i32 %65, 16384
  store volatile i32 %66, ptr %64, align 4, !tbaa !30
  br label %71

67:                                               ; preds = %41
  store volatile i32 32, ptr %6, align 4, !tbaa !5
  store volatile i32 0, ptr %14, align 8, !tbaa !14
  %68 = load volatile i32, ptr %15, align 4, !tbaa !15
  %69 = or i32 %68, 16
  store volatile i32 %69, ptr %15, align 4, !tbaa !15
  store i32 0, ptr %10, align 8, !tbaa !13
  br label %71

70:                                               ; preds = %36
  store ptr @I2C_Master_ISR_IT, ptr %19, align 8, !tbaa !19
  tail call void @I2C_TransferConfig(ptr noundef nonnull %0, i16 noundef zeroext %1, i8 noundef zeroext 0, i32 noundef 33554432, i32 noundef -2147475456)
  store i32 0, ptr %10, align 8, !tbaa !13
  tail call void @I2C_Enable_IRQ(ptr noundef nonnull %0, i16 noundef zeroext 1)
  br label %71

71:                                               ; preds = %5, %58, %70, %9, %67, %55
  %.0 = phi i32 [ 1, %67 ], [ 1, %55 ], [ 2, %9 ], [ 0, %70 ], [ 0, %58 ], [ 2, %5 ]
  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 88}
!14 = !{!6, !11, i64 96}
!15 = !{!6, !11, i64 100}
!16 = !{!6, !7, i64 40}
!17 = !{!6, !12, i64 50}
!18 = !{!6, !11, i64 52}
!19 = !{!6, !7, i64 64}
!20 = !{!6, !11, i64 56}
!21 = !{!6, !12, i64 48}
!22 = !{!6, !7, i64 72}
!23 = !{!24, !7, i64 72}
!24 = !{!"__DMA_HandleTypeDef", !7, i64 0, !25, 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}
!25 = !{!"", !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}
!26 = !{!24, !7, i64 104}
!27 = !{!24, !7, i64 80}
!28 = !{!24, !7, i64 112}
!29 = !{!6, !7, i64 0}
!30 = !{!31, !11, i64 0}
!31 = !{!"", !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}


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