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

; 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.liquid_apsk_s = type { i32, i32, ptr, ptr, ptr, ptr, ptr }
%struct.modemcf_s = type { i32, i32, i32, [8 x float], ptr, i32, { float, float }, { float, float }, %union.anon, ptr, ptr, ptr, i32 }
%union.anon = type { %struct.anon.3 }
%struct.anon.3 = type { i32, [8 x i32], [8 x float], [8 x float], [8 x float], ptr }

@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@liquid_apsk4 = external global %struct.liquid_apsk_s, align 8
@liquid_apsk8 = external global %struct.liquid_apsk_s, align 8
@liquid_apsk16 = external global %struct.liquid_apsk_s, align 8
@liquid_apsk32 = external global %struct.liquid_apsk_s, align 8
@liquid_apsk64 = external global %struct.liquid_apsk_s, align 8
@liquid_apsk128 = external global %struct.liquid_apsk_s, align 8
@liquid_apsk256 = external global %struct.liquid_apsk_s, align 8
@.str.26 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [57 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @modemcf_create_apsk(i32 noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store ptr null, ptr %4, align 8, !tbaa !9
  %8 = load i32, ptr %3, align 4, !tbaa !5
  switch i32 %8, label %16 [
    i32 2, label %9
    i32 3, label %10
    i32 4, label %11
    i32 5, label %12
    i32 6, label %13
    i32 7, label %14
    i32 8, label %15
  ]

9:                                                ; preds = %1
  store ptr @liquid_apsk4, ptr %4, align 8, !tbaa !9
  br label %19

10:                                               ; preds = %1
  store ptr @liquid_apsk8, ptr %4, align 8, !tbaa !9
  br label %19

11:                                               ; preds = %1
  store ptr @liquid_apsk16, ptr %4, align 8, !tbaa !9
  br label %19

12:                                               ; preds = %1
  store ptr @liquid_apsk32, ptr %4, align 8, !tbaa !9
  br label %19

13:                                               ; preds = %1
  store ptr @liquid_apsk64, ptr %4, align 8, !tbaa !9
  br label %19

14:                                               ; preds = %1
  store ptr @liquid_apsk128, ptr %4, align 8, !tbaa !9
  br label %19

15:                                               ; preds = %1
  store ptr @liquid_apsk256, ptr %4, align 8, !tbaa !9
  br label %19

16:                                               ; preds = %1
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef @.str.26, i32 noundef 43, ptr noundef @.str.27, ptr noundef @.str.2, i32 noundef %17)
  store ptr %18, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %178

19:                                               ; preds = %15, %14, %13, %12, %11, %10, %9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %20 = call noalias ptr @malloc(i64 noundef 256) #7
  store ptr %20, ptr %6, align 8, !tbaa !9
  %21 = load ptr, ptr %4, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct.liquid_apsk_s, ptr %21, i32 0, i32 0
  %23 = load i32, ptr %22, align 8, !tbaa !11
  %24 = load ptr, ptr %6, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.modemcf_s, ptr %24, i32 0, i32 0
  store i32 %23, ptr %25, align 8, !tbaa !13
  %26 = load ptr, ptr %6, align 8, !tbaa !9
  %27 = load i32, ptr %3, align 4, !tbaa !5
  %28 = call i32 @modemcf_init(ptr noundef %26, i32 noundef %27)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %29 = load ptr, ptr %4, align 8, !tbaa !9
  %30 = getelementptr inbounds %struct.liquid_apsk_s, ptr %29, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !15
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct.modemcf_s, ptr %32, i32 0, i32 8
  %34 = getelementptr inbounds %struct.anon.3, ptr %33, i32 0, i32 0
  store i32 %31, ptr %34, align 8, !tbaa !16
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %82, %19
  %36 = load i32, ptr %7, align 4, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.modemcf_s, ptr %37, i32 0, i32 8
  %39 = getelementptr inbounds %struct.anon.3, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !16
  %41 = icmp ult i32 %36, %40
  br i1 %41, label %42, label %85

42:                                               ; preds = %35
  %43 = load ptr, ptr %4, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.liquid_apsk_s, ptr %43, i32 0, i32 2
  %45 = load ptr, ptr %44, align 8, !tbaa !17
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = zext i32 %46 to i64
  %48 = getelementptr inbounds i32, ptr %45, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = load ptr, ptr %6, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.modemcf_s, ptr %50, i32 0, i32 8
  %52 = getelementptr inbounds %struct.anon.3, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds [8 x i32], ptr %52, i64 0, i64 %54
  store i32 %49, ptr %55, align 4, !tbaa !16
  %56 = load ptr, ptr %4, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.liquid_apsk_s, ptr %56, i32 0, i32 3
  %58 = load ptr, ptr %57, align 8, !tbaa !18
  %59 = load i32, ptr %7, align 4, !tbaa !5
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds float, ptr %58, i64 %60
  %62 = load float, ptr %61, align 4, !tbaa !19
  %63 = load ptr, ptr %6, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.modemcf_s, ptr %63, i32 0, i32 8
  %65 = getelementptr inbounds %struct.anon.3, ptr %64, i32 0, i32 2
  %66 = load i32, ptr %7, align 4, !tbaa !5
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds [8 x float], ptr %65, i64 0, i64 %67
  store float %62, ptr %68, align 4, !tbaa !16
  %69 = load ptr, ptr %4, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.liquid_apsk_s, ptr %69, i32 0, i32 4
  %71 = load ptr, ptr %70, align 8, !tbaa !21
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds float, ptr %71, i64 %73
  %75 = load float, ptr %74, align 4, !tbaa !19
  %76 = load ptr, ptr %6, align 8, !tbaa !9
  %77 = getelementptr inbounds %struct.modemcf_s, ptr %76, i32 0, i32 8
  %78 = getelementptr inbounds %struct.anon.3, ptr %77, i32 0, i32 4
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds [8 x float], ptr %78, i64 0, i64 %80
  store float %75, ptr %81, align 4, !tbaa !16
  br label %82

82:                                               ; preds = %42
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = add i32 %83, 1
  store i32 %84, ptr %7, align 4, !tbaa !5
  br label %35, !llvm.loop !22

85:                                               ; preds = %35
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %108, %85
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = load ptr, ptr %6, align 8, !tbaa !9
  %89 = getelementptr inbounds %struct.modemcf_s, ptr %88, i32 0, i32 8
  %90 = getelementptr inbounds %struct.anon.3, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !16
  %92 = sub i32 %91, 1
  %93 = icmp ult i32 %87, %92
  br i1 %93, label %94, label %111

94:                                               ; preds = %86
  %95 = load ptr, ptr %4, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.liquid_apsk_s, ptr %95, i32 0, i32 5
  %97 = load ptr, ptr %96, align 8, !tbaa !24
  %98 = load i32, ptr %7, align 4, !tbaa !5
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds float, ptr %97, i64 %99
  %101 = load float, ptr %100, align 4, !tbaa !19
  %102 = load ptr, ptr %6, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.modemcf_s, ptr %102, i32 0, i32 8
  %104 = getelementptr inbounds %struct.anon.3, ptr %103, i32 0, i32 3
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = zext i32 %105 to i64
  %107 = getelementptr inbounds [8 x float], ptr %104, i64 0, i64 %106
  store float %101, ptr %107, align 4, !tbaa !16
  br label %108

108:                                              ; preds = %94
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = add i32 %109, 1
  store i32 %110, ptr %7, align 4, !tbaa !5
  br label %86, !llvm.loop !25

111:                                              ; preds = %86
  %112 = load ptr, ptr %6, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.modemcf_s, ptr %112, i32 0, i32 2
  %114 = load i32, ptr %113, align 8, !tbaa !26
  %115 = zext i32 %114 to i64
  %116 = mul i64 %115, 1
  %117 = call noalias ptr @malloc(i64 noundef %116) #7
  %118 = load ptr, ptr %6, align 8, !tbaa !9
  %119 = getelementptr inbounds %struct.modemcf_s, ptr %118, i32 0, i32 8
  %120 = getelementptr inbounds %struct.anon.3, ptr %119, i32 0, i32 5
  store ptr %117, ptr %120, align 8, !tbaa !16
  %121 = load ptr, ptr %6, align 8, !tbaa !9
  %122 = getelementptr inbounds %struct.modemcf_s, ptr %121, i32 0, i32 8
  %123 = getelementptr inbounds %struct.anon.3, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %123, align 8, !tbaa !16
  %125 = load ptr, ptr %4, align 8, !tbaa !9
  %126 = getelementptr inbounds %struct.liquid_apsk_s, ptr %125, i32 0, i32 6
  %127 = load ptr, ptr %126, align 8, !tbaa !27
  %128 = load ptr, ptr %6, align 8, !tbaa !9
  %129 = getelementptr inbounds %struct.modemcf_s, ptr %128, i32 0, i32 2
  %130 = load i32, ptr %129, align 8, !tbaa !26
  %131 = zext i32 %130 to i64
  %132 = mul i64 %131, 1
  call void @llvm.memmove.p0.p0.i64(ptr align 1 %124, ptr align 1 %127, i64 %132, i1 false)
  %133 = load ptr, ptr %6, align 8, !tbaa !9
  %134 = getelementptr inbounds %struct.modemcf_s, ptr %133, i32 0, i32 9
  store ptr @modemcf_modulate_apsk, ptr %134, align 8, !tbaa !28
  %135 = load ptr, ptr %6, align 8, !tbaa !9
  %136 = getelementptr inbounds %struct.modemcf_s, ptr %135, i32 0, i32 10
  store ptr @modemcf_demodulate_apsk, ptr %136, align 8, !tbaa !29
  %137 = load ptr, ptr %6, align 8, !tbaa !9
  %138 = getelementptr inbounds %struct.modemcf_s, ptr %137, i32 0, i32 1
  %139 = load i32, ptr %138, align 4, !tbaa !30
  switch i32 %139, label %161 [
    i32 2, label %140
    i32 3, label %143
    i32 4, label %146
    i32 5, label %149
    i32 6, label %152
    i32 7, label %155
    i32 8, label %158
  ]

140:                                              ; preds = %111
  %141 = load ptr, ptr %6, align 8, !tbaa !9
  %142 = call i32 @modemcf_demodsoft_gentab(ptr noundef %141, i32 noundef 3)
  br label %162

143:                                              ; preds = %111
  %144 = load ptr, ptr %6, align 8, !tbaa !9
  %145 = call i32 @modemcf_demodsoft_gentab(ptr noundef %144, i32 noundef 3)
  br label %162

146:                                              ; preds = %111
  %147 = load ptr, ptr %6, align 8, !tbaa !9
  %148 = call i32 @modemcf_demodsoft_gentab(ptr noundef %147, i32 noundef 4)
  br label %162

149:                                              ; preds = %111
  %150 = load ptr, ptr %6, align 8, !tbaa !9
  %151 = call i32 @modemcf_demodsoft_gentab(ptr noundef %150, i32 noundef 4)
  br label %162

152:                                              ; preds = %111
  %153 = load ptr, ptr %6, align 8, !tbaa !9
  %154 = call i32 @modemcf_demodsoft_gentab(ptr noundef %153, i32 noundef 4)
  br label %162

155:                                              ; preds = %111
  %156 = load ptr, ptr %6, align 8, !tbaa !9
  %157 = call i32 @modemcf_demodsoft_gentab(ptr noundef %156, i32 noundef 5)
  br label %162

158:                                              ; preds = %111
  %159 = load ptr, ptr %6, align 8, !tbaa !9
  %160 = call i32 @modemcf_demodsoft_gentab(ptr noundef %159, i32 noundef 5)
  br label %162

161:                                              ; preds = %111
  br label %162

162:                                              ; preds = %161, %158, %155, %152, %149, %146, %143, %140
  %163 = load ptr, ptr %6, align 8, !tbaa !9
  %164 = getelementptr inbounds %struct.modemcf_s, ptr %163, i32 0, i32 2
  %165 = load i32, ptr %164, align 8, !tbaa !26
  %166 = zext i32 %165 to i64
  %167 = mul i64 %166, 8
  %168 = call noalias ptr @malloc(i64 noundef %167) #7
  %169 = load ptr, ptr %6, align 8, !tbaa !9
  %170 = getelementptr inbounds %struct.modemcf_s, ptr %169, i32 0, i32 4
  store ptr %168, ptr %170, align 8, !tbaa !31
  %171 = load ptr, ptr %6, align 8, !tbaa !9
  %172 = call i32 @modemcf_init_map(ptr noundef %171)
  %173 = load ptr, ptr %6, align 8, !tbaa !9
  %174 = getelementptr inbounds %struct.modemcf_s, ptr %173, i32 0, i32 5
  store i32 1, ptr %174, align 8, !tbaa !32
  %175 = load ptr, ptr %6, align 8, !tbaa !9
  %176 = call i32 @modemcf_reset(ptr noundef %175)
  %177 = load ptr, ptr %6, align 8, !tbaa !9
  store ptr %177, ptr %2, align 8
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %178

178:                                              ; preds = %162, %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %179 = load ptr, ptr %2, align 8
  ret ptr %179
}

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_reset(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_init(ptr noundef, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_init_map(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_demodsoft_gentab(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_modulate_apsk(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_demodulate_apsk(ptr noundef, <2 x float> noundef, ptr noundef) #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 = { "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 memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="64" "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 allocsize(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 #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

!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 0}
!12 = !{!"liquid_apsk_s", !6, i64 0, !6, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!13 = !{!14, !6, i64 0}
!14 = !{!"modemcf_s", !6, i64 0, !6, i64 4, !6, i64 8, !7, i64 12, !10, i64 48, !6, i64 56, !7, i64 60, !7, i64 68, !7, i64 80, !10, i64 224, !10, i64 232, !10, i64 240, !6, i64 248}
!15 = !{!12, !6, i64 4}
!16 = !{!7, !7, i64 0}
!17 = !{!12, !10, i64 8}
!18 = !{!12, !10, i64 16}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !7, i64 0}
!21 = !{!12, !10, i64 24}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!12, !10, i64 32}
!25 = distinct !{!25, !23}
!26 = !{!14, !6, i64 8}
!27 = !{!12, !10, i64 40}
!28 = !{!14, !10, i64 224}
!29 = !{!14, !10, i64 232}
!30 = !{!14, !6, i64 4}
!31 = !{!14, !10, i64 48}
!32 = !{!14, !6, i64 56}


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

%struct.liquid_apsk_s = type { i32, i32, ptr, ptr, ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@liquid_apsk4 = external local_unnamed_addr global %struct.liquid_apsk_s, align 8
@liquid_apsk8 = external local_unnamed_addr global %struct.liquid_apsk_s, align 8
@liquid_apsk16 = external local_unnamed_addr global %struct.liquid_apsk_s, align 8
@liquid_apsk32 = external local_unnamed_addr global %struct.liquid_apsk_s, align 8
@liquid_apsk64 = external local_unnamed_addr global %struct.liquid_apsk_s, align 8
@liquid_apsk128 = external local_unnamed_addr global %struct.liquid_apsk_s, align 8
@liquid_apsk256 = external local_unnamed_addr global %struct.liquid_apsk_s, align 8
@.str.26 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [57 x i8], align 1
@switch.table.modemcf_create_apsk = private unnamed_addr constant [7 x ptr] [ptr @liquid_apsk4, ptr @liquid_apsk8, ptr @liquid_apsk16, ptr @liquid_apsk32, ptr @liquid_apsk64, ptr @liquid_apsk128, ptr @liquid_apsk256], align 8
@switch.table.modemcf_create_apsk.1 = private unnamed_addr constant [7 x i32] [i32 3, i32 3, i32 4, i32 4, i32 4, i32 5, i32 5], align 4

; Function Attrs: nounwind uwtable
define dso_local ptr @modemcf_create_apsk(i32 noundef %0) local_unnamed_addr #0 {
  %switch.tableidx = add i32 %0, -2
  %2 = icmp ult i32 %switch.tableidx, 7
  br i1 %2, label %switch.lookup, label %3

3:                                                ; preds = %1
  %4 = tail call ptr (ptr, i32, ptr, ...) @liquid_error_config_fl(ptr noundef nonnull @.str.26, i32 noundef 43, ptr noundef nonnull @.str.27, ptr noundef nonnull @.str.2, i32 noundef %0) #5
  br label %82

switch.lookup:                                    ; preds = %1
  %5 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [7 x ptr], ptr @switch.table.modemcf_create_apsk, i64 0, i64 %5
  %switch.load = load ptr, ptr %switch.gep, align 8
  %6 = tail call noalias dereferenceable_or_null(256) ptr @malloc(i64 noundef 256) #6
  %7 = ptrtoint ptr %6 to i64
  %8 = load i32, ptr %switch.load, align 8, !tbaa !5
  store i32 %8, ptr %6, align 8, !tbaa !11
  %9 = tail call i32 @modemcf_init(ptr noundef nonnull %6, i32 noundef %0)
  %10 = getelementptr inbounds i8, ptr %switch.load, i64 4
  %11 = load i32, ptr %10, align 4, !tbaa !13
  %12 = getelementptr inbounds i8, ptr %6, i64 80
  store i32 %11, ptr %12, align 8, !tbaa !14
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %.lr.ph55, label %.lr.ph

.lr.ph:                                           ; preds = %switch.lookup
  %13 = getelementptr inbounds i8, ptr %switch.load, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !15
  %15 = getelementptr inbounds i8, ptr %6, i64 84
  %16 = getelementptr inbounds i8, ptr %switch.load, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %6, i64 116
  %19 = getelementptr inbounds i8, ptr %switch.load, i64 24
  %20 = load ptr, ptr %19, align 8, !tbaa !17
  %21 = getelementptr inbounds i8, ptr %6, i64 180
  %22 = zext i32 %11 to i64
  %min.iters.check = icmp ult i32 %11, 20
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

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

vector.memcheck:                                  ; preds = %.lr.ph
  %23 = shl nuw nsw i64 %22, 2
  %24 = getelementptr i8, ptr %6, i64 %23
  %scevgep = getelementptr i8, ptr %24, i64 180
  %scevgep62 = getelementptr i8, ptr %14, i64 %23
  %scevgep63 = getelementptr i8, ptr %17, i64 %23
  %scevgep64 = getelementptr i8, ptr %20, i64 %23
  %bound0 = icmp ult ptr %15, %scevgep62
  %bound1 = icmp ult ptr %14, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  %bound065 = icmp ult ptr %15, %scevgep63
  %bound166 = icmp ult ptr %17, %scevgep
  %found.conflict67 = and i1 %bound065, %bound166
  %conflict.rdx = or i1 %found.conflict, %found.conflict67
  %bound068 = icmp ult ptr %15, %scevgep64
  %bound169 = icmp ult ptr %20, %scevgep
  %found.conflict70 = and i1 %bound068, %bound169
  %conflict.rdx71 = or i1 %conflict.rdx, %found.conflict70
  br i1 %conflict.rdx71, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %22, 4294967292
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %25 = getelementptr inbounds i32, ptr %14, i64 %index
  %wide.load = load <4 x i32>, ptr %25, align 4, !tbaa !18, !alias.scope !19
  %26 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 %index
  store <4 x i32> %wide.load, ptr %26, align 4, !tbaa !14, !alias.scope !22, !noalias !24
  %27 = getelementptr inbounds float, ptr %17, i64 %index
  %wide.load72 = load <4 x float>, ptr %27, align 4, !tbaa !27, !alias.scope !29
  %28 = getelementptr inbounds [8 x float], ptr %18, i64 0, i64 %index
  store <4 x float> %wide.load72, ptr %28, align 4, !tbaa !14, !alias.scope !22, !noalias !24
  %29 = getelementptr inbounds float, ptr %20, i64 %index
  %wide.load73 = load <4 x float>, ptr %29, align 4, !tbaa !27, !alias.scope !30
  %30 = getelementptr inbounds [8 x float], ptr %21, i64 0, i64 %index
  store <4 x float> %wide.load73, ptr %30, align 4, !tbaa !14, !alias.scope !22, !noalias !24
  %index.next = add nuw i64 %index, 4
  %31 = icmp eq i64 %index.next, %n.vec
  br i1 %31, label %middle.block, label %vector.body, !llvm.loop !31

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

.preheader:                                       ; preds = %scalar.ph, %middle.block
  %.not56 = icmp eq i32 %11, 1
  br i1 %.not56, label %._crit_edge, label %.lr.ph55

.lr.ph55:                                         ; preds = %switch.lookup, %.preheader
  %32 = getelementptr inbounds i8, ptr %switch.load, i64 32
  %33 = load ptr, ptr %32, align 8, !tbaa !35
  %34 = getelementptr inbounds i8, ptr %6, i64 148
  %35 = add i32 %11, -1
  %36 = zext i32 %35 to i64
  %min.iters.check77 = icmp ult i32 %35, 8
  br i1 %min.iters.check77, label %scalar.ph76.preheader, label %vector.memcheck74

scalar.ph76.preheader:                            ; preds = %middle.block75, %vector.memcheck74, %.lr.ph55
  %indvars.iv58.ph = phi i64 [ 0, %vector.memcheck74 ], [ 0, %.lr.ph55 ], [ %n.vec80, %middle.block75 ]
  br label %scalar.ph76

vector.memcheck74:                                ; preds = %.lr.ph55
  %37 = ptrtoint ptr %33 to i64
  %38 = add i64 %7, 148
  %39 = sub i64 %38, %37
  %diff.check = icmp ult i64 %39, 32
  br i1 %diff.check, label %scalar.ph76.preheader, label %vector.ph78

vector.ph78:                                      ; preds = %vector.memcheck74
  %n.vec80 = and i64 %36, 4294967288
  br label %vector.body82

vector.body82:                                    ; preds = %vector.body82, %vector.ph78
  %index83 = phi i64 [ 0, %vector.ph78 ], [ %index.next86, %vector.body82 ]
  %40 = getelementptr inbounds float, ptr %33, i64 %index83
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %wide.load84 = load <4 x float>, ptr %40, align 4, !tbaa !27
  %wide.load85 = load <4 x float>, ptr %41, align 4, !tbaa !27
  %42 = getelementptr inbounds [8 x float], ptr %34, i64 0, i64 %index83
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  store <4 x float> %wide.load84, ptr %42, align 4, !tbaa !14
  store <4 x float> %wide.load85, ptr %43, align 4, !tbaa !14
  %index.next86 = add nuw i64 %index83, 8
  %44 = icmp eq i64 %index.next86, %n.vec80
  br i1 %44, label %middle.block75, label %vector.body82, !llvm.loop !36

middle.block75:                                   ; preds = %vector.body82
  %cmp.n87 = icmp eq i64 %n.vec80, %36
  br i1 %cmp.n87, label %._crit_edge, label %scalar.ph76.preheader

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %45 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv
  %46 = load i32, ptr %45, align 4, !tbaa !18
  %47 = getelementptr inbounds [8 x i32], ptr %15, i64 0, i64 %indvars.iv
  store i32 %46, ptr %47, align 4, !tbaa !14
  %48 = getelementptr inbounds float, ptr %17, i64 %indvars.iv
  %49 = load float, ptr %48, align 4, !tbaa !27
  %50 = getelementptr inbounds [8 x float], ptr %18, i64 0, i64 %indvars.iv
  store float %49, ptr %50, align 4, !tbaa !14
  %51 = getelementptr inbounds float, ptr %20, i64 %indvars.iv
  %52 = load float, ptr %51, align 4, !tbaa !27
  %53 = getelementptr inbounds [8 x float], ptr %21, i64 0, i64 %indvars.iv
  store float %52, ptr %53, align 4, !tbaa !14
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = icmp ult i64 %indvars.iv.next, %22
  br i1 %54, label %scalar.ph, label %.preheader, !llvm.loop !37

scalar.ph76:                                      ; preds = %scalar.ph76.preheader, %scalar.ph76
  %indvars.iv58 = phi i64 [ %indvars.iv.next59, %scalar.ph76 ], [ %indvars.iv58.ph, %scalar.ph76.preheader ]
  %55 = getelementptr inbounds float, ptr %33, i64 %indvars.iv58
  %56 = load float, ptr %55, align 4, !tbaa !27
  %57 = getelementptr inbounds [8 x float], ptr %34, i64 0, i64 %indvars.iv58
  store float %56, ptr %57, align 4, !tbaa !14
  %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
  %58 = icmp ult i64 %indvars.iv.next59, %36
  br i1 %58, label %scalar.ph76, label %._crit_edge, !llvm.loop !38

._crit_edge:                                      ; preds = %scalar.ph76, %middle.block75, %.preheader
  %59 = getelementptr inbounds i8, ptr %6, i64 8
  %60 = load i32, ptr %59, align 8, !tbaa !39
  %61 = zext i32 %60 to i64
  %62 = tail call noalias ptr @malloc(i64 noundef %61) #6
  %63 = getelementptr inbounds i8, ptr %6, i64 216
  store ptr %62, ptr %63, align 8, !tbaa !14
  %64 = getelementptr inbounds i8, ptr %switch.load, i64 40
  %65 = load ptr, ptr %64, align 8, !tbaa !40
  tail call void @llvm.memmove.p0.p0.i64(ptr align 1 %62, ptr align 1 %65, i64 %61, i1 false)
  %66 = getelementptr inbounds i8, ptr %6, i64 224
  store ptr @modemcf_modulate_apsk, ptr %66, align 8, !tbaa !41
  %67 = getelementptr inbounds i8, ptr %6, i64 232
  store ptr @modemcf_demodulate_apsk, ptr %67, align 8, !tbaa !42
  %68 = getelementptr inbounds i8, ptr %6, i64 4
  %69 = load i32, ptr %68, align 4, !tbaa !43
  %switch.tableidx89 = add i32 %69, -2
  %70 = icmp ult i32 %switch.tableidx89, 7
  br i1 %70, label %switch.lookup88, label %73

switch.lookup88:                                  ; preds = %._crit_edge
  %71 = zext nneg i32 %switch.tableidx89 to i64
  %switch.gep90 = getelementptr inbounds [7 x i32], ptr @switch.table.modemcf_create_apsk.1, i64 0, i64 %71
  %switch.load91 = load i32, ptr %switch.gep90, align 4
  %72 = tail call i32 @modemcf_demodsoft_gentab(ptr noundef nonnull %6, i32 noundef %switch.load91)
  br label %73

73:                                               ; preds = %._crit_edge, %switch.lookup88
  %74 = load i32, ptr %59, align 8, !tbaa !39
  %75 = zext i32 %74 to i64
  %76 = shl nuw nsw i64 %75, 3
  %77 = tail call noalias ptr @malloc(i64 noundef %76) #6
  %78 = getelementptr inbounds i8, ptr %6, i64 48
  store ptr %77, ptr %78, align 8, !tbaa !44
  %79 = tail call i32 @modemcf_init_map(ptr noundef nonnull %6)
  %80 = getelementptr inbounds i8, ptr %6, i64 56
  store i32 1, ptr %80, align 8, !tbaa !45
  %81 = tail call i32 @modemcf_reset(ptr noundef nonnull %6)
  br label %82

82:                                               ; preds = %73, %3
  %.051 = phi ptr [ %4, %3 ], [ %6, %73 ]
  ret ptr %.051
}

declare ptr @liquid_error_config_fl(ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memmove.p0.p0.i64(ptr nocapture writeonly, ptr nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_reset(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_init(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_init_map(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_demodsoft_gentab(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_modulate_apsk(ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @modemcf_demodulate_apsk(ptr noundef, <2 x float> noundef, ptr noundef) #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 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="64" "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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nounwind allocsize(0) }

!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, !7, i64 0}
!6 = !{!"liquid_apsk_s", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"modemcf_s", !7, i64 0, !7, i64 4, !7, i64 8, !8, i64 12, !10, i64 48, !7, i64 56, !8, i64 60, !8, i64 68, !8, i64 80, !10, i64 224, !10, i64 232, !10, i64 240, !7, i64 248}
!13 = !{!6, !7, i64 4}
!14 = !{!8, !8, i64 0}
!15 = !{!6, !10, i64 8}
!16 = !{!6, !10, i64 16}
!17 = !{!6, !10, i64 24}
!18 = !{!7, !7, i64 0}
!19 = !{!20}
!20 = distinct !{!20, !21}
!21 = distinct !{!21, !"LVerDomain"}
!22 = !{!23}
!23 = distinct !{!23, !21}
!24 = !{!20, !25, !26}
!25 = distinct !{!25, !21}
!26 = distinct !{!26, !21}
!27 = !{!28, !28, i64 0}
!28 = !{!"float", !8, i64 0}
!29 = !{!25}
!30 = !{!26}
!31 = distinct !{!31, !32, !33, !34}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!"llvm.loop.isvectorized", i32 1}
!34 = !{!"llvm.loop.unroll.runtime.disable"}
!35 = !{!6, !10, i64 32}
!36 = distinct !{!36, !32, !33, !34}
!37 = distinct !{!37, !32, !33}
!38 = distinct !{!38, !32, !33}
!39 = !{!12, !7, i64 8}
!40 = !{!6, !10, i64 40}
!41 = !{!12, !10, i64 224}
!42 = !{!12, !10, i64 232}
!43 = !{!12, !7, i64 4}
!44 = !{!12, !10, i64 48}
!45 = !{!12, !7, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SROAPass,SimplifyCFGPass,TailCallElimPass