#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*/ wav_store_word(int, int /*<<< orphan*/ *);
void wav_write_zero(FILE *f) {
  unsigned int l;
  for (l = 0; l < 10 * 2; l++)
    wav_store_word(0x8000, f);
  for (l = 0; l < 10 * 2; l++)
    wav_store_word(0x7FFF, f);
}


x86 assembly (clang, -O0):
<wav_write_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jae    1149 <wav_write_zero+0x39>
mov    -0x8(%rbp),%rsi
mov    $0x8000,%edi
call   1030 <wav_store_word@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <wav_write_zero+0x13>
movl   $0x0,-0xc(%rbp)
cmpl   $0x14,-0xc(%rbp)
jae    1176 <wav_write_zero+0x66>
mov    -0x8(%rbp),%rsi
mov    $0x7fff,%edi
call   1030 <wav_store_word@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1150 <wav_write_zero+0x40>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wav_write_zero>:
push   %rbx
mov    %rdi,%rbx
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x8000,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
call   1030 <wav_store_word@plt>
mov    $0x7fff,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <wav_store_word@plt>

LLVM IR (-O0):
define void @wav_write_zero(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp ult i32 %5, 20
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32*, i32** %2
%9 = call i32 @wav_store_word(i32 32768, i32* %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
store i32 0, i32* %3
br label %14
14: ; preds = %20, %13
%15 = load i32, i32* %3
%16 = icmp ult i32 %15, 20
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32*, i32** %2
%19 = call i32 @wav_store_word(i32 32767, i32* %18)
br label %20
20: ; preds = %17
%21 = load i32, i32* %3
%22 = add i32 %21, 1
store i32 %22, i32* %3
br label %14
23: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @wav_write_zero(i32* %0) {
%2 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%3 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%4 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%5 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%6 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%7 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%8 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%9 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%10 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%11 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%12 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%13 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%14 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%15 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%16 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%17 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%18 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%19 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%20 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%21 = tail call i32 @wav_store_word(i32 32768, i32* %0)
%22 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%23 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%24 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%25 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%26 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%27 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%28 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%29 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%30 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%31 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%32 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%33 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%34 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%35 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%36 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%37 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%38 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%39 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%40 = tail call i32 @wav_store_word(i32 32767, i32* %0)
%41 = tail call i32 @wav_store_word(i32 32767, i32* %0)
ret void
}