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

; 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.commit_options = type { %struct.strbuf, %struct.strbuf, i64, i64, i64, i64, i8, i8, i8 }
%struct.strbuf = type { i64, i64, ptr }
%struct.commit = type { i16, [20 x i8], [50 x i8], [41 x i8], ptr, %struct.strbuf, %struct.strbuf, %struct.timestamp, i64, i64 }
%struct.timestamp = type { i64, ptr }
%struct.author = type { %struct.strbuf, %struct.strbuf }

@cm_opts = external dso_local global %struct.commit_options, align 8
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@stdout = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@__const.log_commit.sb = external hidden unnamed_addr constant %struct.strbuf, align 8
@.str.75 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [5 x i8], align 1

declare i32 @printf(ptr noundef, ...) #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: inlinehint nounwind uwtable
declare hidden void @print_hash_size(ptr noundef, i64 noundef, ptr noundef) #2

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

declare void @strbuf_release(ptr noundef) #0

; 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) #4

; Function Attrs: nounwind uwtable
define dso_local i32 @log_commit(ptr noundef %0) #5 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %struct.strbuf, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %4, ptr align 8 @__const.log_commit.sb, i64 24, i1 false)
  %6 = load i8, ptr getelementptr inbounds (%struct.commit_options, ptr @cm_opts, i32 0, i32 8), align 2, !tbaa !9, !range !14, !noundef !15
  %7 = trunc i8 %6 to i1
  br i1 %7, label %8, label %9

8:                                                ; preds = %1
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %73

9:                                                ; preds = %1
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.commit, ptr %11, i32 0, i32 1
  %13 = getelementptr inbounds [20 x i8], ptr %12, i64 0, i64 0
  %14 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @print_hash_size(ptr noundef %13, i64 noundef 3, ptr noundef %14)
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.commit, ptr %15, i32 0, i32 0
  %17 = load i16, ptr %16, align 8, !tbaa !16
  %18 = sext i16 %17 to i32
  %19 = and i32 %18, 1
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %26

21:                                               ; preds = %9
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.commit, ptr %22, i32 0, i32 2
  %24 = getelementptr inbounds [50 x i8], ptr %23, i64 0, i64 0
  %25 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %24)
  br label %26

26:                                               ; preds = %21, %9
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.75)
  %28 = load ptr, ptr @stdout, align 8, !tbaa !5
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.commit, ptr %29, i32 0, i32 5
  %31 = getelementptr inbounds %struct.strbuf, ptr %30, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !20
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef @.str.76, ptr noundef %32) #6
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.commit, ptr %34, i32 0, i32 6
  %36 = getelementptr inbounds %struct.strbuf, ptr %35, i32 0, i32 1
  %37 = load i64, ptr %36, align 8, !tbaa !21
  %38 = icmp ne i64 %37, 0
  br i1 %38, label %39, label %46

39:                                               ; preds = %26
  %40 = load ptr, ptr @stdout, align 8, !tbaa !5
  %41 = load ptr, ptr %3, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.commit, ptr %41, i32 0, i32 6
  %43 = getelementptr inbounds %struct.strbuf, ptr %42, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.77, ptr noundef %44) #6
  br label %46

46:                                               ; preds = %39, %26
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.commit, ptr %47, i32 0, i32 7
  %49 = getelementptr inbounds %struct.timestamp, ptr %48, i32 0, i32 0
  %50 = call ptr @localtime(ptr noundef %49) #6
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.commit, ptr %51, i32 0, i32 7
  %53 = getelementptr inbounds %struct.timestamp, ptr %52, i32 0, i32 1
  store ptr %50, ptr %53, align 8, !tbaa !23
  %54 = load ptr, ptr @stdout, align 8, !tbaa !5
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.commit, ptr %55, i32 0, i32 4
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  %58 = getelementptr inbounds %struct.author, ptr %57, i32 0, i32 0
  %59 = getelementptr inbounds %struct.strbuf, ptr %58, i32 0, i32 2
  %60 = load ptr, ptr %59, align 8, !tbaa !25
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.commit, ptr %61, i32 0, i32 4
  %63 = load ptr, ptr %62, align 8, !tbaa !24
  %64 = getelementptr inbounds %struct.author, ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds %struct.strbuf, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !27
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef @.str.78, ptr noundef %60, ptr noundef %66) #6
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.commit, ptr %68, i32 0, i32 7
  call void @time_stamp_humanise(ptr noundef %69, ptr noundef %4)
  %70 = getelementptr inbounds %struct.strbuf, ptr %4, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !28
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.79, ptr noundef %71)
  call void @strbuf_release(ptr noundef %4)
  store i32 0, ptr %2, align 4
  store i32 1, ptr %5, align 4
  br label %73

73:                                               ; preds = %46, %8
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #6
  %74 = load i32, ptr %2, align 4
  ret i32 %74
}

; Function Attrs: nounwind
declare ptr @localtime(ptr noundef) #3

declare void @time_stamp_humanise(ptr noundef, ptr noundef) #0

attributes #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 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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, !13, i64 82}
!10 = !{!"commit_options", !11, i64 0, !11, i64 24, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !13, i64 80, !13, i64 81, !13, i64 82}
!11 = !{!"strbuf", !12, i64 0, !12, i64 8, !6, i64 16}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_Bool", !7, i64 0}
!14 = !{i8 0, i8 2}
!15 = !{}
!16 = !{!17, !18, i64 0}
!17 = !{!"commit", !18, i64 0, !7, i64 2, !7, i64 22, !7, i64 72, !6, i64 120, !11, i64 128, !11, i64 152, !19, i64 176, !12, i64 192, !12, i64 200}
!18 = !{!"short", !7, i64 0}
!19 = !{!"timestamp", !12, i64 0, !6, i64 8}
!20 = !{!17, !6, i64 144}
!21 = !{!17, !12, i64 160}
!22 = !{!17, !6, i64 168}
!23 = !{!17, !6, i64 184}
!24 = !{!17, !6, i64 120}
!25 = !{!26, !6, i64 16}
!26 = !{!"author", !11, i64 0, !11, i64 24}
!27 = !{!26, !6, i64 40}
!28 = !{!11, !6, i64 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.commit_options = type { %struct.strbuf, %struct.strbuf, i64, i64, i64, i64, i8, i8, i8 }
%struct.strbuf = type { i64, i64, ptr }

@cm_opts = external dso_local local_unnamed_addr global %struct.commit_options, align 8
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@__const.log_commit.sb = external hidden unnamed_addr constant %struct.strbuf, align 8
@.str.75 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.76 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.77 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) 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: inlinehint nounwind uwtable
declare hidden void @print_hash_size(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

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

declare void @strbuf_release(ptr noundef) local_unnamed_addr #3

; 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) #4

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @log_commit(ptr noundef %0) local_unnamed_addr #5 {
  %2 = alloca %struct.strbuf, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 8 dereferenceable(24) @__const.log_commit.sb, i64 24, i1 false)
  %3 = load i8, ptr getelementptr inbounds (i8, ptr @cm_opts, i64 82), align 2, !tbaa !5, !range !13, !noundef !14
  %4 = trunc nuw i8 %3 to i1
  br i1 %4, label %42, label %5

5:                                                ; preds = %1
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %7 = getelementptr inbounds i8, ptr %0, i64 2
  %8 = load ptr, ptr @stdout, align 8, !tbaa !15
  tail call void @print_hash_size(ptr noundef nonnull %7, i64 noundef 3, ptr noundef %8)
  %9 = load i16, ptr %0, align 8, !tbaa !16
  %10 = and i16 %9, 1
  %.not = icmp eq i16 %10, 0
  br i1 %.not, label %14, label %11

11:                                               ; preds = %5
  %12 = getelementptr inbounds i8, ptr %0, i64 22
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef nonnull %12)
  br label %14

14:                                               ; preds = %11, %5
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.75)
  %16 = load ptr, ptr @stdout, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %0, i64 144
  %18 = load ptr, ptr %17, align 8, !tbaa !20
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.76, ptr noundef %18) #7
  %20 = getelementptr inbounds i8, ptr %0, i64 160
  %21 = load i64, ptr %20, align 8, !tbaa !21
  %.not11 = icmp eq i64 %21, 0
  br i1 %.not11, label %27, label %22

22:                                               ; preds = %14
  %23 = load ptr, ptr @stdout, align 8, !tbaa !15
  %24 = getelementptr inbounds i8, ptr %0, i64 168
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.77, ptr noundef %25) #7
  br label %27

27:                                               ; preds = %22, %14
  %28 = getelementptr inbounds i8, ptr %0, i64 176
  %29 = tail call ptr @localtime(ptr noundef nonnull %28) #7
  %30 = getelementptr inbounds i8, ptr %0, i64 184
  store ptr %29, ptr %30, align 8, !tbaa !23
  %31 = load ptr, ptr @stdout, align 8, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %0, i64 120
  %33 = load ptr, ptr %32, align 8, !tbaa !24
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !25
  %36 = getelementptr inbounds i8, ptr %33, i64 40
  %37 = load ptr, ptr %36, align 8, !tbaa !27
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.78, ptr noundef %35, ptr noundef %37) #7
  call void @time_stamp_humanise(ptr noundef nonnull %28, ptr noundef nonnull %2) #7
  %39 = getelementptr inbounds i8, ptr %2, i64 16
  %40 = load ptr, ptr %39, align 8, !tbaa !28
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.79, ptr noundef %40)
  call void @strbuf_release(ptr noundef nonnull %2) #7
  br label %42

42:                                               ; preds = %1, %27
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #7
  ret i32 0
}

; Function Attrs: nounwind
declare ptr @localtime(ptr noundef) local_unnamed_addr #6

declare void @time_stamp_humanise(ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 "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 #7 = { 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, !12, i64 82}
!6 = !{!"commit_options", !7, i64 0, !7, i64 24, !8, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !12, i64 80, !12, i64 81, !12, i64 82}
!7 = !{!"strbuf", !8, i64 0, !8, i64 8, !11, i64 16}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"_Bool", !9, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!11, !11, i64 0}
!16 = !{!17, !18, i64 0}
!17 = !{!"commit", !18, i64 0, !9, i64 2, !9, i64 22, !9, i64 72, !11, i64 120, !7, i64 128, !7, i64 152, !19, i64 176, !8, i64 192, !8, i64 200}
!18 = !{!"short", !9, i64 0}
!19 = !{!"timestamp", !8, i64 0, !11, i64 8}
!20 = !{!17, !11, i64 144}
!21 = !{!17, !8, i64 160}
!22 = !{!17, !11, i64 168}
!23 = !{!17, !11, i64 184}
!24 = !{!17, !11, i64 120}
!25 = !{!26, !11, i64 16}
!26 = !{!"author", !7, i64 0, !7, i64 24}
!27 = !{!26, !11, i64 40}
!28 = !{!7, !11, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass