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

; 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
@__func__._ZN10_ossSocket4recvEPciii = external hidden unnamed_addr constant [5 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

; 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

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

25:                                               ; preds = %5
  store i32 0, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %223

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

35:                                               ; preds = %119, %87, %26
  br label %36

36:                                               ; preds = %35
  br label %37

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

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

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

48:                                               ; preds = %42
  %49 = load i32, ptr %18, align 4, !tbaa !9
  %50 = add i32 %49, 1
  store i32 %50, ptr %18, align 4, !tbaa !9
  br label %38, !llvm.loop !22

51:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %52

52:                                               ; preds = %51
  br label %53

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

71:                                               ; preds = %53
  br label %73

72:                                               ; preds = %53
  br label %73

73:                                               ; preds = %72, %71
  %74 = phi ptr [ %15, %71 ], [ null, %72 ]
  %75 = call i32 @select(i32 noundef %68, ptr noundef %16, ptr noundef null, ptr noundef null, ptr noundef %74)
  store i32 %75, ptr %12, align 4, !tbaa !9
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = icmp eq i32 0, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %73
  store i32 -3, ptr %12, align 4, !tbaa !9
  br label %220

79:                                               ; preds = %73
  %80 = load i32, ptr %12, align 4, !tbaa !9
  %81 = icmp sgt i32 0, %80
  br i1 %81, label %82, label %103

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

87:                                               ; preds = %82
  br label %35, !llvm.loop !24

88:                                               ; preds = %82
  br label %89

89:                                               ; preds = %88
  br label %90

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

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

94:                                               ; preds = %91
  %95 = load i32, ptr %12, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef @__func__._ZN10_ossSocket4recvEPciii, ptr noundef @.str, i32 noundef 293, ptr noundef @.str.8, i32 noundef %95)
  br label %96

96:                                               ; preds = %94, %91
  br label %97

97:                                               ; preds = %96
  br label %98

98:                                               ; preds = %97
  br label %222

99:                                               ; No predecessors!
  br label %100

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  br label %103

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

118:                                              ; preds = %103
  br label %120

119:                                              ; preds = %103
  br label %35, !llvm.loop !24

120:                                              ; preds = %118
  br label %121

121:                                              ; preds = %218, %199, %120
  %122 = load i32, ptr %9, align 4, !tbaa !9
  %123 = icmp sgt i32 %122, 0
  br i1 %123, label %124, label %219

124:                                              ; preds = %121
  %125 = getelementptr inbounds %class._ossSocket, ptr %20, i32 0, i32 0
  %126 = load i32, ptr %125, align 4, !tbaa !11
  %127 = load ptr, ptr %8, align 8, !tbaa !5
  %128 = load i32, ptr %9, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = or i32 16384, %130
  %132 = call i64 @recv(i32 noundef %126, ptr noundef %127, i64 noundef %129, i32 noundef %131)
  %133 = trunc i64 %132 to i32
  store i32 %133, ptr %12, align 4, !tbaa !9
  %134 = load i32, ptr %12, align 4, !tbaa !9
  %135 = icmp sgt i32 %134, 0
  br i1 %135, label %136, label %149

136:                                              ; preds = %124
  %137 = load i32, ptr %11, align 4, !tbaa !9
  %138 = and i32 %137, 2
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %141

140:                                              ; preds = %136
  br label %220

141:                                              ; preds = %136
  %142 = load i32, ptr %12, align 4, !tbaa !9
  %143 = load i32, ptr %9, align 4, !tbaa !9
  %144 = sub nsw i32 %143, %142
  store i32 %144, ptr %9, align 4, !tbaa !9
  %145 = load i32, ptr %12, align 4, !tbaa !9
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = sext i32 %145 to i64
  %148 = getelementptr inbounds i8, ptr %146, i64 %147
  store ptr %148, ptr %8, align 8, !tbaa !5
  br label %218

149:                                              ; preds = %124
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = icmp eq i32 %150, 0
  br i1 %151, label %152, label %166

152:                                              ; preds = %149
  br label %153

153:                                              ; preds = %152
  br label %154

154:                                              ; preds = %153
  store i32 -7, ptr %12, align 4, !tbaa !9
  br label %155

155:                                              ; preds = %154
  %156 = load i32, ptr @_curPDLevel, align 4, !tbaa !25
  %157 = icmp sge i32 %156, 3
  br i1 %157, label %158, label %159

158:                                              ; preds = %155
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 3, ptr noundef @__func__._ZN10_ossSocket4recvEPciii, ptr noundef @.str, i32 noundef 315, ptr noundef @.str.11)
  br label %159

159:                                              ; preds = %158, %155
  br label %160

160:                                              ; preds = %159
  br label %161

161:                                              ; preds = %160
  br label %222

162:                                              ; No predecessors!
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  br label %217

166:                                              ; preds = %149
  %167 = call ptr @__errno_location() #6
  %168 = load i32, ptr %167, align 4, !tbaa !9
  store i32 %168, ptr %12, align 4, !tbaa !9
  %169 = load i32, ptr %12, align 4, !tbaa !9
  %170 = icmp eq i32 11, %169
  br i1 %170, label %174, label %171

171:                                              ; preds = %166
  %172 = load i32, ptr %12, align 4, !tbaa !9
  %173 = icmp eq i32 11, %172
  br i1 %173, label %174, label %193

174:                                              ; preds = %171, %166
  %175 = getelementptr inbounds %class._ossSocket, ptr %20, i32 0, i32 6
  %176 = load i32, ptr %175, align 4, !tbaa !27
  %177 = icmp sgt i32 %176, 0
  br i1 %177, label %178, label %193

178:                                              ; preds = %174
  br label %179

179:                                              ; preds = %178
  br label %180

180:                                              ; preds = %179
  store i32 -6, ptr %12, align 4, !tbaa !9
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr @_curPDLevel, align 4, !tbaa !25
  %183 = icmp sge i32 %182, 1
  br i1 %183, label %184, label %186

184:                                              ; preds = %181
  %185 = load i32, ptr %12, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef @__func__._ZN10_ossSocket4recvEPciii, ptr noundef @.str, i32 noundef 324, ptr noundef @.str.12, i32 noundef %185)
  br label %186

186:                                              ; preds = %184, %181
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  br label %222

189:                                              ; No predecessors!
  br label %190

190:                                              ; preds = %189
  br label %191

191:                                              ; preds = %190
  br label %192

192:                                              ; preds = %191
  br label %193

193:                                              ; preds = %192, %174, %171
  %194 = load i32, ptr %12, align 4, !tbaa !9
  %195 = icmp eq i32 4, %194
  br i1 %195, label %196, label %202

196:                                              ; preds = %193
  %197 = load i32, ptr %13, align 4, !tbaa !9
  %198 = icmp slt i32 %197, 5
  br i1 %198, label %199, label %202

199:                                              ; preds = %196
  %200 = load i32, ptr %13, align 4, !tbaa !9
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %13, align 4, !tbaa !9
  br label %121, !llvm.loop !28

202:                                              ; preds = %196, %193
  br label %203

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203
  store i32 -6, ptr %12, align 4, !tbaa !9
  br label %205

205:                                              ; preds = %204
  %206 = load i32, ptr @_curPDLevel, align 4, !tbaa !25
  %207 = icmp sge i32 %206, 1
  br i1 %207, label %208, label %210

208:                                              ; preds = %205
  %209 = load i32, ptr %12, align 4, !tbaa !9
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef @__func__._ZN10_ossSocket4recvEPciii, ptr noundef @.str, i32 noundef 332, ptr noundef @.str.13, i32 noundef %209)
  br label %210

210:                                              ; preds = %208, %205
  br label %211

211:                                              ; preds = %210
  br label %212

212:                                              ; preds = %211
  br label %222

213:                                              ; No predecessors!
  br label %214

214:                                              ; preds = %213
  br label %215

215:                                              ; preds = %214
  br label %216

216:                                              ; preds = %215
  br label %217

217:                                              ; preds = %216, %165
  br label %218

218:                                              ; preds = %217, %141
  br label %121, !llvm.loop !28

219:                                              ; preds = %121
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %220

220:                                              ; preds = %222, %219, %140, %78
  %221 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %221, ptr %6, align 4
  store i32 1, ptr %17, align 4
  br label %223

222:                                              ; preds = %212, %188, %161, %98
  br label %220

223:                                              ; preds = %220, %25
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  %224 = load i32, ptr %6, align 4
  ret i32 %224
}

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

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}
!28 = distinct !{!28, !23}


; 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
@__func__._ZN10_ossSocket4recvEPciii = external hidden unnamed_addr constant [5 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

; 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

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

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

.backedge:                                        ; preds = %.backedge.backedge, %10
  %19 = phi i32 [ %8, %10 ], [ %.be, %.backedge.backedge ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %7, i8 0, i64 128, i1 false), !tbaa !18
  %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 %7, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !18
  %27 = or i64 %22, %26
  store i64 %27, ptr %25, align 8, !tbaa !18
  %28 = call i32 @select(i32 noundef %16, ptr noundef nonnull %7, 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 !19
  %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_ossSocket4recvEPciii, ptr noundef nonnull @.str, i32 noundef 293, 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 %7, i64 0, i64 %43
  %45 = load i64, ptr %44, align 8, !tbaa !18
  %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 %.preheader

.preheader:                                       ; preds = %40
  %50 = icmp sgt i32 %2, 0
  br i1 %50, label %.lr.ph.lr.ph, label %.loopexit

.lr.ph.lr.ph:                                     ; preds = %.preheader
  %51 = or i32 %4, 16384
  %52 = getelementptr inbounds i8, ptr %0, i64 48
  %53 = and i32 %4, 2
  %.not45 = icmp eq i32 %53, 0
  br i1 %.not45, label %.lr.ph.split.us.us, label %.lr.ph.split.us

.outer.us:                                        ; preds = %74, %.lr.ph.split.us.us
  %.us-phi.us = phi i64 [ %60, %.lr.ph.split.us.us ], [ %77, %74 ]
  %.us-phi63.us = phi i32 [ %61, %.lr.ph.split.us.us ], [ %78, %74 ]
  %.us-phi64.us = phi i32 [ %.038.ph82.us, %.lr.ph.split.us.us ], [ %75, %74 ]
  %54 = sub nsw i32 %.040.ph81.us, %.us-phi63.us
  %55 = and i64 %.us-phi.us, 2147483647
  %56 = getelementptr inbounds i8, ptr %.037.ph83.us, i64 %55
  %57 = icmp sgt i32 %54, 0
  br i1 %57, label %.lr.ph.split.us.us, label %.loopexit, !llvm.loop !24

.lr.ph.split.us.us:                               ; preds = %.lr.ph.lr.ph, %.outer.us
  %.037.ph83.us = phi ptr [ %56, %.outer.us ], [ %1, %.lr.ph.lr.ph ]
  %.038.ph82.us = phi i32 [ %.us-phi64.us, %.outer.us ], [ 0, %.lr.ph.lr.ph ]
  %.040.ph81.us = phi i32 [ %54, %.outer.us ], [ %2, %.lr.ph.lr.ph ]
  %58 = zext nneg i32 %.040.ph81.us to i64
  %59 = load i32, ptr %0, align 4, !tbaa !5
  %60 = call i64 @recv(i32 noundef %59, ptr noundef %.037.ph83.us, i64 noundef %58, i32 noundef %51)
  %61 = trunc i64 %60 to i32
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %.outer.us, label %.lr.ph78.us

.lr.ph78.us:                                      ; preds = %.lr.ph.split.us.us, %74
  %63 = phi i32 [ %78, %74 ], [ %61, %.lr.ph.split.us.us ]
  %.03862.us77.us = phi i32 [ %75, %74 ], [ %.038.ph82.us, %.lr.ph.split.us.us ]
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %.split66.us, label %65

65:                                               ; preds = %.lr.ph78.us
  %66 = tail call ptr @__errno_location() #7
  %67 = load i32, ptr %66, align 4, !tbaa !19
  %68 = icmp eq i32 %67, 11
  %69 = load i32, ptr %52, align 4
  %70 = icmp sgt i32 %69, 0
  %or.cond.us.us = select i1 %68, i1 %70, i1 false
  br i1 %or.cond.us.us, label %.split68.us, label %71

71:                                               ; preds = %65
  %72 = icmp eq i32 %67, 4
  %73 = icmp slt i32 %.03862.us77.us, 5
  %or.cond3.us.us = select i1 %72, i1 %73, i1 false
  br i1 %or.cond3.us.us, label %74, label %.split70.us

74:                                               ; preds = %71
  %75 = add nsw i32 %.03862.us77.us, 1
  %76 = load i32, ptr %0, align 4, !tbaa !5
  %77 = call i64 @recv(i32 noundef %76, ptr noundef %.037.ph83.us, i64 noundef %58, i32 noundef %51)
  %78 = trunc i64 %77 to i32
  %79 = icmp sgt i32 %78, 0
  br i1 %79, label %.outer.us, label %.lr.ph78.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.lr.ph
  %80 = zext nneg i32 %2 to i64
  %81 = call i64 @recv(i32 noundef %41, ptr noundef %1, i64 noundef %80, i32 noundef %51)
  %82 = trunc i64 %81 to i32
  %83 = icmp sgt i32 %82, 0
  br i1 %83, label %.loopexit, label %.lr.ph78

.lr.ph78:                                         ; preds = %.lr.ph.split.us, %95
  %84 = phi i32 [ %99, %95 ], [ %82, %.lr.ph.split.us ]
  %.03862.us77 = phi i32 [ %96, %95 ], [ 0, %.lr.ph.split.us ]
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %.split66.us, label %86

86:                                               ; preds = %.lr.ph78
  %87 = tail call ptr @__errno_location() #7
  %88 = load i32, ptr %87, align 4, !tbaa !19
  %89 = icmp eq i32 %88, 11
  %90 = load i32, ptr %52, align 4
  %91 = icmp sgt i32 %90, 0
  %or.cond.us = select i1 %89, i1 %91, i1 false
  br i1 %or.cond.us, label %.split68.us, label %92

92:                                               ; preds = %86
  %93 = icmp eq i32 %88, 4
  %94 = icmp ult i32 %.03862.us77, 5
  %or.cond3.us = select i1 %93, i1 %94, i1 false
  br i1 %or.cond3.us, label %95, label %.split70.us

95:                                               ; preds = %92
  %96 = add nuw nsw i32 %.03862.us77, 1
  %97 = load i32, ptr %0, align 4, !tbaa !5
  %98 = call i64 @recv(i32 noundef %97, ptr noundef %1, i64 noundef %80, i32 noundef %51)
  %99 = trunc i64 %98 to i32
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %.loopexit, label %.lr.ph78

.split66.us:                                      ; preds = %.lr.ph78, %.lr.ph78.us
  %101 = load i32, ptr @_curPDLevel, align 4, !tbaa !22
  %102 = icmp sgt i32 %101, 2
  br i1 %102, label %103, label %.loopexit

103:                                              ; preds = %.split66.us
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 3, ptr noundef nonnull @__func__._ZN10_ossSocket4recvEPciii, ptr noundef nonnull @.str, i32 noundef 315, ptr noundef nonnull @.str.11)
  br label %.loopexit

.split68.us:                                      ; preds = %86, %65
  %104 = load i32, ptr @_curPDLevel, align 4, !tbaa !22
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %106, label %.loopexit

106:                                              ; preds = %.split68.us
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef nonnull @__func__._ZN10_ossSocket4recvEPciii, ptr noundef nonnull @.str, i32 noundef 324, ptr noundef nonnull @.str.12, i32 noundef -6)
  br label %.loopexit

.split70.us:                                      ; preds = %92, %71
  %107 = load i32, ptr @_curPDLevel, align 4, !tbaa !22
  %108 = icmp sgt i32 %107, 0
  br i1 %108, label %109, label %.loopexit

109:                                              ; preds = %.split70.us
  call void (i32, ptr, ptr, i32, ptr, ...) @_Z5pdLog7PDLEVELPKcS1_jS1_z(i32 noundef 1, ptr noundef nonnull @__func__._ZN10_ossSocket4recvEPciii, ptr noundef nonnull @.str, i32 noundef 332, ptr noundef nonnull @.str.13, i32 noundef -6)
  br label %.loopexit

.loopexit:                                        ; preds = %.backedge, %95, %.outer.us, %.preheader, %.lr.ph.split.us, %.split70.us, %109, %.split68.us, %106, %.split66.us, %103, %36, %39, %5
  %.0 = phi i32 [ 0, %5 ], [ -6, %39 ], [ -6, %36 ], [ -7, %103 ], [ -7, %.split66.us ], [ -6, %106 ], [ -6, %.split68.us ], [ -6, %109 ], [ -6, %.split70.us ], [ 0, %.preheader ], [ %82, %.lr.ph.split.us ], [ 0, %.outer.us ], [ %99, %95 ], [ -3, %.backedge ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  ret i32 %.0
}

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

; 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 = !{!15, !16, i64 0}
!15 = !{!"_ZTS7timeval", !16, i64 0, !16, i64 8}
!16 = !{!"long", !8, i64 0}
!17 = !{!15, !16, i64 8}
!18 = !{!16, !16, i64 0}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!23, !23, i64 0}
!23 = !{!"_ZTS7PDLEVEL", !8, i64 0}
!24 = distinct !{!24, !21}


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