#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 BUFSIZ;
scalar_t__ EOF;
int /*<<< orphan*/ SEEK_SET;
scalar_t__ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *const, char *);
int fread(unsigned char *, int, int, int /*<<< orphan*/ *const);
scalar_t__ fseek(int /*<<< orphan*/ *const, int const, int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *const);
int fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ write16le(int const, unsigned char *);
int /*<<< orphan*/ write32le(int const, unsigned char *);
int dumpPCM8(FILE *const infile, const int offset, const int size,
             const int channels, const int srate, const char *const filename) {
  long oldpos;
  FILE *outfile;
  int sizeleft;
  int outsize, outsizetotal;
  int curchan;
  unsigned char inbuf[BUFSIZ];
  unsigned char wavhead[44] = {
      0x52, 0x49, 0x46, 0x46, 0x00, 0x00, 0x00, 0x00, 0x57, 0x41, 0x56,
      0x45, 0x66, 0x6D, 0x74, 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00,
      0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
      0x00, 0x08, 0x00, 0x64, 0x61, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00};
  oldpos = ftell(infile);
  if (oldpos < 0)
    return 1;
  outfile = fopen(filename, "wb");
  if (!outfile)
    return 1;
  outsize = size * channels;
  outsizetotal = outsize + 8;
  write32le(outsizetotal, wavhead + 4);
  write32le(outsize, wavhead + 0x28);
  write16le(channels, wavhead + 0x16);
  write32le(srate, wavhead + 0x18);
  write32le(srate * channels, wavhead + 0x1C);
  if (fwrite(wavhead, 1, 44, outfile) != 44)
    return 1;
  if (fseek(infile, offset, SEEK_SET) < 0)
    return 1;
  for (sizeleft = size; sizeleft >= BUFSIZ; sizeleft -= BUFSIZ) {
    int i;
    if (fread(inbuf, 1, BUFSIZ, infile) != BUFSIZ)
      return 1;
    for (i = 0; i < BUFSIZ; i++) {
      inbuf[i] += 0x80;
    }
    if (fwrite(inbuf, 1, BUFSIZ, outfile) != BUFSIZ)
      return 1;
  }
  if (sizeleft > 0) {
    int i;
    if (fread(inbuf, 1, sizeleft, infile) != sizeleft)
      return 1;
    for (i = 0; i < sizeleft; i++) {
      inbuf[i] += 0x80;
    }
    if (fwrite(inbuf, 1, sizeleft, outfile) != sizeleft)
      return 1;
  }
  if (fclose(outfile) == EOF)
    return 1;
  if (fseek(infile, oldpos, SEEK_SET) < 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<dumpPCM8>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x58(%rbp)
lea    -0x90(%rbp),%rdi
lea    0xe13(%rip),%rsi
mov    $0x2c,%edx
call   1080 <memcpy@plt>
mov    -0x10(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jge    1225 <dumpPCM8+0x95>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
mov    -0x28(%rbp),%rdi
lea    0xdfc(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    125a <dumpPCM8+0xca>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
mov    -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%edi
lea    -0x90(%rbp),%rsi
add    $0x4,%rsi
call   1030 <write32le@plt>
mov    -0x40(%rbp),%edi
lea    -0x90(%rbp),%rsi
add    $0x28,%rsi
call   1030 <write32le@plt>
mov    -0x1c(%rbp),%edi
lea    -0x90(%rbp),%rsi
add    $0x16,%rsi
call   1060 <write16le@plt>
mov    -0x20(%rbp),%edi
lea    -0x90(%rbp),%rsi
add    $0x18,%rsi
call   1030 <write32le@plt>
mov    -0x20(%rbp),%edi
imul   -0x1c(%rbp),%edi
lea    -0x90(%rbp),%rsi
add    $0x1c,%rsi
call   1030 <write32le@plt>
lea    -0x90(%rbp),%rdi
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2c,%edx
call   10b0 <fwrite@plt>
cmp    $0x2c,%eax
je     1309 <dumpPCM8+0x179>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    0x2cb9(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
cmp    $0x0,%rax
jge    133e <dumpPCM8+0x1ae>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
mov    -0x18(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    0x2c8a(%rip),%rcx
cmp    (%rcx),%eax
jl     1445 <dumpPCM8+0x2b5>
mov    -0xa8(%rbp),%rdi
mov    0x2c74(%rip),%rax
mov    (%rax),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    0x2c5d(%rip),%rcx
cmp    (%rcx),%eax
je     1399 <dumpPCM8+0x209>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
movl   $0x0,-0x98(%rbp)
mov    -0x98(%rbp),%eax
mov    0x2c28(%rip),%rcx
cmp    (%rcx),%eax
jge    13e7 <dumpPCM8+0x257>
mov    -0xa8(%rbp),%rax
movslq -0x98(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
add    $0x80,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x98(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x98(%rbp)
jmp    13a3 <dumpPCM8+0x213>
mov    -0xa8(%rbp),%rdi
mov    0x2be3(%rip),%rax
mov    (%rax),%edx
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
call   10b0 <fwrite@plt>
mov    0x2bcc(%rip),%rcx
cmp    (%rcx),%eax
je     142a <dumpPCM8+0x29a>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
jmp    142f <dumpPCM8+0x29f>
mov    0x2ba2(%rip),%rax
mov    (%rax),%ecx
mov    -0x3c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x3c(%rbp)
jmp    1344 <dumpPCM8+0x1b4>
cmpl   $0x0,-0x3c(%rbp)
jle    150a <dumpPCM8+0x37a>
mov    -0xa8(%rbp),%rdi
mov    -0x3c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
cmp    -0x3c(%rbp),%eax
je     1486 <dumpPCM8+0x2f6>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
movl   $0x0,-0x9c(%rbp)
mov    -0x9c(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    14ce <dumpPCM8+0x33e>
mov    -0xa8(%rbp),%rax
movslq -0x9c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
add    $0x80,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1490 <dumpPCM8+0x300>
mov    -0xa8(%rbp),%rdi
mov    -0x3c(%rbp),%edx
mov    -0x38(%rbp),%rcx
mov    $0x1,%esi
call   10b0 <fwrite@plt>
cmp    -0x3c(%rbp),%eax
je     1505 <dumpPCM8+0x375>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
jmp    150a <dumpPCM8+0x37a>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x2ace(%rip),%rcx
cmp    (%rcx),%rax
jne    1539 <dumpPCM8+0x3a9>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rax
mov    %eax,%esi
mov    0x2a86(%rip),%rax
mov    (%rax),%edx
call   1090 <fseek@plt>
cmp    $0x0,%rax
jge    1571 <dumpPCM8+0x3e1>
movl   $0x1,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
jmp    1582 <dumpPCM8+0x3f2>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x94(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dumpPCM8>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9,%r12
mov    %r8d,%r14d
mov    %ecx,%r13d
mov    %edx,-0x2c(%rbp)
mov    %esi,-0x44(%rbp)
mov    0x2e31(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rbx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
movups 0xe6b(%rip),%xmm0
movups %xmm0,-0x64(%rbp)
movaps 0xe54(%rip),%xmm0
movaps %xmm0,-0x70(%rbp)
movaps 0xe39(%rip),%xmm0
movaps %xmm0,-0x80(%rbp)
mov    %rdi,-0x40(%rbp)
call   1070 <ftell@plt>
mov    $0x1,%r15d
test   %rax,%rax
js     15ca <dumpPCM8+0x44a>
mov    %rax,-0x50(%rbp)
lea    0xe3e(%rip),%rsi
mov    %r12,%rdi
call   1090 <fopen@plt>
mov    %rax,-0x38(%rbp)
test   %rax,%rax
je     15ca <dumpPCM8+0x44a>
mov    %r13d,%r15d
mov    -0x2c(%rbp),%r12d
imul   %r12d,%r15d
lea    0x8(%r15),%edi
lea    -0x7c(%rbp),%rsi
call   1030 <write32le@plt>
lea    -0x58(%rbp),%rsi
mov    %r15d,%edi
call   1030 <write32le@plt>
lea    -0x6a(%rbp),%rsi
mov    %r13d,%edi
call   1060 <write16le@plt>
lea    -0x68(%rbp),%rsi
mov    %r14d,%edi
call   1030 <write32le@plt>
imul   %r13d,%r14d
lea    -0x64(%rbp),%rsi
mov    %r14d,%edi
call   1030 <write32le@plt>
lea    -0x80(%rbp),%rdi
mov    $0x1,%r15d
mov    $0x1,%esi
mov    $0x2c,%edx
mov    -0x38(%rbp),%rcx
call   10a0 <fwrite@plt>
cmp    $0x2c,%eax
jne    15ca <dumpPCM8+0x44a>
mov    0x2d44(%rip),%r14
mov    (%r14),%edx
mov    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1080 <fseek@plt>
test   %rax,%rax
js     15ca <dumpPCM8+0x44a>
mov    0x2d2d(%rip),%rax
mov    (%rax),%eax
cmp    %r12d,%eax
jle    12ff <dumpPCM8+0x17f>
cmpl   $0x0,-0x2c(%rbp)
jle    1598 <dumpPCM8+0x418>
mov    $0x1,%r15d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    -0x2c(%rbp),%r12d
mov    %r12d,%edx
mov    -0x40(%rbp),%rcx
call   1040 <fread@plt>
cmp    %r12d,%eax
jne    15ca <dumpPCM8+0x44a>
mov    -0x2c(%rbp),%r12d
mov    %r12d,%esi
cmp    $0x8,%r12d
jae    148b <dumpPCM8+0x30b>
xor    %eax,%eax
mov    -0x38(%rbp),%rcx
jmp    1570 <dumpPCM8+0x3f0>
movabs $0xffffffffffffffe,%r12
ff ff 0f
movabs $0x8080808080808080,%r13
80 80 80
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x1,%r15d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    -0x40(%rbp),%rcx
call   1040 <fread@plt>
mov    0x2c98(%rip),%rcx
cmp    (%rcx),%eax
jne    15ca <dumpPCM8+0x44a>
test   %eax,%eax
jle    143d <dumpPCM8+0x2bd>
mov    %eax,%ecx
cmp    $0x8,%eax
jae    1360 <dumpPCM8+0x1e0>
xor    %edx,%edx
jmp    1430 <dumpPCM8+0x2b0>
xchg   %ax,%ax
cmp    $0x20,%eax
jae    136c <dumpPCM8+0x1ec>
xor    %edx,%edx
jmp    1404 <dumpPCM8+0x284>
mov    %ecx,%edx
and    $0xffffffe0,%edx
lea    -0x20(%rdx),%rsi
mov    %rsi,%r8
shr    $0x5,%r8
add    $0x1,%r8
test   %rsi,%rsi
movaps 0xc76(%rip),%xmm2
je     147a <dumpPCM8+0x2fa>
mov    %r8,%rsi
and    %r12,%rsi
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movaps (%rbx,%rdi,1),%xmm0
xorps  %xmm2,%xmm0
movaps 0x10(%rbx,%rdi,1),%xmm1
xorps  %xmm2,%xmm1
movaps %xmm0,(%rbx,%rdi,1)
movaps %xmm1,0x10(%rbx,%rdi,1)
movaps 0x20(%rbx,%rdi,1),%xmm0
xorps  %xmm2,%xmm0
movaps 0x30(%rbx,%rdi,1),%xmm1
xorps  %xmm2,%xmm1
movaps %xmm0,0x20(%rbx,%rdi,1)
movaps %xmm1,0x30(%rbx,%rdi,1)
add    $0x40,%rdi
add    $0xfffffffffffffffe,%rsi
jne    13a0 <dumpPCM8+0x220>
test   $0x1,%r8b
je     13fa <dumpPCM8+0x27a>
movaps (%rbx,%rdi,1),%xmm0
xorps  %xmm2,%xmm0
movaps 0x10(%rbx,%rdi,1),%xmm1
xorps  %xmm2,%xmm1
movaps %xmm0,(%rbx,%rdi,1)
movaps %xmm1,0x10(%rbx,%rdi,1)
cmp    %rcx,%rdx
je     143d <dumpPCM8+0x2bd>
test   $0x18,%cl
je     1430 <dumpPCM8+0x2b0>
mov    %rdx,%rsi
mov    %ecx,%edx
and    $0xfffffff8,%edx
nopl   0x0(%rax)
xor    %r13,(%rbx,%rsi,1)
add    $0x8,%rsi
cmp    %rsi,%rdx
jne    1410 <dumpPCM8+0x290>
cmp    %rcx,%rdx
je     143d <dumpPCM8+0x2bd>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorb   $0x80,(%rbx,%rdx,1)
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    1430 <dumpPCM8+0x2b0>
mov    $0x1,%r15d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %eax,%edx
mov    -0x38(%rbp),%rcx
call   10a0 <fwrite@plt>
mov    0x2b7b(%rip),%rcx
cmp    (%rcx),%eax
jne    15ca <dumpPCM8+0x44a>
mov    -0x2c(%rbp),%ecx
sub    %eax,%ecx
mov    %ecx,-0x2c(%rbp)
cmp    %eax,%ecx
jge    1320 <dumpPCM8+0x1a0>
jmp    12b2 <dumpPCM8+0x132>
xor    %edi,%edi
test   $0x1,%r8b
jne    13e2 <dumpPCM8+0x262>
jmp    13fa <dumpPCM8+0x27a>
cmp    $0x20,%r12d
jae    149c <dumpPCM8+0x31c>
xor    %eax,%eax
mov    -0x38(%rbp),%rcx
jmp    1536 <dumpPCM8+0x3b6>
mov    %esi,%eax
and    $0xffffffe0,%eax
lea    -0x20(%rax),%rdx
mov    %rdx,%r8
shr    $0x5,%r8
add    $0x1,%r8
test   %rdx,%rdx
mov    -0x38(%rbp),%rcx
je     1507 <dumpPCM8+0x387>
mov    %r8,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %edx,%edx
movaps 0xb37(%rip),%xmm0
movaps (%rbx,%rdx,1),%xmm1
xorps  %xmm0,%xmm1
movaps 0x10(%rbx,%rdx,1),%xmm2
xorps  %xmm0,%xmm2
movaps %xmm1,(%rbx,%rdx,1)
movaps %xmm2,0x10(%rbx,%rdx,1)
movaps 0x20(%rbx,%rdx,1),%xmm1
xorps  %xmm0,%xmm1
movaps 0x30(%rbx,%rdx,1),%xmm2
xorps  %xmm0,%xmm2
movaps %xmm1,0x20(%rbx,%rdx,1)
movaps %xmm2,0x30(%rbx,%rdx,1)
add    $0x40,%rdx
add    $0xfffffffffffffffe,%rdi
jne    14c9 <dumpPCM8+0x349>
jmp    1509 <dumpPCM8+0x389>
xor    %edx,%edx
test   $0x1,%r8b
je     152b <dumpPCM8+0x3ab>
movaps 0xaea(%rip),%xmm0
movaps (%rbx,%rdx,1),%xmm1
xorps  %xmm0,%xmm1
xorps  0x10(%rbx,%rdx,1),%xmm0
movaps %xmm1,(%rbx,%rdx,1)
movaps %xmm0,0x10(%rbx,%rdx,1)
cmp    %rsi,%rax
je     157d <dumpPCM8+0x3fd>
test   $0x18,%sil
je     1570 <dumpPCM8+0x3f0>
mov    %rax,%rdx
mov    %esi,%eax
and    $0xfffffff8,%eax
movabs $0x8080808080808080,%rdi
80 80 80
nopl   0x0(%rax,%rax,1)
xor    %rdi,(%rbx,%rdx,1)
add    $0x8,%rdx
cmp    %rdx,%rax
jne    1550 <dumpPCM8+0x3d0>
cmp    %rsi,%rax
je     157d <dumpPCM8+0x3fd>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xorb   $0x80,(%rbx,%rax,1)
add    $0x1,%rax
cmp    %rax,%rsi
jne    1570 <dumpPCM8+0x3f0>
mov    $0x1,%r15d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r12d,%edx
call   10a0 <fwrite@plt>
cmp    %r12d,%eax
jne    15ca <dumpPCM8+0x44a>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    0x2a40(%rip),%rcx
mov    $0x1,%r15d
cmp    (%rcx),%rax
je     15ca <dumpPCM8+0x44a>
mov    (%r14),%edx
mov    -0x40(%rbp),%rdi
mov    -0x50(%rbp),%rsi
call   1080 <fseek@plt>
mov    %rax,%r15
shr    $0x3f,%r15
mov    %r15d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@BUFSIZ = global i32 0
@__const.dumpPCM8.wavhead = [44 x i8] c"RIFF\00\00\00\00WAVEfmt \10\00\00\00\01\00\01\00\00\00\00\00\00\00\00\00\01\00\08\00data\00\00\00\00"
@.str = [3 x i8] c"wb\00"
@SEEK_SET = global i32 0
@EOF = global i64 0
define i32 @dumpPCM8(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i64
%22 = alloca [44 x i8]
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
store i32* %0, i32** %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
%26 = load i32, i32* @BUFSIZ
%27 = zext i32 %26 to i64
%28 = call i8* @llvm.stacksave()
store i8* %28, i8** %20
%29 = alloca i8, i64 %27
store i64 %27, i64* %21
%30 = bitcast [44 x i8]* %22 to i8*
%31 = load i32*, i32** %8
%32 = call i64 @ftell(i32* %31)
store i64 %32, i64* %14
%33 = load i64, i64* %14
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %36
35: ; preds = %6
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
36: ; preds = %6
%37 = load i8*, i8** %13
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %38, i32** %15
%39 = load i32*, i32** %15
%40 = icmp ne i32* %39, null
br i1 %40, label %42, label %41
41: ; preds = %36
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
42: ; preds = %36
%43 = load i32, i32* %10
%44 = load i32, i32* %11
%45 = mul nsw i32 %43, %44
store i32 %45, i32* %17
%46 = load i32, i32* %17
%47 = add nsw i32 %46, 8
store i32 %47, i32* %18
%48 = load i32, i32* %18
%49 = getelementptr inbounds [44 x i8], [44 x i8]* %22, i64 0, i64 0
%50 = getelementptr inbounds i8, i8* %49, i64 4
%51 = call i32 @write32le(i32 %48, i8* %50)
%52 = load i32, i32* %17
%53 = getelementptr inbounds [44 x i8], [44 x i8]* %22, i64 0, i64 0
%54 = getelementptr inbounds i8, i8* %53, i64 40
%55 = call i32 @write32le(i32 %52, i8* %54)
%56 = load i32, i32* %11
%57 = getelementptr inbounds [44 x i8], [44 x i8]* %22, i64 0, i64 0
%58 = getelementptr inbounds i8, i8* %57, i64 22
%59 = call i32 @write16le(i32 %56, i8* %58)
%60 = load i32, i32* %12
%61 = getelementptr inbounds [44 x i8], [44 x i8]* %22, i64 0, i64 0
%62 = getelementptr inbounds i8, i8* %61, i64 24
%63 = call i32 @write32le(i32 %60, i8* %62)
%64 = load i32, i32* %12
%65 = load i32, i32* %11
%66 = mul nsw i32 %64, %65
%67 = getelementptr inbounds [44 x i8], [44 x i8]* %22, i64 0, i64 0
%68 = getelementptr inbounds i8, i8* %67, i64 28
%69 = call i32 @write32le(i32 %66, i8* %68)
%70 = getelementptr inbounds [44 x i8], [44 x i8]* %22, i64 0, i64 0
%71 = load i32*, i32** %15
%72 = call i32 @fwrite(i8* %70, i32 1, i32 44, i32* %71)
%73 = icmp ne i32 %72, 44
br i1 %73, label %74, label %75
74: ; preds = %42
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
75: ; preds = %42
%76 = load i32*, i32** %8
%77 = load i32, i32* %9
%78 = load i32, i32* @SEEK_SET
%79 = call i64 @fseek(i32* %76, i32 %77, i32 %78)
%80 = icmp slt i64 %79, 0
br i1 %80, label %81, label %82
81: ; preds = %75
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
82: ; preds = %75
%83 = load i32, i32* %10
store i32 %83, i32* %16
br label %84
84: ; preds = %119, %82
%85 = load i32, i32* %16
%86 = load i32, i32* @BUFSIZ
%87 = icmp sge i32 %85, %86
br i1 %87, label %88, label %123
88: ; preds = %84
%89 = load i32, i32* @BUFSIZ
%90 = load i32*, i32** %8
%91 = call i32 @fread(i8* %29, i32 1, i32 %89, i32* %90)
%92 = load i32, i32* @BUFSIZ
%93 = icmp ne i32 %91, %92
br i1 %93, label %94, label %95
94: ; preds = %88
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
95: ; preds = %88
store i32 0, i32* %24
br label %96
96: ; preds = %108, %95
%97 = load i32, i32* %24
%98 = load i32, i32* @BUFSIZ
%99 = icmp slt i32 %97, %98
br i1 %99, label %100, label %111
100: ; preds = %96
%101 = load i32, i32* %24
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %29, i64 %102
%104 = load i8, i8* %103
%105 = zext i8 %104 to i32
%106 = add nsw i32 %105, 128
%107 = trunc i32 %106 to i8
store i8 %107, i8* %103
br label %108
108: ; preds = %100
%109 = load i32, i32* %24
%110 = add nsw i32 %109, 1
store i32 %110, i32* %24
br label %96
111: ; preds = %96
%112 = load i32, i32* @BUFSIZ
%113 = load i32*, i32** %15
%114 = call i32 @fwrite(i8* %29, i32 1, i32 %112, i32* %113)
%115 = load i32, i32* @BUFSIZ
%116 = icmp ne i32 %114, %115
br i1 %116, label %117, label %118
117: ; preds = %111
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
118: ; preds = %111
br label %119
119: ; preds = %118
%120 = load i32, i32* @BUFSIZ
%121 = load i32, i32* %16
%122 = sub nsw i32 %121, %120
store i32 %122, i32* %16
br label %84
123: ; preds = %84
%124 = load i32, i32* %16
%125 = icmp sgt i32 %124, 0
br i1 %125, label %126, label %157
126: ; preds = %123
%127 = load i32, i32* %16
%128 = load i32*, i32** %8
%129 = call i32 @fread(i8* %29, i32 1, i32 %127, i32* %128)
%130 = load i32, i32* %16
%131 = icmp ne i32 %129, %130
br i1 %131, label %132, label %133
132: ; preds = %126
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
133: ; preds = %126
store i32 0, i32* %25
br label %134
134: ; preds = %146, %133
%135 = load i32, i32* %25
%136 = load i32, i32* %16
%137 = icmp slt i32 %135, %136
br i1 %137, label %138, label %149
138: ; preds = %134
%139 = load i32, i32* %25
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds i8, i8* %29, i64 %140
%142 = load i8, i8* %141
%143 = zext i8 %142 to i32
%144 = add nsw i32 %143, 128
%145 = trunc i32 %144 to i8
store i8 %145, i8* %141
br label %146
146: ; preds = %138
%147 = load i32, i32* %25
%148 = add nsw i32 %147, 1
store i32 %148, i32* %25
br label %134
149: ; preds = %134
%150 = load i32, i32* %16
%151 = load i32*, i32** %15
%152 = call i32 @fwrite(i8* %29, i32 1, i32 %150, i32* %151)
%153 = load i32, i32* %16
%154 = icmp ne i32 %152, %153
br i1 %154, label %155, label %156
155: ; preds = %149
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
156: ; preds = %149
br label %157
157: ; preds = %156, %123
%158 = load i32*, i32** %15
%159 = call i64 @fclose(i32* %158)
%160 = load i64, i64* @EOF
%161 = icmp eq i64 %159, %160
br i1 %161, label %162, label %163
162: ; preds = %157
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
163: ; preds = %157
%164 = load i32*, i32** %8
%165 = load i64, i64* %14
%166 = trunc i64 %165 to i32
%167 = load i32, i32* @SEEK_SET
%168 = call i64 @fseek(i32* %164, i32 %166, i32 %167)
%169 = icmp slt i64 %168, 0
br i1 %169, label %170, label %171
170: ; preds = %163
store i32 1, i32* %7
store i32 1, i32* %23
br label %172
171: ; preds = %163
store i32 0, i32* %7
store i32 1, i32* %23
br label %172
172: ; preds = %171, %170, %162, %155, %132, %117, %94, %81, %74, %41, %35
%173 = load i8*, i8** %20
%174 = load i32, i32* %7
ret i32 %174
}

LLVM IR (-O2):
@BUFSIZ = global i32 0
@__const.dumpPCM8.wavhead = [44 x i8] c"RIFF\00\00\00\00WAVEfmt \10\00\00\00\01\00\01\00\00\00\00\00\00\00\00\00\01\00\08\00data\00\00\00\00"
@.str = [3 x i8] c"wb\00"
@SEEK_SET = global i32 0
@EOF = global i64 0
define i32 @dumpPCM8(i32* nocapture %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* nocapture %5) {
%7 = alloca [44 x i8]
%8 = load i32, i32* @BUFSIZ
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
%11 = getelementptr inbounds [44 x i8], [44 x i8]* %7, i64 0, i64 0
%12 = tail call i64 @ftell(i32* %0)
%13 = icmp slt i64 %12, 0
br i1 %13, label %241, label %14
14: ; preds = %6
%15 = tail call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i32* %15, null
br i1 %16, label %241, label %17
17: ; preds = %14
%18 = mul nsw i32 %3, %2
%19 = add nsw i32 %18, 8
%20 = getelementptr inbounds [44 x i8], [44 x i8]* %7, i64 0, i64 4
%21 = call i32 @write32le(i32 %19, i8* %20)
%22 = getelementptr inbounds [44 x i8], [44 x i8]* %7, i64 0, i64 40
%23 = call i32 @write32le(i32 %18, i8* %22)
%24 = getelementptr inbounds [44 x i8], [44 x i8]* %7, i64 0, i64 22
%25 = call i32 @write16le(i32 %3, i8* %24)
%26 = getelementptr inbounds [44 x i8], [44 x i8]* %7, i64 0, i64 24
%27 = call i32 @write32le(i32 %4, i8* %26)
%28 = mul nsw i32 %4, %3
%29 = getelementptr inbounds [44 x i8], [44 x i8]* %7, i64 0, i64 28
%30 = call i32 @write32le(i32 %28, i8* %29)
%31 = call i32 @fwrite(i8* %11, i32 1, i32 44, i32* %15)
%32 = icmp eq i32 %31, 44
br i1 %32, label %33, label %241
33: ; preds = %17
%34 = load i32, i32* @SEEK_SET
%35 = call i64 @fseek(i32* %0, i32 %1, i32 %34)
%36 = icmp slt i64 %35, 0
br i1 %36, label %241, label %37
37: ; preds = %33
%38 = load i32, i32* @BUFSIZ
%39 = icmp sgt i32 %38, %2
br i1 %39, label %139, label %40
40: ; preds = %37, %136
%41 = phi i32 [ %133, %136 ], [ %38, %37 ]
%42 = phi i32 [ %137, %136 ], [ %2, %37 ]
%43 = call i32 @fread(i8* %10, i32 1, i32 %41, i32* %0)
%44 = load i32, i32* @BUFSIZ
%45 = icmp eq i32 %43, %44
br i1 %45, label %46, label %241
46: ; preds = %40
%47 = icmp sgt i32 %43, 0
br i1 %47, label %48, label %132
48: ; preds = %46
%49 = zext i32 %43 to i64
%50 = icmp ult i32 %43, 8
br i1 %50, label %123, label %51
51: ; preds = %48
%52 = icmp ult i32 %43, 32
br i1 %52, label %108, label %53
53: ; preds = %51
%54 = and i64 %49, 4294967264
%55 = add nsw i64 %54, -32
%56 = lshr exact i64 %55, 5
%57 = add nuw nsw i64 %56, 1
%58 = and i64 %57, 1
%59 = icmp eq i64 %55, 0
br i1 %59, label %89, label %60
60: ; preds = %53
%61 = and i64 %57, 1152921504606846974
br label %62
62: ; preds = %62, %60
%63 = phi i64 [ 0, %60 ], [ %86, %62 ]
%64 = phi i64 [ 0, %60 ], [ %87, %62 ]
%65 = getelementptr inbounds i8, i8* %10, i64 %63
%66 = bitcast i8* %65 to <16 x i8>*
%67 = load <16 x i8>, <16 x i8>* %66
%68 = getelementptr inbounds i8, i8* %65, i64 16
%69 = bitcast i8* %68 to <16 x i8>*
%70 = load <16 x i8>, <16 x i8>* %69
%71 = xor <16 x i8> %67, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%72 = xor <16 x i8> %70, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%73 = bitcast i8* %65 to <16 x i8>*
store <16 x i8> %71, <16 x i8>* %73
%74 = bitcast i8* %68 to <16 x i8>*
store <16 x i8> %72, <16 x i8>* %74
%75 = or i64 %63, 32
%76 = getelementptr inbounds i8, i8* %10, i64 %75
%77 = bitcast i8* %76 to <16 x i8>*
%78 = load <16 x i8>, <16 x i8>* %77
%79 = getelementptr inbounds i8, i8* %76, i64 16
%80 = bitcast i8* %79 to <16 x i8>*
%81 = load <16 x i8>, <16 x i8>* %80
%82 = xor <16 x i8> %78, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%83 = xor <16 x i8> %81, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%84 = bitcast i8* %76 to <16 x i8>*
store <16 x i8> %82, <16 x i8>* %84
%85 = bitcast i8* %79 to <16 x i8>*
store <16 x i8> %83, <16 x i8>* %85
%86 = add nuw i64 %63, 64
%87 = add i64 %64, 2
%88 = icmp eq i64 %87, %61
br i1 %88, label %89, label %62
89: ; preds = %62, %53
%90 = phi i64 [ 0, %53 ], [ %86, %62 ]
%91 = icmp eq i64 %58, 0
br i1 %91, label %103, label %92
92: ; preds = %89
%93 = getelementptr inbounds i8, i8* %10, i64 %90
%94 = bitcast i8* %93 to <16 x i8>*
%95 = load <16 x i8>, <16 x i8>* %94
%96 = getelementptr inbounds i8, i8* %93, i64 16
%97 = bitcast i8* %96 to <16 x i8>*
%98 = load <16 x i8>, <16 x i8>* %97
%99 = xor <16 x i8> %95, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%100 = xor <16 x i8> %98, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%101 = bitcast i8* %93 to <16 x i8>*
store <16 x i8> %99, <16 x i8>* %101
%102 = bitcast i8* %96 to <16 x i8>*
store <16 x i8> %100, <16 x i8>* %102
br label %103
103: ; preds = %89, %92
%104 = icmp eq i64 %54, %49
br i1 %104, label %132, label %105
105: ; preds = %103
%106 = and i64 %49, 24
%107 = icmp eq i64 %106, 0
br i1 %107, label %123, label %108
108: ; preds = %51, %105
%109 = phi i64 [ %54, %105 ], [ 0, %51 ]
%110 = zext i32 %43 to i64
%111 = and i64 %110, 4294967288
br label %112
112: ; preds = %112, %108
%113 = phi i64 [ %109, %108 ], [ %119, %112 ]
%114 = getelementptr inbounds i8, i8* %10, i64 %113
%115 = bitcast i8* %114 to <8 x i8>*
%116 = load <8 x i8>, <8 x i8>* %115
%117 = xor <8 x i8> %116, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%118 = bitcast i8* %114 to <8 x i8>*
store <8 x i8> %117, <8 x i8>* %118
%119 = add nuw i64 %113, 8
%120 = icmp eq i64 %119, %111
br i1 %120, label %121, label %112
121: ; preds = %112
%122 = icmp eq i64 %111, %110
br i1 %122, label %132, label %123
123: ; preds = %48, %105, %121
%124 = phi i64 [ 0, %48 ], [ %54, %105 ], [ %111, %121 ]
br label %125
125: ; preds = %123, %125
%126 = phi i64 [ %130, %125 ], [ %124, %123 ]
%127 = getelementptr inbounds i8, i8* %10, i64 %126
%128 = load i8, i8* %127
%129 = xor i8 %128, -128
store i8 %129, i8* %127
%130 = add nuw nsw i64 %126, 1
%131 = icmp eq i64 %130, %49
br i1 %131, label %132, label %125
132: ; preds = %125, %103, %121, %46
%133 = call i32 @fwrite(i8* %10, i32 1, i32 %43, i32* %15)
%134 = load i32, i32* @BUFSIZ
%135 = icmp eq i32 %133, %134
br i1 %135, label %136, label %241
136: ; preds = %132
%137 = sub nsw i32 %42, %133
%138 = icmp slt i32 %137, %133
br i1 %138, label %139, label %40
139: ; preds = %136, %37
%140 = phi i32 [ %2, %37 ], [ %137, %136 ]
%141 = icmp sgt i32 %140, 0
br i1 %141, label %142, label %231
142: ; preds = %139
%143 = call i32 @fread(i8* %10, i32 1, i32 %140, i32* %0)
%144 = icmp eq i32 %143, %140
br i1 %144, label %145, label %241
145: ; preds = %142
%146 = zext i32 %140 to i64
%147 = icmp ult i32 %140, 8
br i1 %147, label %219, label %148
148: ; preds = %145
%149 = icmp ult i32 %140, 32
br i1 %149, label %205, label %150
150: ; preds = %148
%151 = and i64 %146, 4294967264
%152 = add nsw i64 %151, -32
%153 = lshr exact i64 %152, 5
%154 = add nuw nsw i64 %153, 1
%155 = and i64 %154, 1
%156 = icmp eq i64 %152, 0
br i1 %156, label %186, label %157
157: ; preds = %150
%158 = and i64 %154, 1152921504606846974
br label %159
159: ; preds = %159, %157
%160 = phi i64 [ 0, %157 ], [ %183, %159 ]
%161 = phi i64 [ 0, %157 ], [ %184, %159 ]
%162 = getelementptr inbounds i8, i8* %10, i64 %160
%163 = bitcast i8* %162 to <16 x i8>*
%164 = load <16 x i8>, <16 x i8>* %163
%165 = getelementptr inbounds i8, i8* %162, i64 16
%166 = bitcast i8* %165 to <16 x i8>*
%167 = load <16 x i8>, <16 x i8>* %166
%168 = xor <16 x i8> %164, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%169 = xor <16 x i8> %167, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%170 = bitcast i8* %162 to <16 x i8>*
store <16 x i8> %168, <16 x i8>* %170
%171 = bitcast i8* %165 to <16 x i8>*
store <16 x i8> %169, <16 x i8>* %171
%172 = or i64 %160, 32
%173 = getelementptr inbounds i8, i8* %10, i64 %172
%174 = bitcast i8* %173 to <16 x i8>*
%175 = load <16 x i8>, <16 x i8>* %174
%176 = getelementptr inbounds i8, i8* %173, i64 16
%177 = bitcast i8* %176 to <16 x i8>*
%178 = load <16 x i8>, <16 x i8>* %177
%179 = xor <16 x i8> %175, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%180 = xor <16 x i8> %178, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%181 = bitcast i8* %173 to <16 x i8>*
store <16 x i8> %179, <16 x i8>* %181
%182 = bitcast i8* %176 to <16 x i8>*
store <16 x i8> %180, <16 x i8>* %182
%183 = add nuw i64 %160, 64
%184 = add i64 %161, 2
%185 = icmp eq i64 %184, %158
br i1 %185, label %186, label %159
186: ; preds = %159, %150
%187 = phi i64 [ 0, %150 ], [ %183, %159 ]
%188 = icmp eq i64 %155, 0
br i1 %188, label %200, label %189
189: ; preds = %186
%190 = getelementptr inbounds i8, i8* %10, i64 %187
%191 = bitcast i8* %190 to <16 x i8>*
%192 = load <16 x i8>, <16 x i8>* %191
%193 = getelementptr inbounds i8, i8* %190, i64 16
%194 = bitcast i8* %193 to <16 x i8>*
%195 = load <16 x i8>, <16 x i8>* %194
%196 = xor <16 x i8> %192, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%197 = xor <16 x i8> %195, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%198 = bitcast i8* %190 to <16 x i8>*
store <16 x i8> %196, <16 x i8>* %198
%199 = bitcast i8* %193 to <16 x i8>*
store <16 x i8> %197, <16 x i8>* %199
br label %200
200: ; preds = %186, %189
%201 = icmp eq i64 %151, %146
br i1 %201, label %228, label %202
202: ; preds = %200
%203 = and i64 %146, 24
%204 = icmp eq i64 %203, 0
br i1 %204, label %219, label %205
205: ; preds = %148, %202
%206 = phi i64 [ %151, %202 ], [ 0, %148 ]
%207 = and i64 %146, 4294967288
br label %208
208: ; preds = %208, %205
%209 = phi i64 [ %206, %205 ], [ %215, %208 ]
%210 = getelementptr inbounds i8, i8* %10, i64 %209
%211 = bitcast i8* %210 to <8 x i8>*
%212 = load <8 x i8>, <8 x i8>* %211
%213 = xor <8 x i8> %212, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
%214 = bitcast i8* %210 to <8 x i8>*
store <8 x i8> %213, <8 x i8>* %214
%215 = add nuw i64 %209, 8
%216 = icmp eq i64 %215, %207
br i1 %216, label %217, label %208
217: ; preds = %208
%218 = icmp eq i64 %207, %146
br i1 %218, label %228, label %219
219: ; preds = %145, %202, %217
%220 = phi i64 [ 0, %145 ], [ %151, %202 ], [ %207, %217 ]
br label %221
221: ; preds = %219, %221
%222 = phi i64 [ %226, %221 ], [ %220, %219 ]
%223 = getelementptr inbounds i8, i8* %10, i64 %222
%224 = load i8, i8* %223
%225 = xor i8 %224, -128
store i8 %225, i8* %223
%226 = add nuw nsw i64 %222, 1
%227 = icmp eq i64 %226, %146
br i1 %227, label %228, label %221
228: ; preds = %221, %217, %200
%229 = call i32 @fwrite(i8* %10, i32 1, i32 %140, i32* %15)
%230 = icmp eq i32 %229, %140
br i1 %230, label %231, label %241
231: ; preds = %228, %139
%232 = call i64 @fclose(i32* %15)
%233 = load i64, i64* @EOF
%234 = icmp eq i64 %232, %233
br i1 %234, label %241, label %235
235: ; preds = %231
%236 = trunc i64 %12 to i32
%237 = load i32, i32* @SEEK_SET
%238 = call i64 @fseek(i32* %0, i32 %236, i32 %237)
%239 = lshr i64 %238, 63
%240 = trunc i64 %239 to i32
br label %241
241: ; preds = %40, %132, %142, %235, %231, %33, %17, %14, %6, %228
%242 = phi i32 [ 1, %228 ], [ 1, %6 ], [ 1, %14 ], [ 1, %17 ], [ 1, %33 ], [ 1, %231 ], [ %240, %235 ], [ 1, %142 ], [ 1, %132 ], [ 1, %40 ]
ret i32 %242
}