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

/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int MB_CUR_MAX;
int /*<<< orphan*/ assert(int);
int mbsrtowcs(int *, char const **, int, char *);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ wcscmp(int *, char *);
scalar_t__ wmemcmp(int *, char *, int);
int /*<<< orphan*/ wmemset(int *, int, int);
int main(int argc, char *argv[]) {
  char srcbuf[128];
  wchar_t dstbuf[128];
  char *src;
  mbstate_t s;
  printf("1..1\n");
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  src = srcbuf;
  memset(&s, 0, sizeof(s));
  assert(mbsrtowcs(dstbuf, (const char **)&src,
                   sizeof(dstbuf) / sizeof(*dstbuf), &s) == 5);
  assert(wcscmp(dstbuf, L"hello") == 0);
  assert(dstbuf[6] == 0xcccc);
  assert(src == NULL);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  src = srcbuf;
  memset(&s, 0, sizeof(s));
  assert(mbsrtowcs(dstbuf, (const char **)&src, 4, &s) == 4);
  assert(wmemcmp(dstbuf, L"hell", 4) == 0);
  assert(dstbuf[5] == 0xcccc);
  assert(src == srcbuf + 4);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  src = srcbuf;
  memset(&s, 0, sizeof(s));
  assert(mbsrtowcs(NULL, (const char **)&src, 0, &s) == 5);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  src = srcbuf;
  assert(mbsrtowcs(dstbuf, (const char **)&src,
                   sizeof(dstbuf) / sizeof(*dstbuf), NULL) == 5);
  assert(wcscmp(dstbuf, L"hello") == 0);
  assert(dstbuf[6] == 0xcccc);
  assert(src == NULL);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  src = srcbuf;
  assert(mbsrtowcs(NULL, (const char **)&src, 0, NULL) == 5);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  srcbuf[0] = '\0';
  src = srcbuf;
  memset(&s, 0, sizeof(s));
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  assert(mbsrtowcs(dstbuf, (const char **)&src, 1, &s) == 0);
  assert(dstbuf[0] == 0);
  assert(dstbuf[1] == 0xcccc);
  assert(src == NULL);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  src = srcbuf;
  memset(&s, 0, sizeof(s));
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  assert(mbsrtowcs(dstbuf, (const char **)&src, 0, &s) == 0);
  assert(dstbuf[0] == 0xcccc);
  assert(src == srcbuf);
  assert(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0);
  assert(MB_CUR_MAX > 1);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "\xA3\xC1 B \xA3\xC3");
  src = srcbuf;
  memset(&s, 0, sizeof(s));
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  assert(mbsrtowcs(dstbuf, (const char **)&src,
                   sizeof(dstbuf) / sizeof(*dstbuf), &s) == 5);
  assert(dstbuf[0] == 0xA3C1 && dstbuf[1] == 0x20 && dstbuf[2] == 0x42 &&
         dstbuf[3] == 0x20 && dstbuf[4] == 0xA3C3 && dstbuf[5] == 0);
  assert(src == NULL);
  printf("ok 1 - mbsrtowcs()\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2a0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe40(%rip),%rdi
call   1050 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xe1d(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x298(%rbp)
lea    -0x299(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x298(%rbp),%rsi
mov    $0x80,%edx
lea    -0x299(%rbp),%rcx
call   10a0 <mbsrtowcs@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x290(%rbp),%rdi
lea    0xdd2(%rip),%rsi
call   1030 <wcscmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpl   $0xcccc,-0x278(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpq   $0x0,-0x298(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xd3e(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x298(%rbp)
lea    -0x299(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x298(%rbp),%rsi
mov    $0x4,%edx
lea    -0x299(%rbp),%rcx
call   10a0 <mbsrtowcs@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x290(%rbp),%rdi
lea    0xd0b(%rip),%rsi
mov    $0x4,%edx
call   10c0 <wmemcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpl   $0xcccc,-0x27c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x298(%rbp),%rax
lea    -0x90(%rbp),%rcx
add    $0x4,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xc4d(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x298(%rbp)
lea    -0x299(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    -0x298(%rbp),%rsi
xor    %edx,%edx
lea    -0x299(%rbp),%rcx
call   10a0 <mbsrtowcs@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xbda(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x298(%rbp)
lea    -0x290(%rbp),%rdi
lea    -0x298(%rbp),%rsi
mov    $0x80,%edx
xor    %eax,%eax
mov    %eax,%ecx
call   10a0 <mbsrtowcs@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x290(%rbp),%rdi
lea    0xba5(%rip),%rsi
call   1030 <wcscmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpl   $0xcccc,-0x278(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpq   $0x0,-0x298(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xb11(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x298(%rbp)
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x298(%rbp),%rsi
xor    %edx,%edx
mov    %rcx,%rdi
call   10a0 <mbsrtowcs@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
movb   $0x0,-0x90(%rbp)
lea    -0x90(%rbp),%rax
mov    %rax,-0x298(%rbp)
lea    -0x299(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x298(%rbp),%rsi
mov    $0x1,%edx
lea    -0x299(%rbp),%rcx
call   10a0 <mbsrtowcs@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpl   $0x0,-0x290(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpl   $0xcccc,-0x28c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpq   $0x0,-0x298(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0x9f2(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x298(%rbp)
lea    -0x299(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x298(%rbp),%rsi
xor    %edx,%edx
lea    -0x299(%rbp),%rcx
call   10a0 <mbsrtowcs@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpl   $0xcccc,-0x290(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    -0x298(%rbp),%rax
lea    -0x90(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    0x2928(%rip),%rax
mov    (%rax),%edi
lea    0x94b(%rip),%rsi
call   10b0 <setlocale@plt>
mov    %eax,%edi
lea    0x93d(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
mov    0x290c(%rip),%rax
cmpl   $0x1,(%rax)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0x8f8(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rax
mov    %rax,-0x298(%rbp)
lea    -0x299(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x298(%rbp),%rsi
mov    $0x80,%edx
lea    -0x299(%rbp),%rcx
call   10a0 <mbsrtowcs@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
xor    %eax,%eax
cmpl   $0xa3c1,-0x290(%rbp)
mov    %al,-0x29a(%rbp)
jne    180a <main+0x66a>
xor    %eax,%eax
cmpl   $0x20,-0x28c(%rbp)
mov    %al,-0x29a(%rbp)
jne    180a <main+0x66a>
xor    %eax,%eax
cmpl   $0x42,-0x288(%rbp)
mov    %al,-0x29a(%rbp)
jne    180a <main+0x66a>
xor    %eax,%eax
cmpl   $0x20,-0x284(%rbp)
mov    %al,-0x29a(%rbp)
jne    180a <main+0x66a>
xor    %eax,%eax
cmpl   $0xa3c3,-0x280(%rbp)
mov    %al,-0x29a(%rbp)
jne    180a <main+0x66a>
cmpl   $0x0,-0x27c(%rbp)
sete   %al
mov    %al,-0x29a(%rbp)
mov    -0x29a(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
cmpq   $0x0,-0x298(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
lea    0x7ea(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x298,%rsp
lea    0xe72(%rip),%rdi
call   1050 <puts@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    0xe35(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
lea    0x90(%rsp),%r14
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
mov    %rbx,(%rsp)
lea    0xf(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
mov    %rsp,%r12
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x80,%edx
mov    %r15,%rcx
call   10a0 <mbsrtowcs@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1090 <assert@plt>
lea    0xe01(%rip),%rbp
mov    %r14,%rdi
mov    %rbp,%rsi
call   1030 <wcscmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,0xa8(%rsp)
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,(%rsp)
sete   %dil
call   1090 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
mov    %rbx,(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x4,%edx
mov    %r15,%rcx
call   10a0 <mbsrtowcs@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   1090 <assert@plt>
lea    0xd70(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   10c0 <wmemcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,0xa4(%rsp)
sete   %dil
call   1090 <assert@plt>
lea    0x14(%rsp),%rax
xor    %edi,%edi
cmp    %rax,(%rsp)
sete   %dil
call   1090 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %rbx,(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
xor    %edi,%edi
mov    %r12,%rsi
xor    %edx,%edx
mov    %r15,%rcx
call   10a0 <mbsrtowcs@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1090 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
mov    %rbx,(%rsp)
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x80,%edx
xor    %ecx,%ecx
call   10a0 <mbsrtowcs@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1090 <assert@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1030 <wcscmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,0xa8(%rsp)
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,(%rsp)
sete   %dil
call   1090 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %rbx,(%rsp)
xor    %edi,%edi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   10a0 <mbsrtowcs@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1090 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
movb   $0x0,0x10(%rsp)
mov    %rbx,(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
mov    %r15,%rcx
call   10a0 <mbsrtowcs@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,0x90(%rsp)
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,0x94(%rsp)
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,(%rsp)
sete   %dil
call   1090 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %rbx,(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %edx,%edx
mov    %r15,%rcx
call   10a0 <mbsrtowcs@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,0x90(%rsp)
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmp    %rbx,(%rsp)
sete   %dil
call   1090 <assert@plt>
mov    0x2a73(%rip),%rax
mov    (%rax),%edi
lea    0xaa0(%rip),%rbp
mov    %rbp,%rsi
call   10b0 <setlocale@plt>
mov    %eax,%edi
mov    %rbp,%rsi
call   1080 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
mov    0x2a5b(%rip),%rax
xor    %edi,%edi
cmpl   $0x2,(%rax)
setge  %dil
call   1090 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1060 <memset@plt>
lea    0xa5e(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,(%rsp)
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1060 <memset@plt>
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1070 <wmemset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x80,%edx
mov    %r15,%rcx
call   10a0 <mbsrtowcs@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   1090 <assert@plt>
movdqa 0x90(%rsp),%xmm0
pcmpeqd 0x9dd(%rip),%xmm0
movmskps %xmm0,%eax
xor    $0xf,%eax
mov    $0xa3c3,%ecx
xor    0xa0(%rsp),%ecx
or     %eax,%ecx
xor    %edi,%edi
or     0xa4(%rsp),%ecx
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,(%rsp)
sete   %dil
call   1090 <assert@plt>
lea    0x9cf(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x298,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [6 x i32] [i32 104, i32 101, i32 108, i32 108, i32 111, i32 0]
@.str.3 = [5 x i32] [i32 104, i32 101, i32 108, i32 108, i32 0]
@LC_CTYPE = global i32 0
@.str.4 = [12 x i8] c"ja_JP.eucJP\00"
@MB_CUR_MAX = global i32 0
@.str.5 = [8 x i8] c"\A3\C1 B \A3\C3\00"
@str = [5 x i8] c"1..1\00"
@str.7 = [19 x i8] c"ok 1 - mbsrtowcs()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i32]
%5 = alloca i8*
%6 = alloca i8
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%8 = bitcast [128 x i32]* %4 to i8*
%9 = bitcast i8** %5 to i8*
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%11 = call i32 @memset(i8* %7, i32 204, i32 128)
%12 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 0
%14 = call i32 @wmemset(i32* %13, i32 52428, i32 128)
store i8* %7, i8** %5
%15 = call i32 @memset(i8* %6, i32 0, i32 1)
%16 = call i32 @mbsrtowcs(i32* %13, i8** %5, i32 128, i8* %6)
%17 = icmp eq i32 %16, 5
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i64 @wcscmp(i32* %13, i8* bitcast ([6 x i32]* @.str.2 to i8*))
%21 = icmp eq i64 %20, 0
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 6
%25 = load i32, i32* %24
%26 = icmp eq i32 %25, 52428
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = load i8*, i8** %5
%30 = icmp eq i8* %29, null
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = call i32 @memset(i8* %7, i32 204, i32 128)
%34 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%35 = call i32 @wmemset(i32* %13, i32 52428, i32 128)
store i8* %7, i8** %5
%36 = call i32 @memset(i8* %6, i32 0, i32 1)
%37 = call i32 @mbsrtowcs(i32* %13, i8** %5, i32 4, i8* %6)
%38 = icmp eq i32 %37, 4
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i64 @wmemcmp(i32* %13, i8* bitcast ([5 x i32]* @.str.3 to i8*), i32 4)
%42 = icmp eq i64 %41, 0
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 5
%46 = load i32, i32* %45
%47 = icmp eq i32 %46, 52428
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = load i8*, i8** %5
%51 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 4
%52 = icmp eq i8* %50, %51
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = call i32 @memset(i8* %7, i32 204, i32 128)
%56 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %5
%57 = call i32 @memset(i8* %6, i32 0, i32 1)
%58 = call i32 @mbsrtowcs(i32* null, i8** %5, i32 0, i8* %6)
%59 = icmp eq i32 %58, 5
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = call i32 @memset(i8* %7, i32 204, i32 128)
%63 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%64 = call i32 @wmemset(i32* %13, i32 52428, i32 128)
store i8* %7, i8** %5
%65 = call i32 @mbsrtowcs(i32* %13, i8** %5, i32 128, i8* null)
%66 = icmp eq i32 %65, 5
%67 = zext i1 %66 to i32
%68 = call i32 @assert(i32 %67)
%69 = call i64 @wcscmp(i32* %13, i8* bitcast ([6 x i32]* @.str.2 to i8*))
%70 = icmp eq i64 %69, 0
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = load i32, i32* %24
%74 = icmp eq i32 %73, 52428
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
%77 = load i8*, i8** %5
%78 = icmp eq i8* %77, null
%79 = zext i1 %78 to i32
%80 = call i32 @assert(i32 %79)
%81 = call i32 @memset(i8* %7, i32 204, i32 128)
%82 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %5
%83 = call i32 @mbsrtowcs(i32* null, i8** %5, i32 0, i8* null)
%84 = icmp eq i32 %83, 5
%85 = zext i1 %84 to i32
%86 = call i32 @assert(i32 %85)
%87 = call i32 @memset(i8* %7, i32 204, i32 128)
store i8 0, i8* %7
store i8* %7, i8** %5
%88 = call i32 @memset(i8* %6, i32 0, i32 1)
%89 = call i32 @wmemset(i32* %13, i32 52428, i32 128)
%90 = call i32 @mbsrtowcs(i32* %13, i8** %5, i32 1, i8* %6)
%91 = icmp eq i32 %90, 0
%92 = zext i1 %91 to i32
%93 = call i32 @assert(i32 %92)
%94 = load i32, i32* %13
%95 = icmp eq i32 %94, 0
%96 = zext i1 %95 to i32
%97 = call i32 @assert(i32 %96)
%98 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 1
%99 = load i32, i32* %98
%100 = icmp eq i32 %99, 52428
%101 = zext i1 %100 to i32
%102 = call i32 @assert(i32 %101)
%103 = load i8*, i8** %5
%104 = icmp eq i8* %103, null
%105 = zext i1 %104 to i32
%106 = call i32 @assert(i32 %105)
%107 = call i32 @memset(i8* %7, i32 204, i32 128)
%108 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %5
%109 = call i32 @memset(i8* %6, i32 0, i32 1)
%110 = call i32 @wmemset(i32* %13, i32 52428, i32 128)
%111 = call i32 @mbsrtowcs(i32* %13, i8** %5, i32 0, i8* %6)
%112 = icmp eq i32 %111, 0
%113 = zext i1 %112 to i32
%114 = call i32 @assert(i32 %113)
%115 = load i32, i32* %13
%116 = icmp eq i32 %115, 52428
%117 = zext i1 %116 to i32
%118 = call i32 @assert(i32 %117)
%119 = load i8*, i8** %5
%120 = icmp eq i8* %119, %7
%121 = zext i1 %120 to i32
%122 = call i32 @assert(i32 %121)
%123 = load i32, i32* @LC_CTYPE
%124 = call i32 @setlocale(i32 %123, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%125 = call i64 @strcmp(i32 %124, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%126 = icmp eq i64 %125, 0
%127 = zext i1 %126 to i32
%128 = call i32 @assert(i32 %127)
%129 = load i32, i32* @MB_CUR_MAX
%130 = icmp sgt i32 %129, 1
%131 = zext i1 %130 to i32
%132 = call i32 @assert(i32 %131)
%133 = call i32 @memset(i8* %7, i32 204, i32 128)
%134 = call i32 @strcpy(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i8* %7, i8** %5
%135 = call i32 @memset(i8* %6, i32 0, i32 1)
%136 = call i32 @wmemset(i32* %13, i32 52428, i32 128)
%137 = call i32 @mbsrtowcs(i32* %13, i8** %5, i32 128, i8* %6)
%138 = icmp eq i32 %137, 5
%139 = zext i1 %138 to i32
%140 = call i32 @assert(i32 %139)
%141 = bitcast [128 x i32]* %4 to <4 x i32>*
%142 = load <4 x i32>, <4 x i32>* %141
%143 = freeze <4 x i32> %142
%144 = icmp ne <4 x i32> %143, <i32 41921, i32 32, i32 66, i32 32>
%145 = bitcast <4 x i1> %144 to i4
%146 = icmp eq i4 %145, 0
%147 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 4
%148 = load i32, i32* %147
%149 = icmp eq i32 %148, 41923
%150 = select i1 %146, i1 %149, i1 false
%151 = load i32, i32* %45
%152 = icmp eq i32 %151, 0
%153 = select i1 %150, i1 %152, i1 false
%154 = zext i1 %153 to i32
%155 = call i32 @assert(i32 %154)
%156 = load i8*, i8** %5
%157 = icmp eq i8* %156, null
%158 = zext i1 %157 to i32
%159 = call i32 @assert(i32 %158)
%160 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}