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

; 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_allocator_s = type { ptr, ptr, ptr, ptr, ptr }
%struct.rcutils_hash_map_s = type { ptr }
%struct.rcutils_error_string_s = type { [1024 x i8] }

@g_rcutils_log_severity_names = external dso_local constant [51 x ptr], align 16
@g_rcutils_logging_initialized = external dso_local global i8, align 1
@.str.7 = external hidden unnamed_addr constant [60 x i8], align 1
@g_rcutils_logging_allocator = external hidden global %struct.rcutils_allocator_s, align 8
@g_rcutils_logging_default_logger_level = external hidden global i32, align 4
@.str.10 = external hidden unnamed_addr constant [54 x i8], align 1
@stderr = external global ptr, align 8
@g_rcutils_logging_severities_map = external hidden global %struct.rcutils_hash_map_s, align 8
@g_rcutils_logging_severities_map_valid = external hidden global i8, align 1
@.str.34 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @rcutils_logging_initialize_with_allocator(ptr noundef byval(%struct.rcutils_allocator_s) align 8) #0

declare void @rcutils_get_default_allocator(ptr dead_on_unwind writable sret(%struct.rcutils_allocator_s) align 8) #1

declare void @rcutils_set_error_state(ptr noundef, ptr noundef, 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 i32 @rcutils_snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #1

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, 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 @rcutils_reset_error() #1

declare void @rcutils_get_error_string(ptr dead_on_unwind writable sret(%struct.rcutils_error_string_s) align 1) #1

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

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

; Function Attrs: nounwind uwtable
define dso_local i32 @rcutils_logging_set_logger_level(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca %struct.rcutils_allocator_s, align 8
  %7 = alloca %struct.rcutils_error_string_s, align 1
  %8 = alloca %struct.rcutils_error_string_s, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  %17 = alloca [1024 x i8], align 16
  %18 = alloca i32, align 4
  %19 = alloca %struct.rcutils_error_string_s, align 1
  %20 = alloca i32, align 4
  %21 = alloca [1024 x i8], align 16
  %22 = alloca i32, align 4
  %23 = alloca %struct.rcutils_error_string_s, align 1
  %24 = alloca i32, align 4
  %25 = alloca [1024 x i8], align 16
  %26 = alloca i32, align 4
  %27 = alloca %struct.rcutils_error_string_s, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %2
  %29 = load i8, ptr @g_rcutils_logging_initialized, align 1, !tbaa !11, !range !13, !noundef !14
  %30 = trunc i8 %29 to i1
  %31 = xor i1 %30, true
  %32 = zext i1 %31 to i32
  %33 = sext i32 %32 to i64
  %34 = call i64 @llvm.expect.i64(i64 %33, i64 0)
  %35 = icmp ne i64 %34, 0
  br i1 %35, label %36, label %58

36:                                               ; preds = %28
  call void @rcutils_get_default_allocator(ptr dead_on_unwind writable sret(%struct.rcutils_allocator_s) align 8 %6)
  %37 = call i32 @rcutils_logging_initialize_with_allocator(ptr noundef byval(%struct.rcutils_allocator_s) align 8 %6)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %57

39:                                               ; preds = %36
  br label %40

40:                                               ; preds = %39
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i64 @fwrite(ptr noundef @.str.44, i64 noundef 1, i64 noundef 103, ptr noundef %41)
  br label %43

43:                                               ; preds = %40
  br label %44

44:                                               ; preds = %43
  call void @rcutils_get_error_string(ptr dead_on_unwind writable sret(%struct.rcutils_error_string_s) align 1 %7)
  %45 = getelementptr inbounds %struct.rcutils_error_string_s, ptr %7, i32 0, i32 0
  %46 = getelementptr inbounds [1024 x i8], ptr %45, i64 0, i64 0
  call void @rcutils_get_error_string(ptr dead_on_unwind writable sret(%struct.rcutils_error_string_s) align 1 %8)
  %47 = getelementptr inbounds %struct.rcutils_error_string_s, ptr %8, i32 0, i32 0
  %48 = getelementptr inbounds [1024 x i8], ptr %47, i64 0, i64 0
  %49 = call i64 @strlen(ptr noundef %48) #5
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i64 @fwrite(ptr noundef %46, i64 noundef 1, i64 noundef %49, ptr noundef %50)
  br label %52

52:                                               ; preds = %44
  br label %53

53:                                               ; preds = %52
  %54 = load ptr, ptr @stderr, align 8, !tbaa !5
  %55 = call i64 @fwrite(ptr noundef @.str.34, i64 noundef 1, i64 noundef 1, ptr noundef %54)
  br label %56

56:                                               ; preds = %53
  call void @rcutils_reset_error()
  br label %57

57:                                               ; preds = %56, %36
  br label %58

58:                                               ; preds = %57, %28
  br label %59

59:                                               ; preds = %58
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = icmp eq ptr null, %60
  br i1 %61, label %62, label %65

62:                                               ; preds = %59
  br label %63

63:                                               ; preds = %62
  call void @rcutils_set_error_state(ptr noundef @.str.45, ptr noundef @.str.7, i64 noundef 1085)
  br label %64

64:                                               ; preds = %63
  store i32 11, ptr %3, align 4
  br label %243

65:                                               ; preds = %59
  %66 = load i8, ptr @g_rcutils_logging_severities_map_valid, align 1, !tbaa !11, !range !13, !noundef !14
  %67 = trunc i8 %66 to i1
  br i1 %67, label %71, label %68

68:                                               ; preds = %65
  br label %69

69:                                               ; preds = %68
  call void @rcutils_set_error_state(ptr noundef @.str.46, ptr noundef @.str.7, i64 noundef 1090)
  br label %70

70:                                               ; preds = %69
  store i32 40, ptr %3, align 4
  br label %243

71:                                               ; preds = %65
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = icmp slt i32 %72, 0
  br i1 %73, label %77, label %74

74:                                               ; preds = %71
  %75 = load i32, ptr %5, align 4, !tbaa !9
  %76 = icmp sge i32 %75, 51
  br i1 %76, label %77, label %80

77:                                               ; preds = %74, %71
  br label %78

78:                                               ; preds = %77
  call void @rcutils_set_error_state(ptr noundef @.str.47, ptr noundef @.str.7, i64 noundef 1099)
  br label %79

79:                                               ; preds = %78
  store i32 11, ptr %3, align 4
  br label %243

80:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %81 = load i32, ptr %5, align 4, !tbaa !9
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [51 x ptr], ptr @g_rcutils_log_severity_names, i64 0, i64 %82
  %84 = load ptr, ptr %83, align 8, !tbaa !5
  store ptr %84, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = icmp eq ptr null, %85
  br i1 %86, label %87, label %91

87:                                               ; preds = %80
  br label %88

88:                                               ; preds = %87
  call void @rcutils_set_error_state(ptr noundef @.str.48, ptr noundef @.str.7, i64 noundef 1104)
  br label %89

89:                                               ; preds = %88
  br label %90

90:                                               ; preds = %89
  store i32 11, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %242

91:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %92 = load ptr, ptr %4, align 8, !tbaa !5
  %93 = call i64 @strlen(ptr noundef %92) #5
  store i64 %93, ptr %11, align 8, !tbaa !15
  %94 = call zeroext i1 @rcutils_hash_map_key_exists(ptr noundef @g_rcutils_logging_severities_map, ptr noundef %4)
  br i1 %94, label %95, label %205

95:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %96 = call i32 @rcutils_hash_map_get_next_key_and_data(ptr noundef @g_rcutils_logging_severities_map, ptr noundef null, ptr noundef %12, ptr noundef %13)
  store i32 %96, ptr %14, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %200, %95
  %98 = load i32, ptr %14, align 4, !tbaa !9
  %99 = icmp eq i32 0, %98
  br i1 %99, label %100, label %201

100:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %101 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %101, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #6
  store i8 0, ptr %16, align 1, !tbaa !11
  %102 = load ptr, ptr %12, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %104, label %125

104:                                              ; preds = %100
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = load i64, ptr %11, align 8, !tbaa !15
  %108 = call i32 @strncmp(ptr noundef %105, ptr noundef %106, i64 noundef %107) #5
  %109 = icmp eq i32 %108, 0
  br i1 %109, label %110, label %125

110:                                              ; preds = %104
  %111 = load ptr, ptr %12, align 8, !tbaa !5
  %112 = load i64, ptr %11, align 8, !tbaa !15
  %113 = getelementptr inbounds i8, ptr %111, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !17
  %115 = sext i8 %114 to i32
  %116 = icmp eq i32 %115, 0
  br i1 %116, label %117, label %118

117:                                              ; preds = %110
  store i8 1, ptr %16, align 1, !tbaa !11
  br label %124

118:                                              ; preds = %110
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = and i32 %119, 1
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  store i8 1, ptr %16, align 1, !tbaa !11
  br label %123

123:                                              ; preds = %122, %118
  br label %124

124:                                              ; preds = %123, %117
  br label %125

125:                                              ; preds = %124, %104, %100
  %126 = call i32 @rcutils_hash_map_get_next_key_and_data(ptr noundef @g_rcutils_logging_severities_map, ptr noundef %15, ptr noundef %12, ptr noundef %13)
  store i32 %126, ptr %14, align 4, !tbaa !9
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %159

129:                                              ; preds = %125
  %130 = load i32, ptr %14, align 4, !tbaa !9
  %131 = icmp ne i32 %130, 50
  br i1 %131, label %132, label %159

132:                                              ; preds = %129
  %133 = load i32, ptr %14, align 4, !tbaa !9
  %134 = icmp ne i32 %133, 14
  br i1 %134, label %135, label %159

135:                                              ; preds = %132
  br label %136

136:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 1024, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %137 = getelementptr inbounds [1024 x i8], ptr %17, i64 0, i64 0
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  call void @rcutils_get_error_string(ptr dead_on_unwind writable sret(%struct.rcutils_error_string_s) align 1 %19)
  %139 = getelementptr inbounds %struct.rcutils_error_string_s, ptr %19, i32 0, i32 0
  %140 = getelementptr inbounds [1024 x i8], ptr %139, i64 0, i64 0
  %141 = call i32 (ptr, i64, ptr, ...) @rcutils_snprintf(ptr noundef %137, i64 noundef 1024, ptr noundef @.str.49, ptr noundef %138, ptr noundef %140)
  store i32 %141, ptr %18, align 4, !tbaa !9
  %142 = load i32, ptr %18, align 4, !tbaa !9
  %143 = icmp slt i32 %142, 0
  br i1 %143, label %144, label %150

144:                                              ; preds = %136
  br label %145

145:                                              ; preds = %144
  %146 = load ptr, ptr @stderr, align 8, !tbaa !5
  %147 = call i64 @fwrite(ptr noundef @.str.10, i64 noundef 1, i64 noundef 53, ptr noundef %146)
  br label %148

148:                                              ; preds = %145
  br label %149

149:                                              ; preds = %148
  br label %155

150:                                              ; preds = %136
  br label %151

151:                                              ; preds = %150
  %152 = getelementptr inbounds [1024 x i8], ptr %17, i64 0, i64 0
  call void @rcutils_set_error_state(ptr noundef %152, ptr noundef @.str.7, i64 noundef 1148)
  br label %153

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153
  br label %155

155:                                              ; preds = %154, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %17) #6
  br label %156

156:                                              ; preds = %155
  br label %157

157:                                              ; preds = %156
  %158 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %158, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %198

159:                                              ; preds = %132, %129, %125
  %160 = load i8, ptr %16, align 1, !tbaa !11, !range !13, !noundef !14
  %161 = trunc i8 %160 to i1
  br i1 %161, label %162, label %197

162:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %163 = call i32 @rcutils_hash_map_unset(ptr noundef @g_rcutils_logging_severities_map, ptr noundef %15)
  store i32 %163, ptr %20, align 4, !tbaa !9
  %164 = load i32, ptr %20, align 4, !tbaa !9
  %165 = icmp ne i32 %164, 0
  br i1 %165, label %166, label %190

166:                                              ; preds = %162
  br label %167

167:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 1024, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %168 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  %169 = load ptr, ptr %4, align 8, !tbaa !5
  call void @rcutils_get_error_string(ptr dead_on_unwind writable sret(%struct.rcutils_error_string_s) align 1 %23)
  %170 = getelementptr inbounds %struct.rcutils_error_string_s, ptr %23, i32 0, i32 0
  %171 = getelementptr inbounds [1024 x i8], ptr %170, i64 0, i64 0
  %172 = call i32 (ptr, i64, ptr, ...) @rcutils_snprintf(ptr noundef %168, i64 noundef 1024, ptr noundef @.str.50, ptr noundef %169, ptr noundef %171)
  store i32 %172, ptr %22, align 4, !tbaa !9
  %173 = load i32, ptr %22, align 4, !tbaa !9
  %174 = icmp slt i32 %173, 0
  br i1 %174, label %175, label %181

175:                                              ; preds = %167
  br label %176

176:                                              ; preds = %175
  %177 = load ptr, ptr @stderr, align 8, !tbaa !5
  %178 = call i64 @fwrite(ptr noundef @.str.10, i64 noundef 1, i64 noundef 53, ptr noundef %177)
  br label %179

179:                                              ; preds = %176
  br label %180

180:                                              ; preds = %179
  br label %186

181:                                              ; preds = %167
  br label %182

182:                                              ; preds = %181
  %183 = getelementptr inbounds [1024 x i8], ptr %21, i64 0, i64 0
  call void @rcutils_set_error_state(ptr noundef %183, ptr noundef @.str.7, i64 noundef 1161)
  br label %184

184:                                              ; preds = %182
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185, %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %21) #6
  br label %187

187:                                              ; preds = %186
  br label %188

188:                                              ; preds = %187
  %189 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %189, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %194

190:                                              ; preds = %162
  %191 = load ptr, ptr getelementptr inbounds (%struct.rcutils_allocator_s, ptr @g_rcutils_logging_allocator, i32 0, i32 1), align 8, !tbaa !18
  %192 = load ptr, ptr %15, align 8, !tbaa !5
  %193 = load ptr, ptr getelementptr inbounds (%struct.rcutils_allocator_s, ptr @g_rcutils_logging_allocator, i32 0, i32 4), align 8, !tbaa !20
  call void %191(ptr noundef %192, ptr noundef %193)
  store i32 0, ptr %10, align 4
  br label %194

194:                                              ; preds = %190, %188
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  %195 = load i32, ptr %10, align 4
  switch i32 %195, label %198 [
    i32 0, label %196
  ]

196:                                              ; preds = %194
  br label %197

197:                                              ; preds = %196, %159
  store i32 0, ptr %10, align 4
  br label %198

198:                                              ; preds = %197, %194, %157
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  %199 = load i32, ptr %10, align 4
  switch i32 %199, label %202 [
    i32 0, label %200
  ]

200:                                              ; preds = %198
  br label %97, !llvm.loop !21

201:                                              ; preds = %97
  store i32 0, ptr %10, align 4
  br label %202

202:                                              ; preds = %201, %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %203 = load i32, ptr %10, align 4
  switch i32 %203, label %241 [
    i32 0, label %204
  ]

204:                                              ; preds = %202
  br label %205

205:                                              ; preds = %204, %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = load i32, ptr %5, align 4, !tbaa !9
  %208 = call i32 @add_key_to_hash_map(ptr noundef %206, i32 noundef %207, i1 noundef zeroext true)
  store i32 %208, ptr %24, align 4, !tbaa !9
  %209 = load i32, ptr %24, align 4, !tbaa !9
  %210 = icmp ne i32 %209, 0
  br i1 %210, label %211, label %234

211:                                              ; preds = %205
  br label %212

212:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 1024, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %213 = getelementptr inbounds [1024 x i8], ptr %25, i64 0, i64 0
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  call void @rcutils_get_error_string(ptr dead_on_unwind writable sret(%struct.rcutils_error_string_s) align 1 %27)
  %215 = getelementptr inbounds %struct.rcutils_error_string_s, ptr %27, i32 0, i32 0
  %216 = getelementptr inbounds [1024 x i8], ptr %215, i64 0, i64 0
  %217 = call i32 (ptr, i64, ptr, ...) @rcutils_snprintf(ptr noundef %213, i64 noundef 1024, ptr noundef @.str.51, ptr noundef %214, ptr noundef %216)
  store i32 %217, ptr %26, align 4, !tbaa !9
  %218 = load i32, ptr %26, align 4, !tbaa !9
  %219 = icmp slt i32 %218, 0
  br i1 %219, label %220, label %226

220:                                              ; preds = %212
  br label %221

221:                                              ; preds = %220
  %222 = load ptr, ptr @stderr, align 8, !tbaa !5
  %223 = call i64 @fwrite(ptr noundef @.str.10, i64 noundef 1, i64 noundef 53, ptr noundef %222)
  br label %224

224:                                              ; preds = %221
  br label %225

225:                                              ; preds = %224
  br label %231

226:                                              ; preds = %212
  br label %227

227:                                              ; preds = %226
  %228 = getelementptr inbounds [1024 x i8], ptr %25, i64 0, i64 0
  call void @rcutils_set_error_state(ptr noundef %228, ptr noundef @.str.7, i64 noundef 1173)
  br label %229

229:                                              ; preds = %227
  br label %230

230:                                              ; preds = %229
  br label %231

231:                                              ; preds = %230, %225
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %25) #6
  br label %232

232:                                              ; preds = %231
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233, %205
  %235 = load i64, ptr %11, align 8, !tbaa !15
  %236 = icmp eq i64 %235, 0
  br i1 %236, label %237, label %239

237:                                              ; preds = %234
  %238 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %238, ptr @g_rcutils_logging_default_logger_level, align 4, !tbaa !9
  br label %239

239:                                              ; preds = %237, %234
  %240 = load i32, ptr %24, align 4, !tbaa !9
  store i32 %240, ptr %3, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %241

241:                                              ; preds = %239, %202
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %242

242:                                              ; preds = %241, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %243

243:                                              ; preds = %242, %79, %70, %64
  %244 = load i32, ptr %3, align 4
  ret i32 %244
}

declare zeroext i1 @rcutils_hash_map_key_exists(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @add_key_to_hash_map(ptr noundef, i32 noundef, i1 noundef zeroext) #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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #4 = { 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 #5 = { nounwind willreturn memory(read) }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !6, i64 8}
!19 = !{!"rcutils_allocator_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!20 = !{!19, !6, i64 32}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.rcutils_allocator_s = type { ptr, ptr, ptr, ptr, ptr }
%struct.rcutils_hash_map_s = type { ptr }
%struct.rcutils_error_string_s = type { [1024 x i8] }

@g_rcutils_log_severity_names = external dso_local local_unnamed_addr constant [51 x ptr], align 16
@g_rcutils_logging_initialized = external dso_local local_unnamed_addr global i8, align 1
@.str.7 = external hidden unnamed_addr constant [60 x i8], align 1
@g_rcutils_logging_allocator = external hidden local_unnamed_addr global %struct.rcutils_allocator_s, align 8
@g_rcutils_logging_default_logger_level = external hidden local_unnamed_addr global i32, align 4
@.str.10 = external hidden unnamed_addr constant [54 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@g_rcutils_logging_severities_map = external hidden global %struct.rcutils_hash_map_s, align 8
@g_rcutils_logging_severities_map_valid = external hidden local_unnamed_addr global i8, align 1
@.str.34 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [104 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @rcutils_logging_initialize_with_allocator(ptr noundef byval(%struct.rcutils_allocator_s) align 8) local_unnamed_addr #0

declare void @rcutils_get_default_allocator(ptr dead_on_unwind writable sret(%struct.rcutils_allocator_s) align 8) local_unnamed_addr #1

declare void @rcutils_set_error_state(ptr noundef, ptr noundef, 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 i32 @rcutils_snprintf(ptr noundef, i64 noundef, ptr noundef, ...) local_unnamed_addr #1

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

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

declare void @rcutils_reset_error() local_unnamed_addr #1

declare void @rcutils_get_error_string(ptr dead_on_unwind writable sret(%struct.rcutils_error_string_s) align 1) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @rcutils_logging_set_logger_level(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca %struct.rcutils_allocator_s, align 8
  %5 = alloca %struct.rcutils_error_string_s, align 1
  %6 = alloca %struct.rcutils_error_string_s, align 1
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca [1024 x i8], align 16
  %11 = alloca %struct.rcutils_error_string_s, align 1
  %12 = alloca [1024 x i8], align 16
  %13 = alloca %struct.rcutils_error_string_s, align 1
  %14 = alloca [1024 x i8], align 16
  %15 = alloca %struct.rcutils_error_string_s, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  %16 = load i8, ptr @g_rcutils_logging_initialized, align 1, !tbaa !9, !range !11, !noundef !12
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %thread-pre-split, label %18, !prof !13

18:                                               ; preds = %2
  call void @rcutils_get_default_allocator(ptr dead_on_unwind nonnull writable sret(%struct.rcutils_allocator_s) align 8 %4) #6
  %19 = call i32 @rcutils_logging_initialize_with_allocator(ptr noundef nonnull byval(%struct.rcutils_allocator_s) align 8 %4)
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %thread-pre-split, label %20

20:                                               ; preds = %18
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = call i64 @fwrite(ptr noundef nonnull @.str.44, i64 noundef 1, i64 noundef 103, ptr noundef %21) #7
  call void @rcutils_get_error_string(ptr dead_on_unwind nonnull writable sret(%struct.rcutils_error_string_s) align 1 %5) #6
  call void @rcutils_get_error_string(ptr dead_on_unwind nonnull writable sret(%struct.rcutils_error_string_s) align 1 %6) #6
  %23 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %6) #8
  %24 = load ptr, ptr @stderr, align 8, !tbaa !5
  %25 = call i64 @fwrite(ptr noundef nonnull %5, i64 noundef 1, i64 noundef %23, ptr noundef %24) #7
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %char = load i8, ptr @.str.34, align 1
  %chari = sext i8 %char to i32
  %fputc = call i32 @fputc(i32 %chari, ptr %26)
  call void @rcutils_reset_error() #6
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %20, %18, %2
  %27 = icmp eq ptr %0, null
  br i1 %27, label %28, label %29

28:                                               ; preds = %thread-pre-split
  call void @rcutils_set_error_state(ptr noundef nonnull @.str.45, ptr noundef nonnull @.str.7, i64 noundef 1085) #6
  br label %101

29:                                               ; preds = %thread-pre-split
  %30 = load i8, ptr @g_rcutils_logging_severities_map_valid, align 1, !tbaa !9, !range !11, !noundef !12
  %31 = trunc nuw i8 %30 to i1
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  call void @rcutils_set_error_state(ptr noundef nonnull @.str.46, ptr noundef nonnull @.str.7, i64 noundef 1090) #6
  br label %101

33:                                               ; preds = %29
  %or.cond = icmp ugt i32 %1, 50
  br i1 %or.cond, label %34, label %35

34:                                               ; preds = %33
  call void @rcutils_set_error_state(ptr noundef nonnull @.str.47, ptr noundef nonnull @.str.7, i64 noundef 1099) #6
  br label %101

35:                                               ; preds = %33
  %36 = zext nneg i32 %1 to i64
  %37 = getelementptr inbounds [51 x ptr], ptr @g_rcutils_log_severity_names, i64 0, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %41

40:                                               ; preds = %35
  call void @rcutils_set_error_state(ptr noundef nonnull @.str.48, ptr noundef nonnull @.str.7, i64 noundef 1104) #6
  br label %101

41:                                               ; preds = %35
  %42 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #8
  %43 = call zeroext i1 @rcutils_hash_map_key_exists(ptr noundef nonnull @g_rcutils_logging_severities_map, ptr noundef nonnull %3) #6
  br i1 %43, label %44, label %86

44:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %45 = call i32 @rcutils_hash_map_get_next_key_and_data(ptr noundef nonnull @g_rcutils_logging_severities_map, ptr noundef null, ptr noundef nonnull %7, ptr noundef nonnull %8) #6
  %.not4554 = icmp eq i32 %45, 0
  br i1 %.not4554, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %44, %85
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %46, ptr %9, align 8, !tbaa !5
  %.not42 = icmp eq ptr %46, null
  br i1 %.not42, label %58, label %47

47:                                               ; preds = %.lr.ph
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = call i32 @strncmp(ptr noundef %48, ptr noundef nonnull %46, i64 noundef %42) #8
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %58

51:                                               ; preds = %47
  %52 = getelementptr inbounds i8, ptr %46, i64 %42
  %53 = load i8, ptr %52, align 1, !tbaa !14
  %54 = icmp eq i8 %53, 0
  br i1 %54, label %58, label %55

55:                                               ; preds = %51
  %56 = load i32, ptr %8, align 4, !tbaa !15
  %57 = and i32 %56, 1
  %.not43 = icmp eq i32 %57, 0
  br label %58

58:                                               ; preds = %55, %51, %47, %.lr.ph
  %.036 = phi i1 [ false, %47 ], [ false, %.lr.ph ], [ true, %51 ], [ %.not43, %55 ]
  %59 = call i32 @rcutils_hash_map_get_next_key_and_data(ptr noundef nonnull @g_rcutils_logging_severities_map, ptr noundef nonnull %9, ptr noundef nonnull %7, ptr noundef nonnull %8) #6
  switch i32 %59, label %60 [
    i32 50, label %69
    i32 14, label %69
    i32 0, label %69
  ]

60:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %10) #6
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  call void @rcutils_get_error_string(ptr dead_on_unwind nonnull writable sret(%struct.rcutils_error_string_s) align 1 %11) #6
  %62 = call i32 (ptr, i64, ptr, ...) @rcutils_snprintf(ptr noundef nonnull %10, i64 noundef 1024, ptr noundef nonnull @.str.49, ptr noundef %61, ptr noundef nonnull %11) #6
  %63 = icmp slt i32 %62, 0
  br i1 %63, label %64, label %67

64:                                               ; preds = %60
  %65 = load ptr, ptr @stderr, align 8, !tbaa !5
  %66 = call i64 @fwrite(ptr noundef nonnull @.str.10, i64 noundef 1, i64 noundef 53, ptr noundef %65) #7
  br label %68

67:                                               ; preds = %60
  call void @rcutils_set_error_state(ptr noundef nonnull %10, ptr noundef nonnull @.str.7, i64 noundef 1148) #6
  br label %68

68:                                               ; preds = %67, %64
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %10) #6
  br label %.thread50

69:                                               ; preds = %58, %58, %58
  br i1 %.036, label %70, label %85

70:                                               ; preds = %69
  %71 = call i32 @rcutils_hash_map_unset(ptr noundef nonnull @g_rcutils_logging_severities_map, ptr noundef nonnull %9) #6
  %.not44 = icmp eq i32 %71, 0
  br i1 %.not44, label %81, label %72

72:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %12) #6
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  call void @rcutils_get_error_string(ptr dead_on_unwind nonnull writable sret(%struct.rcutils_error_string_s) align 1 %13) #6
  %74 = call i32 (ptr, i64, ptr, ...) @rcutils_snprintf(ptr noundef nonnull %12, i64 noundef 1024, ptr noundef nonnull @.str.50, ptr noundef %73, ptr noundef nonnull %13) #6
  %75 = icmp slt i32 %74, 0
  br i1 %75, label %76, label %79

76:                                               ; preds = %72
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = call i64 @fwrite(ptr noundef nonnull @.str.10, i64 noundef 1, i64 noundef 53, ptr noundef %77) #7
  br label %80

79:                                               ; preds = %72
  call void @rcutils_set_error_state(ptr noundef nonnull %12, ptr noundef nonnull @.str.7, i64 noundef 1161) #6
  br label %80

80:                                               ; preds = %79, %76
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %12) #6
  br label %.thread50

81:                                               ; preds = %70
  %82 = load ptr, ptr getelementptr inbounds (i8, ptr @g_rcutils_logging_allocator, i64 8), align 8, !tbaa !17
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = load ptr, ptr getelementptr inbounds (i8, ptr @g_rcutils_logging_allocator, i64 32), align 8, !tbaa !19
  call void %82(ptr noundef %83, ptr noundef %84) #6
  br label %85

.thread50:                                        ; preds = %80, %68
  %.3.ph = phi i32 [ %71, %80 ], [ %59, %68 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %101

85:                                               ; preds = %81, %69
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %.not45 = icmp eq i32 %59, 0
  br i1 %.not45, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %85, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %86

86:                                               ; preds = %._crit_edge, %41
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = call i32 @add_key_to_hash_map(ptr noundef %87, i32 noundef %1, i1 noundef zeroext true)
  %.not46 = icmp eq i32 %88, 0
  br i1 %.not46, label %98, label %89

89:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %14) #6
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  call void @rcutils_get_error_string(ptr dead_on_unwind nonnull writable sret(%struct.rcutils_error_string_s) align 1 %15) #6
  %91 = call i32 (ptr, i64, ptr, ...) @rcutils_snprintf(ptr noundef nonnull %14, i64 noundef 1024, ptr noundef nonnull @.str.51, ptr noundef %90, ptr noundef nonnull %15) #6
  %92 = icmp slt i32 %91, 0
  br i1 %92, label %93, label %96

93:                                               ; preds = %89
  %94 = load ptr, ptr @stderr, align 8, !tbaa !5
  %95 = call i64 @fwrite(ptr noundef nonnull @.str.10, i64 noundef 1, i64 noundef 53, ptr noundef %94) #7
  br label %97

96:                                               ; preds = %89
  call void @rcutils_set_error_state(ptr noundef nonnull %14, ptr noundef nonnull @.str.7, i64 noundef 1173) #6
  br label %97

97:                                               ; preds = %96, %93
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %14) #6
  br label %98

98:                                               ; preds = %97, %86
  %99 = icmp eq i64 %42, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %98
  store i32 %1, ptr @g_rcutils_logging_default_logger_level, align 4, !tbaa !15
  br label %101

101:                                              ; preds = %.thread50, %40, %98, %100, %34, %32, %28
  %.7 = phi i32 [ 11, %28 ], [ 11, %34 ], [ 40, %32 ], [ 11, %40 ], [ %88, %100 ], [ %88, %98 ], [ %.3.ph, %.thread50 ]
  ret i32 %.7
}

declare zeroext i1 @rcutils_hash_map_key_exists(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #4

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

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

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 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 #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { cold }
attributes #8 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_Bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!14 = !{!7, !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !6, i64 8}
!18 = !{!"rcutils_allocator_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!19 = !{!18, !6, i64 32}


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