; LLVM IR from jgaeddert/liquid-dsp :: examples (gmskmodem_ber_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"

@__const.main.filename = external hidden unnamed_addr constant [24 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca [24 x i8], align 16
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca float, align 4
  %29 = alloca ptr, align 8
  %30 = alloca float, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca float, align 4
  %34 = alloca float, align 4
  %35 = alloca 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) #7
  store i32 4, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 3, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store float 0x3FD3333340000000, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store float -5.000000e+00, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store float 1.500000e+01, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store float 1.000000e+00, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1000000, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 @__const.main.filename, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  br label %36

36:                                               ; preds = %2
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = load ptr, ptr %5, align 8, !tbaa !9
  %39 = call i32 @getopt(i32 noundef %37, ptr noundef %38, ptr noundef @.str.2) #7
  store i32 %39, ptr %14, align 4, !tbaa !5
  %40 = icmp ne i32 %39, -1
  br i1 %40, label %41, label %45

41:                                               ; preds = %36
  %42 = load i32, ptr %14, align 4, !tbaa !5
  switch i32 %42, label %44 [
    i32 104, label %43
  ]

43:                                               ; preds = %41
  call void @usage()
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %223

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

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = load float, ptr %8, align 4, !tbaa !11
  %49 = call ptr @gmskmod_create(i32 noundef %46, i32 noundef %47, float noundef %48)
  store ptr %49, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %50 = load i32, ptr %6, align 4, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = load float, ptr %8, align 4, !tbaa !11
  %53 = call ptr @gmskdem_create(i32 noundef %50, i32 noundef %51, float noundef %52)
  store ptr %53, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %54 = load i32, ptr %7, align 4, !tbaa !5
  %55 = mul i32 2, %54
  store i32 %55, ptr %18, align 4, !tbaa !5
  %56 = load i32, ptr %18, align 4, !tbaa !5
  %57 = zext i32 %56 to i64
  %58 = call ptr @llvm.stacksave.p0()
  store ptr %58, ptr %19, align 8
  %59 = alloca i32, i64 %57, align 16
  store i64 %57, ptr %20, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = zext i32 %60 to i64
  %62 = alloca { float, float }, i64 %61, align 16
  store i64 %61, ptr %22, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %63 = load i32, ptr %6, align 4, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = load float, ptr %8, align 4, !tbaa !11
  %66 = fpext float %65 to double
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %63, i32 noundef %64, double noundef %66)
  %68 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef @.str.7, ptr noundef @.str.8, ptr noundef @.str.9)
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #7
  %69 = load float, ptr %9, align 4, !tbaa !11
  store float %69, ptr %28, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %70 = getelementptr inbounds [24 x i8], ptr %13, i64 0, i64 0
  %71 = call noalias ptr @fopen(ptr noundef %70, ptr noundef @.str.10)
  store ptr %71, ptr %29, align 8, !tbaa !9
  %72 = load ptr, ptr %29, align 8, !tbaa !9
  %73 = getelementptr inbounds [24 x i8], ptr %13, i64 0, i64 0
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %72, ptr noundef @.str.11, ptr noundef %73) #7
  %75 = load ptr, ptr %29, align 8, !tbaa !9
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.12) #7
  br label %77

77:                                               ; preds = %208, %45
  br label %78

78:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #7
  %79 = load float, ptr %28, align 4, !tbaa !11
  %80 = fneg float %79
  %81 = fdiv float %80, 2.000000e+01
  %82 = call float @powf(float noundef 1.000000e+01, float noundef %81) #7
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = uitofp i32 %83 to float
  %85 = call float @sqrtf(float noundef %84) #7
  %86 = fmul float %82, %85
  store float %86, ptr %30, align 4, !tbaa !11
  %87 = load ptr, ptr %16, align 8, !tbaa !9
  %88 = call i32 @gmskmod_reset(ptr noundef %87)
  %89 = load ptr, ptr %17, align 8, !tbaa !9
  %90 = call i32 @gmskdem_reset(ptr noundef %89)
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  store i32 0, ptr %31, align 4, !tbaa !5
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %158, %78
  %92 = load i32, ptr %23, align 4, !tbaa !5
  %93 = load i32, ptr %12, align 4, !tbaa !5
  %94 = load i32, ptr %18, align 4, !tbaa !5
  %95 = add i32 %93, %94
  %96 = icmp ult i32 %92, %95
  br i1 %96, label %97, label %161

97:                                               ; preds = %91
  %98 = load i32, ptr %21, align 4, !tbaa !5
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds i32, ptr %59, i64 %99
  %101 = load i32, ptr %100, align 4, !tbaa !5
  store i32 %101, ptr %27, align 4, !tbaa !5
  %102 = call i32 @rand() #7
  %103 = and i32 %102, 1
  store i32 %103, ptr %25, align 4, !tbaa !5
  %104 = load ptr, ptr %16, align 8, !tbaa !9
  %105 = load i32, ptr %25, align 4, !tbaa !5
  %106 = call i32 @gmskmod_modulate(ptr noundef %104, i32 noundef %105, ptr noundef %62)
  %107 = load i32, ptr %25, align 4, !tbaa !5
  %108 = load i32, ptr %21, align 4, !tbaa !5
  %109 = zext i32 %108 to i64
  %110 = getelementptr inbounds i32, ptr %59, i64 %109
  store i32 %107, ptr %110, align 4, !tbaa !5
  %111 = load i32, ptr %21, align 4, !tbaa !5
  %112 = add i32 %111, 1
  %113 = load i32, ptr %18, align 4, !tbaa !5
  %114 = urem i32 %112, %113
  store i32 %114, ptr %21, align 4, !tbaa !5
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %142, %97
  %116 = load i32, ptr %24, align 4, !tbaa !5
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = icmp ult i32 %116, %117
  br i1 %118, label %119, label %145

119:                                              ; preds = %115
  %120 = load float, ptr %30, align 4, !tbaa !11
  %121 = call float (...) @randnf()
  %122 = call float (...) @randnf()
  %123 = fmul float 0.000000e+00, %122
  %124 = fmul float 1.000000e+00, %122
  %125 = fadd float %121, %123
  %126 = fmul float %120, %125
  %127 = fmul float %120, %124
  %128 = call float @sqrtf(float noundef 2.000000e+00) #7
  %129 = fdiv float %126, %128
  %130 = fdiv float %127, %128
  %131 = load i32, ptr %24, align 4, !tbaa !5
  %132 = zext i32 %131 to i64
  %133 = getelementptr inbounds { float, float }, ptr %62, i64 %132
  %134 = getelementptr inbounds { float, float }, ptr %133, i32 0, i32 0
  %135 = load float, ptr %134, align 8
  %136 = getelementptr inbounds { float, float }, ptr %133, i32 0, i32 1
  %137 = load float, ptr %136, align 4
  %138 = fadd float %135, %129
  %139 = fadd float %137, %130
  %140 = getelementptr inbounds { float, float }, ptr %133, i32 0, i32 0
  %141 = getelementptr inbounds { float, float }, ptr %133, i32 0, i32 1
  store float %138, ptr %140, align 8
  store float %139, ptr %141, align 4
  br label %142

142:                                              ; preds = %119
  %143 = load i32, ptr %24, align 4, !tbaa !5
  %144 = add i32 %143, 1
  store i32 %144, ptr %24, align 4, !tbaa !5
  br label %115, !llvm.loop !13

145:                                              ; preds = %115
  %146 = load ptr, ptr %17, align 8, !tbaa !9
  %147 = call i32 @gmskdem_demodulate(ptr noundef %146, ptr noundef %62, ptr noundef %26)
  %148 = load i32, ptr %23, align 4, !tbaa !5
  %149 = load i32, ptr %18, align 4, !tbaa !5
  %150 = icmp ugt i32 %148, %149
  br i1 %150, label %151, label %157

151:                                              ; preds = %145
  %152 = load i32, ptr %27, align 4, !tbaa !5
  %153 = load i32, ptr %26, align 4, !tbaa !5
  %154 = call i32 @count_bit_errors(i32 noundef %152, i32 noundef %153)
  %155 = load i32, ptr %31, align 4, !tbaa !5
  %156 = add i32 %155, %154
  store i32 %156, ptr %31, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %151, %145
  br label %158

158:                                              ; preds = %157
  %159 = load i32, ptr %23, align 4, !tbaa !5
  %160 = add i32 %159, 1
  store i32 %160, ptr %23, align 4, !tbaa !5
  br label %91, !llvm.loop !15

161:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  %162 = load i32, ptr %7, align 4, !tbaa !5
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = mul i32 %162, %163
  store i32 %164, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %165 = load i32, ptr %31, align 4, !tbaa !5
  %166 = uitofp i32 %165 to float
  %167 = load i32, ptr %32, align 4, !tbaa !5
  %168 = uitofp i32 %167 to float
  %169 = fdiv float %166, %168
  store float %169, ptr %33, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %170 = load float, ptr %28, align 4, !tbaa !11
  %171 = fdiv float %170, 1.000000e+01
  %172 = call float @powf(float noundef 1.000000e+01, float noundef %171) #7
  store float %172, ptr %34, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  %173 = load float, ptr %34, align 4, !tbaa !11
  %174 = fmul float 2.000000e+00, %173
  %175 = call float @sqrtf(float noundef %174) #7
  %176 = call float @liquid_Qf(float noundef %175)
  store float %176, ptr %35, align 4, !tbaa !11
  %177 = load float, ptr %28, align 4, !tbaa !11
  %178 = fpext float %177 to double
  %179 = load i32, ptr %31, align 4, !tbaa !5
  %180 = load i32, ptr %32, align 4, !tbaa !5
  %181 = load float, ptr %33, align 4, !tbaa !11
  %182 = fpext float %181 to double
  %183 = load float, ptr %35, align 4, !tbaa !11
  %184 = fpext float %183 to double
  %185 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, double noundef %178, i32 noundef %179, i32 noundef %180, double noundef %182, double noundef %184)
  %186 = load i32, ptr %31, align 4, !tbaa !5
  %187 = icmp ugt i32 %186, 0
  br i1 %187, label %188, label %197

188:                                              ; preds = %161
  %189 = load ptr, ptr %29, align 8, !tbaa !9
  %190 = load float, ptr %28, align 4, !tbaa !11
  %191 = fpext float %190 to double
  %192 = load float, ptr %33, align 4, !tbaa !11
  %193 = fpext float %192 to double
  %194 = load float, ptr %35, align 4, !tbaa !11
  %195 = fpext float %194 to double
  %196 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %189, ptr noundef @.str.14, double noundef %191, double noundef %193, double noundef %195) #7
  br label %197

197:                                              ; preds = %188, %161
  %198 = load float, ptr %11, align 4, !tbaa !11
  %199 = load float, ptr %28, align 4, !tbaa !11
  %200 = fadd float %199, %198
  store float %200, ptr %28, align 4, !tbaa !11
  %201 = load float, ptr %28, align 4, !tbaa !11
  %202 = load float, ptr %10, align 4, !tbaa !11
  %203 = fcmp ogt float %201, %202
  br i1 %203, label %204, label %205

204:                                              ; preds = %197
  store i32 6, ptr %15, align 4
  br label %206

205:                                              ; preds = %197
  store i32 0, ptr %15, align 4
  br label %206

206:                                              ; preds = %205, %204
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #7
  %207 = load i32, ptr %15, align 4
  switch i32 %207, label %225 [
    i32 0, label %208
    i32 6, label %209
  ]

208:                                              ; preds = %206
  br label %77

209:                                              ; preds = %206
  %210 = load ptr, ptr %29, align 8, !tbaa !9
  %211 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.15) #7
  %212 = load ptr, ptr %29, align 8, !tbaa !9
  %213 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %212, ptr noundef @.str.16) #7
  %214 = load ptr, ptr %29, align 8, !tbaa !9
  %215 = call i32 @fclose(ptr noundef %214)
  %216 = getelementptr inbounds [24 x i8], ptr %13, i64 0, i64 0
  %217 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef %216)
  %218 = load ptr, ptr %16, align 8, !tbaa !9
  %219 = call i32 @gmskmod_destroy(ptr noundef %218)
  %220 = load ptr, ptr %17, align 8, !tbaa !9
  %221 = call i32 @gmskdem_destroy(ptr noundef %220)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  %222 = load ptr, ptr %19, align 8
  call void @llvm.stackrestore.p0(ptr %222)
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %223

223:                                              ; preds = %209, %43
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  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
  %224 = load i32, ptr %3, align 4
  ret i32 %224

225:                                              ; preds = %206
  unreachable
}

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

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

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

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

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

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

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

declare i32 @gmskmod_reset(ptr noundef) #1

declare i32 @gmskdem_reset(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @rand() #4

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

declare float @randnf(...) #1

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

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

declare float @liquid_Qf(float noundef) #1

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

declare i32 @fclose(ptr noundef) #1

declare i32 @gmskmod_destroy(ptr noundef) #1

declare i32 @gmskdem_destroy(ptr noundef) #1

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

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


; 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"

@__const.main.filename = external hidden unnamed_addr constant [24 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [81 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca [24 x i8], align 16
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %3, ptr noundef nonnull align 16 dereferenceable(24) @__const.main.filename, i64 24, i1 false)
  %5 = tail call i32 @getopt(i32 noundef %0, ptr noundef %1, ptr noundef nonnull @.str.2) #9
  switch i32 %5, label %7 [
    i32 -1, label %8
    i32 104, label %6
  ]

6:                                                ; preds = %2
  tail call void @usage()
  br label %110

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

8:                                                ; preds = %2
  %9 = tail call ptr @gmskmod_create(i32 noundef 4, i32 noundef 3, float noundef 0x3FD3333340000000) #9
  %10 = tail call ptr @gmskdem_create(i32 noundef 4, i32 noundef 3, float noundef 0x3FD3333340000000) #9
  %11 = tail call ptr @llvm.stacksave.p0()
  %12 = alloca [6 x i32], align 16
  %13 = alloca [4 x { float, float }], align 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef 4, i32 noundef 3, double noundef 0x3FD3333340000000)
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9)
  %16 = call noalias ptr @fopen(ptr noundef nonnull %3, ptr noundef nonnull @.str.10)
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.11, ptr noundef nonnull %3) #9
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.12) #9
  %19 = getelementptr inbounds i8, ptr %13, i64 8
  %20 = getelementptr inbounds i8, ptr %13, i64 16
  %21 = getelementptr inbounds i8, ptr %13, i64 24
  br label %22

22:                                               ; preds = %102, %8
  %.076.int = phi i32 [ -5, %8 ], [ %.int, %102 ]
  %.071 = phi i32 [ 0, %8 ], [ %79, %102 ]
  %indvar.conv = sitofp i32 %.076.int to float
  %23 = fdiv float %indvar.conv, -2.000000e+01
  %24 = call float @powf(float noundef 1.000000e+01, float noundef %23) #9
  %25 = fmul float %24, 2.000000e+00
  %26 = call i32 @gmskmod_reset(ptr noundef %9) #9
  %27 = call i32 @gmskdem_reset(ptr noundef %10) #9
  %28 = insertelement <2 x float> poison, float %25, i64 0
  %29 = shufflevector <2 x float> %28, <2 x float> poison, <2 x i32> zeroinitializer
  br label %30

30:                                               ; preds = %22, %86
  %.181 = phi i32 [ %.071, %22 ], [ %79, %86 ]
  %.07280 = phi i32 [ 0, %22 ], [ %87, %86 ]
  %.07379 = phi i32 [ 0, %22 ], [ %.174, %86 ]
  %31 = zext i32 %.181 to i64
  %32 = getelementptr inbounds i32, ptr %12, i64 %31
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = call i32 @rand() #9
  %35 = and i32 %34, 1
  %36 = call i32 @gmskmod_modulate(ptr noundef %9, i32 noundef %35, ptr noundef nonnull %13) #9
  store i32 %35, ptr %32, align 4, !tbaa !5
  %37 = add i32 %.181, 1
  %38 = icmp eq i32 %37, 6
  %39 = call float (...) @randnf() #9
  %40 = call float (...) @randnf() #9
  %41 = fmul float %40, 0.000000e+00
  %42 = fadd float %39, %41
  %43 = insertelement <2 x float> poison, float %42, i64 0
  %44 = insertelement <2 x float> %43, float %40, i64 1
  %45 = fmul <2 x float> %29, %44
  %46 = fdiv <2 x float> %45, <float 0x3FF6A09E60000000, float 0x3FF6A09E60000000>
  %47 = load <2 x float>, ptr %13, align 16
  %48 = fadd <2 x float> %47, %46
  store <2 x float> %48, ptr %13, align 16
  %49 = call float (...) @randnf() #9
  %50 = call float (...) @randnf() #9
  %51 = fmul float %50, 0.000000e+00
  %52 = fadd float %49, %51
  %53 = insertelement <2 x float> poison, float %52, i64 0
  %54 = insertelement <2 x float> %53, float %50, i64 1
  %55 = fmul <2 x float> %29, %54
  %56 = fdiv <2 x float> %55, <float 0x3FF6A09E60000000, float 0x3FF6A09E60000000>
  %57 = load <2 x float>, ptr %19, align 8
  %58 = fadd <2 x float> %57, %56
  store <2 x float> %58, ptr %19, align 8
  %59 = call float (...) @randnf() #9
  %60 = call float (...) @randnf() #9
  %61 = fmul float %60, 0.000000e+00
  %62 = fadd float %59, %61
  %63 = insertelement <2 x float> poison, float %62, i64 0
  %64 = insertelement <2 x float> %63, float %60, i64 1
  %65 = fmul <2 x float> %29, %64
  %66 = fdiv <2 x float> %65, <float 0x3FF6A09E60000000, float 0x3FF6A09E60000000>
  %67 = load <2 x float>, ptr %20, align 16
  %68 = fadd <2 x float> %67, %66
  store <2 x float> %68, ptr %20, align 16
  %69 = call float (...) @randnf() #9
  %70 = call float (...) @randnf() #9
  %71 = fmul float %70, 0.000000e+00
  %72 = fadd float %69, %71
  %73 = insertelement <2 x float> poison, float %72, i64 0
  %74 = insertelement <2 x float> %73, float %70, i64 1
  %75 = fmul <2 x float> %29, %74
  %76 = fdiv <2 x float> %75, <float 0x3FF6A09E60000000, float 0x3FF6A09E60000000>
  %77 = load <2 x float>, ptr %21, align 8
  %78 = fadd <2 x float> %77, %76
  store <2 x float> %78, ptr %21, align 8
  %79 = select i1 %38, i32 0, i32 %37
  %80 = call i32 @gmskdem_demodulate(ptr noundef %10, ptr noundef nonnull %13, ptr noundef nonnull %4) #9
  %81 = icmp ugt i32 %.07280, 6
  br i1 %81, label %82, label %86

82:                                               ; preds = %30
  %83 = load i32, ptr %4, align 4, !tbaa !5
  %84 = call i32 @count_bit_errors(i32 noundef %33, i32 noundef %83) #9
  %85 = add i32 %84, %.07379
  br label %86

86:                                               ; preds = %30, %82
  %.174 = phi i32 [ %85, %82 ], [ %.07379, %30 ]
  %87 = add nuw nsw i32 %.07280, 1
  %exitcond.not = icmp eq i32 %87, 1000006
  br i1 %exitcond.not, label %88, label %30, !llvm.loop !9

88:                                               ; preds = %86
  %89 = uitofp i32 %.174 to float
  %90 = fdiv float %89, 3.000000e+06
  %91 = fdiv float %indvar.conv, 1.000000e+01
  %92 = call float @powf(float noundef 1.000000e+01, float noundef %91) #9
  %93 = fmul float %92, 2.000000e+00
  %94 = call float @sqrtf(float noundef %93) #9
  %95 = call float @liquid_Qf(float noundef %94) #9
  %96 = fpext float %indvar.conv to double
  %97 = fpext float %90 to double
  %98 = fpext float %95 to double
  %99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, double noundef %96, i32 noundef %.174, i32 noundef 3000000, double noundef %97, double noundef %98)
  %.not77 = icmp eq i32 %.174, 0
  br i1 %.not77, label %102, label %100

100:                                              ; preds = %88
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.14, double noundef %96, double noundef %97, double noundef %98) #9
  br label %102

102:                                              ; preds = %100, %88
  %.int = add nsw i32 %.076.int, 1
  %exitcond83 = icmp eq i32 %.int, 16
  br i1 %exitcond83, label %103, label %22

103:                                              ; preds = %102
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.15) #9
  %105 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str.16) #9
  %106 = call i32 @fclose(ptr noundef %16)
  %107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull %3)
  %108 = call i32 @gmskmod_destroy(ptr noundef %9) #9
  %109 = call i32 @gmskdem_destroy(ptr noundef %10) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  call void @llvm.stackrestore.p0(ptr %11)
  br label %110

110:                                              ; preds = %103, %6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #9
  ret i32 0
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

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

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

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

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

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

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

declare i32 @gmskmod_reset(ptr noundef) local_unnamed_addr #6

declare i32 @gmskdem_reset(ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #4

declare i32 @gmskmod_modulate(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #6

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

declare i32 @gmskdem_demodulate(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

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

declare float @liquid_Qf(float noundef) local_unnamed_addr #6

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

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

declare i32 @gmskmod_destroy(ptr noundef) local_unnamed_addr #6

declare i32 @gmskdem_destroy(ptr noundef) local_unnamed_addr #6

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

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


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