; LLVM IR from turi-code/SFrame :: oss_src/logger/backtrace.ll/Z18 (print_back_tracev)

; 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.graphlab::mutex" = type { %union.pthread_mutex_t }
%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 }
%"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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::lock_guard" = type { ptr }

@_ZL20back_trace_file_lock = external hidden global %"class.graphlab::mutex", align 8
@_ZL21backtrace_file_number = external hidden global i32, align 4
@_ZL11write_error = external hidden global i8, align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@_ZL11write_count = external hidden global i64, align 8
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.18 = external hidden unnamed_addr constant [42 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8demangleB5cxx11PKc(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef) #0

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18__print_back_tracev() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca [1024 x ptr], align 16
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::lock_guard", align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [1024 x i8], align 16
  %10 = alloca ptr, align 8
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 8192, ptr %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  invoke void @_ZNSt10lock_guardIN8graphlab5mutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(40) @_ZL20back_trace_file_lock)
          to label %12 unwind label %16

12:                                               ; preds = %0
  %13 = load i8, ptr @_ZL11write_error, align 1, !tbaa !5, !range !9, !noundef !10
  %14 = trunc i8 %13 to i1
  br i1 %14, label %15, label %20

15:                                               ; preds = %12
  store i32 1, ptr %8, align 4
  br label %126

16:                                               ; preds = %0
  %17 = landingpad { ptr, i32 }
          catch ptr null
  %18 = extractvalue { ptr, i32 } %17, 0
  store ptr %18, ptr %6, align 8
  %19 = extractvalue { ptr, i32 } %17, 1
  store i32 %19, ptr %7, align 4
  br label %130

20:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 1024, ptr %9) #7
  %21 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 0
  %22 = load i32, ptr @_ZL21backtrace_file_number, align 4, !tbaa !11
  %23 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %21, ptr noundef @.str.6, i32 noundef %22) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store ptr null, ptr %10, align 8, !tbaa !13
  %24 = load i64, ptr @_ZL11write_count, align 8, !tbaa !15
  %25 = icmp eq i64 %24, 0
  br i1 %25, label %26, label %34

26:                                               ; preds = %20
  %27 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 0
  %28 = invoke noalias ptr @fopen(ptr noundef %27, ptr noundef @.str.7)
          to label %29 unwind label %30

29:                                               ; preds = %26
  store ptr %28, ptr %10, align 8, !tbaa !13
  br label %38

30:                                               ; preds = %116, %44, %34, %26
  %31 = landingpad { ptr, i32 }
          catch ptr null
  %32 = extractvalue { ptr, i32 } %31, 0
  store ptr %32, ptr %6, align 8
  %33 = extractvalue { ptr, i32 } %31, 1
  store i32 %33, ptr %7, align 4
  br label %129

34:                                               ; preds = %20
  %35 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 0
  %36 = invoke noalias ptr @fopen(ptr noundef %35, ptr noundef @.str.8)
          to label %37 unwind label %30

37:                                               ; preds = %34
  store ptr %36, ptr %10, align 8, !tbaa !13
  br label %38

38:                                               ; preds = %37, %29
  %39 = load ptr, ptr %10, align 8, !tbaa !13
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %44

41:                                               ; preds = %38
  %42 = load ptr, ptr @stderr, align 8, !tbaa !13
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.9) #7
  store i8 1, ptr @_ZL11write_error, align 1, !tbaa !5
  store i32 1, ptr %8, align 4
  br label %125

44:                                               ; preds = %38
  %45 = load i64, ptr @_ZL11write_count, align 8, !tbaa !15
  %46 = add i64 %45, 1
  store i64 %46, ptr @_ZL11write_count, align 8, !tbaa !15
  %47 = getelementptr inbounds [1024 x ptr], ptr %1, i64 0, i64 0
  %48 = invoke i32 @backtrace(ptr noundef %47, i32 noundef 1024)
          to label %49 unwind label %30

49:                                               ; preds = %44
  %50 = sext i32 %48 to i64
  store i64 %50, ptr %2, align 8, !tbaa !15
  %51 = getelementptr inbounds [1024 x ptr], ptr %1, i64 0, i64 0
  %52 = load i64, ptr %2, align 8, !tbaa !15
  %53 = trunc i64 %52 to i32
  %54 = call ptr @backtrace_symbols(ptr noundef %51, i32 noundef %53) #7
  store ptr %54, ptr %4, align 8, !tbaa !13
  %55 = load ptr, ptr %10, align 8, !tbaa !13
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef @.str.10) #7
  %57 = load ptr, ptr %10, align 8, !tbaa !13
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef @.str.11) #7
  store i64 0, ptr %3, align 8, !tbaa !15
  br label %59

59:                                               ; preds = %69, %49
  %60 = load i64, ptr %3, align 8, !tbaa !15
  %61 = load i64, ptr %2, align 8, !tbaa !15
  %62 = icmp ult i64 %60, %61
  br i1 %62, label %63, label %72

63:                                               ; preds = %59
  %64 = load ptr, ptr %10, align 8, !tbaa !13
  %65 = load i64, ptr %3, align 8, !tbaa !15
  %66 = getelementptr inbounds [1024 x ptr], ptr %1, i64 0, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !13
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %64, ptr noundef @.str.12, ptr noundef %67) #7
  br label %69

69:                                               ; preds = %63
  %70 = load i64, ptr %3, align 8, !tbaa !15
  %71 = add i64 %70, 1
  store i64 %71, ptr %3, align 8, !tbaa !15
  br label %59, !llvm.loop !17

72:                                               ; preds = %59
  %73 = load ptr, ptr %10, align 8, !tbaa !13
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str.13) #7
  %75 = load ptr, ptr %10, align 8, !tbaa !13
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.11) #7
  store i64 0, ptr %3, align 8, !tbaa !15
  br label %77

77:                                               ; preds = %88, %72
  %78 = load i64, ptr %3, align 8, !tbaa !15
  %79 = load i64, ptr %2, align 8, !tbaa !15
  %80 = icmp ult i64 %78, %79
  br i1 %80, label %81, label %91

81:                                               ; preds = %77
  %82 = load ptr, ptr %10, align 8, !tbaa !13
  %83 = load ptr, ptr %4, align 8, !tbaa !13
  %84 = load i64, ptr %3, align 8, !tbaa !15
  %85 = getelementptr inbounds ptr, ptr %83, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !13
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %82, ptr noundef @.str.14, ptr noundef %86) #7
  br label %88

88:                                               ; preds = %81
  %89 = load i64, ptr %3, align 8, !tbaa !15
  %90 = add i64 %89, 1
  store i64 %90, ptr %3, align 8, !tbaa !15
  br label %77, !llvm.loop !19

91:                                               ; preds = %77
  %92 = load ptr, ptr %10, align 8, !tbaa !13
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef @.str.15) #7
  %94 = load ptr, ptr %10, align 8, !tbaa !13
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %94, ptr noundef @.str.11) #7
  store i64 0, ptr %3, align 8, !tbaa !15
  br label %96

96:                                               ; preds = %109, %91
  %97 = load i64, ptr %3, align 8, !tbaa !15
  %98 = load i64, ptr %2, align 8, !tbaa !15
  %99 = icmp ult i64 %97, %98
  br i1 %99, label %100, label %116

100:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  %101 = load ptr, ptr %4, align 8, !tbaa !13
  %102 = load i64, ptr %3, align 8, !tbaa !15
  %103 = getelementptr inbounds ptr, ptr %101, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !13
  invoke void @_Z8demangleB5cxx11PKc(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %11, ptr noundef %104)
          to label %105 unwind label %112

105:                                              ; preds = %100
  %106 = load ptr, ptr %10, align 8, !tbaa !13
  %107 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef @.str.14, ptr noundef %107) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  br label %109

109:                                              ; preds = %105
  %110 = load i64, ptr %3, align 8, !tbaa !15
  %111 = add i64 %110, 1
  store i64 %111, ptr %3, align 8, !tbaa !15
  br label %96, !llvm.loop !20

112:                                              ; preds = %100
  %113 = landingpad { ptr, i32 }
          catch ptr null
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %6, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  br label %129

116:                                              ; preds = %96
  %117 = load ptr, ptr %4, align 8, !tbaa !13
  call void @free(ptr noundef %117) #7
  %118 = load ptr, ptr %10, align 8, !tbaa !13
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.16) #7
  %120 = load ptr, ptr %10, align 8, !tbaa !13
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.17) #7
  %122 = load ptr, ptr %10, align 8, !tbaa !13
  %123 = invoke i32 @fclose(ptr noundef %122)
          to label %124 unwind label %30

124:                                              ; preds = %116
  store i32 0, ptr %8, align 4
  br label %125

125:                                              ; preds = %124, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %9) #7
  br label %126

126:                                              ; preds = %125, %15
  call void @_ZNSt10lock_guardIN8graphlab5mutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  %127 = load i32, ptr %8, align 4
  switch i32 %127, label %139 [
    i32 0, label %128
  ]

128:                                              ; preds = %126
  br label %138

129:                                              ; preds = %112, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %9) #7
  call void @_ZNSt10lock_guardIN8graphlab5mutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  br label %130

130:                                              ; preds = %129, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %131

131:                                              ; preds = %130
  %132 = load ptr, ptr %6, align 8
  %133 = call ptr @__cxa_begin_catch(ptr %132) #7
  %134 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.18)
          to label %135 unwind label %142

135:                                              ; preds = %131
  %136 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %134, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %137 unwind label %142

137:                                              ; preds = %135
  call void @__cxa_end_catch()
  br label %138

138:                                              ; preds = %137, %128
  store i32 0, ptr %8, align 4
  br label %139

139:                                              ; preds = %138, %126
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 8192, ptr %1) #7
  %140 = load i32, ptr %8, align 4
  switch i32 %140, label %155 [
    i32 0, label %141
    i32 1, label %141
  ]

141:                                              ; preds = %139, %139
  ret void

142:                                              ; preds = %135, %131
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %6, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %7, align 4
  invoke void @__cxa_end_catch()
          to label %146 unwind label %152

146:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 8192, ptr %1) #7
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %6, align 8
  %149 = load i32, ptr %7, align 4
  %150 = insertvalue { ptr, i32 } poison, ptr %148, 0
  %151 = insertvalue { ptr, i32 } %150, i32 %149, 1
  resume { ptr, i32 } %151

152:                                              ; preds = %142
  %153 = landingpad { ptr, i32 }
          catch ptr null
  %154 = extractvalue { ptr, i32 } %153, 0
  call void @__clang_call_terminate(ptr %154) #8
  unreachable

155:                                              ; preds = %139
  unreachable
}

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #4

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

declare i32 @backtrace(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind
declare ptr @backtrace_symbols(ptr noundef, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

declare i32 @fclose(ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10lock_guardIN8graphlab5mutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

declare ptr @__cxa_begin_catch(ptr)

; 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) #5

; 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)) #5

declare void @__cxa_end_catch()

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) #6

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 = { 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 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 #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 = { 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 #6 = { noinline noreturn nounwind uwtable "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 }
attributes #8 = { noreturn 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; 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.graphlab::mutex" = type { %union.pthread_mutex_t }
%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 }
%"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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::lock_guard" = type { ptr }

@_ZL20back_trace_file_lock = external hidden global %"class.graphlab::mutex", align 8
@_ZL21backtrace_file_number = external hidden local_unnamed_addr global i32, align 4
@_ZL11write_error = external hidden local_unnamed_addr global i8, align 1
@.str.6 = external hidden unnamed_addr constant [13 x i8], align 1
@_ZL11write_count = external hidden local_unnamed_addr global i64, align 8
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.18 = external hidden unnamed_addr constant [42 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8demangleB5cxx11PKc(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z18__print_back_tracev() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca [1024 x ptr], align 16
  %2 = alloca %"class.std::lock_guard", align 8
  %3 = alloca [1024 x i8], align 16
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  call void @llvm.lifetime.start.p0(i64 8192, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  invoke void @_ZNSt10lock_guardIN8graphlab5mutexEEC2ERS1_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(40) @_ZL20back_trace_file_lock)
          to label %5 unwind label %8

5:                                                ; preds = %0
  %6 = load i8, ptr @_ZL11write_error, align 1, !tbaa !5, !range !9, !noundef !10
  %7 = trunc nuw i8 %6 to i1
  br i1 %7, label %.critedge, label %10

8:                                                ; preds = %0
  %9 = landingpad { ptr, i32 }
          catch ptr null
  br label %59

10:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %3) #9
  %11 = load i32, ptr @_ZL21backtrace_file_number, align 4, !tbaa !11
  %12 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %11) #9
  %13 = load i64, ptr @_ZL11write_count, align 8, !tbaa !13
  %14 = icmp eq i64 %13, 0
  %.str.7..str.8 = select i1 %14, ptr @.str.7, ptr @.str.8
  %15 = call noalias ptr @fopen(ptr noundef nonnull %3, ptr noundef nonnull %.str.7..str.8)
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %18, label %21

16:                                               ; preds = %21
  %17 = landingpad { ptr, i32 }
          catch ptr null
  br label %58

18:                                               ; preds = %10
  %19 = load ptr, ptr @stderr, align 8, !tbaa !15
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.9) #10
  store i8 1, ptr @_ZL11write_error, align 1, !tbaa !5
  br label %57

21:                                               ; preds = %10
  %22 = load i64, ptr @_ZL11write_count, align 8, !tbaa !13
  %23 = add i64 %22, 1
  store i64 %23, ptr @_ZL11write_count, align 8, !tbaa !13
  %24 = invoke i32 @backtrace(ptr noundef nonnull %1, i32 noundef 1024)
          to label %25 unwind label %16

25:                                               ; preds = %21
  %26 = sext i32 %24 to i64
  %27 = call ptr @backtrace_symbols(ptr noundef nonnull %1, i32 noundef %24) #9
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.10) #9
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.11) #9
  %.not47 = icmp eq i32 %24, 0
  br i1 %.not47, label %._crit_edge42.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %25, %.lr.ph
  %.03538 = phi i64 [ %33, %.lr.ph ], [ 0, %25 ]
  %30 = getelementptr inbounds [1024 x ptr], ptr %1, i64 0, i64 %.03538
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.12, ptr noundef %31) #9
  %33 = add nuw i64 %.03538, 1
  %exitcond.not = icmp eq i64 %33, %26
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

._crit_edge:                                      ; preds = %.lr.ph
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.13) #9
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.11) #9
  br i1 %.not47, label %._crit_edge46.critedge, label %.lr.ph41

.lr.ph41:                                         ; preds = %._crit_edge, %.lr.ph41
  %.13639 = phi i64 [ %39, %.lr.ph41 ], [ 0, %._crit_edge ]
  %36 = getelementptr inbounds ptr, ptr %27, i64 %.13639
  %37 = load ptr, ptr %36, align 8, !tbaa !15
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.14, ptr noundef %37) #9
  %39 = add nuw i64 %.13639, 1
  %exitcond50.not = icmp eq i64 %39, %26
  br i1 %exitcond50.not, label %._crit_edge42, label %.lr.ph41, !llvm.loop !19

._crit_edge42.critedge:                           ; preds = %25
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.13) #9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.11) #9
  br label %._crit_edge42

._crit_edge42:                                    ; preds = %.lr.ph41, %._crit_edge42.critedge
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.15) #9
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.11) #9
  br i1 %.not47, label %._crit_edge46, label %.lr.ph45

.lr.ph45:                                         ; preds = %._crit_edge42, %46
  %.243 = phi i64 [ %49, %46 ], [ 0, %._crit_edge42 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #9
  %44 = getelementptr inbounds ptr, ptr %27, i64 %.243
  %45 = load ptr, ptr %44, align 8, !tbaa !15
  invoke void @_Z8demangleB5cxx11PKc(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, ptr noundef %45)
          to label %46 unwind label %50

46:                                               ; preds = %.lr.ph45
  %47 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.14, ptr noundef %47) #9
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #9
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  %49 = add nuw i64 %.243, 1
  %exitcond51.not = icmp eq i64 %49, %26
  br i1 %exitcond51.not, label %._crit_edge46, label %.lr.ph45, !llvm.loop !20

50:                                               ; preds = %.lr.ph45
  %51 = landingpad { ptr, i32 }
          catch ptr null
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #9
  br label %58

._crit_edge46.critedge:                           ; preds = %._crit_edge
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.15) #9
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.11) #9
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %46, %._crit_edge46.critedge, %._crit_edge42
  call void @free(ptr noundef %27) #9
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.16) #9
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.17) #9
  %56 = call i32 @fclose(ptr noundef nonnull %15)
  br label %57

57:                                               ; preds = %._crit_edge46, %18
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #9
  call void @_ZNSt10lock_guardIN8graphlab5mutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  br label %65

58:                                               ; preds = %50, %16
  %.pn = phi { ptr, i32 } [ %51, %50 ], [ %17, %16 ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %3) #9
  call void @_ZNSt10lock_guardIN8graphlab5mutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #9
  br label %59

59:                                               ; preds = %58, %8
  %.pn.pn = phi { ptr, i32 } [ %.pn, %58 ], [ %9, %8 ]
  %.134 = extractvalue { ptr, i32 } %.pn.pn, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  %60 = call ptr @__cxa_begin_catch(ptr %.134) #9
  %61 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.18)
          to label %62 unwind label %66

62:                                               ; preds = %59
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %64 unwind label %66

64:                                               ; preds = %62
  call void @__cxa_end_catch()
  br label %65

.critedge:                                        ; preds = %5
  call void @_ZNSt10lock_guardIN8graphlab5mutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  br label %65

65:                                               ; preds = %57, %64, %.critedge
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %1) #9
  ret void

66:                                               ; preds = %62, %59
  %67 = landingpad { ptr, i32 }
          cleanup
  invoke void @__cxa_end_catch()
          to label %68 unwind label %69

68:                                               ; preds = %66
  call void @llvm.lifetime.end.p0(i64 8192, ptr nonnull %1) #9
  resume { ptr, i32 } %67

69:                                               ; preds = %66
  %70 = landingpad { ptr, i32 }
          catch ptr null
  %71 = extractvalue { ptr, i32 } %70, 0
  call void @__clang_call_terminate(ptr %71) #11
  unreachable
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #4

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

declare i32 @backtrace(ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare ptr @backtrace_symbols(ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt10lock_guardIN8graphlab5mutexEED2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

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

; 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)) #7

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: noinline noreturn nounwind uwtable
declare hidden void @__clang_call_terminate(ptr noundef) local_unnamed_addr #8

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 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = { 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 = { 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 #8 = { noinline noreturn nounwind uwtable "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 = { cold nounwind }
attributes #11 = { noreturn 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"any pointer", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass