; LLVM IR from reazon-research/OpenArm :: control/canfd_control/Drivers/STM32H7xx_HAL_Driver/Src (stm32h7xx_hal_flash_ex)

; 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_OBProgramInitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@pFlash = external 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

declare i32 @FLASH_WaitForLastOperation(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
define dso_local i32 @HAL_FLASHEx_OBProgram(ptr noundef %0) #2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  br label %6

6:                                                ; preds = %1
  %7 = load i32, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 5), align 4, !tbaa !9
  %8 = icmp eq i32 %7, 1
  br i1 %8, label %9, label %10

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

10:                                               ; preds = %6
  store i32 1, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 5), align 4, !tbaa !9
  br label %11

11:                                               ; preds = %10
  br label %12

12:                                               ; preds = %11
  br label %13

13:                                               ; preds = %12
  store volatile i32 0, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 6), align 4, !tbaa !12
  %14 = call i32 @FLASH_WaitForLastOperation(i32 noundef 50000, i32 noundef 1)
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %13
  store i32 1, ptr %4, align 4, !tbaa !13
  br label %18

17:                                               ; preds = %13
  store i32 0, ptr %4, align 4, !tbaa !13
  br label %18

18:                                               ; preds = %17, %16
  %19 = load i32, ptr %4, align 4, !tbaa !13
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %155

21:                                               ; preds = %18
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %22, i32 0, i32 0
  %24 = load i32, ptr %23, align 4, !tbaa !14
  %25 = and i32 %24, 1
  %26 = icmp eq i32 %25, 1
  br i1 %26, label %27, label %47

27:                                               ; preds = %21
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %28, i32 0, i32 1
  %30 = load i32, ptr %29, align 4, !tbaa !16
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %39

32:                                               ; preds = %27
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %33, i32 0, i32 2
  %35 = load i32, ptr %34, align 4, !tbaa !17
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %36, i32 0, i32 7
  %38 = load i32, ptr %37, align 4, !tbaa !18
  call void @FLASH_OB_EnableWRP(i32 noundef %35, i32 noundef %38)
  br label %46

39:                                               ; preds = %27
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 4, !tbaa !17
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %43, i32 0, i32 7
  %45 = load i32, ptr %44, align 4, !tbaa !18
  call void @FLASH_OB_DisableWRP(i32 noundef %42, i32 noundef %45)
  br label %46

46:                                               ; preds = %39, %32
  br label %47

47:                                               ; preds = %46, %21
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 4, !tbaa !14
  %51 = and i32 %50, 2
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %57

53:                                               ; preds = %47
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %54, i32 0, i32 3
  %56 = load i32, ptr %55, align 4, !tbaa !19
  call void @FLASH_OB_RDPConfig(i32 noundef %56)
  br label %57

57:                                               ; preds = %53, %47
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %58, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !14
  %61 = and i32 %60, 4
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %70

63:                                               ; preds = %57
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %64, i32 0, i32 5
  %66 = load i32, ptr %65, align 4, !tbaa !20
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %67, i32 0, i32 6
  %69 = load i32, ptr %68, align 4, !tbaa !21
  call void @FLASH_OB_UserConfig(i32 noundef %66, i32 noundef %69)
  br label %70

70:                                               ; preds = %63, %57
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 4, !tbaa !14
  %74 = and i32 %73, 8
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %89

76:                                               ; preds = %70
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %77, i32 0, i32 8
  %79 = load i32, ptr %78, align 4, !tbaa !22
  %80 = load ptr, ptr %3, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %80, i32 0, i32 9
  %82 = load i32, ptr %81, align 4, !tbaa !23
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %83, i32 0, i32 10
  %85 = load i32, ptr %84, align 4, !tbaa !24
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %86, i32 0, i32 7
  %88 = load i32, ptr %87, align 4, !tbaa !18
  call void @FLASH_OB_PCROPConfig(i32 noundef %79, i32 noundef %82, i32 noundef %85, i32 noundef %88)
  br label %89

89:                                               ; preds = %76, %70
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %90, i32 0, i32 0
  %92 = load i32, ptr %91, align 4, !tbaa !14
  %93 = and i32 %92, 16
  %94 = icmp eq i32 %93, 16
  br i1 %94, label %95, label %99

95:                                               ; preds = %89
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %96, i32 0, i32 4
  %98 = load i32, ptr %97, align 4, !tbaa !25
  call void @FLASH_OB_BOR_LevelConfig(i32 noundef %98)
  br label %99

99:                                               ; preds = %95, %89
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 4, !tbaa !14
  %103 = and i32 %102, 64
  %104 = icmp eq i32 %103, 64
  br i1 %104, label %105, label %115

105:                                              ; preds = %99
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %106, i32 0, i32 11
  %108 = load i32, ptr %107, align 4, !tbaa !26
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %109, i32 0, i32 12
  %111 = load i32, ptr %110, align 4, !tbaa !27
  %112 = load ptr, ptr %3, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %112, i32 0, i32 13
  %114 = load i32, ptr %113, align 4, !tbaa !28
  call void @FLASH_OB_BootAddConfig(i32 noundef %108, i32 noundef %111, i32 noundef %114)
  br label %115

115:                                              ; preds = %105, %99
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %116, i32 0, i32 0
  %118 = load i32, ptr %117, align 4, !tbaa !14
  %119 = and i32 %118, 32
  %120 = icmp eq i32 %119, 32
  br i1 %120, label %121, label %134

121:                                              ; preds = %115
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %122, i32 0, i32 14
  %124 = load i32, ptr %123, align 4, !tbaa !29
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %125, i32 0, i32 15
  %127 = load i32, ptr %126, align 4, !tbaa !30
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %128, i32 0, i32 16
  %130 = load i32, ptr %129, align 4, !tbaa !31
  %131 = load ptr, ptr %3, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %131, i32 0, i32 7
  %133 = load i32, ptr %132, align 4, !tbaa !18
  call void @FLASH_OB_SecureAreaConfig(i32 noundef %124, i32 noundef %127, i32 noundef %130, i32 noundef %133)
  br label %134

134:                                              ; preds = %121, %115
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %135, i32 0, i32 0
  %137 = load i32, ptr %136, align 4, !tbaa !14
  %138 = and i32 %137, 256
  %139 = icmp eq i32 %138, 256
  br i1 %139, label %140, label %144

140:                                              ; preds = %134
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %141, i32 0, i32 17
  %143 = load i32, ptr %142, align 4, !tbaa !32
  call void @FLASH_OB_SharedRAM_Config(i32 noundef %143)
  br label %144

144:                                              ; preds = %140, %134
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %145, i32 0, i32 0
  %147 = load i32, ptr %146, align 4, !tbaa !14
  %148 = and i32 %147, 512
  %149 = icmp eq i32 %148, 512
  br i1 %149, label %150, label %154

150:                                              ; preds = %144
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.FLASH_OBProgramInitTypeDef, ptr %151, i32 0, i32 18
  %153 = load i32, ptr %152, align 4, !tbaa !33
  call void @FLASH_OB_CPUFreq_BoostConfig(i32 noundef %153)
  br label %154

154:                                              ; preds = %150, %144
  br label %155

155:                                              ; preds = %154, %18
  br label %156

156:                                              ; preds = %155
  store i32 0, ptr getelementptr inbounds (%struct.FLASH_ProcessTypeDef, ptr @pFlash, i32 0, i32 5), align 4, !tbaa !9
  br label %157

157:                                              ; preds = %156
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %4, align 4, !tbaa !13
  store i32 %159, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %160

160:                                              ; preds = %158, %9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %161 = load i32, ptr %2, align 4
  ret i32 %161
}

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_EnableWRP(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_DisableWRP(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_RDPConfig(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_UserConfig(i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_PCROPConfig(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_BOR_LevelConfig(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_BootAddConfig(i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_SecureAreaConfig(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_SharedRAM_Config(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_CPUFreq_BoostConfig(i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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, !11, i64 20}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 24}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72}
!16 = !{!15, !11, i64 4}
!17 = !{!15, !11, i64 8}
!18 = !{!15, !11, i64 28}
!19 = !{!15, !11, i64 12}
!20 = !{!15, !11, i64 20}
!21 = !{!15, !11, i64 24}
!22 = !{!15, !11, i64 32}
!23 = !{!15, !11, i64 36}
!24 = !{!15, !11, i64 40}
!25 = !{!15, !11, i64 16}
!26 = !{!15, !11, i64 44}
!27 = !{!15, !11, i64 48}
!28 = !{!15, !11, i64 52}
!29 = !{!15, !11, i64 56}
!30 = !{!15, !11, i64 60}
!31 = !{!15, !11, i64 64}
!32 = !{!15, !11, i64 68}
!33 = !{!15, !11, i64 72}


; 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 global %struct.FLASH_ProcessTypeDef, align 4

declare i32 @FLASH_WaitForLastOperation(i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 3) i32 @HAL_FLASHEx_OBProgram(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = load i32, ptr getelementptr inbounds (i8, ptr @pFlash, i64 20), align 4, !tbaa !5
  %3 = icmp eq i32 %2, 1
  br i1 %3, label %86, label %4

4:                                                ; preds = %1
  store i32 1, ptr getelementptr inbounds (i8, ptr @pFlash, i64 20), align 4, !tbaa !5
  store volatile i32 0, ptr getelementptr inbounds (i8, ptr @pFlash, i64 24), align 4, !tbaa !10
  %5 = tail call i32 @FLASH_WaitForLastOperation(i32 noundef 50000, i32 noundef 1) #2
  %.not = icmp ne i32 %5, 0
  %. = zext i1 %.not to i32
  br i1 %.not, label %85, label %6

6:                                                ; preds = %4
  %7 = load i32, ptr %0, align 4, !tbaa !11
  %8 = and i32 %7, 1
  %.not34 = icmp eq i32 %8, 0
  br i1 %.not34, label %19, label %9

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 4
  %11 = load i32, ptr %10, align 4, !tbaa !13
  %12 = icmp eq i32 %11, 1
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load i32, ptr %13, align 4, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %0, i64 28
  %16 = load i32, ptr %15, align 4, !tbaa !15
  br i1 %12, label %17, label %18

17:                                               ; preds = %9
  tail call void @FLASH_OB_EnableWRP(i32 noundef %14, i32 noundef %16)
  br label %19

18:                                               ; preds = %9
  tail call void @FLASH_OB_DisableWRP(i32 noundef %14, i32 noundef %16)
  br label %19

19:                                               ; preds = %17, %18, %6
  %20 = load i32, ptr %0, align 4, !tbaa !11
  %21 = and i32 %20, 2
  %.not35 = icmp eq i32 %21, 0
  br i1 %.not35, label %25, label %22

22:                                               ; preds = %19
  %23 = getelementptr inbounds i8, ptr %0, i64 12
  %24 = load i32, ptr %23, align 4, !tbaa !16
  tail call void @FLASH_OB_RDPConfig(i32 noundef %24)
  %.pre = load i32, ptr %0, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %22, %19
  %26 = phi i32 [ %.pre, %22 ], [ %20, %19 ]
  %27 = and i32 %26, 4
  %.not36 = icmp eq i32 %27, 0
  br i1 %.not36, label %33, label %28

28:                                               ; preds = %25
  %29 = getelementptr inbounds i8, ptr %0, i64 20
  %30 = load i32, ptr %29, align 4, !tbaa !17
  %31 = getelementptr inbounds i8, ptr %0, i64 24
  %32 = load i32, ptr %31, align 4, !tbaa !18
  tail call void @FLASH_OB_UserConfig(i32 noundef %30, i32 noundef %32)
  %.pre43 = load i32, ptr %0, align 4, !tbaa !11
  br label %33

33:                                               ; preds = %28, %25
  %34 = phi i32 [ %.pre43, %28 ], [ %26, %25 ]
  %35 = and i32 %34, 8
  %.not37 = icmp eq i32 %35, 0
  br i1 %.not37, label %45, label %36

36:                                               ; preds = %33
  %37 = getelementptr inbounds i8, ptr %0, i64 32
  %38 = load i32, ptr %37, align 4, !tbaa !19
  %39 = getelementptr inbounds i8, ptr %0, i64 36
  %40 = load i32, ptr %39, align 4, !tbaa !20
  %41 = getelementptr inbounds i8, ptr %0, i64 40
  %42 = load i32, ptr %41, align 4, !tbaa !21
  %43 = getelementptr inbounds i8, ptr %0, i64 28
  %44 = load i32, ptr %43, align 4, !tbaa !15
  tail call void @FLASH_OB_PCROPConfig(i32 noundef %38, i32 noundef %40, i32 noundef %42, i32 noundef %44)
  %.pre44 = load i32, ptr %0, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %36, %33
  %46 = phi i32 [ %.pre44, %36 ], [ %34, %33 ]
  %47 = and i32 %46, 16
  %.not38 = icmp eq i32 %47, 0
  br i1 %.not38, label %51, label %48

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %0, i64 16
  %50 = load i32, ptr %49, align 4, !tbaa !22
  tail call void @FLASH_OB_BOR_LevelConfig(i32 noundef %50)
  %.pre45 = load i32, ptr %0, align 4, !tbaa !11
  br label %51

51:                                               ; preds = %48, %45
  %52 = phi i32 [ %.pre45, %48 ], [ %46, %45 ]
  %53 = and i32 %52, 64
  %.not39 = icmp eq i32 %53, 0
  br i1 %.not39, label %61, label %54

54:                                               ; preds = %51
  %55 = getelementptr inbounds i8, ptr %0, i64 44
  %56 = load i32, ptr %55, align 4, !tbaa !23
  %57 = getelementptr inbounds i8, ptr %0, i64 48
  %58 = load i32, ptr %57, align 4, !tbaa !24
  %59 = getelementptr inbounds i8, ptr %0, i64 52
  %60 = load i32, ptr %59, align 4, !tbaa !25
  tail call void @FLASH_OB_BootAddConfig(i32 noundef %56, i32 noundef %58, i32 noundef %60)
  %.pre46 = load i32, ptr %0, align 4, !tbaa !11
  br label %61

61:                                               ; preds = %54, %51
  %62 = phi i32 [ %.pre46, %54 ], [ %52, %51 ]
  %63 = and i32 %62, 32
  %.not40 = icmp eq i32 %63, 0
  br i1 %.not40, label %73, label %64

64:                                               ; preds = %61
  %65 = getelementptr inbounds i8, ptr %0, i64 56
  %66 = load i32, ptr %65, align 4, !tbaa !26
  %67 = getelementptr inbounds i8, ptr %0, i64 60
  %68 = load i32, ptr %67, align 4, !tbaa !27
  %69 = getelementptr inbounds i8, ptr %0, i64 64
  %70 = load i32, ptr %69, align 4, !tbaa !28
  %71 = getelementptr inbounds i8, ptr %0, i64 28
  %72 = load i32, ptr %71, align 4, !tbaa !15
  tail call void @FLASH_OB_SecureAreaConfig(i32 noundef %66, i32 noundef %68, i32 noundef %70, i32 noundef %72)
  %.pre47 = load i32, ptr %0, align 4, !tbaa !11
  br label %73

73:                                               ; preds = %64, %61
  %74 = phi i32 [ %.pre47, %64 ], [ %62, %61 ]
  %75 = and i32 %74, 256
  %.not41 = icmp eq i32 %75, 0
  br i1 %.not41, label %79, label %76

76:                                               ; preds = %73
  %77 = getelementptr inbounds i8, ptr %0, i64 68
  %78 = load i32, ptr %77, align 4, !tbaa !29
  tail call void @FLASH_OB_SharedRAM_Config(i32 noundef %78)
  %.pre48 = load i32, ptr %0, align 4, !tbaa !11
  br label %79

79:                                               ; preds = %76, %73
  %80 = phi i32 [ %.pre48, %76 ], [ %74, %73 ]
  %81 = and i32 %80, 512
  %.not42 = icmp eq i32 %81, 0
  br i1 %.not42, label %85, label %82

82:                                               ; preds = %79
  %83 = getelementptr inbounds i8, ptr %0, i64 72
  %84 = load i32, ptr %83, align 4, !tbaa !30
  tail call void @FLASH_OB_CPUFreq_BoostConfig(i32 noundef %84)
  br label %85

85:                                               ; preds = %4, %82, %79
  store i32 0, ptr getelementptr inbounds (i8, ptr @pFlash, i64 20), align 4, !tbaa !5
  br label %86

86:                                               ; preds = %1, %85
  %.033 = phi i32 [ %., %85 ], [ 2, %1 ]
  ret i32 %.033
}

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_EnableWRP(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_DisableWRP(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_RDPConfig(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_UserConfig(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_PCROPConfig(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_BOR_LevelConfig(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_BootAddConfig(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_SecureAreaConfig(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_SharedRAM_Config(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @FLASH_OB_CPUFreq_BoostConfig(i32 noundef) local_unnamed_addr #1

attributes #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" }
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 20}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 24}
!11 = !{!12, !7, i64 0}
!12 = !{!"", !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, !7, i64 72}
!13 = !{!12, !7, i64 4}
!14 = !{!12, !7, i64 8}
!15 = !{!12, !7, i64 28}
!16 = !{!12, !7, i64 12}
!17 = !{!12, !7, i64 20}
!18 = !{!12, !7, i64 24}
!19 = !{!12, !7, i64 32}
!20 = !{!12, !7, i64 36}
!21 = !{!12, !7, i64 40}
!22 = !{!12, !7, i64 16}
!23 = !{!12, !7, i64 44}
!24 = !{!12, !7, i64 48}
!25 = !{!12, !7, i64 52}
!26 = !{!12, !7, i64 56}
!27 = !{!12, !7, i64 60}
!28 = !{!12, !7, i64 64}
!29 = !{!12, !7, i64 68}
!30 = !{!12, !7, i64 72}


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