; LLVM IR from mhsitu/welding_robot :: coppeliaSim-client/common (socketInConnection)

; 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.CSocketInConnection = type <{ ptr, i32, i32, %struct.sockaddr_in, %struct.fd_set, i32, i8, [3 x i8], %"class.std::__cxx11::basic_string", i8, i8, i16, [4 x i8] }>
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.fd_set = type { [16 x i64] }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

; 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: mustprogress uwtable
define dso_local noundef i32 @_ZN19CSocketInConnection20_receiveSimplePacketERSt6vectorIcSaIcEE(ptr noundef nonnull align 8 dereferenceable(204) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #1 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca [6 x i8], align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i16, align 2
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8
  br label %18

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %19 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 4
  store ptr %19, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %20

20:                                               ; preds = %30, %18
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = zext i32 %21 to i64
  %23 = icmp ult i64 %22, 16
  br i1 %23, label %24, label %33

24:                                               ; preds = %20
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.fd_set, ptr %25, i32 0, i32 0
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds [16 x i64], ptr %26, i64 0, i64 %28
  store i64 0, ptr %29, align 8, !tbaa !11
  br label %30

30:                                               ; preds = %24
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = add i32 %31, 1
  store i32 %32, ptr %6, align 4, !tbaa !9
  br label %20, !llvm.loop !13

33:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %34

34:                                               ; preds = %33
  %35 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 2
  %36 = load i32, ptr %35, align 4, !tbaa !15
  %37 = srem i32 %36, 64
  %38 = zext i32 %37 to i64
  %39 = shl i64 1, %38
  %40 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 4
  %41 = getelementptr inbounds %struct.fd_set, ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 2
  %43 = load i32, ptr %42, align 4, !tbaa !15
  %44 = sdiv i32 %43, 64
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [16 x i64], ptr %41, i64 0, i64 %45
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = or i64 %47, %39
  store i64 %48, ptr %46, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %49 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 2
  %50 = load i32, ptr %49, align 4, !tbaa !15
  %51 = add nsw i32 %50, 1
  %52 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 4
  %53 = call i32 @select(i32 noundef %51, ptr noundef %52, ptr noundef null, ptr noundef null, ptr noundef null)
  store i32 %53, ptr %8, align 4, !tbaa !9
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = icmp eq i32 %54, 1
  br i1 %55, label %56, label %168

56:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 6, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %57 = call noundef i32 @_ZN19CSocketInConnection12_getTimeInMsEv(ptr noundef nonnull align 8 dereferenceable(204) %17)
  store i32 %57, ptr %11, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %87, %56
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = icmp ne i32 %59, 6
  br i1 %60, label %61, label %88

61:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %62 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 2
  %63 = load i32, ptr %62, align 4, !tbaa !15
  %64 = getelementptr inbounds [6 x i8], ptr %9, i64 0, i64 0
  %65 = load i32, ptr %10, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %64, i64 %66
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = sub nsw i32 6, %68
  %70 = sext i32 %69 to i64
  %71 = call i64 @recv(i32 noundef %63, ptr noundef %67, i64 noundef %70, i32 noundef 0)
  %72 = trunc i64 %71 to i32
  store i32 %72, ptr %12, align 4, !tbaa !9
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = icmp slt i32 %73, 1
  br i1 %74, label %75, label %76

75:                                               ; preds = %61
  store i32 8, ptr %13, align 4
  br label %85

76:                                               ; preds = %61
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = add nsw i32 %78, %77
  store i32 %79, ptr %10, align 4, !tbaa !9
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = call noundef i32 @_ZN19CSocketInConnection16_getTimeDiffInMsEj(ptr noundef nonnull align 8 dereferenceable(204) %17, i32 noundef %80)
  %82 = icmp ugt i32 %81, 3000
  br i1 %82, label %83, label %84

83:                                               ; preds = %76
  store i32 8, ptr %13, align 4
  br label %85

84:                                               ; preds = %76
  store i32 0, ptr %13, align 4
  br label %85

85:                                               ; preds = %84, %83, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %86 = load i32, ptr %13, align 4
  switch i32 %86, label %175 [
    i32 0, label %87
    i32 8, label %88
  ]

87:                                               ; preds = %85
  br label %58, !llvm.loop !24

88:                                               ; preds = %85, %58
  %89 = load i32, ptr %10, align 4, !tbaa !9
  %90 = icmp ne i32 %89, 6
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  store i32 -2, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %167

92:                                               ; preds = %88
  %93 = getelementptr inbounds [6 x i8], ptr %9, i64 0, i64 0
  %94 = load i8, ptr %93, align 1, !tbaa !25
  %95 = sext i8 %94 to i32
  %96 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 9
  %97 = load i8, ptr %96, align 8, !tbaa !26
  %98 = sext i8 %97 to i32
  %99 = icmp ne i32 %95, %98
  br i1 %99, label %108, label %100

100:                                              ; preds = %92
  %101 = getelementptr inbounds [6 x i8], ptr %9, i64 0, i64 1
  %102 = load i8, ptr %101, align 1, !tbaa !25
  %103 = sext i8 %102 to i32
  %104 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 10
  %105 = load i8, ptr %104, align 1, !tbaa !27
  %106 = sext i8 %105 to i32
  %107 = icmp ne i32 %103, %106
  br i1 %107, label %108, label %109

108:                                              ; preds = %100, %92
  store i32 -2, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %167

109:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #4
  %110 = getelementptr inbounds [6 x i8], ptr %9, i64 0, i64 0
  %111 = getelementptr inbounds i8, ptr %110, i64 2
  %112 = getelementptr inbounds i16, ptr %111, i64 0
  %113 = load i16, ptr %112, align 2, !tbaa !28
  store i16 %113, ptr %14, align 2, !tbaa !28
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZNSt6vectorIcSaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %114) #4
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load i16, ptr %14, align 2, !tbaa !28
  %117 = zext i16 %116 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #4
  store i8 0, ptr %15, align 1, !tbaa !25
  call void @_ZNSt6vectorIcSaIcEE6resizeEmRKc(ptr noundef nonnull align 8 dereferenceable(24) %115, i64 noundef %117, ptr noundef nonnull align 1 dereferenceable(1) %15)
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  %118 = call noundef i32 @_ZN19CSocketInConnection12_getTimeInMsEv(ptr noundef nonnull align 8 dereferenceable(204) %17)
  store i32 %118, ptr %11, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %153, %109
  %120 = load i32, ptr %10, align 4, !tbaa !9
  %121 = load i16, ptr %14, align 2, !tbaa !28
  %122 = zext i16 %121 to i32
  %123 = icmp ne i32 %120, %122
  br i1 %123, label %124, label %154

124:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %125 = getelementptr inbounds %class.CSocketInConnection, ptr %17, i32 0, i32 2
  %126 = load i32, ptr %125, align 4, !tbaa !15
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %127, i64 noundef 0) #4
  %129 = load i32, ptr %10, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i8, ptr %128, i64 %130
  %132 = load i16, ptr %14, align 2, !tbaa !28
  %133 = zext i16 %132 to i32
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = sub nsw i32 %133, %134
  %136 = sext i32 %135 to i64
  %137 = call i64 @recv(i32 noundef %126, ptr noundef %131, i64 noundef %136, i32 noundef 0)
  %138 = trunc i64 %137 to i32
  store i32 %138, ptr %16, align 4, !tbaa !9
  %139 = load i32, ptr %16, align 4, !tbaa !9
  %140 = icmp slt i32 %139, 1
  br i1 %140, label %141, label %142

141:                                              ; preds = %124
  store i32 10, ptr %13, align 4
  br label %151

142:                                              ; preds = %124
  %143 = load i32, ptr %16, align 4, !tbaa !9
  %144 = load i32, ptr %10, align 4, !tbaa !9
  %145 = add nsw i32 %144, %143
  store i32 %145, ptr %10, align 4, !tbaa !9
  %146 = load i32, ptr %11, align 4, !tbaa !9
  %147 = call noundef i32 @_ZN19CSocketInConnection16_getTimeDiffInMsEj(ptr noundef nonnull align 8 dereferenceable(204) %17, i32 noundef %146)
  %148 = icmp ugt i32 %147, 3000
  br i1 %148, label %149, label %150

149:                                              ; preds = %142
  store i32 10, ptr %13, align 4
  br label %151

150:                                              ; preds = %142
  store i32 0, ptr %13, align 4
  br label %151

151:                                              ; preds = %150, %149, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  %152 = load i32, ptr %13, align 4
  switch i32 %152, label %175 [
    i32 0, label %153
    i32 10, label %154
  ]

153:                                              ; preds = %151
  br label %119, !llvm.loop !29

154:                                              ; preds = %151, %119
  %155 = load i32, ptr %10, align 4, !tbaa !9
  %156 = load i16, ptr %14, align 2, !tbaa !28
  %157 = zext i16 %156 to i32
  %158 = icmp ne i32 %155, %157
  br i1 %158, label %159, label %160

159:                                              ; preds = %154
  store i32 -2, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %166

160:                                              ; preds = %154
  %161 = getelementptr inbounds [6 x i8], ptr %9, i64 0, i64 0
  %162 = getelementptr inbounds i8, ptr %161, i64 2
  %163 = getelementptr inbounds i16, ptr %162, i64 1
  %164 = load i16, ptr %163, align 2, !tbaa !28
  %165 = zext i16 %164 to i32
  store i32 %165, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %166

166:                                              ; preds = %160, %159
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #4
  br label %167

167:                                              ; preds = %166, %108, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 6, ptr %9) #4
  br label %173

168:                                              ; preds = %34
  %169 = load i32, ptr %8, align 4, !tbaa !9
  %170 = icmp eq i32 %169, 0
  br i1 %170, label %171, label %172

171:                                              ; preds = %168
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %173

172:                                              ; preds = %168
  store i32 -2, ptr %3, align 4
  store i32 1, ptr %13, align 4
  br label %173

173:                                              ; preds = %172, %171, %167
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  %174 = load i32, ptr %3, align 4
  ret i32 %174

175:                                              ; preds = %151, %85
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

declare i32 @select(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN19CSocketInConnection12_getTimeInMsEv(ptr noundef nonnull align 8 dereferenceable(204)) #2 align 2

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN19CSocketInConnection16_getTimeDiffInMsEj(ptr noundef nonnull align 8 dereferenceable(204), i32 noundef) #2 align 2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !10, i64 12}
!16 = !{!"_ZTS19CSocketInConnection", !10, i64 8, !10, i64 12, !17, i64 16, !20, i64 32, !10, i64 160, !21, i64 164, !22, i64 168, !7, i64 200, !7, i64 201, !18, i64 202}
!17 = !{!"_ZTS11sockaddr_in", !18, i64 0, !18, i64 2, !19, i64 4, !7, i64 8}
!18 = !{!"short", !7, i64 0}
!19 = !{!"_ZTS7in_addr", !10, i64 0}
!20 = !{!"_ZTS6fd_set", !7, i64 0}
!21 = !{!"bool", !7, i64 0}
!22 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !23, i64 0, !12, i64 8, !7, i64 16}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!24 = distinct !{!24, !14}
!25 = !{!7, !7, i64 0}
!26 = !{!16, !7, i64 200}
!27 = !{!16, !7, i64 201}
!28 = !{!18, !18, i64 0}
!29 = distinct !{!29, !14}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -2, 65536) i32 @_ZN19CSocketInConnection20_receiveSimplePacketERSt6vectorIcSaIcEE(ptr noundef nonnull align 8 dereferenceable(204) %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #1 align 2 {
  %3 = alloca [6 x i8], align 1
  %4 = alloca i8, align 1
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %5, i8 0, i64 128, i1 false), !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 12
  %7 = load i32, ptr %6, align 4, !tbaa !9
  %8 = srem i32 %7, 64
  %9 = zext nneg i32 %8 to i64
  %10 = shl nuw i64 1, %9
  %11 = sdiv i32 %7, 64
  %12 = sext i32 %11 to i64
  %13 = getelementptr inbounds [16 x i64], ptr %5, i64 0, i64 %12
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %15 = or i64 %10, %14
  store i64 %15, ptr %13, align 8, !tbaa !5
  %16 = add nsw i32 %7, 1
  %17 = tail call i32 @select(i32 noundef %16, ptr noundef nonnull %5, ptr noundef null, ptr noundef null, ptr noundef null)
  switch i32 %17, label %67 [
    i32 1, label %18
    i32 0, label %68
  ]

18:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %3) #5
  %19 = tail call noundef i32 @_ZN19CSocketInConnection12_getTimeInMsEv(ptr noundef nonnull align 8 dereferenceable(204) %0)
  br label %20

20:                                               ; preds = %30, %18
  %.035 = phi i32 [ 0, %18 ], [ %31, %30 ]
  %.not = icmp eq i32 %.035, 6
  br i1 %.not, label %.thread54, label %21

21:                                               ; preds = %20
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = zext nneg i32 %.035 to i64
  %24 = getelementptr inbounds i8, ptr %3, i64 %23
  %25 = sub nsw i32 6, %.035
  %26 = sext i32 %25 to i64
  %27 = call i64 @recv(i32 noundef %22, ptr noundef nonnull %24, i64 noundef %26, i32 noundef 0)
  %28 = trunc i64 %27 to i32
  %29 = icmp slt i32 %28, 1
  br i1 %29, label %.thread57, label %30

30:                                               ; preds = %21
  %31 = add nuw nsw i32 %.035, %28
  %32 = call noundef i32 @_ZN19CSocketInConnection16_getTimeDiffInMsEj(ptr noundef nonnull align 8 dereferenceable(204) %0, i32 noundef %19)
  %33 = icmp ugt i32 %32, 3000
  br i1 %33, label %34, label %20

34:                                               ; preds = %30
  %.not43 = icmp eq i32 %31, 6
  br i1 %.not43, label %.thread54, label %.thread57

.thread54:                                        ; preds = %20, %34
  %35 = load i8, ptr %3, align 1, !tbaa !20
  %36 = getelementptr inbounds i8, ptr %0, i64 200
  %37 = load i8, ptr %36, align 8, !tbaa !21
  %.not44 = icmp eq i8 %35, %37
  br i1 %.not44, label %38, label %.thread57

38:                                               ; preds = %.thread54
  %39 = getelementptr inbounds i8, ptr %3, i64 1
  %40 = load i8, ptr %39, align 1, !tbaa !20
  %41 = getelementptr inbounds i8, ptr %0, i64 201
  %42 = load i8, ptr %41, align 1, !tbaa !22
  %.not45 = icmp eq i8 %40, %42
  br i1 %.not45, label %43, label %.thread57

43:                                               ; preds = %38
  %44 = getelementptr inbounds i8, ptr %3, i64 2
  %45 = load i16, ptr %44, align 2, !tbaa !23
  call void @_ZNSt6vectorIcSaIcEE5clearEv(ptr noundef nonnull align 8 dereferenceable(24) %1) #5
  %46 = zext i16 %45 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #5
  store i8 0, ptr %4, align 1, !tbaa !20
  call void @_ZNSt6vectorIcSaIcEE6resizeEmRKc(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %46, ptr noundef nonnull align 1 dereferenceable(1) %4)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #5
  %47 = call noundef i32 @_ZN19CSocketInConnection12_getTimeInMsEv(ptr noundef nonnull align 8 dereferenceable(204) %0)
  %48 = zext i16 %45 to i32
  br label %49

49:                                               ; preds = %60, %43
  %.3 = phi i32 [ 0, %43 ], [ %61, %60 ]
  %.not46 = icmp eq i32 %.3, %48
  br i1 %.not46, label %.thread62.thread, label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef 0) #5
  %53 = zext nneg i32 %.3 to i64
  %54 = getelementptr inbounds i8, ptr %52, i64 %53
  %55 = sub nsw i32 %48, %.3
  %56 = sext i32 %55 to i64
  %57 = call i64 @recv(i32 noundef %51, ptr noundef nonnull %54, i64 noundef %56, i32 noundef 0)
  %58 = trunc i64 %57 to i32
  %59 = icmp slt i32 %58, 1
  br i1 %59, label %.thread62, label %60

60:                                               ; preds = %50
  %61 = add nuw nsw i32 %.3, %58
  %62 = call noundef i32 @_ZN19CSocketInConnection16_getTimeDiffInMsEj(ptr noundef nonnull align 8 dereferenceable(204) %0, i32 noundef %47)
  %63 = icmp ugt i32 %62, 3000
  br i1 %63, label %.thread62, label %49

.thread62:                                        ; preds = %60, %50
  %.5 = phi i32 [ %.3, %50 ], [ %61, %60 ]
  %.not47 = icmp eq i32 %.5, %48
  br i1 %.not47, label %.thread62.thread, label %.thread57

.thread62.thread:                                 ; preds = %49, %.thread62
  %64 = getelementptr inbounds i8, ptr %3, i64 4
  %65 = load i16, ptr %64, align 2, !tbaa !23
  %66 = zext i16 %65 to i32
  br label %.thread57

.thread57:                                        ; preds = %21, %.thread62.thread, %.thread62, %.thread54, %38, %34
  %.1 = phi i32 [ -2, %34 ], [ -2, %38 ], [ -2, %.thread54 ], [ %66, %.thread62.thread ], [ -2, %.thread62 ], [ -2, %21 ]
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %3) #5
  br label %68

67:                                               ; preds = %2
  br label %68

68:                                               ; preds = %2, %67, %.thread57
  %.2 = phi i32 [ %.1, %.thread57 ], [ -2, %67 ], [ -1, %2 ]
  ret i32 %.2
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIcSaIcEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

declare i32 @select(i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN19CSocketInConnection12_getTimeInMsEv(ptr noundef nonnull align 8 dereferenceable(204)) local_unnamed_addr #2 align 2

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN19CSocketInConnection16_getTimeDiffInMsEj(ptr noundef nonnull align 8 dereferenceable(204), i32 noundef) local_unnamed_addr #2 align 2

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 12}
!10 = !{!"_ZTS19CSocketInConnection", !11, i64 8, !11, i64 12, !12, i64 16, !15, i64 32, !11, i64 160, !16, i64 164, !17, i64 168, !7, i64 200, !7, i64 201, !13, i64 202}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTS11sockaddr_in", !13, i64 0, !13, i64 2, !14, i64 4, !7, i64 8}
!13 = !{!"short", !7, i64 0}
!14 = !{!"_ZTS7in_addr", !11, i64 0}
!15 = !{!"_ZTS6fd_set", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !18, i64 0, !6, i64 8, !7, i64 16}
!18 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !19, i64 0}
!19 = !{!"any pointer", !7, i64 0}
!20 = !{!7, !7, i64 0}
!21 = !{!10, !7, i64 200}
!22 = !{!10, !7, i64 201}
!23 = !{!13, !13, i64 0}


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