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

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

33:                                               ; preds = %28
  %34 = load i32, ptr %8, align 4, !tbaa !5
  switch i32 %34, label %39 [
    i32 117, label %35
    i32 104, label %35
    i32 112, label %36
  ]

35:                                               ; preds = %33, %33
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  br label %249

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

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

40:                                               ; preds = %36
  br label %28, !llvm.loop !11

41:                                               ; preds = %28
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 0
  br i1 %43, label %44, label %50

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

50:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = shl i32 1, %51
  store i32 %52, ptr %11, align 4, !tbaa !5
  %53 = load i32, ptr %11, align 4, !tbaa !5
  %54 = zext i32 %53 to i64
  %55 = call ptr @llvm.stacksave.p0()
  store ptr %55, ptr %12, align 8
  %56 = alloca { float, float }, i64 %54, align 16
  store i64 %54, ptr %13, align 8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %94, %50
  %58 = load i32, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr %11, align 4, !tbaa !5
  %60 = icmp ult i32 %58, %59
  br i1 %60, label %61, label %97

61:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %62 = load i32, ptr %10, align 4, !tbaa !5
  %63 = uitofp i32 %62 to float
  %64 = load i32, ptr %11, align 4, !tbaa !5
  %65 = uitofp i32 %64 to float
  %66 = call float @logf(float noundef %65) #8
  %67 = fdiv float %63, %66
  %68 = fadd float %67, 4.000000e+00
  store float %68, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %69 = load i32, ptr %10, align 4, !tbaa !5
  %70 = uitofp i32 %69 to float
  %71 = load i32, ptr %11, align 4, !tbaa !5
  %72 = uitofp i32 %71 to float
  %73 = call float @logf(float noundef %72) #8
  %74 = fdiv float %70, %73
  store float %74, ptr %15, align 4, !tbaa !13
  %75 = load float, ptr %14, align 4, !tbaa !13
  %76 = load float, ptr %15, align 4, !tbaa !13
  %77 = fmul float 0.000000e+00, %76
  %78 = fmul float 1.000000e+00, %76
  %79 = getelementptr inbounds { float, float }, ptr %16, i32 0, i32 0
  %80 = getelementptr inbounds { float, float }, ptr %16, i32 0, i32 1
  store float %77, ptr %79, align 4
  store float %78, ptr %80, align 4
  %81 = load <2 x float>, ptr %16, align 4
  %82 = call <2 x float> @cexpf(<2 x float> noundef %81) #8
  store <2 x float> %82, ptr %17, align 4
  %83 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 0
  %84 = load float, ptr %83, align 4
  %85 = getelementptr inbounds { float, float }, ptr %17, i32 0, i32 1
  %86 = load float, ptr %85, align 4
  %87 = fmul float %75, %84
  %88 = fmul float %75, %86
  %89 = load i32, ptr %10, align 4, !tbaa !5
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds { float, float }, ptr %56, i64 %90
  %92 = getelementptr inbounds { float, float }, ptr %91, i32 0, i32 0
  %93 = getelementptr inbounds { float, float }, ptr %91, i32 0, i32 1
  store float %87, ptr %92, align 8
  store float %88, ptr %93, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %94

94:                                               ; preds = %61
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = add i32 %95, 1
  store i32 %96, ptr %10, align 4, !tbaa !5
  br label %57, !llvm.loop !15

97:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %98 = load i32, ptr %11, align 4, !tbaa !5
  %99 = call ptr @modemcf_create_arbitrary(ptr noundef %56, i32 noundef %98)
  store ptr %99, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %100 = load i32, ptr %11, align 4, !tbaa !5
  %101 = call ptr @modemcf_create_arbitrary(ptr noundef %56, i32 noundef %100)
  store ptr %101, ptr %19, align 8, !tbaa !9
  %102 = load ptr, ptr %18, align 8, !tbaa !9
  %103 = call i32 @modemcf_print(ptr noundef %102)
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = zext i32 %104 to i64
  %106 = alloca { float, float }, i64 %105, align 16
  store i64 %105, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #8
  store i32 0, ptr %21, align 4, !tbaa !5
  store i32 0, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %107

107:                                              ; preds = %173, %97
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = load i32, ptr %7, align 4, !tbaa !5
  %110 = icmp ult i32 %108, %109
  br i1 %110, label %111, label %176

111:                                              ; preds = %107
  %112 = load ptr, ptr %18, align 8, !tbaa !9
  %113 = call i32 @modemcf_gen_rand_sym(ptr noundef %112)
  store i32 %113, ptr %22, align 4, !tbaa !5
  %114 = load ptr, ptr %18, align 8, !tbaa !9
  %115 = load i32, ptr %22, align 4, !tbaa !5
  %116 = load i32, ptr %10, align 4, !tbaa !5
  %117 = zext i32 %116 to i64
  %118 = getelementptr inbounds { float, float }, ptr %106, i64 %117
  %119 = call i32 @modemcf_modulate(ptr noundef %114, i32 noundef %115, ptr noundef %118)
  %120 = call float (...) @randnf()
  %121 = fpext float %120 to double
  %122 = fmul double 5.000000e-02, %121
  %123 = call float (...) @randf()
  %124 = fpext float %123 to double
  %125 = fmul double 0.000000e+00, %124
  %126 = fmul double 0x400921FB54442D18, %124
  %127 = fptrunc double %125 to float
  %128 = fptrunc double %126 to float
  %129 = getelementptr inbounds { float, float }, ptr %24, i32 0, i32 0
  %130 = getelementptr inbounds { float, float }, ptr %24, i32 0, i32 1
  store float %127, ptr %129, align 4
  store float %128, ptr %130, align 4
  %131 = load <2 x float>, ptr %24, align 4
  %132 = call <2 x float> @cexpf(<2 x float> noundef %131) #8
  store <2 x float> %132, ptr %25, align 4
  %133 = getelementptr inbounds { float, float }, ptr %25, i32 0, i32 0
  %134 = load float, ptr %133, align 4
  %135 = getelementptr inbounds { float, float }, ptr %25, i32 0, i32 1
  %136 = load float, ptr %135, align 4
  %137 = fpext float %134 to double
  %138 = fpext float %136 to double
  %139 = fmul double %122, %137
  %140 = fmul double %122, %138
  %141 = load i32, ptr %10, align 4, !tbaa !5
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds { float, float }, ptr %106, i64 %142
  %144 = getelementptr inbounds { float, float }, ptr %143, i32 0, i32 0
  %145 = load float, ptr %144, align 8
  %146 = getelementptr inbounds { float, float }, ptr %143, i32 0, i32 1
  %147 = load float, ptr %146, align 4
  %148 = fpext float %145 to double
  %149 = fpext float %147 to double
  %150 = fadd double %148, %139
  %151 = fadd double %149, %140
  %152 = fptrunc double %150 to float
  %153 = fptrunc double %151 to float
  %154 = getelementptr inbounds { float, float }, ptr %143, i32 0, i32 0
  %155 = getelementptr inbounds { float, float }, ptr %143, i32 0, i32 1
  store float %152, ptr %154, align 8
  store float %153, ptr %155, align 4
  %156 = load ptr, ptr %19, align 8, !tbaa !9
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds { float, float }, ptr %106, i64 %158
  %160 = getelementptr inbounds { float, float }, ptr %159, i32 0, i32 0
  %161 = load float, ptr %160, align 8
  %162 = getelementptr inbounds { float, float }, ptr %159, i32 0, i32 1
  %163 = load float, ptr %162, align 4
  %164 = getelementptr inbounds { float, float }, ptr %26, i32 0, i32 0
  %165 = getelementptr inbounds { float, float }, ptr %26, i32 0, i32 1
  store float %161, ptr %164, align 4
  store float %163, ptr %165, align 4
  %166 = load <2 x float>, ptr %26, align 4
  %167 = call i32 @modemcf_demodulate(ptr noundef %156, <2 x float> noundef %166, ptr noundef %23)
  %168 = load i32, ptr %22, align 4, !tbaa !5
  %169 = load i32, ptr %23, align 4, !tbaa !5
  %170 = call i32 @count_bit_errors(i32 noundef %168, i32 noundef %169)
  %171 = load i32, ptr %21, align 4, !tbaa !5
  %172 = add i32 %171, %170
  store i32 %172, ptr %21, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %111
  %174 = load i32, ptr %10, align 4, !tbaa !5
  %175 = add i32 %174, 1
  store i32 %175, ptr %10, align 4, !tbaa !5
  br label %107, !llvm.loop !16

176:                                              ; preds = %107
  %177 = load i32, ptr %21, align 4, !tbaa !5
  %178 = load i32, ptr %6, align 4, !tbaa !5
  %179 = load i32, ptr %7, align 4, !tbaa !5
  %180 = mul i32 %178, %179
  %181 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %177, i32 noundef %180)
  %182 = load ptr, ptr %18, align 8, !tbaa !9
  %183 = call i32 @modemcf_destroy(ptr noundef %182)
  %184 = load ptr, ptr %19, align 8, !tbaa !9
  %185 = call i32 @modemcf_destroy(ptr noundef %184)
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #8
  %186 = call noalias ptr @fopen(ptr noundef @.str.6, ptr noundef @.str.7)
  store ptr %186, ptr %27, align 8, !tbaa !9
  %187 = load ptr, ptr %27, align 8, !tbaa !9
  %188 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %187, ptr noundef @.str.8, ptr noundef @.str.6) #8
  %189 = load ptr, ptr %27, align 8, !tbaa !9
  %190 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %189, ptr noundef @.str.9) #8
  %191 = load ptr, ptr %27, align 8, !tbaa !9
  %192 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %191, ptr noundef @.str.10) #8
  %193 = load ptr, ptr %27, align 8, !tbaa !9
  %194 = load i32, ptr %6, align 4, !tbaa !5
  %195 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %193, ptr noundef @.str.11, i32 noundef %194) #8
  %196 = load ptr, ptr %27, align 8, !tbaa !9
  %197 = load i32, ptr %11, align 4, !tbaa !5
  %198 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %196, ptr noundef @.str.12, i32 noundef %197) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %199

199:                                              ; preds = %224, %176
  %200 = load i32, ptr %10, align 4, !tbaa !5
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = icmp ult i32 %200, %201
  br i1 %202, label %203, label %227

203:                                              ; preds = %199
  %204 = load ptr, ptr %27, align 8, !tbaa !9
  %205 = load i32, ptr %10, align 4, !tbaa !5
  %206 = add i32 %205, 1
  %207 = load i32, ptr %10, align 4, !tbaa !5
  %208 = zext i32 %207 to i64
  %209 = getelementptr inbounds { float, float }, ptr %106, i64 %208
  %210 = getelementptr inbounds { float, float }, ptr %209, i32 0, i32 0
  %211 = load float, ptr %210, align 8
  %212 = getelementptr inbounds { float, float }, ptr %209, i32 0, i32 1
  %213 = load float, ptr %212, align 4
  %214 = fpext float %211 to double
  %215 = load i32, ptr %10, align 4, !tbaa !5
  %216 = zext i32 %215 to i64
  %217 = getelementptr inbounds { float, float }, ptr %106, i64 %216
  %218 = getelementptr inbounds { float, float }, ptr %217, i32 0, i32 0
  %219 = load float, ptr %218, align 8
  %220 = getelementptr inbounds { float, float }, ptr %217, i32 0, i32 1
  %221 = load float, ptr %220, align 4
  %222 = fpext float %221 to double
  %223 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef @.str.13, i32 noundef %206, double noundef %214, double noundef %222) #8
  br label %224

224:                                              ; preds = %203
  %225 = load i32, ptr %10, align 4, !tbaa !5
  %226 = add i32 %225, 1
  store i32 %226, ptr %10, align 4, !tbaa !5
  br label %199, !llvm.loop !17

227:                                              ; preds = %199
  %228 = load ptr, ptr %27, align 8, !tbaa !9
  %229 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %228, ptr noundef @.str.14) #8
  %230 = load ptr, ptr %27, align 8, !tbaa !9
  %231 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %230, ptr noundef @.str.15) #8
  %232 = load ptr, ptr %27, align 8, !tbaa !9
  %233 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %232, ptr noundef @.str.16) #8
  %234 = load ptr, ptr %27, align 8, !tbaa !9
  %235 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %234, ptr noundef @.str.17) #8
  %236 = load ptr, ptr %27, align 8, !tbaa !9
  %237 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %236, ptr noundef @.str.18) #8
  %238 = load ptr, ptr %27, align 8, !tbaa !9
  %239 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %238, ptr noundef @.str.19) #8
  %240 = load ptr, ptr %27, align 8, !tbaa !9
  %241 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %240, ptr noundef @.str.20) #8
  %242 = load ptr, ptr %27, align 8, !tbaa !9
  %243 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %242, ptr noundef @.str.21) #8
  %244 = load ptr, ptr %27, align 8, !tbaa !9
  %245 = call i32 @fclose(ptr noundef %244)
  %246 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, ptr noundef @.str.6)
  %247 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  %248 = load ptr, ptr %12, align 8
  call void @llvm.stackrestore.p0(ptr %248)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  br label %249

249:                                              ; preds = %227, %35
  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
  %250 = load i32, ptr %3, align 4
  ret i32 %250
}

; 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

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #5

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

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

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

; Function Attrs: nounwind
declare float @logf(float noundef) #4

; Function Attrs: nounwind
declare <2 x float> @cexpf(<2 x float> noundef) #4

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

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

declare i32 @modemcf_print(ptr noundef) #1

declare i32 @modemcf_gen_rand_sym(ptr noundef) #1

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

declare float @randnf(...) #1

declare float @randf(...) #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 @modemcf_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
declare void @llvm.stackrestore.p0(ptr) #7

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 #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 = { nocallback nofree nosync nounwind willreturn }
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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !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.3 = external hidden unnamed_addr constant [5 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [20 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 [12 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.23 = 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 #2 {
  %3 = alloca i32, align 4
  br label %4

4:                                                ; preds = %7, %2
  %.069 = phi i32 [ 6, %2 ], [ %9, %7 ]
  %5 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.3) #10
  switch i32 %5, label %10 [
    i32 -1, label %11
    i32 117, label %6
    i32 104, label %6
    i32 112, label %7
  ]

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

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

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

11:                                               ; preds = %4
  %12 = icmp eq i32 %.069, 0
  br i1 %12, label %13, label %17

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

17:                                               ; preds = %11
  %18 = shl nuw i32 1, %.069
  %19 = zext i32 %18 to i64
  %20 = tail call ptr @llvm.stacksave.p0()
  %21 = alloca { float, float }, i64 %19, align 16
  %22 = uitofp i32 %18 to float
  br label %23

23:                                               ; preds = %17, %23
  %indvars.iv = phi i64 [ 0, %17 ], [ %indvars.iv.next, %23 ]
  %24 = trunc nuw i64 %indvars.iv to i32
  %25 = uitofp i32 %24 to float
  %26 = tail call float @logf(float noundef %22) #10
  %27 = fdiv float %25, %26
  %28 = fadd float %27, 4.000000e+00
  %29 = tail call float @logf(float noundef %22) #10
  %30 = fdiv float %25, %29
  %31 = fmul float %30, 0.000000e+00
  %.sroa.029.0.vec.insert = insertelement <2 x float> poison, float %31, i64 0
  %.sroa.029.4.vec.insert = insertelement <2 x float> %.sroa.029.0.vec.insert, float %30, i64 1
  %32 = tail call <2 x float> @cexpf(<2 x float> noundef %.sroa.029.4.vec.insert) #10
  %33 = getelementptr inbounds { float, float }, ptr %21, i64 %indvars.iv
  %34 = insertelement <2 x float> poison, float %28, i64 0
  %35 = shufflevector <2 x float> %34, <2 x float> poison, <2 x i32> zeroinitializer
  %36 = fmul <2 x float> %35, %32
  store <2 x float> %36, ptr %33, align 8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %19
  br i1 %exitcond.not, label %37, label %23, !llvm.loop !11

37:                                               ; preds = %23
  %38 = call ptr @modemcf_create_arbitrary(ptr noundef nonnull %21, i32 noundef %18) #10
  %39 = call ptr @modemcf_create_arbitrary(ptr noundef nonnull %21, i32 noundef %18) #10
  %40 = call i32 @modemcf_print(ptr noundef %38) #10
  %41 = alloca [1024 x { float, float }], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #10
  br label %42

42:                                               ; preds = %37, %42
  %indvars.iv83 = phi i64 [ 0, %37 ], [ %indvars.iv.next84, %42 ]
  %.07078 = phi i32 [ 0, %37 ], [ %66, %42 ]
  %43 = call i32 @modemcf_gen_rand_sym(ptr noundef %38) #10
  %44 = getelementptr inbounds { float, float }, ptr %41, i64 %indvars.iv83
  %45 = call i32 @modemcf_modulate(ptr noundef %38, i32 noundef %43, ptr noundef nonnull %44) #10
  %46 = call float (...) @randnf() #10
  %47 = fpext float %46 to double
  %48 = fmul double %47, 5.000000e-02
  %49 = call float (...) @randf() #10
  %50 = fpext float %49 to double
  %51 = fmul double %50, 0x400921FB54442D18
  %52 = fmul float %49, 0.000000e+00
  %53 = fptrunc double %51 to float
  %.sroa.017.0.vec.insert = insertelement <2 x float> poison, float %52, i64 0
  %.sroa.017.4.vec.insert = insertelement <2 x float> %.sroa.017.0.vec.insert, float %53, i64 1
  %54 = call <2 x float> @cexpf(<2 x float> noundef %.sroa.017.4.vec.insert) #10
  %55 = fpext <2 x float> %54 to <2 x double>
  %56 = insertelement <2 x double> poison, double %48, i64 0
  %57 = shufflevector <2 x double> %56, <2 x double> poison, <2 x i32> zeroinitializer
  %58 = fmul <2 x double> %57, %55
  %59 = load <2 x float>, ptr %44, align 8
  %60 = fpext <2 x float> %59 to <2 x double>
  %61 = fadd <2 x double> %58, %60
  %62 = fptrunc <2 x double> %61 to <2 x float>
  store <2 x float> %62, ptr %44, align 8
  %63 = call i32 @modemcf_demodulate(ptr noundef %39, <2 x float> noundef %62, ptr noundef nonnull %3) #10
  %64 = load i32, ptr %3, align 4, !tbaa !12
  %65 = call i32 @count_bit_errors(i32 noundef %43, i32 noundef %64) #10
  %66 = add i32 %65, %.07078
  %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
  %exitcond86.not = icmp eq i64 %indvars.iv.next84, 1024
  br i1 %exitcond86.not, label %67, label %42, !llvm.loop !14

67:                                               ; preds = %42
  %68 = shl i32 %.069, 10
  %69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %66, i32 noundef %68)
  %70 = call i32 @modemcf_destroy(ptr noundef %38) #10
  %71 = call i32 @modemcf_destroy(ptr noundef %39) #10
  %72 = call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7)
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.6) #10
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.9) #10
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.10) #10
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.11, i32 noundef %.069) #10
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.12, i32 noundef %18) #10
  br label %78

78:                                               ; preds = %67, %78
  %indvars.iv87 = phi i64 [ 0, %67 ], [ %indvars.iv.next88, %78 ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %79 = getelementptr inbounds { float, float }, ptr %41, i64 %indvars.iv87
  %80 = load float, ptr %79, align 8
  %81 = getelementptr inbounds i8, ptr %79, i64 4
  %82 = fpext float %80 to double
  %83 = load float, ptr %81, align 4
  %84 = fpext float %83 to double
  %85 = trunc nuw nsw i64 %indvars.iv.next88 to i32
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.13, i32 noundef %85, double noundef %82, double noundef %84) #10
  %exitcond90.not = icmp eq i64 %indvars.iv.next88, 1024
  br i1 %exitcond90.not, label %87, label %78, !llvm.loop !15

87:                                               ; preds = %78
  %88 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.14) #10
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.15) #10
  %90 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.16) #10
  %91 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.17) #10
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.18) #10
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.19) #10
  %94 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.20) #10
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef nonnull @.str.21) #10
  %96 = call i32 @fclose(ptr noundef %72)
  %97 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef nonnull @.str.6)
  %98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #10
  call void @llvm.stackrestore.p0(ptr %20)
  br label %99

99:                                               ; preds = %87, %6
  ret i32 0
}

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

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

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

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

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

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

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

; Function Attrs: nounwind
declare <2 x float> @cexpf(<2 x float> noundef) local_unnamed_addr #4

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

declare ptr @modemcf_create_arbitrary(ptr noundef, i32 noundef) local_unnamed_addr #9

declare i32 @modemcf_print(ptr noundef) local_unnamed_addr #9

declare i32 @modemcf_gen_rand_sym(ptr noundef) local_unnamed_addr #9

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

declare float @randnf(...) local_unnamed_addr #9

declare float @randf(...) local_unnamed_addr #9

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

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

declare i32 @modemcf_destroy(ptr noundef) local_unnamed_addr #9

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

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

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { 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 #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 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #8 = { 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 #9 = { "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 #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { noreturn nounwind }
attributes #13 = { 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 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}


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