; LLVM IR from jgaeddert/liquid-dsp :: examples (msresamp_crcf_noise_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"

@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@optarg = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [23 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) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  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 float 0x3FD3333340000000, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store float 6.000000e+01, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  br label %25

25:                                               ; preds = %42, %2
  %26 = load i32, ptr %4, align 4, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !9
  %28 = call i32 @getopt(i32 noundef %26, ptr noundef %27, ptr noundef @.str.5) #8
  store i32 %28, ptr %8, align 4, !tbaa !5
  %29 = icmp ne i32 %28, -1
  br i1 %29, label %30, label %43

30:                                               ; preds = %25
  %31 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %31, label %41 [
    i32 104, label %32
    i32 114, label %33
    i32 115, label %37
  ]

32:                                               ; preds = %30
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %201

33:                                               ; preds = %30
  %34 = load ptr, ptr @optarg, align 8, !tbaa !9
  %35 = call double @atof(ptr noundef %34) #9
  %36 = fptrunc double %35 to float
  store float %36, ptr %6, align 4, !tbaa !11
  br label %42

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

41:                                               ; preds = %30
  call void @exit(i32 noundef 1) #10
  unreachable

42:                                               ; preds = %37, %33
  br label %25, !llvm.loop !13

43:                                               ; preds = %25
  %44 = load float, ptr %6, align 4, !tbaa !11
  %45 = fcmp oge float %44, 1.000000e+00
  br i1 %45, label %46, label %52

46:                                               ; preds = %43
  %47 = load ptr, ptr @stderr, align 8, !tbaa !9
  %48 = load ptr, ptr %5, align 8, !tbaa !9
  %49 = getelementptr inbounds ptr, ptr %48, i64 0
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.6, ptr noundef %50) #8
  call void @exit(i32 noundef 1) #10
  unreachable

52:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %53 = load float, ptr %6, align 4, !tbaa !11
  %54 = load float, ptr %7, align 4, !tbaa !11
  %55 = call ptr @msresamp_crcf_create(float noundef %53, float noundef %54)
  store ptr %55, ptr %10, align 8, !tbaa !9
  %56 = load ptr, ptr %10, align 8, !tbaa !9
  %57 = call i32 @msresamp_crcf_print(ptr noundef %56)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1000, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 1024, ptr %12, align 4, !tbaa !5
  %58 = load i32, ptr %12, align 4, !tbaa !5
  %59 = zext i32 %58 to i64
  %60 = call ptr @llvm.stacksave.p0()
  store ptr %60, ptr %13, align 8
  %61 = alloca { float, float }, i64 %59, align 16
  store i64 %59, ptr %14, align 8
  %62 = load i32, ptr %12, align 4, !tbaa !5
  %63 = mul i32 2, %62
  %64 = zext i32 %63 to i64
  %65 = alloca { float, float }, i64 %64, align 16
  store i64 %64, ptr %15, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %66 = call ptr @msourcecf_create_default()
  store ptr %66, ptr %16, align 8, !tbaa !9
  %67 = load ptr, ptr %16, align 8, !tbaa !9
  %68 = call i32 @msourcecf_add_noise(ptr noundef %67, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef -6.000000e+01)
  %69 = load ptr, ptr %16, align 8, !tbaa !9
  %70 = load float, ptr %6, align 4, !tbaa !11
  %71 = fmul float 5.000000e-01, %70
  %72 = call i32 @msourcecf_add_noise(ptr noundef %69, float noundef 0.000000e+00, float noundef %71, float noundef 0.000000e+00)
  %73 = load ptr, ptr %16, align 8, !tbaa !9
  %74 = load float, ptr %6, align 4, !tbaa !11
  %75 = fpext float %74 to double
  %76 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %75, double 0x3FBEB851E0000000)
  %77 = fptrunc double %76 to float
  %78 = call i32 @msourcecf_add_noise(ptr noundef %73, float noundef %77, float noundef 0x3FB99999A0000000, float noundef 1.000000e+01)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 2400, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %79 = load i32, ptr %17, align 4, !tbaa !5
  %80 = call ptr @spgramcf_create_default(i32 noundef %79)
  store ptr %80, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %81 = load i32, ptr %17, align 4, !tbaa !5
  %82 = call ptr @spgramcf_create_default(i32 noundef %81)
  store ptr %82, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %100, %52
  %84 = load i32, ptr %20, align 4, !tbaa !5
  %85 = load i32, ptr %11, align 4, !tbaa !5
  %86 = icmp ult i32 %84, %85
  br i1 %86, label %87, label %103

87:                                               ; preds = %83
  %88 = load ptr, ptr %16, align 8, !tbaa !9
  %89 = load i32, ptr %12, align 4, !tbaa !5
  %90 = call i32 @msourcecf_write_samples(ptr noundef %88, ptr noundef %61, i32 noundef %89)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !5
  %91 = load ptr, ptr %10, align 8, !tbaa !9
  %92 = load i32, ptr %12, align 4, !tbaa !5
  %93 = call i32 @msresamp_crcf_execute(ptr noundef %91, ptr noundef %61, i32 noundef %92, ptr noundef %65, ptr noundef %21)
  %94 = load ptr, ptr %18, align 8, !tbaa !9
  %95 = load i32, ptr %12, align 4, !tbaa !5
  %96 = call i32 @spgramcf_write(ptr noundef %94, ptr noundef %61, i32 noundef %95)
  %97 = load ptr, ptr %19, align 8, !tbaa !9
  %98 = load i32, ptr %21, align 4, !tbaa !5
  %99 = call i32 @spgramcf_write(ptr noundef %97, ptr noundef %65, i32 noundef %98)
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %100

100:                                              ; preds = %87
  %101 = load i32, ptr %20, align 4, !tbaa !5
  %102 = add i32 %101, 1
  store i32 %102, ptr %20, align 4, !tbaa !5
  br label %83, !llvm.loop !15

103:                                              ; preds = %83
  %104 = load ptr, ptr %18, align 8, !tbaa !9
  %105 = call i64 @spgramcf_get_num_samples_total(ptr noundef %104)
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i64 noundef %105)
  %107 = load ptr, ptr %19, align 8, !tbaa !9
  %108 = call i64 @spgramcf_get_num_samples_total(ptr noundef %107)
  %109 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i64 noundef %108)
  %110 = load ptr, ptr %10, align 8, !tbaa !9
  %111 = call i32 @msresamp_crcf_destroy(ptr noundef %110)
  %112 = load i32, ptr %17, align 4, !tbaa !5
  %113 = zext i32 %112 to i64
  %114 = alloca float, i64 %113, align 16
  store i64 %113, ptr %22, align 8
  %115 = load i32, ptr %17, align 4, !tbaa !5
  %116 = zext i32 %115 to i64
  %117 = alloca float, i64 %116, align 16
  store i64 %116, ptr %23, align 8
  %118 = load ptr, ptr %18, align 8, !tbaa !9
  %119 = call i32 @spgramcf_get_psd(ptr noundef %118, ptr noundef %114)
  %120 = load ptr, ptr %19, align 8, !tbaa !9
  %121 = call i32 @spgramcf_get_psd(ptr noundef %120, ptr noundef %117)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #8
  %122 = call noalias ptr @fopen(ptr noundef @.str.9, ptr noundef @.str.10)
  store ptr %122, ptr %24, align 8, !tbaa !9
  %123 = load ptr, ptr %24, align 8, !tbaa !9
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str.11, ptr noundef @.str.9) #8
  %125 = load ptr, ptr %24, align 8, !tbaa !9
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.12) #8
  %127 = load ptr, ptr %24, align 8, !tbaa !9
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.13) #8
  %129 = load ptr, ptr %24, align 8, !tbaa !9
  %130 = load float, ptr %6, align 4, !tbaa !11
  %131 = fpext float %130 to double
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.14, double noundef %131) #8
  %133 = load ptr, ptr %24, align 8, !tbaa !9
  %134 = load i32, ptr %17, align 4, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %133, ptr noundef @.str.15, i32 noundef %134) #8
  %136 = load ptr, ptr %24, align 8, !tbaa !9
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef @.str.16) #8
  %138 = load ptr, ptr %24, align 8, !tbaa !9
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.17) #8
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %163, %103
  %141 = load i32, ptr %20, align 4, !tbaa !5
  %142 = load i32, ptr %17, align 4, !tbaa !5
  %143 = icmp ult i32 %141, %142
  br i1 %143, label %144, label %166

144:                                              ; preds = %140
  %145 = load ptr, ptr %24, align 8, !tbaa !9
  %146 = load i32, ptr %20, align 4, !tbaa !5
  %147 = add i32 %146, 1
  %148 = load i32, ptr %20, align 4, !tbaa !5
  %149 = zext i32 %148 to i64
  %150 = getelementptr inbounds float, ptr %114, i64 %149
  %151 = load float, ptr %150, align 4, !tbaa !11
  %152 = fpext float %151 to double
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str.18, i32 noundef %147, double noundef %152) #8
  %154 = load ptr, ptr %24, align 8, !tbaa !9
  %155 = load i32, ptr %20, align 4, !tbaa !5
  %156 = add i32 %155, 1
  %157 = load i32, ptr %20, align 4, !tbaa !5
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds float, ptr %117, i64 %158
  %160 = load float, ptr %159, align 4, !tbaa !11
  %161 = fpext float %160 to double
  %162 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %154, ptr noundef @.str.19, i32 noundef %156, double noundef %161) #8
  br label %163

163:                                              ; preds = %144
  %164 = load i32, ptr %20, align 4, !tbaa !5
  %165 = add i32 %164, 1
  store i32 %165, ptr %20, align 4, !tbaa !5
  br label %140, !llvm.loop !16

166:                                              ; preds = %140
  %167 = load ptr, ptr %24, align 8, !tbaa !9
  %168 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %167, ptr noundef @.str.20) #8
  %169 = load ptr, ptr %24, align 8, !tbaa !9
  %170 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %169, ptr noundef @.str.21) #8
  %171 = load ptr, ptr %24, align 8, !tbaa !9
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %171, ptr noundef @.str.22) #8
  %173 = load ptr, ptr %24, align 8, !tbaa !9
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %173, ptr noundef @.str.23) #8
  %175 = load ptr, ptr %24, align 8, !tbaa !9
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef @.str.24) #8
  %177 = load ptr, ptr %24, align 8, !tbaa !9
  %178 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef @.str.25) #8
  %179 = load ptr, ptr %24, align 8, !tbaa !9
  %180 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.26) #8
  %181 = load ptr, ptr %24, align 8, !tbaa !9
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.27) #8
  %183 = load ptr, ptr %24, align 8, !tbaa !9
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %183, ptr noundef @.str.28) #8
  %185 = load ptr, ptr %24, align 8, !tbaa !9
  %186 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str.29) #8
  %187 = load ptr, ptr %24, align 8, !tbaa !9
  %188 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %187, ptr noundef @.str.30) #8
  %189 = load ptr, ptr %24, align 8, !tbaa !9
  %190 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %189, ptr noundef @.str.31) #8
  %191 = load ptr, ptr %24, align 8, !tbaa !9
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef @.str.32) #8
  %193 = load ptr, ptr %24, align 8, !tbaa !9
  %194 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %193, ptr noundef @.str.33) #8
  %195 = load ptr, ptr %24, align 8, !tbaa !9
  %196 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %195, ptr noundef @.str.34) #8
  %197 = load ptr, ptr %24, align 8, !tbaa !9
  %198 = call i32 @fclose(ptr noundef %197)
  %199 = call i32 (ptr, ...) @printf(ptr noundef @.str.35, ptr noundef @.str.9)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  %200 = load ptr, ptr %13, align 8
  call void @llvm.stackrestore.p0(ptr %200)
  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 8, ptr %10) #8
  br label %201

201:                                              ; preds = %166, %32
  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
  %202 = load i32, ptr %3, align 4
  ret i32 %202
}

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

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

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

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare ptr @msresamp_crcf_create(float noundef, float noundef) #1

declare i32 @msresamp_crcf_print(ptr noundef) #1

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

declare ptr @msourcecf_create_default() #1

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

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

declare ptr @spgramcf_create_default(i32 noundef) #1

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

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

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

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

declare i64 @spgramcf_get_num_samples_total(ptr noundef) #1

declare i32 @msresamp_crcf_destroy(ptr noundef) #1

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #1

declare i32 @fclose(ptr noundef) #1

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

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

@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [23 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 #0 {
  %3 = alloca i32, align 4
  br label %.outer

.outer:                                           ; preds = %11, %2
  %.070.ph = phi float [ %14, %11 ], [ 6.000000e+01, %2 ]
  %.069.ph = phi float [ %.069, %11 ], [ 0x3FD3333340000000, %2 ]
  br label %4

4:                                                ; preds = %.outer, %7
  %.069 = phi float [ %10, %7 ], [ %.069.ph, %.outer ]
  %5 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.5) #9
  switch i32 %5, label %15 [
    i32 -1, label %16
    i32 104, label %6
    i32 114, label %7
    i32 115, label %11
  ]

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

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

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

15:                                               ; preds = %4
  tail call void @exit(i32 noundef 1) #11
  unreachable

16:                                               ; preds = %4
  %17 = fcmp ult float %.069, 1.000000e+00
  br i1 %17, label %22, label %18

18:                                               ; preds = %16
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = load ptr, ptr %1, align 8, !tbaa !5
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.6, ptr noundef %20) #12
  tail call void @exit(i32 noundef 1) #11
  unreachable

22:                                               ; preds = %16
  %23 = tail call ptr @msresamp_crcf_create(float noundef %.069, float noundef %.070.ph) #9
  %24 = tail call i32 @msresamp_crcf_print(ptr noundef %23) #9
  %25 = tail call ptr @llvm.stacksave.p0()
  %26 = alloca [1024 x { float, float }], align 16
  %27 = alloca [2048 x { float, float }], align 16
  %28 = tail call ptr @msourcecf_create_default() #9
  %29 = tail call i32 @msourcecf_add_noise(ptr noundef %28, float noundef 0.000000e+00, float noundef 1.000000e+00, float noundef -6.000000e+01) #9
  %30 = fmul float %.069, 5.000000e-01
  %31 = tail call i32 @msourcecf_add_noise(ptr noundef %28, float noundef 0.000000e+00, float noundef %30, float noundef 0.000000e+00) #9
  %32 = fpext float %.069 to double
  %33 = tail call double @llvm.fmuladd.f64(double %32, double 5.000000e-01, double 0x3FBEB851E0000000)
  %34 = fptrunc double %33 to float
  %35 = tail call i32 @msourcecf_add_noise(ptr noundef %28, float noundef %34, float noundef 0x3FB99999A0000000, float noundef 1.000000e+01) #9
  %36 = tail call ptr @spgramcf_create_default(i32 noundef 2400) #9
  %37 = tail call ptr @spgramcf_create_default(i32 noundef 2400) #9
  br label %38

38:                                               ; preds = %22, %38
  %.07278 = phi i32 [ 0, %22 ], [ %44, %38 ]
  %39 = call i32 @msourcecf_write_samples(ptr noundef %28, ptr noundef nonnull %26, i32 noundef 1024) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #9
  store i32 0, ptr %3, align 4, !tbaa !11
  %40 = call i32 @msresamp_crcf_execute(ptr noundef %23, ptr noundef nonnull %26, i32 noundef 1024, ptr noundef nonnull %27, ptr noundef nonnull %3) #9
  %41 = call i32 @spgramcf_write(ptr noundef %36, ptr noundef nonnull %26, i32 noundef 1024) #9
  %42 = load i32, ptr %3, align 4, !tbaa !11
  %43 = call i32 @spgramcf_write(ptr noundef %37, ptr noundef nonnull %27, i32 noundef %42) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %44 = add nuw nsw i32 %.07278, 1
  %exitcond.not = icmp eq i32 %44, 1000
  br i1 %exitcond.not, label %45, label %38, !llvm.loop !13

45:                                               ; preds = %38
  %46 = call i64 @spgramcf_get_num_samples_total(ptr noundef %36) #9
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i64 noundef %46)
  %48 = call i64 @spgramcf_get_num_samples_total(ptr noundef %37) #9
  %49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i64 noundef %48)
  %50 = call i32 @msresamp_crcf_destroy(ptr noundef %23) #9
  %51 = alloca [2400 x float], align 16
  %52 = alloca [2400 x float], align 16
  %53 = call i32 @spgramcf_get_psd(ptr noundef %36, ptr noundef nonnull %51) #9
  %54 = call i32 @spgramcf_get_psd(ptr noundef %37, ptr noundef nonnull %52) #9
  %55 = call noalias ptr @fopen(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10)
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.9) #9
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.12) #9
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.13) #9
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.14, double noundef %32) #9
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.15, i32 noundef 2400) #9
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.16) #9
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.17) #9
  br label %63

63:                                               ; preds = %45, %63
  %indvars.iv = phi i64 [ 0, %45 ], [ %indvars.iv.next, %63 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %64 = getelementptr inbounds float, ptr %51, i64 %indvars.iv
  %65 = load float, ptr %64, align 4, !tbaa !14
  %66 = fpext float %65 to double
  %67 = trunc nuw nsw i64 %indvars.iv.next to i32
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.18, i32 noundef %67, double noundef %66) #9
  %69 = getelementptr inbounds float, ptr %52, i64 %indvars.iv
  %70 = load float, ptr %69, align 4, !tbaa !14
  %71 = fpext float %70 to double
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.19, i32 noundef %67, double noundef %71) #9
  %exitcond85.not = icmp eq i64 %indvars.iv.next, 2400
  br i1 %exitcond85.not, label %73, label %63, !llvm.loop !16

73:                                               ; preds = %63
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.20) #9
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.21) #9
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.22) #9
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.23) #9
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.24) #9
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.25) #9
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.26) #9
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.27) #9
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.28) #9
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.29) #9
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.30) #9
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.31) #9
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.32) #9
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.33) #9
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.34) #9
  %89 = call i32 @fclose(ptr noundef %55)
  %90 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35, ptr noundef nonnull @.str.9)
  call void @llvm.stackrestore.p0(ptr %25)
  br label %91

91:                                               ; preds = %73, %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) #2

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

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

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

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

declare ptr @msresamp_crcf_create(float noundef, float noundef) local_unnamed_addr #6

declare i32 @msresamp_crcf_print(ptr noundef) local_unnamed_addr #6

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

declare ptr @msourcecf_create_default() local_unnamed_addr #6

declare i32 @msourcecf_add_noise(ptr noundef, float noundef, float noundef, float noundef) local_unnamed_addr #6

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

declare ptr @spgramcf_create_default(i32 noundef) local_unnamed_addr #6

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

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

declare i32 @spgramcf_write(ptr noundef, ptr noundef, i32 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) #2

declare i64 @spgramcf_get_num_samples_total(ptr noundef) local_unnamed_addr #6

declare i32 @msresamp_crcf_destroy(ptr noundef) local_unnamed_addr #6

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: mustprogress 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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #8 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { noreturn nounwind }
attributes #12 = { cold 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = distinct !{!16, !10}


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