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

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

@__func__._ZN11__sanitizer14DumpProcessMapEv = external hidden unnamed_addr constant [15 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11__sanitizer9MmapOrDieEmPKcb(i64 noundef, ptr noundef, i1 noundef zeroext) #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 uwtable
declare dso_local void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef, i64 noundef) #0

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

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

declare void @_ZN11__sanitizer19MemoryMappingLayoutC1Eb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) unnamed_addr #2

declare noundef zeroext i1 @_ZN11__sanitizer19MemoryMappingLayout4NextEPmS1_S1_PcmS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer14DumpProcessMapEv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.__sanitizer::MemoryMappingLayout", align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %1) #4
  call void @_ZN11__sanitizer19MemoryMappingLayoutC1Eb(ptr noundef nonnull align 8 dereferenceable(32) %1, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  store i64 4095, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %8 = invoke noundef ptr @_ZN11__sanitizer9MmapOrDieEmPKcb(i64 noundef 4095, ptr noundef @__func__._ZN11__sanitizer14DumpProcessMapEv, i1 noundef zeroext false)
          to label %9 unwind label %22

9:                                                ; preds = %0
  store ptr %8, ptr %5, align 8, !tbaa !9
  invoke void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.13)
          to label %10 unwind label %22

10:                                               ; preds = %9
  br label %11

11:                                               ; preds = %21, %10
  %12 = load ptr, ptr %5, align 8, !tbaa !9
  %13 = invoke noundef zeroext i1 @_ZN11__sanitizer19MemoryMappingLayout4NextEPmS1_S1_PcmS1_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, ptr noundef %3, ptr noundef null, ptr noundef %12, i64 noundef 4095, ptr noundef null)
          to label %14 unwind label %22

14:                                               ; preds = %11
  br i1 %13, label %15, label %26

15:                                               ; preds = %14
  %16 = load i64, ptr %2, align 8, !tbaa !5
  %17 = inttoptr i64 %16 to ptr
  %18 = load i64, ptr %3, align 8, !tbaa !5
  %19 = inttoptr i64 %18 to ptr
  %20 = load ptr, ptr %5, align 8, !tbaa !9
  invoke void (ptr, ...) @_ZN11__sanitizer6PrintfEPKcz(ptr noundef @.str.14, ptr noundef %17, ptr noundef %19, ptr noundef %20)
          to label %21 unwind label %22

21:                                               ; preds = %15
  br label %11, !llvm.loop !11

22:                                               ; preds = %27, %26, %15, %11, %9, %0
  %23 = landingpad { ptr, i32 }
          cleanup
  %24 = extractvalue { ptr, i32 } %23, 0
  store ptr %24, ptr %6, align 8
  %25 = extractvalue { ptr, i32 } %23, 1
  store i32 %25, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #4
  br label %30

26:                                               ; preds = %14
  invoke void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef @.str.15)
          to label %27 unwind label %22

27:                                               ; preds = %26
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  invoke void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef %28, i64 noundef 4095)
          to label %29 unwind label %22

29:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  call void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #4
  ret void

30:                                               ; preds = %22
  %31 = load ptr, ptr %6, align 8
  %32 = load i32, ptr %7, align 4
  %33 = insertvalue { ptr, i32 } poison, ptr %31, 0
  %34 = insertvalue { ptr, i32 } %33, i32 %32, 1
  resume { ptr, i32 } %34
}

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

!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 = 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"

%"class.__sanitizer::MemoryMappingLayout" = type { %"struct.__sanitizer::ProcSelfMapsBuff", ptr }
%"struct.__sanitizer::ProcSelfMapsBuff" = type { ptr, i64, i64 }

@__func__._ZN11__sanitizer14DumpProcessMapEv = external hidden unnamed_addr constant [15 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN11__sanitizer9MmapOrDieEmPKcb(i64 noundef, ptr noundef, i1 noundef zeroext) 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 uwtable
declare dso_local void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef, i64 noundef) local_unnamed_addr #0

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

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

declare void @_ZN11__sanitizer19MemoryMappingLayoutC1Eb(ptr noundef nonnull align 8 dereferenceable(32), i1 noundef zeroext) unnamed_addr #2

declare noundef zeroext i1 @_ZN11__sanitizer19MemoryMappingLayout4NextEPmS1_S1_PcmS1_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN11__sanitizer14DumpProcessMapEv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.__sanitizer::MemoryMappingLayout", align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #4
  call void @_ZN11__sanitizer19MemoryMappingLayoutC1Eb(ptr noundef nonnull align 8 dereferenceable(32) %1, i1 noundef zeroext true)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %4 = invoke noundef ptr @_ZN11__sanitizer9MmapOrDieEmPKcb(i64 noundef 4095, ptr noundef nonnull @__func__._ZN11__sanitizer14DumpProcessMapEv, i1 noundef zeroext false)
          to label %5 unwind label %.loopexit.split-lp

5:                                                ; preds = %0
  invoke void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.13)
          to label %.preheader unwind label %.loopexit.split-lp

.preheader:                                       ; preds = %5, %8
  %6 = invoke noundef zeroext i1 @_ZN11__sanitizer19MemoryMappingLayout4NextEPmS1_S1_PcmS1_(ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef null, ptr noundef %4, i64 noundef 4095, ptr noundef null)
          to label %7 unwind label %.loopexit

7:                                                ; preds = %.preheader
  br i1 %6, label %8, label %14

8:                                                ; preds = %7
  %9 = load i64, ptr %2, align 8, !tbaa !5
  %10 = inttoptr i64 %9 to ptr
  %11 = load i64, ptr %3, align 8, !tbaa !5
  %12 = inttoptr i64 %11 to ptr
  invoke void (ptr, ...) @_ZN11__sanitizer6PrintfEPKcz(ptr noundef nonnull @.str.14, ptr noundef %10, ptr noundef %12, ptr noundef %4)
          to label %.preheader unwind label %.loopexit, !llvm.loop !9

.loopexit:                                        ; preds = %.preheader, %8
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %13

.loopexit.split-lp:                               ; preds = %0, %5, %14, %15
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %13

13:                                               ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #4
  resume { ptr, i32 } %lpad.phi

14:                                               ; preds = %7
  invoke void (ptr, ...) @_ZN11__sanitizer6ReportEPKcz(ptr noundef nonnull @.str.15)
          to label %15 unwind label %.loopexit.split-lp

15:                                               ; preds = %14
  invoke void @_ZN11__sanitizer10UnmapOrDieEPvm(ptr noundef %4, i64 noundef 4095)
          to label %16 unwind label %.loopexit.split-lp

16:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @_ZN11__sanitizer19MemoryMappingLayoutD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %1) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #4
  ret void
}

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

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


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