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

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [68 x i8], align 1

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

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

declare i32 @qpacketmodem_get_frame_len(ptr noundef) #1

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

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #2

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

declare i32 @nco_crcf_set_frequency(ptr noundef, float noundef) #1

declare i32 @nco_crcf_set_phase(ptr noundef, float noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @flexframesync_decode_header(ptr noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %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
  %13 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.flexframesync_s, ptr %14, i32 0, i32 22
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.flexframesync_s, ptr %17, i32 0, i32 20
  %19 = load ptr, ptr %18, align 8, !tbaa !17
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.flexframesync_s, ptr %20, i32 0, i32 23
  %22 = load ptr, ptr %21, align 8, !tbaa !18
  %23 = call i32 @qpilotsync_execute(ptr noundef %16, ptr noundef %19, ptr noundef %22)
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.flexframesync_s, ptr %24, i32 0, i32 19
  %26 = load i32, ptr %25, align 8, !tbaa !19
  %27 = icmp ne i32 %26, 0
  br i1 %27, label %28, label %41

28:                                               ; preds = %1
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.flexframesync_s, ptr %29, i32 0, i32 25
  %31 = load ptr, ptr %30, align 8, !tbaa !20
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.flexframesync_s, ptr %32, i32 0, i32 23
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.flexframesync_s, ptr %35, i32 0, i32 28
  %37 = load ptr, ptr %36, align 8, !tbaa !21
  %38 = call i32 @qpacketmodem_decode_soft(ptr noundef %31, ptr noundef %34, ptr noundef %37)
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.flexframesync_s, ptr %39, i32 0, i32 29
  store i32 %38, ptr %40, align 8, !tbaa !22
  br label %54

41:                                               ; preds = %1
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.flexframesync_s, ptr %42, i32 0, i32 25
  %44 = load ptr, ptr %43, align 8, !tbaa !20
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.flexframesync_s, ptr %45, i32 0, i32 23
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.flexframesync_s, ptr %48, i32 0, i32 28
  %50 = load ptr, ptr %49, align 8, !tbaa !21
  %51 = call i32 @qpacketmodem_decode(ptr noundef %44, ptr noundef %47, ptr noundef %50)
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.flexframesync_s, ptr %52, i32 0, i32 29
  store i32 %51, ptr %53, align 8, !tbaa !22
  br label %54

54:                                               ; preds = %41, %28
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.flexframesync_s, ptr %55, i32 0, i32 29
  %57 = load i32, ptr %56, align 8, !tbaa !22
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  store i32 0, ptr %2, align 4
  br label %271

60:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %61 = load ptr, ptr %3, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.flexframesync_s, ptr %61, i32 0, i32 22
  %63 = load ptr, ptr %62, align 8, !tbaa !9
  %64 = call float @qpilotsync_get_dphi(ptr noundef %63)
  store float %64, ptr %4, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  %65 = load ptr, ptr %3, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.flexframesync_s, ptr %65, i32 0, i32 22
  %67 = load ptr, ptr %66, align 8, !tbaa !9
  %68 = call float @qpilotsync_get_phi(ptr noundef %67)
  store float %68, ptr %5, align 4, !tbaa !23
  %69 = load ptr, ptr %3, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.flexframesync_s, ptr %69, i32 0, i32 12
  %71 = load ptr, ptr %70, align 8, !tbaa !24
  %72 = load float, ptr %4, align 4, !tbaa !23
  %73 = call i32 @nco_crcf_set_frequency(ptr noundef %71, float noundef %72)
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.flexframesync_s, ptr %74, i32 0, i32 12
  %76 = load ptr, ptr %75, align 8, !tbaa !24
  %77 = load float, ptr %5, align 4, !tbaa !23
  %78 = load float, ptr %4, align 4, !tbaa !23
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.flexframesync_s, ptr %79, i32 0, i32 21
  %81 = load i32, ptr %80, align 8, !tbaa !25
  %82 = uitofp i32 %81 to float
  %83 = call float @llvm.fmuladd.f32(float %78, float %82, float %77)
  %84 = call i32 @nco_crcf_set_phase(ptr noundef %76, float noundef %83)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  %85 = load ptr, ptr %3, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.flexframesync_s, ptr %85, i32 0, i32 26
  %87 = load i32, ptr %86, align 8, !tbaa !26
  store i32 %87, ptr %6, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.flexframesync_s, ptr %88, i32 0, i32 28
  %90 = load ptr, ptr %89, align 8, !tbaa !21
  %91 = load i32, ptr %6, align 4, !tbaa !27
  %92 = add i32 %91, 0
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds i8, ptr %90, i64 %93
  %95 = load i8, ptr %94, align 1, !tbaa !28
  %96 = zext i8 %95 to i32
  store i32 %96, ptr %7, align 4, !tbaa !27
  %97 = load i32, ptr %7, align 4, !tbaa !27
  %98 = icmp ne i32 %97, 102
  br i1 %98, label %99, label %104

99:                                               ; preds = %60
  %100 = load ptr, ptr %3, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.flexframesync_s, ptr %100, i32 0, i32 29
  store i32 0, ptr %101, align 8, !tbaa !22
  %102 = load i32, ptr %7, align 4, !tbaa !27
  %103 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef @.str.1, i32 noundef 664, ptr noundef @.str.6, i32 noundef %102, i32 noundef 102)
  store i32 %103, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %270

104:                                              ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.flexframesync_s, ptr %105, i32 0, i32 28
  %107 = load ptr, ptr %106, align 8, !tbaa !21
  %108 = load i32, ptr %6, align 4, !tbaa !27
  %109 = add i32 %108, 1
  %110 = zext i32 %109 to i64
  %111 = getelementptr inbounds i8, ptr %107, i64 %110
  %112 = load i8, ptr %111, align 1, !tbaa !28
  %113 = zext i8 %112 to i32
  %114 = shl i32 %113, 8
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.flexframesync_s, ptr %115, i32 0, i32 28
  %117 = load ptr, ptr %116, align 8, !tbaa !21
  %118 = load i32, ptr %6, align 4, !tbaa !27
  %119 = add i32 %118, 2
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds i8, ptr %117, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !28
  %123 = zext i8 %122 to i32
  %124 = or i32 %114, %123
  store i32 %124, ptr %9, align 4, !tbaa !27
  %125 = load i32, ptr %9, align 4, !tbaa !27
  %126 = load ptr, ptr %3, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.flexframesync_s, ptr %126, i32 0, i32 37
  store i32 %125, ptr %127, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %128 = load ptr, ptr %3, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.flexframesync_s, ptr %128, i32 0, i32 28
  %130 = load ptr, ptr %129, align 8, !tbaa !21
  %131 = load i32, ptr %6, align 4, !tbaa !27
  %132 = add i32 %131, 3
  %133 = zext i32 %132 to i64
  %134 = getelementptr inbounds i8, ptr %130, i64 %133
  %135 = load i8, ptr %134, align 1, !tbaa !28
  %136 = zext i8 %135 to i32
  store i32 %136, ptr %10, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %137 = load ptr, ptr %3, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.flexframesync_s, ptr %137, i32 0, i32 28
  %139 = load ptr, ptr %138, align 8, !tbaa !21
  %140 = load i32, ptr %6, align 4, !tbaa !27
  %141 = add i32 %140, 4
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds i8, ptr %139, i64 %142
  %144 = load i8, ptr %143, align 1, !tbaa !28
  %145 = zext i8 %144 to i32
  %146 = ashr i32 %145, 5
  %147 = and i32 %146, 7
  store i32 %147, ptr %11, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.flexframesync_s, ptr %148, i32 0, i32 28
  %150 = load ptr, ptr %149, align 8, !tbaa !21
  %151 = load i32, ptr %6, align 4, !tbaa !27
  %152 = add i32 %151, 4
  %153 = zext i32 %152 to i64
  %154 = getelementptr inbounds i8, ptr %150, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !28
  %156 = zext i8 %155 to i32
  %157 = and i32 %156, 31
  store i32 %157, ptr %12, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %158 = load ptr, ptr %3, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.flexframesync_s, ptr %158, i32 0, i32 28
  %160 = load ptr, ptr %159, align 8, !tbaa !21
  %161 = load i32, ptr %6, align 4, !tbaa !27
  %162 = add i32 %161, 5
  %163 = zext i32 %162 to i64
  %164 = getelementptr inbounds i8, ptr %160, i64 %163
  %165 = load i8, ptr %164, align 1, !tbaa !28
  %166 = zext i8 %165 to i32
  %167 = and i32 %166, 31
  store i32 %167, ptr %13, align 4, !tbaa !27
  %168 = load i32, ptr %10, align 4, !tbaa !27
  %169 = icmp eq i32 %168, 0
  br i1 %169, label %173, label %170

170:                                              ; preds = %104
  %171 = load i32, ptr %10, align 4, !tbaa !27
  %172 = icmp uge i32 %171, 53
  br i1 %172, label %173, label %177

173:                                              ; preds = %170, %104
  %174 = load ptr, ptr %3, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.flexframesync_s, ptr %174, i32 0, i32 29
  store i32 0, ptr %175, align 8, !tbaa !22
  %176 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef @.str.1, i32 noundef 685, ptr noundef @.str.7)
  store i32 %176, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %269

177:                                              ; preds = %170
  %178 = load i32, ptr %11, align 4, !tbaa !27
  %179 = icmp eq i32 %178, 0
  br i1 %179, label %183, label %180

180:                                              ; preds = %177
  %181 = load i32, ptr %11, align 4, !tbaa !27
  %182 = icmp uge i32 %181, 7
  br i1 %182, label %183, label %187

183:                                              ; preds = %180, %177
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.flexframesync_s, ptr %184, i32 0, i32 29
  store i32 0, ptr %185, align 8, !tbaa !22
  %186 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef @.str.1, i32 noundef 688, ptr noundef @.str.8)
  store i32 %186, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %269

187:                                              ; preds = %180
  %188 = load i32, ptr %12, align 4, !tbaa !27
  %189 = icmp eq i32 %188, 0
  br i1 %189, label %193, label %190

190:                                              ; preds = %187
  %191 = load i32, ptr %12, align 4, !tbaa !27
  %192 = icmp uge i32 %191, 28
  br i1 %192, label %193, label %197

193:                                              ; preds = %190, %187
  %194 = load ptr, ptr %3, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.flexframesync_s, ptr %194, i32 0, i32 29
  store i32 0, ptr %195, align 8, !tbaa !22
  %196 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef @.str.1, i32 noundef 691, ptr noundef @.str.9)
  store i32 %196, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %269

197:                                              ; preds = %190
  %198 = load i32, ptr %13, align 4, !tbaa !27
  %199 = icmp eq i32 %198, 0
  br i1 %199, label %203, label %200

200:                                              ; preds = %197
  %201 = load i32, ptr %13, align 4, !tbaa !27
  %202 = icmp uge i32 %201, 28
  br i1 %202, label %203, label %207

203:                                              ; preds = %200, %197
  %204 = load ptr, ptr %3, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.flexframesync_s, ptr %204, i32 0, i32 29
  store i32 0, ptr %205, align 8, !tbaa !22
  %206 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef @.str.1, i32 noundef 694, ptr noundef @.str.10)
  store i32 %206, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %269

207:                                              ; preds = %200
  br label %208

208:                                              ; preds = %207
  br label %209

209:                                              ; preds = %208
  br label %210

210:                                              ; preds = %209
  %211 = load ptr, ptr %3, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.flexframesync_s, ptr %211, i32 0, i32 32
  %213 = load ptr, ptr %212, align 8, !tbaa !30
  %214 = load i32, ptr %10, align 4, !tbaa !27
  %215 = call ptr @modemcf_recreate(ptr noundef %213, i32 noundef %214)
  %216 = load ptr, ptr %3, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.flexframesync_s, ptr %216, i32 0, i32 32
  store ptr %215, ptr %217, align 8, !tbaa !30
  %218 = load ptr, ptr %3, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.flexframesync_s, ptr %218, i32 0, i32 35
  %220 = load ptr, ptr %219, align 8, !tbaa !31
  %221 = load i32, ptr %9, align 4, !tbaa !27
  %222 = load i32, ptr %11, align 4, !tbaa !27
  %223 = load i32, ptr %12, align 4, !tbaa !27
  %224 = load i32, ptr %13, align 4, !tbaa !27
  %225 = load i32, ptr %10, align 4, !tbaa !27
  %226 = call i32 @qpacketmodem_configure(ptr noundef %220, i32 noundef %221, i32 noundef %222, i32 noundef %223, i32 noundef %224, i32 noundef %225)
  %227 = load ptr, ptr %3, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.flexframesync_s, ptr %227, i32 0, i32 35
  %229 = load ptr, ptr %228, align 8, !tbaa !31
  %230 = call i32 @qpacketmodem_get_frame_len(ptr noundef %229)
  %231 = load ptr, ptr %3, align 8, !tbaa !5
  %232 = getelementptr inbounds %struct.flexframesync_s, ptr %231, i32 0, i32 34
  store i32 %230, ptr %232, align 8, !tbaa !32
  %233 = load ptr, ptr %3, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.flexframesync_s, ptr %233, i32 0, i32 33
  %235 = load ptr, ptr %234, align 8, !tbaa !33
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.flexframesync_s, ptr %236, i32 0, i32 34
  %238 = load i32, ptr %237, align 8, !tbaa !32
  %239 = zext i32 %238 to i64
  %240 = mul i64 %239, 8
  %241 = call ptr @realloc(ptr noundef %235, i64 noundef %240) #6
  %242 = load ptr, ptr %3, align 8, !tbaa !5
  %243 = getelementptr inbounds %struct.flexframesync_s, ptr %242, i32 0, i32 33
  store ptr %241, ptr %243, align 8, !tbaa !33
  %244 = load ptr, ptr %3, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.flexframesync_s, ptr %244, i32 0, i32 36
  %246 = load ptr, ptr %245, align 8, !tbaa !34
  %247 = load ptr, ptr %3, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.flexframesync_s, ptr %247, i32 0, i32 37
  %249 = load i32, ptr %248, align 8, !tbaa !29
  %250 = zext i32 %249 to i64
  %251 = mul i64 %250, 1
  %252 = call ptr @realloc(ptr noundef %246, i64 noundef %251) #6
  %253 = load ptr, ptr %3, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.flexframesync_s, ptr %253, i32 0, i32 36
  store ptr %252, ptr %254, align 8, !tbaa !34
  %255 = load ptr, ptr %3, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.flexframesync_s, ptr %255, i32 0, i32 33
  %257 = load ptr, ptr %256, align 8, !tbaa !33
  %258 = icmp eq ptr %257, null
  br i1 %258, label %264, label %259

259:                                              ; preds = %210
  %260 = load ptr, ptr %3, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.flexframesync_s, ptr %260, i32 0, i32 36
  %262 = load ptr, ptr %261, align 8, !tbaa !34
  %263 = icmp eq ptr %262, null
  br i1 %263, label %264, label %268

264:                                              ; preds = %259, %210
  %265 = load ptr, ptr %3, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.flexframesync_s, ptr %265, i32 0, i32 29
  store i32 0, ptr %266, align 8, !tbaa !22
  %267 = call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 9, ptr noundef @.str.1, i32 noundef 713, ptr noundef @.str.11)
  store i32 %267, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %269

268:                                              ; preds = %259
  store i32 0, ptr %2, align 4
  store i32 1, ptr %8, align 4
  br label %269

269:                                              ; preds = %268, %264, %203, %193, %183, %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %270

270:                                              ; preds = %269, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %271

271:                                              ; preds = %270, %59
  %272 = load i32, ptr %2, align 4
  ret i32 %272
}

declare i32 @qpilotsync_execute(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @qpacketmodem_decode_soft(ptr noundef, ptr noundef, ptr noundef) #1

declare i32 @qpacketmodem_decode(ptr noundef, ptr noundef, ptr noundef) #1

declare float @qpilotsync_get_dphi(ptr noundef) #1

declare float @qpilotsync_get_phi(ptr noundef) #1

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

declare ptr @modemcf_recreate(ptr noundef, i32 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind allocsize(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 #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(1) }

!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 200}
!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 184}
!18 = !{!10, !6, i64 208}
!19 = !{!10, !13, i64 176}
!20 = !{!10, !6, i64 224}
!21 = !{!10, !6, i64 240}
!22 = !{!10, !13, i64 248}
!23 = !{!12, !12, i64 0}
!24 = !{!10, !6, i64 128}
!25 = !{!10, !13, i64 192}
!26 = !{!10, !13, i64 232}
!27 = !{!13, !13, i64 0}
!28 = !{!7, !7, i64 0}
!29 = !{!10, !13, i64 312}
!30 = !{!10, !6, i64 272}
!31 = !{!10, !6, i64 296}
!32 = !{!10, !13, i64 288}
!33 = !{!10, !6, i64 280}
!34 = !{!10, !6, i64 304}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [68 x i8], align 1

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

declare i32 @qpacketmodem_get_frame_len(ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #1

declare i32 @liquid_error_fl(i32 noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

declare i32 @nco_crcf_set_frequency(ptr noundef, float noundef) local_unnamed_addr #0

declare i32 @nco_crcf_set_phase(ptr noundef, float noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @flexframesync_decode_header(ptr nocapture noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 200
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 184
  %5 = load ptr, ptr %4, align 8, !tbaa !16
  %6 = getelementptr inbounds i8, ptr %0, i64 208
  %7 = load ptr, ptr %6, align 8, !tbaa !17
  %8 = tail call i32 @qpilotsync_execute(ptr noundef %3, ptr noundef %5, ptr noundef %7) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 176
  %10 = load i32, ptr %9, align 8, !tbaa !18
  %.not = icmp eq i32 %10, 0
  %11 = getelementptr inbounds i8, ptr %0, i64 224
  %12 = load ptr, ptr %11, align 8, !tbaa !19
  %13 = load ptr, ptr %6, align 8, !tbaa !17
  %14 = getelementptr inbounds i8, ptr %0, i64 240
  %15 = load ptr, ptr %14, align 8, !tbaa !20
  br i1 %.not, label %18, label %16

16:                                               ; preds = %1
  %17 = tail call i32 @qpacketmodem_decode_soft(ptr noundef %12, ptr noundef %13, ptr noundef %15) #4
  br label %20

18:                                               ; preds = %1
  %19 = tail call i32 @qpacketmodem_decode(ptr noundef %12, ptr noundef %13, ptr noundef %15) #4
  br label %20

20:                                               ; preds = %18, %16
  %.sink = phi i32 [ %19, %18 ], [ %17, %16 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 248
  store i32 %.sink, ptr %21, align 8
  %.not85 = icmp eq i32 %.sink, 0
  br i1 %.not85, label %119, label %22

22:                                               ; preds = %20
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = tail call float @qpilotsync_get_dphi(ptr noundef %23) #4
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = tail call float @qpilotsync_get_phi(ptr noundef %25) #4
  %27 = getelementptr inbounds i8, ptr %0, i64 128
  %28 = load ptr, ptr %27, align 8, !tbaa !21
  %29 = tail call i32 @nco_crcf_set_frequency(ptr noundef %28, float noundef %24) #4
  %30 = load ptr, ptr %27, align 8, !tbaa !21
  %31 = getelementptr inbounds i8, ptr %0, i64 192
  %32 = load i32, ptr %31, align 8, !tbaa !22
  %33 = uitofp i32 %32 to float
  %34 = tail call float @llvm.fmuladd.f32(float %24, float %33, float %26)
  %35 = tail call i32 @nco_crcf_set_phase(ptr noundef %30, float noundef %34) #4
  %36 = getelementptr inbounds i8, ptr %0, i64 232
  %37 = load i32, ptr %36, align 8, !tbaa !23
  %38 = getelementptr inbounds i8, ptr %0, i64 240
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = zext i32 %37 to i64
  %41 = getelementptr inbounds i8, ptr %39, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !24
  %.not86 = icmp eq i8 %42, 102
  br i1 %.not86, label %46, label %43

43:                                               ; preds = %22
  %44 = zext i8 %42 to i32
  store i32 0, ptr %21, align 8, !tbaa !25
  %45 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef nonnull @.str.1, i32 noundef 664, ptr noundef nonnull @.str.6, i32 noundef %44, i32 noundef 102) #4
  br label %119

46:                                               ; preds = %22
  %47 = add i32 %37, 1
  %48 = zext i32 %47 to i64
  %49 = getelementptr inbounds i8, ptr %39, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !24
  %51 = zext i8 %50 to i32
  %52 = shl nuw nsw i32 %51, 8
  %53 = add i32 %37, 2
  %54 = zext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %39, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !24
  %57 = zext i8 %56 to i32
  %58 = or disjoint i32 %52, %57
  %59 = getelementptr inbounds i8, ptr %0, i64 312
  store i32 %58, ptr %59, align 8, !tbaa !26
  %60 = add i32 %37, 3
  %61 = zext i32 %60 to i64
  %62 = getelementptr inbounds i8, ptr %39, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !24
  %64 = zext i8 %63 to i32
  %65 = add i32 %37, 4
  %66 = zext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %39, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !24
  %69 = zext i8 %68 to i32
  %70 = lshr i32 %69, 5
  %71 = and i32 %69, 31
  %72 = add i32 %37, 5
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds i8, ptr %39, i64 %73
  %75 = load i8, ptr %74, align 1, !tbaa !24
  %76 = and i8 %75, 31
  %77 = zext nneg i8 %76 to i32
  %78 = add i8 %63, -53
  %or.cond = icmp ult i8 %78, -52
  br i1 %or.cond, label %79, label %81

79:                                               ; preds = %46
  store i32 0, ptr %21, align 8, !tbaa !25
  %80 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef nonnull @.str.1, i32 noundef 685, ptr noundef nonnull @.str.7) #4
  br label %119

81:                                               ; preds = %46
  %82 = icmp ult i8 %68, 32
  %83 = icmp eq i32 %70, 7
  %or.cond3 = select i1 %82, i1 true, i1 %83
  br i1 %or.cond3, label %84, label %86

84:                                               ; preds = %81
  store i32 0, ptr %21, align 8, !tbaa !25
  %85 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef nonnull @.str.1, i32 noundef 688, ptr noundef nonnull @.str.8) #4
  br label %119

86:                                               ; preds = %81
  %87 = add nsw i32 %71, -28
  %or.cond5 = icmp ult i32 %87, -27
  br i1 %or.cond5, label %88, label %90

88:                                               ; preds = %86
  store i32 0, ptr %21, align 8, !tbaa !25
  %89 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef nonnull @.str.1, i32 noundef 691, ptr noundef nonnull @.str.9) #4
  br label %119

90:                                               ; preds = %86
  %91 = add nsw i8 %76, -28
  %or.cond7 = icmp ult i8 %91, -27
  br i1 %or.cond7, label %92, label %94

92:                                               ; preds = %90
  store i32 0, ptr %21, align 8, !tbaa !25
  %93 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 3, ptr noundef nonnull @.str.1, i32 noundef 694, ptr noundef nonnull @.str.10) #4
  br label %119

94:                                               ; preds = %90
  %95 = getelementptr inbounds i8, ptr %0, i64 272
  %96 = load ptr, ptr %95, align 8, !tbaa !27
  %97 = tail call ptr @modemcf_recreate(ptr noundef %96, i32 noundef %64) #4
  store ptr %97, ptr %95, align 8, !tbaa !27
  %98 = getelementptr inbounds i8, ptr %0, i64 296
  %99 = load ptr, ptr %98, align 8, !tbaa !28
  %100 = tail call i32 @qpacketmodem_configure(ptr noundef %99, i32 noundef %58, i32 noundef %70, i32 noundef %71, i32 noundef %77, i32 noundef %64) #4
  %101 = load ptr, ptr %98, align 8, !tbaa !28
  %102 = tail call i32 @qpacketmodem_get_frame_len(ptr noundef %101) #4
  %103 = getelementptr inbounds i8, ptr %0, i64 288
  store i32 %102, ptr %103, align 8, !tbaa !29
  %104 = getelementptr inbounds i8, ptr %0, i64 280
  %105 = load ptr, ptr %104, align 8, !tbaa !30
  %106 = zext i32 %102 to i64
  %107 = shl nuw nsw i64 %106, 3
  %108 = tail call ptr @realloc(ptr noundef %105, i64 noundef %107) #5
  store ptr %108, ptr %104, align 8, !tbaa !30
  %109 = getelementptr inbounds i8, ptr %0, i64 304
  %110 = load ptr, ptr %109, align 8, !tbaa !31
  %111 = load i32, ptr %59, align 8, !tbaa !26
  %112 = zext i32 %111 to i64
  %113 = tail call ptr @realloc(ptr noundef %110, i64 noundef %112) #5
  store ptr %113, ptr %109, align 8, !tbaa !31
  %114 = load ptr, ptr %104, align 8, !tbaa !30
  %115 = icmp eq ptr %114, null
  %116 = icmp eq ptr %113, null
  %or.cond87 = or i1 %116, %115
  br i1 %or.cond87, label %117, label %119

117:                                              ; preds = %94
  store i32 0, ptr %21, align 8, !tbaa !25
  %118 = tail call i32 (i32, ptr, i32, ptr, ...) @liquid_error_fl(i32 noundef 9, ptr noundef nonnull @.str.1, i32 noundef 713, ptr noundef nonnull @.str.11) #4
  br label %119

119:                                              ; preds = %43, %94, %117, %92, %88, %84, %79, %20
  %.2 = phi i32 [ 0, %20 ], [ %45, %43 ], [ %80, %79 ], [ %85, %84 ], [ %89, %88 ], [ %93, %92 ], [ %118, %117 ], [ 0, %94 ]
  ret i32 %.2
}

declare i32 @qpilotsync_execute(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @qpacketmodem_decode_soft(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @qpacketmodem_decode(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare float @qpilotsync_get_dphi(ptr noundef) local_unnamed_addr #0

declare float @qpilotsync_get_phi(ptr noundef) local_unnamed_addr #0

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

declare ptr @modemcf_recreate(ptr noundef, i32 noundef) local_unnamed_addr #0

attributes #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 nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, 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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
attributes #5 = { nounwind allocsize(1) }

!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 200}
!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 184}
!17 = !{!6, !7, i64 208}
!18 = !{!6, !12, i64 176}
!19 = !{!6, !7, i64 224}
!20 = !{!6, !7, i64 240}
!21 = !{!6, !7, i64 128}
!22 = !{!6, !12, i64 192}
!23 = !{!6, !12, i64 232}
!24 = !{!8, !8, i64 0}
!25 = !{!6, !12, i64 248}
!26 = !{!6, !12, i64 312}
!27 = !{!6, !7, i64 272}
!28 = !{!6, !7, i64 296}
!29 = !{!6, !12, i64 288}
!30 = !{!6, !7, i64 280}
!31 = !{!6, !7, i64 304}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass