// File: /workspace/github_c_makefile_star2_O0/barabo[P]advanced-shell-history/src/sqlite3.c
// Function: sqlite3VdbeMemTranslate
SQLITE_PRIVATE int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
  int len;                    /* Maximum length of output string in bytes */
  unsigned char *zOut;                  /* Output buffer */
  unsigned char *zIn;                   /* Input iterator */
  unsigned char *zTerm;                 /* End of input */
  unsigned char *z;                     /* Output iterator */
  unsigned int c;

  assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) );
  assert( pMem->flags&MEM_Str );
  assert( pMem->enc!=desiredEnc );
  assert( pMem->enc!=0 );
  assert( pMem->n>=0 );

#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
  {
    char zBuf[100];
    sqlite3VdbeMemPrettyPrint(pMem, zBuf);
    fprintf(stderr, "INPUT:  %s\n", zBuf);
  }
#endif

  /* If the translation is between UTF-16 little and big endian, then 
  ** all that is required is to swap the byte order. This case is handled
  ** differently from the others.
  */
  if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
    u8 temp;
    int rc;
    rc = sqlite3VdbeMemMakeWriteable(pMem);
    if( rc!=SQLITE_OK ){
      assert( rc==SQLITE_NOMEM );
      return SQLITE_NOMEM;
    }
    zIn = (u8*)pMem->z;
    zTerm = &zIn[pMem->n&~1];
    while( zIn<zTerm ){
      temp = *zIn;
      *zIn = *(zIn+1);
      zIn++;
      *zIn++ = temp;
    }
    pMem->enc = desiredEnc;
    goto translate_out;
  }

  /* Set len to the maximum number of bytes required in the output buffer. */
  if( desiredEnc==SQLITE_UTF8 ){
    /* When converting from UTF-16, the maximum growth results from
    ** translating a 2-byte character to a 4-byte UTF-8 character.
    ** A single byte is required for the output string
    ** nul-terminator.
    */
    pMem->n &= ~1;
    len = pMem->n * 2 + 1;
  }else{
    /* When converting from UTF-8 to UTF-16 the maximum growth is caused
    ** when a 1-byte UTF-8 character is translated into a 2-byte UTF-16
    ** character. Two bytes are required in the output buffer for the
    ** nul-terminator.
    */
    len = pMem->n * 2 + 2;
  }

  /* Set zIn to point at the start of the input buffer and zTerm to point 1
  ** byte past the end.
  **
  ** Variable zOut is set to point at the output buffer, space obtained
  ** from sqlite3_malloc().
  */
  zIn = (u8*)pMem->z;
  zTerm = &zIn[pMem->n];
  zOut = sqlite3DbMallocRaw(pMem->db, len);
  if( !zOut ){
    return SQLITE_NOMEM;
  }
  z = zOut;

  if( pMem->enc==SQLITE_UTF8 ){
    if( desiredEnc==SQLITE_UTF16LE ){
      /* UTF-8 -> UTF-16 Little-endian */
      while( zIn<zTerm ){
        READ_UTF8(zIn, zTerm, c);
        WRITE_UTF16LE(z, c);
      }
    }else{
      assert( desiredEnc==SQLITE_UTF16BE );
      /* UTF-8 -> UTF-16 Big-endian */
      while( zIn<zTerm ){
        READ_UTF8(zIn, zTerm, c);
        WRITE_UTF16BE(z, c);
      }
    }
    pMem->n = (int)(z - zOut);
    *z++ = 0;
  }else{
    assert( desiredEnc==SQLITE_UTF8 );
    if( pMem->enc==SQLITE_UTF16LE ){
      /* UTF-16 Little-endian -> UTF-8 */
      while( zIn<zTerm ){
        READ_UTF16LE(zIn, zIn<zTerm, c); 
        WRITE_UTF8(z, c);
      }
    }else{
      /* UTF-16 Big-endian -> UTF-8 */
      while( zIn<zTerm ){
        READ_UTF16BE(zIn, zIn<zTerm, c); 
        WRITE_UTF8(z, c);
      }
    }
    pMem->n = (int)(z - zOut);
  }
  *z = 0;
  assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len );

  sqlite3VdbeMemRelease(pMem);
  pMem->flags &= ~(MEM_Static|MEM_Dyn|MEM_Ephem);
  pMem->enc = desiredEnc;
  pMem->flags |= (MEM_Term|MEM_Dyn);
  pMem->z = (char*)zOut;
  pMem->zMalloc = pMem->z;

translate_out:
#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
  {
    char zBuf[100];
    sqlite3VdbeMemPrettyPrint(pMem, zBuf);
    fprintf(stderr, "OUTPUT: %s\n", zBuf);
  }
#endif
  return SQLITE_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x27(%rax), %eax
cmpl $0x1, %eax
je 0x31633
movzbl -0x11(%rbp), %eax
cmpl $0x1, %eax
je 0x31633
movq -0x10(%rbp), %rdi
callq 0x31300
movl %eax, -0x44(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x315be
movl $0x7, -0x4(%rbp)
jmp 0x31f5d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movl 0x20(%rcx), %ecx
andl $-0x2, %ecx
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x31624
movq -0x28(%rbp), %rax
movb (%rax), %al
movb %al, -0x3d(%rbp)
movq -0x28(%rbp), %rax
movb 0x1(%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
movb -0x3d(%rbp), %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
jmp 0x315e2
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x27(%rax)
jmp 0x31f56
movzbl -0x11(%rbp), %eax
cmpl $0x1, %eax
jne 0x3165a
movq -0x10(%rbp), %rax
movl 0x20(%rax), %ecx
andl $-0x2, %ecx
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
shll %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x31669
movq -0x10(%rbp), %rax
movl 0x20(%rax), %eax
shll %eax
addl $0x2, %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movslq 0x20(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movl -0x18(%rbp), %esi
callq 0x134e0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x316ae
movl $0x7, -0x4(%rbp)
jmp 0x31f5d
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x27(%rax), %eax
cmpl $0x1, %eax
jne 0x31a58
movzbl -0x11(%rbp), %eax
cmpl $0x2, %eax
jne 0x31882
jmp 0x316d6
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x3187d
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x3c(%rbp)
cmpl $0xc0, -0x3c(%rbp)
jb 0x3179f
movl -0x3c(%rbp), %eax
subl $0xc0, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x797f7(%rip), %rax     # 0xaaf10
movzbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x4d(%rbp)
je 0x31746
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
sete %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0x3174f
jmp 0x31771
movl -0x3c(%rbp), %eax
shll $0x6, %eax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movzbl (%rcx), %ecx
andl $0x3f, %ecx
addl %ecx, %eax
movl %eax, -0x3c(%rbp)
jmp 0x31720
cmpl $0x80, -0x3c(%rbp)
jb 0x31796
movl -0x3c(%rbp), %eax
andl $0xfffff800, %eax       # imm = 0xFFFFF800
cmpl $0xd800, %eax           # imm = 0xD800
je 0x31796
movl -0x3c(%rbp), %eax
andl $-0x2, %eax
cmpl $0xfffe, %eax           # imm = 0xFFFE
jne 0x3179d
movl $0xfffd, -0x3c(%rbp)    # imm = 0xFFFD
jmp 0x3179f
cmpl $0xffff, -0x3c(%rbp)    # imm = 0xFFFF
ja 0x317e6
movl -0x3c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31878
movl -0x3c(%rbp), %eax
shrl $0xa, %eax
andl $0x3f, %eax
movl -0x3c(%rbp), %ecx
subl $0x10000, %ecx          # imm = 0x10000
shrl $0xa, %ecx
andl $0xc0, %ecx
addl %ecx, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
subl $0x10000, %eax          # imm = 0x10000
shrl $0x12, %eax
andl $0x3, %eax
addl $0xd8, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0x8, %eax
andl $0x3, %eax
addl $0xdc, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x316d6
jmp 0x31a2d
jmp 0x31884
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x31a2b
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x3c(%rbp)
cmpl $0xc0, -0x3c(%rbp)
jb 0x3194d
movl -0x3c(%rbp), %eax
subl $0xc0, %eax
movl %eax, %eax
movl %eax, %ecx
leaq 0x79649(%rip), %rax     # 0xaaf10
movzbl (%rax,%rcx), %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rcx
xorl %eax, %eax
cmpq -0x30(%rbp), %rcx
movb %al, -0x4e(%rbp)
je 0x318f4
movq -0x28(%rbp), %rax
movzbl (%rax), %eax
andl $0xc0, %eax
cmpl $0x80, %eax
sete %al
movb %al, -0x4e(%rbp)
movb -0x4e(%rbp), %al
testb $0x1, %al
jne 0x318fd
jmp 0x3191f
movl -0x3c(%rbp), %eax
shll $0x6, %eax
movq -0x28(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movzbl (%rcx), %ecx
andl $0x3f, %ecx
addl %ecx, %eax
movl %eax, -0x3c(%rbp)
jmp 0x318ce
cmpl $0x80, -0x3c(%rbp)
jb 0x31944
movl -0x3c(%rbp), %eax
andl $0xfffff800, %eax       # imm = 0xFFFFF800
cmpl $0xd800, %eax           # imm = 0xD800
je 0x31944
movl -0x3c(%rbp), %eax
andl $-0x2, %eax
cmpl $0xfffe, %eax           # imm = 0xFFFE
jne 0x3194b
movl $0xfffd, -0x3c(%rbp)    # imm = 0xFFFD
jmp 0x3194d
cmpl $0xffff, -0x3c(%rbp)    # imm = 0xFFFF
ja 0x31994
movl -0x3c(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31a26
movl -0x3c(%rbp), %eax
subl $0x10000, %eax          # imm = 0x10000
shrl $0x12, %eax
andl $0x3, %eax
addl $0xd8, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0xa, %eax
andl $0x3f, %eax
movl -0x3c(%rbp), %ecx
subl $0x10000, %ecx          # imm = 0x10000
shrl $0xa, %ecx
andl $0xc0, %ecx
addl %ecx, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0x8, %eax
andl $0x3, %eax
addl $0xdc, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31884
jmp 0x31a2d
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x38(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x38(%rbp)
movb $0x0, (%rax)
jmp 0x31efc
movq -0x10(%rbp), %rax
movzbl 0x27(%rax), %eax
cmpl $0x2, %eax
jne 0x31caa
jmp 0x31a6b
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x31ca5
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
shll $0x8, %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl $0xd800, -0x3c(%rbp)    # imm = 0xD800
jb 0x31b1c
cmpl $0xe000, -0x3c(%rbp)    # imm = 0xE000
jae 0x31b1c
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x31b1c
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
movl %eax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
shll $0x8, %eax
addl -0x48(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl -0x3c(%rbp), %ecx
andl $0x3f, %ecx
shll $0xa, %ecx
addl %ecx, %eax
movl -0x3c(%rbp), %ecx
andl $0x3c0, %ecx            # imm = 0x3C0
addl $0x40, %ecx
shll $0xa, %ecx
addl %ecx, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x80, -0x3c(%rbp)
jae 0x31b45
movl -0x3c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31ca0
cmpl $0x800, -0x3c(%rbp)     # imm = 0x800
jae 0x31b98
movl -0x3c(%rbp), %eax
shrl $0x6, %eax
andl $0x1f, %eax
movzbl %al, %eax
addl $0xc0, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31c9e
cmpl $0x10000, -0x3c(%rbp)   # imm = 0x10000
jae 0x31c0f
movl -0x3c(%rbp), %eax
shrl $0xc, %eax
andl $0xf, %eax
movzbl %al, %eax
addl $0xe0, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0x6, %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31c9c
movl -0x3c(%rbp), %eax
shrl $0x12, %eax
andl $0x7, %eax
movzbl %al, %eax
addl $0xf0, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0xc, %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0x6, %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31c9e
jmp 0x31ca0
jmp 0x31a6b
jmp 0x31ee8
jmp 0x31cac
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x31ee6
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
shll $0x8, %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
addl -0x3c(%rbp), %eax
movl %eax, -0x3c(%rbp)
cmpl $0xd800, -0x3c(%rbp)    # imm = 0xD800
jb 0x31d5d
cmpl $0xe000, -0x3c(%rbp)    # imm = 0xE000
jae 0x31d5d
movq -0x28(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x31d5d
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
shll $0x8, %eax
movl %eax, -0x4c(%rbp)
movq -0x28(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x28(%rbp)
movzbl (%rax), %eax
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
andl $0x3ff, %eax            # imm = 0x3FF
movl -0x3c(%rbp), %ecx
andl $0x3f, %ecx
shll $0xa, %ecx
addl %ecx, %eax
movl -0x3c(%rbp), %ecx
andl $0x3c0, %ecx            # imm = 0x3C0
addl $0x40, %ecx
shll $0xa, %ecx
addl %ecx, %eax
movl %eax, -0x3c(%rbp)
cmpl $0x80, -0x3c(%rbp)
jae 0x31d86
movl -0x3c(%rbp), %eax
andl $0xff, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31ee1
cmpl $0x800, -0x3c(%rbp)     # imm = 0x800
jae 0x31dd9
movl -0x3c(%rbp), %eax
shrl $0x6, %eax
andl $0x1f, %eax
movzbl %al, %eax
addl $0xc0, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31edf
cmpl $0x10000, -0x3c(%rbp)   # imm = 0x10000
jae 0x31e50
movl -0x3c(%rbp), %eax
shrl $0xc, %eax
andl $0xf, %eax
movzbl %al, %eax
addl $0xe0, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0x6, %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31edd
movl -0x3c(%rbp), %eax
shrl $0x12, %eax
andl $0x7, %eax
movzbl %al, %eax
addl $0xf0, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0xc, %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
shrl $0x6, %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
movl -0x3c(%rbp), %eax
andl $0x3f, %eax
movzbl %al, %eax
addl $0x80, %eax
movb %al, %cl
movq -0x38(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x38(%rbp)
movb %cl, (%rax)
jmp 0x31edf
jmp 0x31ee1
jmp 0x31cac
jmp 0x31ee8
movq -0x38(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x38(%rbp), %rax
movb $0x0, (%rax)
movq -0x10(%rbp), %rdi
callq 0x10190
movq -0x10(%rbp), %rax
movzwl 0x24(%rax), %ecx
andl $0xffffe3ff, %ecx       # imm = 0xFFFFE3FF
movw %cx, 0x24(%rax)
movb -0x11(%rbp), %cl
movq -0x10(%rbp), %rax
movb %cl, 0x27(%rax)
movq -0x10(%rbp), %rax
movzwl 0x24(%rax), %ecx
orl $0x600, %ecx            # imm = 0x600
movw %cx, 0x24(%rax)
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x30(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)