; 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.57 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [57 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(ptr noundef, ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local void @print_html_node(ptr noundef %0, i64 noundef %1) #4 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.commit_list, ptr %6, i32 0, i32 1
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  store ptr %8, ptr %5, align 8, !tbaa !5
  %9 = load i64, ptr %4, align 8, !tbaa !9
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.91, i64 noundef %9)
  %11 = call i32 (ptr, ...) @printf(ptr noundef @.str.57)
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.commit, ptr %12, i32 0, i32 1
  %14 = getelementptr inbounds [20 x i8], ptr %13, i64 0, i64 0
  %15 = load ptr, ptr @stdout, align 8, !tbaa !5
  call void @print_hash(ptr noundef %14, ptr noundef %15)
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.60)
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.commit, ptr %17, i32 0, i32 0
  %19 = load i16, ptr %18, align 8, !tbaa !13
  %20 = sext i16 %19 to i32
  %21 = and i32 %20, 22
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %25

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

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

32:                                               ; preds = %25
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.commit, ptr %33, i32 0, i32 2
  %35 = getelementptr inbounds [50 x i8], ptr %34, i64 0, i64 0
  br label %37

36:                                               ; preds = %25
  br label %37

37:                                               ; preds = %36, %32
  %38 = phi ptr [ %35, %32 ], [ @.str.85, %36 ]
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.93, ptr noundef %38)
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.commit_list, ptr %40, i32 0, i32 1
  %42 = load ptr, ptr %41, align 8, !tbaa !11
  %43 = getelementptr inbounds %struct.commit, ptr %42, i32 0, i32 7
  %44 = getelementptr inbounds %struct.timestamp, ptr %43, i32 0, i32 0
  %45 = call ptr @localtime(ptr noundef %44) #5
  %46 = load ptr, ptr %3, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.commit_list, ptr %46, i32 0, i32 1
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = getelementptr inbounds %struct.commit, ptr %48, i32 0, i32 7
  %50 = getelementptr inbounds %struct.timestamp, ptr %49, i32 0, i32 1
  store ptr %45, ptr %50, align 8, !tbaa !18
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.commit, ptr %51, i32 0, i32 4
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = getelementptr inbounds %struct.author, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds %struct.strbuf, ptr %54, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !20
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.commit, ptr %57, i32 0, i32 4
  %59 = load ptr, ptr %58, align 8, !tbaa !19
  %60 = getelementptr inbounds %struct.author, ptr %59, i32 0, i32 1
  %61 = getelementptr inbounds %struct.strbuf, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !22
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %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 !23
  %67 = load ptr, ptr %5, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.commit, ptr %67, i32 0, i32 6
  %69 = getelementptr inbounds %struct.strbuf, ptr %68, i32 0, i32 2
  %70 = load ptr, ptr %69, align 8, !tbaa !24
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.commit_list, ptr %71, i32 0, i32 1
  %73 = load ptr, ptr %72, align 8, !tbaa !11
  %74 = getelementptr inbounds %struct.commit, ptr %73, i32 0, i32 7
  %75 = getelementptr inbounds %struct.timestamp, ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !18
  %77 = call ptr @asctime(ptr noundef %76) #5
  %78 = call i32 (ptr, ...) @printf(ptr noundef @.str.94, ptr noundef %56, ptr noundef %62, ptr noundef %66, ptr noundef %70, ptr noundef %77)
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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 = { 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 #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 = !{!"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 184}
!19 = !{!14, !6, i64 120}
!20 = !{!21, !6, i64 16}
!21 = !{!"author", !16, i64 0, !16, i64 24}
!22 = !{!21, !6, i64 40}
!23 = !{!14, !6, i64 144}
!24 = !{!14, !6, i64 168}


; 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.57 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.85 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.91 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.92 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.93 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.94 = external hidden unnamed_addr constant [57 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
declare ptr @asctime(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @print_html_node(ptr nocapture noundef readonly %0, i64 noundef %1) local_unnamed_addr #3 {
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.91, i64 noundef %1)
  %6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.57)
  %7 = getelementptr inbounds i8, ptr %4, i64 2
  %8 = load ptr, ptr @stdout, align 8, !tbaa !11
  tail call void @print_hash(ptr noundef nonnull %7, ptr noundef %8)
  %9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.60)
  %10 = load i16, ptr %4, 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.92)
  %.pre = load i16, ptr %4, align 8, !tbaa !12
  br label %14

14:                                               ; preds = %12, %2
  %15 = phi i16 [ %.pre, %12 ], [ %10, %2 ]
  %16 = and i16 %15, 1
  %.not12 = icmp eq i16 %16, 0
  %17 = getelementptr inbounds i8, ptr %4, i64 22
  %18 = select i1 %.not12, ptr @.str.85, ptr %17
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.93, ptr noundef nonnull %18)
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 176
  %22 = tail call ptr @localtime(ptr noundef nonnull %21) #4
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 184
  store ptr %22, ptr %24, align 8, !tbaa !17
  %25 = getelementptr inbounds i8, ptr %4, i64 120
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = getelementptr inbounds i8, ptr %26, i64 40
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %4, i64 144
  %32 = load ptr, ptr %31, align 8, !tbaa !22
  %33 = getelementptr inbounds i8, ptr %4, i64 168
  %34 = load ptr, ptr %33, align 8, !tbaa !23
  %35 = tail call ptr @asctime(ptr noundef %22) #4
  %36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.94, ptr noundef %28, ptr noundef %30, ptr noundef %32, ptr noundef %34, ptr noundef %35)
  ret void
}

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 184}
!18 = !{!13, !10, i64 120}
!19 = !{!20, !10, i64 16}
!20 = !{!"author", !15, i64 0, !15, i64 24}
!21 = !{!20, !10, i64 40}
!22 = !{!13, !10, i64 144}
!23 = !{!13, !10, i64 168}


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