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

27:                                               ; preds = %51, %2
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = call i32 @getopt(i32 noundef %28, ptr noundef %29, ptr noundef @.str.7) #8
  store i32 %30, ptr %10, align 4, !tbaa !5
  %31 = icmp ne i32 %30, -1
  br i1 %31, label %32, label %52

32:                                               ; preds = %27
  %33 = load i32, ptr %10, align 4, !tbaa !5
  switch i32 %33, label %50 [
    i32 104, label %34
    i32 114, label %35
    i32 109, label %39
    i32 119, label %42
    i32 115, label %46
  ]

34:                                               ; preds = %32
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  br label %212

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

39:                                               ; preds = %32
  %40 = load ptr, ptr @optarg, align 8, !tbaa !9
  %41 = call i32 @atoi(ptr noundef %40) #9
  store i32 %41, ptr %7, align 4, !tbaa !5
  br label %51

42:                                               ; preds = %32
  %43 = load ptr, ptr @optarg, align 8, !tbaa !9
  %44 = call double @atof(ptr noundef %43) #9
  %45 = fptrunc double %44 to float
  store float %45, ptr %8, align 4, !tbaa !11
  br label %51

46:                                               ; preds = %32
  %47 = load ptr, ptr @optarg, align 8, !tbaa !9
  %48 = call double @atof(ptr noundef %47) #9
  %49 = fptrunc double %48 to float
  store float %49, ptr %9, align 4, !tbaa !11
  br label %51

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

51:                                               ; preds = %46, %42, %39, %35
  br label %27, !llvm.loop !13

52:                                               ; preds = %27
  %53 = load float, ptr %6, align 4, !tbaa !11
  %54 = fcmp oge float %53, 1.000000e+00
  br i1 %54, label %55, label %61

55:                                               ; preds = %52
  %56 = load ptr, ptr @stderr, align 8, !tbaa !9
  %57 = load ptr, ptr %5, align 8, !tbaa !9
  %58 = getelementptr inbounds ptr, ptr %57, i64 0
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.8, ptr noundef %59) #8
  call void @exit(i32 noundef 1) #10
  unreachable

61:                                               ; preds = %52
  %62 = load float, ptr %8, align 4, !tbaa !11
  %63 = fcmp olt float %62, 0.000000e+00
  br i1 %63, label %64, label %67

64:                                               ; preds = %61
  %65 = load float, ptr %6, align 4, !tbaa !11
  %66 = fmul float 0x3FD6666660000000, %65
  store float %66, ptr %8, align 4, !tbaa !11
  br label %67

67:                                               ; preds = %64, %61
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %68 = load float, ptr %6, align 4, !tbaa !11
  %69 = load i32, ptr %7, align 4, !tbaa !5
  %70 = load float, ptr %8, align 4, !tbaa !11
  %71 = load float, ptr %9, align 4, !tbaa !11
  %72 = call ptr @resamp_crcf_create(float noundef %68, i32 noundef %69, float noundef %70, float noundef %71, i32 noundef 256)
  store ptr %72, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 1000, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 1024, ptr %14, align 4, !tbaa !5
  %73 = load i32, ptr %14, align 4, !tbaa !5
  %74 = zext i32 %73 to i64
  %75 = call ptr @llvm.stacksave.p0()
  store ptr %75, ptr %15, align 8
  %76 = alloca { float, float }, i64 %74, align 16
  store i64 %74, ptr %16, align 8
  %77 = load i32, ptr %14, align 4, !tbaa !5
  %78 = mul i32 2, %77
  %79 = zext i32 %78 to i64
  %80 = alloca { float, float }, i64 %79, align 16
  store i64 %79, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %81 = call ptr @msourcecf_create_default()
  store ptr %81, ptr %18, align 8, !tbaa !9
  %82 = load ptr, ptr %18, align 8, !tbaa !9
  %83 = load float, ptr %6, align 4, !tbaa !11
  %84 = fmul float 5.000000e-01, %83
  %85 = call i32 @msourcecf_add_noise(ptr noundef %82, float noundef 0.000000e+00, float noundef %84, float noundef 0.000000e+00)
  %86 = load ptr, ptr %18, align 8, !tbaa !9
  %87 = load float, ptr %6, align 4, !tbaa !11
  %88 = call float @llvm.fmuladd.f32(float 5.000000e-01, float %87, float 0x3FA47AE140000000)
  %89 = call i32 @msourcecf_add_noise(ptr noundef %86, float noundef %88, float noundef 0x3F947AE140000000, float noundef 1.000000e+01)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  store i32 2400, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %90 = load i32, ptr %19, align 4, !tbaa !5
  %91 = call ptr @spgramcf_create_default(i32 noundef %90)
  store ptr %91, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %92 = load i32, ptr %19, align 4, !tbaa !5
  %93 = call ptr @spgramcf_create_default(i32 noundef %92)
  store ptr %93, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %111, %67
  %95 = load i32, ptr %22, align 4, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !5
  %97 = icmp ult i32 %95, %96
  br i1 %97, label %98, label %114

98:                                               ; preds = %94
  %99 = load ptr, ptr %18, align 8, !tbaa !9
  %100 = load i32, ptr %14, align 4, !tbaa !5
  %101 = call i32 @msourcecf_write_samples(ptr noundef %99, ptr noundef %76, i32 noundef %100)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %23, align 4, !tbaa !5
  %102 = load ptr, ptr %12, align 8, !tbaa !9
  %103 = load i32, ptr %14, align 4, !tbaa !5
  %104 = call i32 @resamp_crcf_execute_block(ptr noundef %102, ptr noundef %76, i32 noundef %103, ptr noundef %80, ptr noundef %23)
  %105 = load ptr, ptr %20, align 8, !tbaa !9
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = call i32 @spgramcf_write(ptr noundef %105, ptr noundef %76, i32 noundef %106)
  %108 = load ptr, ptr %21, align 8, !tbaa !9
  %109 = load i32, ptr %23, align 4, !tbaa !5
  %110 = call i32 @spgramcf_write(ptr noundef %108, ptr noundef %80, i32 noundef %109)
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  br label %111

111:                                              ; preds = %98
  %112 = load i32, ptr %22, align 4, !tbaa !5
  %113 = add i32 %112, 1
  store i32 %113, ptr %22, align 4, !tbaa !5
  br label %94, !llvm.loop !15

114:                                              ; preds = %94
  %115 = load ptr, ptr %20, align 8, !tbaa !9
  %116 = call i64 @spgramcf_get_num_samples_total(ptr noundef %115)
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, i64 noundef %116)
  %118 = load ptr, ptr %21, align 8, !tbaa !9
  %119 = call i64 @spgramcf_get_num_samples_total(ptr noundef %118)
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i64 noundef %119)
  %121 = load ptr, ptr %12, align 8, !tbaa !9
  %122 = call i32 @resamp_crcf_destroy(ptr noundef %121)
  %123 = load i32, ptr %19, align 4, !tbaa !5
  %124 = zext i32 %123 to i64
  %125 = alloca float, i64 %124, align 16
  store i64 %124, ptr %24, align 8
  %126 = load i32, ptr %19, align 4, !tbaa !5
  %127 = zext i32 %126 to i64
  %128 = alloca float, i64 %127, align 16
  store i64 %127, ptr %25, align 8
  %129 = load ptr, ptr %20, align 8, !tbaa !9
  %130 = call i32 @spgramcf_get_psd(ptr noundef %129, ptr noundef %125)
  %131 = load ptr, ptr %21, align 8, !tbaa !9
  %132 = call i32 @spgramcf_get_psd(ptr noundef %131, ptr noundef %128)
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #8
  %133 = call noalias ptr @fopen(ptr noundef @.str.11, ptr noundef @.str.12)
  store ptr %133, ptr %26, align 8, !tbaa !9
  %134 = load ptr, ptr %26, align 8, !tbaa !9
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.13, ptr noundef @.str.11) #8
  %136 = load ptr, ptr %26, align 8, !tbaa !9
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef @.str.14) #8
  %138 = load ptr, ptr %26, align 8, !tbaa !9
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.15) #8
  %140 = load ptr, ptr %26, align 8, !tbaa !9
  %141 = load float, ptr %6, align 4, !tbaa !11
  %142 = fpext float %141 to double
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %140, ptr noundef @.str.16, double noundef %142) #8
  %144 = load ptr, ptr %26, align 8, !tbaa !9
  %145 = load i32, ptr %19, align 4, !tbaa !5
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef @.str.17, i32 noundef %145) #8
  %147 = load ptr, ptr %26, align 8, !tbaa !9
  %148 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef @.str.18) #8
  %149 = load ptr, ptr %26, align 8, !tbaa !9
  %150 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %149, ptr noundef @.str.19) #8
  store i32 0, ptr %22, align 4, !tbaa !5
  br label %151

151:                                              ; preds = %174, %114
  %152 = load i32, ptr %22, align 4, !tbaa !5
  %153 = load i32, ptr %19, align 4, !tbaa !5
  %154 = icmp ult i32 %152, %153
  br i1 %154, label %155, label %177

155:                                              ; preds = %151
  %156 = load ptr, ptr %26, align 8, !tbaa !9
  %157 = load i32, ptr %22, align 4, !tbaa !5
  %158 = add i32 %157, 1
  %159 = load i32, ptr %22, align 4, !tbaa !5
  %160 = zext i32 %159 to i64
  %161 = getelementptr inbounds float, ptr %125, i64 %160
  %162 = load float, ptr %161, align 4, !tbaa !11
  %163 = fpext float %162 to double
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %156, ptr noundef @.str.20, i32 noundef %158, double noundef %163) #8
  %165 = load ptr, ptr %26, align 8, !tbaa !9
  %166 = load i32, ptr %22, align 4, !tbaa !5
  %167 = add i32 %166, 1
  %168 = load i32, ptr %22, align 4, !tbaa !5
  %169 = zext i32 %168 to i64
  %170 = getelementptr inbounds float, ptr %128, i64 %169
  %171 = load float, ptr %170, align 4, !tbaa !11
  %172 = fpext float %171 to double
  %173 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef @.str.21, i32 noundef %167, double noundef %172) #8
  br label %174

174:                                              ; preds = %155
  %175 = load i32, ptr %22, align 4, !tbaa !5
  %176 = add i32 %175, 1
  store i32 %176, ptr %22, align 4, !tbaa !5
  br label %151, !llvm.loop !16

177:                                              ; preds = %151
  %178 = load ptr, ptr %26, align 8, !tbaa !9
  %179 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %178, ptr noundef @.str.22) #8
  %180 = load ptr, ptr %26, align 8, !tbaa !9
  %181 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %180, ptr noundef @.str.23) #8
  %182 = load ptr, ptr %26, align 8, !tbaa !9
  %183 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %182, ptr noundef @.str.24) #8
  %184 = load ptr, ptr %26, align 8, !tbaa !9
  %185 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %184, ptr noundef @.str.25) #8
  %186 = load ptr, ptr %26, align 8, !tbaa !9
  %187 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %186, ptr noundef @.str.26) #8
  %188 = load ptr, ptr %26, align 8, !tbaa !9
  %189 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef @.str.27) #8
  %190 = load ptr, ptr %26, align 8, !tbaa !9
  %191 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %190, ptr noundef @.str.28) #8
  %192 = load ptr, ptr %26, align 8, !tbaa !9
  %193 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %192, ptr noundef @.str.29) #8
  %194 = load ptr, ptr %26, align 8, !tbaa !9
  %195 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %194, ptr noundef @.str.30) #8
  %196 = load ptr, ptr %26, align 8, !tbaa !9
  %197 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %196, ptr noundef @.str.31) #8
  %198 = load ptr, ptr %26, align 8, !tbaa !9
  %199 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %198, ptr noundef @.str.32) #8
  %200 = load ptr, ptr %26, align 8, !tbaa !9
  %201 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %200, ptr noundef @.str.33) #8
  %202 = load ptr, ptr %26, align 8, !tbaa !9
  %203 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %202, ptr noundef @.str.34) #8
  %204 = load ptr, ptr %26, align 8, !tbaa !9
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef @.str.35) #8
  %206 = load ptr, ptr %26, align 8, !tbaa !9
  %207 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef @.str.36) #8
  %208 = load ptr, ptr %26, align 8, !tbaa !9
  %209 = call i32 @fclose(ptr noundef %208)
  %210 = call i32 (ptr, ...) @printf(ptr noundef @.str.37, ptr noundef @.str.11)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  %211 = load ptr, ptr %15, align 8
  call void @llvm.stackrestore.p0(ptr %211)
  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 8, ptr %12) #8
  br label %212

212:                                              ; preds = %177, %34
  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
  %213 = load i32, ptr %3, align 4
  ret i32 %213
}

; 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: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(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 @resamp_crcf_create(float noundef, i32 noundef, float noundef, float noundef, i32 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 float @llvm.fmuladd.f32(float, float, float) #7

declare ptr @spgramcf_create_default(i32 noundef) #1

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

declare i32 @resamp_crcf_execute_block(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 @resamp_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.7 = external hidden unnamed_addr constant [10 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [28 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 [12 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.37 = 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 = %18, %2
  %.078.ph = phi float [ %21, %18 ], [ 6.000000e+01, %2 ]
  %.076.ph = phi float [ %.076.ph117, %18 ], [ -1.000000e+00, %2 ]
  %.072.ph = phi i32 [ %.072.ph121, %18 ], [ 25, %2 ]
  %.071.ph = phi float [ %.071, %18 ], [ 0x3FE3333340000000, %2 ]
  br label %.outer116

.outer116:                                        ; preds = %.outer, %14
  %.076.ph117 = phi float [ %.076.ph, %.outer ], [ %17, %14 ]
  %.072.ph118 = phi i32 [ %.072.ph, %.outer ], [ %.072.ph121, %14 ]
  %.071.ph119 = phi float [ %.071.ph, %.outer ], [ %.071, %14 ]
  br label %.outer120

.outer120:                                        ; preds = %.outer116, %11
  %.072.ph121 = phi i32 [ %.072.ph118, %.outer116 ], [ %13, %11 ]
  %.071.ph122 = phi float [ %.071.ph119, %.outer116 ], [ %.071, %11 ]
  br label %4

4:                                                ; preds = %.outer120, %7
  %.071 = phi float [ %10, %7 ], [ %.071.ph122, %.outer120 ]
  %5 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.7) #9
  switch i32 %5, label %22 [
    i32 -1, label %23
    i32 104, label %6
    i32 114, label %7
    i32 109, label %11
    i32 119, label %14
    i32 115, label %18
  ]

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

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 i32 @atoi(ptr nocapture noundef %12) #10
  br label %.outer120, !llvm.loop !9

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

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

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

23:                                               ; preds = %4
  %24 = fcmp ult float %.071, 1.000000e+00
  br i1 %24, label %29, label %25

25:                                               ; preds = %23
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = load ptr, ptr %1, align 8, !tbaa !5
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str.8, ptr noundef %27) #12
  tail call void @exit(i32 noundef 1) #11
  unreachable

29:                                               ; preds = %23
  %30 = fcmp olt float %.076.ph117, 0.000000e+00
  %31 = fmul float %.071, 0x3FD6666660000000
  %.2 = select i1 %30, float %31, float %.076.ph117
  %32 = tail call ptr @resamp_crcf_create(float noundef %.071, i32 noundef %.072.ph121, float noundef %.2, float noundef %.078.ph, i32 noundef 256) #9
  %33 = tail call ptr @llvm.stacksave.p0()
  %34 = alloca [1024 x { float, float }], align 16
  %35 = alloca [2048 x { float, float }], align 16
  %36 = tail call ptr @msourcecf_create_default() #9
  %37 = fmul float %.071, 5.000000e-01
  %38 = tail call i32 @msourcecf_add_noise(ptr noundef %36, float noundef 0.000000e+00, float noundef %37, float noundef 0.000000e+00) #9
  %39 = tail call float @llvm.fmuladd.f32(float %.071, float 5.000000e-01, float 0x3FA47AE140000000)
  %40 = tail call i32 @msourcecf_add_noise(ptr noundef %36, float noundef %39, float noundef 0x3F947AE140000000, float noundef 1.000000e+01) #9
  %41 = tail call ptr @spgramcf_create_default(i32 noundef 2400) #9
  %42 = tail call ptr @spgramcf_create_default(i32 noundef 2400) #9
  br label %43

43:                                               ; preds = %29, %43
  %.07488 = phi i32 [ 0, %29 ], [ %49, %43 ]
  %44 = call i32 @msourcecf_write_samples(ptr noundef %36, ptr noundef nonnull %34, 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
  %45 = call i32 @resamp_crcf_execute_block(ptr noundef %32, ptr noundef nonnull %34, i32 noundef 1024, ptr noundef nonnull %35, ptr noundef nonnull %3) #9
  %46 = call i32 @spgramcf_write(ptr noundef %41, ptr noundef nonnull %34, i32 noundef 1024) #9
  %47 = load i32, ptr %3, align 4, !tbaa !11
  %48 = call i32 @spgramcf_write(ptr noundef %42, ptr noundef nonnull %35, i32 noundef %47) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #9
  %49 = add nuw nsw i32 %.07488, 1
  %exitcond.not = icmp eq i32 %49, 1000
  br i1 %exitcond.not, label %50, label %43, !llvm.loop !13

50:                                               ; preds = %43
  %51 = call i64 @spgramcf_get_num_samples_total(ptr noundef %41) #9
  %52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i64 noundef %51)
  %53 = call i64 @spgramcf_get_num_samples_total(ptr noundef %42) #9
  %54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i64 noundef %53)
  %55 = call i32 @resamp_crcf_destroy(ptr noundef %32) #9
  %56 = alloca [2400 x float], align 16
  %57 = alloca [2400 x float], align 16
  %58 = call i32 @spgramcf_get_psd(ptr noundef %41, ptr noundef nonnull %56) #9
  %59 = call i32 @spgramcf_get_psd(ptr noundef %42, ptr noundef nonnull %57) #9
  %60 = call noalias ptr @fopen(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.12)
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.11) #9
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.14) #9
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.15) #9
  %64 = fpext float %.071 to double
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.16, double noundef %64) #9
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.17, i32 noundef 2400) #9
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.18) #9
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.19) #9
  br label %69

69:                                               ; preds = %50, %69
  %indvars.iv = phi i64 [ 0, %50 ], [ %indvars.iv.next, %69 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %70 = getelementptr inbounds float, ptr %56, i64 %indvars.iv
  %71 = load float, ptr %70, align 4, !tbaa !14
  %72 = fpext float %71 to double
  %73 = trunc nuw nsw i64 %indvars.iv.next to i32
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.20, i32 noundef %73, double noundef %72) #9
  %75 = getelementptr inbounds float, ptr %57, i64 %indvars.iv
  %76 = load float, ptr %75, align 4, !tbaa !14
  %77 = fpext float %76 to double
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.21, i32 noundef %73, double noundef %77) #9
  %exitcond99.not = icmp eq i64 %indvars.iv.next, 2400
  br i1 %exitcond99.not, label %79, label %69, !llvm.loop !16

79:                                               ; preds = %69
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.22) #9
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.23) #9
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.24) #9
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.25) #9
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.26) #9
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.27) #9
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.28) #9
  %87 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.29) #9
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.30) #9
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.31) #9
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.32) #9
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.33) #9
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.34) #9
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.35) #9
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.36) #9
  %95 = call i32 @fclose(ptr noundef %60)
  %96 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.37, ptr noundef nonnull @.str.11)
  call void @llvm.stackrestore.p0(ptr %33)
  br label %97

97:                                               ; preds = %79, %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: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(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 @resamp_crcf_create(float noundef, i32 noundef, float noundef, float noundef, i32 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 float @llvm.fmuladd.f32(float, float, float) #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 @resamp_crcf_execute_block(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 @resamp_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