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

/* Variables and functions */
int /*<<< orphan*/ declArray(int /*<<< orphan*/ *, int /*<<< orphan*/ *, char *,
                             char *, int, int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ outS(unsigned char *, int /*<<< orphan*/, int,
                        int /*<<< orphan*/ *, int);
void outWAV(unsigned char *data, int size, int align, FILE *fs, FILE *fh,
            char *id, int global) {
  declArray(fs, fh, "u8", id, size, align, 1);
  outS(data, 0, size, fs, 1);
  fprintf(fs, "\n");
}


x86 assembly (clang, -O0):
<outWAV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    -0xc(%rbp),%r8d
mov    -0x10(%rbp),%r9d
lea    0xe94(%rip),%rdx
movl   $0x1,(%rsp)
call   1030 <declArray@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
mov    $0x1,%r8d
call   1050 <outS@plt>
mov    -0x18(%rbp),%rdi
lea    0xe68(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outWAV>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%rbx
mov    %edx,%eax
mov    %esi,%ebp
mov    %rdi,%r14
movl   $0x1,(%rsp)
lea    0xeb0(%rip),%rdx
mov    %rcx,%rdi
mov    %r8,%rsi
mov    %r9,%rcx
mov    %ebp,%r8d
mov    %eax,%r9d
call   1030 <declArray@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    $0x1,%r8d
call   1050 <outS@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fputc@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"u8\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @outWAV(i8* %0, i32 %1, i32 %2, i32* %3, i32* %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i32
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i32*, i32** %11
%16 = load i32*, i32** %12
%17 = load i8*, i8** %13
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = call i32 @declArray(i32* %15, i32* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18, i32 %19, i32 1)
%21 = load i8*, i8** %8
%22 = load i32, i32* %9
%23 = load i32*, i32** %11
%24 = call i32 @outS(i8* %21, i32 0, i32 %22, i32* %23, i32 1)
%25 = load i32*, i32** %11
%26 = call i32 @fprintf(i32* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"u8\00"
define void @outWAV(i8* %0, i32 %1, i32 %2, i32* %3, i32* %4, i8* %5, i32 %6) {
%8 = tail call i32 @declArray(i32* %3, i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %1, i32 %2, i32 1)
%9 = tail call i32 @outS(i8* %0, i32 0, i32 %1, i32* %3, i32 1)
%10 = tail call i32 @fputc(i32 10, i32* %3)
ret void
}