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

; 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.options = type { ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct.clib_package_opts_t = type { i32, i32, i32, ptr, 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 }

@debugger = external dso_local global %struct.debug_t, align 8
@opts = external hidden global %struct.options, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1
@stderr = external global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@package_opts = external hidden global %struct.clib_package_opts_t, align 8
@.str.27 = external hidden unnamed_addr constant [11 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 i64, align 8
  %7 = alloca %struct.command, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  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 getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 5), align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  store i64 4096, ptr %6, align 8, !tbaa !13
  %14 = call i32 @debug_init(ptr noundef @debugger, ptr noundef @.str)
  %15 = call i32 @clib_cache_init(i64 noundef 2592000)
  call void @llvm.lifetime.start.p0(i64 2112, ptr %7) #9
  call void @command_init(ptr noundef %7, ptr noundef @.str, ptr noundef @.str.1)
  %16 = getelementptr inbounds %struct.command, ptr %7, i32 0, i32 1
  store ptr @.str.2, ptr %16, align 8, !tbaa !15
  call void @command_option(ptr noundef %7, ptr noundef @.str.3, ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @setopt_prefix)
  call void @command_option(ptr noundef %7, ptr noundef @.str.6, ptr noundef @.str.7, ptr noundef @.str.8, ptr noundef @setopt_quiet)
  call void @command_option(ptr noundef %7, ptr noundef @.str.9, ptr noundef @.str.10, ptr noundef @.str.11, ptr noundef @setopt_force)
  call void @command_option(ptr noundef %7, ptr noundef @.str.12, ptr noundef @.str.13, ptr noundef @.str.14, ptr noundef @setopt_token)
  call void @command_option(ptr noundef %7, ptr noundef @.str.15, ptr noundef @.str.16, ptr noundef @.str.17, ptr noundef @setopt_slug)
  call void @command_option(ptr noundef %7, ptr noundef @.str.18, ptr noundef @.str.19, ptr noundef @.str.20, ptr noundef @setopt_tag)
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !9
  call void @command_parse(ptr noundef %7, i32 noundef %17, ptr noundef %18)
  %19 = getelementptr inbounds %struct.command, ptr %7, i32 0, i32 7
  %20 = load i32, ptr %19, align 8, !tbaa !17
  call void (ptr, ptr, ...) @debug(ptr noundef @debugger, ptr noundef @.str.21, i32 noundef %20)
  %21 = call i32 @curl_global_init(i64 noundef 3)
  %22 = icmp ne i32 0, %21
  br i1 %22, label %23, label %33

23:                                               ; preds = %2
  %24 = load ptr, ptr @stderr, align 8, !tbaa !9
  %25 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 2, ptr noundef %24, ptr noundef @.str.22, ptr noundef @.str.23)
  %26 = load ptr, ptr @stderr, align 8, !tbaa !9
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str.24) #9
  %28 = load ptr, ptr @stderr, align 8, !tbaa !9
  %29 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %28, ptr noundef @.str.25)
  %30 = load ptr, ptr @stderr, align 8, !tbaa !9
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.26) #9
  store i32 %31, ptr %8, align 4, !tbaa !5
  %32 = load i32, ptr %8, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %23, %2
  %34 = load ptr, ptr @opts, align 8, !tbaa !18
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %52

36:                                               ; preds = %33
  %37 = load i64, ptr %6, align 8, !tbaa !13
  %38 = call ptr @llvm.stacksave.p0()
  store ptr %38, ptr %9, align 8
  %39 = alloca i8, i64 %37, align 16
  store i64 %37, ptr %10, align 8
  %40 = load i64, ptr %6, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 16 %39, i8 0, i64 %40, i1 false)
  %41 = load ptr, ptr @opts, align 8, !tbaa !18
  %42 = call ptr @realpath(ptr noundef %41, ptr noundef %39) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %43 = call i64 @strlen(ptr noundef %39) #10
  %44 = add i64 %43, 1
  store i64 %44, ptr %11, align 8, !tbaa !13
  %45 = load i64, ptr %11, align 8, !tbaa !13
  %46 = call noalias ptr @malloc(i64 noundef %45) #11
  store ptr %46, ptr @opts, align 8, !tbaa !18
  %47 = load ptr, ptr @opts, align 8, !tbaa !18
  %48 = load i64, ptr %11, align 8, !tbaa !13
  call void @llvm.memset.p0.i64(ptr align 1 %47, i8 0, i64 %48, i1 false)
  %49 = load ptr, ptr @opts, align 8, !tbaa !18
  %50 = load i64, ptr %11, align 8, !tbaa !13
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %49, ptr align 16 %39, i64 %50, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  %51 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %51)
  br label %52

52:                                               ; preds = %36, %33
  %53 = call i32 @clib_cache_init(i64 noundef 2592000)
  store i32 1, ptr @package_opts, align 8, !tbaa !19
  %54 = load ptr, ptr @opts, align 8, !tbaa !18
  store ptr %54, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @package_opts, i32 0, i32 3), align 8, !tbaa !21
  store i32 1, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @package_opts, i32 0, i32 2), align 8, !tbaa !22
  %55 = load i32, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 6), align 4, !tbaa !23
  store i32 %55, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @package_opts, i32 0, i32 1), align 4, !tbaa !24
  %56 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 1), align 8, !tbaa !25
  store ptr %56, ptr getelementptr inbounds (%struct.clib_package_opts_t, ptr @package_opts, i32 0, i32 5), align 8, !tbaa !26
  call void @clib_package_set_opts(ptr noundef byval(%struct.clib_package_opts_t) align 8 @package_opts)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  store ptr null, ptr %12, align 8, !tbaa !9
  %57 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 3), align 8, !tbaa !27
  %58 = icmp eq ptr null, %57
  br i1 %58, label %59, label %68

59:                                               ; preds = %52
  %60 = getelementptr inbounds %struct.command, ptr %7, i32 0, i32 8
  %61 = getelementptr inbounds [32 x ptr], ptr %60, i64 0, i64 0
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  %63 = icmp ne ptr null, %62
  br i1 %63, label %64, label %68

64:                                               ; preds = %59
  %65 = getelementptr inbounds %struct.command, ptr %7, i32 0, i32 8
  %66 = getelementptr inbounds [32 x ptr], ptr %65, i64 0, i64 0
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  store ptr %67, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 3), align 8, !tbaa !27
  br label %68

68:                                               ; preds = %64, %59, %52
  %69 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 2), align 8, !tbaa !28
  %70 = icmp eq ptr null, %69
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  store ptr @.str.27, ptr %12, align 8, !tbaa !9
  br label %74

72:                                               ; preds = %68
  %73 = load ptr, ptr getelementptr inbounds (%struct.options, ptr @opts, i32 0, i32 2), align 8, !tbaa !28
  store ptr %73, ptr %12, align 8, !tbaa !9
  br label %74

74:                                               ; preds = %72, %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %75 = load ptr, ptr %12, align 8, !tbaa !9
  %76 = call i32 @install_package(ptr noundef %75)
  store i32 %76, ptr %13, align 4, !tbaa !5
  call void @curl_global_cleanup()
  call void (...) @clib_package_cleanup()
  call void @command_free(ptr noundef %7)
  %77 = load i32, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 2112, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  ret i32 %77
}

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

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

declare i32 @clib_cache_init(i64 noundef) #2

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

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

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

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

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

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

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

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

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

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

declare i32 @curl_global_init(i64 noundef) #2

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #7

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

declare void @clib_package_set_opts(ptr noundef byval(%struct.clib_package_opts_t) align 8) #2

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

declare void @curl_global_cleanup() #2

declare void @clib_package_cleanup(...) #2

declare void @command_free(ptr noundef) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { nounwind allocsize(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 #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { nounwind allocsize(0) }

!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, !6, i64 40}
!12 = !{!"options", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !6, i64 44}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"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}
!17 = !{!16, !6, i64 1840}
!18 = !{!12, !10, i64 0}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16, !6, i64 24, !10, i64 32}
!21 = !{!20, !10, i64 16}
!22 = !{!20, !6, i64 8}
!23 = !{!12, !6, i64 44}
!24 = !{!20, !6, i64 4}
!25 = !{!12, !10, i64 8}
!26 = !{!20, !10, i64 32}
!27 = !{!12, !10, i64 24}
!28 = !{!12, !10, i64 16}


; 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.options = type { ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct.clib_package_opts_t = type { i32, i32, i32, ptr, 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 }

@debugger = external dso_local global %struct.debug_t, align 8
@opts = external hidden local_unnamed_addr global %struct.options, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.22 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [2 x i8], align 1
@package_opts = external hidden global %struct.clib_package_opts_t, align 8
@.str.27 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.command, align 8
  store i32 1, ptr getelementptr inbounds (i8, ptr @opts, i64 40), align 8, !tbaa !5
  %4 = tail call i32 @debug_init(ptr noundef nonnull @debugger, ptr noundef nonnull @.str) #9
  %5 = tail call i32 @clib_cache_init(i64 noundef 2592000) #9
  call void @llvm.lifetime.start.p0(i64 2112, ptr nonnull %3) #9
  call void @command_init(ptr noundef nonnull %3, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1) #9
  %6 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr @.str.2, ptr %6, align 8, !tbaa !11
  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_prefix) #9
  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_quiet) #9
  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_force) #9
  call void @command_option(ptr noundef nonnull %3, ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.14, ptr noundef nonnull @setopt_token) #9
  call void @command_option(ptr noundef nonnull %3, ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.17, ptr noundef nonnull @setopt_slug) #9
  call void @command_option(ptr noundef nonnull %3, ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.19, ptr noundef nonnull @.str.20, ptr noundef nonnull @setopt_tag) #9
  call void @command_parse(ptr noundef nonnull %3, i32 noundef %0, ptr noundef %1) #9
  %7 = getelementptr inbounds i8, ptr %3, i64 1840
  %8 = load i32, ptr %7, align 8, !tbaa !13
  call void (ptr, ptr, ...) @debug(ptr noundef nonnull @debugger, ptr noundef nonnull @.str.21, i32 noundef %8) #9
  %9 = call i32 @curl_global_init(i64 noundef 3) #9
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %19, label %10

10:                                               ; preds = %2
  %11 = load ptr, ptr @stderr, align 8, !tbaa !14
  %12 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 2, ptr noundef %11, ptr noundef nonnull @.str.22, ptr noundef nonnull @.str.23) #9
  %13 = load ptr, ptr @stderr, align 8, !tbaa !14
  %14 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.24) #10
  %15 = load ptr, ptr @stderr, align 8, !tbaa !14
  %16 = call i32 (i32, ptr, ptr, ...) @cc_fprintf(i32 noundef 9, ptr noundef %15, ptr noundef nonnull @.str.25) #9
  %17 = load ptr, ptr @stderr, align 8, !tbaa !14
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.26) #10
  br label %19

19:                                               ; preds = %10, %2
  %20 = load ptr, ptr @opts, align 8, !tbaa !15
  %.not15 = icmp eq ptr %20, null
  br i1 %.not15, label %28, label %21

21:                                               ; preds = %19
  %22 = call ptr @llvm.stacksave.p0()
  %23 = alloca [4096 x i8], align 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4096) %23, i8 0, i64 4096, i1 false)
  %24 = load ptr, ptr @opts, align 8, !tbaa !15
  %25 = call ptr @realpath(ptr noundef %24, ptr noundef nonnull %23) #9
  %26 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %23) #11
  %27 = add i64 %26, 1
  %calloc = call ptr @calloc(i64 1, i64 %27)
  store ptr %calloc, ptr @opts, align 8, !tbaa !15
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %calloc, ptr nonnull align 16 %23, i64 %27, i1 false)
  call void @llvm.stackrestore.p0(ptr %22)
  br label %28

28:                                               ; preds = %21, %19
  %29 = call i32 @clib_cache_init(i64 noundef 2592000) #9
  store i32 1, ptr @package_opts, align 8, !tbaa !16
  %30 = load ptr, ptr @opts, align 8, !tbaa !15
  store ptr %30, ptr getelementptr inbounds (i8, ptr @package_opts, i64 16), align 8, !tbaa !18
  store i32 1, ptr getelementptr inbounds (i8, ptr @package_opts, i64 8), align 8, !tbaa !19
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @opts, i64 44), align 4, !tbaa !20
  store i32 %31, ptr getelementptr inbounds (i8, ptr @package_opts, i64 4), align 4, !tbaa !21
  %32 = load ptr, ptr getelementptr inbounds (i8, ptr @opts, i64 8), align 8, !tbaa !22
  store ptr %32, ptr getelementptr inbounds (i8, ptr @package_opts, i64 32), align 8, !tbaa !23
  call void @clib_package_set_opts(ptr noundef nonnull byval(%struct.clib_package_opts_t) align 8 @package_opts) #9
  %33 = load ptr, ptr getelementptr inbounds (i8, ptr @opts, i64 24), align 8, !tbaa !24
  %34 = icmp eq ptr %33, null
  %35 = getelementptr inbounds i8, ptr %3, i64 1848
  %36 = load ptr, ptr %35, align 8
  %37 = icmp ne ptr %36, null
  %or.cond = select i1 %34, i1 %37, i1 false
  br i1 %or.cond, label %38, label %39

38:                                               ; preds = %28
  store ptr %36, ptr getelementptr inbounds (i8, ptr @opts, i64 24), align 8, !tbaa !24
  br label %39

39:                                               ; preds = %38, %28
  %40 = load ptr, ptr getelementptr inbounds (i8, ptr @opts, i64 16), align 8, !tbaa !25
  %41 = icmp eq ptr %40, null
  %.str.27. = select i1 %41, ptr @.str.27, ptr %40
  %42 = call i32 @install_package(ptr noundef nonnull %.str.27.)
  call void @curl_global_cleanup() #9
  call void (...) @clib_package_cleanup() #9
  call void @command_free(ptr noundef nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 2112, ptr nonnull %3) #9
  ret i32 %42
}

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

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

declare i32 @clib_cache_init(i64 noundef) local_unnamed_addr #2

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

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

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

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

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

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

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

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

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

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

declare i32 @curl_global_init(i64 noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4

declare void @clib_package_set_opts(ptr noundef byval(%struct.clib_package_opts_t) align 8) local_unnamed_addr #2

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

declare void @curl_global_cleanup() local_unnamed_addr #2

declare void @clib_package_cleanup(...) local_unnamed_addr #2

declare void @command_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #8

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 nocallback nofree nosync nounwind willreturn }
attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" }
attributes #9 = { nounwind }
attributes #10 = { cold nounwind }
attributes #11 = { 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, !10, i64 40}
!6 = !{!"options", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 44}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 8}
!12 = !{!"command", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !8, i64 48, !10, i64 1840, !8, i64 1848, !7, i64 2104}
!13 = !{!12, !10, i64 1840}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !7, i64 0}
!16 = !{!17, !10, i64 0}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !7, i64 16, !10, i64 24, !7, i64 32}
!18 = !{!17, !7, i64 16}
!19 = !{!17, !10, i64 8}
!20 = !{!6, !10, i64 44}
!21 = !{!17, !10, i64 4}
!22 = !{!6, !7, i64 8}
!23 = !{!17, !7, i64 32}
!24 = !{!6, !7, i64 24}
!25 = !{!6, !7, i64 16}


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