; LLVM IR from facebook/redex :: libredex/IRInstruction.ll (ZN13IRInstruction13set_srcs_sizeEm)

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

%class.IRInstruction = type { i16, i16, i32, %union.anon.0, %union.anon.1 }
%union.anon.0 = type { i64 }
%union.anon.1 = type { ptr, [8 x i8] }

@.str.7 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN13IRInstruction13set_srcs_sizeEm = external hidden unnamed_addr constant [52 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNSt14numeric_limitsItE3maxEv() #1 align 2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #3

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #4

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN13IRInstruction13set_srcs_sizeEm(ptr noundef nonnull align 8 dereferenceable(32) %0, i64 noundef %1) #7 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i16, align 2
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca ptr, align 8
  %9 = alloca i16, align 2
  %10 = alloca ptr, align 8
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i64 %1, ptr %4, align 8, !tbaa !9
  %13 = load ptr, ptr %3, align 8
  %14 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 1
  %15 = load i16, ptr %14, align 2, !tbaa !11
  %16 = zext i16 %15 to i32
  %17 = icmp sle i32 %16, 4
  br i1 %17, label %18, label %91

18:                                               ; preds = %2
  %19 = load i64, ptr %4, align 8, !tbaa !9
  %20 = icmp ule i64 %19, 4
  br i1 %20, label %21, label %39

21:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #10
  %22 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 1
  %23 = load i16, ptr %22, align 2, !tbaa !11
  store i16 %23, ptr %5, align 2, !tbaa !16
  br label %24

24:                                               ; preds = %35, %21
  %25 = load i16, ptr %5, align 2, !tbaa !16
  %26 = zext i16 %25 to i64
  %27 = load i64, ptr %4, align 8, !tbaa !9
  %28 = icmp ult i64 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #10
  br label %38

30:                                               ; preds = %24
  %31 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 4
  %32 = load i16, ptr %5, align 2, !tbaa !16
  %33 = zext i16 %32 to i64
  %34 = getelementptr inbounds [4 x i32], ptr %31, i64 0, i64 %33
  store i32 0, ptr %34, align 4, !tbaa !17
  br label %35

35:                                               ; preds = %30
  %36 = load i16, ptr %5, align 2, !tbaa !16
  %37 = add i16 %36, 1
  store i16 %37, ptr %5, align 2, !tbaa !16
  br label %24, !llvm.loop !18

38:                                               ; preds = %29
  br label %90

39:                                               ; preds = %18
  %40 = load i64, ptr %4, align 8, !tbaa !9
  %41 = call noundef zeroext i16 @_ZNSt14numeric_limitsItE3maxEv() #10
  %42 = zext i16 %41 to i64
  %43 = icmp ult i64 %40, %42
  br i1 %43, label %44, label %45

44:                                               ; preds = %39
  br label %47

45:                                               ; preds = %39
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 173, ptr noundef @__PRETTY_FUNCTION__._ZN13IRInstruction13set_srcs_sizeEm, i32 noundef 2, ptr noundef @.str.9) #11
  unreachable

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  %48 = load i64, ptr %4, align 8, !tbaa !9
  %49 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %48, i64 4)
  %50 = extractvalue { i64, i1 } %49, 1
  %51 = extractvalue { i64, i1 } %49, 0
  %52 = select i1 %50, i64 -1, i64 %51
  %53 = call noalias noundef nonnull ptr @_Znam(i64 noundef %52) #12
  store ptr %53, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #10
  store i16 0, ptr %7, align 2, !tbaa !16
  br label %54

54:                                               ; preds = %72, %47
  %55 = load i16, ptr %7, align 2, !tbaa !16
  %56 = zext i16 %55 to i32
  %57 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 1
  %58 = load i16, ptr %57, align 2, !tbaa !11
  %59 = zext i16 %58 to i32
  %60 = icmp slt i32 %56, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #10
  br label %75

62:                                               ; preds = %54
  %63 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 4
  %64 = load i16, ptr %7, align 2, !tbaa !16
  %65 = zext i16 %64 to i64
  %66 = getelementptr inbounds [4 x i32], ptr %63, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !17
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = load i16, ptr %7, align 2, !tbaa !16
  %70 = zext i16 %69 to i64
  %71 = getelementptr inbounds i32, ptr %68, i64 %70
  store i32 %67, ptr %71, align 4, !tbaa !20
  br label %72

72:                                               ; preds = %62
  %73 = load i16, ptr %7, align 2, !tbaa !16
  %74 = add i16 %73, 1
  store i16 %74, ptr %7, align 2, !tbaa !16
  br label %54, !llvm.loop !21

75:                                               ; preds = %61
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 1
  %78 = load i16, ptr %77, align 2, !tbaa !11
  %79 = zext i16 %78 to i32
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds i32, ptr %76, i64 %80
  %82 = load i64, ptr %4, align 8, !tbaa !9
  %83 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 1
  %84 = load i16, ptr %83, align 2, !tbaa !11
  %85 = zext i16 %84 to i64
  %86 = sub i64 %82, %85
  %87 = mul i64 %86, 4
  call void @llvm.memset.p0.i64(ptr align 4 %81, i8 0, i64 %87, i1 false)
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 4
  store ptr %88, ptr %89, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  br label %90

90:                                               ; preds = %75, %38
  br label %172

91:                                               ; preds = %2
  %92 = load i64, ptr %4, align 8, !tbaa !9
  %93 = icmp ule i64 %92, 4
  br i1 %93, label %94, label %121

94:                                               ; preds = %91
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  %95 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 4
  %96 = load ptr, ptr %95, align 8, !tbaa !17
  store ptr %96, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #10
  store i16 0, ptr %9, align 2, !tbaa !16
  br label %97

97:                                               ; preds = %113, %94
  %98 = load i16, ptr %9, align 2, !tbaa !16
  %99 = zext i16 %98 to i64
  %100 = load i64, ptr %4, align 8, !tbaa !9
  %101 = icmp ult i64 %99, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #10
  br label %116

103:                                              ; preds = %97
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = load i16, ptr %9, align 2, !tbaa !16
  %106 = zext i16 %105 to i64
  %107 = getelementptr inbounds i32, ptr %104, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !20
  %109 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 4
  %110 = load i16, ptr %9, align 2, !tbaa !16
  %111 = zext i16 %110 to i64
  %112 = getelementptr inbounds [4 x i32], ptr %109, i64 0, i64 %111
  store i32 %108, ptr %112, align 4, !tbaa !17
  br label %113

113:                                              ; preds = %103
  %114 = load i16, ptr %9, align 2, !tbaa !16
  %115 = add i16 %114, 1
  store i16 %115, ptr %9, align 2, !tbaa !16
  br label %97, !llvm.loop !22

116:                                              ; preds = %102
  %117 = load ptr, ptr %8, align 8, !tbaa !5
  %118 = icmp eq ptr %117, null
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  call void @_ZdaPv(ptr noundef %117) #13
  br label %120

120:                                              ; preds = %119, %116
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  br label %171

121:                                              ; preds = %91
  %122 = load i64, ptr %4, align 8, !tbaa !9
  %123 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 1
  %124 = load i16, ptr %123, align 2, !tbaa !11
  %125 = zext i16 %124 to i64
  %126 = icmp ne i64 %122, %125
  br i1 %126, label %127, label %170

127:                                              ; preds = %121
  %128 = load i64, ptr %4, align 8, !tbaa !9
  %129 = call noundef zeroext i16 @_ZNSt14numeric_limitsItE3maxEv() #10
  %130 = zext i16 %129 to i64
  %131 = icmp ult i64 %128, %130
  br i1 %131, label %132, label %133

132:                                              ; preds = %127
  br label %135

133:                                              ; preds = %127
  call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef @.str.7, ptr noundef @.str.8, i32 noundef 191, ptr noundef @__PRETTY_FUNCTION__._ZN13IRInstruction13set_srcs_sizeEm, i32 noundef 2, ptr noundef @.str.9) #11
  unreachable

134:                                              ; No predecessors!
  br label %135

135:                                              ; preds = %134, %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #10
  %136 = load i64, ptr %4, align 8, !tbaa !9
  %137 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %136, i64 4)
  %138 = extractvalue { i64, i1 } %137, 1
  %139 = extractvalue { i64, i1 } %137, 0
  %140 = select i1 %138, i64 -1, i64 %139
  %141 = call noalias noundef nonnull ptr @_Znam(i64 noundef %140) #12
  store ptr %141, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #10
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #10
  %142 = load i64, ptr %4, align 8, !tbaa !9
  %143 = trunc i64 %142 to i16
  store i16 %143, ptr %12, align 2, !tbaa !16
  %144 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 1
  %145 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %12, ptr noundef nonnull align 2 dereferenceable(2) %144)
  %146 = load i16, ptr %145, align 2, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #10
  store i16 %146, ptr %11, align 2, !tbaa !16
  %147 = load ptr, ptr %10, align 8, !tbaa !5
  %148 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 4
  %149 = load ptr, ptr %148, align 8, !tbaa !17
  %150 = load i16, ptr %11, align 2, !tbaa !16
  %151 = zext i16 %150 to i64
  %152 = mul i64 %151, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %147, ptr align 4 %149, i64 %152, i1 false)
  %153 = load ptr, ptr %10, align 8, !tbaa !5
  %154 = load i16, ptr %11, align 2, !tbaa !16
  %155 = zext i16 %154 to i32
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds i32, ptr %153, i64 %156
  %158 = load i64, ptr %4, align 8, !tbaa !9
  %159 = load i16, ptr %11, align 2, !tbaa !16
  %160 = zext i16 %159 to i64
  %161 = sub i64 %158, %160
  %162 = mul i64 %161, 4
  call void @llvm.memset.p0.i64(ptr align 4 %157, i8 0, i64 %162, i1 false)
  %163 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 4
  %164 = load ptr, ptr %163, align 8, !tbaa !17
  %165 = icmp eq ptr %164, null
  br i1 %165, label %167, label %166

166:                                              ; preds = %135
  call void @_ZdaPv(ptr noundef %164) #13
  br label %167

167:                                              ; preds = %166, %135
  %168 = load ptr, ptr %10, align 8, !tbaa !5
  %169 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 4
  store ptr %168, ptr %169, align 8, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #10
  br label %170

170:                                              ; preds = %167, %121
  br label %171

171:                                              ; preds = %170, %120
  br label %172

172:                                              ; preds = %171, %90
  %173 = load i64, ptr %4, align 8, !tbaa !9
  %174 = trunc i64 %173 to i16
  %175 = getelementptr inbounds %class.IRInstruction, ptr %13, i32 0, i32 1
  store i16 %174, ptr %175, align 2, !tbaa !11
  ret ptr %13
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2), ptr noundef nonnull align 2 dereferenceable(2)) #9

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { noreturn "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 nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nobuiltin allocsize(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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nobuiltin 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 #7 = { mustprogress 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 #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { inlinehint mustprogress 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 #10 = { nounwind }
attributes #11 = { noreturn }
attributes #12 = { builtin allocsize(0) }
attributes #13 = { builtin 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !14, i64 2}
!12 = !{!"_ZTS13IRInstruction", !13, i64 0, !14, i64 2, !15, i64 4, !7, i64 8, !7, i64 16}
!13 = !{!"_ZTS8IROpcode", !7, i64 0}
!14 = !{!"short", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!14, !14, i64 0}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!15, !15, i64 0}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}


; 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.7 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@__PRETTY_FUNCTION__._ZN13IRInstruction13set_srcs_sizeEm = external hidden unnamed_addr constant [52 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i16 @_ZNSt14numeric_limitsItE3maxEv() local_unnamed_addr #1 align 2

; Function Attrs: noreturn
declare void @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #3

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull ptr @_ZN13IRInstruction13set_srcs_sizeEm(ptr noundef nonnull returned align 8 dereferenceable(32) %0, i64 noundef %1) local_unnamed_addr #6 align 2 {
  %3 = alloca i16, align 2
  %4 = getelementptr inbounds i8, ptr %0, i64 2
  %5 = load i16, ptr %4, align 2, !tbaa !5
  %6 = icmp ult i16 %5, 5
  %7 = icmp ult i64 %1, 5
  br i1 %6, label %8, label %42

8:                                                ; preds = %2
  br i1 %7, label %.preheader, label %26

.preheader:                                       ; preds = %8
  %9 = zext nneg i16 %5 to i64
  %10 = icmp ult i64 %9, %1
  br i1 %10, label %.lr.ph49, label %.loopexit

.lr.ph49:                                         ; preds = %.preheader
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  %12 = trunc nuw i64 %1 to i16
  %13 = add nuw nsw i16 %5, 1
  %umax = tail call i16 @llvm.umax.i16(i16 %13, i16 %12)
  %14 = xor i16 %5, -1
  %15 = add nsw i16 %umax, %14
  %16 = zext i16 %15 to i64
  %17 = add nuw nsw i64 %16, 1
  %min.iters.check = icmp ult i16 %15, 7
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph49
  %n.vec = and i64 %17, 131064
  %ind.end = or disjoint i64 %n.vec, %9
  %.cast = trunc i64 %n.vec to i16
  %ind.end56 = or disjoint i16 %5, %.cast
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %offset.idx = or disjoint i64 %index, %9
  %18 = getelementptr inbounds [4 x i32], ptr %11, i64 0, i64 %offset.idx
  %19 = getelementptr inbounds i8, ptr %18, i64 16
  store <4 x i32> zeroinitializer, ptr %18, align 4, !tbaa !12
  store <4 x i32> zeroinitializer, ptr %19, align 4, !tbaa !12
  %index.next = add nuw i64 %index, 8
  %20 = icmp eq i64 %index.next, %n.vec
  br i1 %20, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %17, %n.vec
  br i1 %cmp.n, label %.loopexit, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph49
  %.ph = phi i64 [ %9, %.lr.ph49 ], [ %ind.end, %middle.block ]
  %.048.ph = phi i16 [ %5, %.lr.ph49 ], [ %ind.end56, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %21 = phi i64 [ %24, %scalar.ph ], [ %.ph, %scalar.ph.preheader ]
  %.048 = phi i16 [ %23, %scalar.ph ], [ %.048.ph, %scalar.ph.preheader ]
  %22 = getelementptr inbounds [4 x i32], ptr %11, i64 0, i64 %21
  store i32 0, ptr %22, align 4, !tbaa !12
  %23 = add nuw i16 %.048, 1
  %24 = zext i16 %23 to i64
  %25 = icmp ult i16 %23, %12
  br i1 %25, label %scalar.ph, label %.loopexit, !llvm.loop !17

26:                                               ; preds = %8
  %27 = tail call noundef zeroext i16 @_ZNSt14numeric_limitsItE3maxEv() #10
  %28 = zext i16 %27 to i64
  %29 = icmp ugt i64 %28, %1
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  tail call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 173, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13IRInstruction13set_srcs_sizeEm, i32 noundef 2, ptr noundef nonnull @.str.9) #11
  unreachable

31:                                               ; preds = %26
  %32 = shl nuw nsw i64 %1, 2
  %33 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %32) #12
  %34 = load i16, ptr %4, align 2, !tbaa !5
  %.not51 = icmp eq i16 %34, 0
  br i1 %.not51, label %._crit_edge47, label %.lr.ph46

.lr.ph46:                                         ; preds = %31
  %35 = getelementptr inbounds i8, ptr %0, i64 16
  %36 = zext i16 %34 to i64
  %37 = shl nuw nsw i64 %36, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %33, ptr nonnull align 8 %35, i64 %37, i1 false), !tbaa !12
  br label %._crit_edge47

._crit_edge47:                                    ; preds = %31, %.lr.ph46
  %.pre-phi = phi i64 [ %36, %.lr.ph46 ], [ 0, %31 ]
  %38 = getelementptr inbounds i32, ptr %33, i64 %.pre-phi
  %39 = sub nsw i64 %1, %.pre-phi
  %40 = shl nsw i64 %39, 2
  tail call void @llvm.memset.p0.i64(ptr nonnull align 4 %38, i8 0, i64 %40, i1 false)
  %41 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %33, ptr %41, align 8, !tbaa !12
  br label %.loopexit

42:                                               ; preds = %2
  br i1 %7, label %43, label %57

43:                                               ; preds = %42
  %44 = getelementptr inbounds i8, ptr %0, i64 16
  %45 = load ptr, ptr %44, align 8, !tbaa !12
  %.not50 = icmp eq i64 %1, 0
  br i1 %.not50, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %43
  %46 = icmp eq ptr %45, null
  br i1 %46, label %.loopexit, label %._crit_edge.thread

.lr.ph:                                           ; preds = %43
  %47 = load i32, ptr %45, align 4, !tbaa !18
  store i32 %47, ptr %44, align 8, !tbaa !12
  %exitcond.not = icmp eq i64 %1, 1
  br i1 %exitcond.not, label %._crit_edge.thread, label %.lr.ph.1, !llvm.loop !19

.lr.ph.1:                                         ; preds = %.lr.ph
  %48 = getelementptr inbounds i8, ptr %45, i64 4
  %49 = load i32, ptr %48, align 4, !tbaa !18
  %50 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %49, ptr %50, align 4, !tbaa !12
  %exitcond.not.1 = icmp eq i64 %1, 2
  br i1 %exitcond.not.1, label %._crit_edge.thread, label %.lr.ph.2, !llvm.loop !19

.lr.ph.2:                                         ; preds = %.lr.ph.1
  %51 = getelementptr inbounds i8, ptr %45, i64 8
  %52 = load i32, ptr %51, align 4, !tbaa !18
  %53 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %52, ptr %53, align 8, !tbaa !12
  %exitcond.not.2 = icmp eq i64 %1, 3
  br i1 %exitcond.not.2, label %._crit_edge.thread, label %.lr.ph.3, !llvm.loop !19

.lr.ph.3:                                         ; preds = %.lr.ph.2
  %54 = getelementptr inbounds i8, ptr %45, i64 12
  %55 = load i32, ptr %54, align 4, !tbaa !18
  %56 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 %55, ptr %56, align 4, !tbaa !12
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.lr.ph, %.lr.ph.1, %.lr.ph.2, %.lr.ph.3, %._crit_edge
  tail call void @_ZdaPv(ptr noundef nonnull %45) #13
  br label %.loopexit

57:                                               ; preds = %42
  %58 = zext i16 %5 to i64
  %.not = icmp eq i64 %58, %1
  br i1 %.not, label %.loopexit, label %59

59:                                               ; preds = %57
  %60 = tail call noundef zeroext i16 @_ZNSt14numeric_limitsItE3maxEv() #10
  %61 = zext i16 %60 to i64
  %62 = icmp ugt i64 %61, %1
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  tail call void (ptr, ptr, i32, ptr, i32, ptr, ...) @_Z11assert_failPKcS0_jS0_10RedexErrorS0_z(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, i32 noundef 191, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN13IRInstruction13set_srcs_sizeEm, i32 noundef 2, ptr noundef nonnull @.str.9) #11
  unreachable

64:                                               ; preds = %59
  %65 = shl nuw nsw i64 %1, 2
  %66 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %65) #12
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %3) #10
  %67 = trunc nuw i64 %1 to i16
  store i16 %67, ptr %3, align 2, !tbaa !20
  %68 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %3, ptr noundef nonnull align 2 dereferenceable(2) %4)
  %69 = load i16, ptr %68, align 2, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #10
  %70 = getelementptr inbounds i8, ptr %0, i64 16
  %71 = load ptr, ptr %70, align 8, !tbaa !12
  %72 = zext i16 %69 to i64
  %73 = shl nuw nsw i64 %72, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %66, ptr align 4 %71, i64 %73, i1 false)
  %74 = getelementptr inbounds i32, ptr %66, i64 %72
  %75 = sub nsw i64 %1, %72
  %76 = shl nsw i64 %75, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 %74, i8 0, i64 %76, i1 false)
  %77 = icmp eq ptr %71, null
  br i1 %77, label %79, label %78

78:                                               ; preds = %64
  call void @_ZdaPv(ptr noundef nonnull %71) #13
  br label %79

79:                                               ; preds = %78, %64
  store ptr %66, ptr %70, align 8, !tbaa !12
  br label %.loopexit

.loopexit:                                        ; preds = %scalar.ph, %middle.block, %.preheader, %._crit_edge, %._crit_edge.thread, %79, %57, %._crit_edge47
  %80 = trunc i64 %1 to i16
  store i16 %80, ptr %4, align 2, !tbaa !5
  ret ptr %0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2), ptr noundef nonnull align 2 dereferenceable(2)) local_unnamed_addr #8

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { noreturn "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 = { nobuiltin allocsize(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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nobuiltin 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 #6 = { mustprogress 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { inlinehint mustprogress 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #10 = { nounwind }
attributes #11 = { noreturn }
attributes #12 = { builtin allocsize(0) }
attributes #13 = { builtin 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, !10, i64 2}
!6 = !{!"_ZTS13IRInstruction", !7, i64 0, !10, i64 2, !11, i64 4, !8, i64 8, !8, i64 16}
!7 = !{!"_ZTS8IROpcode", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!8, !8, i64 0}
!13 = distinct !{!13, !14, !15, !16}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !14, !16, !15}
!18 = !{!11, !11, i64 0}
!19 = distinct !{!19, !14}
!20 = !{!10, !10, i64 0}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass