; LLVM IR from clibs/clib :: src (clib-search)

; 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.debug_t = type { ptr, i32, i32, ptr }
%struct.command = type { ptr, ptr, ptr, ptr, ptr, i32, [32 x %struct.command_option_t], i32, [32 x ptr], ptr }
%struct.command_option_t = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.list_t = type { ptr, ptr, i32, ptr, ptr }
%struct.list_node = type { ptr, ptr, ptr }
%struct.wiki_package_t = type { ptr, ptr, ptr, ptr }

@opt_color = external hidden global i32, align 4
@opt_cache = external hidden global i32, align 4
@debugger = external dso_local global %struct.debug_t, align 8
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@stderr = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1
@opt_json = external hidden global i32, align 4
@.str.18 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca %struct.command, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  store i32 1, ptr @opt_color, align 4, !tbaa !5
  store i32 1, ptr @opt_cache, align 4, !tbaa !5
  %20 = call i32 @debug_init(ptr noundef @debugger, ptr noundef @.str)
  %21 = call i32 @clib_cache_init(i64 noundef 86400)
  call void @llvm.lifetime.start.p0(i64 2112, ptr %6) #4
  call void @command_init(ptr noundef %6, ptr noundef @.str, ptr noundef @.str.1)
  %22 = getelementptr inbounds %struct.command, ptr %6, i32 0, i32 1
  store ptr @.str.2, ptr %22, align 8, !tbaa !11
  call void @command_option(ptr noundef %6, ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @setopt_nocolor)
  call void @command_option(ptr noundef %6, ptr noundef @.str.6, ptr noundef @.str.7, ptr noundef @.str.8, ptr noundef @setopt_nocache)
  call void @command_option(ptr noundef %6, ptr noundef @.str.9, ptr noundef @.str.10, ptr noundef @.str.11, ptr noundef @setopt_json)
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  call void @command_parse(ptr noundef %6, i32 noundef %23, ptr noundef %24)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %25

25:                                               ; preds = %38, %2
  %26 = load i32, ptr %7, align 4, !tbaa !5
  %27 = getelementptr inbounds %struct.command, ptr %6, i32 0, i32 7
  %28 = load i32, ptr %27, align 8, !tbaa !13
  %29 = icmp slt i32 %26, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %41

31:                                               ; preds = %25
  %32 = getelementptr inbounds %struct.command, ptr %6, i32 0, i32 8
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [32 x ptr], ptr %32, i64 0, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = call ptr @case_lower(ptr noundef %36)
  br label %38

38:                                               ; preds = %31
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %7, align 4, !tbaa !5
  br label %25, !llvm.loop !14

41:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %42 = load i32, ptr @opt_color, align 4, !tbaa !5
  %43 = icmp ne i32 %42, 0
  %44 = zext i1 %43 to i64
  %45 = select i1 %43, i32 7, i32 0
  store i32 %45, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %46 = load i32, ptr @opt_color, align 4, !tbaa !5
  %47 = icmp ne i32 %46, 0
  %48 = zext i1 %47 to i64
  %49 = select i1 %47, i32 9, i32 0
  store i32 %49, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %50 = call ptr @wiki_html_cache()
  store ptr %50, ptr %10, align 8, !tbaa !9
  %51 = load ptr, ptr %10, align 8, !tbaa !9
  %52 = icmp eq ptr null, %51
  br i1 %52, label %53, label %63

53:                                               ; preds = %41
  call void @command_free(ptr noundef %6)
  %54 = load ptr, ptr @stderr, align 8, !tbaa !9
  %55 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 2, ptr noundef %54, ptr noundef @.str.12, ptr noundef @.str.13)
  %56 = load ptr, ptr @stderr, align 8, !tbaa !9
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.14) #4
  %58 = load ptr, ptr @stderr, align 8, !tbaa !9
  %59 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %58, ptr noundef @.str.15)
  %60 = load ptr, ptr @stderr, align 8, !tbaa !9
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.16) #4
  store i32 %61, ptr %11, align 4, !tbaa !5
  %62 = load i32, ptr %11, align 4, !tbaa !5
  store i32 1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %125

63:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %64 = load ptr, ptr %10, align 8, !tbaa !9
  %65 = call ptr @wiki_registry_parse(ptr noundef %64)
  store ptr %65, ptr %13, align 8, !tbaa !9
  %66 = load ptr, ptr %10, align 8, !tbaa !9
  call void @free(ptr noundef %66) #4
  %67 = load ptr, ptr %13, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.list_t, ptr %67, i32 0, i32 2
  %69 = load i32, ptr %68, align 8, !tbaa !16
  call void (ptr, ptr, ...) @debug(ptr noundef @debugger, ptr noundef @.str.17, i32 noundef %69)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %70 = load ptr, ptr %13, align 8, !tbaa !9
  %71 = call ptr @list_iterator_new(ptr noundef %70, i32 noundef 0)
  store ptr %71, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store ptr null, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store ptr null, ptr %17, align 8, !tbaa !9
  %72 = load i32, ptr @opt_json, align 4, !tbaa !5
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %78

74:                                               ; preds = %63
  %75 = call ptr @json_value_init_array()
  store ptr %75, ptr %17, align 8, !tbaa !9
  %76 = load ptr, ptr %17, align 8, !tbaa !9
  %77 = call ptr @json_value_get_array(ptr noundef %76)
  store ptr %77, ptr %16, align 8, !tbaa !9
  br label %78

78:                                               ; preds = %74, %63
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  br label %80

80:                                               ; preds = %110, %78
  %81 = load ptr, ptr %15, align 8, !tbaa !9
  %82 = call ptr @list_iterator_next(ptr noundef %81)
  store ptr %82, ptr %14, align 8, !tbaa !9
  %83 = icmp ne ptr %82, null
  br i1 %83, label %84, label %112

84:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %85 = load ptr, ptr %14, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.list_node, ptr %85, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !18
  store ptr %87, ptr %18, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.command, ptr %6, i32 0, i32 7
  %89 = load i32, ptr %88, align 8, !tbaa !13
  %90 = getelementptr inbounds %struct.command, ptr %6, i32 0, i32 8
  %91 = getelementptr inbounds [32 x ptr], ptr %90, i64 0, i64 0
  %92 = load ptr, ptr %18, align 8, !tbaa !9
  %93 = call i32 @matches(i32 noundef %89, ptr noundef %91, ptr noundef %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %106

95:                                               ; preds = %84
  %96 = load i32, ptr @opt_json, align 4, !tbaa !5
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %101

98:                                               ; preds = %95
  %99 = load ptr, ptr %18, align 8, !tbaa !9
  %100 = load ptr, ptr %16, align 8, !tbaa !9
  call void @add_package_to_json(ptr noundef %99, ptr noundef %100)
  br label %105

101:                                              ; preds = %95
  %102 = load ptr, ptr %18, align 8, !tbaa !9
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = load i32, ptr %9, align 4, !tbaa !5
  call void @display_package(ptr noundef %102, i32 noundef %103, i32 noundef %104)
  br label %105

105:                                              ; preds = %101, %98
  br label %110

106:                                              ; preds = %84
  %107 = load ptr, ptr %18, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.wiki_package_t, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !20
  call void (ptr, ptr, ...) @debug(ptr noundef @debugger, ptr noundef @.str.18, ptr noundef %109)
  br label %110

110:                                              ; preds = %106, %105
  %111 = load ptr, ptr %18, align 8, !tbaa !9
  call void @wiki_package_free(ptr noundef %111)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %80, !llvm.loop !22

112:                                              ; preds = %80
  %113 = load i32, ptr @opt_json, align 4, !tbaa !5
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %122

115:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  %116 = load ptr, ptr %17, align 8, !tbaa !9
  %117 = call ptr @json_serialize_to_string_pretty(ptr noundef %116)
  store ptr %117, ptr %19, align 8, !tbaa !9
  %118 = load ptr, ptr %19, align 8, !tbaa !9
  %119 = call i32 @puts(ptr noundef %118)
  %120 = load ptr, ptr %19, align 8, !tbaa !9
  call void @json_free_serialized_string(ptr noundef %120)
  %121 = load ptr, ptr %17, align 8, !tbaa !9
  call void @json_value_free(ptr noundef %121)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  br label %122

122:                                              ; preds = %115, %112
  %123 = load ptr, ptr %15, align 8, !tbaa !9
  call void @list_iterator_destroy(ptr noundef %123)
  %124 = load ptr, ptr %13, align 8, !tbaa !9
  call void @list_destroy(ptr noundef %124)
  call void @command_free(ptr noundef %6)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %125

125:                                              ; preds = %122, %53
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 2112, ptr %6) #4
  %126 = load i32, ptr %3, align 4
  ret i32 %126
}

declare i32 @debug_init(ptr noundef, ptr noundef) #1

declare i32 @clib_cache_init(i64 noundef) #1

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

declare void @command_init(ptr noundef, ptr noundef, ptr noundef) #1

declare void @command_option(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @setopt_nocolor(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @setopt_nocache(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @setopt_json(ptr noundef) #0

declare void @command_parse(ptr noundef, i32 noundef, ptr noundef) #1

declare ptr @case_lower(ptr noundef) #1

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

declare void @command_free(ptr noundef) #1

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

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

declare ptr @wiki_registry_parse(ptr noundef) #1

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

declare void @debug(ptr noundef, ptr noundef, ...) #1

declare ptr @list_iterator_new(ptr noundef, i32 noundef) #1

declare ptr @json_value_init_array() #1

declare ptr @json_value_get_array(ptr noundef) #1

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

declare ptr @list_iterator_next(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @matches(i32 noundef, ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @add_package_to_json(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @display_package(ptr noundef, i32 noundef, i32 noundef) #0

declare void @wiki_package_free(ptr noundef) #1

declare ptr @json_serialize_to_string_pretty(ptr noundef) #1

declare i32 @puts(ptr noundef) #1

declare void @json_free_serialized_string(ptr noundef) #1

declare void @json_value_free(ptr noundef) #1

declare void @list_iterator_destroy(ptr noundef) #1

declare void @list_destroy(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @wiki_html_cache() #0

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

!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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"command", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !7, i64 48, !6, i64 1840, !7, i64 1848, !10, i64 2104}
!13 = !{!12, !6, i64 1840}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !6, i64 16}
!17 = !{!"", !10, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !10, i64 32}
!18 = !{!19, !10, i64 16}
!19 = !{!"list_node", !10, i64 0, !10, i64 8, !10, i64 16}
!20 = !{!21, !10, i64 0}
!21 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!22 = distinct !{!22, !15}


; 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.debug_t = type { ptr, i32, i32, ptr }
%struct.command = type { ptr, ptr, ptr, ptr, ptr, i32, [32 x %struct.command_option_t], i32, [32 x ptr], ptr }
%struct.command_option_t = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr }

@opt_color = external hidden local_unnamed_addr global i32, align 4
@opt_cache = external hidden local_unnamed_addr global i32, align 4
@debugger = external dso_local global %struct.debug_t, align 8
@.str = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [19 x i8], align 1
@opt_json = external hidden local_unnamed_addr global i32, align 4
@.str.18 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.command, align 8
  store i32 1, ptr @opt_color, align 4, !tbaa !5
  store i32 1, ptr @opt_cache, align 4, !tbaa !5
  %4 = tail call i32 @debug_init(ptr noundef nonnull @debugger, ptr noundef nonnull @.str) #5
  %5 = tail call i32 @clib_cache_init(i64 noundef 86400) #5
  call void @llvm.lifetime.start.p0(i64 2112, ptr nonnull %3) #5
  call void @command_init(ptr noundef nonnull %3, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1) #5
  %6 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr @.str.2, ptr %6, align 8, !tbaa !9
  call void @command_option(ptr noundef nonnull %3, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull @setopt_nocolor) #5
  call void @command_option(ptr noundef nonnull %3, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, ptr noundef nonnull @setopt_nocache) #5
  call void @command_option(ptr noundef nonnull %3, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.11, ptr noundef nonnull @setopt_json) #5
  call void @command_parse(ptr noundef nonnull %3, i32 noundef %0, ptr noundef %1) #5
  %7 = getelementptr inbounds i8, ptr %3, i64 1840
  %8 = load i32, ptr %7, align 8, !tbaa !12
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %2
  %10 = getelementptr inbounds i8, ptr %3, i64 1848
  br label %16

._crit_edge:                                      ; preds = %16, %2
  %11 = load i32, ptr @opt_color, align 4, !tbaa !5
  %.not = icmp eq i32 %11, 0
  %12 = select i1 %.not, i32 0, i32 7
  %13 = select i1 %.not, i32 0, i32 9
  %14 = call ptr @wiki_html_cache()
  %15 = icmp eq ptr %14, null
  br i1 %15, label %23, label %32

16:                                               ; preds = %.lr.ph, %16
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %16 ]
  %17 = getelementptr inbounds [32 x ptr], ptr %10, i64 0, i64 %indvars.iv
  %18 = load ptr, ptr %17, align 8, !tbaa !13
  %19 = call ptr @case_lower(ptr noundef %18) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %7, align 8, !tbaa !12
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %16, label %._crit_edge, !llvm.loop !14

23:                                               ; preds = %._crit_edge
  call void @command_free(ptr noundef nonnull %3) #5
  %24 = load ptr, ptr @stderr, align 8, !tbaa !13
  %25 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 2, ptr noundef %24, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13) #5
  %26 = load ptr, ptr @stderr, align 8, !tbaa !13
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str.14) #6
  %28 = load ptr, ptr @stderr, align 8, !tbaa !13
  %29 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %28, ptr noundef nonnull @.str.15) #5
  %30 = load ptr, ptr @stderr, align 8, !tbaa !13
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str.16) #6
  br label %64

32:                                               ; preds = %._crit_edge
  %33 = call ptr @wiki_registry_parse(ptr noundef nonnull %14) #5
  call void @free(ptr noundef nonnull %14) #5
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load i32, ptr %34, align 8, !tbaa !16
  call void (ptr, ptr, ...) @debug(ptr noundef nonnull @debugger, ptr noundef nonnull @.str.17, i32 noundef %35) #5
  %36 = call ptr @list_iterator_new(ptr noundef %33, i32 noundef 0) #5
  %37 = load i32, ptr @opt_json, align 4, !tbaa !5
  %.not33 = icmp eq i32 %37, 0
  br i1 %.not33, label %41, label %38

38:                                               ; preds = %32
  %39 = call ptr @json_value_init_array() #5
  %40 = call ptr @json_value_get_array(ptr noundef %39) #5
  br label %41

41:                                               ; preds = %38, %32
  %.030 = phi ptr [ %40, %38 ], [ null, %32 ]
  %.029 = phi ptr [ %39, %38 ], [ null, %32 ]
  %42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %43 = call ptr @list_iterator_next(ptr noundef %36) #5
  %.not3439 = icmp eq ptr %43, null
  br i1 %.not3439, label %._crit_edge42, label %.lr.ph41

.lr.ph41:                                         ; preds = %41
  %44 = getelementptr inbounds i8, ptr %3, i64 1848
  br label %45

45:                                               ; preds = %.lr.ph41, %57
  %46 = phi ptr [ %43, %.lr.ph41 ], [ %58, %57 ]
  %47 = getelementptr inbounds i8, ptr %46, i64 16
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = load i32, ptr %7, align 8, !tbaa !12
  %50 = call i32 @matches(i32 noundef %49, ptr noundef nonnull %44, ptr noundef %48)
  %.not36 = icmp eq i32 %50, 0
  br i1 %.not36, label %55, label %51

51:                                               ; preds = %45
  %52 = load i32, ptr @opt_json, align 4, !tbaa !5
  %.not37 = icmp eq i32 %52, 0
  br i1 %.not37, label %54, label %53

53:                                               ; preds = %51
  call void @add_package_to_json(ptr noundef %48, ptr noundef %.030)
  br label %57

54:                                               ; preds = %51
  call void @display_package(ptr noundef %48, i32 noundef %12, i32 noundef %13)
  br label %57

55:                                               ; preds = %45
  %56 = load ptr, ptr %48, align 8, !tbaa !20
  call void (ptr, ptr, ...) @debug(ptr noundef nonnull @debugger, ptr noundef nonnull @.str.18, ptr noundef %56) #5
  br label %57

57:                                               ; preds = %53, %54, %55
  call void @wiki_package_free(ptr noundef %48) #5
  %58 = call ptr @list_iterator_next(ptr noundef %36) #5
  %.not34 = icmp eq ptr %58, null
  br i1 %.not34, label %._crit_edge42, label %45, !llvm.loop !22

._crit_edge42:                                    ; preds = %57, %41
  %59 = load i32, ptr @opt_json, align 4, !tbaa !5
  %.not35 = icmp eq i32 %59, 0
  br i1 %.not35, label %63, label %60

60:                                               ; preds = %._crit_edge42
  %61 = call ptr @json_serialize_to_string_pretty(ptr noundef %.029) #5
  %62 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %61)
  call void @json_free_serialized_string(ptr noundef %61) #5
  call void @json_value_free(ptr noundef %.029) #5
  br label %63

63:                                               ; preds = %60, %._crit_edge42
  call void @list_iterator_destroy(ptr noundef %36) #5
  call void @list_destroy(ptr noundef %33) #5
  call void @command_free(ptr noundef nonnull %3) #5
  br label %64

64:                                               ; preds = %63, %23
  %.0 = phi i32 [ 1, %23 ], [ 0, %63 ]
  call void @llvm.lifetime.end.p0(i64 2112, ptr nonnull %3) #5
  ret i32 %.0
}

declare i32 @debug_init(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @clib_cache_init(i64 noundef) local_unnamed_addr #1

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

declare void @command_init(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @command_option(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden void @setopt_nocolor(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @setopt_nocache(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare hidden void @setopt_json(ptr noundef) #0

declare void @command_parse(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare ptr @case_lower(ptr noundef) local_unnamed_addr #1

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

declare void @command_free(ptr noundef) local_unnamed_addr #1

declare i32 @cc_fprintf(i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

declare ptr @wiki_registry_parse(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

declare void @debug(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare ptr @list_iterator_new(ptr noundef, i32 noundef) local_unnamed_addr #1

declare ptr @json_value_init_array() local_unnamed_addr #1

declare ptr @json_value_get_array(ptr noundef) local_unnamed_addr #1

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

declare ptr @list_iterator_next(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @matches(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @add_package_to_json(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden void @display_package(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

declare void @wiki_package_free(ptr noundef) local_unnamed_addr #1

declare ptr @json_serialize_to_string_pretty(ptr noundef) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3

declare void @json_free_serialized_string(ptr noundef) local_unnamed_addr #1

declare void @json_value_free(ptr noundef) local_unnamed_addr #1

declare void @list_iterator_destroy(ptr noundef) local_unnamed_addr #1

declare void @list_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @wiki_html_cache() local_unnamed_addr #0

attributes #0 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { cold 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", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !6, i64 40, !7, i64 48, !6, i64 1840, !7, i64 1848, !11, i64 2104}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 1840}
!13 = !{!11, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !6, i64 16}
!17 = !{!"", !11, i64 0, !11, i64 8, !6, i64 16, !11, i64 24, !11, i64 32}
!18 = !{!19, !11, i64 16}
!19 = !{!"list_node", !11, i64 0, !11, i64 8, !11, i64 16}
!20 = !{!21, !11, i64 0}
!21 = !{!"", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!22 = distinct !{!22, !15}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass