; LLVM IR from microsoft/ntttcp-for-linux :: src (throughputmanagement)

; 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.report_segment = type { double, %struct.timeval, i64 }
%struct.timeval = type { i64, i64 }
%struct.ntttcp_test_endpoint = type { i32, ptr, i32, i32, %struct.timeval, %struct.timeval, i32, i32, i8, ptr, ptr, ptr, i8, ptr, i32, [8 x i32] }
%struct.ntttcp_test = type { i8, i8, i8, i8, i8, i8, i8, ptr, i32, i32, ptr, i32, i32, i8, i32, i32, i32, i32, i64, i64, i64, i64, i32, i32, i32, i8, ptr, ptr, i8, ptr, i8, ptr, i8, ptr, i8, i8 }
%struct.ntttcp_stream_client = type { ptr, i32, i32, ptr, i32, i32, i32, i64, i64, i64, i8, i8, i8, i8, i8, i32, i32, i64 }
%struct.ntttcp_stream_server = type { ptr, i32, i32, ptr, i32, i64, i8, i8, i8, i8, i8, i32, i32, %struct.fd_set, %struct.fd_set, i32, i64 }
%struct.fd_set = type { [16 x i64] }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@stdout = external global ptr, align 8

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

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

declare double @get_time_diff(ptr noundef, ptr noundef) #2

; 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 void @report_real_time_throughput(ptr dead_on_unwind noalias writable sret(%struct.report_segment) align 8 %0, ptr noundef %1, ptr noundef byval(%struct.report_segment) align 8 %2, i32 noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %struct.timeval, align 8
  %11 = alloca %struct.timeval, align 8
  %12 = alloca double, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i8, align 1
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %3, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %16 = getelementptr inbounds %struct.report_segment, ptr %2, i32 0, i32 2
  %17 = load i64, ptr %16, align 8, !tbaa !13
  store i64 %17, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  store i64 0, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #5
  %18 = getelementptr inbounds %struct.report_segment, ptr %2, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  store double 0.000000e+00, ptr %12, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %57, %4
  %20 = load i32, ptr %13, align 4, !tbaa !9
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = icmp ult i32 %20, %21
  br i1 %22, label %23, label %60

23:                                               ; preds = %19
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %24, i32 0, i32 1
  %26 = load ptr, ptr %25, align 8, !tbaa !19
  %27 = getelementptr inbounds %struct.ntttcp_test, ptr %26, i32 0, i32 1
  %28 = load i8, ptr %27, align 1, !tbaa !22, !range !24, !noundef !25
  %29 = trunc i8 %28 to i1
  %30 = zext i1 %29 to i32
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %32, label %44

32:                                               ; preds = %23
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %33, i32 0, i32 9
  %35 = load ptr, ptr %34, align 8, !tbaa !26
  %36 = load i32, ptr %13, align 4, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds ptr, ptr %35, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.ntttcp_stream_client, ptr %39, i32 0, i32 17
  %41 = load i64, ptr %40, align 8, !tbaa !27
  %42 = load i64, ptr %7, align 8, !tbaa !11
  %43 = add i64 %42, %41
  store i64 %43, ptr %7, align 8, !tbaa !11
  br label %56

44:                                               ; preds = %23
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %45, i32 0, i32 10
  %47 = load ptr, ptr %46, align 8, !tbaa !29
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds ptr, ptr %47, i64 %49
  %51 = load ptr, ptr %50, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.ntttcp_stream_server, ptr %51, i32 0, i32 16
  %53 = load i64, ptr %52, align 8, !tbaa !30
  %54 = load i64, ptr %7, align 8, !tbaa !11
  %55 = add i64 %54, %53
  store i64 %55, ptr %7, align 8, !tbaa !11
  br label %56

56:                                               ; preds = %44, %32
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %13, align 4, !tbaa !9
  %59 = add i32 %58, 1
  store i32 %59, ptr %13, align 4, !tbaa !9
  br label %19, !llvm.loop !33

60:                                               ; preds = %19
  %61 = call i32 @gettimeofday(ptr noundef %10, ptr noundef null) #5
  %62 = call double @get_time_diff(ptr noundef %10, ptr noundef %11)
  store double %62, ptr %12, align 8, !tbaa !18
  %63 = load i64, ptr %7, align 8, !tbaa !11
  %64 = load i64, ptr %8, align 8, !tbaa !11
  %65 = sub i64 %63, %64
  store i64 %65, ptr %9, align 8, !tbaa !11
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %66, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !19
  %69 = getelementptr inbounds %struct.ntttcp_test, ptr %68, i32 0, i32 34
  %70 = load i8, ptr %69, align 8, !tbaa !35, !range !24, !noundef !25
  %71 = trunc i8 %70 to i1
  br i1 %71, label %90, label %72

72:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %73 = load i64, ptr %9, align 8, !tbaa !11
  %74 = load double, ptr %12, align 8, !tbaa !18
  %75 = call ptr @format_throughput(i64 noundef %73, double noundef %74)
  store ptr %75, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #5
  store i8 10, ptr %15, align 1, !tbaa !36
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ntttcp_test_endpoint, ptr %76, i32 0, i32 12
  %78 = load i8, ptr %77, align 8, !tbaa !37, !range !24, !noundef !25
  %79 = trunc i8 %78 to i1
  br i1 %79, label %80, label %82

80:                                               ; preds = %72
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef 27)
  store i8 13, ptr %15, align 1, !tbaa !36
  br label %82

82:                                               ; preds = %80, %72
  %83 = load ptr, ptr %14, align 8, !tbaa !5
  %84 = load i8, ptr %15, align 1, !tbaa !36
  %85 = sext i8 %84 to i32
  %86 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef @.str.2, ptr noundef %83, i32 noundef %85)
  %87 = load ptr, ptr @stdout, align 8, !tbaa !5
  %88 = call i32 @fflush(ptr noundef %87)
  %89 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %89) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %90

90:                                               ; preds = %82, %60
  %91 = load double, ptr %12, align 8, !tbaa !18
  %92 = getelementptr inbounds %struct.report_segment, ptr %0, i32 0, i32 0
  store double %91, ptr %92, align 8, !tbaa !38
  %93 = getelementptr inbounds %struct.report_segment, ptr %0, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %93, ptr align 8 %10, i64 16, i1 false), !tbaa.struct !17
  %94 = load i64, ptr %7, align 8, !tbaa !11
  %95 = getelementptr inbounds %struct.report_segment, ptr %0, i32 0, i32 2
  store i64 %94, ptr %95, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare ptr @format_throughput(i64 noundef, double noundef) #2

declare i32 @printf(ptr noundef, ...) #2

declare i32 @fflush(ptr noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 24}
!14 = !{!"report_segment", !15, i64 0, !16, i64 8, !12, i64 24}
!15 = !{!"double", !7, i64 0}
!16 = !{!"timeval", !12, i64 0, !12, i64 8}
!17 = !{i64 0, i64 8, !11, i64 8, i64 8, !11}
!18 = !{!15, !15, i64 0}
!19 = !{!20, !6, i64 8}
!20 = !{!"ntttcp_test_endpoint", !10, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !16, i64 24, !16, i64 40, !10, i64 56, !10, i64 60, !21, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !21, i64 96, !6, i64 104, !10, i64 112, !7, i64 116}
!21 = !{!"_Bool", !7, i64 0}
!22 = !{!23, !21, i64 1}
!23 = !{!"ntttcp_test", !21, i64 0, !21, i64 1, !21, i64 2, !21, i64 3, !21, i64 4, !21, i64 5, !21, i64 6, !6, i64 8, !10, i64 16, !10, i64 20, !6, i64 24, !10, i64 32, !10, i64 36, !21, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !10, i64 96, !10, i64 100, !10, i64 104, !21, i64 108, !6, i64 112, !6, i64 120, !21, i64 128, !6, i64 136, !21, i64 144, !6, i64 152, !21, i64 160, !6, i64 168, !21, i64 176, !21, i64 177}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!20, !6, i64 72}
!27 = !{!28, !12, i64 80}
!28 = !{!"ntttcp_stream_client", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !21, i64 64, !21, i64 65, !21, i64 66, !21, i64 67, !21, i64 68, !10, i64 72, !10, i64 76, !12, i64 80}
!29 = !{!20, !6, i64 80}
!30 = !{!31, !12, i64 320}
!31 = !{!"ntttcp_stream_server", !6, i64 0, !10, i64 8, !10, i64 12, !6, i64 16, !10, i64 24, !12, i64 32, !21, i64 40, !21, i64 41, !21, i64 42, !21, i64 43, !21, i64 44, !10, i64 48, !10, i64 52, !32, i64 56, !32, i64 184, !10, i64 312, !12, i64 320}
!32 = !{!"", !7, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!23, !21, i64 176}
!36 = !{!7, !7, i64 0}
!37 = !{!20, !21, i64 96}
!38 = !{!14, !15, i64 0}


; 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.report_segment = type { double, %struct.timeval, i64 }
%struct.timeval = type { i64, i64 }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8

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

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

declare double @get_time_diff(ptr noundef, ptr 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) #0

; Function Attrs: nounwind uwtable
define dso_local void @report_real_time_throughput(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.report_segment) align 8 %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly byval(%struct.report_segment) align 8 %2, i32 noundef %3) local_unnamed_addr #3 {
  %5 = alloca %struct.timeval, align 8
  %6 = alloca %struct.timeval, align 8
  %7 = getelementptr inbounds i8, ptr %2, i64 24
  %8 = load i64, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %9 = getelementptr inbounds i8, ptr %2, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %9, i64 16, i1 false), !tbaa.struct !12
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %4
  %10 = getelementptr inbounds i8, ptr %1, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %12 = getelementptr inbounds i8, ptr %11, i64 1
  %13 = load i8, ptr %12, align 1, !tbaa !19, !range !21, !noundef !22
  %14 = trunc nuw i8 %13 to i1
  %wide.trip.count29 = zext i32 %3 to i64
  br i1 %14, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  %15 = getelementptr inbounds i8, ptr %1, i64 72
  %16 = load ptr, ptr %15, align 8, !tbaa !23
  %xtraiter36 = and i64 %wide.trip.count29, 3
  %17 = icmp ult i32 %3, 4
  br i1 %17, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.split.us.new

.lr.ph.split.us.new:                              ; preds = %.lr.ph.split.us
  %unroll_iter40 = and i64 %wide.trip.count29, 4294967292
  br label %18

18:                                               ; preds = %18, %.lr.ph.split.us.new
  %indvars.iv26 = phi i64 [ 0, %.lr.ph.split.us.new ], [ %indvars.iv.next27.3, %18 ]
  %.02023.us = phi i64 [ 0, %.lr.ph.split.us.new ], [ %.1.us.3, %18 ]
  %niter41 = phi i64 [ 0, %.lr.ph.split.us.new ], [ %niter41.next.3, %18 ]
  %19 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv26
  %20 = load ptr, ptr %19, align 8, !tbaa !24
  %21 = getelementptr inbounds i8, ptr %20, i64 80
  %.pn.us = load i64, ptr %21, align 8, !tbaa !13
  %.1.us = add i64 %.pn.us, %.02023.us
  %indvars.iv.next27 = or disjoint i64 %indvars.iv26, 1
  %22 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next27
  %23 = load ptr, ptr %22, align 8, !tbaa !24
  %24 = getelementptr inbounds i8, ptr %23, i64 80
  %.pn.us.1 = load i64, ptr %24, align 8, !tbaa !13
  %.1.us.1 = add i64 %.pn.us.1, %.1.us
  %indvars.iv.next27.1 = or disjoint i64 %indvars.iv26, 2
  %25 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next27.1
  %26 = load ptr, ptr %25, align 8, !tbaa !24
  %27 = getelementptr inbounds i8, ptr %26, i64 80
  %.pn.us.2 = load i64, ptr %27, align 8, !tbaa !13
  %.1.us.2 = add i64 %.pn.us.2, %.1.us.1
  %indvars.iv.next27.2 = or disjoint i64 %indvars.iv26, 3
  %28 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv.next27.2
  %29 = load ptr, ptr %28, align 8, !tbaa !24
  %30 = getelementptr inbounds i8, ptr %29, i64 80
  %.pn.us.3 = load i64, ptr %30, align 8, !tbaa !13
  %.1.us.3 = add i64 %.pn.us.3, %.1.us.2
  %indvars.iv.next27.3 = add nuw nsw i64 %indvars.iv26, 4
  %niter41.next.3 = add i64 %niter41, 4
  %niter41.ncmp.3 = icmp eq i64 %niter41.next.3, %unroll_iter40
  br i1 %niter41.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %18, !llvm.loop !25

.lr.ph.split:                                     ; preds = %.lr.ph
  %31 = getelementptr inbounds i8, ptr %1, i64 80
  %32 = load ptr, ptr %31, align 8, !tbaa !27
  %xtraiter = and i64 %wide.trip.count29, 3
  %33 = icmp ult i32 %3, 4
  br i1 %33, label %._crit_edge.loopexit33.unr-lcssa, label %.lr.ph.split.new

.lr.ph.split.new:                                 ; preds = %.lr.ph.split
  %unroll_iter = and i64 %wide.trip.count29, 4294967292
  br label %34

34:                                               ; preds = %34, %.lr.ph.split.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.split.new ], [ %indvars.iv.next.3, %34 ]
  %.02023 = phi i64 [ 0, %.lr.ph.split.new ], [ %.1.3, %34 ]
  %niter = phi i64 [ 0, %.lr.ph.split.new ], [ %niter.next.3, %34 ]
  %35 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv
  %36 = load ptr, ptr %35, align 8, !tbaa !24
  %37 = getelementptr inbounds i8, ptr %36, i64 320
  %.pn = load i64, ptr %37, align 8, !tbaa !13
  %.1 = add i64 %.pn, %.02023
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %38 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv.next
  %39 = load ptr, ptr %38, align 8, !tbaa !24
  %40 = getelementptr inbounds i8, ptr %39, i64 320
  %.pn.1 = load i64, ptr %40, align 8, !tbaa !13
  %.1.1 = add i64 %.pn.1, %.1
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %41 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv.next.1
  %42 = load ptr, ptr %41, align 8, !tbaa !24
  %43 = getelementptr inbounds i8, ptr %42, i64 320
  %.pn.2 = load i64, ptr %43, align 8, !tbaa !13
  %.1.2 = add i64 %.pn.2, %.1.1
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %44 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv.next.2
  %45 = load ptr, ptr %44, align 8, !tbaa !24
  %46 = getelementptr inbounds i8, ptr %45, i64 320
  %.pn.3 = load i64, ptr %46, align 8, !tbaa !13
  %.1.3 = add i64 %.pn.3, %.1.2
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit33.unr-lcssa, label %34, !llvm.loop !25

._crit_edge.loopexit.unr-lcssa:                   ; preds = %18, %.lr.ph.split.us
  %.1.us.lcssa.ph = phi i64 [ poison, %.lr.ph.split.us ], [ %.1.us.3, %18 ]
  %indvars.iv26.unr = phi i64 [ 0, %.lr.ph.split.us ], [ %indvars.iv.next27.3, %18 ]
  %.02023.us.unr = phi i64 [ 0, %.lr.ph.split.us ], [ %.1.us.3, %18 ]
  %lcmp.mod38.not = icmp eq i64 %xtraiter36, 0
  br i1 %lcmp.mod38.not, label %._crit_edge, label %.epil.preheader35

.epil.preheader35:                                ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader35
  %indvars.iv26.epil = phi i64 [ %indvars.iv.next27.epil, %.epil.preheader35 ], [ %indvars.iv26.unr, %._crit_edge.loopexit.unr-lcssa ]
  %.02023.us.epil = phi i64 [ %.1.us.epil, %.epil.preheader35 ], [ %.02023.us.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter37 = phi i64 [ %epil.iter37.next, %.epil.preheader35 ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %47 = getelementptr inbounds ptr, ptr %16, i64 %indvars.iv26.epil
  %48 = load ptr, ptr %47, align 8, !tbaa !24
  %49 = getelementptr inbounds i8, ptr %48, i64 80
  %.pn.us.epil = load i64, ptr %49, align 8, !tbaa !13
  %.1.us.epil = add i64 %.pn.us.epil, %.02023.us.epil
  %indvars.iv.next27.epil = add nuw nsw i64 %indvars.iv26.epil, 1
  %epil.iter37.next = add i64 %epil.iter37, 1
  %epil.iter37.cmp.not = icmp eq i64 %epil.iter37.next, %xtraiter36
  br i1 %epil.iter37.cmp.not, label %._crit_edge, label %.epil.preheader35, !llvm.loop !28

._crit_edge.loopexit33.unr-lcssa:                 ; preds = %34, %.lr.ph.split
  %.1.lcssa.ph = phi i64 [ poison, %.lr.ph.split ], [ %.1.3, %34 ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.split ], [ %indvars.iv.next.3, %34 ]
  %.02023.unr = phi i64 [ 0, %.lr.ph.split ], [ %.1.3, %34 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit33.unr-lcssa, %.epil.preheader
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.loopexit33.unr-lcssa ]
  %.02023.epil = phi i64 [ %.1.epil, %.epil.preheader ], [ %.02023.unr, %._crit_edge.loopexit33.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit33.unr-lcssa ]
  %50 = getelementptr inbounds ptr, ptr %32, i64 %indvars.iv.epil
  %51 = load ptr, ptr %50, align 8, !tbaa !24
  %52 = getelementptr inbounds i8, ptr %51, i64 320
  %.pn.epil = load i64, ptr %52, align 8, !tbaa !13
  %.1.epil = add i64 %.pn.epil, %.02023.epil
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !30

._crit_edge:                                      ; preds = %._crit_edge.loopexit33.unr-lcssa, %.epil.preheader, %._crit_edge.loopexit.unr-lcssa, %.epil.preheader35, %4
  %.020.lcssa = phi i64 [ 0, %4 ], [ %.1.us.lcssa.ph, %._crit_edge.loopexit.unr-lcssa ], [ %.1.us.epil, %.epil.preheader35 ], [ %.1.lcssa.ph, %._crit_edge.loopexit33.unr-lcssa ], [ %.1.epil, %.epil.preheader ]
  %53 = call i32 @gettimeofday(ptr noundef nonnull %5, ptr noundef null) #6
  %54 = call double @get_time_diff(ptr noundef nonnull %5, ptr noundef nonnull %6) #6
  %55 = getelementptr inbounds i8, ptr %1, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %56, i64 176
  %58 = load i8, ptr %57, align 8, !tbaa !31, !range !21, !noundef !22
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %72, label %60

60:                                               ; preds = %._crit_edge
  %61 = sub i64 %.020.lcssa, %8
  %62 = call ptr @format_throughput(i64 noundef %61, double noundef %54) #6
  %63 = getelementptr inbounds i8, ptr %1, i64 96
  %64 = load i8, ptr %63, align 8, !tbaa !32, !range !21, !noundef !22
  %65 = trunc nuw i8 %64 to i1
  br i1 %65, label %66, label %68

66:                                               ; preds = %60
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 27)
  br label %68

68:                                               ; preds = %66, %60
  %.0 = phi i32 [ 13, %66 ], [ 10, %60 ]
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @.str.2, ptr noundef %62, i32 noundef %.0)
  %70 = load ptr, ptr @stdout, align 8, !tbaa !24
  %71 = call i32 @fflush(ptr noundef %70)
  call void @free(ptr noundef %62) #6
  br label %72

72:                                               ; preds = %68, %._crit_edge
  store double %54, ptr %0, align 8, !tbaa !33
  %73 = getelementptr inbounds i8, ptr %0, i64 8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %73, ptr noundef nonnull align 8 dereferenceable(16) %5, i64 16, i1 false), !tbaa.struct !12
  %74 = getelementptr inbounds i8, ptr %0, i64 24
  store i64 %.020.lcssa, ptr %74, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

declare ptr @format_throughput(i64 noundef, double noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree 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 = { "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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { 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, !11, i64 24}
!6 = !{!"report_segment", !7, i64 0, !10, i64 8, !11, i64 24}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"timeval", !11, i64 0, !11, i64 8}
!11 = !{!"long", !8, i64 0}
!12 = !{i64 0, i64 8, !13, i64 8, i64 8, !13}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !17, i64 8}
!15 = !{!"ntttcp_test_endpoint", !16, i64 0, !17, i64 8, !16, i64 16, !16, i64 20, !10, i64 24, !10, i64 40, !16, i64 56, !16, i64 60, !18, i64 64, !17, i64 72, !17, i64 80, !17, i64 88, !18, i64 96, !17, i64 104, !16, i64 112, !8, i64 116}
!16 = !{!"int", !8, i64 0}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"_Bool", !8, i64 0}
!19 = !{!20, !18, i64 1}
!20 = !{!"ntttcp_test", !18, i64 0, !18, i64 1, !18, i64 2, !18, i64 3, !18, i64 4, !18, i64 5, !18, i64 6, !17, i64 8, !16, i64 16, !16, i64 20, !17, i64 24, !16, i64 32, !16, i64 36, !18, i64 40, !16, i64 44, !16, i64 48, !16, i64 52, !16, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88, !16, i64 96, !16, i64 100, !16, i64 104, !18, i64 108, !17, i64 112, !17, i64 120, !18, i64 128, !17, i64 136, !18, i64 144, !17, i64 152, !18, i64 160, !17, i64 168, !18, i64 176, !18, i64 177}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!15, !17, i64 72}
!24 = !{!17, !17, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!15, !17, i64 80}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.unroll.disable"}
!30 = distinct !{!30, !29}
!31 = !{!20, !18, i64 176}
!32 = !{!15, !18, i64 96}
!33 = !{!6, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass