; LLVM IR from TobiasKozel/VAE :: external/portaudio/qa (paqa_latency)

; 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.PaStreamParameters = type { i32, i32, i64, double, ptr }
%struct.paTestData = type { [200 x float], i32, i32, [20 x i8], i32, i32, i32, double, double, %struct.PaStreamCallbackTimeInfo }
%struct.PaStreamCallbackTimeInfo = type { double, double, double }
%struct.PaDeviceInfo = type { i32, ptr, i32, i32, i32, double, double, double, double, double }
%struct.PaHostApiInfo = type { i32, i32, ptr, i32, i32, i32 }

@.str.10 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [44 x i8], align 1
@stderr = external global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @paqaCheckLatency(ptr noundef, ptr noundef, double noundef, i64 noundef) #0

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

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

; 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() #0 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.PaStreamParameters, align 8
  %3 = alloca i32, align 4
  %4 = alloca %struct.paTestData, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 880, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store double 4.410000e+04, ptr %8, align 8, !tbaa !5
  %10 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %26, %0
  %12 = load i32, ptr %6, align 4, !tbaa !9
  %13 = icmp slt i32 %12, 200
  br i1 %13, label %14, label %29

14:                                               ; preds = %11
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = sitofp i32 %15 to double
  %17 = fdiv double %16, 2.000000e+02
  %18 = fmul double %17, 0x400921FB54442D18
  %19 = fmul double %18, 2.000000e+00
  %20 = call double @sin(double noundef %19) #4
  %21 = fptrunc double %20 to float
  %22 = getelementptr inbounds %struct.paTestData, ptr %4, i32 0, i32 0
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [200 x float], ptr %22, i64 0, i64 %24
  store float %21, ptr %25, align 4, !tbaa !11
  br label %26

26:                                               ; preds = %14
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr %6, align 4, !tbaa !9
  br label %11, !llvm.loop !13

29:                                               ; preds = %11
  %30 = getelementptr inbounds %struct.paTestData, ptr %4, i32 0, i32 2
  store i32 0, ptr %30, align 4, !tbaa !15
  %31 = getelementptr inbounds %struct.paTestData, ptr %4, i32 0, i32 1
  store i32 0, ptr %31, align 8, !tbaa !18
  %32 = call i32 @Pa_Initialize()
  store i32 %32, ptr %3, align 4, !tbaa !9
  %33 = load i32, ptr %3, align 4, !tbaa !9
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %36

35:                                               ; preds = %29
  br label %174

36:                                               ; preds = %29
  %37 = call i32 @paqaVerifyDeviceInfoLatency()
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %39, label %40

39:                                               ; preds = %36
  br label %174

40:                                               ; preds = %36
  %41 = call i32 @paqaVerifySuggestedLatency()
  %42 = icmp slt i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %40
  br label %174

44:                                               ; preds = %40
  %45 = call i32 @Pa_GetDefaultOutputDevice()
  %46 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 0
  store i32 %45, ptr %46, align 8, !tbaa !19
  %47 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 0
  %48 = load i32, ptr %47, align 8, !tbaa !19
  %49 = icmp eq i32 %48, -1
  br i1 %49, label %50, label %53

50:                                               ; preds = %44
  %51 = load ptr, ptr @stderr, align 8, !tbaa !23
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef @.str.12) #4
  br label %174

53:                                               ; preds = %44
  %54 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  %55 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %56 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 1
  store i32 2, ptr %56, align 4, !tbaa !24
  %57 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 2
  store i64 1, ptr %57, align 8, !tbaa !25
  %58 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 0
  %59 = load i32, ptr %58, align 8, !tbaa !19
  %60 = call ptr @Pa_GetDeviceInfo(i32 noundef %59)
  store ptr %60, ptr %5, align 8, !tbaa !23
  %61 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 0
  %62 = load i32, ptr %61, align 8, !tbaa !19
  %63 = load ptr, ptr %5, align 8, !tbaa !23
  %64 = getelementptr inbounds %struct.PaDeviceInfo, ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !26
  %66 = load ptr, ptr %5, align 8, !tbaa !23
  %67 = getelementptr inbounds %struct.PaDeviceInfo, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !28
  %69 = call ptr @Pa_GetHostApiInfo(i32 noundef %68)
  %70 = getelementptr inbounds %struct.PaHostApiInfo, ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !29
  %72 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %62, ptr noundef %65, ptr noundef %71)
  %73 = load ptr, ptr %5, align 8, !tbaa !23
  %74 = getelementptr inbounds %struct.PaDeviceInfo, ptr %73, i32 0, i32 6
  %75 = load double, ptr %74, align 8, !tbaa !31
  %76 = call i32 (ptr, ...) @printf(ptr noundef @.str.15, double noundef %75)
  %77 = load ptr, ptr %5, align 8, !tbaa !23
  %78 = getelementptr inbounds %struct.PaDeviceInfo, ptr %77, i32 0, i32 8
  %79 = load double, ptr %78, align 8, !tbaa !32
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.16, double noundef %79)
  %81 = load ptr, ptr %5, align 8, !tbaa !23
  %82 = getelementptr inbounds %struct.PaDeviceInfo, ptr %81, i32 0, i32 9
  %83 = load double, ptr %82, align 8, !tbaa !33
  store double %83, ptr %8, align 8, !tbaa !5
  %84 = load double, ptr %8, align 8, !tbaa !5
  %85 = call i32 (ptr, ...) @printf(ptr noundef @.str.17, double noundef %84)
  %86 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 4
  store ptr null, ptr %86, align 8, !tbaa !34
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  store i32 9, ptr %7, align 4, !tbaa !9
  %89 = load ptr, ptr %5, align 8, !tbaa !23
  %90 = getelementptr inbounds %struct.PaDeviceInfo, ptr %89, i32 0, i32 6
  %91 = load double, ptr %90, align 8, !tbaa !31
  %92 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 3
  store double %91, ptr %92, align 8, !tbaa !35
  %93 = load double, ptr %8, align 8, !tbaa !5
  %94 = load i32, ptr %7, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = call i32 @paqaCheckLatency(ptr noundef %2, ptr noundef %4, double noundef %93, i64 noundef %95)
  store i32 %96, ptr %3, align 4, !tbaa !9
  %97 = load i32, ptr %3, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %53
  br label %174

100:                                              ; preds = %53
  %101 = call i32 (ptr, ...) @printf(ptr noundef @.str.19)
  store i32 64, ptr %7, align 4, !tbaa !9
  %102 = load ptr, ptr %5, align 8, !tbaa !23
  %103 = getelementptr inbounds %struct.PaDeviceInfo, ptr %102, i32 0, i32 6
  %104 = load double, ptr %103, align 8, !tbaa !31
  %105 = fmul double %104, 1.100000e+00
  %106 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 3
  store double %105, ptr %106, align 8, !tbaa !35
  %107 = load double, ptr %8, align 8, !tbaa !5
  %108 = load i32, ptr %7, align 4, !tbaa !9
  %109 = sext i32 %108 to i64
  %110 = call i32 @paqaCheckLatency(ptr noundef %2, ptr noundef %4, double noundef %107, i64 noundef %109)
  store i32 %110, ptr %3, align 4, !tbaa !9
  %111 = load i32, ptr %3, align 4, !tbaa !9
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %114

113:                                              ; preds = %100
  br label %174

114:                                              ; preds = %100
  %115 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  store i32 16384, ptr %7, align 4, !tbaa !9
  %116 = load i32, ptr %7, align 4, !tbaa !9
  %117 = sitofp i32 %116 to double
  %118 = load double, ptr %8, align 8, !tbaa !5
  %119 = fdiv double %117, %118
  %120 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 3
  store double %119, ptr %120, align 8, !tbaa !35
  %121 = load double, ptr %8, align 8, !tbaa !5
  %122 = load i32, ptr %7, align 4, !tbaa !9
  %123 = sext i32 %122 to i64
  %124 = call i32 @paqaCheckLatency(ptr noundef %2, ptr noundef %4, double noundef %121, i64 noundef %123)
  store i32 %124, ptr %3, align 4, !tbaa !9
  %125 = load i32, ptr %3, align 4, !tbaa !9
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %128

127:                                              ; preds = %114
  br label %174

128:                                              ; preds = %114
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.21)
  %130 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 3
  store double 0.000000e+00, ptr %130, align 8, !tbaa !35
  %131 = load double, ptr %8, align 8, !tbaa !5
  %132 = call i32 @paqaCheckLatency(ptr noundef %2, ptr noundef %4, double noundef %131, i64 noundef 0)
  store i32 %132, ptr %3, align 4, !tbaa !9
  %133 = load i32, ptr %3, align 4, !tbaa !9
  %134 = icmp ne i32 %133, 0
  br i1 %134, label %135, label %136

135:                                              ; preds = %128
  br label %174

136:                                              ; preds = %128
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  %138 = load ptr, ptr %5, align 8, !tbaa !23
  %139 = getelementptr inbounds %struct.PaDeviceInfo, ptr %138, i32 0, i32 6
  %140 = load double, ptr %139, align 8, !tbaa !31
  %141 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 3
  store double %140, ptr %141, align 8, !tbaa !35
  %142 = load double, ptr %8, align 8, !tbaa !5
  %143 = call i32 @paqaCheckLatency(ptr noundef %2, ptr noundef %4, double noundef %142, i64 noundef 0)
  store i32 %143, ptr %3, align 4, !tbaa !9
  %144 = load i32, ptr %3, align 4, !tbaa !9
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %147

146:                                              ; preds = %136
  br label %174

147:                                              ; preds = %136
  %148 = call i32 (ptr, ...) @printf(ptr noundef @.str.23)
  %149 = load ptr, ptr %5, align 8, !tbaa !23
  %150 = getelementptr inbounds %struct.PaDeviceInfo, ptr %149, i32 0, i32 8
  %151 = load double, ptr %150, align 8, !tbaa !32
  %152 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 3
  store double %151, ptr %152, align 8, !tbaa !35
  %153 = load double, ptr %8, align 8, !tbaa !5
  %154 = call i32 @paqaCheckLatency(ptr noundef %2, ptr noundef %4, double noundef %153, i64 noundef 0)
  store i32 %154, ptr %3, align 4, !tbaa !9
  %155 = load i32, ptr %3, align 4, !tbaa !9
  %156 = icmp ne i32 %155, 0
  br i1 %156, label %157, label %158

157:                                              ; preds = %147
  br label %174

158:                                              ; preds = %147
  %159 = call i32 (ptr, ...) @printf(ptr noundef @.str.24)
  %160 = load ptr, ptr %5, align 8, !tbaa !23
  %161 = getelementptr inbounds %struct.PaDeviceInfo, ptr %160, i32 0, i32 8
  %162 = load double, ptr %161, align 8, !tbaa !32
  %163 = fmul double %162, 4.000000e+00
  %164 = getelementptr inbounds %struct.PaStreamParameters, ptr %2, i32 0, i32 3
  store double %163, ptr %164, align 8, !tbaa !35
  %165 = load double, ptr %8, align 8, !tbaa !5
  %166 = call i32 @paqaCheckLatency(ptr noundef %2, ptr noundef %4, double noundef %165, i64 noundef 0)
  store i32 %166, ptr %3, align 4, !tbaa !9
  %167 = load i32, ptr %3, align 4, !tbaa !9
  %168 = icmp ne i32 %167, 0
  br i1 %168, label %169, label %170

169:                                              ; preds = %158
  br label %174

170:                                              ; preds = %158
  %171 = call i32 @Pa_Terminate()
  %172 = call i32 (ptr, ...) @printf(ptr noundef @.str.25)
  %173 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %173, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %186

174:                                              ; preds = %169, %157, %146, %135, %127, %113, %99, %50, %43, %39, %35
  %175 = call i32 @Pa_Terminate()
  %176 = load ptr, ptr @stderr, align 8, !tbaa !23
  %177 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %176, ptr noundef @.str.26) #4
  %178 = load ptr, ptr @stderr, align 8, !tbaa !23
  %179 = load i32, ptr %3, align 4, !tbaa !9
  %180 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %178, ptr noundef @.str.27, i32 noundef %179) #4
  %181 = load ptr, ptr @stderr, align 8, !tbaa !23
  %182 = load i32, ptr %3, align 4, !tbaa !9
  %183 = call ptr @Pa_GetErrorText(i32 noundef %182)
  %184 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %181, ptr noundef @.str.28, ptr noundef %183) #4
  %185 = load i32, ptr %3, align 4, !tbaa !9
  store i32 %185, ptr %1, align 4
  store i32 1, ptr %9, align 4
  br label %186

186:                                              ; preds = %174, %170
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 880, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %2) #4
  %187 = load i32, ptr %1, align 4
  ret i32 %187
}

; Function Attrs: nounwind
declare double @sin(double noundef) #3

declare i32 @Pa_Initialize() #2

; Function Attrs: nounwind uwtable
declare hidden i32 @paqaVerifyDeviceInfoLatency() #0

; Function Attrs: nounwind uwtable
declare hidden i32 @paqaVerifySuggestedLatency() #0

declare i32 @Pa_GetDefaultOutputDevice() #2

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

declare ptr @Pa_GetDeviceInfo(i32 noundef) #2

declare ptr @Pa_GetHostApiInfo(i32 noundef) #2

declare i32 @Pa_Terminate() #2

declare ptr @Pa_GetErrorText(i32 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !10, i64 804}
!16 = !{!"", !7, i64 0, !10, i64 800, !10, i64 804, !7, i64 808, !10, i64 828, !10, i64 832, !10, i64 836, !6, i64 840, !6, i64 848, !17, i64 856}
!17 = !{!"PaStreamCallbackTimeInfo", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!16, !10, i64 800}
!19 = !{!20, !10, i64 0}
!20 = !{!"PaStreamParameters", !10, i64 0, !10, i64 4, !21, i64 8, !6, i64 16, !22, i64 24}
!21 = !{!"long", !7, i64 0}
!22 = !{!"any pointer", !7, i64 0}
!23 = !{!22, !22, i64 0}
!24 = !{!20, !10, i64 4}
!25 = !{!20, !21, i64 8}
!26 = !{!27, !22, i64 8}
!27 = !{!"PaDeviceInfo", !10, i64 0, !22, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64}
!28 = !{!27, !10, i64 16}
!29 = !{!30, !22, i64 8}
!30 = !{!"PaHostApiInfo", !10, i64 0, !10, i64 4, !22, i64 8, !10, i64 16, !10, i64 20, !10, i64 24}
!31 = !{!27, !6, i64 40}
!32 = !{!27, !6, i64 56}
!33 = !{!27, !6, i64 64}
!34 = !{!20, !22, i64 24}
!35 = !{!20, !6, i64 16}


; 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.PaStreamParameters = type { i32, i32, i64, double, ptr }
%struct.paTestData = type { [200 x float], i32, i32, [20 x i8], i32, i32, i32, double, double, %struct.PaStreamCallbackTimeInfo }
%struct.PaStreamCallbackTimeInfo = type { double, double, double }

@.str.10 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [44 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.12 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [67 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [19 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @paqaCheckLatency(ptr noundef, ptr noundef, double noundef, i64 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; 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 i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.PaStreamParameters, align 8
  %2 = alloca %struct.paTestData, align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 880, ptr nonnull %2) #5
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %4

4:                                                ; preds = %4, %0
  %indvars.iv = phi i64 [ 0, %0 ], [ %indvars.iv.next.1, %4 ]
  %5 = trunc nuw nsw i64 %indvars.iv to i32
  %6 = uitofp nneg i32 %5 to double
  %7 = fdiv double %6, 2.000000e+02
  %8 = fmul double %7, 0x400921FB54442D18
  %9 = fmul double %8, 2.000000e+00
  %10 = tail call double @sin(double noundef %9) #5
  %11 = fptrunc double %10 to float
  %12 = getelementptr inbounds [200 x float], ptr %2, i64 0, i64 %indvars.iv
  store float %11, ptr %12, align 8, !tbaa !5
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %13 = trunc nuw nsw i64 %indvars.iv.next to i32
  %14 = uitofp nneg i32 %13 to double
  %15 = fdiv double %14, 2.000000e+02
  %16 = fmul double %15, 0x400921FB54442D18
  %17 = fmul double %16, 2.000000e+00
  %18 = tail call double @sin(double noundef %17) #5
  %19 = fptrunc double %18 to float
  %20 = getelementptr inbounds [200 x float], ptr %2, i64 0, i64 %indvars.iv.next
  store float %19, ptr %20, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, 200
  br i1 %exitcond.not.1, label %21, label %4, !llvm.loop !9

21:                                               ; preds = %4
  %22 = getelementptr inbounds i8, ptr %2, i64 804
  store i32 0, ptr %22, align 4, !tbaa !11
  %23 = getelementptr inbounds i8, ptr %2, i64 800
  store i32 0, ptr %23, align 8, !tbaa !16
  %24 = tail call i32 @Pa_Initialize() #5
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %25, label %94

25:                                               ; preds = %21
  %26 = tail call i32 @paqaVerifyDeviceInfoLatency()
  %27 = icmp slt i32 %26, 0
  br i1 %27, label %94, label %28

28:                                               ; preds = %25
  %29 = tail call i32 @paqaVerifySuggestedLatency()
  %30 = icmp slt i32 %29, 0
  br i1 %30, label %94, label %31

31:                                               ; preds = %28
  %32 = tail call i32 @Pa_GetDefaultOutputDevice() #5
  store i32 %32, ptr %1, align 8, !tbaa !17
  %33 = icmp eq i32 %32, -1
  br i1 %33, label %34, label %37

34:                                               ; preds = %31
  %35 = load ptr, ptr @stderr, align 8, !tbaa !21
  %36 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %35, ptr noundef nonnull @.str.12) #6
  br label %94

37:                                               ; preds = %31
  %38 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %39 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %40 = getelementptr inbounds i8, ptr %1, i64 4
  store i32 2, ptr %40, align 4, !tbaa !22
  %41 = getelementptr inbounds i8, ptr %1, i64 8
  store i64 1, ptr %41, align 8, !tbaa !23
  %42 = tail call ptr @Pa_GetDeviceInfo(i32 noundef %32) #5
  %43 = getelementptr inbounds i8, ptr %42, i64 8
  %44 = load ptr, ptr %43, align 8, !tbaa !24
  %45 = getelementptr inbounds i8, ptr %42, i64 16
  %46 = load i32, ptr %45, align 8, !tbaa !26
  %47 = tail call ptr @Pa_GetHostApiInfo(i32 noundef %46) #5
  %48 = getelementptr inbounds i8, ptr %47, i64 8
  %49 = load ptr, ptr %48, align 8, !tbaa !27
  %50 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef %32, ptr noundef %44, ptr noundef %49)
  %51 = getelementptr inbounds i8, ptr %42, i64 40
  %52 = load double, ptr %51, align 8, !tbaa !29
  %53 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15, double noundef %52)
  %54 = getelementptr inbounds i8, ptr %42, i64 56
  %55 = load double, ptr %54, align 8, !tbaa !30
  %56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16, double noundef %55)
  %57 = getelementptr inbounds i8, ptr %42, i64 64
  %58 = load double, ptr %57, align 8, !tbaa !31
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17, double noundef %58)
  %60 = getelementptr inbounds i8, ptr %1, i64 24
  store ptr null, ptr %60, align 8, !tbaa !32
  %61 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  %62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  %63 = load double, ptr %51, align 8, !tbaa !29
  %64 = getelementptr inbounds i8, ptr %1, i64 16
  store double %63, ptr %64, align 8, !tbaa !33
  %65 = call i32 @paqaCheckLatency(ptr noundef nonnull %1, ptr noundef nonnull %2, double noundef %58, i64 noundef 9)
  %.not50 = icmp eq i32 %65, 0
  br i1 %.not50, label %66, label %94

66:                                               ; preds = %37
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19)
  %68 = load double, ptr %51, align 8, !tbaa !29
  %69 = fmul double %68, 1.100000e+00
  store double %69, ptr %64, align 8, !tbaa !33
  %70 = call i32 @paqaCheckLatency(ptr noundef nonnull %1, ptr noundef nonnull %2, double noundef %58, i64 noundef 64)
  %.not51 = icmp eq i32 %70, 0
  br i1 %.not51, label %71, label %94

71:                                               ; preds = %66
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %73 = fdiv double 1.638400e+04, %58
  store double %73, ptr %64, align 8, !tbaa !33
  %74 = call i32 @paqaCheckLatency(ptr noundef nonnull %1, ptr noundef nonnull %2, double noundef %58, i64 noundef 16384)
  %.not52 = icmp eq i32 %74, 0
  br i1 %.not52, label %75, label %94

75:                                               ; preds = %71
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21)
  store double 0.000000e+00, ptr %64, align 8, !tbaa !33
  %77 = call i32 @paqaCheckLatency(ptr noundef nonnull %1, ptr noundef nonnull %2, double noundef %58, i64 noundef 0)
  %.not53 = icmp eq i32 %77, 0
  br i1 %.not53, label %78, label %94

78:                                               ; preds = %75
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  %80 = load double, ptr %51, align 8, !tbaa !29
  store double %80, ptr %64, align 8, !tbaa !33
  %81 = call i32 @paqaCheckLatency(ptr noundef nonnull %1, ptr noundef nonnull %2, double noundef %58, i64 noundef 0)
  %.not54 = icmp eq i32 %81, 0
  br i1 %.not54, label %82, label %94

82:                                               ; preds = %78
  %83 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23)
  %84 = load double, ptr %54, align 8, !tbaa !30
  store double %84, ptr %64, align 8, !tbaa !33
  %85 = call i32 @paqaCheckLatency(ptr noundef nonnull %1, ptr noundef nonnull %2, double noundef %58, i64 noundef 0)
  %.not55 = icmp eq i32 %85, 0
  br i1 %.not55, label %86, label %94

86:                                               ; preds = %82
  %87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24)
  %88 = load double, ptr %54, align 8, !tbaa !30
  %89 = fmul double %88, 4.000000e+00
  store double %89, ptr %64, align 8, !tbaa !33
  %90 = call i32 @paqaCheckLatency(ptr noundef nonnull %1, ptr noundef nonnull %2, double noundef %58, i64 noundef 0)
  %.not56 = icmp eq i32 %90, 0
  br i1 %.not56, label %91, label %94

91:                                               ; preds = %86
  %92 = call i32 @Pa_Terminate() #5
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25)
  br label %103

94:                                               ; preds = %86, %82, %78, %75, %71, %66, %37, %28, %25, %21, %34
  %.040 = phi i32 [ %24, %21 ], [ 0, %25 ], [ 0, %28 ], [ 0, %34 ], [ %65, %37 ], [ %70, %66 ], [ %74, %71 ], [ %77, %75 ], [ %81, %78 ], [ %85, %82 ], [ %90, %86 ]
  %95 = call i32 @Pa_Terminate() #5
  %96 = load ptr, ptr @stderr, align 8, !tbaa !21
  %97 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %96, ptr noundef nonnull @.str.26) #6
  %98 = load ptr, ptr @stderr, align 8, !tbaa !21
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef nonnull @.str.27, i32 noundef %.040) #6
  %100 = load ptr, ptr @stderr, align 8, !tbaa !21
  %101 = call ptr @Pa_GetErrorText(i32 noundef %.040) #5
  %102 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef nonnull @.str.28, ptr noundef %101) #6
  br label %103

103:                                              ; preds = %94, %91
  %.039 = phi i32 [ %.040, %94 ], [ 0, %91 ]
  call void @llvm.lifetime.end.p0(i64 880, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  ret i32 %.039
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #3

declare i32 @Pa_Initialize() local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden i32 @paqaVerifyDeviceInfoLatency() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden i32 @paqaVerifySuggestedLatency() local_unnamed_addr #0

declare i32 @Pa_GetDefaultOutputDevice() local_unnamed_addr #4

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

declare ptr @Pa_GetDeviceInfo(i32 noundef) local_unnamed_addr #4

declare ptr @Pa_GetHostApiInfo(i32 noundef) local_unnamed_addr #4

declare i32 @Pa_Terminate() local_unnamed_addr #4

declare ptr @Pa_GetErrorText(i32 noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 }
attributes #6 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !13, i64 804}
!12 = !{!"", !7, i64 0, !13, i64 800, !13, i64 804, !7, i64 808, !13, i64 828, !13, i64 832, !13, i64 836, !14, i64 840, !14, i64 848, !15, i64 856}
!13 = !{!"int", !7, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = !{!"PaStreamCallbackTimeInfo", !14, i64 0, !14, i64 8, !14, i64 16}
!16 = !{!12, !13, i64 800}
!17 = !{!18, !13, i64 0}
!18 = !{!"PaStreamParameters", !13, i64 0, !13, i64 4, !19, i64 8, !14, i64 16, !20, i64 24}
!19 = !{!"long", !7, i64 0}
!20 = !{!"any pointer", !7, i64 0}
!21 = !{!20, !20, i64 0}
!22 = !{!18, !13, i64 4}
!23 = !{!18, !19, i64 8}
!24 = !{!25, !20, i64 8}
!25 = !{!"PaDeviceInfo", !13, i64 0, !20, i64 8, !13, i64 16, !13, i64 20, !13, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64}
!26 = !{!25, !13, i64 16}
!27 = !{!28, !20, i64 8}
!28 = !{!"PaHostApiInfo", !13, i64 0, !13, i64 4, !20, i64 8, !13, i64 16, !13, i64 20, !13, i64 24}
!29 = !{!25, !14, i64 40}
!30 = !{!25, !14, i64 56}
!31 = !{!25, !14, i64 64}
!32 = !{!18, !20, i64 24}
!33 = !{!18, !14, i64 16}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass