; LLVM IR from jgaeddert/liquid-dsp :: examples (cvsd_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 [13 x i8], align 1
@optarg = external global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.28 = 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) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca float, align 4
  %21 = alloca float, align 4
  %22 = 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 i32 512, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store float 0x3F947AE140000000, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 3, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store float 1.500000e+00, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store float 0x3FEE666660000000, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  br label %23

23:                                               ; preds = %50, %2
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !9
  %26 = call i32 @getopt(i32 noundef %24, ptr noundef %25, ptr noundef @.str.7) #8
  store i32 %26, ptr %11, align 4, !tbaa !5
  %27 = icmp ne i32 %26, -1
  br i1 %27, label %28, label %51

28:                                               ; preds = %23
  %29 = load i32, ptr %11, align 4, !tbaa !5
  switch i32 %29, label %49 [
    i32 117, label %30
    i32 104, label %30
    i32 110, label %31
    i32 102, label %34
    i32 98, label %38
    i32 122, label %41
    i32 97, label %45
  ]

30:                                               ; preds = %28, %28
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %231

31:                                               ; preds = %28
  %32 = load ptr, ptr @optarg, align 8, !tbaa !9
  %33 = call i32 @atoi(ptr noundef %32) #9
  store i32 %33, ptr %6, align 4, !tbaa !5
  br label %50

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

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

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

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

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

50:                                               ; preds = %45, %41, %38, %34, %31
  br label %23, !llvm.loop !13

51:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  %52 = load i32, ptr %6, align 4, !tbaa !5
  %53 = zext i32 %52 to i64
  %54 = call ptr @llvm.stacksave.p0()
  store ptr %54, ptr %14, align 8
  %55 = alloca float, i64 %53, align 16
  store i64 %53, ptr %15, align 8
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = zext i32 %56 to i64
  %58 = alloca i8, i64 %57, align 16
  store i64 %57, ptr %16, align 8
  %59 = load i32, ptr %6, align 4, !tbaa !5
  %60 = zext i32 %59 to i64
  %61 = alloca float, i64 %60, align 16
  store i64 %60, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %62 = load i32, ptr %8, align 4, !tbaa !5
  %63 = load float, ptr %9, align 4, !tbaa !11
  %64 = load float, ptr %10, align 4, !tbaa !11
  %65 = call ptr @cvsd_create(i32 noundef %62, float noundef %63, float noundef %64)
  store ptr %65, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = load float, ptr %9, align 4, !tbaa !11
  %68 = load float, ptr %10, align 4, !tbaa !11
  %69 = call ptr @cvsd_create(i32 noundef %66, float noundef %67, float noundef %68)
  store ptr %69, ptr %19, align 8, !tbaa !9
  %70 = load ptr, ptr %18, align 8, !tbaa !9
  %71 = call i32 @cvsd_print(ptr noundef %70)
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %92, %51
  %73 = load i32, ptr %13, align 4, !tbaa !5
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = icmp ult i32 %73, %74
  br i1 %75, label %76, label %95

76:                                               ; preds = %72
  %77 = load float, ptr %7, align 4, !tbaa !11
  %78 = fpext float %77 to double
  %79 = fmul double 0x401921FB54442D18, %78
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = uitofp i32 %80 to double
  %82 = fmul double %79, %81
  %83 = fptrunc double %82 to float
  %84 = call float @sinf(float noundef %83) #8
  %85 = load i32, ptr %13, align 4, !tbaa !5
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = call float @liquid_hamming(i32 noundef %85, i32 noundef %86)
  %88 = fmul float %84, %87
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds float, ptr %55, i64 %90
  store float %88, ptr %91, align 4, !tbaa !11
  br label %92

92:                                               ; preds = %76
  %93 = load i32, ptr %13, align 4, !tbaa !5
  %94 = add i32 %93, 1
  store i32 %94, ptr %13, align 4, !tbaa !5
  br label %72, !llvm.loop !15

95:                                               ; preds = %72
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %110, %95
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = load i32, ptr %6, align 4, !tbaa !5
  %99 = icmp ult i32 %97, %98
  br i1 %99, label %100, label %113

100:                                              ; preds = %96
  %101 = load ptr, ptr %18, align 8, !tbaa !9
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds float, ptr %55, i64 %103
  %105 = load float, ptr %104, align 4, !tbaa !11
  %106 = call zeroext i8 @cvsd_encode(ptr noundef %101, float noundef %105)
  %107 = load i32, ptr %13, align 4, !tbaa !5
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds i8, ptr %58, i64 %108
  store i8 %106, ptr %109, align 1, !tbaa !16
  br label %110

110:                                              ; preds = %100
  %111 = load i32, ptr %13, align 4, !tbaa !5
  %112 = add i32 %111, 1
  store i32 %112, ptr %13, align 4, !tbaa !5
  br label %96, !llvm.loop !17

113:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store float 0.000000e+00, ptr %20, align 4, !tbaa !11
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %154, %113
  %115 = load i32, ptr %13, align 4, !tbaa !5
  %116 = load i32, ptr %6, align 4, !tbaa !5
  %117 = icmp ult i32 %115, %116
  br i1 %117, label %118, label %157

118:                                              ; preds = %114
  %119 = load ptr, ptr %19, align 8, !tbaa !9
  %120 = load i32, ptr %13, align 4, !tbaa !5
  %121 = zext i32 %120 to i64
  %122 = getelementptr inbounds i8, ptr %58, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !16
  %124 = call float @cvsd_decode(ptr noundef %119, i8 noundef zeroext %123)
  %125 = load i32, ptr %13, align 4, !tbaa !5
  %126 = zext i32 %125 to i64
  %127 = getelementptr inbounds float, ptr %61, i64 %126
  store float %124, ptr %127, align 4, !tbaa !11
  %128 = load i32, ptr %13, align 4, !tbaa !5
  %129 = zext i32 %128 to i64
  %130 = getelementptr inbounds i8, ptr %58, i64 %129
  %131 = load i8, ptr %130, align 1, !tbaa !16
  %132 = zext i8 %131 to i32
  %133 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, i32 noundef %132)
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = add i32 %134, 1
  %136 = urem i32 %135, 32
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %140

138:                                              ; preds = %118
  %139 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  br label %140

140:                                              ; preds = %138, %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  %141 = load i32, ptr %13, align 4, !tbaa !5
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds float, ptr %55, i64 %142
  %144 = load float, ptr %143, align 4, !tbaa !11
  %145 = load i32, ptr %13, align 4, !tbaa !5
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds float, ptr %61, i64 %146
  %148 = load float, ptr %147, align 4, !tbaa !11
  %149 = fsub float %144, %148
  store float %149, ptr %21, align 4, !tbaa !11
  %150 = load float, ptr %21, align 4, !tbaa !11
  %151 = load float, ptr %21, align 4, !tbaa !11
  %152 = load float, ptr %20, align 4, !tbaa !11
  %153 = call float @llvm.fmuladd.f32(float %150, float %151, float %152)
  store float %153, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  br label %154

154:                                              ; preds = %140
  %155 = load i32, ptr %13, align 4, !tbaa !5
  %156 = add i32 %155, 1
  store i32 %156, ptr %13, align 4, !tbaa !5
  br label %114, !llvm.loop !18

157:                                              ; preds = %114
  %158 = load float, ptr %20, align 4, !tbaa !11
  %159 = load i32, ptr %6, align 4, !tbaa !5
  %160 = uitofp i32 %159 to float
  %161 = fdiv float %158, %160
  %162 = call float @sqrtf(float noundef %161) #8
  store float %162, ptr %20, align 4, !tbaa !11
  %163 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %164 = load float, ptr %20, align 4, !tbaa !11
  %165 = call float @log10f(float noundef %164) #8
  %166 = fmul float -2.000000e+01, %165
  %167 = fpext float %166 to double
  %168 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, double noundef %167)
  %169 = load ptr, ptr %18, align 8, !tbaa !9
  %170 = call i32 @cvsd_destroy(ptr noundef %169)
  %171 = load ptr, ptr %19, align 8, !tbaa !9
  %172 = call i32 @cvsd_destroy(ptr noundef %171)
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  %173 = call noalias ptr @fopen(ptr noundef @.str.11, ptr noundef @.str.12)
  store ptr %173, ptr %22, align 8, !tbaa !9
  %174 = load ptr, ptr %22, align 8, !tbaa !9
  %175 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %174, ptr noundef @.str.13, ptr noundef @.str.11) #8
  %176 = load ptr, ptr %22, align 8, !tbaa !9
  %177 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %176, ptr noundef @.str.14) #8
  %178 = load ptr, ptr %22, align 8, !tbaa !9
  %179 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %178, ptr noundef @.str.15) #8
  %180 = load ptr, ptr %22, align 8, !tbaa !9
  %181 = load i32, ptr %6, align 4, !tbaa !5
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %180, ptr noundef @.str.16, i32 noundef %181) #8
  %183 = load ptr, ptr %22, align 8, !tbaa !9
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %183, ptr noundef @.str.17) #8
  %185 = load ptr, ptr %22, align 8, !tbaa !9
  %186 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str.18) #8
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %187

187:                                              ; preds = %210, %157
  %188 = load i32, ptr %13, align 4, !tbaa !5
  %189 = load i32, ptr %6, align 4, !tbaa !5
  %190 = icmp ult i32 %188, %189
  br i1 %190, label %191, label %213

191:                                              ; preds = %187
  %192 = load ptr, ptr %22, align 8, !tbaa !9
  %193 = load i32, ptr %13, align 4, !tbaa !5
  %194 = add i32 %193, 1
  %195 = load i32, ptr %13, align 4, !tbaa !5
  %196 = zext i32 %195 to i64
  %197 = getelementptr inbounds float, ptr %55, i64 %196
  %198 = load float, ptr %197, align 4, !tbaa !11
  %199 = fpext float %198 to double
  %200 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %192, ptr noundef @.str.19, i32 noundef %194, double noundef %199) #8
  %201 = load ptr, ptr %22, align 8, !tbaa !9
  %202 = load i32, ptr %13, align 4, !tbaa !5
  %203 = add i32 %202, 1
  %204 = load i32, ptr %13, align 4, !tbaa !5
  %205 = zext i32 %204 to i64
  %206 = getelementptr inbounds float, ptr %61, i64 %205
  %207 = load float, ptr %206, align 4, !tbaa !11
  %208 = fpext float %207 to double
  %209 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %201, ptr noundef @.str.20, i32 noundef %203, double noundef %208) #8
  br label %210

210:                                              ; preds = %191
  %211 = load i32, ptr %13, align 4, !tbaa !5
  %212 = add i32 %211, 1
  store i32 %212, ptr %13, align 4, !tbaa !5
  br label %187, !llvm.loop !19

213:                                              ; preds = %187
  %214 = load ptr, ptr %22, align 8, !tbaa !9
  %215 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %214, ptr noundef @.str.21) #8
  %216 = load ptr, ptr %22, align 8, !tbaa !9
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %216, ptr noundef @.str.22) #8
  %218 = load ptr, ptr %22, align 8, !tbaa !9
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %218, ptr noundef @.str.23) #8
  %220 = load ptr, ptr %22, align 8, !tbaa !9
  %221 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %220, ptr noundef @.str.24) #8
  %222 = load ptr, ptr %22, align 8, !tbaa !9
  %223 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %222, ptr noundef @.str.25) #8
  %224 = load ptr, ptr %22, align 8, !tbaa !9
  %225 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %224, ptr noundef @.str.26) #8
  %226 = load ptr, ptr %22, align 8, !tbaa !9
  %227 = call i32 @fclose(ptr noundef %226)
  %228 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, ptr noundef @.str.11)
  %229 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #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
  %230 = load ptr, ptr %14, align 8
  call void @llvm.stackrestore.p0(ptr %230)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %231

231:                                              ; preds = %213, %30
  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
  %232 = load i32, ptr %3, align 4
  ret i32 %232
}

; 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 i32 @atoi(ptr noundef nonnull) #4

; 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: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6

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

declare i32 @cvsd_print(ptr noundef) #1

; Function Attrs: nounwind
declare float @sinf(float noundef) #3

declare float @liquid_hamming(i32 noundef, i32 noundef) #1

declare zeroext i8 @cvsd_encode(ptr noundef, float noundef) #1

declare float @cvsd_decode(ptr noundef, i8 noundef zeroext) #1

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

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

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #3

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

declare i32 @cvsd_destroy(ptr noundef) #1

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

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

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 = !{!7, !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !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 [13 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.8 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.28 = 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 #0 {
  br label %.outer

.outer:                                           ; preds = %20, %2
  %.077.ph = phi float [ %23, %20 ], [ 0x3FEE666660000000, %2 ]
  %.075.ph = phi float [ %.075.ph152, %20 ], [ 1.500000e+00, %2 ]
  %.073.ph = phi i32 [ %.073.ph157, %20 ], [ 3, %2 ]
  %.071.ph = phi float [ %.071.ph161, %20 ], [ 0x3F947AE140000000, %2 ]
  %.069.ph = phi i32 [ %.069, %20 ], [ 512, %2 ]
  br label %.outer151

.outer151:                                        ; preds = %.outer, %16
  %.075.ph152 = phi float [ %.075.ph, %.outer ], [ %19, %16 ]
  %.073.ph153 = phi i32 [ %.073.ph, %.outer ], [ %.073.ph157, %16 ]
  %.071.ph154 = phi float [ %.071.ph, %.outer ], [ %.071.ph161, %16 ]
  %.069.ph155 = phi i32 [ %.069.ph, %.outer ], [ %.069, %16 ]
  br label %.outer156

.outer156:                                        ; preds = %.outer151, %13
  %.073.ph157 = phi i32 [ %.073.ph153, %.outer151 ], [ %15, %13 ]
  %.071.ph158 = phi float [ %.071.ph154, %.outer151 ], [ %.071.ph161, %13 ]
  %.069.ph159 = phi i32 [ %.069.ph155, %.outer151 ], [ %.069, %13 ]
  br label %.outer160

.outer160:                                        ; preds = %.outer156, %9
  %.071.ph161 = phi float [ %.071.ph158, %.outer156 ], [ %12, %9 ]
  %.069.ph162 = phi i32 [ %.069.ph159, %.outer156 ], [ %.069, %9 ]
  br label %3

3:                                                ; preds = %.outer160, %6
  %.069 = phi i32 [ %8, %6 ], [ %.069.ph162, %.outer160 ]
  %4 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.7) #9
  switch i32 %4, label %24 [
    i32 -1, label %25
    i32 117, label %5
    i32 104, label %5
    i32 110, label %6
    i32 102, label %9
    i32 98, label %13
    i32 122, label %16
    i32 97, label %20
  ]

5:                                                ; preds = %3, %3
  tail call void @usage()
  br label %99

6:                                                ; preds = %3
  %7 = load ptr, ptr @optarg, align 8, !tbaa !5
  %8 = tail call i32 @atoi(ptr nocapture noundef %7) #10
  br label %3, !llvm.loop !9

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

13:                                               ; preds = %3
  %14 = load ptr, ptr @optarg, align 8, !tbaa !5
  %15 = tail call i32 @atoi(ptr nocapture noundef %14) #10
  br label %.outer156, !llvm.loop !9

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

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

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

25:                                               ; preds = %3
  %26 = zext i32 %.069 to i64
  %27 = tail call ptr @llvm.stacksave.p0()
  %28 = alloca float, i64 %26, align 16
  %29 = alloca i8, i64 %26, align 16
  %30 = alloca float, i64 %26, align 16
  %31 = tail call ptr @cvsd_create(i32 noundef %.073.ph157, float noundef %.075.ph152, float noundef %.077.ph) #9
  %32 = tail call ptr @cvsd_create(i32 noundef %.073.ph157, float noundef %.075.ph152, float noundef %.077.ph) #9
  %33 = tail call i32 @cvsd_print(ptr noundef %31) #9
  %.not = icmp eq i32 %.069, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %25
  %34 = fpext float %.071.ph161 to double
  %35 = fmul double %34, 0x401921FB54442D18
  br label %36

.preheader81:                                     ; preds = %36
  br i1 %.not, label %._crit_edge, label %.lr.ph94

36:                                               ; preds = %.lr.ph, %36
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %36 ]
  %37 = trunc nuw i64 %indvars.iv to i32
  %38 = uitofp i32 %37 to double
  %39 = fmul double %35, %38
  %40 = fptrunc double %39 to float
  %41 = tail call float @sinf(float noundef %40) #9
  %42 = tail call float @liquid_hamming(i32 noundef %37, i32 noundef %.069) #9
  %43 = fmul float %41, %42
  %44 = getelementptr inbounds float, ptr %28, i64 %indvars.iv
  store float %43, ptr %44, align 4, !tbaa !11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %26
  br i1 %exitcond.not, label %.preheader81, label %36, !llvm.loop !13

.preheader:                                       ; preds = %.lr.ph94
  br i1 %.not, label %._crit_edge, label %.lr.ph97

.lr.ph94:                                         ; preds = %.preheader81, %.lr.ph94
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.lr.ph94 ], [ 0, %.preheader81 ]
  %45 = getelementptr inbounds float, ptr %28, i64 %indvars.iv116
  %46 = load float, ptr %45, align 4, !tbaa !11
  %47 = tail call zeroext i8 @cvsd_encode(ptr noundef %31, float noundef %46) #9
  %48 = getelementptr inbounds i8, ptr %29, i64 %indvars.iv116
  store i8 %47, ptr %48, align 1, !tbaa !14
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond120.not = icmp eq i64 %indvars.iv.next117, %26
  br i1 %exitcond120.not, label %.preheader, label %.lr.ph94, !llvm.loop !15

.lr.ph97:                                         ; preds = %.preheader, %59
  %indvars.iv121 = phi i64 [ %indvars.iv.next122, %59 ], [ 0, %.preheader ]
  %.07096 = phi float [ %63, %59 ], [ 0.000000e+00, %.preheader ]
  %49 = getelementptr inbounds i8, ptr %29, i64 %indvars.iv121
  %50 = load i8, ptr %49, align 1, !tbaa !14
  %51 = tail call float @cvsd_decode(ptr noundef %32, i8 noundef zeroext %50) #9
  %52 = getelementptr inbounds float, ptr %30, i64 %indvars.iv121
  store float %51, ptr %52, align 4, !tbaa !11
  %53 = zext i8 %50 to i32
  %54 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %53)
  %indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
  %55 = and i64 %indvars.iv.next122, 31
  %56 = icmp eq i64 %55, 0
  br i1 %56, label %57, label %59

57:                                               ; preds = %.lr.ph97
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %59

59:                                               ; preds = %57, %.lr.ph97
  %60 = getelementptr inbounds float, ptr %28, i64 %indvars.iv121
  %61 = load float, ptr %60, align 4, !tbaa !11
  %62 = fsub float %61, %51
  %63 = tail call float @llvm.fmuladd.f32(float %62, float %62, float %.07096)
  %exitcond125.not = icmp eq i64 %indvars.iv.next122, %26
  br i1 %exitcond125.not, label %._crit_edge, label %.lr.ph97, !llvm.loop !16

._crit_edge:                                      ; preds = %59, %25, %.preheader81, %.preheader
  %.070.lcssa = phi float [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %.preheader81 ], [ 0.000000e+00, %25 ], [ %63, %59 ]
  %64 = uitofp i32 %.069 to float
  %65 = fdiv float %.070.lcssa, %64
  %66 = tail call float @sqrtf(float noundef %65) #9
  %67 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %68 = tail call float @log10f(float noundef %66) #9
  %69 = fmul float %68, -2.000000e+01
  %70 = fpext float %69 to double
  %71 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, double noundef %70)
  %72 = tail call i32 @cvsd_destroy(ptr noundef %31) #9
  %73 = tail call i32 @cvsd_destroy(ptr noundef %32) #9
  %74 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.12)
  %75 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.11) #9
  %76 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.14) #9
  %77 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.15) #9
  %78 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.16, i32 noundef %.069) #9
  %79 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.17) #9
  %80 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.18) #9
  br i1 %.not, label %._crit_edge101, label %.lr.ph100

.lr.ph100:                                        ; preds = %._crit_edge, %.lr.ph100
  %indvars.iv126 = phi i64 [ %indvars.iv.next127, %.lr.ph100 ], [ 0, %._crit_edge ]
  %indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
  %81 = getelementptr inbounds float, ptr %28, i64 %indvars.iv126
  %82 = load float, ptr %81, align 4, !tbaa !11
  %83 = fpext float %82 to double
  %84 = trunc nuw i64 %indvars.iv.next127 to i32
  %85 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.19, i32 noundef %84, double noundef %83) #9
  %86 = getelementptr inbounds float, ptr %30, i64 %indvars.iv126
  %87 = load float, ptr %86, align 4, !tbaa !11
  %88 = fpext float %87 to double
  %89 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.20, i32 noundef %84, double noundef %88) #9
  %exitcond130.not = icmp eq i64 %indvars.iv.next127, %26
  br i1 %exitcond130.not, label %._crit_edge101, label %.lr.ph100, !llvm.loop !17

._crit_edge101:                                   ; preds = %.lr.ph100, %._crit_edge
  %90 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.21) #9
  %91 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.22) #9
  %92 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.23) #9
  %93 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.24) #9
  %94 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.25) #9
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %74, ptr noundef nonnull @.str.26) #9
  %96 = tail call i32 @fclose(ptr noundef %74)
  %97 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, ptr noundef nonnull @.str.11)
  %98 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  tail call void @llvm.stackrestore.p0(ptr %27)
  br label %99

99:                                               ; preds = %._crit_edge101, %5
  ret i32 0
}

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

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

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

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

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

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

declare i32 @cvsd_print(ptr noundef) local_unnamed_addr #6

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

declare float @liquid_hamming(i32 noundef, i32 noundef) local_unnamed_addr #6

declare zeroext i8 @cvsd_encode(ptr noundef, float noundef) local_unnamed_addr #6

declare float @cvsd_decode(ptr noundef, i8 noundef zeroext) local_unnamed_addr #6

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

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

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

declare i32 @cvsd_destroy(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 @fprintf(ptr nocapture noundef, 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) #5

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 "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 = { 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 #4 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 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 #8 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { 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 = !{!"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 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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