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

; 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.FLASH_ProcessTypeDef = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.FLASH_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], i32, i32, i32, i32, i32, [40 x i32], i32, i32, i32, i32, i32, [4 x i32], i32, i32, i32, i32, i32, i32, [4 x i32], i32, i32, i32, i32, i32 }

@pFlash = external dso_local global %struct.FLASH_ProcessTypeDef, align 4

; 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 void @HAL_FLASH_IRQHandler() #1 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %4 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 4), align 4, !tbaa !5
  %5 = zext i32 %4 to i64
  %6 = and i64 %5, 65536
  %7 = icmp eq i64 %6, 65536
  %8 = zext i1 %7 to i32
  %9 = icmp ne i32 %8, 0
  br i1 %9, label %10, label %55

10:                                               ; preds = %0
  %11 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %13, label %28

13:                                               ; preds = %10
  %14 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 1), align 4, !tbaa !12
  %15 = add i32 %14, -1
  store volatile i32 %15, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 1), align 4, !tbaa !12
  %16 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 1), align 4, !tbaa !12
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %25

18:                                               ; preds = %13
  %19 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %19)
  store volatile i32 65536, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 5), align 4, !tbaa !14
  %20 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  %21 = add i32 %20, 1
  store volatile i32 %21, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  %22 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  store i32 %22, ptr %1, align 4, !tbaa !15
  %23 = load i32, ptr %1, align 4, !tbaa !15
  %24 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 2), align 4, !tbaa !16
  call void @FLASH_Erase_Sector(i32 noundef %23, i32 noundef 1, i32 noundef %24)
  br label %27

25:                                               ; preds = %13
  store volatile i32 -1, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  %26 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %26)
  store volatile i32 65536, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 5), align 4, !tbaa !14
  br label %27

27:                                               ; preds = %25, %18
  br label %54

28:                                               ; preds = %10
  %29 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  store i32 %29, ptr %3, align 4, !tbaa !15
  %30 = load i32, ptr %3, align 4, !tbaa !15
  %31 = icmp eq i32 %30, 2
  br i1 %31, label %35, label %32

32:                                               ; preds = %28
  %33 = load i32, ptr %3, align 4, !tbaa !15
  %34 = icmp eq i32 %33, 7
  br i1 %34, label %35, label %36

35:                                               ; preds = %32, %28
  call void @HAL_FLASH_EndOfOperationCallback(i32 noundef 1)
  br label %43

36:                                               ; preds = %32
  %37 = load i32, ptr %3, align 4, !tbaa !15
  %38 = icmp eq i32 %37, 3
  br i1 %38, label %39, label %41

39:                                               ; preds = %36
  %40 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 4), align 4, !tbaa !17
  call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %40)
  br label %42

41:                                               ; preds = %36
  br label %42

42:                                               ; preds = %41, %39
  br label %43

43:                                               ; preds = %42, %35
  %44 = load i32, ptr %3, align 4, !tbaa !15
  %45 = icmp ne i32 %44, 4
  br i1 %45, label %46, label %53

46:                                               ; preds = %43
  %47 = load i32, ptr %3, align 4, !tbaa !15
  %48 = icmp ne i32 %47, 5
  br i1 %48, label %49, label %53

49:                                               ; preds = %46
  %50 = load i32, ptr %3, align 4, !tbaa !15
  %51 = icmp ne i32 %50, 6
  br i1 %51, label %52, label %53

52:                                               ; preds = %49
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  store volatile i32 65536, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 5), align 4, !tbaa !14
  br label %53

53:                                               ; preds = %52, %49, %46, %43
  br label %54

54:                                               ; preds = %53, %27
  br label %55

55:                                               ; preds = %54, %0
  %56 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 28), align 4, !tbaa !18
  %57 = zext i32 %56 to i64
  %58 = and i64 %57, 65536
  %59 = icmp eq i64 %58, 65536
  %60 = zext i1 %59 to i32
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %107

62:                                               ; preds = %55
  %63 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  %64 = icmp eq i32 %63, 4
  br i1 %64, label %65, label %80

65:                                               ; preds = %62
  %66 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 1), align 4, !tbaa !12
  %67 = add i32 %66, -1
  store volatile i32 %67, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 1), align 4, !tbaa !12
  %68 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 1), align 4, !tbaa !12
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %77

70:                                               ; preds = %65
  %71 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %71)
  store volatile i32 65536, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 29), align 4, !tbaa !19
  %72 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  %73 = add i32 %72, 1
  store volatile i32 %73, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  %74 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  store i32 %74, ptr %1, align 4, !tbaa !15
  %75 = load i32, ptr %1, align 4, !tbaa !15
  %76 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 2), align 4, !tbaa !16
  call void @FLASH_Erase_Sector(i32 noundef %75, i32 noundef 2, i32 noundef %76)
  br label %79

77:                                               ; preds = %65
  store volatile i32 -1, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  %78 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %78)
  store volatile i32 65536, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 29), align 4, !tbaa !19
  br label %79

79:                                               ; preds = %77, %70
  br label %106

80:                                               ; preds = %62
  %81 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  store i32 %81, ptr %3, align 4, !tbaa !15
  %82 = load i32, ptr %3, align 4, !tbaa !15
  %83 = icmp eq i32 %82, 5
  br i1 %83, label %87, label %84

84:                                               ; preds = %80
  %85 = load i32, ptr %3, align 4, !tbaa !15
  %86 = icmp eq i32 %85, 7
  br i1 %86, label %87, label %88

87:                                               ; preds = %84, %80
  call void @HAL_FLASH_EndOfOperationCallback(i32 noundef 2)
  br label %95

88:                                               ; preds = %84
  %89 = load i32, ptr %3, align 4, !tbaa !15
  %90 = icmp eq i32 %89, 6
  br i1 %90, label %91, label %93

91:                                               ; preds = %88
  %92 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 4), align 4, !tbaa !17
  call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %92)
  br label %94

93:                                               ; preds = %88
  br label %94

94:                                               ; preds = %93, %91
  br label %95

95:                                               ; preds = %94, %87
  %96 = load i32, ptr %3, align 4, !tbaa !15
  %97 = icmp ne i32 %96, 1
  br i1 %97, label %98, label %105

98:                                               ; preds = %95
  %99 = load i32, ptr %3, align 4, !tbaa !15
  %100 = icmp ne i32 %99, 2
  br i1 %100, label %101, label %105

101:                                              ; preds = %98
  %102 = load i32, ptr %3, align 4, !tbaa !15
  %103 = icmp ne i32 %102, 3
  br i1 %103, label %104, label %105

104:                                              ; preds = %101
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  store volatile i32 65536, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 29), align 4, !tbaa !19
  br label %105

105:                                              ; preds = %104, %101, %98, %95
  br label %106

106:                                              ; preds = %105, %79
  br label %107

107:                                              ; preds = %106, %55
  %108 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 4), align 4, !tbaa !5
  %109 = zext i32 %108 to i64
  %110 = and i64 %109, 7208960
  %111 = trunc i64 %110 to i32
  store i32 %111, ptr %2, align 4, !tbaa !15
  %112 = load i32, ptr %2, align 4, !tbaa !15
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %136

114:                                              ; preds = %107
  %115 = load i32, ptr %2, align 4, !tbaa !15
  %116 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 6), align 4, !tbaa !20
  %117 = or i32 %116, %115
  store volatile i32 %117, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 6), align 4, !tbaa !20
  %118 = load i32, ptr %2, align 4, !tbaa !15
  store volatile i32 %118, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 5), align 4, !tbaa !14
  %119 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  store i32 %119, ptr %3, align 4, !tbaa !15
  %120 = load i32, ptr %3, align 4, !tbaa !15
  %121 = icmp eq i32 %120, 1
  br i1 %121, label %122, label %124

122:                                              ; preds = %114
  %123 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  store i32 %123, ptr %1, align 4, !tbaa !15
  store volatile i32 -1, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  br label %134

124:                                              ; preds = %114
  %125 = load i32, ptr %3, align 4, !tbaa !15
  %126 = icmp eq i32 %125, 2
  br i1 %126, label %130, label %127

127:                                              ; preds = %124
  %128 = load i32, ptr %3, align 4, !tbaa !15
  %129 = icmp eq i32 %128, 7
  br i1 %129, label %130, label %131

130:                                              ; preds = %127, %124
  store i32 1, ptr %1, align 4, !tbaa !15
  br label %133

131:                                              ; preds = %127
  %132 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 4), align 4, !tbaa !17
  store i32 %132, ptr %1, align 4, !tbaa !15
  br label %133

133:                                              ; preds = %131, %130
  br label %134

134:                                              ; preds = %133, %122
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  %135 = load i32, ptr %1, align 4, !tbaa !15
  call void @HAL_FLASH_OperationErrorCallback(i32 noundef %135)
  br label %136

136:                                              ; preds = %134, %107
  %137 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 28), align 4, !tbaa !18
  %138 = zext i32 %137 to i64
  %139 = and i64 %138, 7208960
  %140 = trunc i64 %139 to i32
  store i32 %140, ptr %2, align 4, !tbaa !15
  %141 = load i32, ptr %2, align 4, !tbaa !15
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %167

143:                                              ; preds = %136
  %144 = load i32, ptr %2, align 4, !tbaa !15
  %145 = or i32 %144, -2147483648
  %146 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 6), align 4, !tbaa !20
  %147 = or i32 %146, %145
  store volatile i32 %147, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 6), align 4, !tbaa !20
  %148 = load i32, ptr %2, align 4, !tbaa !15
  %149 = and i32 %148, 2147483647
  store volatile i32 %149, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 29), align 4, !tbaa !19
  %150 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  store i32 %150, ptr %3, align 4, !tbaa !15
  %151 = load i32, ptr %3, align 4, !tbaa !15
  %152 = icmp eq i32 %151, 4
  br i1 %152, label %153, label %155

153:                                              ; preds = %143
  %154 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  store i32 %154, ptr %1, align 4, !tbaa !15
  store volatile i32 -1, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 3), align 4, !tbaa !13
  br label %165

155:                                              ; preds = %143
  %156 = load i32, ptr %3, align 4, !tbaa !15
  %157 = icmp eq i32 %156, 5
  br i1 %157, label %161, label %158

158:                                              ; preds = %155
  %159 = load i32, ptr %3, align 4, !tbaa !15
  %160 = icmp eq i32 %159, 7
  br i1 %160, label %161, label %162

161:                                              ; preds = %158, %155
  store i32 2, ptr %1, align 4, !tbaa !15
  br label %164

162:                                              ; preds = %158
  %163 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 4), align 4, !tbaa !17
  store i32 %163, ptr %1, align 4, !tbaa !15
  br label %164

164:                                              ; preds = %162, %161
  br label %165

165:                                              ; preds = %164, %153
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  %166 = load i32, ptr %1, align 4, !tbaa !15
  call void @HAL_FLASH_OperationErrorCallback(i32 noundef %166)
  br label %167

167:                                              ; preds = %165, %136
  %168 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  %169 = icmp eq i32 %168, 0
  br i1 %169, label %170, label %178

170:                                              ; preds = %167
  %171 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 3), align 4, !tbaa !21
  %172 = and i32 %171, -7274497
  store volatile i32 %172, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 3), align 4, !tbaa !21
  %173 = load volatile i32, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 27), align 4, !tbaa !22
  %174 = and i32 %173, -7274497
  store volatile i32 %174, ptr getelementptr inbounds (%struct.FLASH_TypeDef, ptr inttoptr (i64 1375739904 to ptr), i32 0, i32 27), align 4, !tbaa !22
  br label %175

175:                                              ; preds = %170
  store i32 0, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 5), align 4, !tbaa !23
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  br label %178

178:                                              ; preds = %177, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_FLASH_EndOfOperationCallback(i32 noundef) #1

declare void @FLASH_Erase_Sector(i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_FLASH_OperationErrorCallback(i32 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 = { "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, !7, i64 16}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !8, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !8, i64 100, !7, i64 260, !7, i64 264, !7, i64 268, !7, i64 272, !7, i64 276, !8, i64 280, !7, i64 296, !7, i64 300, !7, i64 304, !7, i64 308, !7, i64 312, !7, i64 316, !8, i64 320, !7, i64 336, !7, i64 340, !7, i64 344, !7, i64 348, !7, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!12 = !{!11, !7, i64 4}
!13 = !{!11, !7, i64 12}
!14 = !{!6, !7, i64 20}
!15 = !{!7, !7, i64 0}
!16 = !{!11, !7, i64 8}
!17 = !{!11, !7, i64 16}
!18 = !{!6, !7, i64 272}
!19 = !{!6, !7, i64 276}
!20 = !{!11, !7, i64 24}
!21 = !{!6, !7, i64 12}
!22 = !{!6, !7, i64 268}
!23 = !{!11, !7, i64 20}


; 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"

%struct.FLASH_ProcessTypeDef = type { i32, i32, i32, i32, i32, i32, i32 }

@pFlash = external dso_local global %struct.FLASH_ProcessTypeDef, align 4

; Function Attrs: nounwind uwtable
define dso_local void @HAL_FLASH_IRQHandler() local_unnamed_addr #0 {
  %1 = load volatile i32, ptr inttoptr (i64 1375739920 to ptr), align 16, !tbaa !5
  %2 = and i32 %1, 65536
  %.not = icmp eq i32 %2, 0
  br i1 %.not, label %25, label %3

3:                                                ; preds = %0
  %4 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  %5 = icmp eq i32 %4, 1
  br i1 %5, label %6, label %18

6:                                                ; preds = %3
  %7 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 4), align 4, !tbaa !12
  %8 = add i32 %7, -1
  store volatile i32 %8, ptr getelementptr inbounds (i8, ptr @pFlash, i64 4), align 4, !tbaa !12
  %9 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 4), align 4, !tbaa !12
  %.not49 = icmp eq i32 %9, 0
  br i1 %.not49, label %16, label %10

10:                                               ; preds = %6
  %11 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  tail call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %11)
  store volatile i32 65536, ptr inttoptr (i64 1375739924 to ptr), align 4, !tbaa !14
  %12 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  %13 = add i32 %12, 1
  store volatile i32 %13, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  %14 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  %15 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 8), align 4, !tbaa !15
  tail call void @FLASH_Erase_Sector(i32 noundef %14, i32 noundef 1, i32 noundef %15) #2
  br label %25

16:                                               ; preds = %6
  store volatile i32 -1, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  %17 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  tail call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %17)
  store volatile i32 65536, ptr inttoptr (i64 1375739924 to ptr), align 4, !tbaa !14
  br label %25

18:                                               ; preds = %3
  %19 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  switch i32 %19, label %22 [
    i32 7, label %20
    i32 2, label %20
    i32 3, label %.thread
  ]

20:                                               ; preds = %18, %18
  tail call void @HAL_FLASH_EndOfOperationCallback(i32 noundef 1)
  br label %22

.thread:                                          ; preds = %18
  %21 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 16), align 4, !tbaa !16
  tail call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %21)
  br label %24

22:                                               ; preds = %18, %20
  %23 = add i32 %19, -7
  %or.cond5 = icmp ult i32 %23, -3
  br i1 %or.cond5, label %24, label %25

24:                                               ; preds = %.thread, %22
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  store volatile i32 65536, ptr inttoptr (i64 1375739924 to ptr), align 4, !tbaa !14
  br label %25

25:                                               ; preds = %16, %10, %24, %22, %0
  %26 = load volatile i32, ptr inttoptr (i64 1375740176 to ptr), align 16, !tbaa !17
  %27 = and i32 %26, 65536
  %.not50 = icmp eq i32 %27, 0
  br i1 %.not50, label %52, label %28

28:                                               ; preds = %25
  %29 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  %30 = icmp eq i32 %29, 4
  br i1 %30, label %31, label %43

31:                                               ; preds = %28
  %32 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 4), align 4, !tbaa !12
  %33 = add i32 %32, -1
  store volatile i32 %33, ptr getelementptr inbounds (i8, ptr @pFlash, i64 4), align 4, !tbaa !12
  %34 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 4), align 4, !tbaa !12
  %.not51 = icmp eq i32 %34, 0
  br i1 %.not51, label %41, label %35

35:                                               ; preds = %31
  %36 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  tail call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %36)
  store volatile i32 65536, ptr inttoptr (i64 1375740180 to ptr), align 4, !tbaa !18
  %37 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  %38 = add i32 %37, 1
  store volatile i32 %38, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  %39 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  %40 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 8), align 4, !tbaa !15
  tail call void @FLASH_Erase_Sector(i32 noundef %39, i32 noundef 2, i32 noundef %40) #2
  br label %52

41:                                               ; preds = %31
  store volatile i32 -1, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  %42 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  tail call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %42)
  store volatile i32 65536, ptr inttoptr (i64 1375740180 to ptr), align 4, !tbaa !18
  br label %52

43:                                               ; preds = %28
  %44 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  %45 = and i32 %44, -3
  %or.cond7 = icmp eq i32 %45, 5
  br i1 %or.cond7, label %.thread55.sink.split, label %46

46:                                               ; preds = %43
  %47 = icmp eq i32 %44, 6
  br i1 %47, label %48, label %50

48:                                               ; preds = %46
  %49 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 16), align 4, !tbaa !16
  br label %.thread55.sink.split

50:                                               ; preds = %46
  %51 = add i32 %44, -4
  %or.cond11 = icmp ult i32 %51, -3
  br i1 %or.cond11, label %.thread55, label %52

.thread55.sink.split:                             ; preds = %43, %48
  %.sink = phi i32 [ %49, %48 ], [ 2, %43 ]
  tail call void @HAL_FLASH_EndOfOperationCallback(i32 noundef %.sink)
  br label %.thread55

.thread55:                                        ; preds = %.thread55.sink.split, %50
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  store volatile i32 65536, ptr inttoptr (i64 1375740180 to ptr), align 4, !tbaa !18
  br label %52

52:                                               ; preds = %41, %35, %.thread55, %50, %25
  %53 = load volatile i32, ptr inttoptr (i64 1375739920 to ptr), align 16, !tbaa !5
  %54 = and i32 %53, 7208960
  %.not52 = icmp eq i32 %54, 0
  br i1 %.not52, label %64, label %55

55:                                               ; preds = %52
  %56 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 24), align 4, !tbaa !19
  %57 = or i32 %56, %54
  store volatile i32 %57, ptr getelementptr inbounds (i8, ptr @pFlash, i64 24), align 4, !tbaa !19
  store volatile i32 %54, ptr inttoptr (i64 1375739924 to ptr), align 4, !tbaa !14
  %58 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  switch i32 %58, label %61 [
    i32 1, label %59
    i32 7, label %63
    i32 2, label %63
  ]

59:                                               ; preds = %55
  %60 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  store volatile i32 -1, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  br label %63

61:                                               ; preds = %55
  %62 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 16), align 4, !tbaa !16
  br label %63

63:                                               ; preds = %55, %55, %61, %59
  %.0 = phi i32 [ %60, %59 ], [ %62, %61 ], [ 1, %55 ], [ 1, %55 ]
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  tail call void @HAL_FLASH_OperationErrorCallback(i32 noundef %.0)
  br label %64

64:                                               ; preds = %63, %52
  %65 = load volatile i32, ptr inttoptr (i64 1375740176 to ptr), align 16, !tbaa !17
  %66 = and i32 %65, 7208960
  %.not53 = icmp eq i32 %66, 0
  br i1 %.not53, label %80, label %67

67:                                               ; preds = %64
  %68 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 24), align 4, !tbaa !19
  %69 = or i32 %66, %68
  %70 = or i32 %69, -2147483648
  store volatile i32 %70, ptr getelementptr inbounds (i8, ptr @pFlash, i64 24), align 4, !tbaa !19
  store volatile i32 %66, ptr inttoptr (i64 1375740180 to ptr), align 4, !tbaa !18
  %71 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  %72 = icmp eq i32 %71, 4
  br i1 %72, label %73, label %75

73:                                               ; preds = %67
  %74 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  store volatile i32 -1, ptr getelementptr inbounds (i8, ptr @pFlash, i64 12), align 4, !tbaa !13
  br label %79

75:                                               ; preds = %67
  %76 = and i32 %71, -3
  %or.cond15 = icmp eq i32 %76, 5
  br i1 %or.cond15, label %79, label %77

77:                                               ; preds = %75
  %78 = load volatile i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 16), align 4, !tbaa !16
  br label %79

79:                                               ; preds = %75, %77, %73
  %.1 = phi i32 [ %74, %73 ], [ %78, %77 ], [ 2, %75 ]
  store volatile i32 0, ptr @pFlash, align 4, !tbaa !10
  tail call void @HAL_FLASH_OperationErrorCallback(i32 noundef %.1)
  br label %80

80:                                               ; preds = %79, %64
  %81 = load volatile i32, ptr @pFlash, align 4, !tbaa !10
  %82 = icmp eq i32 %81, 0
  br i1 %82, label %83, label %88

83:                                               ; preds = %80
  %84 = load volatile i32, ptr inttoptr (i64 1375739916 to ptr), align 4, !tbaa !20
  %85 = and i32 %84, -7274497
  store volatile i32 %85, ptr inttoptr (i64 1375739916 to ptr), align 4, !tbaa !20
  %86 = load volatile i32, ptr inttoptr (i64 1375740172 to ptr), align 4, !tbaa !21
  %87 = and i32 %86, -7274497
  store volatile i32 %87, ptr inttoptr (i64 1375740172 to ptr), align 4, !tbaa !21
  store i32 0, ptr getelementptr inbounds (i8, ptr @pFlash, i64 20), align 4, !tbaa !22
  br label %88

88:                                               ; preds = %83, %80
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_FLASH_EndOfOperationCallback(i32 noundef) local_unnamed_addr #0

declare void @FLASH_Erase_Sector(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @HAL_FLASH_OperationErrorCallback(i32 noundef) local_unnamed_addr #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
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, !7, i64 16}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !7, i64 48, !7, i64 52, !7, i64 56, !7, i64 60, !7, i64 64, !7, i64 68, !8, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !8, i64 100, !7, i64 260, !7, i64 264, !7, i64 268, !7, i64 272, !7, i64 276, !8, i64 280, !7, i64 296, !7, i64 300, !7, i64 304, !7, i64 308, !7, i64 312, !7, i64 316, !8, i64 320, !7, i64 336, !7, i64 340, !7, i64 344, !7, i64 348, !7, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!12 = !{!11, !7, i64 4}
!13 = !{!11, !7, i64 12}
!14 = !{!6, !7, i64 20}
!15 = !{!11, !7, i64 8}
!16 = !{!11, !7, i64 16}
!17 = !{!6, !7, i64 272}
!18 = !{!6, !7, i64 276}
!19 = !{!11, !7, i64 24}
!20 = !{!6, !7, i64 12}
!21 = !{!6, !7, i64 268}
!22 = !{!11, !7, i64 20}


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