; LLVM IR from rociodellasala/TP3_SO :: Userland/threadTest (threadTest)

; 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"

@flagTask1 = external dso_local global i32, align 4
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [181 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask1() #0

declare void @printf(ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask4() #0

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask4bis() #0

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask4bisbis() #0

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask3() #0

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

declare ptr @heapStartingPoint(...) #1

declare void @printHexadecimal(ptr noundef) #1

declare void @nextLine(...) #1

declare ptr @malloc(i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  call void (...) @clear_screen()
  call void (ptr, ...) @printf(ptr noundef @.str.8)
  call void (...) @nextLine()
  call void (i32, ptr, ...) @printfColor(i32 noundef 286644, ptr noundef @.str.9)
  call void (...) @clear_buffer()
  br label %8

8:                                                ; preds = %16, %0
  store i32 0, ptr %2, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef @.str.10)
  call void (...) @clear_buffer()
  %9 = call i32 @getNum(ptr noundef %2)
  call void (...) @nextLine()
  br label %10

10:                                               ; preds = %8
  %11 = load i32, ptr %2, align 4, !tbaa !5
  %12 = icmp slt i32 %11, 2
  br i1 %12, label %16, label %13

13:                                               ; preds = %10
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 10
  br label %16

16:                                               ; preds = %13, %10
  %17 = phi i1 [ true, %10 ], [ %15, %13 ]
  br i1 %17, label %8, label %18, !llvm.loop !9

18:                                               ; preds = %16
  store i32 1, ptr @flagTask1, align 4, !tbaa !5
  call void (...) @nextLine()
  br label %19

19:                                               ; preds = %23, %18
  %20 = load i32, ptr %4, align 4, !tbaa !5
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %28

23:                                               ; preds = %19
  call void (ptr, ...) @thread(ptr noundef @functionTask1)
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  call void (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %25)
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %4, align 4, !tbaa !5
  br label %19, !llvm.loop !11

28:                                               ; preds = %19
  call void (...) @nextLine()
  %29 = call i32 (...) @threadCount()
  store i32 %29, ptr %3, align 4, !tbaa !5
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  %33 = icmp eq i32 %30, %32
  br i1 %33, label %34, label %36

34:                                               ; preds = %28
  %35 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef @.str.12, i32 noundef %35)
  br label %41

36:                                               ; preds = %28
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  call void (ptr, ...) @printf(ptr noundef @.str.13, i32 noundef %37, i32 noundef %38, i32 noundef %40)
  br label %41

41:                                               ; preds = %36, %34
  call void (i32, ptr, ...) @printfColor(i32 noundef 286644, ptr noundef @.str.14)
  br label %42

42:                                               ; preds = %44, %41
  store i32 0, ptr %5, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef @.str.15)
  call void (...) @clear_buffer()
  %43 = call i32 @getNum(ptr noundef %5)
  call void (...) @nextLine()
  br label %44

44:                                               ; preds = %42
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = icmp ne i32 %45, 1
  br i1 %46, label %42, label %47, !llvm.loop !12

47:                                               ; preds = %44
  call void (...) @nextLine()
  store i32 0, ptr @flagTask1, align 4, !tbaa !5
  %48 = call i32 (...) @waitThread()
  br label %49

49:                                               ; preds = %52, %47
  %50 = load i32, ptr %5, align 4, !tbaa !5
  %51 = icmp slt i32 %50, 60000000
  br i1 %51, label %52, label %55

52:                                               ; preds = %49
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  store i32 %54, ptr %5, align 4, !tbaa !5
  br label %49, !llvm.loop !13

55:                                               ; preds = %49
  %56 = call i32 (...) @threadCount()
  store i32 %56, ptr %3, align 4, !tbaa !5
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = icmp eq i32 %57, 1
  br i1 %58, label %59, label %61

59:                                               ; preds = %55
  %60 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef @.str.16, i32 noundef %60)
  br label %63

61:                                               ; preds = %55
  %62 = load i32, ptr %3, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef @.str.17, i32 noundef %62)
  br label %63

63:                                               ; preds = %61, %59
  call void (i32, ptr, ...) @printfColor(i32 noundef 286644, ptr noundef @.str.18)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %66, %63
  store i32 0, ptr %5, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef @.str.15)
  call void (...) @clear_buffer()
  %65 = call i32 @getNum(ptr noundef %5)
  call void (...) @nextLine()
  br label %66

66:                                               ; preds = %64
  %67 = load i32, ptr %5, align 4, !tbaa !5
  %68 = icmp ne i32 %67, 1
  br i1 %68, label %64, label %69, !llvm.loop !14

69:                                               ; preds = %66
  call void (...) @nextLine()
  call void (ptr, ...) @printf(ptr noundef @.str.19)
  %70 = call ptr @malloc(i32 noundef 4)
  call void (...) @nextLine()
  call void (ptr, ...) @printf(ptr noundef @.str.20)
  call void (ptr, ...) @printf(ptr noundef @.str.21)
  %71 = call ptr (...) @heapStartingPoint()
  store ptr %71, ptr %7, align 8, !tbaa !15
  %72 = load ptr, ptr %7, align 8, !tbaa !15
  call void @printHexadecimal(ptr noundef %72)
  call void (ptr, ...) @thread(ptr noundef @functionTask3)
  call void (ptr, ...) @printf(ptr noundef @.str.22)
  %73 = call i32 (...) @waitThread()
  br label %74

74:                                               ; preds = %77, %69
  %75 = call i32 (...) @threadCount()
  %76 = icmp ne i32 %75, 1
  br i1 %76, label %77, label %78

77:                                               ; preds = %74
  br label %74, !llvm.loop !17

78:                                               ; preds = %74
  call void (ptr, ...) @printf(ptr noundef @.str.23)
  %79 = call ptr @malloc(i32 noundef 4)
  store ptr %79, ptr %6, align 8, !tbaa !15
  call void (...) @nextLine()
  call void (ptr, ...) @printf(ptr noundef @.str.24)
  %80 = load ptr, ptr %6, align 8, !tbaa !15
  call void @printHexadecimal(ptr noundef %80)
  call void (...) @nextLine()
  call void (i32, ptr, ...) @printfColor(i32 noundef 286644, ptr noundef @.str.25)
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %83, %78
  store i32 0, ptr %5, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef @.str.15)
  call void (...) @clear_buffer()
  %82 = call i32 @getNum(ptr noundef %5)
  call void (...) @nextLine()
  br label %83

83:                                               ; preds = %81
  %84 = load i32, ptr %5, align 4, !tbaa !5
  %85 = icmp ne i32 %84, 1
  br i1 %85, label %81, label %86, !llvm.loop !18

86:                                               ; preds = %83
  call void (...) @nextLine()
  call void (ptr, ...) @printf(ptr noundef @.str.26)
  call void (ptr, ...) @printf(ptr noundef @.str.27)
  call void (ptr, ...) @printf(ptr noundef @.str.28)
  call void (ptr, ...) @printf(ptr noundef @.str.29)
  call void (ptr, ...) @printf(ptr noundef @.str.30)
  call void (ptr, ...) @printf(ptr noundef @.str.31)
  call void (...) @nextLine()
  call void (ptr, ...) @thread(ptr noundef @functionTask4)
  call void (ptr, ...) @printf(ptr noundef @.str.32)
  call void (ptr, ...) @thread(ptr noundef @functionTask4bis)
  call void (ptr, ...) @printf(ptr noundef @.str.33)
  call void (ptr, ...) @thread(ptr noundef @functionTask4bisbis)
  call void (ptr, ...) @printf(ptr noundef @.str.34)
  call void (...) @nextLine()
  %87 = call i32 (...) @waitThread()
  br label %88

88:                                               ; preds = %91, %86
  %89 = call i32 (...) @threadCount()
  %90 = icmp ne i32 %89, 1
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  br label %88, !llvm.loop !19

92:                                               ; preds = %88
  call void (ptr, ...) @printf(ptr noundef @.str.35)
  call void (...) @nextLine()
  call void (...) @clear_buffer()
  call void (...) @exitProcess()
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  ret i32 0
}

declare void @clear_screen(...) #1

declare void @printfColor(i32 noundef, ptr noundef, ...) #1

declare void @clear_buffer(...) #1

declare i32 @getNum(ptr noundef) #1

declare void @thread(...) #1

declare i32 @threadCount(...) #1

declare i32 @waitThread(...) #1

declare void @exitProcess(...) #1

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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}


; 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"

@flagTask1 = external dso_local local_unnamed_addr global i32, align 4
@.str.8 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [102 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [103 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [181 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [26 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask1() #0

declare void @printf(ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask4() #0

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask4bis() #0

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask4bisbis() #0

; Function Attrs: nounwind uwtable
declare dso_local void @functionTask3() #0

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

declare ptr @heapStartingPoint(...) local_unnamed_addr #1

declare void @printHexadecimal(ptr noundef) local_unnamed_addr #1

declare void @nextLine(...) local_unnamed_addr #1

declare ptr @malloc(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 0, ptr %2, align 4, !tbaa !5
  tail call void (...) @clear_screen() #3
  tail call void (ptr, ...) @printf(ptr noundef nonnull @.str.8) #3
  tail call void (...) @nextLine() #3
  tail call void (i32, ptr, ...) @printfColor(i32 noundef 286644, ptr noundef nonnull @.str.9) #3
  tail call void (...) @clear_buffer() #3
  br label %3

3:                                                ; preds = %3, %0
  store i32 0, ptr %1, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.10) #3
  call void (...) @clear_buffer() #3
  %4 = call i32 @getNum(ptr noundef nonnull %1) #3
  call void (...) @nextLine() #3
  %5 = load i32, ptr %1, align 4
  %6 = add i32 %5, -11
  %7 = icmp ult i32 %6, -9
  br i1 %7, label %3, label %8, !llvm.loop !9

8:                                                ; preds = %3
  store i32 1, ptr @flagTask1, align 4, !tbaa !5
  call void (...) @nextLine() #3
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp sgt i32 %9, 0
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %8, %.lr.ph
  %.019 = phi i32 [ %11, %.lr.ph ], [ 0, %8 ]
  call void (ptr, ...) @thread(ptr noundef nonnull @functionTask1) #3
  %11 = add nuw nsw i32 %.019, 1
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.11, i32 noundef %11) #3
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp slt i32 %11, %12
  br i1 %13, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %8
  call void (...) @nextLine() #3
  %14 = call i32 (...) @threadCount() #3
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  %17 = icmp eq i32 %14, %16
  br i1 %17, label %18, label %19

18:                                               ; preds = %._crit_edge
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.12, i32 noundef %14) #3
  br label %20

19:                                               ; preds = %._crit_edge
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.13, i32 noundef %14, i32 noundef %15, i32 noundef %16) #3
  br label %20

20:                                               ; preds = %19, %18
  call void (i32, ptr, ...) @printfColor(i32 noundef 286644, ptr noundef nonnull @.str.14) #3
  br label %21

21:                                               ; preds = %21, %20
  store i32 0, ptr %2, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.15) #3
  call void (...) @clear_buffer() #3
  %22 = call i32 @getNum(ptr noundef nonnull %2) #3
  call void (...) @nextLine() #3
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %23, 1
  br i1 %.not, label %24, label %21, !llvm.loop !12

24:                                               ; preds = %21
  call void (...) @nextLine() #3
  store i32 0, ptr @flagTask1, align 4, !tbaa !5
  %25 = call i32 (...) @waitThread() #3
  %.pr = load i32, ptr %2, align 4, !tbaa !5
  %26 = icmp slt i32 %.pr, 60000000
  br i1 %26, label %.lr.ph21.preheader, label %27

.lr.ph21.preheader:                               ; preds = %24
  store i32 60000000, ptr %2, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %.lr.ph21.preheader, %24
  %28 = call i32 (...) @threadCount() #3
  %29 = icmp eq i32 %28, 1
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.16, i32 noundef 1) #3
  br label %32

31:                                               ; preds = %27
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.17, i32 noundef %28) #3
  br label %32

32:                                               ; preds = %31, %30
  call void (i32, ptr, ...) @printfColor(i32 noundef 286644, ptr noundef nonnull @.str.18) #3
  br label %33

33:                                               ; preds = %33, %32
  store i32 0, ptr %2, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.15) #3
  call void (...) @clear_buffer() #3
  %34 = call i32 @getNum(ptr noundef nonnull %2) #3
  call void (...) @nextLine() #3
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %.not15 = icmp eq i32 %35, 1
  br i1 %.not15, label %36, label %33, !llvm.loop !13

36:                                               ; preds = %33
  call void (...) @nextLine() #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.19) #3
  %37 = call ptr @malloc(i32 noundef 4) #3
  call void (...) @nextLine() #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.20) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.21) #3
  %38 = call ptr (...) @heapStartingPoint() #3
  call void @printHexadecimal(ptr noundef %38) #3
  call void (ptr, ...) @thread(ptr noundef nonnull @functionTask3) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.22) #3
  %39 = call i32 (...) @waitThread() #3
  br label %40

40:                                               ; preds = %40, %36
  %41 = call i32 (...) @threadCount() #3
  %.not16 = icmp eq i32 %41, 1
  br i1 %.not16, label %42, label %40, !llvm.loop !14

42:                                               ; preds = %40
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.23) #3
  %43 = call ptr @malloc(i32 noundef 4) #3
  call void (...) @nextLine() #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.24) #3
  call void @printHexadecimal(ptr noundef %43) #3
  call void (...) @nextLine() #3
  call void (i32, ptr, ...) @printfColor(i32 noundef 286644, ptr noundef nonnull @.str.25) #3
  br label %44

44:                                               ; preds = %44, %42
  store i32 0, ptr %2, align 4, !tbaa !5
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.15) #3
  call void (...) @clear_buffer() #3
  %45 = call i32 @getNum(ptr noundef nonnull %2) #3
  call void (...) @nextLine() #3
  %46 = load i32, ptr %2, align 4, !tbaa !5
  %.not17 = icmp eq i32 %46, 1
  br i1 %.not17, label %47, label %44, !llvm.loop !15

47:                                               ; preds = %44
  call void (...) @nextLine() #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.26) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.27) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.28) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.29) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.30) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.31) #3
  call void (...) @nextLine() #3
  call void (ptr, ...) @thread(ptr noundef nonnull @functionTask4) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.32) #3
  call void (ptr, ...) @thread(ptr noundef nonnull @functionTask4bis) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.33) #3
  call void (ptr, ...) @thread(ptr noundef nonnull @functionTask4bisbis) #3
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.34) #3
  call void (...) @nextLine() #3
  %48 = call i32 (...) @waitThread() #3
  br label %49

49:                                               ; preds = %49, %47
  %50 = call i32 (...) @threadCount() #3
  %.not18 = icmp eq i32 %50, 1
  br i1 %.not18, label %51, label %49, !llvm.loop !16

51:                                               ; preds = %49
  call void (ptr, ...) @printf(ptr noundef nonnull @.str.35) #3
  call void (...) @nextLine() #3
  call void (...) @clear_buffer() #3
  call void (...) @exitProcess() #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #3
  ret i32 0
}

declare void @clear_screen(...) local_unnamed_addr #1

declare void @printfColor(i32 noundef, ptr noundef, ...) local_unnamed_addr #1

declare void @clear_buffer(...) local_unnamed_addr #1

declare i32 @getNum(ptr noundef) local_unnamed_addr #1

declare void @thread(...) local_unnamed_addr #1

declare i32 @threadCount(...) local_unnamed_addr #1

declare i32 @waitThread(...) local_unnamed_addr #1

declare void @exitProcess(...) local_unnamed_addr #1

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}


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