; LLVM IR from clangen/musikcube :: src/3rdparty/win32_src/pdcurses/overlay.ll (copy_overlap)

; 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 [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@__PRETTY_FUNCTION__._copy_overlap = external hidden unnamed_addr constant [51 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @_copy_overlap(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %19 = zext i1 %2 to i8
  store i8 %19, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %3
  br label %24

23:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 111, ptr noundef @__PRETTY_FUNCTION__._copy_overlap) #4
  unreachable

24:                                               ; preds = %22
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %24
  br label %29

28:                                               ; preds = %24
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 112, ptr noundef @__PRETTY_FUNCTION__._copy_overlap) #4
  unreachable

29:                                               ; preds = %27
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %35

32:                                               ; preds = %29
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %36, label %35

35:                                               ; preds = %32, %29
  store i32 -1, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %215

36:                                               ; preds = %32
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._win, ptr %37, i32 0, i32 5
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct._win, ptr %40, i32 0, i32 5
  %42 = load i32, ptr %41, align 4, !tbaa !11
  %43 = icmp sgt i32 %39, %42
  br i1 %43, label %44, label %48

44:                                               ; preds = %36
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._win, ptr %45, i32 0, i32 5
  %47 = load i32, ptr %46, align 4, !tbaa !11
  br label %52

48:                                               ; preds = %36
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._win, ptr %49, i32 0, i32 5
  %51 = load i32, ptr %50, align 4, !tbaa !11
  br label %52

52:                                               ; preds = %48, %44
  %53 = phi i32 [ %47, %44 ], [ %51, %48 ]
  store i32 %53, ptr %9, align 4, !tbaa !15
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._win, ptr %54, i32 0, i32 4
  %56 = load i32, ptr %55, align 8, !tbaa !16
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._win, ptr %57, i32 0, i32 4
  %59 = load i32, ptr %58, align 8, !tbaa !16
  %60 = icmp sgt i32 %56, %59
  br i1 %60, label %61, label %65

61:                                               ; preds = %52
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._win, ptr %62, i32 0, i32 4
  %64 = load i32, ptr %63, align 8, !tbaa !16
  br label %69

65:                                               ; preds = %52
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct._win, ptr %66, i32 0, i32 4
  %68 = load i32, ptr %67, align 8, !tbaa !16
  br label %69

69:                                               ; preds = %65, %61
  %70 = phi i32 [ %64, %61 ], [ %68, %65 ]
  store i32 %70, ptr %8, align 4, !tbaa !15
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct._win, ptr %71, i32 0, i32 5
  %73 = load i32, ptr %72, align 4, !tbaa !11
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct._win, ptr %74, i32 0, i32 3
  %76 = load i32, ptr %75, align 4, !tbaa !17
  %77 = add nsw i32 %73, %76
  %78 = load ptr, ptr %6, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct._win, ptr %78, i32 0, i32 5
  %80 = load i32, ptr %79, align 4, !tbaa !11
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct._win, ptr %81, i32 0, i32 3
  %83 = load i32, ptr %82, align 4, !tbaa !17
  %84 = add nsw i32 %80, %83
  %85 = icmp slt i32 %77, %84
  br i1 %85, label %86, label %94

86:                                               ; preds = %69
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct._win, ptr %87, i32 0, i32 5
  %89 = load i32, ptr %88, align 4, !tbaa !11
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct._win, ptr %90, i32 0, i32 3
  %92 = load i32, ptr %91, align 4, !tbaa !17
  %93 = add nsw i32 %89, %92
  br label %102

94:                                               ; preds = %69
  %95 = load ptr, ptr %6, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct._win, ptr %95, i32 0, i32 5
  %97 = load i32, ptr %96, align 4, !tbaa !11
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct._win, ptr %98, i32 0, i32 3
  %100 = load i32, ptr %99, align 4, !tbaa !17
  %101 = add nsw i32 %97, %100
  br label %102

102:                                              ; preds = %94, %86
  %103 = phi i32 [ %93, %86 ], [ %101, %94 ]
  store i32 %103, ptr %11, align 4, !tbaa !15
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct._win, ptr %104, i32 0, i32 4
  %106 = load i32, ptr %105, align 8, !tbaa !16
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct._win, ptr %107, i32 0, i32 2
  %109 = load i32, ptr %108, align 8, !tbaa !18
  %110 = add nsw i32 %106, %109
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct._win, ptr %111, i32 0, i32 4
  %113 = load i32, ptr %112, align 8, !tbaa !16
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct._win, ptr %114, i32 0, i32 2
  %116 = load i32, ptr %115, align 8, !tbaa !18
  %117 = add nsw i32 %113, %116
  %118 = icmp slt i32 %110, %117
  br i1 %118, label %119, label %127

119:                                              ; preds = %102
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct._win, ptr %120, i32 0, i32 4
  %122 = load i32, ptr %121, align 8, !tbaa !16
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct._win, ptr %123, i32 0, i32 2
  %125 = load i32, ptr %124, align 8, !tbaa !18
  %126 = add nsw i32 %122, %125
  br label %135

127:                                              ; preds = %102
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct._win, ptr %128, i32 0, i32 4
  %130 = load i32, ptr %129, align 8, !tbaa !16
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct._win, ptr %131, i32 0, i32 2
  %133 = load i32, ptr %132, align 8, !tbaa !18
  %134 = add nsw i32 %130, %133
  br label %135

135:                                              ; preds = %127, %119
  %136 = phi i32 [ %126, %119 ], [ %134, %127 ]
  store i32 %136, ptr %10, align 4, !tbaa !15
  %137 = load i32, ptr %11, align 4, !tbaa !15
  %138 = load i32, ptr %9, align 4, !tbaa !15
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %144, label %140

140:                                              ; preds = %135
  %141 = load i32, ptr %10, align 4, !tbaa !15
  %142 = load i32, ptr %8, align 4, !tbaa !15
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %144, label %145

144:                                              ; preds = %140, %135
  store i32 0, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %215

145:                                              ; preds = %140
  %146 = load i32, ptr %11, align 4, !tbaa !15
  %147 = load i32, ptr %9, align 4, !tbaa !15
  %148 = sub nsw i32 %146, %147
  store i32 %148, ptr %16, align 4, !tbaa !15
  %149 = load i32, ptr %10, align 4, !tbaa !15
  %150 = load i32, ptr %8, align 4, !tbaa !15
  %151 = sub nsw i32 %149, %150
  store i32 %151, ptr %17, align 4, !tbaa !15
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct._win, ptr %152, i32 0, i32 5
  %154 = load i32, ptr %153, align 4, !tbaa !11
  %155 = load ptr, ptr %6, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct._win, ptr %155, i32 0, i32 5
  %157 = load i32, ptr %156, align 4, !tbaa !11
  %158 = icmp sle i32 %154, %157
  br i1 %158, label %159, label %167

159:                                              ; preds = %145
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct._win, ptr %160, i32 0, i32 5
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct._win, ptr %163, i32 0, i32 5
  %165 = load i32, ptr %164, align 4, !tbaa !11
  %166 = sub nsw i32 %162, %165
  store i32 %166, ptr %12, align 4, !tbaa !15
  store i32 0, ptr %14, align 4, !tbaa !15
  br label %175

167:                                              ; preds = %145
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct._win, ptr %168, i32 0, i32 5
  %170 = load i32, ptr %169, align 4, !tbaa !11
  %171 = load ptr, ptr %6, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct._win, ptr %171, i32 0, i32 5
  %173 = load i32, ptr %172, align 4, !tbaa !11
  %174 = sub nsw i32 %170, %173
  store i32 %174, ptr %14, align 4, !tbaa !15
  store i32 0, ptr %12, align 4, !tbaa !15
  br label %175

175:                                              ; preds = %167, %159
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct._win, ptr %176, i32 0, i32 4
  %178 = load i32, ptr %177, align 8, !tbaa !16
  %179 = load ptr, ptr %6, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct._win, ptr %179, i32 0, i32 4
  %181 = load i32, ptr %180, align 8, !tbaa !16
  %182 = icmp sle i32 %178, %181
  br i1 %182, label %183, label %191

183:                                              ; preds = %175
  %184 = load ptr, ptr %6, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct._win, ptr %184, i32 0, i32 4
  %186 = load i32, ptr %185, align 8, !tbaa !16
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct._win, ptr %187, i32 0, i32 4
  %189 = load i32, ptr %188, align 8, !tbaa !16
  %190 = sub nsw i32 %186, %189
  store i32 %190, ptr %13, align 4, !tbaa !15
  store i32 0, ptr %15, align 4, !tbaa !15
  br label %199

191:                                              ; preds = %175
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct._win, ptr %192, i32 0, i32 4
  %194 = load i32, ptr %193, align 8, !tbaa !16
  %195 = load ptr, ptr %6, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct._win, ptr %195, i32 0, i32 4
  %197 = load i32, ptr %196, align 8, !tbaa !16
  %198 = sub nsw i32 %194, %197
  store i32 %198, ptr %15, align 4, !tbaa !15
  store i32 0, ptr %13, align 4, !tbaa !15
  br label %199

199:                                              ; preds = %191, %183
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = load ptr, ptr %6, align 8, !tbaa !5
  %202 = load i32, ptr %13, align 4, !tbaa !15
  %203 = load i32, ptr %12, align 4, !tbaa !15
  %204 = load i32, ptr %13, align 4, !tbaa !15
  %205 = load i32, ptr %17, align 4, !tbaa !15
  %206 = add nsw i32 %204, %205
  %207 = load i32, ptr %12, align 4, !tbaa !15
  %208 = load i32, ptr %16, align 4, !tbaa !15
  %209 = add nsw i32 %207, %208
  %210 = load i32, ptr %15, align 4, !tbaa !15
  %211 = load i32, ptr %14, align 4, !tbaa !15
  %212 = load i8, ptr %7, align 1, !tbaa !9, !range !19, !noundef !20
  %213 = trunc i8 %212 to i1
  %214 = call i32 @_copy_win(ptr noundef %200, ptr noundef %201, i32 noundef %202, i32 noundef %203, i32 noundef %206, i32 noundef %209, i32 noundef %210, i32 noundef %211, i1 noundef zeroext %213)
  store i32 %214, ptr %4, align 4
  store i32 1, ptr %18, align 4
  br label %215

215:                                              ; preds = %199, %144, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %216 = load i32, ptr %4, align 4
  ret i32 %216
}

; 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: nounwind uwtable
declare hidden i32 @_copy_win(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) #0

; 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 = { nounwind }
attributes #4 = { 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 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !13, i64 20}
!12 = !{!"_win", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20, !13, i64 24, !14, i64 32, !14, i64 40, !10, i64 48, !10, i64 49, !10, i64 50, !10, i64 51, !10, i64 52, !10, i64 53, !10, i64 54, !6, i64 56, !6, i64 64, !6, i64 72, !13, i64 80, !13, i64 84, !13, i64 88, !13, i64 92, !13, i64 96, !6, i64 104, !13, i64 112, !13, i64 116, !13, i64 120, !13, i64 124, !13, i64 128, !13, i64 132}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!12, !13, i64 16}
!17 = !{!12, !13, i64 12}
!18 = !{!12, !13, i64 8}
!19 = !{i8 0, i8 2}
!20 = !{}


; 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 [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [93 x i8], align 1
@__PRETTY_FUNCTION__._copy_overlap = external hidden unnamed_addr constant [51 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @_copy_overlap(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %4, label %5

4:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 111, ptr noundef nonnull @__PRETTY_FUNCTION__._copy_overlap) #3
  unreachable

5:                                                ; preds = %3
  %.not85 = icmp eq ptr %1, null
  br i1 %.not85, label %6, label %7

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

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %1, i64 20
  %9 = load i32, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 20
  %11 = load i32, ptr %10, align 4, !tbaa !5
  %. = tail call i32 @llvm.smax.i32(i32 %9, i32 %11)
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = load i32, ptr %12, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  %15 = load i32, ptr %14, align 8, !tbaa !13
  %16 = tail call i32 @llvm.smax.i32(i32 %13, i32 %15)
  %17 = getelementptr inbounds i8, ptr %0, i64 12
  %18 = load i32, ptr %17, align 4, !tbaa !14
  %19 = add nsw i32 %18, %11
  %20 = getelementptr inbounds i8, ptr %1, i64 12
  %21 = load i32, ptr %20, align 4, !tbaa !14
  %22 = add nsw i32 %21, %9
  %23 = tail call i32 @llvm.smin.i32(i32 %19, i32 %22)
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !15
  %26 = add nsw i32 %25, %15
  %27 = getelementptr inbounds i8, ptr %1, i64 8
  %28 = load i32, ptr %27, align 8, !tbaa !15
  %29 = add nsw i32 %28, %13
  %30 = tail call i32 @llvm.smin.i32(i32 %26, i32 %29)
  %31 = icmp slt i32 %23, %.
  %32 = icmp slt i32 %30, %16
  %or.cond = select i1 %31, i1 true, i1 %32
  br i1 %or.cond, label %43, label %33

33:                                               ; preds = %7
  %.not86 = icmp sgt i32 %11, %9
  %34 = sub nsw i32 %9, %11
  %35 = sub nsw i32 %11, %9
  %.062 = select i1 %.not86, i32 %35, i32 0
  %.060 = select i1 %.not86, i32 0, i32 %34
  %.not87 = icmp sgt i32 %15, %13
  %36 = sub nsw i32 %13, %15
  %37 = sub nsw i32 %15, %13
  %.063 = select i1 %.not87, i32 0, i32 %36
  %.061 = select i1 %.not87, i32 %37, i32 0
  %38 = sub i32 %.063, %16
  %39 = add i32 %38, %30
  %40 = sub i32 %.060, %.
  %41 = add i32 %40, %23
  %42 = tail call i32 @_copy_win(ptr noundef nonnull %0, ptr noundef nonnull %1, i32 noundef %.063, i32 noundef %.060, i32 noundef %39, i32 noundef %41, i32 noundef %.061, i32 noundef %.062, i1 noundef zeroext %2)
  br label %43

43:                                               ; preds = %7, %33
  %.0 = phi i32 [ %42, %33 ], [ 0, %7 ]
  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: nounwind uwtable
declare hidden i32 @_copy_win(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #0

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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, !7, i64 20}
!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 = !{!6, !7, i64 16}
!14 = !{!6, !7, i64 12}
!15 = !{!6, !7, i64 8}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass