; LLVM IR from jingweizhanghuai/Morn :: src/wave (morn_wave)

; 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.HandleList = type { %struct.MList, i32, i32, i32, i32 }
%struct.MList = type { i32, ptr }
%struct.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleWaveCreate = type { ptr, ptr, i32, i32, [32 x ptr], ptr }
%struct.MWave = type { i32, i32, [32 x ptr] }

@.str = external hidden unnamed_addr constant [76 x i8], align 1
@__FUNCTION__.mWaveCreate = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

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

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

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @mWaveCreate(i32 noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca [32 x ptr], align 16
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %15 = call ptr @ObjectAlloc(i32 noundef 264)
  store ptr %15, ptr %7, align 8, !tbaa !9
  %16 = load ptr, ptr %7, align 8, !tbaa !9
  %17 = getelementptr inbounds %struct.HandleList, ptr %16, i64 -1
  %18 = getelementptr inbounds %struct.HandleList, ptr %17, i32 0, i32 4
  store i32 -1601463196, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %19 = load ptr, ptr %7, align 8, !tbaa !9
  %20 = call ptr @GetHandle(ptr noundef %19, i32 noundef 288, i32 noundef -1601463196, ptr noundef @endWaveCreate)
  store ptr %20, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %21 = load ptr, ptr %8, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct.MHandle, ptr %21, i32 0, i32 3
  %23 = load ptr, ptr %22, align 8, !tbaa !14
  store ptr %23, ptr %9, align 8, !tbaa !9
  %24 = load ptr, ptr %7, align 8, !tbaa !9
  %25 = load ptr, ptr %9, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.HandleWaveCreate, ptr %25, i32 0, i32 0
  store ptr %24, ptr %26, align 8, !tbaa !16
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 0
  br i1 %28, label %29, label %30

29:                                               ; preds = %3
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %29, %3
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %33, %30
  br label %35

35:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %36 = load i32, ptr %4, align 4, !tbaa !5
  %37 = icmp sgt i32 %36, 32
  %38 = zext i1 %37 to i32
  store i32 %38, ptr %10, align 4, !tbaa !5
  %39 = load i32, ptr %10, align 4, !tbaa !5
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %35
  %42 = load i32, ptr %10, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %42, i32 noundef -1, ptr noundef @.str, i32 noundef 36, ptr noundef @__FUNCTION__.mWaveCreate, ptr noundef @.str.2)
  br label %43

43:                                               ; preds = %41, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %44

44:                                               ; preds = %43
  br label %45

45:                                               ; preds = %44
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.MWave, ptr %47, i32 0, i32 1
  store i32 %46, ptr %48, align 4, !tbaa !18
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = load ptr, ptr %7, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.MWave, ptr %50, i32 0, i32 0
  store i32 %49, ptr %51, align 8, !tbaa !20
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = icmp eq i32 %52, 0
  br i1 %53, label %57, label %54

54:                                               ; preds = %45
  %55 = load i32, ptr %4, align 4, !tbaa !5
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %79

57:                                               ; preds = %54, %45
  br label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %59 = load ptr, ptr %6, align 8, !tbaa !9
  %60 = icmp eq ptr %59, null
  br i1 %60, label %65, label %61

61:                                               ; preds = %58
  %62 = load ptr, ptr %6, align 8, !tbaa !9
  %63 = ptrtoint ptr %62 to i64
  %64 = icmp eq i64 %63, -1
  br label %65

65:                                               ; preds = %61, %58
  %66 = phi i1 [ true, %58 ], [ %64, %61 ]
  %67 = xor i1 %66, true
  %68 = zext i1 %67 to i32
  store i32 %68, ptr %11, align 4, !tbaa !5
  %69 = load i32, ptr %11, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %65
  %72 = load i32, ptr %11, align 4, !tbaa !5
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %72, i32 noundef -1, ptr noundef @.str, i32 noundef 41, ptr noundef @__FUNCTION__.mWaveCreate, ptr noundef @.str.2)
  br label %73

73:                                               ; preds = %71, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %74

74:                                               ; preds = %73
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr %7, align 8, !tbaa !9
  %77 = getelementptr inbounds %struct.MWave, ptr %76, i32 0, i32 2
  %78 = getelementptr inbounds [32 x ptr], ptr %77, i64 0, i64 0
  call void @llvm.memset.p0.i64(ptr align 8 %78, i8 0, i64 256, i1 false)
  br label %167

79:                                               ; preds = %54
  %80 = load ptr, ptr %6, align 8, !tbaa !9
  %81 = icmp eq ptr %80, null
  br i1 %81, label %86, label %82

82:                                               ; preds = %79
  %83 = load ptr, ptr %6, align 8, !tbaa !9
  %84 = ptrtoint ptr %83 to i64
  %85 = icmp eq i64 %84, -1
  br i1 %85, label %86, label %158

86:                                               ; preds = %82, %79
  %87 = load i32, ptr %5, align 4, !tbaa !5
  %88 = add nsw i32 %87, 32
  store i32 %88, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %103, %86
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = icmp slt i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %106

94:                                               ; preds = %89
  %95 = load ptr, ptr %9, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.HandleWaveCreate, ptr %95, i32 0, i32 4
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [32 x ptr], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %13, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [32 x ptr], ptr %12, i64 0, i64 %101
  store ptr %99, ptr %102, align 8, !tbaa !9
  br label %103

103:                                              ; preds = %94
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %13, align 4, !tbaa !5
  br label %89, !llvm.loop !21

106:                                              ; preds = %93
  %107 = load ptr, ptr %9, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.HandleWaveCreate, ptr %107, i32 0, i32 5
  %109 = load ptr, ptr %108, align 8, !tbaa !23
  %110 = icmp eq ptr %109, null
  br i1 %110, label %111, label %120

111:                                              ; preds = %106
  %112 = load i32, ptr %4, align 4, !tbaa !5
  %113 = load i32, ptr %5, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = mul i64 %114, 4
  %116 = trunc i64 %115 to i32
  %117 = call ptr @mMemoryCreate(i32 noundef %112, i32 noundef %116, i32 noundef 0)
  %118 = load ptr, ptr %9, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.HandleWaveCreate, ptr %118, i32 0, i32 5
  store ptr %117, ptr %119, align 8, !tbaa !23
  br label %120

120:                                              ; preds = %111, %106
  %121 = load ptr, ptr %9, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.HandleWaveCreate, ptr %121, i32 0, i32 5
  %123 = load ptr, ptr %122, align 8, !tbaa !23
  %124 = load i32, ptr %5, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = mul i64 %125, 4
  %127 = trunc i64 %126 to i32
  %128 = getelementptr inbounds [32 x ptr], ptr %12, i64 0, i64 0
  %129 = load i32, ptr %4, align 4, !tbaa !5
  call void @mMemoryIndex(ptr noundef %123, i32 noundef 1, i32 noundef %127, ptr noundef %128, i32 noundef %129)
  %130 = load i32, ptr %5, align 4, !tbaa !5
  %131 = load ptr, ptr %9, align 8, !tbaa !9
  %132 = getelementptr inbounds %struct.HandleWaveCreate, ptr %131, i32 0, i32 3
  store i32 %130, ptr %132, align 4, !tbaa !24
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = load ptr, ptr %9, align 8, !tbaa !9
  %135 = getelementptr inbounds %struct.HandleWaveCreate, ptr %134, i32 0, i32 2
  store i32 %133, ptr %135, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %136

136:                                              ; preds = %154, %120
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = load i32, ptr %4, align 4, !tbaa !5
  %139 = icmp slt i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %157

141:                                              ; preds = %136
  %142 = load ptr, ptr %9, align 8, !tbaa !9
  %143 = getelementptr inbounds %struct.HandleWaveCreate, ptr %142, i32 0, i32 4
  %144 = load i32, ptr %14, align 4, !tbaa !5
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [32 x ptr], ptr %143, i64 0, i64 %145
  %147 = load ptr, ptr %146, align 8, !tbaa !9
  %148 = getelementptr inbounds float, ptr %147, i64 16
  %149 = load ptr, ptr %7, align 8, !tbaa !9
  %150 = getelementptr inbounds %struct.MWave, ptr %149, i32 0, i32 2
  %151 = load i32, ptr %14, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [32 x ptr], ptr %150, i64 0, i64 %152
  store ptr %148, ptr %153, align 8, !tbaa !9
  br label %154

154:                                              ; preds = %141
  %155 = load i32, ptr %14, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %14, align 4, !tbaa !5
  br label %136, !llvm.loop !26

157:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 256, ptr %12) #5
  br label %166

158:                                              ; preds = %82
  %159 = load ptr, ptr %7, align 8, !tbaa !9
  %160 = getelementptr inbounds %struct.MWave, ptr %159, i32 0, i32 2
  %161 = getelementptr inbounds [32 x ptr], ptr %160, i64 0, i64 0
  %162 = load ptr, ptr %6, align 8, !tbaa !9
  %163 = load i32, ptr %4, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = mul i64 8, %164
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %161, ptr align 8 %162, i64 %165, i1 false)
  br label %166

166:                                              ; preds = %158, %157
  br label %167

167:                                              ; preds = %166, %75
  %168 = load ptr, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret ptr %168
}

declare ptr @ObjectAlloc(i32 noundef) #2

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

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

declare void @mMemoryIndex(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) #2

; 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) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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, !6, i64 28}
!12 = !{!"HandleList", !13, i64 0, !6, i64 16, !6, i64 20, !6, i64 24, !6, i64 28}
!13 = !{!"MList", !6, i64 0, !10, i64 8}
!14 = !{!15, !10, i64 16}
!15 = !{!"MHandle", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16}
!16 = !{!17, !10, i64 0}
!17 = !{!"HandleWaveCreate", !10, i64 0, !10, i64 8, !6, i64 16, !6, i64 20, !7, i64 24, !10, i64 280}
!18 = !{!19, !6, i64 4}
!19 = !{!"MWave", !6, i64 0, !6, i64 4, !7, i64 8}
!20 = !{!19, !6, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!17, !10, i64 280}
!24 = !{!17, !6, i64 20}
!25 = !{!17, !6, i64 16}
!26 = distinct !{!26, !22}


; 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 [76 x i8], align 1
@__FUNCTION__.mWaveCreate = external hidden unnamed_addr constant [12 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [14 x i8], align 1

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @mWaveCreate(i32 noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca [32 x ptr], align 16
  %5 = tail call ptr @ObjectAlloc(i32 noundef 264) #6
  %6 = ptrtoint ptr %5 to i64
  %7 = getelementptr inbounds i8, ptr %5, i64 -4
  store i32 -1601463196, ptr %7, align 4, !tbaa !5
  %8 = tail call ptr @GetHandle(ptr noundef %5, i32 noundef 288, i32 noundef -1601463196, ptr noundef nonnull @endWaveCreate) #6
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %11 = ptrtoint ptr %10 to i64
  store ptr %5, ptr %10, align 8, !tbaa !14
  %spec.store.select = tail call i32 @llvm.smax.i32(i32 %1, i32 0)
  %spec.store.select5 = tail call i32 @llvm.smax.i32(i32 %0, i32 0)
  %12 = icmp sgt i32 %0, 32
  br i1 %12, label %13, label %14

13:                                               ; preds = %3
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 36, ptr noundef nonnull @__FUNCTION__.mWaveCreate, ptr noundef nonnull @.str.2) #6
  br label %14

14:                                               ; preds = %13, %3
  %15 = getelementptr inbounds i8, ptr %5, i64 4
  store i32 %spec.store.select, ptr %15, align 4, !tbaa !16
  store i32 %spec.store.select5, ptr %5, align 8, !tbaa !18
  %16 = icmp slt i32 %1, 1
  %17 = icmp slt i32 %0, 1
  %or.cond = or i1 %17, %16
  %magicptr = ptrtoint ptr %2 to i64
  br i1 %or.cond, label %18, label %25

18:                                               ; preds = %14
  switch i64 %magicptr, label %19 [
    i64 -1, label %23
    i64 0, label %23
  ]

19:                                               ; preds = %18
  %20 = icmp ne ptr %2, null
  %21 = icmp ne ptr %2, inttoptr (i64 -1 to ptr)
  %.not59 = and i1 %20, %21
  %22 = zext i1 %.not59 to i32
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %22, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 41, ptr noundef nonnull @__FUNCTION__.mWaveCreate, ptr noundef nonnull @.str.2) #6
  br label %23

23:                                               ; preds = %18, %18, %19
  %24 = getelementptr inbounds i8, ptr %5, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(256) %24, i8 0, i64 256, i1 false)
  br label %81

25:                                               ; preds = %14
  switch i64 %magicptr, label %77 [
    i64 -1, label %.lr.ph
    i64 0, label %.lr.ph
  ]

.lr.ph:                                           ; preds = %25, %25
  %26 = add nuw nsw i32 %spec.store.select, 32
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #6
  %27 = getelementptr inbounds i8, ptr %10, i64 24
  %wide.trip.count = zext nneg i32 %0 to i64
  %min.iters.check = icmp ult i32 %0, 4
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %28 = getelementptr inbounds [32 x ptr], ptr %27, i64 0, <2 x i64> %vec.ind
  %29 = getelementptr inbounds [32 x ptr], ptr %27, i64 0, <2 x i64> %step.add
  %30 = getelementptr inbounds [32 x ptr], ptr %4, i64 0, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store <2 x ptr> %28, ptr %30, align 16, !tbaa !19
  store <2 x ptr> %29, ptr %31, align 16, !tbaa !19
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %32 = icmp eq i64 %index.next, %n.vec
  br i1 %32, label %middle.block, label %vector.body, !llvm.loop !20

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

._crit_edge:                                      ; preds = %scalar.ph, %middle.block
  %33 = getelementptr inbounds i8, ptr %10, i64 280
  %34 = load ptr, ptr %33, align 8, !tbaa !24
  %35 = icmp eq ptr %34, null
  %36 = shl i32 %26, 2
  br i1 %35, label %39, label %.lr.ph64

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %37 = getelementptr inbounds [32 x ptr], ptr %27, i64 0, i64 %indvars.iv
  %38 = getelementptr inbounds [32 x ptr], ptr %4, i64 0, i64 %indvars.iv
  store ptr %37, ptr %38, align 8, !tbaa !19
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !25

39:                                               ; preds = %._crit_edge
  %40 = tail call ptr @mMemoryCreate(i32 noundef %spec.store.select5, i32 noundef %36, i32 noundef 0) #6
  store ptr %40, ptr %33, align 8, !tbaa !24
  br label %.lr.ph64

.lr.ph64:                                         ; preds = %._crit_edge, %39
  %41 = phi ptr [ %40, %39 ], [ %34, %._crit_edge ]
  call void @mMemoryIndex(ptr noundef %41, i32 noundef 1, i32 noundef %36, ptr noundef nonnull %4, i32 noundef %spec.store.select5) #6
  %42 = getelementptr inbounds i8, ptr %10, i64 20
  store i32 %26, ptr %42, align 4, !tbaa !26
  %43 = getelementptr inbounds i8, ptr %10, i64 16
  store i32 %spec.store.select5, ptr %43, align 8, !tbaa !27
  %44 = getelementptr inbounds i8, ptr %10, i64 24
  %45 = getelementptr inbounds i8, ptr %5, i64 8
  %wide.trip.count70 = zext nneg i32 %0 to i64
  %min.iters.check75 = icmp ult i32 %0, 8
  br i1 %min.iters.check75, label %scalar.ph74.preheader, label %vector.memcheck

scalar.ph74.preheader:                            ; preds = %middle.block73, %vector.memcheck, %.lr.ph64
  %indvars.iv67.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph64 ], [ %n.vec78, %middle.block73 ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %scalar.ph74.prol.loopexit, label %scalar.ph74.prol

scalar.ph74.prol:                                 ; preds = %scalar.ph74.preheader, %scalar.ph74.prol
  %indvars.iv67.prol = phi i64 [ %indvars.iv.next68.prol, %scalar.ph74.prol ], [ %indvars.iv67.ph, %scalar.ph74.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %scalar.ph74.prol ], [ 0, %scalar.ph74.preheader ]
  %46 = getelementptr inbounds [32 x ptr], ptr %44, i64 0, i64 %indvars.iv67.prol
  %47 = load ptr, ptr %46, align 8, !tbaa !19
  %48 = getelementptr inbounds i8, ptr %47, i64 64
  %49 = getelementptr inbounds [32 x ptr], ptr %45, i64 0, i64 %indvars.iv67.prol
  store ptr %48, ptr %49, align 8, !tbaa !19
  %indvars.iv.next68.prol = add nuw nsw i64 %indvars.iv67.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %scalar.ph74.prol.loopexit, label %scalar.ph74.prol, !llvm.loop !28

scalar.ph74.prol.loopexit:                        ; preds = %scalar.ph74.prol, %scalar.ph74.preheader
  %indvars.iv67.unr = phi i64 [ %indvars.iv67.ph, %scalar.ph74.preheader ], [ %indvars.iv.next68.prol, %scalar.ph74.prol ]
  %50 = sub nsw i64 %indvars.iv67.ph, %wide.trip.count
  %51 = icmp ugt i64 %50, -4
  br i1 %51, label %._crit_edge65, label %scalar.ph74

vector.memcheck:                                  ; preds = %.lr.ph64
  %52 = add i64 %6, -16
  %53 = sub i64 %52, %11
  %diff.check = icmp ult i64 %53, 32
  br i1 %diff.check, label %scalar.ph74.preheader, label %vector.ph76

vector.ph76:                                      ; preds = %vector.memcheck
  %n.vec78 = and i64 %wide.trip.count, 2147483644
  br label %vector.body80

vector.body80:                                    ; preds = %vector.body80, %vector.ph76
  %index81 = phi i64 [ 0, %vector.ph76 ], [ %index.next83, %vector.body80 ]
  %54 = getelementptr inbounds [32 x ptr], ptr %44, i64 0, i64 %index81
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  %wide.load = load <2 x ptr>, ptr %54, align 8, !tbaa !19
  %wide.load82 = load <2 x ptr>, ptr %55, align 8, !tbaa !19
  %56 = getelementptr inbounds i8, <2 x ptr> %wide.load, i64 64
  %57 = getelementptr inbounds i8, <2 x ptr> %wide.load82, i64 64
  %58 = getelementptr inbounds [32 x ptr], ptr %45, i64 0, i64 %index81
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  store <2 x ptr> %56, ptr %58, align 8, !tbaa !19
  store <2 x ptr> %57, ptr %59, align 8, !tbaa !19
  %index.next83 = add nuw i64 %index81, 4
  %60 = icmp eq i64 %index.next83, %n.vec78
  br i1 %60, label %middle.block73, label %vector.body80, !llvm.loop !30

middle.block73:                                   ; preds = %vector.body80
  %cmp.n84 = icmp eq i64 %n.vec78, %wide.trip.count
  br i1 %cmp.n84, label %._crit_edge65, label %scalar.ph74.preheader

._crit_edge65:                                    ; preds = %scalar.ph74.prol.loopexit, %scalar.ph74, %middle.block73
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #6
  br label %81

scalar.ph74:                                      ; preds = %scalar.ph74.prol.loopexit, %scalar.ph74
  %indvars.iv67 = phi i64 [ %indvars.iv.next68.3, %scalar.ph74 ], [ %indvars.iv67.unr, %scalar.ph74.prol.loopexit ]
  %61 = getelementptr inbounds [32 x ptr], ptr %44, i64 0, i64 %indvars.iv67
  %62 = load ptr, ptr %61, align 8, !tbaa !19
  %63 = getelementptr inbounds i8, ptr %62, i64 64
  %64 = getelementptr inbounds [32 x ptr], ptr %45, i64 0, i64 %indvars.iv67
  store ptr %63, ptr %64, align 8, !tbaa !19
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %65 = getelementptr inbounds [32 x ptr], ptr %44, i64 0, i64 %indvars.iv.next68
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  %67 = getelementptr inbounds i8, ptr %66, i64 64
  %68 = getelementptr inbounds [32 x ptr], ptr %45, i64 0, i64 %indvars.iv.next68
  store ptr %67, ptr %68, align 8, !tbaa !19
  %indvars.iv.next68.1 = add nuw nsw i64 %indvars.iv67, 2
  %69 = getelementptr inbounds [32 x ptr], ptr %44, i64 0, i64 %indvars.iv.next68.1
  %70 = load ptr, ptr %69, align 8, !tbaa !19
  %71 = getelementptr inbounds i8, ptr %70, i64 64
  %72 = getelementptr inbounds [32 x ptr], ptr %45, i64 0, i64 %indvars.iv.next68.1
  store ptr %71, ptr %72, align 8, !tbaa !19
  %indvars.iv.next68.2 = add nuw nsw i64 %indvars.iv67, 3
  %73 = getelementptr inbounds [32 x ptr], ptr %44, i64 0, i64 %indvars.iv.next68.2
  %74 = load ptr, ptr %73, align 8, !tbaa !19
  %75 = getelementptr inbounds i8, ptr %74, i64 64
  %76 = getelementptr inbounds [32 x ptr], ptr %45, i64 0, i64 %indvars.iv.next68.2
  store ptr %75, ptr %76, align 8, !tbaa !19
  %indvars.iv.next68.3 = add nuw nsw i64 %indvars.iv67, 4
  %exitcond71.not.3 = icmp eq i64 %indvars.iv.next68.3, %wide.trip.count70
  br i1 %exitcond71.not.3, label %._crit_edge65, label %scalar.ph74, !llvm.loop !31

77:                                               ; preds = %25
  %78 = getelementptr inbounds i8, ptr %5, i64 8
  %79 = zext nneg i32 %spec.store.select5 to i64
  %80 = shl nuw nsw i64 %79, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %78, ptr align 8 %2, i64 %80, i1 false)
  br label %81

81:                                               ; preds = %._crit_edge65, %77, %23
  ret ptr %5
}

declare ptr @ObjectAlloc(i32 noundef) local_unnamed_addr #2

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

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

declare void @mMemoryIndex(ptr noundef, i32 noundef, i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !8, i64 28}
!6 = !{!"HandleList", !7, i64 0, !8, i64 16, !8, i64 20, !8, i64 24, !8, i64 28}
!7 = !{!"MList", !8, i64 0, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!13, !11, i64 16}
!13 = !{!"MHandle", !8, i64 0, !8, i64 4, !11, i64 8, !11, i64 16}
!14 = !{!15, !11, i64 0}
!15 = !{!"HandleWaveCreate", !11, i64 0, !11, i64 8, !8, i64 16, !8, i64 20, !9, i64 24, !11, i64 280}
!16 = !{!17, !8, i64 4}
!17 = !{!"MWave", !8, i64 0, !8, i64 4, !9, i64 8}
!18 = !{!17, !8, i64 0}
!19 = !{!11, !11, i64 0}
!20 = distinct !{!20, !21, !22, !23}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!"llvm.loop.isvectorized", i32 1}
!23 = !{!"llvm.loop.unroll.runtime.disable"}
!24 = !{!15, !11, i64 280}
!25 = distinct !{!25, !21, !23, !22}
!26 = !{!15, !8, i64 20}
!27 = !{!15, !8, i64 16}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.unroll.disable"}
!30 = distinct !{!30, !21, !22, !23}
!31 = distinct !{!31, !21, !22}


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