; LLVM IR from freakout42/macrocalc :: arx/src (sql_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 [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1

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

24:                                               ; preds = %1
  store i32 8, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %214

25:                                               ; preds = %1
  %26 = call noalias ptr @malloc(i64 noundef 4001) #8
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.DBF, ptr %27, i32 0, i32 17
  store ptr %26, ptr %28, align 8, !tbaa !15
  %29 = icmp eq ptr %26, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %25
  store i32 8, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %214

31:                                               ; preds = %25
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.DBF, ptr %32, i32 0, i32 13
  %34 = load i32, ptr %33, align 8, !tbaa !16
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %67

36:                                               ; preds = %31
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.DBF, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = load ptr, ptr %3, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.DBF, ptr %40, i32 0, i32 1
  %42 = getelementptr inbounds [1024 x i8], ptr %41, i64 0, i64 0
  %43 = load i8, ptr %42, align 8, !tbaa !18
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %47

46:                                               ; preds = %36
  br label %51

47:                                               ; preds = %36
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.DBF, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds [1024 x i8], ptr %49, i64 0, i64 0
  br label %51

51:                                               ; preds = %47, %46
  %52 = phi ptr [ @.str.1, %46 ], [ %50, %47 ]
  %53 = load ptr, ptr %3, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.DBF, ptr %53, i32 0, i32 1
  %55 = getelementptr inbounds [1024 x i8], ptr %54, i64 0, i64 0
  %56 = load i8, ptr %55, align 8, !tbaa !18
  %57 = sext i8 %56 to i32
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %51
  br label %64

60:                                               ; preds = %51
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.DBF, ptr %61, i32 0, i32 1
  %63 = getelementptr inbounds [1024 x i8], ptr %62, i64 0, i64 0
  br label %64

64:                                               ; preds = %60, %59
  %65 = phi ptr [ @.str.1, %59 ], [ %63, %60 ]
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str, ptr noundef %52, ptr noundef %65) #7
  br label %67

67:                                               ; preds = %64, %31
  store i8 1, ptr %4, align 1, !tbaa !18
  br label %68

68:                                               ; preds = %200, %67
  %69 = load i8, ptr %4, align 1, !tbaa !18
  %70 = zext i8 %69 to i32
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.DBF, ptr %71, i32 0, i32 15
  %73 = load i8, ptr %72, align 8, !tbaa !14
  %74 = zext i8 %73 to i32
  %75 = icmp sle i32 %70, %74
  br i1 %75, label %76, label %203

76:                                               ; preds = %68
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.DBF, ptr %77, i32 0, i32 16
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = load i8, ptr %4, align 1, !tbaa !18
  %81 = zext i8 %80 to i32
  %82 = sub nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds %struct.FIELD_RECORD, ptr %79, i64 %83
  store ptr %84, ptr %5, align 8, !tbaa !5
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.FIELD_RECORD, ptr %86, i32 1
  store ptr %87, ptr %7, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %85, ptr align 4 %86, i64 32, i1 false), !tbaa.struct !19
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.FIELD_RECORD, ptr %88, i32 0, i32 0
  %90 = getelementptr inbounds [11 x i8], ptr %89, i64 0, i64 0
  store ptr %90, ptr %6, align 8, !tbaa !5
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.DBF, ptr %91, i32 0, i32 14
  %93 = load i32, ptr %92, align 4, !tbaa !21
  switch i32 %93, label %118 [
    i32 1, label %94
    i32 2, label %97
    i32 3, label %100
    i32 0, label %118
  ]

94:                                               ; preds = %76
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = call ptr @str_upr(ptr noundef %95)
  br label %118

97:                                               ; preds = %76
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = call ptr @str_low(ptr noundef %98)
  br label %118

100:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %101 = call ptr @__ctype_toupper_loc() #9
  %102 = load ptr, ptr %101, align 8, !tbaa !5
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i64 0
  %105 = load i8, ptr %104, align 1, !tbaa !18
  %106 = sext i8 %105 to i32
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %102, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !20
  store i32 %109, ptr %9, align 4, !tbaa !20
  %110 = load i32, ptr %9, align 4, !tbaa !20
  store i32 %110, ptr %10, align 4, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  %111 = load i32, ptr %10, align 4, !tbaa !20
  %112 = trunc i32 %111 to i8
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 0
  store i8 %112, ptr %114, align 1, !tbaa !18
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds i8, ptr %115, i64 1
  %117 = call ptr @str_low(ptr noundef %116)
  br label %118

118:                                              ; preds = %100, %97, %94, %76, %76
  %119 = load ptr, ptr %3, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.DBF, ptr %119, i32 0, i32 13
  %121 = load i32, ptr %120, align 8, !tbaa !16
  %122 = icmp eq i32 %121, 0
  br i1 %122, label %123, label %199

123:                                              ; preds = %118
  %124 = load ptr, ptr %3, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.DBF, ptr %124, i32 0, i32 3
  %126 = load ptr, ptr %125, align 8, !tbaa !17
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.FIELD_RECORD, ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds [11 x i8], ptr %128, i64 0, i64 0
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.2, i32 noundef 11, ptr noundef %129) #7
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.FIELD_RECORD, ptr %131, i32 0, i32 1
  %133 = load i8, ptr %132, align 1, !tbaa !22
  %134 = zext i8 %133 to i32
  switch i32 %134, label %184 [
    i32 68, label %135
    i32 78, label %140
    i32 70, label %153
    i32 76, label %166
    i32 67, label %171
    i32 77, label %180
  ]

135:                                              ; preds = %123
  %136 = load ptr, ptr %3, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.DBF, ptr %136, i32 0, i32 3
  %138 = load ptr, ptr %137, align 8, !tbaa !17
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.3) #7
  br label %185

140:                                              ; preds = %123
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.DBF, ptr %141, i32 0, i32 3
  %143 = load ptr, ptr %142, align 8, !tbaa !17
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.FIELD_RECORD, ptr %144, i32 0, i32 3
  %146 = load i8, ptr %145, align 4, !tbaa !24
  %147 = zext i8 %146 to i32
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.FIELD_RECORD, ptr %148, i32 0, i32 4
  %150 = load i8, ptr %149, align 1, !tbaa !25
  %151 = zext i8 %150 to i32
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %143, ptr noundef @.str.4, i32 noundef %147, i32 noundef %151) #7
  br label %185

153:                                              ; preds = %123
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.DBF, ptr %154, i32 0, i32 3
  %156 = load ptr, ptr %155, align 8, !tbaa !17
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.FIELD_RECORD, ptr %157, i32 0, i32 3
  %159 = load i8, ptr %158, align 4, !tbaa !24
  %160 = zext i8 %159 to i32
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.FIELD_RECORD, ptr %161, i32 0, i32 4
  %163 = load i8, ptr %162, align 1, !tbaa !25
  %164 = zext i8 %163 to i32
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.4, i32 noundef %160, i32 noundef %164) #7
  br label %185

166:                                              ; preds = %123
  %167 = load ptr, ptr %3, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.DBF, ptr %167, i32 0, i32 3
  %169 = load ptr, ptr %168, align 8, !tbaa !17
  %170 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %169, ptr noundef @.str.5) #7
  br label %185

171:                                              ; preds = %123
  %172 = load ptr, ptr %3, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.DBF, ptr %172, i32 0, i32 3
  %174 = load ptr, ptr %173, align 8, !tbaa !17
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.FIELD_RECORD, ptr %175, i32 0, i32 3
  %177 = load i8, ptr %176, align 4, !tbaa !24
  %178 = zext i8 %177 to i32
  %179 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %174, ptr noundef @.str.6, i32 noundef %178) #7
  br label %185

180:                                              ; preds = %123
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.FIELD_RECORD, ptr %181, i32 0, i32 0
  %183 = getelementptr inbounds [11 x i8], ptr %182, i64 0, i64 0
  call void (ptr, ...) @lib_mesg(ptr noundef @.str.7, ptr noundef %183)
  br label %185

184:                                              ; preds = %123
  call void (i32, ptr, ...) @lib_fatl(i32 noundef 12, ptr noundef @.str.8)
  br label %185

185:                                              ; preds = %184, %180, %171, %166, %153, %140, %135
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.DBF, ptr %186, i32 0, i32 3
  %188 = load ptr, ptr %187, align 8, !tbaa !17
  %189 = load i8, ptr %4, align 1, !tbaa !18
  %190 = zext i8 %189 to i32
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.DBF, ptr %191, i32 0, i32 15
  %193 = load i8, ptr %192, align 8, !tbaa !14
  %194 = zext i8 %193 to i32
  %195 = icmp eq i32 %190, %194
  %196 = zext i1 %195 to i64
  %197 = select i1 %195, ptr @.str.10, ptr @.str.11
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef @.str.9, ptr noundef %197) #7
  br label %199

199:                                              ; preds = %185, %118
  br label %200

200:                                              ; preds = %199
  %201 = load i8, ptr %4, align 1, !tbaa !18
  %202 = add i8 %201, 1
  store i8 %202, ptr %4, align 1, !tbaa !18
  br label %68, !llvm.loop !26

203:                                              ; preds = %68
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.DBF, ptr %204, i32 0, i32 13
  %206 = load i32, ptr %205, align 8, !tbaa !16
  %207 = icmp eq i32 %206, 0
  br i1 %207, label %208, label %213

208:                                              ; preds = %203
  %209 = load ptr, ptr %3, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.DBF, ptr %209, i32 0, i32 3
  %211 = load ptr, ptr %210, align 8, !tbaa !17
  %212 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %211, ptr noundef @.str.12) #7
  br label %213

213:                                              ; preds = %208, %203
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %214

214:                                              ; preds = %213, %30, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #7
  %215 = load i32, ptr %2, align 4
  ret i32 %215
}

; 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

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

declare ptr @str_upr(ptr noundef) #5

declare ptr @str_low(ptr noundef) #5

; 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

declare void @lib_mesg(ptr noundef, ...) #5

declare void @lib_fatl(i32 noundef, ptr noundef, ...) #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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind willreturn memory(none) }

!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, !6, i64 2096}
!10 = !{!"DBF", !7, i64 0, !7, i64 1024, !6, i64 2048, !6, i64 2056, !11, i64 2064, !11, i64 2068, !7, i64 2072, !7, i64 2073, !7, i64 2074, !7, i64 2075, !7, i64 2076, !7, i64 2077, !7, i64 2078, !11, i64 2080, !11, i64 2084, !7, i64 2088, !6, i64 2096, !6, i64 2104, !12, i64 2112}
!11 = !{!"int", !7, i64 0}
!12 = !{!"DBFPROLOG", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !11, i64 4, !13, i64 8, !13, i64 10, !13, i64 12, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 28, !7, i64 29}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !7, i64 2088}
!15 = !{!10, !6, i64 2104}
!16 = !{!10, !11, i64 2080}
!17 = !{!10, !6, i64 2056}
!18 = !{!7, !7, i64 0}
!19 = !{i64 0, i64 11, !18, i64 11, i64 1, !18, i64 12, i64 4, !20, i64 16, i64 1, !18, i64 17, i64 1, !18, i64 18, i64 14, !18}
!20 = !{!11, !11, i64 0}
!21 = !{!10, !11, i64 2084}
!22 = !{!23, !7, i64 11}
!23 = !{!"FIELD_RECORD", !7, i64 0, !7, i64 11, !11, i64 12, !7, i64 16, !7, i64 17, !7, i64 18}
!24 = !{!23, !7, i64 16}
!25 = !{!23, !7, i64 17}
!26 = distinct !{!26, !27}
!27 = !{!"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.FIELD_RECORD = type { [11 x i8], i8, i32, i8, i8, [14 x i8] }

@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 2080
  %16 = load i32, ptr %15, align 8, !tbaa !15
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %26

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 2056
  %20 = load ptr, ptr %19, align 8, !tbaa !16
  %21 = getelementptr inbounds i8, ptr %0, i64 1024
  %22 = load i8, ptr %21, align 8, !tbaa !17
  %23 = icmp eq i8 %22, 0
  %24 = select i1 %23, ptr @.str.1, ptr %21
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %20, ptr noundef nonnull @.str, ptr noundef nonnull %24, ptr noundef nonnull %24) #7
  %.pre = load i8, ptr %4, align 8, !tbaa !13
  br label %26

26:                                               ; preds = %18, %14
  %27 = phi i8 [ %.pre, %18 ], [ %5, %14 ]
  %.not49 = icmp eq i8 %27, 0
  br i1 %.not49, 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
  br label %30

30:                                               ; preds = %.lr.ph, %97
  %.04651 = phi i8 [ 1, %.lr.ph ], [ %98, %97 ]
  %.04750 = phi ptr [ %3, %.lr.ph ], [ %35, %97 ]
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = zext i8 %.04651 to i64
  %33 = getelementptr %struct.FIELD_RECORD, ptr %31, i64 %32
  %34 = getelementptr i8, ptr %33, i64 -32
  %35 = getelementptr inbounds i8, ptr %.04750, i64 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %34, ptr noundef nonnull align 4 dereferenceable(32) %.04750, i64 32, i1 false), !tbaa.struct !18
  %36 = load i32, ptr %28, align 4, !tbaa !20
  switch i32 %36, label %51 [
    i32 1, label %37
    i32 2, label %39
    i32 3, label %41
  ]

37:                                               ; preds = %30
  %38 = tail call ptr @str_upr(ptr noundef %34) #7
  br label %51

39:                                               ; preds = %30
  %40 = tail call ptr @str_low(ptr noundef %34) #7
  br label %51

41:                                               ; preds = %30
  %42 = tail call ptr @__ctype_toupper_loc() #8
  %43 = load ptr, ptr %42, align 8, !tbaa !21
  %44 = load i8, ptr %34, align 1, !tbaa !17
  %45 = sext i8 %44 to i64
  %46 = getelementptr inbounds i32, ptr %43, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !19
  %48 = trunc i32 %47 to i8
  store i8 %48, ptr %34, align 1, !tbaa !17
  %49 = getelementptr i8, ptr %33, i64 -31
  %50 = tail call ptr @str_low(ptr noundef %49) #7
  br label %51

51:                                               ; preds = %41, %39, %37, %30
  %52 = load i32, ptr %15, align 8, !tbaa !15
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %54, label %97

54:                                               ; preds = %51
  %55 = load ptr, ptr %29, align 8, !tbaa !16
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.2, i32 noundef 11, ptr noundef %34) #7
  %57 = getelementptr i8, ptr %33, i64 -21
  %58 = load i8, ptr %57, align 1, !tbaa !22
  switch i8 %58, label %90 [
    i8 68, label %59
    i8 78, label %62
    i8 70, label %71
    i8 76, label %80
    i8 67, label %83
    i8 77, label %89
  ]

59:                                               ; preds = %54
  %60 = load ptr, ptr %29, align 8, !tbaa !16
  %61 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.3) #7
  br label %91

62:                                               ; preds = %54
  %63 = load ptr, ptr %29, align 8, !tbaa !16
  %64 = getelementptr i8, ptr %33, i64 -16
  %65 = load i8, ptr %64, align 4, !tbaa !24
  %66 = zext i8 %65 to i32
  %67 = getelementptr i8, ptr %33, i64 -15
  %68 = load i8, ptr %67, align 1, !tbaa !25
  %69 = zext i8 %68 to i32
  %70 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef nonnull @.str.4, i32 noundef %66, i32 noundef %69) #7
  br label %91

71:                                               ; preds = %54
  %72 = load ptr, ptr %29, align 8, !tbaa !16
  %73 = getelementptr i8, ptr %33, i64 -16
  %74 = load i8, ptr %73, align 4, !tbaa !24
  %75 = zext i8 %74 to i32
  %76 = getelementptr i8, ptr %33, i64 -15
  %77 = load i8, ptr %76, align 1, !tbaa !25
  %78 = zext i8 %77 to i32
  %79 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.4, i32 noundef %75, i32 noundef %78) #7
  br label %91

80:                                               ; preds = %54
  %81 = load ptr, ptr %29, align 8, !tbaa !16
  %82 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %81, ptr noundef nonnull @.str.5) #7
  br label %91

83:                                               ; preds = %54
  %84 = load ptr, ptr %29, align 8, !tbaa !16
  %85 = getelementptr i8, ptr %33, i64 -16
  %86 = load i8, ptr %85, align 4, !tbaa !24
  %87 = zext i8 %86 to i32
  %88 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.6, i32 noundef %87) #7
  br label %91

89:                                               ; preds = %54
  tail call void (ptr, ...) @lib_mesg(ptr noundef nonnull @.str.7, ptr noundef %34) #7
  br label %91

90:                                               ; preds = %54
  tail call void (i32, ptr, ...) @lib_fatl(i32 noundef 12, ptr noundef nonnull @.str.8) #7
  br label %91

91:                                               ; preds = %90, %89, %83, %80, %71, %62, %59
  %92 = load ptr, ptr %29, align 8, !tbaa !16
  %93 = load i8, ptr %4, align 8, !tbaa !13
  %94 = icmp eq i8 %.04651, %93
  %95 = select i1 %94, ptr @.str.10, ptr @.str.11
  %96 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef nonnull @.str.9, ptr noundef nonnull %95) #7
  br label %97

97:                                               ; preds = %51, %91
  %98 = add i8 %.04651, 1
  %99 = load i8, ptr %4, align 8, !tbaa !13
  %.not = icmp ugt i8 %98, %99
  br i1 %.not, label %._crit_edge, label %30, !llvm.loop !26

._crit_edge:                                      ; preds = %97, %26
  %100 = load i32, ptr %15, align 8, !tbaa !15
  %101 = icmp eq i32 %100, 0
  br i1 %101, label %102, label %106

102:                                              ; preds = %._crit_edge
  %103 = getelementptr inbounds i8, ptr %0, i64 2056
  %104 = load ptr, ptr %103, align 8, !tbaa !16
  %105 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef nonnull @.str.12) #7
  br label %106

106:                                              ; preds = %._crit_edge, %102, %10, %1
  %.0 = phi i32 [ 8, %1 ], [ 8, %10 ], [ 0, %102 ], [ 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: 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

declare ptr @str_upr(ptr noundef) local_unnamed_addr #4

declare ptr @str_low(ptr noundef) local_unnamed_addr #4

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

declare void @lib_mesg(ptr noundef, ...) local_unnamed_addr #4

declare void @lib_fatl(i32 noundef, ptr noundef, ...) local_unnamed_addr #4

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 = { "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 = { 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 #6 = { nounwind allocsize(0) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(none) }

!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, !10, i64 2080}
!16 = !{!6, !9, i64 2056}
!17 = !{!7, !7, i64 0}
!18 = !{i64 0, i64 11, !17, i64 11, i64 1, !17, i64 12, i64 4, !19, i64 16, i64 1, !17, i64 17, i64 1, !17, i64 18, i64 14, !17}
!19 = !{!10, !10, i64 0}
!20 = !{!6, !10, i64 2084}
!21 = !{!9, !9, i64 0}
!22 = !{!23, !7, i64 11}
!23 = !{!"FIELD_RECORD", !7, i64 0, !7, i64 11, !10, i64 12, !7, i64 16, !7, i64 17, !7, i64 18}
!24 = !{!23, !7, i64 16}
!25 = !{!23, !7, i64 17}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}


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