// File: evincarofautumn[P]protodata/./write.h
// Function: void write_integer<long>(Interpreter::State const&, long const&, Stream&)
void write_integer
  (const Interpreter::State& state, const T& input, Stream& output) {
  const auto& endianness = state.endianness;
  switch (state.format) {
  case Term::INTEGER:
    switch (state.signedness) {
    case Term::UNSIGNED:
      switch (state.width) {
      case 8:
        write_integer_value<uint8_t>(endianness, input, output);
        break;
      case 16:
        write_integer_value<uint16_t>(endianness, input, output);
        break;
      case 32:
        write_integer_value<uint32_t>(endianness, input, output);
        break;
      case 64:
        write_integer_value<uint64_t>(endianness, input, output);
        break;
      default:
        {
          const uint64_t buffer(input);
          if (buffer & ~((1 << state.width) - 1))
            throw std::runtime_error(join("Value (", buffer,
              ") exceeds range of unsigned ", state.width, "-bit integer."));
          output.write(buffer, state.width);
        }
      }
      break;
    case Term::SIGNED:
      switch (state.width) {
      case 8:
        write_integer_value<int8_t>(endianness, input, output);
        break;
      case 16:
        write_integer_value<int16_t>(endianness, input, output);
        break;
      case 32:
        write_integer_value<int32_t>(endianness, input, output);
        break;
      case 64:
        write_integer_value<int64_t>(endianness, input, output);
        break;
      default:
        {
          const int64_t promoted(input);
          if (promoted < -(1 << (state.width - 1))
            || promoted > (1 << (state.width - 1)) - 1)
            throw std::runtime_error(join("Value (", promoted,
              ") exceeds range of signed ", state.width, "-bit integer."));
          uint64_t buffer;
          if (promoted < 0) {
            buffer = -promoted;
            buffer = (~buffer + 1) & ((1ull << state.width) - 1);
          } else {
            buffer = promoted;
          }
          output.write(buffer, state.width);
        }
      }
      break;
    }
    break;
  case Term::FLOAT:
    switch (state.width) {
    case 32:
      write_float_value<float>(endianness, input, output);
      break;
    case 64:
      write_float_value<double>(endianness, input, output);
      break;
    default:
      IMPOSSIBLE("invalid float bit width");
    }
    break;
  case Term::UNICODE:
    switch (state.width) {
    case 8:
      write_unicode_value<uint8_t>(endianness, input, output, utf8::append);
      break;
    case 16:
      write_unicode_value<uint16_t>(endianness, input, output, utf8::append16);
      break;
    default:
      IMPOSSIBLE("invalid Unicode bit width");
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0xe0(%rbp)
testl %eax, %eax
je 0x5eeb
jmp 0x5ec6
movl -0xe0(%rbp), %eax
subl $0x1, %eax
je 0x62b3
jmp 0x5ed7
movl -0xe0(%rbp), %eax
subl $0x2, %eax
je 0x63c0
jmp 0x64d2
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0xe4(%rbp)
testl %eax, %eax
je 0x5f12
jmp 0x5efe
movl -0xe4(%rbp), %eax
subl $0x1, %eax
je 0x60a6
jmp 0x62ae
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xe8(%rbp)
subl $0x8, %eax
je 0x5f4c
jmp 0x5f25
movl -0xe8(%rbp), %eax
subl $0x10, %eax
je 0x5f64
jmp 0x5f32
movl -0xe8(%rbp), %eax
subl $0x20, %eax
je 0x5f7c
jmp 0x5f3f
movl -0xe8(%rbp), %eax
subl $0x40, %eax
je 0x5f94
jmp 0x5fac
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x84f0
jmp 0x60a1
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8600
jmp 0x60a1
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8720
jmp 0x60a1
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8830
jmp 0x60a1
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
xorl $-0x1, %ecx
movslq %ecx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
je 0x608e
movb $0x1, -0x55(%rbp)
movl $0x10, %edi
callq 0x4150
movq %rax, -0xf0(%rbp)
movq -0x8(%rbp), %r8
leaq 0x14093(%rip), %rsi     # 0x1a093
leaq 0x14094(%rip), %rcx     # 0x1a09b
leaq 0x140aa(%rip), %r9      # 0x1a0b8
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rdx
callq 0x8940
jmp 0x601d
movq -0xf0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x4470
jmp 0x602f
movq -0xf0(%rbp), %rdi
movb $0x0, -0x55(%rbp)
movq 0x1ffaf(%rip), %rsi     # 0x25ff0
movq 0x1ff50(%rip), %rdx     # 0x25f98
callq 0x44b0
jmp 0x64e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x6075
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x41a0
testb $0x1, -0x55(%rbp)
jne 0x607d
jmp 0x6089
movq -0xf0(%rbp), %rdi
callq 0x4200
jmp 0x64db
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x8(%rbp), %rax
movl (%rax), %edx
callq 0xb680
jmp 0x62ae
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xf4(%rbp)
subl $0x8, %eax
je 0x60e0
jmp 0x60b9
movl -0xf4(%rbp), %eax
subl $0x10, %eax
je 0x60f8
jmp 0x60c6
movl -0xf4(%rbp), %eax
subl $0x20, %eax
je 0x6110
jmp 0x60d3
movl -0xf4(%rbp), %eax
subl $0x40, %eax
je 0x6128
jmp 0x6140
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8a10
jmp 0x62ac
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8b30
jmp 0x62ac
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8c50
jmp 0x62ac
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8d60
jmp 0x62ac
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
xorl %ecx, %ecx
subl %edx, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jl 0x6190
movq -0x60(%rbp), %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jle 0x6247
movb $0x1, -0x81(%rbp)
movl $0x10, %edi
callq 0x4150
movq %rax, -0x100(%rbp)
movq -0x8(%rbp), %r8
leaq 0x13ee0(%rip), %rsi     # 0x1a093
leaq 0x13f0c(%rip), %rcx     # 0x1a0c6
leaq 0x13ef7(%rip), %r9      # 0x1a0b8
leaq -0x80(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x8e70
jmp 0x61d0
movq -0x100(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x4470
jmp 0x61e2
movq -0x100(%rbp), %rdi
movb $0x0, -0x81(%rbp)
movq 0x1fdf9(%rip), %rsi     # 0x25ff0
movq 0x1fd9a(%rip), %rdx     # 0x25f98
callq 0x44b0
jmp 0x64e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x622b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x41a0
testb $0x1, -0x81(%rbp)
jne 0x6236
jmp 0x6242
movq -0x100(%rbp), %rdi
callq 0x4200
jmp 0x64db
cmpq $0x0, -0x60(%rbp)
jge 0x628b
xorl %eax, %eax
subq -0x60(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
xorq $-0x1, %rax
addq $0x1, %rax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
subq $0x1, %rcx
andq %rcx, %rax
movq %rax, -0x90(%rbp)
jmp 0x6296
movq -0x60(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x8(%rbp), %rax
movl (%rax), %edx
callq 0xb680
jmp 0x62ae
jmp 0x64d2
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x104(%rbp)
subl $0x20, %eax
je 0x62d3
jmp 0x62c6
movl -0x104(%rbp), %eax
subl $0x40, %eax
je 0x62eb
jmp 0x6303
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8f40
jmp 0x63bb
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x8f80
jmp 0x63bb
movb $0x1, -0xb1(%rbp)
movl $0x10, %edi
callq 0x4150
movq %rax, -0x110(%rbp)
leaq 0x13dbf(%rip), %rsi     # 0x1a0e1
leaq 0x13dcb(%rip), %rdx     # 0x1a0f4
leaq 0x14273(%rip), %rcx     # 0x1a5a3
leaq -0xb0(%rbp), %rdi
callq 0x8fc0
jmp 0x633e
movq -0x110(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4450
jmp 0x6353
movq -0x110(%rbp), %rdi
movb $0x0, -0xb1(%rbp)
movq 0x1fc58(%rip), %rsi     # 0x25fc0
movq 0x1fc39(%rip), %rdx     # 0x25fa8
callq 0x44b0
jmp 0x64e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x639f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x41a0
testb $0x1, -0xb1(%rbp)
jne 0x63aa
jmp 0x63b6
movq -0x110(%rbp), %rdi
callq 0x4200
jmp 0x64db
jmp 0x64d2
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x114(%rbp)
subl $0x8, %eax
je 0x63e0
jmp 0x63d3
movl -0x114(%rbp), %eax
subl $0x10, %eax
je 0x63ff
jmp 0x641e
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x2d0b(%rip), %rcx      # 0x9100
callq 0x9070
jmp 0x64d0
movq -0x20(%rbp), %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0x2f5c(%rip), %rcx      # 0x9370
callq 0x92e0
jmp 0x64d0
movb $0x1, -0xd9(%rbp)
movl $0x10, %edi
callq 0x4150
movq %rax, -0x120(%rbp)
leaq 0x13ca4(%rip), %rsi     # 0x1a0e1
leaq 0x13cc8(%rip), %rdx     # 0x1a10c
leaq 0x14158(%rip), %rcx     # 0x1a5a3
leaq -0xd8(%rbp), %rdi
callq 0x93f0
jmp 0x6459
movq -0x120(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4450
jmp 0x646e
movq -0x120(%rbp), %rdi
movb $0x0, -0xd9(%rbp)
movq 0x1fb3d(%rip), %rsi     # 0x25fc0
movq 0x1fb1e(%rip), %rdx     # 0x25fa8
callq 0x44b0
jmp 0x64e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x64b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x41a0
testb $0x1, -0xd9(%rbp)
jne 0x64c2
jmp 0x64ce
movq -0x120(%rbp), %rdi
callq 0x4200
jmp 0x64db
jmp 0x64d2
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x50(%rbp), %rdi
callq 0x44d0
nopw %cs:(%rax,%rax)
nop