; LLVM IR from AngoraFuzzer/Angora :: llvm_mode/dfsan_rt/sanitizer_common (sanitizer_stacktrace_printer)

; 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.__sanitizer::DataInfo" = type { ptr, i64, ptr, i64, ptr, i64, i64 }

@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [58 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

declare void @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ...) #1

declare noundef ptr @_ZN11__sanitizer15StripPathPrefixEPKcS1_(ptr noundef, ptr noundef) #1

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

; Function Attrs: noreturn
declare void @_ZN11__sanitizer3DieEv() #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer10RenderDataEPNS_20InternalScopedStringEPKcPKNS_8DataInfoES3_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %10 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %10, ptr %9, align 8, !tbaa !5
  br label %11

11:                                               ; preds = %60, %4
  %12 = load ptr, ptr %9, align 8, !tbaa !5
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = sext i8 %13 to i32
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %17, label %16

16:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %63

17:                                               ; preds = %11
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = sext i8 %19 to i32
  %21 = icmp ne i32 %20, 37
  br i1 %21, label %22, label %27

22:                                               ; preds = %17
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = sext i8 %25 to i32
  call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %23, ptr noundef @.str.1, i32 noundef %26)
  br label %60

27:                                               ; preds = %17
  %28 = load ptr, ptr %9, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i32 1
  store ptr %29, ptr %9, align 8, !tbaa !5
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = load i8, ptr %30, align 1, !tbaa !9
  %32 = sext i8 %31 to i32
  switch i32 %32, label %52 [
    i32 37, label %33
    i32 115, label %35
    i32 108, label %42
    i32 103, label %47
  ]

33:                                               ; preds = %27
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %34, ptr noundef @.str.2)
  br label %59

35:                                               ; preds = %27
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = getelementptr inbounds %"struct.__sanitizer::DataInfo", ptr %37, i32 0, i32 2
  %39 = load ptr, ptr %38, align 8, !tbaa !10
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = call noundef ptr @_ZN11__sanitizer15StripPathPrefixEPKcS1_(ptr noundef %39, ptr noundef %40)
  call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %36, ptr noundef @.str.5, ptr noundef %41)
  br label %59

42:                                               ; preds = %27
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.__sanitizer::DataInfo", ptr %44, i32 0, i32 3
  %46 = load i64, ptr %45, align 8, !tbaa !13
  call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %43, ptr noundef @.str.6, i64 noundef %46)
  br label %59

47:                                               ; preds = %27
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.__sanitizer::DataInfo", ptr %49, i32 0, i32 4
  %51 = load ptr, ptr %50, align 8, !tbaa !14
  call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %48, ptr noundef @.str.5, ptr noundef %51)
  br label %59

52:                                               ; preds = %27
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = sext i8 %54 to i32
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = load i8, ptr %56, align 1, !tbaa !9
  %58 = sext i8 %57 to i32
  call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.12, i32 noundef %55, i32 noundef %58)
  call void @_ZN11__sanitizer3DieEv() #5
  unreachable

59:                                               ; preds = %47, %42, %35, %33
  br label %60

60:                                               ; preds = %59, %22
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i32 1
  store ptr %62, ptr %9, align 8, !tbaa !5
  br label %11, !llvm.loop !15

63:                                               ; preds = %16
  ret void
}

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

!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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 16}
!11 = !{!"_ZTSN11__sanitizer8DataInfoE", !6, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !6, i64 32, !12, i64 40, !12, i64 48}
!12 = !{!"long", !7, i64 0}
!13 = !{!11, !12, i64 24}
!14 = !{!11, !6, i64 32}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; 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.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [58 x i8], align 1

declare void @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef, ...) local_unnamed_addr #0

declare noundef ptr @_ZN11__sanitizer15StripPathPrefixEPKcS1_(ptr noundef, ptr noundef) local_unnamed_addr #0

declare void @_ZN11__sanitizer6ReportEPKcz(ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: noreturn
declare void @_ZN11__sanitizer3DieEv() local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer10RenderDataEPNS_20InternalScopedStringEPKcPKNS_8DataInfoES3_(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr noundef %3) local_unnamed_addr #2 {
  %5 = getelementptr inbounds i8, ptr %2, i64 32
  %6 = getelementptr inbounds i8, ptr %2, i64 24
  %7 = getelementptr inbounds i8, ptr %2, i64 16
  br label %8

8:                                                ; preds = %26, %4
  %.0 = phi ptr [ %1, %4 ], [ %27, %26 ]
  %9 = load i8, ptr %.0, align 1, !tbaa !5
  switch i8 %9, label %11 [
    i8 0, label %10
    i8 37, label %13
  ]

10:                                               ; preds = %8
  ret void

11:                                               ; preds = %8
  %12 = sext i8 %9 to i32
  tail call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull @.str.1, i32 noundef %12)
  br label %26

13:                                               ; preds = %8
  %14 = getelementptr inbounds i8, ptr %.0, i64 1
  %15 = load i8, ptr %14, align 1, !tbaa !5
  switch i8 %15, label %24 [
    i8 37, label %16
    i8 115, label %17
    i8 108, label %20
    i8 103, label %22
  ]

16:                                               ; preds = %13
  tail call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull @.str.2)
  br label %26

17:                                               ; preds = %13
  %18 = load ptr, ptr %7, align 8, !tbaa !8
  %19 = tail call noundef ptr @_ZN11__sanitizer15StripPathPrefixEPKcS1_(ptr noundef %18, ptr noundef %3)
  tail call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull @.str.5, ptr noundef %19)
  br label %26

20:                                               ; preds = %13
  %21 = load i64, ptr %6, align 8, !tbaa !12
  tail call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull @.str.6, i64 noundef %21)
  br label %26

22:                                               ; preds = %13
  %23 = load ptr, ptr %5, align 8, !tbaa !13
  tail call void (ptr, ptr, ...) @_ZN11__sanitizer20InternalScopedString6appendEPKcz(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull @.str.5, ptr noundef %23)
  br label %26

24:                                               ; preds = %13
  %25 = sext i8 %15 to i32
  tail call void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.12, i32 noundef %25, i32 noundef %25)
  tail call void @_ZN11__sanitizer3DieEv() #3
  unreachable

26:                                               ; preds = %16, %17, %20, %22, %11
  %.1 = phi ptr [ %.0, %11 ], [ %14, %22 ], [ %14, %20 ], [ %14, %17 ], [ %14, %16 ]
  %27 = getelementptr inbounds i8, ptr %.1, i64 1
  br label %8, !llvm.loop !14
}

attributes #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 = { noreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress 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 = { noreturn }

!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, !10, i64 16}
!9 = !{!"_ZTSN11__sanitizer8DataInfoE", !10, i64 0, !11, i64 8, !10, i64 16, !11, i64 24, !10, i64 32, !11, i64 40, !11, i64 48}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!9, !11, i64 24}
!13 = !{!9, !10, i64 32}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


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