; LLVM IR from jgaeddert/liquid-dsp :: src/modem/tests (gmskmodem_autotest)

; 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 = external hidden unnamed_addr constant [91 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [60 x i8], align 1
@liquid_autotest_verbose = external global i32, align 4

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

declare ptr @gmskmod_create(i32 noundef, i32 noundef, float noundef) #1

declare ptr @msequence_create_default(i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #2

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

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

declare void @liquid_autotest_passed(...) #1

declare i32 @msequence_destroy(ptr noundef) #1

declare i32 @gmskmod_destroy(ptr noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #2

; Function Attrs: nounwind uwtable
define dso_local void @autotest_gmskmod_copy() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca float, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  store i32 5, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  store i32 3, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store float 0x3FCE0418A0000000, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %14 = load i32, ptr %1, align 4, !tbaa !5
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load float, ptr %3, align 4, !tbaa !9
  %17 = call ptr @gmskmod_create(i32 noundef %14, i32 noundef %15, float noundef %16)
  store ptr %17, ptr %4, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 16, ptr %5, align 4, !tbaa !5
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = zext i32 %18 to i64
  %20 = call ptr @llvm.stacksave.p0()
  store ptr %20, ptr %6, align 8
  %21 = alloca { float, float }, i64 %19, align 16
  store i64 %19, ptr %7, align 8
  %22 = load i32, ptr %1, align 4, !tbaa !5
  %23 = zext i32 %22 to i64
  %24 = alloca { float, float }, i64 %23, align 16
  store i64 %23, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %25 = call ptr @msequence_create_default(i32 noundef 7)
  store ptr %25, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %38, %0
  %27 = load i32, ptr %10, align 4, !tbaa !5
  %28 = load i32, ptr %5, align 4, !tbaa !5
  %29 = icmp ult i32 %27, %28
  br i1 %29, label %30, label %41

30:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #4
  %31 = load ptr, ptr %9, align 8, !tbaa !11
  %32 = call i32 @msequence_generate_symbol(ptr noundef %31, i32 noundef 1)
  %33 = trunc i32 %32 to i8
  store i8 %33, ptr %11, align 1, !tbaa !13
  %34 = load ptr, ptr %4, align 8, !tbaa !11
  %35 = load i8, ptr %11, align 1, !tbaa !13
  %36 = zext i8 %35 to i32
  %37 = call i32 @gmskmod_modulate(ptr noundef %34, i32 noundef %36, ptr noundef %21)
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #4
  br label %38

38:                                               ; preds = %30
  %39 = load i32, ptr %10, align 4, !tbaa !5
  %40 = add i32 %39, 1
  store i32 %40, ptr %10, align 4, !tbaa !5
  br label %26, !llvm.loop !14

41:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %42 = load ptr, ptr %4, align 8, !tbaa !11
  %43 = call ptr @gmskmod_copy(ptr noundef %42)
  store ptr %43, ptr %12, align 8, !tbaa !11
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %81, %41
  %45 = load i32, ptr %10, align 4, !tbaa !5
  %46 = load i32, ptr %5, align 4, !tbaa !5
  %47 = icmp ult i32 %45, %46
  br i1 %47, label %48, label %84

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  %49 = load ptr, ptr %9, align 8, !tbaa !11
  %50 = call i32 @msequence_generate_symbol(ptr noundef %49, i32 noundef 1)
  %51 = trunc i32 %50 to i8
  store i8 %51, ptr %13, align 1, !tbaa !13
  %52 = load ptr, ptr %4, align 8, !tbaa !11
  %53 = load i8, ptr %13, align 1, !tbaa !13
  %54 = zext i8 %53 to i32
  %55 = call i32 @gmskmod_modulate(ptr noundef %52, i32 noundef %54, ptr noundef %21)
  %56 = load ptr, ptr %12, align 8, !tbaa !11
  %57 = load i8, ptr %13, align 1, !tbaa !13
  %58 = zext i8 %57 to i32
  %59 = call i32 @gmskmod_modulate(ptr noundef %56, i32 noundef %58, ptr noundef %24)
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = zext i32 %60 to i64
  %62 = mul i64 %61, 8
  %63 = trunc i64 %62 to i32
  %64 = call i32 @liquid_autotest_same_data(ptr noundef %21, ptr noundef %24, i32 noundef %63)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %79, label %66

66:                                               ; preds = %48
  call void @liquid_autotest_failed_msg(ptr noundef @.str, i32 noundef 135, ptr noundef @.str.4)
  %67 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %78

69:                                               ; preds = %66
  %70 = load i32, ptr %1, align 4, !tbaa !5
  %71 = zext i32 %70 to i64
  %72 = mul i64 %71, 8
  %73 = trunc i64 %72 to i32
  call void @liquid_autotest_print_array(ptr noundef %21, i32 noundef %73)
  %74 = load i32, ptr %1, align 4, !tbaa !5
  %75 = zext i32 %74 to i64
  %76 = mul i64 %75, 8
  %77 = trunc i64 %76 to i32
  call void @liquid_autotest_print_array(ptr noundef %24, i32 noundef %77)
  br label %78

78:                                               ; preds = %69, %66
  br label %80

79:                                               ; preds = %48
  call void (...) @liquid_autotest_passed()
  br label %80

80:                                               ; preds = %79, %78
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %10, align 4, !tbaa !5
  %83 = add i32 %82, 1
  store i32 %83, ptr %10, align 4, !tbaa !5
  br label %44, !llvm.loop !16

84:                                               ; preds = %44
  %85 = load ptr, ptr %9, align 8, !tbaa !11
  %86 = call i32 @msequence_destroy(ptr noundef %85)
  %87 = load ptr, ptr %4, align 8, !tbaa !11
  %88 = call i32 @gmskmod_destroy(ptr noundef %87)
  %89 = load ptr, ptr %12, align 8, !tbaa !11
  %90 = call i32 @gmskmod_destroy(ptr noundef %89)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %91 = load ptr, ptr %6, align 8
  call void @llvm.stackrestore.p0(ptr %91)
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %1) #4
  ret void
}

declare ptr @gmskmod_copy(ptr noundef) #1

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

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

declare void @liquid_autotest_print_array(ptr 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 = { nocallback nofree nosync nounwind willreturn }
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 }

!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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; 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 [91 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [60 x i8], align 1
@liquid_autotest_verbose = external local_unnamed_addr global i32, align 4

declare ptr @gmskmod_create(i32 noundef, i32 noundef, float noundef) local_unnamed_addr #0

declare ptr @msequence_create_default(i32 noundef) local_unnamed_addr #0

declare i32 @msequence_generate_symbol(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @gmskmod_modulate(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @liquid_autotest_passed(...) local_unnamed_addr #0

declare i32 @msequence_destroy(ptr noundef) local_unnamed_addr #0

declare i32 @gmskmod_destroy(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @autotest_gmskmod_copy() local_unnamed_addr #1 {
  %1 = tail call ptr @gmskmod_create(i32 noundef 5, i32 noundef 3, float noundef 0x3FCE0418A0000000) #2
  %2 = alloca [5 x { float, float }], align 16
  %3 = alloca [5 x { float, float }], align 16
  %4 = tail call ptr @msequence_create_default(i32 noundef 7) #2
  %5 = tail call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %6 = and i32 %5, 255
  %7 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %6, ptr noundef nonnull %2) #2
  %8 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %9 = and i32 %8, 255
  %10 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %9, ptr noundef nonnull %2) #2
  %11 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %12 = and i32 %11, 255
  %13 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %12, ptr noundef nonnull %2) #2
  %14 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %15 = and i32 %14, 255
  %16 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %15, ptr noundef nonnull %2) #2
  %17 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %18 = and i32 %17, 255
  %19 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %18, ptr noundef nonnull %2) #2
  %20 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %21 = and i32 %20, 255
  %22 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %21, ptr noundef nonnull %2) #2
  %23 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %24 = and i32 %23, 255
  %25 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %24, ptr noundef nonnull %2) #2
  %26 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %27 = and i32 %26, 255
  %28 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %27, ptr noundef nonnull %2) #2
  %29 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %30 = and i32 %29, 255
  %31 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %30, ptr noundef nonnull %2) #2
  %32 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %33 = and i32 %32, 255
  %34 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %33, ptr noundef nonnull %2) #2
  %35 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %36 = and i32 %35, 255
  %37 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %36, ptr noundef nonnull %2) #2
  %38 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %39 = and i32 %38, 255
  %40 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %39, ptr noundef nonnull %2) #2
  %41 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %42 = and i32 %41, 255
  %43 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %42, ptr noundef nonnull %2) #2
  %44 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %45 = and i32 %44, 255
  %46 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %45, ptr noundef nonnull %2) #2
  %47 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %48 = and i32 %47, 255
  %49 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %48, ptr noundef nonnull %2) #2
  %50 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %51 = and i32 %50, 255
  %52 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %51, ptr noundef nonnull %2) #2
  %53 = call ptr @gmskmod_copy(ptr noundef %1) #2
  br label %54

54:                                               ; preds = %0, %64
  %.128 = phi i32 [ 0, %0 ], [ %65, %64 ]
  %55 = call i32 @msequence_generate_symbol(ptr noundef %4, i32 noundef 1) #2
  %56 = and i32 %55, 255
  %57 = call i32 @gmskmod_modulate(ptr noundef %1, i32 noundef %56, ptr noundef nonnull %2) #2
  %58 = call i32 @gmskmod_modulate(ptr noundef %53, i32 noundef %56, ptr noundef nonnull %3) #2
  %59 = call i32 @liquid_autotest_same_data(ptr noundef nonnull %2, ptr noundef nonnull %3, i32 noundef 40) #2
  %.not = icmp eq i32 %59, 0
  br i1 %.not, label %60, label %63

60:                                               ; preds = %54
  call void @liquid_autotest_failed_msg(ptr noundef nonnull @.str, i32 noundef 135, ptr noundef nonnull @.str.4) #2
  %61 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %.not26 = icmp eq i32 %61, 0
  br i1 %.not26, label %64, label %62

62:                                               ; preds = %60
  call void @liquid_autotest_print_array(ptr noundef nonnull %2, i32 noundef 40) #2
  call void @liquid_autotest_print_array(ptr noundef nonnull %3, i32 noundef 40) #2
  br label %64

63:                                               ; preds = %54
  call void (...) @liquid_autotest_passed() #2
  br label %64

64:                                               ; preds = %60, %62, %63
  %65 = add nuw nsw i32 %.128, 1
  %exitcond.not = icmp eq i32 %65, 16
  br i1 %exitcond.not, label %66, label %54, !llvm.loop !9

66:                                               ; preds = %64
  %67 = call i32 @msequence_destroy(ptr noundef %4) #2
  %68 = call i32 @gmskmod_destroy(ptr noundef %1) #2
  %69 = call i32 @gmskmod_destroy(ptr noundef %53) #2
  ret void
}

declare ptr @gmskmod_copy(ptr noundef) local_unnamed_addr #0

declare i32 @liquid_autotest_same_data(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @liquid_autotest_failed_msg(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

declare void @liquid_autotest_print_array(ptr noundef, i32 noundef) local_unnamed_addr #0

attributes #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 = { 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 = { 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"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass