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

%struct.div_t = type { i32, i32 }

@.str = external hidden unnamed_addr constant [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 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: nounwind
declare i32 @rand() #1

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

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

declare void @liquid_autotest_failed_expr(ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, double noundef) #2

declare void @liquid_autotest_passed(...) #2

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

; Function Attrs: nounwind uwtable
define dso_local void @autotest_secded2216_codec_e1() #3 {
  %1 = alloca i32, align 4
  %2 = alloca [2 x i8], align 1
  %3 = alloca [3 x i8], align 1
  %4 = alloca [3 x i8], align 1
  %5 = alloca %struct.div_t, align 4
  %6 = alloca [3 x i8], align 1
  %7 = alloca [2 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #6
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %8

8:                                                ; preds = %97, %0
  %9 = load i32, ptr %1, align 4, !tbaa !5
  %10 = icmp ult i32 %9, 22
  br i1 %10, label %11, label %100

11:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 2, ptr %2) #6
  %12 = call i32 @rand() #6
  %13 = and i32 %12, 65535
  %14 = trunc i32 %13 to i8
  %15 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 0
  store i8 %14, ptr %15, align 1, !tbaa !9
  %16 = call i32 @rand() #6
  %17 = and i32 %16, 65535
  %18 = trunc i32 %17 to i8
  %19 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 1
  store i8 %18, ptr %19, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %3) #6
  %20 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 0
  %21 = getelementptr inbounds [3 x i8], ptr %3, i64 0, i64 0
  %22 = call i32 @fec_secded2216_encode_symbol(ptr noundef %20, ptr noundef %21)
  call void @llvm.lifetime.start.p0(i64 3, ptr %4) #6
  call void @llvm.memset.p0.i64(ptr align 1 %4, i8 0, i64 3, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = call i64 @div(i32 noundef %23, i32 noundef 8) #7
  store i64 %24, ptr %5, align 4
  %25 = getelementptr inbounds %struct.div_t, ptr %5, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !10
  %27 = shl i32 1, %26
  %28 = trunc i32 %27 to i8
  %29 = getelementptr inbounds %struct.div_t, ptr %5, i32 0, i32 0
  %30 = load i32, ptr %29, align 4, !tbaa !12
  %31 = sub nsw i32 3, %30
  %32 = sub nsw i32 %31, 1
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [3 x i8], ptr %4, i64 0, i64 %33
  store i8 %28, ptr %34, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 3, ptr %6) #6
  %35 = getelementptr inbounds [3 x i8], ptr %3, i64 0, i64 0
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = zext i8 %36 to i32
  %38 = getelementptr inbounds [3 x i8], ptr %4, i64 0, i64 0
  %39 = load i8, ptr %38, align 1, !tbaa !9
  %40 = zext i8 %39 to i32
  %41 = xor i32 %37, %40
  %42 = trunc i32 %41 to i8
  %43 = getelementptr inbounds [3 x i8], ptr %6, i64 0, i64 0
  store i8 %42, ptr %43, align 1, !tbaa !9
  %44 = getelementptr inbounds [3 x i8], ptr %3, i64 0, i64 1
  %45 = load i8, ptr %44, align 1, !tbaa !9
  %46 = zext i8 %45 to i32
  %47 = getelementptr inbounds [3 x i8], ptr %4, i64 0, i64 1
  %48 = load i8, ptr %47, align 1, !tbaa !9
  %49 = zext i8 %48 to i32
  %50 = xor i32 %46, %49
  %51 = trunc i32 %50 to i8
  %52 = getelementptr inbounds [3 x i8], ptr %6, i64 0, i64 1
  store i8 %51, ptr %52, align 1, !tbaa !9
  %53 = getelementptr inbounds [3 x i8], ptr %3, i64 0, i64 2
  %54 = load i8, ptr %53, align 1, !tbaa !9
  %55 = zext i8 %54 to i32
  %56 = getelementptr inbounds [3 x i8], ptr %4, i64 0, i64 2
  %57 = load i8, ptr %56, align 1, !tbaa !9
  %58 = zext i8 %57 to i32
  %59 = xor i32 %55, %58
  %60 = trunc i32 %59 to i8
  %61 = getelementptr inbounds [3 x i8], ptr %6, i64 0, i64 2
  store i8 %60, ptr %61, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #6
  %62 = getelementptr inbounds [3 x i8], ptr %6, i64 0, i64 0
  %63 = getelementptr inbounds [2 x i8], ptr %7, i64 0, i64 0
  %64 = call i32 @fec_secded2216_decode_symbol(ptr noundef %62, ptr noundef %63)
  %65 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 0
  %66 = load i8, ptr %65, align 1, !tbaa !9
  %67 = zext i8 %66 to i32
  %68 = getelementptr inbounds [2 x i8], ptr %7, i64 0, i64 0
  %69 = load i8, ptr %68, align 1, !tbaa !9
  %70 = zext i8 %69 to i32
  %71 = icmp ne i32 %67, %70
  br i1 %71, label %72, label %79

72:                                               ; preds = %11
  %73 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 0
  %74 = load i8, ptr %73, align 1, !tbaa !9
  %75 = uitofp i8 %74 to double
  %76 = getelementptr inbounds [2 x i8], ptr %7, i64 0, i64 0
  %77 = load i8, ptr %76, align 1, !tbaa !9
  %78 = uitofp i8 %77 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 85, ptr noundef @.str.1, double noundef %75, ptr noundef @.str.2, ptr noundef @.str.3, double noundef %78)
  br label %80

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

80:                                               ; preds = %79, %72
  %81 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 1
  %82 = load i8, ptr %81, align 1, !tbaa !9
  %83 = zext i8 %82 to i32
  %84 = getelementptr inbounds [2 x i8], ptr %7, i64 0, i64 1
  %85 = load i8, ptr %84, align 1, !tbaa !9
  %86 = zext i8 %85 to i32
  %87 = icmp ne i32 %83, %86
  br i1 %87, label %88, label %95

88:                                               ; preds = %80
  %89 = getelementptr inbounds [2 x i8], ptr %2, i64 0, i64 1
  %90 = load i8, ptr %89, align 1, !tbaa !9
  %91 = uitofp i8 %90 to double
  %92 = getelementptr inbounds [2 x i8], ptr %7, i64 0, i64 1
  %93 = load i8, ptr %92, align 1, !tbaa !9
  %94 = uitofp i8 %93 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 86, ptr noundef @.str.4, double noundef %91, ptr noundef @.str.2, ptr noundef @.str.5, double noundef %94)
  br label %96

95:                                               ; preds = %80
  call void (...) @liquid_autotest_passed()
  br label %96

96:                                               ; preds = %95, %88
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr %2) #6
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %1, align 4, !tbaa !5
  %99 = add i32 %98, 1
  store i32 %99, ptr %1, align 4, !tbaa !5
  br label %8, !llvm.loop !13

100:                                              ; preds = %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #6
  ret void
}

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

; Function Attrs: nounwind willreturn memory(none)
declare i64 @div(i32 noundef, i32 noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(none) "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 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }

!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}
!10 = !{!11, !6, i64 4}
!11 = !{!"", !6, i64 0, !6, i64 4}
!12 = !{!11, !6, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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 [94 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [11 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: nounwind
declare i32 @rand() local_unnamed_addr #1

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

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

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

declare void @liquid_autotest_passed(...) 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) #0

; Function Attrs: nounwind uwtable
define dso_local void @autotest_secded2216_codec_e1() local_unnamed_addr #3 {
  %1 = alloca [2 x i8], align 1
  %2 = alloca [3 x i8], align 1
  %3 = alloca [3 x i8], align 1
  %4 = alloca [3 x i8], align 1
  %5 = alloca [2 x i8], align 1
  %6 = getelementptr inbounds i8, ptr %1, i64 1
  %7 = getelementptr inbounds i8, ptr %2, i64 1
  %8 = getelementptr inbounds i8, ptr %3, i64 1
  %9 = getelementptr inbounds i8, ptr %4, i64 1
  %10 = getelementptr inbounds i8, ptr %2, i64 2
  %11 = getelementptr inbounds i8, ptr %3, i64 2
  %12 = getelementptr inbounds i8, ptr %4, i64 2
  %13 = getelementptr inbounds i8, ptr %5, i64 1
  br label %14

14:                                               ; preds = %0, %49
  %.04 = phi i32 [ 0, %0 ], [ %50, %49 ]
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %1) #6
  %15 = call i32 @rand() #6
  %16 = trunc i32 %15 to i8
  store i8 %16, ptr %1, align 1, !tbaa !5
  %17 = call i32 @rand() #6
  %18 = trunc i32 %17 to i8
  store i8 %18, ptr %6, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %2) #6
  %19 = call i32 @fec_secded2216_encode_symbol(ptr noundef nonnull %1, ptr noundef nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %3) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %3, i8 0, i64 3, i1 false)
  %20 = call i64 @div(i32 noundef %.04, i32 noundef 8) #7
  %.sroa.4.0.extract.shift = lshr i64 %20, 32
  %.sroa.4.0.extract.trunc = trunc nuw i64 %.sroa.4.0.extract.shift to i32
  %21 = shl nuw i32 1, %.sroa.4.0.extract.trunc
  %22 = trunc i32 %21 to i8
  %23 = shl i64 %20, 32
  %sext = sub i64 8589934592, %23
  %24 = ashr exact i64 %sext, 32
  %25 = getelementptr inbounds [3 x i8], ptr %3, i64 0, i64 %24
  store i8 %22, ptr %25, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %4) #6
  %26 = load i8, ptr %2, align 1, !tbaa !5
  %27 = load i8, ptr %3, align 1, !tbaa !5
  %28 = xor i8 %27, %26
  store i8 %28, ptr %4, align 1, !tbaa !5
  %29 = load i8, ptr %7, align 1, !tbaa !5
  %30 = load i8, ptr %8, align 1, !tbaa !5
  %31 = xor i8 %30, %29
  store i8 %31, ptr %9, align 1, !tbaa !5
  %32 = load i8, ptr %10, align 1, !tbaa !5
  %33 = load i8, ptr %11, align 1, !tbaa !5
  %34 = xor i8 %33, %32
  store i8 %34, ptr %12, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %5) #6
  %35 = call i32 @fec_secded2216_decode_symbol(ptr noundef nonnull %4, ptr noundef nonnull %5) #6
  %36 = load i8, ptr %1, align 1, !tbaa !5
  %37 = load i8, ptr %5, align 1, !tbaa !5
  %.not = icmp eq i8 %36, %37
  br i1 %.not, label %41, label %38

38:                                               ; preds = %14
  %39 = uitofp i8 %36 to double
  %40 = uitofp i8 %37 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 85, ptr noundef nonnull @.str.1, double noundef %39, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, double noundef %40) #6
  br label %42

41:                                               ; preds = %14
  call void (...) @liquid_autotest_passed() #6
  br label %42

42:                                               ; preds = %41, %38
  %43 = load i8, ptr %6, align 1, !tbaa !5
  %44 = load i8, ptr %13, align 1, !tbaa !5
  %.not3 = icmp eq i8 %43, %44
  br i1 %.not3, label %48, label %45

45:                                               ; preds = %42
  %46 = uitofp i8 %43 to double
  %47 = uitofp i8 %44 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 86, ptr noundef nonnull @.str.4, double noundef %46, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.5, double noundef %47) #6
  br label %49

48:                                               ; preds = %42
  call void (...) @liquid_autotest_passed() #6
  br label %49

49:                                               ; preds = %48, %45
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %1) #6
  %50 = add nuw nsw i32 %.04, 1
  %exitcond.not = icmp eq i32 %50, 22
  br i1 %exitcond.not, label %51, label %14, !llvm.loop !8

51:                                               ; preds = %49
  ret void
}

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare i64 @div(i32 noundef, i32 noundef) local_unnamed_addr #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { nounwind }
attributes #7 = { nounwind willreturn memory(none) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,ReassociatePass,SROAPass,SimplifyCFGPass