; LLVM IR from jgaeddert/liquid-dsp :: examples (modem_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 [6 x i8], align 1
@optarg = external global ptr, align 8
@stderr = external global ptr, align 8
@.str.5 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [24 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca { float, float }, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca { float, float }, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 27, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 1, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  br label %21

21:                                               ; preds = %45, %2
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = load ptr, ptr %5, align 8, !tbaa !9
  %24 = call i32 @getopt(i32 noundef %22, ptr noundef %23, ptr noundef @.str.4) #6
  store i32 %24, ptr %8, align 4, !tbaa !5
  %25 = icmp ne i32 %24, -1
  br i1 %25, label %26, label %46

26:                                               ; preds = %21
  %27 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %27, label %44 [
    i32 104, label %28
    i32 118, label %29
    i32 113, label %30
    i32 109, label %31
  ]

28:                                               ; preds = %26
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %180

29:                                               ; preds = %26
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %45

30:                                               ; preds = %26
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %45

31:                                               ; preds = %26
  %32 = load ptr, ptr @optarg, align 8, !tbaa !9
  %33 = call i32 @liquid_getopt_str2mod(ptr noundef %32)
  store i32 %33, ptr %6, align 4, !tbaa !5
  %34 = load i32, ptr %6, align 4, !tbaa !5
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %43

36:                                               ; preds = %31
  %37 = load ptr, ptr @stderr, align 8, !tbaa !9
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = getelementptr inbounds ptr, ptr %38, i64 0
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  %41 = load ptr, ptr @optarg, align 8, !tbaa !9
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.5, ptr noundef %40, ptr noundef %41) #6
  store i32 1, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %180

43:                                               ; preds = %31
  br label %45

44:                                               ; preds = %26
  call void @exit(i32 noundef 1) #7
  unreachable

45:                                               ; preds = %43, %30, %29
  br label %21, !llvm.loop !11

46:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = call ptr @modemcf_create(i32 noundef %47)
  store ptr %48, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = call ptr @modemcf_create(i32 noundef %49)
  store ptr %50, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %51 = load ptr, ptr %10, align 8, !tbaa !9
  %52 = call i32 @modemcf_get_bps(ptr noundef %51)
  store i32 %52, ptr %12, align 4, !tbaa !5
  %53 = load ptr, ptr %10, align 8, !tbaa !9
  %54 = call i32 @modemcf_print(ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %55 = call noalias ptr @fopen(ptr noundef @.str.6, ptr noundef @.str.7)
  store ptr %55, ptr %13, align 8, !tbaa !9
  %56 = load ptr, ptr %13, align 8, !tbaa !9
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %56, ptr noundef @.str.8, ptr noundef @.str.6) #6
  %58 = load ptr, ptr %13, align 8, !tbaa !9
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.9) #6
  %60 = load ptr, ptr %13, align 8, !tbaa !9
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.10) #6
  %62 = load ptr, ptr %13, align 8, !tbaa !9
  %63 = load i32, ptr %12, align 4, !tbaa !5
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %62, ptr noundef @.str.11, i32 noundef %63) #6
  %65 = load ptr, ptr %13, align 8, !tbaa !9
  %66 = load i32, ptr %12, align 4, !tbaa !5
  %67 = shl i32 1, %66
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.12, i32 noundef %67) #6
  %69 = load ptr, ptr %13, align 8, !tbaa !9
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %69, ptr noundef @.str.13) #6
  %71 = load ptr, ptr %13, align 8, !tbaa !9
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str.14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %73 = load i32, ptr %12, align 4, !tbaa !5
  %74 = shl i32 1, %73
  store i32 %74, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 0, ptr %19, align 4, !tbaa !5
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %75

75:                                               ; preds = %139, %46
  %76 = load i32, ptr %14, align 4, !tbaa !5
  %77 = load i32, ptr %16, align 4, !tbaa !5
  %78 = icmp ult i32 %76, %77
  br i1 %78, label %79, label %142

79:                                               ; preds = %75
  %80 = load ptr, ptr %10, align 8, !tbaa !9
  %81 = load i32, ptr %14, align 4, !tbaa !5
  %82 = call i32 @modemcf_modulate(ptr noundef %80, i32 noundef %81, ptr noundef %17)
  %83 = load ptr, ptr %11, align 8, !tbaa !9
  %84 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 0
  %85 = load float, ptr %84, align 4
  %86 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 1
  %87 = load float, ptr %86, align 4
  %88 = getelementptr inbounds { float, float }, ptr %20, i32 0, i32 0
  %89 = getelementptr inbounds { float, float }, ptr %20, i32 0, i32 1
  store float %85, ptr %88, align 4
  store float %87, ptr %89, align 4
  %90 = load <2 x float>, ptr %20, align 4
  %91 = call i32 @modemcf_demodulate(ptr noundef %83, <2 x float> noundef %90, ptr noundef %15)
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %107

94:                                               ; preds = %79
  %95 = load i32, ptr %14, align 4, !tbaa !5
  %96 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 0
  %97 = load float, ptr %96, align 4
  %98 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 1
  %99 = load float, ptr %98, align 4
  %100 = fpext float %97 to double
  %101 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 0
  %102 = load float, ptr %101, align 4
  %103 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 1
  %104 = load float, ptr %103, align 4
  %105 = fpext float %104 to double
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, i32 noundef %95, double noundef %100, double noundef %105)
  br label %107

107:                                              ; preds = %94, %79
  %108 = load i32, ptr %14, align 4, !tbaa !5
  %109 = load i32, ptr %15, align 4, !tbaa !5
  %110 = icmp eq i32 %108, %109
  %111 = zext i1 %110 to i64
  %112 = select i1 %110, i32 0, i32 1
  %113 = load i32, ptr %18, align 4, !tbaa !5
  %114 = add i32 %113, %112
  store i32 %114, ptr %18, align 4, !tbaa !5
  %115 = load i32, ptr %14, align 4, !tbaa !5
  %116 = load i32, ptr %15, align 4, !tbaa !5
  %117 = call i32 @count_bit_errors(i32 noundef %115, i32 noundef %116)
  %118 = load i32, ptr %19, align 4, !tbaa !5
  %119 = add i32 %118, %117
  store i32 %119, ptr %19, align 4, !tbaa !5
  %120 = load ptr, ptr %13, align 8, !tbaa !9
  %121 = load i32, ptr %14, align 4, !tbaa !5
  %122 = add i32 %121, 1
  %123 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 0
  %124 = load float, ptr %123, align 4
  %125 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 1
  %126 = load float, ptr %125, align 4
  %127 = fpext float %124 to double
  %128 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 0
  %129 = load float, ptr %128, align 4
  %130 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 1
  %131 = load float, ptr %130, align 4
  %132 = fpext float %131 to double
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.16, i32 noundef %122, double noundef %127, double noundef %132) #6
  %134 = load ptr, ptr %13, align 8, !tbaa !9
  %135 = load i32, ptr %14, align 4, !tbaa !5
  %136 = add i32 %135, 1
  %137 = load i32, ptr %14, align 4, !tbaa !5
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.17, i32 noundef %136, i32 noundef %137) #6
  br label %139

139:                                              ; preds = %107
  %140 = load i32, ptr %14, align 4, !tbaa !5
  %141 = add i32 %140, 1
  store i32 %141, ptr %14, align 4, !tbaa !5
  br label %75, !llvm.loop !13

142:                                              ; preds = %75
  %143 = load i32, ptr %18, align 4, !tbaa !5
  %144 = load i32, ptr %16, align 4, !tbaa !5
  %145 = call i32 (ptr, ...) @printf(ptr noundef @.str.18, i32 noundef %143, i32 noundef %144)
  %146 = load i32, ptr %19, align 4, !tbaa !5
  %147 = load i32, ptr %16, align 4, !tbaa !5
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = mul i32 %147, %148
  %150 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, i32 noundef %146, i32 noundef %149)
  %151 = load ptr, ptr %13, align 8, !tbaa !9
  %152 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %151, ptr noundef @.str.20) #6
  %153 = load ptr, ptr %13, align 8, !tbaa !9
  %154 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %153, ptr noundef @.str.21) #6
  %155 = load ptr, ptr %13, align 8, !tbaa !9
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %155, ptr noundef @.str.22) #6
  %157 = load ptr, ptr %13, align 8, !tbaa !9
  %158 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %157, ptr noundef @.str.23) #6
  %159 = load ptr, ptr %13, align 8, !tbaa !9
  %160 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %159, ptr noundef @.str.24) #6
  %161 = load ptr, ptr %13, align 8, !tbaa !9
  %162 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %161, ptr noundef @.str.25) #6
  %163 = load ptr, ptr %13, align 8, !tbaa !9
  %164 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %163, ptr noundef @.str.26) #6
  %165 = load ptr, ptr %13, align 8, !tbaa !9
  %166 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %165, ptr noundef @.str.27) #6
  %167 = load ptr, ptr %13, align 8, !tbaa !9
  %168 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %167, ptr noundef @.str.28) #6
  %169 = load ptr, ptr %13, align 8, !tbaa !9
  %170 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %169, ptr noundef @.str.29) #6
  %171 = load ptr, ptr %13, align 8, !tbaa !9
  %172 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %171, ptr noundef @.str.30) #6
  %173 = load ptr, ptr %13, align 8, !tbaa !9
  %174 = call i32 @fclose(ptr noundef %173)
  %175 = call i32 (ptr, ...) @printf(ptr noundef @.str.31, ptr noundef @.str.6)
  %176 = load ptr, ptr %10, align 8, !tbaa !9
  %177 = call i32 @modemcf_destroy(ptr noundef %176)
  %178 = load ptr, ptr %11, align 8, !tbaa !9
  %179 = call i32 @modemcf_destroy(ptr noundef %178)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %180

180:                                              ; preds = %142, %36, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %181 = load i32, ptr %3, align 4
  ret i32 %181
}

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

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

declare i32 @liquid_getopt_str2mod(ptr noundef) #1

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

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

declare ptr @modemcf_create(i32 noundef) #1

declare i32 @modemcf_get_bps(ptr noundef) #1

declare i32 @modemcf_print(ptr noundef) #1

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

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

declare i32 @modemcf_demodulate(ptr noundef, <2 x float> noundef, ptr noundef) #1

declare i32 @count_bit_errors(i32 noundef, i32 noundef) #1

declare i32 @fclose(ptr noundef) #1

declare i32 @modemcf_destroy(ptr noundef) #1

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

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


; 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 [6 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 [55 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [24 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 range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = alloca i32, align 4
  %4 = alloca { float, float }, align 8
  br label %.outer

.outer:                                           ; preds = %.outer.backedge, %2
  %.060.ph = phi i32 [ 1, %2 ], [ %.060.ph.be, %.outer.backedge ]
  %.059.ph = phi i32 [ 27, %2 ], [ %.059, %.outer.backedge ]
  br label %5

5:                                                ; preds = %.outer, %9
  %.059 = phi i32 [ %11, %9 ], [ %.059.ph, %.outer ]
  %6 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.4) #7
  switch i32 %6, label %18 [
    i32 -1, label %19
    i32 104, label %7
    i32 118, label %.outer.backedge
    i32 113, label %8
    i32 109, label %9
  ], !llvm.loop !5

7:                                                ; preds = %5
  tail call void @usage()
  br label %89

8:                                                ; preds = %5
  br label %.outer.backedge

.outer.backedge:                                  ; preds = %5, %8
  %.060.ph.be = phi i32 [ 0, %8 ], [ 1, %5 ]
  br label %.outer, !llvm.loop !5

9:                                                ; preds = %5
  %10 = load ptr, ptr @optarg, align 8, !tbaa !7
  %11 = tail call i32 @liquid_getopt_str2mod(ptr noundef %10) #7
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %5, !llvm.loop !5

13:                                               ; preds = %9
  %14 = load ptr, ptr @stderr, align 8, !tbaa !7
  %15 = load ptr, ptr %1, align 8, !tbaa !7
  %16 = load ptr, ptr @optarg, align 8, !tbaa !7
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %14, ptr noundef nonnull @.str.5, ptr noundef %15, ptr noundef %16) #8
  br label %89

18:                                               ; preds = %5
  tail call void @exit(i32 noundef 1) #9
  unreachable

19:                                               ; preds = %5
  %20 = tail call ptr @modemcf_create(i32 noundef %.059) #7
  %21 = tail call ptr @modemcf_create(i32 noundef %.059) #7
  %22 = tail call i32 @modemcf_get_bps(ptr noundef %20) #7
  %23 = tail call i32 @modemcf_print(ptr noundef %20) #7
  %24 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7)
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.6) #7
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.9) #7
  %27 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.10) #7
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.11, i32 noundef %22) #7
  %29 = shl nuw i32 1, %22
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.12, i32 noundef %29) #7
  %31 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.13) #7
  %32 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %33 = getelementptr inbounds i8, ptr %4, i64 4
  %.not65 = icmp eq i32 %.060.ph, 0
  br i1 %.not65, label %.split.us, label %.split

.split.us:                                        ; preds = %19, %.split.us
  %.074.us = phi i32 [ %42, %.split.us ], [ 0, %19 ]
  %.05673.us = phi i32 [ %40, %.split.us ], [ 0, %19 ]
  %.05872.us = phi i32 [ %43, %.split.us ], [ 0, %19 ]
  %34 = call i32 @modemcf_modulate(ptr noundef %20, i32 noundef %.05872.us, ptr noundef nonnull %4) #7
  %35 = load <2 x float>, ptr %4, align 8
  %36 = call i32 @modemcf_demodulate(ptr noundef %21, <2 x float> noundef %35, ptr noundef nonnull %3) #7
  %37 = load i32, ptr %3, align 4, !tbaa !11
  %38 = icmp ne i32 %.05872.us, %37
  %39 = zext i1 %38 to i32
  %40 = add i32 %.05673.us, %39
  %41 = call i32 @count_bit_errors(i32 noundef %.05872.us, i32 noundef %37) #7
  %42 = add i32 %41, %.074.us
  %43 = add nuw i32 %.05872.us, 1
  %44 = load float, ptr %4, align 8
  %45 = fpext float %44 to double
  %46 = load float, ptr %33, align 4
  %47 = fpext float %46 to double
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.16, i32 noundef %43, double noundef %45, double noundef %47) #7
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.17, i32 noundef %43, i32 noundef %.05872.us) #7
  %exitcond89.not = icmp eq i32 %43, %29
  br i1 %exitcond89.not, label %.split76.us, label %.split.us, !llvm.loop !13

.split:                                           ; preds = %19, %.split
  %.074 = phi i32 [ %63, %.split ], [ 0, %19 ]
  %.05673 = phi i32 [ %61, %.split ], [ 0, %19 ]
  %.05872 = phi i32 [ %64, %.split ], [ 0, %19 ]
  %50 = call i32 @modemcf_modulate(ptr noundef %20, i32 noundef %.05872, ptr noundef nonnull %4) #7
  %51 = load <2 x float>, ptr %4, align 8
  %52 = call i32 @modemcf_demodulate(ptr noundef %21, <2 x float> noundef %51, ptr noundef nonnull %3) #7
  %53 = load float, ptr %4, align 8
  %54 = fpext float %53 to double
  %55 = load float, ptr %33, align 4
  %56 = fpext float %55 to double
  %57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, i32 noundef %.05872, double noundef %54, double noundef %56)
  %58 = load i32, ptr %3, align 4, !tbaa !11
  %59 = icmp ne i32 %.05872, %58
  %60 = zext i1 %59 to i32
  %61 = add i32 %.05673, %60
  %62 = call i32 @count_bit_errors(i32 noundef %.05872, i32 noundef %58) #7
  %63 = add i32 %62, %.074
  %64 = add nuw i32 %.05872, 1
  %65 = load float, ptr %4, align 8
  %66 = fpext float %65 to double
  %67 = load float, ptr %33, align 4
  %68 = fpext float %67 to double
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.16, i32 noundef %64, double noundef %66, double noundef %68) #7
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.17, i32 noundef %64, i32 noundef %.05872) #7
  %exitcond.not = icmp eq i32 %64, %29
  br i1 %exitcond.not, label %.split76.us, label %.split, !llvm.loop !13

.split76.us:                                      ; preds = %.split, %.split.us
  %.us-phi = phi i32 [ %40, %.split.us ], [ %61, %.split ]
  %.us-phi77 = phi i32 [ %42, %.split.us ], [ %63, %.split ]
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18, i32 noundef %.us-phi, i32 noundef %29)
  %72 = shl i32 %22, %22
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %.us-phi77, i32 noundef %72)
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.20) #7
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.21) #7
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.22) #7
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.23) #7
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.24) #7
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.25) #7
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.26) #7
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.27) #7
  %82 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.28) #7
  %83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.29) #7
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str.30) #7
  %85 = call i32 @fclose(ptr noundef %24)
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.31, ptr noundef nonnull @.str.6)
  %87 = call i32 @modemcf_destroy(ptr noundef %20) #7
  %88 = call i32 @modemcf_destroy(ptr noundef %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %89

89:                                               ; preds = %.split76.us, %13, %7
  %.057 = phi i32 [ 1, %13 ], [ 0, %7 ], [ 0, %.split76.us ]
  ret i32 %.057
}

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

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

declare i32 @liquid_getopt_str2mod(ptr noundef) local_unnamed_addr #5

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

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

declare ptr @modemcf_create(i32 noundef) local_unnamed_addr #5

declare i32 @modemcf_get_bps(ptr noundef) local_unnamed_addr #5

declare i32 @modemcf_print(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

declare i32 @modemcf_modulate(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #5

declare i32 @modemcf_demodulate(ptr noundef, <2 x float> noundef, ptr noundef) local_unnamed_addr #5

declare i32 @count_bit_errors(i32 noundef, i32 noundef) local_unnamed_addr #5

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

declare i32 @modemcf_destroy(ptr noundef) local_unnamed_addr #5

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass