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

@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
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [9 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @print_commit_stats(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load i8, ptr getelementptr inbounds (%struct.commit_options, ptr @cm_opts, i32 0, i32 8), align 2, !tbaa !9, !range !14, !noundef !15
  %6 = trunc i8 %5 to i1
  br i1 %6, label %7, label %8

7:                                                ; preds = %2
  br label %106

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

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

25:                                               ; preds = %20, %8
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.commit, ptr %26, i32 0, i32 5
  %28 = getelementptr inbounds %struct.strbuf, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !20
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, ptr noundef %29)
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.commit, ptr %31, i32 0, i32 6
  %33 = getelementptr inbounds %struct.strbuf, ptr %32, i32 0, i32 1
  %34 = load i64, ptr %33, align 8, !tbaa !21
  %35 = icmp ne i64 %34, 0
  br i1 %35, label %36, label %42

36:                                               ; preds = %25
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.commit, ptr %37, i32 0, i32 6
  %39 = getelementptr inbounds %struct.strbuf, ptr %38, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !22
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, ptr noundef %40)
  br label %42

42:                                               ; preds = %36, %25
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.commit_options, ptr %43, i32 0, i32 4
  %45 = load i64, ptr %44, align 8, !tbaa !23
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.commit_options, ptr %46, i32 0, i32 5
  %48 = load i64, ptr %47, align 8, !tbaa !24
  %49 = add i64 %45, %48
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.commit_options, ptr %50, i32 0, i32 4
  %52 = load i64, ptr %51, align 8, !tbaa !23
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.commit_options, ptr %53, i32 0, i32 5
  %55 = load i64, ptr %54, align 8, !tbaa !24
  %56 = add i64 %52, %55
  %57 = icmp ugt i64 %56, 1
  %58 = zext i1 %57 to i64
  %59 = select i1 %57, ptr @.str.9, ptr @.str.10
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i64 noundef %49, ptr noundef %59)
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.commit_options, ptr %61, i32 0, i32 2
  %63 = load i64, ptr %62, align 8, !tbaa !25
  %64 = icmp ne i64 %63, 0
  br i1 %64, label %65, label %76

65:                                               ; preds = %42
  %66 = load ptr, ptr %3, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.commit_options, ptr %66, i32 0, i32 2
  %68 = load i64, ptr %67, align 8, !tbaa !25
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.commit_options, ptr %69, i32 0, i32 2
  %71 = load i64, ptr %70, align 8, !tbaa !25
  %72 = icmp ugt i64 %71, 1
  %73 = zext i1 %72 to i64
  %74 = select i1 %72, ptr @.str.12, ptr @.str.13
  %75 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i64 noundef %68, ptr noundef %74)
  br label %76

76:                                               ; preds = %65, %42
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.commit_options, ptr %77, i32 0, i32 2
  %79 = load i64, ptr %78, align 8, !tbaa !25
  %80 = icmp ne i64 %79, 0
  br i1 %80, label %81, label %88

81:                                               ; preds = %76
  %82 = load ptr, ptr %3, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.commit_options, ptr %82, i32 0, i32 3
  %84 = load i64, ptr %83, align 8, !tbaa !26
  %85 = icmp ne i64 %84, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %81
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  br label %88

88:                                               ; preds = %86, %81, %76
  %89 = load ptr, ptr %3, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.commit_options, ptr %89, i32 0, i32 3
  %91 = load i64, ptr %90, align 8, !tbaa !26
  %92 = icmp ne i64 %91, 0
  br i1 %92, label %93, label %104

93:                                               ; preds = %88
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.commit_options, ptr %94, i32 0, i32 3
  %96 = load i64, ptr %95, align 8, !tbaa !26
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.commit_options, ptr %97, i32 0, i32 3
  %99 = load i64, ptr %98, align 8, !tbaa !26
  %100 = icmp ugt i64 %99, 1
  %101 = zext i1 %100 to i64
  %102 = select i1 %100, ptr @.str.16, ptr @.str.17
  %103 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i64 noundef %96, ptr noundef %102)
  br label %104

104:                                              ; preds = %93, %88
  %105 = call i32 @putchar(i32 noundef 10)
  br label %106

106:                                              ; preds = %104, %7
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare i32 @putchar(i32 noundef) #2

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 = { 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 = { 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" }

!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 = !{!10, !12, i64 64}
!24 = !{!10, !12, i64 72}
!25 = !{!10, !12, i64 48}
!26 = !{!10, !12, i64 56}


; 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
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [9 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @print_commit_stats(ptr nocapture noundef readonly %0, ptr noundef %1) local_unnamed_addr #1 {
  %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 %50, label %5

5:                                                ; preds = %2
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
  %7 = getelementptr inbounds i8, ptr %1, 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 %1, 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 %1, 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 = getelementptr inbounds i8, ptr %1, i64 144
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  %17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, ptr noundef %16)
  %18 = getelementptr inbounds i8, ptr %1, i64 160
  %19 = load i64, ptr %18, align 8, !tbaa !21
  %.not19 = icmp eq i64 %19, 0
  br i1 %.not19, label %24, label %20

20:                                               ; preds = %14
  %21 = getelementptr inbounds i8, ptr %1, i64 168
  %22 = load ptr, ptr %21, align 8, !tbaa !22
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, ptr noundef %22)
  br label %24

24:                                               ; preds = %20, %14
  %25 = getelementptr inbounds i8, ptr %0, i64 64
  %26 = load i64, ptr %25, align 8, !tbaa !23
  %27 = getelementptr inbounds i8, ptr %0, i64 72
  %28 = load i64, ptr %27, align 8, !tbaa !24
  %29 = add i64 %28, %26
  %30 = icmp ugt i64 %29, 1
  %31 = select i1 %30, ptr @.str.9, ptr @.str.10
  %32 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i64 noundef %29, ptr noundef nonnull %31)
  %33 = getelementptr inbounds i8, ptr %0, i64 48
  %34 = load i64, ptr %33, align 8, !tbaa !25
  %.not20 = icmp eq i64 %34, 0
  br i1 %.not20, label %.thread, label %35

35:                                               ; preds = %24
  %.not21 = icmp eq i64 %34, 1
  %36 = select i1 %.not21, ptr @.str.13, ptr @.str.12
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i64 noundef %34, ptr noundef nonnull %36)
  %.pr = load i64, ptr %33, align 8, !tbaa !25
  %.not22 = icmp eq i64 %.pr, 0
  br i1 %.not22, label %.thread, label %38

38:                                               ; preds = %35
  %39 = getelementptr inbounds i8, ptr %0, i64 56
  %40 = load i64, ptr %39, align 8, !tbaa !26
  %.not23 = icmp eq i64 %40, 0
  br i1 %.not23, label %.thread, label %41

41:                                               ; preds = %38
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  br label %.thread

.thread:                                          ; preds = %24, %41, %38, %35
  %43 = getelementptr inbounds i8, ptr %0, i64 56
  %44 = load i64, ptr %43, align 8, !tbaa !26
  %.not24 = icmp eq i64 %44, 0
  br i1 %.not24, label %48, label %45

45:                                               ; preds = %.thread
  %.not25 = icmp eq i64 %44, 1
  %46 = select i1 %.not25, ptr @.str.17, ptr @.str.16
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i64 noundef %44, ptr noundef nonnull %46)
  br label %48

48:                                               ; preds = %45, %.thread
  %49 = tail call i32 @putchar(i32 noundef 10)
  br label %50

50:                                               ; preds = %2, %48
  ret void
}

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

; Function Attrs: inlinehint nofree nounwind uwtable
declare noundef i32 @putchar(i32 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 = { 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 = { 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 = { inlinehint nofree 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" }

!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 = !{!6, !8, i64 64}
!24 = !{!6, !8, i64 72}
!25 = !{!6, !8, i64 48}
!26 = !{!6, !8, i64 56}


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