; LLVM IR from AngoraFuzzer/Angora :: llvm_mode/dfsan_rt/sanitizer_common/sanitizer_common.ll/ZN11 (sanitizer12PrintCmdlineEv)

; 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.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 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: mustprogress uwtable
define dso_local void @_ZN11__sanitizer12PrintCmdlineEv() #1 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  %4 = call noundef ptr @_ZN11__sanitizer7GetArgvEv()
  store ptr %4, ptr %1, align 8, !tbaa !5
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = icmp ne ptr %5, null
  br i1 %6, label %8, label %7

7:                                                ; preds = %0
  store i32 1, ptr %2, align 4
  br label %25

8:                                                ; preds = %0
  call void (ptr, ...) @_ZN11__sanitizer6PrintfEPKcz(ptr noundef @.str.19)
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  store i64 0, ptr %3, align 8, !tbaa !9
  br label %9

9:                                                ; preds = %21, %8
  %10 = load ptr, ptr %1, align 8, !tbaa !5
  %11 = load i64, ptr %3, align 8, !tbaa !9
  %12 = getelementptr inbounds ptr, ptr %10, i64 %11
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %9
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  br label %24

16:                                               ; preds = %9
  %17 = load ptr, ptr %1, align 8, !tbaa !5
  %18 = load i64, ptr %3, align 8, !tbaa !9
  %19 = getelementptr inbounds ptr, ptr %17, i64 %18
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  call void (ptr, ...) @_ZN11__sanitizer6PrintfEPKcz(ptr noundef @.str.13, ptr noundef %20)
  br label %21

21:                                               ; preds = %16
  %22 = load i64, ptr %3, align 8, !tbaa !9
  %23 = add i64 %22, 1
  store i64 %23, ptr %3, align 8, !tbaa !9
  br label %9, !llvm.loop !11

24:                                               ; preds = %15
  call void (ptr, ...) @_ZN11__sanitizer6PrintfEPKcz(ptr noundef @.str.20)
  store i32 0, ptr %2, align 4
  br label %25

25:                                               ; preds = %24, %7
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  %26 = load i32, ptr %2, align 4
  switch i32 %26, label %28 [
    i32 0, label %27
    i32 1, label %27
  ]

27:                                               ; preds = %25, %25
  ret void

28:                                               ; preds = %25
  unreachable
}

declare noundef ptr @_ZN11__sanitizer7GetArgvEv() #2

declare void @_ZN11__sanitizer6PrintfEPKcz(ptr noundef, ...) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 }

!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 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer12PrintCmdlineEv() local_unnamed_addr #0 {
  %1 = tail call noundef ptr @_ZN11__sanitizer7GetArgvEv()
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %8, label %2

2:                                                ; preds = %0
  tail call void (ptr, ...) @_ZN11__sanitizer6PrintfEPKcz(ptr noundef nonnull @.str.19)
  %3 = load ptr, ptr %1, align 8, !tbaa !5
  %.not78 = icmp eq ptr %3, null
  br i1 %.not78, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %2
  tail call void (ptr, ...) @_ZN11__sanitizer6PrintfEPKcz(ptr noundef nonnull @.str.20)
  br label %8

.lr.ph:                                           ; preds = %2, %.lr.ph
  %4 = phi ptr [ %7, %.lr.ph ], [ %3, %2 ]
  %.09 = phi i64 [ %5, %.lr.ph ], [ 0, %2 ]
  tail call void (ptr, ...) @_ZN11__sanitizer6PrintfEPKcz(ptr noundef nonnull @.str.13, ptr noundef nonnull %4)
  %5 = add i64 %.09, 1
  %6 = getelementptr inbounds ptr, ptr %1, i64 %5
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %.not7 = icmp eq ptr %7, null
  br i1 %.not7, label %._crit_edge, label %.lr.ph, !llvm.loop !9

8:                                                ; preds = %0, %._crit_edge
  ret void
}

declare noundef ptr @_ZN11__sanitizer7GetArgvEv() local_unnamed_addr #1

declare void @_ZN11__sanitizer6PrintfEPKcz(ptr noundef, ...) local_unnamed_addr #1

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 = { "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" }

!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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


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