; LLVM IR from clibs/clib :: deps/commander (commander)

; 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 { 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 }

@.str.11 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.command_option = external hidden unnamed_addr constant [95 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [14 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 uwtable
declare dso_local void @command_free(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @command_option(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.command, ptr %13, i32 0, i32 5
  %15 = load i32, ptr %14, align 8, !tbaa !9
  %16 = icmp eq i32 %15, 32
  br i1 %16, label %17, label %19

17:                                               ; preds = %5
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  call void @command_free(ptr noundef %18)
  call void @error(ptr noundef @.str.11)
  br label %19

19:                                               ; preds = %17, %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.command, ptr %20, i32 0, i32 5
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %21, align 8, !tbaa !9
  store i32 %22, ptr %11, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.command, ptr %24, i32 0, i32 6
  %26 = load i32, ptr %11, align 4, !tbaa !12
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [32 x %struct.command_option_t], ptr %25, i64 0, i64 %27
  store ptr %28, ptr %12, align 8, !tbaa !5
  %29 = load ptr, ptr %10, align 8, !tbaa !5
  %30 = load ptr, ptr %12, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.command_option_t, ptr %30, i32 0, i32 7
  store ptr %29, ptr %31, align 8, !tbaa !13
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = load ptr, ptr %12, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.command_option_t, ptr %33, i32 0, i32 4
  store ptr %32, ptr %34, align 8, !tbaa !15
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  %36 = load ptr, ptr %12, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.command_option_t, ptr %36, i32 0, i32 6
  store ptr %35, ptr %37, align 8, !tbaa !16
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.command_option_t, ptr %38, i32 0, i32 0
  store i32 0, ptr %39, align 8, !tbaa !17
  %40 = load ptr, ptr %12, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.command_option_t, ptr %40, i32 0, i32 1
  store i32 0, ptr %41, align 4, !tbaa !18
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.command_option_t, ptr %43, i32 0, i32 5
  store ptr %42, ptr %44, align 8, !tbaa !19
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = call i64 @strlen(ptr noundef %45) #6
  %47 = add i64 %46, 1
  %48 = call noalias ptr @malloc(i64 noundef %47) #7
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.command_option_t, ptr %49, i32 0, i32 2
  store ptr %48, ptr %50, align 8, !tbaa !20
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.command_option_t, ptr %51, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !20
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %56

55:                                               ; preds = %19
  br label %57

56:                                               ; preds = %19
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.13, i32 noundef 185, ptr noundef @__PRETTY_FUNCTION__.command_option) #8
  unreachable

57:                                               ; preds = %55
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = call i64 @strlen(ptr noundef %58) #6
  %60 = add i64 %59, 1
  %61 = call noalias ptr @malloc(i64 noundef %60) #7
  %62 = load ptr, ptr %12, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.command_option_t, ptr %62, i32 0, i32 3
  store ptr %61, ptr %63, align 8, !tbaa !21
  %64 = load ptr, ptr %12, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.command_option_t, ptr %64, i32 0, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !21
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %69

68:                                               ; preds = %57
  br label %70

69:                                               ; preds = %57
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.13, i32 noundef 187, ptr noundef @__PRETTY_FUNCTION__.command_option) #8
  unreachable

70:                                               ; preds = %68
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.command_option_t, ptr %72, i32 0, i32 3
  %74 = load ptr, ptr %73, align 8, !tbaa !21
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.command_option_t, ptr %75, i32 0, i32 2
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  call void @parse_argname(ptr noundef %71, ptr noundef %74, ptr noundef %77)
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.command_option_t, ptr %78, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !20
  %81 = getelementptr inbounds i8, ptr %80, i64 0
  %82 = load i8, ptr %81, align 1, !tbaa !22
  %83 = sext i8 %82 to i32
  %84 = icmp eq i32 91, %83
  br i1 %84, label %85, label %88

85:                                               ; preds = %70
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.command_option_t, ptr %86, i32 0, i32 0
  store i32 1, ptr %87, align 8, !tbaa !17
  br label %88

88:                                               ; preds = %85, %70
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.command_option_t, ptr %89, i32 0, i32 2
  %91 = load ptr, ptr %90, align 8, !tbaa !20
  %92 = getelementptr inbounds i8, ptr %91, i64 0
  %93 = load i8, ptr %92, align 1, !tbaa !22
  %94 = sext i8 %93 to i32
  %95 = icmp eq i32 60, %94
  br i1 %95, label %96, label %99

96:                                               ; preds = %88
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.command_option_t, ptr %97, i32 0, i32 1
  store i32 1, ptr %98, align 4, !tbaa !18
  br label %99

99:                                               ; preds = %96, %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @error(ptr noundef) #1

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 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 #3 = { 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 #4 = { noreturn 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) }
attributes #7 = { nounwind allocsize(0) }
attributes #8 = { noreturn 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, !11, i64 40}
!10 = !{!"command", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !7, i64 48, !11, i64 1840, !7, i64 1848, !6, i64 2104}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !6, i64 48}
!14 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!15 = !{!14, !6, i64 24}
!16 = !{!14, !6, i64 40}
!17 = !{!14, !11, i64 0}
!18 = !{!14, !11, i64 4}
!19 = !{!14, !6, i64 32}
!20 = !{!14, !6, i64 8}
!21 = !{!14, !6, i64 16}
!22 = !{!7, !7, i64 0}


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

@.str.11 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [71 x i8], align 1
@__PRETTY_FUNCTION__.command_option = external hidden unnamed_addr constant [95 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @command_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @command_option(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp eq i32 %7, 32
  br i1 %8, label %9, label %10

9:                                                ; preds = %5
  tail call void @command_free(ptr noundef nonnull %0)
  tail call void @error(ptr noundef nonnull @.str.11)
  %.pre = load i32, ptr %6, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %9, %5
  %11 = phi i32 [ %.pre, %9 ], [ %7, %5 ]
  %12 = add nsw i32 %11, 1
  store i32 %12, ptr %6, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 48
  %14 = sext i32 %11 to i64
  %15 = getelementptr inbounds [32 x %struct.command_option_t], ptr %13, i64 0, i64 %14
  %16 = getelementptr inbounds i8, ptr %15, i64 48
  store ptr %4, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %15, i64 24
  store ptr %1, ptr %17, align 8, !tbaa !13
  %18 = getelementptr inbounds i8, ptr %15, i64 40
  store ptr %3, ptr %18, align 8, !tbaa !14
  store i32 0, ptr %15, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %15, i64 4
  store i32 0, ptr %19, align 4, !tbaa !16
  %20 = getelementptr inbounds i8, ptr %15, i64 32
  store ptr %2, ptr %20, align 8, !tbaa !17
  %21 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #4
  %22 = add i64 %21, 1
  %23 = tail call noalias ptr @malloc(i64 noundef %22) #5
  %24 = getelementptr inbounds i8, ptr %15, i64 8
  store ptr %23, ptr %24, align 8, !tbaa !18
  %.not = icmp eq ptr %23, null
  br i1 %.not, label %25, label %26

25:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.13, i32 noundef 185, ptr noundef nonnull @__PRETTY_FUNCTION__.command_option) #6
  unreachable

26:                                               ; preds = %10
  %27 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #4
  %28 = add i64 %27, 1
  %29 = tail call noalias ptr @malloc(i64 noundef %28) #5
  %30 = getelementptr inbounds i8, ptr %15, i64 16
  store ptr %29, ptr %30, align 8, !tbaa !19
  %.not27 = icmp eq ptr %29, null
  br i1 %.not27, label %31, label %32

31:                                               ; preds = %26
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.13, i32 noundef 187, ptr noundef nonnull @__PRETTY_FUNCTION__.command_option) #6
  unreachable

32:                                               ; preds = %26
  tail call void @parse_argname(ptr noundef %2, ptr noundef nonnull %29, ptr noundef nonnull %23)
  %33 = load ptr, ptr %24, align 8, !tbaa !18
  %34 = load i8, ptr %33, align 1, !tbaa !20
  %35 = icmp eq i8 %34, 91
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  store i32 1, ptr %15, align 8, !tbaa !15
  %.pr = load i8, ptr %33, align 1, !tbaa !20
  br label %37

37:                                               ; preds = %36, %32
  %38 = phi i8 [ %.pr, %36 ], [ %34, %32 ]
  %39 = icmp eq i8 %38, 60
  br i1 %39, label %40, label %41

40:                                               ; preds = %37
  store i32 1, ptr %19, align 4, !tbaa !16
  br label %41

41:                                               ; preds = %40, %37
  ret void
}

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @parse_argname(ptr noundef, ptr noundef, ptr noundef) 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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #2 = { 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 #3 = { noreturn 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 willreturn memory(read) }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { noreturn 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 40}
!6 = !{!"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}
!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 48}
!12 = !{!"", !10, i64 0, !10, i64 4, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!13 = !{!12, !7, i64 24}
!14 = !{!12, !7, i64 40}
!15 = !{!12, !10, i64 0}
!16 = !{!12, !10, i64 4}
!17 = !{!12, !7, i64 32}
!18 = !{!12, !7, i64 8}
!19 = !{!12, !7, i64 16}
!20 = !{!8, !8, i64 0}


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