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

; 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 [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @sql_wrio(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i8, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.DBF, ptr %6, i32 0, i32 3
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.DBF, ptr %9, i32 0, i32 1
  %11 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 0
  %12 = load i8, ptr %11, align 8, !tbaa !14
  %13 = sext i8 %12 to i32
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %16

15:                                               ; preds = %1
  br label %20

16:                                               ; preds = %1
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.DBF, ptr %17, i32 0, i32 1
  %19 = getelementptr inbounds [1024 x i8], ptr %18, i64 0, i64 0
  br label %20

20:                                               ; preds = %16, %15
  %21 = phi ptr [ @.str.1, %15 ], [ %19, %16 ]
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef @.str, ptr noundef %21) #6
  store i8 0, ptr %3, align 1, !tbaa !14
  br label %23

23:                                               ; preds = %59, %20
  %24 = load i8, ptr %3, align 1, !tbaa !14
  %25 = zext i8 %24 to i32
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.DBF, ptr %26, i32 0, i32 15
  %28 = load i8, ptr %27, align 8, !tbaa !15
  %29 = zext i8 %28 to i32
  %30 = icmp slt i32 %25, %29
  br i1 %30, label %31, label %62

31:                                               ; preds = %23
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.DBF, ptr %32, i32 0, i32 16
  %34 = load ptr, ptr %33, align 8, !tbaa !16
  %35 = load i8, ptr %3, align 1, !tbaa !14
  %36 = zext i8 %35 to i64
  %37 = getelementptr inbounds %struct.FIELD_RECORD, ptr %34, i64 %36
  store ptr %37, ptr %4, align 8, !tbaa !5
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.DBF, ptr %38, i32 0, i32 3
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.FIELD_RECORD, ptr %41, i32 0, i32 0
  %43 = getelementptr inbounds [11 x i8], ptr %42, i64 0, i64 0
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.2, i32 noundef 11, ptr noundef %43) #6
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.DBF, ptr %45, i32 0, i32 3
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = load i8, ptr %3, align 1, !tbaa !14
  %49 = zext i8 %48 to i32
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.DBF, ptr %50, i32 0, i32 15
  %52 = load i8, ptr %51, align 8, !tbaa !15
  %53 = zext i8 %52 to i32
  %54 = sub nsw i32 %53, 1
  %55 = icmp eq i32 %49, %54
  %56 = zext i1 %55 to i64
  %57 = select i1 %55, ptr @.str.4, ptr @.str.5
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.3, ptr noundef %57) #6
  br label %59

59:                                               ; preds = %31
  %60 = load i8, ptr %3, align 1, !tbaa !14
  %61 = add i8 %60, 1
  store i8 %61, ptr %3, align 1, !tbaa !14
  br label %23, !llvm.loop !17

62:                                               ; preds = %23
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.DBF, ptr %63, i32 0, i32 3
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.6) #6
  store i8 0, ptr %3, align 1, !tbaa !14
  br label %67

67:                                               ; preds = %218, %62
  %68 = load i8, ptr %3, align 1, !tbaa !14
  %69 = zext i8 %68 to i32
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.DBF, ptr %70, i32 0, i32 15
  %72 = load i8, ptr %71, align 8, !tbaa !15
  %73 = zext i8 %72 to i32
  %74 = icmp slt i32 %69, %73
  br i1 %74, label %75, label %221

75:                                               ; preds = %67
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.DBF, ptr %76, i32 0, i32 16
  %78 = load ptr, ptr %77, align 8, !tbaa !16
  %79 = load i8, ptr %3, align 1, !tbaa !14
  %80 = zext i8 %79 to i64
  %81 = getelementptr inbounds %struct.FIELD_RECORD, ptr %78, i64 %80
  store ptr %81, ptr %4, align 8, !tbaa !5
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.DBF, ptr %82, i32 0, i32 17
  %84 = load ptr, ptr %83, align 8, !tbaa !19
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.FIELD_RECORD, ptr %85, i32 0, i32 2
  %87 = load i32, ptr %86, align 4, !tbaa !20
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %84, i64 %88
  store ptr %89, ptr %5, align 8, !tbaa !5
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.FIELD_RECORD, ptr %90, i32 0, i32 1
  %92 = load i8, ptr %91, align 1, !tbaa !22
  %93 = zext i8 %92 to i32
  switch i32 %93, label %203 [
    i32 68, label %94
    i32 78, label %122
    i32 70, label %122
    i32 76, label %136
    i32 67, label %155
  ]

94:                                               ; preds = %75
  %95 = call ptr @__ctype_b_loc() #7
  %96 = load ptr, ptr %95, align 8, !tbaa !5
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = load i8, ptr %97, align 1, !tbaa !14
  %99 = sext i8 %98 to i32
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i16, ptr %96, i64 %100
  %102 = load i16, ptr %101, align 2, !tbaa !23
  %103 = zext i16 %102 to i32
  %104 = and i32 %103, 2048
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %116

106:                                              ; preds = %94
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.DBF, ptr %107, i32 0, i32 3
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds i8, ptr %111, i64 4
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds i8, ptr %113, i64 6
  %115 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str.7, ptr noundef %110, ptr noundef %112, ptr noundef %114) #6
  br label %121

116:                                              ; preds = %94
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.DBF, ptr %117, i32 0, i32 3
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  %120 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %119, ptr noundef @.str.8) #6
  br label %121

121:                                              ; preds = %116, %106
  br label %203

122:                                              ; preds = %75, %75
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.DBF, ptr %123, i32 0, i32 3
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = load i8, ptr %126, align 1, !tbaa !14
  %128 = sext i8 %127 to i32
  %129 = icmp eq i32 %128, 0
  br i1 %129, label %130, label %131

130:                                              ; preds = %122
  br label %133

131:                                              ; preds = %122
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  br label %133

133:                                              ; preds = %131, %130
  %134 = phi ptr [ @.str.8, %130 ], [ %132, %131 ]
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.3, ptr noundef %134) #6
  br label %203

136:                                              ; preds = %75
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = load i8, ptr %137, align 1, !tbaa !14
  %139 = sext i8 %138 to i32
  %140 = icmp ne i32 %139, 0
  br i1 %140, label %141, label %147

141:                                              ; preds = %136
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = load i8, ptr %142, align 1, !tbaa !14
  %144 = sext i8 %143 to i32
  %145 = call ptr @strchr(ptr noundef @.str.9, i32 noundef %144) #8
  %146 = icmp ne ptr %145, null
  br label %147

147:                                              ; preds = %141, %136
  %148 = phi i1 [ false, %136 ], [ %146, %141 ]
  %149 = zext i1 %148 to i64
  %150 = select i1 %148, i32 49, i32 48
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.DBF, ptr %151, i32 0, i32 3
  %153 = load ptr, ptr %152, align 8, !tbaa !9
  %154 = call i32 @fputc(i32 noundef %150, ptr noundef %153)
  br label %203

155:                                              ; preds = %75
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.DBF, ptr %156, i32 0, i32 3
  %158 = load ptr, ptr %157, align 8, !tbaa !9
  %159 = call i32 @fputc(i32 noundef 39, ptr noundef %158)
  br label %160

160:                                              ; preds = %189, %155
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = load i8, ptr %161, align 1, !tbaa !14
  %163 = icmp ne i8 %162, 0
  br i1 %163, label %164, label %198

164:                                              ; preds = %160
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = load i8, ptr %165, align 1, !tbaa !14
  %167 = sext i8 %166 to i32
  %168 = icmp eq i32 %167, 39
  br i1 %168, label %184, label %169

169:                                              ; preds = %164
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = load i8, ptr %170, align 1, !tbaa !14
  %172 = sext i8 %171 to i32
  %173 = icmp eq i32 %172, 92
  br i1 %173, label %184, label %174

174:                                              ; preds = %169
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = load i8, ptr %175, align 1, !tbaa !14
  %177 = sext i8 %176 to i32
  %178 = icmp eq i32 %177, 37
  br i1 %178, label %184, label %179

179:                                              ; preds = %174
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = load i8, ptr %180, align 1, !tbaa !14
  %182 = sext i8 %181 to i32
  %183 = icmp eq i32 %182, 95
  br i1 %183, label %184, label %189

184:                                              ; preds = %179, %174, %169, %164
  %185 = load ptr, ptr %2, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.DBF, ptr %185, i32 0, i32 3
  %187 = load ptr, ptr %186, align 8, !tbaa !9
  %188 = call i32 @fputc(i32 noundef 92, ptr noundef %187)
  br label %189

189:                                              ; preds = %184, %179
  %190 = load ptr, ptr %5, align 8, !tbaa !5
  %191 = getelementptr inbounds i8, ptr %190, i32 1
  store ptr %191, ptr %5, align 8, !tbaa !5
  %192 = load i8, ptr %190, align 1, !tbaa !14
  %193 = sext i8 %192 to i32
  %194 = load ptr, ptr %2, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.DBF, ptr %194, i32 0, i32 3
  %196 = load ptr, ptr %195, align 8, !tbaa !9
  %197 = call i32 @fputc(i32 noundef %193, ptr noundef %196)
  br label %160, !llvm.loop !24

198:                                              ; preds = %160
  %199 = load ptr, ptr %2, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.DBF, ptr %199, i32 0, i32 3
  %201 = load ptr, ptr %200, align 8, !tbaa !9
  %202 = call i32 @fputc(i32 noundef 39, ptr noundef %201)
  br label %203

203:                                              ; preds = %198, %147, %133, %121, %75
  %204 = load ptr, ptr %2, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.DBF, ptr %204, i32 0, i32 3
  %206 = load ptr, ptr %205, align 8, !tbaa !9
  %207 = load i8, ptr %3, align 1, !tbaa !14
  %208 = zext i8 %207 to i32
  %209 = load ptr, ptr %2, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.DBF, ptr %209, i32 0, i32 15
  %211 = load i8, ptr %210, align 8, !tbaa !15
  %212 = zext i8 %211 to i32
  %213 = sub nsw i32 %212, 1
  %214 = icmp eq i32 %208, %213
  %215 = zext i1 %214 to i64
  %216 = select i1 %214, ptr @.str.4, ptr @.str.5
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef @.str.3, ptr noundef %216) #6
  br label %218

218:                                              ; preds = %203
  %219 = load i8, ptr %3, align 1, !tbaa !14
  %220 = add i8 %219, 1
  store i8 %220, ptr %3, align 1, !tbaa !14
  br label %67, !llvm.loop !25

221:                                              ; preds = %67
  %222 = load ptr, ptr %2, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.DBF, ptr %222, i32 0, i32 3
  %224 = load ptr, ptr %223, align 8, !tbaa !9
  %225 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %224, ptr noundef @.str.10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #6
  ret i32 0
}

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

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__ctype_b_loc() #3

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

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strchr(ptr noundef, i32 noundef) #5

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 2056}
!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 = !{!7, !7, i64 0}
!15 = !{!10, !7, i64 2088}
!16 = !{!10, !6, i64 2096}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!10, !6, i64 2104}
!20 = !{!21, !11, i64 12}
!21 = !{!"FIELD_RECORD", !7, i64 0, !7, i64 11, !11, i64 12, !7, i64 16, !7, i64 17, !7, i64 18}
!22 = !{!21, !7, i64 11}
!23 = !{!13, !13, i64 0}
!24 = distinct !{!24, !18}
!25 = distinct !{!25, !18}


; 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 [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nofree nounwind uwtable
define dso_local noundef i32 @sql_wrio(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 2056
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 1024
  %5 = load i8, ptr %4, align 8, !tbaa !13
  %6 = icmp eq i8 %5, 0
  %7 = select i1 %6, ptr @.str.1, ptr %4
  %8 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %3, ptr noundef nonnull @.str, ptr noundef nonnull %7) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 2088
  %10 = load i8, ptr %9, align 8, !tbaa !14
  %.not61 = icmp eq i8 %10, 0
  br i1 %.not61, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 2096
  br label %12

12:                                               ; preds = %.lr.ph, %12
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %12 ]
  %13 = trunc nuw i64 %indvars.iv to i32
  %14 = load ptr, ptr %11, align 8, !tbaa !15
  %15 = getelementptr inbounds %struct.FIELD_RECORD, ptr %14, i64 %indvars.iv
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.2, i32 noundef 11, ptr noundef %15) #4
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = load i8, ptr %9, align 8, !tbaa !14
  %20 = zext i8 %19 to i32
  %21 = add nsw i32 %20, -1
  %22 = icmp eq i32 %21, %13
  %23 = select i1 %22, ptr @.str.4, ptr @.str.5
  %24 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.3, ptr noundef nonnull %23) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %25 = load i8, ptr %9, align 8, !tbaa !14
  %26 = zext i8 %25 to i64
  %27 = icmp ult i64 %indvars.iv.next, %26
  br i1 %27, label %12, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %12, %1
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %28, ptr noundef nonnull @.str.6) #4
  %30 = load i8, ptr %9, align 8, !tbaa !14
  %.not62 = icmp eq i8 %30, 0
  br i1 %.not62, label %._crit_edge60, label %.lr.ph59

.lr.ph59:                                         ; preds = %._crit_edge
  %31 = getelementptr inbounds i8, ptr %0, i64 2096
  %32 = getelementptr inbounds i8, ptr %0, i64 2104
  br label %33

33:                                               ; preds = %.lr.ph59, %86
  %indvars.iv64 = phi i64 [ 0, %.lr.ph59 ], [ %indvars.iv.next65, %86 ]
  %34 = phi i32 [ 0, %.lr.ph59 ], [ %94, %86 ]
  %35 = load ptr, ptr %31, align 8, !tbaa !15
  %36 = getelementptr inbounds %struct.FIELD_RECORD, ptr %35, i64 %indvars.iv64
  %37 = load ptr, ptr %32, align 8, !tbaa !18
  %38 = getelementptr inbounds i8, ptr %36, i64 12
  %39 = load i32, ptr %38, align 4, !tbaa !19
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %37, i64 %40
  %42 = getelementptr inbounds i8, ptr %36, i64 11
  %43 = load i8, ptr %42, align 1, !tbaa !21
  switch i8 %43, label %86 [
    i8 68, label %44
    i8 78, label %59
    i8 70, label %59
    i8 76, label %65
    i8 67, label %.preheader
  ]

44:                                               ; preds = %33
  %45 = tail call ptr @__ctype_b_loc() #5
  %46 = load ptr, ptr %45, align 8, !tbaa !22
  %47 = load i8, ptr %41, align 1, !tbaa !13
  %48 = sext i8 %47 to i64
  %49 = getelementptr inbounds i16, ptr %46, i64 %48
  %50 = load i16, ptr %49, align 2, !tbaa !23
  %51 = and i16 %50, 2048
  %.not54 = icmp eq i16 %51, 0
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  br i1 %.not54, label %57, label %53

53:                                               ; preds = %44
  %54 = getelementptr inbounds i8, ptr %41, i64 4
  %55 = getelementptr inbounds i8, ptr %41, i64 6
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.7, ptr noundef nonnull %41, ptr noundef nonnull %54, ptr noundef nonnull %55) #4
  br label %86

57:                                               ; preds = %44
  %58 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef nonnull @.str.8) #4
  br label %86

59:                                               ; preds = %33, %33
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = load i8, ptr %41, align 1, !tbaa !13
  %62 = icmp eq i8 %61, 0
  %63 = select i1 %62, ptr @.str.8, ptr %41
  %64 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.3, ptr noundef nonnull %63) #4
  br label %86

65:                                               ; preds = %33
  %66 = load i8, ptr %41, align 1, !tbaa !13
  %.not53 = icmp eq i8 %66, 0
  br i1 %.not53, label %.thread, label %67

67:                                               ; preds = %65
  %68 = sext i8 %66 to i32
  %69 = tail call ptr @strchr(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %68) #6
  %.fr = freeze ptr %69
  %.not = icmp eq ptr %.fr, null
  %spec.select = select i1 %.not, i32 48, i32 49
  br label %.thread

.thread:                                          ; preds = %67, %65
  %70 = phi i32 [ 48, %65 ], [ %spec.select, %67 ]
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = tail call i32 @fputc(i32 noundef %70, ptr noundef %71)
  br label %86

.preheader:                                       ; preds = %33, %79
  %.sink = phi i32 [ %82, %79 ], [ 39, %33 ]
  %.0 = phi ptr [ %81, %79 ], [ %41, %33 ]
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = tail call i32 @fputc(i32 noundef %.sink, ptr noundef %73)
  %75 = load i8, ptr %.0, align 1, !tbaa !13
  switch i8 %75, label %79 [
    i8 0, label %83
    i8 39, label %76
    i8 92, label %76
    i8 37, label %76
    i8 95, label %76
  ]

76:                                               ; preds = %.preheader, %.preheader, %.preheader, %.preheader
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = tail call i32 @fputc(i32 noundef 92, ptr noundef %77)
  %.pre = load i8, ptr %.0, align 1, !tbaa !13
  br label %79

79:                                               ; preds = %.preheader, %76
  %80 = phi i8 [ %75, %.preheader ], [ %.pre, %76 ]
  %81 = getelementptr inbounds i8, ptr %.0, i64 1
  %82 = sext i8 %80 to i32
  br label %.preheader, !llvm.loop !24

83:                                               ; preds = %.preheader
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = tail call i32 @fputc(i32 noundef 39, ptr noundef %84)
  br label %86

86:                                               ; preds = %53, %57, %83, %.thread, %59, %33
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = load i8, ptr %9, align 8, !tbaa !14
  %89 = zext i8 %88 to i32
  %90 = add nsw i32 %89, -1
  %91 = icmp eq i32 %90, %34
  %92 = select i1 %91, ptr @.str.4, ptr @.str.5
  %93 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef nonnull @.str.3, ptr noundef nonnull %92) #4
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %94 = trunc nuw i64 %indvars.iv.next65 to i32
  %95 = load i8, ptr %9, align 8, !tbaa !14
  %96 = zext i8 %95 to i64
  %97 = icmp ult i64 %indvars.iv.next65, %96
  br i1 %97, label %33, label %._crit_edge60, !llvm.loop !25

._crit_edge60:                                    ; preds = %86, %._crit_edge
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.10) #4
  ret i32 0
}

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strchr(ptr noundef, i32 noundef) local_unnamed_addr #3

attributes #0 = { nofree 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 = { 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 #2 = { 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(none) }
attributes #6 = { 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 2056}
!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 = !{!7, !7, i64 0}
!14 = !{!6, !7, i64 2088}
!15 = !{!6, !9, i64 2096}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!6, !9, i64 2104}
!19 = !{!20, !10, i64 12}
!20 = !{!"FIELD_RECORD", !7, i64 0, !7, i64 11, !10, i64 12, !7, i64 16, !7, i64 17, !7, i64 18}
!21 = !{!20, !7, i64 11}
!22 = !{!9, !9, i64 0}
!23 = !{!12, !12, i64 0}
!24 = distinct !{!24, !17}
!25 = distinct !{!25, !17}


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