#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 EOF;
int fputc(unsigned int const, int /*<<< orphan*/ *const);
int fwrite(unsigned char **, unsigned int const, int,
           int /*<<< orphan*/ *const);
int /*<<< orphan*/ pm_error(char *, ...);
void pm_putraw(FILE *const file, unsigned int const value,
               unsigned int const bytes) {
  if (bytes == 1) {
    int rc;
    rc = fputc(value, file);
    if (rc == EOF)
      pm_error("Error writing 1 byte sample to file.");
  } else {
    int shift;
    unsigned char outval[4];
    int cursor;
    int n_written;
    cursor = 0;
    for (shift = (bytes - 1) * 8; shift >= 0; shift -= 8) {
      outval[cursor++] = (value >> shift) & 0xFF;
    }
    n_written = fwrite(&outval, bytes, 1, file);
    if (n_written == 0)
      pm_error("Error writing %d byte sample to file.", bytes);
  }
}


x86 assembly (clang, -O0):
<pm_putraw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jne    1180 <pm_putraw+0x50>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <fputc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%eax
jne    117b <pm_putraw+0x4b>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <pm_error@plt>
jmp    1203 <pm_putraw+0xd3>
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
shl    $0x3,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     11cb <pm_putraw+0x9b>
mov    -0xc(%rbp),%eax
mov    -0x18(%rbp),%ecx
shr    %cl,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x20(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
cltq
mov    %cl,-0x1c(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x18(%rbp)
jmp    1193 <pm_putraw+0x63>
lea    -0x1c(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
call   1040 <fwrite@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    11fe <pm_putraw+0xce>
mov    -0x10(%rbp),%esi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1050 <pm_error@plt>
jmp    1203 <pm_putraw+0xd3>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_putraw>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r8
cmp    $0x1,%edx
jne    116a <pm_putraw+0x3a>
mov    %esi,%edi
mov    %r8,%rsi
call   1030 <fputc@plt>
mov    0x2e9b(%rip),%rcx
cmp    (%rcx),%eax
jne    19de <pm_putraw+0x8ae>
lea    0xf34(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <pm_error@plt>
mov    %edx,%r14d
lea    0x0(,%r14,8),%ecx
add    $0xfffffff8,%ecx
js     19b4 <pm_putraw+0x884>
mov    %ecx,%edx
shr    $0x3,%edx
add    $0x1,%edx
cmp    $0x78,%ecx
jae    1192 <pm_putraw+0x62>
xor    %edi,%edi
jmp    19a0 <pm_putraw+0x870>
mov    %edx,%edi
movd   %ecx,%xmm0
pshufd $0x0,%xmm0,%xmm15
movdqa 0xe59(%rip),%xmm13
paddd  %xmm15,%xmm13
movdqa 0xe5b(%rip),%xmm14
paddd  %xmm15,%xmm14
movdqa 0xe5d(%rip),%xmm9
paddd  %xmm15,%xmm9
paddd  0xe5f(%rip),%xmm15
and    $0xfffffff0,%edi
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm8
lea    -0x10(%rdi),%rbx
mov    %rbx,%rax
shr    $0x4,%rax
add    $0x1,%rax
mov    %eax,%r9d
and    $0x3,%r9d
cmp    $0x30,%rbx
jae    1201 <pm_putraw+0xd1>
xor    %ebx,%ebx
jmp    17f6 <pm_putraw+0x6c6>
and    $0xfffffffffffffffc,%rax
xor    %ebx,%ebx
movaps 0xe31(%rip),%xmm12
movdqa 0xe58(%rip),%xmm10
movdqa 0xe5f(%rip),%xmm11
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
pshuflw $0xfe,%xmm13,%xmm3
movdqa %xmm8,%xmm4
psrld  %xmm3,%xmm4
pshuflw $0x54,%xmm13,%xmm3
movdqa %xmm8,%xmm0
psrld  %xmm3,%xmm0
pshufd $0xee,%xmm13,%xmm3
pshuflw $0xfe,%xmm3,%xmm5
movdqa %xmm8,%xmm7
psrld  %xmm5,%xmm7
punpcklqdq %xmm4,%xmm0
pshuflw $0x54,%xmm3,%xmm3
movdqa %xmm8,%xmm4
psrld  %xmm3,%xmm4
punpckhqdq %xmm7,%xmm4
pshuflw $0xfe,%xmm14,%xmm3
movdqa %xmm8,%xmm5
psrld  %xmm3,%xmm5
shufps $0xcc,%xmm4,%xmm0
pshuflw $0x54,%xmm14,%xmm3
movdqa %xmm8,%xmm4
psrld  %xmm3,%xmm4
pshufd $0xee,%xmm14,%xmm3
pshuflw $0xfe,%xmm3,%xmm7
movdqa %xmm8,%xmm2
psrld  %xmm7,%xmm2
punpcklqdq %xmm5,%xmm4
pshuflw $0x54,%xmm3,%xmm3
movdqa %xmm8,%xmm5
psrld  %xmm3,%xmm5
punpckhqdq %xmm2,%xmm5
pshuflw $0xfe,%xmm9,%xmm2
movdqa %xmm8,%xmm7
psrld  %xmm2,%xmm7
shufps $0xcc,%xmm5,%xmm4
pshuflw $0x54,%xmm9,%xmm2
movdqa %xmm8,%xmm3
psrld  %xmm2,%xmm3
pshufd $0xee,%xmm9,%xmm2
pshuflw $0xfe,%xmm2,%xmm5
movdqa %xmm8,%xmm1
psrld  %xmm5,%xmm1
punpcklqdq %xmm7,%xmm3
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm8,%xmm5
psrld  %xmm2,%xmm5
punpckhqdq %xmm1,%xmm5
pshuflw $0xfe,%xmm15,%xmm2
movdqa %xmm8,%xmm7
psrld  %xmm2,%xmm7
shufps $0xcc,%xmm5,%xmm3
pshuflw $0x54,%xmm15,%xmm2
movdqa %xmm8,%xmm5
psrld  %xmm2,%xmm5
pshufd $0xee,%xmm15,%xmm2
pshuflw $0xfe,%xmm2,%xmm6
movdqa %xmm8,%xmm1
psrld  %xmm6,%xmm1
punpcklqdq %xmm7,%xmm5
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm8,%xmm7
psrld  %xmm2,%xmm7
punpckhqdq %xmm1,%xmm7
shufps $0xcc,%xmm7,%xmm5
andps  %xmm12,%xmm5
andps  %xmm12,%xmm3
packuswb %xmm3,%xmm5
andps  %xmm12,%xmm4
andps  %xmm12,%xmm0
packuswb %xmm0,%xmm4
packuswb %xmm4,%xmm5
movdqu %xmm5,0x4(%rsp,%rbx,1)
movdqa %xmm15,%xmm6
movdqa 0xcc1(%rip),%xmm0
paddd  %xmm0,%xmm6
movdqa %xmm9,%xmm3
paddd  %xmm0,%xmm3
movdqa %xmm14,%xmm1
movdqa %xmm13,%xmm2
paddd  %xmm0,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm8,%xmm7
psrld  %xmm4,%xmm7
paddd  %xmm0,%xmm1
pshuflw $0x54,%xmm2,%xmm4
movdqa %xmm8,%xmm0
psrld  %xmm4,%xmm0
pshufd $0xee,%xmm2,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm8,%xmm5
psrld  %xmm4,%xmm5
punpcklqdq %xmm7,%xmm0
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm8,%xmm4
psrld  %xmm2,%xmm4
punpckhqdq %xmm5,%xmm4
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm5
psrld  %xmm2,%xmm5
shufps $0xcc,%xmm4,%xmm0
pshuflw $0x54,%xmm1,%xmm2
movdqa %xmm8,%xmm4
psrld  %xmm2,%xmm4
pshufd $0xee,%xmm1,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm7
psrld  %xmm2,%xmm7
punpcklqdq %xmm5,%xmm4
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm7,%xmm2
pshuflw $0xfe,%xmm3,%xmm1
movdqa %xmm8,%xmm5
psrld  %xmm1,%xmm5
shufps $0xcc,%xmm2,%xmm4
pshuflw $0x54,%xmm3,%xmm1
movdqa %xmm8,%xmm7
psrld  %xmm1,%xmm7
pshufd $0xee,%xmm3,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm3
psrld  %xmm2,%xmm3
punpcklqdq %xmm5,%xmm7
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm3,%xmm2
pshuflw $0xfe,%xmm6,%xmm1
movdqa %xmm8,%xmm3
psrld  %xmm1,%xmm3
shufps $0xcc,%xmm2,%xmm7
pshuflw $0x54,%xmm6,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
pshufd $0xee,%xmm6,%xmm1
pshuflw $0xfe,%xmm1,%xmm6
movdqa %xmm8,%xmm5
psrld  %xmm6,%xmm5
punpcklqdq %xmm3,%xmm2
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm3
psrld  %xmm1,%xmm3
punpckhqdq %xmm5,%xmm3
shufps $0xcc,%xmm3,%xmm2
andps  %xmm12,%xmm2
andps  %xmm12,%xmm7
packuswb %xmm7,%xmm2
andps  %xmm12,%xmm4
andps  %xmm12,%xmm0
packuswb %xmm0,%xmm4
packuswb %xmm4,%xmm2
movdqu %xmm2,0x14(%rsp,%rbx,1)
movdqa %xmm15,%xmm6
movdqa 0xb5f(%rip),%xmm0
paddd  %xmm0,%xmm6
movdqa %xmm9,%xmm3
paddd  %xmm0,%xmm3
movdqa %xmm14,%xmm1
movdqa %xmm13,%xmm2
paddd  %xmm0,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm8,%xmm7
psrld  %xmm4,%xmm7
paddd  %xmm0,%xmm1
pshuflw $0x54,%xmm2,%xmm4
movdqa %xmm8,%xmm0
psrld  %xmm4,%xmm0
pshufd $0xee,%xmm2,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm8,%xmm5
psrld  %xmm4,%xmm5
punpcklqdq %xmm7,%xmm0
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm8,%xmm4
psrld  %xmm2,%xmm4
punpckhqdq %xmm5,%xmm4
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm5
psrld  %xmm2,%xmm5
shufps $0xcc,%xmm4,%xmm0
pshuflw $0x54,%xmm1,%xmm2
movdqa %xmm8,%xmm4
psrld  %xmm2,%xmm4
pshufd $0xee,%xmm1,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm7
psrld  %xmm2,%xmm7
punpcklqdq %xmm5,%xmm4
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm7,%xmm2
pshuflw $0xfe,%xmm3,%xmm1
movdqa %xmm8,%xmm5
psrld  %xmm1,%xmm5
shufps $0xcc,%xmm2,%xmm4
pshuflw $0x54,%xmm3,%xmm1
movdqa %xmm8,%xmm7
psrld  %xmm1,%xmm7
pshufd $0xee,%xmm3,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm3
psrld  %xmm2,%xmm3
punpcklqdq %xmm5,%xmm7
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm3,%xmm2
pshuflw $0xfe,%xmm6,%xmm1
movdqa %xmm8,%xmm3
psrld  %xmm1,%xmm3
shufps $0xcc,%xmm2,%xmm7
pshuflw $0x54,%xmm6,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
pshufd $0xee,%xmm6,%xmm1
pshuflw $0xfe,%xmm1,%xmm6
movdqa %xmm8,%xmm5
psrld  %xmm6,%xmm5
punpcklqdq %xmm3,%xmm2
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm3
psrld  %xmm1,%xmm3
punpckhqdq %xmm5,%xmm3
shufps $0xcc,%xmm3,%xmm2
andps  %xmm12,%xmm2
andps  %xmm12,%xmm7
packuswb %xmm7,%xmm2
andps  %xmm12,%xmm4
andps  %xmm12,%xmm0
packuswb %xmm0,%xmm4
packuswb %xmm4,%xmm2
movdqu %xmm2,0x24(%rsp,%rbx,1)
movdqa %xmm15,%xmm6
paddd  %xmm10,%xmm6
movdqa %xmm9,%xmm3
paddd  %xmm10,%xmm3
movdqa %xmm14,%xmm1
movdqa %xmm13,%xmm2
paddd  %xmm10,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm8,%xmm7
psrld  %xmm4,%xmm7
paddd  %xmm10,%xmm1
pshuflw $0x54,%xmm2,%xmm4
movdqa %xmm8,%xmm0
psrld  %xmm4,%xmm0
pshufd $0xee,%xmm2,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm8,%xmm5
psrld  %xmm4,%xmm5
punpcklqdq %xmm7,%xmm0
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm8,%xmm4
psrld  %xmm2,%xmm4
punpckhqdq %xmm5,%xmm4
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm5
psrld  %xmm2,%xmm5
shufps $0xcc,%xmm4,%xmm0
pshuflw $0x54,%xmm1,%xmm2
movdqa %xmm8,%xmm4
psrld  %xmm2,%xmm4
pshufd $0xee,%xmm1,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm7
psrld  %xmm2,%xmm7
punpcklqdq %xmm5,%xmm4
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm7,%xmm2
pshuflw $0xfe,%xmm3,%xmm1
movdqa %xmm8,%xmm5
psrld  %xmm1,%xmm5
shufps $0xcc,%xmm2,%xmm4
pshuflw $0x54,%xmm3,%xmm1
movdqa %xmm8,%xmm7
psrld  %xmm1,%xmm7
pshufd $0xee,%xmm3,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm3
psrld  %xmm2,%xmm3
punpcklqdq %xmm5,%xmm7
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm3,%xmm2
pshuflw $0xfe,%xmm6,%xmm1
movdqa %xmm8,%xmm3
psrld  %xmm1,%xmm3
shufps $0xcc,%xmm2,%xmm7
pshuflw $0x54,%xmm6,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
pshufd $0xee,%xmm6,%xmm1
pshuflw $0xfe,%xmm1,%xmm6
movdqa %xmm8,%xmm5
psrld  %xmm6,%xmm5
punpcklqdq %xmm3,%xmm2
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm3
psrld  %xmm1,%xmm3
punpckhqdq %xmm5,%xmm3
shufps $0xcc,%xmm3,%xmm2
andps  %xmm12,%xmm2
andps  %xmm12,%xmm7
packuswb %xmm7,%xmm2
andps  %xmm12,%xmm4
andps  %xmm12,%xmm0
packuswb %xmm0,%xmm4
packuswb %xmm4,%xmm2
movdqu %xmm2,0x34(%rsp,%rbx,1)
add    $0x40,%rbx
paddd  %xmm11,%xmm15
paddd  %xmm11,%xmm9
paddd  %xmm11,%xmm14
paddd  %xmm11,%xmm13
add    $0xfffffffffffffffc,%rax
jne    1230 <pm_putraw+0x100>
test   %r9,%r9
je     1992 <pm_putraw+0x862>
lea    (%rsp,%rbx,1),%rax
add    $0x4,%rax
shl    $0x4,%r9
xor    %ebx,%ebx
movaps 0x82b(%rip),%xmm11
movdqa 0x832(%rip),%xmm10
xchg   %ax,%ax
pshuflw $0xfe,%xmm13,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
pshuflw $0x54,%xmm13,%xmm1
movdqa %xmm8,%xmm3
psrld  %xmm1,%xmm3
pshufd $0xee,%xmm13,%xmm1
pshuflw $0xfe,%xmm1,%xmm4
movdqa %xmm8,%xmm5
psrld  %xmm4,%xmm5
punpcklqdq %xmm2,%xmm3
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm5,%xmm2
pshuflw $0xfe,%xmm14,%xmm1
movdqa %xmm8,%xmm5
psrld  %xmm1,%xmm5
shufps $0xcc,%xmm2,%xmm3
pshuflw $0x54,%xmm14,%xmm1
movdqa %xmm8,%xmm4
psrld  %xmm1,%xmm4
pshufd $0xee,%xmm14,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm7
psrld  %xmm2,%xmm7
punpcklqdq %xmm5,%xmm4
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm7,%xmm2
pshuflw $0xfe,%xmm9,%xmm1
movdqa %xmm8,%xmm7
psrld  %xmm1,%xmm7
shufps $0xcc,%xmm2,%xmm4
pshuflw $0x54,%xmm9,%xmm1
movdqa %xmm8,%xmm5
psrld  %xmm1,%xmm5
pshufd $0xee,%xmm9,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm8,%xmm0
psrld  %xmm2,%xmm0
punpcklqdq %xmm7,%xmm5
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm8,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm0,%xmm2
pshuflw $0xfe,%xmm15,%xmm0
movdqa %xmm8,%xmm1
psrld  %xmm0,%xmm1
shufps $0xcc,%xmm2,%xmm5
pshuflw $0x54,%xmm15,%xmm0
movdqa %xmm8,%xmm2
psrld  %xmm0,%xmm2
pshufd $0xee,%xmm15,%xmm0
pshuflw $0xfe,%xmm0,%xmm7
movdqa %xmm8,%xmm6
psrld  %xmm7,%xmm6
punpcklqdq %xmm1,%xmm2
pshuflw $0x54,%xmm0,%xmm0
movdqa %xmm8,%xmm1
psrld  %xmm0,%xmm1
punpckhqdq %xmm6,%xmm1
shufps $0xcc,%xmm1,%xmm2
andps  %xmm11,%xmm2
andps  %xmm11,%xmm5
packuswb %xmm5,%xmm2
andps  %xmm11,%xmm4
andps  %xmm11,%xmm3
packuswb %xmm3,%xmm4
packuswb %xmm4,%xmm2
movdqu %xmm2,(%rax,%rbx,1)
paddd  %xmm10,%xmm15
paddd  %xmm10,%xmm9
paddd  %xmm10,%xmm14
paddd  %xmm10,%xmm13
add    $0x10,%rbx
cmp    %rbx,%r9
jne    1820 <pm_putraw+0x6f0>
cmp    %rdx,%rdi
je     19b4 <pm_putraw+0x884>
lea    0x0(,%rdi,8),%eax
sub    %eax,%ecx
mov    %esi,%eax
shr    %cl,%eax
mov    %al,0x4(%rsp,%rdi,1)
add    $0x1,%rdi
add    $0xfffffff8,%ecx
cmp    %rdi,%rdx
jne    19a0 <pm_putraw+0x870>
lea    0x4(%rsp),%rdi
mov    %r14d,%esi
mov    $0x1,%edx
mov    %r8,%rcx
call   1040 <fwrite@plt>
test   %eax,%eax
jne    19de <pm_putraw+0x8ae>
lea    0x6e1(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1050 <pm_error@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EOF = global i32 0
@.str = [37 x i8] c"Error writing 1 byte sample to file.\00"
@.str.1 = [38 x i8] c"Error writing %d byte sample to file.\00"
define void @pm_putraw(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x i8]
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = load i32, i32* %6
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %24
14: ; preds = %3
%15 = load i32, i32* %5
%16 = load i32*, i32** %4
%17 = call i32 @fputc(i32 %15, i32* %16)
store i32 %17, i32* %7
%18 = load i32, i32* %7
%19 = load i32, i32* @EOF
%20 = icmp eq i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %14
%22 = call i32 (i8*, ...) @pm_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %23
23: ; preds = %21, %14
br label %55
24: ; preds = %3
store i32 0, i32* %10
%25 = load i32, i32* %6
%26 = sub i32 %25, 1
%27 = mul i32 %26, 8
store i32 %27, i32* %8
br label %28
28: ; preds = %41, %24
%29 = load i32, i32* %8
%30 = icmp sge i32 %29, 0
br i1 %30, label %31, label %44
31: ; preds = %28
%32 = load i32, i32* %5
%33 = load i32, i32* %8
%34 = lshr i32 %32, %33
%35 = and i32 %34, 255
%36 = trunc i32 %35 to i8
%37 = load i32, i32* %10
%38 = add nsw i32 %37, 1
store i32 %38, i32* %10
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 %39
store i8 %36, i8* %40
br label %41
41: ; preds = %31
%42 = load i32, i32* %8
%43 = sub nsw i32 %42, 8
store i32 %43, i32* %8
br label %28
44: ; preds = %28
%45 = bitcast [4 x i8]* %9 to i8**
%46 = load i32, i32* %6
%47 = load i32*, i32** %4
%48 = call i32 @fwrite(i8** %45, i32 %46, i32 1, i32* %47)
store i32 %48, i32* %11
%49 = load i32, i32* %11
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %44
%52 = load i32, i32* %6
%53 = call i32 (i8*, ...) @pm_error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %51, %44
br label %55
55: ; preds = %54, %23
ret void
}

LLVM IR (-O2):
@EOF = global i32 0
@.str = [37 x i8] c"Error writing 1 byte sample to file.\00"
@.str.1 = [38 x i8] c"Error writing %d byte sample to file.\00"
define void @pm_putraw(i32* nocapture %0, i32 %1, i32 %2) {
%4 = alloca [4 x i8]
%5 = icmp eq i32 %2, 1
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = tail call i32 @fputc(i32 %1, i32* %0)
%8 = load i32, i32* @EOF
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %106
10: ; preds = %6
%11 = tail call i32 (i8*, ...) @pm_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %106
12: ; preds = %3
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%14 = shl i32 %2, 3
%15 = add i32 %14, -8
%16 = icmp sgt i32 %15, -1
br i1 %16, label %17, label %99
17: ; preds = %12
%18 = lshr exact i32 %15, 3
%19 = add nuw nsw i32 %18, 1
%20 = zext i32 %19 to i64
%21 = icmp ult i32 %15, 120
br i1 %21, label %87, label %22
22: ; preds = %17
%23 = and i64 %20, 1073741808
%24 = trunc i64 %23 to i32
%25 = mul i32 %24, -8
%26 = add i32 %15, %25
%27 = insertelement <16 x i32> poison, i32 %15, i64 0
%28 = shufflevector <16 x i32> %27, <16 x i32> poison, <16 x i32> zeroinitializer
%29 = add <16 x i32> %28, <i32 0, i32 -8, i32 -16, i32 -24, i32 -32, i32 -40, i32 -48, i32 -56, i32 -64, i32 -72, i32 -80, i32 -88, i32 -96, i32 -104, i32 -112, i32 -120>
%30 = insertelement <16 x i32> poison, i32 %1, i64 0
%31 = shufflevector <16 x i32> %30, <16 x i32> poison, <16 x i32> zeroinitializer
%32 = add nsw i64 %23, -16
%33 = lshr exact i64 %32, 4
%34 = add nuw nsw i64 %33, 1
%35 = and i64 %34, 3
%36 = icmp ult i64 %32, 48
br i1 %36, label %69, label %37
37: ; preds = %22
%38 = and i64 %34, 2305843009213693948
br label %39
39: ; preds = %39, %37
%40 = phi i64 [ 0, %37 ], [ %65, %39 ]
%41 = phi <16 x i32> [ %29, %37 ], [ %66, %39 ]
%42 = phi i64 [ 0, %37 ], [ %67, %39 ]
%43 = lshr <16 x i32> %31, %41
%44 = trunc <16 x i32> %43 to <16 x i8>
%45 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %40
%46 = bitcast i8* %45 to <16 x i8>*
store <16 x i8> %44, <16 x i8>* %46
%47 = or i64 %40, 16
%48 = add <16 x i32> %41, <i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128>
%49 = lshr <16 x i32> %31, %48
%50 = trunc <16 x i32> %49 to <16 x i8>
%51 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %47
%52 = bitcast i8* %51 to <16 x i8>*
store <16 x i8> %50, <16 x i8>* %52
%53 = or i64 %40, 32
%54 = add <16 x i32> %41, <i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256, i32 -256>
%55 = lshr <16 x i32> %31, %54
%56 = trunc <16 x i32> %55 to <16 x i8>
%57 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %53
%58 = bitcast i8* %57 to <16 x i8>*
store <16 x i8> %56, <16 x i8>* %58
%59 = or i64 %40, 48
%60 = add <16 x i32> %41, <i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384, i32 -384>
%61 = lshr <16 x i32> %31, %60
%62 = trunc <16 x i32> %61 to <16 x i8>
%63 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %59
%64 = bitcast i8* %63 to <16 x i8>*
store <16 x i8> %62, <16 x i8>* %64
%65 = add nuw i64 %40, 64
%66 = add <16 x i32> %41, <i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512, i32 -512>
%67 = add i64 %42, 4
%68 = icmp eq i64 %67, %38
br i1 %68, label %69, label %39
69: ; preds = %39, %22
%70 = phi i64 [ 0, %22 ], [ %65, %39 ]
%71 = phi <16 x i32> [ %29, %22 ], [ %66, %39 ]
%72 = icmp eq i64 %35, 0
br i1 %72, label %85, label %73
73: ; preds = %69, %73
%74 = phi i64 [ %81, %73 ], [ %70, %69 ]
%75 = phi <16 x i32> [ %82, %73 ], [ %71, %69 ]
%76 = phi i64 [ %83, %73 ], [ 0, %69 ]
%77 = lshr <16 x i32> %31, %75
%78 = trunc <16 x i32> %77 to <16 x i8>
%79 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %74
%80 = bitcast i8* %79 to <16 x i8>*
store <16 x i8> %78, <16 x i8>* %80
%81 = add nuw i64 %74, 16
%82 = add <16 x i32> %75, <i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128, i32 -128>
%83 = add i64 %76, 1
%84 = icmp eq i64 %83, %35
br i1 %84, label %85, label %73
85: ; preds = %73, %69
%86 = icmp eq i64 %23, %20
br i1 %86, label %99, label %87
87: ; preds = %17, %85
%88 = phi i64 [ 0, %17 ], [ %23, %85 ]
%89 = phi i32 [ %15, %17 ], [ %26, %85 ]
br label %90
90: ; preds = %87, %90
%91 = phi i64 [ %95, %90 ], [ %88, %87 ]
%92 = phi i32 [ %97, %90 ], [ %89, %87 ]
%93 = lshr i32 %1, %92
%94 = trunc i32 %93 to i8
%95 = add nuw nsw i64 %91, 1
%96 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 %91
store i8 %94, i8* %96
%97 = add i32 %92, -8
%98 = icmp eq i64 %95, %20
br i1 %98, label %99, label %90
99: ; preds = %90, %85, %12
%100 = bitcast [4 x i8]* %4 to i8**
%101 = call i32 @fwrite(i8** %100, i32 %2, i32 1, i32* %0)
%102 = icmp eq i32 %101, 0
br i1 %102, label %103, label %105
103: ; preds = %99
%104 = tail call i32 (i8*, ...) @pm_error(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %105
105: ; preds = %103, %99
br label %106
106: ; preds = %6, %10, %105
ret void
}