#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int rand();
int /*<<< orphan*/ runtest(int, double, double, int, int);
int main(int argc, char **argv) {
  int i, srclen, dstlen, ifreq;
  double factor;
  printf("\n*** Vary source block size*** \n\n");
  srclen = 10000;
  ifreq = 100;
  for (i = 0; i < 20; i++) {
    factor = ((rand() % 16) + 1) / 4.0;
    dstlen = (int)(srclen * factor + 10);
    runtest(srclen, (double)ifreq, factor, 64, dstlen);
    runtest(srclen, (double)ifreq, factor, 32, dstlen);
    runtest(srclen, (double)ifreq, factor, 8, dstlen);
    runtest(srclen, (double)ifreq, factor, 2, dstlen);
    runtest(srclen, (double)ifreq, factor, srclen, dstlen);
  }
  printf("\n*** Vary dest block size ***\n\n");
  srclen = 10000;
  ifreq = 100;
  for (i = 0; i < 20; i++) {
    factor = ((rand() % 16) + 1) / 4.0;
    runtest(srclen, (double)ifreq, factor, srclen, 32);
    dstlen = (int)(srclen * factor + 10);
    runtest(srclen, (double)ifreq, factor, srclen, dstlen);
  }
  printf("\n*** Resample factor 1.0, testing different srclen ***\n\n");
  ifreq = 40;
  for (i = 0; i < 100; i++) {
    srclen = (rand() % 30000) + 10;
    dstlen = (int)(srclen + 10);
    runtest(srclen, (double)ifreq, 1.0, srclen, dstlen);
  }
  printf("\n*** Resample factor 1.0, testing different sin freq ***\n\n");
  srclen = 10000;
  for (i = 0; i < 100; i++) {
    ifreq = ((int)rand() % 10000) + 1;
    dstlen = (int)(srclen * 10);
    runtest(srclen, (double)ifreq, 1.0, srclen, dstlen);
  }
  printf("\n*** Resample with different factors ***\n\n");
  srclen = 10000;
  ifreq = 100;
  for (i = 0; i < 100; i++) {
    factor = ((rand() % 64) + 1) / 4.0;
    dstlen = (int)(srclen * factor + 10);
    runtest(srclen, (double)ifreq, factor, srclen, dstlen);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2710,-0x18(%rbp)
movl   $0x64,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    1247 <main+0x117>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cvtsi2sd %edx,%xmm0
movsd  0xe79(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe52(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x1c(%rbp),%edx
mov    $0x40,%esi
call   1040 <runtest@plt>
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x1c(%rbp),%edx
mov    $0x20,%esi
call   1040 <runtest@plt>
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x1c(%rbp),%edx
mov    $0x8,%esi
call   1040 <runtest@plt>
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x1c(%rbp),%edx
mov    $0x2,%esi
call   1040 <runtest@plt>
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <runtest@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1167 <main+0x37>
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2710,-0x18(%rbp)
movl   $0x64,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x14,-0x14(%rbp)
jge    12fa <main+0x1ca>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x10,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cvtsi2sd %edx,%xmm0
movsd  0xd78(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x18(%rbp),%esi
mov    $0x20,%edx
call   1040 <runtest@plt>
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd37(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <runtest@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1268 <main+0x138>
lea    0xd59(%rip),%rdi
call   1030 <printf@plt>
movl   $0x28,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1365 <main+0x235>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x7530,%ecx
cltd
idiv   %ecx
add    $0xa,%edx
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
movsd  0xcbe(%rip),%xmm1
call   1040 <runtest@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1314 <main+0x1e4>
lea    0xd27(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2710,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    13ce <main+0x29e>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x2710,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
imul   $0xa,-0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
movsd  0xc55(%rip),%xmm1
call   1040 <runtest@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    137f <main+0x24f>
lea    0xcf9(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2710,-0x18(%rbp)
movl   $0x64,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1467 <main+0x337>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
cvtsi2sd %edx,%xmm0
movsd  0xbf1(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xbca(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%edi
cvtsi2sdl -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1040 <runtest@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13ef <main+0x2bf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
mov    $0x14,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1050 <rand@plt>
lea    0xf(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff0,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xe88(%rip),%xmm1
movapd %xmm1,%xmm0
movsd  %xmm1,(%rsp)
mulsd  0xe7f(%rip),%xmm0
addsd  0xe7f(%rip),%xmm0
cvttsd2si %xmm0,%ebx
mov    $0x2710,%edi
movsd  0xe76(%rip),%xmm0
mov    $0x40,%esi
mov    %ebx,%edx
call   1040 <runtest@plt>
mov    $0x2710,%edi
movsd  0xe5d(%rip),%xmm0
movsd  (%rsp),%xmm1
mov    $0x20,%esi
mov    %ebx,%edx
call   1040 <runtest@plt>
mov    $0x2710,%edi
movsd  0xe3f(%rip),%xmm0
movsd  (%rsp),%xmm1
mov    $0x8,%esi
mov    %ebx,%edx
call   1040 <runtest@plt>
mov    $0x2710,%edi
movsd  0xe21(%rip),%xmm0
movsd  (%rsp),%xmm1
mov    $0x2,%esi
mov    %ebx,%edx
call   1040 <runtest@plt>
mov    $0x2710,%edi
movsd  0xe03(%rip),%xmm0
movsd  (%rsp),%xmm1
mov    $0x2710,%esi
mov    %ebx,%edx
call   1040 <runtest@plt>
add    $0xffffffff,%ebp
jne    1150 <main+0x20>
lea    0xe1b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x14,%ebx
xor    %eax,%eax
call   1050 <rand@plt>
lea    0xf(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffff0,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xd98(%rip),%xmm1
movsd  %xmm1,(%rsp)
mov    $0x2710,%edi
movsd  0xd9e(%rip),%xmm0
mov    $0x2710,%esi
mov    $0x20,%edx
call   1040 <runtest@plt>
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  0xd6e(%rip),%xmm0
addsd  0xd6e(%rip),%xmm0
cvttsd2si %xmm0,%edx
mov    $0x2710,%edi
movsd  0xd65(%rip),%xmm0
mov    $0x2710,%esi
call   1040 <runtest@plt>
add    $0xffffffff,%ebx
jne    1240 <main+0x110>
lea    0xda3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x45e7b273,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
imul   $0x7530,%ecx,%ecx
mov    %eax,%edi
sub    %ecx,%edi
add    $0xa,%edi
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x14,%edx
movsd  0xd06(%rip),%xmm0
movsd  0xd06(%rip),%xmm1
mov    %edi,%esi
call   1040 <runtest@plt>
add    $0xffffffff,%ebx
jne    12e0 <main+0x1b0>
lea    0xd73(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%ebx
nop
xor    %eax,%eax
call   1050 <rand@plt>
cltq
imul   $0x68db8bad,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2c,%rcx
add    %edx,%ecx
imul   $0x2710,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mov    $0x2710,%edi
movsd  0xcaa(%rip),%xmm1
mov    $0x2710,%esi
mov    $0x186a0,%edx
call   1040 <runtest@plt>
add    $0xffffffff,%ebx
jne    1340 <main+0x210>
lea    0xd49(%rip),%rdi
call   1030 <puts@plt>
mov    $0x64,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1050 <rand@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xc28(%rip),%xmm1
movapd %xmm1,%xmm0
mulsd  0xc24(%rip),%xmm0
addsd  0xc24(%rip),%xmm0
cvttsd2si %xmm0,%edx
mov    $0x2710,%edi
movsd  0xc1b(%rip),%xmm0
mov    $0x2710,%esi
call   1040 <runtest@plt>
add    $0xffffffff,%ebx
jne    13b0 <main+0x280>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"\0A*** Vary source block size*** \0A\0A\00"
@.str.1 = [32 x i8] c"\0A*** Vary dest block size ***\0A\0A\00"
@.str.2 = [57 x i8] c"\0A*** Resample factor 1.0, testing different srclen ***\0A\0A\00"
@.str.3 = [59 x i8] c"\0A*** Resample factor 1.0, testing different sin freq ***\0A\0A\00"
@.str.4 = [43 x i8] c"\0A*** Resample with different factors ***\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 10000, i32* %7
store i32 100, i32* %9
store i32 0, i32* %6
br label %12
12: ; preds = %57, %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 20
br i1 %14, label %15, label %60
15: ; preds = %12
%16 = call i32 (...) @rand()
%17 = srem i32 %16, 16
%18 = add nsw i32 %17, 1
%19 = sitofp i32 %18 to double
%20 = fdiv double %19, 4.000000e+00
store double %20, double* %10
%21 = load i32, i32* %7
%22 = sitofp i32 %21 to double
%23 = load double, double* %10
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double 1.000000e+01)
%25 = fptosi double %24 to i32
store i32 %25, i32* %8
%26 = load i32, i32* %7
%27 = load i32, i32* %9
%28 = sitofp i32 %27 to double
%29 = load double, double* %10
%30 = load i32, i32* %8
%31 = call i32 @runtest(i32 %26, double %28, double %29, i32 64, i32 %30)
%32 = load i32, i32* %7
%33 = load i32, i32* %9
%34 = sitofp i32 %33 to double
%35 = load double, double* %10
%36 = load i32, i32* %8
%37 = call i32 @runtest(i32 %32, double %34, double %35, i32 32, i32 %36)
%38 = load i32, i32* %7
%39 = load i32, i32* %9
%40 = sitofp i32 %39 to double
%41 = load double, double* %10
%42 = load i32, i32* %8
%43 = call i32 @runtest(i32 %38, double %40, double %41, i32 8, i32 %42)
%44 = load i32, i32* %7
%45 = load i32, i32* %9
%46 = sitofp i32 %45 to double
%47 = load double, double* %10
%48 = load i32, i32* %8
%49 = call i32 @runtest(i32 %44, double %46, double %47, i32 2, i32 %48)
%50 = load i32, i32* %7
%51 = load i32, i32* %9
%52 = sitofp i32 %51 to double
%53 = load double, double* %10
%54 = load i32, i32* %7
%55 = load i32, i32* %8
%56 = call i32 @runtest(i32 %50, double %52, double %53, i32 %54, i32 %55)
br label %57
57: ; preds = %15
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %12
60: ; preds = %12
%61 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
store i32 10000, i32* %7
store i32 100, i32* %9
store i32 0, i32* %6
br label %62
62: ; preds = %89, %60
%63 = load i32, i32* %6
%64 = icmp slt i32 %63, 20
br i1 %64, label %65, label %92
65: ; preds = %62
%66 = call i32 (...) @rand()
%67 = srem i32 %66, 16
%68 = add nsw i32 %67, 1
%69 = sitofp i32 %68 to double
%70 = fdiv double %69, 4.000000e+00
store double %70, double* %10
%71 = load i32, i32* %7
%72 = load i32, i32* %9
%73 = sitofp i32 %72 to double
%74 = load double, double* %10
%75 = load i32, i32* %7
%76 = call i32 @runtest(i32 %71, double %73, double %74, i32 %75, i32 32)
%77 = load i32, i32* %7
%78 = sitofp i32 %77 to double
%79 = load double, double* %10
%80 = call double @llvm.fmuladd.f64(double %78, double %79, double 1.000000e+01)
%81 = fptosi double %80 to i32
store i32 %81, i32* %8
%82 = load i32, i32* %7
%83 = load i32, i32* %9
%84 = sitofp i32 %83 to double
%85 = load double, double* %10
%86 = load i32, i32* %7
%87 = load i32, i32* %8
%88 = call i32 @runtest(i32 %82, double %84, double %85, i32 %86, i32 %87)
br label %89
89: ; preds = %65
%90 = load i32, i32* %6
%91 = add nsw i32 %90, 1
store i32 %91, i32* %6
br label %62
92: ; preds = %62
%93 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.2, i64 0, i64 0))
store i32 40, i32* %9
store i32 0, i32* %6
br label %94
94: ; preds = %109, %92
%95 = load i32, i32* %6
%96 = icmp slt i32 %95, 100
br i1 %96, label %97, label %112
97: ; preds = %94
%98 = call i32 (...) @rand()
%99 = srem i32 %98, 30000
%100 = add nsw i32 %99, 10
store i32 %100, i32* %7
%101 = load i32, i32* %7
%102 = add nsw i32 %101, 10
store i32 %102, i32* %8
%103 = load i32, i32* %7
%104 = load i32, i32* %9
%105 = sitofp i32 %104 to double
%106 = load i32, i32* %7
%107 = load i32, i32* %8
%108 = call i32 @runtest(i32 %103, double %105, double 1.000000e+00, i32 %106, i32 %107)
br label %109
109: ; preds = %97
%110 = load i32, i32* %6
%111 = add nsw i32 %110, 1
store i32 %111, i32* %6
br label %94
112: ; preds = %94
%113 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.3, i64 0, i64 0))
store i32 10000, i32* %7
store i32 0, i32* %6
br label %114
114: ; preds = %129, %112
%115 = load i32, i32* %6
%116 = icmp slt i32 %115, 100
br i1 %116, label %117, label %132
117: ; preds = %114
%118 = call i32 (...) @rand()
%119 = srem i32 %118, 10000
%120 = add nsw i32 %119, 1
store i32 %120, i32* %9
%121 = load i32, i32* %7
%122 = mul nsw i32 %121, 10
store i32 %122, i32* %8
%123 = load i32, i32* %7
%124 = load i32, i32* %9
%125 = sitofp i32 %124 to double
%126 = load i32, i32* %7
%127 = load i32, i32* %8
%128 = call i32 @runtest(i32 %123, double %125, double 1.000000e+00, i32 %126, i32 %127)
br label %129
129: ; preds = %117
%130 = load i32, i32* %6
%131 = add nsw i32 %130, 1
store i32 %131, i32* %6
br label %114
132: ; preds = %114
%133 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.4, i64 0, i64 0))
store i32 10000, i32* %7
store i32 100, i32* %9
store i32 0, i32* %6
br label %134
134: ; preds = %155, %132
%135 = load i32, i32* %6
%136 = icmp slt i32 %135, 100
br i1 %136, label %137, label %158
137: ; preds = %134
%138 = call i32 (...) @rand()
%139 = srem i32 %138, 64
%140 = add nsw i32 %139, 1
%141 = sitofp i32 %140 to double
%142 = fdiv double %141, 4.000000e+00
store double %142, double* %10
%143 = load i32, i32* %7
%144 = sitofp i32 %143 to double
%145 = load double, double* %10
%146 = call double @llvm.fmuladd.f64(double %144, double %145, double 1.000000e+01)
%147 = fptosi double %146 to i32
store i32 %147, i32* %8
%148 = load i32, i32* %7
%149 = load i32, i32* %9
%150 = sitofp i32 %149 to double
%151 = load double, double* %10
%152 = load i32, i32* %7
%153 = load i32, i32* %8
%154 = call i32 @runtest(i32 %148, double %150, double %151, i32 %152, i32 %153)
br label %155
155: ; preds = %137
%156 = load i32, i32* %6
%157 = add nsw i32 %156, 1
store i32 %157, i32* %6
br label %134
158: ; preds = %134
ret i32 0
}

LLVM IR (-O2):
@str = [33 x i8] c"\0A*** Vary source block size*** \0A\00"
@str.5 = [31 x i8] c"\0A*** Vary dest block size ***\0A\00"
@str.6 = [56 x i8] c"\0A*** Resample factor 1.0, testing different srclen ***\0A\00"
@str.7 = [58 x i8] c"\0A*** Resample factor 1.0, testing different sin freq ***\0A\00"
@str.8 = [42 x i8] c"\0A*** Resample with different factors ***\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
%5 = phi i32 [ 0, %2 ], [ %18, %4 ]
%6 = tail call i32 (...) @rand()
%7 = srem i32 %6, 16
%8 = add nsw i32 %7, 1
%9 = sitofp i32 %8 to double
%10 = fmul double %9, 2.500000e-01
%11 = tail call double @llvm.fmuladd.f64(double %10, double 1.000000e+04, double 1.000000e+01)
%12 = fptosi double %11 to i32
%13 = tail call i32 @runtest(i32 10000, double 1.000000e+02, double %10, i32 64, i32 %12)
%14 = tail call i32 @runtest(i32 10000, double 1.000000e+02, double %10, i32 32, i32 %12)
%15 = tail call i32 @runtest(i32 10000, double 1.000000e+02, double %10, i32 8, i32 %12)
%16 = tail call i32 @runtest(i32 10000, double 1.000000e+02, double %10, i32 2, i32 %12)
%17 = tail call i32 @runtest(i32 10000, double 1.000000e+02, double %10, i32 10000, i32 %12)
%18 = add nuw nsw i32 %5, 1
%19 = icmp eq i32 %18, 20
br i1 %19, label %20, label %4
20: ; preds = %4
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0))
br label %22
22: ; preds = %20, %22
%23 = phi i32 [ 0, %20 ], [ %33, %22 ]
%24 = tail call i32 (...) @rand()
%25 = srem i32 %24, 16
%26 = add nsw i32 %25, 1
%27 = sitofp i32 %26 to double
%28 = fmul double %27, 2.500000e-01
%29 = tail call i32 @runtest(i32 10000, double 1.000000e+02, double %28, i32 10000, i32 32)
%30 = tail call double @llvm.fmuladd.f64(double %28, double 1.000000e+04, double 1.000000e+01)
%31 = fptosi double %30 to i32
%32 = tail call i32 @runtest(i32 10000, double 1.000000e+02, double %28, i32 10000, i32 %31)
%33 = add nuw nsw i32 %23, 1
%34 = icmp eq i32 %33, 20
br i1 %34, label %35, label %22
35: ; preds = %22
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.6, i64 0, i64 0))
br label %37
37: ; preds = %35, %37
%38 = phi i32 [ 0, %35 ], [ %44, %37 ]
%39 = tail call i32 (...) @rand()
%40 = srem i32 %39, 30000
%41 = add nsw i32 %40, 10
%42 = add nsw i32 %40, 20
%43 = tail call i32 @runtest(i32 %41, double 4.000000e+01, double 1.000000e+00, i32 %41, i32 %42)
%44 = add nuw nsw i32 %38, 1
%45 = icmp eq i32 %44, 100
br i1 %45, label %46, label %37
46: ; preds = %37
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.7, i64 0, i64 0))
br label %48
48: ; preds = %46, %48
%49 = phi i32 [ 0, %46 ], [ %55, %48 ]
%50 = tail call i32 (...) @rand()
%51 = srem i32 %50, 10000
%52 = add nsw i32 %51, 1
%53 = sitofp i32 %52 to double
%54 = tail call i32 @runtest(i32 10000, double %53, double 1.000000e+00, i32 10000, i32 100000)
%55 = add nuw nsw i32 %49, 1
%56 = icmp eq i32 %55, 100
br i1 %56, label %57, label %48
57: ; preds = %48
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.8, i64 0, i64 0))
br label %59
59: ; preds = %57, %59
%60 = phi i32 [ 0, %57 ], [ %69, %59 ]
%61 = tail call i32 (...) @rand()
%62 = srem i32 %61, 64
%63 = add nsw i32 %62, 1
%64 = sitofp i32 %63 to double
%65 = fmul double %64, 2.500000e-01
%66 = tail call double @llvm.fmuladd.f64(double %65, double 1.000000e+04, double 1.000000e+01)
%67 = fptosi double %66 to i32
%68 = tail call i32 @runtest(i32 10000, double 1.000000e+02, double %65, i32 10000, i32 %67)
%69 = add nuw nsw i32 %60, 1
%70 = icmp eq i32 %69, 100
br i1 %70, label %71, label %59
71: ; preds = %59
ret i32 0
}