; LLVM IR from DroneBridge/DroneBridge :: video (video_main_air)

; 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.timespec = type { i64, i64 }
%struct.packet_buffer_t = type { i32, i32, i32, ptr }
%struct.db_uav_status_t = type <{ i32, i8, i8, i32, i32, i32, i32, i32, i16, i16, i8, i8, i32, [8 x %struct.db_adapter_status] }>
%struct.db_adapter_status = type <{ i32, i32, i8, [4 x i8], i8, i8, i8, i8, [16 x i8] }>

@num_data_per_block = external dso_local global i32, align 4
@num_fec_per_block = external dso_local global i32, align 4
@db_uav_status = external dso_local global ptr, align 8
@start_time = external dso_local global %struct.timespec, align 8
@end_time = external dso_local global %struct.timespec, align 8
@transmit_block.data_blocks = external hidden global [32 x ptr], align 16
@transmit_block.fec_pool = external hidden global [32 x [1450 x i8]], align 16
@transmit_block.fec_blocks = external hidden global [32 x ptr], align 16

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

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

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

; Function Attrs: nounwind
declare i32 @clock_gettime(i32 noundef, ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @TimeSpecToUSeconds(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @transmit_block(ptr noundef %0, ptr noundef %1, i32 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %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 %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %25, %3
  %12 = load i32, ptr %7, align 4, !tbaa !9
  %13 = load i32, ptr @num_data_per_block, align 4, !tbaa !9
  %14 = icmp ult i32 %12, %13
  br i1 %14, label %15, label %28

15:                                               ; preds = %11
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = load i32, ptr %7, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds %struct.packet_buffer_t, ptr %16, i64 %18
  %20 = getelementptr inbounds %struct.packet_buffer_t, ptr %19, i32 0, i32 3
  %21 = load ptr, ptr %20, align 8, !tbaa !11
  %22 = load i32, ptr %7, align 4, !tbaa !9
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %23
  store ptr %21, ptr %24, align 8, !tbaa !5
  br label %25

25:                                               ; preds = %15
  %26 = load i32, ptr %7, align 4, !tbaa !9
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %7, align 4, !tbaa !9
  br label %11, !llvm.loop !13

28:                                               ; preds = %11
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %41, %28
  %30 = load i32, ptr %7, align 4, !tbaa !9
  %31 = load i32, ptr @num_fec_per_block, align 4, !tbaa !9
  %32 = icmp ult i32 %30, %31
  br i1 %32, label %33, label %44

33:                                               ; preds = %29
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [32 x [1450 x i8]], ptr @transmit_block.fec_pool, i64 0, i64 %35
  %37 = getelementptr inbounds [1450 x i8], ptr %36, i64 0, i64 0
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [32 x ptr], ptr @transmit_block.fec_blocks, i64 0, i64 %39
  store ptr %37, ptr %40, align 8, !tbaa !5
  br label %41

41:                                               ; preds = %33
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %7, align 4, !tbaa !9
  br label %29, !llvm.loop !15

44:                                               ; preds = %29
  %45 = load i32, ptr @num_fec_per_block, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %58

47:                                               ; preds = %44
  %48 = call i32 @clock_gettime(i32 noundef 1, ptr noundef @start_time) #5
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = load i32, ptr @num_data_per_block, align 4, !tbaa !9
  %51 = load i32, ptr @num_fec_per_block, align 4, !tbaa !9
  call void @fec_encode(i32 noundef %49, ptr noundef @transmit_block.data_blocks, i32 noundef %50, ptr noundef @transmit_block.fec_blocks, i32 noundef %51)
  %52 = call i32 @clock_gettime(i32 noundef 1, ptr noundef @end_time) #5
  %53 = call i32 @TimeSpecToUSeconds(ptr noundef @end_time)
  %54 = call i32 @TimeSpecToUSeconds(ptr noundef @start_time)
  %55 = sub nsw i32 %53, %54
  %56 = load ptr, ptr @db_uav_status, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.db_uav_status_t, ptr %56, i32 0, i32 0
  store i32 %55, ptr %57, align 1, !tbaa !16
  br label %58

58:                                               ; preds = %47, %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = load i32, ptr %59, align 4, !tbaa !9
  store i32 %60, ptr %10, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %101, %58
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = load i32, ptr @num_data_per_block, align 4, !tbaa !9
  %64 = icmp ult i32 %62, %63
  br i1 %64, label %69, label %65

65:                                               ; preds = %61
  %66 = load i32, ptr %9, align 4, !tbaa !9
  %67 = load i32, ptr @num_fec_per_block, align 4, !tbaa !9
  %68 = icmp ult i32 %66, %67
  br label %69

69:                                               ; preds = %65, %61
  %70 = phi i1 [ true, %61 ], [ %68, %65 ]
  br i1 %70, label %71, label %102

71:                                               ; preds = %69
  %72 = load i32, ptr %8, align 4, !tbaa !9
  %73 = load i32, ptr @num_data_per_block, align 4, !tbaa !9
  %74 = icmp ult i32 %72, %73
  br i1 %74, label %75, label %86

75:                                               ; preds = %71
  %76 = load i32, ptr %10, align 4, !tbaa !9
  %77 = load i32, ptr %8, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !5
  %81 = load i32, ptr %6, align 4, !tbaa !9
  call void @transmit_packet(i32 noundef %76, ptr noundef %80, i32 noundef %81)
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = add i32 %82, 1
  store i32 %83, ptr %10, align 4, !tbaa !9
  %84 = load i32, ptr %8, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %8, align 4, !tbaa !9
  br label %86

86:                                               ; preds = %75, %71
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = load i32, ptr @num_fec_per_block, align 4, !tbaa !9
  %89 = icmp ult i32 %87, %88
  br i1 %89, label %90, label %101

90:                                               ; preds = %86
  %91 = load i32, ptr %10, align 4, !tbaa !9
  %92 = load i32, ptr %9, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [32 x [1450 x i8]], ptr @transmit_block.fec_pool, i64 0, i64 %93
  %95 = getelementptr inbounds [1450 x i8], ptr %94, i64 0, i64 0
  %96 = load i32, ptr %6, align 4, !tbaa !9
  call void @transmit_packet(i32 noundef %91, ptr noundef %95, i32 noundef %96)
  %97 = load i32, ptr %10, align 4, !tbaa !9
  %98 = add i32 %97, 1
  store i32 %98, ptr %10, align 4, !tbaa !9
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %9, align 4, !tbaa !9
  br label %101

101:                                              ; preds = %90, %86
  br label %61, !llvm.loop !19

102:                                              ; preds = %69
  %103 = load i32, ptr @num_data_per_block, align 4, !tbaa !9
  %104 = load i32, ptr @num_fec_per_block, align 4, !tbaa !9
  %105 = add i32 %103, %104
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = add i32 %107, %105
  store i32 %108, ptr %106, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %119, %102
  %110 = load i32, ptr %7, align 4, !tbaa !9
  %111 = load i32, ptr @num_data_per_block, align 4, !tbaa !9
  %112 = icmp ult i32 %110, %111
  br i1 %112, label %113, label %122

113:                                              ; preds = %109
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = load i32, ptr %7, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds %struct.packet_buffer_t, ptr %114, i64 %116
  %118 = getelementptr inbounds %struct.packet_buffer_t, ptr %117, i32 0, i32 2
  store i32 0, ptr %118, align 8, !tbaa !20
  br label %119

119:                                              ; preds = %113
  %120 = load i32, ptr %7, align 4, !tbaa !9
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %7, align 4, !tbaa !9
  br label %109, !llvm.loop !21

122:                                              ; preds = %109
  %123 = load ptr, ptr @db_uav_status, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.db_uav_status_t, ptr %123, i32 0, i32 3
  %125 = load i32, ptr %124, align 1, !tbaa !22
  %126 = add i32 %125, 1
  store i32 %126, ptr %124, align 1, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void
}

declare void @fec_encode(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "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 = { inlinehint 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 #4 = { "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 #5 = { 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, !6, i64 16}
!12 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!17, !10, i64 0}
!17 = !{!"", !10, i64 0, !7, i64 4, !7, i64 5, !10, i64 6, !10, i64 10, !10, i64 14, !10, i64 18, !10, i64 22, !18, i64 26, !18, i64 28, !7, i64 30, !7, i64 31, !10, i64 32, !7, i64 36}
!18 = !{!"short", !7, i64 0}
!19 = distinct !{!19, !14}
!20 = !{!12, !10, i64 8}
!21 = distinct !{!21, !14}
!22 = !{!17, !10, i64 6}


; 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.timespec = type { i64, i64 }
%struct.packet_buffer_t = type { i32, i32, i32, ptr }

@num_data_per_block = external dso_local local_unnamed_addr global i32, align 4
@num_fec_per_block = external dso_local local_unnamed_addr global i32, align 4
@db_uav_status = external dso_local local_unnamed_addr global ptr, align 8
@start_time = external dso_local global %struct.timespec, align 8
@end_time = external dso_local global %struct.timespec, align 8
@transmit_block.data_blocks = external hidden global [32 x ptr], align 16
@transmit_block.fec_pool = external hidden global [32 x [1450 x i8]], align 16
@transmit_block.fec_blocks = external hidden global [32 x ptr], align 16

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

; Function Attrs: nounwind
declare i32 @clock_gettime(i32 noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @transmit_block(ptr nocapture noundef %0, ptr nocapture noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = load i32, ptr @num_data_per_block, align 4, !tbaa !5
  %.not56 = icmp eq i32 %4, 0
  br i1 %.not56, label %.preheader, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %3
  %wide.trip.count = zext i32 %4 to i64
  %min.iters.check = icmp ult i32 %4, 17
  br i1 %min.iters.check, label %.lr.ph.preheader91, label %vector.memcheck

.lr.ph.preheader91:                               ; preds = %vector.body, %vector.memcheck, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.preheader ], [ %n.vec, %vector.body ]
  %5 = sub nsw i64 %wide.trip.count, %indvars.iv.ph
  %xtraiter = and i64 %5, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader91, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader91 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader91 ]
  %6 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %indvars.iv.prol, i32 3
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %8 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %indvars.iv.prol
  store ptr %7, ptr %8, align 8, !tbaa !12
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !13

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader91
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader91 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %9 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %10 = icmp ugt i64 %9, -4
  br i1 %10, label %.preheader, label %.lr.ph

vector.memcheck:                                  ; preds = %.lr.ph.preheader
  %11 = shl nuw nsw i64 %wide.trip.count, 3
  %scevgep = getelementptr i8, ptr @transmit_block.data_blocks, i64 %11
  %scevgep76 = getelementptr i8, ptr %0, i64 16
  %12 = mul nuw nsw i64 %wide.trip.count, 24
  %scevgep77 = getelementptr i8, ptr %0, i64 %12
  %bound0 = icmp ugt ptr %scevgep77, @transmit_block.data_blocks
  %bound1 = icmp ult ptr %scevgep76, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph.preheader91, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.mod.vf = and i64 %wide.trip.count, 3
  %13 = icmp eq i64 %n.mod.vf, 0
  %14 = select i1 %13, i64 4, i64 %n.mod.vf
  %n.vec = sub nsw i64 %wide.trip.count, %14
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %15 = or disjoint i64 %index, 1
  %16 = or disjoint i64 %index, 2
  %17 = or disjoint i64 %index, 3
  %18 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %index, i32 3
  %19 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %15, i32 3
  %20 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %16, i32 3
  %21 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %17, i32 3
  %22 = load ptr, ptr %18, align 8, !tbaa !9, !alias.scope !15
  %23 = load ptr, ptr %19, align 8, !tbaa !9, !alias.scope !15
  %24 = insertelement <2 x ptr> poison, ptr %22, i64 0
  %25 = insertelement <2 x ptr> %24, ptr %23, i64 1
  %26 = load ptr, ptr %20, align 8, !tbaa !9, !alias.scope !15
  %27 = load ptr, ptr %21, align 8, !tbaa !9, !alias.scope !15
  %28 = insertelement <2 x ptr> poison, ptr %26, i64 0
  %29 = insertelement <2 x ptr> %28, ptr %27, i64 1
  %30 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store <2 x ptr> %25, ptr %30, align 16, !tbaa !12, !alias.scope !18, !noalias !15
  store <2 x ptr> %29, ptr %31, align 16, !tbaa !12, !alias.scope !18, !noalias !15
  %index.next = add nuw i64 %index, 4
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %.lr.ph.preheader91, label %vector.body, !llvm.loop !20

.preheader:                                       ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %3
  %33 = load i32, ptr @num_fec_per_block, align 4
  %.not57 = icmp eq i32 %33, 0
  br i1 %.not57, label %._crit_edge.thread, label %.lr.ph43.preheader

.lr.ph43.preheader:                               ; preds = %.preheader
  %wide.trip.count65 = zext i32 %33 to i64
  %min.iters.check80 = icmp ult i32 %33, 4
  br i1 %min.iters.check80, label %.lr.ph43.preheader90, label %vector.ph81

.lr.ph43.preheader90:                             ; preds = %middle.block78, %.lr.ph43.preheader
  %indvars.iv62.ph = phi i64 [ 0, %.lr.ph43.preheader ], [ %n.vec83, %middle.block78 ]
  br label %.lr.ph43

vector.ph81:                                      ; preds = %.lr.ph43.preheader
  %n.vec83 = and i64 %wide.trip.count65, 4294967292
  br label %vector.body85

vector.body85:                                    ; preds = %vector.body85, %vector.ph81
  %index86 = phi i64 [ 0, %vector.ph81 ], [ %index.next88, %vector.body85 ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph81 ], [ %vec.ind.next, %vector.body85 ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %34 = getelementptr inbounds [32 x [1450 x i8]], ptr @transmit_block.fec_pool, i64 0, <2 x i64> %vec.ind
  %35 = getelementptr inbounds [32 x [1450 x i8]], ptr @transmit_block.fec_pool, i64 0, <2 x i64> %step.add
  %36 = getelementptr inbounds [32 x ptr], ptr @transmit_block.fec_blocks, i64 0, i64 %index86
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  store <2 x ptr> %34, ptr %36, align 16, !tbaa !12
  store <2 x ptr> %35, ptr %37, align 16, !tbaa !12
  %index.next88 = add nuw i64 %index86, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %38 = icmp eq i64 %index.next88, %n.vec83
  br i1 %38, label %middle.block78, label %vector.body85, !llvm.loop !24

middle.block78:                                   ; preds = %vector.body85
  %cmp.n = icmp eq i64 %n.vec83, %wide.trip.count65
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph43.preheader90

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %39 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %indvars.iv, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %indvars.iv
  store ptr %40, ptr %41, align 8, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %42 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %indvars.iv.next, i32 3
  %43 = load ptr, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %indvars.iv.next
  store ptr %43, ptr %44, align 8, !tbaa !12
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %45 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %indvars.iv.next.1, i32 3
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %indvars.iv.next.1
  store ptr %46, ptr %47, align 8, !tbaa !12
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %48 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %indvars.iv.next.2, i32 3
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  %50 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %indvars.iv.next.2
  store ptr %49, ptr %50, align 8, !tbaa !12
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %.preheader, label %.lr.ph, !llvm.loop !25

.lr.ph43:                                         ; preds = %.lr.ph43.preheader90, %.lr.ph43
  %indvars.iv62 = phi i64 [ %indvars.iv.next63, %.lr.ph43 ], [ %indvars.iv62.ph, %.lr.ph43.preheader90 ]
  %51 = getelementptr inbounds [32 x [1450 x i8]], ptr @transmit_block.fec_pool, i64 0, i64 %indvars.iv62
  %52 = getelementptr inbounds [32 x ptr], ptr @transmit_block.fec_blocks, i64 0, i64 %indvars.iv62
  store ptr %51, ptr %52, align 8, !tbaa !12
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65
  br i1 %exitcond66.not, label %._crit_edge, label %.lr.ph43, !llvm.loop !26

._crit_edge:                                      ; preds = %.lr.ph43, %middle.block78
  br i1 %.not57, label %._crit_edge.thread, label %53

53:                                               ; preds = %._crit_edge
  %54 = tail call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull @start_time) #4
  %55 = load i32, ptr @num_data_per_block, align 4, !tbaa !5
  %56 = load i32, ptr @num_fec_per_block, align 4, !tbaa !5
  tail call void @fec_encode(i32 noundef %2, ptr noundef nonnull @transmit_block.data_blocks, i32 noundef %55, ptr noundef nonnull @transmit_block.fec_blocks, i32 noundef %56) #4
  %57 = tail call i32 @clock_gettime(i32 noundef 1, ptr noundef nonnull @end_time) #4
  %58 = tail call i32 @TimeSpecToUSeconds(ptr noundef nonnull @end_time)
  %59 = tail call i32 @TimeSpecToUSeconds(ptr noundef nonnull @start_time)
  %60 = sub nsw i32 %58, %59
  %61 = load ptr, ptr @db_uav_status, align 8, !tbaa !12
  store i32 %60, ptr %61, align 1, !tbaa !27
  %.pre = load i32, ptr @num_data_per_block, align 4, !tbaa !5
  %.pre70 = load i32, ptr @num_fec_per_block, align 4
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.preheader, %53, %._crit_edge
  %62 = phi i32 [ %.pre70, %53 ], [ 0, %._crit_edge ], [ 0, %.preheader ]
  %63 = phi i32 [ %.pre, %53 ], [ %4, %._crit_edge ], [ %4, %.preheader ]
  %64 = load i32, ptr %1, align 4, !tbaa !5
  %65 = icmp ne i32 %63, 0
  %66 = icmp ne i32 %62, 0
  %67 = select i1 %65, i1 true, i1 %66
  br i1 %67, label %.lr.ph48, label %._crit_edge49

.lr.ph48:                                         ; preds = %._crit_edge.thread, %84
  %68 = phi i32 [ %85, %84 ], [ %62, %._crit_edge.thread ]
  %69 = phi i1 [ %87, %84 ], [ %65, %._crit_edge.thread ]
  %.046 = phi i32 [ %.2, %84 ], [ %64, %._crit_edge.thread ]
  %.02945 = phi i32 [ %.130, %84 ], [ 0, %._crit_edge.thread ]
  %.03144 = phi i32 [ %.132, %84 ], [ 0, %._crit_edge.thread ]
  br i1 %69, label %70, label %76

70:                                               ; preds = %.lr.ph48
  %71 = sext i32 %.03144 to i64
  %72 = getelementptr inbounds [32 x ptr], ptr @transmit_block.data_blocks, i64 0, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !12
  tail call void @transmit_packet(i32 noundef %.046, ptr noundef %73, i32 noundef %2)
  %74 = add i32 %.046, 1
  %75 = add nuw nsw i32 %.03144, 1
  %.pre71 = load i32, ptr @num_fec_per_block, align 4
  br label %76

76:                                               ; preds = %70, %.lr.ph48
  %77 = phi i32 [ %.pre71, %70 ], [ %68, %.lr.ph48 ]
  %.132 = phi i32 [ %75, %70 ], [ %.03144, %.lr.ph48 ]
  %.1 = phi i32 [ %74, %70 ], [ %.046, %.lr.ph48 ]
  %78 = icmp ult i32 %.02945, %77
  br i1 %78, label %79, label %84

79:                                               ; preds = %76
  %80 = sext i32 %.02945 to i64
  %81 = getelementptr inbounds [32 x [1450 x i8]], ptr @transmit_block.fec_pool, i64 0, i64 %80
  tail call void @transmit_packet(i32 noundef %.1, ptr noundef nonnull %81, i32 noundef %2)
  %82 = add i32 %.1, 1
  %83 = add nuw nsw i32 %.02945, 1
  %.pre72 = load i32, ptr @num_fec_per_block, align 4
  br label %84

84:                                               ; preds = %79, %76
  %85 = phi i32 [ %.pre72, %79 ], [ %77, %76 ]
  %.130 = phi i32 [ %83, %79 ], [ %.02945, %76 ]
  %.2 = phi i32 [ %82, %79 ], [ %.1, %76 ]
  %86 = load i32, ptr @num_data_per_block, align 4, !tbaa !5
  %87 = icmp ult i32 %.132, %86
  %88 = icmp ult i32 %.130, %85
  %89 = select i1 %87, i1 true, i1 %88
  br i1 %89, label %.lr.ph48, label %._crit_edge49.loopexit, !llvm.loop !30

._crit_edge49.loopexit:                           ; preds = %84
  %.pre73 = load i32, ptr %1, align 4, !tbaa !5
  %90 = add i32 %85, %86
  br label %._crit_edge49

._crit_edge49:                                    ; preds = %._crit_edge49.loopexit, %._crit_edge.thread
  %91 = phi i32 [ %64, %._crit_edge.thread ], [ %.pre73, %._crit_edge49.loopexit ]
  %92 = phi i32 [ 0, %._crit_edge.thread ], [ %90, %._crit_edge49.loopexit ]
  %93 = add i32 %92, %91
  store i32 %93, ptr %1, align 4, !tbaa !5
  %94 = load i32, ptr @num_data_per_block, align 4, !tbaa !5
  %.not58 = icmp eq i32 %94, 0
  br i1 %.not58, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %._crit_edge49, %.lr.ph54
  %indvars.iv67 = phi i64 [ %indvars.iv.next68, %.lr.ph54 ], [ 0, %._crit_edge49 ]
  %95 = getelementptr inbounds %struct.packet_buffer_t, ptr %0, i64 %indvars.iv67, i32 2
  store i32 0, ptr %95, align 8, !tbaa !31
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %96 = load i32, ptr @num_data_per_block, align 4, !tbaa !5
  %97 = zext i32 %96 to i64
  %98 = icmp ult i64 %indvars.iv.next68, %97
  br i1 %98, label %.lr.ph54, label %._crit_edge55, !llvm.loop !32

._crit_edge55:                                    ; preds = %.lr.ph54, %._crit_edge49
  %99 = load ptr, ptr @db_uav_status, align 8, !tbaa !12
  %100 = getelementptr inbounds i8, ptr %99, i64 6
  %101 = load i32, ptr %100, align 1, !tbaa !33
  %102 = add i32 %101, 1
  store i32 %102, ptr %100, align 1, !tbaa !33
  ret void
}

declare void @fec_encode(i32 noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #3

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 = { nounwind "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 = { inlinehint 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 = { "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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 16}
!10 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !11, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = !{!16}
!16 = distinct !{!16, !17}
!17 = distinct !{!17, !"LVerDomain"}
!18 = !{!19}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = distinct !{!24, !21, !22, !23}
!25 = distinct !{!25, !21, !22}
!26 = distinct !{!26, !21, !23, !22}
!27 = !{!28, !6, i64 0}
!28 = !{!"", !6, i64 0, !7, i64 4, !7, i64 5, !6, i64 6, !6, i64 10, !6, i64 14, !6, i64 18, !6, i64 22, !29, i64 26, !29, i64 28, !7, i64 30, !7, i64 31, !6, i64 32, !7, i64 36}
!29 = !{!"short", !7, i64 0}
!30 = distinct !{!30, !21}
!31 = !{!10, !6, i64 8}
!32 = distinct !{!32, !21}
!33 = !{!28, !6, i64 6}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass