; LLVM IR from freakout42/macrocalc :: arx/src (rdb_crea)

; 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.DBF = type { [1024 x i8], [1024 x i8], ptr, ptr, i32, i32, i8, i8, i8, i8, i8, i8, i8, i32, i32, i8, ptr, ptr, %struct.DBFPROLOG }
%struct.DBFPROLOG = type { i8, i8, i8, i8, i32, i16, i16, i16, i8, i8, [12 x i8], i8, [3 x i8] }
%struct.FIELD_RECORD = type { [11 x i8], i8, i32, i8, i8, [14 x i8] }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @rdb_crea(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i8, align 1
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.DBF, ptr %14, i32 0, i32 16
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %16, ptr %10, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.DBF, ptr %17, i32 0, i32 15
  %19 = load i8, ptr %18, align 8, !tbaa !15
  %20 = zext i8 %19 to i32
  %21 = mul i32 %20, 32
  %22 = zext i32 %21 to i64
  %23 = call noalias ptr @malloc(i64 noundef %22) #9
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.DBF, ptr %24, i32 0, i32 16
  store ptr %23, ptr %25, align 8, !tbaa !11
  %26 = icmp eq ptr %23, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %2
  store i32 8, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %262

28:                                               ; preds = %2
  %29 = call noalias ptr @malloc(i64 noundef 4001) #9
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.DBF, ptr %30, i32 0, i32 17
  store ptr %29, ptr %31, align 8, !tbaa !16
  %32 = icmp eq ptr %29, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %28
  store i32 8, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %262

34:                                               ; preds = %28
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %50

37:                                               ; preds = %34
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.DBF, ptr %38, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !17
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str) #8
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.DBF, ptr %42, i32 0, i32 6
  %44 = load i8, ptr %43, align 8, !tbaa !18
  %45 = sext i8 %44 to i32
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.DBF, ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !17
  %49 = call i32 @putc(i32 noundef %45, ptr noundef %48)
  br label %50

50:                                               ; preds = %37, %34
  store i8 1, ptr %6, align 1, !tbaa !19
  br label %51

51:                                               ; preds = %135, %50
  %52 = load i8, ptr %6, align 1, !tbaa !19
  %53 = zext i8 %52 to i32
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.DBF, ptr %54, i32 0, i32 15
  %56 = load i8, ptr %55, align 8, !tbaa !15
  %57 = zext i8 %56 to i32
  %58 = icmp sle i32 %53, %57
  br i1 %58, label %59, label %138

59:                                               ; preds = %51
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.DBF, ptr %60, i32 0, i32 16
  %62 = load ptr, ptr %61, align 8, !tbaa !11
  %63 = load i8, ptr %6, align 1, !tbaa !19
  %64 = zext i8 %63 to i32
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %struct.FIELD_RECORD, ptr %62, i64 %66
  store ptr %67, ptr %8, align 8, !tbaa !5
  %68 = load ptr, ptr %8, align 8, !tbaa !5
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.FIELD_RECORD, ptr %69, i32 1
  store ptr %70, ptr %10, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %68, ptr align 4 %69, i64 32, i1 false), !tbaa.struct !20
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.DBF, ptr %71, i32 0, i32 17
  %73 = load ptr, ptr %72, align 8, !tbaa !16
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.FIELD_RECORD, ptr %74, i32 0, i32 0
  %76 = getelementptr inbounds [11 x i8], ptr %75, i64 0, i64 0
  %77 = call ptr @strncpy(ptr noundef %73, ptr noundef %76, i64 noundef 11) #8
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.DBF, ptr %78, i32 0, i32 17
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  %81 = getelementptr inbounds i8, ptr %80, i64 11
  store i8 0, ptr %81, align 1, !tbaa !19
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.DBF, ptr %82, i32 0, i32 17
  %84 = load ptr, ptr %83, align 8, !tbaa !16
  store ptr %84, ptr %9, align 8, !tbaa !5
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.DBF, ptr %85, i32 0, i32 14
  %87 = load i32, ptr %86, align 4, !tbaa !21
  switch i32 %87, label %112 [
    i32 1, label %88
    i32 2, label %91
    i32 3, label %94
    i32 0, label %112
  ]

88:                                               ; preds = %59
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = call ptr @str_upr(ptr noundef %89)
  br label %112

91:                                               ; preds = %59
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = call ptr @str_low(ptr noundef %92)
  br label %112

94:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  %95 = call ptr @__ctype_toupper_loc() #10
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %97, i64 0
  %99 = load i8, ptr %98, align 1, !tbaa !19
  %100 = sext i8 %99 to i32
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i32, ptr %96, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  store i32 %103, ptr %12, align 4, !tbaa !9
  %104 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %104, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  %105 = load i32, ptr %13, align 4, !tbaa !9
  %106 = trunc i32 %105 to i8
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %107, i64 0
  store i8 %106, ptr %108, align 1, !tbaa !19
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds i8, ptr %109, i64 1
  %111 = call ptr @str_low(ptr noundef %110)
  br label %112

112:                                              ; preds = %94, %91, %88, %59, %59
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.DBF, ptr %113, i32 0, i32 3
  %115 = load ptr, ptr %114, align 8, !tbaa !17
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %115, ptr noundef @.str.1, ptr noundef %116) #8
  %118 = load i8, ptr %6, align 1, !tbaa !19
  %119 = zext i8 %118 to i32
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.DBF, ptr %120, i32 0, i32 15
  %122 = load i8, ptr %121, align 8, !tbaa !15
  %123 = zext i8 %122 to i32
  %124 = icmp slt i32 %119, %123
  br i1 %124, label %125, label %134

125:                                              ; preds = %112
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.DBF, ptr %126, i32 0, i32 6
  %128 = load i8, ptr %127, align 8, !tbaa !18
  %129 = sext i8 %128 to i32
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.DBF, ptr %130, i32 0, i32 3
  %132 = load ptr, ptr %131, align 8, !tbaa !17
  %133 = call i32 @putc(i32 noundef %129, ptr noundef %132)
  br label %134

134:                                              ; preds = %125, %112
  br label %135

135:                                              ; preds = %134
  %136 = load i8, ptr %6, align 1, !tbaa !19
  %137 = add i8 %136, 1
  store i8 %137, ptr %6, align 1, !tbaa !19
  br label %51, !llvm.loop !22

138:                                              ; preds = %51
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.DBF, ptr %139, i32 0, i32 3
  %141 = load ptr, ptr %140, align 8, !tbaa !17
  %142 = call i32 @putc(i32 noundef 10, ptr noundef %141)
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.DBF, ptr %143, i32 0, i32 7
  %145 = load i8, ptr %144, align 1, !tbaa !24
  %146 = icmp ne i8 %145, 0
  br i1 %146, label %147, label %261

147:                                              ; preds = %138
  %148 = load i32, ptr %5, align 4, !tbaa !9
  %149 = icmp eq i32 %148, 1
  br i1 %149, label %150, label %163

150:                                              ; preds = %147
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.DBF, ptr %151, i32 0, i32 3
  %153 = load ptr, ptr %152, align 8, !tbaa !17
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef @.str.2) #8
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.DBF, ptr %155, i32 0, i32 6
  %157 = load i8, ptr %156, align 8, !tbaa !18
  %158 = sext i8 %157 to i32
  %159 = load ptr, ptr %4, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.DBF, ptr %159, i32 0, i32 3
  %161 = load ptr, ptr %160, align 8, !tbaa !17
  %162 = call i32 @putc(i32 noundef %158, ptr noundef %161)
  br label %163

163:                                              ; preds = %150, %147
  store i8 1, ptr %6, align 1, !tbaa !19
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.DBF, ptr %164, i32 0, i32 16
  %166 = load ptr, ptr %165, align 8, !tbaa !11
  store ptr %166, ptr %8, align 8, !tbaa !5
  br label %167

167:                                              ; preds = %251, %163
  %168 = load i8, ptr %6, align 1, !tbaa !19
  %169 = zext i8 %168 to i32
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.DBF, ptr %170, i32 0, i32 15
  %172 = load i8, ptr %171, align 8, !tbaa !15
  %173 = zext i8 %172 to i32
  %174 = icmp sle i32 %169, %173
  br i1 %174, label %175, label %256

175:                                              ; preds = %167
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.DBF, ptr %176, i32 0, i32 8
  %178 = load i8, ptr %177, align 2, !tbaa !25
  %179 = sext i8 %178 to i32
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %181, label %186

181:                                              ; preds = %175
  %182 = load ptr, ptr %8, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.FIELD_RECORD, ptr %182, i32 0, i32 3
  %184 = load i8, ptr %183, align 4, !tbaa !26
  %185 = zext i8 %184 to i64
  br label %200

186:                                              ; preds = %175
  %187 = load ptr, ptr %8, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.FIELD_RECORD, ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds [11 x i8], ptr %188, i64 0, i64 0
  %190 = call i64 @strlen(ptr noundef %189) #11
  %191 = icmp ult i64 %190, 11
  br i1 %191, label %192, label %197

192:                                              ; preds = %186
  %193 = load ptr, ptr %8, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.FIELD_RECORD, ptr %193, i32 0, i32 0
  %195 = getelementptr inbounds [11 x i8], ptr %194, i64 0, i64 0
  %196 = call i64 @strlen(ptr noundef %195) #11
  br label %198

197:                                              ; preds = %186
  br label %198

198:                                              ; preds = %197, %192
  %199 = phi i64 [ %196, %192 ], [ 11, %197 ]
  br label %200

200:                                              ; preds = %198, %181
  %201 = phi i64 [ %185, %181 ], [ %199, %198 ]
  %202 = trunc i64 %201 to i32
  store i32 %202, ptr %7, align 4, !tbaa !9
  %203 = load ptr, ptr %4, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.DBF, ptr %203, i32 0, i32 8
  %205 = load i8, ptr %204, align 2, !tbaa !25
  %206 = sext i8 %205 to i32
  %207 = icmp ne i32 %206, 0
  br i1 %207, label %208, label %221

208:                                              ; preds = %200
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.FIELD_RECORD, ptr %209, i32 0, i32 1
  %211 = load i8, ptr %210, align 1, !tbaa !28
  %212 = zext i8 %211 to i32
  %213 = icmp eq i32 %212, 68
  br i1 %213, label %214, label %221

214:                                              ; preds = %208
  %215 = load ptr, ptr %4, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.DBF, ptr %215, i32 0, i32 9
  %217 = load i8, ptr %216, align 1, !tbaa !29
  %218 = sext i8 %217 to i32
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %220, label %221

220:                                              ; preds = %214
  store i32 8, ptr %7, align 4, !tbaa !9
  br label %221

221:                                              ; preds = %220, %214, %208, %200
  br label %222

222:                                              ; preds = %230, %221
  %223 = load i32, ptr %7, align 4, !tbaa !9
  %224 = icmp sgt i32 %223, 0
  br i1 %224, label %225, label %233

225:                                              ; preds = %222
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.DBF, ptr %226, i32 0, i32 3
  %228 = load ptr, ptr %227, align 8, !tbaa !17
  %229 = call i32 @putc(i32 noundef 45, ptr noundef %228)
  br label %230

230:                                              ; preds = %225
  %231 = load i32, ptr %7, align 4, !tbaa !9
  %232 = add nsw i32 %231, -1
  store i32 %232, ptr %7, align 4, !tbaa !9
  br label %222, !llvm.loop !30

233:                                              ; preds = %222
  %234 = load i8, ptr %6, align 1, !tbaa !19
  %235 = zext i8 %234 to i32
  %236 = load ptr, ptr %4, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.DBF, ptr %236, i32 0, i32 15
  %238 = load i8, ptr %237, align 8, !tbaa !15
  %239 = zext i8 %238 to i32
  %240 = icmp slt i32 %235, %239
  br i1 %240, label %241, label %250

241:                                              ; preds = %233
  %242 = load ptr, ptr %4, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.DBF, ptr %242, i32 0, i32 6
  %244 = load i8, ptr %243, align 8, !tbaa !18
  %245 = sext i8 %244 to i32
  %246 = load ptr, ptr %4, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.DBF, ptr %246, i32 0, i32 3
  %248 = load ptr, ptr %247, align 8, !tbaa !17
  %249 = call i32 @putc(i32 noundef %245, ptr noundef %248)
  br label %250

250:                                              ; preds = %241, %233
  br label %251

251:                                              ; preds = %250
  %252 = load i8, ptr %6, align 1, !tbaa !19
  %253 = add i8 %252, 1
  store i8 %253, ptr %6, align 1, !tbaa !19
  %254 = load ptr, ptr %8, align 8, !tbaa !5
  %255 = getelementptr inbounds %struct.FIELD_RECORD, ptr %254, i32 1
  store ptr %255, ptr %8, align 8, !tbaa !5
  br label %167, !llvm.loop !31

256:                                              ; preds = %167
  %257 = load ptr, ptr %4, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.DBF, ptr %257, i32 0, i32 3
  %259 = load ptr, ptr %258, align 8, !tbaa !17
  %260 = call i32 @putc(i32 noundef 10, ptr noundef %259)
  br label %261

261:                                              ; preds = %256, %138
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %262

262:                                              ; preds = %261, %33, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #8
  %263 = load i32, ptr %3, align 4
  ret i32 %263
}

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

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

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

declare i32 @putc(i32 noundef, ptr noundef) #4

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

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

declare ptr @str_upr(ptr noundef) #4

declare ptr @str_low(ptr noundef) #4

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() #6

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

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

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 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind willreturn memory(none) }
attributes #11 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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, !6, i64 2096}
!12 = !{!"DBF", !7, i64 0, !7, i64 1024, !6, i64 2048, !6, i64 2056, !10, i64 2064, !10, i64 2068, !7, i64 2072, !7, i64 2073, !7, i64 2074, !7, i64 2075, !7, i64 2076, !7, i64 2077, !7, i64 2078, !10, i64 2080, !10, i64 2084, !7, i64 2088, !6, i64 2096, !6, i64 2104, !13, i64 2112}
!13 = !{!"DBFPROLOG", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !14, i64 8, !14, i64 10, !14, i64 12, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 28, !7, i64 29}
!14 = !{!"short", !7, i64 0}
!15 = !{!12, !7, i64 2088}
!16 = !{!12, !6, i64 2104}
!17 = !{!12, !6, i64 2056}
!18 = !{!12, !7, i64 2072}
!19 = !{!7, !7, i64 0}
!20 = !{i64 0, i64 11, !19, i64 11, i64 1, !19, i64 12, i64 4, !9, i64 16, i64 1, !19, i64 17, i64 1, !19, i64 18, i64 14, !19}
!21 = !{!12, !10, i64 2084}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!12, !7, i64 2073}
!25 = !{!12, !7, i64 2074}
!26 = !{!27, !7, i64 16}
!27 = !{!"FIELD_RECORD", !7, i64 0, !7, i64 11, !10, i64 12, !7, i64 16, !7, i64 17, !7, i64 18}
!28 = !{!27, !7, i64 11}
!29 = !{!12, !7, i64 2075}
!30 = distinct !{!30, !23}
!31 = distinct !{!31, !23}


; 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.FIELD_RECORD = type { [11 x i8], i8, i32, i8, i8, [14 x i8] }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 9) i32 @rdb_crea(ptr nocapture noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 2096
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 2088
  %6 = load i8, ptr %5, align 8, !tbaa !13
  %7 = zext i8 %6 to i64
  %8 = shl nuw nsw i64 %7, 5
  %9 = tail call noalias ptr @malloc(i64 noundef %8) #9
  store ptr %9, ptr %3, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %121, label %11

11:                                               ; preds = %2
  %12 = tail call noalias dereferenceable_or_null(4001) ptr @malloc(i64 noundef 4001) #9
  %13 = getelementptr inbounds i8, ptr %0, i64 2104
  store ptr %12, ptr %13, align 8, !tbaa !14
  %14 = icmp eq ptr %12, null
  br i1 %14, label %121, label %15

15:                                               ; preds = %11
  %16 = icmp eq i32 %1, 1
  br i1 %16, label %17, label %26

17:                                               ; preds = %15
  %18 = getelementptr inbounds i8, ptr %0, i64 2056
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str) #10
  %21 = getelementptr inbounds i8, ptr %0, i64 2072
  %22 = load i8, ptr %21, align 8, !tbaa !16
  %23 = sext i8 %22 to i32
  %24 = load ptr, ptr %18, align 8, !tbaa !15
  %25 = tail call i32 @putc(i32 noundef %23, ptr noundef %24)
  %.pre = load i8, ptr %5, align 8, !tbaa !13
  br label %26

26:                                               ; preds = %17, %15
  %27 = phi i8 [ %.pre, %17 ], [ %6, %15 ]
  %.not73 = icmp eq i8 %27, 0
  br i1 %.not73, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %26
  %28 = getelementptr inbounds i8, ptr %0, i64 2084
  %29 = getelementptr inbounds i8, ptr %0, i64 2056
  %30 = getelementptr inbounds i8, ptr %0, i64 2072
  br label %31

31:                                               ; preds = %.lr.ph, %67
  %.05975 = phi i8 [ 1, %.lr.ph ], [ %69, %67 ]
  %.06074 = phi ptr [ %4, %.lr.ph ], [ %36, %67 ]
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = zext i8 %.05975 to i64
  %34 = getelementptr %struct.FIELD_RECORD, ptr %32, i64 %33
  %35 = getelementptr i8, ptr %34, i64 -32
  %36 = getelementptr inbounds i8, ptr %.06074, i64 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %35, ptr noundef nonnull align 4 dereferenceable(32) %.06074, i64 32, i1 false), !tbaa.struct !17
  %37 = load ptr, ptr %13, align 8, !tbaa !14
  %38 = tail call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %37, ptr noundef nonnull dereferenceable(1) %35, i64 noundef 11) #10
  %39 = load ptr, ptr %13, align 8, !tbaa !14
  %40 = getelementptr inbounds i8, ptr %39, i64 11
  store i8 0, ptr %40, align 1, !tbaa !18
  %41 = load ptr, ptr %13, align 8, !tbaa !14
  %42 = load i32, ptr %28, align 4, !tbaa !20
  switch i32 %42, label %57 [
    i32 1, label %43
    i32 2, label %45
    i32 3, label %47
  ]

43:                                               ; preds = %31
  %44 = tail call ptr @str_upr(ptr noundef %41) #10
  br label %57

45:                                               ; preds = %31
  %46 = tail call ptr @str_low(ptr noundef %41) #10
  br label %57

47:                                               ; preds = %31
  %48 = tail call ptr @__ctype_toupper_loc() #11
  %49 = load ptr, ptr %48, align 8, !tbaa !21
  %50 = load i8, ptr %41, align 1, !tbaa !18
  %51 = sext i8 %50 to i64
  %52 = getelementptr inbounds i32, ptr %49, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !19
  %54 = trunc i32 %53 to i8
  store i8 %54, ptr %41, align 1, !tbaa !18
  %55 = getelementptr inbounds i8, ptr %41, i64 1
  %56 = tail call ptr @str_low(ptr noundef nonnull %55) #10
  br label %57

57:                                               ; preds = %47, %45, %43, %31
  %58 = load ptr, ptr %29, align 8, !tbaa !15
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef nonnull @.str.1, ptr noundef %41) #10
  %60 = load i8, ptr %5, align 8, !tbaa !13
  %61 = icmp ult i8 %.05975, %60
  br i1 %61, label %62, label %67

62:                                               ; preds = %57
  %63 = load i8, ptr %30, align 8, !tbaa !16
  %64 = sext i8 %63 to i32
  %65 = load ptr, ptr %29, align 8, !tbaa !15
  %66 = tail call i32 @putc(i32 noundef %64, ptr noundef %65)
  %.pre86 = load i8, ptr %5, align 8, !tbaa !13
  br label %67

67:                                               ; preds = %57, %62
  %68 = phi i8 [ %60, %57 ], [ %.pre86, %62 ]
  %69 = add i8 %.05975, 1
  %.not = icmp ugt i8 %69, %68
  br i1 %.not, label %._crit_edge, label %31, !llvm.loop !22

._crit_edge:                                      ; preds = %67, %26
  %70 = getelementptr inbounds i8, ptr %0, i64 2056
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %72 = tail call i32 @putc(i32 noundef 10, ptr noundef %71)
  %73 = getelementptr inbounds i8, ptr %0, i64 2073
  %74 = load i8, ptr %73, align 1, !tbaa !24
  %.not67 = icmp eq i8 %74, 0
  br i1 %.not67, label %121, label %75

75:                                               ; preds = %._crit_edge
  br i1 %16, label %76, label %84

76:                                               ; preds = %75
  %77 = load ptr, ptr %70, align 8, !tbaa !15
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef nonnull @.str.2) #10
  %79 = getelementptr inbounds i8, ptr %0, i64 2072
  %80 = load i8, ptr %79, align 8, !tbaa !16
  %81 = sext i8 %80 to i32
  %82 = load ptr, ptr %70, align 8, !tbaa !15
  %83 = tail call i32 @putc(i32 noundef %81, ptr noundef %82)
  br label %84

84:                                               ; preds = %76, %75
  %85 = load i8, ptr %5, align 8, !tbaa !13
  %.not6880 = icmp eq i8 %85, 0
  br i1 %.not6880, label %._crit_edge85, label %.lr.ph84

.lr.ph84:                                         ; preds = %84
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %0, i64 2074
  %88 = getelementptr inbounds i8, ptr %0, i64 2075
  %89 = getelementptr inbounds i8, ptr %0, i64 2072
  br label %90

90:                                               ; preds = %.lr.ph84, %115
  %91 = phi i8 [ %85, %.lr.ph84 ], [ %116, %115 ]
  %.182 = phi i8 [ 1, %.lr.ph84 ], [ %117, %115 ]
  %.06381 = phi ptr [ %86, %.lr.ph84 ], [ %118, %115 ]
  %92 = load i8, ptr %87, align 2, !tbaa !25
  %.not69 = icmp eq i8 %92, 0
  br i1 %.not69, label %.thread, label %95

.thread:                                          ; preds = %90
  %93 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.06381) #12
  %spec.select = tail call i64 @llvm.umin.i64(i64 %93, i64 11)
  %94 = trunc nuw nsw i64 %spec.select to i32
  br label %select.unfold

95:                                               ; preds = %90
  %96 = getelementptr inbounds i8, ptr %.06381, i64 16
  %97 = load i8, ptr %96, align 4, !tbaa !26
  %98 = zext i8 %97 to i32
  %99 = getelementptr inbounds i8, ptr %.06381, i64 11
  %100 = load i8, ptr %99, align 1, !tbaa !28
  %101 = icmp eq i8 %100, 68
  br i1 %101, label %102, label %select.unfold

102:                                              ; preds = %95
  %103 = load i8, ptr %88, align 1, !tbaa !29
  %.not71 = icmp eq i8 %103, 0
  br i1 %.not71, label %select.unfold, label %.lr.ph78.preheader

select.unfold:                                    ; preds = %102, %.thread, %95
  %.061 = phi i32 [ %98, %95 ], [ %94, %.thread ], [ %98, %102 ]
  %.not92 = icmp eq i32 %.061, 0
  br i1 %.not92, label %._crit_edge79, label %.lr.ph78.preheader

.lr.ph78.preheader:                               ; preds = %102, %select.unfold
  %.16276.ph = phi i32 [ 8, %102 ], [ %.061, %select.unfold ]
  br label %.lr.ph78

.lr.ph78:                                         ; preds = %.lr.ph78.preheader, %.lr.ph78
  %.16276 = phi i32 [ %106, %.lr.ph78 ], [ %.16276.ph, %.lr.ph78.preheader ]
  %104 = load ptr, ptr %70, align 8, !tbaa !15
  %105 = tail call i32 @putc(i32 noundef 45, ptr noundef %104)
  %106 = add nsw i32 %.16276, -1
  %107 = icmp ugt i32 %.16276, 1
  br i1 %107, label %.lr.ph78, label %._crit_edge79.loopexit, !llvm.loop !30

._crit_edge79.loopexit:                           ; preds = %.lr.ph78
  %.pre87 = load i8, ptr %5, align 8, !tbaa !13
  br label %._crit_edge79

._crit_edge79:                                    ; preds = %._crit_edge79.loopexit, %select.unfold
  %108 = phi i8 [ %.pre87, %._crit_edge79.loopexit ], [ %91, %select.unfold ]
  %109 = icmp ult i8 %.182, %108
  br i1 %109, label %110, label %115

110:                                              ; preds = %._crit_edge79
  %111 = load i8, ptr %89, align 8, !tbaa !16
  %112 = sext i8 %111 to i32
  %113 = load ptr, ptr %70, align 8, !tbaa !15
  %114 = tail call i32 @putc(i32 noundef %112, ptr noundef %113)
  %.pre88 = load i8, ptr %5, align 8, !tbaa !13
  br label %115

115:                                              ; preds = %._crit_edge79, %110
  %116 = phi i8 [ %108, %._crit_edge79 ], [ %.pre88, %110 ]
  %117 = add i8 %.182, 1
  %118 = getelementptr inbounds i8, ptr %.06381, i64 32
  %.not68 = icmp ugt i8 %117, %116
  br i1 %.not68, label %._crit_edge85, label %90, !llvm.loop !31

._crit_edge85:                                    ; preds = %115, %84
  %119 = load ptr, ptr %70, align 8, !tbaa !15
  %120 = tail call i32 @putc(i32 noundef 10, ptr noundef %119)
  br label %121

121:                                              ; preds = %._crit_edge, %._crit_edge85, %11, %2
  %.0 = phi i32 [ 8, %2 ], [ 8, %11 ], [ 0, %._crit_edge85 ], [ 0, %._crit_edge ]
  ret i32 %.0
}

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

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

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

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

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

declare ptr @str_upr(ptr noundef) local_unnamed_addr #5

declare ptr @str_low(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_toupper_loc() local_unnamed_addr #6

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { "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 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(none) }
attributes #12 = { 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, !9, i64 2096}
!6 = !{!"DBF", !7, i64 0, !7, i64 1024, !9, i64 2048, !9, i64 2056, !10, i64 2064, !10, i64 2068, !7, i64 2072, !7, i64 2073, !7, i64 2074, !7, i64 2075, !7, i64 2076, !7, i64 2077, !7, i64 2078, !10, i64 2080, !10, i64 2084, !7, i64 2088, !9, i64 2096, !9, i64 2104, !11, i64 2112}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"DBFPROLOG", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 4, !12, i64 8, !12, i64 10, !12, i64 12, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 28, !7, i64 29}
!12 = !{!"short", !7, i64 0}
!13 = !{!6, !7, i64 2088}
!14 = !{!6, !9, i64 2104}
!15 = !{!6, !9, i64 2056}
!16 = !{!6, !7, i64 2072}
!17 = !{i64 0, i64 11, !18, i64 11, i64 1, !18, i64 12, i64 4, !19, i64 16, i64 1, !18, i64 17, i64 1, !18, i64 18, i64 14, !18}
!18 = !{!7, !7, i64 0}
!19 = !{!10, !10, i64 0}
!20 = !{!6, !10, i64 2084}
!21 = !{!9, !9, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!6, !7, i64 2073}
!25 = !{!6, !7, i64 2074}
!26 = !{!27, !7, i64 16}
!27 = !{!"FIELD_RECORD", !7, i64 0, !7, i64 11, !10, i64 12, !7, i64 16, !7, i64 17, !7, i64 18}
!28 = !{!27, !7, i64 11}
!29 = !{!6, !7, i64 2075}
!30 = distinct !{!30, !23}
!31 = distinct !{!31, !23}


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