; LLVM IR from uNetworking/uSockets :: examples (hammer_test)

; 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.us_socket_context_options_t = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }

@long_length = external dso_local global i32, align 4
@websocket_context = external dso_local global ptr, align 8
@http_context = external dso_local global ptr, align 8
@long_buffer = external dso_local global ptr, align 8
@closed_clients = external dso_local global i32, align 4
@closed_servers = external dso_local global i32, align 4
@opened_clients = external dso_local global i32, align 4
@listen_socket = external dso_local global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [10 x i8], align 1
@opened_servers = external dso_local global i32, align 4
@stderr = external global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @print_progress(double noundef) #0

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

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

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

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

declare void @us_socket_timeout(i32 noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @on_wakeup(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @on_pre(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @on_post(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_writable(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_writable(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_close(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_close(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_end(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_end(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_data(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_data(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_open(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @next_connection() #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_connect_error(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_connect_error(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_open(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_timeout(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_timeout(ptr noundef) #0

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca %struct.us_socket_context_options_t, align 8
  %4 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %5 = load ptr, ptr @stderr, align 8, !tbaa !5
  %6 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef @.str.14) #6
  %7 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %8 = call i64 @time(ptr noundef null) #6
  %9 = trunc i64 %8 to i32
  call void @srand(i32 noundef %9) #6
  %10 = load i32, ptr @long_length, align 4, !tbaa !9
  %11 = zext i32 %10 to i64
  %12 = call noalias ptr @calloc(i64 noundef %11, i64 noundef 1) #7
  store ptr %12, ptr @long_buffer, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %13 = call ptr @us_create_loop(ptr noundef null, ptr noundef @on_wakeup, ptr noundef @on_pre, ptr noundef @on_post, i32 noundef 0)
  store ptr %13, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %3) #6
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 56, i1 false)
  %14 = getelementptr inbounds %struct.us_socket_context_options_t, ptr %3, i32 0, i32 0
  store ptr @.str.16, ptr %14, align 8, !tbaa !11
  %15 = getelementptr inbounds %struct.us_socket_context_options_t, ptr %3, i32 0, i32 1
  store ptr @.str.17, ptr %15, align 8, !tbaa !13
  %16 = getelementptr inbounds %struct.us_socket_context_options_t, ptr %3, i32 0, i32 2
  store ptr @.str.18, ptr %16, align 8, !tbaa !14
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = call ptr @us_create_socket_context(i32 noundef 1, ptr noundef %17, i32 noundef 1, ptr noundef byval(%struct.us_socket_context_options_t) align 8 %3)
  store ptr %18, ptr @http_context, align 8, !tbaa !5
  %19 = load ptr, ptr @http_context, align 8, !tbaa !5
  call void @us_socket_context_on_open(i32 noundef 1, ptr noundef %19, ptr noundef @on_http_socket_open)
  %20 = load ptr, ptr @http_context, align 8, !tbaa !5
  call void @us_socket_context_on_data(i32 noundef 1, ptr noundef %20, ptr noundef @on_http_socket_data)
  %21 = load ptr, ptr @http_context, align 8, !tbaa !5
  call void @us_socket_context_on_writable(i32 noundef 1, ptr noundef %21, ptr noundef @on_http_socket_writable)
  %22 = load ptr, ptr @http_context, align 8, !tbaa !5
  call void @us_socket_context_on_close(i32 noundef 1, ptr noundef %22, ptr noundef @on_http_socket_close)
  %23 = load ptr, ptr @http_context, align 8, !tbaa !5
  call void @us_socket_context_on_timeout(i32 noundef 1, ptr noundef %23, ptr noundef @on_http_socket_timeout)
  %24 = load ptr, ptr @http_context, align 8, !tbaa !5
  call void @us_socket_context_on_end(i32 noundef 1, ptr noundef %24, ptr noundef @on_http_socket_end)
  %25 = load ptr, ptr @http_context, align 8, !tbaa !5
  call void @us_socket_context_on_connect_error(i32 noundef 1, ptr noundef %25, ptr noundef @on_http_socket_connect_error)
  %26 = load ptr, ptr @http_context, align 8, !tbaa !5
  %27 = call ptr @us_create_child_socket_context(i32 noundef 1, ptr noundef %26, i32 noundef 1)
  store ptr %27, ptr @websocket_context, align 8, !tbaa !5
  %28 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  call void @us_socket_context_on_open(i32 noundef 1, ptr noundef %28, ptr noundef @on_web_socket_open)
  %29 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  call void @us_socket_context_on_data(i32 noundef 1, ptr noundef %29, ptr noundef @on_web_socket_data)
  %30 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  call void @us_socket_context_on_writable(i32 noundef 1, ptr noundef %30, ptr noundef @on_web_socket_writable)
  %31 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  call void @us_socket_context_on_close(i32 noundef 1, ptr noundef %31, ptr noundef @on_web_socket_close)
  %32 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  call void @us_socket_context_on_timeout(i32 noundef 1, ptr noundef %32, ptr noundef @on_web_socket_timeout)
  %33 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  call void @us_socket_context_on_end(i32 noundef 1, ptr noundef %33, ptr noundef @on_web_socket_end)
  %34 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  call void @us_socket_context_on_connect_error(i32 noundef 1, ptr noundef %34, ptr noundef @on_web_socket_connect_error)
  %35 = load ptr, ptr @http_context, align 8, !tbaa !5
  %36 = call ptr @us_socket_context_listen(i32 noundef 1, ptr noundef %35, ptr noundef @.str.9, i32 noundef 3000, i32 noundef 0, i32 noundef 160)
  store ptr %36, ptr @listen_socket, align 8, !tbaa !5
  %37 = load ptr, ptr @listen_socket, align 8, !tbaa !5
  call void @us_socket_timeout(i32 noundef 1, ptr noundef %37, i32 noundef 16)
  %38 = load ptr, ptr @listen_socket, align 8, !tbaa !5
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %44

40:                                               ; preds = %0
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  call void @print_progress(double noundef 0.000000e+00)
  %42 = call ptr @next_connection()
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  call void @us_loop_run(ptr noundef %43)
  br label %46

44:                                               ; preds = %0
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  br label %46

46:                                               ; preds = %44, %40
  %47 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  call void @us_socket_context_free(i32 noundef 1, ptr noundef %47)
  %48 = load ptr, ptr @http_context, align 8, !tbaa !5
  call void @us_socket_context_free(i32 noundef 1, ptr noundef %48)
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  call void @us_loop_free(ptr noundef %49)
  %50 = load ptr, ptr @long_buffer, align 8, !tbaa !5
  call void @free(ptr noundef %50) #6
  call void @print_progress(double noundef 1.000000e+00)
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  %52 = load i32, ptr @opened_clients, align 4, !tbaa !9
  %53 = icmp eq i32 %52, 5000
  br i1 %53, label %54, label %65

54:                                               ; preds = %46
  %55 = load i32, ptr @closed_clients, align 4, !tbaa !9
  %56 = icmp eq i32 %55, 5000
  br i1 %56, label %57, label %65

57:                                               ; preds = %54
  %58 = load i32, ptr @opened_servers, align 4, !tbaa !9
  %59 = icmp eq i32 %58, 5000
  br i1 %59, label %60, label %65

60:                                               ; preds = %57
  %61 = load i32, ptr @closed_servers, align 4, !tbaa !9
  %62 = icmp eq i32 %61, 5000
  br i1 %62, label %63, label %65

63:                                               ; preds = %60
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %67

65:                                               ; preds = %60, %57, %54, %46
  %66 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %67

67:                                               ; preds = %65, %63
  call void @llvm.lifetime.end.p0(i64 56, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %68 = load i32, ptr %1, align 4
  ret i32 %68
}

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind
declare void @srand(i32 noundef) #4

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #5

declare ptr @us_create_loop(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) #2

declare ptr @us_create_socket_context(i32 noundef, ptr noundef, i32 noundef, ptr noundef byval(%struct.us_socket_context_options_t) align 8) #2

declare void @us_socket_context_on_open(i32 noundef, ptr noundef, ptr noundef) #2

declare void @us_socket_context_on_data(i32 noundef, ptr noundef, ptr noundef) #2

declare void @us_socket_context_on_writable(i32 noundef, ptr noundef, ptr noundef) #2

declare void @us_socket_context_on_close(i32 noundef, ptr noundef, ptr noundef) #2

declare void @us_socket_context_on_timeout(i32 noundef, ptr noundef, ptr noundef) #2

declare void @us_socket_context_on_end(i32 noundef, ptr noundef, ptr noundef) #2

declare void @us_socket_context_on_connect_error(i32 noundef, ptr noundef, ptr noundef) #2

declare ptr @us_create_child_socket_context(i32 noundef, ptr noundef, i32 noundef) #2

declare ptr @us_socket_context_listen(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

declare void @us_loop_run(ptr noundef) #2

declare void @us_socket_context_free(i32 noundef, ptr noundef) #2

declare void @us_loop_free(ptr noundef) #2

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

attributes #0 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind allocsize(0,1) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0,1) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"us_socket_context_options_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 16}


; 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.us_socket_context_options_t = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }

@long_length = external dso_local local_unnamed_addr global i32, align 4
@websocket_context = external dso_local local_unnamed_addr global ptr, align 8
@http_context = external dso_local local_unnamed_addr global ptr, align 8
@long_buffer = external dso_local local_unnamed_addr global ptr, align 8
@closed_clients = external dso_local local_unnamed_addr global i32, align 4
@closed_servers = external dso_local local_unnamed_addr global i32, align 4
@opened_clients = external dso_local local_unnamed_addr global i32, align 4
@listen_socket = external dso_local local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [10 x i8], align 1
@opened_servers = external dso_local local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.14 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @print_progress(double 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

declare void @us_socket_timeout(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @on_wakeup(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @on_pre(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @on_post(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_writable(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_writable(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_close(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_close(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_end(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_end(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_data(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_data(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_open(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @next_connection() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_connect_error(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_connect_error(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_open(ptr noundef, i32 noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_web_socket_timeout(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @on_http_socket_timeout(ptr noundef) #0

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.us_socket_context_options_t, align 8
  %2 = load ptr, ptr @stderr, align 8, !tbaa !5
  %3 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.14) #8
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %5 = tail call i64 @time(ptr noundef null) #9
  %6 = trunc i64 %5 to i32
  tail call void @srand(i32 noundef %6) #9
  %7 = load i32, ptr @long_length, align 4, !tbaa !9
  %8 = zext i32 %7 to i64
  %9 = tail call noalias ptr @calloc(i64 noundef %8, i64 noundef 1) #10
  store ptr %9, ptr @long_buffer, align 8, !tbaa !5
  %10 = tail call ptr @us_create_loop(ptr noundef null, ptr noundef nonnull @on_wakeup, ptr noundef nonnull @on_pre, ptr noundef nonnull @on_post, i32 noundef 0) #9
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %1) #9
  %11 = getelementptr inbounds i8, ptr %1, i64 24
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %11, i8 0, i64 32, i1 false)
  store ptr @.str.16, ptr %1, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  store ptr @.str.17, ptr %12, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr @.str.18, ptr %13, align 8, !tbaa !14
  %14 = tail call ptr @us_create_socket_context(i32 noundef 1, ptr noundef %10, i32 noundef 1, ptr noundef nonnull byval(%struct.us_socket_context_options_t) align 8 %1) #9
  store ptr %14, ptr @http_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_open(i32 noundef 1, ptr noundef %14, ptr noundef nonnull @on_http_socket_open) #9
  %15 = load ptr, ptr @http_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_data(i32 noundef 1, ptr noundef %15, ptr noundef nonnull @on_http_socket_data) #9
  %16 = load ptr, ptr @http_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_writable(i32 noundef 1, ptr noundef %16, ptr noundef nonnull @on_http_socket_writable) #9
  %17 = load ptr, ptr @http_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_close(i32 noundef 1, ptr noundef %17, ptr noundef nonnull @on_http_socket_close) #9
  %18 = load ptr, ptr @http_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_timeout(i32 noundef 1, ptr noundef %18, ptr noundef nonnull @on_http_socket_timeout) #9
  %19 = load ptr, ptr @http_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_end(i32 noundef 1, ptr noundef %19, ptr noundef nonnull @on_http_socket_end) #9
  %20 = load ptr, ptr @http_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_connect_error(i32 noundef 1, ptr noundef %20, ptr noundef nonnull @on_http_socket_connect_error) #9
  %21 = load ptr, ptr @http_context, align 8, !tbaa !5
  %22 = tail call ptr @us_create_child_socket_context(i32 noundef 1, ptr noundef %21, i32 noundef 1) #9
  store ptr %22, ptr @websocket_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_open(i32 noundef 1, ptr noundef %22, ptr noundef nonnull @on_web_socket_open) #9
  %23 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_data(i32 noundef 1, ptr noundef %23, ptr noundef nonnull @on_web_socket_data) #9
  %24 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_writable(i32 noundef 1, ptr noundef %24, ptr noundef nonnull @on_web_socket_writable) #9
  %25 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_close(i32 noundef 1, ptr noundef %25, ptr noundef nonnull @on_web_socket_close) #9
  %26 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_timeout(i32 noundef 1, ptr noundef %26, ptr noundef nonnull @on_web_socket_timeout) #9
  %27 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_end(i32 noundef 1, ptr noundef %27, ptr noundef nonnull @on_web_socket_end) #9
  %28 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  tail call void @us_socket_context_on_connect_error(i32 noundef 1, ptr noundef %28, ptr noundef nonnull @on_web_socket_connect_error) #9
  %29 = load ptr, ptr @http_context, align 8, !tbaa !5
  %30 = tail call ptr @us_socket_context_listen(i32 noundef 1, ptr noundef %29, ptr noundef nonnull @.str.9, i32 noundef 3000, i32 noundef 0, i32 noundef 160) #9
  store ptr %30, ptr @listen_socket, align 8, !tbaa !5
  tail call void @us_socket_timeout(i32 noundef 1, ptr noundef %30, i32 noundef 16) #9
  %31 = load ptr, ptr @listen_socket, align 8, !tbaa !5
  %.not = icmp eq ptr %31, null
  br i1 %.not, label %35, label %32

32:                                               ; preds = %0
  %33 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  tail call void @print_progress(double noundef 0.000000e+00)
  %34 = tail call ptr @next_connection()
  tail call void @us_loop_run(ptr noundef %10) #9
  br label %37

35:                                               ; preds = %0
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  br label %37

37:                                               ; preds = %35, %32
  %38 = load ptr, ptr @websocket_context, align 8, !tbaa !5
  tail call void @us_socket_context_free(i32 noundef 1, ptr noundef %38) #9
  %39 = load ptr, ptr @http_context, align 8, !tbaa !5
  tail call void @us_socket_context_free(i32 noundef 1, ptr noundef %39) #9
  tail call void @us_loop_free(ptr noundef %10) #9
  %40 = load ptr, ptr @long_buffer, align 8, !tbaa !5
  tail call void @free(ptr noundef %40) #9
  tail call void @print_progress(double noundef 1.000000e+00)
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  %42 = load i32, ptr @opened_clients, align 4, !tbaa !9
  %43 = icmp ne i32 %42, 5000
  %44 = load i32, ptr @closed_clients, align 4
  %45 = icmp ne i32 %44, 5000
  %or.cond.not13 = select i1 %43, i1 true, i1 %45
  %46 = load i32, ptr @opened_servers, align 4
  %47 = icmp ne i32 %46, 5000
  %or.cond3.not10 = select i1 %or.cond.not13, i1 true, i1 %47
  %48 = load i32, ptr @closed_servers, align 4
  %49 = icmp ne i32 %48, 5000
  %or.cond5.not = select i1 %or.cond3.not10, i1 true, i1 %49
  %.str.22..str.23 = select i1 %or.cond5.not, ptr @.str.23, ptr @.str.22
  %. = zext i1 %or.cond5.not to i32
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.22..str.23)
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %1) #9
  ret i32 %.
}

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #6

declare ptr @us_create_loop(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @us_create_socket_context(i32 noundef, ptr noundef, i32 noundef, ptr noundef byval(%struct.us_socket_context_options_t) align 8) local_unnamed_addr #4

declare void @us_socket_context_on_open(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @us_socket_context_on_data(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @us_socket_context_on_writable(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @us_socket_context_on_close(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @us_socket_context_on_timeout(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @us_socket_context_on_end(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @us_socket_context_on_connect_error(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare ptr @us_create_child_socket_context(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @us_socket_context_listen(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #4

declare void @us_loop_run(ptr noundef) local_unnamed_addr #4

declare void @us_socket_context_free(i32 noundef, ptr noundef) local_unnamed_addr #4

declare void @us_loop_free(ptr noundef) local_unnamed_addr #4

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

attributes #0 = { 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { cold nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0,1) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"us_socket_context_options_t", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48}
!13 = !{!12, !6, i64 8}
!14 = !{!12, !6, i64 16}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass