; LLVM IR from ekoontz/graphlab :: src/graphlab/logger/logger.ll (ZN11file_logger4_logEiPKcS1_iS1_z)

; 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 }
%struct.__va_list_tag = type { i32, i32, ptr, ptr }
%class.file_logger = type <{ %"class.std::basic_ofstream", %"class.std::__cxx11::basic_string", %"class.std::__cxx11::basic_stringstream", i32, i8, i8, [2 x i8], i32, [4 x i8] }>
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%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_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.0 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.0 = type { i64, [8 x i8] }
%"class.std::__cxx11::basic_stringstream" = type { %"class.std::basic_iostream.base", %"class.std::__cxx11::basic_stringbuf", %"class.std::basic_ios" }
%"class.std::basic_iostream.base" = type { %"class.std::basic_istream.base", %"class.std::basic_ostream.base" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::__cxx11::basic_stringbuf" = type { %"class.std::basic_streambuf", i32, %"class.std::__cxx11::basic_string" }

@messages = external dso_local global [4 x ptr], align 16
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z9textcolorP8_IO_FILEii(ptr noundef, i32 noundef, i32 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: mustprogress nounwind uwtable
declare dso_local void @_Z11reset_colorP8_IO_FILE(ptr noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11file_logger4_logEiPKcS1_iS1_z(ptr noundef nonnull align 8 dereferenceable(948) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr noundef %5, ...) #2 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca [1 x %struct.__va_list_tag], align 16
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  %19 = load ptr, ptr %7, align 8
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = icmp sge i32 %20, 0
  br i1 %21, label %22, label %137

22:                                               ; preds = %6
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = icmp sle i32 %23, 3
  br i1 %24, label %25, label %137

25:                                               ; preds = %22
  %26 = load i32, ptr %8, align 4, !tbaa !9
  %27 = getelementptr inbounds %class.file_logger, ptr %19, i32 0, i32 7
  %28 = load i32, ptr %27, align 8, !tbaa !11
  %29 = icmp sge i32 %26, %28
  br i1 %29, label %30, label %137

30:                                               ; preds = %25
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = call noundef ptr @strrchr(ptr noundef %31, i32 noundef 47) #9
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %35

34:                                               ; preds = %30
  br label %38

35:                                               ; preds = %30
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 -1
  br label %38

38:                                               ; preds = %35, %34
  %39 = phi ptr [ %32, %34 ], [ %37, %35 ]
  %40 = getelementptr inbounds i8, ptr %39, i64 1
  store ptr %40, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [4 x ptr], ptr @messages, i64 0, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = load ptr, ptr %10, align 8, !tbaa !5
  %47 = load i32, ptr %11, align 4, !tbaa !9
  %48 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef null, i64 noundef 0, ptr noundef @.str.8, ptr noundef %44, ptr noundef %45, ptr noundef %46, i32 noundef %47) #10
  %49 = sext i32 %48 to i64
  store i64 %49, ptr %13, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #10
  %50 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %14, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %50)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %14, i64 0, i64 0
  %53 = call i32 @vsnprintf(ptr noundef null, i64 noundef 0, ptr noundef %51, ptr noundef %52) #10
  %54 = sext i32 %53 to i64
  store i64 %54, ptr %15, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #10
  %55 = load i64, ptr %13, align 8, !tbaa !29
  %56 = load i64, ptr %15, align 8, !tbaa !29
  %57 = add i64 %55, %56
  store i64 %57, ptr %16, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #10
  %58 = load i64, ptr %16, align 8, !tbaa !29
  %59 = add i64 %58, 3
  %60 = call noalias noundef nonnull ptr @_Znam(i64 noundef %59) #11
  store ptr %60, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #10
  %61 = load ptr, ptr %17, align 8, !tbaa !5
  %62 = load i64, ptr %16, align 8, !tbaa !29
  %63 = add i64 %62, 1
  %64 = load i32, ptr %8, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [4 x ptr], ptr @messages, i64 0, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %61, i64 noundef %63, ptr noundef @.str.8, ptr noundef %67, ptr noundef %68, ptr noundef %69, i32 noundef %70) #10
  store i32 %71, ptr %18, align 4, !tbaa !9
  %72 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %14, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %72)
  %73 = load ptr, ptr %17, align 8, !tbaa !5
  %74 = load i32, ptr %18, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds i8, ptr %73, i64 %75
  %77 = load i64, ptr %16, align 8, !tbaa !29
  %78 = load i32, ptr %18, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = sub i64 %77, %79
  %81 = add i64 %80, 1
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %14, i64 0, i64 0
  %84 = call i32 @vsnprintf(ptr noundef %76, i64 noundef %81, ptr noundef %82, ptr noundef %83) #10
  %85 = load i32, ptr %18, align 4, !tbaa !9
  %86 = add nsw i32 %85, %84
  store i32 %86, ptr %18, align 4, !tbaa !9
  %87 = load ptr, ptr %17, align 8, !tbaa !5
  %88 = load i32, ptr %18, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %87, i64 %89
  %91 = load i64, ptr %16, align 8, !tbaa !29
  %92 = load i32, ptr %18, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = sub i64 %91, %93
  %95 = add i64 %94, 3
  %96 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %90, i64 noundef %95, ptr noundef @.str.9) #10
  %97 = getelementptr inbounds %class.file_logger, ptr %19, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !30
  %99 = getelementptr i8, ptr %98, i64 -24
  %100 = load i64, ptr %99, align 8
  %101 = getelementptr inbounds i8, ptr %97, i64 %100
  %102 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264) %101)
  br i1 %102, label %103, label %107

103:                                              ; preds = %38
  %104 = getelementptr inbounds %class.file_logger, ptr %19, i32 0, i32 0
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  %106 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %104, ptr noundef %105)
  br label %107

107:                                              ; preds = %103, %38
  %108 = getelementptr inbounds %class.file_logger, ptr %19, i32 0, i32 5
  %109 = load i8, ptr %108, align 1, !tbaa !32, !range !33, !noundef !34
  %110 = trunc i8 %109 to i1
  br i1 %110, label %111, label %132

111:                                              ; preds = %107
  %112 = load i32, ptr %8, align 4, !tbaa !9
  %113 = icmp eq i32 %112, 3
  br i1 %113, label %114, label %116

114:                                              ; preds = %111
  %115 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @_Z9textcolorP8_IO_FILEii(ptr noundef %115, i32 noundef 1, i32 noundef 1)
  br label %128

116:                                              ; preds = %111
  %117 = load i32, ptr %8, align 4, !tbaa !9
  %118 = icmp eq i32 %117, 2
  br i1 %118, label %119, label %121

119:                                              ; preds = %116
  %120 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @_Z9textcolorP8_IO_FILEii(ptr noundef %120, i32 noundef 1, i32 noundef 1)
  br label %127

121:                                              ; preds = %116
  %122 = load i32, ptr %8, align 4, !tbaa !9
  %123 = icmp eq i32 %122, 1
  br i1 %123, label %124, label %126

124:                                              ; preds = %121
  %125 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @_Z9textcolorP8_IO_FILEii(ptr noundef %125, i32 noundef 1, i32 noundef 2)
  br label %126

126:                                              ; preds = %124, %121
  br label %127

127:                                              ; preds = %126, %119
  br label %128

128:                                              ; preds = %127, %114
  %129 = load ptr, ptr %17, align 8, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef %129)
  %131 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @_Z11reset_colorP8_IO_FILE(ptr noundef %131)
  br label %132

132:                                              ; preds = %128, %107
  %133 = load ptr, ptr %17, align 8, !tbaa !5
  %134 = icmp eq ptr %133, null
  br i1 %134, label %136, label %135

135:                                              ; preds = %132
  call void @_ZdaPv(ptr noundef %133) #12
  br label %136

136:                                              ; preds = %135, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  br label %137

137:                                              ; preds = %136, %25, %22, %6
  ret void
}

; Function Attrs: nounwind willreturn memory(read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) #3

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #5

; Function Attrs: nounwind
declare i32 @vsnprintf(ptr noundef, i64 noundef, ptr noundef, ptr noundef) #4

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

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #8

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = { 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 #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 944}
!12 = !{!"_ZTS11file_logger", !13, i64 0, !23, i64 512, !25, i64 544, !10, i64 936, !19, i64 940, !19, i64 941, !10, i64 944}
!13 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !14, i64 0, !15, i64 8}
!14 = !{!"_ZTSSo"}
!15 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !16, i64 0, !7, i64 64, !18, i64 104, !20, i64 120, !21, i64 124, !21, i64 132, !21, i64 140, !6, i64 152, !22, i64 160, !19, i64 168, !19, i64 169, !19, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !19, i64 192, !6, i64 200, !6, i64 208, !22, i64 216, !6, i64 224, !6, i64 232}
!16 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !17, i64 56}
!17 = !{!"_ZTSSt6locale", !6, i64 0}
!18 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !19, i64 8}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!21 = !{!"_ZTS11__mbstate_t", !10, i64 0, !7, i64 4}
!22 = !{!"long", !7, i64 0}
!23 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !24, i64 0, !22, i64 8, !7, i64 16}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!25 = !{!"_ZTSNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE", !26, i64 0, !28, i64 24}
!26 = !{!"_ZTSSd", !27, i64 0, !14, i64 16}
!27 = !{!"_ZTSSi", !22, i64 8}
!28 = !{!"_ZTSNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE", !16, i64 0, !20, i64 64, !23, i64 72}
!29 = !{!22, !22, i64 0}
!30 = !{!31, !31, i64 0}
!31 = !{!"vtable pointer", !8, i64 0}
!32 = !{!12, !19, i64 941}
!33 = !{i8 0, i8 2}
!34 = !{}


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

@messages = external dso_local local_unnamed_addr global [4 x ptr], align 16
@.str.8 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@switch.table._ZN11file_logger4_logEiPKcS1_iS1_z = private unnamed_addr constant [3 x i32] [i32 2, i32 1, i32 1], align 4

; Function Attrs: mustprogress nounwind uwtable
declare noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z9textcolorP8_IO_FILEii(ptr noundef, i32 noundef, i32 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 uwtable
declare dso_local void @_Z11reset_colorP8_IO_FILE(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11file_logger4_logEiPKcS1_iS1_z(ptr noundef nonnull align 8 dereferenceable(948) %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, ptr nocapture noundef readonly %5, ...) local_unnamed_addr #2 align 2 {
  %7 = alloca [1 x %struct.__va_list_tag], align 16
  %or.cond = icmp ugt i32 %1, 3
  %8 = getelementptr inbounds i8, ptr %0, i64 944
  %9 = load i32, ptr %8, align 8
  %.not = icmp sgt i32 %9, %1
  %or.cond38 = select i1 %or.cond, i1 true, i1 %.not
  br i1 %or.cond38, label %56, label %10

10:                                               ; preds = %6
  %11 = tail call noundef ptr @strrchr(ptr noundef nonnull dereferenceable(1) %2, i32 noundef 47) #9
  %.not36 = icmp eq ptr %11, null
  %12 = getelementptr inbounds i8, ptr %2, i64 -1
  %13 = select i1 %.not36, ptr %12, ptr %11
  %14 = getelementptr inbounds i8, ptr %13, i64 1
  %15 = zext nneg i32 %1 to i64
  %16 = getelementptr inbounds [4 x ptr], ptr @messages, i64 0, i64 %15
  %17 = load ptr, ptr %16, align 8, !tbaa !5
  %18 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef null, i64 noundef 0, ptr noundef nonnull @.str.8, ptr noundef %17, ptr noundef nonnull %14, ptr noundef %3, i32 noundef %4) #10
  %19 = sext i32 %18 to i64
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #10
  call void @llvm.va_start.p0(ptr nonnull %7)
  %20 = call i32 @vsnprintf(ptr noundef null, i64 noundef 0, ptr noundef %5, ptr noundef nonnull %7) #10
  %21 = sext i32 %20 to i64
  %22 = add nsw i64 %21, %19
  %23 = add nsw i64 %22, 3
  %24 = call noalias noundef nonnull ptr @_Znam(i64 noundef %23) #11
  %25 = add nsw i64 %22, 1
  %26 = load ptr, ptr %16, align 8, !tbaa !5
  %27 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull %24, i64 noundef %25, ptr noundef nonnull @.str.8, ptr noundef %26, ptr noundef nonnull %14, ptr noundef %3, i32 noundef %4) #10
  call void @llvm.va_start.p0(ptr nonnull %7)
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i8, ptr %24, i64 %28
  %30 = sub nsw i64 %25, %28
  %31 = call i32 @vsnprintf(ptr noundef nonnull %29, i64 noundef %30, ptr noundef %5, ptr noundef nonnull %7) #10
  %32 = add nsw i32 %31, %27
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds i8, ptr %24, i64 %33
  %35 = sub nsw i64 %23, %33
  %36 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull %34, i64 noundef %35, ptr noundef nonnull @.str.9) #10
  %37 = load ptr, ptr %0, align 8, !tbaa !9
  %38 = getelementptr i8, ptr %37, i64 -24
  %39 = load i64, ptr %38, align 8
  %40 = getelementptr inbounds i8, ptr %0, i64 %39
  %41 = call noundef zeroext i1 @_ZNKSt9basic_iosIcSt11char_traitsIcEE4goodEv(ptr noundef nonnull align 8 dereferenceable(264) %40)
  br i1 %41, label %42, label %44

42:                                               ; preds = %10
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull %24)
  br label %44

44:                                               ; preds = %42, %10
  %45 = getelementptr inbounds i8, ptr %0, i64 941
  %46 = load i8, ptr %45, align 1, !tbaa !11, !range !30, !noundef !31
  %47 = trunc nuw i8 %46 to i1
  br i1 %47, label %48, label %55

48:                                               ; preds = %44
  %switch.tableidx = add nsw i32 %1, -1
  %49 = icmp ult i32 %switch.tableidx, 3
  br i1 %49, label %switch.lookup, label %52

switch.lookup:                                    ; preds = %48
  %50 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [3 x i32], ptr @switch.table._ZN11file_logger4_logEiPKcS1_iS1_z, i64 0, i64 %50
  %switch.load = load i32, ptr %switch.gep, align 4
  %51 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @_Z9textcolorP8_IO_FILEii(ptr noundef %51, i32 noundef 1, i32 noundef %switch.load)
  br label %52

52:                                               ; preds = %48, %switch.lookup
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull %24)
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  call void @_Z11reset_colorP8_IO_FILE(ptr noundef %54)
  br label %55

55:                                               ; preds = %44, %52
  call void @_ZdaPv(ptr noundef nonnull %24) #12
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #10
  br label %56

56:                                               ; preds = %55, %6
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare noundef ptr @strrchr(ptr noundef, i32 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #5

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #6

; 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: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #8

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #6 = { 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 #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 = { 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 #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind }
attributes #11 = { builtin allocsize(0) }
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, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !19, i64 941}
!12 = !{!"_ZTS11file_logger", !13, i64 0, !24, i64 512, !26, i64 544, !22, i64 936, !19, i64 940, !19, i64 941, !22, i64 944}
!13 = !{!"_ZTSSt14basic_ofstreamIcSt11char_traitsIcEE", !14, i64 0, !15, i64 8}
!14 = !{!"_ZTSSo"}
!15 = !{!"_ZTSSt13basic_filebufIcSt11char_traitsIcEE", !16, i64 0, !7, i64 64, !18, i64 104, !20, i64 120, !21, i64 124, !21, i64 132, !21, i64 140, !6, i64 152, !23, i64 160, !19, i64 168, !19, i64 169, !19, i64 170, !7, i64 171, !6, i64 176, !6, i64 184, !19, i64 192, !6, i64 200, !6, i64 208, !23, i64 216, !6, i64 224, !6, i64 232}
!16 = !{!"_ZTSSt15basic_streambufIcSt11char_traitsIcEE", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !17, i64 56}
!17 = !{!"_ZTSSt6locale", !6, i64 0}
!18 = !{!"_ZTSSt12__basic_fileIcE", !6, i64 0, !19, i64 8}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSSt13_Ios_Openmode", !7, i64 0}
!21 = !{!"_ZTS11__mbstate_t", !22, i64 0, !7, i64 4}
!22 = !{!"int", !7, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE", !25, i64 0, !23, i64 8, !7, i64 16}
!25 = !{!"_ZTSNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_Alloc_hiderE", !6, i64 0}
!26 = !{!"_ZTSNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE", !27, i64 0, !29, i64 24}
!27 = !{!"_ZTSSd", !28, i64 0, !14, i64 16}
!28 = !{!"_ZTSSi", !23, i64 8}
!29 = !{!"_ZTSNSt7__cxx1115basic_stringbufIcSt11char_traitsIcESaIcEEE", !16, i64 0, !20, i64 64, !24, i64 72}
!30 = !{i8 0, i8 2}
!31 = !{}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass