; LLVM IR from turi-code/SFrame :: oss_src/parallel/pthread_tools.ll (ZN8graphlab6thread6launchERKN5boost8functionIFvvEEE)

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

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.anon = type { i8 }
%union.pthread_attr_t = type { i64, [48 x i8] }
%class.anon.2 = type { i8 }
%class.anon.4 = type { i8 }
%class.anon.6 = type { i8 }
%class.anon.8 = type { i8 }
%"class.graphlab::thread" = type <{ i64, i64, i64, i8, [7 x i8] }>

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.12 = external hidden unnamed_addr constant [61 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN8graphlabL10get_tsd_idEv() #0

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN8graphlab6thread6invokeEPv(ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab6thread6launchERKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(25) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.anon, align 1
  %6 = alloca %union.pthread_attr_t, align 8
  %7 = alloca i32, align 4
  %8 = alloca %class.anon.2, align 1
  %9 = alloca %class.anon.4, align 1
  %10 = alloca %class.anon.6, align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %class.anon.8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  %15 = call noundef i32 @_ZN8graphlabL10get_tsd_idEv()
  br label %16

16:                                               ; preds = %2
  %17 = getelementptr inbounds %"class.graphlab::thread", ptr %14, i32 0, i32 3
  %18 = load i8, ptr %17, align 8, !tbaa !9, !range !13, !noundef !14
  %19 = trunc i8 %18 to i1
  %20 = xor i1 %19, true
  %21 = xor i1 %20, true
  %22 = xor i1 %21, true
  %23 = xor i1 %22, true
  %24 = zext i1 %23 to i64
  %25 = call i64 @llvm.expect.i64(i64 %24, i64 0)
  %26 = icmp ne i64 %25, 0
  br i1 %26, label %27, label %28

27:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #9
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #9
  br label %28

28:                                               ; preds = %27, %16
  br label %29

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 56, ptr %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !15
  %30 = call i32 @pthread_attr_init(ptr noundef %6) #9
  store i32 %30, ptr %7, align 4, !tbaa !15
  br label %31

31:                                               ; preds = %29
  %32 = load i32, ptr %7, align 4, !tbaa !15
  %33 = icmp ne i32 %32, 0
  %34 = xor i1 %33, true
  %35 = xor i1 %34, true
  %36 = xor i1 %35, true
  %37 = xor i1 %36, true
  %38 = zext i1 %37 to i64
  %39 = call i64 @llvm.expect.i64(i64 %38, i64 0)
  %40 = icmp ne i64 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #9
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %8)
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #9
  br label %42

42:                                               ; preds = %41, %31
  br label %43

43:                                               ; preds = %42
  br label %44

44:                                               ; preds = %43
  %45 = getelementptr inbounds %"class.graphlab::thread", ptr %14, i32 0, i32 0
  %46 = load i64, ptr %45, align 8, !tbaa !17
  %47 = call i32 @pthread_attr_setstacksize(ptr noundef %6, i64 noundef %46) #9
  store i32 %47, ptr %7, align 4, !tbaa !15
  br label %48

48:                                               ; preds = %44
  %49 = load i32, ptr %7, align 4, !tbaa !15
  %50 = icmp ne i32 %49, 0
  %51 = xor i1 %50, true
  %52 = xor i1 %51, true
  %53 = xor i1 %52, true
  %54 = xor i1 %53, true
  %55 = zext i1 %54 to i64
  %56 = call i64 @llvm.expect.i64(i64 %55, i64 0)
  %57 = icmp ne i64 %56, 0
  br i1 %57, label %58, label %59

58:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #9
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_2clEv"(ptr noundef nonnull align 1 dereferenceable(1) %9)
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #9
  br label %59

59:                                               ; preds = %58, %48
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  %62 = call i32 @pthread_attr_setdetachstate(ptr noundef %6, i32 noundef 0) #9
  store i32 %62, ptr %7, align 4, !tbaa !15
  br label %63

63:                                               ; preds = %61
  %64 = load i32, ptr %7, align 4, !tbaa !15
  %65 = icmp ne i32 %64, 0
  %66 = xor i1 %65, true
  %67 = xor i1 %66, true
  %68 = xor i1 %67, true
  %69 = xor i1 %68, true
  %70 = zext i1 %69 to i64
  %71 = call i64 @llvm.expect.i64(i64 %70, i64 0)
  %72 = icmp ne i64 %71, 0
  br i1 %72, label %73, label %74

73:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #9
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_3clEv"(ptr noundef nonnull align 1 dereferenceable(1) %10)
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #9
  br label %74

74:                                               ; preds = %73, %63
  br label %75

75:                                               ; preds = %74
  br label %76

76:                                               ; preds = %75
  %77 = getelementptr inbounds %"class.graphlab::thread", ptr %14, i32 0, i32 1
  %78 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 40) #10
  %79 = getelementptr inbounds %"class.graphlab::thread", ptr %14, i32 0, i32 2
  %80 = load i64, ptr %79, align 8, !tbaa !18
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN8graphlab6thread11invoke_argsC2EmRKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(40) %78, i64 noundef %80, ptr noundef nonnull align 8 dereferenceable(32) %81)
          to label %82 unwind label %92

82:                                               ; preds = %76
  %83 = call i32 @pthread_create(ptr noundef %77, ptr noundef %6, ptr noundef @_ZN8graphlab6thread6invokeEPv, ptr noundef %78) #9
  store i32 %83, ptr %7, align 4, !tbaa !15
  %84 = getelementptr inbounds %"class.graphlab::thread", ptr %14, i32 0, i32 3
  store i8 1, ptr %84, align 8, !tbaa !9
  %85 = load i32, ptr %7, align 4, !tbaa !15
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %96

87:                                               ; preds = %82
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.12)
  %89 = load i32, ptr %7, align 4, !tbaa !15
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %88, i32 noundef %89)
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 1) #11
  unreachable

92:                                               ; preds = %76
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %11, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %78, i64 noundef 40) #12
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #9
  br label %112

96:                                               ; preds = %82
  %97 = call i32 @pthread_attr_destroy(ptr noundef %6) #9
  store i32 %97, ptr %7, align 4, !tbaa !15
  br label %98

98:                                               ; preds = %96
  %99 = load i32, ptr %7, align 4, !tbaa !15
  %100 = icmp ne i32 %99, 0
  %101 = xor i1 %100, true
  %102 = xor i1 %101, true
  %103 = xor i1 %102, true
  %104 = xor i1 %103, true
  %105 = zext i1 %104 to i64
  %106 = call i64 @llvm.expect.i64(i64 %105, i64 0)
  %107 = icmp ne i64 %106, 0
  br i1 %107, label %108, label %109

108:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #9
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_4clEv"(ptr noundef nonnull align 1 dereferenceable(1) %13)
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #9
  br label %109

109:                                              ; preds = %108, %98
  br label %110

110:                                              ; preds = %109
  br label %111

111:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr %6) #9
  ret void

112:                                              ; preds = %92
  %113 = load ptr, ptr %11, align 8
  %114 = load i32, ptr %12, align 4
  %115 = insertvalue { ptr, i32 } poison, ptr %113, 0
  %116 = insertvalue { ptr, i32 } %115, i32 %114, 1
  resume { ptr, i32 } %116
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #7

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

; Function Attrs: nounwind
declare i32 @pthread_attr_init(ptr noundef) #8

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

; Function Attrs: nounwind
declare i32 @pthread_attr_setstacksize(ptr noundef, i64 noundef) #8

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_2clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

; Function Attrs: nounwind
declare i32 @pthread_attr_setdetachstate(ptr noundef, i32 noundef) #8

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_3clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8graphlab6thread11invoke_argsC2EmRKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: nounwind
declare i32 @pthread_attr_destroy(ptr noundef) #8

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_4clEv"(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin 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 = { nobuiltin 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 #4 = { inlinehint 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 = { "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 = { noreturn 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 #7 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #8 = { 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 #9 = { nounwind }
attributes #10 = { builtin allocsize(0) }
attributes #11 = { noreturn nounwind }
attributes #12 = { builtin 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++ TBAA"}
!9 = !{!10, !12, i64 24}
!10 = !{!"_ZTSN8graphlab6threadE", !11, i64 0, !11, i64 8, !11, i64 16, !12, i64 24}
!11 = !{!"long", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!10, !11, i64 0}
!18 = !{!10, !11, 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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.anon = type { i8 }
%union.pthread_attr_t = type { i64, [48 x i8] }
%class.anon.2 = type { i8 }
%class.anon.4 = type { i8 }
%class.anon.6 = type { i8 }
%class.anon.8 = type { i8 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.12 = external hidden unnamed_addr constant [61 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN8graphlabL10get_tsd_idEv() 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #2

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

; 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 uwtable
declare dso_local noundef ptr @_ZN8graphlab6thread6invokeEPv(ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #5

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8graphlab6thread6launchERKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(25) %0, ptr noundef nonnull align 8 dereferenceable(32) %1) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.anon, align 1
  %4 = alloca %union.pthread_attr_t, align 8
  %5 = alloca %class.anon.2, align 1
  %6 = alloca %class.anon.4, align 1
  %7 = alloca %class.anon.6, align 1
  %8 = alloca %class.anon.8, align 1
  %9 = tail call noundef i32 @_ZN8graphlabL10get_tsd_idEv()
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load i8, ptr %10, align 8, !tbaa !5, !range !11, !noundef !12
  %12 = trunc nuw i8 %11 to i1
  br i1 %12, label %13, label %14, !prof !13

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #8
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1) %3)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #8
  br label %14

14:                                               ; preds = %2, %13
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %4) #8
  %15 = call i32 @pthread_attr_init(ptr noundef nonnull %4) #8
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %17, label %16, !prof !14

16:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #8
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #8
  br label %17

17:                                               ; preds = %16, %14
  %18 = load i64, ptr %0, align 8, !tbaa !15
  %19 = call i32 @pthread_attr_setstacksize(ptr noundef nonnull %4, i64 noundef %18) #8
  %.not9 = icmp eq i32 %19, 0
  br i1 %.not9, label %21, label %20, !prof !14

20:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %6) #8
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_2clEv"(ptr noundef nonnull align 1 dereferenceable(1) %6)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %6) #8
  br label %21

21:                                               ; preds = %20, %17
  %22 = call i32 @pthread_attr_setdetachstate(ptr noundef nonnull %4, i32 noundef 0) #8
  %.not10 = icmp eq i32 %22, 0
  br i1 %.not10, label %24, label %23, !prof !14

23:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #8
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_3clEv"(ptr noundef nonnull align 1 dereferenceable(1) %7)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  br label %24

24:                                               ; preds = %23, %21
  %25 = call noalias noundef nonnull dereferenceable(40) ptr @_Znwm(i64 noundef 40) #9
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = load i64, ptr %26, align 8, !tbaa !16
  invoke void @_ZN8graphlab6thread11invoke_argsC2EmRKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(40) %25, i64 noundef %27, ptr noundef nonnull align 8 dereferenceable(32) %1)
          to label %28 unwind label %35

28:                                               ; preds = %24
  %29 = getelementptr inbounds i8, ptr %0, i64 8
  %30 = call i32 @pthread_create(ptr noundef nonnull %29, ptr noundef nonnull %4, ptr noundef nonnull @_ZN8graphlab6thread6invokeEPv, ptr noundef nonnull %25) #8
  store i8 1, ptr %10, align 8, !tbaa !5
  %.not11 = icmp eq i32 %30, 0
  br i1 %.not11, label %37, label %31

31:                                               ; preds = %28
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.12)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %32, i32 noundef %30)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @exit(i32 noundef 1) #10
  unreachable

35:                                               ; preds = %24
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %25, i64 noundef 40) #11
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #8
  resume { ptr, i32 } %36

37:                                               ; preds = %28
  %38 = call i32 @pthread_attr_destroy(ptr noundef nonnull %4) #8
  %.not12 = icmp eq i32 %38, 0
  br i1 %.not12, label %40, label %39, !prof !14

39:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #8
  call void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_4clEv"(ptr noundef nonnull align 1 dereferenceable(1) %8)
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #8
  br label %40

40:                                               ; preds = %39, %37
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %4) #8
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_0clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: nounwind
declare i32 @pthread_attr_init(ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_1clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: nounwind
declare i32 @pthread_attr_setstacksize(ptr noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_2clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

; Function Attrs: nounwind
declare i32 @pthread_attr_setdetachstate(ptr noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_3clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8graphlab6thread11invoke_argsC2EmRKN5boost8functionIFvvEEE(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

; Function Attrs: nounwind
declare i32 @pthread_attr_destroy(ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZZN8graphlab6thread6launchERKN5boost8functionIFvvEEEENK3$_4clEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nobuiltin 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 = { nobuiltin 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 #4 = { inlinehint 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 = { "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 = { noreturn 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { builtin allocsize(0) }
attributes #10 = { noreturn nounwind }
attributes #11 = { builtin 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, !10, i64 24}
!6 = !{!"_ZTSN8graphlab6threadE", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"bool", !8, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!14 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!15 = !{!6, !7, i64 0}
!16 = !{!6, !7, i64 16}


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