; LLVM IR from jgaeddert/liquid-dsp :: examples (gmskframesync_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.framesyncstats_s = type { float, float, float, ptr, i32, i32, i32, i32, i32, i32 }

@__const.main.header = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @callback(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.framesyncstats_s) align 8, ptr noundef) #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 i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca [8 x i8], align 1
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 2, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 3, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store float 5.000000e-01, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 40, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 6, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 6, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %14, ptr align 1 @__const.main.header, i64 8, i1 false)
  %22 = load i32, ptr %9, align 4, !tbaa !5
  %23 = zext i32 %22 to i64
  %24 = call ptr @llvm.stacksave.p0()
  store ptr %24, ptr %15, align 8
  %25 = alloca i8, i64 %23, align 16
  store i64 %23, ptr %16, align 8
  %26 = load i32, ptr %9, align 4, !tbaa !5
  %27 = zext i32 %26 to i64
  call void @llvm.memset.p0.i64(ptr align 16 %25, i8 0, i64 %27, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = load float, ptr %8, align 4, !tbaa !11
  %31 = call ptr @gmskframegen_create_set(i32 noundef %28, i32 noundef %29, float noundef %30)
  store ptr %31, ptr %17, align 8, !tbaa !9
  %32 = load ptr, ptr %17, align 8, !tbaa !9
  %33 = getelementptr inbounds [8 x i8], ptr %14, i64 0, i64 0
  %34 = load i32, ptr %9, align 4, !tbaa !5
  %35 = load i32, ptr %10, align 4, !tbaa !5
  %36 = load i32, ptr %11, align 4, !tbaa !5
  %37 = load i32, ptr %12, align 4, !tbaa !5
  %38 = call i32 @gmskframegen_assemble(ptr noundef %32, ptr noundef %33, ptr noundef %25, i32 noundef %34, i32 noundef %35, i32 noundef %36, i32 noundef %37)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %39 = load i32, ptr %6, align 4, !tbaa !5
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = load float, ptr %8, align 4, !tbaa !11
  %42 = call ptr @gmskframesync_create_set(i32 noundef %39, i32 noundef %40, float noundef %41, ptr noundef @callback, ptr noundef null)
  store ptr %42, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %43 = load ptr, ptr %17, align 8, !tbaa !9
  %44 = call i32 @gmskframegen_getframelen(ptr noundef %43)
  %45 = add i32 %44, 800
  store i32 %45, ptr %19, align 4, !tbaa !5
  %46 = load i32, ptr %19, align 4, !tbaa !5
  %47 = zext i32 %46 to i64
  %48 = alloca { float, float }, i64 %47, align 16
  store i64 %47, ptr %20, align 8
  %49 = load i32, ptr %19, align 4, !tbaa !5
  %50 = zext i32 %49 to i64
  %51 = mul i64 %50, 8
  call void @llvm.memset.p0.i64(ptr align 16 %48, i8 0, i64 %51, i1 false)
  %52 = load ptr, ptr %17, align 8, !tbaa !9
  %53 = getelementptr inbounds { float, float }, ptr %48, i64 250
  %54 = load i32, ptr %19, align 4, !tbaa !5
  %55 = sub i32 %54, 250
  %56 = call i32 @gmskframegen_write(ptr noundef %52, ptr noundef %53, i32 noundef %55)
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %93, %2
  %58 = load i32, ptr %13, align 4, !tbaa !5
  %59 = load i32, ptr %19, align 4, !tbaa !5
  %60 = icmp ult i32 %58, %59
  br i1 %60, label %61, label %96

61:                                               ; preds = %57
  %62 = load i32, ptr %13, align 4, !tbaa !5
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds { float, float }, ptr %48, i64 %63
  %65 = getelementptr inbounds { float, float }, ptr %64, i32 0, i32 0
  %66 = load float, ptr %65, align 8
  %67 = getelementptr inbounds { float, float }, ptr %64, i32 0, i32 1
  %68 = load float, ptr %67, align 4
  %69 = fpext float %66 to double
  %70 = fpext float %68 to double
  %71 = fmul double 3.000000e-01, %69
  %72 = fmul double 3.000000e-01, %70
  %73 = call float (...) @randnf()
  %74 = call float (...) @randnf()
  %75 = fmul float %74, 0.000000e+00
  %76 = fmul float %74, 1.000000e+00
  %77 = fadd float %73, %75
  %78 = fmul float 0x3F847AE140000000, %77
  %79 = fmul float 0x3F847AE140000000, %76
  %80 = fpext float %78 to double
  %81 = fpext float %79 to double
  %82 = fmul double %80, 0x3FE6A09E667F3BCD
  %83 = fmul double %81, 0x3FE6A09E667F3BCD
  %84 = fadd double %71, %82
  %85 = fadd double %72, %83
  %86 = fptrunc double %84 to float
  %87 = fptrunc double %85 to float
  %88 = load i32, ptr %13, align 4, !tbaa !5
  %89 = zext i32 %88 to i64
  %90 = getelementptr inbounds { float, float }, ptr %48, i64 %89
  %91 = getelementptr inbounds { float, float }, ptr %90, i32 0, i32 0
  %92 = getelementptr inbounds { float, float }, ptr %90, i32 0, i32 1
  store float %86, ptr %91, align 8
  store float %87, ptr %92, align 4
  br label %93

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

96:                                               ; preds = %57
  %97 = load ptr, ptr %18, align 8, !tbaa !9
  %98 = load i32, ptr %19, align 4, !tbaa !5
  %99 = call i32 @gmskframesync_execute(ptr noundef %97, ptr noundef %48, i32 noundef %98)
  %100 = load ptr, ptr %18, align 8, !tbaa !9
  %101 = call i32 @gmskframesync_print(ptr noundef %100)
  %102 = load ptr, ptr %17, align 8, !tbaa !9
  %103 = call i32 @gmskframegen_destroy(ptr noundef %102)
  %104 = load ptr, ptr %18, align 8, !tbaa !9
  %105 = call i32 @gmskframesync_destroy(ptr noundef %104)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  %106 = call noalias ptr @fopen(ptr noundef @.str.1, ptr noundef @.str.2)
  store ptr %106, ptr %21, align 8, !tbaa !9
  %107 = load ptr, ptr %21, align 8, !tbaa !9
  %108 = icmp eq ptr %107, null
  br i1 %108, label %109, label %115

109:                                              ; preds = %96
  %110 = load ptr, ptr @stderr, align 8, !tbaa !9
  %111 = load ptr, ptr %5, align 8, !tbaa !9
  %112 = getelementptr inbounds ptr, ptr %111, i64 0
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %110, ptr noundef @.str.3, ptr noundef %113, ptr noundef @.str.1) #8
  call void @exit(i32 noundef 1) #9
  unreachable

115:                                              ; preds = %96
  %116 = load ptr, ptr %21, align 8, !tbaa !9
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %116, ptr noundef @.str.4, ptr noundef @.str.1) #8
  %118 = load ptr, ptr %21, align 8, !tbaa !9
  %119 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.5) #8
  %120 = load ptr, ptr %21, align 8, !tbaa !9
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %120, ptr noundef @.str.6) #8
  %122 = load ptr, ptr %21, align 8, !tbaa !9
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef @.str.7) #8
  %124 = load ptr, ptr %21, align 8, !tbaa !9
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %124, ptr noundef @.str.5) #8
  %126 = load ptr, ptr %21, align 8, !tbaa !9
  %127 = load i32, ptr %19, align 4, !tbaa !5
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %126, ptr noundef @.str.8, i32 noundef %127) #8
  %129 = load ptr, ptr %21, align 8, !tbaa !9
  %130 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %129, ptr noundef @.str.9) #8
  %131 = load ptr, ptr %21, align 8, !tbaa !9
  %132 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %131, ptr noundef @.str.5) #8
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %158, %115
  %134 = load i32, ptr %13, align 4, !tbaa !5
  %135 = load i32, ptr %19, align 4, !tbaa !5
  %136 = icmp ult i32 %134, %135
  br i1 %136, label %137, label %161

137:                                              ; preds = %133
  %138 = load ptr, ptr %21, align 8, !tbaa !9
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = add i32 %139, 1
  %141 = load i32, ptr %13, align 4, !tbaa !5
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds { float, float }, ptr %48, i64 %142
  %144 = getelementptr inbounds { float, float }, ptr %143, i32 0, i32 0
  %145 = load float, ptr %144, align 8
  %146 = getelementptr inbounds { float, float }, ptr %143, i32 0, i32 1
  %147 = load float, ptr %146, align 4
  %148 = fpext float %145 to double
  %149 = load i32, ptr %13, align 4, !tbaa !5
  %150 = zext i32 %149 to i64
  %151 = getelementptr inbounds { float, float }, ptr %48, i64 %150
  %152 = getelementptr inbounds { float, float }, ptr %151, i32 0, i32 0
  %153 = load float, ptr %152, align 8
  %154 = getelementptr inbounds { float, float }, ptr %151, i32 0, i32 1
  %155 = load float, ptr %154, align 4
  %156 = fpext float %155 to double
  %157 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.10, i32 noundef %140, double noundef %148, double noundef %156) #8
  br label %158

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

161:                                              ; preds = %133
  %162 = load ptr, ptr %21, align 8, !tbaa !9
  %163 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %162, ptr noundef @.str.5) #8
  %164 = load ptr, ptr %21, align 8, !tbaa !9
  %165 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %164, ptr noundef @.str.11) #8
  %166 = load ptr, ptr %21, align 8, !tbaa !9
  %167 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %166, ptr noundef @.str.12) #8
  %168 = load ptr, ptr %21, align 8, !tbaa !9
  %169 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %168, ptr noundef @.str.13) #8
  %170 = load ptr, ptr %21, align 8, !tbaa !9
  %171 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %170, ptr noundef @.str.14) #8
  %172 = load ptr, ptr %21, align 8, !tbaa !9
  %173 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %172, ptr noundef @.str.15) #8
  %174 = load ptr, ptr %21, align 8, !tbaa !9
  %175 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %174, ptr noundef @.str.16) #8
  %176 = load ptr, ptr %21, align 8, !tbaa !9
  %177 = call i32 @fclose(ptr noundef %176)
  %178 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, ptr noundef @.str.1)
  store i32 0, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  %179 = load ptr, ptr %15, align 8
  call void @llvm.stackrestore.p0(ptr %179)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  %180 = load i32, ptr %3, align 4
  ret i32 %180
}

; 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: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

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

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

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

declare i32 @gmskframegen_getframelen(ptr noundef) #1

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

declare float @randnf(...) #1

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

declare i32 @gmskframesync_print(ptr noundef) #1

declare i32 @gmskframegen_destroy(ptr noundef) #1

declare i32 @gmskframesync_destroy(ptr noundef) #1

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

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

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

declare i32 @fclose(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) #4

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 = { nocallback nofree nosync nounwind willreturn }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind }
attributes #9 = { noreturn nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!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"

%struct.framesyncstats_s = type { float, float, float, ptr, i32, i32, i32, i32, i32, i32 }

@__const.main.header = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @callback(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef byval(%struct.framesyncstats_s) align 8, ptr noundef) #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 nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [8 x i8], align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %4 = load i64, ptr @__const.main.header, align 1
  store i64 %4, ptr %3, align 8
  %5 = tail call ptr @llvm.stacksave.p0()
  %6 = alloca [40 x i8], align 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %6, i8 0, i64 40, i1 false)
  %7 = tail call ptr @gmskframegen_create_set(i32 noundef 2, i32 noundef 3, float noundef 5.000000e-01) #7
  %8 = call i32 @gmskframegen_assemble(ptr noundef %7, ptr noundef nonnull %3, ptr noundef nonnull %6, i32 noundef 40, i32 noundef 6, i32 noundef 6, i32 noundef 1) #7
  %9 = call ptr @gmskframesync_create_set(i32 noundef 2, i32 noundef 3, float noundef 5.000000e-01, ptr noundef nonnull @callback, ptr noundef null) #7
  %10 = call i32 @gmskframegen_getframelen(ptr noundef %7) #7
  %11 = add i32 %10, 800
  %12 = zext i32 %11 to i64
  %13 = alloca { float, float }, i64 %12, align 16
  %14 = shl nuw nsw i64 %12, 3
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %13, i8 0, i64 %14, i1 false)
  %15 = getelementptr inbounds i8, ptr %13, i64 2000
  %16 = add i32 %10, 550
  %17 = call i32 @gmskframegen_write(ptr noundef %7, ptr noundef nonnull %15, i32 noundef %16) #7
  %.not = icmp eq i32 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %2 ]
  %18 = getelementptr inbounds { float, float }, ptr %13, i64 %indvars.iv
  %19 = load float, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr %18, i64 4
  %21 = load float, ptr %20, align 4
  %22 = call float (...) @randnf() #7
  %23 = call float (...) @randnf() #7
  %24 = fmul float %23, 0.000000e+00
  %25 = fadd float %22, %24
  %26 = fmul float %25, 0x3F847AE140000000
  %27 = fmul float %23, 0x3F847AE140000000
  %28 = insertelement <2 x float> poison, float %26, i64 0
  %29 = insertelement <2 x float> %28, float %21, i64 1
  %30 = fpext <2 x float> %29 to <2 x double>
  %31 = insertelement <2 x float> poison, float %19, i64 0
  %32 = insertelement <2 x float> %31, float %27, i64 1
  %33 = fpext <2 x float> %32 to <2 x double>
  %34 = fmul <2 x double> %30, <double 0x3FE6A09E667F3BCD, double 3.000000e-01>
  %35 = fmul <2 x double> %33, <double 3.000000e-01, double 0x3FE6A09E667F3BCD>
  %36 = fadd <2 x double> %34, %35
  %37 = fptrunc <2 x double> %36 to <2 x float>
  store <2 x float> %37, ptr %18, align 8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %12
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !5

._crit_edge:                                      ; preds = %.lr.ph, %2
  %38 = call i32 @gmskframesync_execute(ptr noundef %9, ptr noundef nonnull %13, i32 noundef %11) #7
  %39 = call i32 @gmskframesync_print(ptr noundef %9) #7
  %40 = call i32 @gmskframegen_destroy(ptr noundef %7) #7
  %41 = call i32 @gmskframesync_destroy(ptr noundef %9) #7
  %42 = call noalias ptr @fopen(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2)
  %43 = icmp eq ptr %42, null
  br i1 %43, label %44, label %48

44:                                               ; preds = %._crit_edge
  %45 = load ptr, ptr @stderr, align 8, !tbaa !7
  %46 = load ptr, ptr %1, align 8, !tbaa !7
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %45, ptr noundef nonnull @.str.3, ptr noundef %46, ptr noundef nonnull @.str.1) #8
  call void @exit(i32 noundef 1) #9
  unreachable

48:                                               ; preds = %._crit_edge
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.1) #7
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.5) #7
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.6) #7
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.7) #7
  %53 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.5) #7
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.8, i32 noundef %11) #7
  %55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.9) #7
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.5) #7
  br i1 %.not, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %48, %.lr.ph60
  %indvars.iv64 = phi i64 [ %indvars.iv.next65, %.lr.ph60 ], [ 0, %48 ]
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %57 = getelementptr inbounds { float, float }, ptr %13, i64 %indvars.iv64
  %58 = load float, ptr %57, align 8
  %59 = getelementptr inbounds i8, ptr %57, i64 4
  %60 = fpext float %58 to double
  %61 = load float, ptr %59, align 4
  %62 = fpext float %61 to double
  %63 = trunc nuw i64 %indvars.iv.next65 to i32
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.10, i32 noundef %63, double noundef %60, double noundef %62) #7
  %exitcond68.not = icmp eq i64 %indvars.iv.next65, %12
  br i1 %exitcond68.not, label %._crit_edge61, label %.lr.ph60, !llvm.loop !11

._crit_edge61:                                    ; preds = %.lr.ph60, %48
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.5) #7
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.11) #7
  %67 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.12) #7
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.13) #7
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.14) #7
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.15) #7
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %42, ptr noundef nonnull @.str.16) #7
  %72 = call i32 @fclose(ptr noundef nonnull %42)
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, ptr noundef nonnull @.str.1)
  call void @llvm.stackrestore.p0(ptr %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  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 nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare ptr @gmskframegen_create_set(i32 noundef, i32 noundef, float noundef) local_unnamed_addr #5

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

declare ptr @gmskframesync_create_set(i32 noundef, i32 noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

declare i32 @gmskframegen_getframelen(ptr noundef) local_unnamed_addr #5

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

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

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

declare i32 @gmskframesync_print(ptr noundef) local_unnamed_addr #5

declare i32 @gmskframegen_destroy(ptr noundef) local_unnamed_addr #5

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

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

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

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

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

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

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

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass