; LLVM IR from Softmotions/iowow :: src/utils (iwstw)

; 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.iwstw = type { ptr, ptr, ptr, ptr, %union.pthread_mutex_t, %union.pthread_cond_t, %union.pthread_cond_t, i64, i32, i32, i8, i8, i8 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare i64 @iwrc_set_errno(i64 noundef, i32 noundef) #3

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: nounwind uwtable
define dso_local i64 @iwstw_start(ptr noundef %0, i32 noundef %1, i1 noundef zeroext %2, ptr noundef %3) #6 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca %struct.iwstw, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  %15 = zext i1 %2 to i8
  store i8 %15, ptr %8, align 1, !tbaa !11
  store ptr %3, ptr %9, align 8, !tbaa !5
  %16 = load i32, ptr %7, align 4, !tbaa !9
  %17 = icmp slt i32 %16, 0
  br i1 %17, label %21, label %18

18:                                               ; preds = %4
  %19 = load ptr, ptr %9, align 8, !tbaa !5
  %20 = icmp ne ptr %19, null
  br i1 %20, label %22, label %21

21:                                               ; preds = %18, %4
  store i64 70017, ptr %5, align 8
  br label %121

22:                                               ; preds = %18
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %30

25:                                               ; preds = %22
  %26 = load ptr, ptr %6, align 8, !tbaa !5
  %27 = call i64 @strlen(ptr noundef %26) #9
  %28 = icmp ugt i64 %27, 15
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  store i64 70017, ptr %5, align 8
  br label %121

30:                                               ; preds = %25, %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  %31 = call noalias ptr @malloc(i64 noundef 192) #11
  store ptr %31, ptr %10, align 8, !tbaa !5
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %39, label %34

34:                                               ; preds = %30
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr null, ptr %35, align 8, !tbaa !5
  %36 = call ptr @__errno_location() #12
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %38 = call i64 @iwrc_set_errno(i64 noundef 70013, i32 noundef %37)
  store i64 %38, ptr %5, align 8
  store i32 1, ptr %11, align 4
  br label %120

39:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  store i64 0, ptr %13, align 8, !tbaa !13
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 192, i1 false)
  %41 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 0
  %42 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 1
  %43 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 2
  %44 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 3
  %45 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 4
  %46 = getelementptr inbounds %struct.__pthread_mutex_s, ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds %struct.__pthread_mutex_s, ptr %45, i32 0, i32 1
  %48 = getelementptr inbounds %struct.__pthread_mutex_s, ptr %45, i32 0, i32 2
  %49 = getelementptr inbounds %struct.__pthread_mutex_s, ptr %45, i32 0, i32 3
  %50 = getelementptr inbounds %struct.__pthread_mutex_s, ptr %45, i32 0, i32 4
  store i32 0, ptr %50, align 8, !tbaa !15
  %51 = getelementptr inbounds %struct.__pthread_mutex_s, ptr %45, i32 0, i32 5
  %52 = getelementptr inbounds %struct.__pthread_mutex_s, ptr %45, i32 0, i32 6
  %53 = getelementptr inbounds %struct.__pthread_mutex_s, ptr %45, i32 0, i32 7
  %54 = getelementptr inbounds %struct.__pthread_internal_list, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %struct.__pthread_internal_list, ptr %53, i32 0, i32 1
  %56 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 5
  %57 = getelementptr inbounds %struct.__pthread_cond_s, ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %struct.__pthread_cond_s, ptr %56, i32 0, i32 1
  %59 = getelementptr inbounds %struct.__pthread_cond_s, ptr %56, i32 0, i32 2
  %60 = getelementptr inbounds i32, ptr %59, i64 1
  %61 = getelementptr inbounds %struct.__pthread_cond_s, ptr %56, i32 0, i32 3
  %62 = getelementptr inbounds i32, ptr %61, i64 1
  %63 = getelementptr inbounds %struct.__pthread_cond_s, ptr %56, i32 0, i32 4
  %64 = getelementptr inbounds %struct.__pthread_cond_s, ptr %56, i32 0, i32 5
  %65 = getelementptr inbounds %struct.__pthread_cond_s, ptr %56, i32 0, i32 6
  %66 = getelementptr inbounds i32, ptr %65, i64 1
  %67 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 6
  %68 = getelementptr inbounds %struct.__pthread_cond_s, ptr %67, i32 0, i32 0
  %69 = getelementptr inbounds %struct.__pthread_cond_s, ptr %67, i32 0, i32 1
  %70 = getelementptr inbounds %struct.__pthread_cond_s, ptr %67, i32 0, i32 2
  %71 = getelementptr inbounds i32, ptr %70, i64 1
  %72 = getelementptr inbounds %struct.__pthread_cond_s, ptr %67, i32 0, i32 3
  %73 = getelementptr inbounds i32, ptr %72, i64 1
  %74 = getelementptr inbounds %struct.__pthread_cond_s, ptr %67, i32 0, i32 4
  %75 = getelementptr inbounds %struct.__pthread_cond_s, ptr %67, i32 0, i32 5
  %76 = getelementptr inbounds %struct.__pthread_cond_s, ptr %67, i32 0, i32 6
  %77 = getelementptr inbounds i32, ptr %76, i64 1
  %78 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 7
  %79 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 8
  %80 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 9
  %81 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %81, ptr %80, align 4, !tbaa !19
  %82 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 10
  %83 = load i8, ptr %8, align 1, !tbaa !11, !range !21, !noundef !22
  %84 = trunc i8 %83 to i1
  %85 = zext i1 %84 to i8
  store i8 %85, ptr %82, align 8, !tbaa !23
  %86 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 11
  %87 = getelementptr inbounds %struct.iwstw, ptr %14, i32 0, i32 12
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %40, ptr align 8 %14, i64 192, i1 true), !tbaa.struct !24
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %95

90:                                               ; preds = %39
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = call noalias ptr @strdup(ptr noundef %91) #10
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.iwstw, ptr %93, i32 0, i32 2
  store ptr %92, ptr %94, align 8, !tbaa !26
  br label %95

95:                                               ; preds = %90, %39
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.iwstw, ptr %96, i32 0, i32 7
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = call i32 @pthread_create(ptr noundef %97, ptr noundef null, ptr noundef @_worker_fn, ptr noundef %98) #10
  store i32 %99, ptr %12, align 4, !tbaa !9
  %100 = load i32, ptr %12, align 4, !tbaa !9
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %106

102:                                              ; preds = %95
  %103 = call ptr @__errno_location() #12
  %104 = load i32, ptr %103, align 4, !tbaa !9
  %105 = call i64 @iwrc_set_errno(i64 noundef 70008, i32 noundef %104)
  store i64 %105, ptr %13, align 8, !tbaa !13
  br label %107

106:                                              ; preds = %95
  br label %107

107:                                              ; preds = %106, %102
  %108 = load i64, ptr %13, align 8, !tbaa !13
  %109 = icmp ne i64 %108, 0
  br i1 %109, label %110, label %116

110:                                              ; preds = %107
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr null, ptr %111, align 8, !tbaa !5
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.iwstw, ptr %112, i32 0, i32 2
  %114 = load ptr, ptr %113, align 8, !tbaa !26
  call void @free(ptr noundef %114) #10
  %115 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %115) #10
  br label %119

116:                                              ; preds = %107
  %117 = load ptr, ptr %10, align 8, !tbaa !5
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %117, ptr %118, align 8, !tbaa !5
  br label %119

119:                                              ; preds = %116, %110
  store i64 0, ptr %5, align 8
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #10
  br label %120

120:                                              ; preds = %119, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  br label %121

121:                                              ; preds = %120, %29, %21
  %122 = load i64, ptr %5, align 8
  ret i64 %122
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #7

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

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @_worker_fn(ptr noundef) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { nounwind willreturn memory(read) "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind }
attributes #11 = { nounwind allocsize(0) }
attributes #12 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 16}
!16 = !{!"__pthread_mutex_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !17, i64 20, !17, i64 22, !18, i64 24}
!17 = !{!"short", !7, i64 0}
!18 = !{!"__pthread_internal_list", !6, i64 0, !6, i64 8}
!19 = !{!20, !10, i64 180}
!20 = !{!"iwstw", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !7, i64 72, !7, i64 120, !14, i64 168, !10, i64 176, !10, i64 180, !12, i64 184, !12, i64 185, !12, i64 186}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!20, !12, i64 184}
!24 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 40, !25, i64 72, i64 48, !25, i64 120, i64 48, !25, i64 168, i64 8, !13, i64 176, i64 4, !9, i64 180, i64 4, !9, i64 184, i64 1, !11, i64 185, i64 1, !11, i64 186, i64 1, !11}
!25 = !{!7, !7, i64 0}
!26 = !{!20, !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"

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

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

declare i64 @iwrc_set_errno(i64 noundef, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nounwind uwtable
define dso_local i64 @iwstw_start(ptr noundef readonly %0, i32 noundef %1, i1 noundef zeroext %2, ptr noundef writeonly %3) local_unnamed_addr #5 {
  %.sroa.0 = alloca [48 x i8], align 8
  %.sroa.2 = alloca i32, align 8
  %.sroa.3 = alloca [128 x i8], align 4
  %.sroa.32 = alloca i32, align 4
  %.sroa.4 = alloca i8, align 8
  %.sroa.5 = alloca [7 x i8], align 1
  %5 = zext i1 %2 to i8
  %6 = icmp sgt i32 %1, -1
  %7 = icmp ne ptr %3, null
  %or.cond = and i1 %6, %7
  br i1 %or.cond, label %8, label %33

8:                                                ; preds = %4
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %12, label %9

9:                                                ; preds = %8
  %10 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #10
  %11 = icmp ugt i64 %10, 15
  br i1 %11, label %33, label %12

12:                                               ; preds = %9, %8
  %13 = tail call noalias dereferenceable_or_null(192) ptr @malloc(i64 noundef 192) #11
  %.not29 = icmp eq ptr %13, null
  br i1 %.not29, label %14, label %18

14:                                               ; preds = %12
  store ptr null, ptr %3, align 8, !tbaa !5
  %15 = tail call ptr @__errno_location() #12
  %16 = load i32, ptr %15, align 4, !tbaa !9
  %17 = tail call i64 @iwrc_set_errno(i64 noundef 70013, i32 noundef %16) #13
  br label %33

18:                                               ; preds = %12
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %.sroa.0, i8 0, i64 48, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(128) %.sroa.3, i8 0, i64 128, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(7) %.sroa.5, i8 0, i64 7, i1 false)
  store i32 0, ptr %.sroa.2, align 8, !tbaa !11
  store i32 %1, ptr %.sroa.32, align 4, !tbaa !15
  store i8 %5, ptr %.sroa.4, align 8, !tbaa !19
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %13, ptr nonnull align 8 %.sroa.0, i64 48, i1 true), !tbaa.struct !20
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 48
  %.sroa.2.0..sroa.2.0..sroa.2.0..sroa.2.0..sroa.2.0.copyload = load volatile i32, ptr %.sroa.2, align 8
  store volatile i32 %.sroa.2.0..sroa.2.0..sroa.2.0..sroa.2.0..sroa.2.0.copyload, ptr %.sroa.2.0..sroa_idx, align 8
  %.sroa.3.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 52
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %.sroa.3.0..sroa_idx, ptr nonnull align 4 %.sroa.3, i64 128, i1 true), !tbaa.struct !24
  %.sroa.32.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 180
  %.sroa.32.0..sroa.32.0..sroa.32.0..sroa.32.0..sroa.32.0.copyload = load volatile i32, ptr %.sroa.32, align 4, !tbaa !9
  store volatile i32 %.sroa.32.0..sroa.32.0..sroa.32.0..sroa.32.0..sroa.32.0.copyload, ptr %.sroa.32.0..sroa_idx, align 4, !tbaa !9
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 184
  %.sroa.4.0..sroa.4.0..sroa.4.0..sroa.4.0..sroa.4.0.copyload = load volatile i8, ptr %.sroa.4, align 8, !tbaa !23
  store volatile i8 %.sroa.4.0..sroa.4.0..sroa.4.0..sroa.4.0..sroa.4.0.copyload, ptr %.sroa.4.0..sroa_idx, align 8, !tbaa !23
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %13, i64 185
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %.sroa.5.0..sroa_idx, ptr nonnull align 1 %.sroa.5, i64 7, i1 true), !tbaa.struct !25
  br i1 %.not, label %22, label %19

19:                                               ; preds = %18
  %20 = tail call noalias ptr @strdup(ptr noundef nonnull %0) #13
  %21 = getelementptr inbounds i8, ptr %13, i64 16
  store ptr %20, ptr %21, align 8, !tbaa !26
  br label %22

22:                                               ; preds = %19, %18
  %23 = getelementptr inbounds i8, ptr %13, i64 168
  %24 = tail call i32 @pthread_create(ptr noundef nonnull %23, ptr noundef null, ptr noundef nonnull @_worker_fn, ptr noundef nonnull %13) #13
  %.not30 = icmp eq i32 %24, 0
  br i1 %.not30, label %.critedge, label %25

25:                                               ; preds = %22
  %26 = tail call ptr @__errno_location() #12
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = tail call i64 @iwrc_set_errno(i64 noundef 70008, i32 noundef %27) #13
  %29 = icmp eq i64 %28, 0
  br i1 %29, label %.critedge, label %30

30:                                               ; preds = %25
  store ptr null, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %13, i64 16
  %32 = load ptr, ptr %31, align 8, !tbaa !26
  tail call void @free(ptr noundef %32) #13
  tail call void @free(ptr noundef nonnull %13) #13
  br label %33

.critedge:                                        ; preds = %22, %25
  store ptr %13, ptr %3, align 8, !tbaa !5
  br label %33

33:                                               ; preds = %14, %.critedge, %30, %9, %4
  %.1 = phi i64 [ 70017, %4 ], [ 70017, %9 ], [ %17, %14 ], [ 0, %.critedge ], [ 0, %30 ]
  ret i64 %.1
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #8

; Function Attrs: nounwind
declare i32 @pthread_create(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #9

; Function Attrs: nounwind uwtable
declare hidden ptr @_worker_fn(ptr noundef) #5

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) 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 #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 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { mustprogress nofree nounwind willreturn 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 #9 = { 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 #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind allocsize(0) }
attributes #12 = { nounwind willreturn memory(none) }
attributes #13 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 16}
!12 = !{!"__pthread_mutex_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !13, i64 20, !13, i64 22, !14, i64 24}
!13 = !{!"short", !7, i64 0}
!14 = !{!"__pthread_internal_list", !6, i64 0, !6, i64 8}
!15 = !{!16, !10, i64 180}
!16 = !{!"iwstw", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !7, i64 32, !7, i64 72, !7, i64 120, !17, i64 168, !10, i64 176, !10, i64 180, !18, i64 184, !18, i64 185, !18, i64 186}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!16, !18, i64 184}
!20 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 40, !21, i64 72, i64 48, !21, i64 120, i64 48, !21, i64 168, i64 8, !22, i64 176, i64 4, !9, i64 180, i64 4, !9, i64 184, i64 1, !23, i64 185, i64 1, !23, i64 186, i64 1, !23}
!21 = !{!7, !7, i64 0}
!22 = !{!17, !17, i64 0}
!23 = !{!18, !18, i64 0}
!24 = !{i64 0, i64 20, !21, i64 20, i64 48, !21, i64 68, i64 48, !21, i64 116, i64 8, !22, i64 124, i64 4, !9, i64 128, i64 4, !9, i64 132, i64 1, !23, i64 133, i64 1, !23, i64 134, i64 1, !23}
!25 = !{i64 0, i64 1, !23, i64 1, i64 1, !23}
!26 = !{!16, !6, i64 16}


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