; LLVM IR from ctlst-tech/catpilot :: bsp/mcu/periph/can/stm32 (can)

; 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.FDCAN_TxHeaderTypeDef = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.can_header_t = type { i32, i32, i32 }
%struct.can_t = type { [32 x i8], [32 x i8], %struct.FDCAN_HandleTypeDef, ptr, ptr, i32, i32, i32, i32, i32, i32, %struct.can_private_t }
%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.can_private_t = type { i32, i32, ptr, ptr, ptr, ptr, i32, i8, i32, [32 x ptr], ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1

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

declare i64 @xQueueSemaphoreTake(ptr 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 @can_transmit(ptr noundef %0, ptr noundef %1, ptr noundef %2) #2 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %struct.FDCAN_TxHeaderTypeDef, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %24, label %13

13:                                               ; preds = %3
  %14 = load ptr, ptr %7, align 8, !tbaa !5
  %15 = icmp eq ptr %14, null
  br i1 %15, label %24, label %16

16:                                               ; preds = %13
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = icmp eq ptr %17, null
  br i1 %18, label %24, label %19

19:                                               ; preds = %16
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.can_header_t, ptr %20, i32 0, i32 2
  %22 = load i32, ptr %21, align 4, !tbaa !11
  %23 = icmp ugt i32 %22, 8
  br i1 %23, label %24, label %25

24:                                               ; preds = %19, %16, %13, %3
  store i32 22, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %143

25:                                               ; preds = %19
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.can_t, ptr %26, i32 0, i32 11
  %28 = getelementptr inbounds %struct.can_private_t, ptr %27, i32 0, i32 4
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.can_t, ptr %30, i32 0, i32 5
  %32 = load i32, ptr %31, align 8, !tbaa !20
  %33 = mul i32 %32, 1000
  %34 = udiv i32 %33, 1000
  %35 = call i64 @xQueueSemaphoreTake(ptr noundef %29, i32 noundef %34)
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %38, label %37

37:                                               ; preds = %25
  store i32 116, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %143

38:                                               ; preds = %25
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.can_t, ptr %39, i32 0, i32 11
  %41 = getelementptr inbounds %struct.can_private_t, ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  %43 = call i64 @xQueueSemaphoreTake(ptr noundef %42, i32 noundef 0)
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.can_t, ptr %44, i32 0, i32 11
  %46 = getelementptr inbounds %struct.can_private_t, ptr %45, i32 0, i32 6
  store i32 1, ptr %46, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 36, ptr %10) #3
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.can_header_t, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 4, !tbaa !23
  %50 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 0
  store i32 %49, ptr %50, align 4, !tbaa !24
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.can_header_t, ptr %51, i32 0, i32 0
  %53 = load i32, ptr %52, align 4, !tbaa !23
  %54 = call i32 @can_id_type_to_hal(i32 noundef %53)
  %55 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 1
  store i32 %54, ptr %55, align 4, !tbaa !26
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.can_header_t, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 4, !tbaa !27
  %59 = call i32 @can_frame_type_to_hal(i32 noundef %58)
  %60 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 2
  store i32 %59, ptr %60, align 4, !tbaa !28
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.can_header_t, ptr %61, i32 0, i32 2
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = call i32 @can_length_to_hal(i32 noundef %63)
  %65 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 3
  store i32 %64, ptr %65, align 4, !tbaa !29
  %66 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 4
  store i32 0, ptr %66, align 4, !tbaa !30
  %67 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 5
  store i32 1048576, ptr %67, align 4, !tbaa !31
  %68 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 6
  store i32 0, ptr %68, align 4, !tbaa !32
  %69 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 7
  store i32 0, ptr %69, align 4, !tbaa !33
  %70 = getelementptr inbounds %struct.FDCAN_TxHeaderTypeDef, ptr %10, i32 0, i32 8
  store i32 0, ptr %70, align 4, !tbaa !34
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.can_t, ptr %71, i32 0, i32 2
  %73 = load ptr, ptr %7, align 8, !tbaa !5
  %74 = call i32 @HAL_FDCAN_AddMessageToTxFifoQ(ptr noundef %72, ptr noundef %10, ptr noundef %73)
  store i32 %74, ptr %8, align 4, !tbaa !9
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %87

77:                                               ; preds = %38
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.can_t, ptr %78, i32 0, i32 10
  %80 = load i32, ptr %79, align 4, !tbaa !35
  %81 = icmp eq i32 %80, 2
  br i1 %81, label %82, label %86

82:                                               ; preds = %77
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load ptr, ptr %6, align 8, !tbaa !5
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  call void @can_print_info(ptr noundef %83, ptr noundef %84, ptr noundef %85)
  br label %86

86:                                               ; preds = %82, %77
  br label %103

87:                                               ; preds = %38
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.can_t, ptr %88, i32 0, i32 10
  %90 = load i32, ptr %89, align 4, !tbaa !35
  %91 = icmp sgt i32 %90, 0
  br i1 %91, label %92, label %102

92:                                               ; preds = %87
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.can_t, ptr %93, i32 0, i32 0
  %95 = getelementptr inbounds [32 x i8], ptr %94, i64 0, i64 0
  %96 = call i32 (ptr, ...) @printf_(ptr noundef @.str.1, ptr noundef %95)
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.can_t, ptr %97, i32 0, i32 2
  %99 = getelementptr inbounds %struct.FDCAN_HandleTypeDef, ptr %98, i32 0, i32 7
  %100 = load volatile i32, ptr %99, align 8, !tbaa !36
  %101 = call i32 (ptr, ...) @printf_(ptr noundef @.str.2, i32 noundef %100)
  br label %102

102:                                              ; preds = %92, %87
  br label %103

103:                                              ; preds = %102, %86
  %104 = load i32, ptr %8, align 4, !tbaa !9
  %105 = icmp eq i32 %104, 0
  br i1 %105, label %106, label %133

106:                                              ; preds = %103
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.can_t, ptr %107, i32 0, i32 11
  %109 = getelementptr inbounds %struct.can_private_t, ptr %108, i32 0, i32 2
  %110 = load ptr, ptr %109, align 8, !tbaa !21
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.can_t, ptr %111, i32 0, i32 5
  %113 = load i32, ptr %112, align 8, !tbaa !20
  %114 = mul i32 %113, 1000
  %115 = udiv i32 %114, 1000
  %116 = call i64 @xQueueSemaphoreTake(ptr noundef %110, i32 noundef %115)
  %117 = icmp ne i64 %116, 0
  br i1 %117, label %133, label %118

118:                                              ; preds = %106
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.can_t, ptr %119, i32 0, i32 10
  %121 = load i32, ptr %120, align 4, !tbaa !35
  %122 = icmp sgt i32 %121, 0
  br i1 %122, label %123, label %132

123:                                              ; preds = %118
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.can_t, ptr %124, i32 0, i32 0
  %126 = getelementptr inbounds [32 x i8], ptr %125, i64 0, i64 0
  %127 = call i32 (ptr, ...) @printf_(ptr noundef @.str.1, ptr noundef %126)
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.can_t, ptr %128, i32 0, i32 5
  %130 = load i32, ptr %129, align 8, !tbaa !20
  %131 = call i32 (ptr, ...) @printf_(ptr noundef @.str.3, i32 noundef %130)
  br label %132

132:                                              ; preds = %123, %118
  store i32 116, ptr %8, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %132, %106, %103
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.can_t, ptr %134, i32 0, i32 11
  %136 = getelementptr inbounds %struct.can_private_t, ptr %135, i32 0, i32 6
  store i32 0, ptr %136, align 8, !tbaa !22
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.can_t, ptr %137, i32 0, i32 11
  %139 = getelementptr inbounds %struct.can_private_t, ptr %138, i32 0, i32 4
  %140 = load ptr, ptr %139, align 8, !tbaa !13
  %141 = call i64 @xQueueGenericSend(ptr noundef %140, ptr noundef null, i32 noundef 0, i64 noundef 0)
  %142 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %142, ptr %4, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 36, ptr %10) #3
  br label %143

143:                                              ; preds = %133, %37, %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %144 = load i32, ptr %4, align 4
  ret i32 %144
}

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

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

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

declare i32 @HAL_FDCAN_AddMessageToTxFifoQ(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @can_print_info(ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @printf_(ptr noundef, ...) #1

declare i64 @xQueueGenericSend(ptr noundef, ptr noundef, i32 noundef, i64 noundef) #1

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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8}
!13 = !{!14, !6, i64 312}
!14 = !{!"", !7, i64 0, !7, i64 32, !15, i64 64, !6, i64 248, !6, i64 256, !10, i64 264, !10, i64 268, !10, i64 272, !10, i64 276, !10, i64 280, !10, i64 284, !18, i64 288}
!15 = !{!"", !6, i64 0, !6, i64 8, !16, i64 16, !17, i64 124, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176}
!16 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!18 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !19, i64 44, !10, i64 48, !7, i64 56, !6, i64 312, !6, i64 320}
!19 = !{!"_Bool", !7, i64 0}
!20 = !{!14, !10, i64 264}
!21 = !{!14, !6, i64 296}
!22 = !{!14, !10, i64 328}
!23 = !{!12, !10, i64 0}
!24 = !{!25, !10, i64 0}
!25 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!26 = !{!25, !10, i64 4}
!27 = !{!12, !10, i64 4}
!28 = !{!25, !10, i64 8}
!29 = !{!25, !10, i64 12}
!30 = !{!25, !10, i64 16}
!31 = !{!25, !10, i64 20}
!32 = !{!25, !10, i64 24}
!33 = !{!25, !10, i64 28}
!34 = !{!25, !10, i64 32}
!35 = !{!14, !10, i64 284}
!36 = !{!14, !10, i64 240}


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

@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1

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

declare i64 @xQueueSemaphoreTake(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress 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 @can_transmit(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #2 {
  %4 = alloca %struct.FDCAN_TxHeaderTypeDef, align 4
  %5 = icmp eq ptr %0, null
  %6 = icmp eq ptr %2, null
  %or.cond = or i1 %5, %6
  %7 = icmp eq ptr %1, null
  %or.cond3 = or i1 %7, %or.cond
  br i1 %or.cond3, label %68, label %8

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = icmp ugt i32 %10, 8
  br i1 %11, label %68, label %12

12:                                               ; preds = %8
  %13 = getelementptr inbounds i8, ptr %0, i64 312
  %14 = load ptr, ptr %13, align 8, !tbaa !10
  %15 = getelementptr inbounds i8, ptr %0, i64 264
  %16 = load i32, ptr %15, align 8, !tbaa !18
  %17 = mul i32 %16, 1000
  %18 = udiv i32 %17, 1000
  %19 = tail call i64 @xQueueSemaphoreTake(ptr noundef %14, i32 noundef %18) #3
  %.not = icmp eq i64 %19, 0
  br i1 %.not, label %68, label %20

20:                                               ; preds = %12
  %21 = getelementptr inbounds i8, ptr %0, i64 296
  %22 = load ptr, ptr %21, align 8, !tbaa !19
  %23 = tail call i64 @xQueueSemaphoreTake(ptr noundef %22, i32 noundef 0) #3
  %24 = getelementptr inbounds i8, ptr %0, i64 328
  store i32 1, ptr %24, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %4) #3
  %25 = load i32, ptr %1, align 4, !tbaa !21
  store i32 %25, ptr %4, align 4, !tbaa !22
  %26 = tail call i32 @can_id_type_to_hal(i32 noundef %25)
  %27 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 %26, ptr %27, align 4, !tbaa !24
  %28 = getelementptr inbounds i8, ptr %1, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !25
  %30 = tail call i32 @can_frame_type_to_hal(i32 noundef %29)
  %31 = getelementptr inbounds i8, ptr %4, i64 8
  store i32 %30, ptr %31, align 4, !tbaa !26
  %32 = load i32, ptr %9, align 4, !tbaa !5
  %33 = tail call i32 @can_length_to_hal(i32 noundef %32)
  %34 = getelementptr inbounds i8, ptr %4, i64 12
  store i32 %33, ptr %34, align 4, !tbaa !27
  %35 = getelementptr inbounds i8, ptr %4, i64 16
  store <4 x i32> <i32 0, i32 1048576, i32 0, i32 0>, ptr %35, align 4, !tbaa !28
  %36 = getelementptr inbounds i8, ptr %4, i64 32
  store i32 0, ptr %36, align 4, !tbaa !29
  %37 = getelementptr inbounds i8, ptr %0, i64 64
  %38 = call i32 @HAL_FDCAN_AddMessageToTxFifoQ(ptr noundef nonnull %37, ptr noundef nonnull %4, ptr noundef nonnull %2) #3
  %39 = icmp eq i32 %38, 0
  %40 = getelementptr inbounds i8, ptr %0, i64 284
  %41 = load i32, ptr %40, align 4, !tbaa !30
  br i1 %39, label %42, label %45

42:                                               ; preds = %20
  %43 = icmp eq i32 %41, 2
  br i1 %43, label %44, label %52

44:                                               ; preds = %42
  call void @can_print_info(ptr noundef nonnull %0, ptr noundef nonnull %1, ptr noundef nonnull %2)
  br label %52

45:                                               ; preds = %20
  %46 = icmp sgt i32 %41, 0
  br i1 %46, label %47, label %65

47:                                               ; preds = %45
  %48 = call i32 (ptr, ...) @printf_(ptr noundef nonnull @.str.1, ptr noundef nonnull %0) #3
  %49 = getelementptr inbounds i8, ptr %0, i64 240
  %50 = load volatile i32, ptr %49, align 8, !tbaa !31
  %51 = call i32 (ptr, ...) @printf_(ptr noundef nonnull @.str.2, i32 noundef %50) #3
  br label %65

52:                                               ; preds = %42, %44
  %53 = load ptr, ptr %21, align 8, !tbaa !19
  %54 = load i32, ptr %15, align 8, !tbaa !18
  %55 = mul i32 %54, 1000
  %56 = udiv i32 %55, 1000
  %57 = call i64 @xQueueSemaphoreTake(ptr noundef %53, i32 noundef %56) #3
  %.not39 = icmp eq i64 %57, 0
  br i1 %.not39, label %58, label %65

58:                                               ; preds = %52
  %59 = load i32, ptr %40, align 4, !tbaa !30
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %61, label %65

61:                                               ; preds = %58
  %62 = call i32 (ptr, ...) @printf_(ptr noundef nonnull @.str.1, ptr noundef nonnull %0) #3
  %63 = load i32, ptr %15, align 8, !tbaa !18
  %64 = call i32 (ptr, ...) @printf_(ptr noundef nonnull @.str.3, i32 noundef %63) #3
  br label %65

65:                                               ; preds = %47, %45, %58, %61, %52
  %.0 = phi i32 [ 0, %52 ], [ 116, %61 ], [ 116, %58 ], [ %38, %45 ], [ %38, %47 ]
  store i32 0, ptr %24, align 8, !tbaa !20
  %66 = load ptr, ptr %13, align 8, !tbaa !10
  %67 = call i64 @xQueueGenericSend(ptr noundef %66, ptr noundef null, i32 noundef 0, i64 noundef 0) #3
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %4) #3
  br label %68

68:                                               ; preds = %12, %3, %8, %65
  %.034 = phi i32 [ %.0, %65 ], [ 22, %8 ], [ 22, %3 ], [ 116, %12 ]
  ret i32 %.034
}

; Function Attrs: nounwind uwtable
declare hidden i32 @can_id_type_to_hal(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @can_frame_type_to_hal(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare hidden i32 @can_length_to_hal(i32 noundef) local_unnamed_addr #2

declare i32 @HAL_FDCAN_AddMessageToTxFifoQ(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @can_print_info(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @printf_(ptr noundef, ...) local_unnamed_addr #1

declare i64 @xQueueGenericSend(ptr noundef, ptr noundef, i32 noundef, i64 noundef) local_unnamed_addr #1

attributes #0 = { mustprogress 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, !7, i64 8}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !13, i64 312}
!11 = !{!"", !8, i64 0, !8, i64 32, !12, i64 64, !13, i64 248, !13, i64 256, !7, i64 264, !7, i64 268, !7, i64 272, !7, i64 276, !7, i64 280, !7, i64 284, !16, i64 288}
!12 = !{!"", !13, i64 0, !13, i64 8, !14, i64 16, !15, i64 124, !7, i64 164, !7, i64 168, !7, i64 172, !7, i64 176}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"", !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, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104}
!15 = !{!"", !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}
!16 = !{!"", !7, i64 0, !7, i64 4, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !7, i64 40, !17, i64 44, !7, i64 48, !8, i64 56, !13, i64 312, !13, i64 320}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!11, !7, i64 264}
!19 = !{!11, !13, i64 296}
!20 = !{!11, !7, i64 328}
!21 = !{!6, !7, i64 0}
!22 = !{!23, !7, i64 0}
!23 = !{!"", !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}
!24 = !{!23, !7, i64 4}
!25 = !{!6, !7, i64 4}
!26 = !{!23, !7, i64 8}
!27 = !{!23, !7, i64 12}
!28 = !{!7, !7, i64 0}
!29 = !{!23, !7, i64 32}
!30 = !{!11, !7, i64 284}
!31 = !{!11, !7, i64 240}


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