; LLVM IR from aap/pdp6 :: fe6 (fe)

; 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.termios = type { i32, i32, i32, i32, i8, [32 x i8], i32, i32 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.Assembler = type { [4 x i64], i32, i64, i32, i32 }

@tiosaved = external dso_local global %struct.termios, align 4
@permmode = external dso_local global i32, align 4
@errjmp = external dso_local global [1 x %struct.__jmp_buf_tag], align 16
@number = external dso_local global i64, align 8
@ch = external dso_local global i8, align 1
@hasnum = external dso_local global i32, align 4
@nbuf = external dso_local global i32, align 4
@dot = external dso_local global i32, align 4
@as = external dso_local global %struct.Assembler, align 8
@q = external dso_local global i64, align 8
@.str.32 = external hidden unnamed_addr constant [4 x i8], align 1
@curmode = external dso_local global i32, align 4
@opened = external dso_local global i32, align 4
@addr = external dso_local global i32, align 4
@flags = external dso_local global i32, align 4
@linemode = external dso_local global i32, align 4
@.str.37 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [5 x i8], align 1
@erasec = external dso_local global i8, align 1
@killc = external dso_local global i8, align 1
@intrc = external dso_local global i8, align 1
@started = external dso_local global i32, align 4
@.str.39 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [1 x i8], align 1
@colhelpstr = external global ptr, align 8
@helpstr = external global ptr, align 8
@.str.46 = external hidden unnamed_addr constant [6 x i8], align 1
@starta = external dso_local global i32, align 4
@.str.47 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @raw(i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local signext i8 @tyi() #0

; Function Attrs: nounwind uwtable
declare dso_local void @tyo(i8 noundef signext) #0

; Function Attrs: nounwind uwtable
declare dso_local void @typenum(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @typestr(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @typestrnl(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @typestrnl_(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @err(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @num() #0

; Function Attrs: nounwind uwtable
declare dso_local void @ins() #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @resetexp() #0

; Function Attrs: nounwind uwtable
declare dso_local void @pushexp() #0

; Function Attrs: nounwind uwtable
declare dso_local void @popexp() #0

; Function Attrs: nounwind uwtable
declare dso_local void @combine(i64 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @endword(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @prword(i32 noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @typeout(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @propen(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @aclose(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @aopen(i32 noundef) #0

declare i64 @examine(i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @modechange(i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @runline() #0

; Function Attrs: nounwind uwtable
declare dso_local void @zerocore() #0

; Function Attrs: nounwind uwtable
declare dso_local void @quit() #0

; Function Attrs: nounwind uwtable
define dso_local i32 @threadmain(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i8, align 1
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @init6()
  call void @initcrt(ptr noundef @.str.38)
  %9 = call i32 @raw(i32 noundef 0)
  %10 = load i8, ptr getelementptr inbounds ([32 x i8], ptr getelementptr inbounds (%struct.termios, ptr @tiosaved, i32 0, i32 5), i64 0, i64 2), align 1, !tbaa !11
  store i8 %10, ptr @erasec, align 1, !tbaa !11
  %11 = load i8, ptr getelementptr inbounds ([32 x i8], ptr getelementptr inbounds (%struct.termios, ptr @tiosaved, i32 0, i32 5), i64 0, i64 3), align 1, !tbaa !11
  store i8 %11, ptr @killc, align 1, !tbaa !11
  %12 = load i8, ptr getelementptr inbounds (%struct.termios, ptr @tiosaved, i32 0, i32 5), align 1, !tbaa !11
  store i8 %12, ptr @intrc, align 1, !tbaa !11
  %13 = call i32 @_setjmp(ptr noundef @errjmp) #6
  store i32 0, ptr @nbuf, align 4, !tbaa !5
  store i32 0, ptr @opened, align 4, !tbaa !5
  call void @resetexp()
  store i32 0, ptr @flags, align 4, !tbaa !5
  %14 = load i32, ptr @permmode, align 4, !tbaa !5
  store i32 %14, ptr @curmode, align 4, !tbaa !5
  store i64 0, ptr @number, align 8, !tbaa !12
  store i32 0, ptr @hasnum, align 4, !tbaa !5
  store i32 0, ptr @linemode, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %421, %61, %2
  %16 = call i32 @hasinput(i32 noundef 0)
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %20

18:                                               ; preds = %15
  %19 = call signext i8 @tyi()
  store i8 %19, ptr @ch, align 1, !tbaa !11
  br label %63

20:                                               ; preds = %15
  %21 = load i32, ptr @started, align 4, !tbaa !5
  %22 = icmp ne i32 %21, 0
  br i1 %22, label %23, label %61

23:                                               ; preds = %20
  %24 = call i32 @isrunning()
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %29

26:                                               ; preds = %23
  %27 = call i32 @isstopped()
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %61

29:                                               ; preds = %26, %23
  %30 = call i64 @examine(i32 noundef 262165)
  store i64 %30, ptr %6, align 8, !tbaa !12
  call void @typestrnl(ptr noundef @.str.39)
  %31 = load i64, ptr %6, align 8, !tbaa !12
  call void @typenum(i64 noundef %31)
  %32 = call i32 @isrunning()
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %35, label %34

34:                                               ; preds = %29
  call void @typestr(ptr noundef @.str.40)
  br label %36

35:                                               ; preds = %29
  call void @typestr(ptr noundef @.str.41)
  br label %36

36:                                               ; preds = %35, %34
  %37 = load i64, ptr %6, align 8, !tbaa !12
  %38 = trunc i64 %37 to i32
  %39 = call i64 @examine(i32 noundef %38)
  store i64 %39, ptr %6, align 8, !tbaa !12
  %40 = load i64, ptr %6, align 8, !tbaa !12
  call void @prword(i32 noundef 3, i64 noundef %40)
  call void @typestr(ptr noundef @.str.32)
  %41 = load i64, ptr %6, align 8, !tbaa !12
  %42 = and i64 %41, 60129542144
  %43 = icmp eq i64 %42, 60129542144
  br i1 %43, label %44, label %47

44:                                               ; preds = %36
  %45 = load i64, ptr %6, align 8, !tbaa !12
  %46 = and i64 %45, 262143
  store i64 %46, ptr %6, align 8, !tbaa !12
  br label %51

47:                                               ; preds = %36
  %48 = load i64, ptr %6, align 8, !tbaa !12
  %49 = lshr i64 %48, 23
  %50 = and i64 %49, 15
  store i64 %50, ptr %6, align 8, !tbaa !12
  br label %51

51:                                               ; preds = %47, %44
  %52 = load i64, ptr %6, align 8, !tbaa !12
  %53 = trunc i64 %52 to i32
  store i32 %53, ptr @dot, align 4, !tbaa !5
  %54 = load i32, ptr @dot, align 4, !tbaa !5
  %55 = zext i32 %54 to i64
  call void @prword(i32 noundef 3, i64 noundef %55)
  call void @typestr(ptr noundef @.str.42)
  %56 = load i64, ptr %6, align 8, !tbaa !12
  %57 = trunc i64 %56 to i32
  %58 = call i64 @examine(i32 noundef %57)
  store i64 %58, ptr %6, align 8, !tbaa !12
  %59 = load i64, ptr %6, align 8, !tbaa !12
  call void @prword(i32 noundef 3, i64 noundef %59)
  %60 = load i64, ptr %6, align 8, !tbaa !12
  store i64 %60, ptr @q, align 8, !tbaa !12
  call void @typestr(ptr noundef @.str.43)
  store i32 0, ptr @started, align 4, !tbaa !5
  br label %61

61:                                               ; preds = %51, %26, %20
  call void @fe_svc()
  %62 = call i32 @usleep(i32 noundef 1000)
  br label %15

63:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %64 = call ptr @__ctype_toupper_loc() #7
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = load i8, ptr @ch, align 1, !tbaa !11
  %67 = sext i8 %66 to i32
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds i32, ptr %65, i64 %68
  %70 = load i32, ptr %69, align 4, !tbaa !5
  store i32 %70, ptr %7, align 4, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %71, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = trunc i32 %72 to i8
  store i8 %73, ptr %5, align 1, !tbaa !11
  %74 = load i8, ptr @ch, align 1, !tbaa !11
  %75 = sext i8 %74 to i32
  %76 = load i8, ptr @erasec, align 1, !tbaa !11
  %77 = sext i8 %76 to i32
  %78 = icmp eq i32 %75, %77
  br i1 %78, label %87, label %79

79:                                               ; preds = %63
  %80 = load i8, ptr @ch, align 1, !tbaa !11
  %81 = sext i8 %80 to i32
  %82 = icmp eq i32 %81, 8
  br i1 %82, label %87, label %83

83:                                               ; preds = %79
  %84 = load i8, ptr @ch, align 1, !tbaa !11
  %85 = sext i8 %84 to i32
  %86 = icmp eq i32 %85, 31
  br i1 %86, label %87, label %98

87:                                               ; preds = %83, %79, %63
  %88 = load i32, ptr @flags, align 4, !tbaa !5
  %89 = and i32 %88, 1
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %94, label %91

91:                                               ; preds = %87
  %92 = load i32, ptr @nbuf, align 4, !tbaa !5
  %93 = icmp sle i32 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %91, %87
  call void @err(ptr noundef @.str.37)
  br label %95

95:                                               ; preds = %94, %91
  call void @typestr(ptr noundef @.str.44)
  %96 = load i32, ptr @nbuf, align 4, !tbaa !5
  %97 = add nsw i32 %96, -1
  store i32 %97, ptr @nbuf, align 4, !tbaa !5
  br label %420

98:                                               ; preds = %83
  %99 = load i8, ptr @ch, align 1, !tbaa !11
  %100 = sext i8 %99 to i32
  %101 = load i8, ptr @killc, align 1, !tbaa !11
  %102 = sext i8 %101 to i32
  %103 = icmp eq i32 %100, %102
  br i1 %103, label %104, label %105

104:                                              ; preds = %98
  call void @err(ptr noundef @.str.45)
  br label %419

105:                                              ; preds = %98
  %106 = load i8, ptr @ch, align 1, !tbaa !11
  %107 = sext i8 %106 to i32
  %108 = load i8, ptr @intrc, align 1, !tbaa !11
  %109 = sext i8 %108 to i32
  %110 = icmp eq i32 %107, %109
  br i1 %110, label %111, label %112

111:                                              ; preds = %105
  br label %422

112:                                              ; preds = %105
  %113 = load i32, ptr @linemode, align 4, !tbaa !5
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %127

115:                                              ; preds = %112
  %116 = load i8, ptr @ch, align 1, !tbaa !11
  %117 = sext i8 %116 to i32
  %118 = icmp eq i32 %117, 13
  br i1 %118, label %123, label %119

119:                                              ; preds = %115
  %120 = load i8, ptr @ch, align 1, !tbaa !11
  %121 = sext i8 %120 to i32
  %122 = icmp eq i32 %121, 10
  br i1 %122, label %123, label %124

123:                                              ; preds = %119, %115
  call void @typestrnl(ptr noundef @.str.39)
  call void @runline()
  call void @err(ptr noundef @.str.45)
  br label %126

124:                                              ; preds = %119
  %125 = load i8, ptr @ch, align 1, !tbaa !11
  call void @tyo(i8 noundef signext %125)
  call void @ins()
  br label %126

126:                                              ; preds = %124, %123
  br label %417

127:                                              ; preds = %112
  %128 = load i8, ptr @ch, align 1, !tbaa !11
  call void @tyo(i8 noundef signext %128)
  %129 = load i32, ptr @flags, align 4, !tbaa !5
  %130 = and i32 %129, 1
  %131 = icmp eq i32 %130, 0
  br i1 %131, label %132, label %149

132:                                              ; preds = %127
  %133 = load i8, ptr @ch, align 1, !tbaa !11
  %134 = sext i8 %133 to i32
  %135 = icmp sge i32 %134, 65
  br i1 %135, label %136, label %140

136:                                              ; preds = %132
  %137 = load i8, ptr @ch, align 1, !tbaa !11
  %138 = sext i8 %137 to i32
  %139 = icmp sle i32 %138, 90
  br i1 %139, label %148, label %140

140:                                              ; preds = %136, %132
  %141 = load i8, ptr @ch, align 1, !tbaa !11
  %142 = sext i8 %141 to i32
  %143 = icmp sge i32 %142, 97
  br i1 %143, label %144, label %149

144:                                              ; preds = %140
  %145 = load i8, ptr @ch, align 1, !tbaa !11
  %146 = sext i8 %145 to i32
  %147 = icmp sle i32 %146, 122
  br i1 %147, label %148, label %149

148:                                              ; preds = %144, %136
  call void @ins()
  br label %416

149:                                              ; preds = %144, %140, %127
  %150 = load i8, ptr %5, align 1, !tbaa !11
  %151 = sext i8 %150 to i32
  switch i32 %151, label %414 [
    i32 58, label %152
    i32 76, label %153
    i32 89, label %154
    i32 63, label %155
    i32 4, label %165
    i32 46, label %166
    i32 37, label %166
    i32 36, label %166
    i32 48, label %167
    i32 49, label %167
    i32 50, label %167
    i32 51, label %167
    i32 52, label %167
    i32 53, label %167
    i32 54, label %167
    i32 55, label %167
    i32 56, label %167
    i32 57, label %167
    i32 70, label %173
    i32 71, label %174
    i32 82, label %200
    i32 26, label %216
    i32 80, label %223
    i32 14, label %225
    i32 88, label %233
    i32 73, label %240
    i32 81, label %241
    i32 90, label %243
    i32 27, label %250
    i32 43, label %260
    i32 45, label %260
    i32 42, label %260
    i32 124, label %260
    i32 40, label %273
    i32 41, label %279
    i32 32, label %297
    i32 44, label %319
    i32 64, label %341
    i32 47, label %346
    i32 92, label %349
    i32 91, label %351
    i32 93, label %358
    i32 33, label %365
    i32 9, label %367
    i32 94, label %371
    i32 10, label %378
    i32 13, label %385
    i32 95, label %387
    i32 61, label %388
    i32 59, label %389
    i32 34, label %390
    i32 39, label %397
    i32 38, label %404
    i32 83, label %411
    i32 67, label %412
    i32 72, label %413
  ]

152:                                              ; preds = %149
  store i32 1, ptr @linemode, align 4, !tbaa !5
  store i32 0, ptr @nbuf, align 4, !tbaa !5
  br label %415

153:                                              ; preds = %149
  call void @tyo(i8 noundef signext 32)
  store i32 2, ptr @linemode, align 4, !tbaa !5
  store i32 0, ptr @nbuf, align 4, !tbaa !5
  br label %415

154:                                              ; preds = %149
  call void @tyo(i8 noundef signext 32)
  store i32 3, ptr @linemode, align 4, !tbaa !5
  store i32 0, ptr @nbuf, align 4, !tbaa !5
  br label %415

155:                                              ; preds = %149
  %156 = load i32, ptr @flags, align 4, !tbaa !5
  %157 = and i32 %156, 1
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %161

159:                                              ; preds = %155
  %160 = load ptr, ptr @colhelpstr, align 8, !tbaa !9
  br label %163

161:                                              ; preds = %155
  %162 = load ptr, ptr @helpstr, align 8, !tbaa !9
  br label %163

163:                                              ; preds = %161, %159
  %164 = phi ptr [ %160, %159 ], [ %162, %161 ]
  call void @typestrnl_(ptr noundef %164)
  br label %415

165:                                              ; preds = %149
  call void @err(ptr noundef @.str.46)
  br label %415

166:                                              ; preds = %149, %149, %149
  call void @ins()
  br label %415

167:                                              ; preds = %149, %149, %149, %149, %149, %149, %149, %149, %149, %149
  %168 = load i32, ptr @flags, align 4, !tbaa !5
  %169 = and i32 %168, 1
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %171, label %172

171:                                              ; preds = %167
  call void @num()
  br label %421

172:                                              ; preds = %167
  call void @ins()
  br label %415

173:                                              ; preds = %149
  call void @cpu_printflags()
  br label %415

174:                                              ; preds = %149
  %175 = call i32 @endword(ptr noundef %6)
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %180, label %177

177:                                              ; preds = %174
  %178 = load i32, ptr @starta, align 4, !tbaa !5
  %179 = zext i32 %178 to i64
  store i64 %179, ptr %6, align 8, !tbaa !12
  br label %180

180:                                              ; preds = %177, %174
  %181 = load i32, ptr @flags, align 4, !tbaa !5
  %182 = and i32 %181, 2
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %187

184:                                              ; preds = %180
  %185 = load i64, ptr %6, align 8, !tbaa !12
  %186 = trunc i64 %185 to i32
  store i32 %186, ptr @starta, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %184, %180
  %188 = load i32, ptr @hasnum, align 4, !tbaa !5
  %189 = icmp ne i32 %188, 0
  br i1 %189, label %190, label %196

190:                                              ; preds = %187
  %191 = load i64, ptr @number, align 8, !tbaa !12
  %192 = icmp eq i64 %191, 0
  br i1 %192, label %193, label %196

193:                                              ; preds = %190
  %194 = load i64, ptr %6, align 8, !tbaa !12
  %195 = trunc i64 %194 to i32
  call void @cpu_setpc(i32 noundef %195)
  br label %199

196:                                              ; preds = %190, %187
  %197 = load i64, ptr %6, align 8, !tbaa !12
  %198 = trunc i64 %197 to i32
  call void @cpu_start(i32 noundef %198)
  br label %199

199:                                              ; preds = %196, %193
  store i32 1, ptr @started, align 4, !tbaa !5
  br label %415

200:                                              ; preds = %149
  %201 = call i32 @endword(ptr noundef %6)
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %206, label %203

203:                                              ; preds = %200
  %204 = load i32, ptr @starta, align 4, !tbaa !5
  %205 = zext i32 %204 to i64
  store i64 %205, ptr %6, align 8, !tbaa !12
  br label %206

206:                                              ; preds = %203, %200
  %207 = load i32, ptr @flags, align 4, !tbaa !5
  %208 = and i32 %207, 2
  %209 = icmp ne i32 %208, 0
  br i1 %209, label %210, label %213

210:                                              ; preds = %206
  %211 = load i64, ptr %6, align 8, !tbaa !12
  %212 = trunc i64 %211 to i32
  store i32 %212, ptr @starta, align 4, !tbaa !5
  br label %213

213:                                              ; preds = %210, %206
  %214 = load i64, ptr %6, align 8, !tbaa !12
  %215 = trunc i64 %214 to i32
  call void @cpu_readin(i32 noundef %215)
  store i32 1, ptr @started, align 4, !tbaa !5
  br label %415

216:                                              ; preds = %149
  store i32 0, ptr @nbuf, align 4, !tbaa !5
  %217 = load i32, ptr @flags, align 4, !tbaa !5
  %218 = and i32 %217, 1
  %219 = icmp ne i32 %218, 0
  br i1 %219, label %220, label %221

220:                                              ; preds = %216
  call void @cpu_stopmem()
  br label %222

221:                                              ; preds = %216
  call void @cpu_stopinst()
  br label %222

222:                                              ; preds = %221, %220
  br label %415

223:                                              ; preds = %149
  %224 = call i32 @endword(ptr noundef %6)
  call void @cpu_cont()
  store i32 1, ptr @started, align 4, !tbaa !5
  br label %415

225:                                              ; preds = %149
  %226 = call i32 @endword(ptr noundef %6)
  %227 = load i32, ptr @flags, align 4, !tbaa !5
  %228 = and i32 %227, 1
  %229 = icmp ne i32 %228, 0
  br i1 %229, label %230, label %231

230:                                              ; preds = %225
  call void @cpu_nextmem()
  br label %232

231:                                              ; preds = %225
  call void @cpu_nextinst()
  br label %232

232:                                              ; preds = %231, %230
  store i32 1, ptr @started, align 4, !tbaa !5
  br label %415

233:                                              ; preds = %149
  %234 = call i32 @endword(ptr noundef %6)
  %235 = icmp ne i32 %234, 0
  br i1 %235, label %238, label %236

236:                                              ; preds = %233
  %237 = load i64, ptr @q, align 8, !tbaa !12
  store i64 %237, ptr %6, align 8, !tbaa !12
  br label %238

238:                                              ; preds = %236, %233
  %239 = load i64, ptr %6, align 8, !tbaa !12
  call void @cpu_exec(i64 noundef %239)
  call void @typestrnl(ptr noundef @.str.39)
  br label %415

240:                                              ; preds = %149
  store i32 0, ptr @nbuf, align 4, !tbaa !5
  call void @cpu_ioreset()
  br label %415

241:                                              ; preds = %149
  %242 = load i64, ptr @q, align 8, !tbaa !12
  call void @combine(i64 noundef %242)
  br label %415

243:                                              ; preds = %149
  %244 = load i32, ptr @flags, align 4, !tbaa !5
  %245 = and i32 %244, 2
  %246 = icmp ne i32 %245, 0
  br i1 %246, label %247, label %248

247:                                              ; preds = %243
  call void @zerocore()
  br label %249

248:                                              ; preds = %243
  call void @err(ptr noundef @.str.47)
  br label %249

249:                                              ; preds = %248, %247
  br label %415

250:                                              ; preds = %149
  %251 = load i32, ptr @flags, align 4, !tbaa !5
  %252 = and i32 %251, 1
  %253 = icmp ne i32 %252, 0
  br i1 %253, label %254, label %257

254:                                              ; preds = %250
  %255 = load i32, ptr @flags, align 4, !tbaa !5
  %256 = or i32 %255, 2
  store i32 %256, ptr @flags, align 4, !tbaa !5
  br label %257

257:                                              ; preds = %254, %250
  %258 = load i32, ptr @flags, align 4, !tbaa !5
  %259 = or i32 %258, 1
  store i32 %259, ptr @flags, align 4, !tbaa !5
  br label %421

260:                                              ; preds = %149, %149, %149, %149
  %261 = call i32 @parse(ptr noundef %6)
  %262 = icmp ne i32 %261, 0
  br i1 %262, label %269, label %263

263:                                              ; preds = %260
  %264 = load i8, ptr @ch, align 1, !tbaa !11
  %265 = sext i8 %264 to i32
  %266 = icmp eq i32 %265, 45
  br i1 %266, label %267, label %268

267:                                              ; preds = %263
  store i32 45, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 3), align 8, !tbaa !14
  br label %268

268:                                              ; preds = %267, %263
  br label %415

269:                                              ; preds = %260
  %270 = load i64, ptr %6, align 8, !tbaa !12
  call void @combine(i64 noundef %270)
  %271 = load i8, ptr @ch, align 1, !tbaa !11
  %272 = sext i8 %271 to i32
  store i32 %272, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 3), align 8, !tbaa !14
  br label %415

273:                                              ; preds = %149
  %274 = call i32 @parse(ptr noundef %6)
  %275 = icmp ne i32 %274, 0
  br i1 %275, label %276, label %278

276:                                              ; preds = %273
  %277 = load i64, ptr %6, align 8, !tbaa !12
  call void @combine(i64 noundef %277)
  br label %278

278:                                              ; preds = %276, %273
  call void @pushexp()
  br label %415

279:                                              ; preds = %149
  store i64 0, ptr %6, align 8, !tbaa !12
  %280 = call i32 @endword(ptr noundef %6)
  call void @popexp()
  %281 = load i32, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 3), align 8, !tbaa !14
  %282 = icmp eq i32 %281, 0
  br i1 %282, label %283, label %294

283:                                              ; preds = %279
  %284 = load i64, ptr %6, align 8, !tbaa !12
  %285 = and i64 %284, 68719214592
  %286 = lshr i64 %285, 18
  %287 = load i64, ptr %6, align 8, !tbaa !12
  %288 = and i64 %287, 262143
  %289 = shl i64 %288, 18
  %290 = or i64 %286, %289
  store i64 %290, ptr %6, align 8, !tbaa !12
  %291 = load i64, ptr %6, align 8, !tbaa !12
  %292 = load i64, ptr @as, align 8, !tbaa !12
  %293 = add i64 %292, %291
  store i64 %293, ptr @as, align 8, !tbaa !12
  store i32 1, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 4), align 4, !tbaa !16
  br label %296

294:                                              ; preds = %279
  %295 = load i64, ptr %6, align 8, !tbaa !12
  call void @combine(i64 noundef %295)
  br label %296

296:                                              ; preds = %294, %283
  store i32 0, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 3), align 8, !tbaa !14
  br label %415

297:                                              ; preds = %149
  %298 = call i32 @parse(ptr noundef %6)
  %299 = icmp ne i32 %298, 0
  br i1 %299, label %301, label %300

300:                                              ; preds = %297
  br label %415

301:                                              ; preds = %297
  %302 = load i64, ptr %6, align 8, !tbaa !12
  call void @combine(i64 noundef %302)
  %303 = load i32, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  %304 = and i32 %303, 8
  %305 = icmp ne i32 %304, 0
  br i1 %305, label %306, label %312

306:                                              ; preds = %301
  %307 = load i64, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 2), align 8, !tbaa !18
  %308 = load i64, ptr getelementptr inbounds ([4 x i64], ptr @as, i64 0, i64 3), align 8, !tbaa !12
  %309 = add i64 %308, %307
  store i64 %309, ptr getelementptr inbounds ([4 x i64], ptr @as, i64 0, i64 3), align 8, !tbaa !12
  %310 = load i32, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  %311 = or i32 %310, 1
  store i32 %311, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  br label %318

312:                                              ; preds = %301
  %313 = load i64, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 2), align 8, !tbaa !18
  %314 = load i64, ptr @as, align 8, !tbaa !12
  %315 = add i64 %314, %313
  store i64 %315, ptr @as, align 8, !tbaa !12
  %316 = load i32, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  %317 = or i32 %316, 8
  store i32 %317, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  br label %318

318:                                              ; preds = %312, %306
  store i64 0, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 2), align 8, !tbaa !18
  br label %415

319:                                              ; preds = %149
  %320 = call i32 @parse(ptr noundef %6)
  %321 = icmp ne i32 %320, 0
  br i1 %321, label %323, label %322

322:                                              ; preds = %319
  br label %415

323:                                              ; preds = %319
  %324 = load i64, ptr %6, align 8, !tbaa !12
  call void @combine(i64 noundef %324)
  %325 = load i32, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  %326 = and i32 %325, 4
  %327 = icmp ne i32 %326, 0
  br i1 %327, label %328, label %334

328:                                              ; preds = %323
  %329 = load i64, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 2), align 8, !tbaa !18
  %330 = load i64, ptr getelementptr inbounds ([4 x i64], ptr @as, i64 0, i64 3), align 8, !tbaa !12
  %331 = add i64 %330, %329
  store i64 %331, ptr getelementptr inbounds ([4 x i64], ptr @as, i64 0, i64 3), align 8, !tbaa !12
  %332 = load i32, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  %333 = or i32 %332, 1
  store i32 %333, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  br label %340

334:                                              ; preds = %323
  %335 = load i64, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 2), align 8, !tbaa !18
  %336 = load i64, ptr getelementptr inbounds ([4 x i64], ptr @as, i64 0, i64 1), align 8, !tbaa !12
  %337 = add i64 %336, %335
  store i64 %337, ptr getelementptr inbounds ([4 x i64], ptr @as, i64 0, i64 1), align 8, !tbaa !12
  %338 = load i32, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  %339 = or i32 %338, 4
  store i32 %339, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  br label %340

340:                                              ; preds = %334, %328
  store i64 0, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 2), align 8, !tbaa !18
  br label %415

341:                                              ; preds = %149
  %342 = load i64, ptr getelementptr inbounds ([4 x i64], ptr @as, i64 0, i64 2), align 8, !tbaa !12
  %343 = add i64 %342, 4194304
  store i64 %343, ptr getelementptr inbounds ([4 x i64], ptr @as, i64 0, i64 2), align 8, !tbaa !12
  %344 = load i32, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  %345 = or i32 %344, 2
  store i32 %345, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 1), align 8, !tbaa !17
  store i32 1, ptr getelementptr inbounds (%struct.Assembler, ptr @as, i32 0, i32 4), align 4, !tbaa !16
  br label %415

346:                                              ; preds = %149
  call void @aclose(i32 noundef 0)
  %347 = load i32, ptr @addr, align 4, !tbaa !5
  store i32 %347, ptr @dot, align 4, !tbaa !5
  %348 = load i32, ptr @curmode, align 4, !tbaa !5
  call void @aopen(i32 noundef %348)
  br label %415

349:                                              ; preds = %149
  call void @aclose(i32 noundef 0)
  %350 = load i32, ptr @curmode, align 4, !tbaa !5
  call void @aopen(i32 noundef %350)
  br label %415

351:                                              ; preds = %149
  %352 = load i32, ptr @flags, align 4, !tbaa !5
  %353 = and i32 %352, 1
  %354 = icmp ne i32 %353, 0
  br i1 %354, label %355, label %356

355:                                              ; preds = %351
  call void @tyo(i8 noundef signext 32)
  store i32 4, ptr @linemode, align 4, !tbaa !5
  store i32 0, ptr @nbuf, align 4, !tbaa !5
  br label %415

356:                                              ; preds = %351
  call void @aclose(i32 noundef 0)
  %357 = load i32, ptr @addr, align 4, !tbaa !5
  store i32 %357, ptr @dot, align 4, !tbaa !5
  call void @aopen(i32 noundef 1)
  br label %415

358:                                              ; preds = %149
  %359 = load i32, ptr @flags, align 4, !tbaa !5
  %360 = and i32 %359, 1
  %361 = icmp ne i32 %360, 0
  br i1 %361, label %362, label %363

362:                                              ; preds = %358
  call void @tyo(i8 noundef signext 32)
  store i32 5, ptr @linemode, align 4, !tbaa !5
  store i32 0, ptr @nbuf, align 4, !tbaa !5
  br label %415

363:                                              ; preds = %358
  call void @aclose(i32 noundef 0)
  %364 = load i32, ptr @addr, align 4, !tbaa !5
  store i32 %364, ptr @dot, align 4, !tbaa !5
  call void @aopen(i32 noundef 3)
  br label %415

365:                                              ; preds = %149
  call void @aclose(i32 noundef 0)
  %366 = load i32, ptr @addr, align 4, !tbaa !5
  store i32 %366, ptr @dot, align 4, !tbaa !5
  call void @aopen(i32 noundef 0)
  br label %415

367:                                              ; preds = %149
  call void @typestrnl(ptr noundef @.str.39)
  call void @aclose(i32 noundef 1)
  %368 = load i32, ptr @addr, align 4, !tbaa !5
  store i32 %368, ptr @dot, align 4, !tbaa !5
  %369 = load i32, ptr @addr, align 4, !tbaa !5
  call void @propen(i32 noundef %369)
  %370 = load i32, ptr @curmode, align 4, !tbaa !5
  call void @aopen(i32 noundef %370)
  br label %415

371:                                              ; preds = %149
  call void @typestrnl(ptr noundef @.str.39)
  call void @aclose(i32 noundef 1)
  %372 = load i32, ptr @dot, align 4, !tbaa !5
  %373 = sub i32 %372, 1
  %374 = and i32 %373, 1048575
  store i32 %374, ptr @dot, align 4, !tbaa !5
  %375 = load i32, ptr @dot, align 4, !tbaa !5
  store i32 %375, ptr @addr, align 4, !tbaa !5
  %376 = load i32, ptr @addr, align 4, !tbaa !5
  call void @propen(i32 noundef %376)
  %377 = load i32, ptr @curmode, align 4, !tbaa !5
  call void @aopen(i32 noundef %377)
  br label %415

378:                                              ; preds = %149
  call void @tyo(i8 noundef signext 13)
  call void @aclose(i32 noundef 1)
  %379 = load i32, ptr @dot, align 4, !tbaa !5
  %380 = add i32 %379, 1
  %381 = and i32 %380, 1048575
  store i32 %381, ptr @dot, align 4, !tbaa !5
  %382 = load i32, ptr @dot, align 4, !tbaa !5
  store i32 %382, ptr @addr, align 4, !tbaa !5
  %383 = load i32, ptr @addr, align 4, !tbaa !5
  call void @propen(i32 noundef %383)
  %384 = load i32, ptr @curmode, align 4, !tbaa !5
  call void @aopen(i32 noundef %384)
  br label %415

385:                                              ; preds = %149
  call void @tyo(i8 noundef signext 10)
  call void @aclose(i32 noundef 1)
  %386 = load i32, ptr @permmode, align 4, !tbaa !5
  store i32 %386, ptr @curmode, align 4, !tbaa !5
  br label %415

387:                                              ; preds = %149
  call void @typeout(i32 noundef 3)
  br label %415

388:                                              ; preds = %149
  call void @typeout(i32 noundef 1)
  br label %415

389:                                              ; preds = %149
  call void @typeout(i32 noundef 7)
  br label %415

390:                                              ; preds = %149
  %391 = load i32, ptr @flags, align 4, !tbaa !5
  %392 = and i32 %391, 1
  %393 = icmp ne i32 %392, 0
  br i1 %393, label %394, label %395

394:                                              ; preds = %390
  call void @modechange(i32 noundef 4)
  br label %396

395:                                              ; preds = %390
  call void @typeout(i32 noundef 4)
  br label %396

396:                                              ; preds = %395, %394
  br label %415

397:                                              ; preds = %149
  %398 = load i32, ptr @flags, align 4, !tbaa !5
  %399 = and i32 %398, 1
  %400 = icmp ne i32 %399, 0
  br i1 %400, label %401, label %402

401:                                              ; preds = %397
  call void @modechange(i32 noundef 5)
  br label %403

402:                                              ; preds = %397
  call void @typeout(i32 noundef 5)
  br label %403

403:                                              ; preds = %402, %401
  br label %415

404:                                              ; preds = %149
  %405 = load i32, ptr @flags, align 4, !tbaa !5
  %406 = and i32 %405, 1
  %407 = icmp ne i32 %406, 0
  br i1 %407, label %408, label %409

408:                                              ; preds = %404
  call void @modechange(i32 noundef 6)
  br label %410

409:                                              ; preds = %404
  call void @typeout(i32 noundef 6)
  br label %410

410:                                              ; preds = %409, %408
  br label %415

411:                                              ; preds = %149
  call void @modechange(i32 noundef 3)
  br label %415

412:                                              ; preds = %149
  call void @modechange(i32 noundef 1)
  br label %415

413:                                              ; preds = %149
  call void @modechange(i32 noundef 2)
  br label %415

414:                                              ; preds = %149
  call void @err(ptr noundef @.str.47)
  br label %415

415:                                              ; preds = %414, %413, %412, %411, %410, %403, %396, %389, %388, %387, %385, %378, %371, %367, %365, %363, %362, %356, %355, %349, %346, %341, %340, %322, %318, %300, %296, %278, %269, %268, %249, %241, %240, %238, %232, %223, %222, %213, %199, %173, %172, %166, %165, %163, %154, %153, %152
  br label %416

416:                                              ; preds = %415, %148
  br label %417

417:                                              ; preds = %416, %126
  br label %418

418:                                              ; preds = %417
  br label %419

419:                                              ; preds = %418, %104
  br label %420

420:                                              ; preds = %419, %95
  store i32 0, ptr @flags, align 4, !tbaa !5
  store i64 0, ptr @number, align 8, !tbaa !12
  store i32 0, ptr @hasnum, align 4, !tbaa !5
  br label %421

421:                                              ; preds = %420, %257, %171
  br label %15

422:                                              ; preds = %111
  call void @quit()
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  ret i32 0
}

declare void @init6() #2

declare void @initcrt(ptr noundef) #2

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #3

declare i32 @hasinput(i32 noundef) #2

declare i32 @isrunning() #2

declare i32 @isstopped() #2

declare void @fe_svc() #2

declare i32 @usleep(i32 noundef) #2

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

declare void @cpu_printflags() #2

declare void @cpu_setpc(i32 noundef) #2

declare void @cpu_start(i32 noundef) #2

declare void @cpu_readin(i32 noundef) #2

declare void @cpu_stopmem() #2

declare void @cpu_stopinst() #2

declare void @cpu_cont() #2

declare void @cpu_nextmem() #2

declare void @cpu_nextinst() #2

declare void @cpu_exec(i64 noundef) #2

declare void @cpu_ioreset() #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind returns_twice "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 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 #5 = { nounwind }
attributes #6 = { nounwind returns_twice }
attributes #7 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !6, i64 48}
!15 = !{!"Assembler", !7, i64 0, !6, i64 32, !13, i64 40, !6, i64 48, !6, i64 52}
!16 = !{!15, !6, i64 52}
!17 = !{!15, !6, i64 32}
!18 = !{!15, !13, i64 40}


; 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.termios = type { i32, i32, i32, i32, i8, [32 x i8], i32, i32 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.Assembler = type { [4 x i64], i32, i64, i32, i32 }

@tiosaved = external dso_local local_unnamed_addr global %struct.termios, align 4
@permmode = external dso_local local_unnamed_addr global i32, align 4
@errjmp = external dso_local global [1 x %struct.__jmp_buf_tag], align 16
@number = external dso_local local_unnamed_addr global i64, align 8
@ch = external dso_local local_unnamed_addr global i8, align 1
@hasnum = external dso_local local_unnamed_addr global i32, align 4
@nbuf = external dso_local local_unnamed_addr global i32, align 4
@dot = external dso_local local_unnamed_addr global i32, align 4
@as = external dso_local local_unnamed_addr global %struct.Assembler, align 8
@q = external dso_local local_unnamed_addr global i64, align 8
@.str.32 = external hidden unnamed_addr constant [4 x i8], align 1
@curmode = external dso_local local_unnamed_addr global i32, align 4
@opened = external dso_local local_unnamed_addr global i32, align 4
@addr = external dso_local local_unnamed_addr global i32, align 4
@flags = external dso_local local_unnamed_addr global i32, align 4
@linemode = external dso_local local_unnamed_addr global i32, align 4
@.str.37 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [5 x i8], align 1
@erasec = external dso_local local_unnamed_addr global i8, align 1
@killc = external dso_local local_unnamed_addr global i8, align 1
@intrc = external dso_local local_unnamed_addr global i8, align 1
@started = external dso_local local_unnamed_addr global i32, align 4
@.str.39 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [1 x i8], align 1
@colhelpstr = external local_unnamed_addr global ptr, align 8
@helpstr = external local_unnamed_addr global ptr, align 8
@.str.46 = external hidden unnamed_addr constant [6 x i8], align 1
@starta = external dso_local local_unnamed_addr global i32, align 4
@.str.47 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @raw(i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local signext i8 @tyi() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @tyo(i8 noundef signext) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @typenum(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @typestr(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @typestrnl(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @typestrnl_(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @err(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @num() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ins() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @parse(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @resetexp() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @pushexp() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @popexp() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @combine(i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @endword(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @prword(i32 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @typeout(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @propen(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @aclose(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @aopen(i32 noundef) local_unnamed_addr #0

declare i64 @examine(i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @modechange(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @runline() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @zerocore() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @quit() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @threadmain(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  call void @init6() #5
  call void @initcrt(ptr noundef nonnull @.str.38) #5
  %4 = call i32 @raw(i32 noundef 0)
  %5 = load i8, ptr getelementptr inbounds (i8, ptr @tiosaved, i64 19), align 1, !tbaa !5
  store i8 %5, ptr @erasec, align 1, !tbaa !5
  %6 = load i8, ptr getelementptr inbounds (i8, ptr @tiosaved, i64 20), align 4, !tbaa !5
  store i8 %6, ptr @killc, align 1, !tbaa !5
  %7 = load i8, ptr getelementptr inbounds (i8, ptr @tiosaved, i64 17), align 1, !tbaa !5
  store i8 %7, ptr @intrc, align 1, !tbaa !5
  %8 = call i32 @_setjmp(ptr noundef nonnull @errjmp) #6
  store i32 0, ptr @nbuf, align 4, !tbaa !8
  store i32 0, ptr @opened, align 4, !tbaa !8
  call void @resetexp()
  store i32 0, ptr @flags, align 4, !tbaa !8
  %9 = load i32, ptr @permmode, align 4, !tbaa !8
  store i32 %9, ptr @curmode, align 4, !tbaa !8
  store i64 0, ptr @number, align 8, !tbaa !10
  store i32 0, ptr @hasnum, align 4, !tbaa !8
  store i32 0, ptr @linemode, align 4, !tbaa !8
  br label %.backedge

.backedge:                                        ; preds = %.backedge.backedge, %2
  %10 = call i32 @hasinput(i32 noundef 0) #5
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %21, label %11

11:                                               ; preds = %.backedge
  %12 = call signext i8 @tyi()
  store i8 %12, ptr @ch, align 1, !tbaa !5
  %13 = call ptr @__ctype_toupper_loc() #7
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = sext i8 %12 to i64
  %16 = getelementptr inbounds i32, ptr %14, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !8
  %18 = load i8, ptr @erasec, align 1, !tbaa !5
  %19 = icmp eq i8 %12, %18
  %20 = freeze i1 %19
  br i1 %20, label %47, label %switch.early.test

switch.early.test:                                ; preds = %11
  switch i8 %12, label %57 [
    i8 31, label %47
    i8 8, label %47
  ]

21:                                               ; preds = %.backedge
  %22 = load i32, ptr @started, align 4, !tbaa !8
  %.not21 = icmp eq i32 %22, 0
  br i1 %.not21, label %45, label %23

23:                                               ; preds = %21
  %24 = call i32 @isrunning() #5
  %.not22 = icmp eq i32 %24, 0
  br i1 %.not22, label %27, label %25

25:                                               ; preds = %23
  %26 = call i32 @isstopped() #5
  %.not23 = icmp eq i32 %26, 0
  br i1 %.not23, label %45, label %27

27:                                               ; preds = %25, %23
  %28 = call i64 @examine(i32 noundef 262165) #5
  store i64 %28, ptr %3, align 8, !tbaa !10
  call void @typestrnl(ptr noundef nonnull @.str.39)
  %29 = load i64, ptr %3, align 8, !tbaa !10
  call void @typenum(i64 noundef %29)
  %30 = call i32 @isrunning() #5
  %.not24 = icmp eq i32 %30, 0
  %.str.40..str.41 = select i1 %.not24, ptr @.str.40, ptr @.str.41
  call void @typestr(ptr noundef nonnull %.str.40..str.41)
  %31 = load i64, ptr %3, align 8, !tbaa !10
  %32 = trunc i64 %31 to i32
  %33 = call i64 @examine(i32 noundef %32) #5
  store i64 %33, ptr %3, align 8, !tbaa !10
  call void @prword(i32 noundef 3, i64 noundef %33)
  call void @typestr(ptr noundef nonnull @.str.32)
  %34 = load i64, ptr %3, align 8, !tbaa !10
  %35 = and i64 %34, 60129542144
  %36 = icmp eq i64 %35, 60129542144
  %37 = lshr i64 %34, 23
  %38 = and i64 %37, 15
  %39 = and i64 %34, 262143
  %storemerge = select i1 %36, i64 %39, i64 %38
  store i64 %storemerge, ptr %3, align 8, !tbaa !10
  %40 = trunc nuw nsw i64 %storemerge to i32
  store i32 %40, ptr @dot, align 4, !tbaa !8
  call void @prword(i32 noundef 3, i64 noundef %storemerge)
  call void @typestr(ptr noundef nonnull @.str.42)
  %41 = load i64, ptr %3, align 8, !tbaa !10
  %42 = trunc i64 %41 to i32
  %43 = call i64 @examine(i32 noundef %42) #5
  store i64 %43, ptr %3, align 8, !tbaa !10
  call void @prword(i32 noundef 3, i64 noundef %43)
  %44 = load i64, ptr %3, align 8, !tbaa !10
  store i64 %44, ptr @q, align 8, !tbaa !10
  call void @typestr(ptr noundef nonnull @.str.43)
  store i32 0, ptr @started, align 4, !tbaa !8
  br label %45

45:                                               ; preds = %27, %25, %21
  call void @fe_svc() #5
  %46 = call i32 @usleep(i32 noundef 1000) #5
  br label %.backedge.backedge

47:                                               ; preds = %switch.early.test, %switch.early.test, %11
  %48 = load i32, ptr @flags, align 4, !tbaa !8
  %49 = and i32 %48, 1
  %50 = icmp ne i32 %49, 0
  %51 = load i32, ptr @nbuf, align 4
  %52 = icmp slt i32 %51, 1
  %or.cond7 = select i1 %50, i1 true, i1 %52
  br i1 %or.cond7, label %53, label %54

53:                                               ; preds = %47
  call void @err(ptr noundef nonnull @.str.37)
  br label %54

54:                                               ; preds = %47, %53
  call void @typestr(ptr noundef nonnull @.str.44)
  %55 = load i32, ptr @nbuf, align 4, !tbaa !8
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr @nbuf, align 4, !tbaa !8
  br label %252

57:                                               ; preds = %switch.early.test
  %58 = load i8, ptr @killc, align 1, !tbaa !5
  %59 = icmp eq i8 %12, %58
  br i1 %59, label %60, label %61

60:                                               ; preds = %57
  call void @err(ptr noundef nonnull @.str.45)
  br label %252

61:                                               ; preds = %57
  %62 = load i8, ptr @intrc, align 1, !tbaa !5
  %63 = icmp eq i8 %12, %62
  br i1 %63, label %253, label %64

64:                                               ; preds = %61
  %65 = load i32, ptr @linemode, align 4, !tbaa !8
  %.not25 = icmp eq i32 %65, 0
  br i1 %.not25, label %69, label %66

66:                                               ; preds = %64
  switch i8 %12, label %68 [
    i8 13, label %67
    i8 10, label %67
  ]

67:                                               ; preds = %66, %66
  call void @typestrnl(ptr noundef nonnull @.str.39)
  call void @runline()
  call void @err(ptr noundef nonnull @.str.45)
  br label %252

68:                                               ; preds = %66
  call void @tyo(i8 noundef signext %12)
  call void @ins()
  br label %252

69:                                               ; preds = %64
  call void @tyo(i8 noundef signext %12)
  %70 = load i32, ptr @flags, align 4, !tbaa !8
  %71 = and i32 %70, 1
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %78

73:                                               ; preds = %69
  %74 = load i8, ptr @ch, align 1
  %75 = and i8 %74, -33
  %76 = add i8 %75, -65
  %or.cond = icmp ult i8 %76, 26
  br i1 %or.cond, label %77, label %78

77:                                               ; preds = %73
  call void @ins()
  br label %252

78:                                               ; preds = %73, %69
  %sext = shl i32 %17, 24
  %79 = ashr exact i32 %sext, 24
  switch i32 %79, label %251 [
    i32 58, label %80
    i32 76, label %81
    i32 89, label %82
    i32 63, label %83
    i32 4, label %87
    i32 46, label %88
    i32 37, label %88
    i32 36, label %88
    i32 48, label %89
    i32 49, label %89
    i32 50, label %89
    i32 51, label %89
    i32 52, label %89
    i32 53, label %89
    i32 54, label %89
    i32 55, label %89
    i32 56, label %89
    i32 57, label %89
    i32 70, label %92
    i32 71, label %93
    i32 82, label %114
    i32 26, label %123
    i32 80, label %126
    i32 14, label %128
    i32 88, label %135
    i32 73, label %141
    i32 81, label %142
    i32 90, label %144
    i32 27, label %148
    i32 43, label %151
    i32 45, label %151
    i32 42, label %151
    i32 124, label %151
    i32 40, label %161
    i32 41, label %166
    i32 32, label %181
    i32 44, label %191
    i32 64, label %201
    i32 47, label %206
    i32 92, label %209
    i32 91, label %211
    i32 93, label %215
    i32 33, label %219
    i32 9, label %221
    i32 94, label %224
    i32 10, label %229
    i32 13, label %234
    i32 95, label %236
    i32 61, label %237
    i32 59, label %238
    i32 34, label %239
    i32 39, label %242
    i32 38, label %245
    i32 83, label %248
    i32 67, label %249
    i32 72, label %250
  ]

80:                                               ; preds = %78
  store i32 1, ptr @linemode, align 4, !tbaa !8
  store i32 0, ptr @nbuf, align 4, !tbaa !8
  br label %252

81:                                               ; preds = %78
  call void @tyo(i8 noundef signext 32)
  store i32 2, ptr @linemode, align 4, !tbaa !8
  store i32 0, ptr @nbuf, align 4, !tbaa !8
  br label %252

82:                                               ; preds = %78
  call void @tyo(i8 noundef signext 32)
  store i32 3, ptr @linemode, align 4, !tbaa !8
  store i32 0, ptr @nbuf, align 4, !tbaa !8
  br label %252

83:                                               ; preds = %78
  %84 = load ptr, ptr @colhelpstr, align 8
  %85 = load ptr, ptr @helpstr, align 8
  %86 = select i1 %72, ptr %85, ptr %84
  call void @typestrnl_(ptr noundef %86)
  br label %252

87:                                               ; preds = %78
  call void @err(ptr noundef nonnull @.str.46)
  br label %252

88:                                               ; preds = %78, %78, %78
  call void @ins()
  br label %252

89:                                               ; preds = %78, %78, %78, %78, %78, %78, %78, %78, %78, %78
  br i1 %72, label %91, label %90

90:                                               ; preds = %89
  call void @num()
  br label %.backedge.backedge

.backedge.backedge:                               ; preds = %90, %148, %252, %45
  br label %.backedge

91:                                               ; preds = %89
  call void @ins()
  br label %252

92:                                               ; preds = %78
  call void @cpu_printflags() #5
  br label %252

93:                                               ; preds = %78
  %94 = call i32 @endword(ptr noundef nonnull %3)
  %.not46 = icmp eq i32 %94, 0
  br i1 %.not46, label %95, label %98

95:                                               ; preds = %93
  %96 = load i32, ptr @starta, align 4, !tbaa !8
  %97 = zext i32 %96 to i64
  store i64 %97, ptr %3, align 8, !tbaa !10
  br label %98

98:                                               ; preds = %95, %93
  %99 = load i32, ptr @flags, align 4, !tbaa !8
  %100 = and i32 %99, 2
  %.not47 = icmp eq i32 %100, 0
  br i1 %.not47, label %104, label %101

101:                                              ; preds = %98
  %102 = load i64, ptr %3, align 8, !tbaa !10
  %103 = trunc i64 %102 to i32
  store i32 %103, ptr @starta, align 4, !tbaa !8
  br label %104

104:                                              ; preds = %101, %98
  %105 = load i32, ptr @hasnum, align 4, !tbaa !8
  %106 = icmp ne i32 %105, 0
  %107 = load i64, ptr @number, align 8
  %108 = icmp eq i64 %107, 0
  %or.cond18 = select i1 %106, i1 %108, i1 false
  %109 = load i64, ptr %3, align 8, !tbaa !10
  %110 = trunc i64 %109 to i32
  br i1 %or.cond18, label %111, label %112

111:                                              ; preds = %104
  call void @cpu_setpc(i32 noundef %110) #5
  br label %113

112:                                              ; preds = %104
  call void @cpu_start(i32 noundef %110) #5
  br label %113

113:                                              ; preds = %112, %111
  store i32 1, ptr @started, align 4, !tbaa !8
  br label %252

114:                                              ; preds = %78
  %115 = call i32 @endword(ptr noundef nonnull %3)
  %.not44 = icmp eq i32 %115, 0
  br i1 %.not44, label %116, label %._crit_edge51

._crit_edge51:                                    ; preds = %114
  %.pre50.pre = load i64, ptr %3, align 8, !tbaa !10
  br label %119

116:                                              ; preds = %114
  %117 = load i32, ptr @starta, align 4, !tbaa !8
  %118 = zext i32 %117 to i64
  store i64 %118, ptr %3, align 8, !tbaa !10
  br label %119

119:                                              ; preds = %._crit_edge51, %116
  %.pre50 = phi i64 [ %.pre50.pre, %._crit_edge51 ], [ %118, %116 ]
  %120 = load i32, ptr @flags, align 4, !tbaa !8
  %121 = and i32 %120, 2
  %.not45 = icmp eq i32 %121, 0
  %.pre54 = trunc i64 %.pre50 to i32
  br i1 %.not45, label %._crit_edge53, label %122

122:                                              ; preds = %119
  store i32 %.pre54, ptr @starta, align 4, !tbaa !8
  br label %._crit_edge53

._crit_edge53:                                    ; preds = %119, %122
  call void @cpu_readin(i32 noundef %.pre54) #5
  store i32 1, ptr @started, align 4, !tbaa !8
  br label %252

123:                                              ; preds = %78
  store i32 0, ptr @nbuf, align 4, !tbaa !8
  br i1 %72, label %125, label %124

124:                                              ; preds = %123
  call void @cpu_stopmem() #5
  br label %252

125:                                              ; preds = %123
  call void @cpu_stopinst() #5
  br label %252

126:                                              ; preds = %78
  %127 = call i32 @endword(ptr noundef nonnull %3)
  call void @cpu_cont() #5
  store i32 1, ptr @started, align 4, !tbaa !8
  br label %252

128:                                              ; preds = %78
  %129 = call i32 @endword(ptr noundef nonnull %3)
  %130 = load i32, ptr @flags, align 4, !tbaa !8
  %131 = and i32 %130, 1
  %.not42 = icmp eq i32 %131, 0
  br i1 %.not42, label %133, label %132

132:                                              ; preds = %128
  call void @cpu_nextmem() #5
  br label %134

133:                                              ; preds = %128
  call void @cpu_nextinst() #5
  br label %134

134:                                              ; preds = %133, %132
  store i32 1, ptr @started, align 4, !tbaa !8
  br label %252

135:                                              ; preds = %78
  %136 = call i32 @endword(ptr noundef nonnull %3)
  %.not41 = icmp eq i32 %136, 0
  br i1 %.not41, label %137, label %._crit_edge

._crit_edge:                                      ; preds = %135
  %.pre = load i64, ptr %3, align 8, !tbaa !10
  br label %139

137:                                              ; preds = %135
  %138 = load i64, ptr @q, align 8, !tbaa !10
  store i64 %138, ptr %3, align 8, !tbaa !10
  br label %139

139:                                              ; preds = %._crit_edge, %137
  %140 = phi i64 [ %.pre, %._crit_edge ], [ %138, %137 ]
  call void @cpu_exec(i64 noundef %140) #5
  call void @typestrnl(ptr noundef nonnull @.str.39)
  br label %252

141:                                              ; preds = %78
  store i32 0, ptr @nbuf, align 4, !tbaa !8
  call void @cpu_ioreset() #5
  br label %252

142:                                              ; preds = %78
  %143 = load i64, ptr @q, align 8, !tbaa !10
  call void @combine(i64 noundef %143)
  br label %252

144:                                              ; preds = %78
  %145 = and i32 %70, 2
  %.not40 = icmp eq i32 %145, 0
  br i1 %.not40, label %147, label %146

146:                                              ; preds = %144
  call void @zerocore()
  br label %252

147:                                              ; preds = %144
  call void @err(ptr noundef nonnull @.str.47)
  br label %252

148:                                              ; preds = %78
  %149 = shl nuw nsw i32 %71, 1
  %spec.select = or i32 %70, %149
  %150 = or i32 %spec.select, 1
  store i32 %150, ptr @flags, align 4, !tbaa !8
  br label %.backedge.backedge

151:                                              ; preds = %78, %78, %78, %78
  %152 = call i32 @parse(ptr noundef nonnull %3)
  %.not38 = icmp eq i32 %152, 0
  br i1 %.not38, label %153, label %157

153:                                              ; preds = %151
  %154 = load i8, ptr @ch, align 1, !tbaa !5
  %155 = icmp eq i8 %154, 45
  br i1 %155, label %156, label %252

156:                                              ; preds = %153
  store i32 45, ptr getelementptr inbounds (i8, ptr @as, i64 48), align 8, !tbaa !14
  br label %252

157:                                              ; preds = %151
  %158 = load i64, ptr %3, align 8, !tbaa !10
  call void @combine(i64 noundef %158)
  %159 = load i8, ptr @ch, align 1, !tbaa !5
  %160 = sext i8 %159 to i32
  store i32 %160, ptr getelementptr inbounds (i8, ptr @as, i64 48), align 8, !tbaa !14
  br label %252

161:                                              ; preds = %78
  %162 = call i32 @parse(ptr noundef nonnull %3)
  %.not37 = icmp eq i32 %162, 0
  br i1 %.not37, label %165, label %163

163:                                              ; preds = %161
  %164 = load i64, ptr %3, align 8, !tbaa !10
  call void @combine(i64 noundef %164)
  br label %165

165:                                              ; preds = %163, %161
  call void @pushexp()
  br label %252

166:                                              ; preds = %78
  store i64 0, ptr %3, align 8, !tbaa !10
  %167 = call i32 @endword(ptr noundef nonnull %3)
  call void @popexp()
  %168 = load i32, ptr getelementptr inbounds (i8, ptr @as, i64 48), align 8, !tbaa !14
  %169 = icmp eq i32 %168, 0
  %170 = load i64, ptr %3, align 8, !tbaa !10
  br i1 %169, label %171, label %179

171:                                              ; preds = %166
  %172 = lshr i64 %170, 18
  %173 = and i64 %172, 262143
  %174 = shl i64 %170, 18
  %175 = and i64 %174, 68719214592
  %176 = or disjoint i64 %173, %175
  store i64 %176, ptr %3, align 8, !tbaa !10
  %177 = load i64, ptr @as, align 8, !tbaa !10
  %178 = add i64 %176, %177
  store i64 %178, ptr @as, align 8, !tbaa !10
  store i32 1, ptr getelementptr inbounds (i8, ptr @as, i64 52), align 4, !tbaa !16
  br label %180

179:                                              ; preds = %166
  call void @combine(i64 noundef %170)
  br label %180

180:                                              ; preds = %179, %171
  store i32 0, ptr getelementptr inbounds (i8, ptr @as, i64 48), align 8, !tbaa !14
  br label %252

181:                                              ; preds = %78
  %182 = call i32 @parse(ptr noundef nonnull %3)
  %.not34 = icmp eq i32 %182, 0
  br i1 %.not34, label %252, label %183

183:                                              ; preds = %181
  %184 = load i64, ptr %3, align 8, !tbaa !10
  call void @combine(i64 noundef %184)
  %185 = load i32, ptr getelementptr inbounds (i8, ptr @as, i64 32), align 8, !tbaa !17
  %186 = and i32 %185, 8
  %.not35 = icmp eq i32 %186, 0
  %187 = load i64, ptr getelementptr inbounds (i8, ptr @as, i64 40), align 8, !tbaa !18
  %as. = select i1 %.not35, ptr @as, ptr getelementptr inbounds (i8, ptr @as, i64 24)
  %. = select i1 %.not35, i32 8, i32 1
  %188 = load i64, ptr %as., align 8, !tbaa !10
  %189 = add i64 %188, %187
  store i64 %189, ptr %as., align 8, !tbaa !10
  %190 = or i32 %185, %.
  store i32 %190, ptr getelementptr inbounds (i8, ptr @as, i64 32), align 8, !tbaa !17
  store i64 0, ptr getelementptr inbounds (i8, ptr @as, i64 40), align 8, !tbaa !18
  br label %252

191:                                              ; preds = %78
  %192 = call i32 @parse(ptr noundef nonnull %3)
  %.not31 = icmp eq i32 %192, 0
  br i1 %.not31, label %252, label %193

193:                                              ; preds = %191
  %194 = load i64, ptr %3, align 8, !tbaa !10
  call void @combine(i64 noundef %194)
  %195 = load i32, ptr getelementptr inbounds (i8, ptr @as, i64 32), align 8, !tbaa !17
  %196 = and i32 %195, 4
  %.not32 = icmp eq i32 %196, 0
  %197 = load i64, ptr getelementptr inbounds (i8, ptr @as, i64 40), align 8, !tbaa !18
  %.63 = select i1 %.not32, ptr getelementptr inbounds (i8, ptr @as, i64 8), ptr getelementptr inbounds (i8, ptr @as, i64 24)
  %.64 = select i1 %.not32, i32 4, i32 1
  %198 = load i64, ptr %.63, align 8, !tbaa !10
  %199 = add i64 %198, %197
  store i64 %199, ptr %.63, align 8, !tbaa !10
  %200 = or i32 %195, %.64
  store i32 %200, ptr getelementptr inbounds (i8, ptr @as, i64 32), align 8, !tbaa !17
  store i64 0, ptr getelementptr inbounds (i8, ptr @as, i64 40), align 8, !tbaa !18
  br label %252

201:                                              ; preds = %78
  %202 = load i64, ptr getelementptr inbounds (i8, ptr @as, i64 16), align 8, !tbaa !10
  %203 = add i64 %202, 4194304
  store i64 %203, ptr getelementptr inbounds (i8, ptr @as, i64 16), align 8, !tbaa !10
  %204 = load i32, ptr getelementptr inbounds (i8, ptr @as, i64 32), align 8, !tbaa !17
  %205 = or i32 %204, 2
  store i32 %205, ptr getelementptr inbounds (i8, ptr @as, i64 32), align 8, !tbaa !17
  store i32 1, ptr getelementptr inbounds (i8, ptr @as, i64 52), align 4, !tbaa !16
  br label %252

206:                                              ; preds = %78
  call void @aclose(i32 noundef 0)
  %207 = load i32, ptr @addr, align 4, !tbaa !8
  store i32 %207, ptr @dot, align 4, !tbaa !8
  %208 = load i32, ptr @curmode, align 4, !tbaa !8
  call void @aopen(i32 noundef %208)
  br label %252

209:                                              ; preds = %78
  call void @aclose(i32 noundef 0)
  %210 = load i32, ptr @curmode, align 4, !tbaa !8
  call void @aopen(i32 noundef %210)
  br label %252

211:                                              ; preds = %78
  br i1 %72, label %213, label %212

212:                                              ; preds = %211
  call void @tyo(i8 noundef signext 32)
  store i32 4, ptr @linemode, align 4, !tbaa !8
  store i32 0, ptr @nbuf, align 4, !tbaa !8
  br label %252

213:                                              ; preds = %211
  call void @aclose(i32 noundef 0)
  %214 = load i32, ptr @addr, align 4, !tbaa !8
  store i32 %214, ptr @dot, align 4, !tbaa !8
  call void @aopen(i32 noundef 1)
  br label %252

215:                                              ; preds = %78
  br i1 %72, label %217, label %216

216:                                              ; preds = %215
  call void @tyo(i8 noundef signext 32)
  store i32 5, ptr @linemode, align 4, !tbaa !8
  store i32 0, ptr @nbuf, align 4, !tbaa !8
  br label %252

217:                                              ; preds = %215
  call void @aclose(i32 noundef 0)
  %218 = load i32, ptr @addr, align 4, !tbaa !8
  store i32 %218, ptr @dot, align 4, !tbaa !8
  call void @aopen(i32 noundef 3)
  br label %252

219:                                              ; preds = %78
  call void @aclose(i32 noundef 0)
  %220 = load i32, ptr @addr, align 4, !tbaa !8
  store i32 %220, ptr @dot, align 4, !tbaa !8
  call void @aopen(i32 noundef 0)
  br label %252

221:                                              ; preds = %78
  call void @typestrnl(ptr noundef nonnull @.str.39)
  call void @aclose(i32 noundef 1)
  %222 = load i32, ptr @addr, align 4, !tbaa !8
  store i32 %222, ptr @dot, align 4, !tbaa !8
  call void @propen(i32 noundef %222)
  %223 = load i32, ptr @curmode, align 4, !tbaa !8
  call void @aopen(i32 noundef %223)
  br label %252

224:                                              ; preds = %78
  call void @typestrnl(ptr noundef nonnull @.str.39)
  call void @aclose(i32 noundef 1)
  %225 = load i32, ptr @dot, align 4, !tbaa !8
  %226 = add i32 %225, 1048575
  %227 = and i32 %226, 1048575
  store i32 %227, ptr @dot, align 4, !tbaa !8
  store i32 %227, ptr @addr, align 4, !tbaa !8
  call void @propen(i32 noundef %227)
  %228 = load i32, ptr @curmode, align 4, !tbaa !8
  call void @aopen(i32 noundef %228)
  br label %252

229:                                              ; preds = %78
  call void @tyo(i8 noundef signext 13)
  call void @aclose(i32 noundef 1)
  %230 = load i32, ptr @dot, align 4, !tbaa !8
  %231 = add i32 %230, 1
  %232 = and i32 %231, 1048575
  store i32 %232, ptr @dot, align 4, !tbaa !8
  store i32 %232, ptr @addr, align 4, !tbaa !8
  call void @propen(i32 noundef %232)
  %233 = load i32, ptr @curmode, align 4, !tbaa !8
  call void @aopen(i32 noundef %233)
  br label %252

234:                                              ; preds = %78
  call void @tyo(i8 noundef signext 10)
  call void @aclose(i32 noundef 1)
  %235 = load i32, ptr @permmode, align 4, !tbaa !8
  store i32 %235, ptr @curmode, align 4, !tbaa !8
  br label %252

236:                                              ; preds = %78
  call void @typeout(i32 noundef 3)
  br label %252

237:                                              ; preds = %78
  call void @typeout(i32 noundef 1)
  br label %252

238:                                              ; preds = %78
  call void @typeout(i32 noundef 7)
  br label %252

239:                                              ; preds = %78
  br i1 %72, label %241, label %240

240:                                              ; preds = %239
  call void @modechange(i32 noundef 4)
  br label %252

241:                                              ; preds = %239
  call void @typeout(i32 noundef 4)
  br label %252

242:                                              ; preds = %78
  br i1 %72, label %244, label %243

243:                                              ; preds = %242
  call void @modechange(i32 noundef 5)
  br label %252

244:                                              ; preds = %242
  call void @typeout(i32 noundef 5)
  br label %252

245:                                              ; preds = %78
  br i1 %72, label %247, label %246

246:                                              ; preds = %245
  call void @modechange(i32 noundef 6)
  br label %252

247:                                              ; preds = %245
  call void @typeout(i32 noundef 6)
  br label %252

248:                                              ; preds = %78
  call void @modechange(i32 noundef 3)
  br label %252

249:                                              ; preds = %78
  call void @modechange(i32 noundef 1)
  br label %252

250:                                              ; preds = %78
  call void @modechange(i32 noundef 2)
  br label %252

251:                                              ; preds = %78
  call void @err(ptr noundef nonnull @.str.47)
  br label %252

252:                                              ; preds = %60, %68, %67, %80, %81, %82, %83, %87, %88, %91, %92, %113, %._crit_edge53, %126, %134, %139, %141, %142, %157, %165, %180, %183, %193, %201, %206, %209, %212, %213, %216, %217, %219, %221, %224, %229, %234, %236, %237, %238, %248, %249, %250, %251, %125, %124, %147, %146, %156, %153, %181, %191, %241, %240, %244, %243, %247, %246, %77, %54
  store i32 0, ptr @flags, align 4, !tbaa !8
  store i64 0, ptr @number, align 8, !tbaa !10
  store i32 0, ptr @hasnum, align 4, !tbaa !8
  br label %.backedge.backedge

253:                                              ; preds = %61
  call void @quit()
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  ret i32 0
}

declare void @init6() local_unnamed_addr #2

declare void @initcrt(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #3

declare i32 @hasinput(i32 noundef) local_unnamed_addr #2

declare i32 @isrunning() local_unnamed_addr #2

declare i32 @isstopped() local_unnamed_addr #2

declare void @fe_svc() local_unnamed_addr #2

declare i32 @usleep(i32 noundef) local_unnamed_addr #2

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

declare void @cpu_printflags() local_unnamed_addr #2

declare void @cpu_setpc(i32 noundef) local_unnamed_addr #2

declare void @cpu_start(i32 noundef) local_unnamed_addr #2

declare void @cpu_readin(i32 noundef) local_unnamed_addr #2

declare void @cpu_stopmem() local_unnamed_addr #2

declare void @cpu_stopinst() local_unnamed_addr #2

declare void @cpu_cont() local_unnamed_addr #2

declare void @cpu_nextmem() local_unnamed_addr #2

declare void @cpu_nextinst() local_unnamed_addr #2

declare void @cpu_exec(i64 noundef) local_unnamed_addr #2

declare void @cpu_ioreset() local_unnamed_addr #2

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind returns_twice "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 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 #5 = { nounwind }
attributes #6 = { nounwind returns_twice }
attributes #7 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !6, i64 0}
!14 = !{!15, !9, i64 48}
!15 = !{!"Assembler", !6, i64 0, !9, i64 32, !11, i64 40, !9, i64 48, !9, i64 52}
!16 = !{!15, !9, i64 52}
!17 = !{!15, !9, i64 32}
!18 = !{!15, !11, i64 40}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass