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

; 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.RTC_HandleTypeDef = type { ptr, %struct.RTC_InitTypeDef, i32, i32 }
%struct.RTC_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_OscInitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.RCC_PLLInitTypeDef }
%struct.RCC_PLLInitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PeriphCLKInitTypeDef = type { i32, %struct.RCC_PLL2InitTypeDef, %struct.RCC_PLL3InitTypeDef, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL2InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL3InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [9 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x i32] }
%struct.RTC_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.PWR_TypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@hRTC_Handle = external hidden global %struct.RTC_HandleTypeDef, align 8
@SystemCoreClock = external global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local i32 @HAL_InitTick(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.RCC_OscInitTypeDef, align 4
  %6 = alloca %struct.RCC_PeriphCLKInitTypeDef, align 4
  %7 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store volatile i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 76, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 188, ptr %6) #3
  %8 = getelementptr inbounds %struct.RCC_OscInitTypeDef, ptr %5, i32 0, i32 0
  store i32 1, ptr %8, align 4, !tbaa !9
  %9 = getelementptr inbounds %struct.RCC_OscInitTypeDef, ptr %5, i32 0, i32 9
  %10 = getelementptr inbounds %struct.RCC_PLLInitTypeDef, ptr %9, i32 0, i32 0
  store i32 0, ptr %10, align 4, !tbaa !12
  %11 = getelementptr inbounds %struct.RCC_OscInitTypeDef, ptr %5, i32 0, i32 1
  store i32 65536, ptr %11, align 4, !tbaa !13
  %12 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %6, i32 0, i32 30
  store i32 66304, ptr %12, align 4, !tbaa !14
  %13 = call i32 @HAL_RCC_OscConfig(ptr noundef %5)
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %116

15:                                               ; preds = %1
  %16 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %6, i32 0, i32 0
  store i32 4194304, ptr %16, align 4, !tbaa !17
  %17 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef %6)
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %115

19:                                               ; preds = %15
  %20 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 28), align 4, !tbaa !18
  %21 = zext i32 %20 to i64
  %22 = or i64 %21, 32768
  %23 = trunc i64 %22 to i32
  store volatile i32 %23, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 28), align 4, !tbaa !18
  store ptr inttoptr (i64 1476411392 to ptr), ptr @hRTC_Handle, align 8, !tbaa !20
  store i32 0, ptr getelementptr inbounds (%struct.RTC_HandleTypeDef, ptr @hRTC_Handle, i32 0, i32 1), align 8, !tbaa !24
  store i32 99, ptr getelementptr inbounds (%struct.RTC_InitTypeDef, ptr getelementptr inbounds (%struct.RTC_HandleTypeDef, ptr @hRTC_Handle, i32 0, i32 1), i32 0, i32 1), align 4, !tbaa !25
  store i32 9, ptr getelementptr inbounds (%struct.RTC_InitTypeDef, ptr getelementptr inbounds (%struct.RTC_HandleTypeDef, ptr @hRTC_Handle, i32 0, i32 1), i32 0, i32 2), align 8, !tbaa !26
  store i32 0, ptr getelementptr inbounds (%struct.RTC_InitTypeDef, ptr getelementptr inbounds (%struct.RTC_HandleTypeDef, ptr @hRTC_Handle, i32 0, i32 1), i32 0, i32 3), align 4, !tbaa !27
  store i32 0, ptr getelementptr inbounds (%struct.RTC_InitTypeDef, ptr getelementptr inbounds (%struct.RTC_HandleTypeDef, ptr @hRTC_Handle, i32 0, i32 1), i32 0, i32 5), align 4, !tbaa !28
  store i32 0, ptr getelementptr inbounds (%struct.RTC_InitTypeDef, ptr getelementptr inbounds (%struct.RTC_HandleTypeDef, ptr @hRTC_Handle, i32 0, i32 1), i32 0, i32 6), align 8, !tbaa !29
  %24 = call i32 @HAL_RTC_Init(ptr noundef @hRTC_Handle)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %19
  store i32 1, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %117

27:                                               ; preds = %19
  br label %28

28:                                               ; preds = %27
  %29 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %30 = getelementptr inbounds %struct.RTC_TypeDef, ptr %29, i32 0, i32 9
  store volatile i32 202, ptr %30, align 4, !tbaa !30
  %31 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %32 = getelementptr inbounds %struct.RTC_TypeDef, ptr %31, i32 0, i32 9
  store volatile i32 83, ptr %32, align 4, !tbaa !30
  br label %33

33:                                               ; preds = %28
  br label %34

34:                                               ; preds = %33
  %35 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %36 = getelementptr inbounds %struct.RTC_TypeDef, ptr %35, i32 0, i32 2
  %37 = load volatile i32, ptr %36, align 4, !tbaa !32
  %38 = zext i32 %37 to i64
  %39 = and i64 %38, -1025
  %40 = trunc i64 %39 to i32
  store volatile i32 %40, ptr %36, align 4, !tbaa !32
  %41 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %42 = getelementptr inbounds %struct.RTC_TypeDef, ptr %41, i32 0, i32 2
  %43 = load volatile i32, ptr %42, align 4, !tbaa !32
  %44 = zext i32 %43 to i64
  %45 = and i64 %44, -16385
  %46 = trunc i64 %45 to i32
  store volatile i32 %46, ptr %42, align 4, !tbaa !32
  br label %47

47:                                               ; preds = %64, %34
  %48 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %49 = getelementptr inbounds %struct.RTC_TypeDef, ptr %48, i32 0, i32 3
  %50 = load volatile i32, ptr %49, align 4, !tbaa !33
  %51 = zext i32 %50 to i64
  %52 = and i64 %51, 4
  %53 = icmp ne i64 %52, 0
  %54 = zext i1 %53 to i64
  %55 = select i1 %53, i32 1, i32 0
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %65

57:                                               ; preds = %47
  %58 = load volatile i32, ptr %4, align 4, !tbaa !5
  %59 = add i32 %58, 1
  store volatile i32 %59, ptr %4, align 4, !tbaa !5
  %60 = load i32, ptr @SystemCoreClock, align 4, !tbaa !5
  %61 = udiv i32 %60, 48
  %62 = icmp eq i32 %58, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %57
  store i32 1, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %117

64:                                               ; preds = %57
  br label %47, !llvm.loop !34

65:                                               ; preds = %47
  %66 = load volatile i32, ptr getelementptr inbounds (%struct.PWR_TypeDef, ptr inttoptr (i64 1476544512 to ptr), i32 0, i32 4), align 4, !tbaa !36
  %67 = zext i32 %66 to i64
  %68 = or i64 %67, 512
  %69 = trunc i64 %68 to i32
  store volatile i32 %69, ptr getelementptr inbounds (%struct.PWR_TypeDef, ptr inttoptr (i64 1476544512 to ptr), i32 0, i32 4), align 4, !tbaa !36
  %70 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %71 = getelementptr inbounds %struct.RTC_TypeDef, ptr %70, i32 0, i32 3
  %72 = load volatile i32, ptr %71, align 4, !tbaa !33
  %73 = zext i32 %72 to i64
  %74 = and i64 %73, 128
  %75 = or i64 -1153, %74
  %76 = trunc i64 %75 to i32
  %77 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %78 = getelementptr inbounds %struct.RTC_TypeDef, ptr %77, i32 0, i32 3
  store volatile i32 %76, ptr %78, align 4, !tbaa !33
  %79 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %80 = getelementptr inbounds %struct.RTC_TypeDef, ptr %79, i32 0, i32 5
  store volatile i32 0, ptr %80, align 4, !tbaa !38
  %81 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %82 = getelementptr inbounds %struct.RTC_TypeDef, ptr %81, i32 0, i32 2
  %83 = load volatile i32, ptr %82, align 4, !tbaa !32
  %84 = and i32 %83, -8
  store volatile i32 %84, ptr %82, align 4, !tbaa !32
  %85 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %86 = getelementptr inbounds %struct.RTC_TypeDef, ptr %85, i32 0, i32 2
  %87 = load volatile i32, ptr %86, align 4, !tbaa !32
  %88 = or i32 %87, 4
  store volatile i32 %88, ptr %86, align 4, !tbaa !32
  %89 = load volatile i32, ptr inttoptr (i64 1476395136 to ptr), align 4, !tbaa !39
  %90 = zext i32 %89 to i64
  %91 = or i64 %90, 524288
  %92 = trunc i64 %91 to i32
  store volatile i32 %92, ptr inttoptr (i64 1476395136 to ptr), align 4, !tbaa !39
  %93 = load volatile i32, ptr inttoptr (i64 1476395008 to ptr), align 4, !tbaa !40
  %94 = zext i32 %93 to i64
  %95 = or i64 %94, 524288
  %96 = trunc i64 %95 to i32
  store volatile i32 %96, ptr inttoptr (i64 1476395008 to ptr), align 4, !tbaa !40
  %97 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %98 = getelementptr inbounds %struct.RTC_TypeDef, ptr %97, i32 0, i32 2
  %99 = load volatile i32, ptr %98, align 4, !tbaa !32
  %100 = zext i32 %99 to i64
  %101 = or i64 %100, 16384
  %102 = trunc i64 %101 to i32
  store volatile i32 %102, ptr %98, align 4, !tbaa !32
  %103 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %104 = getelementptr inbounds %struct.RTC_TypeDef, ptr %103, i32 0, i32 2
  %105 = load volatile i32, ptr %104, align 4, !tbaa !32
  %106 = zext i32 %105 to i64
  %107 = or i64 %106, 1024
  %108 = trunc i64 %107 to i32
  store volatile i32 %108, ptr %104, align 4, !tbaa !32
  br label %109

109:                                              ; preds = %65
  %110 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %111 = getelementptr inbounds %struct.RTC_TypeDef, ptr %110, i32 0, i32 9
  store volatile i32 255, ptr %111, align 4, !tbaa !30
  br label %112

112:                                              ; preds = %109
  br label %113

113:                                              ; preds = %112
  %114 = load i32, ptr %3, align 4, !tbaa !5
  call void @HAL_NVIC_SetPriority(i32 noundef 3, i32 noundef %114, i32 noundef 0)
  call void @HAL_NVIC_EnableIRQ(i32 noundef 3)
  store i32 0, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %117

115:                                              ; preds = %15
  br label %116

116:                                              ; preds = %115, %1
  store i32 1, ptr %2, align 4
  store i32 1, ptr %7, align 4
  br label %117

117:                                              ; preds = %116, %113, %63, %26
  call void @llvm.lifetime.end.p0(i64 188, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 76, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %118 = load i32, ptr %2, align 4
  ret i32 %118
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare i32 @HAL_RCC_OscConfig(ptr noundef) #2

declare i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef) #2

declare i32 @HAL_RTC_Init(ptr noundef) #2

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

declare void @HAL_NVIC_EnableIRQ(i32 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !11, i64 36}
!11 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36}
!12 = !{!10, !6, i64 36}
!13 = !{!10, !6, i64 4}
!14 = !{!15, !6, i64 176}
!15 = !{!"", !6, i64 0, !16, i64 4, !16, i64 36, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !6, i64 172, !6, i64 176, !6, i64 180, !6, i64 184}
!16 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!17 = !{!15, !6, i64 0}
!18 = !{!19, !6, i64 112}
!19 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !7, i64 172, !6, i64 208, !6, i64 212, !6, i64 216, !6, i64 220, !6, i64 224, !6, i64 228, !6, i64 232, !6, i64 236, !6, i64 240, !6, i64 244, !6, i64 248, !6, i64 252, !6, i64 256, !6, i64 260, !6, i64 264, !6, i64 268, !6, i64 272, !6, i64 276, !6, i64 280, !6, i64 284, !7, i64 288}
!20 = !{!21, !22, i64 0}
!21 = !{!"", !22, i64 0, !23, i64 8, !6, i64 36, !6, i64 40}
!22 = !{!"any pointer", !7, i64 0}
!23 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24}
!24 = !{!21, !6, i64 8}
!25 = !{!21, !6, i64 12}
!26 = !{!21, !6, i64 16}
!27 = !{!21, !6, i64 20}
!28 = !{!21, !6, i64 28}
!29 = !{!21, !6, i64 32}
!30 = !{!31, !6, i64 36}
!31 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !6, i64 172, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !6, i64 192, !6, i64 196, !6, i64 200, !6, i64 204}
!32 = !{!31, !6, i64 8}
!33 = !{!31, !6, i64 12}
!34 = distinct !{!34, !35}
!35 = !{!"llvm.loop.mustprogress"}
!36 = !{!37, !6, i64 16}
!37 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40}
!38 = !{!31, !6, i64 20}
!39 = !{!37, !6, i64 0}
!40 = !{!41, !6, i64 0}
!41 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !7, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !7, i64 56, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !7, i64 88, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168}


; 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.RTC_HandleTypeDef = type { ptr, %struct.RTC_InitTypeDef, i32, i32 }
%struct.RTC_InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_OscInitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.RCC_PLLInitTypeDef }
%struct.RCC_PLLInitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PeriphCLKInitTypeDef = type { i32, %struct.RCC_PLL2InitTypeDef, %struct.RCC_PLL3InitTypeDef, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL2InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL3InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }

@hRTC_Handle = external hidden global %struct.RTC_HandleTypeDef, align 8
@SystemCoreClock = external local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @HAL_InitTick(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  %3 = alloca %struct.RCC_OscInitTypeDef, align 4
  %4 = alloca %struct.RCC_PeriphCLKInitTypeDef, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2)
  store volatile i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 76, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 188, ptr nonnull %4) #3
  store i32 1, ptr %3, align 4, !tbaa !9
  %5 = getelementptr inbounds i8, ptr %3, i64 36
  store i32 0, ptr %5, align 4, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 65536, ptr %6, align 4, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %4, i64 176
  store i32 66304, ptr %7, align 4, !tbaa !14
  %8 = call i32 @HAL_RCC_OscConfig(ptr noundef nonnull %3) #3
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %.loopexit

10:                                               ; preds = %1
  store i32 4194304, ptr %4, align 4, !tbaa !17
  %11 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef nonnull %4) #3
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %.loopexit

13:                                               ; preds = %10
  %14 = load volatile i32, ptr inttoptr (i64 1476543600 to ptr), align 16, !tbaa !18
  %15 = or i32 %14, 32768
  store volatile i32 %15, ptr inttoptr (i64 1476543600 to ptr), align 16, !tbaa !18
  store ptr inttoptr (i64 1476411392 to ptr), ptr @hRTC_Handle, align 8, !tbaa !20
  store <4 x i32> <i32 0, i32 99, i32 9, i32 0>, ptr getelementptr inbounds (i8, ptr @hRTC_Handle, i64 8), align 8, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @hRTC_Handle, i64 28), align 4, !tbaa !24
  store i32 0, ptr getelementptr inbounds (i8, ptr @hRTC_Handle, i64 32), align 8, !tbaa !25
  %16 = call i32 @HAL_RTC_Init(ptr noundef nonnull @hRTC_Handle) #3
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %17, label %.loopexit

17:                                               ; preds = %13
  %18 = load ptr, ptr @hRTC_Handle, align 8, !tbaa !20
  %19 = getelementptr inbounds i8, ptr %18, i64 36
  store volatile i32 202, ptr %19, align 4, !tbaa !26
  store volatile i32 83, ptr %19, align 4, !tbaa !26
  %20 = getelementptr inbounds i8, ptr %18, i64 8
  %21 = load volatile i32, ptr %20, align 4, !tbaa !28
  %22 = and i32 %21, -1025
  store volatile i32 %22, ptr %20, align 4, !tbaa !28
  %23 = load volatile i32, ptr %20, align 4, !tbaa !28
  %24 = and i32 %23, -16385
  store volatile i32 %24, ptr %20, align 4, !tbaa !28
  %25 = getelementptr inbounds i8, ptr %18, i64 12
  %26 = load i32, ptr @SystemCoreClock, align 4
  %27 = udiv i32 %26, 48
  br label %28

28:                                               ; preds = %32, %17
  %29 = load volatile i32, ptr %25, align 4, !tbaa !29
  %30 = and i32 %29, 4
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %35

32:                                               ; preds = %28
  %.0..0..0..0. = load volatile i32, ptr %2, align 4, !tbaa !5
  %33 = add i32 %.0..0..0..0., 1
  store volatile i32 %33, ptr %2, align 4, !tbaa !5
  %34 = icmp eq i32 %.0..0..0..0., %27
  br i1 %34, label %.loopexit, label %28, !llvm.loop !30

35:                                               ; preds = %28
  %36 = load volatile i32, ptr inttoptr (i64 1476544528 to ptr), align 16, !tbaa !32
  %37 = or i32 %36, 512
  store volatile i32 %37, ptr inttoptr (i64 1476544528 to ptr), align 16, !tbaa !32
  %38 = load volatile i32, ptr %25, align 4, !tbaa !29
  %39 = and i32 %38, 128
  %40 = or disjoint i32 %39, -1153
  store volatile i32 %40, ptr %25, align 4, !tbaa !29
  %41 = getelementptr inbounds i8, ptr %18, i64 20
  store volatile i32 0, ptr %41, align 4, !tbaa !34
  %42 = load volatile i32, ptr %20, align 4, !tbaa !28
  %43 = and i32 %42, -8
  store volatile i32 %43, ptr %20, align 4, !tbaa !28
  %44 = load volatile i32, ptr %20, align 4, !tbaa !28
  %45 = or i32 %44, 4
  store volatile i32 %45, ptr %20, align 4, !tbaa !28
  %46 = load volatile i32, ptr inttoptr (i64 1476395136 to ptr), align 128, !tbaa !35
  %47 = or i32 %46, 524288
  store volatile i32 %47, ptr inttoptr (i64 1476395136 to ptr), align 128, !tbaa !35
  %48 = load volatile i32, ptr inttoptr (i64 1476395008 to ptr), align 134217728, !tbaa !36
  %49 = or i32 %48, 524288
  store volatile i32 %49, ptr inttoptr (i64 1476395008 to ptr), align 134217728, !tbaa !36
  %50 = load volatile i32, ptr %20, align 4, !tbaa !28
  %51 = or i32 %50, 16384
  store volatile i32 %51, ptr %20, align 4, !tbaa !28
  %52 = load volatile i32, ptr %20, align 4, !tbaa !28
  %53 = or i32 %52, 1024
  store volatile i32 %53, ptr %20, align 4, !tbaa !28
  store volatile i32 255, ptr %19, align 4, !tbaa !26
  call void @HAL_NVIC_SetPriority(i32 noundef 3, i32 noundef %0, i32 noundef 0) #3
  call void @HAL_NVIC_EnableIRQ(i32 noundef 3) #3
  br label %.loopexit

.loopexit:                                        ; preds = %32, %1, %10, %13, %35
  %.0 = phi i32 [ 0, %35 ], [ 1, %13 ], [ 1, %10 ], [ 1, %1 ], [ 1, %32 ]
  call void @llvm.lifetime.end.p0(i64 188, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 76, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2)
  ret i32 %.0
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

declare i32 @HAL_RCC_OscConfig(ptr noundef) local_unnamed_addr #2

declare i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef) local_unnamed_addr #2

declare i32 @HAL_RTC_Init(ptr noundef) local_unnamed_addr #2

declare void @HAL_NVIC_SetPriority(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @HAL_NVIC_EnableIRQ(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !11, i64 36}
!11 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36}
!12 = !{!10, !6, i64 36}
!13 = !{!10, !6, i64 4}
!14 = !{!15, !6, i64 176}
!15 = !{!"", !6, i64 0, !16, i64 4, !16, i64 36, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !6, i64 172, !6, i64 176, !6, i64 180, !6, i64 184}
!16 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!17 = !{!15, !6, i64 0}
!18 = !{!19, !6, i64 112}
!19 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !7, i64 172, !6, i64 208, !6, i64 212, !6, i64 216, !6, i64 220, !6, i64 224, !6, i64 228, !6, i64 232, !6, i64 236, !6, i64 240, !6, i64 244, !6, i64 248, !6, i64 252, !6, i64 256, !6, i64 260, !6, i64 264, !6, i64 268, !6, i64 272, !6, i64 276, !6, i64 280, !6, i64 284, !7, i64 288}
!20 = !{!21, !22, i64 0}
!21 = !{!"", !22, i64 0, !23, i64 8, !6, i64 36, !6, i64 40}
!22 = !{!"any pointer", !7, i64 0}
!23 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24}
!24 = !{!21, !6, i64 28}
!25 = !{!21, !6, i64 32}
!26 = !{!27, !6, i64 36}
!27 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !6, i64 88, !6, i64 92, !6, i64 96, !6, i64 100, !6, i64 104, !6, i64 108, !6, i64 112, !6, i64 116, !6, i64 120, !6, i64 124, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168, !6, i64 172, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188, !6, i64 192, !6, i64 196, !6, i64 200, !6, i64 204}
!28 = !{!27, !6, i64 8}
!29 = !{!27, !6, i64 12}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!33, !6, i64 16}
!33 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28, !6, i64 32, !6, i64 36, !6, i64 40}
!34 = !{!27, !6, i64 20}
!35 = !{!33, !6, i64 0}
!36 = !{!37, !6, i64 0}
!37 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !7, i64 24, !6, i64 32, !6, i64 36, !6, i64 40, !6, i64 44, !6, i64 48, !6, i64 52, !7, i64 56, !6, i64 64, !6, i64 68, !6, i64 72, !6, i64 76, !6, i64 80, !6, i64 84, !7, i64 88, !6, i64 128, !6, i64 132, !6, i64 136, !6, i64 140, !6, i64 144, !6, i64 148, !6, i64 152, !6, i64 156, !6, i64 160, !6, i64 164, !6, i64 168}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass