; LLVM IR from cruppstahl/upscaledb :: 3rdparty/simdcomp/src (unit)

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

@.str.11 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [69 x i8], align 1
@__PRETTY_FUNCTION__.test_simdpackedselect = external hidden unnamed_addr constant [28 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [18 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

declare i32 @printf(ptr noundef, ...) #1

declare void @simdpackwithoutmaskd1(i32 noundef, ptr noundef, ptr noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @test_simdpackedselect() #3 {
  %1 = alloca [128 x i32], align 16
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [128 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 512, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 33, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %6

6:                                                ; preds = %16, %0
  %7 = load i32, ptr %4, align 4, !tbaa !5
  %8 = icmp slt i32 %7, 128
  br i1 %8, label %9, label %19

9:                                                ; preds = %6
  %10 = load i32, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr %4, align 4, !tbaa !5
  %12 = add i32 %10, %11
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  %15 = getelementptr inbounds [128 x i32], ptr %1, i64 0, i64 %14
  store i32 %12, ptr %15, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %9
  %17 = load i32, ptr %4, align 4, !tbaa !5
  %18 = add nsw i32 %17, 1
  store i32 %18, ptr %4, align 4, !tbaa !5
  br label %6, !llvm.loop !9

19:                                               ; preds = %6
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %50, %19
  %21 = load i32, ptr %3, align 4, !tbaa !5
  %22 = icmp sle i32 %21, 32
  br i1 %22, label %23, label %53

23:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 512, ptr %5) #4
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = getelementptr inbounds [128 x i32], ptr %1, i64 0, i64 0
  %26 = getelementptr inbounds [128 x i32], ptr %5, i64 0, i64 0
  %27 = load i32, ptr %3, align 4, !tbaa !5
  call void @simdpackwithoutmaskd1(i32 noundef %24, ptr noundef %25, ptr noundef %26, i32 noundef %27)
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = call i32 (ptr, ...) @printf(ptr noundef @.str.40, i32 noundef %28)
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %46, %23
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 128
  br i1 %32, label %33, label %49

33:                                               ; preds = %30
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = getelementptr inbounds [128 x i32], ptr %5, i64 0, i64 0
  %36 = load i32, ptr %3, align 4, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = call i32 @simdselectd1(i32 noundef %34, ptr noundef %35, i32 noundef %36, i32 noundef %37)
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = add i32 %39, %40
  %42 = icmp eq i32 %38, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %33
  br label %45

44:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str.41, ptr noundef @.str.11, i32 noundef 481, ptr noundef @__PRETTY_FUNCTION__.test_simdpackedselect) #5
  unreachable

45:                                               ; preds = %43
  br label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = add nsw i32 %47, 1
  store i32 %48, ptr %4, align 4, !tbaa !5
  br label %30, !llvm.loop !11

49:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 512, ptr %5) #4
  br label %50

50:                                               ; preds = %49
  %51 = load i32, ptr %3, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %3, align 4, !tbaa !5
  br label %20, !llvm.loop !12

53:                                               ; preds = %20
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.42)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 512, ptr %1) #4
  ret i32 0
}

declare i32 @simdselectd1(i32 noundef, ptr noundef, i32 noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}


; 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.11 = external hidden unnamed_addr constant [83 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [69 x i8], align 1
@__PRETTY_FUNCTION__.test_simdpackedselect = external hidden unnamed_addr constant [28 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [18 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @test_simdpackedselect() local_unnamed_addr #4 {
vector.ph:
  %0 = alloca [128 x i32], align 16
  %1 = alloca [128 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %0) #5
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  store <4 x i32> <i32 33, i32 34, i32 35, i32 36>, ptr %0, align 16, !tbaa !5
  store <4 x i32> <i32 37, i32 38, i32 39, i32 40>, ptr %2, align 16, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 32
  %4 = getelementptr inbounds i8, ptr %0, i64 48
  store <4 x i32> <i32 41, i32 42, i32 43, i32 44>, ptr %3, align 16, !tbaa !5
  store <4 x i32> <i32 45, i32 46, i32 47, i32 48>, ptr %4, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 64
  %6 = getelementptr inbounds i8, ptr %0, i64 80
  store <4 x i32> <i32 49, i32 50, i32 51, i32 52>, ptr %5, align 16, !tbaa !5
  store <4 x i32> <i32 53, i32 54, i32 55, i32 56>, ptr %6, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 96
  %8 = getelementptr inbounds i8, ptr %0, i64 112
  store <4 x i32> <i32 57, i32 58, i32 59, i32 60>, ptr %7, align 16, !tbaa !5
  store <4 x i32> <i32 61, i32 62, i32 63, i32 64>, ptr %8, align 16, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 128
  %10 = getelementptr inbounds i8, ptr %0, i64 144
  store <4 x i32> <i32 65, i32 66, i32 67, i32 68>, ptr %9, align 16, !tbaa !5
  store <4 x i32> <i32 69, i32 70, i32 71, i32 72>, ptr %10, align 16, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 160
  %12 = getelementptr inbounds i8, ptr %0, i64 176
  store <4 x i32> <i32 73, i32 74, i32 75, i32 76>, ptr %11, align 16, !tbaa !5
  store <4 x i32> <i32 77, i32 78, i32 79, i32 80>, ptr %12, align 16, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 192
  %14 = getelementptr inbounds i8, ptr %0, i64 208
  store <4 x i32> <i32 81, i32 82, i32 83, i32 84>, ptr %13, align 16, !tbaa !5
  store <4 x i32> <i32 85, i32 86, i32 87, i32 88>, ptr %14, align 16, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 224
  %16 = getelementptr inbounds i8, ptr %0, i64 240
  store <4 x i32> <i32 89, i32 90, i32 91, i32 92>, ptr %15, align 16, !tbaa !5
  store <4 x i32> <i32 93, i32 94, i32 95, i32 96>, ptr %16, align 16, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 256
  %18 = getelementptr inbounds i8, ptr %0, i64 272
  store <4 x i32> <i32 97, i32 98, i32 99, i32 100>, ptr %17, align 16, !tbaa !5
  store <4 x i32> <i32 101, i32 102, i32 103, i32 104>, ptr %18, align 16, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 288
  %20 = getelementptr inbounds i8, ptr %0, i64 304
  store <4 x i32> <i32 105, i32 106, i32 107, i32 108>, ptr %19, align 16, !tbaa !5
  store <4 x i32> <i32 109, i32 110, i32 111, i32 112>, ptr %20, align 16, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %0, i64 320
  %22 = getelementptr inbounds i8, ptr %0, i64 336
  store <4 x i32> <i32 113, i32 114, i32 115, i32 116>, ptr %21, align 16, !tbaa !5
  store <4 x i32> <i32 117, i32 118, i32 119, i32 120>, ptr %22, align 16, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 352
  %24 = getelementptr inbounds i8, ptr %0, i64 368
  store <4 x i32> <i32 121, i32 122, i32 123, i32 124>, ptr %23, align 16, !tbaa !5
  store <4 x i32> <i32 125, i32 126, i32 127, i32 128>, ptr %24, align 16, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 384
  %26 = getelementptr inbounds i8, ptr %0, i64 400
  store <4 x i32> <i32 129, i32 130, i32 131, i32 132>, ptr %25, align 16, !tbaa !5
  store <4 x i32> <i32 133, i32 134, i32 135, i32 136>, ptr %26, align 16, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 416
  %28 = getelementptr inbounds i8, ptr %0, i64 432
  store <4 x i32> <i32 137, i32 138, i32 139, i32 140>, ptr %27, align 16, !tbaa !5
  store <4 x i32> <i32 141, i32 142, i32 143, i32 144>, ptr %28, align 16, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %0, i64 448
  %30 = getelementptr inbounds i8, ptr %0, i64 464
  store <4 x i32> <i32 145, i32 146, i32 147, i32 148>, ptr %29, align 16, !tbaa !5
  store <4 x i32> <i32 149, i32 150, i32 151, i32 152>, ptr %30, align 16, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 480
  %32 = getelementptr inbounds i8, ptr %0, i64 496
  store <4 x i32> <i32 153, i32 154, i32 155, i32 156>, ptr %31, align 16, !tbaa !5
  store <4 x i32> <i32 157, i32 158, i32 159, i32 160>, ptr %32, align 16, !tbaa !5
  br label %.preheader

.preheader:                                       ; preds = %vector.ph, %41
  %.01720 = phi i32 [ %42, %41 ], [ 1, %vector.ph ]
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %1) #5
  call void @simdpackwithoutmaskd1(i32 noundef 33, ptr noundef nonnull %0, ptr noundef nonnull %1, i32 noundef %.01720) #5
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.40, i32 noundef %.01720)
  br label %36

34:                                               ; preds = %36
  %35 = add nuw nsw i32 %.119, 1
  %exitcond22.not = icmp eq i32 %35, 128
  br i1 %exitcond22.not, label %41, label %36, !llvm.loop !9

36:                                               ; preds = %.preheader, %34
  %.119 = phi i32 [ 0, %.preheader ], [ %35, %34 ]
  %37 = call i32 @simdselectd1(i32 noundef 33, ptr noundef nonnull %1, i32 noundef %.01720, i32 noundef %.119) #5
  %38 = add nuw nsw i32 %.119, 33
  %39 = icmp eq i32 %37, %38
  br i1 %39, label %34, label %40

40:                                               ; preds = %36
  call void @__assert_fail(ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.11, i32 noundef 481, ptr noundef nonnull @__PRETTY_FUNCTION__.test_simdpackedselect) #6
  unreachable

41:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %1) #5
  %42 = add nuw nsw i32 %.01720, 1
  %exitcond23.not = icmp eq i32 %42, 33
  br i1 %exitcond23.not, label %43, label %.preheader, !llvm.loop !11

43:                                               ; preds = %41
  %44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.42)
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %0) #5
  ret i32 0
}

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree 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 = { "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 = { 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 #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass