; LLVM IR from jspd-group/pegit :: src (delta)

; 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.strbuf = type { i64, i64, ptr }
%struct.pack_file_cache = type { ptr, %struct.strbuf }
%struct.basic_delta_result = type { i64, i64, i64, ptr, %struct.strbuf_list, %struct.strbuf_list }
%struct.strbuf_list = type { ptr, ptr, i64 }
%struct.index_list = type { ptr, ptr }
%struct.index = type { [256 x i8], %struct.stat, i8, i64, i64, i64 }
%struct.stat = type { i64, i64, i64, i32, i32, i32, i32, i64, i64, i64, i64, %struct.timespec, %struct.timespec, %struct.timespec, [3 x i64] }
%struct.timespec = type { i64, i64 }

@stderr = external global ptr, align 8
@stdout = external global ptr, align 8
@__const.do_commit_delta.out = external hidden unnamed_addr constant %struct.strbuf, align 8
@__const.do_commit_delta.cache = external hidden unnamed_addr constant %struct.pack_file_cache, align 8
@.str.40 = external hidden unnamed_addr constant [2 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: nounwind uwtable
declare dso_local void @basic_delta_result_init(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: nounwind uwtable
declare dso_local void @index_delta(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

declare void @strbuf_release(ptr noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @delta_index_splash(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @print_insertion_only(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @print_object_insertions(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @do_commit_delta(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca %struct.basic_delta_result, align 8
  %12 = alloca %struct.strbuf, align 8
  %13 = alloca %struct.pack_file_cache, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %15 = zext i1 %2 to i8
  store i8 %15, ptr %6, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 80, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 @__const.do_commit_delta.out, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr %13) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 @__const.do_commit_delta.cache, i64 32, i1 false)
  call void @basic_delta_result_init(ptr noundef %11, ptr noundef null)
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  call void @make_index_list_from_commit(ptr noundef %16, ptr noundef %7)
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  call void @make_index_list_from_commit(ptr noundef %17, ptr noundef %8)
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %23

20:                                               ; preds = %3
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = icmp ne ptr %21, null
  br i1 %22, label %26, label %23

23:                                               ; preds = %20, %3
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str.40) #6
  store i32 1, ptr %14, align 4
  br label %123

26:                                               ; preds = %20
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %27, ptr %9, align 8, !tbaa !5
  %28 = call i32 @cache_pack_file(ptr noundef %13)
  br label %29

29:                                               ; preds = %74, %26
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %78

32:                                               ; preds = %29
  %33 = load ptr, ptr %8, align 8, !tbaa !5
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.index_list, ptr %34, i32 0, i32 0
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct.index, ptr %36, i32 0, i32 0
  %38 = getelementptr inbounds [256 x i8], ptr %37, i64 0, i64 0
  %39 = call ptr @find_file_index_list(ptr noundef %33, ptr noundef %38)
  store ptr %39, ptr %10, align 8, !tbaa !5
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = icmp ne ptr %40, null
  br i1 %41, label %42, label %65

42:                                               ; preds = %32
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.index_list, ptr %43, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds %struct.index, ptr %45, i32 0, i32 0
  %47 = getelementptr inbounds [256 x i8], ptr %46, i64 0, i64 0
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.index, ptr %48, i32 0, i32 0
  %50 = getelementptr inbounds [256 x i8], ptr %49, i64 0, i64 0
  call void @delta_index_splash(ptr noundef %12, ptr noundef %47, ptr noundef %50)
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.index, ptr %51, i32 0, i32 2
  store i8 2, ptr %52, align 8, !tbaa !13
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.index_list, ptr %53, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !11
  %56 = load ptr, ptr %10, align 8, !tbaa !5
  %57 = load i8, ptr %6, align 1, !tbaa !9, !range !19, !noundef !20
  %58 = trunc i8 %57 to i1
  call void @index_delta(ptr noundef %11, ptr noundef %13, ptr noundef %55, ptr noundef %56, ptr noundef %12, i1 noundef zeroext %58)
  %59 = getelementptr inbounds %struct.strbuf, ptr %12, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !21
  %61 = getelementptr inbounds %struct.strbuf, ptr %12, i32 0, i32 1
  %62 = load i64, ptr %61, align 8, !tbaa !23
  %63 = load ptr, ptr @stdout, align 8, !tbaa !5
  %64 = call i64 @fwrite(ptr noundef %60, i64 noundef 1, i64 noundef %62, ptr noundef %63)
  call void @strbuf_setlen(ptr noundef %12, i64 noundef 0)
  br label %74

65:                                               ; preds = %32
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.index_list, ptr %66, i32 0, i32 0
  %68 = load ptr, ptr %67, align 8, !tbaa !11
  %69 = getelementptr inbounds %struct.index, ptr %68, i32 0, i32 0
  %70 = getelementptr inbounds [256 x i8], ptr %69, i64 0, i64 0
  call void @delta_index_splash(ptr noundef %12, ptr noundef %70, ptr noundef null)
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.index_list, ptr %71, i32 0, i32 0
  %73 = load ptr, ptr %72, align 8, !tbaa !11
  call void @print_object_insertions(ptr noundef %13, ptr noundef %73)
  br label %74

74:                                               ; preds = %65, %42
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.index_list, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !24
  store ptr %77, ptr %9, align 8, !tbaa !5
  br label %29, !llvm.loop !25

78:                                               ; preds = %29
  %79 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %79, ptr %9, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %117, %91, %78
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = icmp ne ptr %81, null
  br i1 %82, label %83, label %121

83:                                               ; preds = %80
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.index_list, ptr %84, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !11
  %87 = getelementptr inbounds %struct.index, ptr %86, i32 0, i32 2
  %88 = load i8, ptr %87, align 8, !tbaa !13
  %89 = zext i8 %88 to i32
  %90 = icmp eq i32 %89, 2
  br i1 %90, label %91, label %95

91:                                               ; preds = %83
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.index_list, ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !24
  store ptr %94, ptr %9, align 8, !tbaa !5
  br label %80, !llvm.loop !27

95:                                               ; preds = %83
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.index_list, ptr %96, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  %99 = getelementptr inbounds %struct.index, ptr %98, i32 0, i32 0
  %100 = getelementptr inbounds [256 x i8], ptr %99, i64 0, i64 0
  call void @delta_index_splash(ptr noundef %12, ptr noundef null, ptr noundef %100)
  %101 = getelementptr inbounds %struct.strbuf, ptr %12, i32 0, i32 2
  %102 = load ptr, ptr %101, align 8, !tbaa !21
  %103 = getelementptr inbounds %struct.strbuf, ptr %12, i32 0, i32 1
  %104 = load i64, ptr %103, align 8, !tbaa !23
  %105 = load ptr, ptr @stdout, align 8, !tbaa !5
  %106 = call i64 @fwrite(ptr noundef %102, i64 noundef 1, i64 noundef %104, ptr noundef %105)
  %107 = load i8, ptr %6, align 1, !tbaa !9, !range !19, !noundef !20
  %108 = trunc i8 %107 to i1
  br i1 %108, label %113, label %109

109:                                              ; preds = %95
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.index_list, ptr %110, i32 0, i32 0
  %112 = load ptr, ptr %111, align 8, !tbaa !11
  call void @print_insertion_only(ptr noundef %13, ptr noundef %112)
  br label %117

113:                                              ; preds = %95
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.index_list, ptr %114, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !11
  call void @print_object_insertions(ptr noundef %13, ptr noundef %116)
  br label %117

117:                                              ; preds = %113, %109
  %118 = load ptr, ptr %9, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.index_list, ptr %118, i32 0, i32 1
  %120 = load ptr, ptr %119, align 8, !tbaa !24
  store ptr %120, ptr %9, align 8, !tbaa !5
  call void @strbuf_setlen(ptr noundef %12, i64 noundef 0)
  br label %80, !llvm.loop !27

121:                                              ; preds = %80
  %122 = getelementptr inbounds %struct.pack_file_cache, ptr %13, i32 0, i32 1
  call void @strbuf_release(ptr noundef %122)
  call void @strbuf_release(ptr noundef %12)
  store i32 0, ptr %14, align 4
  br label %123

123:                                              ; preds = %121, %23
  call void @llvm.lifetime.end.p0(i64 32, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %124 = load i32, ptr %14, align 4
  switch i32 %124, label %126 [
    i32 0, label %125
    i32 1, label %125
  ]

125:                                              ; preds = %123, %123
  ret void

126:                                              ; preds = %123
  unreachable
}

declare void @make_index_list_from_commit(ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cache_pack_file(ptr noundef) #5

declare ptr @find_file_index_list(ptr noundef, ptr noundef) #4

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @strbuf_setlen(ptr noundef, i64 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { inlinehint 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 #6 = { 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 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"index_list", !6, i64 0, !6, i64 8}
!13 = !{!14, !7, i64 400}
!14 = !{!"index", !7, i64 0, !15, i64 256, !7, i64 400, !16, i64 408, !16, i64 416, !16, i64 424}
!15 = !{!"stat", !16, i64 0, !16, i64 8, !16, i64 16, !17, i64 24, !17, i64 28, !17, i64 32, !17, i64 36, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !18, i64 72, !18, i64 88, !18, i64 104, !7, i64 120}
!16 = !{!"long", !7, i64 0}
!17 = !{!"int", !7, i64 0}
!18 = !{!"timespec", !16, i64 0, !16, i64 8}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = !{!22, !6, i64 16}
!22 = !{!"strbuf", !16, i64 0, !16, i64 8, !6, i64 16}
!23 = !{!22, !16, i64 8}
!24 = !{!12, !6, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}


; 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.strbuf = type { i64, i64, ptr }
%struct.pack_file_cache = type { ptr, %struct.strbuf }
%struct.basic_delta_result = type { i64, i64, i64, ptr, %struct.strbuf_list, %struct.strbuf_list }
%struct.strbuf_list = type { ptr, ptr, i64 }

@stderr = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@__const.do_commit_delta.out = external hidden unnamed_addr constant %struct.strbuf, align 8
@__const.do_commit_delta.cache = external hidden unnamed_addr constant %struct.pack_file_cache, align 8
@.str.40 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @basic_delta_result_init(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @index_delta(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i1 noundef zeroext) local_unnamed_addr #1

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

declare void @strbuf_release(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @delta_index_splash(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @print_insertion_only(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @print_object_insertions(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @do_commit_delta(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2) local_unnamed_addr #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.basic_delta_result, align 8
  %7 = alloca %struct.strbuf, align 8
  %8 = alloca %struct.pack_file_cache, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) @__const.do_commit_delta.out, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) @__const.do_commit_delta.cache, i64 32, i1 false)
  call void @basic_delta_result_init(ptr noundef nonnull %6, ptr noundef null)
  call void @make_index_list_from_commit(ptr noundef %0, ptr noundef nonnull %4) #6
  call void @make_index_list_from_commit(ptr noundef %1, ptr noundef nonnull %5) #6
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = icmp ne ptr %9, null
  %11 = load ptr, ptr %5, align 8
  %12 = icmp ne ptr %11, null
  %or.cond = select i1 %10, i1 %12, i1 false
  br i1 %or.cond, label %16, label %13

13:                                               ; preds = %3
  %14 = load ptr, ptr @stderr, align 8, !tbaa !5
  %15 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.40) #7
  br label %70

16:                                               ; preds = %3
  %17 = call i32 @cache_pack_file(ptr noundef nonnull %8)
  %18 = getelementptr inbounds i8, ptr %7, i64 16
  %19 = getelementptr inbounds i8, ptr %7, i64 8
  br label %20

20:                                               ; preds = %16, %34
  %.026 = phi ptr [ %9, %16 ], [ %36, %34 ]
  %21 = load ptr, ptr %5, align 8, !tbaa !5
  %22 = load ptr, ptr %.026, align 8, !tbaa !9
  %23 = call ptr @find_file_index_list(ptr noundef %21, ptr noundef %22) #6
  %.not25 = icmp eq ptr %23, null
  %24 = load ptr, ptr %.026, align 8, !tbaa !9
  br i1 %.not25, label %32, label %25

25:                                               ; preds = %20
  call void @delta_index_splash(ptr noundef nonnull %7, ptr noundef %24, ptr noundef nonnull %23)
  %26 = getelementptr inbounds i8, ptr %23, i64 400
  store i8 2, ptr %26, align 8, !tbaa !11
  %27 = load ptr, ptr %.026, align 8, !tbaa !9
  call void @index_delta(ptr noundef nonnull %6, ptr noundef nonnull %8, ptr noundef %27, ptr noundef nonnull %23, ptr noundef nonnull %7, i1 noundef zeroext %2)
  %28 = load ptr, ptr %18, align 8, !tbaa !17
  %29 = load i64, ptr %19, align 8, !tbaa !19
  %30 = load ptr, ptr @stdout, align 8, !tbaa !5
  %31 = call i64 @fwrite(ptr noundef %28, i64 noundef 1, i64 noundef %29, ptr noundef %30)
  call void @strbuf_setlen(ptr noundef nonnull %7, i64 noundef 0)
  br label %34

32:                                               ; preds = %20
  call void @delta_index_splash(ptr noundef nonnull %7, ptr noundef %24, ptr noundef null)
  %33 = load ptr, ptr %.026, align 8, !tbaa !9
  call void @print_object_insertions(ptr noundef nonnull %8, ptr noundef %33)
  br label %34

34:                                               ; preds = %32, %25
  %35 = getelementptr inbounds i8, ptr %.026, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  %.not = icmp eq ptr %36, null
  br i1 %.not, label %37, label %20, !llvm.loop !21

37:                                               ; preds = %34
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %.not2427 = icmp eq ptr %38, null
  br i1 %.not2427, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %37
  br i1 %2, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.backedge.us
  %.128.us = phi ptr [ %.1.be.us, %.backedge.us ], [ %38, %.lr.ph ]
  %39 = load ptr, ptr %.128.us, align 8, !tbaa !9
  %40 = getelementptr inbounds i8, ptr %39, i64 400
  %41 = load i8, ptr %40, align 8, !tbaa !11
  %42 = icmp eq i8 %41, 2
  br i1 %42, label %51, label %43

43:                                               ; preds = %.lr.ph.split.us
  call void @delta_index_splash(ptr noundef nonnull %7, ptr noundef null, ptr noundef nonnull %39)
  %44 = load ptr, ptr %18, align 8, !tbaa !17
  %45 = load i64, ptr %19, align 8, !tbaa !19
  %46 = load ptr, ptr @stdout, align 8, !tbaa !5
  %47 = call i64 @fwrite(ptr noundef %44, i64 noundef 1, i64 noundef %45, ptr noundef %46)
  %48 = load ptr, ptr %.128.us, align 8, !tbaa !9
  call void @print_object_insertions(ptr noundef nonnull %8, ptr noundef %48)
  %49 = getelementptr inbounds i8, ptr %.128.us, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !20
  call void @strbuf_setlen(ptr noundef nonnull %7, i64 noundef 0)
  br label %.backedge.us

51:                                               ; preds = %.lr.ph.split.us
  %52 = getelementptr inbounds i8, ptr %.128.us, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !20
  br label %.backedge.us

.backedge.us:                                     ; preds = %51, %43
  %.1.be.us = phi ptr [ %53, %51 ], [ %50, %43 ]
  %.not24.us = icmp eq ptr %.1.be.us, null
  br i1 %.not24.us, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !23

.lr.ph.split:                                     ; preds = %.lr.ph, %.backedge
  %.128 = phi ptr [ %.1.be, %.backedge ], [ %38, %.lr.ph ]
  %54 = load ptr, ptr %.128, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %54, i64 400
  %56 = load i8, ptr %55, align 8, !tbaa !11
  %57 = icmp eq i8 %56, 2
  br i1 %57, label %58, label %61

58:                                               ; preds = %.lr.ph.split
  %59 = getelementptr inbounds i8, ptr %.128, i64 8
  %60 = load ptr, ptr %59, align 8, !tbaa !20
  br label %.backedge

.backedge:                                        ; preds = %58, %61
  %.1.be = phi ptr [ %60, %58 ], [ %68, %61 ]
  %.not24 = icmp eq ptr %.1.be, null
  br i1 %.not24, label %._crit_edge, label %.lr.ph.split, !llvm.loop !23

61:                                               ; preds = %.lr.ph.split
  call void @delta_index_splash(ptr noundef nonnull %7, ptr noundef null, ptr noundef nonnull %54)
  %62 = load ptr, ptr %18, align 8, !tbaa !17
  %63 = load i64, ptr %19, align 8, !tbaa !19
  %64 = load ptr, ptr @stdout, align 8, !tbaa !5
  %65 = call i64 @fwrite(ptr noundef %62, i64 noundef 1, i64 noundef %63, ptr noundef %64)
  %66 = load ptr, ptr %.128, align 8, !tbaa !9
  call void @print_insertion_only(ptr noundef nonnull %8, ptr noundef %66)
  %67 = getelementptr inbounds i8, ptr %.128, i64 8
  %68 = load ptr, ptr %67, align 8, !tbaa !20
  call void @strbuf_setlen(ptr noundef nonnull %7, i64 noundef 0)
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %.backedge.us, %37
  %69 = getelementptr inbounds i8, ptr %8, i64 8
  call void @strbuf_release(ptr noundef nonnull %69) #6
  call void @strbuf_release(ptr noundef nonnull %7) #6
  br label %70

70:                                               ; preds = %._crit_edge, %13
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  ret void
}

declare void @make_index_list_from_commit(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @cache_pack_file(ptr noundef) local_unnamed_addr #5

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @strbuf_setlen(ptr noundef, i64 noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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: readwrite) }
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 = { inlinehint 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 #6 = { nounwind }
attributes #7 = { cold 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, !6, i64 0}
!10 = !{!"index_list", !6, i64 0, !6, i64 8}
!11 = !{!12, !7, i64 400}
!12 = !{!"index", !7, i64 0, !13, i64 256, !7, i64 400, !14, i64 408, !14, i64 416, !14, i64 424}
!13 = !{!"stat", !14, i64 0, !14, i64 8, !14, i64 16, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !16, i64 72, !16, i64 88, !16, i64 104, !7, i64 120}
!14 = !{!"long", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"timespec", !14, i64 0, !14, i64 8}
!17 = !{!18, !6, i64 16}
!18 = !{!"strbuf", !14, i64 0, !14, i64 8, !6, i64 16}
!19 = !{!18, !14, i64 8}
!20 = !{!10, !6, i64 8}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass