; LLVM IR from RemHero/ReUp-DateBase-Raft :: layer3/ossSocket.ll (ZN10_ossSocket6recvNFEPcRii)

; 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.timeval = type { i64, i64 }
%struct.fd_set = type { [16 x i64] }
%class._ossSocket = type { i32, i32, i32, %struct.sockaddr_in, %struct.sockaddr_in, i8, i32 }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }

@_curPDLevel = external dso_local global i32, align 4
@.str = external hidden unnamed_addr constant [80 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@__func__._ZN10_ossSocket6recvNFEPcRii = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) #0

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

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN10_ossSocket6recvNFEPcRii(ptr noundef nonnull align 4 dereferenceable(52) %0, ptr noundef %1, ptr noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %3) #4 align 2 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %struct.timeval, align 8
  %14 = alloca %struct.fd_set, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  %18 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %19 = getelementptr inbounds %class._ossSocket, ptr %18, i32 0, i32 0
  %20 = load i32, ptr %19, align 4, !tbaa !11
  store i32 %20, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr %14) #5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = load i32, ptr %21, align 4, !tbaa !9
  %23 = icmp eq i32 0, %22
  br i1 %23, label %24, label %25

24:                                               ; preds = %4
  store i32 0, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %206

25:                                               ; preds = %4
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = sdiv i32 %26, 1000000
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds %struct.timeval, ptr %13, i32 0, i32 0
  store i64 %28, ptr %29, align 8, !tbaa !17
  %30 = load i32, ptr %9, align 4, !tbaa !9
  %31 = srem i32 %30, 1000000
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds %struct.timeval, ptr %13, i32 0, i32 1
  store i64 %32, ptr %33, align 8, !tbaa !20
  br label %34

34:                                               ; preds = %118, %86, %25
  br label %35

35:                                               ; preds = %34
  br label %36

36:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  store ptr %14, ptr %17, align 8, !tbaa !5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %47, %36
  %38 = load i32, ptr %16, align 4, !tbaa !9
  %39 = zext i32 %38 to i64
  %40 = icmp ult i64 %39, 16
  br i1 %40, label %41, label %50

41:                                               ; preds = %37
  %42 = load ptr, ptr %17, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.fd_set, ptr %42, i32 0, i32 0
  %44 = load i32, ptr %16, align 4, !tbaa !9
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds [16 x i64], ptr %43, i64 0, i64 %45
  store i64 0, ptr %46, align 8, !tbaa !21
  br label %47

47:                                               ; preds = %41
  %48 = load i32, ptr %16, align 4, !tbaa !9
  %49 = add i32 %48, 1
  store i32 %49, ptr %16, align 4, !tbaa !9
  br label %37, !llvm.loop !22

50:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %51

51:                                               ; preds = %50
  br label %52

52:                                               ; preds = %51
  %53 = getelementptr inbounds %class._ossSocket, ptr %18, i32 0, i32 0
  %54 = load i32, ptr %53, align 4, !tbaa !11
  %55 = srem i32 %54, 64
  %56 = zext i32 %55 to i64
  %57 = shl i64 1, %56
  %58 = getelementptr inbounds %struct.fd_set, ptr %14, i32 0, i32 0
  %59 = getelementptr inbounds %class._ossSocket, ptr %18, i32 0, i32 0
  %60 = load i32, ptr %59, align 4, !tbaa !11
  %61 = sdiv i32 %60, 64
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [16 x i64], ptr %58, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !21
  %65 = or i64 %64, %57
  store i64 %65, ptr %63, align 8, !tbaa !21
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = add nsw i32 %66, 1
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = icmp sge i32 %68, 0
  br i1 %69, label %70, label %71

70:                                               ; preds = %52
  br label %72

71:                                               ; preds = %52
  br label %72

72:                                               ; preds = %71, %70
  %73 = phi ptr [ %13, %70 ], [ null, %71 ]
  %74 = call i32 @select(i32 noundef %67, ptr noundef %14, ptr noundef null, ptr noundef null, ptr noundef %73)
  store i32 %74, ptr %10, align 4, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = icmp eq i32 0, %75
  br i1 %76, label %77, label %78

77:                                               ; preds = %72
  store i32 -3, ptr %10, align 4, !tbaa !9
  br label %203

78:                                               ; preds = %72
  %79 = load i32, ptr %10, align 4, !tbaa !9
  %80 = icmp sgt i32 0, %79
  br i1 %80, label %81, label %102

81:                                               ; preds = %78
  %82 = call ptr @__errno_location() #6
  %83 = load i32, ptr %82, align 4, !tbaa !9
  store i32 %83, ptr %10, align 4, !tbaa !9
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = icmp eq i32 4, %84
  br i1 %85, label %86, label %87

86:                                               ; preds = %81
  br label %34, !llvm.loop !24

87:                                               ; preds = %81
  br label %88

88:                                               ; preds = %87
  br label %89

89:                                               ; preds = %88
  store i32 -6, ptr %10, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr @_curPDLevel, align 4, !tbaa !25
  %92 = icmp sge i32 %91, 1
  br i1 %92, label %93, label %95

93:                                               ; preds = %90
  %94 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef @__func__._ZN10_ossSocket6recvNFEPcRii, ptr noundef @.str, i32 noundef 381, ptr noundef @.str.8, i32 noundef %94)
  br label %95

95:                                               ; preds = %93, %90
  br label %96

96:                                               ; preds = %95
  br label %97

97:                                               ; preds = %96
  br label %205

98:                                               ; No predecessors!
  br label %99

99:                                               ; preds = %98
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101, %78
  %103 = getelementptr inbounds %struct.fd_set, ptr %14, i32 0, i32 0
  %104 = getelementptr inbounds %class._ossSocket, ptr %18, i32 0, i32 0
  %105 = load i32, ptr %104, align 4, !tbaa !11
  %106 = sdiv i32 %105, 64
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [16 x i64], ptr %103, i64 0, i64 %107
  %109 = load i64, ptr %108, align 8, !tbaa !21
  %110 = getelementptr inbounds %class._ossSocket, ptr %18, i32 0, i32 0
  %111 = load i32, ptr %110, align 4, !tbaa !11
  %112 = srem i32 %111, 64
  %113 = zext i32 %112 to i64
  %114 = shl i64 1, %113
  %115 = and i64 %109, %114
  %116 = icmp ne i64 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %102
  br label %119

118:                                              ; preds = %102
  br label %34, !llvm.loop !24

119:                                              ; preds = %117
  %120 = getelementptr inbounds %class._ossSocket, ptr %18, i32 0, i32 0
  %121 = load i32, ptr %120, align 4, !tbaa !11
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load ptr, ptr %8, align 8, !tbaa !5
  %124 = load i32, ptr %123, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = call i64 @recv(i32 noundef %121, ptr noundef %122, i64 noundef %125, i32 noundef 16384)
  %127 = trunc i64 %126 to i32
  store i32 %127, ptr %10, align 4, !tbaa !9
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = icmp sgt i32 %128, 0
  br i1 %129, label %130, label %133

130:                                              ; preds = %119
  %131 = load i32, ptr %10, align 4, !tbaa !9
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 %131, ptr %132, align 4, !tbaa !9
  br label %202

133:                                              ; preds = %119
  %134 = load i32, ptr %10, align 4, !tbaa !9
  %135 = icmp eq i32 %134, 0
  br i1 %135, label %136, label %150

136:                                              ; preds = %133
  br label %137

137:                                              ; preds = %136
  br label %138

138:                                              ; preds = %137
  store i32 -7, ptr %10, align 4, !tbaa !9
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr @_curPDLevel, align 4, !tbaa !25
  %141 = icmp sge i32 %140, 3
  br i1 %141, label %142, label %143

142:                                              ; preds = %139
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 3, ptr noundef @__func__._ZN10_ossSocket6recvNFEPcRii, ptr noundef @.str, i32 noundef 402, ptr noundef @.str.11)
  br label %143

143:                                              ; preds = %142, %139
  br label %144

144:                                              ; preds = %143
  br label %145

145:                                              ; preds = %144
  br label %205

146:                                              ; No predecessors!
  br label %147

147:                                              ; preds = %146
  br label %148

148:                                              ; preds = %147
  br label %149

149:                                              ; preds = %148
  br label %201

150:                                              ; preds = %133
  %151 = call ptr @__errno_location() #6
  %152 = load i32, ptr %151, align 4, !tbaa !9
  store i32 %152, ptr %10, align 4, !tbaa !9
  %153 = load i32, ptr %10, align 4, !tbaa !9
  %154 = icmp eq i32 11, %153
  br i1 %154, label %158, label %155

155:                                              ; preds = %150
  %156 = load i32, ptr %10, align 4, !tbaa !9
  %157 = icmp eq i32 11, %156
  br i1 %157, label %158, label %177

158:                                              ; preds = %155, %150
  %159 = getelementptr inbounds %class._ossSocket, ptr %18, i32 0, i32 6
  %160 = load i32, ptr %159, align 4, !tbaa !27
  %161 = icmp sgt i32 %160, 0
  br i1 %161, label %162, label %177

162:                                              ; preds = %158
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  store i32 -6, ptr %10, align 4, !tbaa !9
  br label %165

165:                                              ; preds = %164
  %166 = load i32, ptr @_curPDLevel, align 4, !tbaa !25
  %167 = icmp sge i32 %166, 1
  br i1 %167, label %168, label %170

168:                                              ; preds = %165
  %169 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef @__func__._ZN10_ossSocket6recvNFEPcRii, ptr noundef @.str, i32 noundef 413, ptr noundef @.str.12, i32 noundef %169)
  br label %170

170:                                              ; preds = %168, %165
  br label %171

171:                                              ; preds = %170
  br label %172

172:                                              ; preds = %171
  br label %205

173:                                              ; No predecessors!
  br label %174

174:                                              ; preds = %173
  br label %175

175:                                              ; preds = %174
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176, %158, %155
  %178 = load i32, ptr %10, align 4, !tbaa !9
  %179 = icmp eq i32 4, %178
  br i1 %179, label %180, label %186

180:                                              ; preds = %177
  %181 = load i32, ptr %11, align 4, !tbaa !9
  %182 = icmp slt i32 %181, 5
  br i1 %182, label %183, label %186

183:                                              ; preds = %180
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = add nsw i32 %184, 1
  store i32 %185, ptr %11, align 4, !tbaa !9
  br label %186

186:                                              ; preds = %183, %180, %177
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  store i32 -6, ptr %10, align 4, !tbaa !9
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr @_curPDLevel, align 4, !tbaa !25
  %191 = icmp sge i32 %190, 1
  br i1 %191, label %192, label %194

192:                                              ; preds = %189
  %193 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef @__func__._ZN10_ossSocket6recvNFEPcRii, ptr noundef @.str, i32 noundef 422, ptr noundef @.str.13, i32 noundef %193)
  br label %194

194:                                              ; preds = %192, %189
  br label %195

195:                                              ; preds = %194
  br label %196

196:                                              ; preds = %195
  br label %205

197:                                              ; No predecessors!
  br label %198

198:                                              ; preds = %197
  br label %199

199:                                              ; preds = %198
  br label %200

200:                                              ; preds = %199
  br label %201

201:                                              ; preds = %200, %149
  br label %202

202:                                              ; preds = %201, %130
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %203

203:                                              ; preds = %205, %202, %77
  %204 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %204, ptr %5, align 4
  store i32 1, ptr %15, align 4
  br label %206

205:                                              ; preds = %196, %172, %145, %97
  br label %203

206:                                              ; preds = %203, %24
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %207 = load i32, ptr %5, align 4
  ret i32 %207
}

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind willreturn memory(none) "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 = { 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(none) }

!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, !10, i64 0}
!12 = !{!"_ZTS10_ossSocket", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 12, !13, i64 28, !16, i64 44, !10, i64 48}
!13 = !{!"_ZTS11sockaddr_in", !14, i64 0, !14, i64 2, !15, i64 4, !7, i64 8}
!14 = !{!"short", !7, i64 0}
!15 = !{!"_ZTS7in_addr", !10, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !19, i64 0}
!18 = !{!"_ZTS7timeval", !19, i64 0, !19, i64 8}
!19 = !{!"long", !7, i64 0}
!20 = !{!18, !19, i64 8}
!21 = !{!19, !19, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}
!25 = !{!26, !26, i64 0}
!26 = !{!"_ZTS7PDLEVEL", !7, i64 0}
!27 = !{!12, !10, i64 48}


; 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.timeval = type { i64, i64 }
%struct.fd_set = type { [16 x i64] }

@_curPDLevel = external dso_local local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [80 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [23 x i8], align 1
@__func__._ZN10_ossSocket6recvNFEPcRii = external hidden unnamed_addr constant [7 x i8], align 1

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

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

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #2

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 -7, 1) i32 @_ZN10_ossSocket6recvNFEPcRii(ptr nocapture noundef nonnull readonly align 4 dereferenceable(52) %0, ptr noundef %1, ptr nocapture noundef nonnull align 4 dereferenceable(4) %2, i32 noundef %3) local_unnamed_addr #4 align 2 {
  %5 = alloca %struct.timeval, align 8
  %6 = alloca %struct.fd_set, align 8
  %7 = load i32, ptr %0, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %6) #6
  %8 = load i32, ptr %2, align 4, !tbaa !14
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %.loopexit, label %10

10:                                               ; preds = %4
  %11 = sdiv i32 %3, 1000000
  %12 = sext i32 %11 to i64
  store i64 %12, ptr %5, align 8, !tbaa !15
  %13 = srem i32 %3, 1000000
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds i8, ptr %5, i64 8
  store i64 %14, ptr %15, align 8, !tbaa !18
  %16 = add nsw i32 %7, 1
  %17 = icmp sgt i32 %3, -1
  %18 = select i1 %17, ptr %5, ptr null
  br label %.backedge

.backedge:                                        ; preds = %.backedge.backedge, %10
  %19 = phi i32 [ %7, %10 ], [ %.be, %.backedge.backedge ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %6, i8 0, i64 128, i1 false), !tbaa !19
  %20 = srem i32 %19, 64
  %21 = zext nneg i32 %20 to i64
  %22 = shl nuw i64 1, %21
  %23 = sdiv i32 %19, 64
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !19
  %27 = or i64 %22, %26
  store i64 %27, ptr %25, align 8, !tbaa !19
  %28 = call i32 @select(i32 noundef %16, ptr noundef nonnull %6, ptr noundef null, ptr noundef null, ptr noundef %18)
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %.loopexit, label %30

30:                                               ; preds = %.backedge
  %31 = icmp slt i32 %28, 0
  br i1 %31, label %32, label %40

32:                                               ; preds = %30
  %33 = tail call ptr @__errno_location() #7
  %34 = load i32, ptr %33, align 4, !tbaa !14
  %35 = icmp eq i32 %34, 4
  br i1 %35, label %..backedge_crit_edge, label %36

..backedge_crit_edge:                             ; preds = %32
  %.pre.pre = load i32, ptr %0, align 4, !tbaa !5
  br label %.backedge.backedge

.backedge.backedge:                               ; preds = %..backedge_crit_edge, %40
  %.be = phi i32 [ %.pre.pre, %..backedge_crit_edge ], [ %41, %40 ]
  br label %.backedge, !llvm.loop !20

36:                                               ; preds = %32
  %37 = load i32, ptr @_curPDLevel, align 4, !tbaa !22
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %39, label %.loopexit

39:                                               ; preds = %36
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef nonnull @__func__._ZN10_ossSocket6recvNFEPcRii, ptr noundef nonnull @.str, i32 noundef 381, ptr noundef nonnull @.str.8, i32 noundef -6)
  br label %.loopexit

40:                                               ; preds = %30
  %41 = load i32, ptr %0, align 4, !tbaa !5
  %42 = sdiv i32 %41, 64
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [16 x i64], ptr %6, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !19
  %46 = srem i32 %41, 64
  %47 = zext nneg i32 %46 to i64
  %48 = shl nuw i64 1, %47
  %49 = and i64 %48, %45
  %.not = icmp eq i64 %49, 0
  br i1 %.not, label %.backedge.backedge, label %50

50:                                               ; preds = %40
  %51 = load i32, ptr %2, align 4, !tbaa !14
  %52 = sext i32 %51 to i64
  %53 = call i64 @recv(i32 noundef %41, ptr noundef %1, i64 noundef %52, i32 noundef 16384)
  %54 = trunc i64 %53 to i32
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %50
  store i32 %54, ptr %2, align 4, !tbaa !14
  br label %.loopexit

57:                                               ; preds = %50
  %58 = icmp eq i32 %54, 0
  br i1 %58, label %59, label %63

59:                                               ; preds = %57
  %60 = load i32, ptr @_curPDLevel, align 4, !tbaa !22
  %61 = icmp sgt i32 %60, 2
  br i1 %61, label %62, label %.loopexit

62:                                               ; preds = %59
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 3, ptr noundef nonnull @__func__._ZN10_ossSocket6recvNFEPcRii, ptr noundef nonnull @.str, i32 noundef 402, ptr noundef nonnull @.str.11)
  br label %.loopexit

63:                                               ; preds = %57
  %64 = tail call ptr @__errno_location() #7
  %65 = load i32, ptr %64, align 4, !tbaa !14
  %66 = icmp eq i32 %65, 11
  %67 = getelementptr inbounds i8, ptr %0, i64 48
  %68 = load i32, ptr %67, align 4
  %69 = icmp sgt i32 %68, 0
  %or.cond = select i1 %66, i1 %69, i1 false
  %70 = load i32, ptr @_curPDLevel, align 4, !tbaa !22
  %71 = icmp sgt i32 %70, 0
  br i1 %or.cond, label %72, label %74

72:                                               ; preds = %63
  br i1 %71, label %73, label %.loopexit

73:                                               ; preds = %72
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef nonnull @__func__._ZN10_ossSocket6recvNFEPcRii, ptr noundef nonnull @.str, i32 noundef 413, ptr noundef nonnull @.str.12, i32 noundef -6)
  br label %.loopexit

74:                                               ; preds = %63
  br i1 %71, label %75, label %.loopexit

75:                                               ; preds = %74
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef nonnull @__func__._ZN10_ossSocket6recvNFEPcRii, ptr noundef nonnull @.str, i32 noundef 422, ptr noundef nonnull @.str.13, i32 noundef -6)
  br label %.loopexit

.loopexit:                                        ; preds = %.backedge, %56, %74, %75, %72, %73, %59, %62, %36, %39, %4
  %.0 = phi i32 [ 0, %4 ], [ -6, %39 ], [ -6, %36 ], [ 0, %56 ], [ -7, %62 ], [ -7, %59 ], [ -6, %73 ], [ -6, %72 ], [ -6, %75 ], [ -6, %74 ], [ -3, %.backedge ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  ret i32 %.0
}

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTS10_ossSocket", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12, !10, i64 28, !13, i64 44, !7, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTS11sockaddr_in", !11, i64 0, !11, i64 2, !12, i64 4, !8, i64 8}
!11 = !{!"short", !8, i64 0}
!12 = !{!"_ZTS7in_addr", !7, i64 0}
!13 = !{!"bool", !8, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"_ZTS7timeval", !17, i64 0, !17, i64 8}
!17 = !{!"long", !8, i64 0}
!18 = !{!16, !17, i64 8}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !23, i64 0}
!23 = !{!"_ZTS7PDLEVEL", !8, i64 0}


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