#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*/ dstbuf;

/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int MB_CUR_MAX;
int /*<<< orphan*/ assert(int);
int mbstowcs(int *, char *, int);
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];
  printf("1..1\n");
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  assert(mbstowcs(dstbuf, srcbuf, sizeof(dstbuf) / sizeof(*dstbuf)) == 5);
  assert(wcscmp(dstbuf, L"hello") == 0);
  assert(dstbuf[6] == 0xcccc);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  assert(mbstowcs(dstbuf, srcbuf, 4) == 4);
  assert(wmemcmp(dstbuf, L"hell", 4) == 0);
  assert(dstbuf[5] == 0xcccc);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  assert(mbstowcs(NULL, srcbuf, 0) == 5);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  srcbuf[0] = '\0';
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  assert(mbstowcs(dstbuf, srcbuf, 1) == 0);
  assert(dstbuf[0] == 0);
  assert(dstbuf[1] == 0xcccc);
  memset(srcbuf, 0xcc, sizeof(srcbuf));
  strcpy(srcbuf, "hello");
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  assert(mbstowcs(dstbuf, srcbuf, 0) == 0);
  assert(dstbuf[0] == 0xcccc);
  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");
  wmemset(dstbuf, 0xcccc, sizeof(dstbuf) / sizeof(*dstbuf));
  assert(mbstowcs(dstbuf, srcbuf, sizeof(dstbuf) / sizeof(*dstbuf)) == 5);
  assert(dstbuf[0] == 0xA3C1 && dstbuf[1] == 0x20 && dstbuf[2] == 0x42 &&
         dstbuf[3] == 0x20 && dstbuf[4] == 0xA3C3 && dstbuf[5] == 0);
  printf("ok 1 - mbstowcs()\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   1060 <printf@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <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   1080 <wmemset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1050 <mbstowcs@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    -0x290(%rbp),%rdi
lea    0xdfa(%rip),%rsi
call   1030 <wcscmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
cmpl   $0xcccc,-0x278(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xd7b(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x4,%edx
call   1050 <mbstowcs@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    -0x290(%rbp),%rdi
lea    0xd70(%rip),%rsi
mov    $0x4,%edx
call   10c0 <wmemcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
cmpl   $0xcccc,-0x27c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xcd4(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x90(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
xor    %edx,%edx
call   1050 <mbstowcs@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
movb   $0x0,-0x90(%rbp)
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x1,%edx
call   1050 <mbstowcs@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
cmpl   $0x0,-0x290(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
cmpl   $0xcccc,-0x28c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xc03(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x90(%rbp),%rsi
xor    %edx,%edx
call   1050 <mbstowcs@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
cmpl   $0xcccc,-0x290(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
mov    0x2b7f(%rip),%rax
mov    (%rax),%edi
lea    0xba2(%rip),%rsi
call   10b0 <setlocale@plt>
mov    %eax,%edi
lea    0xb94(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
mov    0x2b63(%rip),%rax
cmpl   $0x1,(%rax)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    -0x90(%rbp),%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
lea    -0x90(%rbp),%rdi
lea    0xb4f(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x290(%rbp),%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
lea    -0x290(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1050 <mbstowcs@plt>
cmp    $0x5,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
xor    %eax,%eax
cmpl   $0xa3c1,-0x290(%rbp)
mov    %al,-0x291(%rbp)
jne    158b <main+0x3eb>
xor    %eax,%eax
cmpl   $0x20,-0x28c(%rbp)
mov    %al,-0x291(%rbp)
jne    158b <main+0x3eb>
xor    %eax,%eax
cmpl   $0x42,-0x288(%rbp)
mov    %al,-0x291(%rbp)
jne    158b <main+0x3eb>
xor    %eax,%eax
cmpl   $0x20,-0x284(%rbp)
mov    %al,-0x291(%rbp)
jne    158b <main+0x3eb>
xor    %eax,%eax
cmpl   $0xa3c3,-0x280(%rbp)
mov    %al,-0x291(%rbp)
jne    158b <main+0x3eb>
cmpl   $0x0,-0x27c(%rbp)
sete   %al
mov    %al,-0x291(%rbp)
mov    -0x291(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   10a0 <assert@plt>
lea    0xa7e(%rip),%rdi
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x2a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x288,%rsp
lea    0xe75(%rip),%rdi
call   1050 <puts@plt>
lea    0x200(%rsp),%r12
mov    %r12,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
lea    0xe35(%rip),%r15
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x80,%edx
call   1060 <mbstowcs@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   10a0 <assert@plt>
lea    0xe24(%rip),%rsi
mov    %r14,%rdi
call   1030 <wcscmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   10a0 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,0x18(%rsp)
sete   %dil
call   10a0 <assert@plt>
mov    %r12,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x4,%edx
call   1060 <mbstowcs@plt>
xor    %edi,%edi
cmp    $0x4,%eax
sete   %dil
call   10a0 <assert@plt>
lea    0xdbf(%rip),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   10c0 <wmemcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   10a0 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,0x14(%rsp)
sete   %dil
call   10a0 <assert@plt>
mov    %r12,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
xor    %edi,%edi
mov    %r12,%rsi
xor    %edx,%edx
call   1060 <mbstowcs@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   10a0 <assert@plt>
mov    %r12,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
movb   $0x0,0x200(%rsp)
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1060 <mbstowcs@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   10a0 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,(%rsp)
sete   %dil
call   10a0 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,0x4(%rsp)
sete   %dil
call   10a0 <assert@plt>
mov    %r12,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %edx,%edx
call   1060 <mbstowcs@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   10a0 <assert@plt>
xor    %edi,%edi
cmpl   $0xcccc,(%rsp)
sete   %dil
call   10a0 <assert@plt>
mov    0x2c11(%rip),%rax
mov    (%rax),%edi
lea    0xc3e(%rip),%rbx
mov    %rbx,%rsi
call   10b0 <setlocale@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1090 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   10a0 <assert@plt>
mov    0x2bf9(%rip),%rax
xor    %edi,%edi
cmpl   $0x2,(%rax)
setge  %dil
call   10a0 <assert@plt>
mov    %r12,%rdi
mov    $0xcc,%esi
mov    $0x80,%edx
call   1070 <memset@plt>
lea    0xbfc(%rip),%rsi
mov    %r12,%rdi
call   1040 <strcpy@plt>
mov    %r14,%rdi
mov    $0xcccc,%esi
mov    $0x80,%edx
call   1080 <wmemset@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x80,%edx
call   1060 <mbstowcs@plt>
xor    %edi,%edi
cmp    $0x5,%eax
sete   %dil
call   10a0 <assert@plt>
movdqa (%rsp),%xmm0
pcmpeqd 0xb95(%rip),%xmm0
movmskps %xmm0,%eax
xor    $0xf,%eax
mov    $0xa3c3,%ecx
xor    0x10(%rsp),%ecx
or     %eax,%ecx
xor    %edi,%edi
or     0x14(%rsp),%ecx
sete   %dil
call   10a0 <assert@plt>
lea    0xb9d(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x288,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
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 = [19 x i8] c"ok 1 - mbstowcs()\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]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i32 204, i32 128)
%11 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%14 = call i32 @wmemset(i32* %13, i32 52428, i32 128)
%15 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%17 = call i32 @mbstowcs(i32* %15, i8* %16, i32 128)
%18 = icmp eq i32 %17, 5
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%22 = call i64 @wcscmp(i32* %21, i8* bitcast ([6 x i32]* @.str.2 to i8*))
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 6
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 52428
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%32 = call i32 @memset(i8* %31, i32 204, i32 128)
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%34 = call i32 @strcpy(i8* %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%35 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%36 = call i32 @wmemset(i32* %35, i32 52428, i32 128)
%37 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%39 = call i32 @mbstowcs(i32* %37, i8* %38, i32 4)
%40 = icmp eq i32 %39, 4
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%44 = call i64 @wmemcmp(i32* %43, i8* bitcast ([5 x i32]* @.str.3 to i8*), i32 4)
%45 = icmp eq i64 %44, 0
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 5
%49 = load i32, i32* %48
%50 = icmp eq i32 %49, 52428
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%54 = call i32 @memset(i8* %53, i32 204, i32 128)
%55 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%56 = call i32 @strcpy(i8* %55, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%57 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%58 = call i32 @mbstowcs(i32* null, i8* %57, i32 0)
%59 = icmp eq i32 %58, 5
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%63 = call i32 @memset(i8* %62, i32 204, i32 128)
%64 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
store i8 0, i8* %64
%65 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%66 = call i32 @wmemset(i32* %65, i32 52428, i32 128)
%67 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%68 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%69 = call i32 @mbstowcs(i32* %67, i8* %68, i32 1)
%70 = icmp eq i32 %69, 0
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%74 = load i32, i32* %73
%75 = icmp eq i32 %74, 0
%76 = zext i1 %75 to i32
%77 = call i32 @assert(i32 %76)
%78 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 1
%79 = load i32, i32* %78
%80 = icmp eq i32 %79, 52428
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%84 = call i32 @memset(i8* %83, i32 204, i32 128)
%85 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%86 = call i32 @strcpy(i8* %85, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%87 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%88 = call i32 @wmemset(i32* %87, i32 52428, i32 128)
%89 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%91 = call i32 @mbstowcs(i32* %89, i8* %90, i32 0)
%92 = icmp eq i32 %91, 0
%93 = zext i1 %92 to i32
%94 = call i32 @assert(i32 %93)
%95 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%96 = load i32, i32* %95
%97 = icmp eq i32 %96, 52428
%98 = zext i1 %97 to i32
%99 = call i32 @assert(i32 %98)
%100 = load i32, i32* @LC_CTYPE
%101 = call i32 @setlocale(i32 %100, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%102 = call i64 @strcmp(i32 %101, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%103 = icmp eq i64 %102, 0
%104 = zext i1 %103 to i32
%105 = call i32 @assert(i32 %104)
%106 = load i32, i32* @MB_CUR_MAX
%107 = icmp sgt i32 %106, 1
%108 = zext i1 %107 to i32
%109 = call i32 @assert(i32 %108)
%110 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%111 = call i32 @memset(i8* %110, i32 204, i32 128)
%112 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%113 = call i32 @strcpy(i8* %112, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%114 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%115 = call i32 @wmemset(i32* %114, i32 52428, i32 128)
%116 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%117 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%118 = call i32 @mbstowcs(i32* %116, i8* %117, i32 128)
%119 = icmp eq i32 %118, 5
%120 = zext i1 %119 to i32
%121 = call i32 @assert(i32 %120)
%122 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 0
%123 = load i32, i32* %122
%124 = icmp eq i32 %123, 41921
br i1 %124, label %125, label %145
125: ; preds = %2
%126 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 1
%127 = load i32, i32* %126
%128 = icmp eq i32 %127, 32
br i1 %128, label %129, label %145
129: ; preds = %125
%130 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 2
%131 = load i32, i32* %130
%132 = icmp eq i32 %131, 66
br i1 %132, label %133, label %145
133: ; preds = %129
%134 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 3
%135 = load i32, i32* %134
%136 = icmp eq i32 %135, 32
br i1 %136, label %137, label %145
137: ; preds = %133
%138 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 4
%139 = load i32, i32* %138
%140 = icmp eq i32 %139, 41923
br i1 %140, label %141, label %145
141: ; preds = %137
%142 = getelementptr inbounds [128 x i32], [128 x i32]* %7, i64 0, i64 5
%143 = load i32, i32* %142
%144 = icmp eq i32 %143, 0
br label %145
145: ; preds = %141, %137, %133, %129, %125, %2
%146 = phi i1 [ false, %137 ], [ false, %133 ], [ false, %129 ], [ false, %125 ], [ false, %2 ], [ %144, %141 ]
%147 = zext i1 %146 to i32
%148 = call i32 @assert(i32 %147)
%149 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 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 = [18 x i8] c"ok 1 - mbstowcs()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [128 x i8]
%4 = alloca [128 x i32]
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%6 = bitcast [128 x i32]* %4 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%8 = call i32 @memset(i8* %5, i32 204, i32 128)
%9 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 0
%11 = call i32 @wmemset(i32* %10, i32 52428, i32 128)
%12 = call i32 @mbstowcs(i32* %10, i8* %5, i32 128)
%13 = icmp eq i32 %12, 5
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = call i64 @wcscmp(i32* %10, i8* bitcast ([6 x i32]* @.str.2 to i8*))
%17 = icmp eq i64 %16, 0
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 6
%21 = load i32, i32* %20
%22 = icmp eq i32 %21, 52428
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = call i32 @memset(i8* %5, i32 204, i32 128)
%26 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%27 = call i32 @wmemset(i32* %10, i32 52428, i32 128)
%28 = call i32 @mbstowcs(i32* %10, i8* %5, i32 4)
%29 = icmp eq i32 %28, 4
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = call i64 @wmemcmp(i32* %10, i8* bitcast ([5 x i32]* @.str.3 to i8*), i32 4)
%33 = icmp eq i64 %32, 0
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 5
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 52428
%39 = zext i1 %38 to i32
%40 = call i32 @assert(i32 %39)
%41 = call i32 @memset(i8* %5, i32 204, i32 128)
%42 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%43 = call i32 @mbstowcs(i32* null, i8* %5, i32 0)
%44 = icmp eq i32 %43, 5
%45 = zext i1 %44 to i32
%46 = call i32 @assert(i32 %45)
%47 = call i32 @memset(i8* %5, i32 204, i32 128)
store i8 0, i8* %5
%48 = call i32 @wmemset(i32* %10, i32 52428, i32 128)
%49 = call i32 @mbstowcs(i32* %10, i8* %5, i32 1)
%50 = icmp eq i32 %49, 0
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = load i32, i32* %10
%54 = icmp eq i32 %53, 0
%55 = zext i1 %54 to i32
%56 = call i32 @assert(i32 %55)
%57 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 1
%58 = load i32, i32* %57
%59 = icmp eq i32 %58, 52428
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = call i32 @memset(i8* %5, i32 204, i32 128)
%63 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%64 = call i32 @wmemset(i32* %10, i32 52428, i32 128)
%65 = call i32 @mbstowcs(i32* %10, i8* %5, i32 0)
%66 = icmp eq i32 %65, 0
%67 = zext i1 %66 to i32
%68 = call i32 @assert(i32 %67)
%69 = load i32, i32* %10
%70 = icmp eq i32 %69, 52428
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = load i32, i32* @LC_CTYPE
%74 = call i32 @setlocale(i32 %73, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%75 = call i64 @strcmp(i32 %74, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%76 = icmp eq i64 %75, 0
%77 = zext i1 %76 to i32
%78 = call i32 @assert(i32 %77)
%79 = load i32, i32* @MB_CUR_MAX
%80 = icmp sgt i32 %79, 1
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = call i32 @memset(i8* %5, i32 204, i32 128)
%84 = call i32 @strcpy(i8* %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%85 = call i32 @wmemset(i32* %10, i32 52428, i32 128)
%86 = call i32 @mbstowcs(i32* %10, i8* %5, i32 128)
%87 = icmp eq i32 %86, 5
%88 = zext i1 %87 to i32
%89 = call i32 @assert(i32 %88)
%90 = bitcast [128 x i32]* %4 to <4 x i32>*
%91 = load <4 x i32>, <4 x i32>* %90
%92 = freeze <4 x i32> %91
%93 = icmp ne <4 x i32> %92, <i32 41921, i32 32, i32 66, i32 32>
%94 = bitcast <4 x i1> %93 to i4
%95 = icmp eq i4 %94, 0
%96 = getelementptr inbounds [128 x i32], [128 x i32]* %4, i64 0, i64 4
%97 = load i32, i32* %96
%98 = icmp eq i32 %97, 41923
%99 = select i1 %95, i1 %98, i1 false
%100 = load i32, i32* %36
%101 = icmp eq i32 %100, 0
%102 = select i1 %99, i1 %101, i1 false
%103 = zext i1 %102 to i32
%104 = call i32 @assert(i32 %103)
%105 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}