; LLVM IR from recp/ds :: test/src (test_rb)

; 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.test_status_t = type { ptr, i32 }
%struct.RBTree = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64 }
%struct.RBNode = type { ptr, ptr, [2 x ptr], i8 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@inserted_items = external hidden global [2000 x ptr], align 16
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local { ptr, i32 } @test_rb_topdown_str() #0 {
  %1 = alloca %struct.test_status_t, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [256 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 256, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 1000, ptr %7, align 4, !tbaa !5
  %11 = call ptr @rb_newtree_str()
  store ptr %11, ptr %2, align 8, !tbaa !9
  %12 = load ptr, ptr %2, align 8, !tbaa !9
  %13 = getelementptr inbounds %struct.RBTree, ptr %12, i32 0, i32 7
  store ptr @test_rb_foundkey, ptr %13, align 8, !tbaa !11
  %14 = call i64 @time(ptr noundef null) #4
  %15 = trunc i64 %14 to i32
  call void @srand(i32 noundef %15) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %99, %0
  %17 = load i32, ptr %8, align 4, !tbaa !5
  %18 = load i32, ptr %7, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %20, label %102

20:                                               ; preds = %16
  %21 = call i32 @rand() #4
  %22 = sext i32 %21 to i64
  %23 = urem i64 %22, 31
  %24 = trunc i64 %23 to i32
  store i32 %24, ptr %9, align 4, !tbaa !5
  %25 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  call void @rand_str(ptr noundef %25, i64 noundef %27)
  %28 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %29 = call noalias ptr @strdup(ptr noundef %28) #4
  store ptr %29, ptr %6, align 8, !tbaa !9
  %30 = load ptr, ptr %2, align 8, !tbaa !9
  %31 = load ptr, ptr %6, align 8, !tbaa !9
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  call void @rb_insert(ptr noundef %30, ptr noundef %31, ptr noundef %32)
  br label %33

33:                                               ; preds = %20
  %34 = load ptr, ptr %2, align 8, !tbaa !9
  %35 = load ptr, ptr %2, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.RBTree, ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !14
  %38 = getelementptr inbounds %struct.RBNode, ptr %37, i32 0, i32 2
  %39 = getelementptr inbounds [2 x ptr], ptr %38, i64 0, i64 1
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = call i32 @rb_assert(ptr noundef %34, ptr noundef %40)
  %42 = icmp ne i32 %41, 0
  br i1 %42, label %48, label %43

43:                                               ; preds = %33
  %44 = load ptr, ptr @stderr, align 8, !tbaa !9
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 90, ptr noundef @.str.2) #4
  %46 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %46, align 8, !tbaa !15
  %47 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %47, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

48:                                               ; preds = %33
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  %51 = load ptr, ptr %2, align 8, !tbaa !9
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  %53 = call ptr @rb_find_node(ptr noundef %51, ptr noundef %52)
  store ptr %53, ptr %3, align 8, !tbaa !9
  br label %54

54:                                               ; preds = %50
  %55 = load ptr, ptr %3, align 8, !tbaa !9
  %56 = icmp ne ptr %55, null
  br i1 %56, label %62, label %57

57:                                               ; preds = %54
  %58 = load ptr, ptr @stderr, align 8, !tbaa !9
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 94, ptr noundef @.str.3) #4
  %60 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %60, align 8, !tbaa !15
  %61 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %61, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

62:                                               ; preds = %54
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  %65 = load ptr, ptr %2, align 8, !tbaa !9
  %66 = load ptr, ptr %6, align 8, !tbaa !9
  %67 = call ptr @rb_find(ptr noundef %65, ptr noundef %66)
  store ptr %67, ptr %4, align 8, !tbaa !9
  br label %68

68:                                               ; preds = %64
  %69 = load ptr, ptr %3, align 8, !tbaa !9
  %70 = icmp ne ptr %69, null
  br i1 %70, label %76, label %71

71:                                               ; preds = %68
  %72 = load ptr, ptr @stderr, align 8, !tbaa !9
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 98, ptr noundef @.str.3) #4
  %74 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %74, align 8, !tbaa !15
  %75 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %75, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

76:                                               ; preds = %68
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  %80 = load ptr, ptr %3, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct.RBNode, ptr %80, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !18
  %83 = load ptr, ptr %4, align 8, !tbaa !9
  %84 = icmp eq ptr %82, %83
  br i1 %84, label %90, label %85

85:                                               ; preds = %79
  %86 = load ptr, ptr @stderr, align 8, !tbaa !9
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 101, ptr noundef @.str.4) #4
  %88 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %88, align 8, !tbaa !15
  %89 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %89, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

90:                                               ; preds = %79
  br label %91

91:                                               ; preds = %90
  br label %92

92:                                               ; preds = %91
  %93 = load ptr, ptr %3, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.RBNode, ptr %93, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !20
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [2000 x ptr], ptr @inserted_items, i64 0, i64 %97
  store ptr %95, ptr %98, align 8, !tbaa !9
  br label %99

99:                                               ; preds = %92
  %100 = load i32, ptr %8, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %8, align 4, !tbaa !5
  br label %16, !llvm.loop !21

102:                                              ; preds = %16
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %187, %102
  %104 = load i32, ptr %8, align 4, !tbaa !5
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %190

107:                                              ; preds = %103
  %108 = call i32 @rand() #4
  %109 = sext i32 %108 to i64
  %110 = urem i64 %109, 31
  %111 = trunc i64 %110 to i32
  store i32 %111, ptr %9, align 4, !tbaa !5
  %112 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  call void @rand_str(ptr noundef %112, i64 noundef %114)
  %115 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %116 = call noalias ptr @strdup(ptr noundef %115) #4
  store ptr %116, ptr %6, align 8, !tbaa !9
  %117 = load ptr, ptr %2, align 8, !tbaa !9
  %118 = load ptr, ptr %6, align 8, !tbaa !9
  %119 = load ptr, ptr %6, align 8, !tbaa !9
  call void @rb_insert(ptr noundef %117, ptr noundef %118, ptr noundef %119)
  br label %120

120:                                              ; preds = %107
  %121 = load ptr, ptr %2, align 8, !tbaa !9
  %122 = load ptr, ptr %2, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.RBTree, ptr %122, i32 0, i32 1
  %124 = load ptr, ptr %123, align 8, !tbaa !14
  %125 = getelementptr inbounds %struct.RBNode, ptr %124, i32 0, i32 2
  %126 = getelementptr inbounds [2 x ptr], ptr %125, i64 0, i64 1
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = call i32 @rb_assert(ptr noundef %121, ptr noundef %127)
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %135, label %130

130:                                              ; preds = %120
  %131 = load ptr, ptr @stderr, align 8, !tbaa !9
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 117, ptr noundef @.str.2) #4
  %133 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %133, align 8, !tbaa !15
  %134 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %134, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

135:                                              ; preds = %120
  br label %136

136:                                              ; preds = %135
  br label %137

137:                                              ; preds = %136
  %138 = load ptr, ptr %2, align 8, !tbaa !9
  %139 = load ptr, ptr %6, align 8, !tbaa !9
  %140 = call ptr @rb_find_node(ptr noundef %138, ptr noundef %139)
  store ptr %140, ptr %3, align 8, !tbaa !9
  br label %141

141:                                              ; preds = %137
  %142 = load ptr, ptr %3, align 8, !tbaa !9
  %143 = icmp ne ptr %142, null
  br i1 %143, label %149, label %144

144:                                              ; preds = %141
  %145 = load ptr, ptr @stderr, align 8, !tbaa !9
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 121, ptr noundef @.str.3) #4
  %147 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %147, align 8, !tbaa !15
  %148 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %148, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

149:                                              ; preds = %141
  br label %150

150:                                              ; preds = %149
  br label %151

151:                                              ; preds = %150
  %152 = load ptr, ptr %2, align 8, !tbaa !9
  %153 = load ptr, ptr %6, align 8, !tbaa !9
  %154 = call ptr @rb_find(ptr noundef %152, ptr noundef %153)
  store ptr %154, ptr %4, align 8, !tbaa !9
  br label %155

155:                                              ; preds = %151
  %156 = load ptr, ptr %3, align 8, !tbaa !9
  %157 = icmp ne ptr %156, null
  br i1 %157, label %163, label %158

158:                                              ; preds = %155
  %159 = load ptr, ptr @stderr, align 8, !tbaa !9
  %160 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %159, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 125, ptr noundef @.str.3) #4
  %161 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %161, align 8, !tbaa !15
  %162 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %162, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

163:                                              ; preds = %155
  br label %164

164:                                              ; preds = %163
  br label %165

165:                                              ; preds = %164
  br label %166

166:                                              ; preds = %165
  %167 = load ptr, ptr %3, align 8, !tbaa !9
  %168 = getelementptr inbounds %struct.RBNode, ptr %167, i32 0, i32 1
  %169 = load ptr, ptr %168, align 8, !tbaa !18
  %170 = load ptr, ptr %4, align 8, !tbaa !9
  %171 = icmp eq ptr %169, %170
  br i1 %171, label %177, label %172

172:                                              ; preds = %166
  %173 = load ptr, ptr @stderr, align 8, !tbaa !9
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %173, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 128, ptr noundef @.str.4) #4
  %175 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %175, align 8, !tbaa !15
  %176 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %176, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

177:                                              ; preds = %166
  br label %178

178:                                              ; preds = %177
  br label %179

179:                                              ; preds = %178
  %180 = load ptr, ptr %3, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.RBNode, ptr %180, i32 0, i32 0
  %182 = load ptr, ptr %181, align 8, !tbaa !20
  %183 = load i32, ptr %8, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1000
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [2000 x ptr], ptr @inserted_items, i64 0, i64 %185
  store ptr %182, ptr %186, align 8, !tbaa !9
  br label %187

187:                                              ; preds = %179
  %188 = load i32, ptr %8, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %8, align 4, !tbaa !5
  br label %103, !llvm.loop !23

190:                                              ; preds = %103
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %220, %190
  %192 = load i32, ptr %8, align 4, !tbaa !5
  %193 = load i32, ptr %7, align 4, !tbaa !5
  %194 = mul nsw i32 %193, 2
  %195 = icmp slt i32 %192, %194
  br i1 %195, label %196, label %223

196:                                              ; preds = %191
  %197 = load ptr, ptr %2, align 8, !tbaa !9
  %198 = load i32, ptr %8, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [2000 x ptr], ptr @inserted_items, i64 0, i64 %199
  %201 = load ptr, ptr %200, align 8, !tbaa !9
  call void @rb_remove(ptr noundef %197, ptr noundef %201)
  br label %202

202:                                              ; preds = %196
  %203 = load ptr, ptr %2, align 8, !tbaa !9
  %204 = load ptr, ptr %2, align 8, !tbaa !9
  %205 = getelementptr inbounds %struct.RBTree, ptr %204, i32 0, i32 1
  %206 = load ptr, ptr %205, align 8, !tbaa !14
  %207 = getelementptr inbounds %struct.RBNode, ptr %206, i32 0, i32 2
  %208 = getelementptr inbounds [2 x ptr], ptr %207, i64 0, i64 1
  %209 = load ptr, ptr %208, align 8, !tbaa !9
  %210 = call i32 @rb_assert(ptr noundef %203, ptr noundef %209)
  %211 = icmp ne i32 %210, 0
  br i1 %211, label %217, label %212

212:                                              ; preds = %202
  %213 = load ptr, ptr @stderr, align 8, !tbaa !9
  %214 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %213, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 138, ptr noundef @.str.2) #4
  %215 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %215, align 8, !tbaa !15
  %216 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %216, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

217:                                              ; preds = %202
  br label %218

218:                                              ; preds = %217
  br label %219

219:                                              ; preds = %218
  br label %220

220:                                              ; preds = %219
  %221 = load i32, ptr %8, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %8, align 4, !tbaa !5
  br label %191, !llvm.loop !24

223:                                              ; preds = %191
  br label %224

224:                                              ; preds = %223
  %225 = load ptr, ptr %2, align 8, !tbaa !9
  %226 = call zeroext i1 @rb_isempty(ptr noundef %225)
  br i1 %226, label %232, label %227

227:                                              ; preds = %224
  %228 = load ptr, ptr @stderr, align 8, !tbaa !9
  %229 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %228, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 142, ptr noundef @.str.5) #4
  %230 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %230, align 8, !tbaa !15
  %231 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %231, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

232:                                              ; preds = %224
  br label %233

233:                                              ; preds = %232
  br label %234

234:                                              ; preds = %233
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %235

235:                                              ; preds = %317, %234
  %236 = load i32, ptr %8, align 4, !tbaa !5
  %237 = icmp slt i32 %236, 100
  br i1 %237, label %238, label %320

238:                                              ; preds = %235
  %239 = call i32 @rand() #4
  %240 = sext i32 %239 to i64
  %241 = urem i64 %240, 31
  %242 = trunc i64 %241 to i32
  store i32 %242, ptr %9, align 4, !tbaa !5
  %243 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %244 = load i32, ptr %9, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  call void @rand_str(ptr noundef %243, i64 noundef %245)
  %246 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %247 = call noalias ptr @strdup(ptr noundef %246) #4
  store ptr %247, ptr %6, align 8, !tbaa !9
  %248 = load ptr, ptr %2, align 8, !tbaa !9
  %249 = load ptr, ptr %6, align 8, !tbaa !9
  %250 = load ptr, ptr %6, align 8, !tbaa !9
  call void @rb_insert(ptr noundef %248, ptr noundef %249, ptr noundef %250)
  br label %251

251:                                              ; preds = %238
  %252 = load ptr, ptr %2, align 8, !tbaa !9
  %253 = load ptr, ptr %2, align 8, !tbaa !9
  %254 = getelementptr inbounds %struct.RBTree, ptr %253, i32 0, i32 1
  %255 = load ptr, ptr %254, align 8, !tbaa !14
  %256 = getelementptr inbounds %struct.RBNode, ptr %255, i32 0, i32 2
  %257 = getelementptr inbounds [2 x ptr], ptr %256, i64 0, i64 1
  %258 = load ptr, ptr %257, align 8, !tbaa !9
  %259 = call i32 @rb_assert(ptr noundef %252, ptr noundef %258)
  %260 = icmp ne i32 %259, 0
  br i1 %260, label %266, label %261

261:                                              ; preds = %251
  %262 = load ptr, ptr @stderr, align 8, !tbaa !9
  %263 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %262, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 155, ptr noundef @.str.2) #4
  %264 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %264, align 8, !tbaa !15
  %265 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %265, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

266:                                              ; preds = %251
  br label %267

267:                                              ; preds = %266
  br label %268

268:                                              ; preds = %267
  %269 = load ptr, ptr %2, align 8, !tbaa !9
  %270 = load ptr, ptr %6, align 8, !tbaa !9
  %271 = call ptr @rb_find_node(ptr noundef %269, ptr noundef %270)
  store ptr %271, ptr %3, align 8, !tbaa !9
  br label %272

272:                                              ; preds = %268
  %273 = load ptr, ptr %3, align 8, !tbaa !9
  %274 = icmp ne ptr %273, null
  br i1 %274, label %280, label %275

275:                                              ; preds = %272
  %276 = load ptr, ptr @stderr, align 8, !tbaa !9
  %277 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %276, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 159, ptr noundef @.str.3) #4
  %278 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %278, align 8, !tbaa !15
  %279 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %279, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

280:                                              ; preds = %272
  br label %281

281:                                              ; preds = %280
  br label %282

282:                                              ; preds = %281
  %283 = load ptr, ptr %2, align 8, !tbaa !9
  %284 = load ptr, ptr %6, align 8, !tbaa !9
  %285 = call ptr @rb_find(ptr noundef %283, ptr noundef %284)
  store ptr %285, ptr %4, align 8, !tbaa !9
  br label %286

286:                                              ; preds = %282
  %287 = load ptr, ptr %3, align 8, !tbaa !9
  %288 = icmp ne ptr %287, null
  br i1 %288, label %294, label %289

289:                                              ; preds = %286
  %290 = load ptr, ptr @stderr, align 8, !tbaa !9
  %291 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %290, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 163, ptr noundef @.str.3) #4
  %292 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %292, align 8, !tbaa !15
  %293 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %293, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

294:                                              ; preds = %286
  br label %295

295:                                              ; preds = %294
  br label %296

296:                                              ; preds = %295
  br label %297

297:                                              ; preds = %296
  %298 = load ptr, ptr %3, align 8, !tbaa !9
  %299 = getelementptr inbounds %struct.RBNode, ptr %298, i32 0, i32 1
  %300 = load ptr, ptr %299, align 8, !tbaa !18
  %301 = load ptr, ptr %4, align 8, !tbaa !9
  %302 = icmp eq ptr %300, %301
  br i1 %302, label %308, label %303

303:                                              ; preds = %297
  %304 = load ptr, ptr @stderr, align 8, !tbaa !9
  %305 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %304, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 166, ptr noundef @.str.4) #4
  %306 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %306, align 8, !tbaa !15
  %307 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %307, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

308:                                              ; preds = %297
  br label %309

309:                                              ; preds = %308
  br label %310

310:                                              ; preds = %309
  %311 = load ptr, ptr %3, align 8, !tbaa !9
  %312 = getelementptr inbounds %struct.RBNode, ptr %311, i32 0, i32 0
  %313 = load ptr, ptr %312, align 8, !tbaa !20
  %314 = load i32, ptr %8, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [2000 x ptr], ptr @inserted_items, i64 0, i64 %315
  store ptr %313, ptr %316, align 8, !tbaa !9
  br label %317

317:                                              ; preds = %310
  %318 = load i32, ptr %8, align 4, !tbaa !5
  %319 = add nsw i32 %318, 1
  store i32 %319, ptr %8, align 4, !tbaa !5
  br label %235, !llvm.loop !25

320:                                              ; preds = %235
  %321 = load ptr, ptr %2, align 8, !tbaa !9
  call void @rb_walk(ptr noundef %321, ptr noundef @test_rb_walk)
  %322 = load ptr, ptr %2, align 8, !tbaa !9
  call void @rb_empty(ptr noundef %322)
  br label %323

323:                                              ; preds = %320
  %324 = load ptr, ptr %2, align 8, !tbaa !9
  %325 = call zeroext i1 @rb_isempty(ptr noundef %324)
  br i1 %325, label %331, label %326

326:                                              ; preds = %323
  %327 = load ptr, ptr @stderr, align 8, !tbaa !9
  %328 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %327, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 176, ptr noundef @.str.5) #4
  %329 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %329, align 8, !tbaa !15
  %330 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 0, ptr %330, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

331:                                              ; preds = %323
  br label %332

332:                                              ; preds = %331
  br label %333

333:                                              ; preds = %332
  %334 = getelementptr inbounds [256 x i8], ptr %5, i64 0, i64 0
  %335 = call noalias ptr @strdup(ptr noundef %334) #4
  store ptr %335, ptr %6, align 8, !tbaa !9
  %336 = load ptr, ptr %2, align 8, !tbaa !9
  %337 = load ptr, ptr %6, align 8, !tbaa !9
  %338 = load ptr, ptr %6, align 8, !tbaa !9
  call void @rb_insert(ptr noundef %336, ptr noundef %337, ptr noundef %338)
  %339 = load ptr, ptr %2, align 8, !tbaa !9
  call void @rb_print(ptr noundef %339)
  %340 = load ptr, ptr %2, align 8, !tbaa !9
  call void @rb_destroy(ptr noundef %340)
  %341 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 0
  store ptr null, ptr %341, align 8, !tbaa !15
  %342 = getelementptr inbounds %struct.test_status_t, ptr %1, i32 0, i32 1
  store i32 1, ptr %342, align 8, !tbaa !17
  store i32 1, ptr %10, align 4
  br label %343

343:                                              ; preds = %333, %326, %303, %289, %275, %261, %227, %212, %172, %158, %144, %130, %85, %71, %57, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 256, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #4
  %344 = load { ptr, i32 }, ptr %1, align 8
  ret { ptr, i32 } %344
}

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

declare ptr @rb_newtree_str() #2

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @rand() #3

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

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #3

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

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

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

declare ptr @rb_find_node(ptr noundef, ptr noundef) #2

declare ptr @rb_find(ptr noundef, ptr noundef) #2

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

declare zeroext i1 @rb_isempty(ptr noundef) #2

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

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

declare void @rb_empty(ptr noundef) #2

declare void @rb_print(ptr noundef) #2

declare void @rb_destroy(ptr noundef) #2

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

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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 56}
!12 = !{!"RBTree", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !13, i64 64}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !10, i64 8}
!15 = !{!16, !10, i64 0}
!16 = !{!"test_status_t", !10, i64 0, !6, i64 8}
!17 = !{!16, !6, i64 8}
!18 = !{!19, !10, i64 8}
!19 = !{!"RBNode", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 32}
!20 = !{!19, !10, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !22}


; 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"

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [19 x i8], align 1
@inserted_items = external hidden local_unnamed_addr global [2000 x ptr], align 16
@.str.5 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local { ptr, i32 } @test_rb_topdown_str() local_unnamed_addr #0 {
  %1 = alloca [256 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %1) #6
  %2 = tail call ptr @rb_newtree_str() #6
  %3 = getelementptr inbounds i8, ptr %2, i64 56
  store ptr @test_rb_foundkey, ptr %3, align 8, !tbaa !5
  %4 = tail call i64 @time(ptr noundef null) #6
  %5 = trunc i64 %4 to i32
  tail call void @srand(i32 noundef %5) #6
  %6 = getelementptr inbounds i8, ptr %2, i64 8
  br label %7

7:                                                ; preds = %0, %32
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next, %32 ]
  %8 = call i32 @rand() #6
  %9 = sext i32 %8 to i64
  %10 = urem i64 %9, 31
  call void @rand_str(ptr noundef nonnull %1, i64 noundef %10) #6
  %11 = call noalias ptr @strdup(ptr noundef nonnull %1) #6
  call void @rb_insert(ptr noundef nonnull %2, ptr noundef %11, ptr noundef %11) #6
  %12 = load ptr, ptr %6, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %12, i64 24
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = call i32 @rb_assert(ptr noundef nonnull %2, ptr noundef %14) #6
  %.not79 = icmp eq i32 %15, 0
  br i1 %.not79, label %16, label %19

16:                                               ; preds = %7
  %17 = load ptr, ptr @stderr, align 8, !tbaa !12
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 90, ptr noundef nonnull @.str.2) #7
  br label %112

19:                                               ; preds = %7
  %20 = call ptr @rb_find_node(ptr noundef nonnull %2, ptr noundef %11) #6
  %.not80 = icmp eq ptr %20, null
  br i1 %.not80, label %21, label %24

21:                                               ; preds = %19
  %22 = load ptr, ptr @stderr, align 8, !tbaa !12
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %22, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 94, ptr noundef nonnull @.str.3) #7
  br label %112

24:                                               ; preds = %19
  %25 = call ptr @rb_find(ptr noundef nonnull %2, ptr noundef %11) #6
  %26 = getelementptr inbounds i8, ptr %20, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = icmp eq ptr %27, %25
  br i1 %28, label %32, label %29

29:                                               ; preds = %24
  %30 = load ptr, ptr @stderr, align 8, !tbaa !12
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 101, ptr noundef nonnull @.str.4) #7
  br label %112

32:                                               ; preds = %24
  %33 = load ptr, ptr %20, align 8, !tbaa !15
  %34 = getelementptr inbounds [2000 x ptr], ptr @inserted_items, i64 0, i64 %indvars.iv
  store ptr %33, ptr %34, align 8, !tbaa !12
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1000
  br i1 %exitcond.not, label %.preheader82, label %7, !llvm.loop !16

.preheader82:                                     ; preds = %32, %59
  %indvars.iv88 = phi i64 [ %indvars.iv.next89, %59 ], [ 0, %32 ]
  %35 = call i32 @rand() #6
  %36 = sext i32 %35 to i64
  %37 = urem i64 %36, 31
  call void @rand_str(ptr noundef nonnull %1, i64 noundef %37) #6
  %38 = call noalias ptr @strdup(ptr noundef nonnull %1) #6
  call void @rb_insert(ptr noundef nonnull %2, ptr noundef %38, ptr noundef %38) #6
  %39 = load ptr, ptr %6, align 8, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %39, i64 24
  %41 = load ptr, ptr %40, align 8, !tbaa !12
  %42 = call i32 @rb_assert(ptr noundef nonnull %2, ptr noundef %41) #6
  %.not77 = icmp eq i32 %42, 0
  br i1 %.not77, label %43, label %46

43:                                               ; preds = %.preheader82
  %44 = load ptr, ptr @stderr, align 8, !tbaa !12
  %45 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %44, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 117, ptr noundef nonnull @.str.2) #7
  br label %112

46:                                               ; preds = %.preheader82
  %47 = call ptr @rb_find_node(ptr noundef nonnull %2, ptr noundef %38) #6
  %.not78 = icmp eq ptr %47, null
  br i1 %.not78, label %48, label %51

48:                                               ; preds = %46
  %49 = load ptr, ptr @stderr, align 8, !tbaa !12
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 121, ptr noundef nonnull @.str.3) #7
  br label %112

51:                                               ; preds = %46
  %52 = call ptr @rb_find(ptr noundef nonnull %2, ptr noundef %38) #6
  %53 = getelementptr inbounds i8, ptr %47, i64 8
  %54 = load ptr, ptr %53, align 8, !tbaa !13
  %55 = icmp eq ptr %54, %52
  br i1 %55, label %59, label %56

56:                                               ; preds = %51
  %57 = load ptr, ptr @stderr, align 8, !tbaa !12
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %57, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 128, ptr noundef nonnull @.str.4) #7
  br label %112

59:                                               ; preds = %51
  %60 = load ptr, ptr %47, align 8, !tbaa !15
  %61 = add nuw nsw i64 %indvars.iv88, 1000
  %62 = getelementptr inbounds [2000 x ptr], ptr @inserted_items, i64 0, i64 %61
  store ptr %60, ptr %62, align 8, !tbaa !12
  %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next89, 1000
  br i1 %exitcond91.not, label %.preheader81, label %.preheader82, !llvm.loop !18

63:                                               ; preds = %.preheader81
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %exitcond95.not = icmp eq i64 %indvars.iv.next93, 2000
  br i1 %exitcond95.not, label %73, label %.preheader81, !llvm.loop !19

.preheader81:                                     ; preds = %59, %63
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %63 ], [ 0, %59 ]
  %64 = getelementptr inbounds [2000 x ptr], ptr @inserted_items, i64 0, i64 %indvars.iv92
  %65 = load ptr, ptr %64, align 8, !tbaa !12
  call void @rb_remove(ptr noundef nonnull %2, ptr noundef %65) #6
  %66 = load ptr, ptr %6, align 8, !tbaa !11
  %67 = getelementptr inbounds i8, ptr %66, i64 24
  %68 = load ptr, ptr %67, align 8, !tbaa !12
  %69 = call i32 @rb_assert(ptr noundef nonnull %2, ptr noundef %68) #6
  %.not76 = icmp eq i32 %69, 0
  br i1 %.not76, label %70, label %63

70:                                               ; preds = %.preheader81
  %71 = load ptr, ptr @stderr, align 8, !tbaa !12
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 138, ptr noundef nonnull @.str.2) #7
  br label %112

73:                                               ; preds = %63
  %74 = call zeroext i1 @rb_isempty(ptr noundef nonnull %2) #6
  br i1 %74, label %.preheader, label %75

75:                                               ; preds = %73
  %76 = load ptr, ptr @stderr, align 8, !tbaa !12
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 142, ptr noundef nonnull @.str.5) #7
  br label %112

.preheader:                                       ; preds = %73, %102
  %indvars.iv96 = phi i64 [ %indvars.iv.next97, %102 ], [ 0, %73 ]
  %78 = call i32 @rand() #6
  %79 = sext i32 %78 to i64
  %80 = urem i64 %79, 31
  call void @rand_str(ptr noundef nonnull %1, i64 noundef %80) #6
  %81 = call noalias ptr @strdup(ptr noundef nonnull %1) #6
  call void @rb_insert(ptr noundef nonnull %2, ptr noundef %81, ptr noundef %81) #6
  %82 = load ptr, ptr %6, align 8, !tbaa !11
  %83 = getelementptr inbounds i8, ptr %82, i64 24
  %84 = load ptr, ptr %83, align 8, !tbaa !12
  %85 = call i32 @rb_assert(ptr noundef nonnull %2, ptr noundef %84) #6
  %.not = icmp eq i32 %85, 0
  br i1 %.not, label %86, label %89

86:                                               ; preds = %.preheader
  %87 = load ptr, ptr @stderr, align 8, !tbaa !12
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 155, ptr noundef nonnull @.str.2) #7
  br label %112

89:                                               ; preds = %.preheader
  %90 = call ptr @rb_find_node(ptr noundef nonnull %2, ptr noundef %81) #6
  %.not75 = icmp eq ptr %90, null
  br i1 %.not75, label %91, label %94

91:                                               ; preds = %89
  %92 = load ptr, ptr @stderr, align 8, !tbaa !12
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 159, ptr noundef nonnull @.str.3) #7
  br label %112

94:                                               ; preds = %89
  %95 = call ptr @rb_find(ptr noundef nonnull %2, ptr noundef %81) #6
  %96 = getelementptr inbounds i8, ptr %90, i64 8
  %97 = load ptr, ptr %96, align 8, !tbaa !13
  %98 = icmp eq ptr %97, %95
  br i1 %98, label %102, label %99

99:                                               ; preds = %94
  %100 = load ptr, ptr @stderr, align 8, !tbaa !12
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 166, ptr noundef nonnull @.str.4) #7
  br label %112

102:                                              ; preds = %94
  %103 = load ptr, ptr %90, align 8, !tbaa !15
  %104 = getelementptr inbounds [2000 x ptr], ptr @inserted_items, i64 0, i64 %indvars.iv96
  store ptr %103, ptr %104, align 8, !tbaa !12
  %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
  %exitcond99.not = icmp eq i64 %indvars.iv.next97, 100
  br i1 %exitcond99.not, label %105, label %.preheader, !llvm.loop !20

105:                                              ; preds = %102
  call void @rb_walk(ptr noundef nonnull %2, ptr noundef nonnull @test_rb_walk) #6
  call void @rb_empty(ptr noundef nonnull %2) #6
  %106 = call zeroext i1 @rb_isempty(ptr noundef nonnull %2) #6
  br i1 %106, label %110, label %107

107:                                              ; preds = %105
  %108 = load ptr, ptr @stderr, align 8, !tbaa !12
  %109 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %108, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 176, ptr noundef nonnull @.str.5) #7
  br label %112

110:                                              ; preds = %105
  %111 = call noalias ptr @strdup(ptr noundef nonnull %1) #6
  call void @rb_insert(ptr noundef nonnull %2, ptr noundef %111, ptr noundef %111) #6
  call void @rb_print(ptr noundef nonnull %2) #6
  call void @rb_destroy(ptr noundef nonnull %2) #6
  br label %112

112:                                              ; preds = %110, %107, %99, %91, %86, %75, %70, %56, %48, %43, %29, %21, %16
  %.sroa.17.0 = phi i32 [ 0, %29 ], [ 0, %21 ], [ 0, %16 ], [ 0, %56 ], [ 0, %48 ], [ 0, %43 ], [ 0, %70 ], [ 0, %99 ], [ 0, %91 ], [ 0, %86 ], [ 1, %110 ], [ 0, %107 ], [ 0, %75 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %1) #6
  %.fca.1.insert = insertvalue { ptr, i32 } { ptr null, i32 poison }, i32 %.sroa.17.0, 1
  ret { ptr, i32 } %.fca.1.insert
}

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

declare ptr @rb_newtree_str() local_unnamed_addr #2

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

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #3

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #4

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

declare i32 @rb_assert(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 #5

declare ptr @rb_find_node(ptr noundef, ptr noundef) local_unnamed_addr #2

declare ptr @rb_find(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

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

declare void @rb_empty(ptr noundef) local_unnamed_addr #2

declare void @rb_print(ptr noundef) local_unnamed_addr #2

declare void @rb_destroy(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) #1

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 = { 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: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { cold nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 56}
!6 = !{!"RBTree", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !10, i64 64}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!6, !7, i64 8}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !7, i64 8}
!14 = !{!"RBNode", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 32}
!15 = !{!14, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = distinct !{!19, !17}
!20 = distinct !{!20, !17}


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