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

; 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.command_type = type { i32, ptr, ptr }

@cmds = external hidden global [17 x %struct.command_type], align 16
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [91 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

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

; Function Attrs: nounwind uwtable
define dso_local void @print_help() #2 {
  %1 = alloca i32, align 4
  %2 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %3

3:                                                ; preds = %19, %0
  %4 = load i32, ptr %1, align 4, !tbaa !5
  %5 = icmp slt i32 %4, 14
  br i1 %5, label %7, label %6

6:                                                ; preds = %3
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  br label %22

7:                                                ; preds = %3
  %8 = load i32, ptr %1, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds [17 x %struct.command_type], ptr @cmds, i64 0, i64 %9
  %11 = getelementptr inbounds %struct.command_type, ptr %10, i32 0, i32 1
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [17 x %struct.command_type], ptr @cmds, i64 0, i64 %14
  %16 = getelementptr inbounds %struct.command_type, ptr %15, i32 0, i32 2
  %17 = load ptr, ptr %16, align 8, !tbaa !12
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, ptr noundef %12, ptr noundef %17)
  br label %19

19:                                               ; preds = %7
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = add nsw i32 %20, 1
  store i32 %21, ptr %1, align 4, !tbaa !5
  br label %3, !llvm.loop !13

22:                                               ; preds = %6
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"command_type", !6, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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.command_type = type { i32, ptr, ptr }

@cmds = external hidden local_unnamed_addr global [17 x %struct.command_type], align 16
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [91 x i8], align 1

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @print_help() local_unnamed_addr #1 {
  %1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %2 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 8), align 8, !tbaa !5
  %3 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 16), align 16, !tbaa !11
  %4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %2, ptr noundef %3)
  %5 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 32), align 16, !tbaa !5
  %6 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 40), align 8, !tbaa !11
  %7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %5, ptr noundef %6)
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 56), align 8, !tbaa !5
  %9 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 64), align 16, !tbaa !11
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %8, ptr noundef %9)
  %11 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 80), align 16, !tbaa !5
  %12 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 88), align 8, !tbaa !11
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %11, ptr noundef %12)
  %14 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 104), align 8, !tbaa !5
  %15 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 112), align 16, !tbaa !11
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %14, ptr noundef %15)
  %17 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 128), align 16, !tbaa !5
  %18 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 136), align 8, !tbaa !11
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %17, ptr noundef %18)
  %20 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 152), align 8, !tbaa !5
  %21 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 160), align 16, !tbaa !11
  %22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %20, ptr noundef %21)
  %23 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 176), align 16, !tbaa !5
  %24 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 184), align 8, !tbaa !11
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %23, ptr noundef %24)
  %26 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 200), align 8, !tbaa !5
  %27 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 208), align 16, !tbaa !11
  %28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %26, ptr noundef %27)
  %29 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 224), align 16, !tbaa !5
  %30 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 232), align 8, !tbaa !11
  %31 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %29, ptr noundef %30)
  %32 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 248), align 8, !tbaa !5
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 256), align 16, !tbaa !11
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %32, ptr noundef %33)
  %35 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 272), align 16, !tbaa !5
  %36 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 280), align 8, !tbaa !11
  %37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %35, ptr noundef %36)
  %38 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 296), align 8, !tbaa !5
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 304), align 16, !tbaa !11
  %40 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %38, ptr noundef %39)
  %41 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 320), align 16, !tbaa !5
  %42 = load ptr, ptr getelementptr inbounds (i8, ptr @cmds, i64 328), align 8, !tbaa !11
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, ptr noundef %41, ptr noundef %42)
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  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 = { 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, !10, i64 8}
!6 = !{!"command_type", !7, i64 0, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}


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