; LLVM IR from jgaeddert/liquid-dsp :: examples (flexframesync_example)

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

@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@optarg = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @usage() #0

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %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 float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca float, align 4
  %19 = alloca float, align 4
  %20 = alloca %struct.flexframegenprops_s, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i32, align 4
  %28 = alloca float, align 4
  %29 = alloca { float, float }, align 4
  %30 = alloca { float, float }, align 4
  %31 = alloca { float, float }, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 40, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 6, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 1, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 480, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store float -6.000000e+01, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store float 2.000000e+01, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store float 0x3F847AE140000000, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  br label %32

32:                                               ; preds = %66, %2
  %33 = load i32, ptr %4, align 4, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !9
  %35 = call i32 @getopt(i32 noundef %33, ptr noundef %34, ptr noundef @.str.10) #8
  store i32 %35, ptr %15, align 4, !tbaa !5
  %36 = icmp ne i32 %35, -1
  br i1 %36, label %37, label %67

37:                                               ; preds = %32
  %38 = load i32, ptr %15, align 4, !tbaa !5
  switch i32 %38, label %65 [
    i32 117, label %39
    i32 104, label %39
    i32 115, label %40
    i32 70, label %44
    i32 110, label %48
    i32 109, label %52
    i32 118, label %55
    i32 99, label %58
    i32 107, label %61
    i32 100, label %64
  ]

39:                                               ; preds = %37, %37
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %214

40:                                               ; preds = %37
  %41 = load ptr, ptr @optarg, align 8, !tbaa !9
  %42 = call double @atof(ptr noundef %41) #9
  %43 = fptrunc double %42 to float
  store float %43, ptr %13, align 4, !tbaa !11
  br label %66

44:                                               ; preds = %37
  %45 = load ptr, ptr @optarg, align 8, !tbaa !9
  %46 = call double @atof(ptr noundef %45) #9
  %47 = fptrunc double %46 to float
  store float %47, ptr %14, align 4, !tbaa !11
  br label %66

48:                                               ; preds = %37
  %49 = load ptr, ptr @optarg, align 8, !tbaa !9
  %50 = call i64 @atol(ptr noundef %49) #9
  %51 = trunc i64 %50 to i32
  store i32 %51, ptr %10, align 4, !tbaa !5
  br label %66

52:                                               ; preds = %37
  %53 = load ptr, ptr @optarg, align 8, !tbaa !9
  %54 = call i32 @liquid_getopt_str2mod(ptr noundef %53)
  store i32 %54, ptr %6, align 4, !tbaa !5
  br label %66

55:                                               ; preds = %37
  %56 = load ptr, ptr @optarg, align 8, !tbaa !9
  %57 = call i32 @liquid_getopt_str2crc(ptr noundef %56)
  store i32 %57, ptr %7, align 4, !tbaa !5
  br label %66

58:                                               ; preds = %37
  %59 = load ptr, ptr @optarg, align 8, !tbaa !9
  %60 = call i32 @liquid_getopt_str2fec(ptr noundef %59)
  store i32 %60, ptr %8, align 4, !tbaa !5
  br label %66

61:                                               ; preds = %37
  %62 = load ptr, ptr @optarg, align 8, !tbaa !9
  %63 = call i32 @liquid_getopt_str2fec(ptr noundef %62)
  store i32 %63, ptr %9, align 4, !tbaa !5
  br label %66

64:                                               ; preds = %37
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %66

65:                                               ; preds = %37
  call void @exit(i32 noundef -1) #10
  unreachable

66:                                               ; preds = %64, %61, %58, %55, %52, %48, %44, %40
  br label %32, !llvm.loop !13

67:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  %68 = load float, ptr %12, align 4, !tbaa !11
  %69 = fdiv float %68, 2.000000e+01
  %70 = call float @powf(float noundef 1.000000e+01, float noundef %69) #8
  store float %70, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %71 = load float, ptr %13, align 4, !tbaa !11
  %72 = load float, ptr %12, align 4, !tbaa !11
  %73 = fadd float %71, %72
  %74 = fdiv float %73, 2.000000e+01
  %75 = call float @powf(float noundef 1.000000e+01, float noundef %74) #8
  store float %75, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #8
  %76 = call i32 @flexframegenprops_init_default(ptr noundef %20)
  %77 = load i32, ptr %6, align 4, !tbaa !5
  %78 = getelementptr inbounds %struct.flexframegenprops_s, ptr %20, i32 0, i32 3
  store i32 %77, ptr %78, align 4, !tbaa !15
  %79 = load i32, ptr %7, align 4, !tbaa !5
  %80 = getelementptr inbounds %struct.flexframegenprops_s, ptr %20, i32 0, i32 0
  store i32 %79, ptr %80, align 4, !tbaa !17
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = getelementptr inbounds %struct.flexframegenprops_s, ptr %20, i32 0, i32 1
  store i32 %81, ptr %82, align 4, !tbaa !18
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = getelementptr inbounds %struct.flexframegenprops_s, ptr %20, i32 0, i32 2
  store i32 %83, ptr %84, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %85 = call ptr @flexframegen_create(ptr noundef %20)
  store ptr %85, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %86 = call ptr @flexframesync_create(ptr noundef @callback, ptr noundef null)
  store ptr %86, ptr %22, align 8, !tbaa !9
  %87 = load i32, ptr %11, align 4, !tbaa !5
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %92

89:                                               ; preds = %67
  %90 = load ptr, ptr %22, align 8, !tbaa !9
  %91 = call i32 @flexframesync_debug_enable(ptr noundef %90)
  br label %92

92:                                               ; preds = %89, %67
  %93 = load ptr, ptr %21, align 8, !tbaa !9
  %94 = load i32, ptr %10, align 4, !tbaa !5
  %95 = call i32 @flexframegen_assemble(ptr noundef %93, ptr noundef null, ptr noundef null, i32 noundef %94)
  %96 = load ptr, ptr %21, align 8, !tbaa !9
  %97 = call i32 @flexframegen_print(ptr noundef %96)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 256, ptr %23, align 4, !tbaa !5
  %98 = load i32, ptr %23, align 4, !tbaa !5
  %99 = zext i32 %98 to i64
  %100 = call ptr @llvm.stacksave.p0()
  store ptr %100, ptr %24, align 8
  %101 = alloca { float, float }, i64 %99, align 16
  store i64 %99, ptr %25, align 8
  %102 = load i32, ptr %23, align 4, !tbaa !5
  %103 = zext i32 %102 to i64
  %104 = alloca { float, float }, i64 %103, align 16
  store i64 %103, ptr %26, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store float 0.000000e+00, ptr %28, align 4, !tbaa !11
  br label %105

105:                                              ; preds = %195, %92
  %106 = load i32, ptr %27, align 4, !tbaa !5
  %107 = icmp ne i32 %106, 0
  %108 = xor i1 %107, true
  br i1 %108, label %109, label %199

109:                                              ; preds = %105
  %110 = load ptr, ptr %21, align 8, !tbaa !9
  %111 = load i32, ptr %23, align 4, !tbaa !5
  %112 = call i32 @flexframegen_write_samples(ptr noundef %110, ptr noundef %101, i32 noundef %111)
  store i32 %112, ptr %27, align 4, !tbaa !5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %113

113:                                              ; preds = %192, %109
  %114 = load i32, ptr %17, align 4, !tbaa !5
  %115 = load i32, ptr %23, align 4, !tbaa !5
  %116 = icmp ult i32 %114, %115
  br i1 %116, label %117, label %195

117:                                              ; preds = %113
  %118 = load float, ptr %19, align 4, !tbaa !11
  %119 = load i32, ptr %17, align 4, !tbaa !5
  %120 = zext i32 %119 to i64
  %121 = getelementptr inbounds { float, float }, ptr %101, i64 %120
  %122 = getelementptr inbounds { float, float }, ptr %121, i32 0, i32 0
  %123 = load float, ptr %122, align 8
  %124 = getelementptr inbounds { float, float }, ptr %121, i32 0, i32 1
  %125 = load float, ptr %124, align 4
  %126 = fmul float %118, %123
  %127 = fmul float %118, %125
  %128 = load float, ptr %28, align 4, !tbaa !11
  %129 = fmul float 0.000000e+00, %128
  %130 = fmul float 1.000000e+00, %128
  %131 = getelementptr inbounds { float, float }, ptr %29, i32 0, i32 0
  %132 = getelementptr inbounds { float, float }, ptr %29, i32 0, i32 1
  store float %129, ptr %131, align 4
  store float %130, ptr %132, align 4
  %133 = load <2 x float>, ptr %29, align 4
  %134 = call <2 x float> @cexpf(<2 x float> noundef %133) #8
  store <2 x float> %134, ptr %30, align 4
  %135 = getelementptr inbounds { float, float }, ptr %30, i32 0, i32 0
  %136 = load float, ptr %135, align 4
  %137 = getelementptr inbounds { float, float }, ptr %30, i32 0, i32 1
  %138 = load float, ptr %137, align 4
  %139 = fmul float %126, %136
  %140 = fmul float %127, %138
  %141 = fmul float %126, %138
  %142 = fmul float %127, %136
  %143 = fsub float %139, %140
  %144 = fadd float %141, %142
  %145 = fcmp uno float %143, %143
  br i1 %145, label %146, label %154, !prof !20

146:                                              ; preds = %117
  %147 = fcmp uno float %144, %144
  br i1 %147, label %148, label %154, !prof !20

148:                                              ; preds = %146
  %149 = call <2 x float> @__mulsc3(float noundef %126, float noundef %127, float noundef %136, float noundef %138) #8
  store <2 x float> %149, ptr %31, align 4
  %150 = getelementptr inbounds { float, float }, ptr %31, i32 0, i32 0
  %151 = load float, ptr %150, align 4
  %152 = getelementptr inbounds { float, float }, ptr %31, i32 0, i32 1
  %153 = load float, ptr %152, align 4
  br label %154

154:                                              ; preds = %148, %146, %117
  %155 = phi float [ %143, %117 ], [ %143, %146 ], [ %151, %148 ]
  %156 = phi float [ %144, %117 ], [ %144, %146 ], [ %153, %148 ]
  %157 = load i32, ptr %17, align 4, !tbaa !5
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds { float, float }, ptr %104, i64 %158
  %160 = getelementptr inbounds { float, float }, ptr %159, i32 0, i32 0
  %161 = getelementptr inbounds { float, float }, ptr %159, i32 0, i32 1
  store float %155, ptr %160, align 8
  store float %156, ptr %161, align 4
  %162 = load float, ptr %14, align 4, !tbaa !11
  %163 = load float, ptr %28, align 4, !tbaa !11
  %164 = fadd float %163, %162
  store float %164, ptr %28, align 4, !tbaa !11
  %165 = load float, ptr %18, align 4, !tbaa !11
  %166 = call float (...) @randnf()
  %167 = call float (...) @randnf()
  %168 = fmul float 0.000000e+00, %167
  %169 = fmul float 1.000000e+00, %167
  %170 = fadd float %166, %168
  %171 = fmul float %165, %170
  %172 = fmul float %165, %169
  %173 = fpext float %171 to double
  %174 = fpext float %172 to double
  %175 = fmul double %173, 0x3FE6A09E667F3BCD
  %176 = fmul double %174, 0x3FE6A09E667F3BCD
  %177 = load i32, ptr %17, align 4, !tbaa !5
  %178 = zext i32 %177 to i64
  %179 = getelementptr inbounds { float, float }, ptr %104, i64 %178
  %180 = getelementptr inbounds { float, float }, ptr %179, i32 0, i32 0
  %181 = load float, ptr %180, align 8
  %182 = getelementptr inbounds { float, float }, ptr %179, i32 0, i32 1
  %183 = load float, ptr %182, align 4
  %184 = fpext float %181 to double
  %185 = fpext float %183 to double
  %186 = fadd double %184, %175
  %187 = fadd double %185, %176
  %188 = fptrunc double %186 to float
  %189 = fptrunc double %187 to float
  %190 = getelementptr inbounds { float, float }, ptr %179, i32 0, i32 0
  %191 = getelementptr inbounds { float, float }, ptr %179, i32 0, i32 1
  store float %188, ptr %190, align 8
  store float %189, ptr %191, align 4
  br label %192

192:                                              ; preds = %154
  %193 = load i32, ptr %17, align 4, !tbaa !5
  %194 = add i32 %193, 1
  store i32 %194, ptr %17, align 4, !tbaa !5
  br label %113, !llvm.loop !21

195:                                              ; preds = %113
  %196 = load ptr, ptr %22, align 8, !tbaa !9
  %197 = load i32, ptr %23, align 4, !tbaa !5
  %198 = call i32 @flexframesync_execute(ptr noundef %196, ptr noundef %104, i32 noundef %197)
  br label %105, !llvm.loop !22

199:                                              ; preds = %105
  %200 = load i32, ptr %11, align 4, !tbaa !5
  %201 = icmp ne i32 %200, 0
  br i1 %201, label %202, label %205

202:                                              ; preds = %199
  %203 = load ptr, ptr %22, align 8, !tbaa !9
  %204 = call i32 @flexframesync_debug_print(ptr noundef %203, ptr noundef @.str.11)
  br label %205

205:                                              ; preds = %202, %199
  %206 = load ptr, ptr %22, align 8, !tbaa !9
  %207 = call i32 @flexframesync_print(ptr noundef %206)
  %208 = load ptr, ptr %21, align 8, !tbaa !9
  %209 = call i32 @flexframegen_destroy(ptr noundef %208)
  %210 = load ptr, ptr %22, align 8, !tbaa !9
  %211 = call i32 @flexframesync_destroy(ptr noundef %210)
  %212 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  %213 = load ptr, ptr %24, align 8
  call void @llvm.stackrestore.p0(ptr %213)
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %214

214:                                              ; preds = %205, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  %215 = load i32, ptr %3, align 4
  ret i32 %215
}

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

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare double @atof(ptr noundef nonnull) #5

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr noundef nonnull) #5

declare i32 @liquid_getopt_str2mod(ptr noundef) #1

declare i32 @liquid_getopt_str2crc(ptr noundef) #1

declare i32 @liquid_getopt_str2fec(ptr noundef) #1

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

; Function Attrs: nounwind
declare float @powf(float noundef, float noundef) #4

declare i32 @flexframegenprops_init_default(ptr noundef) #1

declare ptr @flexframegen_create(ptr noundef) #1

declare ptr @flexframesync_create(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden i32 @callback(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.framesyncstats_s) align 8, ptr noundef) #0

declare i32 @flexframesync_debug_enable(ptr noundef) #1

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

declare i32 @flexframegen_print(ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #7

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

; Function Attrs: nounwind
declare <2 x float> @cexpf(<2 x float> noundef) #4

declare <2 x float> @__mulsc3(float, float, float, float)

declare float @randnf(...) #1

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

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

declare i32 @flexframesync_print(ptr noundef) #1

declare i32 @flexframegen_destroy(ptr noundef) #1

declare i32 @flexframesync_destroy(ptr noundef) #1

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #7

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { inlinehint nounwind willreturn memory(read) 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 #6 = { noreturn 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 #7 = { nocallback nofree nosync nounwind willreturn }
attributes #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !6, i64 12}
!16 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!17 = !{!16, !6, i64 0}
!18 = !{!16, !6, i64 4}
!19 = !{!16, !6, i64 8}
!20 = !{!"branch_weights", i32 1, i32 1048575}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}


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

@.str.10 = external hidden unnamed_addr constant [18 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @usage() local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca %struct.flexframegenprops_s, align 4
  br label %4

4:                                                ; preds = %.backedge, %2
  %.058 = phi float [ 0x3F847AE140000000, %2 ], [ %.058.be, %.backedge ]
  %.056 = phi float [ 2.000000e+01, %2 ], [ %.056.be, %.backedge ]
  %.054 = phi i32 [ 0, %2 ], [ %.054.be, %.backedge ]
  %.052 = phi i32 [ 480, %2 ], [ %.052.be, %.backedge ]
  %.050 = phi i32 [ 1, %2 ], [ %.050.be, %.backedge ]
  %.048 = phi i32 [ 1, %2 ], [ %.048.be, %.backedge ]
  %.046 = phi i32 [ 6, %2 ], [ %.046.be, %.backedge ]
  %.042 = phi i32 [ 40, %2 ], [ %.042.be, %.backedge ]
  %5 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.10) #10
  switch i32 %5, label %31 [
    i32 -1, label %32
    i32 117, label %6
    i32 104, label %6
    i32 115, label %7
    i32 70, label %11
    i32 110, label %15
    i32 109, label %19
    i32 118, label %22
    i32 99, label %25
    i32 107, label %28
    i32 100, label %.backedge
  ]

.backedge:                                        ; preds = %4, %28, %25, %22, %19, %15, %11, %7
  %.058.be = phi float [ %.058, %28 ], [ %.058, %25 ], [ %.058, %22 ], [ %.058, %19 ], [ %.058, %15 ], [ %14, %11 ], [ %.058, %7 ], [ %.058, %4 ]
  %.056.be = phi float [ %.056, %28 ], [ %.056, %25 ], [ %.056, %22 ], [ %.056, %19 ], [ %.056, %15 ], [ %.056, %11 ], [ %10, %7 ], [ %.056, %4 ]
  %.054.be = phi i32 [ %.054, %28 ], [ %.054, %25 ], [ %.054, %22 ], [ %.054, %19 ], [ %.054, %15 ], [ %.054, %11 ], [ %.054, %7 ], [ 1, %4 ]
  %.052.be = phi i32 [ %.052, %28 ], [ %.052, %25 ], [ %.052, %22 ], [ %.052, %19 ], [ %18, %15 ], [ %.052, %11 ], [ %.052, %7 ], [ %.052, %4 ]
  %.050.be = phi i32 [ %30, %28 ], [ %.050, %25 ], [ %.050, %22 ], [ %.050, %19 ], [ %.050, %15 ], [ %.050, %11 ], [ %.050, %7 ], [ %.050, %4 ]
  %.048.be = phi i32 [ %.048, %28 ], [ %27, %25 ], [ %.048, %22 ], [ %.048, %19 ], [ %.048, %15 ], [ %.048, %11 ], [ %.048, %7 ], [ %.048, %4 ]
  %.046.be = phi i32 [ %.046, %28 ], [ %.046, %25 ], [ %24, %22 ], [ %.046, %19 ], [ %.046, %15 ], [ %.046, %11 ], [ %.046, %7 ], [ %.046, %4 ]
  %.042.be = phi i32 [ %.042, %28 ], [ %.042, %25 ], [ %.042, %22 ], [ %21, %19 ], [ %.042, %15 ], [ %.042, %11 ], [ %.042, %7 ], [ %.042, %4 ]
  br label %4, !llvm.loop !5

6:                                                ; preds = %4, %4
  tail call void @usage()
  br label %105

7:                                                ; preds = %4
  %8 = load ptr, ptr @optarg, align 8, !tbaa !7
  %9 = tail call double @atof(ptr noundef %8) #11
  %10 = fptrunc double %9 to float
  br label %.backedge

11:                                               ; preds = %4
  %12 = load ptr, ptr @optarg, align 8, !tbaa !7
  %13 = tail call double @atof(ptr noundef %12) #11
  %14 = fptrunc double %13 to float
  br label %.backedge

15:                                               ; preds = %4
  %16 = load ptr, ptr @optarg, align 8, !tbaa !7
  %17 = tail call i64 @atol(ptr nocapture noundef %16) #11
  %18 = trunc i64 %17 to i32
  br label %.backedge

19:                                               ; preds = %4
  %20 = load ptr, ptr @optarg, align 8, !tbaa !7
  %21 = tail call i32 @liquid_getopt_str2mod(ptr noundef %20) #10
  br label %.backedge

22:                                               ; preds = %4
  %23 = load ptr, ptr @optarg, align 8, !tbaa !7
  %24 = tail call i32 @liquid_getopt_str2crc(ptr noundef %23) #10
  br label %.backedge

25:                                               ; preds = %4
  %26 = load ptr, ptr @optarg, align 8, !tbaa !7
  %27 = tail call i32 @liquid_getopt_str2fec(ptr noundef %26) #10
  br label %.backedge

28:                                               ; preds = %4
  %29 = load ptr, ptr @optarg, align 8, !tbaa !7
  %30 = tail call i32 @liquid_getopt_str2fec(ptr noundef %29) #10
  br label %.backedge

31:                                               ; preds = %4
  tail call void @exit(i32 noundef -1) #12
  unreachable

32:                                               ; preds = %4
  %33 = fadd float %.056, -6.000000e+01
  %34 = fdiv float %33, 2.000000e+01
  %35 = tail call float @powf(float noundef 1.000000e+01, float noundef %34) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #10
  %36 = call i32 @flexframegenprops_init_default(ptr noundef nonnull %3) #10
  %37 = getelementptr inbounds i8, ptr %3, i64 12
  store i32 %.042, ptr %37, align 4, !tbaa !11
  store i32 %.046, ptr %3, align 4, !tbaa !14
  %38 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 %.048, ptr %38, align 4, !tbaa !15
  %39 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 %.050, ptr %39, align 4, !tbaa !16
  %40 = call ptr @flexframegen_create(ptr noundef nonnull %3) #10
  %41 = call ptr @flexframesync_create(ptr noundef nonnull @callback, ptr noundef null) #10
  %.not61 = icmp eq i32 %.054, 0
  br i1 %.not61, label %44, label %42

42:                                               ; preds = %32
  %43 = call i32 @flexframesync_debug_enable(ptr noundef %41) #10
  br label %44

44:                                               ; preds = %42, %32
  %45 = call i32 @flexframegen_assemble(ptr noundef %40, ptr noundef null, ptr noundef null, i32 noundef %.052) #10
  %46 = call i32 @flexframegen_print(ptr noundef %40) #10
  %47 = call ptr @llvm.stacksave.p0()
  %48 = alloca [256 x { float, float }], align 16
  %49 = alloca [256 x { float, float }], align 16
  %50 = insertelement <2 x float> poison, float %35, i64 0
  %51 = shufflevector <2 x float> %50, <2 x float> poison, <2 x i32> zeroinitializer
  br label %52

52:                                               ; preds = %44, %95
  %.04381 = phi float [ 0.000000e+00, %44 ], [ %81, %95 ]
  %53 = call i32 @flexframegen_write_samples(ptr noundef %40, ptr noundef nonnull %48, i32 noundef 256) #10
  br label %54

54:                                               ; preds = %52, %76
  %indvars.iv = phi i64 [ 0, %52 ], [ %indvars.iv.next, %76 ]
  %.14480 = phi float [ %.04381, %52 ], [ %81, %76 ]
  %55 = getelementptr inbounds { float, float }, ptr %48, i64 %indvars.iv
  %56 = fmul float %.14480, 0.000000e+00
  %.sroa.02.0.vec.insert = insertelement <2 x float> poison, float %56, i64 0
  %.sroa.02.4.vec.insert = insertelement <2 x float> %.sroa.02.0.vec.insert, float %.14480, i64 1
  %57 = load <2 x float>, ptr %55, align 8
  %58 = fmul <2 x float> %51, %57
  %59 = call <2 x float> @cexpf(<2 x float> noundef %.sroa.02.4.vec.insert) #10
  %60 = fmul <2 x float> %58, %59
  %61 = shufflevector <2 x float> %59, <2 x float> poison, <2 x i32> <i32 1, i32 0>
  %62 = fmul <2 x float> %58, %61
  %shift = shufflevector <2 x float> %60, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %63 = fsub <2 x float> %60, %shift
  %64 = extractelement <2 x float> %63, i64 0
  %shift131 = shufflevector <2 x float> %62, <2 x float> poison, <2 x i32> <i32 1, i32 poison>
  %65 = fadd <2 x float> %62, %shift131
  %66 = extractelement <2 x float> %65, i64 0
  %67 = fcmp uno float %64, 0.000000e+00
  br i1 %67, label %68, label %76, !prof !17

68:                                               ; preds = %54
  %69 = fcmp uno float %66, 0.000000e+00
  br i1 %69, label %70, label %76, !prof !17

70:                                               ; preds = %68
  %71 = extractelement <2 x float> %58, i64 0
  %72 = extractelement <2 x float> %58, i64 1
  %73 = extractelement <2 x float> %59, i64 0
  %74 = extractelement <2 x float> %59, i64 1
  %75 = call <2 x float> @__mulsc3(float noundef %71, float noundef %72, float noundef %73, float noundef %74) #10
  %.sroa.0.0.vec.extract = extractelement <2 x float> %75, i64 0
  %.sroa.0.4.vec.extract = extractelement <2 x float> %75, i64 1
  br label %76

76:                                               ; preds = %70, %68, %54
  %77 = phi float [ %64, %54 ], [ %64, %68 ], [ %.sroa.0.0.vec.extract, %70 ]
  %78 = phi float [ %66, %54 ], [ %66, %68 ], [ %.sroa.0.4.vec.extract, %70 ]
  %79 = getelementptr inbounds { float, float }, ptr %49, i64 %indvars.iv
  %80 = getelementptr inbounds i8, ptr %79, i64 4
  store float %77, ptr %79, align 8
  store float %78, ptr %80, align 4
  %81 = fadd float %.058, %.14480
  %82 = call float (...) @randnf() #10
  %83 = call float (...) @randnf() #10
  %84 = fmul float %83, 0.000000e+00
  %85 = fadd float %82, %84
  %86 = insertelement <2 x float> poison, float %85, i64 0
  %87 = insertelement <2 x float> %86, float %83, i64 1
  %88 = fmul <2 x float> %87, <float 0x3F50624DE0000000, float 0x3F50624DE0000000>
  %89 = fpext <2 x float> %88 to <2 x double>
  %90 = fmul <2 x double> %89, <double 0x3FE6A09E667F3BCD, double 0x3FE6A09E667F3BCD>
  %91 = load <2 x float>, ptr %79, align 8
  %92 = fpext <2 x float> %91 to <2 x double>
  %93 = fadd <2 x double> %90, %92
  %94 = fptrunc <2 x double> %93 to <2 x float>
  store <2 x float> %94, ptr %79, align 8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 256
  br i1 %exitcond.not, label %95, label %54, !llvm.loop !18

95:                                               ; preds = %76
  %96 = call i32 @flexframesync_execute(ptr noundef %41, ptr noundef nonnull %49, i32 noundef 256) #10
  %.not62 = icmp eq i32 %53, 0
  br i1 %.not62, label %52, label %97, !llvm.loop !19

97:                                               ; preds = %95
  br i1 %.not61, label %100, label %98

98:                                               ; preds = %97
  %99 = call i32 @flexframesync_debug_print(ptr noundef %41, ptr noundef nonnull @.str.11) #10
  br label %100

100:                                              ; preds = %98, %97
  %101 = call i32 @flexframesync_print(ptr noundef %41) #10
  %102 = call i32 @flexframegen_destroy(ptr noundef %40) #10
  %103 = call i32 @flexframesync_destroy(ptr noundef %41) #10
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  call void @llvm.stackrestore.p0(ptr %47)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #10
  br label %105

105:                                              ; preds = %100, %6
  ret i32 0
}

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

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i64 @atol(ptr nocapture noundef nonnull) local_unnamed_addr #5

declare i32 @liquid_getopt_str2mod(ptr noundef) local_unnamed_addr #6

declare i32 @liquid_getopt_str2crc(ptr noundef) local_unnamed_addr #6

declare i32 @liquid_getopt_str2fec(ptr noundef) local_unnamed_addr #6

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @powf(float noundef, float noundef) local_unnamed_addr #8

declare i32 @flexframegenprops_init_default(ptr noundef) local_unnamed_addr #6

declare ptr @flexframegen_create(ptr noundef) local_unnamed_addr #6

declare ptr @flexframesync_create(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden i32 @callback(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.framesyncstats_s) align 8, ptr noundef) #0

declare i32 @flexframesync_debug_enable(ptr noundef) local_unnamed_addr #6

declare i32 @flexframegen_assemble(ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

declare i32 @flexframegen_print(ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #9

declare i32 @flexframegen_write_samples(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

; Function Attrs: nounwind
declare <2 x float> @cexpf(<2 x float> noundef) local_unnamed_addr #4

declare <2 x float> @__mulsc3(float, float, float, float) local_unnamed_addr

declare float @randnf(...) local_unnamed_addr #6

declare i32 @flexframesync_execute(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #6

declare i32 @flexframesync_debug_print(ptr noundef, ptr noundef) local_unnamed_addr #6

declare i32 @flexframesync_print(ptr noundef) local_unnamed_addr #6

declare i32 @flexframegen_destroy(ptr noundef) local_unnamed_addr #6

declare i32 @flexframesync_destroy(ptr noundef) local_unnamed_addr #6

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #9

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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #6 = { "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 #7 = { noreturn 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 #8 = { 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 #9 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { noreturn 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!12, !13, i64 12}
!12 = !{!"", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!13 = !{!"int", !9, i64 0}
!14 = !{!12, !13, i64 0}
!15 = !{!12, !13, i64 4}
!16 = !{!12, !13, i64 8}
!17 = !{!"branch_weights", i32 1, i32 1048575}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !6}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass