#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 */

/* Variables and functions */
int binrpc_get_int_len(unsigned int);
int binrpc_build_hdr(int type, int body_len, unsigned int cookie,
                     unsigned char *buf, int b_len) {
  unsigned char *p;
  int len_len;
  int c_len;
  len_len = binrpc_get_int_len(body_len);
  c_len = binrpc_get_int_len(cookie);
  if (len_len == 0)
    len_len = 1;
  if (c_len == 0)
    c_len = 1;
  if (b_len < (2 + len_len + c_len)) {
    goto error_len;
  }
  p = buf;
  *p = (0xA << 4) | 1;
  p++;
  *p = (type << 4) | ((len_len - 1) << 2) | (c_len - 1);
  p++;
  for (; len_len > 0; len_len--, p++) {
    *p = (unsigned char)(body_len >> ((len_len - 1) * 8));
  }
  for (; c_len > 0; c_len--, p++) {
    *p = (unsigned char)(cookie >> ((c_len - 1) * 8));
  }
  return (int)(p - buf);
error_len:
  return -2;
}


x86 assembly (clang, -O0):
<binrpc_build_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <binrpc_get_int_len@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%edi
call   1030 <binrpc_get_int_len@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1150 <binrpc_build_hdr+0x40>
movl   $0x1,-0x2c(%rbp)
cmpl   $0x0,-0x30(%rbp)
jne    1161 <binrpc_build_hdr+0x51>
movl   $0x1,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x2c(%rbp),%ecx
add    $0x2,%ecx
add    -0x30(%rbp),%ecx
cmp    %ecx,%eax
jge    117a <binrpc_build_hdr+0x6a>
jmp    124e <binrpc_build_hdr+0x13e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0xa1,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x2,%ecx
or     %ecx,%eax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jle    11fc <binrpc_build_hdr+0xec>
mov    -0xc(%rbp),%eax
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x3,%ecx
sar    %cl,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x2c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    11c2 <binrpc_build_hdr+0xb2>
jmp    1201 <binrpc_build_hdr+0xf1>
cmpl   $0x0,-0x30(%rbp)
jle    123b <binrpc_build_hdr+0x12b>
mov    -0x10(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
shl    $0x3,%ecx
shr    %cl,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x30(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1201 <binrpc_build_hdr+0xf1>
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1255 <binrpc_build_hdr+0x145>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binrpc_build_hdr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8d,%ebx
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%r13d
mov    %edi,%ebp
mov    %esi,%edi
call   1030 <binrpc_get_int_len@plt>
mov    %eax,%r12d
mov    %r15d,%edi
call   1030 <binrpc_get_int_len@plt>
test   %r12d,%r12d
mov    $0x1,%ecx
cmove  %ecx,%r12d
mov    %eax,%edx
test   %eax,%eax
cmove  %ecx,%edx
lea    (%r12,%rdx,1),%ecx
add    $0x2,%ecx
mov    $0xfffffffe,%eax
cmp    %ebx,%ecx
jg     1d19 <binrpc_build_hdr+0xc09>
movb   $0xa1,(%r14)
shl    $0x4,%ebp
lea    0xfc(,%r12,4),%eax
or     %ebp,%eax
lea    -0x1(%rdx),%r8d
or     %r8d,%eax
mov    %al,0x1(%r14)
lea    0x2(%r14),%rax
test   %r12d,%r12d
jle    1757 <binrpc_build_hdr+0x647>
lea    -0x1(%r12),%ecx
cmp    $0xf,%ecx
jb     1730 <binrpc_build_hdr+0x620>
add    $0x1,%rcx
mov    %rcx,%r9
and    $0xfffffffffffffff0,%r9
movd   %r12d,%xmm0
pshufd $0x0,%xmm0,%xmm8
movdqa 0xe45(%rip),%xmm15
paddd  %xmm8,%xmm15
movdqa 0xe47(%rip),%xmm9
paddd  %xmm8,%xmm9
movdqa 0xe49(%rip),%xmm10
paddd  %xmm8,%xmm10
paddd  0xe4b(%rip),%xmm8
movd   %r13d,%xmm0
pshufd $0x0,%xmm0,%xmm12
lea    -0x10(%r9),%rsi
mov    %rsi,%rdi
shr    $0x4,%rdi
add    $0x1,%rdi
test   %rsi,%rsi
je     1d28 <binrpc_build_hdr+0xc18>
mov    %rdi,%rbx
and    $0xfffffffffffffffe,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movdqa %xmm10,(%rsp)
movdqa %xmm8,0x10(%rsp)
movdqa %xmm15,%xmm4
pslld  $0x3,%xmm4
movdqa %xmm9,%xmm14
pslld  $0x3,%xmm14
movdqa (%rsp),%xmm13
pslld  $0x3,%xmm13
movdqa 0x10(%rsp),%xmm8
pslld  $0x3,%xmm8
movdqa %xmm8,%xmm5
movdqa 0xdd8(%rip),%xmm6
paddd  %xmm6,%xmm5
movdqa %xmm13,%xmm7
paddd  %xmm6,%xmm7
movdqa %xmm14,%xmm2
movdqa %xmm4,%xmm0
paddd  %xmm6,%xmm0
pshuflw $0xfe,%xmm0,%xmm1
movdqa %xmm12,%xmm3
psrad  %xmm1,%xmm3
paddd  %xmm6,%xmm2
pshuflw $0x54,%xmm0,%xmm11
movdqa %xmm12,%xmm1
psrad  %xmm11,%xmm1
pshufd $0xee,%xmm0,%xmm0
pshuflw $0xfe,%xmm0,%xmm11
movdqa %xmm12,%xmm10
psrad  %xmm11,%xmm10
punpcklqdq %xmm3,%xmm1
pshuflw $0x54,%xmm0,%xmm0
movdqa %xmm12,%xmm3
psrad  %xmm0,%xmm3
punpckhqdq %xmm10,%xmm3
pshuflw $0xfe,%xmm2,%xmm0
movdqa %xmm12,%xmm10
psrad  %xmm0,%xmm10
shufps $0xcc,%xmm3,%xmm1
pshuflw $0x54,%xmm2,%xmm3
movdqa %xmm12,%xmm0
psrad  %xmm3,%xmm0
pshufd $0xee,%xmm2,%xmm2
pshuflw $0xfe,%xmm2,%xmm11
movdqa %xmm12,%xmm3
psrad  %xmm11,%xmm3
punpcklqdq %xmm10,%xmm0
pshuflw $0x54,%xmm2,%xmm10
movdqa %xmm12,%xmm2
psrad  %xmm10,%xmm2
punpckhqdq %xmm3,%xmm2
pshuflw $0xfe,%xmm7,%xmm10
movdqa %xmm12,%xmm3
psrad  %xmm10,%xmm3
shufps $0xcc,%xmm2,%xmm0
pshuflw $0x54,%xmm7,%xmm10
movdqa %xmm12,%xmm2
psrad  %xmm10,%xmm2
pshufd $0xee,%xmm7,%xmm11
pshuflw $0xfe,%xmm11,%xmm10
movdqa %xmm12,%xmm7
psrad  %xmm10,%xmm7
punpcklqdq %xmm3,%xmm2
pshuflw $0x54,%xmm11,%xmm10
movdqa %xmm12,%xmm3
psrad  %xmm10,%xmm3
punpckhqdq %xmm7,%xmm3
pshuflw $0xfe,%xmm5,%xmm10
movdqa %xmm12,%xmm7
psrad  %xmm10,%xmm7
shufps $0xcc,%xmm3,%xmm2
pshuflw $0x54,%xmm5,%xmm10
movdqa %xmm12,%xmm3
psrad  %xmm10,%xmm3
pshufd $0xee,%xmm5,%xmm11
pshuflw $0xfe,%xmm11,%xmm10
movdqa %xmm12,%xmm5
psrad  %xmm10,%xmm5
punpcklqdq %xmm7,%xmm3
pshuflw $0x54,%xmm11,%xmm7
movdqa %xmm12,%xmm6
psrad  %xmm7,%xmm6
punpckhqdq %xmm5,%xmm6
shufps $0xcc,%xmm6,%xmm3
movaps 0xc82(%rip),%xmm11
andps  %xmm11,%xmm3
andps  %xmm11,%xmm2
packuswb %xmm2,%xmm3
andps  %xmm11,%xmm0
andps  %xmm11,%xmm1
packuswb %xmm1,%xmm0
packuswb %xmm0,%xmm3
movdqu %xmm3,0x2(%r14,%rbp,1)
movdqa 0xc67(%rip),%xmm1
paddd  %xmm1,%xmm8
paddd  %xmm1,%xmm13
paddd  %xmm1,%xmm4
pshuflw $0xfe,%xmm4,%xmm0
movdqa %xmm12,%xmm2
psrad  %xmm0,%xmm2
paddd  %xmm1,%xmm14
pshuflw $0x54,%xmm4,%xmm0
movdqa %xmm12,%xmm1
psrad  %xmm0,%xmm1
pshufd $0xee,%xmm4,%xmm0
pshuflw $0xfe,%xmm0,%xmm3
movdqa %xmm12,%xmm4
psrad  %xmm3,%xmm4
punpcklqdq %xmm2,%xmm1
pshuflw $0x54,%xmm0,%xmm0
movdqa %xmm12,%xmm2
psrad  %xmm0,%xmm2
punpckhqdq %xmm4,%xmm2
pshuflw $0xfe,%xmm14,%xmm0
movdqa %xmm12,%xmm3
psrad  %xmm0,%xmm3
shufps $0xcc,%xmm2,%xmm1
pshuflw $0x54,%xmm14,%xmm2
movdqa %xmm12,%xmm0
psrad  %xmm2,%xmm0
pshufd $0xee,%xmm14,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm12,%xmm5
psrad  %xmm4,%xmm5
punpcklqdq %xmm3,%xmm0
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm12,%xmm3
psrad  %xmm2,%xmm3
punpckhqdq %xmm5,%xmm3
pshuflw $0xfe,%xmm13,%xmm2
movdqa %xmm12,%xmm4
psrad  %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm0
pshuflw $0x54,%xmm13,%xmm3
movdqa %xmm12,%xmm2
psrad  %xmm3,%xmm2
pshufd $0xee,%xmm13,%xmm3
movdqa (%rsp),%xmm10
pshuflw $0xfe,%xmm3,%xmm5
movdqa %xmm12,%xmm6
psrad  %xmm5,%xmm6
punpcklqdq %xmm4,%xmm2
pshuflw $0x54,%xmm3,%xmm3
movdqa %xmm12,%xmm4
psrad  %xmm3,%xmm4
punpckhqdq %xmm6,%xmm4
pshuflw $0xfe,%xmm8,%xmm3
movdqa %xmm12,%xmm5
psrad  %xmm3,%xmm5
shufps $0xcc,%xmm4,%xmm2
pshuflw $0x54,%xmm8,%xmm3
movdqa %xmm12,%xmm4
psrad  %xmm3,%xmm4
pshufd $0xee,%xmm8,%xmm3
movdqa 0x10(%rsp),%xmm8
pshuflw $0xfe,%xmm3,%xmm6
movdqa %xmm12,%xmm7
psrad  %xmm6,%xmm7
punpcklqdq %xmm5,%xmm4
pshuflw $0x54,%xmm3,%xmm3
movdqa %xmm12,%xmm5
psrad  %xmm3,%xmm5
punpckhqdq %xmm7,%xmm5
shufps $0xcc,%xmm5,%xmm4
andps  %xmm11,%xmm4
andps  %xmm11,%xmm2
packuswb %xmm2,%xmm4
andps  %xmm11,%xmm0
andps  %xmm11,%xmm1
packuswb %xmm1,%xmm0
packuswb %xmm0,%xmm4
movdqu %xmm4,0x12(%r14,%rbp,1)
add    $0x20,%rbp
movdqa 0xafb(%rip),%xmm0
paddd  %xmm0,%xmm8
paddd  %xmm0,%xmm10
paddd  %xmm0,%xmm9
paddd  %xmm0,%xmm15
add    $0xfffffffffffffffe,%rbx
jne    1220 <binrpc_build_hdr+0x110>
test   $0x1,%dil
je     1725 <binrpc_build_hdr+0x615>
pslld  $0x3,%xmm15
pslld  $0x3,%xmm9
pslld  $0x3,%xmm10
pslld  $0x3,%xmm8
movdqa 0xa83(%rip),%xmm0
paddd  %xmm0,%xmm8
paddd  %xmm0,%xmm15
pshuflw $0xfe,%xmm15,%xmm1
movdqa %xmm12,%xmm2
psrad  %xmm1,%xmm2
paddd  %xmm0,%xmm10
pshuflw $0x54,%xmm15,%xmm3
movdqa %xmm12,%xmm1
psrad  %xmm3,%xmm1
pshufd $0xee,%xmm15,%xmm3
pshuflw $0xfe,%xmm3,%xmm4
movdqa %xmm12,%xmm5
psrad  %xmm4,%xmm5
paddd  %xmm0,%xmm9
pshuflw $0x54,%xmm3,%xmm0
movdqa %xmm12,%xmm3
psrad  %xmm0,%xmm3
punpcklqdq %xmm2,%xmm1
pshuflw $0xfe,%xmm9,%xmm0
movdqa %xmm12,%xmm2
psrad  %xmm0,%xmm2
punpckhqdq %xmm5,%xmm3
pshuflw $0x54,%xmm9,%xmm4
movdqa %xmm12,%xmm0
psrad  %xmm4,%xmm0
pshufd $0xee,%xmm9,%xmm4
pshuflw $0xfe,%xmm4,%xmm5
movdqa %xmm12,%xmm6
psrad  %xmm5,%xmm6
shufps $0xcc,%xmm3,%xmm1
pshuflw $0x54,%xmm4,%xmm3
movdqa %xmm12,%xmm4
psrad  %xmm3,%xmm4
punpcklqdq %xmm2,%xmm0
pshuflw $0xfe,%xmm10,%xmm2
movdqa %xmm12,%xmm3
psrad  %xmm2,%xmm3
punpckhqdq %xmm6,%xmm4
pshuflw $0x54,%xmm10,%xmm5
movdqa %xmm12,%xmm2
psrad  %xmm5,%xmm2
pshufd $0xee,%xmm10,%xmm5
pshuflw $0xfe,%xmm5,%xmm6
movdqa %xmm12,%xmm7
psrad  %xmm6,%xmm7
shufps $0xcc,%xmm4,%xmm0
pshuflw $0x54,%xmm5,%xmm4
movdqa %xmm12,%xmm5
psrad  %xmm4,%xmm5
punpcklqdq %xmm3,%xmm2
pshuflw $0xfe,%xmm8,%xmm3
movdqa %xmm12,%xmm4
psrad  %xmm3,%xmm4
punpckhqdq %xmm7,%xmm5
pshuflw $0x54,%xmm8,%xmm3
movdqa %xmm12,%xmm6
psrad  %xmm3,%xmm6
pshufd $0xee,%xmm8,%xmm3
pshuflw $0xfe,%xmm3,%xmm8
movdqa %xmm12,%xmm7
psrad  %xmm8,%xmm7
shufps $0xcc,%xmm5,%xmm2
pshuflw $0x54,%xmm3,%xmm3
psrad  %xmm3,%xmm12
punpcklqdq %xmm4,%xmm6
punpckhqdq %xmm7,%xmm12
shufps $0xcc,%xmm12,%xmm6
movaps 0x948(%rip),%xmm3
andps  %xmm3,%xmm6
andps  %xmm3,%xmm2
packuswb %xmm2,%xmm6
andps  %xmm3,%xmm0
andps  %xmm3,%xmm1
packuswb %xmm1,%xmm0
packuswb %xmm0,%xmm6
movdqu %xmm6,(%rax,%rbp,1)
add    %r9,%rax
cmp    %r9,%rcx
je     1757 <binrpc_build_hdr+0x647>
sub    %r9d,%r12d
mov    %r12d,%esi
add    $0x1,%esi
lea    -0x8(,%r12,8),%ecx
ff
xchg   %ax,%ax
mov    %r13d,%edi
sar    %cl,%edi
mov    %dil,(%rax)
add    $0x1,%rax
add    $0xffffffff,%esi
add    $0xfffffff8,%ecx
cmp    $0x1,%esi
ja     1740 <binrpc_build_hdr+0x630>
test   %edx,%edx
jle    1d16 <binrpc_build_hdr+0xc06>
cmp    $0xf,%r8d
jb     1cec <binrpc_build_hdr+0xbdc>
add    $0x1,%r8
mov    %r8,%rcx
and    $0xfffffffffffffff0,%rcx
movd   %edx,%xmm0
pshufd $0x0,%xmm0,%xmm8
movdqa 0x879(%rip),%xmm15
paddd  %xmm8,%xmm15
movdqa 0x87b(%rip),%xmm9
paddd  %xmm8,%xmm9
movdqa 0x87d(%rip),%xmm10
paddd  %xmm8,%xmm10
paddd  0x87f(%rip),%xmm8
movd   %r15d,%xmm0
pshufd $0x0,%xmm0,%xmm12
lea    -0x10(%rcx),%rsi
mov    %rsi,%rbp
shr    $0x4,%rbp
add    $0x1,%rbp
test   %rsi,%rsi
je     1d39 <binrpc_build_hdr+0xc29>
mov    %rbp,%rsi
and    $0xfffffffffffffffe,%rsi
xor    %edi,%edi
nopl   (%rax)
movdqa %xmm10,(%rsp)
movdqa %xmm8,0x10(%rsp)
movdqa %xmm15,%xmm4
pslld  $0x3,%xmm4
movdqa %xmm9,%xmm14
pslld  $0x3,%xmm14
movdqa (%rsp),%xmm13
pslld  $0x3,%xmm13
movdqa 0x10(%rsp),%xmm8
pslld  $0x3,%xmm8
movdqa %xmm8,%xmm5
movdqa 0x818(%rip),%xmm6
paddd  %xmm6,%xmm5
movdqa %xmm13,%xmm7
paddd  %xmm6,%xmm7
movdqa %xmm14,%xmm2
movdqa %xmm4,%xmm0
paddd  %xmm6,%xmm0
pshuflw $0xfe,%xmm0,%xmm1
movdqa %xmm12,%xmm3
psrld  %xmm1,%xmm3
paddd  %xmm6,%xmm2
pshuflw $0x54,%xmm0,%xmm11
movdqa %xmm12,%xmm1
psrld  %xmm11,%xmm1
pshufd $0xee,%xmm0,%xmm0
pshuflw $0xfe,%xmm0,%xmm11
movdqa %xmm12,%xmm10
psrld  %xmm11,%xmm10
punpcklqdq %xmm3,%xmm1
pshuflw $0x54,%xmm0,%xmm0
movdqa %xmm12,%xmm3
psrld  %xmm0,%xmm3
punpckhqdq %xmm10,%xmm3
pshuflw $0xfe,%xmm2,%xmm0
movdqa %xmm12,%xmm10
psrld  %xmm0,%xmm10
shufps $0xcc,%xmm3,%xmm1
pshuflw $0x54,%xmm2,%xmm3
movdqa %xmm12,%xmm0
psrld  %xmm3,%xmm0
pshufd $0xee,%xmm2,%xmm2
pshuflw $0xfe,%xmm2,%xmm11
movdqa %xmm12,%xmm3
psrld  %xmm11,%xmm3
punpcklqdq %xmm10,%xmm0
pshuflw $0x54,%xmm2,%xmm10
movdqa %xmm12,%xmm2
psrld  %xmm10,%xmm2
punpckhqdq %xmm3,%xmm2
pshuflw $0xfe,%xmm7,%xmm10
movdqa %xmm12,%xmm3
psrld  %xmm10,%xmm3
shufps $0xcc,%xmm2,%xmm0
pshuflw $0x54,%xmm7,%xmm10
movdqa %xmm12,%xmm2
psrld  %xmm10,%xmm2
pshufd $0xee,%xmm7,%xmm11
pshuflw $0xfe,%xmm11,%xmm10
movdqa %xmm12,%xmm7
psrld  %xmm10,%xmm7
punpcklqdq %xmm3,%xmm2
pshuflw $0x54,%xmm11,%xmm10
movdqa %xmm12,%xmm3
psrld  %xmm10,%xmm3
punpckhqdq %xmm7,%xmm3
pshuflw $0xfe,%xmm5,%xmm10
movdqa %xmm12,%xmm7
psrld  %xmm10,%xmm7
shufps $0xcc,%xmm3,%xmm2
pshuflw $0x54,%xmm5,%xmm10
movdqa %xmm12,%xmm3
psrld  %xmm10,%xmm3
pshufd $0xee,%xmm5,%xmm11
pshuflw $0xfe,%xmm11,%xmm10
movdqa %xmm12,%xmm5
psrld  %xmm10,%xmm5
punpcklqdq %xmm7,%xmm3
pshuflw $0x54,%xmm11,%xmm7
movdqa %xmm12,%xmm6
psrld  %xmm7,%xmm6
punpckhqdq %xmm5,%xmm6
shufps $0xcc,%xmm6,%xmm3
movaps 0x6c2(%rip),%xmm11
andps  %xmm11,%xmm3
andps  %xmm11,%xmm2
packuswb %xmm2,%xmm3
andps  %xmm11,%xmm0
andps  %xmm11,%xmm1
packuswb %xmm1,%xmm0
packuswb %xmm0,%xmm3
movdqu %xmm3,(%rax,%rdi,1)
movdqa 0x6a9(%rip),%xmm1
paddd  %xmm1,%xmm8
paddd  %xmm1,%xmm13
paddd  %xmm1,%xmm4
pshuflw $0xfe,%xmm4,%xmm0
movdqa %xmm12,%xmm2
psrld  %xmm0,%xmm2
paddd  %xmm1,%xmm14
pshuflw $0x54,%xmm4,%xmm0
movdqa %xmm12,%xmm1
psrld  %xmm0,%xmm1
pshufd $0xee,%xmm4,%xmm0
pshuflw $0xfe,%xmm0,%xmm3
movdqa %xmm12,%xmm4
psrld  %xmm3,%xmm4
punpcklqdq %xmm2,%xmm1
pshuflw $0x54,%xmm0,%xmm0
movdqa %xmm12,%xmm2
psrld  %xmm0,%xmm2
punpckhqdq %xmm4,%xmm2
pshuflw $0xfe,%xmm14,%xmm0
movdqa %xmm12,%xmm3
psrld  %xmm0,%xmm3
shufps $0xcc,%xmm2,%xmm1
pshuflw $0x54,%xmm14,%xmm2
movdqa %xmm12,%xmm0
psrld  %xmm2,%xmm0
pshufd $0xee,%xmm14,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm12,%xmm5
psrld  %xmm4,%xmm5
punpcklqdq %xmm3,%xmm0
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm12,%xmm3
psrld  %xmm2,%xmm3
punpckhqdq %xmm5,%xmm3
pshuflw $0xfe,%xmm13,%xmm2
movdqa %xmm12,%xmm4
psrld  %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm0
pshuflw $0x54,%xmm13,%xmm3
movdqa %xmm12,%xmm2
psrld  %xmm3,%xmm2
pshufd $0xee,%xmm13,%xmm3
movdqa (%rsp),%xmm10
pshuflw $0xfe,%xmm3,%xmm5
movdqa %xmm12,%xmm6
psrld  %xmm5,%xmm6
punpcklqdq %xmm4,%xmm2
pshuflw $0x54,%xmm3,%xmm3
movdqa %xmm12,%xmm4
psrld  %xmm3,%xmm4
punpckhqdq %xmm6,%xmm4
pshuflw $0xfe,%xmm8,%xmm3
movdqa %xmm12,%xmm5
psrld  %xmm3,%xmm5
shufps $0xcc,%xmm4,%xmm2
pshuflw $0x54,%xmm8,%xmm3
movdqa %xmm12,%xmm4
psrld  %xmm3,%xmm4
pshufd $0xee,%xmm8,%xmm3
movdqa 0x10(%rsp),%xmm8
pshuflw $0xfe,%xmm3,%xmm6
movdqa %xmm12,%xmm7
psrld  %xmm6,%xmm7
punpcklqdq %xmm5,%xmm4
pshuflw $0x54,%xmm3,%xmm3
movdqa %xmm12,%xmm5
psrld  %xmm3,%xmm5
punpckhqdq %xmm7,%xmm5
shufps $0xcc,%xmm5,%xmm4
andps  %xmm11,%xmm4
andps  %xmm11,%xmm2
packuswb %xmm2,%xmm4
andps  %xmm11,%xmm0
andps  %xmm11,%xmm1
packuswb %xmm1,%xmm0
packuswb %xmm0,%xmm4
movdqu %xmm4,0x10(%rax,%rdi,1)
add    $0x20,%rdi
movdqa 0x53e(%rip),%xmm0
paddd  %xmm0,%xmm8
paddd  %xmm0,%xmm10
paddd  %xmm0,%xmm9
paddd  %xmm0,%xmm15
add    $0xfffffffffffffffe,%rsi
jne    17e0 <binrpc_build_hdr+0x6d0>
test   $0x1,%bpl
je     1ce2 <binrpc_build_hdr+0xbd2>
pslld  $0x3,%xmm15
pslld  $0x3,%xmm9
pslld  $0x3,%xmm10
pslld  $0x3,%xmm8
movdqa 0x4c6(%rip),%xmm0
paddd  %xmm0,%xmm8
paddd  %xmm0,%xmm15
pshuflw $0xfe,%xmm15,%xmm1
movdqa %xmm12,%xmm2
psrld  %xmm1,%xmm2
paddd  %xmm0,%xmm10
pshuflw $0x54,%xmm15,%xmm3
movdqa %xmm12,%xmm1
psrld  %xmm3,%xmm1
pshufd $0xee,%xmm15,%xmm3
pshuflw $0xfe,%xmm3,%xmm4
movdqa %xmm12,%xmm5
psrld  %xmm4,%xmm5
paddd  %xmm0,%xmm9
pshuflw $0x54,%xmm3,%xmm0
movdqa %xmm12,%xmm3
psrld  %xmm0,%xmm3
punpcklqdq %xmm2,%xmm1
pshuflw $0xfe,%xmm9,%xmm0
movdqa %xmm12,%xmm2
psrld  %xmm0,%xmm2
punpckhqdq %xmm5,%xmm3
pshuflw $0x54,%xmm9,%xmm4
movdqa %xmm12,%xmm0
psrld  %xmm4,%xmm0
pshufd $0xee,%xmm9,%xmm4
pshuflw $0xfe,%xmm4,%xmm5
movdqa %xmm12,%xmm6
psrld  %xmm5,%xmm6
shufps $0xcc,%xmm3,%xmm1
pshuflw $0x54,%xmm4,%xmm3
movdqa %xmm12,%xmm4
psrld  %xmm3,%xmm4
punpcklqdq %xmm2,%xmm0
pshuflw $0xfe,%xmm10,%xmm2
movdqa %xmm12,%xmm3
psrld  %xmm2,%xmm3
punpckhqdq %xmm6,%xmm4
pshuflw $0x54,%xmm10,%xmm5
movdqa %xmm12,%xmm2
psrld  %xmm5,%xmm2
pshufd $0xee,%xmm10,%xmm5
pshuflw $0xfe,%xmm5,%xmm6
movdqa %xmm12,%xmm7
psrld  %xmm6,%xmm7
shufps $0xcc,%xmm4,%xmm0
pshuflw $0x54,%xmm5,%xmm4
movdqa %xmm12,%xmm5
psrld  %xmm4,%xmm5
punpcklqdq %xmm3,%xmm2
pshuflw $0xfe,%xmm8,%xmm3
movdqa %xmm12,%xmm4
psrld  %xmm3,%xmm4
punpckhqdq %xmm7,%xmm5
pshuflw $0x54,%xmm8,%xmm3
movdqa %xmm12,%xmm6
psrld  %xmm3,%xmm6
pshufd $0xee,%xmm8,%xmm3
pshuflw $0xfe,%xmm3,%xmm8
movdqa %xmm12,%xmm7
psrld  %xmm8,%xmm7
shufps $0xcc,%xmm5,%xmm2
pshuflw $0x54,%xmm3,%xmm3
psrld  %xmm3,%xmm12
punpcklqdq %xmm4,%xmm6
punpckhqdq %xmm7,%xmm12
shufps $0xcc,%xmm12,%xmm6
movaps 0x38b(%rip),%xmm3
andps  %xmm3,%xmm6
andps  %xmm3,%xmm2
packuswb %xmm2,%xmm6
andps  %xmm3,%xmm0
andps  %xmm3,%xmm1
packuswb %xmm1,%xmm0
packuswb %xmm0,%xmm6
movdqu %xmm6,(%rax,%rdi,1)
add    %rcx,%rax
cmp    %rcx,%r8
je     1d16 <binrpc_build_hdr+0xc06>
sub    %ecx,%edx
mov    %edx,%esi
add    $0x1,%esi
lea    -0x8(,%rdx,8),%ecx
nopl   0x0(%rax,%rax,1)
mov    %r15d,%edx
shr    %cl,%edx
mov    %dl,(%rax)
add    $0x1,%rax
add    $0xffffffff,%esi
add    $0xfffffff8,%ecx
cmp    $0x1,%esi
ja     1d00 <binrpc_build_hdr+0xbf0>
sub    %r14d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
test   $0x1,%dil
jne    159d <binrpc_build_hdr+0x48d>
jmp    1725 <binrpc_build_hdr+0x615>
xor    %edi,%edi
test   $0x1,%bpl
jne    1b5a <binrpc_build_hdr+0xa4a>
jmp    1ce2 <binrpc_build_hdr+0xbd2>

LLVM IR (-O0):
define i32 @binrpc_build_hdr(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i32 %4, i32* %11
%15 = load i32, i32* %8
%16 = call i32 @binrpc_get_int_len(i32 %15)
store i32 %16, i32* %13
%17 = load i32, i32* %9
%18 = call i32 @binrpc_get_int_len(i32 %17)
store i32 %18, i32* %14
%19 = load i32, i32* %13
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %5
store i32 1, i32* %13
br label %22
22: ; preds = %21, %5
%23 = load i32, i32* %14
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %22
store i32 1, i32* %14
br label %26
26: ; preds = %25, %22
%27 = load i32, i32* %11
%28 = load i32, i32* %13
%29 = add nsw i32 2, %28
%30 = load i32, i32* %14
%31 = add nsw i32 %29, %30
%32 = icmp slt i32 %27, %31
br i1 %32, label %33, label %34
33: ; preds = %26
br label %92
34: ; preds = %26
%35 = load i8*, i8** %10
store i8* %35, i8** %12
%36 = load i8*, i8** %12
store i8 -95, i8* %36
%37 = load i8*, i8** %12
%38 = getelementptr inbounds i8, i8* %37, i32 1
store i8* %38, i8** %12
%39 = load i32, i32* %7
%40 = shl i32 %39, 4
%41 = load i32, i32* %13
%42 = sub nsw i32 %41, 1
%43 = shl i32 %42, 2
%44 = or i32 %40, %43
%45 = load i32, i32* %14
%46 = sub nsw i32 %45, 1
%47 = or i32 %44, %46
%48 = trunc i32 %47 to i8
%49 = load i8*, i8** %12
store i8 %48, i8* %49
%50 = load i8*, i8** %12
%51 = getelementptr inbounds i8, i8* %50, i32 1
store i8* %51, i8** %12
br label %52
52: ; preds = %63, %34
%53 = load i32, i32* %13
%54 = icmp sgt i32 %53, 0
br i1 %54, label %55, label %68
55: ; preds = %52
%56 = load i32, i32* %8
%57 = load i32, i32* %13
%58 = sub nsw i32 %57, 1
%59 = mul nsw i32 %58, 8
%60 = ashr i32 %56, %59
%61 = trunc i32 %60 to i8
%62 = load i8*, i8** %12
store i8 %61, i8* %62
br label %63
63: ; preds = %55
%64 = load i32, i32* %13
%65 = add nsw i32 %64, -1
store i32 %65, i32* %13
%66 = load i8*, i8** %12
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %12
br label %52
68: ; preds = %52
br label %69
69: ; preds = %80, %68
%70 = load i32, i32* %14
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %85
72: ; preds = %69
%73 = load i32, i32* %9
%74 = load i32, i32* %14
%75 = sub nsw i32 %74, 1
%76 = mul nsw i32 %75, 8
%77 = lshr i32 %73, %76
%78 = trunc i32 %77 to i8
%79 = load i8*, i8** %12
store i8 %78, i8* %79
br label %80
80: ; preds = %72
%81 = load i32, i32* %14
%82 = add nsw i32 %81, -1
store i32 %82, i32* %14
%83 = load i8*, i8** %12
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %12
br label %69
85: ; preds = %69
%86 = load i8*, i8** %12
%87 = load i8*, i8** %10
%88 = ptrtoint i8* %86 to i64
%89 = ptrtoint i8* %87 to i64
%90 = sub i64 %88, %89
%91 = trunc i64 %90 to i32
store i32 %91, i32* %6
br label %93
92: ; preds = %33
store i32 -2, i32* %6
br label %93
93: ; preds = %92, %85
%94 = load i32, i32* %6
ret i32 %94
}

LLVM IR (-O2):
define i32 @binrpc_build_hdr(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = tail call i32 @binrpc_get_int_len(i32 %1)
%7 = tail call i32 @binrpc_get_int_len(i32 %2)
%8 = icmp eq i32 %6, 0
%9 = select i1 %8, i32 1, i32 %6
%10 = icmp eq i32 %7, 0
%11 = select i1 %10, i32 1, i32 %7
%12 = add nsw i32 %9, 2
%13 = add nsw i32 %12, %11
%14 = icmp sgt i32 %13, %4
br i1 %14, label %173, label %15
15: ; preds = %5
store i8 -95, i8* %3
%16 = getelementptr inbounds i8, i8* %3, i64 1
%17 = shl i32 %0, 4
%18 = shl i32 %9, 2
%19 = add i32 %18, 252
%20 = or i32 %19, %17
%21 = add i32 %11, 255
%22 = or i32 %20, %21
%23 = trunc i32 %22 to i8
store i8 %23, i8* %16
%24 = getelementptr inbounds i8, i8* %3, i64 2
%25 = icmp sgt i32 %9, 0
br i1 %25, label %26, label %85
26: ; preds = %15
%27 = add i32 %9, -1
%28 = zext i32 %27 to i64
%29 = add nuw nsw i64 %28, 1
%30 = icmp ult i32 %27, 15
br i1 %30, label %82, label %31
31: ; preds = %26
%32 = and i64 %29, 8589934576
%33 = trunc i64 %32 to i32
%34 = sub i32 %9, %33
%35 = getelementptr i8, i8* %24, i64 %32
%36 = insertelement <16 x i32> poison, i32 %9, i64 0
%37 = shufflevector <16 x i32> %36, <16 x i32> poison, <16 x i32> zeroinitializer
%38 = add <16 x i32> %37, <i32 0, i32 -1, i32 -2, i32 -3, i32 -4, i32 -5, i32 -6, i32 -7, i32 -8, i32 -9, i32 -10, i32 -11, i32 -12, i32 -13, i32 -14, i32 -15>
%39 = insertelement <16 x i32> poison, i32 %1, i64 0
%40 = shufflevector <16 x i32> %39, <16 x i32> poison, <16 x i32> zeroinitializer
%41 = add nsw i64 %32, -16
%42 = lshr exact i64 %41, 4
%43 = add nuw nsw i64 %42, 1
%44 = and i64 %43, 1
%45 = icmp eq i64 %41, 0
br i1 %45, label %69, label %46
46: ; preds = %31
%47 = and i64 %43, 2305843009213693950
br label %48
48: ; preds = %48, %46
%49 = phi i64 [ 0, %46 ], [ %65, %48 ]
%50 = phi <16 x i32> [ %38, %46 ], [ %66, %48 ]
%51 = phi i64 [ 0, %46 ], [ %67, %48 ]
%52 = getelementptr i8, i8* %24, i64 %49
%53 = shl <16 x i32> %50, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%54 = add <16 x i32> %53, <i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8>
%55 = ashr <16 x i32> %40, %54
%56 = trunc <16 x i32> %55 to <16 x i8>
%57 = bitcast i8* %52 to <16 x i8>*
store <16 x i8> %56, <16 x i8>* %57
%58 = or i64 %49, 16
%59 = getelementptr i8, i8* %24, i64 %58
%60 = shl <16 x i32> %50, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%61 = add <16 x i32> %60, <i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136>
%62 = ashr <16 x i32> %40, %61
%63 = trunc <16 x i32> %62 to <16 x i8>
%64 = bitcast i8* %59 to <16 x i8>*
store <16 x i8> %63, <16 x i8>* %64
%65 = add nuw i64 %49, 32
%66 = add <16 x i32> %50, <i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32>
%67 = add i64 %51, 2
%68 = icmp eq i64 %67, %47
br i1 %68, label %69, label %48
69: ; preds = %48, %31
%70 = phi i64 [ 0, %31 ], [ %65, %48 ]
%71 = phi <16 x i32> [ %38, %31 ], [ %66, %48 ]
%72 = icmp eq i64 %44, 0
br i1 %72, label %80, label %73
73: ; preds = %69
%74 = getelementptr i8, i8* %24, i64 %70
%75 = shl <16 x i32> %71, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%76 = add <16 x i32> %75, <i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8>
%77 = ashr <16 x i32> %40, %76
%78 = trunc <16 x i32> %77 to <16 x i8>
%79 = bitcast i8* %74 to <16 x i8>*
store <16 x i8> %78, <16 x i8>* %79
br label %80
80: ; preds = %69, %73
%81 = icmp eq i64 %29, %32
br i1 %81, label %85, label %82
82: ; preds = %26, %80
%83 = phi i32 [ %9, %26 ], [ %34, %80 ]
%84 = phi i8* [ %24, %26 ], [ %35, %80 ]
br label %147
85: ; preds = %147, %80, %15
%86 = phi i8* [ %24, %15 ], [ %35, %80 ], [ %155, %147 ]
%87 = icmp sgt i32 %11, 0
br i1 %87, label %88, label %167
88: ; preds = %85
%89 = add i32 %11, -1
%90 = zext i32 %89 to i64
%91 = add nuw nsw i64 %90, 1
%92 = icmp ult i32 %89, 15
br i1 %92, label %144, label %93
93: ; preds = %88
%94 = and i64 %91, 8589934576
%95 = trunc i64 %94 to i32
%96 = sub i32 %11, %95
%97 = getelementptr i8, i8* %86, i64 %94
%98 = insertelement <16 x i32> poison, i32 %11, i64 0
%99 = shufflevector <16 x i32> %98, <16 x i32> poison, <16 x i32> zeroinitializer
%100 = add <16 x i32> %99, <i32 0, i32 -1, i32 -2, i32 -3, i32 -4, i32 -5, i32 -6, i32 -7, i32 -8, i32 -9, i32 -10, i32 -11, i32 -12, i32 -13, i32 -14, i32 -15>
%101 = insertelement <16 x i32> poison, i32 %2, i64 0
%102 = shufflevector <16 x i32> %101, <16 x i32> poison, <16 x i32> zeroinitializer
%103 = add nsw i64 %94, -16
%104 = lshr exact i64 %103, 4
%105 = add nuw nsw i64 %104, 1
%106 = and i64 %105, 1
%107 = icmp eq i64 %103, 0
br i1 %107, label %131, label %108
108: ; preds = %93
%109 = and i64 %105, 2305843009213693950
br label %110
110: ; preds = %110, %108
%111 = phi i64 [ 0, %108 ], [ %127, %110 ]
%112 = phi <16 x i32> [ %100, %108 ], [ %128, %110 ]
%113 = phi i64 [ 0, %108 ], [ %129, %110 ]
%114 = getelementptr i8, i8* %86, i64 %111
%115 = shl <16 x i32> %112, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%116 = add <16 x i32> %115, <i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8>
%117 = lshr <16 x i32> %102, %116
%118 = trunc <16 x i32> %117 to <16 x i8>
%119 = bitcast i8* %114 to <16 x i8>*
store <16 x i8> %118, <16 x i8>* %119
%120 = or i64 %111, 16
%121 = getelementptr i8, i8* %86, i64 %120
%122 = shl <16 x i32> %112, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%123 = add <16 x i32> %122, <i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136, i32 -136>
%124 = lshr <16 x i32> %102, %123
%125 = trunc <16 x i32> %124 to <16 x i8>
%126 = bitcast i8* %121 to <16 x i8>*
store <16 x i8> %125, <16 x i8>* %126
%127 = add nuw i64 %111, 32
%128 = add <16 x i32> %112, <i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32>
%129 = add i64 %113, 2
%130 = icmp eq i64 %129, %109
br i1 %130, label %131, label %110
131: ; preds = %110, %93
%132 = phi i64 [ 0, %93 ], [ %127, %110 ]
%133 = phi <16 x i32> [ %100, %93 ], [ %128, %110 ]
%134 = icmp eq i64 %106, 0
br i1 %134, label %142, label %135
135: ; preds = %131
%136 = getelementptr i8, i8* %86, i64 %132
%137 = shl <16 x i32> %133, <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
%138 = add <16 x i32> %137, <i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8, i32 -8>
%139 = lshr <16 x i32> %102, %138
%140 = trunc <16 x i32> %139 to <16 x i8>
%141 = bitcast i8* %136 to <16 x i8>*
store <16 x i8> %140, <16 x i8>* %141
br label %142
142: ; preds = %131, %135
%143 = icmp eq i64 %91, %94
br i1 %143, label %167, label %144
144: ; preds = %88, %142
%145 = phi i32 [ %11, %88 ], [ %96, %142 ]
%146 = phi i8* [ %86, %88 ], [ %97, %142 ]
br label %157
147: ; preds = %82, %147
%148 = phi i32 [ %154, %147 ], [ %83, %82 ]
%149 = phi i8* [ %155, %147 ], [ %84, %82 ]
%150 = shl i32 %148, 3
%151 = add i32 %150, -8
%152 = ashr i32 %1, %151
%153 = trunc i32 %152 to i8
store i8 %153, i8* %149
%154 = add nsw i32 %148, -1
%155 = getelementptr inbounds i8, i8* %149, i64 1
%156 = icmp ugt i32 %148, 1
br i1 %156, label %147, label %85
157: ; preds = %144, %157
%158 = phi i32 [ %164, %157 ], [ %145, %144 ]
%159 = phi i8* [ %165, %157 ], [ %146, %144 ]
%160 = shl i32 %158, 3
%161 = add i32 %160, -8
%162 = lshr i32 %2, %161
%163 = trunc i32 %162 to i8
store i8 %163, i8* %159
%164 = add nsw i32 %158, -1
%165 = getelementptr inbounds i8, i8* %159, i64 1
%166 = icmp ugt i32 %158, 1
br i1 %166, label %157, label %167
167: ; preds = %157, %142, %85
%168 = phi i8* [ %86, %85 ], [ %97, %142 ], [ %165, %157 ]
%169 = ptrtoint i8* %168 to i64
%170 = ptrtoint i8* %3 to i64
%171 = sub i64 %169, %170
%172 = trunc i64 %171 to i32
br label %173
173: ; preds = %5, %167
%174 = phi i32 [ %172, %167 ], [ -2, %5 ]
ret i32 %174
}