#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 long long int64_t;

/* Variables and functions */
int ltf8_put(char *cp, int64_t val) {
  unsigned char *up = (unsigned char *)cp;
  if (!(val & ~((1LL << 7) - 1))) {
    *up = val;
    return 1;
  } else if (!(val & ~((1LL << (6 + 8)) - 1))) {
    *up++ = (val >> 8) | 0x80;
    *up = val & 0xff;
    return 2;
  } else if (!(val & ~((1LL << (5 + 2 * 8)) - 1))) {
    *up++ = (val >> 16) | 0xc0;
    *up++ = (val >> 8) & 0xff;
    *up = val & 0xff;
    return 3;
  } else if (!(val & ~((1LL << (4 + 3 * 8)) - 1))) {
    *up++ = (val >> 24) | 0xe0;
    *up++ = (val >> 16) & 0xff;
    *up++ = (val >> 8) & 0xff;
    *up = val & 0xff;
    return 4;
  } else if (!(val & ~((1LL << (3 + 4 * 8)) - 1))) {
    *up++ = (val >> 32) | 0xf0;
    *up++ = (val >> 24) & 0xff;
    *up++ = (val >> 16) & 0xff;
    *up++ = (val >> 8) & 0xff;
    *up = val & 0xff;
    return 5;
  } else if (!(val & ~((1LL << (2 + 5 * 8)) - 1))) {
    *up++ = (val >> 40) | 0xf8;
    *up++ = (val >> 32) & 0xff;
    *up++ = (val >> 24) & 0xff;
    *up++ = (val >> 16) & 0xff;
    *up++ = (val >> 8) & 0xff;
    *up = val & 0xff;
    return 6;
  } else if (!(val & ~((1LL << (1 + 6 * 8)) - 1))) {
    *up++ = (val >> 48) | 0xfc;
    *up++ = (val >> 40) & 0xff;
    *up++ = (val >> 32) & 0xff;
    *up++ = (val >> 24) & 0xff;
    *up++ = (val >> 16) & 0xff;
    *up++ = (val >> 8) & 0xff;
    *up = val & 0xff;
    return 7;
  } else if (!(val & ~((1LL << (7 * 8)) - 1))) {
    *up++ = (val >> 56) | 0xfe;
    *up++ = (val >> 48) & 0xff;
    *up++ = (val >> 40) & 0xff;
    *up++ = (val >> 32) & 0xff;
    *up++ = (val >> 24) & 0xff;
    *up++ = (val >> 16) & 0xff;
    *up++ = (val >> 8) & 0xff;
    *up = val & 0xff;
    return 8;
  } else {
    *up++ = 0xff;
    *up++ = (val >> 56) & 0xff;
    *up++ = (val >> 48) & 0xff;
    *up++ = (val >> 40) & 0xff;
    *up++ = (val >> 32) & 0xff;
    *up++ = (val >> 24) & 0xff;
    *up++ = (val >> 16) & 0xff;
    *up++ = (val >> 8) & 0xff;
    *up = val & 0xff;
    return 9;
  }
}


x86 assembly (clang, -O0):
<ltf8_put>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
and    $0xffffffffffffff80,%rax
cmp    $0x0,%rax
jne    113e <ltf8_put+0x3e>
mov    -0x18(%rbp),%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    175a <ltf8_put+0x65a>
mov    -0x18(%rbp),%rax
and    $0xffffffffffffc000,%rax
cmp    $0x0,%rax
jne    1191 <ltf8_put+0x91>
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
or     $0x80,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x2,-0x4(%rbp)
jmp    175a <ltf8_put+0x65a>
mov    -0x18(%rbp),%rax
and    $0xffffffffffe00000,%rax
cmp    $0x0,%rax
jne    1205 <ltf8_put+0x105>
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
or     $0xc0,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x3,-0x4(%rbp)
jmp    175a <ltf8_put+0x65a>
mov    -0x18(%rbp),%rax
and    $0xfffffffff0000000,%rax
cmp    $0x0,%rax
jne    129a <ltf8_put+0x19a>
mov    -0x18(%rbp),%rax
sar    $0x18,%rax
or     $0xe0,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x4,-0x4(%rbp)
jmp    175a <ltf8_put+0x65a>
movabs $0xfffffff800000000,%rax
ff ff ff
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
jne    1354 <ltf8_put+0x254>
mov    -0x18(%rbp),%rax
sar    $0x20,%rax
or     $0xf0,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x5,-0x4(%rbp)
jmp    175a <ltf8_put+0x65a>
movabs $0xfffffc0000000000,%rax
fc ff ff
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
jne    142f <ltf8_put+0x32f>
mov    -0x18(%rbp),%rax
sar    $0x28,%rax
or     $0xf8,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x20,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x6,-0x4(%rbp)
jmp    175a <ltf8_put+0x65a>
movabs $0xfffe000000000000,%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
jne    152b <ltf8_put+0x42b>
mov    -0x18(%rbp),%rax
sar    $0x30,%rax
or     $0xfc,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x28,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x20,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x7,-0x4(%rbp)
jmp    175a <ltf8_put+0x65a>
movabs $0xff00000000000000,%rax
and    -0x18(%rbp),%rax
cmp    $0x0,%rax
jne    1648 <ltf8_put+0x548>
mov    -0x18(%rbp),%rax
sar    $0x38,%rax
or     $0xfe,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x30,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x28,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x20,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x8,-0x4(%rbp)
jmp    175a <ltf8_put+0x65a>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movb   $0xff,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x38,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x30,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x28,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x20,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
sar    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x20(%rbp),%rax
mov    %cl,(%rax)
movl   $0x9,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltf8_put>:
mov    %rsi,%rcx
mov    $0x1,%eax
cmp    $0x80,%rsi
jae    1114 <ltf8_put+0x14>
mov    %cl,(%rdi)
ret
mov    %rcx,%rax
cmp    $0x3fff,%rcx
ja     1134 <ltf8_put+0x34>
shr    $0x8,%rax
or     $0x80,%al
mov    %al,(%rdi)
add    $0x1,%rdi
mov    $0x2,%eax
mov    %cl,(%rdi)
ret
cmp    $0x1fffff,%rcx
ja     1154 <ltf8_put+0x54>
shr    $0x10,%rax
or     $0xc0,%al
mov    %al,(%rdi)
mov    %ch,0x1(%rdi)
add    $0x2,%rdi
mov    $0x3,%eax
mov    %cl,(%rdi)
ret
cmp    $0xfffffff,%rcx
ja     117e <ltf8_put+0x7e>
shr    $0x18,%rax
or     $0xe0,%al
mov    %al,(%rdi)
mov    %rcx,%rax
shr    $0x10,%rax
mov    %al,0x1(%rdi)
mov    %ch,0x2(%rdi)
add    $0x3,%rdi
mov    $0x4,%eax
mov    %cl,(%rdi)
ret
shr    $0x23,%rax
jne    11b2 <ltf8_put+0xb2>
mov    %rcx,%rax
shr    $0x20,%rax
or     $0xf0,%al
mov    %al,(%rdi)
mov    %rcx,%rax
shr    $0x18,%rax
mov    %al,0x1(%rdi)
mov    %rcx,%rax
shr    $0x10,%rax
mov    %al,0x2(%rdi)
mov    %ch,0x3(%rdi)
add    $0x4,%rdi
mov    $0x5,%eax
mov    %cl,(%rdi)
ret
mov    %rcx,%rax
shr    $0x2a,%rax
jne    11f3 <ltf8_put+0xf3>
mov    %rcx,%rax
shr    $0x28,%rax
or     $0xf8,%al
mov    %al,(%rdi)
mov    %rcx,%rax
shr    $0x20,%rax
mov    %al,0x1(%rdi)
mov    %rcx,%rax
shr    $0x18,%rax
mov    %al,0x2(%rdi)
mov    %rcx,%rax
shr    $0x10,%rax
mov    %al,0x3(%rdi)
mov    %ch,0x4(%rdi)
add    $0x5,%rdi
mov    $0x6,%eax
mov    %cl,(%rdi)
ret
mov    %rcx,%rax
shr    $0x31,%rax
jne    123e <ltf8_put+0x13e>
mov    %rcx,%rax
shr    $0x30,%rax
or     $0xfc,%al
mov    %al,(%rdi)
mov    %rcx,%rax
shr    $0x28,%rax
mov    %al,0x1(%rdi)
mov    %rcx,%rax
shr    $0x20,%rax
mov    %al,0x2(%rdi)
mov    %rcx,%rax
shr    $0x18,%rax
mov    %al,0x3(%rdi)
mov    %rcx,%rax
shr    $0x10,%rax
mov    %al,0x4(%rdi)
mov    %ch,0x5(%rdi)
add    $0x6,%rdi
mov    $0x7,%eax
mov    %cl,(%rdi)
ret
mov    %rcx,%rax
shr    $0x38,%rax
jne    128c <ltf8_put+0x18c>
or     $0xfe,%al
mov    %al,(%rdi)
mov    %rcx,%rax
shr    $0x30,%rax
mov    %al,0x1(%rdi)
mov    %rcx,%rax
shr    $0x28,%rax
mov    %al,0x2(%rdi)
mov    %rcx,%rax
shr    $0x20,%rax
mov    %al,0x3(%rdi)
mov    %rcx,%rax
shr    $0x18,%rax
mov    %al,0x4(%rdi)
mov    %rcx,%rax
shr    $0x10,%rax
mov    %al,0x5(%rdi)
mov    %ch,0x6(%rdi)
add    $0x7,%rdi
mov    $0x8,%eax
mov    %cl,(%rdi)
ret
movb   $0xff,(%rdi)
mov    %al,0x1(%rdi)
mov    %rcx,%rax
shr    $0x30,%rax
mov    %al,0x2(%rdi)
mov    %rcx,%rax
shr    $0x28,%rax
mov    %al,0x3(%rdi)
mov    %rcx,%rax
shr    $0x20,%rax
mov    %al,0x4(%rdi)
mov    %rcx,%rax
shr    $0x18,%rax
mov    %al,0x5(%rdi)
mov    %rcx,%rax
shr    $0x10,%rax
mov    %al,0x6(%rdi)
mov    %ch,0x7(%rdi)
add    $0x8,%rdi
mov    $0x9,%eax
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define i32 @ltf8_put(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = load i8*, i8** %4
store i8* %7, i8** %6
%8 = load i64, i64* %5
%9 = and i64 %8, -128
%10 = icmp ne i64 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i64, i64* %5
%13 = trunc i64 %12 to i8
%14 = load i8*, i8** %6
store i8 %13, i8* %14
store i32 1, i32* %3
br label %295
15: ; preds = %2
%16 = load i64, i64* %5
%17 = and i64 %16, -16384
%18 = icmp ne i64 %17, 0
br i1 %18, label %30, label %19
19: ; preds = %15
%20 = load i64, i64* %5
%21 = ashr i64 %20, 8
%22 = or i64 %21, 128
%23 = trunc i64 %22 to i8
%24 = load i8*, i8** %6
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %6
store i8 %23, i8* %24
%26 = load i64, i64* %5
%27 = and i64 %26, 255
%28 = trunc i64 %27 to i8
%29 = load i8*, i8** %6
store i8 %28, i8* %29
store i32 2, i32* %3
br label %295
30: ; preds = %15
%31 = load i64, i64* %5
%32 = and i64 %31, -2097152
%33 = icmp ne i64 %32, 0
br i1 %33, label %51, label %34
34: ; preds = %30
%35 = load i64, i64* %5
%36 = ashr i64 %35, 16
%37 = or i64 %36, 192
%38 = trunc i64 %37 to i8
%39 = load i8*, i8** %6
%40 = getelementptr inbounds i8, i8* %39, i32 1
store i8* %40, i8** %6
store i8 %38, i8* %39
%41 = load i64, i64* %5
%42 = ashr i64 %41, 8
%43 = and i64 %42, 255
%44 = trunc i64 %43 to i8
%45 = load i8*, i8** %6
%46 = getelementptr inbounds i8, i8* %45, i32 1
store i8* %46, i8** %6
store i8 %44, i8* %45
%47 = load i64, i64* %5
%48 = and i64 %47, 255
%49 = trunc i64 %48 to i8
%50 = load i8*, i8** %6
store i8 %49, i8* %50
store i32 3, i32* %3
br label %295
51: ; preds = %30
%52 = load i64, i64* %5
%53 = and i64 %52, -268435456
%54 = icmp ne i64 %53, 0
br i1 %54, label %78, label %55
55: ; preds = %51
%56 = load i64, i64* %5
%57 = ashr i64 %56, 24
%58 = or i64 %57, 224
%59 = trunc i64 %58 to i8
%60 = load i8*, i8** %6
%61 = getelementptr inbounds i8, i8* %60, i32 1
store i8* %61, i8** %6
store i8 %59, i8* %60
%62 = load i64, i64* %5
%63 = ashr i64 %62, 16
%64 = and i64 %63, 255
%65 = trunc i64 %64 to i8
%66 = load i8*, i8** %6
%67 = getelementptr inbounds i8, i8* %66, i32 1
store i8* %67, i8** %6
store i8 %65, i8* %66
%68 = load i64, i64* %5
%69 = ashr i64 %68, 8
%70 = and i64 %69, 255
%71 = trunc i64 %70 to i8
%72 = load i8*, i8** %6
%73 = getelementptr inbounds i8, i8* %72, i32 1
store i8* %73, i8** %6
store i8 %71, i8* %72
%74 = load i64, i64* %5
%75 = and i64 %74, 255
%76 = trunc i64 %75 to i8
%77 = load i8*, i8** %6
store i8 %76, i8* %77
store i32 4, i32* %3
br label %295
78: ; preds = %51
%79 = load i64, i64* %5
%80 = and i64 %79, -34359738368
%81 = icmp ne i64 %80, 0
br i1 %81, label %111, label %82
82: ; preds = %78
%83 = load i64, i64* %5
%84 = ashr i64 %83, 32
%85 = or i64 %84, 240
%86 = trunc i64 %85 to i8
%87 = load i8*, i8** %6
%88 = getelementptr inbounds i8, i8* %87, i32 1
store i8* %88, i8** %6
store i8 %86, i8* %87
%89 = load i64, i64* %5
%90 = ashr i64 %89, 24
%91 = and i64 %90, 255
%92 = trunc i64 %91 to i8
%93 = load i8*, i8** %6
%94 = getelementptr inbounds i8, i8* %93, i32 1
store i8* %94, i8** %6
store i8 %92, i8* %93
%95 = load i64, i64* %5
%96 = ashr i64 %95, 16
%97 = and i64 %96, 255
%98 = trunc i64 %97 to i8
%99 = load i8*, i8** %6
%100 = getelementptr inbounds i8, i8* %99, i32 1
store i8* %100, i8** %6
store i8 %98, i8* %99
%101 = load i64, i64* %5
%102 = ashr i64 %101, 8
%103 = and i64 %102, 255
%104 = trunc i64 %103 to i8
%105 = load i8*, i8** %6
%106 = getelementptr inbounds i8, i8* %105, i32 1
store i8* %106, i8** %6
store i8 %104, i8* %105
%107 = load i64, i64* %5
%108 = and i64 %107, 255
%109 = trunc i64 %108 to i8
%110 = load i8*, i8** %6
store i8 %109, i8* %110
store i32 5, i32* %3
br label %295
111: ; preds = %78
%112 = load i64, i64* %5
%113 = and i64 %112, -4398046511104
%114 = icmp ne i64 %113, 0
br i1 %114, label %150, label %115
115: ; preds = %111
%116 = load i64, i64* %5
%117 = ashr i64 %116, 40
%118 = or i64 %117, 248
%119 = trunc i64 %118 to i8
%120 = load i8*, i8** %6
%121 = getelementptr inbounds i8, i8* %120, i32 1
store i8* %121, i8** %6
store i8 %119, i8* %120
%122 = load i64, i64* %5
%123 = ashr i64 %122, 32
%124 = and i64 %123, 255
%125 = trunc i64 %124 to i8
%126 = load i8*, i8** %6
%127 = getelementptr inbounds i8, i8* %126, i32 1
store i8* %127, i8** %6
store i8 %125, i8* %126
%128 = load i64, i64* %5
%129 = ashr i64 %128, 24
%130 = and i64 %129, 255
%131 = trunc i64 %130 to i8
%132 = load i8*, i8** %6
%133 = getelementptr inbounds i8, i8* %132, i32 1
store i8* %133, i8** %6
store i8 %131, i8* %132
%134 = load i64, i64* %5
%135 = ashr i64 %134, 16
%136 = and i64 %135, 255
%137 = trunc i64 %136 to i8
%138 = load i8*, i8** %6
%139 = getelementptr inbounds i8, i8* %138, i32 1
store i8* %139, i8** %6
store i8 %137, i8* %138
%140 = load i64, i64* %5
%141 = ashr i64 %140, 8
%142 = and i64 %141, 255
%143 = trunc i64 %142 to i8
%144 = load i8*, i8** %6
%145 = getelementptr inbounds i8, i8* %144, i32 1
store i8* %145, i8** %6
store i8 %143, i8* %144
%146 = load i64, i64* %5
%147 = and i64 %146, 255
%148 = trunc i64 %147 to i8
%149 = load i8*, i8** %6
store i8 %148, i8* %149
store i32 6, i32* %3
br label %295
150: ; preds = %111
%151 = load i64, i64* %5
%152 = and i64 %151, -562949953421312
%153 = icmp ne i64 %152, 0
br i1 %153, label %195, label %154
154: ; preds = %150
%155 = load i64, i64* %5
%156 = ashr i64 %155, 48
%157 = or i64 %156, 252
%158 = trunc i64 %157 to i8
%159 = load i8*, i8** %6
%160 = getelementptr inbounds i8, i8* %159, i32 1
store i8* %160, i8** %6
store i8 %158, i8* %159
%161 = load i64, i64* %5
%162 = ashr i64 %161, 40
%163 = and i64 %162, 255
%164 = trunc i64 %163 to i8
%165 = load i8*, i8** %6
%166 = getelementptr inbounds i8, i8* %165, i32 1
store i8* %166, i8** %6
store i8 %164, i8* %165
%167 = load i64, i64* %5
%168 = ashr i64 %167, 32
%169 = and i64 %168, 255
%170 = trunc i64 %169 to i8
%171 = load i8*, i8** %6
%172 = getelementptr inbounds i8, i8* %171, i32 1
store i8* %172, i8** %6
store i8 %170, i8* %171
%173 = load i64, i64* %5
%174 = ashr i64 %173, 24
%175 = and i64 %174, 255
%176 = trunc i64 %175 to i8
%177 = load i8*, i8** %6
%178 = getelementptr inbounds i8, i8* %177, i32 1
store i8* %178, i8** %6
store i8 %176, i8* %177
%179 = load i64, i64* %5
%180 = ashr i64 %179, 16
%181 = and i64 %180, 255
%182 = trunc i64 %181 to i8
%183 = load i8*, i8** %6
%184 = getelementptr inbounds i8, i8* %183, i32 1
store i8* %184, i8** %6
store i8 %182, i8* %183
%185 = load i64, i64* %5
%186 = ashr i64 %185, 8
%187 = and i64 %186, 255
%188 = trunc i64 %187 to i8
%189 = load i8*, i8** %6
%190 = getelementptr inbounds i8, i8* %189, i32 1
store i8* %190, i8** %6
store i8 %188, i8* %189
%191 = load i64, i64* %5
%192 = and i64 %191, 255
%193 = trunc i64 %192 to i8
%194 = load i8*, i8** %6
store i8 %193, i8* %194
store i32 7, i32* %3
br label %295
195: ; preds = %150
%196 = load i64, i64* %5
%197 = and i64 %196, -72057594037927936
%198 = icmp ne i64 %197, 0
br i1 %198, label %246, label %199
199: ; preds = %195
%200 = load i64, i64* %5
%201 = ashr i64 %200, 56
%202 = or i64 %201, 254
%203 = trunc i64 %202 to i8
%204 = load i8*, i8** %6
%205 = getelementptr inbounds i8, i8* %204, i32 1
store i8* %205, i8** %6
store i8 %203, i8* %204
%206 = load i64, i64* %5
%207 = ashr i64 %206, 48
%208 = and i64 %207, 255
%209 = trunc i64 %208 to i8
%210 = load i8*, i8** %6
%211 = getelementptr inbounds i8, i8* %210, i32 1
store i8* %211, i8** %6
store i8 %209, i8* %210
%212 = load i64, i64* %5
%213 = ashr i64 %212, 40
%214 = and i64 %213, 255
%215 = trunc i64 %214 to i8
%216 = load i8*, i8** %6
%217 = getelementptr inbounds i8, i8* %216, i32 1
store i8* %217, i8** %6
store i8 %215, i8* %216
%218 = load i64, i64* %5
%219 = ashr i64 %218, 32
%220 = and i64 %219, 255
%221 = trunc i64 %220 to i8
%222 = load i8*, i8** %6
%223 = getelementptr inbounds i8, i8* %222, i32 1
store i8* %223, i8** %6
store i8 %221, i8* %222
%224 = load i64, i64* %5
%225 = ashr i64 %224, 24
%226 = and i64 %225, 255
%227 = trunc i64 %226 to i8
%228 = load i8*, i8** %6
%229 = getelementptr inbounds i8, i8* %228, i32 1
store i8* %229, i8** %6
store i8 %227, i8* %228
%230 = load i64, i64* %5
%231 = ashr i64 %230, 16
%232 = and i64 %231, 255
%233 = trunc i64 %232 to i8
%234 = load i8*, i8** %6
%235 = getelementptr inbounds i8, i8* %234, i32 1
store i8* %235, i8** %6
store i8 %233, i8* %234
%236 = load i64, i64* %5
%237 = ashr i64 %236, 8
%238 = and i64 %237, 255
%239 = trunc i64 %238 to i8
%240 = load i8*, i8** %6
%241 = getelementptr inbounds i8, i8* %240, i32 1
store i8* %241, i8** %6
store i8 %239, i8* %240
%242 = load i64, i64* %5
%243 = and i64 %242, 255
%244 = trunc i64 %243 to i8
%245 = load i8*, i8** %6
store i8 %244, i8* %245
store i32 8, i32* %3
br label %295
246: ; preds = %195
%247 = load i8*, i8** %6
%248 = getelementptr inbounds i8, i8* %247, i32 1
store i8* %248, i8** %6
store i8 -1, i8* %247
%249 = load i64, i64* %5
%250 = ashr i64 %249, 56
%251 = and i64 %250, 255
%252 = trunc i64 %251 to i8
%253 = load i8*, i8** %6
%254 = getelementptr inbounds i8, i8* %253, i32 1
store i8* %254, i8** %6
store i8 %252, i8* %253
%255 = load i64, i64* %5
%256 = ashr i64 %255, 48
%257 = and i64 %256, 255
%258 = trunc i64 %257 to i8
%259 = load i8*, i8** %6
%260 = getelementptr inbounds i8, i8* %259, i32 1
store i8* %260, i8** %6
store i8 %258, i8* %259
%261 = load i64, i64* %5
%262 = ashr i64 %261, 40
%263 = and i64 %262, 255
%264 = trunc i64 %263 to i8
%265 = load i8*, i8** %6
%266 = getelementptr inbounds i8, i8* %265, i32 1
store i8* %266, i8** %6
store i8 %264, i8* %265
%267 = load i64, i64* %5
%268 = ashr i64 %267, 32
%269 = and i64 %268, 255
%270 = trunc i64 %269 to i8
%271 = load i8*, i8** %6
%272 = getelementptr inbounds i8, i8* %271, i32 1
store i8* %272, i8** %6
store i8 %270, i8* %271
%273 = load i64, i64* %5
%274 = ashr i64 %273, 24
%275 = and i64 %274, 255
%276 = trunc i64 %275 to i8
%277 = load i8*, i8** %6
%278 = getelementptr inbounds i8, i8* %277, i32 1
store i8* %278, i8** %6
store i8 %276, i8* %277
%279 = load i64, i64* %5
%280 = ashr i64 %279, 16
%281 = and i64 %280, 255
%282 = trunc i64 %281 to i8
%283 = load i8*, i8** %6
%284 = getelementptr inbounds i8, i8* %283, i32 1
store i8* %284, i8** %6
store i8 %282, i8* %283
%285 = load i64, i64* %5
%286 = ashr i64 %285, 8
%287 = and i64 %286, 255
%288 = trunc i64 %287 to i8
%289 = load i8*, i8** %6
%290 = getelementptr inbounds i8, i8* %289, i32 1
store i8* %290, i8** %6
store i8 %288, i8* %289
%291 = load i64, i64* %5
%292 = and i64 %291, 255
%293 = trunc i64 %292 to i8
%294 = load i8*, i8** %6
store i8 %293, i8* %294
store i32 9, i32* %3
br label %295
295: ; preds = %246, %199, %154, %115, %82, %55, %34, %19, %11
%296 = load i32, i32* %3
ret i32 %296
}

LLVM IR (-O2):
define i32 @ltf8_put(i8* writeonly %0, i64 %1) {
%3 = icmp ult i64 %1, 128
br i1 %3, label %139, label %4
4: ; preds = %2
%5 = icmp ult i64 %1, 16384
br i1 %5, label %6, label %11
6: ; preds = %4
%7 = lshr i64 %1, 8
%8 = trunc i64 %7 to i8
%9 = or i8 %8, -128
%10 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %9, i8* %0
br label %139
11: ; preds = %4
%12 = icmp ult i64 %1, 2097152
br i1 %12, label %13, label %21
13: ; preds = %11
%14 = lshr i64 %1, 16
%15 = trunc i64 %14 to i8
%16 = or i8 %15, -64
%17 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %16, i8* %0
%18 = lshr i64 %1, 8
%19 = trunc i64 %18 to i8
%20 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %19, i8* %17
br label %139
21: ; preds = %11
%22 = icmp ult i64 %1, 268435456
br i1 %22, label %23, label %34
23: ; preds = %21
%24 = lshr i64 %1, 24
%25 = trunc i64 %24 to i8
%26 = or i8 %25, -32
%27 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %26, i8* %0
%28 = lshr i64 %1, 16
%29 = trunc i64 %28 to i8
%30 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %29, i8* %27
%31 = lshr i64 %1, 8
%32 = trunc i64 %31 to i8
%33 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %32, i8* %30
br label %139
34: ; preds = %21
%35 = icmp ult i64 %1, 34359738368
br i1 %35, label %36, label %50
36: ; preds = %34
%37 = lshr i64 %1, 32
%38 = trunc i64 %37 to i8
%39 = or i8 %38, -16
%40 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %39, i8* %0
%41 = lshr i64 %1, 24
%42 = trunc i64 %41 to i8
%43 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %42, i8* %40
%44 = lshr i64 %1, 16
%45 = trunc i64 %44 to i8
%46 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %45, i8* %43
%47 = lshr i64 %1, 8
%48 = trunc i64 %47 to i8
%49 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %48, i8* %46
br label %139
50: ; preds = %34
%51 = icmp ult i64 %1, 4398046511104
br i1 %51, label %52, label %69
52: ; preds = %50
%53 = lshr i64 %1, 40
%54 = trunc i64 %53 to i8
%55 = or i8 %54, -8
%56 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %55, i8* %0
%57 = lshr i64 %1, 32
%58 = trunc i64 %57 to i8
%59 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %58, i8* %56
%60 = lshr i64 %1, 24
%61 = trunc i64 %60 to i8
%62 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %61, i8* %59
%63 = lshr i64 %1, 16
%64 = trunc i64 %63 to i8
%65 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %64, i8* %62
%66 = lshr i64 %1, 8
%67 = trunc i64 %66 to i8
%68 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %67, i8* %65
br label %139
69: ; preds = %50
%70 = icmp ult i64 %1, 562949953421312
br i1 %70, label %71, label %91
71: ; preds = %69
%72 = lshr i64 %1, 48
%73 = trunc i64 %72 to i8
%74 = or i8 %73, -4
%75 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %74, i8* %0
%76 = lshr i64 %1, 40
%77 = trunc i64 %76 to i8
%78 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %77, i8* %75
%79 = lshr i64 %1, 32
%80 = trunc i64 %79 to i8
%81 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %80, i8* %78
%82 = lshr i64 %1, 24
%83 = trunc i64 %82 to i8
%84 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %83, i8* %81
%85 = lshr i64 %1, 16
%86 = trunc i64 %85 to i8
%87 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %86, i8* %84
%88 = lshr i64 %1, 8
%89 = trunc i64 %88 to i8
%90 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %89, i8* %87
br label %139
91: ; preds = %69
%92 = icmp ult i64 %1, 72057594037927936
br i1 %92, label %93, label %116
93: ; preds = %91
%94 = lshr i64 %1, 56
%95 = trunc i64 %94 to i8
%96 = or i8 %95, -2
%97 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %96, i8* %0
%98 = lshr i64 %1, 48
%99 = trunc i64 %98 to i8
%100 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %99, i8* %97
%101 = lshr i64 %1, 40
%102 = trunc i64 %101 to i8
%103 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %102, i8* %100
%104 = lshr i64 %1, 32
%105 = trunc i64 %104 to i8
%106 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %105, i8* %103
%107 = lshr i64 %1, 24
%108 = trunc i64 %107 to i8
%109 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %108, i8* %106
%110 = lshr i64 %1, 16
%111 = trunc i64 %110 to i8
%112 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %111, i8* %109
%113 = lshr i64 %1, 8
%114 = trunc i64 %113 to i8
%115 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %114, i8* %112
br label %139
116: ; preds = %91
%117 = getelementptr inbounds i8, i8* %0, i64 1
store i8 -1, i8* %0
%118 = lshr i64 %1, 56
%119 = trunc i64 %118 to i8
%120 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %119, i8* %117
%121 = lshr i64 %1, 48
%122 = trunc i64 %121 to i8
%123 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %122, i8* %120
%124 = lshr i64 %1, 40
%125 = trunc i64 %124 to i8
%126 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %125, i8* %123
%127 = lshr i64 %1, 32
%128 = trunc i64 %127 to i8
%129 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %128, i8* %126
%130 = lshr i64 %1, 24
%131 = trunc i64 %130 to i8
%132 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %131, i8* %129
%133 = lshr i64 %1, 16
%134 = trunc i64 %133 to i8
%135 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %134, i8* %132
%136 = lshr i64 %1, 8
%137 = trunc i64 %136 to i8
%138 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %137, i8* %135
br label %139
139: ; preds = %2, %116, %93, %71, %52, %36, %23, %13, %6
%140 = phi i8* [ %138, %116 ], [ %115, %93 ], [ %90, %71 ], [ %68, %52 ], [ %49, %36 ], [ %33, %23 ], [ %20, %13 ], [ %10, %6 ], [ %0, %2 ]
%141 = phi i32 [ 9, %116 ], [ 8, %93 ], [ 7, %71 ], [ 6, %52 ], [ 5, %36 ], [ 4, %23 ], [ 3, %13 ], [ 2, %6 ], [ 1, %2 ]
%142 = trunc i64 %1 to i8
store i8 %142, i8* %140
ret i32 %141
}