; LLVM IR from jgaeddert/liquid-dsp :: src/framing/src (flexframesync)

; 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.flexframesync_s = type { ptr, ptr, %struct.framesyncstats_s, %struct.framedatastats_s, i32, float, ptr, float, float, float, float, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i32, ptr, i32, ptr, ptr, i32, ptr, i32, i32, ptr, i32, %struct.flexframegenprops_s, i32, ptr, ptr, i32, ptr, ptr, i32, i32, i32, i32, i32, i32, i32, i32, ptr }
%struct.framesyncstats_s = type { float, float, float, ptr, i32, i32, i32, i32, i32, i32 }
%struct.framedatastats_s = type { i32, i32, i32, i64 }
%struct.flexframegenprops_s = type { i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local ptr @flexframesync_create(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %13 = call noalias ptr @malloc(i64 noundef 352) #5
  store ptr %13, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.flexframesync_s, ptr %15, i32 0, i32 0
  store ptr %14, ptr %16, align 8, !tbaa !9
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.flexframesync_s, ptr %18, i32 0, i32 1
  store ptr %17, ptr %19, align 8, !tbaa !17
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.flexframesync_s, ptr %20, i32 0, i32 4
  store i32 7, ptr %21, align 8, !tbaa !18
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.flexframesync_s, ptr %22, i32 0, i32 5
  store float 0x3FD3333340000000, ptr %23, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %24 = call noalias ptr @malloc(i64 noundef 512) #5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.flexframesync_s, ptr %25, i32 0, i32 17
  store ptr %24, ptr %26, align 8, !tbaa !20
  %27 = call noalias ptr @malloc(i64 noundef 512) #5
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.flexframesync_s, ptr %28, i32 0, i32 18
  store ptr %27, ptr %29, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %30 = call ptr @msequence_create(i32 noundef 7, i32 noundef 137, i32 noundef 1)
  store ptr %30, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %6, align 4, !tbaa !22
  br label %31

31:                                               ; preds = %74, %2
  %32 = load i32, ptr %6, align 4, !tbaa !22
  %33 = icmp ult i32 %32, 64
  br i1 %33, label %34, label %77

34:                                               ; preds = %31
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  %36 = call i32 @msequence_advance(ptr noundef %35)
  %37 = icmp ne i32 %36, 0
  %38 = zext i1 %37 to i64
  %39 = select i1 %37, double 0x3FE6A09E667F3BCD, double 0xBFE6A09E667F3BCD
  %40 = fptrunc double %39 to float
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.flexframesync_s, ptr %41, i32 0, i32 17
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %44 = load i32, ptr %6, align 4, !tbaa !22
  %45 = zext i32 %44 to i64
  %46 = getelementptr inbounds { float, float }, ptr %43, i64 %45
  %47 = getelementptr inbounds { float, float }, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds { float, float }, ptr %46, i32 0, i32 1
  store float %40, ptr %47, align 4
  store float 0.000000e+00, ptr %48, align 4
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = call i32 @msequence_advance(ptr noundef %49)
  %51 = icmp ne i32 %50, 0
  %52 = zext i1 %51 to i64
  %53 = select i1 %51, double 0x3FE6A09E667F3BCD, double 0xBFE6A09E667F3BCD
  %54 = fmul double %53, 0.000000e+00
  %55 = fmul double %53, 1.000000e+00
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.flexframesync_s, ptr %56, i32 0, i32 17
  %58 = load ptr, ptr %57, align 8, !tbaa !20
  %59 = load i32, ptr %6, align 4, !tbaa !22
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds { float, float }, ptr %58, i64 %60
  %62 = getelementptr inbounds { float, float }, ptr %61, i32 0, i32 0
  %63 = load float, ptr %62, align 4
  %64 = getelementptr inbounds { float, float }, ptr %61, i32 0, i32 1
  %65 = load float, ptr %64, align 4
  %66 = fpext float %63 to double
  %67 = fpext float %65 to double
  %68 = fadd double %66, %54
  %69 = fadd double %67, %55
  %70 = fptrunc double %68 to float
  %71 = fptrunc double %69 to float
  %72 = getelementptr inbounds { float, float }, ptr %61, i32 0, i32 0
  %73 = getelementptr inbounds { float, float }, ptr %61, i32 0, i32 1
  store float %70, ptr %72, align 4
  store float %71, ptr %73, align 4
  br label %74

74:                                               ; preds = %34
  %75 = load i32, ptr %6, align 4, !tbaa !22
  %76 = add i32 %75, 1
  store i32 %76, ptr %6, align 4, !tbaa !22
  br label %31, !llvm.loop !23

77:                                               ; preds = %31
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = call i32 @msequence_destroy(ptr noundef %78)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 2, ptr %8, align 4, !tbaa !22
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.flexframesync_s, ptr %80, i32 0, i32 17
  %82 = load ptr, ptr %81, align 8, !tbaa !20
  %83 = load i32, ptr %8, align 4, !tbaa !22
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.flexframesync_s, ptr %84, i32 0, i32 4
  %86 = load i32, ptr %85, align 8, !tbaa !18
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.flexframesync_s, ptr %87, i32 0, i32 5
  %89 = load float, ptr %88, align 4, !tbaa !19
  %90 = call ptr @qdetector_cccf_create_linear(ptr noundef %82, i32 noundef 64, i32 noundef 7, i32 noundef %83, i32 noundef %86, float noundef %89)
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.flexframesync_s, ptr %91, i32 0, i32 6
  store ptr %90, ptr %92, align 8, !tbaa !25
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.flexframesync_s, ptr %93, i32 0, i32 6
  %95 = load ptr, ptr %94, align 8, !tbaa !25
  %96 = call i32 @qdetector_cccf_set_threshold(ptr noundef %95, float noundef 5.000000e-01)
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.flexframesync_s, ptr %97, i32 0, i32 14
  store i32 32, ptr %98, align 8, !tbaa !26
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.flexframesync_s, ptr %99, i32 0, i32 14
  %101 = load i32, ptr %100, align 8, !tbaa !26
  %102 = load i32, ptr %8, align 4, !tbaa !22
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.flexframesync_s, ptr %103, i32 0, i32 4
  %105 = load i32, ptr %104, align 8, !tbaa !18
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.flexframesync_s, ptr %106, i32 0, i32 5
  %108 = load float, ptr %107, align 4, !tbaa !19
  %109 = call ptr @firpfb_crcf_create_rnyquist(i32 noundef 7, i32 noundef %101, i32 noundef %102, i32 noundef %105, float noundef %108)
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.flexframesync_s, ptr %110, i32 0, i32 13
  store ptr %109, ptr %111, align 8, !tbaa !27
  %112 = call ptr @nco_crcf_create(i32 noundef 0)
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.flexframesync_s, ptr %113, i32 0, i32 11
  store ptr %112, ptr %114, align 8, !tbaa !28
  %115 = call ptr @nco_crcf_create(i32 noundef 0)
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.flexframesync_s, ptr %116, i32 0, i32 12
  store ptr %115, ptr %117, align 8, !tbaa !29
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.flexframesync_s, ptr %118, i32 0, i32 12
  %120 = load ptr, ptr %119, align 8, !tbaa !29
  %121 = call i32 @nco_crcf_pll_set_bandwidth(ptr noundef %120, float noundef 0x3F1A36E2E0000000)
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.flexframesync_s, ptr %122, i32 0, i32 20
  store ptr null, ptr %123, align 8, !tbaa !30
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.flexframesync_s, ptr %124, i32 0, i32 23
  store ptr null, ptr %125, align 8, !tbaa !31
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.flexframesync_s, ptr %126, i32 0, i32 28
  store ptr null, ptr %127, align 8, !tbaa !32
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.flexframesync_s, ptr %128, i32 0, i32 22
  store ptr null, ptr %129, align 8, !tbaa !33
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.flexframesync_s, ptr %130, i32 0, i32 25
  store ptr null, ptr %131, align 8, !tbaa !34
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.flexframesync_s, ptr %132, i32 0, i32 26
  store i32 14, ptr %133, align 8, !tbaa !35
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.flexframesync_s, ptr %134, i32 0, i32 19
  store i32 0, ptr %135, align 8, !tbaa !36
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = call i32 @flexframesync_set_header_props(ptr noundef %136, ptr noundef null)
  %138 = call ptr @modemcf_create(i32 noundef 40)
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.flexframesync_s, ptr %139, i32 0, i32 32
  store ptr %138, ptr %140, align 8, !tbaa !37
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.flexframesync_s, ptr %141, i32 0, i32 37
  store i32 64, ptr %142, align 8, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 5, ptr %9, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 7, ptr %11, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 39, ptr %12, align 4, !tbaa !22
  %143 = call ptr (...) @qpacketmodem_create()
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.flexframesync_s, ptr %144, i32 0, i32 35
  store ptr %143, ptr %145, align 8, !tbaa !39
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.flexframesync_s, ptr %146, i32 0, i32 35
  %148 = load ptr, ptr %147, align 8, !tbaa !39
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.flexframesync_s, ptr %149, i32 0, i32 37
  %151 = load i32, ptr %150, align 8, !tbaa !38
  %152 = load i32, ptr %9, align 4, !tbaa !22
  %153 = load i32, ptr %10, align 4, !tbaa !22
  %154 = load i32, ptr %11, align 4, !tbaa !22
  %155 = load i32, ptr %12, align 4, !tbaa !22
  %156 = call i32 @qpacketmodem_configure(ptr noundef %148, i32 noundef %151, i32 noundef %152, i32 noundef %153, i32 noundef %154, i32 noundef %155)
  %157 = load ptr, ptr %5, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.flexframesync_s, ptr %157, i32 0, i32 35
  %159 = load ptr, ptr %158, align 8, !tbaa !39
  %160 = call i32 @qpacketmodem_get_frame_len(ptr noundef %159)
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.flexframesync_s, ptr %161, i32 0, i32 34
  store i32 %160, ptr %162, align 8, !tbaa !40
  %163 = load ptr, ptr %5, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.flexframesync_s, ptr %163, i32 0, i32 34
  %165 = load i32, ptr %164, align 8, !tbaa !40
  %166 = zext i32 %165 to i64
  %167 = mul i64 %166, 8
  %168 = call noalias ptr @malloc(i64 noundef %167) #5
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.flexframesync_s, ptr %169, i32 0, i32 33
  store ptr %168, ptr %170, align 8, !tbaa !41
  %171 = load ptr, ptr %5, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.flexframesync_s, ptr %171, i32 0, i32 37
  %173 = load i32, ptr %172, align 8, !tbaa !38
  %174 = zext i32 %173 to i64
  %175 = mul i64 %174, 1
  %176 = call noalias ptr @malloc(i64 noundef %175) #5
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.flexframesync_s, ptr %177, i32 0, i32 36
  store ptr %176, ptr %178, align 8, !tbaa !42
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.flexframesync_s, ptr %179, i32 0, i32 31
  store i32 0, ptr %180, align 4, !tbaa !43
  %181 = load ptr, ptr %5, align 8, !tbaa !5
  %182 = call i32 @flexframesync_reset_framedatastats(ptr noundef %181)
  %183 = load ptr, ptr %5, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.flexframesync_s, ptr %183, i32 0, i32 42
  store i32 0, ptr %184, align 4, !tbaa !44
  %185 = load ptr, ptr %5, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.flexframesync_s, ptr %185, i32 0, i32 43
  store i32 0, ptr %186, align 8, !tbaa !45
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.flexframesync_s, ptr %187, i32 0, i32 44
  store i32 0, ptr %188, align 4, !tbaa !46
  %189 = load ptr, ptr %5, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.flexframesync_s, ptr %189, i32 0, i32 45
  store ptr null, ptr %190, align 8, !tbaa !47
  %191 = load ptr, ptr %5, align 8, !tbaa !5
  %192 = call i32 @flexframesync_reset(ptr noundef %191)
  %193 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  ret ptr %193
}

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

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

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

declare i32 @msequence_advance(ptr noundef) #3

declare i32 @msequence_destroy(ptr noundef) #3

declare ptr @qdetector_cccf_create_linear(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef) #3

declare i32 @qdetector_cccf_set_threshold(ptr noundef, float noundef) #3

declare ptr @firpfb_crcf_create_rnyquist(i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef) #3

declare ptr @nco_crcf_create(i32 noundef) #3

declare i32 @nco_crcf_pll_set_bandwidth(ptr noundef, float noundef) #3

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

declare ptr @modemcf_create(i32 noundef) #3

declare ptr @qpacketmodem_create(...) #3

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

declare i32 @qpacketmodem_get_frame_len(ptr noundef) #3

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

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

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

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 = { 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 #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 = { nounwind }
attributes #5 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"flexframesync_s", !6, i64 0, !6, i64 8, !11, i64 16, !14, i64 64, !13, i64 88, !12, i64 92, !6, i64 96, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !6, i64 120, !6, i64 128, !6, i64 136, !13, i64 144, !13, i64 148, !13, i64 152, !6, i64 160, !6, i64 168, !13, i64 176, !6, i64 184, !13, i64 192, !6, i64 200, !6, i64 208, !13, i64 216, !6, i64 224, !13, i64 232, !13, i64 236, !6, i64 240, !13, i64 248, !16, i64 252, !13, i64 268, !6, i64 272, !6, i64 280, !13, i64 288, !6, i64 296, !6, i64 304, !13, i64 312, !13, i64 316, !13, i64 320, !13, i64 324, !13, i64 328, !13, i64 332, !13, i64 336, !13, i64 340, !6, i64 344}
!11 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !6, i64 16, !13, i64 24, !13, i64 28, !13, i64 32, !13, i64 36, !13, i64 40, !13, i64 44}
!12 = !{!"float", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !15, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!17 = !{!10, !6, i64 8}
!18 = !{!10, !13, i64 88}
!19 = !{!10, !12, i64 92}
!20 = !{!10, !6, i64 160}
!21 = !{!10, !6, i64 168}
!22 = !{!13, !13, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!10, !6, i64 96}
!26 = !{!10, !13, i64 144}
!27 = !{!10, !6, i64 136}
!28 = !{!10, !6, i64 120}
!29 = !{!10, !6, i64 128}
!30 = !{!10, !6, i64 184}
!31 = !{!10, !6, i64 208}
!32 = !{!10, !6, i64 240}
!33 = !{!10, !6, i64 200}
!34 = !{!10, !6, i64 224}
!35 = !{!10, !13, i64 232}
!36 = !{!10, !13, i64 176}
!37 = !{!10, !6, i64 272}
!38 = !{!10, !13, i64 312}
!39 = !{!10, !6, i64 296}
!40 = !{!10, !13, i64 288}
!41 = !{!10, !6, i64 280}
!42 = !{!10, !6, i64 304}
!43 = !{!10, !13, i64 268}
!44 = !{!10, !13, i64 332}
!45 = !{!10, !13, i64 336}
!46 = !{!10, !13, i64 340}
!47 = !{!10, !6, i64 344}


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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @flexframesync_create(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call noalias dereferenceable_or_null(352) ptr @malloc(i64 noundef 352) #5
  store ptr %0, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  store ptr %1, ptr %4, align 8, !tbaa !16
  %5 = getelementptr inbounds i8, ptr %3, i64 88
  store i32 7, ptr %5, align 8, !tbaa !17
  %6 = getelementptr inbounds i8, ptr %3, i64 92
  store float 0x3FD3333340000000, ptr %6, align 4, !tbaa !18
  %7 = tail call noalias dereferenceable_or_null(512) ptr @malloc(i64 noundef 512) #5
  %8 = getelementptr inbounds i8, ptr %3, i64 160
  store ptr %7, ptr %8, align 8, !tbaa !19
  %9 = tail call noalias dereferenceable_or_null(512) ptr @malloc(i64 noundef 512) #5
  %10 = getelementptr inbounds i8, ptr %3, i64 168
  store ptr %9, ptr %10, align 8, !tbaa !20
  %11 = tail call ptr @msequence_create(i32 noundef 7, i32 noundef 137, i32 noundef 1) #6
  br label %12

12:                                               ; preds = %2, %12
  %indvars.iv = phi i64 [ 0, %2 ], [ %indvars.iv.next, %12 ]
  %13 = tail call i32 @msequence_advance(ptr noundef %11) #6
  %.not = icmp eq i32 %13, 0
  %14 = select i1 %.not, float 0xBFE6A09E60000000, float 0x3FE6A09E60000000
  %15 = getelementptr inbounds { float, float }, ptr %7, i64 %indvars.iv
  %16 = getelementptr inbounds i8, ptr %15, i64 4
  store float %14, ptr %15, align 4
  store float 0.000000e+00, ptr %16, align 4
  %17 = tail call i32 @msequence_advance(ptr noundef %11) #6
  %.not62 = icmp eq i32 %17, 0
  %18 = select i1 %.not62, double 0xBFE6A09E667F3BCD, double 0x3FE6A09E667F3BCD
  %19 = tail call double @llvm.copysign.f64(double 0.000000e+00, double %18)
  %20 = load <2 x float>, ptr %15, align 4
  %21 = fpext <2 x float> %20 to <2 x double>
  %22 = insertelement <2 x double> poison, double %19, i64 0
  %23 = insertelement <2 x double> %22, double %18, i64 1
  %24 = fadd <2 x double> %23, %21
  %25 = fptrunc <2 x double> %24 to <2 x float>
  store <2 x float> %25, ptr %15, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 64
  br i1 %exitcond.not, label %26, label %12, !llvm.loop !21

26:                                               ; preds = %12
  %27 = tail call i32 @msequence_destroy(ptr noundef %11) #6
  %28 = tail call ptr @qdetector_cccf_create_linear(ptr noundef nonnull %7, i32 noundef 64, i32 noundef 7, i32 noundef 2, i32 noundef 7, float noundef 0x3FD3333340000000) #6
  %29 = getelementptr inbounds i8, ptr %3, i64 96
  store ptr %28, ptr %29, align 8, !tbaa !23
  %30 = tail call i32 @qdetector_cccf_set_threshold(ptr noundef %28, float noundef 5.000000e-01) #6
  %31 = getelementptr inbounds i8, ptr %3, i64 144
  store i32 32, ptr %31, align 8, !tbaa !24
  %32 = tail call ptr @firpfb_crcf_create_rnyquist(i32 noundef 7, i32 noundef 32, i32 noundef 2, i32 noundef 7, float noundef 0x3FD3333340000000) #6
  %33 = getelementptr inbounds i8, ptr %3, i64 136
  store ptr %32, ptr %33, align 8, !tbaa !25
  %34 = tail call ptr @nco_crcf_create(i32 noundef 0) #6
  %35 = getelementptr inbounds i8, ptr %3, i64 120
  store ptr %34, ptr %35, align 8, !tbaa !26
  %36 = tail call ptr @nco_crcf_create(i32 noundef 0) #6
  %37 = getelementptr inbounds i8, ptr %3, i64 128
  store ptr %36, ptr %37, align 8, !tbaa !27
  %38 = tail call i32 @nco_crcf_pll_set_bandwidth(ptr noundef %36, float noundef 0x3F1A36E2E0000000) #6
  %39 = getelementptr inbounds i8, ptr %3, i64 184
  store ptr null, ptr %39, align 8, !tbaa !28
  %40 = getelementptr inbounds i8, ptr %3, i64 240
  store ptr null, ptr %40, align 8, !tbaa !29
  %41 = getelementptr inbounds i8, ptr %3, i64 200
  %42 = getelementptr inbounds i8, ptr %3, i64 224
  store ptr null, ptr %42, align 8, !tbaa !30
  %43 = getelementptr inbounds i8, ptr %3, i64 232
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %41, i8 0, i64 16, i1 false)
  store i32 14, ptr %43, align 8, !tbaa !31
  %44 = getelementptr inbounds i8, ptr %3, i64 176
  store i32 0, ptr %44, align 8, !tbaa !32
  %45 = tail call i32 @flexframesync_set_header_props(ptr noundef nonnull %3, ptr noundef null)
  %46 = tail call ptr @modemcf_create(i32 noundef 40) #6
  %47 = getelementptr inbounds i8, ptr %3, i64 272
  store ptr %46, ptr %47, align 8, !tbaa !33
  %48 = getelementptr inbounds i8, ptr %3, i64 312
  store i32 64, ptr %48, align 8, !tbaa !34
  %49 = tail call ptr (...) @qpacketmodem_create() #6
  %50 = getelementptr inbounds i8, ptr %3, i64 296
  store ptr %49, ptr %50, align 8, !tbaa !35
  %51 = load i32, ptr %48, align 8, !tbaa !34
  %52 = tail call i32 @qpacketmodem_configure(ptr noundef %49, i32 noundef %51, i32 noundef 5, i32 noundef 1, i32 noundef 7, i32 noundef 39) #6
  %53 = load ptr, ptr %50, align 8, !tbaa !35
  %54 = tail call i32 @qpacketmodem_get_frame_len(ptr noundef %53) #6
  %55 = getelementptr inbounds i8, ptr %3, i64 288
  store i32 %54, ptr %55, align 8, !tbaa !36
  %56 = zext i32 %54 to i64
  %57 = shl nuw nsw i64 %56, 3
  %58 = tail call noalias ptr @malloc(i64 noundef %57) #5
  %59 = getelementptr inbounds i8, ptr %3, i64 280
  store ptr %58, ptr %59, align 8, !tbaa !37
  %60 = load i32, ptr %48, align 8, !tbaa !34
  %61 = zext i32 %60 to i64
  %62 = tail call noalias ptr @malloc(i64 noundef %61) #5
  %63 = getelementptr inbounds i8, ptr %3, i64 304
  store ptr %62, ptr %63, align 8, !tbaa !38
  %64 = getelementptr inbounds i8, ptr %3, i64 268
  store i32 0, ptr %64, align 4, !tbaa !39
  %65 = tail call i32 @flexframesync_reset_framedatastats(ptr noundef nonnull %3)
  %66 = getelementptr inbounds i8, ptr %3, i64 332
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %66, i8 0, i64 20, i1 false)
  %67 = tail call i32 @flexframesync_reset(ptr noundef nonnull %3)
  ret ptr %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 #1

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

declare i32 @msequence_advance(ptr noundef) local_unnamed_addr #2

declare i32 @msequence_destroy(ptr noundef) local_unnamed_addr #2

declare ptr @qdetector_cccf_create_linear(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef) local_unnamed_addr #2

declare i32 @qdetector_cccf_set_threshold(ptr noundef, float noundef) local_unnamed_addr #2

declare ptr @firpfb_crcf_create_rnyquist(i32 noundef, i32 noundef, i32 noundef, i32 noundef, float noundef) local_unnamed_addr #2

declare ptr @nco_crcf_create(i32 noundef) local_unnamed_addr #2

declare i32 @nco_crcf_pll_set_bandwidth(ptr noundef, float noundef) local_unnamed_addr #2

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

declare ptr @modemcf_create(i32 noundef) local_unnamed_addr #2

declare ptr @qpacketmodem_create(...) local_unnamed_addr #2

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

declare i32 @qpacketmodem_get_frame_len(ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.copysign.f64(double, double) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind allocsize(0) }
attributes #6 = { 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, !7, i64 0}
!6 = !{!"flexframesync_s", !7, i64 0, !7, i64 8, !10, i64 16, !13, i64 64, !12, i64 88, !11, i64 92, !7, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !7, i64 120, !7, i64 128, !7, i64 136, !12, i64 144, !12, i64 148, !12, i64 152, !7, i64 160, !7, i64 168, !12, i64 176, !7, i64 184, !12, i64 192, !7, i64 200, !7, i64 208, !12, i64 216, !7, i64 224, !12, i64 232, !12, i64 236, !7, i64 240, !12, i64 248, !15, i64 252, !12, i64 268, !7, i64 272, !7, i64 280, !12, i64 288, !7, i64 296, !7, i64 304, !12, i64 312, !12, i64 316, !12, i64 320, !12, i64 324, !12, i64 328, !12, i64 332, !12, i64 336, !12, i64 340, !7, i64 344}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !7, i64 16, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44}
!11 = !{!"float", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !14, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!"", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!16 = !{!6, !7, i64 8}
!17 = !{!6, !12, i64 88}
!18 = !{!6, !11, i64 92}
!19 = !{!6, !7, i64 160}
!20 = !{!6, !7, i64 168}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!6, !7, i64 96}
!24 = !{!6, !12, i64 144}
!25 = !{!6, !7, i64 136}
!26 = !{!6, !7, i64 120}
!27 = !{!6, !7, i64 128}
!28 = !{!6, !7, i64 184}
!29 = !{!6, !7, i64 240}
!30 = !{!6, !7, i64 224}
!31 = !{!6, !12, i64 232}
!32 = !{!6, !12, i64 176}
!33 = !{!6, !7, i64 272}
!34 = !{!6, !12, i64 312}
!35 = !{!6, !7, i64 296}
!36 = !{!6, !12, i64 288}
!37 = !{!6, !7, i64 280}
!38 = !{!6, !7, i64 304}
!39 = !{!6, !12, i64 268}


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