; LLVM IR from Bousk/Net :: NetworkLib/src/UDP/AckHandler.ll (ZN5Bousk7Network3UDP10AckHandler6updateEtmb)

; 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"

%"class.Bousk::Network::UDP::AckHandler" = type <{ i64, i64, %"class.std::vector", i16, i8, [5 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned short, std::allocator<unsigned short>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Bousk7Network3UDP10AckHandler6updateEtmb(ptr noundef nonnull align 8 dereferenceable(43) %0, i16 noundef zeroext %1, i64 noundef %2, i1 noundef zeroext %3) #0 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i16, align 2
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca i8, align 1
  %12 = alloca i16, align 2
  %13 = alloca i8, align 1
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i16, align 2
  %17 = alloca i16, align 2
  %18 = alloca i16, align 2
  %19 = alloca i16, align 2
  %20 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i16 %1, ptr %6, align 2, !tbaa !9
  store i64 %2, ptr %7, align 8, !tbaa !11
  %21 = zext i1 %3 to i8
  store i8 %21, ptr %8, align 1, !tbaa !13
  %22 = load ptr, ptr %5, align 8
  %23 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 4
  store i8 0, ptr %23, align 2, !tbaa !15
  %24 = load i16, ptr %6, align 2, !tbaa !9
  %25 = zext i16 %24 to i32
  %26 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 3
  %27 = load i16, ptr %26, align 8, !tbaa !21
  %28 = zext i16 %27 to i32
  %29 = icmp eq i32 %25, %28
  br i1 %29, label %30, label %42

30:                                               ; preds = %4
  %31 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %32 = load i64, ptr %31, align 8, !tbaa !22
  %33 = load i64, ptr %7, align 8, !tbaa !11
  %34 = and i64 %32, %33
  %35 = load i64, ptr %7, align 8, !tbaa !11
  %36 = xor i64 %34, %35
  %37 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 1
  store i64 %36, ptr %37, align 8, !tbaa !23
  %38 = load i64, ptr %7, align 8, !tbaa !11
  %39 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %40 = load i64, ptr %39, align 8, !tbaa !22
  %41 = or i64 %40, %38
  store i64 %41, ptr %39, align 8, !tbaa !22
  br label %200

42:                                               ; preds = %4
  %43 = load i16, ptr %6, align 2, !tbaa !9
  %44 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 3
  %45 = load i16, ptr %44, align 8, !tbaa !21
  %46 = call noundef zeroext i1 @_ZN5Bousk5Utils15IsSequenceNewerEtt(i16 noundef zeroext %43, i16 noundef zeroext %45)
  br i1 %46, label %47, label %161

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #3
  %48 = load i16, ptr %6, align 2, !tbaa !9
  %49 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 3
  %50 = load i16, ptr %49, align 8, !tbaa !21
  %51 = call noundef zeroext i16 @_ZN5Bousk5Utils12SequenceDiffEtt(i16 noundef zeroext %48, i16 noundef zeroext %50)
  store i16 %51, ptr %9, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #3
  %52 = load i16, ptr %9, align 2, !tbaa !9
  %53 = zext i16 %52 to i32
  %54 = sub nsw i32 %53, 1
  %55 = trunc i32 %54 to i16
  store i16 %55, ptr %10, align 2, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #3
  store i16 64, ptr %12, align 2, !tbaa !9
  %56 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %9, ptr noundef nonnull align 2 dereferenceable(2) %12)
  %57 = load i16, ptr %56, align 2, !tbaa !9
  %58 = trunc i16 %57 to i8
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #3
  store i8 %58, ptr %11, align 1, !tbaa !24
  %59 = load i8, ptr %8, align 1, !tbaa !13, !range !25, !noundef !26
  %60 = trunc i8 %59 to i1
  br i1 %60, label %61, label %96

61:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #3
  store i8 0, ptr %13, align 1, !tbaa !24
  br label %62

62:                                               ; preds = %92, %61
  %63 = load i8, ptr %13, align 1, !tbaa !24
  %64 = zext i8 %63 to i32
  %65 = load i8, ptr %11, align 1, !tbaa !24
  %66 = zext i8 %65 to i32
  %67 = icmp slt i32 %64, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #3
  br label %95

69:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 1, ptr %14) #3
  %70 = load i8, ptr %13, align 1, !tbaa !24
  %71 = zext i8 %70 to i32
  %72 = sub nsw i32 64, %71
  %73 = trunc i32 %72 to i8
  store i8 %73, ptr %14, align 1, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #3
  %74 = load i8, ptr %14, align 1, !tbaa !24
  %75 = zext i8 %74 to i32
  %76 = sub nsw i32 %75, 1
  %77 = trunc i32 %76 to i8
  store i8 %77, ptr %15, align 1, !tbaa !24
  %78 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %79 = load i64, ptr %78, align 8, !tbaa !22
  %80 = load i8, ptr %15, align 1, !tbaa !24
  %81 = call noundef zeroext i1 @_ZN5Bousk5Utils6HasBitEmh(i64 noundef %79, i8 noundef zeroext %80)
  br i1 %81, label %91, label %82

82:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #3
  %83 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 3
  %84 = load i16, ptr %83, align 8, !tbaa !21
  %85 = zext i16 %84 to i32
  %86 = load i8, ptr %14, align 1, !tbaa !24
  %87 = zext i8 %86 to i32
  %88 = sub nsw i32 %85, %87
  %89 = trunc i32 %88 to i16
  store i16 %89, ptr %16, align 2, !tbaa !9
  %90 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 2
  call void @_ZNSt6vectorItSaItEE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(24) %90, ptr noundef nonnull align 2 dereferenceable(2) %16)
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #3
  br label %91

91:                                               ; preds = %82, %69
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %14) #3
  br label %92

92:                                               ; preds = %91
  %93 = load i8, ptr %13, align 1, !tbaa !24
  %94 = add i8 %93, 1
  store i8 %94, ptr %13, align 1, !tbaa !24
  br label %62, !llvm.loop !27

95:                                               ; preds = %68
  br label %96

96:                                               ; preds = %95, %47
  %97 = load i8, ptr %11, align 1, !tbaa !24
  %98 = zext i8 %97 to i32
  %99 = icmp sge i32 %98, 64
  br i1 %99, label %100, label %102

100:                                              ; preds = %96
  %101 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  store i64 0, ptr %101, align 8, !tbaa !22
  br label %109

102:                                              ; preds = %96
  %103 = load i8, ptr %11, align 1, !tbaa !24
  %104 = zext i8 %103 to i32
  %105 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %106 = load i64, ptr %105, align 8, !tbaa !22
  %107 = zext i32 %104 to i64
  %108 = shl i64 %106, %107
  store i64 %108, ptr %105, align 8, !tbaa !22
  br label %109

109:                                              ; preds = %102, %100
  %110 = load i16, ptr %10, align 2, !tbaa !9
  %111 = zext i16 %110 to i32
  %112 = icmp sge i32 %111, 64
  br i1 %112, label %113, label %142

113:                                              ; preds = %109
  %114 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 1
  store i64 0, ptr %114, align 8, !tbaa !23
  %115 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  store i64 0, ptr %115, align 8, !tbaa !22
  %116 = load i8, ptr %8, align 1, !tbaa !13, !range !25, !noundef !26
  %117 = trunc i8 %116 to i1
  br i1 %117, label %118, label %141

118:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 2, ptr %17) #3
  store i16 64, ptr %17, align 2, !tbaa !9
  br label %119

119:                                              ; preds = %137, %118
  %120 = load i16, ptr %17, align 2, !tbaa !9
  %121 = zext i16 %120 to i32
  %122 = load i16, ptr %10, align 2, !tbaa !9
  %123 = zext i16 %122 to i32
  %124 = icmp slt i32 %121, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %119
  call void @llvm.lifetime.end.p0(i64 2, ptr %17) #3
  br label %140

126:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #3
  %127 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 3
  %128 = load i16, ptr %127, align 8, !tbaa !21
  %129 = zext i16 %128 to i32
  %130 = load i16, ptr %17, align 2, !tbaa !9
  %131 = zext i16 %130 to i32
  %132 = sub nsw i32 %131, 64
  %133 = add nsw i32 %129, %132
  %134 = add nsw i32 %133, 1
  %135 = trunc i32 %134 to i16
  store i16 %135, ptr %18, align 2, !tbaa !9
  %136 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 2
  call void @_ZNSt6vectorItSaItEE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(24) %136, ptr noundef nonnull align 2 dereferenceable(2) %18)
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #3
  br label %137

137:                                              ; preds = %126
  %138 = load i16, ptr %17, align 2, !tbaa !9
  %139 = add i16 %138, 1
  store i16 %139, ptr %17, align 2, !tbaa !9
  br label %119, !llvm.loop !29

140:                                              ; preds = %125
  br label %141

141:                                              ; preds = %140, %113
  br label %146

142:                                              ; preds = %109
  %143 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %144 = load i16, ptr %10, align 2, !tbaa !9
  %145 = trunc i16 %144 to i8
  call void @_ZN5Bousk5Utils6SetBitERmh(ptr noundef nonnull align 8 dereferenceable(8) %143, i8 noundef zeroext %145)
  br label %146

146:                                              ; preds = %142, %141
  %147 = load i16, ptr %6, align 2, !tbaa !9
  %148 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 3
  store i16 %147, ptr %148, align 8, !tbaa !21
  %149 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 4
  store i8 1, ptr %149, align 2, !tbaa !15
  %150 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %151 = load i64, ptr %150, align 8, !tbaa !22
  %152 = load i64, ptr %7, align 8, !tbaa !11
  %153 = and i64 %151, %152
  %154 = load i64, ptr %7, align 8, !tbaa !11
  %155 = xor i64 %153, %154
  %156 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 1
  store i64 %155, ptr %156, align 8, !tbaa !23
  %157 = load i64, ptr %7, align 8, !tbaa !11
  %158 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %159 = load i64, ptr %158, align 8, !tbaa !22
  %160 = or i64 %159, %157
  store i64 %160, ptr %158, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #3
  br label %199

161:                                              ; preds = %42
  call void @llvm.lifetime.start.p0(i64 2, ptr %19) #3
  %162 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 3
  %163 = load i16, ptr %162, align 8, !tbaa !21
  %164 = load i16, ptr %6, align 2, !tbaa !9
  %165 = call noundef zeroext i16 @_ZN5Bousk5Utils12SequenceDiffEtt(i16 noundef zeroext %163, i16 noundef zeroext %164)
  store i16 %165, ptr %19, align 2, !tbaa !9
  %166 = load i16, ptr %19, align 2, !tbaa !9
  %167 = zext i16 %166 to i32
  %168 = icmp sle i32 %167, 64
  br i1 %168, label %169, label %197

169:                                              ; preds = %161
  %170 = load i16, ptr %19, align 2, !tbaa !9
  %171 = zext i16 %170 to i32
  %172 = icmp eq i32 %171, 64
  br i1 %172, label %173, label %174

173:                                              ; preds = %169
  store i64 0, ptr %7, align 8, !tbaa !11
  br label %180

174:                                              ; preds = %169
  %175 = load i16, ptr %19, align 2, !tbaa !9
  %176 = zext i16 %175 to i32
  %177 = load i64, ptr %7, align 8, !tbaa !11
  %178 = zext i32 %176 to i64
  %179 = shl i64 %177, %178
  store i64 %179, ptr %7, align 8, !tbaa !11
  br label %180

180:                                              ; preds = %174, %173
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #3
  %181 = load i16, ptr %19, align 2, !tbaa !9
  %182 = zext i16 %181 to i32
  %183 = sub nsw i32 %182, 1
  %184 = trunc i32 %183 to i8
  store i8 %184, ptr %20, align 1, !tbaa !24
  %185 = load i8, ptr %20, align 1, !tbaa !24
  call void @_ZN5Bousk5Utils6SetBitERmh(ptr noundef nonnull align 8 dereferenceable(8) %7, i8 noundef zeroext %185)
  %186 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %187 = load i64, ptr %186, align 8, !tbaa !22
  %188 = load i64, ptr %7, align 8, !tbaa !11
  %189 = and i64 %187, %188
  %190 = load i64, ptr %7, align 8, !tbaa !11
  %191 = xor i64 %189, %190
  %192 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 1
  store i64 %191, ptr %192, align 8, !tbaa !23
  %193 = load i64, ptr %7, align 8, !tbaa !11
  %194 = getelementptr inbounds %"class.Bousk::Network::UDP::AckHandler", ptr %22, i32 0, i32 0
  %195 = load i64, ptr %194, align 8, !tbaa !22
  %196 = or i64 %195, %193
  store i64 %196, ptr %194, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #3
  br label %198

197:                                              ; preds = %161
  br label %198

198:                                              ; preds = %197, %180
  call void @llvm.lifetime.end.p0(i64 2, ptr %19) #3
  br label %199

199:                                              ; preds = %198, %146
  br label %200

200:                                              ; preds = %199, %30
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5Bousk5Utils15IsSequenceNewerEtt(i16 noundef zeroext, i16 noundef zeroext) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN5Bousk5Utils12SequenceDiffEtt(i16 noundef zeroext, i16 noundef zeroext) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2), ptr noundef nonnull align 2 dereferenceable(2)) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5Bousk5Utils6HasBitEmh(i64 noundef, i8 noundef zeroext) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorItSaItEE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 2 dereferenceable(2)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Bousk5Utils6SetBitERmh(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef zeroext) #1

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"short", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !14, i64 42}
!16 = !{!"_ZTSN5Bousk7Network3UDP10AckHandlerE", !12, i64 0, !12, i64 8, !17, i64 16, !10, i64 40, !14, i64 42}
!17 = !{!"_ZTSSt6vectorItSaItEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseItSaItEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseItSaItEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseItSaItEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!16, !10, i64 40}
!22 = !{!16, !12, i64 0}
!23 = !{!16, !12, i64 8}
!24 = !{!7, !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}


; 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"

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5Bousk7Network3UDP10AckHandler6updateEtmb(ptr noundef nonnull align 8 dereferenceable(43) %0, i16 noundef zeroext %1, i64 noundef %2, i1 noundef zeroext %3) local_unnamed_addr #0 align 2 {
  %5 = alloca i64, align 8
  %6 = alloca i16, align 2
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  %9 = alloca i16, align 2
  %10 = getelementptr inbounds i8, ptr %0, i64 42
  store i8 0, ptr %10, align 2, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  %12 = load i16, ptr %11, align 8, !tbaa !17
  %13 = icmp eq i16 %12, %1
  br i1 %13, label %14, label %20

14:                                               ; preds = %4
  %15 = load i64, ptr %0, align 8, !tbaa !18
  %16 = xor i64 %15, -1
  %17 = and i64 %16, %2
  %18 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %17, ptr %18, align 8, !tbaa !19
  %19 = or i64 %15, %2
  store i64 %19, ptr %0, align 8, !tbaa !18
  br label %76

20:                                               ; preds = %4
  %21 = tail call noundef zeroext i1 @_ZN5Bousk5Utils15IsSequenceNewerEtt(i16 noundef zeroext %1, i16 noundef zeroext %12)
  br i1 %21, label %22, label %60

22:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %6) #4
  %23 = load i16, ptr %11, align 8, !tbaa !17
  %24 = tail call noundef zeroext i16 @_ZN5Bousk5Utils12SequenceDiffEtt(i16 noundef zeroext %1, i16 noundef zeroext %23)
  store i16 %24, ptr %6, align 2, !tbaa !20
  %25 = add i16 %24, -1
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %7) #4
  store i16 64, ptr %7, align 2, !tbaa !20
  %26 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %6, ptr noundef nonnull align 2 dereferenceable(2) %7)
  %27 = load i16, ptr %26, align 2, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %7) #4
  %.mask = and i16 %27, 255
  br i1 %3, label %.preheader34, label %.loopexit35

.preheader34:                                     ; preds = %22
  %.not = icmp eq i16 %.mask, 0
  br i1 %.not, label %.loopexit35, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader34
  %28 = getelementptr inbounds i8, ptr %0, i64 16
  br label %29

29:                                               ; preds = %.lr.ph, %39
  %indvars.iv = phi i16 [ 0, %.lr.ph ], [ %indvars.iv.next, %39 ]
  %30 = trunc nuw i16 %indvars.iv to i8
  %31 = sub i8 63, %30
  %32 = load i64, ptr %0, align 8, !tbaa !18
  %33 = call noundef zeroext i1 @_ZN5Bousk5Utils6HasBitEmh(i64 noundef %32, i8 noundef zeroext %31)
  br i1 %33, label %39, label %34

34:                                               ; preds = %29
  %35 = sub nsw i16 64, %indvars.iv
  %36 = and i16 %35, 255
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %8) #4
  %37 = load i16, ptr %11, align 8, !tbaa !17
  %38 = sub i16 %37, %36
  store i16 %38, ptr %8, align 2, !tbaa !20
  call void @_ZNSt6vectorItSaItEE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(24) %28, ptr noundef nonnull align 2 dereferenceable(2) %8)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %8) #4
  br label %39

39:                                               ; preds = %34, %29
  %indvars.iv.next = add nuw nsw i16 %indvars.iv, 1
  %exitcond.not = icmp eq i16 %indvars.iv.next, %.mask
  br i1 %exitcond.not, label %.loopexit35, label %29, !llvm.loop !21

.loopexit35:                                      ; preds = %39, %22, %.preheader34
  %.pre-phi = phi i16 [ 0, %.preheader34 ], [ %.mask, %22 ], [ %.mask, %39 ]
  %40 = icmp ugt i16 %.pre-phi, 63
  %41 = load i64, ptr %0, align 8
  %42 = zext nneg i16 %.pre-phi to i64
  %43 = shl i64 %41, %42
  %storemerge33 = select i1 %40, i64 0, i64 %43
  store i64 %storemerge33, ptr %0, align 8, !tbaa !18
  %44 = icmp ugt i16 %25, 63
  br i1 %44, label %45, label %53

45:                                               ; preds = %.loopexit35
  %46 = icmp ne i16 %25, 64
  %or.cond = and i1 %46, %3
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %0, i8 0, i64 16, i1 false)
  br i1 %or.cond, label %.lr.ph38, label %.loopexit

.lr.ph38:                                         ; preds = %45
  %47 = getelementptr inbounds i8, ptr %0, i64 16
  br label %48

48:                                               ; preds = %.lr.ph38, %48
  %.02737 = phi i16 [ 64, %.lr.ph38 ], [ %52, %48 ]
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %9) #4
  %49 = load i16, ptr %11, align 8, !tbaa !17
  %50 = add i16 %.02737, -63
  %51 = add i16 %50, %49
  store i16 %51, ptr %9, align 2, !tbaa !20
  call void @_ZNSt6vectorItSaItEE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(24) %47, ptr noundef nonnull align 2 dereferenceable(2) %9)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %9) #4
  %52 = add nuw i16 %.02737, 1
  %exitcond40.not = icmp eq i16 %52, %25
  br i1 %exitcond40.not, label %.loopexit, label %48, !llvm.loop !23

53:                                               ; preds = %.loopexit35
  %54 = trunc nuw i16 %25 to i8
  call void @_ZN5Bousk5Utils6SetBitERmh(ptr noundef nonnull align 8 dereferenceable(8) %0, i8 noundef zeroext %54)
  br label %.loopexit

.loopexit:                                        ; preds = %48, %45, %53
  store i16 %1, ptr %11, align 8, !tbaa !17
  store i8 1, ptr %10, align 2, !tbaa !5
  %55 = load i64, ptr %0, align 8, !tbaa !18
  %56 = xor i64 %55, -1
  %57 = and i64 %56, %2
  %58 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %57, ptr %58, align 8, !tbaa !19
  %59 = or i64 %55, %2
  store i64 %59, ptr %0, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %6) #4
  br label %76

60:                                               ; preds = %20
  %61 = load i16, ptr %11, align 8, !tbaa !17
  %62 = tail call noundef zeroext i16 @_ZN5Bousk5Utils12SequenceDiffEtt(i16 noundef zeroext %61, i16 noundef zeroext %1)
  %63 = icmp ult i16 %62, 65
  br i1 %63, label %64, label %76

64:                                               ; preds = %60
  %65 = trunc nuw i16 %62 to i8
  %66 = icmp eq i16 %62, 64
  %67 = zext nneg i16 %62 to i64
  %68 = shl i64 %2, %67
  %storemerge = select i1 %66, i64 0, i64 %68
  store i64 %storemerge, ptr %5, align 8, !tbaa !24
  %69 = add nsw i8 %65, -1
  call void @_ZN5Bousk5Utils6SetBitERmh(ptr noundef nonnull align 8 dereferenceable(8) %5, i8 noundef zeroext %69)
  %70 = load i64, ptr %0, align 8, !tbaa !18
  %71 = load i64, ptr %5, align 8, !tbaa !24
  %72 = xor i64 %70, -1
  %73 = and i64 %71, %72
  %74 = getelementptr inbounds i8, ptr %0, i64 8
  store i64 %73, ptr %74, align 8, !tbaa !19
  %75 = or i64 %71, %70
  store i64 %75, ptr %0, align 8, !tbaa !18
  br label %76

76:                                               ; preds = %64, %60, %.loopexit, %14
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5Bousk5Utils15IsSequenceNewerEtt(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZN5Bousk5Utils12SequenceDiffEtt(i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2), ptr noundef nonnull align 2 dereferenceable(2)) 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) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5Bousk5Utils6HasBitEmh(i64 noundef, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorItSaItEE9push_backERKt(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Bousk5Utils6SetBitERmh(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef zeroext) local_unnamed_addr #1

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

attributes #0 = { mustprogress 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 = { inlinehint mustprogress 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 = { 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, !16, i64 42}
!6 = !{!"_ZTSN5Bousk7Network3UDP10AckHandlerE", !7, i64 0, !7, i64 8, !10, i64 16, !15, i64 40, !16, i64 42}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt6vectorItSaItEE", !11, i64 0}
!11 = !{!"_ZTSSt12_Vector_baseItSaItEE", !12, i64 0}
!12 = !{!"_ZTSNSt12_Vector_baseItSaItEE12_Vector_implE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseItSaItEE17_Vector_impl_dataE", !14, i64 0, !14, i64 8, !14, i64 16}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"short", !8, i64 0}
!16 = !{!"bool", !8, i64 0}
!17 = !{!6, !15, i64 40}
!18 = !{!6, !7, i64 0}
!19 = !{!6, !7, i64 8}
!20 = !{!15, !15, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass