; LLVM IR from freakout42/macrocalc :: mc/mex (files)

; 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.BUFFER = type { ptr, ptr, i32, ptr, i32, ptr, i32, i32, [128 x i8], [128 x i8] }
%struct.WINDOW = type { ptr, ptr, ptr, ptr, i32, ptr, i32, i32, i32, i32, i32, i32 }

@curbp = external global ptr, align 8
@oldbp = external global ptr, align 8
@curwp = external global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@bheadp = external global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @cpyfname(ptr noundef, ptr 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 i32 @choosefile(ptr noundef, ptr noundef, i32 noundef) #0

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

declare void @mlwrite(ptr noundef, ...) #2

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

declare i32 @ctrlg(...) #2

declare i32 @bclear(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @filevisit(i32 noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca [128 x i8], align 16
  %8 = alloca [128 x i8], align 16
  %9 = alloca [128 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %16 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 0
  %17 = call i32 @choosefile(ptr noundef @.str.19, ptr noundef %16, i32 noundef 0)
  %18 = icmp ne i32 %17, 1
  br i1 %18, label %19, label %21

19:                                               ; preds = %2
  %20 = call i32 (...) @ctrlg()
  store i32 %20, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %131

21:                                               ; preds = %2
  store i32 0, ptr %11, align 4, !tbaa !5
  %22 = load ptr, ptr @bheadp, align 8, !tbaa !9
  store ptr %22, ptr %6, align 8, !tbaa !9
  br label %23

23:                                               ; preds = %41, %21
  %24 = load ptr, ptr %6, align 8, !tbaa !9
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %45

26:                                               ; preds = %23
  %27 = load ptr, ptr %6, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct.BUFFER, ptr %27, i32 0, i32 7
  %29 = load i32, ptr %28, align 4, !tbaa !11
  %30 = and i32 %29, 1
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %40

32:                                               ; preds = %26
  %33 = load ptr, ptr %6, align 8, !tbaa !9
  %34 = getelementptr inbounds %struct.BUFFER, ptr %33, i32 0, i32 8
  %35 = getelementptr inbounds [128 x i8], ptr %34, i64 0, i64 0
  %36 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 0
  %37 = call i32 @strcmp(ptr noundef %35, ptr noundef %36) #6
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %32
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %45

40:                                               ; preds = %32, %26
  br label %41

41:                                               ; preds = %40
  %42 = load ptr, ptr %6, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct.BUFFER, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  store ptr %44, ptr %6, align 8, !tbaa !9
  br label %23, !llvm.loop !14

45:                                               ; preds = %39, %23
  %46 = load i32, ptr %11, align 4, !tbaa !5
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %45
  br label %92

49:                                               ; preds = %45
  %50 = getelementptr inbounds [128 x i8], ptr %8, i64 0, i64 0
  %51 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 0
  call void @makename(ptr noundef %50, ptr noundef %51)
  br label %52

52:                                               ; preds = %82, %49
  %53 = getelementptr inbounds [128 x i8], ptr %8, i64 0, i64 0
  %54 = call ptr (ptr, i32, i32, ...) @bfind(ptr noundef %53, i32 noundef 0, i32 noundef 0)
  store ptr %54, ptr %6, align 8, !tbaa !9
  %55 = icmp ne ptr %54, null
  br i1 %55, label %56, label %83

56:                                               ; preds = %52
  store ptr @.str.20, ptr %12, align 8, !tbaa !9
  %57 = getelementptr inbounds [128 x i8], ptr %9, i64 0, i64 0
  %58 = getelementptr inbounds [128 x i8], ptr %8, i64 0, i64 0
  %59 = call ptr @strcpy(ptr noundef %57, ptr noundef %58) #5
  %60 = load ptr, ptr %12, align 8, !tbaa !9
  %61 = getelementptr inbounds [128 x i8], ptr %9, i64 0, i64 0
  %62 = getelementptr inbounds [128 x i8], ptr %8, i64 0, i64 0
  %63 = call i32 @mlreply(ptr noundef %60, ptr noundef %61, ptr noundef %62, i32 noundef 128, i32 noundef 0)
  store i32 %63, ptr %10, align 4, !tbaa !5
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = icmp ne i32 %64, 1
  br i1 %65, label %66, label %71

66:                                               ; preds = %56
  %67 = load i32, ptr %10, align 4, !tbaa !5
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %71

69:                                               ; preds = %66
  %70 = call i32 (...) @ctrlg()
  store i32 %70, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %131

71:                                               ; preds = %66, %56
  %72 = getelementptr inbounds [128 x i8], ptr %8, i64 0, i64 0
  %73 = getelementptr inbounds [128 x i8], ptr %9, i64 0, i64 0
  %74 = call i32 @strcmp(ptr noundef %72, ptr noundef %73) #6
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %82

76:                                               ; preds = %71
  %77 = load ptr, ptr %6, align 8, !tbaa !9
  %78 = call i32 @bclear(ptr noundef %77)
  %79 = icmp ne i32 %78, 1
  br i1 %79, label %80, label %81

80:                                               ; preds = %76
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %131

81:                                               ; preds = %76
  br label %83

82:                                               ; preds = %71
  br label %52, !llvm.loop !16

83:                                               ; preds = %81, %52
  %84 = load ptr, ptr %6, align 8, !tbaa !9
  %85 = icmp eq ptr %84, null
  br i1 %85, label %86, label %91

86:                                               ; preds = %83
  %87 = getelementptr inbounds [128 x i8], ptr %8, i64 0, i64 0
  %88 = call ptr (ptr, i32, i32, ...) @bfind(ptr noundef %87, i32 noundef 1, i32 noundef 0)
  store ptr %88, ptr %6, align 8, !tbaa !9
  %89 = icmp eq ptr %88, null
  br i1 %89, label %90, label %91

90:                                               ; preds = %86
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %131

91:                                               ; preds = %86, %83
  br label %92

92:                                               ; preds = %91, %48
  %93 = load ptr, ptr @curwp, align 8, !tbaa !9
  %94 = getelementptr inbounds %struct.WINDOW, ptr %93, i32 0, i32 2
  %95 = load ptr, ptr %94, align 8, !tbaa !17
  store ptr %95, ptr %13, align 8, !tbaa !9
  %96 = load ptr, ptr @curwp, align 8, !tbaa !9
  %97 = getelementptr inbounds %struct.WINDOW, ptr %96, i32 0, i32 3
  %98 = load ptr, ptr %97, align 8, !tbaa !19
  store ptr %98, ptr %14, align 8, !tbaa !9
  %99 = load ptr, ptr %6, align 8, !tbaa !9
  call void @gotobuf(ptr noundef %99)
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %103

102:                                              ; preds = %92
  call void (ptr, ...) @mlwrite(ptr noundef @.str.21)
  br label %126

103:                                              ; preds = %92
  %104 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 0
  %105 = call i32 @readin(ptr noundef %104)
  store i32 %105, ptr %10, align 4, !tbaa !5
  %106 = icmp ne i32 %105, 2
  br i1 %106, label %107, label %117

107:                                              ; preds = %103
  %108 = load ptr, ptr @curbp, align 8, !tbaa !9
  call void @bbclear(ptr noundef %108)
  %109 = load ptr, ptr @oldbp, align 8, !tbaa !9
  call void @gotobuf(ptr noundef %109)
  %110 = load ptr, ptr @oldbp, align 8, !tbaa !9
  call void @freebuf(ptr noundef %110)
  %111 = load ptr, ptr %13, align 8, !tbaa !9
  %112 = load ptr, ptr @curwp, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.WINDOW, ptr %112, i32 0, i32 2
  store ptr %111, ptr %113, align 8, !tbaa !17
  %114 = load ptr, ptr %14, align 8, !tbaa !9
  %115 = load ptr, ptr @curwp, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.WINDOW, ptr %115, i32 0, i32 3
  store ptr %114, ptr %116, align 8, !tbaa !19
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %131

117:                                              ; preds = %103
  %118 = load ptr, ptr %6, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.BUFFER, ptr %118, i32 0, i32 8
  %120 = getelementptr inbounds [128 x i8], ptr %119, i64 0, i64 0
  %121 = getelementptr inbounds [128 x i8], ptr %7, i64 0, i64 0
  call void @cpyfname(ptr noundef %120, ptr noundef %121)
  %122 = load ptr, ptr %6, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.BUFFER, ptr %122, i32 0, i32 7
  %124 = load i32, ptr %123, align 4, !tbaa !11
  %125 = and i32 %124, -8
  store i32 %125, ptr %123, align 4, !tbaa !11
  br label %126

126:                                              ; preds = %117, %102
  %127 = load ptr, ptr @curwp, align 8, !tbaa !9
  %128 = getelementptr inbounds %struct.WINDOW, ptr %127, i32 0, i32 11
  %129 = load i32, ptr %128, align 4, !tbaa !20
  %130 = or i32 %129, 25
  store i32 %130, ptr %128, align 4, !tbaa !20
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %131

131:                                              ; preds = %126, %107, %90, %80, %69, %19
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %132 = load i32, ptr %3, align 4
  ret i32 %132
}

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

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

declare ptr @bfind(...) #2

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

declare void @gotobuf(ptr noundef) #2

declare void @bbclear(ptr noundef) #2

declare void @freebuf(ptr noundef) #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 willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !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, !6, i64 52}
!12 = !{!"BUFFER", !10, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !6, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !7, i64 56, !7, i64 184}
!13 = !{!12, !10, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!18, !10, i64 16}
!18 = !{!"WINDOW", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !6, i64 60, !6, i64 64, !6, i64 68}
!19 = !{!18, !10, i64 24}
!20 = !{!18, !6, i64 68}


; 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"

@curbp = external local_unnamed_addr global ptr, align 8
@oldbp = external local_unnamed_addr global ptr, align 8
@curwp = external local_unnamed_addr global ptr, align 8
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@bheadp = external local_unnamed_addr global ptr, align 8
@.str.20 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [13 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @cpyfname(ptr noundef, ptr 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 i32 @choosefile(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @mlreply(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare void @mlwrite(ptr noundef, ...) local_unnamed_addr #2

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

declare i32 @ctrlg(...) local_unnamed_addr #2

declare i32 @bclear(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local i32 @filevisit(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = alloca [128 x i8], align 16
  %4 = alloca [128 x i8], align 16
  %5 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %5) #5
  %6 = call i32 @choosefile(ptr noundef nonnull @.str.19, ptr noundef nonnull %3, i32 noundef 0)
  %.not = icmp eq i32 %6, 1
  br i1 %.not, label %.preheader, label %7

.preheader:                                       ; preds = %2
  %.01732 = load ptr, ptr @bheadp, align 8, !tbaa !5
  %.not2233 = icmp eq ptr %.01732, null
  br i1 %.not2233, label %.critedge, label %.lr.ph

7:                                                ; preds = %2
  %8 = call i32 (...) @ctrlg() #5
  br label %55

.lr.ph:                                           ; preds = %.preheader, %17
  %.01734 = phi ptr [ %.017, %17 ], [ %.01732, %.preheader ]
  %9 = getelementptr inbounds i8, ptr %.01734, i64 52
  %10 = load i32, ptr %9, align 4, !tbaa !9
  %11 = and i32 %10, 1
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %17

13:                                               ; preds = %.lr.ph
  %14 = getelementptr inbounds i8, ptr %.01734, i64 56
  %15 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %14, ptr noundef nonnull dereferenceable(1) %3) #6
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %.loopexit, label %17

17:                                               ; preds = %.lr.ph, %13
  %.017 = load ptr, ptr %.01734, align 8, !tbaa !5
  %.not22 = icmp eq ptr %.017, null
  br i1 %.not22, label %.critedge, label %.lr.ph, !llvm.loop !12

.critedge:                                        ; preds = %17, %.preheader
  call void @makename(ptr noundef nonnull %4, ptr noundef nonnull %3)
  br label %18

18:                                               ; preds = %25, %.critedge
  %19 = call ptr (ptr, i32, i32, ...) @bfind(ptr noundef nonnull %4, i32 noundef 0, i32 noundef 0) #5
  %cond = icmp eq ptr %19, null
  br i1 %cond, label %30, label %20

20:                                               ; preds = %18
  %21 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) %4) #5
  %22 = call i32 @mlreply(ptr noundef nonnull @.str.20, ptr noundef nonnull %5, ptr noundef nonnull %4, i32 noundef 128, i32 noundef 0) #5
  %or.cond = icmp ugt i32 %22, 1
  br i1 %or.cond, label %23, label %25

23:                                               ; preds = %20
  %24 = call i32 (...) @ctrlg() #5
  br label %55

25:                                               ; preds = %20
  %26 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) %5) #6
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %18, !llvm.loop !14

28:                                               ; preds = %25
  %29 = call i32 @bclear(ptr noundef nonnull %19) #5
  %.not25 = icmp eq i32 %29, 1
  br i1 %.not25, label %.loopexit, label %55

30:                                               ; preds = %18
  %31 = call ptr (ptr, i32, i32, ...) @bfind(ptr noundef nonnull %4, i32 noundef 1, i32 noundef 0) #5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %55, label %.loopexit

.loopexit:                                        ; preds = %13, %28, %30
  %.not2230 = phi i1 [ true, %30 ], [ true, %28 ], [ false, %13 ]
  %.1 = phi ptr [ %31, %30 ], [ %19, %28 ], [ %.01734, %13 ]
  %33 = load ptr, ptr @curwp, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %35 = load <2 x ptr>, ptr %34, align 8, !tbaa !5
  call void @gotobuf(ptr noundef nonnull %.1) #5
  br i1 %.not2230, label %37, label %36

36:                                               ; preds = %.loopexit
  call void (ptr, ...) @mlwrite(ptr noundef nonnull @.str.21) #5
  br label %50

37:                                               ; preds = %.loopexit
  %38 = call i32 @readin(ptr noundef nonnull %3)
  %.not26 = icmp eq i32 %38, 2
  br i1 %.not26, label %45, label %39

39:                                               ; preds = %37
  %40 = load ptr, ptr @curbp, align 8, !tbaa !5
  call void @bbclear(ptr noundef %40) #5
  %41 = load ptr, ptr @oldbp, align 8, !tbaa !5
  call void @gotobuf(ptr noundef %41) #5
  %42 = load ptr, ptr @oldbp, align 8, !tbaa !5
  call void @freebuf(ptr noundef %42) #5
  %43 = load ptr, ptr @curwp, align 8, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %43, i64 16
  store <2 x ptr> %35, ptr %44, align 8, !tbaa !5
  br label %55

45:                                               ; preds = %37
  %46 = getelementptr inbounds i8, ptr %.1, i64 56
  call void @cpyfname(ptr noundef nonnull %46, ptr noundef nonnull %3)
  %47 = getelementptr inbounds i8, ptr %.1, i64 52
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = and i32 %48, -8
  store i32 %49, ptr %47, align 4, !tbaa !9
  br label %50

50:                                               ; preds = %45, %36
  %51 = load ptr, ptr @curwp, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i64 68
  %53 = load i32, ptr %52, align 4, !tbaa !15
  %54 = or i32 %53, 25
  store i32 %54, ptr %52, align 4, !tbaa !15
  br label %55

55:                                               ; preds = %30, %28, %50, %39, %23, %7
  %.0 = phi i32 [ %8, %7 ], [ 1, %50 ], [ 0, %39 ], [ %24, %23 ], [ 0, %28 ], [ 0, %30 ]
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #5
  ret i32 %.0
}

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

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

declare ptr @bfind(...) local_unnamed_addr #2

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

declare void @gotobuf(ptr noundef) local_unnamed_addr #2

declare void @bbclear(ptr noundef) local_unnamed_addr #2

declare void @freebuf(ptr noundef) 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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 52}
!10 = !{!"BUFFER", !6, i64 0, !6, i64 8, !11, i64 16, !6, i64 24, !11, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !7, i64 56, !7, i64 184}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !11, i64 68}
!16 = !{!"WINDOW", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68}


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