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

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

@.str.2 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [36 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN11__sanitizer14internal_cloneEPFiPvES0_iS0_PiS0_S3_(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #3 {
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store i32 %2, ptr %11, align 4, !tbaa !9
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %27

24:                                               ; preds = %7
  %25 = load ptr, ptr %10, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %28, label %27

27:                                               ; preds = %24, %7
  store i64 -22, ptr %8, align 8
  store i32 1, ptr %17, align 4
  br label %67

28:                                               ; preds = %24
  br label %29

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i64 0, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = ptrtoint ptr %30 to i64
  %32 = urem i64 %31, 16
  store i64 %32, ptr %19, align 8, !tbaa !11
  %33 = load i64, ptr %18, align 8, !tbaa !11
  %34 = load i64, ptr %19, align 8, !tbaa !11
  %35 = icmp eq i64 %33, %34
  %36 = xor i1 %35, true
  %37 = xor i1 %36, true
  %38 = xor i1 %37, true
  %39 = zext i1 %38 to i64
  %40 = call i64 @llvm.expect.i64(i64 %39, i64 0)
  %41 = icmp ne i64 %40, 0
  br i1 %41, label %42, label %45

42:                                               ; preds = %29
  %43 = load i64, ptr %18, align 8, !tbaa !11
  %44 = load i64, ptr %19, align 8, !tbaa !11
  call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef @.str.2, i32 noundef 921, ptr noundef @.str.20, i64 noundef %43, i64 noundef %44) #5
  unreachable

45:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %46

46:                                               ; preds = %45
  br label %47

47:                                               ; preds = %46
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 -16
  store ptr %49, ptr %10, align 8, !tbaa !5
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  %51 = ptrtoint ptr %50 to i64
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = getelementptr inbounds i64, ptr %52, i64 0
  store i64 %51, ptr %53, align 8, !tbaa !11
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = ptrtoint ptr %54 to i64
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = getelementptr inbounds i64, ptr %56, i64 1
  store i64 %55, ptr %57, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %58, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %59, ptr %21, align 8, !tbaa !5
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  %61 = load i32, ptr %11, align 4, !tbaa !9
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = load ptr, ptr %20, align 8, !tbaa !5
  %64 = load ptr, ptr %21, align 8, !tbaa !5
  %65 = call i64 asm sideeffect "syscall\0Atestq  %rax,%rax\0Ajnz    1f\0Axorq   %rbp,%rbp\0Apopq   %rax\0Apopq   %rdi\0Acall   *%rax\0Amovq   %rax,%rdi\0Amovq   $2,%rax\0Asyscall\0A1:\0A", "={ax},{ax},i,{si},{di},{dx},{r8},{r10},~{rsp},~{memory},~{r11},~{rcx},~{dirflag},~{fpsr},~{flags}"(i32 56, i32 60, ptr %60, i32 %61, ptr %62, ptr %63, ptr %64) #4, !srcloc !13
  store i64 %65, ptr %16, align 8, !tbaa !11
  %66 = load i64, ptr %16, align 8, !tbaa !11
  store i64 %66, ptr %8, align 8
  store i32 1, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  br label %67

67:                                               ; preds = %47, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  %68 = load i64, ptr %8, align 8
  ret i64 %68
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{i64 29798, i64 29939, i64 29985, i64 30317, i64 30409, i64 30449, i64 30489, i64 30578, i64 30624, i64 30667, i64 30748}


; 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.2 = external hidden unnamed_addr constant [108 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [36 x i8], align 1

; Function Attrs: noreturn
declare void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef, i32 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN11__sanitizer14internal_cloneEPFiPvES0_iS0_PiS0_S3_(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) local_unnamed_addr #1 {
  %8 = icmp ne ptr %0, null
  %9 = icmp ne ptr %1, null
  %or.cond = and i1 %8, %9
  br i1 %or.cond, label %10, label %20

10:                                               ; preds = %7
  %11 = ptrtoint ptr %1 to i64
  %12 = and i64 %11, 15
  %.not = icmp eq i64 %12, 0
  br i1 %.not, label %14, label %13, !prof !5

13:                                               ; preds = %10
  tail call void @_ZN11__sanitizer11CheckFailedEPKciS1_yy(ptr noundef nonnull @.str.2, i32 noundef 921, ptr noundef nonnull @.str.20, i64 noundef 0, i64 noundef %12) #2
  unreachable

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %1, i64 -16
  %16 = ptrtoint ptr %0 to i64
  store i64 %16, ptr %15, align 8, !tbaa !6
  %17 = ptrtoint ptr %3 to i64
  %18 = getelementptr inbounds i8, ptr %1, i64 -8
  store i64 %17, ptr %18, align 8, !tbaa !6
  %19 = tail call i64 asm sideeffect "syscall\0Atestq  %rax,%rax\0Ajnz    1f\0Axorq   %rbp,%rbp\0Apopq   %rax\0Apopq   %rdi\0Acall   *%rax\0Amovq   %rax,%rdi\0Amovq   $2,%rax\0Asyscall\0A1:\0A", "={ax},{ax},i,{si},{di},{dx},{r8},{r10},~{rsp},~{memory},~{r11},~{rcx},~{dirflag},~{fpsr},~{flags}"(i32 56, i32 60, ptr nonnull %15, i32 %2, ptr %4, ptr %5, ptr %6) #3, !srcloc !10
  br label %20

20:                                               ; preds = %7, %14
  %.0 = phi i64 [ %19, %14 ], [ -22, %7 ]
  ret i64 %.0
}

attributes #0 = { 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 #1 = { 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 #2 = { noreturn }
attributes #3 = { 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 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!6 = !{!7, !7, i64 0}
!7 = !{!"long long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{i64 29798, i64 29939, i64 29985, i64 30317, i64 30409, i64 30449, i64 30489, i64 30578, i64 30624, i64 30667, i64 30748}


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