; LLVM IR from ros2/rcutils :: src (string_array)

; 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.rcutils_string_array_s = type { i64, ptr, %struct.rcutils_allocator_s }
%struct.rcutils_allocator_s = type { ptr, ptr, ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @rcutils_get_zero_initialized_string_array(ptr dead_on_unwind noalias writable sret(%struct.rcutils_string_array_s) align 8) #0

; 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) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @rcutils_string_array_init(ptr noundef, i64 noundef, ptr noundef) #0

declare void @rcutils_set_error_state(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @rcutils_string_array_fini(ptr noundef) #0

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

declare zeroext i1 @rcutils_allocator_is_valid(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @rcutils_string_array_resize(ptr noundef %0, i64 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.rcutils_string_array_s, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i64 %1, ptr %5, align 8, !tbaa !9
  br label %15

15:                                               ; preds = %2
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = icmp eq ptr null, %16
  br i1 %17, label %18, label %21

18:                                               ; preds = %15
  br label %19

19:                                               ; preds = %18
  call void @rcutils_set_error_state(ptr noundef @.str.2, ptr noundef @.str.1, i64 noundef 147)
  br label %20

20:                                               ; preds = %19
  store i32 11, ptr %3, align 4
  br label %145

21:                                               ; preds = %15
  br label %22

22:                                               ; preds = %21
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %23, i32 0, i32 0
  %25 = load i64, ptr %24, align 8, !tbaa !11
  %26 = load i64, ptr %5, align 8, !tbaa !9
  %27 = icmp eq i64 %25, %26
  br i1 %27, label %28, label %29

28:                                               ; preds = %22
  store i32 0, ptr %3, align 4
  br label %145

29:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %30, i32 0, i32 2
  store ptr %31, ptr %6, align 8, !tbaa !5
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = call zeroext i1 @rcutils_allocator_is_valid(ptr noundef %32)
  br i1 %33, label %38, label %34

34:                                               ; preds = %29
  br label %35

35:                                               ; preds = %34
  call void @rcutils_set_error_state(ptr noundef @.str.4, ptr noundef @.str.1, i64 noundef 155)
  br label %36

36:                                               ; preds = %35
  br label %37

37:                                               ; preds = %36
  store i32 11, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %144

38:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 56, ptr %8) #4
  call void @rcutils_get_zero_initialized_string_array(ptr dead_on_unwind writable sret(%struct.rcutils_string_array_s) align 8 %8)
  %39 = load i64, ptr %5, align 8, !tbaa !9
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %40, i32 0, i32 0
  %42 = load i64, ptr %41, align 8, !tbaa !11
  %43 = icmp ult i64 %39, %42
  br i1 %43, label %44, label %71

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %45, i32 0, i32 0
  %47 = load i64, ptr %46, align 8, !tbaa !11
  %48 = load i64, ptr %5, align 8, !tbaa !9
  %49 = sub i64 %47, %48
  store i64 %49, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %50 = load i64, ptr %9, align 8, !tbaa !9
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = call i32 @rcutils_string_array_init(ptr noundef %8, i64 noundef %50, ptr noundef %51)
  store i32 %52, ptr %10, align 4, !tbaa !14
  %53 = load i32, ptr %10, align 4, !tbaa !14
  %54 = icmp ne i32 0, %53
  br i1 %54, label %55, label %57

55:                                               ; preds = %44
  %56 = load i32, ptr %10, align 4, !tbaa !14
  store i32 %56, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %68

57:                                               ; preds = %44
  %58 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %8, i32 0, i32 1
  %59 = load ptr, ptr %58, align 8, !tbaa !16
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !16
  %63 = load i64, ptr %5, align 8, !tbaa !9
  %64 = getelementptr inbounds ptr, ptr %62, i64 %63
  %65 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %8, i32 0, i32 0
  %66 = load i64, ptr %65, align 8, !tbaa !11
  %67 = mul i64 %66, 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %59, ptr align 8 %64, i64 %67, i1 false)
  store i32 0, ptr %7, align 4
  br label %68

68:                                               ; preds = %57, %55
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %69 = load i32, ptr %7, align 4
  switch i32 %69, label %143 [
    i32 0, label %70
  ]

70:                                               ; preds = %68
  br label %71

71:                                               ; preds = %70, %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.rcutils_allocator_s, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !17
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !16
  %78 = load i64, ptr %5, align 8, !tbaa !9
  %79 = mul i64 %78, 8
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.rcutils_allocator_s, ptr %80, i32 0, i32 4
  %82 = load ptr, ptr %81, align 8, !tbaa !18
  %83 = call ptr %74(ptr noundef %77, i64 noundef %79, ptr noundef %82)
  store ptr %83, ptr %11, align 8, !tbaa !5
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = icmp eq ptr null, %84
  br i1 %85, label %86, label %116

86:                                               ; preds = %71
  %87 = load i64, ptr %5, align 8, !tbaa !9
  %88 = icmp ne i64 0, %87
  br i1 %88, label %89, label %116

89:                                               ; preds = %86
  br label %90

90:                                               ; preds = %89
  call void @rcutils_set_error_state(ptr noundef @.str.3, ptr noundef @.str.1, i64 noundef 174)
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %93

93:                                               ; preds = %104, %92
  %94 = load i64, ptr %12, align 8, !tbaa !9
  %95 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %8, i32 0, i32 0
  %96 = load i64, ptr %95, align 8, !tbaa !11
  %97 = icmp ult i64 %94, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %93
  store i32 10, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %107

99:                                               ; preds = %93
  %100 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %8, i32 0, i32 1
  %101 = load ptr, ptr %100, align 8, !tbaa !16
  %102 = load i64, ptr %12, align 8, !tbaa !9
  %103 = getelementptr inbounds ptr, ptr %101, i64 %102
  store ptr null, ptr %103, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %99
  %105 = load i64, ptr %12, align 8, !tbaa !9
  %106 = add i64 %105, 1
  store i64 %106, ptr %12, align 8, !tbaa !9
  br label %93, !llvm.loop !19

107:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %108 = call i32 @rcutils_string_array_fini(ptr noundef %8)
  store i32 %108, ptr %13, align 4, !tbaa !14
  %109 = load i32, ptr %13, align 4, !tbaa !14
  %110 = icmp ne i32 0, %109
  br i1 %110, label %111, label %115

111:                                              ; preds = %107
  br label %112

112:                                              ; preds = %111
  call void @rcutils_set_error_state(ptr noundef @.str.12, ptr noundef @.str.1, i64 noundef 180)
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  br label %115

115:                                              ; preds = %114, %107
  store i32 10, ptr %3, align 4
  store i32 1, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %142

116:                                              ; preds = %86, %71
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %118, i32 0, i32 1
  store ptr %117, ptr %119, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %120, i32 0, i32 0
  %122 = load i64, ptr %121, align 8, !tbaa !11
  store i64 %122, ptr %14, align 8, !tbaa !9
  br label %123

123:                                              ; preds = %134, %116
  %124 = load i64, ptr %14, align 8, !tbaa !9
  %125 = load i64, ptr %5, align 8, !tbaa !9
  %126 = icmp ult i64 %124, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %123
  store i32 15, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %137

128:                                              ; preds = %123
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %129, i32 0, i32 1
  %131 = load ptr, ptr %130, align 8, !tbaa !16
  %132 = load i64, ptr %14, align 8, !tbaa !9
  %133 = getelementptr inbounds ptr, ptr %131, i64 %132
  store ptr null, ptr %133, align 8, !tbaa !5
  br label %134

134:                                              ; preds = %128
  %135 = load i64, ptr %14, align 8, !tbaa !9
  %136 = add i64 %135, 1
  store i64 %136, ptr %14, align 8, !tbaa !9
  br label %123, !llvm.loop !21

137:                                              ; preds = %127
  %138 = load i64, ptr %5, align 8, !tbaa !9
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.rcutils_string_array_s, ptr %139, i32 0, i32 0
  store i64 %138, ptr %140, align 8, !tbaa !11
  %141 = call i32 @rcutils_string_array_fini(ptr noundef %8)
  store i32 %141, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %142

142:                                              ; preds = %137, %115
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %143

143:                                              ; preds = %142, %68
  call void @llvm.lifetime.end.p0(i64 56, ptr %8) #4
  br label %144

144:                                              ; preds = %143, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %145

145:                                              ; preds = %144, %28, %20
  %146 = load i32, ptr %3, align 4
  ret i32 %146
}

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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"rcutils_string_array_s", !10, i64 0, !6, i64 8, !13, i64 16}
!13 = !{!"rcutils_allocator_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!12, !6, i64 8}
!17 = !{!13, !6, i64 16}
!18 = !{!13, !6, i64 32}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}


; 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.rcutils_string_array_s = type { i64, ptr, %struct.rcutils_allocator_s }
%struct.rcutils_allocator_s = type { ptr, ptr, ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [65 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [40 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @rcutils_get_zero_initialized_string_array(ptr dead_on_unwind noalias writable sret(%struct.rcutils_string_array_s) align 8) local_unnamed_addr #0

; 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) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @rcutils_string_array_init(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #0

declare void @rcutils_set_error_state(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

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

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

declare zeroext i1 @rcutils_allocator_is_valid(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @rcutils_string_array_resize(ptr noundef %0, i64 noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.rcutils_string_array_s, align 8
  %4 = icmp eq ptr %0, null
  br i1 %4, label %5, label %6

5:                                                ; preds = %2
  tail call void @rcutils_set_error_state(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i64 noundef 147) #4
  br label %82

6:                                                ; preds = %2
  %7 = load i64, ptr %0, align 8, !tbaa !5
  %8 = icmp eq i64 %7, %1
  br i1 %8, label %82, label %9

9:                                                ; preds = %6
  %10 = getelementptr inbounds i8, ptr %0, i64 16
  %11 = tail call zeroext i1 @rcutils_allocator_is_valid(ptr noundef nonnull %10) #4
  br i1 %11, label %13, label %12

12:                                               ; preds = %9
  tail call void @rcutils_set_error_state(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1, i64 noundef 155) #4
  br label %82

13:                                               ; preds = %9
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %3) #4
  call void @rcutils_get_zero_initialized_string_array(ptr dead_on_unwind nonnull writable sret(%struct.rcutils_string_array_s) align 8 %3)
  %14 = load i64, ptr %0, align 8, !tbaa !5
  %15 = icmp ugt i64 %14, %1
  br i1 %15, label %16, label %27

16:                                               ; preds = %13
  %17 = sub i64 %14, %1
  %18 = call i32 @rcutils_string_array_init(ptr noundef nonnull %3, i64 noundef %17, ptr noundef nonnull %10)
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %19, label %.critedge

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %3, i64 8
  %21 = load ptr, ptr %20, align 8, !tbaa !12
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = load ptr, ptr %22, align 8, !tbaa !12
  %24 = getelementptr inbounds ptr, ptr %23, i64 %1
  %25 = load i64, ptr %3, align 8, !tbaa !5
  %26 = shl i64 %25, 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %21, ptr align 8 %24, i64 %26, i1 false)
  br label %27

27:                                               ; preds = %19, %13
  %28 = getelementptr inbounds i8, ptr %0, i64 32
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %0, i64 8
  %31 = load ptr, ptr %30, align 8, !tbaa !12
  %32 = shl i64 %1, 3
  %33 = getelementptr inbounds i8, ptr %0, i64 48
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = call ptr %29(ptr noundef %31, i64 noundef %32, ptr noundef %34) #4
  %36 = icmp eq ptr %35, null
  %37 = icmp ne i64 %1, 0
  %or.cond = and i1 %37, %36
  br i1 %or.cond, label %38, label %60

38:                                               ; preds = %27
  call void @rcutils_set_error_state(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i64 noundef 174) #4
  %39 = load i64, ptr %3, align 8, !tbaa !5
  %.not49 = icmp eq i64 %39, 0
  br i1 %.not49, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %38
  %40 = getelementptr inbounds i8, ptr %3, i64 8
  %xtraiter51 = and i64 %39, 3
  %41 = icmp ult i64 %39, 4
  br i1 %41, label %._crit_edge48.loopexit.unr-lcssa, label %.lr.ph47.new

.lr.ph47.new:                                     ; preds = %.lr.ph47
  %unroll_iter = and i64 %39, -4
  br label %46

._crit_edge48.loopexit.unr-lcssa:                 ; preds = %46, %.lr.ph47
  %.03845.unr = phi i64 [ 0, %.lr.ph47 ], [ %58, %46 ]
  %lcmp.mod52.not = icmp eq i64 %xtraiter51, 0
  br i1 %lcmp.mod52.not, label %._crit_edge48, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge48.loopexit.unr-lcssa, %.epil.preheader
  %.03845.epil = phi i64 [ %44, %.epil.preheader ], [ %.03845.unr, %._crit_edge48.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge48.loopexit.unr-lcssa ]
  %42 = load ptr, ptr %40, align 8, !tbaa !12
  %43 = getelementptr inbounds ptr, ptr %42, i64 %.03845.epil
  store ptr null, ptr %43, align 8, !tbaa !15
  %44 = add nuw i64 %.03845.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter51
  br i1 %epil.iter.cmp.not, label %._crit_edge48, label %.epil.preheader, !llvm.loop !16

._crit_edge48:                                    ; preds = %._crit_edge48.loopexit.unr-lcssa, %.epil.preheader, %38
  %45 = call i32 @rcutils_string_array_fini(ptr noundef nonnull %3)
  %.not43 = icmp eq i32 %45, 0
  br i1 %.not43, label %.critedge, label %59

46:                                               ; preds = %46, %.lr.ph47.new
  %.03845 = phi i64 [ 0, %.lr.ph47.new ], [ %58, %46 ]
  %niter = phi i64 [ 0, %.lr.ph47.new ], [ %niter.next.3, %46 ]
  %47 = load ptr, ptr %40, align 8, !tbaa !12
  %48 = getelementptr inbounds ptr, ptr %47, i64 %.03845
  store ptr null, ptr %48, align 8, !tbaa !15
  %49 = or disjoint i64 %.03845, 1
  %50 = load ptr, ptr %40, align 8, !tbaa !12
  %51 = getelementptr inbounds ptr, ptr %50, i64 %49
  store ptr null, ptr %51, align 8, !tbaa !15
  %52 = or disjoint i64 %.03845, 2
  %53 = load ptr, ptr %40, align 8, !tbaa !12
  %54 = getelementptr inbounds ptr, ptr %53, i64 %52
  store ptr null, ptr %54, align 8, !tbaa !15
  %55 = or disjoint i64 %.03845, 3
  %56 = load ptr, ptr %40, align 8, !tbaa !12
  %57 = getelementptr inbounds ptr, ptr %56, i64 %55
  store ptr null, ptr %57, align 8, !tbaa !15
  %58 = add nuw i64 %.03845, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge48.loopexit.unr-lcssa, label %46, !llvm.loop !18

59:                                               ; preds = %._crit_edge48
  call void @rcutils_set_error_state(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i64 noundef 180) #4
  br label %.critedge

60:                                               ; preds = %27
  store ptr %35, ptr %30, align 8, !tbaa !12
  %61 = load i64, ptr %0, align 8, !tbaa !5
  %62 = icmp ult i64 %61, %1
  br i1 %62, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %60
  %63 = sub i64 %1, %61
  %xtraiter = and i64 %63, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %.044.prol = phi i64 [ %66, %.lr.ph.prol ], [ %61, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %64 = load ptr, ptr %30, align 8, !tbaa !12
  %65 = getelementptr inbounds ptr, ptr %64, i64 %.044.prol
  store ptr null, ptr %65, align 8, !tbaa !15
  %66 = add nuw i64 %.044.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !20

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.044.unr = phi i64 [ %61, %.lr.ph.preheader ], [ %66, %.lr.ph.prol ]
  %67 = sub i64 %61, %1
  %68 = icmp ugt i64 %67, -4
  br i1 %68, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %60
  store i64 %1, ptr %0, align 8, !tbaa !5
  %69 = call i32 @rcutils_string_array_fini(ptr noundef nonnull %3)
  br label %.critedge

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.044 = phi i64 [ %81, %.lr.ph ], [ %.044.unr, %.lr.ph.prol.loopexit ]
  %70 = load ptr, ptr %30, align 8, !tbaa !12
  %71 = getelementptr inbounds ptr, ptr %70, i64 %.044
  store ptr null, ptr %71, align 8, !tbaa !15
  %72 = load ptr, ptr %30, align 8, !tbaa !12
  %73 = getelementptr ptr, ptr %72, i64 %.044
  %74 = getelementptr i8, ptr %73, i64 8
  store ptr null, ptr %74, align 8, !tbaa !15
  %75 = load ptr, ptr %30, align 8, !tbaa !12
  %76 = getelementptr ptr, ptr %75, i64 %.044
  %77 = getelementptr i8, ptr %76, i64 16
  store ptr null, ptr %77, align 8, !tbaa !15
  %78 = load ptr, ptr %30, align 8, !tbaa !12
  %79 = getelementptr ptr, ptr %78, i64 %.044
  %80 = getelementptr i8, ptr %79, i64 24
  store ptr null, ptr %80, align 8, !tbaa !15
  %81 = add nuw i64 %.044, 4
  %exitcond.not.3 = icmp eq i64 %81, %1
  br i1 %exitcond.not.3, label %._crit_edge, label %.lr.ph, !llvm.loop !21

.critedge:                                        ; preds = %16, %._crit_edge, %59, %._crit_edge48
  %.2 = phi i32 [ %69, %._crit_edge ], [ 10, %59 ], [ 10, %._crit_edge48 ], [ %18, %16 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %3) #4
  br label %82

82:                                               ; preds = %12, %.critedge, %6, %5
  %.4 = phi i32 [ 11, %5 ], [ 0, %6 ], [ %.2, %.critedge ], [ 11, %12 ]
  ret i32 %.4
}

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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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, !7, i64 0}
!6 = !{!"rcutils_string_array_s", !7, i64 0, !10, i64 8, !11, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"rcutils_allocator_s", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!12 = !{!6, !10, i64 8}
!13 = !{!11, !10, i64 16}
!14 = !{!11, !10, i64 32}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !19}


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