#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 */
typedef scalar_t__ int16_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
double INT16_MAX;
int M_PI;
int atoi(char *);
scalar_t__ fwrite(scalar_t__ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ *popen(char *, char *);
double sin(int);
int main(int ARGC, char *ARGV[]) {
  int i, j, k;
  double amp[2] = {0.5, 0.5};
  double wave[2][48000 / 375];
  for (i = 0; i < 48000 / 375; i++) {
    wave[0][i] = sin(2 * M_PI * 6000 * i / 48000);
    wave[1][i] = sin(2 * M_PI * 6000 * i / 48000 + M_PI / 2);
  }
  char code[2][31] = {{0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1,
                       1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0},
                      {0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0,
                       0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1}};
  double data[2][(48000 * 31 / 375)];
  for (i = 0; i < 31; i++) {
    for (j = 0; j < 48000 / 375; j++) {
      for (k = 0; k < 2; k++) {
        int symbol = code[k][i] ^ 1;
        data[k][i * 48000 / 375 + j] = wave[symbol][j];
      }
    }
  }
  int16_t buf[(48000 * 31 / 375)];
  for (i = 0; i < (48000 * 31 / 375); i++) {
    buf[i] = 0;
    int ch = atoi(ARGV[1]);
    buf[i] = (int16_t)(INT16_MAX * amp[ch] * data[ch][i]);
  }
  FILE *play;
  char cmd[] = "play -t raw -b 16 -c 1 -e s -r 48000 -";
  if ((play = popen(cmd, "w")) == NULL) {
    perror("play");
  }
  int n;
  while (1) {
    n = 0;
    while (1) {
      n += fwrite(buf + n, sizeof(int16_t), (48000 * 31 / 375) - n, play);
      if (n >= (48000 * 31 / 375)) {
        break;
      }
    }
  }
  pclose(play);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x17cd0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xe80(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe7d(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x80,-0x14(%rbp)
jge    1228 <main+0xc8>
mov    0x2e3e(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
imul   $0x1770,%eax,%eax
imul   -0x14(%rbp),%eax
mov    $0xbb80,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <sin@plt>
movslq -0x14(%rbp),%rax
movsd  %xmm0,-0x830(%rbp,%rax,8)
ff ff
mov    0x2e0c(%rip),%rax
mov    (%rax),%eax
shl    $0x1,%eax
imul   $0x1770,%eax,%eax
imul   -0x14(%rbp),%eax
mov    $0xbb80,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    0x2dec(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    %eax,%edi
call   1030 <sin@plt>
movslq -0x14(%rbp),%rax
movsd  %xmm0,-0x430(%rbp,%rax,8)
ff ff
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1196 <main+0x36>
lea    -0x870(%rbp),%rdi
lea    0xdda(%rip),%rsi
mov    $0x3e,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x1f,-0x14(%rbp)
jge    132a <main+0x1ca>
movl   $0x0,-0x18(%rbp)
cmpl   $0x80,-0x18(%rbp)
jge    1317 <main+0x1b7>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jge    1304 <main+0x1a4>
movslq -0x1c(%rbp),%rcx
lea    -0x870(%rbp),%rax
imul   $0x1f,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
xor    $0x1,%eax
mov    %eax,-0x10074(%rbp)
movslq -0x10074(%rbp),%rcx
lea    -0x830(%rbp),%rax
shl    $0xa,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movslq -0x1c(%rbp),%rcx
lea    -0x10070(%rbp),%rax
imul   $0x7c00,%rcx,%rcx
add    %rcx,%rax
mov    %rax,-0x17cd0(%rbp)
imul   $0xbb80,-0x14(%rbp),%eax
mov    $0x177,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x17cd0(%rbp),%rax
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    126c <main+0x10c>
jmp    1309 <main+0x1a9>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1258 <main+0xf8>
jmp    131c <main+0x1bc>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1247 <main+0xe7>
movl   $0x0,-0x14(%rbp)
cmpl   $0xf80,-0x14(%rbp)
jge    13b9 <main+0x259>
movslq -0x14(%rbp),%rax
movq   $0x0,-0x17c80(%rbp,%rax,8)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x17c84(%rbp)
mov    0x2c70(%rip),%rax
movsd  (%rax),%xmm0
movslq -0x17c84(%rbp),%rax
mulsd  -0x30(%rbp,%rax,8),%xmm0
movslq -0x17c84(%rbp),%rcx
lea    -0x10070(%rbp),%rax
imul   $0x7c00,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
cvttsd2si %xmm0,%rcx
movslq -0x14(%rbp),%rax
mov    %rcx,-0x17c80(%rbp,%rax,8)
ff
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1331 <main+0x1d1>
lea    -0x17cc0(%rbp),%rdi
lea    0xc89(%rip),%rsi
mov    $0x27,%edx
call   1040 <memcpy@plt>
lea    -0x17cc0(%rbp),%rdi
lea    0xc98(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x17c90(%rbp)
cmp    $0x0,%rax
jne    1401 <main+0x2a1>
lea    0xc7d(%rip),%rdi
call   1060 <perror@plt>
jmp    1406 <main+0x2a6>
movl   $0x0,-0x17cc4(%rbp)
lea    -0x17c80(%rbp),%rdi
movslq -0x17cc4(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
mov    $0xf80,%edx
sub    -0x17cc4(%rbp),%edx
mov    -0x17c90(%rbp),%rcx
mov    $0x8,%esi
call   1080 <fwrite@plt>
mov    %rax,%rcx
movslq -0x17cc4(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x17cc4(%rbp)
cmpl   $0xf80,-0x17cc4(%rbp)
jl     1469 <main+0x309>
jmp    146e <main+0x30e>
jmp    1410 <main+0x2b0>
jmp    1406 <main+0x2a6>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x17c48,%rsp
mov    %rsi,%r14
lea    0x440(%rsp),%r15
xor    %ebx,%ebx
mov    0x2e76(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12),%eax
imul   %ebx,%eax
cltq
imul   $0x57619f1,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x2a,%rdi
add    %eax,%edi
call   1030 <sin@plt>
movsd  %xmm0,-0x400(%r15)
ff ff
mov    (%r12),%eax
mov    %ebx,%ecx
imul   %eax,%ecx
movslq %ecx,%rcx
imul   $0x57619f1,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2a,%rcx
add    %edx,%ecx
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
add    %ecx,%edi
call   1030 <sin@plt>
movsd  %xmm0,(%r15)
add    $0x2ee0,%rbx
add    $0x8,%r15
cmp    $0x177000,%rbx
jne    1180 <main+0x30>
lea    0x10050(%rsp),%rax
lea    0x50(%rsp),%r8
xor    %edx,%edx
lea    0xe06(%rip),%rsi
nopw   0x0(%rax,%rax,1)
movsbq (%rdx,%rsi,1),%rdi
movsbq 0x1f(%rdx,%rsi,1),%rbx
xor    $0x1,%rdi
xor    $0x1,%rbx
shl    $0xa,%rdi
add    %r8,%rdi
shl    $0xa,%rbx
add    %r8,%rbx
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movaps -0x10(%rdi,%rcx,8),%xmm0
movaps %xmm0,-0x7c10(%rax,%rcx,8)
ff
movaps -0x10(%rbx,%rcx,8),%xmm0
movaps %xmm0,-0x10(%rax,%rcx,8)
movaps (%rdi,%rcx,8),%xmm0
movaps %xmm0,-0x7c00(%rax,%rcx,8)
ff
movaps (%rbx,%rcx,8),%xmm0
movaps %xmm0,(%rax,%rcx,8)
add    $0x4,%rcx
cmp    $0x80,%rcx
jne    1240 <main+0xf0>
add    $0x1,%rdx
add    $0x400,%rax
cmp    $0x1f,%rdx
jne    1210 <main+0xc0>
mov    0x8(%r14),%r14
mov    0x2d45(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %ebx,%ebx
lea    0xd5a(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1060 <atoi@plt>
cltq
movsd  (%r15,%rax,8),%xmm0
mulsd  0x8(%rsp),%xmm0
imul   $0x7c00,%rax,%rax
add    %rsp,%rax
add    $0x8440,%rax
mulsd  (%rax,%rbx,8),%xmm0
cvttsd2si %xmm0,%rax
mov    %rax,0x840(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    $0xf80,%rbx
jne    12b0 <main+0x160>
movaps 0xd64(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xd48(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movabs $0x2d203030303834,%rax
mov    %rax,0x2f(%rsp)
lea    0xd54(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1040 <popen@plt>
mov    %rax,%r14
test   %rax,%rax
je     137d <main+0x22d>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %eax,%rbx
lea    (%rsp,%rbx,8),%rdi
add    $0x840,%rdi
mov    $0xf80,%edx
sub    %ebx,%edx
mov    $0x8,%esi
mov    %r14,%rcx
call   1070 <fwrite@plt>
add    %ebx,%eax
cmp    $0xf7f,%eax
jle    1350 <main+0x200>
jmp    1340 <main+0x1f0>
lea    0xcf5(%rip),%rdi
call   1050 <perror@plt>
jmp    1340 <main+0x1f0>

LLVM IR (-O0):
@__const.main.amp = [2 x double] [double 5.000000e-01, double 5.000000e-01]
@M_PI = global i32 0
@__const.main.code = [2 x [31 x i8]] [[31 x i8] c"\00\00\00\00\00\00\00\01\01\01\01\00\01\01\00\01\01\01\01\01\00\01\01\01\00\01\00\00\00\01\00", [31 x i8] c"\00\00\00\00\01\00\01\00\01\00\01\01\01\01\00\00\00\00\01\00\01\00\00\00\00\01\01\00\00\00\01"]
@INT16_MAX = global double 0.000000e+00
@__const.main.cmd = [39 x i8] c"play -t raw -b 16 -c 1 -e s -r 48000 -\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [5 x i8] c"play\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 [2 x double]
%10 = alloca [2 x [128 x double]]
%11 = alloca [2 x [31 x i8]]
%12 = alloca [2 x [3968 x double]]
%13 = alloca i32
%14 = alloca [3968 x i64]
%15 = alloca i32
%16 = alloca i32*
%17 = alloca [39 x i8]
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = bitcast [2 x double]* %9 to i8*
store i32 0, i32* %6
br label %20
20: ; preds = %49, %2
%21 = load i32, i32* %6
%22 = icmp slt i32 %21, 128
br i1 %22, label %23, label %52
23: ; preds = %20
%24 = load i32, i32* @M_PI
%25 = mul nsw i32 2, %24
%26 = mul nsw i32 %25, 6000
%27 = load i32, i32* %6
%28 = mul nsw i32 %26, %27
%29 = sdiv i32 %28, 48000
%30 = call double @sin(i32 %29)
%31 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %10, i64 0, i64 0
%32 = load i32, i32* %6
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [128 x double], [128 x double]* %31, i64 0, i64 %33
store double %30, double* %34
%35 = load i32, i32* @M_PI
%36 = mul nsw i32 2, %35
%37 = mul nsw i32 %36, 6000
%38 = load i32, i32* %6
%39 = mul nsw i32 %37, %38
%40 = sdiv i32 %39, 48000
%41 = load i32, i32* @M_PI
%42 = sdiv i32 %41, 2
%43 = add nsw i32 %40, %42
%44 = call double @sin(i32 %43)
%45 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %10, i64 0, i64 1
%46 = load i32, i32* %6
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [128 x double], [128 x double]* %45, i64 0, i64 %47
store double %44, double* %48
br label %49
49: ; preds = %23
%50 = load i32, i32* %6
%51 = add nsw i32 %50, 1
store i32 %51, i32* %6
br label %20
52: ; preds = %20
%53 = bitcast [2 x [31 x i8]]* %11 to i8*
store i32 0, i32* %6
br label %54
54: ; preds = %100, %52
%55 = load i32, i32* %6
%56 = icmp slt i32 %55, 31
br i1 %56, label %57, label %103
57: ; preds = %54
store i32 0, i32* %7
br label %58
58: ; preds = %96, %57
%59 = load i32, i32* %7
%60 = icmp slt i32 %59, 128
br i1 %60, label %61, label %99
61: ; preds = %58
store i32 0, i32* %8
br label %62
62: ; preds = %92, %61
%63 = load i32, i32* %8
%64 = icmp slt i32 %63, 2
br i1 %64, label %65, label %95
65: ; preds = %62
%66 = load i32, i32* %8
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [2 x [31 x i8]], [2 x [31 x i8]]* %11, i64 0, i64 %67
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [31 x i8], [31 x i8]* %68, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = xor i32 %73, 1
store i32 %74, i32* %13
%75 = load i32, i32* %13
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %10, i64 0, i64 %76
%78 = load i32, i32* %7
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [128 x double], [128 x double]* %77, i64 0, i64 %79
%81 = load double, double* %80
%82 = load i32, i32* %8
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [2 x [3968 x double]], [2 x [3968 x double]]* %12, i64 0, i64 %83
%85 = load i32, i32* %6
%86 = mul nsw i32 %85, 48000
%87 = sdiv i32 %86, 375
%88 = load i32, i32* %7
%89 = add nsw i32 %87, %88
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [3968 x double], [3968 x double]* %84, i64 0, i64 %90
store double %81, double* %91
br label %92
92: ; preds = %65
%93 = load i32, i32* %8
%94 = add nsw i32 %93, 1
store i32 %94, i32* %8
br label %62
95: ; preds = %62
br label %96
96: ; preds = %95
%97 = load i32, i32* %7
%98 = add nsw i32 %97, 1
store i32 %98, i32* %7
br label %58
99: ; preds = %58
br label %100
100: ; preds = %99
%101 = load i32, i32* %6
%102 = add nsw i32 %101, 1
store i32 %102, i32* %6
br label %54
103: ; preds = %54
store i32 0, i32* %6
br label %104
104: ; preds = %133, %103
%105 = load i32, i32* %6
%106 = icmp slt i32 %105, 3968
br i1 %106, label %107, label %136
107: ; preds = %104
%108 = load i32, i32* %6
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [3968 x i64], [3968 x i64]* %14, i64 0, i64 %109
store i64 0, i64* %110
%111 = load i8**, i8*** %5
%112 = getelementptr inbounds i8*, i8** %111, i64 1
%113 = load i8*, i8** %112
%114 = call i32 @atoi(i8* %113)
store i32 %114, i32* %15
%115 = load double, double* @INT16_MAX
%116 = load i32, i32* %15
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [2 x double], [2 x double]* %9, i64 0, i64 %117
%119 = load double, double* %118
%120 = fmul double %115, %119
%121 = load i32, i32* %15
%122 = sext i32 %121 to i64
%123 = getelementptr inbounds [2 x [3968 x double]], [2 x [3968 x double]]* %12, i64 0, i64 %122
%124 = load i32, i32* %6
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [3968 x double], [3968 x double]* %123, i64 0, i64 %125
%127 = load double, double* %126
%128 = fmul double %120, %127
%129 = fptosi double %128 to i64
%130 = load i32, i32* %6
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [3968 x i64], [3968 x i64]* %14, i64 0, i64 %131
store i64 %129, i64* %132
br label %133
133: ; preds = %107
%134 = load i32, i32* %6
%135 = add nsw i32 %134, 1
store i32 %135, i32* %6
br label %104
136: ; preds = %104
%137 = bitcast [39 x i8]* %17 to i8*
%138 = getelementptr inbounds [39 x i8], [39 x i8]* %17, i64 0, i64 0
%139 = call i32* @popen(i8* %138, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %139, i32** %16
%140 = icmp eq i32* %139, null
br i1 %140, label %141, label %143
141: ; preds = %136
%142 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %143
143: ; preds = %141, %136
br label %144
144: ; preds = %143, %162
store i32 0, i32* %18
br label %145
145: ; preds = %144, %161
%146 = getelementptr inbounds [3968 x i64], [3968 x i64]* %14, i64 0, i64 0
%147 = load i32, i32* %18
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds i64, i64* %146, i64 %148
%150 = load i32, i32* %18
%151 = sub nsw i32 3968, %150
%152 = load i32*, i32** %16
%153 = call i64 @fwrite(i64* %149, i32 8, i32 %151, i32* %152)
%154 = load i32, i32* %18
%155 = sext i32 %154 to i64
%156 = add nsw i64 %155, %153
%157 = trunc i64 %156 to i32
store i32 %157, i32* %18
%158 = load i32, i32* %18
%159 = icmp sge i32 %158, 3968
br i1 %159, label %160, label %161
160: ; preds = %145
br label %162
161: ; preds = %145
br label %145
162: ; preds = %160
br label %144
}

LLVM IR (-O2):
@__const.main.amp = [2 x double] [double 5.000000e-01, double 5.000000e-01]
@M_PI = global i32 0
@__const.main.code = [2 x [31 x i8]] [[31 x i8] c"\00\00\00\00\00\00\00\01\01\01\01\00\01\01\00\01\01\01\01\01\00\01\01\01\00\01\00\00\00\01\00", [31 x i8] c"\00\00\00\00\01\00\01\00\01\00\01\01\01\01\00\00\00\00\01\00\01\00\00\00\00\01\01\00\00\00\01"]
@INT16_MAX = global double 0.000000e+00
@__const.main.cmd = [39 x i8] c"play -t raw -b 16 -c 1 -e s -r 48000 -\00"
@.str = [2 x i8] c"w\00"
@.str.1 = [5 x i8] c"play\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x [128 x double]]
%4 = alloca [2 x [3968 x double]]
%5 = alloca [3968 x i64]
%6 = alloca [39 x i8]
%7 = bitcast [2 x [128 x double]]* %3 to i8*
br label %8
8: ; preds = %2, %8
%9 = phi i64 [ 0, %2 ], [ %24, %8 ]
%10 = load i32, i32* @M_PI
%11 = trunc i64 %9 to i32
%12 = mul i32 %11, 12000
%13 = mul i32 %12, %10
%14 = sdiv i32 %13, 48000
%15 = tail call double @sin(i32 %14)
%16 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %3, i64 0, i64 0, i64 %9
store double %15, double* %16
%17 = load i32, i32* @M_PI
%18 = mul i32 %12, %17
%19 = sdiv i32 %18, 48000
%20 = sdiv i32 %17, 2
%21 = add nsw i32 %19, %20
%22 = tail call double @sin(i32 %21)
%23 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %3, i64 0, i64 1, i64 %9
store double %22, double* %23
%24 = add nuw nsw i64 %9, 1
%25 = icmp eq i64 %24, 128
br i1 %25, label %26, label %8
26: ; preds = %8
%27 = bitcast [2 x [3968 x double]]* %4 to i8*
br label %28
28: ; preds = %26, %66
%29 = phi i64 [ 0, %26 ], [ %67, %66 ]
%30 = shl nsw i64 %29, 7
%31 = getelementptr inbounds [2 x [31 x i8]], [2 x [31 x i8]]* @__const.main.code, i64 0, i64 0, i64 %29
%32 = load i8, i8* %31
%33 = getelementptr inbounds [2 x [31 x i8]], [2 x [31 x i8]]* @__const.main.code, i64 0, i64 1, i64 %29
%34 = load i8, i8* %33
%35 = xor i8 %32, 1
%36 = sext i8 %35 to i64
%37 = xor i8 %34, 1
%38 = sext i8 %37 to i64
br label %39
39: ; preds = %39, %28
%40 = phi i64 [ 0, %28 ], [ %64, %39 ]
%41 = add nuw nsw i64 %40, %30
%42 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %3, i64 0, i64 %36, i64 %40
%43 = bitcast double* %42 to <2 x double>*
%44 = load <2 x double>, <2 x double>* %43
%45 = getelementptr inbounds [2 x [3968 x double]], [2 x [3968 x double]]* %4, i64 0, i64 0, i64 %41
%46 = bitcast double* %45 to <2 x double>*
store <2 x double> %44, <2 x double>* %46
%47 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %3, i64 0, i64 %38, i64 %40
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = getelementptr inbounds [2 x [3968 x double]], [2 x [3968 x double]]* %4, i64 0, i64 1, i64 %41
%51 = bitcast double* %50 to <2 x double>*
store <2 x double> %49, <2 x double>* %51
%52 = or i64 %40, 2
%53 = add nuw nsw i64 %52, %30
%54 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %3, i64 0, i64 %36, i64 %52
%55 = bitcast double* %54 to <2 x double>*
%56 = load <2 x double>, <2 x double>* %55
%57 = getelementptr inbounds [2 x [3968 x double]], [2 x [3968 x double]]* %4, i64 0, i64 0, i64 %53
%58 = bitcast double* %57 to <2 x double>*
store <2 x double> %56, <2 x double>* %58
%59 = getelementptr inbounds [2 x [128 x double]], [2 x [128 x double]]* %3, i64 0, i64 %38, i64 %52
%60 = bitcast double* %59 to <2 x double>*
%61 = load <2 x double>, <2 x double>* %60
%62 = getelementptr inbounds [2 x [3968 x double]], [2 x [3968 x double]]* %4, i64 0, i64 1, i64 %53
%63 = bitcast double* %62 to <2 x double>*
store <2 x double> %61, <2 x double>* %63
%64 = add nuw nsw i64 %40, 4
%65 = icmp eq i64 %64, 128
br i1 %65, label %66, label %39
66: ; preds = %39
%67 = add nuw nsw i64 %29, 1
%68 = icmp eq i64 %67, 31
br i1 %68, label %69, label %28
69: ; preds = %66
%70 = bitcast [3968 x i64]* %5 to i8*
%71 = getelementptr inbounds i8*, i8** %1, i64 1
%72 = load i8*, i8** %71
%73 = load double, double* @INT16_MAX
br label %74
74: ; preds = %69, %74
%75 = phi i64 [ 0, %69 ], [ %86, %74 ]
%76 = getelementptr inbounds [3968 x i64], [3968 x i64]* %5, i64 0, i64 %75
%77 = tail call i32 @atoi(i8* %72)
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds [2 x double], [2 x double]* @__const.main.amp, i64 0, i64 %78
%80 = load double, double* %79
%81 = fmul double %73, %80
%82 = getelementptr inbounds [2 x [3968 x double]], [2 x [3968 x double]]* %4, i64 0, i64 %78, i64 %75
%83 = load double, double* %82
%84 = fmul double %81, %83
%85 = fptosi double %84 to i64
store i64 %85, i64* %76
%86 = add nuw nsw i64 %75, 1
%87 = icmp eq i64 %86, 3968
br i1 %87, label %88, label %74
88: ; preds = %74
%89 = getelementptr inbounds [39 x i8], [39 x i8]* %6, i64 0, i64 0
%90 = call i32* @popen(i8* %89, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%91 = icmp eq i32* %90, null
br i1 %91, label %92, label %94
92: ; preds = %88
%93 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %94
94: ; preds = %92, %88
br label %95
95: ; preds = %96, %94
br label %96
96: ; preds = %96, %95
%97 = phi i32 [ 0, %95 ], [ %103, %96 ]
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [3968 x i64], [3968 x i64]* %5, i64 0, i64 %98
%100 = sub nsw i32 3968, %97
%101 = call i64 @fwrite(i64* %99, i32 8, i32 %100, i32* %90)
%102 = trunc i64 %101 to i32
%103 = add i32 %97, %102
%104 = icmp sgt i32 %103, 3967
br i1 %104, label %95, label %96
}