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

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

@modulation_types = external constant [53 x %struct.modulation_type_s], align 16

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @ofdmflexframesync_reset(ptr noundef) #1

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

declare float @ofdmframesync_get_rssi(ptr noundef) #2

declare float @ofdmframesync_get_cfo(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @ofdmflexframesync_rxheader(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca { float, float }, align 4
  %10 = alloca { float, float }, align 4
  %11 = alloca float, 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 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %13

13:                                               ; preds = %217, %2
  %14 = load i32, ptr %5, align 4, !tbaa !9
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = icmp ult i32 %14, %17
  br i1 %18, label %19, label %220

19:                                               ; preds = %13
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !18
  %23 = load i32, ptr %5, align 4, !tbaa !9
  %24 = zext i32 %23 to i64
  %25 = getelementptr inbounds i8, ptr %22, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !19
  %27 = zext i8 %26 to i32
  store i32 %27, ptr %6, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp eq i32 %28, 2
  br i1 %29, label %30, label %216

30:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %31, i32 0, i32 9
  %33 = load i32, ptr %32, align 4, !tbaa !20
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %69

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %36, i32 0, i32 20
  %38 = getelementptr inbounds %struct.ofdmflexframegenprops_s, ptr %37, i32 0, i32 3
  %39 = load i32, ptr %38, align 4, !tbaa !21
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds [53 x %struct.modulation_type_s], ptr @modulation_types, i64 0, i64 %40
  %42 = getelementptr inbounds %struct.modulation_type_s, ptr %41, i32 0, i32 3
  %43 = load i32, ptr %42, align 4, !tbaa !22
  store i32 %43, ptr %8, align 4, !tbaa !9
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %44, i32 0, i32 10
  %46 = load ptr, ptr %45, align 8, !tbaa !24
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load i32, ptr %5, align 4, !tbaa !9
  %49 = zext i32 %48 to i64
  %50 = getelementptr inbounds { float, float }, ptr %47, i64 %49
  %51 = getelementptr inbounds { float, float }, ptr %50, i32 0, i32 0
  %52 = load float, ptr %51, align 4
  %53 = getelementptr inbounds { float, float }, ptr %50, i32 0, i32 1
  %54 = load float, ptr %53, align 4
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %55, i32 0, i32 14
  %57 = load ptr, ptr %56, align 8, !tbaa !25
  %58 = load i32, ptr %8, align 4, !tbaa !9
  %59 = load ptr, ptr %3, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %59, i32 0, i32 44
  %61 = load i32, ptr %60, align 8, !tbaa !26
  %62 = mul i32 %58, %61
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %57, i64 %63
  %65 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %66 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  store float %52, ptr %65, align 4
  store float %54, ptr %66, align 4
  %67 = load <2 x float>, ptr %9, align 4
  %68 = call i32 @modemcf_demodulate_soft(ptr noundef %46, <2 x float> noundef %67, ptr noundef %7, ptr noundef %64)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %95

69:                                               ; preds = %30
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %70, i32 0, i32 10
  %72 = load ptr, ptr %71, align 8, !tbaa !24
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !9
  %75 = zext i32 %74 to i64
  %76 = getelementptr inbounds { float, float }, ptr %73, i64 %75
  %77 = getelementptr inbounds { float, float }, ptr %76, i32 0, i32 0
  %78 = load float, ptr %77, align 4
  %79 = getelementptr inbounds { float, float }, ptr %76, i32 0, i32 1
  %80 = load float, ptr %79, align 4
  %81 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 0
  %82 = getelementptr inbounds { float, float }, ptr %10, i32 0, i32 1
  store float %78, ptr %81, align 4
  store float %80, ptr %82, align 4
  %83 = load <2 x float>, ptr %10, align 4
  %84 = call i32 @modemcf_demodulate(ptr noundef %72, <2 x float> noundef %83, ptr noundef %7)
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = trunc i32 %85 to i8
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %87, i32 0, i32 14
  %89 = load ptr, ptr %88, align 8, !tbaa !25
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %90, i32 0, i32 44
  %92 = load i32, ptr %91, align 8, !tbaa !26
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %89, i64 %93
  store i8 %86, ptr %94, align 1, !tbaa !19
  br label %95

95:                                               ; preds = %69, %35
  %96 = load ptr, ptr %3, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %96, i32 0, i32 44
  %98 = load i32, ptr %97, align 8, !tbaa !26
  %99 = add i32 %98, 1
  store i32 %99, ptr %97, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %100, i32 0, i32 10
  %102 = load ptr, ptr %101, align 8, !tbaa !24
  %103 = call float @modemcf_get_demodulator_evm(ptr noundef %102)
  store float %103, ptr %11, align 4, !tbaa !27
  %104 = load float, ptr %11, align 4, !tbaa !27
  %105 = load float, ptr %11, align 4, !tbaa !27
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %106, i32 0, i32 40
  %108 = load float, ptr %107, align 8, !tbaa !28
  %109 = call float @llvm.fmuladd.f32(float %104, float %105, float %108)
  store float %109, ptr %107, align 8, !tbaa !28
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %110, i32 0, i32 44
  %112 = load i32, ptr %111, align 8, !tbaa !26
  %113 = load ptr, ptr %3, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %113, i32 0, i32 18
  %115 = load i32, ptr %114, align 4, !tbaa !29
  %116 = icmp eq i32 %112, %115
  br i1 %116, label %117, label %212

117:                                              ; preds = %95
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = call i32 @ofdmflexframesync_decode_header(ptr noundef %118)
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %120, i32 0, i32 40
  %122 = load float, ptr %121, align 8, !tbaa !28
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %123, i32 0, i32 18
  %125 = load i32, ptr %124, align 4, !tbaa !29
  %126 = uitofp i32 %125 to float
  %127 = fdiv float %122, %126
  %128 = call float @log10f(float noundef %127) #6
  %129 = fmul float 1.000000e+01, %128
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %130, i32 0, i32 38
  %132 = getelementptr inbounds %struct.framesyncstats_s, ptr %131, i32 0, i32 0
  store float %129, ptr %132, align 8, !tbaa !30
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %133, i32 0, i32 39
  %135 = getelementptr inbounds %struct.framedatastats_s, ptr %134, i32 0, i32 0
  %136 = load i32, ptr %135, align 8, !tbaa !31
  %137 = add i32 %136, 1
  store i32 %137, ptr %135, align 8, !tbaa !31
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %138, i32 0, i32 19
  %140 = load i32, ptr %139, align 8, !tbaa !32
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %150

142:                                              ; preds = %117
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %143, i32 0, i32 43
  store i32 1, ptr %144, align 4, !tbaa !33
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %145, i32 0, i32 39
  %147 = getelementptr inbounds %struct.framedatastats_s, ptr %146, i32 0, i32 1
  %148 = load i32, ptr %147, align 4, !tbaa !34
  %149 = add i32 %148, 1
  store i32 %149, ptr %147, align 4, !tbaa !34
  br label %211

150:                                              ; preds = %117
  %151 = load ptr, ptr %3, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %151, i32 0, i32 41
  %153 = load ptr, ptr %152, align 8, !tbaa !35
  %154 = call float @ofdmframesync_get_rssi(ptr noundef %153)
  %155 = load ptr, ptr %3, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %155, i32 0, i32 38
  %157 = getelementptr inbounds %struct.framesyncstats_s, ptr %156, i32 0, i32 1
  store float %154, ptr %157, align 4, !tbaa !36
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %158, i32 0, i32 41
  %160 = load ptr, ptr %159, align 8, !tbaa !35
  %161 = call float @ofdmframesync_get_cfo(ptr noundef %160)
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %162, i32 0, i32 38
  %164 = getelementptr inbounds %struct.framesyncstats_s, ptr %163, i32 0, i32 2
  store float %161, ptr %164, align 8, !tbaa !37
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %165, i32 0, i32 38
  %167 = getelementptr inbounds %struct.framesyncstats_s, ptr %166, i32 0, i32 3
  store ptr null, ptr %167, align 8, !tbaa !38
  %168 = load ptr, ptr %3, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %168, i32 0, i32 38
  %170 = getelementptr inbounds %struct.framesyncstats_s, ptr %169, i32 0, i32 4
  store i32 0, ptr %170, align 8, !tbaa !39
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %171, i32 0, i32 38
  %173 = getelementptr inbounds %struct.framesyncstats_s, ptr %172, i32 0, i32 5
  store i32 0, ptr %173, align 4, !tbaa !40
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %174, i32 0, i32 38
  %176 = getelementptr inbounds %struct.framesyncstats_s, ptr %175, i32 0, i32 6
  store i32 0, ptr %176, align 8, !tbaa !41
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %177, i32 0, i32 38
  %179 = getelementptr inbounds %struct.framesyncstats_s, ptr %178, i32 0, i32 7
  store i32 0, ptr %179, align 4, !tbaa !42
  %180 = load ptr, ptr %3, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %180, i32 0, i32 38
  %182 = getelementptr inbounds %struct.framesyncstats_s, ptr %181, i32 0, i32 8
  store i32 0, ptr %182, align 8, !tbaa !43
  %183 = load ptr, ptr %3, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %183, i32 0, i32 38
  %185 = getelementptr inbounds %struct.framesyncstats_s, ptr %184, i32 0, i32 9
  store i32 0, ptr %185, align 4, !tbaa !44
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %186, i32 0, i32 36
  %188 = load ptr, ptr %187, align 8, !tbaa !45
  %189 = icmp eq ptr %188, null
  br i1 %189, label %190, label %193

190:                                              ; preds = %150
  %191 = load ptr, ptr %3, align 8, !tbaa !5
  %192 = call i32 @ofdmflexframesync_reset(ptr noundef %191)
  store i32 2, ptr %12, align 4
  br label %213

193:                                              ; preds = %150
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %194, i32 0, i32 36
  %196 = load ptr, ptr %195, align 8, !tbaa !45
  %197 = load ptr, ptr %3, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %197, i32 0, i32 12
  %199 = load ptr, ptr %198, align 8, !tbaa !46
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %200, i32 0, i32 19
  %202 = load i32, ptr %201, align 8, !tbaa !32
  %203 = load ptr, ptr %3, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %203, i32 0, i32 38
  %205 = load ptr, ptr %3, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.ofdmflexframesync_s, ptr %205, i32 0, i32 37
  %207 = load ptr, ptr %206, align 8, !tbaa !47
  %208 = call i32 %196(ptr noundef %199, i32 noundef %202, ptr noundef null, i32 noundef 0, i32 noundef 0, ptr noundef byval(%struct.framesyncstats_s) align 8 %204, ptr noundef %207)
  %209 = load ptr, ptr %3, align 8, !tbaa !5
  %210 = call i32 @ofdmflexframesync_reset(ptr noundef %209)
  br label %211

211:                                              ; preds = %193, %142
  store i32 2, ptr %12, align 4
  br label %213

212:                                              ; preds = %95
  store i32 0, ptr %12, align 4
  br label %213

213:                                              ; preds = %212, %211, %190
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  %214 = load i32, ptr %12, align 4
  switch i32 %214, label %221 [
    i32 0, label %215
    i32 2, label %220
  ]

215:                                              ; preds = %213
  br label %216

216:                                              ; preds = %215, %19
  br label %217

217:                                              ; preds = %216
  %218 = load i32, ptr %5, align 4, !tbaa !9
  %219 = add i32 %218, 1
  store i32 %219, ptr %5, align 4, !tbaa !9
  br label %13, !llvm.loop !48

220:                                              ; preds = %213, %13
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret i32 0

221:                                              ; preds = %213
  unreachable
}

declare i32 @modemcf_demodulate_soft(ptr noundef, <2 x float> noundef, ptr noundef, ptr noundef) #2

declare i32 @modemcf_demodulate(ptr noundef, <2 x float> noundef, ptr noundef) #2

declare float @modemcf_get_demodulator_evm(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nounwind uwtable
declare dso_local i32 @ofdmflexframesync_decode_header(ptr noundef) #1

; Function Attrs: nounwind
declare float @log10f(float noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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"="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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"ofdmflexframesync_s", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !13, i64 108, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !10, i64 184, !10, i64 188, !10, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !14, i64 224, !16, i64 272, !15, i64 296, !6, i64 304, !10, i64 312, !10, i64 316, !10, i64 320, !10, i64 324, !10, i64 328}
!13 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!14 = !{!"", !15, i64 0, !15, i64 4, !15, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44}
!15 = !{!"float", !7, i64 0}
!16 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !17, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!12, !6, i64 16}
!19 = !{!7, !7, i64 0}
!20 = !{!12, !10, i64 44}
!21 = !{!12, !10, i64 120}
!22 = !{!23, !10, i64 20}
!23 = !{!"modulation_type_s", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20}
!24 = !{!12, !6, i64 48}
!25 = !{!12, !6, i64 80}
!26 = !{!12, !10, i64 320}
!27 = !{!15, !15, i64 0}
!28 = !{!12, !15, i64 296}
!29 = !{!12, !10, i64 100}
!30 = !{!12, !15, i64 224}
!31 = !{!12, !10, i64 272}
!32 = !{!12, !10, i64 104}
!33 = !{!12, !10, i64 316}
!34 = !{!12, !10, i64 276}
!35 = !{!12, !6, i64 304}
!36 = !{!12, !15, i64 228}
!37 = !{!12, !15, i64 232}
!38 = !{!12, !6, i64 240}
!39 = !{!12, !10, i64 248}
!40 = !{!12, !10, i64 252}
!41 = !{!12, !10, i64 256}
!42 = !{!12, !10, i64 260}
!43 = !{!12, !10, i64 264}
!44 = !{!12, !10, i64 268}
!45 = !{!12, !6, i64 208}
!46 = !{!12, !6, i64 64}
!47 = !{!12, !6, i64 216}
!48 = distinct !{!48, !49}
!49 = !{!"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"

%struct.modulation_type_s = type { ptr, ptr, i32, i32 }
%struct.framesyncstats_s = type { float, float, float, ptr, i32, i32, i32, i32, i32, i32 }

@modulation_types = external local_unnamed_addr constant [53 x %struct.modulation_type_s], align 16

; 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 uwtable
declare dso_local i32 @ofdmflexframesync_reset(ptr noundef) local_unnamed_addr #1

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

declare float @ofdmframesync_get_rssi(ptr noundef) local_unnamed_addr #2

declare float @ofdmframesync_get_cfo(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @ofdmflexframesync_rxheader(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = alloca i32, align 4
  %4 = load i32, ptr %0, align 8, !tbaa !5
  %.not65 = icmp eq i32 %4, 0
  br i1 %.not65, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %5 = getelementptr inbounds i8, ptr %0, i64 16
  %6 = getelementptr inbounds i8, ptr %0, i64 44
  %7 = getelementptr inbounds i8, ptr %0, i64 120
  %8 = getelementptr inbounds i8, ptr %0, i64 48
  %9 = getelementptr inbounds i8, ptr %0, i64 80
  %10 = getelementptr inbounds i8, ptr %0, i64 320
  %11 = getelementptr inbounds i8, ptr %0, i64 296
  %12 = getelementptr inbounds i8, ptr %0, i64 100
  br label %13

13:                                               ; preds = %.lr.ph, %98
  %14 = phi i32 [ %4, %.lr.ph ], [ %99, %98 ]
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %98 ]
  %15 = load ptr, ptr %5, align 8, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %15, i64 %indvars.iv
  %17 = load i8, ptr %16, align 1, !tbaa !17
  %18 = icmp eq i8 %17, 2
  br i1 %18, label %19, label %98

19:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %20 = load i32, ptr %6, align 4, !tbaa !18
  %.not = icmp eq i32 %20, 0
  br i1 %.not, label %35, label %21

21:                                               ; preds = %19
  %22 = load i32, ptr %7, align 4, !tbaa !19
  %23 = zext i32 %22 to i64
  %24 = getelementptr inbounds [53 x %struct.modulation_type_s], ptr @modulation_types, i64 0, i64 %23, i32 3
  %25 = load i32, ptr %24, align 4, !tbaa !20
  %26 = load ptr, ptr %8, align 8, !tbaa !22
  %27 = getelementptr inbounds { float, float }, ptr %1, i64 %indvars.iv
  %28 = load <2 x float>, ptr %27, align 4
  %29 = load ptr, ptr %9, align 8, !tbaa !23
  %30 = load i32, ptr %10, align 8, !tbaa !24
  %31 = mul i32 %30, %25
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds i8, ptr %29, i64 %32
  %34 = call i32 @modemcf_demodulate_soft(ptr noundef %26, <2 x float> noundef %28, ptr noundef nonnull %3, ptr noundef %33) #7
  br label %46

35:                                               ; preds = %19
  %36 = load ptr, ptr %8, align 8, !tbaa !22
  %37 = getelementptr inbounds { float, float }, ptr %1, i64 %indvars.iv
  %38 = load <2 x float>, ptr %37, align 4
  %39 = call i32 @modemcf_demodulate(ptr noundef %36, <2 x float> noundef %38, ptr noundef nonnull %3) #7
  %40 = load i32, ptr %3, align 4, !tbaa !25
  %41 = trunc i32 %40 to i8
  %42 = load ptr, ptr %9, align 8, !tbaa !23
  %43 = load i32, ptr %10, align 8, !tbaa !24
  %44 = zext i32 %43 to i64
  %45 = getelementptr inbounds i8, ptr %42, i64 %44
  store i8 %41, ptr %45, align 1, !tbaa !17
  br label %46

46:                                               ; preds = %35, %21
  %47 = load i32, ptr %10, align 8, !tbaa !24
  %48 = add i32 %47, 1
  store i32 %48, ptr %10, align 8, !tbaa !24
  %49 = load ptr, ptr %8, align 8, !tbaa !22
  %50 = call float @modemcf_get_demodulator_evm(ptr noundef %49) #7
  %51 = load float, ptr %11, align 8, !tbaa !26
  %52 = call float @llvm.fmuladd.f32(float %50, float %50, float %51)
  store float %52, ptr %11, align 8, !tbaa !26
  %53 = load i32, ptr %10, align 8, !tbaa !24
  %54 = load i32, ptr %12, align 4, !tbaa !27
  %55 = icmp eq i32 %53, %54
  br i1 %55, label %56, label %97

56:                                               ; preds = %46
  %57 = call i32 @ofdmflexframesync_decode_header(ptr noundef nonnull %0)
  %58 = load float, ptr %11, align 8, !tbaa !26
  %59 = load i32, ptr %12, align 4, !tbaa !27
  %60 = uitofp i32 %59 to float
  %61 = fdiv float %58, %60
  %62 = call float @log10f(float noundef %61) #7
  %63 = fmul float %62, 1.000000e+01
  %64 = getelementptr inbounds i8, ptr %0, i64 224
  store float %63, ptr %64, align 8, !tbaa !28
  %65 = getelementptr inbounds i8, ptr %0, i64 272
  %66 = load i32, ptr %65, align 8, !tbaa !29
  %67 = add i32 %66, 1
  store i32 %67, ptr %65, align 8, !tbaa !29
  %68 = getelementptr inbounds i8, ptr %0, i64 104
  %69 = load i32, ptr %68, align 8, !tbaa !30
  %.not58 = icmp eq i32 %69, 0
  br i1 %.not58, label %75, label %70

70:                                               ; preds = %56
  %71 = getelementptr inbounds i8, ptr %0, i64 316
  store i32 1, ptr %71, align 4, !tbaa !31
  %72 = getelementptr inbounds i8, ptr %0, i64 276
  %73 = load i32, ptr %72, align 4, !tbaa !32
  %74 = add i32 %73, 1
  store i32 %74, ptr %72, align 4, !tbaa !32
  br label %.thread

75:                                               ; preds = %56
  %76 = getelementptr inbounds i8, ptr %0, i64 304
  %77 = load ptr, ptr %76, align 8, !tbaa !33
  %78 = call float @ofdmframesync_get_rssi(ptr noundef %77) #7
  %79 = getelementptr inbounds i8, ptr %0, i64 228
  store float %78, ptr %79, align 4, !tbaa !34
  %80 = load ptr, ptr %76, align 8, !tbaa !33
  %81 = call float @ofdmframesync_get_cfo(ptr noundef %80) #7
  %82 = getelementptr inbounds i8, ptr %0, i64 232
  store float %81, ptr %82, align 8, !tbaa !35
  %83 = getelementptr inbounds i8, ptr %0, i64 240
  %84 = getelementptr inbounds i8, ptr %0, i64 208
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %83, i8 0, i64 32, i1 false)
  %85 = load ptr, ptr %84, align 8, !tbaa !36
  %86 = icmp eq ptr %85, null
  br i1 %86, label %87, label %89

87:                                               ; preds = %75
  %88 = call i32 @ofdmflexframesync_reset(ptr noundef nonnull %0)
  br label %.thread

89:                                               ; preds = %75
  %90 = getelementptr inbounds i8, ptr %0, i64 64
  %91 = load ptr, ptr %90, align 8, !tbaa !37
  %92 = load i32, ptr %68, align 8, !tbaa !30
  %93 = getelementptr inbounds i8, ptr %0, i64 216
  %94 = load ptr, ptr %93, align 8, !tbaa !38
  %95 = call i32 %85(ptr noundef %91, i32 noundef %92, ptr noundef null, i32 noundef 0, i32 noundef 0, ptr noundef nonnull byval(%struct.framesyncstats_s) align 8 %64, ptr noundef %94) #7
  %96 = call i32 @ofdmflexframesync_reset(ptr noundef nonnull %0)
  br label %.thread

.thread:                                          ; preds = %87, %89, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %.loopexit

97:                                               ; preds = %46
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %.pre = load i32, ptr %0, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %97, %13
  %99 = phi i32 [ %.pre, %97 ], [ %14, %13 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %100 = zext i32 %99 to i64
  %101 = icmp ult i64 %indvars.iv.next, %100
  br i1 %101, label %13, label %.loopexit, !llvm.loop !39

.loopexit:                                        ; preds = %98, %2, %.thread
  ret i32 0
}

declare i32 @modemcf_demodulate_soft(ptr noundef, <2 x float> noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @modemcf_demodulate(ptr noundef, <2 x float> noundef, ptr noundef) local_unnamed_addr #2

declare float @modemcf_get_demodulator_evm(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @log10f(float noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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"="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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(write) "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 = !{!"ofdmflexframesync_s", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !7, i64 88, !7, i64 92, !7, i64 96, !7, i64 100, !7, i64 104, !11, i64 108, !7, i64 124, !7, i64 128, !7, i64 132, !7, i64 136, !7, i64 140, !7, i64 144, !7, i64 148, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176, !7, i64 184, !7, i64 188, !7, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !12, i64 224, !14, i64 272, !13, i64 296, !10, i64 304, !7, i64 312, !7, i64 316, !7, i64 320, !7, i64 324, !7, i64 328}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !10, i64 16, !7, i64 24, !7, i64 28, !7, i64 32, !7, i64 36, !7, i64 40, !7, i64 44}
!13 = !{!"float", !8, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !15, i64 16}
!15 = !{!"long", !8, i64 0}
!16 = !{!6, !10, i64 16}
!17 = !{!8, !8, i64 0}
!18 = !{!6, !7, i64 44}
!19 = !{!6, !7, i64 120}
!20 = !{!21, !7, i64 20}
!21 = !{!"modulation_type_s", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 20}
!22 = !{!6, !10, i64 48}
!23 = !{!6, !10, i64 80}
!24 = !{!6, !7, i64 320}
!25 = !{!7, !7, i64 0}
!26 = !{!6, !13, i64 296}
!27 = !{!6, !7, i64 100}
!28 = !{!6, !13, i64 224}
!29 = !{!6, !7, i64 272}
!30 = !{!6, !7, i64 104}
!31 = !{!6, !7, i64 316}
!32 = !{!6, !7, i64 276}
!33 = !{!6, !10, i64 304}
!34 = !{!6, !13, i64 228}
!35 = !{!6, !13, i64 232}
!36 = !{!6, !10, i64 208}
!37 = !{!6, !10, i64 64}
!38 = !{!6, !10, i64 216}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass