; LLVM IR from reazon-research/OpenArm :: control/canfd_control/Core/Src (fdcan)

; 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.GPIO_InitTypeDef = type { i32, i32, i32, i32, i32 }
%struct.RCC_PeriphCLKInitTypeDef = type { i64, %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 }
%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.FDCAN_HandleTypeDef = type { ptr, ptr, %struct.FDCAN_InitTypeDef, %struct.FDCAN_MsgRamAddressTypeDef, i32, i32, i32, i32 }
%struct.FDCAN_InitTypeDef = 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 }
%struct.FDCAN_MsgRamAddressTypeDef = type { i32, i32, 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] }

@HAL_RCC_FDCAN_CLK_ENABLED = external hidden global i32, align 4

declare void @Error_Handler() #0

; Function Attrs: nounwind uwtable
define dso_local void @HAL_FDCAN_MspInit(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.GPIO_InitTypeDef, align 4
  %4 = alloca %struct.RCC_PeriphCLKInitTypeDef, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %3) #4
  call void @llvm.memset.p0.i64(ptr align 4 %3, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 184, ptr %4) #4
  call void @llvm.memset.p0.i64(ptr align 8 %4, i8 0, i64 184, i1 false)
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.FDCAN_HandleTypeDef, ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = icmp eq ptr %13, inttoptr (i64 1073782784 to ptr)
  br i1 %14, label %15, label %57

15:                                               ; preds = %1
  %16 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %4, i32 0, i32 0
  store i64 32768, ptr %16, align 8, !tbaa !14
  %17 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %4, i32 0, i32 12
  store i32 268435456, ptr %17, align 4, !tbaa !18
  %18 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef %4)
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %21

20:                                               ; preds = %15
  call void @Error_Handler()
  br label %21

21:                                               ; preds = %20, %15
  %22 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %23 = add i32 %22, 1
  store i32 %23, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %24 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %25 = icmp eq i32 %24, 1
  br i1 %25, label %26, label %39

26:                                               ; preds = %21
  br label %27

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %28 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %29 = zext i32 %28 to i64
  %30 = or i64 %29, 256
  %31 = trunc i64 %30 to i32
  store volatile i32 %31, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %32 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %33 = zext i32 %32 to i64
  %34 = and i64 %33, 256
  %35 = trunc i64 %34 to i32
  store volatile i32 %35, ptr %5, align 4, !tbaa !19
  %36 = load volatile i32, ptr %5, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %37

37:                                               ; preds = %27
  br label %38

38:                                               ; preds = %37
  br label %39

39:                                               ; preds = %38, %21
  br label %40

40:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %41 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %42 = zext i32 %41 to i64
  %43 = or i64 %42, 8
  %44 = trunc i64 %43 to i32
  store volatile i32 %44, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %45 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %46 = zext i32 %45 to i64
  %47 = and i64 %46, 8
  %48 = trunc i64 %47 to i32
  store volatile i32 %48, ptr %6, align 4, !tbaa !19
  %49 = load volatile i32, ptr %6, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %50

50:                                               ; preds = %40
  br label %51

51:                                               ; preds = %50
  %52 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 3, ptr %52, align 4, !tbaa !23
  %53 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %53, align 4, !tbaa !25
  %54 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %54, align 4, !tbaa !26
  %55 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 0, ptr %55, align 4, !tbaa !27
  %56 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 9, ptr %56, align 4, !tbaa !28
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476529152 to ptr), ptr noundef %3)
  call void @HAL_NVIC_SetPriority(i32 noundef 19, i32 noundef 0, i32 noundef 0)
  call void @HAL_NVIC_EnableIRQ(i32 noundef 19)
  br label %153

57:                                               ; preds = %1
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.FDCAN_HandleTypeDef, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = icmp eq ptr %60, inttoptr (i64 1073783808 to ptr)
  br i1 %61, label %62, label %104

62:                                               ; preds = %57
  %63 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %4, i32 0, i32 0
  store i64 32768, ptr %63, align 8, !tbaa !14
  %64 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %4, i32 0, i32 12
  store i32 268435456, ptr %64, align 4, !tbaa !18
  %65 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef %4)
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %68

67:                                               ; preds = %62
  call void @Error_Handler()
  br label %68

68:                                               ; preds = %67, %62
  %69 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %70 = add i32 %69, 1
  store i32 %70, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %71 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %72 = icmp eq i32 %71, 1
  br i1 %72, label %73, label %86

73:                                               ; preds = %68
  br label %74

74:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %75 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %76 = zext i32 %75 to i64
  %77 = or i64 %76, 256
  %78 = trunc i64 %77 to i32
  store volatile i32 %78, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %79 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %80 = zext i32 %79 to i64
  %81 = and i64 %80, 256
  %82 = trunc i64 %81 to i32
  store volatile i32 %82, ptr %7, align 4, !tbaa !19
  %83 = load volatile i32, ptr %7, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %84

84:                                               ; preds = %74
  br label %85

85:                                               ; preds = %84
  br label %86

86:                                               ; preds = %85, %68
  br label %87

87:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %88 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %89 = zext i32 %88 to i64
  %90 = or i64 %89, 2
  %91 = trunc i64 %90 to i32
  store volatile i32 %91, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %92 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %93 = zext i32 %92 to i64
  %94 = and i64 %93, 2
  %95 = trunc i64 %94 to i32
  store volatile i32 %95, ptr %8, align 4, !tbaa !19
  %96 = load volatile i32, ptr %8, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %97

97:                                               ; preds = %87
  br label %98

98:                                               ; preds = %97
  %99 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 96, ptr %99, align 4, !tbaa !23
  %100 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %100, align 4, !tbaa !25
  %101 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %101, align 4, !tbaa !26
  %102 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 0, ptr %102, align 4, !tbaa !27
  %103 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 9, ptr %103, align 4, !tbaa !28
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476527104 to ptr), ptr noundef %3)
  call void @HAL_NVIC_SetPriority(i32 noundef 20, i32 noundef 0, i32 noundef 0)
  call void @HAL_NVIC_EnableIRQ(i32 noundef 20)
  br label %152

104:                                              ; preds = %57
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.FDCAN_HandleTypeDef, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  %108 = icmp eq ptr %107, inttoptr (i64 1073796096 to ptr)
  br i1 %108, label %109, label %151

109:                                              ; preds = %104
  %110 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %4, i32 0, i32 0
  store i64 32768, ptr %110, align 8, !tbaa !14
  %111 = getelementptr inbounds %struct.RCC_PeriphCLKInitTypeDef, ptr %4, i32 0, i32 12
  store i32 268435456, ptr %111, align 4, !tbaa !18
  %112 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef %4)
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %115

114:                                              ; preds = %109
  call void @Error_Handler()
  br label %115

115:                                              ; preds = %114, %109
  %116 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %117 = add i32 %116, 1
  store i32 %117, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %118 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !19
  %119 = icmp eq i32 %118, 1
  br i1 %119, label %120, label %133

120:                                              ; preds = %115
  br label %121

121:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %122 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %123 = zext i32 %122 to i64
  %124 = or i64 %123, 256
  %125 = trunc i64 %124 to i32
  store volatile i32 %125, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %126 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 51), align 4, !tbaa !20
  %127 = zext i32 %126 to i64
  %128 = and i64 %127, 256
  %129 = trunc i64 %128 to i32
  store volatile i32 %129, ptr %9, align 4, !tbaa !19
  %130 = load volatile i32, ptr %9, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %131

131:                                              ; preds = %121
  br label %132

132:                                              ; preds = %131
  br label %133

133:                                              ; preds = %132, %115
  br label %134

134:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %135 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %136 = zext i32 %135 to i64
  %137 = or i64 %136, 8
  %138 = trunc i64 %137 to i32
  store volatile i32 %138, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %139 = load volatile i32, ptr getelementptr inbounds (%struct.RCC_TypeDef, ptr inttoptr (i64 1476543488 to ptr), i32 0, i32 48), align 4, !tbaa !22
  %140 = zext i32 %139 to i64
  %141 = and i64 %140, 8
  %142 = trunc i64 %141 to i32
  store volatile i32 %142, ptr %10, align 4, !tbaa !19
  %143 = load volatile i32, ptr %10, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %144

144:                                              ; preds = %134
  br label %145

145:                                              ; preds = %144
  %146 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 0
  store i32 12288, ptr %146, align 4, !tbaa !23
  %147 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 1
  store i32 2, ptr %147, align 4, !tbaa !25
  %148 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 2
  store i32 0, ptr %148, align 4, !tbaa !26
  %149 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 3
  store i32 0, ptr %149, align 4, !tbaa !27
  %150 = getelementptr inbounds %struct.GPIO_InitTypeDef, ptr %3, i32 0, i32 4
  store i32 5, ptr %150, align 4, !tbaa !28
  call void @HAL_GPIO_Init(ptr noundef inttoptr (i64 1476529152 to ptr), ptr noundef %3)
  br label %151

151:                                              ; preds = %145, %104
  br label %152

152:                                              ; preds = %151, %98
  br label %153

153:                                              ; preds = %152, %51
  call void @llvm.lifetime.end.p0(i64 184, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %3) #4
  ret void
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef) #0

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

declare void @HAL_GPIO_Init(ptr noundef, ptr noundef) #0

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

declare void @HAL_NVIC_EnableIRQ(i32 noundef) #0

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 8, !11, i64 16, !13, i64 124, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104}
!12 = !{!"int", !7, i64 0}
!13 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36}
!14 = !{!15, !16, i64 0}
!15 = !{!"", !16, i64 0, !17, i64 8, !17, i64 40, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !12, i64 172, !12, i64 176, !12, i64 180}
!16 = !{!"long", !7, i64 0}
!17 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!18 = !{!15, !12, i64 108}
!19 = !{!12, !12, i64 0}
!20 = !{!21, !12, i64 236}
!21 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !12, i64 124, !12, i64 128, !12, i64 132, !12, i64 136, !12, i64 140, !12, i64 144, !12, i64 148, !12, i64 152, !12, i64 156, !12, i64 160, !12, i64 164, !12, i64 168, !7, i64 172, !12, i64 208, !12, i64 212, !12, i64 216, !12, i64 220, !12, i64 224, !12, i64 228, !12, i64 232, !12, i64 236, !12, i64 240, !12, i64 244, !12, i64 248, !12, i64 252, !12, i64 256, !12, i64 260, !12, i64 264, !12, i64 268, !12, i64 272, !12, i64 276, !12, i64 280, !12, i64 284, !7, i64 288}
!22 = !{!21, !12, i64 224}
!23 = !{!24, !12, i64 0}
!24 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16}
!25 = !{!24, !12, i64 4}
!26 = !{!24, !12, i64 8}
!27 = !{!24, !12, i64 12}
!28 = !{!24, !12, i64 16}


; 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.GPIO_InitTypeDef = type { i32, i32, i32, i32, i32 }
%struct.RCC_PeriphCLKInitTypeDef = type { i64, %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 }
%struct.RCC_PLL2InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.RCC_PLL3InitTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32 }

@HAL_RCC_FDCAN_CLK_ENABLED = external hidden local_unnamed_addr global i32, align 4

declare void @Error_Handler() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @HAL_FDCAN_MspInit(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = alloca %struct.GPIO_InitTypeDef, align 16
  %3 = alloca %struct.RCC_PeriphCLKInitTypeDef, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %2, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 184, ptr nonnull %3) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(184) %3, i8 0, i64 184, i1 false)
  %10 = load ptr, ptr %0, align 8, !tbaa !5
  %magicptr12 = ptrtoint ptr %10 to i64
  switch i64 %magicptr12, label %68 [
    i64 1073782784, label %11
    i64 1073783808, label %30
    i64 1073796096, label %49
  ]

11:                                               ; preds = %1
  store i64 32768, ptr %3, align 8, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %3, i64 108
  store i32 268435456, ptr %12, align 4, !tbaa !17
  %13 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef nonnull %3) #4
  %.not11 = icmp eq i32 %13, 0
  br i1 %.not11, label %15, label %14

14:                                               ; preds = %11
  call void @Error_Handler() #4
  br label %15

15:                                               ; preds = %14, %11
  %16 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !18
  %17 = add i32 %16, 1
  store i32 %17, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !18
  %18 = icmp eq i32 %16, 0
  br i1 %18, label %19, label %24

19:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4)
  %20 = load volatile i32, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %21 = or i32 %20, 256
  store volatile i32 %21, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %22 = load volatile i32, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %23 = and i32 %22, 256
  store volatile i32 %23, ptr %4, align 4, !tbaa !18
  %.0..0..0..0.5 = load volatile i32, ptr %4, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4)
  br label %24

24:                                               ; preds = %15, %19
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5)
  %25 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %26 = or i32 %25, 8
  store volatile i32 %26, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %27 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %28 = and i32 %27, 8
  store volatile i32 %28, ptr %5, align 4, !tbaa !18
  %.0..0..0..0.4 = load volatile i32, ptr %5, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5)
  store <4 x i32> <i32 3, i32 2, i32 0, i32 0>, ptr %2, align 16, !tbaa !18
  %29 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 9, ptr %29, align 16, !tbaa !22
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476529152 to ptr), ptr noundef nonnull %2) #4
  call void @HAL_NVIC_SetPriority(i32 noundef 19, i32 noundef 0, i32 noundef 0) #4
  call void @HAL_NVIC_EnableIRQ(i32 noundef 19) #4
  br label %68

30:                                               ; preds = %1
  store i64 32768, ptr %3, align 8, !tbaa !13
  %31 = getelementptr inbounds i8, ptr %3, i64 108
  store i32 268435456, ptr %31, align 4, !tbaa !17
  %32 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef nonnull %3) #4
  %.not10 = icmp eq i32 %32, 0
  br i1 %.not10, label %34, label %33

33:                                               ; preds = %30
  call void @Error_Handler() #4
  br label %34

34:                                               ; preds = %33, %30
  %35 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !18
  %36 = add i32 %35, 1
  store i32 %36, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !18
  %37 = icmp eq i32 %35, 0
  br i1 %37, label %38, label %43

38:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6)
  %39 = load volatile i32, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %40 = or i32 %39, 256
  store volatile i32 %40, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %41 = load volatile i32, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %42 = and i32 %41, 256
  store volatile i32 %42, ptr %6, align 4, !tbaa !18
  %.0..0..0..0.3 = load volatile i32, ptr %6, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6)
  br label %43

43:                                               ; preds = %34, %38
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7)
  %44 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %45 = or i32 %44, 2
  store volatile i32 %45, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %46 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %47 = and i32 %46, 2
  store volatile i32 %47, ptr %7, align 4, !tbaa !18
  %.0..0..0..0.2 = load volatile i32, ptr %7, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7)
  store <4 x i32> <i32 96, i32 2, i32 0, i32 0>, ptr %2, align 16, !tbaa !18
  %48 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 9, ptr %48, align 16, !tbaa !22
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476527104 to ptr), ptr noundef nonnull %2) #4
  call void @HAL_NVIC_SetPriority(i32 noundef 20, i32 noundef 0, i32 noundef 0) #4
  call void @HAL_NVIC_EnableIRQ(i32 noundef 20) #4
  br label %68

49:                                               ; preds = %1
  store i64 32768, ptr %3, align 8, !tbaa !13
  %50 = getelementptr inbounds i8, ptr %3, i64 108
  store i32 268435456, ptr %50, align 4, !tbaa !17
  %51 = call i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef nonnull %3) #4
  %.not = icmp eq i32 %51, 0
  br i1 %.not, label %53, label %52

52:                                               ; preds = %49
  call void @Error_Handler() #4
  br label %53

53:                                               ; preds = %52, %49
  %54 = load i32, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !18
  %55 = add i32 %54, 1
  store i32 %55, ptr @HAL_RCC_FDCAN_CLK_ENABLED, align 4, !tbaa !18
  %56 = icmp eq i32 %54, 0
  br i1 %56, label %57, label %62

57:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8)
  %58 = load volatile i32, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %59 = or i32 %58, 256
  store volatile i32 %59, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %60 = load volatile i32, ptr inttoptr (i64 1476543724 to ptr), align 4, !tbaa !19
  %61 = and i32 %60, 256
  store volatile i32 %61, ptr %8, align 4, !tbaa !18
  %.0..0..0..0.1 = load volatile i32, ptr %8, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8)
  br label %62

62:                                               ; preds = %53, %57
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9)
  %63 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %64 = or i32 %63, 8
  store volatile i32 %64, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %65 = load volatile i32, ptr inttoptr (i64 1476543712 to ptr), align 32, !tbaa !21
  %66 = and i32 %65, 8
  store volatile i32 %66, ptr %9, align 4, !tbaa !18
  %.0..0..0..0. = load volatile i32, ptr %9, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9)
  store <4 x i32> <i32 12288, i32 2, i32 0, i32 0>, ptr %2, align 16, !tbaa !18
  %67 = getelementptr inbounds i8, ptr %2, i64 16
  store i32 5, ptr %67, align 16, !tbaa !22
  call void @HAL_GPIO_Init(ptr noundef nonnull inttoptr (i64 1476529152 to ptr), ptr noundef nonnull %2) #4
  br label %68

68:                                               ; preds = %1, %43, %62, %24
  call void @llvm.lifetime.end.p0(i64 184, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #4
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare i32 @HAL_RCCEx_PeriphCLKConfig(ptr noundef) local_unnamed_addr #0

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

declare void @HAL_GPIO_Init(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare void @HAL_NVIC_EnableIRQ(i32 noundef) local_unnamed_addr #0

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { 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 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16, !12, i64 124, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176}
!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, 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, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104}
!11 = !{!"int", !8, i64 0}
!12 = !{!"", !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}
!13 = !{!14, !15, i64 0}
!14 = !{!"", !15, i64 0, !16, i64 8, !16, i64 40, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180}
!15 = !{!"long", !8, i64 0}
!16 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!17 = !{!14, !11, i64 108}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !11, i64 236}
!20 = !{!"", !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, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !11, i64 160, !11, i64 164, !11, i64 168, !8, i64 172, !11, i64 208, !11, i64 212, !11, i64 216, !11, i64 220, !11, i64 224, !11, i64 228, !11, i64 232, !11, i64 236, !11, i64 240, !11, i64 244, !11, i64 248, !11, i64 252, !11, i64 256, !11, i64 260, !11, i64 264, !11, i64 268, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !8, i64 288}
!21 = !{!20, !11, i64 224}
!22 = !{!23, !11, i64 16}
!23 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass