; LLVM IR from clangen/musikcube :: src/3rdparty/win32_src/pdcurses (scroll)

; 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._win = type { i32, i32, i32, i32, i32, i32, i32, i64, i64, i8, i8, i8, i8, i8, i8, i8, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, i32 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.wscrl = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @wscrl(ptr noundef %0, i32 noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %15, label %16

15:                                               ; preds = %2
  br label %17

16:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 50, ptr noundef @__PRETTY_FUNCTION__.wscrl) #6
  unreachable

17:                                               ; preds = %15
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %20, label %28

20:                                               ; preds = %17
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct._win, ptr %21, i32 0, i32 11
  %23 = load i8, ptr %22, align 2, !tbaa !11, !range !15, !noundef !16
  %24 = trunc i8 %23 to i1
  br i1 %24, label %25, label %28

25:                                               ; preds = %20
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %29, label %28

28:                                               ; preds = %25, %20, %17
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %152

29:                                               ; preds = %25
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct._win, ptr %30, i32 0, i32 8
  %32 = load i64, ptr %31, align 8, !tbaa !17
  store i64 %32, ptr %9, align 8, !tbaa !18
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct._win, ptr %33, i32 0, i32 19
  %35 = load i32, ptr %34, align 8, !tbaa !19
  store i32 %35, ptr %6, align 4, !tbaa !9
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._win, ptr %36, i32 0, i32 20
  %38 = load i32, ptr %37, align 4, !tbaa !20
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %7, align 4, !tbaa !9
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = sub nsw i32 %40, %41
  store i32 %42, ptr %8, align 4, !tbaa !9
  %43 = load i32, ptr %5, align 4, !tbaa !9
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %45, label %86

45:                                               ; preds = %29
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = icmp sgt i32 %46, %47
  br i1 %48, label %49, label %51

49:                                               ; preds = %45
  %50 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %50, ptr %5, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %49, %45
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._win, ptr %52, i32 0, i32 16
  %54 = load ptr, ptr %53, align 8, !tbaa !21
  %55 = load i32, ptr %6, align 4, !tbaa !9
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds ptr, ptr %54, i64 %56
  %58 = load ptr, ptr %57, align 8, !tbaa !5
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._win, ptr %59, i32 0, i32 16
  %61 = load ptr, ptr %60, align 8, !tbaa !21
  %62 = load i32, ptr %6, align 4, !tbaa !9
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = add nsw i32 %62, %63
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds ptr, ptr %61, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = load i32, ptr %5, align 4, !tbaa !9
  %70 = sub nsw i32 %68, %69
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._win, ptr %71, i32 0, i32 3
  %73 = load i32, ptr %72, align 4, !tbaa !22
  %74 = mul nsw i32 %70, %73
  %75 = sext i32 %74 to i64
  %76 = mul i64 %75, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %58, ptr align 8 %67, i64 %76, i1 false)
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct._win, ptr %77, i32 0, i32 16
  %79 = load ptr, ptr %78, align 8, !tbaa !21
  %80 = load i32, ptr %7, align 4, !tbaa !9
  %81 = load i32, ptr %5, align 4, !tbaa !9
  %82 = sub nsw i32 %80, %81
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds ptr, ptr %79, i64 %83
  %85 = load ptr, ptr %84, align 8, !tbaa !5
  store ptr %85, ptr %10, align 8, !tbaa !5
  br label %129

86:                                               ; preds = %29
  %87 = load i32, ptr %5, align 4, !tbaa !9
  %88 = sub nsw i32 0, %87
  store i32 %88, ptr %5, align 4, !tbaa !9
  %89 = load i32, ptr %5, align 4, !tbaa !9
  %90 = load i32, ptr %8, align 4, !tbaa !9
  %91 = icmp sgt i32 %89, %90
  br i1 %91, label %92, label %94

92:                                               ; preds = %86
  %93 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %93, ptr %5, align 4, !tbaa !9
  br label %94

94:                                               ; preds = %92, %86
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._win, ptr %95, i32 0, i32 16
  %97 = load ptr, ptr %96, align 8, !tbaa !21
  %98 = load i32, ptr %6, align 4, !tbaa !9
  %99 = load i32, ptr %5, align 4, !tbaa !9
  %100 = add nsw i32 %98, %99
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds ptr, ptr %97, i64 %101
  %103 = load ptr, ptr %102, align 8, !tbaa !5
  %104 = load ptr, ptr %4, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._win, ptr %104, i32 0, i32 16
  %106 = load ptr, ptr %105, align 8, !tbaa !21
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds ptr, ptr %106, i64 %108
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = load i32, ptr %8, align 4, !tbaa !9
  %112 = load i32, ptr %5, align 4, !tbaa !9
  %113 = sub nsw i32 %111, %112
  %114 = load ptr, ptr %4, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._win, ptr %114, i32 0, i32 3
  %116 = load i32, ptr %115, align 4, !tbaa !22
  %117 = mul nsw i32 %113, %116
  %118 = sext i32 %117 to i64
  %119 = mul i64 %118, 8
  call void @llvm.memmove.p0.p0.i64(ptr align 8 %103, ptr align 8 %110, i64 %119, i1 false)
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._win, ptr %120, i32 0, i32 16
  %122 = load ptr, ptr %121, align 8, !tbaa !21
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._win, ptr %123, i32 0, i32 19
  %125 = load i32, ptr %124, align 8, !tbaa !19
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds ptr, ptr %122, i64 %126
  %128 = load ptr, ptr %127, align 8, !tbaa !5
  store ptr %128, ptr %10, align 8, !tbaa !5
  br label %129

129:                                              ; preds = %94, %51
  %130 = load ptr, ptr %10, align 8, !tbaa !5
  %131 = load i32, ptr %5, align 4, !tbaa !9
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct._win, ptr %132, i32 0, i32 3
  %134 = load i32, ptr %133, align 4, !tbaa !22
  %135 = mul nsw i32 %131, %134
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i64, ptr %130, i64 %136
  store ptr %137, ptr %11, align 8, !tbaa !5
  br label %138

138:                                              ; preds = %142, %129
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = icmp ult ptr %139, %140
  br i1 %141, label %142, label %146

142:                                              ; preds = %138
  %143 = load i64, ptr %9, align 8, !tbaa !18
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = getelementptr inbounds i64, ptr %144, i32 1
  store ptr %145, ptr %10, align 8, !tbaa !5
  store i64 %143, ptr %144, align 8, !tbaa !18
  br label %138, !llvm.loop !23

146:                                              ; preds = %138
  %147 = load ptr, ptr %4, align 8, !tbaa !5
  %148 = load i32, ptr %6, align 4, !tbaa !9
  %149 = load i32, ptr %8, align 4, !tbaa !9
  %150 = call i32 @touchline(ptr noundef %147, i32 noundef %148, i32 noundef %149)
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  call void @PDC_sync(ptr noundef %151)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %152

152:                                              ; preds = %146, %28
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %153 = load i32, ptr %3, align 4
  ret i32 %153
}

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #3

declare i32 @touchline(ptr noundef, i32 noundef, i32 noundef) #4

declare void @PDC_sync(ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { noreturn 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !14, i64 50}
!12 = !{!"_win", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !13, i64 32, !13, i64 40, !14, i64 48, !14, i64 49, !14, i64 50, !14, i64 51, !14, i64 52, !14, i64 53, !14, i64 54, !6, i64 56, !6, i64 64, !6, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !6, i64 104, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132}
!13 = !{!"long", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!12, !13, i64 40}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !10, i64 80}
!20 = !{!12, !10, i64 84}
!21 = !{!12, !6, i64 56}
!22 = !{!12, !10, i64 12}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [92 x i8], align 1
@__PRETTY_FUNCTION__.wscrl = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @wscrl(ptr noundef %0, i32 noundef %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %3, label %4

3:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 50, ptr noundef nonnull @__PRETTY_FUNCTION__.wscrl) #5
  unreachable

4:                                                ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 50
  %6 = load i8, ptr %5, align 2, !tbaa !5, !range !13, !noundef !14
  %7 = trunc nuw i8 %6 to i1
  %8 = icmp ne i32 %1, 0
  %or.cond = and i1 %8, %7
  br i1 %or.cond, label %9, label %76

9:                                                ; preds = %4
  %10 = getelementptr inbounds i8, ptr %0, i64 40
  %11 = load i64, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %0, i64 80
  %13 = load i32, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %0, i64 84
  %15 = load i32, ptr %14, align 4, !tbaa !17
  %16 = add nsw i32 %15, 1
  %17 = sub nsw i32 %16, %13
  %18 = icmp sgt i32 %1, 0
  br i1 %18, label %19, label %36

19:                                               ; preds = %9
  %spec.select = tail call i32 @llvm.smin.i32(i32 %17, i32 %1)
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  %21 = load ptr, ptr %20, align 8, !tbaa !18
  %22 = sext i32 %13 to i64
  %23 = getelementptr inbounds ptr, ptr %21, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !19
  %25 = add nsw i32 %spec.select, %13
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds ptr, ptr %21, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !19
  %29 = sub nsw i32 %17, %spec.select
  %30 = getelementptr inbounds i8, ptr %0, i64 12
  %31 = load i32, ptr %30, align 4, !tbaa !20
  %32 = mul nsw i32 %31, %29
  %33 = sext i32 %32 to i64
  %34 = shl nsw i64 %33, 3
  tail call void @llvm.memmove.p0.p0.i64(ptr align 8 %24, ptr align 8 %28, i64 %34, i1 false)
  %35 = sub nsw i32 %16, %spec.select
  br label %54

36:                                               ; preds = %9
  %37 = sub nsw i32 0, %1
  %spec.select58 = tail call i32 @llvm.smin.i32(i32 %17, i32 %37)
  %38 = getelementptr inbounds i8, ptr %0, i64 56
  %39 = load ptr, ptr %38, align 8, !tbaa !18
  %40 = add nsw i32 %spec.select58, %13
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds ptr, ptr %39, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  %44 = sext i32 %13 to i64
  %45 = getelementptr inbounds ptr, ptr %39, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !19
  %47 = sub nsw i32 %17, %spec.select58
  %48 = getelementptr inbounds i8, ptr %0, i64 12
  %49 = load i32, ptr %48, align 4, !tbaa !20
  %50 = mul nsw i32 %49, %47
  %51 = sext i32 %50 to i64
  %52 = shl nsw i64 %51, 3
  tail call void @llvm.memmove.p0.p0.i64(ptr align 8 %43, ptr align 8 %46, i64 %52, i1 false)
  %53 = load i32, ptr %12, align 8, !tbaa !16
  br label %54

54:                                               ; preds = %36, %19
  %.sink61 = phi i32 [ %53, %36 ], [ %35, %19 ]
  %.sink.in = phi ptr [ %38, %36 ], [ %20, %19 ]
  %.2 = phi i32 [ %spec.select58, %36 ], [ %spec.select, %19 ]
  %.sink = load ptr, ptr %.sink.in, align 8, !tbaa !18
  %55 = sext i32 %.sink61 to i64
  %56 = getelementptr inbounds ptr, ptr %.sink, i64 %55
  %.050 = load ptr, ptr %56, align 8, !tbaa !19
  %57 = getelementptr inbounds i8, ptr %0, i64 12
  %58 = load i32, ptr %57, align 4, !tbaa !20
  %59 = mul nsw i32 %58, %.2
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds i64, ptr %.050, i64 %60
  %62 = icmp sgt i32 %59, 0
  br i1 %62, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %54
  %.05062 = ptrtoint ptr %.050 to i64
  %63 = shl nuw nsw i64 %60, 3
  %64 = add i64 %63, %.05062
  %65 = add i64 %.05062, 8
  %umax = tail call i64 @llvm.umax.i64(i64 %64, i64 %65)
  %66 = xor i64 %.05062, -1
  %67 = add i64 %umax, %66
  %68 = lshr i64 %67, 3
  %69 = add nuw nsw i64 %68, 1
  %min.iters.check = icmp ult i64 %67, 24
  br i1 %min.iters.check, label %.lr.ph.preheader64, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %69, 4611686018427387900
  %70 = shl i64 %n.vec, 3
  %ind.end = getelementptr i8, ptr %.050, i64 %70
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %11, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = shl i64 %index, 3
  %next.gep = getelementptr i8, ptr %.050, i64 %offset.idx
  %71 = getelementptr i8, ptr %next.gep, i64 16
  store <2 x i64> %broadcast.splat, ptr %next.gep, align 8, !tbaa !21
  store <2 x i64> %broadcast.splat, ptr %71, align 8, !tbaa !21
  %index.next = add nuw i64 %index, 4
  %72 = icmp eq i64 %index.next, %n.vec
  br i1 %72, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %69, %n.vec
  br i1 %cmp.n, label %._crit_edge, label %.lr.ph.preheader64

.lr.ph.preheader64:                               ; preds = %middle.block, %.lr.ph.preheader
  %.159.ph = phi ptr [ %.050, %.lr.ph.preheader ], [ %ind.end, %middle.block ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader64, %.lr.ph
  %.159 = phi ptr [ %73, %.lr.ph ], [ %.159.ph, %.lr.ph.preheader64 ]
  %73 = getelementptr inbounds i8, ptr %.159, i64 8
  store i64 %11, ptr %.159, align 8, !tbaa !21
  %74 = icmp ult ptr %73, %61
  br i1 %74, label %.lr.ph, label %._crit_edge, !llvm.loop !26

._crit_edge:                                      ; preds = %.lr.ph, %middle.block, %54
  %75 = tail call i32 @touchline(ptr noundef nonnull %0, i32 noundef %13, i32 noundef %17) #6
  tail call void @PDC_sync(ptr noundef nonnull %0) #6
  br label %76

76:                                               ; preds = %4, %._crit_edge
  %.0 = phi i32 [ 0, %._crit_edge ], [ -1, %4 ]
  ret i32 %.0
}

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #2

declare i32 @touchline(ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

declare void @PDC_sync(ptr noundef) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #4

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 = { noreturn 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { noreturn nounwind }
attributes #6 = { 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, !11, i64 50}
!6 = !{!"_win", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !10, i64 32, !10, i64 40, !11, i64 48, !11, i64 49, !11, i64 50, !11, i64 51, !11, i64 52, !11, i64 53, !11, i64 54, !12, i64 56, !12, i64 64, !12, i64 72, !7, i64 80, !7, i64 84, !7, i64 88, !7, i64 92, !7, i64 96, !12, i64 104, !7, i64 112, !7, i64 116, !7, i64 120, !7, i64 124, !7, i64 128, !7, i64 132}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!6, !10, i64 40}
!16 = !{!6, !7, i64 80}
!17 = !{!6, !7, i64 84}
!18 = !{!6, !12, i64 56}
!19 = !{!12, !12, i64 0}
!20 = !{!6, !7, i64 12}
!21 = !{!10, !10, i64 0}
!22 = distinct !{!22, !23, !24, !25}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !23, !25, !24}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass