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

; 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.__USART_HandleTypeDef = type { ptr, %struct.USART_InitTypeDef, ptr, i16, i16, ptr, i16, i16, i16, i16, i16, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32 }
%struct.USART_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.USART_TypeDef = 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
define dso_local i32 @HAL_USART_Receive_IT(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  %9 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i16 %2, ptr %7, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #2
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %10, i32 0, i32 18
  %12 = load volatile i32, ptr %11, align 4, !tbaa !11
  %13 = icmp eq i32 %12, 1
  br i1 %13, label %14, label %251

14:                                               ; preds = %3
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = icmp eq ptr %15, null
  br i1 %16, label %21, label %17

17:                                               ; preds = %14
  %18 = load i16, ptr %7, align 2, !tbaa !9
  %19 = zext i16 %18 to i32
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %17, %14
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %252

22:                                               ; preds = %17
  br label %23

23:                                               ; preds = %22
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %24, i32 0, i32 17
  %26 = load i32, ptr %25, align 8, !tbaa !15
  %27 = icmp eq i32 %26, 1
  br i1 %27, label %28, label %29

28:                                               ; preds = %23
  store i32 2, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %252

29:                                               ; preds = %23
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %30, i32 0, i32 17
  store i32 1, ptr %31, align 8, !tbaa !15
  br label %32

32:                                               ; preds = %29
  br label %33

33:                                               ; preds = %32
  br label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %36, i32 0, i32 5
  store ptr %35, ptr %37, align 8, !tbaa !16
  %38 = load i16, ptr %7, align 2, !tbaa !9
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %39, i32 0, i32 6
  store i16 %38, ptr %40, align 8, !tbaa !17
  %41 = load i16, ptr %7, align 2, !tbaa !9
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %42, i32 0, i32 7
  store volatile i16 %41, ptr %43, align 2, !tbaa !18
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %44, i32 0, i32 13
  store ptr null, ptr %45, align 8, !tbaa !19
  br label %46

46:                                               ; preds = %34
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !20
  %51 = icmp eq i32 %50, 4096
  br i1 %51, label %52, label %65

52:                                               ; preds = %46
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %54, i32 0, i32 3
  %56 = load i32, ptr %55, align 4, !tbaa !21
  %57 = icmp eq i32 %56, 0
  br i1 %57, label %58, label %61

58:                                               ; preds = %52
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %59, i32 0, i32 8
  store i16 511, ptr %60, align 4, !tbaa !22
  br label %64

61:                                               ; preds = %52
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %62, i32 0, i32 8
  store i16 255, ptr %63, align 4, !tbaa !22
  br label %64

64:                                               ; preds = %61, %58
  br label %108

65:                                               ; preds = %46
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %67, i32 0, i32 1
  %69 = load i32, ptr %68, align 4, !tbaa !20
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %84

71:                                               ; preds = %65
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %72, i32 0, i32 1
  %74 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %73, i32 0, i32 3
  %75 = load i32, ptr %74, align 4, !tbaa !21
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %80

77:                                               ; preds = %71
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %78, i32 0, i32 8
  store i16 255, ptr %79, align 4, !tbaa !22
  br label %83

80:                                               ; preds = %71
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %81, i32 0, i32 8
  store i16 127, ptr %82, align 4, !tbaa !22
  br label %83

83:                                               ; preds = %80, %77
  br label %107

84:                                               ; preds = %65
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %85, i32 0, i32 1
  %87 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !20
  %89 = icmp eq i32 %88, 268435456
  br i1 %89, label %90, label %103

90:                                               ; preds = %84
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %91, i32 0, i32 1
  %93 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %92, i32 0, i32 3
  %94 = load i32, ptr %93, align 4, !tbaa !21
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %96, label %99

96:                                               ; preds = %90
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %97, i32 0, i32 8
  store i16 127, ptr %98, align 4, !tbaa !22
  br label %102

99:                                               ; preds = %90
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %100, i32 0, i32 8
  store i16 63, ptr %101, align 4, !tbaa !22
  br label %102

102:                                              ; preds = %99, %96
  br label %106

103:                                              ; preds = %84
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %104, i32 0, i32 8
  store i16 0, ptr %105, align 4, !tbaa !22
  br label %106

106:                                              ; preds = %103, %102
  br label %107

107:                                              ; preds = %106, %83
  br label %108

108:                                              ; preds = %107, %64
  br label %109

109:                                              ; preds = %108
  br label %110

110:                                              ; preds = %109
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %111, i32 0, i32 19
  store volatile i32 0, ptr %112, align 8, !tbaa !23
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %113, i32 0, i32 18
  store volatile i32 34, ptr %114, align 4, !tbaa !11
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !24
  %118 = getelementptr inbounds %struct.USART_TypeDef, ptr %117, i32 0, i32 2
  %119 = load volatile i32, ptr %118, align 4, !tbaa !25
  %120 = zext i32 %119 to i64
  %121 = or i64 %120, 1
  %122 = trunc i64 %121 to i32
  store volatile i32 %122, ptr %118, align 4, !tbaa !25
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %123, i32 0, i32 12
  %125 = load i32, ptr %124, align 8, !tbaa !27
  %126 = zext i32 %125 to i64
  %127 = icmp eq i64 %126, 536870912
  br i1 %127, label %128, label %176

128:                                              ; preds = %110
  %129 = load i16, ptr %7, align 2, !tbaa !9
  %130 = zext i16 %129 to i32
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %131, i32 0, i32 9
  %133 = load i16, ptr %132, align 2, !tbaa !28
  %134 = zext i16 %133 to i32
  %135 = icmp sge i32 %130, %134
  br i1 %135, label %136, label %176

136:                                              ; preds = %128
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %137, i32 0, i32 1
  %139 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !20
  %141 = icmp eq i32 %140, 4096
  br i1 %141, label %142, label %151

142:                                              ; preds = %136
  %143 = load ptr, ptr %5, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %143, i32 0, i32 1
  %145 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %144, i32 0, i32 3
  %146 = load i32, ptr %145, align 4, !tbaa !21
  %147 = icmp eq i32 %146, 0
  br i1 %147, label %148, label %151

148:                                              ; preds = %142
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %149, i32 0, i32 13
  store ptr @USART_RxISR_16BIT_FIFOEN, ptr %150, align 8, !tbaa !19
  br label %154

151:                                              ; preds = %142, %136
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %152, i32 0, i32 13
  store ptr @USART_RxISR_8BIT_FIFOEN, ptr %153, align 8, !tbaa !19
  br label %154

154:                                              ; preds = %151, %148
  br label %155

155:                                              ; preds = %154
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %156, i32 0, i32 17
  store i32 0, ptr %157, align 8, !tbaa !15
  br label %158

158:                                              ; preds = %155
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %160, i32 0, i32 0
  %162 = load ptr, ptr %161, align 8, !tbaa !24
  %163 = getelementptr inbounds %struct.USART_TypeDef, ptr %162, i32 0, i32 0
  %164 = load volatile i32, ptr %163, align 4, !tbaa !29
  %165 = zext i32 %164 to i64
  %166 = or i64 %165, 256
  %167 = trunc i64 %166 to i32
  store volatile i32 %167, ptr %163, align 4, !tbaa !29
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %168, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !24
  %171 = getelementptr inbounds %struct.USART_TypeDef, ptr %170, i32 0, i32 2
  %172 = load volatile i32, ptr %171, align 4, !tbaa !25
  %173 = zext i32 %172 to i64
  %174 = or i64 %173, 268435456
  %175 = trunc i64 %174 to i32
  store volatile i32 %175, ptr %171, align 4, !tbaa !25
  br label %208

176:                                              ; preds = %128, %110
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %177, i32 0, i32 1
  %179 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %178, i32 0, i32 1
  %180 = load i32, ptr %179, align 4, !tbaa !20
  %181 = icmp eq i32 %180, 4096
  br i1 %181, label %182, label %191

182:                                              ; preds = %176
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %183, i32 0, i32 1
  %185 = getelementptr inbounds %struct.USART_InitTypeDef, ptr %184, i32 0, i32 3
  %186 = load i32, ptr %185, align 4, !tbaa !21
  %187 = icmp eq i32 %186, 0
  br i1 %187, label %188, label %191

188:                                              ; preds = %182
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %189, i32 0, i32 13
  store ptr @USART_RxISR_16BIT, ptr %190, align 8, !tbaa !19
  br label %194

191:                                              ; preds = %182, %176
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %192, i32 0, i32 13
  store ptr @USART_RxISR_8BIT, ptr %193, align 8, !tbaa !19
  br label %194

194:                                              ; preds = %191, %188
  br label %195

195:                                              ; preds = %194
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %196, i32 0, i32 17
  store i32 0, ptr %197, align 8, !tbaa !15
  br label %198

198:                                              ; preds = %195
  br label %199

199:                                              ; preds = %198
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %200, i32 0, i32 0
  %202 = load ptr, ptr %201, align 8, !tbaa !24
  %203 = getelementptr inbounds %struct.USART_TypeDef, ptr %202, i32 0, i32 0
  %204 = load volatile i32, ptr %203, align 4, !tbaa !29
  %205 = zext i32 %204 to i64
  %206 = or i64 %205, 288
  %207 = trunc i64 %206 to i32
  store volatile i32 %207, ptr %203, align 4, !tbaa !29
  br label %208

208:                                              ; preds = %199, %159
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %209, i32 0, i32 11
  %211 = load i32, ptr %210, align 4, !tbaa !30
  %212 = icmp eq i32 %211, 0
  br i1 %212, label %213, label %250

213:                                              ; preds = %208
  %214 = load ptr, ptr %5, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %214, i32 0, i32 12
  %216 = load i32, ptr %215, align 8, !tbaa !27
  %217 = zext i32 %216 to i64
  %218 = icmp eq i64 %217, 536870912
  br i1 %218, label %219, label %244

219:                                              ; preds = %213
  %220 = load i16, ptr %7, align 2, !tbaa !9
  %221 = zext i16 %220 to i32
  %222 = load ptr, ptr %5, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %222, i32 0, i32 9
  %224 = load i16, ptr %223, align 2, !tbaa !28
  %225 = zext i16 %224 to i32
  %226 = icmp sge i32 %221, %225
  br i1 %226, label %227, label %244

227:                                              ; preds = %219
  %228 = load ptr, ptr %5, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %228, i32 0, i32 9
  %230 = load i16, ptr %229, align 2, !tbaa !28
  store i16 %230, ptr %8, align 2, !tbaa !9
  br label %231

231:                                              ; preds = %240, %227
  %232 = load i16, ptr %8, align 2, !tbaa !9
  %233 = zext i16 %232 to i32
  %234 = icmp ugt i32 %233, 0
  br i1 %234, label %235, label %243

235:                                              ; preds = %231
  %236 = load ptr, ptr %5, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %236, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !24
  %239 = getelementptr inbounds %struct.USART_TypeDef, ptr %238, i32 0, i32 10
  store volatile i32 255, ptr %239, align 4, !tbaa !31
  br label %240

240:                                              ; preds = %235
  %241 = load i16, ptr %8, align 2, !tbaa !9
  %242 = add i16 %241, -1
  store i16 %242, ptr %8, align 2, !tbaa !9
  br label %231, !llvm.loop !32

243:                                              ; preds = %231
  br label %249

244:                                              ; preds = %219, %213
  %245 = load ptr, ptr %5, align 8, !tbaa !5
  %246 = getelementptr inbounds %struct.__USART_HandleTypeDef, ptr %245, i32 0, i32 0
  %247 = load ptr, ptr %246, align 8, !tbaa !24
  %248 = getelementptr inbounds %struct.USART_TypeDef, ptr %247, i32 0, i32 10
  store volatile i32 255, ptr %248, align 4, !tbaa !31
  br label %249

249:                                              ; preds = %244, %243
  br label %250

250:                                              ; preds = %249, %208
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %252

251:                                              ; preds = %3
  store i32 2, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %252

252:                                              ; preds = %251, %250, %28, %21
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #2
  %253 = load i32, ptr %4, align 4
  ret i32 %253
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !14, i64 132}
!12 = !{!"__USART_HandleTypeDef", !6, i64 0, !13, i64 8, !6, i64 48, !10, i64 56, !10, i64 58, !6, i64 64, !10, i64 72, !10, i64 74, !10, i64 76, !10, i64 78, !10, i64 80, !14, i64 84, !14, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !14, i64 128, !14, i64 132, !14, i64 136}
!13 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32}
!14 = !{!"int", !7, i64 0}
!15 = !{!12, !14, i64 128}
!16 = !{!12, !6, i64 64}
!17 = !{!12, !10, i64 72}
!18 = !{!12, !10, i64 74}
!19 = !{!12, !6, i64 96}
!20 = !{!12, !14, i64 12}
!21 = !{!12, !14, i64 20}
!22 = !{!12, !10, i64 76}
!23 = !{!12, !14, i64 136}
!24 = !{!12, !6, i64 0}
!25 = !{!26, !14, i64 8}
!26 = !{!"", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44}
!27 = !{!12, !14, i64 88}
!28 = !{!12, !10, i64 78}
!29 = !{!26, !14, i64 0}
!30 = !{!12, !14, i64 84}
!31 = !{!26, !14, i64 40}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; 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: nofree norecurse nounwind uwtable
define dso_local range(i32 0, 3) i32 @HAL_USART_Receive_IT(ptr noundef %0, ptr noundef %1, i16 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 132
  %5 = load volatile i32, ptr %4, align 4, !tbaa !5
  %6 = icmp eq i32 %5, 1
  br i1 %6, label %7, label %.loopexit

7:                                                ; preds = %3
  %8 = icmp eq ptr %1, null
  %9 = icmp eq i16 %2, 0
  %or.cond = or i1 %8, %9
  br i1 %or.cond, label %.loopexit, label %10

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 128
  %12 = load i32, ptr %11, align 8, !tbaa !13
  %13 = icmp eq i32 %12, 1
  br i1 %13, label %.loopexit, label %14

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %1, ptr %15, align 8, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  store i16 %2, ptr %16, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %0, i64 74
  store volatile i16 %2, ptr %17, align 2, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %0, i64 96
  %19 = getelementptr inbounds i8, ptr %0, i64 12
  %20 = load i32, ptr %19, align 4, !tbaa !17
  switch i32 %20, label %42 [
    i32 4096, label %21
    i32 0, label %28
    i32 268435456, label %35
  ]

21:                                               ; preds = %14
  %22 = getelementptr inbounds i8, ptr %0, i64 20
  %23 = load i32, ptr %22, align 4, !tbaa !18
  %24 = icmp eq i32 %23, 0
  %25 = getelementptr inbounds i8, ptr %0, i64 76
  br i1 %24, label %26, label %27

26:                                               ; preds = %21
  store i16 511, ptr %25, align 4, !tbaa !19
  br label %44

27:                                               ; preds = %21
  store i16 255, ptr %25, align 4, !tbaa !19
  br label %44

28:                                               ; preds = %14
  %29 = getelementptr inbounds i8, ptr %0, i64 20
  %30 = load i32, ptr %29, align 4, !tbaa !18
  %31 = icmp eq i32 %30, 0
  %32 = getelementptr inbounds i8, ptr %0, i64 76
  br i1 %31, label %33, label %34

33:                                               ; preds = %28
  store i16 255, ptr %32, align 4, !tbaa !19
  br label %44

34:                                               ; preds = %28
  store i16 127, ptr %32, align 4, !tbaa !19
  br label %44

35:                                               ; preds = %14
  %36 = getelementptr inbounds i8, ptr %0, i64 20
  %37 = load i32, ptr %36, align 4, !tbaa !18
  %38 = icmp eq i32 %37, 0
  %39 = getelementptr inbounds i8, ptr %0, i64 76
  br i1 %38, label %40, label %41

40:                                               ; preds = %35
  store i16 127, ptr %39, align 4, !tbaa !19
  br label %44

41:                                               ; preds = %35
  store i16 63, ptr %39, align 4, !tbaa !19
  br label %44

42:                                               ; preds = %14
  %43 = getelementptr inbounds i8, ptr %0, i64 76
  store i16 0, ptr %43, align 4, !tbaa !19
  br label %44

44:                                               ; preds = %34, %33, %40, %41, %42, %26, %27
  %45 = getelementptr inbounds i8, ptr %0, i64 136
  store volatile i32 0, ptr %45, align 8, !tbaa !20
  store volatile i32 34, ptr %4, align 4, !tbaa !5
  %46 = load ptr, ptr %0, align 8, !tbaa !21
  %47 = getelementptr inbounds i8, ptr %46, i64 8
  %48 = load volatile i32, ptr %47, align 4, !tbaa !22
  %49 = or i32 %48, 1
  store volatile i32 %49, ptr %47, align 4, !tbaa !22
  %50 = getelementptr inbounds i8, ptr %0, i64 88
  %51 = load i32, ptr %50, align 8, !tbaa !24
  %52 = icmp eq i32 %51, 536870912
  br i1 %52, label %53, label %63

53:                                               ; preds = %44
  %54 = getelementptr inbounds i8, ptr %0, i64 78
  %55 = load i16, ptr %54, align 2, !tbaa !25
  %.not = icmp ugt i16 %55, %2
  br i1 %.not, label %63, label %56

56:                                               ; preds = %53
  %57 = icmp eq i32 %20, 4096
  br i1 %57, label %58, label %62

58:                                               ; preds = %56
  %59 = getelementptr inbounds i8, ptr %0, i64 20
  %60 = load i32, ptr %59, align 4, !tbaa !18
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %.thread, label %62

62:                                               ; preds = %58, %56
  br label %.thread

63:                                               ; preds = %53, %44
  %64 = icmp eq i32 %20, 4096
  br i1 %64, label %65, label %69

65:                                               ; preds = %63
  %66 = getelementptr inbounds i8, ptr %0, i64 20
  %67 = load i32, ptr %66, align 4, !tbaa !18
  %68 = icmp eq i32 %67, 0
  br i1 %68, label %70, label %69

69:                                               ; preds = %65, %63
  br label %70

70:                                               ; preds = %69, %65
  %storemerge = phi ptr [ @USART_RxISR_8BIT, %69 ], [ @USART_RxISR_16BIT, %65 ]
  store ptr %storemerge, ptr %18, align 8, !tbaa !26
  store i32 0, ptr %11, align 8, !tbaa !13
  %71 = load volatile i32, ptr %46, align 4, !tbaa !27
  %72 = or i32 %71, 288
  store volatile i32 %72, ptr %46, align 4, !tbaa !27
  %73 = getelementptr inbounds i8, ptr %0, i64 84
  %74 = load i32, ptr %73, align 4, !tbaa !28
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %83, label %.loopexit

.thread:                                          ; preds = %62, %58
  %storemerge59 = phi ptr [ @USART_RxISR_8BIT_FIFOEN, %62 ], [ @USART_RxISR_16BIT_FIFOEN, %58 ]
  store ptr %storemerge59, ptr %18, align 8, !tbaa !26
  store i32 0, ptr %11, align 8, !tbaa !13
  %76 = load volatile i32, ptr %46, align 4, !tbaa !27
  %77 = or i32 %76, 256
  store volatile i32 %77, ptr %46, align 4, !tbaa !27
  %78 = load volatile i32, ptr %47, align 4, !tbaa !22
  %79 = or i32 %78, 268435456
  store volatile i32 %79, ptr %47, align 4, !tbaa !22
  %80 = getelementptr inbounds i8, ptr %0, i64 84
  %81 = load i32, ptr %80, align 4, !tbaa !28
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %.thread62, label %.loopexit

83:                                               ; preds = %70
  br i1 %52, label %..thread62_crit_edge, label %90

..thread62_crit_edge:                             ; preds = %83
  %.phi.trans.insert = getelementptr inbounds i8, ptr %0, i64 78
  %.pre = load i16, ptr %.phi.trans.insert, align 2, !tbaa !25
  br label %.thread62

.thread62:                                        ; preds = %..thread62_crit_edge, %.thread
  %84 = phi i16 [ %.pre, %..thread62_crit_edge ], [ %55, %.thread ]
  %85 = freeze i16 %84
  %.not60 = icmp ugt i16 %85, %2
  br i1 %.not60, label %90, label %.preheader

.preheader:                                       ; preds = %.thread62
  %.not6163 = icmp eq i16 %85, 0
  br i1 %.not6163, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %86 = getelementptr inbounds i8, ptr %46, i64 40
  %xtraiter = and i16 %85, 7
  %lcmp.mod.not = icmp eq i16 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.preheader

.prol.preheader:                                  ; preds = %.lr.ph, %.prol.preheader
  %.064.prol = phi i16 [ %87, %.prol.preheader ], [ %85, %.lr.ph ]
  %prol.iter = phi i16 [ %prol.iter.next, %.prol.preheader ], [ 0, %.lr.ph ]
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  %87 = add i16 %.064.prol, -1
  %prol.iter.next = add i16 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i16 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.prol.loopexit, label %.prol.preheader, !llvm.loop !30

.prol.loopexit:                                   ; preds = %.prol.preheader, %.lr.ph
  %.064.unr = phi i16 [ %85, %.lr.ph ], [ %87, %.prol.preheader ]
  %88 = icmp ult i16 %85, 8
  br i1 %88, label %.loopexit, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.prol.loopexit, %.lr.ph.new
  %.064 = phi i16 [ %89, %.lr.ph.new ], [ %.064.unr, %.prol.loopexit ]
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  store volatile i32 255, ptr %86, align 4, !tbaa !29
  %89 = add i16 %.064, -8
  %.not61.7 = icmp eq i16 %89, 0
  br i1 %.not61.7, label %.loopexit, label %.lr.ph.new, !llvm.loop !32

90:                                               ; preds = %.thread62, %83
  %91 = getelementptr inbounds i8, ptr %46, i64 40
  store volatile i32 255, ptr %91, align 4, !tbaa !29
  br label %.loopexit

.loopexit:                                        ; preds = %.prol.loopexit, %.lr.ph.new, %.preheader, %.thread, %3, %70, %90, %10, %7
  %.055 = phi i32 [ 1, %7 ], [ 2, %10 ], [ 0, %90 ], [ 0, %70 ], [ 2, %3 ], [ 0, %.thread ], [ 0, %.preheader ], [ 0, %.lr.ph.new ], [ 0, %.prol.loopexit ]
  ret i32 %.055
}

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

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

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

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

attributes #0 = { nofree norecurse 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 = { 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 132}
!6 = !{!"__USART_HandleTypeDef", !7, i64 0, !10, i64 8, !7, i64 48, !12, i64 56, !12, i64 58, !7, i64 64, !12, i64 72, !12, i64 74, !12, i64 76, !12, i64 78, !12, i64 80, !11, i64 84, !11, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !11, i64 128, !11, i64 132, !11, i64 136}
!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 = !{!"int", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !11, i64 128}
!14 = !{!6, !7, i64 64}
!15 = !{!6, !12, i64 72}
!16 = !{!6, !12, i64 74}
!17 = !{!6, !11, i64 12}
!18 = !{!6, !11, i64 20}
!19 = !{!6, !12, i64 76}
!20 = !{!6, !11, i64 136}
!21 = !{!6, !7, i64 0}
!22 = !{!23, !11, i64 8}
!23 = !{!"", !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}
!24 = !{!6, !11, i64 88}
!25 = !{!6, !12, i64 78}
!26 = !{!6, !7, i64 96}
!27 = !{!23, !11, i64 0}
!28 = !{!6, !11, i64 84}
!29 = !{!23, !11, i64 40}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.unroll.disable"}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass