// File: /workspace/github_c_makefile_star2_O0/ShinyaKato[P]skcc/utf8.c
// Function: check_sequence
int check_sequence(struct utf8c uc) {
  if(0x00 <= uc.sequence[0] && uc.sequence[0] <= 0x7F) { // 1-byte character
    if(uc.bytes != 1) return 0;
  } else if(0x80 <= uc.sequence[0] && uc.sequence[0] <= 0xC1) { // invalid sequence (not first byte)
    return 0;
  } else if(0xC2 <= uc.sequence[0] && uc.sequence[0] <= 0xDF) { // 2-bytes character
    if(uc.bytes != 2) return 0;
    if(!(0x80 <= uc.sequence[1] && uc.sequence[1] <= 0xC1)) return 0;
    if(uc.sequence[0] & 0x1E) return 0;
  } else if(0xE0 <= uc.sequence[0] && uc.sequence[0] <= 0xEF) { // 3-bytes character
    if(uc.bytes != 3) return 0;
    if(!(0x80 <= uc.sequence[1] && uc.sequence[1] <= 0xC1)) return 0;
    if(!(0x80 <= uc.sequence[2] && uc.sequence[2] <= 0xC1)) return 0;
    if((uc.sequence[0] & 0x0F) && (uc.sequence[1] & 0x20)) return 0;
  } else if(0xF0 <= uc.sequence[0] && uc.sequence[0] <= 0xF7) { // 4-bytes character
    if(uc.bytes != 4) return 0;
    if(!(0x80 <= uc.sequence[1] && uc.sequence[1] <= 0xC1)) return 0;
    if(!(0x80 <= uc.sequence[2] && uc.sequence[2] <= 0xC1)) return 0;
    if(!(0x80 <= uc.sequence[3] && uc.sequence[3] <= 0xC1)) return 0;
    if((uc.sequence[0] & 0x08) && (uc.sequence[1] & 0x30)) return 0;
  } else if(0xF8 <= uc.sequence[0] && uc.sequence[0] <= 0xFB) { // 5-bytes character
    return 0;
  } else if(0xFC <= uc.sequence[0] && uc.sequence[0] <= 0xFD) { // 6-bytes character
    return 0;
  } else if(uc.sequence[0] == 0xFE) { // invalid sequence
    return 0;
  } else if(uc.sequence[0] == 0xFF) { // EOF
    if(uc.bytes != 0) return 0;
    if(uc.sequence[0] != 0xFF) return 0;
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x20(%rbp)
movb %al, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x8(%rbp)
movzbl -0xc(%rbp), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x15f6
movzbl -0xc(%rbp), %eax
cmpl $0x7f, %eax
jg 0x15f6
cmpl $0x1, -0x10(%rbp)
je 0x15f1
movl $0x0, -0x4(%rbp)
jmp 0x188c
jmp 0x1885
movzbl -0xc(%rbp), %ecx
movl $0x80, %eax
cmpl %ecx, %eax
jg 0x161a
movzbl -0xc(%rbp), %eax
cmpl $0xc1, %eax
jg 0x161a
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xc(%rbp), %ecx
movl $0xc2, %eax
cmpl %ecx, %eax
jg 0x1685
movzbl -0xc(%rbp), %eax
cmpl $0xdf, %eax
jg 0x1685
cmpl $0x2, -0x10(%rbp)
je 0x1644
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xb(%rbp), %ecx
movl $0x80, %eax
cmpl %ecx, %eax
jg 0x165c
movzbl -0xb(%rbp), %eax
cmpl $0xc1, %eax
jle 0x1668
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xc(%rbp), %eax
andl $0x1e, %eax
cmpl $0x0, %eax
je 0x1680
movl $0x0, -0x4(%rbp)
jmp 0x188c
jmp 0x1881
movzbl -0xc(%rbp), %ecx
movl $0xe0, %eax
cmpl %ecx, %eax
jg 0x1728
movzbl -0xc(%rbp), %eax
cmpl $0xef, %eax
jg 0x1728
cmpl $0x3, -0x10(%rbp)
je 0x16b7
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xb(%rbp), %ecx
movl $0x80, %eax
cmpl %ecx, %eax
jg 0x16cf
movzbl -0xb(%rbp), %eax
cmpl $0xc1, %eax
jle 0x16db
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xa(%rbp), %ecx
movl $0x80, %eax
cmpl %ecx, %eax
jg 0x16f3
movzbl -0xa(%rbp), %eax
cmpl $0xc1, %eax
jle 0x16ff
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xc(%rbp), %eax
andl $0xf, %eax
cmpl $0x0, %eax
je 0x1723
movzbl -0xb(%rbp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x1723
movl $0x0, -0x4(%rbp)
jmp 0x188c
jmp 0x187f
movzbl -0xc(%rbp), %ecx
movl $0xf0, %eax
cmpl %ecx, %eax
jg 0x17ef
movzbl -0xc(%rbp), %eax
cmpl $0xf7, %eax
jg 0x17ef
cmpl $0x4, -0x10(%rbp)
je 0x175a
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xb(%rbp), %ecx
movl $0x80, %eax
cmpl %ecx, %eax
jg 0x1772
movzbl -0xb(%rbp), %eax
cmpl $0xc1, %eax
jle 0x177e
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xa(%rbp), %ecx
movl $0x80, %eax
cmpl %ecx, %eax
jg 0x1796
movzbl -0xa(%rbp), %eax
cmpl $0xc1, %eax
jle 0x17a2
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0x9(%rbp), %ecx
movl $0x80, %eax
cmpl %ecx, %eax
jg 0x17ba
movzbl -0x9(%rbp), %eax
cmpl $0xc1, %eax
jle 0x17c6
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xc(%rbp), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x17ea
movzbl -0xb(%rbp), %eax
andl $0x30, %eax
cmpl $0x0, %eax
je 0x17ea
movl $0x0, -0x4(%rbp)
jmp 0x188c
jmp 0x187d
movzbl -0xc(%rbp), %ecx
movl $0xf8, %eax
cmpl %ecx, %eax
jg 0x1810
movzbl -0xc(%rbp), %eax
cmpl $0xfb, %eax
jg 0x1810
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xc(%rbp), %ecx
movl $0xfc, %eax
cmpl %ecx, %eax
jg 0x1831
movzbl -0xc(%rbp), %eax
cmpl $0xfd, %eax
jg 0x1831
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xc(%rbp), %eax
cmpl $0xfe, %eax
jne 0x1845
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xc(%rbp), %eax
cmpl $0xff, %eax
jne 0x1875
cmpl $0x0, -0x10(%rbp)
je 0x185f
movl $0x0, -0x4(%rbp)
jmp 0x188c
movzbl -0xc(%rbp), %eax
cmpl $0xff, %eax
je 0x1873
movl $0x0, -0x4(%rbp)
jmp 0x188c
jmp 0x1875
jmp 0x1877
jmp 0x1879
jmp 0x187b
jmp 0x187d
jmp 0x187f
jmp 0x1881
jmp 0x1883
jmp 0x1885
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)