; LLVM IR from freakout42/macrocalc :: mc/src (wksfio)

; 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.CELLADR = type { i32, i32 }
%struct.Lotrec = type { i16, i16, %union.anon.0 }
%union.anon.0 = type <{ %struct.anon.5, [2039 x i8] }>
%struct.anon.5 = type { [16 x i8], %struct.CELLADR123, %struct.CELLADR123 }
%struct.CELLADR123 = type { i16, i16 }
%union.anon.11 = type { double }
%struct.anon = type { i16 }
%struct.anon.1 = type { i8 }
%struct.anon.2 = type { i8 }
%struct.anon.3 = type <{ i16, i16, i8, i8, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i8, i16 }>
%struct.anon.4 = type <{ i16, i8 }>
%struct.Range = type { ptr, [2 x %struct.CELLADR], ptr }
%struct.CELLREC = type { %struct.CELLADR, ptr, i8, i8, i8, ptr, %struct.CELLVALUE, %struct.CELLSTRING }
%struct.CELLVALUE = type { double, double, ptr }
%struct.CELLSTRING = type { i16, ptr }
%struct.anon.9 = type <{ i8, %struct.CELLADR123, %struct.mydouble, i16, [2048 x i8] }>
%struct.mydouble = type { [8 x i8] }
%struct.anon.8 = type <{ i8, %struct.CELLADR123, [240 x i8] }>
%struct.anon.7 = type <{ i8, %struct.CELLADR123, %struct.mydouble }>

@curcol = external global i32, align 4
@currow = external global i32, align 4
@leftcol = external global i32, align 4
@windowrow = external global i32, align 4
@borderline = external global i32, align 4
@windowline = external global i32, align 4
@toprow = external global i32, align 4
@colwidth = external global [702 x i8], align 16
@lastcol = external global i32, align 4
@lastrow = external global i32, align 4
@defaultformat = external global i8, align 1
@defaultwidth = external global i8, align 1
@rightcol = external global i32, align 4
@screenlin = external global i32, align 4
@cellcont = external global i8, align 1
@menudisp = external global i8, align 1
@rnames = external global ptr, align 8
@origcol = external global i32, align 4
@origrow = external global i32, align 4
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1

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

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

declare void @convertlabel(ptr noundef) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @towks(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.CELLADR, align 4
  %6 = alloca i32, align 4
  %7 = alloca [32768 x i8], align 16
  %8 = alloca ptr, align 8
  %9 = alloca %struct.Lotrec, align 2
  %10 = alloca ptr, align 8
  %11 = alloca %union.anon.11, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 32768, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 2068, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %12 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 0, ptr %12, align 2, !tbaa !9
  %13 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 2, ptr %13, align 2, !tbaa !12
  %14 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %15 = getelementptr inbounds %struct.anon, ptr %14, i32 0, i32 0
  store i16 1028, ptr %15, align 2, !tbaa !13
  %16 = call i32 @putwksrecord(ptr noundef %9)
  %17 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 4, ptr %17, align 2, !tbaa !9
  %18 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 1, ptr %18, align 2, !tbaa !12
  %19 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %20 = getelementptr inbounds %struct.anon.1, ptr %19, i32 0, i32 0
  store i8 0, ptr %20, align 2, !tbaa !13
  %21 = call i32 @putwksrecord(ptr noundef %9)
  %22 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 5, ptr %22, align 2, !tbaa !9
  %23 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 1, ptr %23, align 2, !tbaa !12
  %24 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %25 = getelementptr inbounds %struct.anon.2, ptr %24, i32 0, i32 0
  store i8 0, ptr %25, align 2, !tbaa !13
  %26 = call i32 @putwksrecord(ptr noundef %9)
  %27 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 7, ptr %27, align 2, !tbaa !9
  %28 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 31, ptr %28, align 2, !tbaa !12
  %29 = load i32, ptr @curcol, align 4, !tbaa !14
  %30 = trunc i32 %29 to i16
  %31 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %32 = getelementptr inbounds %struct.anon.3, ptr %31, i32 0, i32 0
  store i16 %30, ptr %32, align 2, !tbaa !13
  %33 = load i32, ptr @currow, align 4, !tbaa !14
  %34 = trunc i32 %33 to i16
  %35 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %36 = getelementptr inbounds %struct.anon.3, ptr %35, i32 0, i32 1
  store i16 %34, ptr %36, align 2, !tbaa !13
  %37 = load i8, ptr @defaultformat, align 1, !tbaa !13
  %38 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %39 = getelementptr inbounds %struct.anon.3, ptr %38, i32 0, i32 2
  store i8 %37, ptr %39, align 2, !tbaa !13
  %40 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %41 = getelementptr inbounds %struct.anon.3, ptr %40, i32 0, i32 3
  store i8 0, ptr %41, align 1, !tbaa !13
  %42 = load i8, ptr @defaultwidth, align 1, !tbaa !13
  %43 = zext i8 %42 to i16
  %44 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %45 = getelementptr inbounds %struct.anon.3, ptr %44, i32 0, i32 4
  store i16 %43, ptr %45, align 2, !tbaa !13
  %46 = load i32, ptr @rightcol, align 4, !tbaa !14
  %47 = load i32, ptr @leftcol, align 4, !tbaa !14
  %48 = sub nsw i32 %46, %47
  %49 = add nsw i32 %48, 1
  %50 = trunc i32 %49 to i16
  %51 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %52 = getelementptr inbounds %struct.anon.3, ptr %51, i32 0, i32 5
  store i16 %50, ptr %52, align 2, !tbaa !13
  %53 = load i32, ptr @screenlin, align 4, !tbaa !14
  %54 = load i8, ptr @cellcont, align 1, !tbaa !13
  %55 = zext i8 %54 to i32
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %61

57:                                               ; preds = %1
  %58 = load i8, ptr @menudisp, align 1, !tbaa !13
  %59 = zext i8 %58 to i32
  %60 = icmp ne i32 %59, 0
  br label %61

61:                                               ; preds = %57, %1
  %62 = phi i1 [ false, %1 ], [ %60, %57 ]
  %63 = zext i1 %62 to i64
  %64 = select i1 %62, i32 4, i32 3
  %65 = sub nsw i32 %53, %64
  %66 = trunc i32 %65 to i16
  %67 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %68 = getelementptr inbounds %struct.anon.3, ptr %67, i32 0, i32 6
  store i16 %66, ptr %68, align 2, !tbaa !13
  %69 = load i32, ptr @leftcol, align 4, !tbaa !14
  %70 = trunc i32 %69 to i16
  %71 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %72 = getelementptr inbounds %struct.anon.3, ptr %71, i32 0, i32 7
  store i16 %70, ptr %72, align 2, !tbaa !13
  %73 = load i32, ptr @windowrow, align 4, !tbaa !14
  %74 = trunc i32 %73 to i16
  %75 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %76 = getelementptr inbounds %struct.anon.3, ptr %75, i32 0, i32 8
  store i16 %74, ptr %76, align 2, !tbaa !13
  %77 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %78 = getelementptr inbounds %struct.anon.3, ptr %77, i32 0, i32 9
  store i16 0, ptr %78, align 2, !tbaa !13
  %79 = load i32, ptr @windowline, align 4, !tbaa !14
  %80 = load i32, ptr @borderline, align 4, !tbaa !14
  %81 = sub nsw i32 %79, %80
  %82 = sub nsw i32 %81, 1
  %83 = trunc i32 %82 to i16
  %84 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %85 = getelementptr inbounds %struct.anon.3, ptr %84, i32 0, i32 10
  store i16 %83, ptr %85, align 2, !tbaa !13
  %86 = load i32, ptr @leftcol, align 4, !tbaa !14
  %87 = trunc i32 %86 to i16
  %88 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %89 = getelementptr inbounds %struct.anon.3, ptr %88, i32 0, i32 11
  store i16 %87, ptr %89, align 2, !tbaa !13
  %90 = load i32, ptr @toprow, align 4, !tbaa !14
  %91 = trunc i32 %90 to i16
  %92 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %93 = getelementptr inbounds %struct.anon.3, ptr %92, i32 0, i32 12
  store i16 %91, ptr %93, align 2, !tbaa !13
  %94 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %95 = getelementptr inbounds %struct.anon.3, ptr %94, i32 0, i32 13
  store i16 4, ptr %95, align 2, !tbaa !13
  %96 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %97 = getelementptr inbounds %struct.anon.3, ptr %96, i32 0, i32 14
  store i16 4, ptr %97, align 2, !tbaa !13
  %98 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %99 = getelementptr inbounds %struct.anon.3, ptr %98, i32 0, i32 16
  store i16 72, ptr %99, align 1, !tbaa !13
  %100 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %101 = getelementptr inbounds %struct.anon.3, ptr %100, i32 0, i32 15
  store i8 0, ptr %101, align 2, !tbaa !13
  %102 = call i32 @putwksrecord(ptr noundef %9)
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %103

103:                                              ; preds = %129, %61
  %104 = load i32, ptr %3, align 4, !tbaa !14
  %105 = load i32, ptr @lastcol, align 4, !tbaa !14
  %106 = icmp sle i32 %104, %105
  br i1 %106, label %107, label %132

107:                                              ; preds = %103
  %108 = load i32, ptr %3, align 4, !tbaa !14
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [702 x i8], ptr @colwidth, i64 0, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !13
  %112 = zext i8 %111 to i32
  %113 = icmp ne i32 %112, 9
  br i1 %113, label %114, label %128

114:                                              ; preds = %107
  %115 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 8, ptr %115, align 2, !tbaa !9
  %116 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 3, ptr %116, align 2, !tbaa !12
  %117 = load i32, ptr %3, align 4, !tbaa !14
  %118 = trunc i32 %117 to i16
  %119 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %120 = getelementptr inbounds %struct.anon.4, ptr %119, i32 0, i32 0
  store i16 %118, ptr %120, align 2, !tbaa !13
  %121 = load i32, ptr %3, align 4, !tbaa !14
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [702 x i8], ptr @colwidth, i64 0, i64 %122
  %124 = load i8, ptr %123, align 1, !tbaa !13
  %125 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %126 = getelementptr inbounds %struct.anon.4, ptr %125, i32 0, i32 1
  store i8 %124, ptr %126, align 2, !tbaa !13
  %127 = call i32 @putwksrecord(ptr noundef %9)
  br label %128

128:                                              ; preds = %114, %107
  br label %129

129:                                              ; preds = %128
  %130 = load i32, ptr %3, align 4, !tbaa !14
  %131 = add nsw i32 %130, 1
  store i32 %131, ptr %3, align 4, !tbaa !14
  br label %103, !llvm.loop !16

132:                                              ; preds = %103
  %133 = load ptr, ptr @rnames, align 8, !tbaa !5
  store ptr %133, ptr %10, align 8, !tbaa !5
  br label %134

134:                                              ; preds = %188, %132
  %135 = load ptr, ptr %10, align 8, !tbaa !5
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %192

137:                                              ; preds = %134
  %138 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 11, ptr %138, align 2, !tbaa !9
  %139 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 24, ptr %139, align 2, !tbaa !12
  %140 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %141 = getelementptr inbounds %struct.anon.5, ptr %140, i32 0, i32 0
  %142 = getelementptr inbounds [16 x i8], ptr %141, i64 0, i64 0
  %143 = load ptr, ptr %10, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.Range, ptr %143, i32 0, i32 2
  %145 = load ptr, ptr %144, align 8, !tbaa !18
  %146 = call ptr @strncpy(ptr noundef %142, ptr noundef %145, i64 noundef 16) #6
  %147 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %148 = getelementptr inbounds %struct.anon.5, ptr %147, i32 0, i32 0
  %149 = getelementptr inbounds [16 x i8], ptr %148, i64 0, i64 0
  %150 = call ptr @str_upr(ptr noundef %149)
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.Range, ptr %151, i32 0, i32 1
  %153 = getelementptr inbounds [2 x %struct.CELLADR], ptr %152, i64 0, i64 0
  %154 = getelementptr inbounds %struct.CELLADR, ptr %153, i32 0, i32 0
  %155 = load i32, ptr %154, align 8, !tbaa !20
  %156 = trunc i32 %155 to i16
  %157 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %158 = getelementptr inbounds %struct.anon.5, ptr %157, i32 0, i32 1
  %159 = getelementptr inbounds %struct.CELLADR123, ptr %158, i32 0, i32 0
  store i16 %156, ptr %159, align 2, !tbaa !13
  %160 = load ptr, ptr %10, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.Range, ptr %160, i32 0, i32 1
  %162 = getelementptr inbounds [2 x %struct.CELLADR], ptr %161, i64 0, i64 0
  %163 = getelementptr inbounds %struct.CELLADR, ptr %162, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !22
  %165 = trunc i32 %164 to i16
  %166 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %167 = getelementptr inbounds %struct.anon.5, ptr %166, i32 0, i32 1
  %168 = getelementptr inbounds %struct.CELLADR123, ptr %167, i32 0, i32 1
  store i16 %165, ptr %168, align 2, !tbaa !13
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.Range, ptr %169, i32 0, i32 1
  %171 = getelementptr inbounds [2 x %struct.CELLADR], ptr %170, i64 0, i64 1
  %172 = getelementptr inbounds %struct.CELLADR, ptr %171, i32 0, i32 0
  %173 = load i32, ptr %172, align 8, !tbaa !20
  %174 = trunc i32 %173 to i16
  %175 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %176 = getelementptr inbounds %struct.anon.5, ptr %175, i32 0, i32 2
  %177 = getelementptr inbounds %struct.CELLADR123, ptr %176, i32 0, i32 0
  store i16 %174, ptr %177, align 2, !tbaa !13
  %178 = load ptr, ptr %10, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.Range, ptr %178, i32 0, i32 1
  %180 = getelementptr inbounds [2 x %struct.CELLADR], ptr %179, i64 0, i64 1
  %181 = getelementptr inbounds %struct.CELLADR, ptr %180, i32 0, i32 1
  %182 = load i32, ptr %181, align 4, !tbaa !22
  %183 = trunc i32 %182 to i16
  %184 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %185 = getelementptr inbounds %struct.anon.5, ptr %184, i32 0, i32 2
  %186 = getelementptr inbounds %struct.CELLADR123, ptr %185, i32 0, i32 1
  store i16 %183, ptr %186, align 2, !tbaa !13
  %187 = call i32 @putwksrecord(ptr noundef %9)
  br label %188

188:                                              ; preds = %137
  %189 = load ptr, ptr %10, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.Range, ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !23
  store ptr %191, ptr %10, align 8, !tbaa !5
  br label %134, !llvm.loop !24

192:                                              ; preds = %134
  store i32 0, ptr %4, align 4, !tbaa !14
  br label %193

193:                                              ; preds = %322, %192
  %194 = load i32, ptr %4, align 4, !tbaa !14
  %195 = load i32, ptr @lastrow, align 4, !tbaa !14
  %196 = icmp sle i32 %194, %195
  br i1 %196, label %197, label %325

197:                                              ; preds = %193
  %198 = load i32, ptr @lastcol, align 4, !tbaa !14
  store i32 %198, ptr %3, align 4, !tbaa !14
  br label %199

199:                                              ; preds = %318, %197
  %200 = load i32, ptr %3, align 4, !tbaa !14
  %201 = icmp sge i32 %200, 0
  br i1 %201, label %202, label %321

202:                                              ; preds = %199
  %203 = load i32, ptr %3, align 4, !tbaa !14
  %204 = load i32, ptr %4, align 4, !tbaa !14
  %205 = call ptr @cell(i32 noundef %203, i32 noundef %204)
  store ptr %205, ptr %8, align 8, !tbaa !5
  %206 = load ptr, ptr %8, align 8, !tbaa !5
  %207 = icmp ne ptr %206, null
  br i1 %207, label %208, label %317

208:                                              ; preds = %202
  %209 = load ptr, ptr %8, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.CELLREC, ptr %209, i32 0, i32 2
  %211 = load i8, ptr %210, align 8, !tbaa !25
  %212 = zext i8 %211 to i32
  store i32 %212, ptr %6, align 4, !tbaa !14
  %213 = load ptr, ptr %8, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.CELLREC, ptr %213, i32 0, i32 3
  %215 = load i8, ptr %214, align 1, !tbaa !30
  %216 = zext i8 %215 to i32
  %217 = and i32 %216, 32
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %221, label %219

219:                                              ; preds = %208
  %220 = getelementptr inbounds [32768 x i8], ptr %7, i64 0, i64 0
  store i8 0, ptr %220, align 16, !tbaa !13
  br label %221

221:                                              ; preds = %219, %208
  %222 = load i32, ptr %3, align 4, !tbaa !14
  store i32 %222, ptr @origcol, align 4, !tbaa !14
  %223 = load i32, ptr %4, align 4, !tbaa !14
  store i32 %223, ptr @origrow, align 4, !tbaa !14
  %224 = load i32, ptr %6, align 4, !tbaa !14
  switch i32 %224, label %312 [
    i32 11, label %225
    i32 3, label %225
    i32 4, label %256
    i32 1, label %264
    i32 6, label %264
    i32 7, label %264
    i32 8, label %264
    i32 2, label %289
    i32 9, label %289
    i32 10, label %316
  ]

225:                                              ; preds = %221, %221
  %226 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 16, ptr %226, align 2, !tbaa !9
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.CELLREC, ptr %227, i32 0, i32 6
  %229 = getelementptr inbounds %struct.CELLVALUE, ptr %228, i32 0, i32 0
  %230 = load double, ptr %229, align 8, !tbaa !31
  store double %230, ptr %11, align 8, !tbaa !13
  %231 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %232 = getelementptr inbounds %struct.anon.9, ptr %231, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %232, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !32
  %233 = load ptr, ptr %8, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %235 = getelementptr inbounds %struct.anon.9, ptr %234, i32 0, i32 3
  %236 = call i32 @parse2(ptr noundef %233, ptr noundef %235)
  store i32 %236, ptr %6, align 4, !tbaa !14
  %237 = load i32, ptr %6, align 4, !tbaa !14
  %238 = icmp ne i32 %237, 3
  br i1 %238, label %239, label %246

239:                                              ; preds = %225
  %240 = load i32, ptr %6, align 4, !tbaa !14
  %241 = icmp ne i32 %240, 11
  br i1 %241, label %242, label %246

242:                                              ; preds = %239
  %243 = load i32, ptr %6, align 4, !tbaa !14
  %244 = icmp ne i32 %243, 2
  br i1 %244, label %245, label %246

245:                                              ; preds = %242
  br label %265

246:                                              ; preds = %242, %239, %225
  %247 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %248 = getelementptr inbounds %struct.anon.9, ptr %247, i32 0, i32 3
  %249 = load i16, ptr %248, align 1, !tbaa !13
  %250 = sext i16 %249 to i32
  %251 = add nsw i32 %250, 2063
  %252 = sext i32 %251 to i64
  %253 = sub i64 %252, 2048
  %254 = trunc i64 %253 to i16
  %255 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 %254, ptr %255, align 2, !tbaa !12
  br label %298

256:                                              ; preds = %221
  %257 = getelementptr inbounds [32768 x i8], ptr %7, i64 0, i64 0
  store i8 32, ptr %257, align 16, !tbaa !13
  %258 = getelementptr inbounds [32768 x i8], ptr %7, i64 0, i64 0
  %259 = getelementptr inbounds i8, ptr %258, i64 1
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.CELLREC, ptr %260, i32 0, i32 5
  %262 = load ptr, ptr %261, align 8, !tbaa !33
  %263 = call ptr @strcpy(ptr noundef %259, ptr noundef %262) #6
  br label %264

264:                                              ; preds = %256, %221, %221, %221, %221
  br label %265

265:                                              ; preds = %264, %245
  %266 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 15, ptr %266, align 2, !tbaa !9
  %267 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %268 = getelementptr inbounds %struct.anon.8, ptr %267, i32 0, i32 2
  %269 = getelementptr inbounds [240 x i8], ptr %268, i64 0, i64 0
  %270 = load ptr, ptr %8, align 8, !tbaa !5
  %271 = getelementptr inbounds %struct.CELLREC, ptr %270, i32 0, i32 5
  %272 = load ptr, ptr %271, align 8, !tbaa !33
  %273 = call ptr @strcpy(ptr noundef %269, ptr noundef %272) #6
  %274 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %275 = getelementptr inbounds %struct.anon.8, ptr %274, i32 0, i32 2
  %276 = getelementptr inbounds [240 x i8], ptr %275, i64 0, i64 0
  %277 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %278 = ptrtoint ptr %276 to i64
  %279 = ptrtoint ptr %277 to i64
  %280 = sub i64 %278, %279
  %281 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %282 = getelementptr inbounds %struct.anon.8, ptr %281, i32 0, i32 2
  %283 = getelementptr inbounds [240 x i8], ptr %282, i64 0, i64 0
  %284 = call i64 @strlen(ptr noundef %283) #7
  %285 = add i64 %280, %284
  %286 = add i64 %285, 1
  %287 = trunc i64 %286 to i16
  %288 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 %287, ptr %288, align 2, !tbaa !12
  call void @convertlabel(ptr noundef %9)
  br label %298

289:                                              ; preds = %221, %221
  %290 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 14, ptr %290, align 2, !tbaa !9
  %291 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 13, ptr %291, align 2, !tbaa !12
  %292 = load ptr, ptr %8, align 8, !tbaa !5
  %293 = getelementptr inbounds %struct.CELLREC, ptr %292, i32 0, i32 6
  %294 = getelementptr inbounds %struct.CELLVALUE, ptr %293, i32 0, i32 0
  %295 = load double, ptr %294, align 8, !tbaa !31
  store double %295, ptr %11, align 8, !tbaa !13
  %296 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %297 = getelementptr inbounds %struct.anon.7, ptr %296, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %297, ptr align 8 %11, i64 8, i1 false), !tbaa.struct !32
  br label %298

298:                                              ; preds = %289, %265, %246
  %299 = load ptr, ptr %8, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.CELLREC, ptr %299, i32 0, i32 4
  %301 = load i8, ptr %300, align 2, !tbaa !34
  %302 = call zeroext i8 @convertlformat(i8 noundef zeroext %301)
  %303 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %304 = getelementptr inbounds %struct.anon.8, ptr %303, i32 0, i32 0
  store i8 %302, ptr %304, align 2, !tbaa !13
  %305 = load i32, ptr %3, align 4, !tbaa !14
  %306 = getelementptr inbounds %struct.CELLADR, ptr %5, i32 0, i32 0
  store i32 %305, ptr %306, align 4, !tbaa !20
  %307 = load i32, ptr %4, align 4, !tbaa !14
  %308 = getelementptr inbounds %struct.CELLADR, ptr %5, i32 0, i32 1
  store i32 %307, ptr %308, align 4, !tbaa !22
  %309 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 2
  %310 = getelementptr inbounds %struct.anon.8, ptr %309, i32 0, i32 1
  call void @convertcelladr(ptr noundef %310, ptr noundef %5)
  %311 = call i32 @putwksrecord(ptr noundef %9)
  br label %316

312:                                              ; preds = %221
  %313 = load ptr, ptr @stderr, align 8, !tbaa !5
  %314 = load i32, ptr %6, align 4, !tbaa !14
  %315 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %313, ptr noundef @.str.3, i32 noundef %314) #6
  br label %316

316:                                              ; preds = %312, %298, %221
  br label %317

317:                                              ; preds = %316, %202
  br label %318

318:                                              ; preds = %317
  %319 = load i32, ptr %3, align 4, !tbaa !14
  %320 = add nsw i32 %319, -1
  store i32 %320, ptr %3, align 4, !tbaa !14
  br label %199, !llvm.loop !35

321:                                              ; preds = %199
  br label %322

322:                                              ; preds = %321
  %323 = load i32, ptr %4, align 4, !tbaa !14
  %324 = add nsw i32 %323, 1
  store i32 %324, ptr %4, align 4, !tbaa !14
  br label %193, !llvm.loop !36

325:                                              ; preds = %193
  %326 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 0
  store i16 1, ptr %326, align 2, !tbaa !9
  %327 = getelementptr inbounds %struct.Lotrec, ptr %9, i32 0, i32 1
  store i16 0, ptr %327, align 2, !tbaa !12
  %328 = call i32 @putwksrecord(ptr noundef %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 2068, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 32768, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  ret i32 0
}

declare i32 @putwksrecord(ptr noundef) #2

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

declare ptr @str_upr(ptr noundef) #2

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

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

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

declare zeroext i8 @convertlformat(i8 noundef zeroext) #2

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 #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(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, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 2, !7, i64 4}
!11 = !{!"short", !7, i64 0}
!12 = !{!10, !11, i64 2}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !6, i64 24}
!19 = !{!"Range", !6, i64 0, !7, i64 8, !6, i64 24}
!20 = !{!21, !15, i64 0}
!21 = !{!"CELLADR", !15, i64 0, !15, i64 4}
!22 = !{!21, !15, i64 4}
!23 = !{!19, !6, i64 0}
!24 = distinct !{!24, !17}
!25 = !{!26, !7, i64 16}
!26 = !{!"CELLREC", !21, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !6, i64 24, !27, i64 32, !29, i64 56}
!27 = !{!"CELLVALUE", !28, i64 0, !28, i64 8, !6, i64 16}
!28 = !{!"double", !7, i64 0}
!29 = !{!"CELLSTRING", !11, i64 0, !6, i64 8}
!30 = !{!26, !7, i64 17}
!31 = !{!26, !28, i64 32}
!32 = !{i64 0, i64 8, !13}
!33 = !{!26, !6, i64 24}
!34 = !{!26, !7, i64 18}
!35 = distinct !{!35, !17}
!36 = distinct !{!36, !17}


; 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.CELLADR = type { i32, i32 }
%struct.Lotrec = type { i16, i16, %union.anon.0 }
%union.anon.0 = type <{ %struct.anon.5, [2039 x i8] }>
%struct.anon.5 = type { [16 x i8], %struct.CELLADR123, %struct.CELLADR123 }
%struct.CELLADR123 = type { i16, i16 }

@curcol = external local_unnamed_addr global i32, align 4
@currow = external local_unnamed_addr global i32, align 4
@leftcol = external local_unnamed_addr global i32, align 4
@windowrow = external local_unnamed_addr global i32, align 4
@borderline = external local_unnamed_addr global i32, align 4
@windowline = external local_unnamed_addr global i32, align 4
@toprow = external local_unnamed_addr global i32, align 4
@colwidth = external local_unnamed_addr global [702 x i8], align 16
@lastcol = external local_unnamed_addr global i32, align 4
@lastrow = external local_unnamed_addr global i32, align 4
@defaultformat = external local_unnamed_addr global i8, align 1
@defaultwidth = external local_unnamed_addr global i8, align 1
@rightcol = external local_unnamed_addr global i32, align 4
@screenlin = external local_unnamed_addr global i32, align 4
@cellcont = external local_unnamed_addr global i8, align 1
@menudisp = external local_unnamed_addr global i8, align 1
@rnames = external local_unnamed_addr global ptr, align 8
@origcol = external local_unnamed_addr global i32, align 4
@origrow = external local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [25 x i8], align 1

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

declare void @convertlabel(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @towks(ptr nocapture noundef readnone %0) local_unnamed_addr #3 {
  %2 = alloca %struct.CELLADR, align 4
  %3 = alloca %struct.Lotrec, align 2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 2068, ptr nonnull %3) #6
  store i16 0, ptr %3, align 2, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 2
  store i16 2, ptr %4, align 2, !tbaa !10
  %5 = getelementptr inbounds i8, ptr %3, i64 4
  store i16 1028, ptr %5, align 2, !tbaa !11
  %6 = call i32 @putwksrecord(ptr noundef nonnull %3) #6
  store i16 4, ptr %3, align 2, !tbaa !5
  store i16 1, ptr %4, align 2, !tbaa !10
  store i8 0, ptr %5, align 2, !tbaa !11
  %7 = call i32 @putwksrecord(ptr noundef nonnull %3) #6
  store i16 5, ptr %3, align 2, !tbaa !5
  store i16 1, ptr %4, align 2, !tbaa !10
  store i8 0, ptr %5, align 2, !tbaa !11
  %8 = call i32 @putwksrecord(ptr noundef nonnull %3) #6
  store i16 7, ptr %3, align 2, !tbaa !5
  store i16 31, ptr %4, align 2, !tbaa !10
  %9 = load i32, ptr @curcol, align 4, !tbaa !12
  %10 = trunc i32 %9 to i16
  store i16 %10, ptr %5, align 2, !tbaa !11
  %11 = load i32, ptr @currow, align 4, !tbaa !12
  %12 = trunc i32 %11 to i16
  %13 = getelementptr inbounds i8, ptr %3, i64 6
  store i16 %12, ptr %13, align 2, !tbaa !11
  %14 = load i8, ptr @defaultformat, align 1, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %3, i64 8
  store i8 %14, ptr %15, align 2, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %3, i64 9
  store i8 0, ptr %16, align 1, !tbaa !11
  %17 = load i8, ptr @defaultwidth, align 1, !tbaa !11
  %18 = zext i8 %17 to i16
  %19 = getelementptr inbounds i8, ptr %3, i64 10
  store i16 %18, ptr %19, align 2, !tbaa !11
  %20 = load i32, ptr @rightcol, align 4, !tbaa !12
  %21 = load i32, ptr @leftcol, align 4, !tbaa !12
  %22 = sub nsw i32 %20, %21
  %23 = trunc i32 %22 to i16
  %24 = add i16 %23, 1
  %25 = getelementptr inbounds i8, ptr %3, i64 12
  store i16 %24, ptr %25, align 2, !tbaa !11
  %26 = load i32, ptr @screenlin, align 4, !tbaa !12
  %27 = load i8, ptr @cellcont, align 1, !tbaa !11
  %28 = icmp ne i8 %27, 0
  %29 = load i8, ptr @menudisp, align 1
  %30 = icmp ne i8 %29, 0
  %31 = select i1 %28, i1 %30, i1 false
  %.neg = select i1 %31, i32 65532, i32 65533
  %32 = add i32 %.neg, %26
  %33 = trunc i32 %32 to i16
  %34 = getelementptr inbounds i8, ptr %3, i64 14
  store i16 %33, ptr %34, align 2, !tbaa !11
  %35 = trunc i32 %21 to i16
  %36 = getelementptr inbounds i8, ptr %3, i64 16
  store i16 %35, ptr %36, align 2, !tbaa !11
  %37 = load i32, ptr @windowrow, align 4, !tbaa !12
  %38 = trunc i32 %37 to i16
  %39 = getelementptr inbounds i8, ptr %3, i64 18
  store i16 %38, ptr %39, align 2, !tbaa !11
  %40 = getelementptr inbounds i8, ptr %3, i64 20
  store i16 0, ptr %40, align 2, !tbaa !11
  %41 = load i32, ptr @windowline, align 4, !tbaa !12
  %42 = load i32, ptr @borderline, align 4, !tbaa !12
  %43 = xor i32 %42, -1
  %44 = add i32 %41, %43
  %45 = trunc i32 %44 to i16
  %46 = getelementptr inbounds i8, ptr %3, i64 22
  store i16 %45, ptr %46, align 2, !tbaa !11
  %47 = getelementptr inbounds i8, ptr %3, i64 24
  store i16 %35, ptr %47, align 2, !tbaa !11
  %48 = load i32, ptr @toprow, align 4, !tbaa !12
  %49 = trunc i32 %48 to i16
  %50 = getelementptr inbounds i8, ptr %3, i64 26
  store i16 %49, ptr %50, align 2, !tbaa !11
  %51 = getelementptr inbounds i8, ptr %3, i64 28
  store i16 4, ptr %51, align 2, !tbaa !11
  %52 = getelementptr inbounds i8, ptr %3, i64 30
  store i16 4, ptr %52, align 2, !tbaa !11
  %53 = getelementptr inbounds i8, ptr %3, i64 33
  store i16 72, ptr %53, align 1, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %3, i64 32
  store i8 0, ptr %54, align 2, !tbaa !11
  %55 = call i32 @putwksrecord(ptr noundef nonnull %3) #6
  %56 = load i32, ptr @lastcol, align 4, !tbaa !12
  %.not48 = icmp slt i32 %56, 0
  br i1 %.not48, label %.preheader47, label %.lr.ph

.preheader47:                                     ; preds = %63, %1
  %.050 = load ptr, ptr @rnames, align 8, !tbaa !14
  %.not4251 = icmp eq ptr %.050, null
  br i1 %.not4251, label %.preheader, label %.lr.ph53

.lr.ph:                                           ; preds = %1, %63
  %57 = phi i32 [ %64, %63 ], [ %56, %1 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %63 ], [ 0, %1 ]
  %58 = getelementptr inbounds [702 x i8], ptr @colwidth, i64 0, i64 %indvars.iv
  %59 = load i8, ptr %58, align 1, !tbaa !11
  %.not46 = icmp eq i8 %59, 9
  br i1 %.not46, label %63, label %60

60:                                               ; preds = %.lr.ph
  store i16 8, ptr %3, align 2, !tbaa !5
  store i16 3, ptr %4, align 2, !tbaa !10
  %61 = trunc i64 %indvars.iv to i16
  store i16 %61, ptr %5, align 2, !tbaa !11
  store i8 %59, ptr %13, align 2, !tbaa !11
  %62 = call i32 @putwksrecord(ptr noundef nonnull %3) #6
  %.pre = load i32, ptr @lastcol, align 4, !tbaa !12
  br label %63

63:                                               ; preds = %.lr.ph, %60
  %64 = phi i32 [ %57, %.lr.ph ], [ %.pre, %60 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %65 = sext i32 %64 to i64
  %.not.not = icmp slt i64 %indvars.iv, %65
  br i1 %.not.not, label %.lr.ph, label %.preheader47, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph53, %.preheader47
  %66 = load i32, ptr @lastrow, align 4, !tbaa !12
  %.not4356 = icmp slt i32 %66, 0
  br i1 %.not4356, label %._crit_edge59, label %.lr.ph58

.lr.ph58:                                         ; preds = %.preheader
  %67 = getelementptr inbounds i8, ptr %3, i64 17
  %68 = getelementptr inbounds i8, ptr %2, i64 4
  %69 = getelementptr inbounds i8, ptr %3, i64 5
  %70 = load i32, ptr @lastcol, align 4, !tbaa !12
  %71 = icmp sgt i32 %70, -1
  br i1 %71, label %.lr.ph58.split, label %._crit_edge59

.lr.ph53:                                         ; preds = %.preheader47, %.lr.ph53
  %.052 = phi ptr [ %.0, %.lr.ph53 ], [ %.050, %.preheader47 ]
  store i16 11, ptr %3, align 2, !tbaa !5
  store i16 24, ptr %4, align 2, !tbaa !10
  %72 = getelementptr inbounds i8, ptr %.052, i64 24
  %73 = load ptr, ptr %72, align 8, !tbaa !18
  %74 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) %73, i64 noundef 16) #6
  %75 = call ptr @str_upr(ptr noundef nonnull %5) #6
  %76 = getelementptr inbounds i8, ptr %.052, i64 8
  %77 = load i32, ptr %76, align 8, !tbaa !20
  %78 = trunc i32 %77 to i16
  store i16 %78, ptr %40, align 2, !tbaa !11
  %79 = getelementptr inbounds i8, ptr %.052, i64 12
  %80 = load i32, ptr %79, align 4, !tbaa !22
  %81 = trunc i32 %80 to i16
  store i16 %81, ptr %46, align 2, !tbaa !11
  %82 = getelementptr inbounds i8, ptr %.052, i64 16
  %83 = load i32, ptr %82, align 8, !tbaa !20
  %84 = trunc i32 %83 to i16
  store i16 %84, ptr %47, align 2, !tbaa !11
  %85 = getelementptr inbounds i8, ptr %.052, i64 20
  %86 = load i32, ptr %85, align 4, !tbaa !22
  %87 = trunc i32 %86 to i16
  store i16 %87, ptr %50, align 2, !tbaa !11
  %88 = call i32 @putwksrecord(ptr noundef nonnull %3) #6
  %.0 = load ptr, ptr %.052, align 8, !tbaa !14
  %.not42 = icmp eq ptr %.0, null
  br i1 %.not42, label %.preheader, label %.lr.ph53, !llvm.loop !23

.lr.ph58.splitthread-pre-split:                   ; preds = %._crit_edge
  %89 = add nuw nsw i32 %.04057, 1
  %.pr = load i32, ptr @lastcol, align 4, !tbaa !12
  br label %.lr.ph58.split

.lr.ph58.split:                                   ; preds = %.lr.ph58, %.lr.ph58.splitthread-pre-split
  %90 = phi i32 [ %.pr, %.lr.ph58.splitthread-pre-split ], [ %70, %.lr.ph58 ]
  %91 = phi i32 [ %126, %.lr.ph58.splitthread-pre-split ], [ %66, %.lr.ph58 ]
  %.04057 = phi i32 [ %89, %.lr.ph58.splitthread-pre-split ], [ 0, %.lr.ph58 ]
  %92 = icmp sgt i32 %90, -1
  br i1 %92, label %.lr.ph55, label %._crit_edge

.lr.ph55:                                         ; preds = %.lr.ph58.split, %123
  %.154 = phi i32 [ %124, %123 ], [ %90, %.lr.ph58.split ]
  %93 = call ptr @cell(i32 noundef %.154, i32 noundef %.04057) #6
  %.not44 = icmp eq ptr %93, null
  br i1 %.not44, label %123, label %94

94:                                               ; preds = %.lr.ph55
  %95 = getelementptr inbounds i8, ptr %93, i64 16
  %96 = load i8, ptr %95, align 8, !tbaa !24
  store i32 %.154, ptr @origcol, align 4, !tbaa !12
  store i32 %.04057, ptr @origrow, align 4, !tbaa !12
  switch i8 %96, label %119 [
    i8 11, label %97
    i8 3, label %97
    i8 4, label %104
    i8 1, label %104
    i8 6, label %104
    i8 7, label %104
    i8 8, label %104
    i8 2, label %111
    i8 9, label %111
    i8 10, label %123
  ]

97:                                               ; preds = %94, %94
  store i16 16, ptr %3, align 2, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %93, i64 32
  %99 = load double, ptr %98, align 8, !tbaa !29
  store double %99, ptr %16, align 1, !tbaa !11
  %100 = call i32 @parse2(ptr noundef nonnull %93, ptr noundef nonnull %67) #6
  switch i32 %100, label %104 [
    i32 11, label %101
    i32 3, label %101
    i32 2, label %101
  ]

101:                                              ; preds = %97, %97, %97
  %102 = load i16, ptr %67, align 1, !tbaa !11
  %103 = add i16 %102, 15
  store i16 %103, ptr %4, align 2, !tbaa !10
  br label %114

104:                                              ; preds = %94, %97, %94, %94, %94, %94
  store i16 15, ptr %3, align 2, !tbaa !5
  %105 = getelementptr inbounds i8, ptr %93, i64 24
  %106 = load ptr, ptr %105, align 8, !tbaa !30
  %107 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %16, ptr noundef nonnull dereferenceable(1) %106) #6
  %108 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %16) #7
  %109 = trunc i64 %108 to i16
  %110 = add i16 %109, 6
  store i16 %110, ptr %4, align 2, !tbaa !10
  call void @convertlabel(ptr noundef nonnull %3) #6
  br label %114

111:                                              ; preds = %94, %94
  store i16 14, ptr %3, align 2, !tbaa !5
  store i16 13, ptr %4, align 2, !tbaa !10
  %112 = getelementptr inbounds i8, ptr %93, i64 32
  %113 = load double, ptr %112, align 8, !tbaa !29
  store double %113, ptr %16, align 1, !tbaa !11
  br label %114

114:                                              ; preds = %111, %104, %101
  %115 = getelementptr inbounds i8, ptr %93, i64 18
  %116 = load i8, ptr %115, align 2, !tbaa !31
  %117 = call zeroext i8 @convertlformat(i8 noundef zeroext %116) #6
  store i8 %117, ptr %5, align 2, !tbaa !11
  store i32 %.154, ptr %2, align 4, !tbaa !20
  store i32 %.04057, ptr %68, align 4, !tbaa !22
  call void @convertcelladr(ptr noundef nonnull %69, ptr noundef nonnull %2) #6
  %118 = call i32 @putwksrecord(ptr noundef nonnull %3) #6
  br label %123

119:                                              ; preds = %94
  %120 = zext i8 %96 to i32
  %121 = load ptr, ptr @stderr, align 8, !tbaa !14
  %122 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef nonnull @.str.3, i32 noundef %120) #8
  br label %123

123:                                              ; preds = %.lr.ph55, %119, %114, %94
  %124 = add nsw i32 %.154, -1
  %125 = icmp sgt i32 %.154, 0
  br i1 %125, label %.lr.ph55, label %._crit_edge.loopexit, !llvm.loop !32

._crit_edge.loopexit:                             ; preds = %123
  %.pre62 = load i32, ptr @lastrow, align 4, !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph58.split
  %126 = phi i32 [ %.pre62, %._crit_edge.loopexit ], [ %91, %.lr.ph58.split ]
  %.not43.not = icmp slt i32 %.04057, %126
  br i1 %.not43.not, label %.lr.ph58.splitthread-pre-split, label %._crit_edge59, !llvm.loop !33

._crit_edge59:                                    ; preds = %._crit_edge, %.lr.ph58, %.preheader
  store i16 1, ptr %3, align 2, !tbaa !5
  store i16 0, ptr %4, align 2, !tbaa !10
  %127 = call i32 @putwksrecord(ptr noundef nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 2068, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  ret i32 0
}

declare i32 @putwksrecord(ptr noundef) local_unnamed_addr #1

; 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 #2

declare ptr @str_upr(ptr noundef) local_unnamed_addr #1

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

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

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

declare zeroext i8 @convertlformat(i8 noundef zeroext) local_unnamed_addr #1

declare void @convertcelladr(ptr noundef, ptr noundef) local_unnamed_addr #1

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 2, !8, i64 4}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 2}
!11 = !{!8, !8, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !8, i64 0}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !15, i64 24}
!19 = !{!"Range", !15, i64 0, !8, i64 8, !15, i64 24}
!20 = !{!21, !13, i64 0}
!21 = !{!"CELLADR", !13, i64 0, !13, i64 4}
!22 = !{!21, !13, i64 4}
!23 = distinct !{!23, !17}
!24 = !{!25, !8, i64 16}
!25 = !{!"CELLREC", !21, i64 0, !15, i64 8, !8, i64 16, !8, i64 17, !8, i64 18, !15, i64 24, !26, i64 32, !28, i64 56}
!26 = !{!"CELLVALUE", !27, i64 0, !27, i64 8, !15, i64 16}
!27 = !{!"double", !8, i64 0}
!28 = !{!"CELLSTRING", !7, i64 0, !15, i64 8}
!29 = !{!25, !27, i64 32}
!30 = !{!25, !15, i64 24}
!31 = !{!25, !8, i64 18}
!32 = distinct !{!32, !17}
!33 = distinct !{!33, !17, !34}
!34 = !{!"llvm.loop.unswitch.partial.disable"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass