; LLVM IR from aap/pdp6 :: tools (as6)

; 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.Sym = type { i64, i32, %union.anon, ptr }
%union.anon = type { %struct.Value }
%struct.Value = type { i64, i32 }
%struct.Additive = type { i32, %struct.Value, ptr }

@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@lstfp = external dso_local global ptr, align 8
@dot = external dso_local global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@symtab = external dso_local global [4000 x %struct.Sym], align 16
@.str.57 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [4 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; 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
declare dso_local void @putword(i64 noundef, i32 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @startitem(i32 noundef) #2

declare i64 @fw(i32 noundef, i32 noundef) #3

declare i32 @right(i64 noundef) #3

declare i32 @left(i64 noundef) #3

declare void @unsixbit(i64 noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @symcmp(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @writesymtab() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca [8 x i8], align 1
  %4 = alloca ptr, align 8
  %5 = alloca [4000 x ptr], align 16
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 32000, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  store ptr @symtab, ptr %4, align 8, !tbaa !9
  br label %11

11:                                               ; preds = %45, %0
  %12 = load ptr, ptr %4, align 8, !tbaa !9
  %13 = icmp ult ptr %12, getelementptr inbounds ([4000 x %struct.Sym], ptr @symtab, i64 0, i64 4000)
  br i1 %13, label %14, label %48

14:                                               ; preds = %11
  %15 = load ptr, ptr %4, align 8, !tbaa !9
  %16 = getelementptr inbounds %struct.Sym, ptr %15, i32 0, i32 0
  %17 = load i64, ptr %16, align 8, !tbaa !11
  %18 = icmp eq i64 %17, 0
  br i1 %18, label %38, label %19

19:                                               ; preds = %14
  %20 = load ptr, ptr %4, align 8, !tbaa !9
  %21 = load ptr, ptr @dot, align 8, !tbaa !9
  %22 = icmp eq ptr %20, %21
  br i1 %22, label %38, label %23

23:                                               ; preds = %19
  %24 = load ptr, ptr %4, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.Sym, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 8, !tbaa !14
  %27 = icmp eq i32 %26, 64
  br i1 %27, label %38, label %28

28:                                               ; preds = %23
  %29 = load ptr, ptr %4, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.Sym, ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 8, !tbaa !14
  %32 = icmp eq i32 %31, 65
  br i1 %32, label %38, label %33

33:                                               ; preds = %28
  %34 = load ptr, ptr %4, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.Sym, ptr %34, i32 0, i32 1
  %36 = load i32, ptr %35, align 8, !tbaa !14
  %37 = icmp eq i32 %36, 66
  br i1 %37, label %38, label %39

38:                                               ; preds = %33, %28, %23, %19, %14
  br label %45

39:                                               ; preds = %33
  %40 = load ptr, ptr %4, align 8, !tbaa !9
  %41 = load i32, ptr %9, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %9, align 4, !tbaa !5
  %43 = sext i32 %41 to i64
  %44 = getelementptr inbounds [4000 x ptr], ptr %5, i64 0, i64 %43
  store ptr %40, ptr %44, align 8, !tbaa !9
  br label %45

45:                                               ; preds = %39, %38
  %46 = load ptr, ptr %4, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.Sym, ptr %46, i32 1
  store ptr %47, ptr %4, align 8, !tbaa !9
  br label %11, !llvm.loop !15

48:                                               ; preds = %11
  %49 = getelementptr inbounds [4000 x ptr], ptr %5, i64 0, i64 0
  %50 = load i32, ptr %9, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  call void @qsort(ptr noundef %49, i64 noundef %51, i64 noundef 8, ptr noundef @symcmp)
  call void @startitem(i32 noundef 2)
  %52 = load ptr, ptr @lstfp, align 8, !tbaa !9
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %52, ptr noundef @.str.57) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %214, %48
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = load i32, ptr %9, align 4, !tbaa !5
  %57 = icmp slt i32 %55, %56
  br i1 %57, label %58, label %217

58:                                               ; preds = %54
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [4000 x ptr], ptr %5, i64 0, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !9
  store ptr %62, ptr %4, align 8, !tbaa !9
  %63 = load ptr, ptr %4, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.Sym, ptr %63, i32 0, i32 1
  %65 = load i32, ptr %64, align 8, !tbaa !14
  %66 = and i32 %65, 4
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %68, label %81

68:                                               ; preds = %58
  %69 = load ptr, ptr %4, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.Sym, ptr %69, i32 0, i32 2
  %71 = getelementptr inbounds %struct.Value, ptr %70, i32 0, i32 0
  %72 = load i64, ptr %71, align 8, !tbaa !17
  %73 = icmp eq i64 %72, 0
  br i1 %73, label %74, label %81

74:                                               ; preds = %68
  %75 = load ptr, ptr %4, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.Sym, ptr %75, i32 0, i32 2
  %77 = getelementptr inbounds %struct.Value, ptr %76, i32 0, i32 1
  %78 = load i32, ptr %77, align 8, !tbaa !17
  %79 = icmp eq i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %74
  br label %214

81:                                               ; preds = %74, %68, %58
  store i32 0, ptr %10, align 4, !tbaa !5
  %82 = load ptr, ptr %4, align 8, !tbaa !9
  %83 = getelementptr inbounds %struct.Sym, ptr %82, i32 0, i32 1
  %84 = load i32, ptr %83, align 8, !tbaa !14
  %85 = and i32 %84, 2
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %81
  store i32 4, ptr %10, align 4, !tbaa !5
  br label %96

88:                                               ; preds = %81
  %89 = load ptr, ptr %4, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.Sym, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 8, !tbaa !14
  %92 = and i32 %91, 1
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %95

94:                                               ; preds = %88
  store i32 8, ptr %10, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %94, %88
  br label %96

96:                                               ; preds = %95, %87
  %97 = load ptr, ptr %4, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.Sym, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 8, !tbaa !14
  %100 = and i32 %99, 16
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %105

102:                                              ; preds = %96
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = or i32 %103, 32
  store i32 %104, ptr %10, align 4, !tbaa !5
  br label %105

105:                                              ; preds = %102, %96
  %106 = load ptr, ptr %4, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.Sym, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 8, !tbaa !14
  %109 = and i32 %108, 4
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %112

111:                                              ; preds = %105
  store i32 48, ptr %10, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %111, %105
  %113 = load ptr, ptr %4, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.Sym, ptr %113, i32 0, i32 0
  %115 = load i64, ptr %114, align 8, !tbaa !11
  %116 = getelementptr inbounds [8 x i8], ptr %3, i64 0, i64 0
  call void @unsixbit(i64 noundef %115, ptr noundef %116)
  %117 = load ptr, ptr %4, align 8, !tbaa !9
  %118 = getelementptr inbounds %struct.Sym, ptr %117, i32 0, i32 2
  %119 = getelementptr inbounds %struct.Value, ptr %118, i32 0, i32 0
  %120 = load i64, ptr %119, align 8, !tbaa !17
  %121 = call i32 @left(i64 noundef %120)
  store i32 %121, ptr %1, align 4, !tbaa !5
  %122 = load ptr, ptr %4, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.Sym, ptr %122, i32 0, i32 2
  %124 = getelementptr inbounds %struct.Value, ptr %123, i32 0, i32 0
  %125 = load i64, ptr %124, align 8, !tbaa !17
  %126 = call i32 @right(i64 noundef %125)
  store i32 %126, ptr %2, align 4, !tbaa !5
  %127 = load ptr, ptr @lstfp, align 8, !tbaa !9
  %128 = getelementptr inbounds [8 x i8], ptr %3, i64 0, i64 0
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.58, ptr noundef %128, ptr noundef @.str.6) #4
  %130 = load i32, ptr %1, align 4, !tbaa !5
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %136

132:                                              ; preds = %112
  %133 = load ptr, ptr @lstfp, align 8, !tbaa !9
  %134 = load i32, ptr %1, align 4, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.59, i32 noundef %134) #4
  br label %139

136:                                              ; preds = %112
  %137 = load ptr, ptr @lstfp, align 8, !tbaa !9
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %137, ptr noundef @.str.60, ptr noundef @.str.6) #4
  br label %139

139:                                              ; preds = %136, %132
  %140 = load ptr, ptr @lstfp, align 8, !tbaa !9
  %141 = load i32, ptr %2, align 4, !tbaa !5
  %142 = load ptr, ptr %4, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.Sym, ptr %142, i32 0, i32 2
  %144 = getelementptr inbounds %struct.Value, ptr %143, i32 0, i32 1
  %145 = load i32, ptr %144, align 8, !tbaa !17
  %146 = icmp ne i32 %145, 0
  %147 = zext i1 %146 to i64
  %148 = select i1 %146, i32 39, i32 32
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %140, ptr noundef @.str.61, i32 noundef %141, i32 noundef %148) #4
  %150 = load ptr, ptr %4, align 8, !tbaa !9
  %151 = getelementptr inbounds %struct.Sym, ptr %150, i32 0, i32 1
  %152 = load i32, ptr %151, align 8, !tbaa !14
  %153 = and i32 %152, 4
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %158

155:                                              ; preds = %139
  %156 = load ptr, ptr @lstfp, align 8, !tbaa !9
  %157 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.62) #4
  br label %158

158:                                              ; preds = %155, %139
  %159 = load ptr, ptr %4, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.Sym, ptr %159, i32 0, i32 1
  %161 = load i32, ptr %160, align 8, !tbaa !14
  %162 = and i32 %161, 2
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %167

164:                                              ; preds = %158
  %165 = load ptr, ptr @lstfp, align 8, !tbaa !9
  %166 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef @.str.63) #4
  br label %167

167:                                              ; preds = %164, %158
  %168 = load ptr, ptr @lstfp, align 8, !tbaa !9
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %168, ptr noundef @.str.1) #4
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = getelementptr inbounds [8 x i8], ptr %3, i64 0, i64 0
  %172 = call i64 @rad50(i32 noundef %170, ptr noundef %171)
  store i64 %172, ptr %7, align 8, !tbaa !18
  %173 = load i64, ptr %7, align 8, !tbaa !18
  call void @putword(i64 noundef %173, i32 noundef 0)
  %174 = load ptr, ptr %4, align 8, !tbaa !9
  %175 = getelementptr inbounds %struct.Sym, ptr %174, i32 0, i32 2
  %176 = getelementptr inbounds %struct.Value, ptr %175, i32 0, i32 0
  %177 = load i64, ptr %176, align 8, !tbaa !17
  %178 = call i32 @right(i64 noundef %177)
  %179 = call i64 @fw(i32 noundef 0, i32 noundef %178)
  %180 = load ptr, ptr %4, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.Sym, ptr %180, i32 0, i32 2
  %182 = getelementptr inbounds %struct.Value, ptr %181, i32 0, i32 1
  %183 = load i32, ptr %182, align 8, !tbaa !17
  call void @putword(i64 noundef %179, i32 noundef %183)
  %184 = load ptr, ptr %4, align 8, !tbaa !9
  %185 = getelementptr inbounds %struct.Sym, ptr %184, i32 0, i32 3
  %186 = load ptr, ptr %185, align 8, !tbaa !19
  store ptr %186, ptr %6, align 8, !tbaa !9
  br label %187

187:                                              ; preds = %209, %167
  %188 = load ptr, ptr %6, align 8, !tbaa !9
  %189 = icmp ne ptr %188, null
  br i1 %189, label %190, label %213

190:                                              ; preds = %187
  %191 = load i64, ptr %7, align 8, !tbaa !18
  call void @putword(i64 noundef %191, i32 noundef 0)
  %192 = load ptr, ptr %6, align 8, !tbaa !9
  %193 = getelementptr inbounds %struct.Additive, ptr %192, i32 0, i32 0
  %194 = load i32, ptr %193, align 8, !tbaa !20
  %195 = icmp ne i32 %194, 0
  %196 = zext i1 %195 to i64
  %197 = select i1 %195, i32 65536, i32 0
  %198 = or i32 131072, %197
  %199 = load ptr, ptr %6, align 8, !tbaa !9
  %200 = getelementptr inbounds %struct.Additive, ptr %199, i32 0, i32 1
  %201 = getelementptr inbounds %struct.Value, ptr %200, i32 0, i32 0
  %202 = load i64, ptr %201, align 8, !tbaa !23
  %203 = call i32 @right(i64 noundef %202)
  %204 = call i64 @fw(i32 noundef %198, i32 noundef %203)
  %205 = load ptr, ptr %6, align 8, !tbaa !9
  %206 = getelementptr inbounds %struct.Additive, ptr %205, i32 0, i32 1
  %207 = getelementptr inbounds %struct.Value, ptr %206, i32 0, i32 1
  %208 = load i32, ptr %207, align 8, !tbaa !24
  call void @putword(i64 noundef %204, i32 noundef %208)
  br label %209

209:                                              ; preds = %190
  %210 = load ptr, ptr %6, align 8, !tbaa !9
  %211 = getelementptr inbounds %struct.Additive, ptr %210, i32 0, i32 2
  %212 = load ptr, ptr %211, align 8, !tbaa !25
  store ptr %212, ptr %6, align 8, !tbaa !9
  br label %187, !llvm.loop !26

213:                                              ; preds = %187
  br label %214

214:                                              ; preds = %213, %80
  %215 = load i32, ptr %8, align 4, !tbaa !5
  %216 = add nsw i32 %215, 1
  store i32 %216, ptr %8, align 4, !tbaa !5
  br label %54, !llvm.loop !27

217:                                              ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 32000, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void
}

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

declare i64 @rad50(i32 noundef, ptr noundef) #3

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

!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 = !{!12, !13, i64 0}
!12 = !{!"Sym", !13, i64 0, !6, i64 8, !7, i64 16, !10, i64 32}
!13 = !{!"long", !7, i64 0}
!14 = !{!12, !6, i64 8}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !10, i64 32}
!20 = !{!21, !6, i64 0}
!21 = !{!"Additive", !6, i64 0, !22, i64 8, !10, i64 24}
!22 = !{!"Value", !13, i64 0, !6, i64 8}
!23 = !{!21, !13, i64 8}
!24 = !{!21, !6, i64 16}
!25 = !{!21, !10, i64 24}
!26 = distinct !{!26, !16}
!27 = distinct !{!27, !16}


; 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.Sym = type { i64, i32, %union.anon, ptr }
%union.anon = type { %struct.Value }
%struct.Value = type { i64, i32 }

@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@lstfp = external dso_local local_unnamed_addr global ptr, align 8
@dot = external dso_local local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@symtab = external dso_local global [4000 x %struct.Sym], align 16
@.str.57 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [4 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

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

; 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
declare dso_local void @putword(i64 noundef, i32 noundef) local_unnamed_addr #2

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

declare i64 @fw(i32 noundef, i32 noundef) local_unnamed_addr #3

declare i32 @right(i64 noundef) local_unnamed_addr #3

declare i32 @left(i64 noundef) local_unnamed_addr #3

declare void @unsixbit(i64 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local i32 @symcmp(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @writesymtab() local_unnamed_addr #2 {
  %1 = alloca [8 x i8], align 1
  %2 = alloca [4000 x ptr], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 32000, ptr nonnull %2) #5
  %3 = load ptr, ptr @dot, align 8
  br label %4

4:                                                ; preds = %0, %15
  %.04161 = phi i32 [ 0, %0 ], [ %.142, %15 ]
  %.044.idx60 = phi i64 [ 0, %0 ], [ %.044.add, %15 ]
  %.044.ptr62 = getelementptr inbounds i8, ptr @symtab, i64 %.044.idx60
  %5 = load i64, ptr %.044.ptr62, align 8, !tbaa !5
  %6 = icmp eq i64 %5, 0
  %7 = icmp eq ptr %.044.ptr62, %3
  %or.cond = select i1 %6, i1 true, i1 %7
  br i1 %or.cond, label %15, label %8

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %.044.ptr62, i64 8
  %10 = load i32, ptr %9, align 8, !tbaa !12
  %.off = add i32 %10, -64
  %switch = icmp ult i32 %.off, 3
  br i1 %switch, label %15, label %11

11:                                               ; preds = %8
  %12 = add nsw i32 %.04161, 1
  %13 = sext i32 %.04161 to i64
  %14 = getelementptr inbounds [4000 x ptr], ptr %2, i64 0, i64 %13
  store ptr %.044.ptr62, ptr %14, align 8, !tbaa !13
  br label %15

15:                                               ; preds = %8, %4, %11
  %.142 = phi i32 [ %.04161, %4 ], [ %12, %11 ], [ %.04161, %8 ]
  %.044.add = add nuw nsw i64 %.044.idx60, 40
  %16 = icmp ult i64 %.044.idx60, 159960
  br i1 %16, label %4, label %17, !llvm.loop !14

17:                                               ; preds = %15
  %18 = sext i32 %.142 to i64
  call void @qsort(ptr noundef nonnull %2, i64 noundef %18, i64 noundef 8, ptr noundef nonnull @symcmp) #5
  call void @startitem(i32 noundef 2)
  %19 = load ptr, ptr @lstfp, align 8, !tbaa !13
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.57) #5
  %21 = icmp sgt i32 %.142, 0
  br i1 %21, label %.lr.ph67.preheader, label %._crit_edge

.lr.ph67.preheader:                               ; preds = %17
  %wide.trip.count = zext nneg i32 %.142 to i64
  br label %.lr.ph67

.lr.ph67:                                         ; preds = %.lr.ph67.preheader, %.loopexit
  %indvars.iv = phi i64 [ 0, %.lr.ph67.preheader ], [ %indvars.iv.next, %.loopexit ]
  %22 = getelementptr inbounds [4000 x ptr], ptr %2, i64 0, i64 %indvars.iv
  %23 = load ptr, ptr %22, align 8, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %23, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !12
  %26 = and i32 %25, 4
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %35, label %27

27:                                               ; preds = %.lr.ph67
  %28 = getelementptr inbounds i8, ptr %23, i64 16
  %29 = load i64, ptr %28, align 8, !tbaa !16
  %30 = icmp eq i64 %29, 0
  br i1 %30, label %31, label %35

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %23, i64 24
  %33 = load i32, ptr %32, align 8, !tbaa !16
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %.loopexit, label %35

35:                                               ; preds = %31, %27, %.lr.ph67
  %36 = and i32 %25, 2
  %.not48 = icmp eq i32 %36, 0
  %37 = shl i32 %25, 3
  %spec.select = and i32 %37, 8
  %.0 = select i1 %.not48, i32 %spec.select, i32 4
  %38 = shl i32 %25, 1
  %39 = and i32 %38, 32
  %spec.select59 = or disjoint i32 %.0, %39
  %.2 = select i1 %.not, i32 %spec.select59, i32 48
  %40 = load i64, ptr %23, align 8, !tbaa !5
  call void @unsixbit(i64 noundef %40, ptr noundef nonnull %1) #5
  %41 = getelementptr inbounds i8, ptr %23, i64 16
  %42 = load i64, ptr %41, align 8, !tbaa !16
  %43 = call i32 @left(i64 noundef %42) #5
  %44 = load i64, ptr %41, align 8, !tbaa !16
  %45 = call i32 @right(i64 noundef %44) #5
  %46 = load ptr, ptr @lstfp, align 8, !tbaa !13
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef nonnull @.str.58, ptr noundef nonnull %1, ptr noundef nonnull @.str.6) #5
  %.not52 = icmp eq i32 %43, 0
  %48 = load ptr, ptr @lstfp, align 8, !tbaa !13
  br i1 %.not52, label %51, label %49

49:                                               ; preds = %35
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.59, i32 noundef %43) #5
  br label %53

51:                                               ; preds = %35
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.60, ptr noundef nonnull @.str.6) #5
  br label %53

53:                                               ; preds = %51, %49
  %54 = load ptr, ptr @lstfp, align 8, !tbaa !13
  %55 = getelementptr inbounds i8, ptr %23, i64 24
  %56 = load i32, ptr %55, align 8, !tbaa !16
  %.not53 = icmp eq i32 %56, 0
  %57 = select i1 %.not53, i32 32, i32 39
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %54, ptr noundef nonnull @.str.61, i32 noundef %45, i32 noundef %57) #5
  %59 = load i32, ptr %24, align 8, !tbaa !12
  %60 = and i32 %59, 4
  %.not54 = icmp eq i32 %60, 0
  br i1 %.not54, label %64, label %61

61:                                               ; preds = %53
  %62 = load ptr, ptr @lstfp, align 8, !tbaa !13
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef nonnull @.str.62) #5
  %.pre = load i32, ptr %24, align 8, !tbaa !12
  br label %64

64:                                               ; preds = %61, %53
  %65 = phi i32 [ %.pre, %61 ], [ %59, %53 ]
  %66 = and i32 %65, 2
  %.not55 = icmp eq i32 %66, 0
  br i1 %.not55, label %70, label %67

67:                                               ; preds = %64
  %68 = load ptr, ptr @lstfp, align 8, !tbaa !13
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.63) #5
  br label %70

70:                                               ; preds = %67, %64
  %71 = load ptr, ptr @lstfp, align 8, !tbaa !13
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef nonnull @.str.1) #5
  %73 = call i64 @rad50(i32 noundef %.2, ptr noundef nonnull %1) #5
  call void @putword(i64 noundef %73, i32 noundef 0)
  %74 = load i64, ptr %41, align 8, !tbaa !16
  %75 = call i32 @right(i64 noundef %74) #5
  %76 = call i64 @fw(i32 noundef 0, i32 noundef %75) #5
  %77 = load i32, ptr %55, align 8, !tbaa !16
  call void @putword(i64 noundef %76, i32 noundef %77)
  %78 = getelementptr inbounds i8, ptr %23, i64 32
  %.04563 = load ptr, ptr %78, align 8, !tbaa !13
  %.not5664 = icmp eq ptr %.04563, null
  br i1 %.not5664, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %70, %.lr.ph
  %.04565 = phi ptr [ %.045, %.lr.ph ], [ %.04563, %70 ]
  call void @putword(i64 noundef %73, i32 noundef 0)
  %79 = load i32, ptr %.04565, align 8, !tbaa !17
  %.not57 = icmp eq i32 %79, 0
  %80 = select i1 %.not57, i32 131072, i32 196608
  %81 = getelementptr inbounds i8, ptr %.04565, i64 8
  %82 = load i64, ptr %81, align 8, !tbaa !20
  %83 = call i32 @right(i64 noundef %82) #5
  %84 = call i64 @fw(i32 noundef %80, i32 noundef %83) #5
  %85 = getelementptr inbounds i8, ptr %.04565, i64 16
  %86 = load i32, ptr %85, align 8, !tbaa !21
  call void @putword(i64 noundef %84, i32 noundef %86)
  %87 = getelementptr inbounds i8, ptr %.04565, i64 24
  %.045 = load ptr, ptr %87, align 8, !tbaa !13
  %.not56 = icmp eq ptr %.045, null
  br i1 %.not56, label %.loopexit, label %.lr.ph, !llvm.loop !22

.loopexit:                                        ; preds = %.lr.ph, %70, %31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph67, !llvm.loop !23

._crit_edge:                                      ; preds = %.loopexit, %17
  call void @llvm.lifetime.end.p0(i64 32000, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #5
  ret void
}

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

declare i64 @rad50(i32 noundef, ptr noundef) local_unnamed_addr #3

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

!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 = !{!"Sym", !7, i64 0, !10, i64 8, !8, i64 16, !11, i64 32}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !10, i64 8}
!13 = !{!11, !11, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!8, !8, i64 0}
!17 = !{!18, !10, i64 0}
!18 = !{!"Additive", !10, i64 0, !19, i64 8, !11, i64 24}
!19 = !{!"Value", !7, i64 0, !10, i64 8}
!20 = !{!18, !7, i64 8}
!21 = !{!18, !10, i64 16}
!22 = distinct !{!22, !15}
!23 = distinct !{!23, !15}


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