; LLVM IR from Overload-Technologies/Overload :: Dependencies/tracy/client/TracySysTrace.ll (ZN5tracy23SysTraceGetExternalNameEmRPKcS2_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.tracy::QueueItem" = type { %"struct.tracy::QueueHeader", %union.anon.8 }
%"struct.tracy::QueueHeader" = type { %union.anon.7 }
%union.anon.7 = type { i8 }
%union.anon.8 = type <{ %"struct.tracy::QueuePlotDataInt", [7 x i8] }>
%"struct.tracy::QueuePlotDataInt" = type { %"struct.tracy::QueuePlotDataBase", i64 }
%"struct.tracy::QueuePlotDataBase" = type { i64, i64 }
%"struct.tracy::QueueTidToPid" = type { i64, i64 }

@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [14 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #1

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

declare noundef ptr @_ZN5tracy8GetTokenEv() #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN5tracy10moodycamel15ConcurrentQueueINS_9QueueItemENS0_28ConcurrentQueueDefaultTraitsEE16ExplicitProducer14get_tail_indexEv(ptr noundef nonnull align 8 dereferenceable(136)) #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN5tracy10moodycamel15ConcurrentQueueINS_9QueueItemENS0_28ConcurrentQueueDefaultTraitsEE16ExplicitProducer13enqueue_beginERm(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(8)) #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN5tracy8MemWriteINS_9QueueTypeEEEvPvT_(ptr noundef, i8 noundef zeroext) #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN5tracy8MemWriteImEEvPvT_(ptr noundef, i64 noundef) #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZNSt13__atomic_baseImE5storeEmSt12memory_order(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i32 noundef) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN5tracyL15tracy_free_fastEPv(ptr noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5tracy23SysTraceGetExternalNameEmRPKcS2_(i64 noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #6 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [256 x i8], align 16
  %9 = alloca [256 x i8], align 16
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca [256 x i8], align 16
  %21 = alloca i64, align 8
  %22 = alloca i32, align 4
  store i64 %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #9
  call void @llvm.lifetime.start.p0(i64 256, ptr %8) #9
  %23 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %24 = load i64, ptr %4, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %23, ptr noundef @.str.17, i64 noundef %24) #9
  %26 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %27 = call noalias ptr @fopen(ptr noundef %26, ptr noundef @.str.18)
  store ptr %27, ptr %7, align 8, !tbaa !9
  %28 = load ptr, ptr %7, align 8, !tbaa !9
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %53

30:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 256, ptr %9) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #9
  %31 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  %32 = load ptr, ptr %7, align 8, !tbaa !9
  %33 = call i64 @fread(ptr noundef %31, i64 noundef 1, i64 noundef 256, ptr noundef %32)
  store i64 %33, ptr %10, align 8, !tbaa !5
  %34 = load i64, ptr %10, align 8, !tbaa !5
  %35 = icmp ugt i64 %34, 0
  br i1 %35, label %36, label %47

36:                                               ; preds = %30
  %37 = load i64, ptr %10, align 8, !tbaa !5
  %38 = sub i64 %37, 1
  %39 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !11
  %41 = sext i8 %40 to i32
  %42 = icmp eq i32 %41, 10
  br i1 %42, label %43, label %47

43:                                               ; preds = %36
  %44 = load i64, ptr %10, align 8, !tbaa !5
  %45 = sub i64 %44, 1
  %46 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 %45
  store i8 0, ptr %46, align 1, !tbaa !11
  br label %47

47:                                               ; preds = %43, %36, %30
  %48 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  %49 = call noundef ptr @_ZN5tracyL10CopyStringEPKc(ptr noundef %48)
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  store ptr %49, ptr %50, align 8, !tbaa !9
  %51 = load ptr, ptr %7, align 8, !tbaa !9
  %52 = call i32 @fclose(ptr noundef %51)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #9
  call void @llvm.lifetime.end.p0(i64 256, ptr %9) #9
  br label %56

53:                                               ; preds = %3
  %54 = call noundef ptr @_ZN5tracyL10CopyStringEPKcm(ptr noundef @.str.19, i64 noundef 3)
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  store ptr %54, ptr %55, align 8, !tbaa !9
  br label %56

56:                                               ; preds = %53, %47
  %57 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %58 = load i64, ptr %4, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %57, ptr noundef @.str.20, i64 noundef %58) #9
  %60 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %61 = call noalias ptr @fopen(ptr noundef %60, ptr noundef @.str.18)
  store ptr %61, ptr %7, align 8, !tbaa !9
  %62 = load ptr, ptr %7, align 8, !tbaa !9
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %169

64:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %65 = call noundef ptr @_ZN5tracyL17tracy_malloc_fastEm(i64 noundef 8192)
  store ptr %65, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %66 = load ptr, ptr %11, align 8, !tbaa !9
  %67 = load ptr, ptr %7, align 8, !tbaa !9
  %68 = call i64 @fread(ptr noundef %66, i64 noundef 1, i64 noundef 8192, ptr noundef %67)
  store i64 %68, ptr %12, align 8, !tbaa !5
  %69 = load ptr, ptr %7, align 8, !tbaa !9
  %70 = call i32 @fclose(ptr noundef %69)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 -1, ptr %13, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #9
  %71 = load ptr, ptr %11, align 8, !tbaa !9
  store ptr %71, ptr %14, align 8, !tbaa !9
  br label %72

72:                                               ; preds = %105, %64
  %73 = load ptr, ptr %14, align 8, !tbaa !9
  %74 = call i32 @memcmp(ptr noundef @.str.21, ptr noundef %73, i64 noundef 6) #10
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %80

76:                                               ; preds = %72
  %77 = load ptr, ptr %14, align 8, !tbaa !9
  %78 = getelementptr inbounds i8, ptr %77, i64 6
  %79 = call i32 @atoi(ptr noundef %78) #10
  store i32 %79, ptr %13, align 4, !tbaa !12
  br label %108

80:                                               ; preds = %72
  br label %81

81:                                               ; preds = %96, %80
  %82 = load ptr, ptr %14, align 8, !tbaa !9
  %83 = load ptr, ptr %11, align 8, !tbaa !9
  %84 = ptrtoint ptr %82 to i64
  %85 = ptrtoint ptr %83 to i64
  %86 = sub i64 %84, %85
  %87 = load i64, ptr %12, align 8, !tbaa !5
  %88 = icmp slt i64 %86, %87
  br i1 %88, label %89, label %94

89:                                               ; preds = %81
  %90 = load ptr, ptr %14, align 8, !tbaa !9
  %91 = load i8, ptr %90, align 1, !tbaa !11
  %92 = sext i8 %91 to i32
  %93 = icmp ne i32 %92, 10
  br label %94

94:                                               ; preds = %89, %81
  %95 = phi i1 [ false, %81 ], [ %93, %89 ]
  br i1 %95, label %96, label %99

96:                                               ; preds = %94
  %97 = load ptr, ptr %14, align 8, !tbaa !9
  %98 = getelementptr inbounds i8, ptr %97, i32 1
  store ptr %98, ptr %14, align 8, !tbaa !9
  br label %81, !llvm.loop !14

99:                                               ; preds = %94
  %100 = load ptr, ptr %14, align 8, !tbaa !9
  %101 = load i8, ptr %100, align 1, !tbaa !11
  %102 = sext i8 %101 to i32
  %103 = icmp ne i32 %102, 10
  br i1 %103, label %104, label %105

104:                                              ; preds = %99
  br label %108

105:                                              ; preds = %99
  %106 = load ptr, ptr %14, align 8, !tbaa !9
  %107 = getelementptr inbounds i8, ptr %106, i32 1
  store ptr %107, ptr %14, align 8, !tbaa !9
  br label %72, !llvm.loop !16

108:                                              ; preds = %104, %76
  %109 = load ptr, ptr %11, align 8, !tbaa !9
  call void @_ZN5tracyL15tracy_free_fastEPv(ptr noundef %109)
  %110 = load i32, ptr %13, align 4, !tbaa !12
  %111 = icmp sge i32 %110, 0
  br i1 %111, label %112, label %165

112:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #9
  %113 = load i32, ptr %13, align 4, !tbaa !12
  %114 = sext i32 %113 to i64
  store i64 %114, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #9
  %115 = call noundef ptr @_ZN5tracy8GetTokenEv()
  store ptr %115, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #9
  %116 = load ptr, ptr %17, align 8, !tbaa !9
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5tracy10moodycamel15ConcurrentQueueINS_9QueueItemENS0_28ConcurrentQueueDefaultTraitsEE16ExplicitProducer14get_tail_indexEv(ptr noundef nonnull align 8 dereferenceable(136) %116)
  store ptr %117, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #9
  %118 = load ptr, ptr %17, align 8, !tbaa !9
  %119 = call noundef ptr @_ZN5tracy10moodycamel15ConcurrentQueueINS_9QueueItemENS0_28ConcurrentQueueDefaultTraitsEE16ExplicitProducer13enqueue_beginERm(ptr noundef nonnull align 8 dereferenceable(136) %118, ptr noundef nonnull align 8 dereferenceable(8) %16)
  store ptr %119, ptr %19, align 8, !tbaa !9
  %120 = load ptr, ptr %19, align 8, !tbaa !9
  %121 = getelementptr inbounds %"struct.tracy::QueueItem", ptr %120, i32 0, i32 0
  %122 = getelementptr inbounds %"struct.tracy::QueueHeader", ptr %121, i32 0, i32 0
  call void @_ZN5tracy8MemWriteINS_9QueueTypeEEEvPvT_(ptr noundef %122, i8 noundef zeroext 83)
  %123 = load ptr, ptr %19, align 8, !tbaa !9
  %124 = getelementptr inbounds %"struct.tracy::QueueItem", ptr %123, i32 0, i32 1
  %125 = getelementptr inbounds %"struct.tracy::QueueTidToPid", ptr %124, i32 0, i32 0
  %126 = load i64, ptr %4, align 8, !tbaa !5
  call void @_ZN5tracy8MemWriteImEEvPvT_(ptr noundef %125, i64 noundef %126)
  %127 = load ptr, ptr %19, align 8, !tbaa !9
  %128 = getelementptr inbounds %"struct.tracy::QueueItem", ptr %127, i32 0, i32 1
  %129 = getelementptr inbounds %"struct.tracy::QueueTidToPid", ptr %128, i32 0, i32 1
  %130 = load i64, ptr %15, align 8, !tbaa !5
  call void @_ZN5tracy8MemWriteImEEvPvT_(ptr noundef %129, i64 noundef %130)
  %131 = load ptr, ptr %18, align 8, !tbaa !9
  %132 = load i64, ptr %16, align 8, !tbaa !5
  %133 = add i64 %132, 1
  call void @_ZNSt13__atomic_baseImE5storeEmSt12memory_order(ptr noundef nonnull align 8 dereferenceable(8) %131, i64 noundef %133, i32 noundef 3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #9
  %134 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %135 = load i32, ptr %13, align 4, !tbaa !12
  %136 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %134, ptr noundef @.str.22, i32 noundef %135) #9
  %137 = getelementptr inbounds [256 x i8], ptr %8, i64 0, i64 0
  %138 = call noalias ptr @fopen(ptr noundef %137, ptr noundef @.str.18)
  store ptr %138, ptr %7, align 8, !tbaa !9
  %139 = load ptr, ptr %7, align 8, !tbaa !9
  %140 = icmp ne ptr %139, null
  br i1 %140, label %141, label %164

141:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 256, ptr %20) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #9
  %142 = getelementptr inbounds [256 x i8], ptr %20, i64 0, i64 0
  %143 = load ptr, ptr %7, align 8, !tbaa !9
  %144 = call i64 @fread(ptr noundef %142, i64 noundef 1, i64 noundef 256, ptr noundef %143)
  store i64 %144, ptr %21, align 8, !tbaa !5
  %145 = load i64, ptr %21, align 8, !tbaa !5
  %146 = icmp ugt i64 %145, 0
  br i1 %146, label %147, label %158

147:                                              ; preds = %141
  %148 = load i64, ptr %21, align 8, !tbaa !5
  %149 = sub i64 %148, 1
  %150 = getelementptr inbounds [256 x i8], ptr %20, i64 0, i64 %149
  %151 = load i8, ptr %150, align 1, !tbaa !11
  %152 = sext i8 %151 to i32
  %153 = icmp eq i32 %152, 10
  br i1 %153, label %154, label %158

154:                                              ; preds = %147
  %155 = load i64, ptr %21, align 8, !tbaa !5
  %156 = sub i64 %155, 1
  %157 = getelementptr inbounds [256 x i8], ptr %20, i64 0, i64 %156
  store i8 0, ptr %157, align 1, !tbaa !11
  br label %158

158:                                              ; preds = %154, %147, %141
  %159 = getelementptr inbounds [256 x i8], ptr %20, i64 0, i64 0
  %160 = call noundef ptr @_ZN5tracyL14CopyStringFastEPKc(ptr noundef %159)
  %161 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %160, ptr %161, align 8, !tbaa !9
  %162 = load ptr, ptr %7, align 8, !tbaa !9
  %163 = call i32 @fclose(ptr noundef %162)
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #9
  call void @llvm.lifetime.end.p0(i64 256, ptr %20) #9
  br label %166

164:                                              ; preds = %112
  br label %165

165:                                              ; preds = %164, %108
  store i32 0, ptr %22, align 4
  br label %166

166:                                              ; preds = %165, %158
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  %167 = load i32, ptr %22, align 4
  switch i32 %167, label %172 [
    i32 0, label %168
  ]

168:                                              ; preds = %166
  br label %169

169:                                              ; preds = %168, %56
  %170 = call noundef ptr @_ZN5tracyL14CopyStringFastEPKcm(ptr noundef @.str.19, i64 noundef 3)
  %171 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %170, ptr %171, align 8, !tbaa !9
  store i32 0, ptr %22, align 4
  br label %172

172:                                              ; preds = %169, %166
  call void @llvm.lifetime.end.p0(i64 256, ptr %8) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #9
  %173 = load i32, ptr %22, align 4
  switch i32 %173, label %175 [
    i32 0, label %174
    i32 1, label %174
  ]

174:                                              ; preds = %172, %172
  ret void

175:                                              ; preds = %172
  unreachable
}

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

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden noundef ptr @_ZN5tracyL10CopyStringEPKc(ptr noundef) #4

declare i32 @fclose(ptr noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN5tracyL10CopyStringEPKcm(ptr noundef, i64 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN5tracyL17tracy_malloc_fastEm(i64 noundef) #5

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #8

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden noundef ptr @_ZN5tracyL14CopyStringFastEPKc(ptr noundef) #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN5tracyL14CopyStringFastEPKcm(ptr noundef, i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nounwind willreturn memory(read) 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { alwaysinline 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 = { alwaysinline 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 = { inlinehint 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 #6 = { 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 #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 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [14 x i8], align 1

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #1

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

declare noundef ptr @_ZN5tracy8GetTokenEv() local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN5tracy10moodycamel15ConcurrentQueueINS_9QueueItemENS0_28ConcurrentQueueDefaultTraitsEE16ExplicitProducer14get_tail_indexEv(ptr noundef nonnull align 8 dereferenceable(136)) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef ptr @_ZN5tracy10moodycamel15ConcurrentQueueINS_9QueueItemENS0_28ConcurrentQueueDefaultTraitsEE16ExplicitProducer13enqueue_beginERm(ptr noundef nonnull align 8 dereferenceable(136), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN5tracy8MemWriteINS_9QueueTypeEEEvPvT_(ptr noundef, i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZN5tracy8MemWriteImEEvPvT_(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local void @_ZNSt13__atomic_baseImE5storeEmSt12memory_order(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZN5tracyL15tracy_free_fastEPv(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5tracy23SysTraceGetExternalNameEmRPKcS2_(i64 noundef %0, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %1, ptr nocapture noundef nonnull writeonly align 8 dereferenceable(8) %2) local_unnamed_addr #6 {
  %4 = alloca [256 x i8], align 16
  %5 = alloca [256 x i8], align 16
  %6 = alloca i64, align 8
  %7 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #9
  %8 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.17, i64 noundef %0) #9
  %9 = call noalias ptr @fopen(ptr noundef nonnull %4, ptr noundef nonnull @.str.18)
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %21, label %10

10:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #9
  %11 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 1, i64 noundef 256, ptr noundef nonnull %9)
  %.not51 = icmp eq i64 %11, 0
  br i1 %.not51, label %18, label %12

12:                                               ; preds = %10
  %13 = add i64 %11, -1
  %14 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 %13
  %15 = load i8, ptr %14, align 1, !tbaa !5
  %16 = icmp eq i8 %15, 10
  br i1 %16, label %17, label %18

17:                                               ; preds = %12
  store i8 0, ptr %14, align 1, !tbaa !5
  br label %18

18:                                               ; preds = %17, %12, %10
  %19 = call noundef ptr @_ZN5tracyL10CopyStringEPKc(ptr noundef nonnull %5)
  store ptr %19, ptr %1, align 8, !tbaa !8
  %20 = call i32 @fclose(ptr noundef nonnull %9)
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #9
  br label %23

21:                                               ; preds = %3
  %22 = tail call noundef ptr @_ZN5tracyL10CopyStringEPKcm(ptr noundef nonnull @.str.19, i64 noundef 3)
  store ptr %22, ptr %1, align 8, !tbaa !8
  br label %23

23:                                               ; preds = %21, %18
  %24 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.20, i64 noundef %0) #9
  %25 = call noalias ptr @fopen(ptr noundef nonnull %4, ptr noundef nonnull @.str.18)
  %.not52 = icmp eq ptr %25, null
  br i1 %.not52, label %67, label %26

26:                                               ; preds = %23
  %27 = call noundef ptr @_ZN5tracyL17tracy_malloc_fastEm(i64 noundef 8192)
  %28 = call i64 @fread(ptr noundef %27, i64 noundef 1, i64 noundef 8192, ptr noundef nonnull %25)
  %29 = call i32 @fclose(ptr noundef nonnull %25)
  %bcmp65 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) @.str.21, ptr noundef nonnull dereferenceable(6) %27, i64 6)
  %30 = icmp eq i32 %bcmp65, 0
  br i1 %30, label %._crit_edge, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %26
  %31 = ptrtoint ptr %27 to i64
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %.critedge.thread
  %.04566 = phi ptr [ %27, %.preheader.lr.ph ], [ %41, %.critedge.thread ]
  %32 = ptrtoint ptr %.04566 to i64
  %33 = sub i64 %32, %31
  %34 = icmp slt i64 %33, %28
  br i1 %34, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %.preheader, %36
  %.164 = phi ptr [ %37, %36 ], [ %.04566, %.preheader ]
  %35 = load i8, ptr %.164, align 1, !tbaa !5
  %.not53 = icmp eq i8 %35, 10
  br i1 %.not53, label %.critedge.thread, label %36

36:                                               ; preds = %.lr.ph
  %37 = getelementptr inbounds i8, ptr %.164, i64 1
  %38 = ptrtoint ptr %37 to i64
  %39 = sub i64 %38, %31
  %40 = icmp slt i64 %39, %28
  br i1 %40, label %.lr.ph, label %.critedge, !llvm.loop !10

.critedge:                                        ; preds = %36, %.preheader
  %.1.lcssa = phi ptr [ %.04566, %.preheader ], [ %37, %36 ]
  %.pr = load i8, ptr %.1.lcssa, align 1, !tbaa !5
  %.not54 = icmp eq i8 %.pr, 10
  br i1 %.not54, label %.critedge.thread, label %.thread

.thread:                                          ; preds = %.critedge
  call void @_ZN5tracyL15tracy_free_fastEPv(ptr noundef %27)
  br label %67

.critedge.thread:                                 ; preds = %.lr.ph, %.critedge
  %.162 = phi ptr [ %.1.lcssa, %.critedge ], [ %.164, %.lr.ph ]
  %41 = getelementptr inbounds i8, ptr %.162, i64 1
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) @.str.21, ptr noundef nonnull dereferenceable(6) %41, i64 6)
  %42 = icmp eq i32 %bcmp, 0
  br i1 %42, label %._crit_edge, label %.preheader, !llvm.loop !12

._crit_edge:                                      ; preds = %.critedge.thread, %26
  %.045.lcssa = phi ptr [ %27, %26 ], [ %41, %.critedge.thread ]
  %43 = getelementptr inbounds i8, ptr %.045.lcssa, i64 6
  %44 = call i32 @atoi(ptr nocapture noundef %43) #10
  call void @_ZN5tracyL15tracy_free_fastEPv(ptr noundef %27)
  %45 = icmp sgt i32 %44, -1
  br i1 %45, label %46, label %67

46:                                               ; preds = %._crit_edge
  %47 = zext nneg i32 %44 to i64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #9
  %48 = call noundef ptr @_ZN5tracy8GetTokenEv()
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5tracy10moodycamel15ConcurrentQueueINS_9QueueItemENS0_28ConcurrentQueueDefaultTraitsEE16ExplicitProducer14get_tail_indexEv(ptr noundef nonnull align 8 dereferenceable(136) %48)
  %50 = call noundef ptr @_ZN5tracy10moodycamel15ConcurrentQueueINS_9QueueItemENS0_28ConcurrentQueueDefaultTraitsEE16ExplicitProducer13enqueue_beginERm(ptr noundef nonnull align 8 dereferenceable(136) %48, ptr noundef nonnull align 8 dereferenceable(8) %6)
  call void @_ZN5tracy8MemWriteINS_9QueueTypeEEEvPvT_(ptr noundef %50, i8 noundef zeroext 83)
  %51 = getelementptr inbounds i8, ptr %50, i64 1
  call void @_ZN5tracy8MemWriteImEEvPvT_(ptr noundef nonnull %51, i64 noundef %0)
  %52 = getelementptr inbounds i8, ptr %50, i64 9
  call void @_ZN5tracy8MemWriteImEEvPvT_(ptr noundef nonnull %52, i64 noundef %47)
  %53 = load i64, ptr %6, align 8, !tbaa !13
  %54 = add i64 %53, 1
  call void @_ZNSt13__atomic_baseImE5storeEmSt12memory_order(ptr noundef nonnull align 8 dereferenceable(8) %49, i64 noundef %54, i32 noundef 3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #9
  %55 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.22, i32 noundef %44) #9
  %56 = call noalias ptr @fopen(ptr noundef nonnull %4, ptr noundef nonnull @.str.18)
  %.not55 = icmp eq ptr %56, null
  br i1 %.not55, label %67, label %57

57:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %7) #9
  %58 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 1, i64 noundef 256, ptr noundef nonnull %56)
  %.not56 = icmp eq i64 %58, 0
  br i1 %.not56, label %.critedge58, label %59

59:                                               ; preds = %57
  %60 = add i64 %58, -1
  %61 = getelementptr inbounds [256 x i8], ptr %7, i64 0, i64 %60
  %62 = load i8, ptr %61, align 1, !tbaa !5
  %63 = icmp eq i8 %62, 10
  br i1 %63, label %64, label %.critedge58

64:                                               ; preds = %59
  store i8 0, ptr %61, align 1, !tbaa !5
  br label %.critedge58

.critedge58:                                      ; preds = %64, %59, %57
  %65 = call noundef ptr @_ZN5tracyL14CopyStringFastEPKc(ptr noundef nonnull %7)
  store ptr %65, ptr %2, align 8, !tbaa !8
  %66 = call i32 @fclose(ptr noundef nonnull %56)
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %7) #9
  br label %69

67:                                               ; preds = %.thread, %46, %._crit_edge, %23
  %68 = call noundef ptr @_ZN5tracyL14CopyStringFastEPKcm(ptr noundef nonnull @.str.19, i64 noundef 3)
  store ptr %68, ptr %2, align 8, !tbaa !8
  br label %69

69:                                               ; preds = %.critedge58, %67
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #9
  ret void
}

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

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

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden noundef ptr @_ZN5tracyL10CopyStringEPKc(ptr noundef) local_unnamed_addr #4

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN5tracyL10CopyStringEPKcm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN5tracyL17tracy_malloc_fastEm(i64 noundef) local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress uwtable
declare hidden noundef ptr @_ZN5tracyL14CopyStringFastEPKc(ptr noundef) local_unnamed_addr #4

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN5tracyL14CopyStringFastEPKcm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #8

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { alwaysinline 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 = { alwaysinline 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 = { inlinehint 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 #6 = { 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 #7 = { 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 #8 = { nofree nounwind willreturn memory(argmem: read) }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !6, i64 0}


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