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

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

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

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

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

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

30:                                               ; preds = %26
  br label %18, !llvm.loop !11

31:                                               ; preds = %18
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = call i32 @liquid_nextpow2(i32 noundef %32)
  %34 = shl i32 1, %33
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = icmp ne i32 %34, %35
  br i1 %36, label %37, label %43

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

43:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = call ptr @bsequence_create(i32 noundef %44)
  store ptr %45, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = call ptr @bsequence_create(i32 noundef %46)
  store ptr %47, ptr %10, align 8, !tbaa !9
  %48 = load ptr, ptr %9, align 8, !tbaa !9
  %49 = load ptr, ptr %10, align 8, !tbaa !9
  %50 = call i32 @bsequence_create_ccodes(ptr noundef %48, ptr noundef %49)
  %51 = load ptr, ptr %9, align 8, !tbaa !9
  %52 = call i32 @bsequence_print(ptr noundef %51)
  %53 = load ptr, ptr %10, align 8, !tbaa !9
  %54 = call i32 @bsequence_print(ptr noundef %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %55 = load i32, ptr %6, align 4, !tbaa !5
  %56 = call ptr @bsequence_create(i32 noundef %55)
  store ptr %56, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = call ptr @bsequence_create(i32 noundef %57)
  store ptr %58, ptr %12, align 8, !tbaa !9
  %59 = load ptr, ptr %11, align 8, !tbaa !9
  %60 = load ptr, ptr %12, align 8, !tbaa !9
  %61 = call i32 @bsequence_create_ccodes(ptr noundef %59, ptr noundef %60)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = zext i32 %62 to i64
  %64 = call ptr @llvm.stacksave.p0()
  store ptr %64, ptr %14, align 8
  %65 = alloca i32, i64 %63, align 16
  store i64 %63, ptr %15, align 8
  %66 = load i32, ptr %6, align 4, !tbaa !5
  %67 = zext i32 %66 to i64
  %68 = alloca i32, i64 %67, align 16
  store i64 %67, ptr %16, align 8
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %116, %43
  %70 = load i32, ptr %13, align 4, !tbaa !5
  %71 = load i32, ptr %6, align 4, !tbaa !5
  %72 = icmp ult i32 %70, %71
  br i1 %72, label %73, label %119

73:                                               ; preds = %69
  %74 = load ptr, ptr %9, align 8, !tbaa !9
  %75 = load ptr, ptr %11, align 8, !tbaa !9
  %76 = call i32 @bsequence_correlate(ptr noundef %74, ptr noundef %75)
  %77 = mul nsw i32 2, %76
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = sub i32 %77, %78
  %80 = load i32, ptr %13, align 4, !tbaa !5
  %81 = zext i32 %80 to i64
  %82 = getelementptr inbounds i32, ptr %65, i64 %81
  store i32 %79, ptr %82, align 4, !tbaa !5
  %83 = load ptr, ptr %10, align 8, !tbaa !9
  %84 = load ptr, ptr %12, align 8, !tbaa !9
  %85 = call i32 @bsequence_correlate(ptr noundef %83, ptr noundef %84)
  %86 = mul nsw i32 2, %85
  %87 = load i32, ptr %6, align 4, !tbaa !5
  %88 = sub i32 %86, %87
  %89 = load i32, ptr %13, align 4, !tbaa !5
  %90 = zext i32 %89 to i64
  %91 = getelementptr inbounds i32, ptr %68, i64 %90
  store i32 %88, ptr %91, align 4, !tbaa !5
  %92 = load ptr, ptr %11, align 8, !tbaa !9
  %93 = call i32 @bsequence_circshift(ptr noundef %92)
  %94 = load ptr, ptr %12, align 8, !tbaa !9
  %95 = call i32 @bsequence_circshift(ptr noundef %94)
  %96 = load i32, ptr %13, align 4, !tbaa !5
  %97 = load i32, ptr %13, align 4, !tbaa !5
  %98 = zext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr %65, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = load i32, ptr %13, align 4, !tbaa !5
  %102 = load i32, ptr %13, align 4, !tbaa !5
  %103 = zext i32 %102 to i64
  %104 = getelementptr inbounds i32, ptr %68, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds i32, ptr %65, i64 %107
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = load i32, ptr %13, align 4, !tbaa !5
  %111 = zext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %68, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !5
  %114 = add nsw i32 %109, %113
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %96, i32 noundef %100, i32 noundef %101, i32 noundef %105, i32 noundef %114)
  br label %116

116:                                              ; preds = %73
  %117 = load i32, ptr %13, align 4, !tbaa !5
  %118 = add i32 %117, 1
  store i32 %118, ptr %13, align 4, !tbaa !5
  br label %69, !llvm.loop !13

119:                                              ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %120 = call noalias ptr @fopen(ptr noundef @.str.6, ptr noundef @.str.7)
  store ptr %120, ptr %17, align 8, !tbaa !9
  %121 = load ptr, ptr %17, align 8, !tbaa !9
  %122 = icmp ne ptr %121, null
  br i1 %122, label %129, label %123

123:                                              ; preds = %119
  %124 = load ptr, ptr @stderr, align 8, !tbaa !9
  %125 = load ptr, ptr %5, align 8, !tbaa !9
  %126 = getelementptr inbounds ptr, ptr %125, i64 0
  %127 = load ptr, ptr %126, align 8, !tbaa !9
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef @.str.8, ptr noundef %127, ptr noundef @.str.6) #7
  call void @exit(i32 noundef 1) #9
  unreachable

129:                                              ; preds = %119
  %130 = load ptr, ptr %17, align 8, !tbaa !9
  %131 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %130, ptr noundef @.str.9, ptr noundef @.str.6) #7
  %132 = load ptr, ptr %17, align 8, !tbaa !9
  %133 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %132, ptr noundef @.str.10) #7
  %134 = load ptr, ptr %17, align 8, !tbaa !9
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.11) #7
  %136 = load ptr, ptr %17, align 8, !tbaa !9
  %137 = load i32, ptr %6, align 4, !tbaa !5
  %138 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef @.str.12, i32 noundef %137) #7
  %139 = load ptr, ptr %17, align 8, !tbaa !9
  %140 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %139, ptr noundef @.str.13) #7
  %141 = load ptr, ptr %17, align 8, !tbaa !9
  %142 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %141, ptr noundef @.str.14) #7
  %143 = load ptr, ptr %17, align 8, !tbaa !9
  %144 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %143, ptr noundef @.str.15) #7
  %145 = load ptr, ptr %17, align 8, !tbaa !9
  %146 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %145, ptr noundef @.str.16) #7
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %198, %129
  %148 = load i32, ptr %13, align 4, !tbaa !5
  %149 = load i32, ptr %6, align 4, !tbaa !5
  %150 = icmp ult i32 %148, %149
  br i1 %150, label %151, label %201

151:                                              ; preds = %147
  %152 = load ptr, ptr %17, align 8, !tbaa !9
  %153 = load i32, ptr %13, align 4, !tbaa !5
  %154 = add i32 %153, 1
  %155 = load ptr, ptr %9, align 8, !tbaa !9
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = load i32, ptr %13, align 4, !tbaa !5
  %158 = sub i32 %156, %157
  %159 = sub i32 %158, 1
  %160 = call i32 @bsequence_index(ptr noundef %155, i32 noundef %159)
  %161 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %152, ptr noundef @.str.17, i32 noundef %154, i32 noundef %160) #7
  %162 = load ptr, ptr %17, align 8, !tbaa !9
  %163 = load i32, ptr %13, align 4, !tbaa !5
  %164 = add i32 %163, 1
  %165 = load ptr, ptr %10, align 8, !tbaa !9
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = load i32, ptr %13, align 4, !tbaa !5
  %168 = sub i32 %166, %167
  %169 = sub i32 %168, 1
  %170 = call i32 @bsequence_index(ptr noundef %165, i32 noundef %169)
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %162, ptr noundef @.str.18, i32 noundef %164, i32 noundef %170) #7
  %172 = load ptr, ptr %17, align 8, !tbaa !9
  %173 = load i32, ptr %13, align 4, !tbaa !5
  %174 = add i32 %173, 1
  %175 = load i32, ptr %13, align 4, !tbaa !5
  %176 = zext i32 %175 to i64
  %177 = getelementptr inbounds i32, ptr %65, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = sitofp i32 %178 to float
  %180 = load i32, ptr %6, align 4, !tbaa !5
  %181 = uitofp i32 %180 to float
  %182 = fdiv float %179, %181
  %183 = fpext float %182 to double
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %172, ptr noundef @.str.19, i32 noundef %174, double noundef %183) #7
  %185 = load ptr, ptr %17, align 8, !tbaa !9
  %186 = load i32, ptr %13, align 4, !tbaa !5
  %187 = add i32 %186, 1
  %188 = load i32, ptr %13, align 4, !tbaa !5
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds i32, ptr %68, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = sitofp i32 %191 to float
  %193 = load i32, ptr %6, align 4, !tbaa !5
  %194 = uitofp i32 %193 to float
  %195 = fdiv float %192, %194
  %196 = fpext float %195 to double
  %197 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %185, ptr noundef @.str.20, i32 noundef %187, double noundef %196) #7
  br label %198

198:                                              ; preds = %151
  %199 = load i32, ptr %13, align 4, !tbaa !5
  %200 = add i32 %199, 1
  store i32 %200, ptr %13, align 4, !tbaa !5
  br label %147, !llvm.loop !14

201:                                              ; preds = %147
  %202 = load ptr, ptr %17, align 8, !tbaa !9
  %203 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %202, ptr noundef @.str.21) #7
  %204 = load ptr, ptr %17, align 8, !tbaa !9
  %205 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %204, ptr noundef @.str.22) #7
  %206 = load ptr, ptr %17, align 8, !tbaa !9
  %207 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %206, ptr noundef @.str.23) #7
  %208 = load ptr, ptr %17, align 8, !tbaa !9
  %209 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %208, ptr noundef @.str.24) #7
  %210 = load ptr, ptr %17, align 8, !tbaa !9
  %211 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %210, ptr noundef @.str.25) #7
  %212 = load ptr, ptr %17, align 8, !tbaa !9
  %213 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %212, ptr noundef @.str.26) #7
  %214 = load ptr, ptr %17, align 8, !tbaa !9
  %215 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %214, ptr noundef @.str.27) #7
  %216 = load ptr, ptr %17, align 8, !tbaa !9
  %217 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %216, ptr noundef @.str.28) #7
  %218 = load ptr, ptr %17, align 8, !tbaa !9
  %219 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %218, ptr noundef @.str.25) #7
  %220 = load ptr, ptr %17, align 8, !tbaa !9
  %221 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %220, ptr noundef @.str.29) #7
  %222 = load ptr, ptr %17, align 8, !tbaa !9
  %223 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %222, ptr noundef @.str.30) #7
  %224 = load ptr, ptr %17, align 8, !tbaa !9
  %225 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %224, ptr noundef @.str.31) #7
  %226 = load ptr, ptr %17, align 8, !tbaa !9
  %227 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %226, ptr noundef @.str.32) #7
  %228 = load ptr, ptr %17, align 8, !tbaa !9
  %229 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %228, ptr noundef @.str.33) #7
  %230 = load ptr, ptr %17, align 8, !tbaa !9
  %231 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %230, ptr noundef @.str.34) #7
  %232 = load ptr, ptr %17, align 8, !tbaa !9
  %233 = call i32 @fclose(ptr noundef %232)
  %234 = call i32 (ptr, ...) @printf(ptr noundef @.str.35, ptr noundef @.str.6)
  %235 = load ptr, ptr %9, align 8, !tbaa !9
  %236 = call i32 @bsequence_destroy(ptr noundef %235)
  %237 = load ptr, ptr %10, align 8, !tbaa !9
  %238 = call i32 @bsequence_destroy(ptr noundef %237)
  %239 = load ptr, ptr %11, align 8, !tbaa !9
  %240 = call i32 @bsequence_destroy(ptr noundef %239)
  %241 = load ptr, ptr %12, align 8, !tbaa !9
  %242 = call i32 @bsequence_destroy(ptr noundef %241)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  %243 = load ptr, ptr %14, align 8
  call void @llvm.stackrestore.p0(ptr %243)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %244

244:                                              ; preds = %201, %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %245 = load i32, ptr %3, align 4
  ret i32 %245
}

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

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

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

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

declare i32 @liquid_nextpow2(i32 noundef) #1

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

declare ptr @bsequence_create(i32 noundef) #1

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

declare i32 @bsequence_print(ptr noundef) #1

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

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

declare i32 @bsequence_circshift(ptr noundef) #1

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

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

declare i32 @fclose(ptr noundef) #1

declare i32 @bsequence_destroy(ptr noundef) #1

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !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 [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [13 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 [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.31 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.35 = 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 noundef i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  br label %3

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

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

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

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

10:                                               ; preds = %3
  %11 = tail call i32 @liquid_nextpow2(i32 noundef %.090) #7
  %12 = shl nuw i32 1, %11
  %.not93 = icmp eq i32 %12, %.090
  br i1 %.not93, label %17, label %13

13:                                               ; preds = %10
  %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) #10
  tail call void @exit(i32 noundef 1) #9
  unreachable

17:                                               ; preds = %10
  %18 = tail call ptr @bsequence_create(i32 noundef %.090) #7
  %19 = tail call ptr @bsequence_create(i32 noundef %.090) #7
  %20 = tail call i32 @bsequence_create_ccodes(ptr noundef %18, ptr noundef %19) #7
  %21 = tail call i32 @bsequence_print(ptr noundef %18) #7
  %22 = tail call i32 @bsequence_print(ptr noundef %19) #7
  %23 = tail call ptr @bsequence_create(i32 noundef %.090) #7
  %24 = tail call ptr @bsequence_create(i32 noundef %.090) #7
  %25 = tail call i32 @bsequence_create_ccodes(ptr noundef %23, ptr noundef %24) #7
  %26 = zext i32 %.090 to i64
  %27 = tail call ptr @llvm.stacksave.p0()
  %28 = alloca i32, i64 %26, align 16
  %29 = alloca i32, i64 %26, align 16
  br label %30

30:                                               ; preds = %17, %30
  %indvars.iv = phi i64 [ 0, %17 ], [ %indvars.iv.next, %30 ]
  %31 = tail call i32 @bsequence_correlate(ptr noundef %18, ptr noundef %23) #7
  %32 = shl nsw i32 %31, 1
  %33 = sub i32 %32, %.090
  %34 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv
  store i32 %33, ptr %34, align 4, !tbaa !11
  %35 = tail call i32 @bsequence_correlate(ptr noundef %19, ptr noundef %24) #7
  %36 = shl nsw i32 %35, 1
  %37 = sub i32 %36, %.090
  %38 = getelementptr inbounds i32, ptr %29, i64 %indvars.iv
  store i32 %37, ptr %38, align 4, !tbaa !11
  %39 = tail call i32 @bsequence_circshift(ptr noundef %23) #7
  %40 = tail call i32 @bsequence_circshift(ptr noundef %24) #7
  %41 = add nsw i32 %37, %33
  %42 = trunc nuw i64 %indvars.iv to i32
  %43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %42, i32 noundef %33, i32 noundef %42, i32 noundef %37, i32 noundef %41)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %26
  br i1 %exitcond.not, label %44, label %30, !llvm.loop !13

44:                                               ; preds = %30
  %45 = tail call noalias ptr @fopen(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7)
  %.not94 = icmp eq ptr %45, null
  br i1 %.not94, label %46, label %50

46:                                               ; preds = %44
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = load ptr, ptr %1, align 8, !tbaa !5
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef nonnull @.str.8, ptr noundef %48, ptr noundef nonnull @.str.6) #10
  tail call void @exit(i32 noundef 1) #9
  unreachable

50:                                               ; preds = %44
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %45, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.6) #7
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %45, ptr noundef nonnull @.str.10) #7
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %45, ptr noundef nonnull @.str.11) #7
  %54 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %45, ptr noundef nonnull @.str.12, i32 noundef %.090) #7
  %55 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %45, ptr noundef nonnull @.str.13) #7
  %56 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %45, ptr noundef nonnull @.str.14) #7
  %57 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %45, ptr noundef nonnull @.str.15) #7
  %58 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %45, ptr noundef nonnull @.str.16) #7
  %.not = icmp eq i32 %.090, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %50
  %59 = uitofp i32 %.090 to float
  br label %60

60:                                               ; preds = %.lr.ph, %60
  %indvars.iv102 = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next103, %60 ]
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %61 = trunc nuw i64 %indvars.iv102 to i32
  %62 = xor i32 %61, -1
  %63 = add i32 %.090, %62
  %64 = tail call i32 @bsequence_index(ptr noundef %18, i32 noundef %63) #7
  %65 = trunc nuw i64 %indvars.iv.next103 to i32
  %66 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.17, i32 noundef %65, i32 noundef %64) #7
  %67 = tail call i32 @bsequence_index(ptr noundef %19, i32 noundef %63) #7
  %68 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.18, i32 noundef %65, i32 noundef %67) #7
  %69 = getelementptr inbounds i32, ptr %28, i64 %indvars.iv102
  %70 = load i32, ptr %69, align 4, !tbaa !11
  %71 = sitofp i32 %70 to float
  %72 = fdiv float %71, %59
  %73 = fpext float %72 to double
  %74 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.19, i32 noundef %65, double noundef %73) #7
  %75 = getelementptr inbounds i32, ptr %29, i64 %indvars.iv102
  %76 = load i32, ptr %75, align 4, !tbaa !11
  %77 = sitofp i32 %76 to float
  %78 = fdiv float %77, %59
  %79 = fpext float %78 to double
  %80 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.20, i32 noundef %65, double noundef %79) #7
  %exitcond106.not = icmp eq i64 %indvars.iv.next103, %26
  br i1 %exitcond106.not, label %._crit_edge, label %60, !llvm.loop !14

._crit_edge:                                      ; preds = %60, %50
  %81 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.21) #7
  %82 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.22) #7
  %83 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.23) #7
  %84 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.24) #7
  %85 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.25) #7
  %86 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.26) #7
  %87 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.27) #7
  %88 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.28) #7
  %89 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.25) #7
  %90 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.29) #7
  %91 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.30) #7
  %92 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.31) #7
  %93 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.32) #7
  %94 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.33) #7
  %95 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.34) #7
  %96 = tail call i32 @fclose(ptr noundef %45)
  %97 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.35, ptr noundef nonnull @.str.6)
  %98 = tail call i32 @bsequence_destroy(ptr noundef %18) #7
  %99 = tail call i32 @bsequence_destroy(ptr noundef %19) #7
  %100 = tail call i32 @bsequence_destroy(ptr noundef %23) #7
  %101 = tail call i32 @bsequence_destroy(ptr noundef %24) #7
  tail call void @llvm.stackrestore.p0(ptr %27)
  br label %102

102:                                              ; preds = %._crit_edge, %5
  ret i32 0
}

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

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

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

declare i32 @liquid_nextpow2(i32 noundef) local_unnamed_addr #5

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

declare ptr @bsequence_create(i32 noundef) local_unnamed_addr #5

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

declare i32 @bsequence_print(ptr noundef) local_unnamed_addr #5

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

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

declare i32 @bsequence_circshift(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 @bsequence_index(ptr noundef, i32 noundef) local_unnamed_addr #5

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

declare i32 @bsequence_destroy(ptr noundef) local_unnamed_addr #5

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { noreturn nounwind }
attributes #10 = { cold nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}


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