; LLVM IR from Gottox/sqsh-tools :: examples (traverse_dir_ll)

; 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.SqshConfig = type { i64, i64, ptr, i32, i32, i32, i64, i32, i32, [128 x i8] }

@.str = external hidden unnamed_addr constant [23 x i8], align 1
@sqsh_mapper_impl_mmap = external constant ptr, align 8
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 x i8], align 1
@stdout = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1

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

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 0
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str, ptr noundef %24)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %117

26:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 184, ptr %8) #4
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 184, i1 false)
  %27 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 0
  %28 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 1
  %29 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 2
  %30 = load ptr, ptr @sqsh_mapper_impl_mmap, align 8, !tbaa !9
  store ptr %30, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 3
  %32 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 4
  %33 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 5
  %34 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 6
  %35 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 7
  %36 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 8
  %37 = getelementptr inbounds %struct.SqshConfig, ptr %8, i32 0, i32 9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds ptr, ptr %38, i64 1
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = call ptr @sqsh_archive_open(ptr noundef %40, ptr noundef %8, ptr noundef %6)
  store ptr %41, ptr %9, align 8, !tbaa !9
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %46

44:                                               ; preds = %26
  %45 = load i32, ptr %6, align 4, !tbaa !5
  call void @sqsh_perror(i32 noundef %45, ptr noundef @.str.1)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %116

46:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %47 = load ptr, ptr %9, align 8, !tbaa !9
  %48 = call ptr @sqsh_archive_superblock(ptr noundef %47)
  store ptr %48, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = call i64 @sqsh_superblock_inode_root_ref(ptr noundef %49)
  store i64 %50, ptr %11, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %51 = load ptr, ptr %9, align 8, !tbaa !9
  %52 = load i64, ptr %11, align 8, !tbaa !14
  %53 = call ptr @sqsh_open_by_ref(ptr noundef %51, i64 noundef %52, ptr noundef %6)
  store ptr %53, ptr %12, align 8, !tbaa !9
  %54 = load i32, ptr %6, align 4, !tbaa !5
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %58

56:                                               ; preds = %46
  %57 = load i32, ptr %6, align 4, !tbaa !5
  call void @sqsh_perror(i32 noundef %57, ptr noundef @.str.2)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %115

58:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %59 = load ptr, ptr %12, align 8, !tbaa !9
  %60 = call ptr @sqsh_tree_traversal_new(ptr noundef %59, ptr noundef %6)
  store ptr %60, ptr %13, align 8, !tbaa !9
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %65

63:                                               ; preds = %58
  %64 = load i32, ptr %6, align 4, !tbaa !5
  call void @sqsh_perror(i32 noundef %64, ptr noundef @.str.3)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %114

65:                                               ; preds = %58
  br label %66

66:                                               ; preds = %101, %99, %65
  %67 = load ptr, ptr %13, align 8, !tbaa !9
  %68 = call zeroext i1 @sqsh_tree_traversal_next(ptr noundef %67, ptr noundef %6)
  br i1 %68, label %69, label %102

69:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %70 = load ptr, ptr %13, align 8, !tbaa !9
  %71 = call i32 @sqsh_tree_traversal_state(ptr noundef %70)
  store i32 %71, ptr %14, align 4, !tbaa !5
  %72 = load i32, ptr %14, align 4, !tbaa !5
  %73 = icmp eq i32 %72, 3
  br i1 %73, label %74, label %75

74:                                               ; preds = %69
  store i32 2, ptr %7, align 4
  br label %99, !llvm.loop !15

75:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %76 = load ptr, ptr %13, align 8, !tbaa !9
  %77 = call i64 @sqsh_tree_traversal_depth(ptr noundef %76)
  store i64 %77, ptr %15, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i64 0, ptr %18, align 8, !tbaa !14
  br label %78

78:                                               ; preds = %93, %75
  %79 = load i64, ptr %18, align 8, !tbaa !14
  %80 = load i64, ptr %15, align 8, !tbaa !14
  %81 = icmp ult i64 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  store i32 4, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %96

83:                                               ; preds = %78
  %84 = load ptr, ptr %13, align 8, !tbaa !9
  %85 = load i64, ptr %18, align 8, !tbaa !14
  %86 = call ptr @sqsh_tree_traversal_path_segment(ptr noundef %84, ptr noundef %16, i64 noundef %85)
  store ptr %86, ptr %17, align 8, !tbaa !9
  %87 = load ptr, ptr @stdout, align 8, !tbaa !9
  %88 = call i32 @fputc(i32 noundef 47, ptr noundef %87)
  %89 = load ptr, ptr %17, align 8, !tbaa !9
  %90 = load i64, ptr %16, align 8, !tbaa !14
  %91 = load ptr, ptr @stdout, align 8, !tbaa !9
  %92 = call i64 @fwrite(ptr noundef %89, i64 noundef 1, i64 noundef %90, ptr noundef %91)
  br label %93

93:                                               ; preds = %83
  %94 = load i64, ptr %18, align 8, !tbaa !14
  %95 = add i64 %94, 1
  store i64 %95, ptr %18, align 8, !tbaa !14
  br label %78, !llvm.loop !17

96:                                               ; preds = %82
  %97 = load ptr, ptr @stdout, align 8, !tbaa !9
  %98 = call i32 @fputc(i32 noundef 10, ptr noundef %97)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  store i32 0, ptr %7, align 4
  br label %99

99:                                               ; preds = %96, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %100 = load i32, ptr %7, align 4
  switch i32 %100, label %119 [
    i32 0, label %101
    i32 2, label %66
  ]

101:                                              ; preds = %99
  br label %66, !llvm.loop !15

102:                                              ; preds = %66
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = icmp slt i32 %103, 0
  br i1 %104, label %105, label %107

105:                                              ; preds = %102
  %106 = load i32, ptr %6, align 4, !tbaa !5
  call void @sqsh_perror(i32 noundef %106, ptr noundef @.str.4)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %114

107:                                              ; preds = %102
  %108 = load ptr, ptr %13, align 8, !tbaa !9
  %109 = call i32 @sqsh_tree_traversal_free(ptr noundef %108)
  %110 = load ptr, ptr %12, align 8, !tbaa !9
  %111 = call i32 @sqsh_close(ptr noundef %110)
  %112 = load ptr, ptr %9, align 8, !tbaa !9
  %113 = call i32 @sqsh_archive_close(ptr noundef %112)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %114

114:                                              ; preds = %107, %105, %63
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %115

115:                                              ; preds = %114, %56
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %116

116:                                              ; preds = %115, %44
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 184, ptr %8) #4
  br label %117

117:                                              ; preds = %116, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %118 = load i32, ptr %3, align 4
  ret i32 %118

119:                                              ; preds = %99
  unreachable
}

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

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare ptr @sqsh_archive_open(ptr noundef, ptr noundef, ptr noundef) #2

declare void @sqsh_perror(i32 noundef, ptr noundef) #2

declare ptr @sqsh_archive_superblock(ptr noundef) #2

declare i64 @sqsh_superblock_inode_root_ref(ptr noundef) #2

declare ptr @sqsh_open_by_ref(ptr noundef, i64 noundef, ptr noundef) #2

declare ptr @sqsh_tree_traversal_new(ptr noundef, ptr noundef) #2

declare zeroext i1 @sqsh_tree_traversal_next(ptr noundef, ptr noundef) #2

declare i32 @sqsh_tree_traversal_state(ptr noundef) #2

declare i64 @sqsh_tree_traversal_depth(ptr noundef) #2

declare ptr @sqsh_tree_traversal_path_segment(ptr noundef, ptr noundef, i64 noundef) #2

declare i32 @fputc(i32 noundef, ptr noundef) #2

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

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

declare i32 @sqsh_tree_traversal_free(ptr noundef) #2

declare i32 @sqsh_close(ptr noundef) #2

declare i32 @sqsh_archive_close(ptr noundef) #2

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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !10, i64 16}
!12 = !{!"SqshConfig", !13, i64 0, !13, i64 8, !10, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !13, i64 40, !6, i64 48, !6, i64 52, !7, i64 56}
!13 = !{!"long", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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.SqshConfig = type { i64, i64, ptr, i32, i32, i32, i64, i32, i32, [128 x i8] }

@.str = external hidden unnamed_addr constant [23 x i8], align 1
@sqsh_mapper_impl_mmap = external local_unnamed_addr constant ptr, align 8
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca %struct.SqshConfig, align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  %.not = icmp eq i32 %0, 2
  br i1 %.not, label %9, label %6

6:                                                ; preds = %2
  %7 = load ptr, ptr %1, align 8, !tbaa !9
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %7)
  br label %51

9:                                                ; preds = %2
  call void @llvm.lifetime.start.p0(i64 184, ptr nonnull %4) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(184) %4, i8 0, i64 184, i1 false)
  %10 = getelementptr inbounds i8, ptr %4, i64 16
  %11 = load ptr, ptr @sqsh_mapper_impl_mmap, align 8, !tbaa !9
  store ptr %11, ptr %10, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %1, i64 8
  %13 = load ptr, ptr %12, align 8, !tbaa !9
  %14 = call ptr @sqsh_archive_open(ptr noundef %13, ptr noundef nonnull %4, ptr noundef nonnull %3) #5
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %.not26 = icmp eq i32 %15, 0
  br i1 %.not26, label %17, label %16

16:                                               ; preds = %9
  call void @sqsh_perror(i32 noundef %15, ptr noundef nonnull @.str.1) #5
  br label %50

17:                                               ; preds = %9
  %18 = call ptr @sqsh_archive_superblock(ptr noundef %14) #5
  %19 = call i64 @sqsh_superblock_inode_root_ref(ptr noundef %18) #5
  %20 = call ptr @sqsh_open_by_ref(ptr noundef %14, i64 noundef %19, ptr noundef nonnull %3) #5
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %.not27 = icmp eq i32 %21, 0
  br i1 %.not27, label %23, label %22

22:                                               ; preds = %17
  call void @sqsh_perror(i32 noundef %21, ptr noundef nonnull @.str.2) #5
  br label %50

23:                                               ; preds = %17
  %24 = call ptr @sqsh_tree_traversal_new(ptr noundef %20, ptr noundef nonnull %3) #5
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %.not28 = icmp eq i32 %25, 0
  br i1 %.not28, label %.preheader, label %27

.preheader:                                       ; preds = %23
  %26 = call zeroext i1 @sqsh_tree_traversal_next(ptr noundef %24, ptr noundef nonnull %3) #5
  br i1 %26, label %.lr.ph30, label %._crit_edge31

27:                                               ; preds = %23
  call void @sqsh_perror(i32 noundef %25, ptr noundef nonnull @.str.3) #5
  br label %50

.lr.ph30:                                         ; preds = %.preheader, %41
  %28 = call i32 @sqsh_tree_traversal_state(ptr noundef %24) #5
  %29 = icmp eq i32 %28, 3
  br i1 %29, label %41, label %30, !llvm.loop !14

30:                                               ; preds = %.lr.ph30
  %31 = call i64 @sqsh_tree_traversal_depth(ptr noundef %24) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %.not32 = icmp eq i64 %31, 0
  br i1 %.not32, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %30
  %32 = load ptr, ptr @stdout, align 8, !tbaa !9
  %33 = call i32 @fputc(i32 noundef 10, ptr noundef %32)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %41

.lr.ph:                                           ; preds = %30, %.lr.ph
  %.029 = phi i64 [ %40, %.lr.ph ], [ 0, %30 ]
  %34 = call ptr @sqsh_tree_traversal_path_segment(ptr noundef %24, ptr noundef nonnull %5, i64 noundef %.029) #5
  %35 = load ptr, ptr @stdout, align 8, !tbaa !9
  %36 = call i32 @fputc(i32 noundef 47, ptr noundef %35)
  %37 = load i64, ptr %5, align 8, !tbaa !16
  %38 = load ptr, ptr @stdout, align 8, !tbaa !9
  %39 = call i64 @fwrite(ptr noundef %34, i64 noundef 1, i64 noundef %37, ptr noundef %38)
  %40 = add nuw i64 %.029, 1
  %exitcond.not = icmp eq i64 %40, %31
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !17

41:                                               ; preds = %.lr.ph30, %._crit_edge
  %42 = call zeroext i1 @sqsh_tree_traversal_next(ptr noundef %24, ptr noundef nonnull %3) #5
  br i1 %42, label %.lr.ph30, label %._crit_edge31

._crit_edge31:                                    ; preds = %41, %.preheader
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = icmp slt i32 %43, 0
  br i1 %44, label %45, label %46

45:                                               ; preds = %._crit_edge31
  call void @sqsh_perror(i32 noundef %43, ptr noundef nonnull @.str.4) #5
  br label %50

46:                                               ; preds = %._crit_edge31
  %47 = call i32 @sqsh_tree_traversal_free(ptr noundef %24) #5
  %48 = call i32 @sqsh_close(ptr noundef %20) #5
  %49 = call i32 @sqsh_archive_close(ptr noundef %14) #5
  br label %50

50:                                               ; preds = %22, %46, %45, %27, %16
  %.2 = phi i32 [ 1, %16 ], [ 1, %22 ], [ 1, %27 ], [ 1, %45 ], [ 0, %46 ]
  call void @llvm.lifetime.end.p0(i64 184, ptr nonnull %4) #5
  br label %51

51:                                               ; preds = %50, %6
  %.3 = phi i32 [ 1, %6 ], [ %.2, %50 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  ret i32 %.3
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

declare ptr @sqsh_archive_open(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @sqsh_perror(i32 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @sqsh_archive_superblock(ptr noundef) local_unnamed_addr #4

declare i64 @sqsh_superblock_inode_root_ref(ptr noundef) local_unnamed_addr #4

declare ptr @sqsh_open_by_ref(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @sqsh_tree_traversal_new(ptr noundef, ptr noundef) local_unnamed_addr #4

declare zeroext i1 @sqsh_tree_traversal_next(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @sqsh_tree_traversal_state(ptr noundef) local_unnamed_addr #4

declare i64 @sqsh_tree_traversal_depth(ptr noundef) local_unnamed_addr #4

declare ptr @sqsh_tree_traversal_path_segment(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fputc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

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

declare i32 @sqsh_tree_traversal_free(ptr noundef) local_unnamed_addr #4

declare i32 @sqsh_close(ptr noundef) local_unnamed_addr #4

declare i32 @sqsh_archive_close(ptr noundef) local_unnamed_addr #4

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 = { nofree 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { "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 #5 = { 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, !10, i64 16}
!12 = !{!"SqshConfig", !13, i64 0, !13, i64 8, !10, i64 16, !6, i64 24, !6, i64 28, !6, i64 32, !13, i64 40, !6, i64 48, !6, i64 52, !7, i64 56}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!13, !13, i64 0}
!17 = distinct !{!17, !15}


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