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

@stdout = external global ptr, align 8
@.str.33 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.83 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.84 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.86 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.90 = external hidden unnamed_addr constant [9 x i8], align 1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @print_hash(ptr noundef, ptr noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @show_commit_node(ptr noundef %0, i64 noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %5 = load i64, ptr %4, align 8, !tbaa !9
  %6 = call i32 (ptr, ...) @printf(ptr noundef @.str.81, i64 noundef %5)
  %7 = call i32 (ptr, ...) @printf(ptr noundef @.str.82)
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.commit_list, ptr %8, i32 0, i32 1
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %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(ptr noundef %12, ptr noundef %13)
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.commit_list, ptr %14, i32 0, i32 1
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  %17 = getelementptr inbounds %struct.commit, ptr %16, i32 0, i32 0
  %18 = load i16, ptr %17, align 8, !tbaa !13
  %19 = sext i16 %18 to i32
  %20 = and i32 %19, 22
  %21 = icmp ne i32 %20, 0
  br i1 %21, label %22, label %24

22:                                               ; preds = %2
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.83)
  br label %24

24:                                               ; preds = %22, %2
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.commit_list, ptr %25, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  %28 = getelementptr inbounds %struct.commit, ptr %27, i32 0, i32 0
  %29 = load i16, ptr %28, align 8, !tbaa !13
  %30 = sext i16 %29 to i32
  %31 = and i32 %30, 1
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %39

33:                                               ; preds = %24
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.commit_list, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct.commit, ptr %36, i32 0, i32 2
  %38 = getelementptr inbounds [50 x i8], ptr %37, i64 0, i64 0
  br label %40

39:                                               ; preds = %24
  br label %40

40:                                               ; preds = %39, %33
  %41 = phi ptr [ %38, %33 ], [ @.str.85, %39 ]
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.84, ptr noundef %41)
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.commit_list, ptr %43, i32 0, i32 1
  %45 = load ptr, ptr %44, align 8, !tbaa !11
  %46 = getelementptr inbounds %struct.commit, ptr %45, i32 0, i32 4
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = getelementptr inbounds %struct.author, ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds %struct.strbuf, ptr %48, i32 0, i32 2
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.86, ptr noundef %50)
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.commit_list, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !11
  %55 = getelementptr inbounds %struct.commit, ptr %54, i32 0, i32 4
  %56 = load ptr, ptr %55, align 8, !tbaa !18
  %57 = getelementptr inbounds %struct.author, ptr %56, i32 0, i32 1
  %58 = getelementptr inbounds %struct.strbuf, ptr %57, i32 0, i32 2
  %59 = load ptr, ptr %58, align 8, !tbaa !21
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.87, ptr noundef %59)
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.commit_list, ptr %61, i32 0, i32 1
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  %64 = getelementptr inbounds %struct.commit, ptr %63, i32 0, i32 5
  %65 = getelementptr inbounds %struct.strbuf, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !22
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.88, ptr noundef %66)
  %68 = load ptr, ptr %3, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.commit_list, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct.commit, ptr %70, i32 0, i32 6
  %72 = getelementptr inbounds %struct.strbuf, ptr %71, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !23
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.89, ptr noundef %73)
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.commit_list, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = getelementptr inbounds %struct.commit, ptr %77, i32 0, i32 7
  %79 = getelementptr inbounds %struct.timestamp, ptr %78, i32 0, i32 0
  %80 = call ptr @localtime(ptr noundef %79) #4
  %81 = load ptr, ptr %3, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.commit_list, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !11
  %84 = getelementptr inbounds %struct.commit, ptr %83, i32 0, i32 7
  %85 = getelementptr inbounds %struct.timestamp, ptr %84, i32 0, i32 1
  store ptr %80, ptr %85, align 8, !tbaa !24
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.commit_list, ptr %86, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  %89 = getelementptr inbounds %struct.commit, ptr %88, i32 0, i32 7
  %90 = getelementptr inbounds %struct.timestamp, ptr %89, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !24
  %92 = call ptr @asctime(ptr noundef %91) #4
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.90, ptr noundef %92)
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.33)
  ret void
}

; Function Attrs: nounwind
declare ptr @asctime(ptr 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 = { 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 #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 = { 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 #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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"commit_list", !10, i64 0, !6, i64 8, !6, i64 16}
!13 = !{!14, !15, i64 0}
!14 = !{!"commit", !15, i64 0, !7, i64 2, !7, i64 22, !7, i64 72, !6, i64 120, !16, i64 128, !16, i64 152, !17, i64 176, !10, i64 192, !10, i64 200}
!15 = !{!"short", !7, i64 0}
!16 = !{!"strbuf", !10, i64 0, !10, i64 8, !6, i64 16}
!17 = !{!"timestamp", !10, i64 0, !6, i64 8}
!18 = !{!14, !6, i64 120}
!19 = !{!20, !6, i64 16}
!20 = !{!"author", !16, i64 0, !16, i64 24}
!21 = !{!20, !6, i64 40}
!22 = !{!14, !6, i64 144}
!23 = !{!14, !6, i64 168}
!24 = !{!14, !6, i64 184}


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

@stdout = external local_unnamed_addr global ptr, align 8
@.str.33 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.83 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.84 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.86 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.87 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.88 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.89 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.90 = 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: inlinehint nounwind uwtable
declare hidden void @print_hash(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @show_commit_node(ptr nocapture noundef readonly %0, i64 noundef %1) local_unnamed_addr #3 {
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.81, i64 noundef %1)
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.82)
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 2
  %8 = load ptr, ptr @stdout, align 8, !tbaa !11
  tail call void @print_hash(ptr noundef nonnull %7, ptr noundef %8)
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = load i16, ptr %9, align 8, !tbaa !12
  %11 = and i16 %10, 22
  %.not = icmp eq i16 %11, 0
  br i1 %.not, label %14, label %12

12:                                               ; preds = %2
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.83)
  %.pre = load ptr, ptr %5, align 8, !tbaa !5
  %.pre12 = load i16, ptr %.pre, align 8, !tbaa !12
  br label %14

14:                                               ; preds = %12, %2
  %15 = phi i16 [ %.pre12, %12 ], [ %10, %2 ]
  %16 = phi ptr [ %.pre, %12 ], [ %9, %2 ]
  %17 = and i16 %15, 1
  %.not11 = icmp eq i16 %17, 0
  %18 = getelementptr inbounds i8, ptr %16, i64 22
  %spec.select = select i1 %.not11, ptr @.str.85, ptr %18
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.84, ptr noundef nonnull %spec.select)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 120
  %22 = load ptr, ptr %21, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %22, i64 16
  %24 = load ptr, ptr %23, align 8, !tbaa !18
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.86, ptr noundef %24)
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 120
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  %29 = getelementptr inbounds i8, ptr %28, i64 40
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.87, ptr noundef %30)
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 144
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.88, ptr noundef %34)
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 168
  %38 = load ptr, ptr %37, align 8, !tbaa !22
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.89, ptr noundef %38)
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 176
  %42 = tail call ptr @localtime(ptr noundef nonnull %41) #4
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 184
  store ptr %42, ptr %44, align 8, !tbaa !23
  %45 = tail call ptr @asctime(ptr noundef %42) #4
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.90, ptr noundef %45)
  %47 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.33)
  ret void
}

; Function Attrs: nounwind
declare ptr @asctime(ptr noundef) local_unnamed_addr #2

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 = { 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 #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 = { 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 #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, !10, i64 8}
!6 = !{!"commit_list", !7, i64 0, !10, i64 8, !10, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!10, !10, i64 0}
!12 = !{!13, !14, i64 0}
!13 = !{!"commit", !14, i64 0, !8, i64 2, !8, i64 22, !8, i64 72, !10, i64 120, !15, i64 128, !15, i64 152, !16, i64 176, !7, i64 192, !7, i64 200}
!14 = !{!"short", !8, i64 0}
!15 = !{!"strbuf", !7, i64 0, !7, i64 8, !10, i64 16}
!16 = !{!"timestamp", !7, i64 0, !10, i64 8}
!17 = !{!13, !10, i64 120}
!18 = !{!19, !10, i64 16}
!19 = !{!"author", !15, i64 0, !15, i64 24}
!20 = !{!19, !10, i64 40}
!21 = !{!13, !10, i64 144}
!22 = !{!13, !10, i64 168}
!23 = !{!13, !10, i64 184}


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