; LLVM IR from jgaeddert/liquid-dsp :: examples (agc_rrrf_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.4 = external hidden unnamed_addr constant [10 x i8], align 1
@optarg = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.32 = 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 float, align 4
  %7 = alloca float, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = 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) #7
  store float 0x3F847AE140000000, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store float 0x3F50624DE0000000, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 2000, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  br label %18

18:                                               ; preds = %34, %2
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = load ptr, ptr %5, align 8, !tbaa !9
  %21 = call i32 @getopt(i32 noundef %19, ptr noundef %20, ptr noundef @.str.4) #7
  store i32 %21, ptr %9, align 4, !tbaa !5
  %22 = icmp ne i32 %21, -1
  br i1 %22, label %23, label %35

23:                                               ; preds = %18
  %24 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %24, label %33 [
    i32 104, label %25
    i32 110, label %26
    i32 98, label %29
  ]

25:                                               ; preds = %23
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  br label %210

26:                                               ; preds = %23
  %27 = load ptr, ptr @optarg, align 8, !tbaa !9
  %28 = call i32 @atoi(ptr noundef %27) #8
  store i32 %28, ptr %8, align 4, !tbaa !5
  br label %34

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

33:                                               ; preds = %23
  call void @exit(i32 noundef 1) #9
  unreachable

34:                                               ; preds = %29, %26
  br label %18, !llvm.loop !13

35:                                               ; preds = %18
  %36 = load float, ptr %6, align 4, !tbaa !11
  %37 = fcmp olt float %36, 0.000000e+00
  br i1 %37, label %38, label %44

38:                                               ; preds = %35
  %39 = load ptr, ptr @stderr, align 8, !tbaa !9
  %40 = load ptr, ptr %5, align 8, !tbaa !9
  %41 = getelementptr inbounds ptr, ptr %40, i64 0
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.5, ptr noundef %42) #7
  call void @exit(i32 noundef 1) #9
  unreachable

44:                                               ; preds = %35
  %45 = load i32, ptr %8, align 4, !tbaa !5
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %53

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

53:                                               ; preds = %44
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %55 = call ptr @agc_rrrf_create()
  store ptr %55, ptr %12, align 8, !tbaa !9
  %56 = load ptr, ptr %12, align 8, !tbaa !9
  %57 = load float, ptr %6, align 4, !tbaa !11
  %58 = call i32 @agc_rrrf_set_bandwidth(ptr noundef %56, float noundef %57)
  %59 = load i32, ptr %8, align 4, !tbaa !5
  %60 = zext i32 %59 to i64
  %61 = call ptr @llvm.stacksave.p0()
  store ptr %61, ptr %13, align 8
  %62 = alloca float, i64 %60, align 16
  store i64 %60, ptr %14, align 8
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = zext i32 %63 to i64
  %65 = alloca float, i64 %64, align 16
  store i64 %64, ptr %15, align 8
  %66 = load i32, ptr %8, align 4, !tbaa !5
  %67 = zext i32 %66 to i64
  %68 = alloca float, i64 %67, align 16
  store i64 %67, ptr %16, align 8
  %69 = load float, ptr %6, align 4, !tbaa !11
  %70 = fpext float %69 to double
  %71 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, double noundef %70)
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %87, %54
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = icmp ult i32 %73, %74
  br i1 %75, label %76, label %90

76:                                               ; preds = %72
  %77 = load float, ptr %7, align 4, !tbaa !11
  %78 = load i32, ptr %11, align 4, !tbaa !5
  %79 = uitofp i32 %78 to double
  %80 = fmul double 0x3FE2B2E1EE11C60E, %79
  %81 = fptrunc double %80 to float
  %82 = call float @cosf(float noundef %81) #7
  %83 = fmul float %77, %82
  %84 = load i32, ptr %11, align 4, !tbaa !5
  %85 = zext i32 %84 to i64
  %86 = getelementptr inbounds float, ptr %62, i64 %85
  store float %83, ptr %86, align 4, !tbaa !11
  br label %87

87:                                               ; preds = %76
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = add i32 %88, 1
  store i32 %89, ptr %11, align 4, !tbaa !5
  br label %72, !llvm.loop !15

90:                                               ; preds = %72
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %110, %90
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = load i32, ptr %8, align 4, !tbaa !5
  %94 = icmp ult i32 %92, %93
  br i1 %94, label %95, label %113

95:                                               ; preds = %91
  %96 = load ptr, ptr %12, align 8, !tbaa !9
  %97 = load i32, ptr %11, align 4, !tbaa !5
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds float, ptr %62, i64 %98
  %100 = load float, ptr %99, align 4, !tbaa !11
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds float, ptr %65, i64 %102
  %104 = call i32 @agc_rrrf_execute(ptr noundef %96, float noundef %100, ptr noundef %103)
  %105 = load ptr, ptr %12, align 8, !tbaa !9
  %106 = call float @agc_rrrf_get_rssi(ptr noundef %105)
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = zext i32 %107 to i64
  %109 = getelementptr inbounds float, ptr %68, i64 %108
  store float %106, ptr %109, align 4, !tbaa !11
  br label %110

110:                                              ; preds = %95
  %111 = load i32, ptr %11, align 4, !tbaa !5
  %112 = add i32 %111, 1
  store i32 %112, ptr %11, align 4, !tbaa !5
  br label %91, !llvm.loop !16

113:                                              ; preds = %91
  %114 = load ptr, ptr %12, align 8, !tbaa !9
  %115 = call i32 @agc_rrrf_destroy(ptr noundef %114)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %116 = call noalias ptr @fopen(ptr noundef @.str.8, ptr noundef @.str.9)
  store ptr %116, ptr %17, align 8, !tbaa !9
  %117 = load ptr, ptr %17, align 8, !tbaa !9
  %118 = icmp ne ptr %117, null
  br i1 %118, label %125, label %119

119:                                              ; preds = %113
  %120 = load ptr, ptr @stderr, align 8, !tbaa !9
  %121 = load ptr, ptr %5, align 8, !tbaa !9
  %122 = getelementptr inbounds ptr, ptr %121, i64 0
  %123 = load ptr, ptr %122, align 8, !tbaa !9
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.10, ptr noundef %123, ptr noundef @.str.8) #7
  call void @exit(i32 noundef 1) #9
  unreachable

125:                                              ; preds = %113
  %126 = load ptr, ptr %17, align 8, !tbaa !9
  %127 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.11, ptr noundef @.str.8) #7
  %128 = load ptr, ptr %17, align 8, !tbaa !9
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %128, ptr noundef @.str.12) #7
  %130 = load ptr, ptr %17, align 8, !tbaa !9
  %131 = load i32, ptr %8, align 4, !tbaa !5
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str.13, i32 noundef %131) #7
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %165, %125
  %134 = load i32, ptr %11, align 4, !tbaa !5
  %135 = load i32, ptr %8, align 4, !tbaa !5
  %136 = icmp ult i32 %134, %135
  br i1 %136, label %137, label %168

137:                                              ; preds = %133
  %138 = load ptr, ptr %17, align 8, !tbaa !9
  %139 = load i32, ptr %11, align 4, !tbaa !5
  %140 = add i32 %139, 1
  %141 = load i32, ptr %11, align 4, !tbaa !5
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds float, ptr %62, i64 %142
  %144 = load float, ptr %143, align 4, !tbaa !11
  %145 = fpext float %144 to double
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.14, i32 noundef %140, double noundef %145) #7
  %147 = load ptr, ptr %17, align 8, !tbaa !9
  %148 = load i32, ptr %11, align 4, !tbaa !5
  %149 = add i32 %148, 1
  %150 = load i32, ptr %11, align 4, !tbaa !5
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds float, ptr %65, i64 %151
  %153 = load float, ptr %152, align 4, !tbaa !11
  %154 = fpext float %153 to double
  %155 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %147, ptr noundef @.str.15, i32 noundef %149, double noundef %154) #7
  %156 = load ptr, ptr %17, align 8, !tbaa !9
  %157 = load i32, ptr %11, align 4, !tbaa !5
  %158 = add i32 %157, 1
  %159 = load i32, ptr %11, align 4, !tbaa !5
  %160 = zext i32 %159 to i64
  %161 = getelementptr inbounds float, ptr %68, 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.16, i32 noundef %158, double noundef %163) #7
  br label %165

165:                                              ; preds = %137
  %166 = load i32, ptr %11, align 4, !tbaa !5
  %167 = add i32 %166, 1
  store i32 %167, ptr %11, align 4, !tbaa !5
  br label %133, !llvm.loop !17

168:                                              ; preds = %133
  %169 = load ptr, ptr %17, align 8, !tbaa !9
  %170 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %169, ptr noundef @.str.17) #7
  %171 = load ptr, ptr %17, align 8, !tbaa !9
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %171, ptr noundef @.str.18) #7
  %173 = load ptr, ptr %17, align 8, !tbaa !9
  %174 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %173, ptr noundef @.str.19) #7
  %175 = load ptr, ptr %17, align 8, !tbaa !9
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef @.str.20) #7
  %177 = load ptr, ptr %17, align 8, !tbaa !9
  %178 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %177, ptr noundef @.str.21) #7
  %179 = load ptr, ptr %17, align 8, !tbaa !9
  %180 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %179, ptr noundef @.str.22) #7
  %181 = load ptr, ptr %17, align 8, !tbaa !9
  %182 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.23) #7
  %183 = load ptr, ptr %17, align 8, !tbaa !9
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %183, ptr noundef @.str.24) #7
  %185 = load ptr, ptr %17, align 8, !tbaa !9
  %186 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str.25) #7
  %187 = load ptr, ptr %17, align 8, !tbaa !9
  %188 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %187, ptr noundef @.str.26) #7
  %189 = load ptr, ptr %17, align 8, !tbaa !9
  %190 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %189, ptr noundef @.str.22) #7
  %191 = load ptr, ptr %17, align 8, !tbaa !9
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef @.str.23) #7
  %193 = load ptr, ptr %17, align 8, !tbaa !9
  %194 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %193, ptr noundef @.str.27) #7
  %195 = load ptr, ptr %17, align 8, !tbaa !9
  %196 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %195, ptr noundef @.str.28) #7
  %197 = load ptr, ptr %17, align 8, !tbaa !9
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %197, ptr noundef @.str.29) #7
  %199 = load ptr, ptr %17, align 8, !tbaa !9
  %200 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %199, ptr noundef @.str.22) #7
  %201 = load ptr, ptr %17, align 8, !tbaa !9
  %202 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %201, ptr noundef @.str.23) #7
  %203 = load ptr, ptr %17, align 8, !tbaa !9
  %204 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %203, ptr noundef @.str.30) #7
  %205 = load ptr, ptr %17, align 8, !tbaa !9
  %206 = call i32 @fclose(ptr noundef %205)
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str.31, ptr noundef @.str.8)
  %208 = call i32 (ptr, ...) @printf(ptr noundef @.str.32)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  %209 = load ptr, ptr %13, align 8
  call void @llvm.stackrestore.p0(ptr %209)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %210

210:                                              ; preds = %168, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %211 = load i32, ptr %3, align 4
  ret i32 %211
}

; 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare ptr @agc_rrrf_create() #1

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

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

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

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

declare float @agc_rrrf_get_rssi(ptr noundef) #1

declare i32 @agc_rrrf_destroy(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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

; 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 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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}
!17 = distinct !{!17, !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.4 = 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.5 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.32 = 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 = %6, %2
  %.067.ph = phi i32 [ %8, %6 ], [ 2000, %2 ]
  %.066.ph = phi float [ %.066, %6 ], [ 0x3F847AE140000000, %2 ]
  br label %3

3:                                                ; preds = %.outer, %9
  %.066 = phi float [ %12, %9 ], [ %.066.ph, %.outer ]
  %4 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.4) #8
  switch i32 %4, label %13 [
    i32 -1, label %14
    i32 104, label %5
    i32 110, label %6
    i32 98, label %9
  ]

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

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

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

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

14:                                               ; preds = %3
  %15 = fcmp olt float %.066, 0.000000e+00
  br i1 %15, label %16, label %20

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

20:                                               ; preds = %14
  %21 = icmp eq i32 %.067.ph, 0
  br i1 %21, label %22, label %26

22:                                               ; preds = %20
  %23 = load ptr, ptr @stderr, align 8, !tbaa !5
  %24 = load ptr, ptr %1, align 8, !tbaa !5
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %23, ptr noundef nonnull @.str.6, ptr noundef %24) #11
  tail call void @exit(i32 noundef 1) #10
  unreachable

26:                                               ; preds = %20
  %27 = tail call ptr @agc_rrrf_create() #8
  %28 = tail call i32 @agc_rrrf_set_bandwidth(ptr noundef %27, float noundef %.066) #8
  %29 = zext i32 %.067.ph to i64
  %30 = tail call ptr @llvm.stacksave.p0()
  %31 = alloca float, i64 %29, align 16
  %32 = alloca float, i64 %29, align 16
  %33 = alloca float, i64 %29, align 16
  %34 = fpext float %.066 to double
  %35 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, double noundef %34)
  %xtraiter = and i64 %29, 1
  %36 = icmp eq i32 %.067.ph, 1
  br i1 %36, label %.preheader.preheader.unr-lcssa, label %.new

.new:                                             ; preds = %26
  %unroll_iter = and i64 %29, 4294967294
  br label %37

37:                                               ; preds = %37, %.new
  %indvars.iv = phi i64 [ 0, %.new ], [ %indvars.iv.next.1, %37 ]
  %niter = phi i64 [ 0, %.new ], [ %niter.next.1, %37 ]
  %38 = trunc nuw i64 %indvars.iv to i32
  %39 = uitofp i32 %38 to double
  %40 = fmul double %39, 0x3FE2B2E1EE11C60E
  %41 = fptrunc double %40 to float
  %42 = tail call float @cosf(float noundef %41) #8
  %43 = fmul float %42, 0x3F50624DE0000000
  %44 = getelementptr inbounds float, ptr %31, i64 %indvars.iv
  store float %43, ptr %44, align 8, !tbaa !11
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %45 = trunc nuw i64 %indvars.iv.next to i32
  %46 = uitofp i32 %45 to double
  %47 = fmul double %46, 0x3FE2B2E1EE11C60E
  %48 = fptrunc double %47 to float
  %49 = tail call float @cosf(float noundef %48) #8
  %50 = fmul float %49, 0x3F50624DE0000000
  %51 = getelementptr inbounds float, ptr %31, i64 %indvars.iv.next
  store float %50, ptr %51, align 4, !tbaa !11
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.preheader.preheader.unr-lcssa, label %37, !llvm.loop !13

.preheader.preheader.unr-lcssa:                   ; preds = %37, %26
  %indvars.iv.unr = phi i64 [ 0, %26 ], [ %indvars.iv.next.1, %37 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader.preheader, label %.preheader.preheader.epilog-lcssa

.preheader.preheader.epilog-lcssa:                ; preds = %.preheader.preheader.unr-lcssa
  %52 = trunc nuw i64 %indvars.iv.unr to i32
  %53 = uitofp i32 %52 to double
  %54 = fmul double %53, 0x3FE2B2E1EE11C60E
  %55 = fptrunc double %54 to float
  %56 = tail call float @cosf(float noundef %55) #8
  %57 = fmul float %56, 0x3F50624DE0000000
  %58 = getelementptr inbounds float, ptr %31, i64 %indvars.iv.unr
  store float %57, ptr %58, align 4, !tbaa !11
  br label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader.preheader.unr-lcssa, %.preheader.preheader.epilog-lcssa
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %.preheader
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %.preheader ], [ 0, %.preheader.preheader ]
  %59 = getelementptr inbounds float, ptr %31, i64 %indvars.iv85
  %60 = load float, ptr %59, align 4, !tbaa !11
  %61 = getelementptr inbounds float, ptr %32, i64 %indvars.iv85
  %62 = call i32 @agc_rrrf_execute(ptr noundef %27, float noundef %60, ptr noundef nonnull %61) #8
  %63 = call float @agc_rrrf_get_rssi(ptr noundef %27) #8
  %64 = getelementptr inbounds float, ptr %33, i64 %indvars.iv85
  store float %63, ptr %64, align 4, !tbaa !11
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %exitcond89.not = icmp eq i64 %indvars.iv.next86, %29
  br i1 %exitcond89.not, label %65, label %.preheader, !llvm.loop !14

65:                                               ; preds = %.preheader
  %66 = call i32 @agc_rrrf_destroy(ptr noundef %27) #8
  %67 = call noalias ptr @fopen(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9)
  %.not72 = icmp eq ptr %67, null
  br i1 %.not72, label %68, label %72

68:                                               ; preds = %65
  %69 = load ptr, ptr @stderr, align 8, !tbaa !5
  %70 = load ptr, ptr %1, align 8, !tbaa !5
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef nonnull @.str.10, ptr noundef %70, ptr noundef nonnull @.str.8) #11
  call void @exit(i32 noundef 1) #10
  unreachable

72:                                               ; preds = %65
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %67, ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.8) #8
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %67, ptr noundef nonnull @.str.12) #8
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %67, ptr noundef nonnull @.str.13, i32 noundef %.067.ph) #8
  br label %76

76:                                               ; preds = %72, %76
  %indvars.iv90 = phi i64 [ 0, %72 ], [ %indvars.iv.next91, %76 ]
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %77 = getelementptr inbounds float, ptr %31, i64 %indvars.iv90
  %78 = load float, ptr %77, align 4, !tbaa !11
  %79 = fpext float %78 to double
  %80 = trunc nuw i64 %indvars.iv.next91 to i32
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.14, i32 noundef %80, double noundef %79) #8
  %82 = getelementptr inbounds float, ptr %32, i64 %indvars.iv90
  %83 = load float, ptr %82, align 4, !tbaa !11
  %84 = fpext float %83 to double
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.15, i32 noundef %80, double noundef %84) #8
  %86 = getelementptr inbounds float, ptr %33, i64 %indvars.iv90
  %87 = load float, ptr %86, align 4, !tbaa !11
  %88 = fpext float %87 to double
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.16, i32 noundef %80, double noundef %88) #8
  %exitcond94.not = icmp eq i64 %indvars.iv.next91, %29
  br i1 %exitcond94.not, label %90, label %76, !llvm.loop !15

90:                                               ; preds = %76
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.17) #8
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.18) #8
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.19) #8
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.20) #8
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.21) #8
  %96 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.22) #8
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.23) #8
  %98 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.24) #8
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.25) #8
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.26) #8
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.22) #8
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.23) #8
  %103 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.27) #8
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.28) #8
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.29) #8
  %106 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.22) #8
  %107 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.23) #8
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.30) #8
  %109 = call i32 @fclose(ptr noundef %67)
  %110 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31, ptr noundef nonnull @.str.8)
  %111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.32)
  call void @llvm.stackrestore.p0(ptr %30)
  br label %112

112:                                              ; preds = %90, %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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare ptr @agc_rrrf_create() local_unnamed_addr #5

declare i32 @agc_rrrf_set_bandwidth(ptr noundef, float noundef) local_unnamed_addr #5

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

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

declare i32 @agc_rrrf_execute(ptr noundef, float noundef, ptr noundef) local_unnamed_addr #5

declare float @agc_rrrf_get_rssi(ptr noundef) local_unnamed_addr #5

declare i32 @agc_rrrf_destroy(ptr noundef) local_unnamed_addr #5

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


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