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

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

@curwp = external global ptr, align 8
@wheadp = external global ptr, align 8
@curbp = external global ptr, align 8
@term = external global %struct.TERM, align 8

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @onlywind(i32 noundef %0, i32 noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  br label %8

8:                                                ; preds = %53, %2
  %9 = load ptr, ptr @wheadp, align 8, !tbaa !9
  %10 = load ptr, ptr @curwp, align 8, !tbaa !9
  %11 = icmp ne ptr %9, %10
  br i1 %11, label %12, label %55

12:                                               ; preds = %8
  %13 = load ptr, ptr @wheadp, align 8, !tbaa !9
  store ptr %13, ptr %5, align 8, !tbaa !9
  %14 = load ptr, ptr %5, align 8, !tbaa !9
  %15 = getelementptr inbounds %struct.WINDOW, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %16, ptr @wheadp, align 8, !tbaa !9
  %17 = load ptr, ptr %5, align 8, !tbaa !9
  %18 = getelementptr inbounds %struct.WINDOW, ptr %17, i32 0, i32 1
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = getelementptr inbounds %struct.BUFFER, ptr %19, i32 0, i32 6
  %21 = load i32, ptr %20, align 8, !tbaa !14
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr %20, align 8, !tbaa !14
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %53

24:                                               ; preds = %12
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.WINDOW, ptr %25, i32 0, i32 3
  %27 = load ptr, ptr %26, align 8, !tbaa !16
  %28 = load ptr, ptr %5, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.WINDOW, ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !13
  %31 = getelementptr inbounds %struct.BUFFER, ptr %30, i32 0, i32 1
  store ptr %27, ptr %31, align 8, !tbaa !17
  %32 = load ptr, ptr %5, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct.WINDOW, ptr %32, i32 0, i32 4
  %34 = load i32, ptr %33, align 8, !tbaa !18
  %35 = load ptr, ptr %5, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.WINDOW, ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !13
  %38 = getelementptr inbounds %struct.BUFFER, ptr %37, i32 0, i32 2
  store i32 %34, ptr %38, align 8, !tbaa !19
  %39 = load ptr, ptr %5, align 8, !tbaa !9
  %40 = getelementptr inbounds %struct.WINDOW, ptr %39, i32 0, i32 5
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  %42 = load ptr, ptr %5, align 8, !tbaa !9
  %43 = getelementptr inbounds %struct.WINDOW, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  %45 = getelementptr inbounds %struct.BUFFER, ptr %44, i32 0, i32 3
  store ptr %41, ptr %45, align 8, !tbaa !21
  %46 = load ptr, ptr %5, align 8, !tbaa !9
  %47 = getelementptr inbounds %struct.WINDOW, ptr %46, i32 0, i32 6
  %48 = load i32, ptr %47, align 8, !tbaa !22
  %49 = load ptr, ptr %5, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.WINDOW, ptr %49, i32 0, i32 1
  %51 = load ptr, ptr %50, align 8, !tbaa !13
  %52 = getelementptr inbounds %struct.BUFFER, ptr %51, i32 0, i32 4
  store i32 %48, ptr %52, align 8, !tbaa !23
  br label %53

53:                                               ; preds = %24, %12
  %54 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %54) #3
  br label %8, !llvm.loop !24

55:                                               ; preds = %8
  br label %56

56:                                               ; preds = %106, %55
  %57 = load ptr, ptr @curwp, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.WINDOW, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !11
  %60 = icmp ne ptr %59, null
  br i1 %60, label %61, label %108

61:                                               ; preds = %56
  %62 = load ptr, ptr @curwp, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.WINDOW, ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !11
  store ptr %64, ptr %5, align 8, !tbaa !9
  %65 = load ptr, ptr %5, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.WINDOW, ptr %65, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  %68 = load ptr, ptr @curwp, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.WINDOW, ptr %68, i32 0, i32 0
  store ptr %67, ptr %69, align 8, !tbaa !11
  %70 = load ptr, ptr %5, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.WINDOW, ptr %70, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !13
  %73 = getelementptr inbounds %struct.BUFFER, ptr %72, i32 0, i32 6
  %74 = load i32, ptr %73, align 8, !tbaa !14
  %75 = add nsw i32 %74, -1
  store i32 %75, ptr %73, align 8, !tbaa !14
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %106

77:                                               ; preds = %61
  %78 = load ptr, ptr %5, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.WINDOW, ptr %78, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  %81 = load ptr, ptr %5, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.WINDOW, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !13
  %84 = getelementptr inbounds %struct.BUFFER, ptr %83, i32 0, i32 1
  store ptr %80, ptr %84, align 8, !tbaa !17
  %85 = load ptr, ptr %5, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.WINDOW, ptr %85, i32 0, i32 4
  %87 = load i32, ptr %86, align 8, !tbaa !18
  %88 = load ptr, ptr %5, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct.WINDOW, ptr %88, i32 0, i32 1
  %90 = load ptr, ptr %89, align 8, !tbaa !13
  %91 = getelementptr inbounds %struct.BUFFER, ptr %90, i32 0, i32 2
  store i32 %87, ptr %91, align 8, !tbaa !19
  %92 = load ptr, ptr %5, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.WINDOW, ptr %92, i32 0, i32 5
  %94 = load ptr, ptr %93, align 8, !tbaa !20
  %95 = load ptr, ptr %5, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.WINDOW, ptr %95, i32 0, i32 1
  %97 = load ptr, ptr %96, align 8, !tbaa !13
  %98 = getelementptr inbounds %struct.BUFFER, ptr %97, i32 0, i32 3
  store ptr %94, ptr %98, align 8, !tbaa !21
  %99 = load ptr, ptr %5, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.WINDOW, ptr %99, i32 0, i32 6
  %101 = load i32, ptr %100, align 8, !tbaa !22
  %102 = load ptr, ptr %5, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.WINDOW, ptr %102, i32 0, i32 1
  %104 = load ptr, ptr %103, align 8, !tbaa !13
  %105 = getelementptr inbounds %struct.BUFFER, ptr %104, i32 0, i32 4
  store i32 %101, ptr %105, align 8, !tbaa !23
  br label %106

106:                                              ; preds = %77, %61
  %107 = load ptr, ptr %5, align 8, !tbaa !9
  call void @free(ptr noundef %107) #3
  br label %56, !llvm.loop !26

108:                                              ; preds = %56
  %109 = load ptr, ptr @curwp, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.WINDOW, ptr %109, i32 0, i32 2
  %111 = load ptr, ptr %110, align 8, !tbaa !27
  store ptr %111, ptr %6, align 8, !tbaa !9
  %112 = load ptr, ptr @curwp, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.WINDOW, ptr %112, i32 0, i32 7
  %114 = load i32, ptr %113, align 4, !tbaa !28
  store i32 %114, ptr %7, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %128, %108
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = icmp ne i32 %116, 0
  br i1 %117, label %118, label %126

118:                                              ; preds = %115
  %119 = load ptr, ptr %6, align 8, !tbaa !9
  %120 = getelementptr inbounds %struct.LINE, ptr %119, i32 0, i32 1
  %121 = load ptr, ptr %120, align 8, !tbaa !29
  %122 = load ptr, ptr @curbp, align 8, !tbaa !9
  %123 = getelementptr inbounds %struct.BUFFER, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %123, align 8, !tbaa !32
  %125 = icmp ne ptr %121, %124
  br label %126

126:                                              ; preds = %118, %115
  %127 = phi i1 [ false, %115 ], [ %125, %118 ]
  br i1 %127, label %128, label %134

128:                                              ; preds = %126
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = add nsw i32 %129, -1
  store i32 %130, ptr %7, align 4, !tbaa !5
  %131 = load ptr, ptr %6, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.LINE, ptr %131, i32 0, i32 1
  %133 = load ptr, ptr %132, align 8, !tbaa !29
  store ptr %133, ptr %6, align 8, !tbaa !9
  br label %115, !llvm.loop !33

134:                                              ; preds = %126
  %135 = load ptr, ptr @curwp, align 8, !tbaa !9
  %136 = getelementptr inbounds %struct.WINDOW, ptr %135, i32 0, i32 7
  store i32 0, ptr %136, align 4, !tbaa !28
  %137 = load i32, ptr @term, align 8, !tbaa !34
  %138 = sub nsw i32 %137, 1
  %139 = load ptr, ptr @curwp, align 8, !tbaa !9
  %140 = getelementptr inbounds %struct.WINDOW, ptr %139, i32 0, i32 8
  store i32 %138, ptr %140, align 8, !tbaa !36
  %141 = load ptr, ptr %6, align 8, !tbaa !9
  %142 = load ptr, ptr @curwp, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.WINDOW, ptr %142, i32 0, i32 2
  store ptr %141, ptr %143, align 8, !tbaa !27
  %144 = load ptr, ptr @curwp, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.WINDOW, ptr %144, i32 0, i32 11
  %146 = load i32, ptr %145, align 4, !tbaa !37
  %147 = or i32 %146, 24
  store i32 %147, ptr %145, align 4, !tbaa !37
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  ret i32 1
}

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

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

!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, !10, i64 0}
!12 = !{!"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}
!13 = !{!12, !10, i64 8}
!14 = !{!15, !6, i64 48}
!15 = !{!"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}
!16 = !{!12, !10, i64 24}
!17 = !{!15, !10, i64 8}
!18 = !{!12, !6, i64 32}
!19 = !{!15, !6, i64 16}
!20 = !{!12, !10, i64 40}
!21 = !{!15, !10, i64 24}
!22 = !{!12, !6, i64 48}
!23 = !{!15, !6, i64 32}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = distinct !{!26, !25}
!27 = !{!12, !10, i64 16}
!28 = !{!12, !6, i64 52}
!29 = !{!30, !10, i64 8}
!30 = !{!"LINE", !10, i64 0, !10, i64 8, !31, i64 16, !31, i64 18, !7, i64 20}
!31 = !{!"short", !7, i64 0}
!32 = !{!15, !10, i64 40}
!33 = distinct !{!33, !25}
!34 = !{!35, !6, i64 0}
!35 = !{!"", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96}
!36 = !{!12, !6, i64 56}
!37 = !{!12, !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"

%struct.TERM = type { i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@curwp = external local_unnamed_addr global ptr, align 8
@wheadp = external local_unnamed_addr global ptr, align 8
@curbp = external local_unnamed_addr global ptr, align 8
@term = external local_unnamed_addr global %struct.TERM, align 8

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @onlywind(i32 noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %3 = load ptr, ptr @wheadp, align 8, !tbaa !5
  %4 = load ptr, ptr @curwp, align 8, !tbaa !5
  %.not33 = icmp eq ptr %3, %4
  br i1 %.not33, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %28, %2
  %5 = phi ptr [ %4, %2 ], [ %30, %28 ]
  %6 = load ptr, ptr %5, align 8, !tbaa !9
  %.not3034 = icmp eq ptr %6, null
  br i1 %.not3034, label %._crit_edge, label %.lr.ph35

.lr.ph:                                           ; preds = %2, %28
  %7 = phi ptr [ %29, %28 ], [ %3, %2 ]
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  store ptr %8, ptr @wheadp, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %7, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %10, i64 48
  %12 = load i32, ptr %11, align 8, !tbaa !13
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr %11, align 8, !tbaa !13
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %28

15:                                               ; preds = %.lr.ph
  %16 = getelementptr inbounds i8, ptr %7, i64 24
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds i8, ptr %10, i64 8
  store ptr %17, ptr %18, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %7, i64 32
  %20 = load i32, ptr %19, align 8, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %10, i64 16
  store i32 %20, ptr %21, align 8, !tbaa !18
  %22 = getelementptr inbounds i8, ptr %7, i64 40
  %23 = load ptr, ptr %22, align 8, !tbaa !19
  %24 = getelementptr inbounds i8, ptr %10, i64 24
  store ptr %23, ptr %24, align 8, !tbaa !20
  %25 = getelementptr inbounds i8, ptr %7, i64 48
  %26 = load i32, ptr %25, align 8, !tbaa !21
  %27 = getelementptr inbounds i8, ptr %10, i64 32
  store i32 %26, ptr %27, align 8, !tbaa !22
  br label %28

28:                                               ; preds = %15, %.lr.ph
  tail call void @free(ptr noundef nonnull %7) #2
  %29 = load ptr, ptr @wheadp, align 8, !tbaa !5
  %30 = load ptr, ptr @curwp, align 8, !tbaa !5
  %.not = icmp eq ptr %29, %30
  br i1 %.not, label %.preheader, label %.lr.ph, !llvm.loop !23

.lr.ph35:                                         ; preds = %.preheader, %53
  %31 = phi ptr [ %55, %53 ], [ %6, %.preheader ]
  %32 = phi ptr [ %54, %53 ], [ %5, %.preheader ]
  %33 = load ptr, ptr %31, align 8, !tbaa !9
  store ptr %33, ptr %32, align 8, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %31, i64 8
  %35 = load ptr, ptr %34, align 8, !tbaa !12
  %36 = getelementptr inbounds i8, ptr %35, i64 48
  %37 = load i32, ptr %36, align 8, !tbaa !13
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %36, align 8, !tbaa !13
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %53

40:                                               ; preds = %.lr.ph35
  %41 = getelementptr inbounds i8, ptr %31, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !15
  %43 = getelementptr inbounds i8, ptr %35, i64 8
  store ptr %42, ptr %43, align 8, !tbaa !16
  %44 = getelementptr inbounds i8, ptr %31, i64 32
  %45 = load i32, ptr %44, align 8, !tbaa !17
  %46 = getelementptr inbounds i8, ptr %35, i64 16
  store i32 %45, ptr %46, align 8, !tbaa !18
  %47 = getelementptr inbounds i8, ptr %31, i64 40
  %48 = load ptr, ptr %47, align 8, !tbaa !19
  %49 = getelementptr inbounds i8, ptr %35, i64 24
  store ptr %48, ptr %49, align 8, !tbaa !20
  %50 = getelementptr inbounds i8, ptr %31, i64 48
  %51 = load i32, ptr %50, align 8, !tbaa !21
  %52 = getelementptr inbounds i8, ptr %35, i64 32
  store i32 %51, ptr %52, align 8, !tbaa !22
  br label %53

53:                                               ; preds = %40, %.lr.ph35
  tail call void @free(ptr noundef nonnull %31) #2
  %54 = load ptr, ptr @curwp, align 8, !tbaa !5
  %55 = load ptr, ptr %54, align 8, !tbaa !9
  %.not30 = icmp eq ptr %55, null
  br i1 %.not30, label %._crit_edge, label %.lr.ph35, !llvm.loop !25

._crit_edge:                                      ; preds = %53, %.preheader
  %.lcssa = phi ptr [ %5, %.preheader ], [ %54, %53 ]
  %56 = getelementptr inbounds i8, ptr %.lcssa, i64 16
  %57 = load ptr, ptr %56, align 8, !tbaa !26
  %58 = getelementptr inbounds i8, ptr %.lcssa, i64 52
  %59 = load i32, ptr %58, align 4, !tbaa !27
  %.not3136 = icmp eq i32 %59, 0
  br i1 %.not3136, label %.critedge, label %.lr.ph40

.lr.ph40:                                         ; preds = %._crit_edge
  %60 = load ptr, ptr @curbp, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 40
  %62 = load ptr, ptr %61, align 8, !tbaa !28
  br label %65

63:                                               ; preds = %65
  %64 = add nsw i32 %.038, -1
  %.not31 = icmp eq i32 %64, 0
  br i1 %.not31, label %.critedge, label %65, !llvm.loop !29

65:                                               ; preds = %.lr.ph40, %63
  %.038 = phi i32 [ %59, %.lr.ph40 ], [ %64, %63 ]
  %.02637 = phi ptr [ %57, %.lr.ph40 ], [ %67, %63 ]
  %66 = getelementptr inbounds i8, ptr %.02637, i64 8
  %67 = load ptr, ptr %66, align 8, !tbaa !30
  %.not32 = icmp eq ptr %67, %62
  br i1 %.not32, label %.critedge, label %63

.critedge:                                        ; preds = %65, %63, %._crit_edge
  %.026.lcssa = phi ptr [ %57, %._crit_edge ], [ %67, %63 ], [ %.02637, %65 ]
  store i32 0, ptr %58, align 4, !tbaa !27
  %68 = load i32, ptr @term, align 8, !tbaa !33
  %69 = add nsw i32 %68, -1
  %70 = getelementptr inbounds i8, ptr %.lcssa, i64 56
  store i32 %69, ptr %70, align 8, !tbaa !35
  store ptr %.026.lcssa, ptr %56, align 8, !tbaa !26
  %71 = getelementptr inbounds i8, ptr %.lcssa, i64 68
  %72 = load i32, ptr %71, align 4, !tbaa !36
  %73 = or i32 %72, 24
  store i32 %73, ptr %71, align 4, !tbaa !36
  ret i32 1
}

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"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}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 8}
!13 = !{!14, !11, i64 48}
!14 = !{!"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}
!15 = !{!10, !6, i64 24}
!16 = !{!14, !6, i64 8}
!17 = !{!10, !11, i64 32}
!18 = !{!14, !11, i64 16}
!19 = !{!10, !6, i64 40}
!20 = !{!14, !6, i64 24}
!21 = !{!10, !11, i64 48}
!22 = !{!14, !11, i64 32}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = !{!10, !6, i64 16}
!27 = !{!10, !11, i64 52}
!28 = !{!14, !6, i64 40}
!29 = distinct !{!29, !24}
!30 = !{!31, !6, i64 8}
!31 = !{!"LINE", !6, i64 0, !6, i64 8, !32, i64 16, !32, i64 18, !7, i64 20}
!32 = !{!"short", !7, i64 0}
!33 = !{!34, !11, i64 0}
!34 = !{!"", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96}
!35 = !{!10, !11, i64 56}
!36 = !{!10, !11, i64 68}


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