#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 uint8_t;

/* Variables and functions */
int /*<<< orphan*/ _isvalidutf8ext(int);
int _read_char();
int *calloc(int, int);
char *strdup(char *);
int vt_read(int *control, int *esc, char **key) {
  if ((control == NULL) || (esc == NULL) || (key == NULL)) {
    return (int)(-1);
  }
  uint8_t **key_bytes = (uint8_t **)key;
  uint8_t byte0 = _read_char();
  if (byte0 == 0x00) {
    (*control) = 0;
    (*esc) = 0;
    (*key) = strdup("");
    return (int)(0);
  }
  if (byte0 == 0x08) {
    (*control) = 0;
    (*esc) = 0;
    (*key) = strdup("backspace");
    return (int)(0);
  }
  if (byte0 == 0x09) {
    (*control) = 0;
    (*esc) = 0;
    (*key) = strdup("tab");
    return (int)(0);
  }
  if (byte0 == 0x0D) {
    (*control) = 0;
    (*esc) = 0;
    (*key) = strdup("enter");
    return (int)(0);
  }
  if ((0x01 <= byte0) && (byte0 <= 0x1A)) {
    (*control) = 1;
    (*esc) = 0;
    (*key_bytes) = calloc(2, sizeof(uint8_t));
    (*key_bytes)[0] = (byte0 - 0x01) + 'a';
    (*key_bytes)[1] = '\0';
    return (int)(0);
  }
  if (byte0 == 0x1B) {
    uint8_t byte1 = _read_char();
    if (byte1 != 0x5B) {
      (*control) = 0;
      (*esc) = 1;
      (*key_bytes) = calloc(2, sizeof(uint8_t));
      (*key_bytes)[0] = byte1;
      (*key_bytes)[1] = '\0';
      return (int)(0);
    } else {
      uint8_t byte2 = _read_char();
      if (byte2 == 0x31) {
        uint8_t byte3 = _read_char();
        if (byte3 == 0x7E) {
          (*control) = 0;
          (*esc) = 0;
          (*key) = strdup("home");
          return (int)(0);
        }
        return (int)(-2);
      }
      if (byte2 == 0x32) {
        uint8_t byte3 = _read_char();
        if (byte3 == 0x7E) {
          (*control) = 0;
          (*esc) = 0;
          (*key) = strdup("insert");
          return (int)(0);
        }
        return (int)(-2);
      }
      if (byte2 == 0x33) {
        uint8_t byte3 = _read_char();
        if (byte3 == 0x7E) {
          (*control) = 0;
          (*esc) = 0;
          (*key) = strdup("delete");
          return (int)(0);
        }
        return (int)(-2);
      }
      if (byte2 == 0x34) {
        uint8_t byte3 = _read_char();
        if (byte3 == 0x7E) {
          (*control) = 0;
          (*esc) = 0;
          (*key) = strdup("end");
          return (int)(0);
        }
        if (byte3 == 0x68) {
          (*control) = 0;
          (*esc) = 0;
          (*key) = strdup("insert");
          return (int)(0);
        }
        return (int)(-2);
      }
      if (byte2 == 0x35) {
        uint8_t byte3 = _read_char();
        if (byte3 == 0x7E) {
          (*control) = 0;
          (*esc) = 0;
          (*key) = strdup("pageup");
          return (int)(0);
        }
        return (int)(-2);
      }
      if (byte2 == 0x36) {
        uint8_t byte3 = _read_char();
        if (byte3 == 0x7E) {
          (*control) = 0;
          (*esc) = 0;
          (*key) = strdup("pagedown");
          return (int)(0);
        }
        return (int)(-2);
      }
      if (byte2 == 0x41) {
        (*control) = 0;
        (*esc) = 0;
        (*key) = strdup("up");
        return (int)(0);
      }
      if (byte2 == 0x42) {
        (*control) = 0;
        (*esc) = 0;
        (*key) = strdup("down");
        return (int)(0);
      }
      if (byte2 == 0x43) {
        (*control) = 0;
        (*esc) = 0;
        (*key) = strdup("right");
        return (int)(0);
      }
      if (byte2 == 0x44) {
        (*control) = 0;
        (*esc) = 0;
        (*key) = strdup("left");
        return (int)(0);
      }
      if (byte2 == 0x46) {
        (*control) = 0;
        (*esc) = 0;
        (*key) = strdup("end");
        return (int)(0);
      }
      if (byte2 == 0x48) {
        (*control) = 0;
        (*esc) = 0;
        (*key) = strdup("home");
        return (int)(0);
      }
      if (byte2 == 0x50) {
        (*control) = 0;
        (*esc) = 0;
        (*key) = strdup("delete");
        return (int)(0);
      }
      return (int)(-2);
    }
  }
  if ((0x20 <= byte0) && (byte0 <= 0x7E)) {
    (*control) = 0;
    (*esc) = 0;
    (*key_bytes) = calloc(2, sizeof(uint8_t));
    (*key_bytes)[0] = byte0;
    (*key_bytes)[1] = '\0';
    return (int)(0);
  }
  if (byte0 == 0x7F) {
    (*control) = 0;
    (*esc) = 0;
    (*key) = strdup("backspace");
    return (int)(0);
  }
  if ((byte0 & (0b111 << 5)) == (0b110 << 5)) {
    uint8_t byte1 = _read_char();
    if (!_isvalidutf8ext(byte1)) {
      return (int)(-2);
    }
    (*control) = 0;
    (*esc) = 0;
    (*key_bytes) = calloc(3, sizeof(uint8_t));
    (*key_bytes)[0] = byte0;
    (*key_bytes)[1] = byte1;
    (*key_bytes)[2] = '\0';
    return (int)(0);
  }
  if ((byte0 & (0b1111 << 4)) == (0b1110 << 4)) {
    uint8_t byte1 = _read_char();
    if (!_isvalidutf8ext(byte1)) {
      return (int)(-2);
    }
    uint8_t byte2 = _read_char();
    if (!_isvalidutf8ext(byte2)) {
      return (int)(-2);
    }
    (*control) = 0;
    (*esc) = 0;
    (*key_bytes) = calloc(4, sizeof(uint8_t));
    (*key_bytes)[0] = byte0;
    (*key_bytes)[1] = byte1;
    (*key_bytes)[2] = byte2;
    (*key_bytes)[3] = '\0';
    return (int)(0);
  }
  if ((byte0 & (0b11111 << 3)) == (0b11110 << 3)) {
    uint8_t byte1 = _read_char();
    if (!_isvalidutf8ext(byte1)) {
      return (int)(-2);
    }
    uint8_t byte2 = _read_char();
    if (!_isvalidutf8ext(byte2)) {
      return (int)(-2);
    }
    uint8_t byte3 = _read_char();
    if (!_isvalidutf8ext(byte3)) {
      return (int)(-2);
    }
    (*control) = 0;
    (*esc) = 0;
    (*key_bytes) = calloc(5, sizeof(uint8_t));
    (*key_bytes)[0] = byte0;
    (*key_bytes)[1] = byte1;
    (*key_bytes)[2] = byte2;
    (*key_bytes)[3] = byte3;
    (*key_bytes)[4] = '\0';
    return (int)(0);
  }
  return (int)(-2);
}


x86 assembly (clang, -O0):
<vt_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1175 <vt_read+0x35>
cmpq   $0x0,-0x18(%rbp)
je     1175 <vt_read+0x35>
cmpq   $0x0,-0x20(%rbp)
jne    1181 <vt_read+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    11d3 <vt_read+0x93>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xe55(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x8,-0x2c(%rbp)
jne    1213 <vt_read+0xd3>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xe08(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x9,-0x2c(%rbp)
jne    1253 <vt_read+0x113>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xdd2(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0xd,-0x2c(%rbp)
jne    1293 <vt_read+0x153>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xd96(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    $0x1,%eax
cmp    -0x2c(%rbp),%eax
jg     1304 <vt_read+0x1c4>
cmpl   $0x1a,-0x2c(%rbp)
jg     1304 <vt_read+0x1c4>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%ecx
sub    $0x1,%ecx
add    $0x61,%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,0x4(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x1b,-0x2c(%rbp)
jne    17cb <vt_read+0x68b>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x30(%rbp)
cmpl   $0x5b,-0x30(%rbp)
je     1375 <vt_read+0x235>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x1,(%rax)
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,0x4(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x31,-0x34(%rbp)
jne    13df <vt_read+0x29f>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x7e,-0x38(%rbp)
jne    13d3 <vt_read+0x293>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xc5c(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x32,-0x34(%rbp)
jne    143f <vt_read+0x2ff>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x7e,-0x3c(%rbp)
jne    1433 <vt_read+0x2f3>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xc01(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x33,-0x34(%rbp)
jne    149f <vt_read+0x35f>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x40(%rbp)
cmpl   $0x7e,-0x40(%rbp)
jne    1493 <vt_read+0x353>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xba8(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x34,-0x34(%rbp)
jne    153f <vt_read+0x3ff>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x7e,-0x44(%rbp)
jne    14f3 <vt_read+0x3b3>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xb4f(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x68,-0x44(%rbp)
jne    1533 <vt_read+0x3f3>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xb01(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x35,-0x34(%rbp)
jne    159f <vt_read+0x45f>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x48(%rbp)
cmpl   $0x7e,-0x48(%rbp)
jne    1593 <vt_read+0x453>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xab3(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x36,-0x34(%rbp)
jne    15ff <vt_read+0x4bf>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x4c(%rbp)
cmpl   $0x7e,-0x4c(%rbp)
jne    15f3 <vt_read+0x4b3>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xa5a(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x41,-0x34(%rbp)
jne    163f <vt_read+0x4ff>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0xa0b(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x42,-0x34(%rbp)
jne    167f <vt_read+0x53f>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0x9d2(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x43,-0x34(%rbp)
jne    16bf <vt_read+0x57f>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0x997(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x44,-0x34(%rbp)
jne    16ff <vt_read+0x5bf>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0x95d(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x46,-0x34(%rbp)
jne    173f <vt_read+0x5ff>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0x903(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x48,-0x34(%rbp)
jne    177f <vt_read+0x63f>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0x8b0(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x50,-0x34(%rbp)
jne    17bf <vt_read+0x67f>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0x87c(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    $0x20,%eax
cmp    -0x2c(%rbp),%eax
jg     1836 <vt_read+0x6f6>
cmpl   $0x7e,-0x2c(%rbp)
jg     1836 <vt_read+0x6f6>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,0x4(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
cmpl   $0x7f,-0x2c(%rbp)
jne    1876 <vt_read+0x736>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
lea    0x7a5(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    -0x2c(%rbp),%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    1910 <vt_read+0x7d0>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%edi
call   1030 <_isvalidutf8ext@plt>
cmp    $0x0,%eax
jne    18b0 <vt_read+0x770>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x50(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,0x8(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    -0x2c(%rbp),%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    19db <vt_read+0x89b>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%edi
call   1030 <_isvalidutf8ext@plt>
cmp    $0x0,%eax
jne    194a <vt_read+0x80a>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%edi
call   1030 <_isvalidutf8ext@plt>
cmp    $0x0,%eax
jne    1971 <vt_read+0x831>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x4,%esi
mov    %esi,%edi
call   1040 <calloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x54(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0x58(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x8(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,0xc(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    -0x2c(%rbp),%eax
and    $0xf8,%eax
cmp    $0xf0,%eax
jne    1add <vt_read+0x99d>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%edi
call   1030 <_isvalidutf8ext@plt>
cmp    $0x0,%eax
jne    1a15 <vt_read+0x8d5>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%edi
call   1030 <_isvalidutf8ext@plt>
cmp    $0x0,%eax
jne    1a3c <vt_read+0x8fc>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    $0x0,%al
call   1050 <_read_char@plt>
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%edi
call   1030 <_isvalidutf8ext@plt>
cmp    $0x0,%eax
jne    1a63 <vt_read+0x923>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    $0x5,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x5c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x4(%rax)
mov    -0x60(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0x8(%rax)
mov    -0x64(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,0xc(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movl   $0x0,0x10(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1ae4 <vt_read+0x9a4>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_read>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0xffffffff,%ebp
test   %rdi,%rdi
je     1304 <vt_read+0x1c4>
mov    %rsi,%r15
test   %rsi,%rsi
je     1304 <vt_read+0x1c4>
mov    %rdx,%r14
test   %rdx,%rdx
je     1304 <vt_read+0x1c4>
mov    %rdi,%r12
xor    %eax,%eax
call   1050 <_read_char@plt>
mov    %eax,%ebx
cmp    $0xd,%eax
ja     11af <vt_read+0x6f>
mov    %ebx,%eax
lea    0xe75(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xf1b(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
lea    -0x1(%rbx),%eax
cmp    $0x19,%eax
ja     1216 <vt_read+0xd6>
movl   $0x1,(%r12)
movl   $0x0,(%r15)
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,(%r14)
add    $0x60,%ebx
jmp    12a6 <vt_read+0x166>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xecc(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xeb5(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
cmp    $0x1b,%ebx
jne    127d <vt_read+0x13d>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <_read_char@plt>
cmp    $0x5b,%eax
jne    12b1 <vt_read+0x171>
xor    %eax,%eax
call   1050 <_read_char@plt>
mov    $0xfffffffe,%ebp
add    $0xffffffcf,%eax
cmp    $0x1f,%eax
ja     1304 <vt_read+0x1c4>
lea    0xdec(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
call   1050 <_read_char@plt>
cmp    $0x7e,%eax
jne    1304 <vt_read+0x1c4>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xe51(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
lea    -0x20(%rbx),%eax
cmp    $0x5e,%eax
ja     12df <vt_read+0x19f>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,(%r14)
mov    %ebx,(%rax)
movl   $0x0,0x4(%rax)
jmp    1302 <vt_read+0x1c2>
mov    %eax,%ebx
movl   $0x0,(%r12)
movl   $0x1,(%r15)
mov    $0x2,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,(%r14)
mov    %ebx,(%rax)
movl   $0x0,0x4(%rax)
jmp    1304 <vt_read+0x1c4>
cmp    $0x7f,%ebx
jne    1315 <vt_read+0x1d5>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xdbe(%rip),%rdi
call   1060 <strdup@plt>
mov    %rax,(%r14)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ebx,%eax
and    $0xe0,%eax
cmp    $0xc0,%eax
jne    136e <vt_read+0x22e>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <_read_char@plt>
mov    %eax,%r13d
mov    %eax,%edi
call   1030 <_isvalidutf8ext@plt>
test   %eax,%eax
je     148f <vt_read+0x34f>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
mov    $0x3,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,(%r14)
mov    %ebx,(%rax)
mov    %r13d,0x4(%rax)
movl   $0x0,0x8(%rax)
jmp    1304 <vt_read+0x1c4>
mov    %ebx,%eax
and    $0xf0,%eax
cmp    $0xe0,%eax
jne    13ec <vt_read+0x2ac>
xor    %eax,%eax
call   1050 <_read_char@plt>
mov    %eax,%r13d
mov    %eax,%edi
call   1030 <_isvalidutf8ext@plt>
mov    $0xfffffffe,%ebp
test   %eax,%eax
je     1304 <vt_read+0x1c4>
xor    %eax,%eax
call   1050 <_read_char@plt>
mov    %eax,(%rsp)
mov    %eax,%edi
call   1030 <_isvalidutf8ext@plt>
test   %eax,%eax
je     1304 <vt_read+0x1c4>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
mov    $0x4,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,(%r14)
mov    %ebx,(%rax)
mov    %r13d,0x4(%rax)
mov    (%rsp),%ecx
mov    %ecx,0x8(%rax)
movl   $0x0,0xc(%rax)
jmp    1302 <vt_read+0x1c2>
mov    %ebx,%eax
and    $0xf8,%eax
mov    $0xfffffffe,%ebp
cmp    $0xf0,%eax
jne    1304 <vt_read+0x1c4>
xor    %eax,%eax
call   1050 <_read_char@plt>
mov    %eax,%r13d
mov    %eax,%edi
call   1030 <_isvalidutf8ext@plt>
test   %eax,%eax
je     1304 <vt_read+0x1c4>
xor    %eax,%eax
call   1050 <_read_char@plt>
mov    %eax,(%rsp)
mov    %eax,%edi
call   1030 <_isvalidutf8ext@plt>
test   %eax,%eax
je     1304 <vt_read+0x1c4>
xor    %eax,%eax
call   1050 <_read_char@plt>
mov    %eax,0x4(%rsp)
mov    %eax,%edi
call   1030 <_isvalidutf8ext@plt>
test   %eax,%eax
je     1304 <vt_read+0x1c4>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
mov    $0x5,%edi
mov    $0x4,%esi
call   1040 <calloc@plt>
mov    %rax,(%r14)
mov    %ebx,(%rax)
mov    %r13d,0x4(%rax)
mov    (%rsp),%ecx
mov    %ecx,0x8(%rax)
mov    0x4(%rsp),%ecx
mov    %ecx,0xc(%rax)
movl   $0x0,0x10(%rax)
jmp    1302 <vt_read+0x1c2>
mov    $0xfffffffe,%ebp
jmp    1304 <vt_read+0x1c4>
xor    %eax,%eax
call   1050 <_read_char@plt>
cmp    $0x7e,%eax
jne    1304 <vt_read+0x1c4>
jmp    15cf <vt_read+0x48f>
xor    %eax,%eax
call   1050 <_read_char@plt>
cmp    $0x7e,%eax
jne    1304 <vt_read+0x1c4>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xc04(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
xor    %eax,%eax
call   1050 <_read_char@plt>
cmp    $0x68,%eax
je     15cf <vt_read+0x48f>
cmp    $0x7e,%eax
jne    1304 <vt_read+0x1c4>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xbd7(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
xor    %eax,%eax
call   1050 <_read_char@plt>
cmp    $0x7e,%eax
jne    1304 <vt_read+0x1c4>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xbb0(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
xor    %eax,%eax
call   1050 <_read_char@plt>
cmp    $0x7e,%eax
jne    1304 <vt_read+0x1c4>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xb8c(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xb6e(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xb5a(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xb44(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xb2f(%rip),%rdi
jmp    12fa <vt_read+0x1ba>
movl   $0x0,(%r12)
movl   $0x0,(%r15)
lea    0xaec(%rip),%rdi
jmp    12fa <vt_read+0x1ba>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [10 x i8] c"backspace\00"
@.str.2 = [4 x i8] c"tab\00"
@.str.3 = [6 x i8] c"enter\00"
@.str.4 = [5 x i8] c"home\00"
@.str.5 = [7 x i8] c"insert\00"
@.str.6 = [7 x i8] c"delete\00"
@.str.7 = [4 x i8] c"end\00"
@.str.8 = [7 x i8] c"pageup\00"
@.str.9 = [9 x i8] c"pagedown\00"
@.str.10 = [3 x i8] c"up\00"
@.str.11 = [5 x i8] c"down\00"
@.str.12 = [6 x i8] c"right\00"
@.str.13 = [5 x i8] c"left\00"
define i32 @vt_read(i32* %0, i32* %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8**
%8 = alloca i32**
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i8** %2, i8*** %7
%24 = load i32*, i32** %5
%25 = icmp eq i32* %24, null
br i1 %25, label %32, label %26
26: ; preds = %3
%27 = load i32*, i32** %6
%28 = icmp eq i32* %27, null
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i8**, i8*** %7
%31 = icmp eq i8** %30, null
br i1 %31, label %32, label %33
32: ; preds = %29, %26, %3
store i32 -1, i32* %4
br label %386
33: ; preds = %29
%34 = load i8**, i8*** %7
%35 = bitcast i8** %34 to i32**
store i32** %35, i32*** %8
%36 = call i32 (...) @_read_char()
store i32 %36, i32* %9
%37 = load i32, i32* %9
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %44
39: ; preds = %33
%40 = load i32*, i32** %5
store i32 0, i32* %40
%41 = load i32*, i32** %6
store i32 0, i32* %41
%42 = call i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%43 = load i8**, i8*** %7
store i8* %42, i8** %43
store i32 0, i32* %4
br label %386
44: ; preds = %33
%45 = load i32, i32* %9
%46 = icmp eq i32 %45, 8
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = load i32*, i32** %5
store i32 0, i32* %48
%49 = load i32*, i32** %6
store i32 0, i32* %49
%50 = call i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%51 = load i8**, i8*** %7
store i8* %50, i8** %51
store i32 0, i32* %4
br label %386
52: ; preds = %44
%53 = load i32, i32* %9
%54 = icmp eq i32 %53, 9
br i1 %54, label %55, label %60
55: ; preds = %52
%56 = load i32*, i32** %5
store i32 0, i32* %56
%57 = load i32*, i32** %6
store i32 0, i32* %57
%58 = call i8* @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%59 = load i8**, i8*** %7
store i8* %58, i8** %59
store i32 0, i32* %4
br label %386
60: ; preds = %52
%61 = load i32, i32* %9
%62 = icmp eq i32 %61, 13
br i1 %62, label %63, label %68
63: ; preds = %60
%64 = load i32*, i32** %5
store i32 0, i32* %64
%65 = load i32*, i32** %6
store i32 0, i32* %65
%66 = call i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%67 = load i8**, i8*** %7
store i8* %66, i8** %67
store i32 0, i32* %4
br label %386
68: ; preds = %60
%69 = load i32, i32* %9
%70 = icmp sle i32 1, %69
br i1 %70, label %71, label %88
71: ; preds = %68
%72 = load i32, i32* %9
%73 = icmp sle i32 %72, 26
br i1 %73, label %74, label %88
74: ; preds = %71
%75 = load i32*, i32** %5
store i32 1, i32* %75
%76 = load i32*, i32** %6
store i32 0, i32* %76
%77 = call i32* @calloc(i32 2, i32 4)
%78 = load i32**, i32*** %8
store i32* %77, i32** %78
%79 = load i32, i32* %9
%80 = sub nsw i32 %79, 1
%81 = add nsw i32 %80, 97
%82 = load i32**, i32*** %8
%83 = load i32*, i32** %82
%84 = getelementptr inbounds i32, i32* %83, i64 0
store i32 %81, i32* %84
%85 = load i32**, i32*** %8
%86 = load i32*, i32** %85
%87 = getelementptr inbounds i32, i32* %86, i64 1
store i32 0, i32* %87
store i32 0, i32* %4
br label %386
88: ; preds = %71, %68
%89 = load i32, i32* %9
%90 = icmp eq i32 %89, 27
br i1 %90, label %91, label %251
91: ; preds = %88
%92 = call i32 (...) @_read_char()
store i32 %92, i32* %10
%93 = load i32, i32* %10
%94 = icmp ne i32 %93, 91
br i1 %94, label %95, label %107
95: ; preds = %91
%96 = load i32*, i32** %5
store i32 0, i32* %96
%97 = load i32*, i32** %6
store i32 1, i32* %97
%98 = call i32* @calloc(i32 2, i32 4)
%99 = load i32**, i32*** %8
store i32* %98, i32** %99
%100 = load i32, i32* %10
%101 = load i32**, i32*** %8
%102 = load i32*, i32** %101
%103 = getelementptr inbounds i32, i32* %102, i64 0
store i32 %100, i32* %103
%104 = load i32**, i32*** %8
%105 = load i32*, i32** %104
%106 = getelementptr inbounds i32, i32* %105, i64 1
store i32 0, i32* %106
store i32 0, i32* %4
br label %386
107: ; preds = %91
%108 = call i32 (...) @_read_char()
store i32 %108, i32* %11
%109 = load i32, i32* %11
%110 = icmp eq i32 %109, 49
br i1 %110, label %111, label %121
111: ; preds = %107
%112 = call i32 (...) @_read_char()
store i32 %112, i32* %12
%113 = load i32, i32* %12
%114 = icmp eq i32 %113, 126
br i1 %114, label %115, label %120
115: ; preds = %111
%116 = load i32*, i32** %5
store i32 0, i32* %116
%117 = load i32*, i32** %6
store i32 0, i32* %117
%118 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%119 = load i8**, i8*** %7
store i8* %118, i8** %119
store i32 0, i32* %4
br label %386
120: ; preds = %111
store i32 -2, i32* %4
br label %386
121: ; preds = %107
%122 = load i32, i32* %11
%123 = icmp eq i32 %122, 50
br i1 %123, label %124, label %134
124: ; preds = %121
%125 = call i32 (...) @_read_char()
store i32 %125, i32* %13
%126 = load i32, i32* %13
%127 = icmp eq i32 %126, 126
br i1 %127, label %128, label %133
128: ; preds = %124
%129 = load i32*, i32** %5
store i32 0, i32* %129
%130 = load i32*, i32** %6
store i32 0, i32* %130
%131 = call i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%132 = load i8**, i8*** %7
store i8* %131, i8** %132
store i32 0, i32* %4
br label %386
133: ; preds = %124
store i32 -2, i32* %4
br label %386
134: ; preds = %121
%135 = load i32, i32* %11
%136 = icmp eq i32 %135, 51
br i1 %136, label %137, label %147
137: ; preds = %134
%138 = call i32 (...) @_read_char()
store i32 %138, i32* %14
%139 = load i32, i32* %14
%140 = icmp eq i32 %139, 126
br i1 %140, label %141, label %146
141: ; preds = %137
%142 = load i32*, i32** %5
store i32 0, i32* %142
%143 = load i32*, i32** %6
store i32 0, i32* %143
%144 = call i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%145 = load i8**, i8*** %7
store i8* %144, i8** %145
store i32 0, i32* %4
br label %386
146: ; preds = %137
store i32 -2, i32* %4
br label %386
147: ; preds = %134
%148 = load i32, i32* %11
%149 = icmp eq i32 %148, 52
br i1 %149, label %150, label %168
150: ; preds = %147
%151 = call i32 (...) @_read_char()
store i32 %151, i32* %15
%152 = load i32, i32* %15
%153 = icmp eq i32 %152, 126
br i1 %153, label %154, label %159
154: ; preds = %150
%155 = load i32*, i32** %5
store i32 0, i32* %155
%156 = load i32*, i32** %6
store i32 0, i32* %156
%157 = call i8* @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%158 = load i8**, i8*** %7
store i8* %157, i8** %158
store i32 0, i32* %4
br label %386
159: ; preds = %150
%160 = load i32, i32* %15
%161 = icmp eq i32 %160, 104
br i1 %161, label %162, label %167
162: ; preds = %159
%163 = load i32*, i32** %5
store i32 0, i32* %163
%164 = load i32*, i32** %6
store i32 0, i32* %164
%165 = call i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
%166 = load i8**, i8*** %7
store i8* %165, i8** %166
store i32 0, i32* %4
br label %386
167: ; preds = %159
store i32 -2, i32* %4
br label %386
168: ; preds = %147
%169 = load i32, i32* %11
%170 = icmp eq i32 %169, 53
br i1 %170, label %171, label %181
171: ; preds = %168
%172 = call i32 (...) @_read_char()
store i32 %172, i32* %16
%173 = load i32, i32* %16
%174 = icmp eq i32 %173, 126
br i1 %174, label %175, label %180
175: ; preds = %171
%176 = load i32*, i32** %5
store i32 0, i32* %176
%177 = load i32*, i32** %6
store i32 0, i32* %177
%178 = call i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%179 = load i8**, i8*** %7
store i8* %178, i8** %179
store i32 0, i32* %4
br label %386
180: ; preds = %171
store i32 -2, i32* %4
br label %386
181: ; preds = %168
%182 = load i32, i32* %11
%183 = icmp eq i32 %182, 54
br i1 %183, label %184, label %194
184: ; preds = %181
%185 = call i32 (...) @_read_char()
store i32 %185, i32* %17
%186 = load i32, i32* %17
%187 = icmp eq i32 %186, 126
br i1 %187, label %188, label %193
188: ; preds = %184
%189 = load i32*, i32** %5
store i32 0, i32* %189
%190 = load i32*, i32** %6
store i32 0, i32* %190
%191 = call i8* @strdup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
%192 = load i8**, i8*** %7
store i8* %191, i8** %192
store i32 0, i32* %4
br label %386
193: ; preds = %184
store i32 -2, i32* %4
br label %386
194: ; preds = %181
%195 = load i32, i32* %11
%196 = icmp eq i32 %195, 65
br i1 %196, label %197, label %202
197: ; preds = %194
%198 = load i32*, i32** %5
store i32 0, i32* %198
%199 = load i32*, i32** %6
store i32 0, i32* %199
%200 = call i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
%201 = load i8**, i8*** %7
store i8* %200, i8** %201
store i32 0, i32* %4
br label %386
202: ; preds = %194
%203 = load i32, i32* %11
%204 = icmp eq i32 %203, 66
br i1 %204, label %205, label %210
205: ; preds = %202
%206 = load i32*, i32** %5
store i32 0, i32* %206
%207 = load i32*, i32** %6
store i32 0, i32* %207
%208 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%209 = load i8**, i8*** %7
store i8* %208, i8** %209
store i32 0, i32* %4
br label %386
210: ; preds = %202
%211 = load i32, i32* %11
%212 = icmp eq i32 %211, 67
br i1 %212, label %213, label %218
213: ; preds = %210
%214 = load i32*, i32** %5
store i32 0, i32* %214
%215 = load i32*, i32** %6
store i32 0, i32* %215
%216 = call i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
%217 = load i8**, i8*** %7
store i8* %216, i8** %217
store i32 0, i32* %4
br label %386
218: ; preds = %210
%219 = load i32, i32* %11
%220 = icmp eq i32 %219, 68
br i1 %220, label %221, label %226
221: ; preds = %218
%222 = load i32*, i32** %5
store i32 0, i32* %222
%223 = load i32*, i32** %6
store i32 0, i32* %223
%224 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%225 = load i8**, i8*** %7
store i8* %224, i8** %225
store i32 0, i32* %4
br label %386
226: ; preds = %218
%227 = load i32, i32* %11
%228 = icmp eq i32 %227, 70
br i1 %228, label %229, label %234
229: ; preds = %226
%230 = load i32*, i32** %5
store i32 0, i32* %230
%231 = load i32*, i32** %6
store i32 0, i32* %231
%232 = call i8* @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%233 = load i8**, i8*** %7
store i8* %232, i8** %233
store i32 0, i32* %4
br label %386
234: ; preds = %226
%235 = load i32, i32* %11
%236 = icmp eq i32 %235, 72
br i1 %236, label %237, label %242
237: ; preds = %234
%238 = load i32*, i32** %5
store i32 0, i32* %238
%239 = load i32*, i32** %6
store i32 0, i32* %239
%240 = call i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%241 = load i8**, i8*** %7
store i8* %240, i8** %241
store i32 0, i32* %4
br label %386
242: ; preds = %234
%243 = load i32, i32* %11
%244 = icmp eq i32 %243, 80
br i1 %244, label %245, label %250
245: ; preds = %242
%246 = load i32*, i32** %5
store i32 0, i32* %246
%247 = load i32*, i32** %6
store i32 0, i32* %247
%248 = call i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
%249 = load i8**, i8*** %7
store i8* %248, i8** %249
store i32 0, i32* %4
br label %386
250: ; preds = %242
store i32 -2, i32* %4
br label %386
251: ; preds = %88
%252 = load i32, i32* %9
%253 = icmp sle i32 32, %252
br i1 %253, label %254, label %269
254: ; preds = %251
%255 = load i32, i32* %9
%256 = icmp sle i32 %255, 126
br i1 %256, label %257, label %269
257: ; preds = %254
%258 = load i32*, i32** %5
store i32 0, i32* %258
%259 = load i32*, i32** %6
store i32 0, i32* %259
%260 = call i32* @calloc(i32 2, i32 4)
%261 = load i32**, i32*** %8
store i32* %260, i32** %261
%262 = load i32, i32* %9
%263 = load i32**, i32*** %8
%264 = load i32*, i32** %263
%265 = getelementptr inbounds i32, i32* %264, i64 0
store i32 %262, i32* %265
%266 = load i32**, i32*** %8
%267 = load i32*, i32** %266
%268 = getelementptr inbounds i32, i32* %267, i64 1
store i32 0, i32* %268
store i32 0, i32* %4
br label %386
269: ; preds = %254, %251
%270 = load i32, i32* %9
%271 = icmp eq i32 %270, 127
br i1 %271, label %272, label %277
272: ; preds = %269
%273 = load i32*, i32** %5
store i32 0, i32* %273
%274 = load i32*, i32** %6
store i32 0, i32* %274
%275 = call i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%276 = load i8**, i8*** %7
store i8* %275, i8** %276
store i32 0, i32* %4
br label %386
277: ; preds = %269
%278 = load i32, i32* %9
%279 = and i32 %278, 224
%280 = icmp eq i32 %279, 192
br i1 %280, label %281, label %303
281: ; preds = %277
%282 = call i32 (...) @_read_char()
store i32 %282, i32* %18
%283 = load i32, i32* %18
%284 = call i32 @_isvalidutf8ext(i32 %283)
%285 = icmp ne i32 %284, 0
br i1 %285, label %287, label %286
286: ; preds = %281
store i32 -2, i32* %4
br label %386
287: ; preds = %281
%288 = load i32*, i32** %5
store i32 0, i32* %288
%289 = load i32*, i32** %6
store i32 0, i32* %289
%290 = call i32* @calloc(i32 3, i32 4)
%291 = load i32**, i32*** %8
store i32* %290, i32** %291
%292 = load i32, i32* %9
%293 = load i32**, i32*** %8
%294 = load i32*, i32** %293
%295 = getelementptr inbounds i32, i32* %294, i64 0
store i32 %292, i32* %295
%296 = load i32, i32* %18
%297 = load i32**, i32*** %8
%298 = load i32*, i32** %297
%299 = getelementptr inbounds i32, i32* %298, i64 1
store i32 %296, i32* %299
%300 = load i32**, i32*** %8
%301 = load i32*, i32** %300
%302 = getelementptr inbounds i32, i32* %301, i64 2
store i32 0, i32* %302
store i32 0, i32* %4
br label %386
303: ; preds = %277
%304 = load i32, i32* %9
%305 = and i32 %304, 240
%306 = icmp eq i32 %305, 224
br i1 %306, label %307, label %339
307: ; preds = %303
%308 = call i32 (...) @_read_char()
store i32 %308, i32* %19
%309 = load i32, i32* %19
%310 = call i32 @_isvalidutf8ext(i32 %309)
%311 = icmp ne i32 %310, 0
br i1 %311, label %313, label %312
312: ; preds = %307
store i32 -2, i32* %4
br label %386
313: ; preds = %307
%314 = call i32 (...) @_read_char()
store i32 %314, i32* %20
%315 = load i32, i32* %20
%316 = call i32 @_isvalidutf8ext(i32 %315)
%317 = icmp ne i32 %316, 0
br i1 %317, label %319, label %318
318: ; preds = %313
store i32 -2, i32* %4
br label %386
319: ; preds = %313
%320 = load i32*, i32** %5
store i32 0, i32* %320
%321 = load i32*, i32** %6
store i32 0, i32* %321
%322 = call i32* @calloc(i32 4, i32 4)
%323 = load i32**, i32*** %8
store i32* %322, i32** %323
%324 = load i32, i32* %9
%325 = load i32**, i32*** %8
%326 = load i32*, i32** %325
%327 = getelementptr inbounds i32, i32* %326, i64 0
store i32 %324, i32* %327
%328 = load i32, i32* %19
%329 = load i32**, i32*** %8
%330 = load i32*, i32** %329
%331 = getelementptr inbounds i32, i32* %330, i64 1
store i32 %328, i32* %331
%332 = load i32, i32* %20
%333 = load i32**, i32*** %8
%334 = load i32*, i32** %333
%335 = getelementptr inbounds i32, i32* %334, i64 2
store i32 %332, i32* %335
%336 = load i32**, i32*** %8
%337 = load i32*, i32** %336
%338 = getelementptr inbounds i32, i32* %337, i64 3
store i32 0, i32* %338
store i32 0, i32* %4
br label %386
339: ; preds = %303
%340 = load i32, i32* %9
%341 = and i32 %340, 248
%342 = icmp eq i32 %341, 240
br i1 %342, label %343, label %385
343: ; preds = %339
%344 = call i32 (...) @_read_char()
store i32 %344, i32* %21
%345 = load i32, i32* %21
%346 = call i32 @_isvalidutf8ext(i32 %345)
%347 = icmp ne i32 %346, 0
br i1 %347, label %349, label %348
348: ; preds = %343
store i32 -2, i32* %4
br label %386
349: ; preds = %343
%350 = call i32 (...) @_read_char()
store i32 %350, i32* %22
%351 = load i32, i32* %22
%352 = call i32 @_isvalidutf8ext(i32 %351)
%353 = icmp ne i32 %352, 0
br i1 %353, label %355, label %354
354: ; preds = %349
store i32 -2, i32* %4
br label %386
355: ; preds = %349
%356 = call i32 (...) @_read_char()
store i32 %356, i32* %23
%357 = load i32, i32* %23
%358 = call i32 @_isvalidutf8ext(i32 %357)
%359 = icmp ne i32 %358, 0
br i1 %359, label %361, label %360
360: ; preds = %355
store i32 -2, i32* %4
br label %386
361: ; preds = %355
%362 = load i32*, i32** %5
store i32 0, i32* %362
%363 = load i32*, i32** %6
store i32 0, i32* %363
%364 = call i32* @calloc(i32 5, i32 4)
%365 = load i32**, i32*** %8
store i32* %364, i32** %365
%366 = load i32, i32* %9
%367 = load i32**, i32*** %8
%368 = load i32*, i32** %367
%369 = getelementptr inbounds i32, i32* %368, i64 0
store i32 %366, i32* %369
%370 = load i32, i32* %21
%371 = load i32**, i32*** %8
%372 = load i32*, i32** %371
%373 = getelementptr inbounds i32, i32* %372, i64 1
store i32 %370, i32* %373
%374 = load i32, i32* %22
%375 = load i32**, i32*** %8
%376 = load i32*, i32** %375
%377 = getelementptr inbounds i32, i32* %376, i64 2
store i32 %374, i32* %377
%378 = load i32, i32* %23
%379 = load i32**, i32*** %8
%380 = load i32*, i32** %379
%381 = getelementptr inbounds i32, i32* %380, i64 3
store i32 %378, i32* %381
%382 = load i32**, i32*** %8
%383 = load i32*, i32** %382
%384 = getelementptr inbounds i32, i32* %383, i64 4
store i32 0, i32* %384
store i32 0, i32* %4
br label %386
385: ; preds = %339
store i32 -2, i32* %4
br label %386
386: ; preds = %385, %361, %360, %354, %348, %319, %318, %312, %287, %286, %272, %257, %250, %245, %237, %229, %221, %213, %205, %197, %193, %188, %180, %175, %167, %162, %154, %146, %141, %133, %128, %120, %115, %95, %74, %63, %55, %47, %39, %32
%387 = load i32, i32* %4
ret i32 %387
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [10 x i8] c"backspace\00"
@.str.2 = [4 x i8] c"tab\00"
@.str.3 = [6 x i8] c"enter\00"
@.str.4 = [5 x i8] c"home\00"
@.str.5 = [7 x i8] c"insert\00"
@.str.6 = [7 x i8] c"delete\00"
@.str.7 = [4 x i8] c"end\00"
@.str.8 = [7 x i8] c"pageup\00"
@.str.9 = [9 x i8] c"pagedown\00"
@.str.10 = [3 x i8] c"up\00"
@.str.11 = [5 x i8] c"down\00"
@.str.12 = [6 x i8] c"right\00"
@.str.13 = [5 x i8] c"left\00"
define i32 @vt_read(i32* writeonly %0, i32* writeonly %1, i8** %2) {
%4 = icmp eq i32* %0, null
%5 = icmp eq i32* %1, null
%6 = or i1 %4, %5
%7 = icmp eq i8** %2, null
%8 = or i1 %6, %7
br i1 %8, label %140, label %9
9: ; preds = %3
%10 = bitcast i8** %2 to i32**
%11 = tail call i32 (...) @_read_char()
switch i32 %11, label %20 [
i32 0, label %12
i32 8, label %14
i32 9, label %16
i32 13, label %18
]
12: ; preds = %9
store i32 0, i32* %0
store i32 0, i32* %1
%13 = tail call dereferenceable_or_null(1) i8* @strdup(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
store i8* %13, i8** %2
br label %140
14: ; preds = %9
store i32 0, i32* %0
store i32 0, i32* %1
%15 = tail call dereferenceable_or_null(10) i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i8* %15, i8** %2
br label %140
16: ; preds = %9
store i32 0, i32* %0
store i32 0, i32* %1
%17 = tail call dereferenceable_or_null(4) i8* @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i8* %17, i8** %2
br label %140
18: ; preds = %9
store i32 0, i32* %0
store i32 0, i32* %1
%19 = tail call dereferenceable_or_null(6) i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i8* %19, i8** %2
br label %140
20: ; preds = %9
%21 = add i32 %11, -1
%22 = icmp ult i32 %21, 26
br i1 %22, label %23, label %27
23: ; preds = %20
store i32 1, i32* %0
store i32 0, i32* %1
%24 = tail call i32* @calloc(i32 2, i32 4)
store i32* %24, i32** %10
%25 = add nuw nsw i32 %11, 96
store i32 %25, i32* %24
%26 = getelementptr inbounds i32, i32* %24, i64 1
store i32 0, i32* %26
br label %140
27: ; preds = %20
%28 = icmp eq i32 %11, 27
br i1 %28, label %29, label %82
29: ; preds = %27
%30 = tail call i32 (...) @_read_char()
%31 = icmp eq i32 %30, 91
br i1 %31, label %35, label %32
32: ; preds = %29
store i32 0, i32* %0
store i32 1, i32* %1
%33 = tail call i32* @calloc(i32 2, i32 4)
store i32* %33, i32** %10
store i32 %30, i32* %33
%34 = getelementptr inbounds i32, i32* %33, i64 1
store i32 0, i32* %34
br label %140
35: ; preds = %29
%36 = tail call i32 (...) @_read_char()
switch i32 %36, label %140 [
i32 49, label %37
i32 50, label %42
i32 51, label %47
i32 52, label %52
i32 53, label %58
i32 54, label %63
i32 65, label %68
i32 66, label %70
i32 67, label %72
i32 68, label %74
i32 70, label %76
i32 72, label %78
i32 80, label %80
]
37: ; preds = %35
%38 = tail call i32 (...) @_read_char()
%39 = icmp eq i32 %38, 126
br i1 %39, label %40, label %140
40: ; preds = %37
store i32 0, i32* %0
store i32 0, i32* %1
%41 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i8* %41, i8** %2
br label %140
42: ; preds = %35
%43 = tail call i32 (...) @_read_char()
%44 = icmp eq i32 %43, 126
br i1 %44, label %45, label %140
45: ; preds = %42
store i32 0, i32* %0
store i32 0, i32* %1
%46 = tail call dereferenceable_or_null(7) i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
store i8* %46, i8** %2
br label %140
47: ; preds = %35
%48 = tail call i32 (...) @_read_char()
%49 = icmp eq i32 %48, 126
br i1 %49, label %50, label %140
50: ; preds = %47
store i32 0, i32* %0
store i32 0, i32* %1
%51 = tail call dereferenceable_or_null(7) i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i8* %51, i8** %2
br label %140
52: ; preds = %35
%53 = tail call i32 (...) @_read_char()
switch i32 %53, label %140 [
i32 126, label %54
i32 104, label %56
]
54: ; preds = %52
store i32 0, i32* %0
store i32 0, i32* %1
%55 = tail call dereferenceable_or_null(4) i8* @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
store i8* %55, i8** %2
br label %140
56: ; preds = %52
store i32 0, i32* %0
store i32 0, i32* %1
%57 = tail call dereferenceable_or_null(7) i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0))
store i8* %57, i8** %2
br label %140
58: ; preds = %35
%59 = tail call i32 (...) @_read_char()
%60 = icmp eq i32 %59, 126
br i1 %60, label %61, label %140
61: ; preds = %58
store i32 0, i32* %0
store i32 0, i32* %1
%62 = tail call dereferenceable_or_null(7) i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
store i8* %62, i8** %2
br label %140
63: ; preds = %35
%64 = tail call i32 (...) @_read_char()
%65 = icmp eq i32 %64, 126
br i1 %65, label %66, label %140
66: ; preds = %63
store i32 0, i32* %0
store i32 0, i32* %1
%67 = tail call dereferenceable_or_null(9) i8* @strdup(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0))
store i8* %67, i8** %2
br label %140
68: ; preds = %35
store i32 0, i32* %0
store i32 0, i32* %1
%69 = tail call dereferenceable_or_null(3) i8* @strdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
store i8* %69, i8** %2
br label %140
70: ; preds = %35
store i32 0, i32* %0
store i32 0, i32* %1
%71 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
store i8* %71, i8** %2
br label %140
72: ; preds = %35
store i32 0, i32* %0
store i32 0, i32* %1
%73 = tail call dereferenceable_or_null(6) i8* @strdup(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0))
store i8* %73, i8** %2
br label %140
74: ; preds = %35
store i32 0, i32* %0
store i32 0, i32* %1
%75 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
store i8* %75, i8** %2
br label %140
76: ; preds = %35
store i32 0, i32* %0
store i32 0, i32* %1
%77 = tail call dereferenceable_or_null(4) i8* @strdup(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
store i8* %77, i8** %2
br label %140
78: ; preds = %35
store i32 0, i32* %0
store i32 0, i32* %1
%79 = tail call dereferenceable_or_null(5) i8* @strdup(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
store i8* %79, i8** %2
br label %140
80: ; preds = %35
store i32 0, i32* %0
store i32 0, i32* %1
%81 = tail call dereferenceable_or_null(7) i8* @strdup(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
store i8* %81, i8** %2
br label %140
82: ; preds = %27
%83 = add i32 %11, -32
%84 = icmp ult i32 %83, 95
br i1 %84, label %85, label %88
85: ; preds = %82
store i32 0, i32* %0
store i32 0, i32* %1
%86 = tail call i32* @calloc(i32 2, i32 4)
store i32* %86, i32** %10
store i32 %11, i32* %86
%87 = getelementptr inbounds i32, i32* %86, i64 1
store i32 0, i32* %87
br label %140
88: ; preds = %82
%89 = icmp eq i32 %11, 127
br i1 %89, label %90, label %92
90: ; preds = %88
store i32 0, i32* %0
store i32 0, i32* %1
%91 = tail call dereferenceable_or_null(10) i8* @strdup(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i8* %91, i8** %2
br label %140
92: ; preds = %88
%93 = and i32 %11, 224
%94 = icmp eq i32 %93, 192
br i1 %94, label %95, label %103
95: ; preds = %92
%96 = tail call i32 (...) @_read_char()
%97 = tail call i32 @_isvalidutf8ext(i32 %96)
%98 = icmp eq i32 %97, 0
br i1 %98, label %140, label %99
99: ; preds = %95
store i32 0, i32* %0
store i32 0, i32* %1
%100 = tail call i32* @calloc(i32 3, i32 4)
store i32* %100, i32** %10
store i32 %11, i32* %100
%101 = getelementptr inbounds i32, i32* %100, i64 1
store i32 %96, i32* %101
%102 = getelementptr inbounds i32, i32* %100, i64 2
store i32 0, i32* %102
br label %140
103: ; preds = %92
%104 = and i32 %11, 240
%105 = icmp eq i32 %104, 224
br i1 %105, label %106, label %119
106: ; preds = %103
%107 = tail call i32 (...) @_read_char()
%108 = tail call i32 @_isvalidutf8ext(i32 %107)
%109 = icmp eq i32 %108, 0
br i1 %109, label %140, label %110
110: ; preds = %106
%111 = tail call i32 (...) @_read_char()
%112 = tail call i32 @_isvalidutf8ext(i32 %111)
%113 = icmp eq i32 %112, 0
br i1 %113, label %140, label %114
114: ; preds = %110
store i32 0, i32* %0
store i32 0, i32* %1
%115 = tail call i32* @calloc(i32 4, i32 4)
store i32* %115, i32** %10
store i32 %11, i32* %115
%116 = getelementptr inbounds i32, i32* %115, i64 1
store i32 %107, i32* %116
%117 = getelementptr inbounds i32, i32* %115, i64 2
store i32 %111, i32* %117
%118 = getelementptr inbounds i32, i32* %115, i64 3
store i32 0, i32* %118
br label %140
119: ; preds = %103
%120 = and i32 %11, 248
%121 = icmp eq i32 %120, 240
br i1 %121, label %122, label %140
122: ; preds = %119
%123 = tail call i32 (...) @_read_char()
%124 = tail call i32 @_isvalidutf8ext(i32 %123)
%125 = icmp eq i32 %124, 0
br i1 %125, label %140, label %126
126: ; preds = %122
%127 = tail call i32 (...) @_read_char()
%128 = tail call i32 @_isvalidutf8ext(i32 %127)
%129 = icmp eq i32 %128, 0
br i1 %129, label %140, label %130
130: ; preds = %126
%131 = tail call i32 (...) @_read_char()
%132 = tail call i32 @_isvalidutf8ext(i32 %131)
%133 = icmp eq i32 %132, 0
br i1 %133, label %140, label %134
134: ; preds = %130
store i32 0, i32* %0
store i32 0, i32* %1
%135 = tail call i32* @calloc(i32 5, i32 4)
store i32* %135, i32** %10
store i32 %11, i32* %135
%136 = getelementptr inbounds i32, i32* %135, i64 1
store i32 %123, i32* %136
%137 = getelementptr inbounds i32, i32* %135, i64 2
store i32 %127, i32* %137
%138 = getelementptr inbounds i32, i32* %135, i64 3
store i32 %131, i32* %138
%139 = getelementptr inbounds i32, i32* %135, i64 4
store i32 0, i32* %139
br label %140
140: ; preds = %12, %14, %16, %18, %23, %85, %90, %68, %70, %72, %74, %76, %78, %80, %37, %40, %42, %45, %47, %50, %52, %56, %54, %58, %61, %63, %66, %35, %32, %95, %99, %114, %110, %106, %126, %130, %134, %122, %119, %3
%141 = phi i32 [ -1, %3 ], [ 0, %12 ], [ 0, %14 ], [ 0, %16 ], [ 0, %18 ], [ 0, %23 ], [ 0, %85 ], [ 0, %90 ], [ 0, %32 ], [ 0, %68 ], [ 0, %70 ], [ 0, %72 ], [ 0, %74 ], [ 0, %76 ], [ 0, %78 ], [ 0, %80 ], [ 0, %40 ], [ -2, %37 ], [ 0, %45 ], [ -2, %42 ], [ 0, %50 ], [ -2, %47 ], [ 0, %54 ], [ 0, %56 ], [ -2, %52 ], [ 0, %61 ], [ -2, %58 ], [ 0, %66 ], [ -2, %63 ], [ -2, %35 ], [ 0, %99 ], [ -2, %95 ], [ -2, %106 ], [ 0, %114 ], [ -2, %110 ], [ -2, %122 ], [ -2, %126 ], [ 0, %134 ], [ -2, %130 ], [ -2, %119 ]
ret i32 %141
}