#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 /*<<< orphan*/ s;
typedef char mbstate_t;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ EILSEQ;
int /*<<< orphan*/ LC_CTYPE;
int /*<<< orphan*/ MB_LEN_MAX;
int /*<<< orphan*/ assert(int);
size_t c16rtomb(char *, int, char *);
scalar_t__ errno;
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int main(int argc, char *argv[]) {
  mbstate_t s;
  char buf[MB_LEN_MAX + 1];
  printf("1..1\n");
  assert(c16rtomb(NULL, L'\0', NULL) == 1);
  assert(c16rtomb(NULL, 0xdc00, NULL) == 1);
  memset(&s, 0, sizeof(s));
  memset(buf, 0xcc, sizeof(buf));
  assert(c16rtomb(buf, 0, &s) == 1);
  assert((unsigned char)buf[0] == 0 && (unsigned char)buf[1] == 0xcc);
  assert(c16rtomb(NULL, L'\0', NULL) == 1);
  assert(c16rtomb(NULL, L'A', NULL) == 1);
  memset(&s, 0, sizeof(s));
  memset(buf, 0xcc, sizeof(buf));
  assert(c16rtomb(buf, L'A', &s) == 1);
  assert((unsigned char)buf[0] == 'A' && (unsigned char)buf[1] == 0xcc);
  memset(&s, 0, sizeof(s));
  memset(buf, 0xcc, sizeof(buf));
  assert(c16rtomb(buf, 0xd83d, &s) == 0);
  assert(c16rtomb(buf, 0xdca9, &s) == (size_t)-1);
  assert(errno == EILSEQ);
  assert((unsigned char)buf[0] == 0xcc);
  assert(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-1"), "en_US.ISO8859-1") ==
         0);
  memset(&s, 0, sizeof(s));
  memset(buf, 0xcc, sizeof(buf));
  assert(c16rtomb(buf, 0x20ac, &s) == (size_t)-1);
  assert(errno == EILSEQ);
  assert((unsigned char)buf[0] == 0xcc);
  assert(strcmp(setlocale(LC_CTYPE, "en_US.ISO8859-15"), "en_US.ISO8859-15") ==
         0);
  memset(&s, 0, sizeof(s));
  memset(buf, 0xcc, sizeof(buf));
  assert(c16rtomb(buf, 0x20ac, &s) == 1);
  assert((unsigned char)buf[0] == 0xa4 && (unsigned char)buf[1] == 0xcc);
  assert(strcmp(setlocale(LC_CTYPE, "en_US.UTF-8"), "en_US.UTF-8") == 0);
  memset(&s, 0, sizeof(s));
  memset(buf, 0xcc, sizeof(buf));
  assert(c16rtomb(buf, 0xd83d, &s) == 0);
  assert(c16rtomb(buf, 0xdca9, &s) == 4);
  assert((unsigned char)buf[0] == 0xf0 && (unsigned char)buf[1] == 0x9f &&
         (unsigned char)buf[2] == 0x92 && (unsigned char)buf[3] == 0xa9 &&
         (unsigned char)buf[4] == 0xcc);
  memset(&s, 0, sizeof(s));
  memset(buf, 0xcc, sizeof(buf));
  assert(c16rtomb(buf, 0xd83d, &s) == 0);
  assert(c16rtomb(buf, L'A', &s) == (size_t)-1);
  assert(errno == EILSEQ);
  assert((unsigned char)buf[0] == 0xcc);
  memset(&s, 0, sizeof(s));
  memset(buf, 0xcc, sizeof(buf));
  assert(c16rtomb(buf, 0xdca9, &s) == (size_t)-1);
  assert(errno == EILSEQ);
  assert((unsigned char)buf[0] == 0xcc);
  printf("ok 1 - c16rtomb()\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e4b(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rax,-0x40(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edx
xor    %esi,%esi
mov    %rdx,%rdi
call   1080 <c16rtomb@plt>
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
mov    %eax,%edx
mov    $0xdc00,%esi
mov    %rdx,%rdi
call   1080 <c16rtomb@plt>
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
xor    %esi,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x29(%rbp)
jne    1262 <main+0x102>
mov    -0x38(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xcc,%eax
sete   %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
mov    %eax,%edx
xor    %esi,%esi
mov    %rdx,%rdi
call   1080 <c16rtomb@plt>
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
mov    %eax,%edx
mov    $0x41,%esi
mov    %rdx,%rdi
call   1080 <c16rtomb@plt>
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    $0x41,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x41(%rbp)
jne    131f <main+0x1bf>
mov    -0x38(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xcc,%eax
sete   %al
mov    %al,-0x41(%rbp)
mov    -0x41(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    $0xd83d,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    $0xdca9,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0xffffffffffffffff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2c33(%rip),%rax
mov    (%rax),%rax
mov    0x2c49(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xcc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
lea    0xc26(%rip),%rsi
call   1070 <setlocale@plt>
mov    %eax,%edi
lea    0xc18(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    $0x20ac,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0xffffffffffffffff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2b7e(%rip),%rax
mov    (%rax),%rax
mov    0x2b94(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xcc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2b54(%rip),%rax
mov    (%rax),%edi
lea    0xb81(%rip),%rsi
call   1070 <setlocale@plt>
mov    %eax,%edi
lea    0xb73(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    $0x20ac,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0x1,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xa4,%ecx
mov    %al,-0x42(%rbp)
jne    152b <main+0x3cb>
mov    -0x38(%rbp),%rax
movzbl 0x1(%rax),%eax
cmp    $0xcc,%eax
sete   %al
mov    %al,-0x42(%rbp)
mov    -0x42(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2aa1(%rip),%rax
mov    (%rax),%edi
lea    0xadf(%rip),%rsi
call   1070 <setlocale@plt>
mov    %eax,%edi
lea    0xad1(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    $0xd83d,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    $0xdca9,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0x4,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movzbl (%rax),%ecx
xor    %eax,%eax
cmp    $0xf0,%ecx
mov    %al,-0x43(%rbp)
jne    164c <main+0x4ec>
mov    -0x38(%rbp),%rax
movzbl 0x1(%rax),%ecx
xor    %eax,%eax
cmp    $0x9f,%ecx
mov    %al,-0x43(%rbp)
jne    164c <main+0x4ec>
mov    -0x38(%rbp),%rax
movzbl 0x2(%rax),%ecx
xor    %eax,%eax
cmp    $0x92,%ecx
mov    %al,-0x43(%rbp)
jne    164c <main+0x4ec>
mov    -0x38(%rbp),%rax
movzbl 0x3(%rax),%ecx
xor    %eax,%eax
cmp    $0xa9,%ecx
mov    %al,-0x43(%rbp)
jne    164c <main+0x4ec>
mov    -0x38(%rbp),%rax
movzbl 0x4(%rax),%eax
cmp    $0xcc,%eax
sete   %al
mov    %al,-0x43(%rbp)
mov    -0x43(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    $0xd83d,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    $0x41,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0xffffffffffffffff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2906(%rip),%rax
mov    (%rax),%rax
mov    0x291c(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xcc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    -0x11(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rdi
mov    $0xdca9,%esi
lea    -0x11(%rbp),%rdx
call   1080 <c16rtomb@plt>
cmp    $0xffffffffffffffff,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2885(%rip),%rax
mov    (%rax),%rax
mov    0x289b(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xcc,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0x8ae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsp,-0x38(%rbp)
mov    0x2e4c(%rip),%rax
mov    (%rax),%r14d
add    $0x1,%r14d
mov    %rsp,%r13
lea    0xf(%r14),%r15
and    $0xfffffffffffffff0,%r15
mov    %r13,%rbx
sub    %r15,%rbx
mov    %rbx,%rsp
neg    %r15
lea    0xe8c(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0x1,%rax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
mov    $0xdc00,%esi
xor    %edx,%edx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0x1,%rax
sete   %dil
call   1060 <assert@plt>
lea    -0x29(%rbp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r12,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0x1,%rax
sete   %dil
call   1060 <assert@plt>
cmpb   $0x0,0x0(%r13,%r15,1)
mov    $0x0,%edi
jne    1233 <main+0xd3>
xor    %edi,%edi
cmpb   $0xcc,0x1(%rbx)
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0x1,%rax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
mov    $0x41,%esi
xor    %edx,%edx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0x1,%rax
sete   %dil
call   1060 <assert@plt>
lea    -0x29(%rbp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x41,%esi
mov    %r12,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0x1,%rax
sete   %dil
call   1060 <assert@plt>
cmpb   $0x41,(%rbx)
mov    $0x0,%edi
jne    12c5 <main+0x165>
xor    %edi,%edi
cmpb   $0xcc,0x1(%rbx)
sete   %dil
call   1060 <assert@plt>
lea    -0x29(%rbp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xd83d,%esi
mov    %r15,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    $0xdca9,%esi
mov    %r15,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0xffffffffffffffff,%rax
sete   %dil
call   1060 <assert@plt>
mov    0x2c9f(%rip),%r15
mov    (%r15),%rax
mov    0x2cb5(%rip),%r12
xor    %edi,%edi
cmp    (%r12),%rax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpb   $0xcc,(%rbx)
sete   %dil
call   1060 <assert@plt>
mov    0x2c81(%rip),%rax
mov    (%rax),%edi
lea    0xc98(%rip),%r13
mov    %r13,%rsi
call   1070 <setlocale@plt>
mov    %eax,%edi
mov    %r13,%rsi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
lea    -0x29(%rbp),%r13
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x20ac,%esi
mov    %r13,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0xffffffffffffffff,%rax
sete   %dil
call   1060 <assert@plt>
mov    (%r15),%rax
xor    %edi,%edi
cmp    (%r12),%rax
mov    0x2c06(%rip),%r12
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpb   $0xcc,(%rbx)
sete   %dil
call   1060 <assert@plt>
mov    (%r12),%edi
lea    0xc14(%rip),%r13
mov    %r13,%rsi
call   1070 <setlocale@plt>
mov    %eax,%edi
mov    %r13,%rsi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
lea    -0x29(%rbp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x20ac,%esi
mov    %r15,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0x1,%rax
sete   %dil
call   1060 <assert@plt>
cmpb   $0xa4,(%rbx)
mov    $0x0,%edi
jne    1472 <main+0x312>
xor    %edi,%edi
cmpb   $0xcc,0x1(%rbx)
sete   %dil
call   1060 <assert@plt>
mov    (%r12),%edi
lea    0xb9f(%rip),%r12
mov    %r12,%rsi
call   1070 <setlocale@plt>
mov    %eax,%edi
mov    %r12,%rsi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
lea    -0x29(%rbp),%r12
mov    %r12,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xd83d,%esi
mov    %r12,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    $0xdca9,%esi
mov    %r12,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0x4,%rax
sete   %dil
call   1060 <assert@plt>
cmpb   $0xf0,(%rbx)
jne    152a <main+0x3ca>
cmpb   $0x9f,0x1(%rbx)
jne    152a <main+0x3ca>
cmpb   $0x92,0x2(%rbx)
jne    152a <main+0x3ca>
cmpb   $0xa9,0x3(%rbx)
mov    $0x0,%edi
jne    152c <main+0x3cc>
xor    %edi,%edi
cmpb   $0xcc,0x4(%rbx)
sete   %dil
jmp    152c <main+0x3cc>
xor    %edi,%edi
call   1060 <assert@plt>
lea    -0x29(%rbp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xd83d,%esi
mov    %r15,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    $0x41,%esi
mov    %r15,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0xffffffffffffffff,%rax
sete   %dil
call   1060 <assert@plt>
mov    0x2a38(%rip),%r13
mov    0x0(%r13),%rax
xor    %edi,%edi
mov    0x2a4b(%rip),%r12
cmp    (%r12),%rax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpb   $0xcc,(%rbx)
sete   %dil
call   1060 <assert@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r14d,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0xdca9,%esi
mov    %r15,%rdx
call   1080 <c16rtomb@plt>
xor    %edi,%edi
cmp    $0xffffffffffffffff,%rax
sete   %dil
call   1060 <assert@plt>
mov    0x0(%r13),%rax
xor    %edi,%edi
cmp    (%r12),%rax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpb   $0xcc,(%rbx)
sete   %dil
call   1060 <assert@plt>
lea    0xa0c(%rip),%rdi
call   1030 <puts@plt>
mov    -0x38(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@MB_LEN_MAX = global i32 0
@.str = [6 x i8] c"1..1\0A\00"
@errno = global i64 0
@EILSEQ = global i64 0
@LC_CTYPE = global i32 0
@.str.1 = [16 x i8] c"en_US.ISO8859-1\00"
@.str.2 = [17 x i8] c"en_US.ISO8859-15\00"
@.str.3 = [12 x i8] c"en_US.UTF-8\00"
@.str.4 = [19 x i8] c"ok 1 - c16rtomb()\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8
%7 = alloca i8*
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* @MB_LEN_MAX
%10 = add nsw i32 %9, 1
%11 = zext i32 %10 to i64
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %7
%13 = alloca i8, i64 %11
store i64 %11, i64* %8
%14 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%15 = call i64 @c16rtomb(i8* null, i32 0, i8* null)
%16 = icmp eq i64 %15, 1
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = call i64 @c16rtomb(i8* null, i32 56320, i8* null)
%20 = icmp eq i64 %19, 1
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @memset(i8* %6, i32 0, i32 1)
%24 = trunc i64 %11 to i32
%25 = call i32 @memset(i8* %13, i32 204, i32 %24)
%26 = call i64 @c16rtomb(i8* %13, i32 0, i8* %6)
%27 = icmp eq i64 %26, 1
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = getelementptr inbounds i8, i8* %13, i64 0
%31 = load i8, i8* %30
%32 = zext i8 %31 to i32
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %39
34: ; preds = %2
%35 = getelementptr inbounds i8, i8* %13, i64 1
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = icmp eq i32 %37, 204
br label %39
39: ; preds = %34, %2
%40 = phi i1 [ false, %2 ], [ %38, %34 ]
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = call i64 @c16rtomb(i8* null, i32 0, i8* null)
%44 = icmp eq i64 %43, 1
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = call i64 @c16rtomb(i8* null, i32 65, i8* null)
%48 = icmp eq i64 %47, 1
%49 = zext i1 %48 to i32
%50 = call i32 @assert(i32 %49)
%51 = call i32 @memset(i8* %6, i32 0, i32 1)
%52 = trunc i64 %11 to i32
%53 = call i32 @memset(i8* %13, i32 204, i32 %52)
%54 = call i64 @c16rtomb(i8* %13, i32 65, i8* %6)
%55 = icmp eq i64 %54, 1
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
%58 = getelementptr inbounds i8, i8* %13, i64 0
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = icmp eq i32 %60, 65
br i1 %61, label %62, label %67
62: ; preds = %39
%63 = getelementptr inbounds i8, i8* %13, i64 1
%64 = load i8, i8* %63
%65 = zext i8 %64 to i32
%66 = icmp eq i32 %65, 204
br label %67
67: ; preds = %62, %39
%68 = phi i1 [ false, %39 ], [ %66, %62 ]
%69 = zext i1 %68 to i32
%70 = call i32 @assert(i32 %69)
%71 = call i32 @memset(i8* %6, i32 0, i32 1)
%72 = trunc i64 %11 to i32
%73 = call i32 @memset(i8* %13, i32 204, i32 %72)
%74 = call i64 @c16rtomb(i8* %13, i32 55357, i8* %6)
%75 = icmp eq i64 %74, 0
%76 = zext i1 %75 to i32
%77 = call i32 @assert(i32 %76)
%78 = call i64 @c16rtomb(i8* %13, i32 56489, i8* %6)
%79 = icmp eq i64 %78, -1
%80 = zext i1 %79 to i32
%81 = call i32 @assert(i32 %80)
%82 = load i64, i64* @errno
%83 = load i64, i64* @EILSEQ
%84 = icmp eq i64 %82, %83
%85 = zext i1 %84 to i32
%86 = call i32 @assert(i32 %85)
%87 = getelementptr inbounds i8, i8* %13, i64 0
%88 = load i8, i8* %87
%89 = zext i8 %88 to i32
%90 = icmp eq i32 %89, 204
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
%93 = load i32, i32* @LC_CTYPE
%94 = call i32 @setlocale(i32 %93, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%95 = call i64 @strcmp(i32 %94, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
%97 = zext i1 %96 to i32
%98 = call i32 @assert(i32 %97)
%99 = call i32 @memset(i8* %6, i32 0, i32 1)
%100 = trunc i64 %11 to i32
%101 = call i32 @memset(i8* %13, i32 204, i32 %100)
%102 = call i64 @c16rtomb(i8* %13, i32 8364, i8* %6)
%103 = icmp eq i64 %102, -1
%104 = zext i1 %103 to i32
%105 = call i32 @assert(i32 %104)
%106 = load i64, i64* @errno
%107 = load i64, i64* @EILSEQ
%108 = icmp eq i64 %106, %107
%109 = zext i1 %108 to i32
%110 = call i32 @assert(i32 %109)
%111 = getelementptr inbounds i8, i8* %13, i64 0
%112 = load i8, i8* %111
%113 = zext i8 %112 to i32
%114 = icmp eq i32 %113, 204
%115 = zext i1 %114 to i32
%116 = call i32 @assert(i32 %115)
%117 = load i32, i32* @LC_CTYPE
%118 = call i32 @setlocale(i32 %117, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%119 = call i64 @strcmp(i32 %118, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%120 = icmp eq i64 %119, 0
%121 = zext i1 %120 to i32
%122 = call i32 @assert(i32 %121)
%123 = call i32 @memset(i8* %6, i32 0, i32 1)
%124 = trunc i64 %11 to i32
%125 = call i32 @memset(i8* %13, i32 204, i32 %124)
%126 = call i64 @c16rtomb(i8* %13, i32 8364, i8* %6)
%127 = icmp eq i64 %126, 1
%128 = zext i1 %127 to i32
%129 = call i32 @assert(i32 %128)
%130 = getelementptr inbounds i8, i8* %13, i64 0
%131 = load i8, i8* %130
%132 = zext i8 %131 to i32
%133 = icmp eq i32 %132, 164
br i1 %133, label %134, label %139
134: ; preds = %67
%135 = getelementptr inbounds i8, i8* %13, i64 1
%136 = load i8, i8* %135
%137 = zext i8 %136 to i32
%138 = icmp eq i32 %137, 204
br label %139
139: ; preds = %134, %67
%140 = phi i1 [ false, %67 ], [ %138, %134 ]
%141 = zext i1 %140 to i32
%142 = call i32 @assert(i32 %141)
%143 = load i32, i32* @LC_CTYPE
%144 = call i32 @setlocale(i32 %143, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%145 = call i64 @strcmp(i32 %144, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%146 = icmp eq i64 %145, 0
%147 = zext i1 %146 to i32
%148 = call i32 @assert(i32 %147)
%149 = call i32 @memset(i8* %6, i32 0, i32 1)
%150 = trunc i64 %11 to i32
%151 = call i32 @memset(i8* %13, i32 204, i32 %150)
%152 = call i64 @c16rtomb(i8* %13, i32 55357, i8* %6)
%153 = icmp eq i64 %152, 0
%154 = zext i1 %153 to i32
%155 = call i32 @assert(i32 %154)
%156 = call i64 @c16rtomb(i8* %13, i32 56489, i8* %6)
%157 = icmp eq i64 %156, 4
%158 = zext i1 %157 to i32
%159 = call i32 @assert(i32 %158)
%160 = getelementptr inbounds i8, i8* %13, i64 0
%161 = load i8, i8* %160
%162 = zext i8 %161 to i32
%163 = icmp eq i32 %162, 240
br i1 %163, label %164, label %184
164: ; preds = %139
%165 = getelementptr inbounds i8, i8* %13, i64 1
%166 = load i8, i8* %165
%167 = zext i8 %166 to i32
%168 = icmp eq i32 %167, 159
br i1 %168, label %169, label %184
169: ; preds = %164
%170 = getelementptr inbounds i8, i8* %13, i64 2
%171 = load i8, i8* %170
%172 = zext i8 %171 to i32
%173 = icmp eq i32 %172, 146
br i1 %173, label %174, label %184
174: ; preds = %169
%175 = getelementptr inbounds i8, i8* %13, i64 3
%176 = load i8, i8* %175
%177 = zext i8 %176 to i32
%178 = icmp eq i32 %177, 169
br i1 %178, label %179, label %184
179: ; preds = %174
%180 = getelementptr inbounds i8, i8* %13, i64 4
%181 = load i8, i8* %180
%182 = zext i8 %181 to i32
%183 = icmp eq i32 %182, 204
br label %184
184: ; preds = %179, %174, %169, %164, %139
%185 = phi i1 [ false, %174 ], [ false, %169 ], [ false, %164 ], [ false, %139 ], [ %183, %179 ]
%186 = zext i1 %185 to i32
%187 = call i32 @assert(i32 %186)
%188 = call i32 @memset(i8* %6, i32 0, i32 1)
%189 = trunc i64 %11 to i32
%190 = call i32 @memset(i8* %13, i32 204, i32 %189)
%191 = call i64 @c16rtomb(i8* %13, i32 55357, i8* %6)
%192 = icmp eq i64 %191, 0
%193 = zext i1 %192 to i32
%194 = call i32 @assert(i32 %193)
%195 = call i64 @c16rtomb(i8* %13, i32 65, i8* %6)
%196 = icmp eq i64 %195, -1
%197 = zext i1 %196 to i32
%198 = call i32 @assert(i32 %197)
%199 = load i64, i64* @errno
%200 = load i64, i64* @EILSEQ
%201 = icmp eq i64 %199, %200
%202 = zext i1 %201 to i32
%203 = call i32 @assert(i32 %202)
%204 = getelementptr inbounds i8, i8* %13, i64 0
%205 = load i8, i8* %204
%206 = zext i8 %205 to i32
%207 = icmp eq i32 %206, 204
%208 = zext i1 %207 to i32
%209 = call i32 @assert(i32 %208)
%210 = call i32 @memset(i8* %6, i32 0, i32 1)
%211 = trunc i64 %11 to i32
%212 = call i32 @memset(i8* %13, i32 204, i32 %211)
%213 = call i64 @c16rtomb(i8* %13, i32 56489, i8* %6)
%214 = icmp eq i64 %213, -1
%215 = zext i1 %214 to i32
%216 = call i32 @assert(i32 %215)
%217 = load i64, i64* @errno
%218 = load i64, i64* @EILSEQ
%219 = icmp eq i64 %217, %218
%220 = zext i1 %219 to i32
%221 = call i32 @assert(i32 %220)
%222 = getelementptr inbounds i8, i8* %13, i64 0
%223 = load i8, i8* %222
%224 = zext i8 %223 to i32
%225 = icmp eq i32 %224, 204
%226 = zext i1 %225 to i32
%227 = call i32 @assert(i32 %226)
%228 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%229 = load i8*, i8** %7
%230 = load i32, i32* %3
ret i32 %230
}

LLVM IR (-O2):
@MB_LEN_MAX = global i32 0
@errno = global i64 0
@EILSEQ = global i64 0
@LC_CTYPE = global i32 0
@.str.1 = [16 x i8] c"en_US.ISO8859-1\00"
@.str.2 = [17 x i8] c"en_US.ISO8859-15\00"
@.str.3 = [12 x i8] c"en_US.UTF-8\00"
@str = [5 x i8] c"1..1\00"
@str.5 = [18 x i8] c"ok 1 - c16rtomb()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = load i32, i32* @MB_LEN_MAX
%5 = add nsw i32 %4, 1
%6 = zext i32 %5 to i64
%7 = tail call i8* @llvm.stacksave()
%8 = alloca i8, i64 %6
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%10 = tail call i64 @c16rtomb(i8* null, i32 0, i8* null)
%11 = icmp eq i64 %10, 1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i64 @c16rtomb(i8* null, i32 56320, i8* null)
%15 = icmp eq i64 %14, 1
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = call i32 @memset(i8* %3, i32 0, i32 1)
%19 = call i32 @memset(i8* %8, i32 204, i32 %5)
%20 = call i64 @c16rtomb(i8* %8, i32 0, i8* %3)
%21 = icmp eq i64 %20, 1
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i8, i8* %8
%25 = icmp eq i8 %24, 0
br i1 %25, label %26, label %31
26: ; preds = %2
%27 = getelementptr inbounds i8, i8* %8, i64 1
%28 = load i8, i8* %27
%29 = icmp eq i8 %28, -52
%30 = zext i1 %29 to i32
br label %31
31: ; preds = %26, %2
%32 = phi i32 [ 0, %2 ], [ %30, %26 ]
%33 = call i32 @assert(i32 %32)
%34 = call i64 @c16rtomb(i8* null, i32 0, i8* null)
%35 = icmp eq i64 %34, 1
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = call i64 @c16rtomb(i8* null, i32 65, i8* null)
%39 = icmp eq i64 %38, 1
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = call i32 @memset(i8* %3, i32 0, i32 1)
%43 = call i32 @memset(i8* %8, i32 204, i32 %5)
%44 = call i64 @c16rtomb(i8* %8, i32 65, i8* %3)
%45 = icmp eq i64 %44, 1
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = load i8, i8* %8
%49 = icmp eq i8 %48, 65
br i1 %49, label %50, label %55
50: ; preds = %31
%51 = getelementptr inbounds i8, i8* %8, i64 1
%52 = load i8, i8* %51
%53 = icmp eq i8 %52, -52
%54 = zext i1 %53 to i32
br label %55
55: ; preds = %50, %31
%56 = phi i32 [ 0, %31 ], [ %54, %50 ]
%57 = call i32 @assert(i32 %56)
%58 = call i32 @memset(i8* %3, i32 0, i32 1)
%59 = call i32 @memset(i8* %8, i32 204, i32 %5)
%60 = call i64 @c16rtomb(i8* %8, i32 55357, i8* %3)
%61 = icmp eq i64 %60, 0
%62 = zext i1 %61 to i32
%63 = call i32 @assert(i32 %62)
%64 = call i64 @c16rtomb(i8* %8, i32 56489, i8* %3)
%65 = icmp eq i64 %64, -1
%66 = zext i1 %65 to i32
%67 = call i32 @assert(i32 %66)
%68 = load i64, i64* @errno
%69 = load i64, i64* @EILSEQ
%70 = icmp eq i64 %68, %69
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = load i8, i8* %8
%74 = icmp eq i8 %73, -52
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
%77 = load i32, i32* @LC_CTYPE
%78 = call i32 @setlocale(i32 %77, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%79 = call i64 @strcmp(i32 %78, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%80 = icmp eq i64 %79, 0
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = call i32 @memset(i8* %3, i32 0, i32 1)
%84 = call i32 @memset(i8* %8, i32 204, i32 %5)
%85 = call i64 @c16rtomb(i8* %8, i32 8364, i8* %3)
%86 = icmp eq i64 %85, -1
%87 = zext i1 %86 to i32
%88 = call i32 @assert(i32 %87)
%89 = load i64, i64* @errno
%90 = load i64, i64* @EILSEQ
%91 = icmp eq i64 %89, %90
%92 = zext i1 %91 to i32
%93 = call i32 @assert(i32 %92)
%94 = load i8, i8* %8
%95 = icmp eq i8 %94, -52
%96 = zext i1 %95 to i32
%97 = call i32 @assert(i32 %96)
%98 = load i32, i32* @LC_CTYPE
%99 = call i32 @setlocale(i32 %98, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%100 = call i64 @strcmp(i32 %99, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%101 = icmp eq i64 %100, 0
%102 = zext i1 %101 to i32
%103 = call i32 @assert(i32 %102)
%104 = call i32 @memset(i8* %3, i32 0, i32 1)
%105 = call i32 @memset(i8* %8, i32 204, i32 %5)
%106 = call i64 @c16rtomb(i8* %8, i32 8364, i8* %3)
%107 = icmp eq i64 %106, 1
%108 = zext i1 %107 to i32
%109 = call i32 @assert(i32 %108)
%110 = load i8, i8* %8
%111 = icmp eq i8 %110, -92
br i1 %111, label %112, label %117
112: ; preds = %55
%113 = getelementptr inbounds i8, i8* %8, i64 1
%114 = load i8, i8* %113
%115 = icmp eq i8 %114, -52
%116 = zext i1 %115 to i32
br label %117
117: ; preds = %112, %55
%118 = phi i32 [ 0, %55 ], [ %116, %112 ]
%119 = call i32 @assert(i32 %118)
%120 = load i32, i32* @LC_CTYPE
%121 = call i32 @setlocale(i32 %120, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%122 = call i64 @strcmp(i32 %121, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%123 = icmp eq i64 %122, 0
%124 = zext i1 %123 to i32
%125 = call i32 @assert(i32 %124)
%126 = call i32 @memset(i8* %3, i32 0, i32 1)
%127 = call i32 @memset(i8* %8, i32 204, i32 %5)
%128 = call i64 @c16rtomb(i8* %8, i32 55357, i8* %3)
%129 = icmp eq i64 %128, 0
%130 = zext i1 %129 to i32
%131 = call i32 @assert(i32 %130)
%132 = call i64 @c16rtomb(i8* %8, i32 56489, i8* %3)
%133 = icmp eq i64 %132, 4
%134 = zext i1 %133 to i32
%135 = call i32 @assert(i32 %134)
%136 = load i8, i8* %8
%137 = icmp eq i8 %136, -16
br i1 %137, label %138, label %155
138: ; preds = %117
%139 = getelementptr inbounds i8, i8* %8, i64 1
%140 = load i8, i8* %139
%141 = icmp eq i8 %140, -97
br i1 %141, label %142, label %155
142: ; preds = %138
%143 = getelementptr inbounds i8, i8* %8, i64 2
%144 = load i8, i8* %143
%145 = icmp eq i8 %144, -110
br i1 %145, label %146, label %155
146: ; preds = %142
%147 = getelementptr inbounds i8, i8* %8, i64 3
%148 = load i8, i8* %147
%149 = icmp eq i8 %148, -87
br i1 %149, label %150, label %155
150: ; preds = %146
%151 = getelementptr inbounds i8, i8* %8, i64 4
%152 = load i8, i8* %151
%153 = icmp eq i8 %152, -52
%154 = zext i1 %153 to i32
br label %155
155: ; preds = %150, %146, %142, %138, %117
%156 = phi i32 [ 0, %146 ], [ 0, %142 ], [ 0, %138 ], [ 0, %117 ], [ %154, %150 ]
%157 = call i32 @assert(i32 %156)
%158 = call i32 @memset(i8* %3, i32 0, i32 1)
%159 = call i32 @memset(i8* %8, i32 204, i32 %5)
%160 = call i64 @c16rtomb(i8* %8, i32 55357, i8* %3)
%161 = icmp eq i64 %160, 0
%162 = zext i1 %161 to i32
%163 = call i32 @assert(i32 %162)
%164 = call i64 @c16rtomb(i8* %8, i32 65, i8* %3)
%165 = icmp eq i64 %164, -1
%166 = zext i1 %165 to i32
%167 = call i32 @assert(i32 %166)
%168 = load i64, i64* @errno
%169 = load i64, i64* @EILSEQ
%170 = icmp eq i64 %168, %169
%171 = zext i1 %170 to i32
%172 = call i32 @assert(i32 %171)
%173 = load i8, i8* %8
%174 = icmp eq i8 %173, -52
%175 = zext i1 %174 to i32
%176 = call i32 @assert(i32 %175)
%177 = call i32 @memset(i8* %3, i32 0, i32 1)
%178 = call i32 @memset(i8* %8, i32 204, i32 %5)
%179 = call i64 @c16rtomb(i8* %8, i32 56489, i8* %3)
%180 = icmp eq i64 %179, -1
%181 = zext i1 %180 to i32
%182 = call i32 @assert(i32 %181)
%183 = load i64, i64* @errno
%184 = load i64, i64* @EILSEQ
%185 = icmp eq i64 %183, %184
%186 = zext i1 %185 to i32
%187 = call i32 @assert(i32 %186)
%188 = load i8, i8* %8
%189 = icmp eq i8 %188, -52
%190 = zext i1 %189 to i32
%191 = call i32 @assert(i32 %190)
%192 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}