; LLVM IR from joltwallet/jolt_wallet :: components/console/argtable3 (argtable3)

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

@.str.8 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [9 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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare hidden void @arg_cat_optionv(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @arg_print_formatted(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #3

declare i32 @fputc(i32 noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local void @arg_print_glossary_gnu(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [200 x i8], align 16
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %12, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %101, %2
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = sext i32 %15 to i64
  %17 = getelementptr inbounds ptr, ptr %14, i64 %16
  %18 = load ptr, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.arg_hdr, ptr %18, i32 0, i32 0
  %20 = load i8, ptr %19, align 8, !tbaa !11
  %21 = sext i8 %20 to i32
  %22 = and i32 %21, 1
  %23 = icmp ne i32 %22, 0
  %24 = xor i1 %23, true
  br i1 %24, label %25, label %104

25:                                               ; preds = %13
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds ptr, ptr %26, i64 %28
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.arg_hdr, ptr %30, i32 0, i32 4
  %32 = load ptr, ptr %31, align 8, !tbaa !13
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %100

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 200, ptr %7) #6
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 200, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds ptr, ptr %35, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.arg_hdr, ptr %39, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !14
  store ptr %41, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = load i32, ptr %6, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %42, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.arg_hdr, ptr %46, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !15
  store ptr %48, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds ptr, ptr %49, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.arg_hdr, ptr %53, i32 0, i32 3
  %55 = load ptr, ptr %54, align 8, !tbaa !16
  store ptr %55, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds ptr, ptr %56, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.arg_hdr, ptr %60, i32 0, i32 4
  %62 = load ptr, ptr %61, align 8, !tbaa !13
  store ptr %62, ptr %11, align 8, !tbaa !5
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %72, label %65

65:                                               ; preds = %34
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %72

68:                                               ; preds = %65
  %69 = getelementptr inbounds [200 x i8], ptr %7, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 16 %69, i8 32, i64 4, i1 false)
  %70 = getelementptr inbounds [200 x i8], ptr %7, i64 0, i64 0
  %71 = getelementptr inbounds i8, ptr %70, i64 4
  store i8 0, ptr %71, align 1, !tbaa !17
  br label %72

72:                                               ; preds = %68, %65, %34
  %73 = getelementptr inbounds [200 x i8], ptr %7, i64 0, i64 0
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load ptr, ptr %10, align 8, !tbaa !5
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = load i32, ptr %6, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds ptr, ptr %77, i64 %79
  %81 = load ptr, ptr %80, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.arg_hdr, ptr %81, i32 0, i32 0
  %83 = load i8, ptr %82, align 8, !tbaa !11
  %84 = sext i8 %83 to i32
  %85 = and i32 %84, 4
  call void @arg_cat_optionv(ptr noundef %73, i64 noundef 200, ptr noundef %74, ptr noundef %75, ptr noundef %76, i32 noundef %85, ptr noundef @.str.23)
  %86 = getelementptr inbounds [200 x i8], ptr %7, i64 0, i64 0
  %87 = call i64 @strlen(ptr noundef %86) #7
  %88 = icmp ugt i64 %87, 25
  br i1 %88, label %89, label %94

89:                                               ; preds = %72
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds [200 x i8], ptr %7, i64 0, i64 0
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.25, ptr noundef %91, ptr noundef @.str.8) #6
  %93 = getelementptr inbounds [200 x i8], ptr %7, i64 0, i64 0
  store i8 0, ptr %93, align 16, !tbaa !17
  br label %94

94:                                               ; preds = %89, %72
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = getelementptr inbounds [200 x i8], ptr %7, i64 0, i64 0
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %95, ptr noundef @.str.26, ptr noundef %96) #6
  %98 = load ptr, ptr %3, align 8, !tbaa !5
  %99 = load ptr, ptr %11, align 8, !tbaa !5
  call void @arg_print_formatted(ptr noundef %98, i32 noundef 28, i32 noundef 79, ptr noundef %99)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %7) #6
  br label %100

100:                                              ; preds = %94, %25
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %6, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %6, align 4, !tbaa !9
  br label %13, !llvm.loop !18

104:                                              ; preds = %13
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = call i32 @fputc(i32 noundef 10, ptr noundef %105)
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  ret void
}

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"arg_hdr", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !10, i64 40, !10, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!13 = !{!12, !6, i64 32}
!14 = !{!12, !6, i64 8}
!15 = !{!12, !6, i64 16}
!16 = !{!12, !6, i64 24}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"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"

@.str.8 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare hidden void @arg_cat_optionv(ptr noundef, i64 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @arg_print_formatted(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fputc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local void @arg_print_glossary_gnu(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = alloca [200 x i8], align 16
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  %5 = load i8, ptr %4, align 8, !tbaa !9
  %6 = and i8 %5, 1
  %.not27 = icmp eq i8 %6, 0
  br i1 %.not27, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2, %31
  %indvars.iv = phi i64 [ %indvars.iv.next, %31 ], [ 0, %2 ]
  %7 = phi ptr [ %33, %31 ], [ %4, %2 ]
  %8 = getelementptr inbounds i8, ptr %7, i64 32
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %.not26 = icmp eq ptr %9, null
  br i1 %.not26, label %31, label %10

10:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %3) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200) %3, i8 0, i64 200, i1 false)
  %11 = getelementptr inbounds i8, ptr %7, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %7, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %7, i64 24
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = load ptr, ptr %8, align 8, !tbaa !12
  %18 = icmp eq ptr %12, null
  %19 = icmp ne ptr %14, null
  %or.cond = select i1 %18, i1 %19, i1 false
  br i1 %or.cond, label %20, label %21

20:                                               ; preds = %10
  store i32 538976288, ptr %3, align 16
  br label %21

21:                                               ; preds = %20, %10
  %22 = load i8, ptr %7, align 8, !tbaa !9
  %23 = and i8 %22, 4
  %24 = zext nneg i8 %23 to i32
  call void @arg_cat_optionv(ptr noundef nonnull %3, i64 noundef 200, ptr noundef %12, ptr noundef %14, ptr noundef %16, i32 noundef %24, ptr noundef nonnull @.str.23)
  %25 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #6
  %26 = icmp ugt i64 %25, 25
  br i1 %26, label %27, label %29

27:                                               ; preds = %21
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.25, ptr noundef nonnull %3, ptr noundef nonnull @.str.8) #5
  store i8 0, ptr %3, align 16, !tbaa !16
  br label %29

29:                                               ; preds = %27, %21
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str.26, ptr noundef nonnull %3) #5
  call void @arg_print_formatted(ptr noundef %0, i32 noundef 28, i32 noundef 79, ptr noundef %17)
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %3) #5
  br label %31

31:                                               ; preds = %.lr.ph, %29
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %32 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv.next
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = load i8, ptr %33, align 8, !tbaa !9
  %35 = and i8 %34, 1
  %.not = icmp eq i8 %35, 0
  br i1 %.not, label %.lr.ph, label %._crit_edge, !llvm.loop !17

._crit_edge:                                      ; preds = %31, %2
  %36 = call i32 @fputc(i32 noundef 10, ptr noundef %0)
  ret void
}

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

!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, !7, i64 0}
!10 = !{!"arg_hdr", !7, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !11, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 32}
!13 = !{!10, !6, i64 8}
!14 = !{!10, !6, i64 16}
!15 = !{!10, !6, i64 24}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass