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

%struct.framedatastats_s = type { i32, i32, i32, i64 }

@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @frame64_add_noise(ptr noundef, float noundef) #0

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca [1440 x { float, float }], align 16
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca float, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %struct.framedatastats_s, align 8
  %23 = alloca i32, align 4
  %24 = alloca %struct.framedatastats_s, align 8
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = 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 8, ptr %6) #4
  %28 = call ptr (...) @framegen64_create()
  store ptr %28, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %29 = call ptr @framesync64_create(ptr noundef null, ptr noundef null)
  store ptr %29, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 50, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 500, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 5000, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store float 0x3F847AE140000000, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 11520, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store float -3.000000e+00, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store float -1.000000e+00, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store float -1.000000e+00, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store float 0.000000e+00, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store float 0.000000e+00, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %30 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %30, ptr %18, align 8, !tbaa !9
  %31 = load ptr, ptr %18, align 8, !tbaa !9
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str.2, ptr noundef @.str) #4
  %33 = load ptr, ptr %18, align 8, !tbaa !9
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %33, ptr noundef @.str.3) #4
  %35 = load ptr, ptr %18, align 8, !tbaa !9
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef @.str.4) #4
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef @.str.6, ptr noundef @.str.7, ptr noundef @.str.8, ptr noundef @.str.9, ptr noundef @.str.10)
  br label %38

38:                                               ; preds = %147, %2
  %39 = load float, ptr %13, align 4, !tbaa !11
  %40 = fcmp olt float %39, 1.000000e+01
  br i1 %40, label %41, label %148

41:                                               ; preds = %38
  %42 = load ptr, ptr %7, align 8, !tbaa !9
  %43 = call i32 @framesync64_reset_framedatastats(ptr noundef %42)
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %85, %41
  br label %45

45:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %46

46:                                               ; preds = %61, %45
  %47 = load i32, ptr %21, align 4, !tbaa !5
  %48 = load i32, ptr %9, align 4, !tbaa !5
  %49 = icmp ult i32 %47, %48
  br i1 %49, label %50, label %64

50:                                               ; preds = %46
  %51 = load ptr, ptr %7, align 8, !tbaa !9
  %52 = call i32 @framesync64_reset(ptr noundef %51)
  %53 = load ptr, ptr %6, align 8, !tbaa !9
  %54 = getelementptr inbounds [1440 x { float, float }], ptr %12, i64 0, i64 0
  %55 = call i32 @framegen64_execute(ptr noundef %53, ptr noundef null, ptr noundef null, ptr noundef %54)
  %56 = getelementptr inbounds [1440 x { float, float }], ptr %12, i64 0, i64 0
  %57 = load float, ptr %13, align 4, !tbaa !11
  call void @frame64_add_noise(ptr noundef %56, float noundef %57)
  %58 = load ptr, ptr %7, align 8, !tbaa !9
  %59 = getelementptr inbounds [1440 x { float, float }], ptr %12, i64 0, i64 0
  %60 = call i32 @framesync64_execute(ptr noundef %58, ptr noundef %59, i32 noundef 1440)
  br label %61

61:                                               ; preds = %50
  %62 = load i32, ptr %21, align 4, !tbaa !5
  %63 = add i32 %62, 1
  store i32 %63, ptr %21, align 4, !tbaa !5
  br label %46, !llvm.loop !13

64:                                               ; preds = %46
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = load i32, ptr %19, align 4, !tbaa !5
  %67 = add i32 %66, %65
  store i32 %67, ptr %19, align 4, !tbaa !5
  %68 = load i32, ptr %19, align 4, !tbaa !5
  %69 = load ptr, ptr %7, align 8, !tbaa !9
  call void @framesync64_get_framedatastats(ptr dead_on_unwind writable sret(%struct.framedatastats_s) align 8 %22, ptr noundef %69)
  %70 = getelementptr inbounds %struct.framedatastats_s, ptr %22, i32 0, i32 2
  %71 = load i32, ptr %70, align 8, !tbaa !15
  %72 = sub i32 %68, %71
  store i32 %72, ptr %20, align 4, !tbaa !5
  %73 = load i32, ptr %20, align 4, !tbaa !5
  %74 = load i32, ptr %8, align 4, !tbaa !5
  %75 = icmp uge i32 %73, %74
  br i1 %75, label %76, label %77

76:                                               ; preds = %64
  store i32 5, ptr %23, align 4
  br label %83

77:                                               ; preds = %64
  %78 = load i32, ptr %19, align 4, !tbaa !5
  %79 = load i32, ptr %10, align 4, !tbaa !5
  %80 = icmp uge i32 %78, %79
  br i1 %80, label %81, label %82

81:                                               ; preds = %77
  store i32 5, ptr %23, align 4
  br label %83

82:                                               ; preds = %77
  store i32 0, ptr %23, align 4
  br label %83

83:                                               ; preds = %82, %81, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  %84 = load i32, ptr %23, align 4
  switch i32 %84, label %208 [
    i32 0, label %85
    i32 5, label %86
  ]

85:                                               ; preds = %83
  br label %44

86:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #4
  %87 = load ptr, ptr %7, align 8, !tbaa !9
  call void @framesync64_get_framedatastats(ptr dead_on_unwind writable sret(%struct.framedatastats_s) align 8 %24, ptr noundef %87)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #4
  %88 = load i32, ptr %19, align 4, !tbaa !5
  %89 = getelementptr inbounds %struct.framedatastats_s, ptr %24, i32 0, i32 2
  %90 = load i32, ptr %89, align 8, !tbaa !15
  %91 = sub i32 %88, %90
  %92 = uitofp i32 %91 to float
  %93 = load i32, ptr %19, align 4, !tbaa !5
  %94 = uitofp i32 %93 to float
  %95 = fdiv float %92, %94
  store float %95, ptr %25, align 4, !tbaa !11
  %96 = load float, ptr %25, align 4, !tbaa !11
  %97 = load float, ptr %11, align 4, !tbaa !11
  %98 = fcmp oge float %96, %97
  br i1 %98, label %99, label %102

99:                                               ; preds = %86
  %100 = load float, ptr %25, align 4, !tbaa !11
  store float %100, ptr %14, align 4, !tbaa !11
  %101 = load float, ptr %13, align 4, !tbaa !11
  store float %101, ptr %16, align 4, !tbaa !11
  br label %109

102:                                              ; preds = %86
  %103 = load float, ptr %15, align 4, !tbaa !11
  %104 = fcmp olt float %103, 0.000000e+00
  br i1 %104, label %105, label %108

105:                                              ; preds = %102
  %106 = load float, ptr %25, align 4, !tbaa !11
  store float %106, ptr %15, align 4, !tbaa !11
  %107 = load float, ptr %13, align 4, !tbaa !11
  store float %107, ptr %17, align 4, !tbaa !11
  br label %108

108:                                              ; preds = %105, %102
  br label %109

109:                                              ; preds = %108, %99
  %110 = load float, ptr %13, align 4, !tbaa !11
  %111 = fpext float %110 to double
  %112 = getelementptr inbounds %struct.framedatastats_s, ptr %24, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !18
  %114 = getelementptr inbounds %struct.framedatastats_s, ptr %24, i32 0, i32 2
  %115 = load i32, ptr %114, align 8, !tbaa !15
  %116 = load i32, ptr %19, align 4, !tbaa !5
  %117 = load float, ptr %25, align 4, !tbaa !11
  %118 = fpext float %117 to double
  %119 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, double noundef %111, i32 noundef %113, i32 noundef %115, i32 noundef %116, double noundef %118)
  %120 = load ptr, ptr %18, align 8, !tbaa !9
  %121 = load float, ptr %13, align 4, !tbaa !11
  %122 = fpext float %121 to double
  %123 = getelementptr inbounds %struct.framedatastats_s, ptr %24, i32 0, i32 0
  %124 = load i32, ptr %123, align 8, !tbaa !18
  %125 = uitofp i32 %124 to float
  %126 = load i32, ptr %19, align 4, !tbaa !5
  %127 = uitofp i32 %126 to float
  %128 = fdiv float %125, %127
  %129 = fpext float %128 to double
  %130 = getelementptr inbounds %struct.framedatastats_s, ptr %24, i32 0, i32 2
  %131 = load i32, ptr %130, align 8, !tbaa !15
  %132 = uitofp i32 %131 to float
  %133 = load i32, ptr %19, align 4, !tbaa !5
  %134 = uitofp i32 %133 to float
  %135 = fdiv float %132, %134
  %136 = fpext float %135 to double
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.12, double noundef %122, double noundef %129, double noundef %136) #4
  %138 = load i32, ptr %20, align 4, !tbaa !5
  %139 = load i32, ptr %8, align 4, !tbaa !5
  %140 = icmp ult i32 %138, %139
  br i1 %140, label %141, label %142

141:                                              ; preds = %109
  store i32 3, ptr %23, align 4
  br label %145

142:                                              ; preds = %109
  %143 = load float, ptr %13, align 4, !tbaa !11
  %144 = fadd float %143, 5.000000e-01
  store float %144, ptr %13, align 4, !tbaa !11
  store i32 0, ptr %23, align 4
  br label %145

145:                                              ; preds = %142, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  %146 = load i32, ptr %23, align 4
  switch i32 %146, label %208 [
    i32 0, label %147
    i32 3, label %148
  ]

147:                                              ; preds = %145
  br label %38, !llvm.loop !19

148:                                              ; preds = %145, %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #4
  %149 = load float, ptr %15, align 4, !tbaa !11
  %150 = call float @logf(float noundef %149) #4
  %151 = load float, ptr %14, align 4, !tbaa !11
  %152 = call float @logf(float noundef %151) #4
  %153 = fsub float %150, %152
  %154 = load float, ptr %17, align 4, !tbaa !11
  %155 = load float, ptr %16, align 4, !tbaa !11
  %156 = fsub float %154, %155
  %157 = fdiv float %153, %156
  store float %157, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %158 = load float, ptr %16, align 4, !tbaa !11
  %159 = load float, ptr %11, align 4, !tbaa !11
  %160 = call float @logf(float noundef %159) #4
  %161 = load float, ptr %14, align 4, !tbaa !11
  %162 = call float @logf(float noundef %161) #4
  %163 = fsub float %160, %162
  %164 = load float, ptr %26, align 4, !tbaa !11
  %165 = fdiv float %163, %164
  %166 = fadd float %158, %165
  store float %166, ptr %27, align 4, !tbaa !11
  %167 = load float, ptr %14, align 4, !tbaa !11
  %168 = fpext float %167 to double
  %169 = load float, ptr %15, align 4, !tbaa !11
  %170 = fpext float %169 to double
  %171 = load float, ptr %16, align 4, !tbaa !11
  %172 = fpext float %171 to double
  %173 = load float, ptr %17, align 4, !tbaa !11
  %174 = fpext float %173 to double
  %175 = load float, ptr %27, align 4, !tbaa !11
  %176 = fpext float %175 to double
  %177 = load float, ptr %11, align 4, !tbaa !11
  %178 = fpext float %177 to double
  %179 = call i32 (ptr, ...) @printf(ptr noundef @.str.13, double noundef %168, double noundef %170, double noundef %172, double noundef %174, double noundef %176, double noundef %178)
  %180 = load ptr, ptr %18, align 8, !tbaa !9
  %181 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %180, ptr noundef @.str.14) #4
  %182 = load ptr, ptr %18, align 8, !tbaa !9
  %183 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %182, ptr noundef @.str.15) #4
  %184 = load ptr, ptr %18, align 8, !tbaa !9
  %185 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %184, ptr noundef @.str.16) #4
  %186 = load ptr, ptr %18, align 8, !tbaa !9
  %187 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %186, ptr noundef @.str.17) #4
  %188 = load ptr, ptr %18, align 8, !tbaa !9
  %189 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %188, ptr noundef @.str.18) #4
  %190 = load ptr, ptr %18, align 8, !tbaa !9
  %191 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %190, ptr noundef @.str.19) #4
  %192 = load ptr, ptr %18, align 8, !tbaa !9
  %193 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %192, ptr noundef @.str.20) #4
  %194 = load ptr, ptr %18, align 8, !tbaa !9
  %195 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %194, ptr noundef @.str.21) #4
  %196 = load ptr, ptr %18, align 8, !tbaa !9
  %197 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %196, ptr noundef @.str.22) #4
  %198 = load ptr, ptr %18, align 8, !tbaa !9
  %199 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %198, ptr noundef @.str.23) #4
  %200 = load ptr, ptr %18, align 8, !tbaa !9
  %201 = call i32 @fclose(ptr noundef %200)
  %202 = call i32 (ptr, ...) @printf(ptr noundef @.str.24, ptr noundef @.str)
  %203 = load ptr, ptr %6, align 8, !tbaa !9
  %204 = call i32 @framegen64_destroy(ptr noundef %203)
  %205 = load ptr, ptr %7, align 8, !tbaa !9
  %206 = call i32 @framesync64_destroy(ptr noundef %205)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %23, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 11520, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %207 = load i32, ptr %3, align 4
  ret i32 %207

208:                                              ; preds = %145, %83
  unreachable
}

declare ptr @framegen64_create(...) #2

declare ptr @framesync64_create(ptr noundef, ptr noundef) #2

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

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

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

declare i32 @framesync64_reset_framedatastats(ptr noundef) #2

declare i32 @framesync64_reset(ptr noundef) #2

declare i32 @framegen64_execute(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

declare i32 @framesync64_execute(ptr noundef, ptr noundef, i32 noundef) #2

declare void @framesync64_get_framedatastats(ptr dead_on_unwind writable sret(%struct.framedatastats_s) align 8, ptr noundef) #2

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

declare i32 @fclose(ptr noundef) #2

declare i32 @framegen64_destroy(ptr noundef) #2

declare i32 @framesync64_destroy(ptr noundef) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 = { 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 = !{!16, !6, i64 8}
!16 = !{!"", !6, i64 0, !6, i64 4, !6, i64 8, !17, i64 16}
!17 = !{!"long", !7, i64 0}
!18 = !{!16, !6, i64 0}
!19 = distinct !{!19, !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"

%struct.framedatastats_s = type { i32, i32, i32, i64 }

@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [66 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [69 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [23 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @frame64_add_noise(ptr noundef, float noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [1440 x { float, float }], align 16
  %4 = alloca %struct.framedatastats_s, align 8
  %5 = alloca %struct.framedatastats_s, align 8
  %6 = tail call ptr (...) @framegen64_create() #5
  %7 = tail call ptr @framesync64_create(ptr noundef null, ptr noundef null) #5
  call void @llvm.lifetime.start.p0(i64 11520, ptr nonnull %3) #5
  %8 = tail call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %9 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str) #5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.3) #5
  %11 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.4) #5
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.10)
  %13 = getelementptr inbounds i8, ptr %4, i64 8
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  br label %15

15:                                               ; preds = %41, %2
  %.081 = phi float [ 0.000000e+00, %2 ], [ %.182, %41 ]
  %.078 = phi float [ 0.000000e+00, %2 ], [ %.179, %41 ]
  %.075 = phi float [ -1.000000e+00, %2 ], [ %.176, %41 ]
  %.069 = phi float [ -1.000000e+00, %2 ], [ %.170, %41 ]
  %.0 = phi float [ -3.000000e+00, %2 ], [ %55, %41 ]
  %16 = fcmp olt float %.0, 1.000000e+01
  br i1 %16, label %17, label %56

17:                                               ; preds = %15
  %18 = call i32 @framesync64_reset_framedatastats(ptr noundef %7) #5
  br label %19

19:                                               ; preds = %25, %17
  %.074 = phi i32 [ 0, %17 ], [ %26, %25 ]
  br label %20

20:                                               ; preds = %19, %20
  %.07389 = phi i32 [ 0, %19 ], [ %24, %20 ]
  %21 = call i32 @framesync64_reset(ptr noundef %7) #5
  %22 = call i32 @framegen64_execute(ptr noundef %6, ptr noundef null, ptr noundef null, ptr noundef nonnull %3) #5
  call void @frame64_add_noise(ptr noundef nonnull %3, float noundef %.0)
  %23 = call i32 @framesync64_execute(ptr noundef %7, ptr noundef nonnull %3, i32 noundef 1440) #5
  %24 = add nuw nsw i32 %.07389, 1
  %exitcond.not = icmp eq i32 %24, 500
  br i1 %exitcond.not, label %25, label %20, !llvm.loop !5

25:                                               ; preds = %20
  %26 = add nuw nsw i32 %.074, 500
  call void @framesync64_get_framedatastats(ptr dead_on_unwind nonnull writable sret(%struct.framedatastats_s) align 8 %4, ptr noundef %7) #5
  %27 = load i32, ptr %13, align 8, !tbaa !7
  %28 = sub i32 %26, %27
  %29 = icmp ult i32 %28, 50
  %30 = icmp ult i32 %.074, 4500
  %.not87 = and i1 %30, %29
  br i1 %.not87, label %19, label %31

31:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @framesync64_get_framedatastats(ptr dead_on_unwind nonnull writable sret(%struct.framedatastats_s) align 8 %5, ptr noundef %7) #5
  %32 = load i32, ptr %14, align 8, !tbaa !7
  %33 = sub i32 %26, %32
  %34 = uitofp i32 %33 to float
  %35 = uitofp nneg i32 %26 to float
  %36 = fdiv float %34, %35
  %37 = fcmp ult float %36, 0x3F847AE140000000
  br i1 %37, label %38, label %41

38:                                               ; preds = %31
  %39 = fcmp olt float %.075, 0.000000e+00
  br i1 %39, label %40, label %41

40:                                               ; preds = %38
  br label %41

41:                                               ; preds = %31, %38, %40
  %.182 = phi float [ %.081, %40 ], [ %.081, %38 ], [ %.0, %31 ]
  %.179 = phi float [ %.0, %40 ], [ %.078, %38 ], [ %.078, %31 ]
  %.176 = phi float [ %36, %40 ], [ %.075, %38 ], [ %.075, %31 ]
  %.170 = phi float [ %.069, %40 ], [ %.069, %38 ], [ %36, %31 ]
  %42 = fpext float %.0 to double
  %43 = load i32, ptr %5, align 8, !tbaa !13
  %44 = fpext float %36 to double
  %45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, double noundef %42, i32 noundef %43, i32 noundef %32, i32 noundef %26, double noundef %44)
  %46 = load i32, ptr %5, align 8, !tbaa !13
  %47 = uitofp i32 %46 to float
  %48 = fdiv float %47, %35
  %49 = fpext float %48 to double
  %50 = load i32, ptr %14, align 8, !tbaa !7
  %51 = uitofp i32 %50 to float
  %52 = fdiv float %51, %35
  %53 = fpext float %52 to double
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.12, double noundef %42, double noundef %49, double noundef %53) #5
  %55 = fadd float %.0, 5.000000e-01
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  br i1 %29, label %56, label %15

56:                                               ; preds = %41, %15
  %.283 = phi float [ %.182, %41 ], [ %.081, %15 ]
  %.280 = phi float [ %.179, %41 ], [ %.078, %15 ]
  %.277 = phi float [ %.176, %41 ], [ %.075, %15 ]
  %.2 = phi float [ %.170, %41 ], [ %.069, %15 ]
  %57 = call float @logf(float noundef %.277) #5
  %58 = call float @logf(float noundef %.2) #5
  %59 = fsub float %57, %58
  %60 = fsub float %.280, %.283
  %61 = fdiv float %59, %60
  %62 = call float @logf(float noundef %.2) #5
  %63 = fsub float 0xC0126BB1C0000000, %62
  %64 = fdiv float %63, %61
  %65 = fadd float %.283, %64
  %66 = fpext float %.2 to double
  %67 = fpext float %.277 to double
  %68 = fpext float %.283 to double
  %69 = fpext float %.280 to double
  %70 = fpext float %65 to double
  %71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13, double noundef %66, double noundef %67, double noundef %68, double noundef %69, double noundef %70, double noundef 0x3F847AE140000000)
  %72 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.14) #5
  %73 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.15) #5
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.16) #5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.17) #5
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.18) #5
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.19) #5
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.20) #5
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.21) #5
  %80 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.22) #5
  %81 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str.23) #5
  %82 = call i32 @fclose(ptr noundef %8)
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24, ptr noundef nonnull @.str)
  %84 = call i32 @framegen64_destroy(ptr noundef %6) #5
  %85 = call i32 @framesync64_destroy(ptr noundef %7) #5
  call void @llvm.lifetime.end.p0(i64 11520, ptr nonnull %3) #5
  ret i32 0
}

declare ptr @framegen64_create(...) local_unnamed_addr #2

declare ptr @framesync64_create(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

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

declare i32 @framesync64_reset_framedatastats(ptr noundef) local_unnamed_addr #2

declare i32 @framesync64_reset(ptr noundef) local_unnamed_addr #2

declare i32 @framegen64_execute(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @framesync64_execute(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @framesync64_get_framedatastats(ptr dead_on_unwind writable sret(%struct.framedatastats_s) align 8, ptr noundef) local_unnamed_addr #2

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

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

declare i32 @framegen64_destroy(ptr noundef) local_unnamed_addr #2

declare i32 @framesync64_destroy(ptr noundef) local_unnamed_addr #2

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { 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 #4 = { 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 #5 = { nounwind }

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

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


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