; LLVM IR from jgaeddert/liquid-dsp :: src/fec/tests (fec_rep5_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"

@__const.autotest_rep5_codec.msg = external hidden unnamed_addr constant [4 x i8], align 1
@liquid_autotest_verbose = external global i32, align 4
@.str = external hidden unnamed_addr constant [88 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1

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

23:                                               ; preds = %0
  %24 = load ptr, ptr %8, align 8, !tbaa !9
  %25 = call i32 @fec_print(ptr noundef %24)
  br label %26

26:                                               ; preds = %23, %0
  %27 = load ptr, ptr %8, align 8, !tbaa !9
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = getelementptr inbounds [4 x i8], ptr %2, i64 0, i64 0
  %30 = call i32 @fec_encode(ptr noundef %27, i32 noundef %28, ptr noundef %29, ptr noundef %18)
  %31 = getelementptr inbounds i8, ptr %18, i64 0
  %32 = load i8, ptr %31, align 16, !tbaa !11
  %33 = zext i8 %32 to i32
  %34 = xor i32 %33, -1
  %35 = trunc i32 %34 to i8
  %36 = getelementptr inbounds i8, ptr %18, i64 0
  store i8 %35, ptr %36, align 16, !tbaa !11
  %37 = getelementptr inbounds i8, ptr %18, i64 4
  %38 = load i8, ptr %37, align 4, !tbaa !11
  %39 = zext i8 %38 to i32
  %40 = xor i32 %39, -1
  %41 = trunc i32 %40 to i8
  %42 = getelementptr inbounds i8, ptr %18, i64 4
  store i8 %41, ptr %42, align 4, !tbaa !11
  %43 = getelementptr inbounds i8, ptr %18, i64 1
  %44 = load i8, ptr %43, align 1, !tbaa !11
  %45 = zext i8 %44 to i32
  %46 = xor i32 %45, -1
  %47 = trunc i32 %46 to i8
  %48 = getelementptr inbounds i8, ptr %18, i64 1
  store i8 %47, ptr %48, align 1, !tbaa !11
  %49 = getelementptr inbounds i8, ptr %18, i64 9
  %50 = load i8, ptr %49, align 1, !tbaa !11
  %51 = zext i8 %50 to i32
  %52 = xor i32 %51, -1
  %53 = trunc i32 %52 to i8
  %54 = getelementptr inbounds i8, ptr %18, i64 9
  store i8 %53, ptr %54, align 1, !tbaa !11
  %55 = getelementptr inbounds i8, ptr %18, i64 10
  %56 = load i8, ptr %55, align 2, !tbaa !11
  %57 = zext i8 %56 to i32
  %58 = xor i32 %57, -1
  %59 = trunc i32 %58 to i8
  %60 = getelementptr inbounds i8, ptr %18, i64 10
  store i8 %59, ptr %60, align 2, !tbaa !11
  %61 = getelementptr inbounds i8, ptr %18, i64 14
  %62 = load i8, ptr %61, align 2, !tbaa !11
  %63 = zext i8 %62 to i32
  %64 = xor i32 %63, -1
  %65 = trunc i32 %64 to i8
  %66 = getelementptr inbounds i8, ptr %18, i64 14
  store i8 %65, ptr %66, align 2, !tbaa !11
  %67 = getelementptr inbounds i8, ptr %18, i64 3
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = zext i8 %68 to i32
  %70 = xor i32 %69, -1
  %71 = trunc i32 %70 to i8
  %72 = getelementptr inbounds i8, ptr %18, i64 3
  store i8 %71, ptr %72, align 1, !tbaa !11
  %73 = getelementptr inbounds i8, ptr %18, i64 19
  %74 = load i8, ptr %73, align 1, !tbaa !11
  %75 = zext i8 %74 to i32
  %76 = xor i32 %75, -1
  %77 = trunc i32 %76 to i8
  %78 = getelementptr inbounds i8, ptr %18, i64 19
  store i8 %77, ptr %78, align 1, !tbaa !11
  %79 = load ptr, ptr %8, align 8, !tbaa !9
  %80 = load i32, ptr %1, align 4, !tbaa !5
  %81 = call i32 @fec_decode(ptr noundef %79, i32 noundef %80, ptr noundef %18, ptr noundef %15)
  %82 = getelementptr inbounds [4 x i8], ptr %2, i64 0, i64 0
  %83 = load i32, ptr %1, align 4, !tbaa !5
  %84 = call i32 @liquid_autotest_same_data(ptr noundef %82, ptr noundef %15, i32 noundef %83)
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %94, label %86

86:                                               ; preds = %26
  call void @liquid_autotest_failed_msg(ptr noundef @.str, i32 noundef 78, ptr noundef @.str.1)
  %87 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %93

89:                                               ; preds = %86
  %90 = getelementptr inbounds [4 x i8], ptr %2, i64 0, i64 0
  %91 = load i32, ptr %1, align 4, !tbaa !5
  call void @liquid_autotest_print_array(ptr noundef %90, i32 noundef %91)
  %92 = load i32, ptr %1, align 4, !tbaa !5
  call void @liquid_autotest_print_array(ptr noundef %15, i32 noundef %92)
  br label %93

93:                                               ; preds = %89, %86
  br label %95

94:                                               ; preds = %26
  call void (...) @liquid_autotest_passed()
  br label %95

95:                                               ; preds = %94, %93
  %96 = load ptr, ptr %8, align 8, !tbaa !9
  %97 = call i32 @fec_destroy(ptr noundef %96)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %98 = load ptr, ptr %5, align 8
  call void @llvm.stackrestore.p0(ptr %98)
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

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

; 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) #2

declare i32 @fec_get_enc_msg_length(i32 noundef, i32 noundef) #3

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

declare ptr @fec_create(i32 noundef, ptr noundef) #3

declare i32 @fec_print(ptr noundef) #3

declare i32 @fec_encode(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

declare i32 @fec_decode(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

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

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

declare void @liquid_autotest_print_array(ptr noundef, i32 noundef) #3

declare void @liquid_autotest_passed(...) #3

declare i32 @fec_destroy(ptr noundef) #3

; 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 nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { nocallback nofree nosync nounwind willreturn }
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 = !{!7, !7, i64 0}


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

@__const.autotest_rep5_codec.msg = external hidden unnamed_addr constant [4 x i8], align 1
@liquid_autotest_verbose = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [88 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [31 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_rep5_codec() local_unnamed_addr #0 {
  %1 = alloca [4 x i8], align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  %2 = load i32, ptr @__const.autotest_rep5_codec.msg, align 1
  store i32 %2, ptr %1, align 4
  %3 = tail call i32 @fec_get_enc_msg_length(i32 noundef 3, i32 noundef 4) #4
  %4 = tail call ptr @llvm.stacksave.p0()
  %5 = alloca [4 x i8], align 16
  %6 = zext i32 %3 to i64
  %7 = alloca i8, i64 %6, align 16
  %8 = tail call ptr @fec_create(i32 noundef 3, ptr noundef null) #4
  %9 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %12, label %10

10:                                               ; preds = %0
  %11 = tail call i32 @fec_print(ptr noundef %8) #4
  br label %12

12:                                               ; preds = %10, %0
  %13 = call i32 @fec_encode(ptr noundef %8, i32 noundef 4, ptr noundef nonnull %1, ptr noundef nonnull %7) #4
  %14 = load i8, ptr %7, align 16, !tbaa !9
  %15 = xor i8 %14, -1
  store i8 %15, ptr %7, align 16, !tbaa !9
  %16 = getelementptr inbounds i8, ptr %7, i64 4
  %17 = load i8, ptr %16, align 4, !tbaa !9
  %18 = xor i8 %17, -1
  store i8 %18, ptr %16, align 4, !tbaa !9
  %19 = getelementptr inbounds i8, ptr %7, i64 1
  %20 = load i8, ptr %19, align 1, !tbaa !9
  %21 = xor i8 %20, -1
  store i8 %21, ptr %19, align 1, !tbaa !9
  %22 = getelementptr inbounds i8, ptr %7, i64 9
  %23 = load i8, ptr %22, align 1, !tbaa !9
  %24 = xor i8 %23, -1
  store i8 %24, ptr %22, align 1, !tbaa !9
  %25 = getelementptr inbounds i8, ptr %7, i64 10
  %26 = load i8, ptr %25, align 2, !tbaa !9
  %27 = xor i8 %26, -1
  store i8 %27, ptr %25, align 2, !tbaa !9
  %28 = getelementptr inbounds i8, ptr %7, i64 14
  %29 = load i8, ptr %28, align 2, !tbaa !9
  %30 = xor i8 %29, -1
  store i8 %30, ptr %28, align 2, !tbaa !9
  %31 = getelementptr inbounds i8, ptr %7, i64 3
  %32 = load i8, ptr %31, align 1, !tbaa !9
  %33 = xor i8 %32, -1
  store i8 %33, ptr %31, align 1, !tbaa !9
  %34 = getelementptr inbounds i8, ptr %7, i64 19
  %35 = load i8, ptr %34, align 1, !tbaa !9
  %36 = xor i8 %35, -1
  store i8 %36, ptr %34, align 1, !tbaa !9
  %37 = call i32 @fec_decode(ptr noundef %8, i32 noundef 4, ptr noundef nonnull %7, ptr noundef nonnull %5) #4
  %38 = call i32 @liquid_autotest_same_data(ptr noundef nonnull %1, ptr noundef nonnull %5, i32 noundef 4) #4
  %.not14 = icmp eq i32 %38, 0
  br i1 %.not14, label %39, label %42

39:                                               ; preds = %12
  call void @liquid_autotest_failed_msg(ptr noundef nonnull @.str, i32 noundef 78, ptr noundef nonnull @.str.1) #4
  %40 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %.not15 = icmp eq i32 %40, 0
  br i1 %.not15, label %43, label %41

41:                                               ; preds = %39
  call void @liquid_autotest_print_array(ptr noundef nonnull %1, i32 noundef 4) #4
  call void @liquid_autotest_print_array(ptr noundef nonnull %5, i32 noundef 4) #4
  br label %43

42:                                               ; preds = %12
  call void (...) @liquid_autotest_passed() #4
  br label %43

43:                                               ; preds = %39, %41, %42
  %44 = call i32 @fec_destroy(ptr noundef %8) #4
  call void @llvm.stackrestore.p0(ptr %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void
}

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

declare i32 @fec_get_enc_msg_length(i32 noundef, i32 noundef) local_unnamed_addr #2

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

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

declare i32 @fec_print(ptr noundef) local_unnamed_addr #2

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

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

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

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

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

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

declare i32 @fec_destroy(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 nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

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 nosync nounwind willreturn }
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 = !{!7, !7, i64 0}


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