; LLVM IR from kmxz/overlayfs-tools :: check (ovl_scan_fix)

; 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.scan_result = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ovl_fs = type { %struct.ovl_layer, ptr, i32, %struct.ovl_layer }
%struct.ovl_layer = type { ptr, i32, i32, i32, i32 }

@flags = external global i32, align 4
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@ovl_scan_desc = external hidden global [2 x ptr], align 16
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @ovl_scan_fix(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %struct.scan_result, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.scan_result, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 28, ptr %4) #4
  call void @llvm.memset.p0.i64(ptr align 4 %4, i8 0, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %100, %1
  %12 = load i32, ptr %5, align 4, !tbaa !9
  %13 = icmp slt i32 %12, 2
  br i1 %13, label %14, label %103

14:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 28, ptr %8) #4
  call void @llvm.memset.p0.i64(ptr align 4 %8, i8 0, i64 28, i1 false)
  %15 = load i32, ptr @flags, align 4, !tbaa !9
  %16 = and i32 %15, 1
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %24

18:                                               ; preds = %14
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [2 x ptr], ptr @ovl_scan_desc, i64 0, i64 %21
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  call void (ptr, ...) @print_info(ptr noundef @.str, i32 noundef %19, ptr noundef %23)
  br label %24

24:                                               ; preds = %18, %14
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.ovl_fs, ptr %25, i32 0, i32 2
  %27 = load i32, ptr %26, align 8, !tbaa !11
  %28 = sub nsw i32 %27, 1
  store i32 %28, ptr %6, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %79, %24
  %30 = load i32, ptr %6, align 4, !tbaa !9
  %31 = icmp sge i32 %30, 0
  br i1 %31, label %32, label %82

32:                                               ; preds = %29
  %33 = load i32, ptr %6, align 4, !tbaa !9
  call void (ptr, ...) @print_debug(ptr noundef @.str.1, i32 noundef %33)
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.ovl_fs, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !14
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds %struct.ovl_layer, ptr %36, i64 %38
  %40 = getelementptr inbounds %struct.ovl_layer, ptr %39, i32 0, i32 4
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = and i32 %41, 1
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %64

44:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %45 = load i32, ptr @flags, align 4, !tbaa !9
  %46 = and i32 %45, 56
  store i32 %46, ptr %9, align 4, !tbaa !9
  %47 = load i32, ptr %6, align 4, !tbaa !9
  call void (ptr, ...) @print_info(ptr noundef @.str.2, i32 noundef %47)
  %48 = load i32, ptr @flags, align 4, !tbaa !9
  %49 = and i32 %48, 0
  %50 = or i32 %49, 16
  store i32 %50, ptr @flags, align 4, !tbaa !9
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.ovl_fs, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !14
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds %struct.ovl_layer, ptr %54, i64 %56
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = call i32 @ovl_scan_layer(ptr noundef %51, ptr noundef %57, i32 noundef %58, ptr noundef %8)
  store i32 %59, ptr %7, align 4, !tbaa !9
  %60 = load i32, ptr @flags, align 4, !tbaa !9
  %61 = and i32 %60, 0
  %62 = load i32, ptr %9, align 4, !tbaa !9
  %63 = or i32 %61, %62
  store i32 %63, ptr @flags, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %74

64:                                               ; preds = %32
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.ovl_fs, ptr %66, i32 0, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !14
  %69 = load i32, ptr %6, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %struct.ovl_layer, ptr %68, i64 %70
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = call i32 @ovl_scan_layer(ptr noundef %65, ptr noundef %71, i32 noundef %72, ptr noundef %8)
  store i32 %73, ptr %7, align 4, !tbaa !9
  br label %74

74:                                               ; preds = %64, %44
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = icmp ne i32 %75, 0
  br i1 %76, label %77, label %78

77:                                               ; preds = %74
  store i32 8, ptr %10, align 4
  br label %97

78:                                               ; preds = %74
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %6, align 4, !tbaa !9
  %81 = add nsw i32 %80, -1
  store i32 %81, ptr %6, align 4, !tbaa !9
  br label %29, !llvm.loop !16

82:                                               ; preds = %29
  %83 = load i32, ptr @flags, align 4, !tbaa !9
  %84 = and i32 %83, 2
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %96

86:                                               ; preds = %82
  call void (ptr, ...) @print_debug(ptr noundef @.str.3)
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.ovl_fs, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %5, align 4, !tbaa !9
  %91 = call i32 @ovl_scan_layer(ptr noundef %87, ptr noundef %89, i32 noundef %90, ptr noundef %8)
  store i32 %91, ptr %7, align 4, !tbaa !9
  %92 = load i32, ptr %7, align 4, !tbaa !9
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %86
  store i32 8, ptr %10, align 4
  br label %97

95:                                               ; preds = %86
  br label %96

96:                                               ; preds = %95, %82
  call void @ovl_scan_update_result(ptr noundef %8, ptr noundef %4)
  store i32 0, ptr %10, align 4
  br label %97

97:                                               ; preds = %96, %94, %77
  call void @llvm.lifetime.end.p0(i64 28, ptr %8) #4
  %98 = load i32, ptr %10, align 4
  switch i32 %98, label %106 [
    i32 0, label %99
    i32 8, label %104
  ]

99:                                               ; preds = %97
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %5, align 4, !tbaa !9
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %5, align 4, !tbaa !9
  br label %11, !llvm.loop !18

103:                                              ; preds = %11
  br label %104

104:                                              ; preds = %103, %97
  call void @ovl_scan_report(ptr noundef %4)
  call void @ovl_scan_clean()
  %105 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %105, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %106

106:                                              ; preds = %104, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 28, ptr %4) #4
  %107 = load i32, ptr %2, align 4
  ret i32 %107
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @print_info(ptr noundef, ...) #3

declare void @print_debug(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
declare hidden i32 @ovl_scan_layer(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

; Function Attrs: nounwind uwtable
declare hidden void @ovl_scan_update_result(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @ovl_scan_report(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @ovl_scan_clean() #0

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 32}
!12 = !{!"ovl_fs", !13, i64 0, !6, i64 24, !10, i64 32, !13, i64 40}
!13 = !{!"ovl_layer", !6, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!14 = !{!12, !6, i64 24}
!15 = !{!13, !10, i64 20}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


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

%struct.scan_result = type { i32, i32, i32, i32, i32, i32, i32 }
%struct.ovl_layer = type { ptr, i32, i32, i32, i32 }

@flags = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@ovl_scan_desc = external hidden local_unnamed_addr global [2 x ptr], align 16
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @ovl_scan_fix(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca %struct.scan_result, align 4
  %3 = alloca %struct.scan_result, align 4
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %2) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %2, i8 0, i64 28, i1 false)
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = getelementptr inbounds i8, ptr %0, i64 24
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %3) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %3, i8 0, i64 28, i1 false)
  %6 = load i32, ptr @flags, align 4, !tbaa !5
  %7 = and i32 %6, 1
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %10, label %8

8:                                                ; preds = %1
  %9 = load ptr, ptr @ovl_scan_desc, align 16, !tbaa !9
  tail call void (ptr, ...) @print_info(ptr noundef nonnull @.str, i32 noundef 0, ptr noundef %9) #4
  br label %10

10:                                               ; preds = %8, %1
  %11 = load i32, ptr %4, align 8, !tbaa !11
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %10
  %13 = zext nneg i32 %11 to i64
  br label %.lr.ph

14:                                               ; preds = %30
  %15 = icmp ugt i64 %indvars.iv, 1
  br i1 %15, label %.lr.ph, label %._crit_edge, !llvm.loop !14

.lr.ph:                                           ; preds = %.lr.ph.preheader, %14
  %indvars.iv = phi i64 [ %13, %.lr.ph.preheader ], [ %indvars.iv.next, %14 ]
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %16 = trunc nuw nsw i64 %indvars.iv.next to i32
  call void (ptr, ...) @print_debug(ptr noundef nonnull @.str.1, i32 noundef %16) #4
  %17 = load ptr, ptr %5, align 8, !tbaa !16
  %18 = getelementptr inbounds %struct.ovl_layer, ptr %17, i64 %indvars.iv.next
  %19 = getelementptr inbounds i8, ptr %18, i64 20
  %20 = load i32, ptr %19, align 4, !tbaa !17
  %21 = and i32 %20, 1
  %.not35 = icmp eq i32 %21, 0
  br i1 %.not35, label %28, label %22

22:                                               ; preds = %.lr.ph
  %23 = load i32, ptr @flags, align 4, !tbaa !5
  %24 = and i32 %23, 56
  call void (ptr, ...) @print_info(ptr noundef nonnull @.str.2, i32 noundef %16) #4
  store i32 16, ptr @flags, align 4, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !16
  %26 = getelementptr inbounds %struct.ovl_layer, ptr %25, i64 %indvars.iv.next
  %27 = call i32 @ovl_scan_layer(ptr noundef nonnull %0, ptr noundef %26, i32 noundef 0, ptr noundef nonnull %3)
  store i32 %24, ptr @flags, align 4, !tbaa !5
  br label %30

28:                                               ; preds = %.lr.ph
  %29 = call i32 @ovl_scan_layer(ptr noundef nonnull %0, ptr noundef nonnull %18, i32 noundef 0, ptr noundef nonnull %3)
  br label %30

30:                                               ; preds = %28, %22
  %.2 = phi i32 [ %27, %22 ], [ %29, %28 ]
  %.not36 = icmp eq i32 %.2, 0
  br i1 %.not36, label %14, label %.thread, !llvm.loop !14

._crit_edge:                                      ; preds = %14, %10
  %31 = load i32, ptr @flags, align 4, !tbaa !5
  %32 = and i32 %31, 2
  %.not33 = icmp eq i32 %32, 0
  br i1 %.not33, label %35, label %33

33:                                               ; preds = %._crit_edge
  call void (ptr, ...) @print_debug(ptr noundef nonnull @.str.3) #4
  %34 = call i32 @ovl_scan_layer(ptr noundef nonnull %0, ptr noundef nonnull %0, i32 noundef 0, ptr noundef nonnull %3)
  %.not34 = icmp eq i32 %34, 0
  br i1 %.not34, label %35, label %.thread

.thread:                                          ; preds = %30, %58, %33, %63
  %.4.ph = phi i32 [ %34, %33 ], [ %64, %63 ], [ %.2.1, %58 ], [ %.2, %30 ]
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %3) #4
  br label %.loopexit

35:                                               ; preds = %33, %._crit_edge
  call void @ovl_scan_update_result(ptr noundef nonnull %3, ptr noundef nonnull %2)
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %3) #4
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(28) %3, i8 0, i64 28, i1 false)
  %36 = load i32, ptr @flags, align 4, !tbaa !5
  %37 = and i32 %36, 1
  %.not.1 = icmp eq i32 %37, 0
  br i1 %.not.1, label %40, label %38

38:                                               ; preds = %35
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @ovl_scan_desc, i64 8), align 8, !tbaa !9
  call void (ptr, ...) @print_info(ptr noundef nonnull @.str, i32 noundef 1, ptr noundef %39) #4
  br label %40

40:                                               ; preds = %38, %35
  %41 = load i32, ptr %4, align 8, !tbaa !11
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %.lr.ph.preheader.1, label %._crit_edge.1

.lr.ph.preheader.1:                               ; preds = %40
  %43 = zext nneg i32 %41 to i64
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %59, %.lr.ph.preheader.1
  %indvars.iv.1 = phi i64 [ %43, %.lr.ph.preheader.1 ], [ %indvars.iv.next.1, %59 ]
  %indvars.iv.next.1 = add nsw i64 %indvars.iv.1, -1
  %44 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  call void (ptr, ...) @print_debug(ptr noundef nonnull @.str.1, i32 noundef %44) #4
  %45 = load ptr, ptr %5, align 8, !tbaa !16
  %46 = getelementptr inbounds %struct.ovl_layer, ptr %45, i64 %indvars.iv.next.1
  %47 = getelementptr inbounds i8, ptr %46, i64 20
  %48 = load i32, ptr %47, align 4, !tbaa !17
  %49 = and i32 %48, 1
  %.not35.1 = icmp eq i32 %49, 0
  br i1 %.not35.1, label %56, label %50

50:                                               ; preds = %.lr.ph.1
  %51 = load i32, ptr @flags, align 4, !tbaa !5
  %52 = and i32 %51, 56
  call void (ptr, ...) @print_info(ptr noundef nonnull @.str.2, i32 noundef %44) #4
  store i32 16, ptr @flags, align 4, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !16
  %54 = getelementptr inbounds %struct.ovl_layer, ptr %53, i64 %indvars.iv.next.1
  %55 = call i32 @ovl_scan_layer(ptr noundef nonnull %0, ptr noundef %54, i32 noundef 1, ptr noundef nonnull %3)
  store i32 %52, ptr @flags, align 4, !tbaa !5
  br label %58

56:                                               ; preds = %.lr.ph.1
  %57 = call i32 @ovl_scan_layer(ptr noundef nonnull %0, ptr noundef nonnull %46, i32 noundef 1, ptr noundef nonnull %3)
  br label %58

58:                                               ; preds = %56, %50
  %.2.1 = phi i32 [ %55, %50 ], [ %57, %56 ]
  %.not36.1 = icmp eq i32 %.2.1, 0
  br i1 %.not36.1, label %59, label %.thread, !llvm.loop !14

59:                                               ; preds = %58
  %60 = icmp ugt i64 %indvars.iv.1, 1
  br i1 %60, label %.lr.ph.1, label %._crit_edge.1, !llvm.loop !14

._crit_edge.1:                                    ; preds = %59, %40
  %61 = load i32, ptr @flags, align 4, !tbaa !5
  %62 = and i32 %61, 2
  %.not33.1 = icmp eq i32 %62, 0
  br i1 %.not33.1, label %.loopexit.loopexit, label %63

63:                                               ; preds = %._crit_edge.1
  call void (ptr, ...) @print_debug(ptr noundef nonnull @.str.3) #4
  %64 = call i32 @ovl_scan_layer(ptr noundef nonnull %0, ptr noundef nonnull %0, i32 noundef 1, ptr noundef nonnull %3)
  %.not34.1 = icmp eq i32 %64, 0
  br i1 %.not34.1, label %.loopexit.loopexit, label %.thread

.loopexit.loopexit:                               ; preds = %63, %._crit_edge.1
  call void @ovl_scan_update_result(ptr noundef nonnull %3, ptr noundef nonnull %2)
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %3) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %.thread
  %.5 = phi i32 [ %.4.ph, %.thread ], [ 0, %.loopexit.loopexit ]
  call void @ovl_scan_report(ptr noundef nonnull %2)
  call void @ovl_scan_clean()
  call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %2) #4
  ret i32 %.5
}

; 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 nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @print_info(ptr noundef, ...) local_unnamed_addr #3

declare void @print_debug(ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden i32 @ovl_scan_layer(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden void @ovl_scan_update_result(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @ovl_scan_report(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @ovl_scan_clean() local_unnamed_addr #0

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 32}
!12 = !{!"ovl_fs", !13, i64 0, !10, i64 24, !6, i64 32, !13, i64 40}
!13 = !{!"ovl_layer", !10, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!12, !10, i64 24}
!17 = !{!13, !6, i64 20}


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