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

/* Variables and functions */
int /*<<< orphan*/ LC_CTYPE;
int MB_CUR_MAX;
int /*<<< orphan*/ MB_LEN_MAX;
int /*<<< orphan*/ assert(int);
int mbtowc(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 main(int argc, char *argv[]) {
  size_t len;
  wchar_t wc;
  char buf[MB_LEN_MAX + 1];
  printf("1..1\n");
  assert(MB_CUR_MAX == 1);
  assert(mbtowc(NULL, NULL, 0) == 0);
  wc = 0xcccc;
  memset(buf, 0, sizeof(buf));
  assert(mbtowc(&wc, buf, 1) == 0);
  assert(wc == 0);
  buf[0] = 'A';
  assert(mbtowc(&wc, buf, 1) == 1);
  assert(wc == L'A');
  wc = L'z';
  buf[0] = '\0';
  assert(mbtowc(&wc, buf, 0) == -1);
  assert(wc == L'z');
  assert(mbtowc(NULL, NULL, 0) == 0);
  assert(strcmp(setlocale(LC_CTYPE, "ja_JP.eucJP"), "ja_JP.eucJP") == 0);
  assert(MB_CUR_MAX > 1);
  memset(buf, 0xcc, sizeof(buf));
  buf[0] = 0;
  wc = 0xcccc;
  assert(mbtowc(&wc, buf, 1) == 0);
  assert(wc == 0);
  buf[0] = 'A';
  assert(mbtowc(&wc, buf, 1) == 1);
  assert(wc == L'A');
  wc = L'z';
  buf[0] = '\0';
  assert(mbtowc(&wc, buf, 0) == -1);
  assert(wc == L'z');
  assert(mbtowc(NULL, NULL, 0) == 0);
  memset(buf, 0xcc, sizeof(buf));
  buf[0] = 0xa3;
  buf[1] = 0x00;
  wc = L'z';
  assert(mbtowc(&wc, buf, 1) == -1);
  assert(wc == L'z');
  assert(mbtowc(NULL, NULL, 0) == 0);
  buf[1] = 0xc1;
  assert(mbtowc(&wc, buf, 2) == 2);
  assert(wc == 0xa3c1);
  printf("ok 1 - mbtowc()\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e53(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rax,-0x40(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x28(%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,-0x30(%rbp)
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e3c(%rip),%rax
cmpl   $0x1,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    %rsi,%rdi
call   1070 <mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
movl   $0xcccc,-0x1c(%rbp)
mov    %eax,%edx
xor    %esi,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rsi
lea    -0x1c(%rbp),%rdi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x0,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rsi
movb   $0x41,(%rsi)
lea    -0x1c(%rbp),%rdi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x41,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rsi
movl   $0x7a,-0x1c(%rbp)
movb   $0x0,(%rsi)
lea    -0x1c(%rbp),%rdi
xor    %edx,%edx
call   1070 <mbtowc@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x7a,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    %rsi,%rdi
call   1070 <mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2d16(%rip),%rax
mov    (%rax),%edi
lea    0xd33(%rip),%rsi
call   1080 <setlocale@plt>
mov    %eax,%edi
lea    0xd25(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    0x2cfa(%rip),%rax
cmpl   $0x1,(%rax)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rsi
movb   $0x0,(%rsi)
movl   $0xcccc,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x0,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rsi
movb   $0x41,(%rsi)
lea    -0x1c(%rbp),%rdi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x41,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rsi
movl   $0x7a,-0x1c(%rbp)
movb   $0x0,(%rsi)
lea    -0x1c(%rbp),%rdi
xor    %edx,%edx
call   1070 <mbtowc@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x7a,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    %rsi,%rdi
call   1070 <mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    %eax,%edx
mov    $0xcc,%esi
call   1040 <memset@plt>
mov    -0x38(%rbp),%rsi
movb   $0xa3,(%rsi)
movb   $0x0,0x1(%rsi)
movl   $0x7a,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0x7a,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
mov    %rsi,%rdi
call   1070 <mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x38(%rbp),%rsi
movb   $0xc1,0x1(%rsi)
lea    -0x1c(%rbp),%rdi
mov    $0x2,%edx
call   1070 <mbtowc@plt>
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
cmpl   $0xa3c1,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xb71(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%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,-0x40(%rbp)
mov    0x2e54(%rip),%rax
mov    (%rax),%r15d
add    $0x1,%r15d
mov    %rsp,%rbx
mov    %rbx,-0x38(%rbp)
lea    0xf(%r15),%r13
and    $0xfffffffffffffff0,%r13
sub    %r13,%rbx
mov    %rbx,%rsp
lea    0xe6d(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e4d(%rip),%rax
xor    %edi,%edi
cmpl   $0x1,(%rax)
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
movl   $0xcccc,-0x2c(%rbp)
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15d,%edx
call   1040 <memset@plt>
lea    -0x2c(%rbp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,-0x2c(%rbp)
sete   %dil
call   1060 <assert@plt>
movb   $0x41,(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpl   $0x41,-0x2c(%rbp)
sete   %dil
call   1060 <assert@plt>
movl   $0x7a,-0x2c(%rbp)
movb   $0x0,(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpl   $0x7a,-0x2c(%rbp)
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xd5f(%rip),%r12
mov    %r12,%rsi
call   1080 <setlocale@plt>
mov    %eax,%edi
mov    %r12,%rsi
call   1050 <strcmp@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
mov    0x2d2e(%rip),%rax
cmpl   $0x2,(%rax)
setge  %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r15d,%edx
call   1040 <memset@plt>
movb   $0x0,(%rbx)
movl   $0xcccc,-0x2c(%rbp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpl   $0x0,-0x2c(%rbp)
sete   %dil
call   1060 <assert@plt>
movb   $0x41,(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpl   $0x41,-0x2c(%rbp)
sete   %dil
call   1060 <assert@plt>
movl   $0x7a,-0x2c(%rbp)
movb   $0x0,(%rbx)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpl   $0x7a,-0x2c(%rbp)
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    $0xcc,%esi
mov    %r15d,%edx
call   1040 <memset@plt>
movw   $0xa3,(%rbx)
neg    %r13
movl   $0x7a,-0x2c(%rbp)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpl   $0x7a,-0x2c(%rbp)
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    -0x38(%rbp),%rax
movb   $0xc1,0x1(%rax,%r13,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x2,%edx
call   1070 <mbtowc@plt>
xor    %edi,%edi
cmp    $0x2,%eax
sete   %dil
call   1060 <assert@plt>
xor    %edi,%edi
cmpl   $0xa3c1,-0x2c(%rbp)
sete   %dil
call   1060 <assert@plt>
lea    0xbd4(%rip),%rdi
call   1030 <puts@plt>
mov    -0x40(%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"
@MB_CUR_MAX = global i32 0
@LC_CTYPE = global i32 0
@.str.1 = [12 x i8] c"ja_JP.eucJP\00"
@.str.2 = [17 x i8] c"ok 1 - mbtowc()\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* @MB_LEN_MAX
%11 = add nsw i32 %10, 1
%12 = zext i32 %11 to i64
%13 = call i8* @llvm.stacksave()
store i8* %13, i8** %8
%14 = alloca i8, i64 %12
store i64 %12, i64* %9
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @MB_CUR_MAX
%17 = icmp eq i32 %16, 1
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = call i32 @mbtowc(i32* null, i8* null, i32 0)
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
store i32 52428, i32* %7
%24 = trunc i64 %12 to i32
%25 = call i32 @memset(i8* %14, i32 0, i32 %24)
%26 = call i32 @mbtowc(i32* %7, i8* %14, i32 1)
%27 = icmp eq i32 %26, 0
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load i32, i32* %7
%31 = icmp eq i32 %30, 0
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = getelementptr inbounds i8, i8* %14, i64 0
store i8 65, i8* %34
%35 = call i32 @mbtowc(i32* %7, i8* %14, i32 1)
%36 = icmp eq i32 %35, 1
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = load i32, i32* %7
%40 = icmp eq i32 %39, 65
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
store i32 122, i32* %7
%43 = getelementptr inbounds i8, i8* %14, i64 0
store i8 0, i8* %43
%44 = call i32 @mbtowc(i32* %7, i8* %14, i32 0)
%45 = icmp eq i32 %44, -1
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = load i32, i32* %7
%49 = icmp eq i32 %48, 122
%50 = zext i1 %49 to i32
%51 = call i32 @assert(i32 %50)
%52 = call i32 @mbtowc(i32* null, i8* null, i32 0)
%53 = icmp eq i32 %52, 0
%54 = zext i1 %53 to i32
%55 = call i32 @assert(i32 %54)
%56 = load i32, i32* @LC_CTYPE
%57 = call i32 @setlocale(i32 %56, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%58 = call i64 @strcmp(i32 %57, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%59 = icmp eq i64 %58, 0
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = load i32, i32* @MB_CUR_MAX
%63 = icmp sgt i32 %62, 1
%64 = zext i1 %63 to i32
%65 = call i32 @assert(i32 %64)
%66 = trunc i64 %12 to i32
%67 = call i32 @memset(i8* %14, i32 204, i32 %66)
%68 = getelementptr inbounds i8, i8* %14, i64 0
store i8 0, i8* %68
store i32 52428, i32* %7
%69 = call i32 @mbtowc(i32* %7, i8* %14, i32 1)
%70 = icmp eq i32 %69, 0
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
%73 = load i32, i32* %7
%74 = icmp eq i32 %73, 0
%75 = zext i1 %74 to i32
%76 = call i32 @assert(i32 %75)
%77 = getelementptr inbounds i8, i8* %14, i64 0
store i8 65, i8* %77
%78 = call i32 @mbtowc(i32* %7, i8* %14, i32 1)
%79 = icmp eq i32 %78, 1
%80 = zext i1 %79 to i32
%81 = call i32 @assert(i32 %80)
%82 = load i32, i32* %7
%83 = icmp eq i32 %82, 65
%84 = zext i1 %83 to i32
%85 = call i32 @assert(i32 %84)
store i32 122, i32* %7
%86 = getelementptr inbounds i8, i8* %14, i64 0
store i8 0, i8* %86
%87 = call i32 @mbtowc(i32* %7, i8* %14, i32 0)
%88 = icmp eq i32 %87, -1
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = load i32, i32* %7
%92 = icmp eq i32 %91, 122
%93 = zext i1 %92 to i32
%94 = call i32 @assert(i32 %93)
%95 = call i32 @mbtowc(i32* null, i8* null, i32 0)
%96 = icmp eq i32 %95, 0
%97 = zext i1 %96 to i32
%98 = call i32 @assert(i32 %97)
%99 = trunc i64 %12 to i32
%100 = call i32 @memset(i8* %14, i32 204, i32 %99)
%101 = getelementptr inbounds i8, i8* %14, i64 0
store i8 -93, i8* %101
%102 = getelementptr inbounds i8, i8* %14, i64 1
store i8 0, i8* %102
store i32 122, i32* %7
%103 = call i32 @mbtowc(i32* %7, i8* %14, i32 1)
%104 = icmp eq i32 %103, -1
%105 = zext i1 %104 to i32
%106 = call i32 @assert(i32 %105)
%107 = load i32, i32* %7
%108 = icmp eq i32 %107, 122
%109 = zext i1 %108 to i32
%110 = call i32 @assert(i32 %109)
%111 = call i32 @mbtowc(i32* null, i8* null, i32 0)
%112 = icmp eq i32 %111, 0
%113 = zext i1 %112 to i32
%114 = call i32 @assert(i32 %113)
%115 = getelementptr inbounds i8, i8* %14, i64 1
store i8 -63, i8* %115
%116 = call i32 @mbtowc(i32* %7, i8* %14, i32 2)
%117 = icmp eq i32 %116, 2
%118 = zext i1 %117 to i32
%119 = call i32 @assert(i32 %118)
%120 = load i32, i32* %7
%121 = icmp eq i32 %120, 41921
%122 = zext i1 %121 to i32
%123 = call i32 @assert(i32 %122)
%124 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %3
%125 = load i8*, i8** %8
%126 = load i32, i32* %3
ret i32 %126
}

LLVM IR (-O2):
@MB_LEN_MAX = global i32 0
@MB_CUR_MAX = global i32 0
@LC_CTYPE = global i32 0
@.str.1 = [12 x i8] c"ja_JP.eucJP\00"
@str = [5 x i8] c"1..1\00"
@str.3 = [16 x i8] c"ok 1 - mbtowc()\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i32, i32* @MB_LEN_MAX
%6 = add nsw i32 %5, 1
%7 = zext i32 %6 to i64
%8 = tail call i8* @llvm.stacksave()
%9 = alloca i8, i64 %7
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%11 = load i32, i32* @MB_CUR_MAX
%12 = icmp eq i32 %11, 1
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i32 @mbtowc(i32* null, i8* null, i32 0)
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
store i32 52428, i32* %3
%19 = call i32 @memset(i8* %9, i32 0, i32 %6)
%20 = call i32 @mbtowc(i32* %3, i8* %9, i32 1)
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
store i8 65, i8* %9
%28 = call i32 @mbtowc(i32* %3, i8* %9, i32 1)
%29 = icmp eq i32 %28, 1
%30 = zext i1 %29 to i32
%31 = call i32 @assert(i32 %30)
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 65
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
store i32 122, i32* %3
store i8 0, i8* %9
%36 = call i32 @mbtowc(i32* %3, i8* %9, i32 0)
%37 = icmp eq i32 %36, -1
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = load i32, i32* %3
%41 = icmp eq i32 %40, 122
%42 = zext i1 %41 to i32
%43 = call i32 @assert(i32 %42)
%44 = call i32 @mbtowc(i32* null, i8* null, i32 0)
%45 = icmp eq i32 %44, 0
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = load i32, i32* @LC_CTYPE
%49 = call i32 @setlocale(i32 %48, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%50 = call i64 @strcmp(i32 %49, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%51 = icmp eq i64 %50, 0
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = load i32, i32* @MB_CUR_MAX
%55 = icmp sgt i32 %54, 1
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
%58 = call i32 @memset(i8* %9, i32 204, i32 %6)
store i8 0, i8* %9
store i32 52428, i32* %3
%59 = call i32 @mbtowc(i32* %3, i8* %9, i32 1)
%60 = icmp eq i32 %59, 0
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = load i32, i32* %3
%64 = icmp eq i32 %63, 0
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
store i8 65, i8* %9
%67 = call i32 @mbtowc(i32* %3, i8* %9, i32 1)
%68 = icmp eq i32 %67, 1
%69 = zext i1 %68 to i32
%70 = call i32 @assert(i32 %69)
%71 = load i32, i32* %3
%72 = icmp eq i32 %71, 65
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
store i32 122, i32* %3
store i8 0, i8* %9
%75 = call i32 @mbtowc(i32* %3, i8* %9, i32 0)
%76 = icmp eq i32 %75, -1
%77 = zext i1 %76 to i32
%78 = call i32 @assert(i32 %77)
%79 = load i32, i32* %3
%80 = icmp eq i32 %79, 122
%81 = zext i1 %80 to i32
%82 = call i32 @assert(i32 %81)
%83 = call i32 @mbtowc(i32* null, i8* null, i32 0)
%84 = icmp eq i32 %83, 0
%85 = zext i1 %84 to i32
%86 = call i32 @assert(i32 %85)
%87 = call i32 @memset(i8* %9, i32 204, i32 %6)
store i8 -93, i8* %9
%88 = getelementptr inbounds i8, i8* %9, i64 1
store i8 0, i8* %88
store i32 122, i32* %3
%89 = call i32 @mbtowc(i32* %3, i8* %9, i32 1)
%90 = icmp eq i32 %89, -1
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
%93 = load i32, i32* %3
%94 = icmp eq i32 %93, 122
%95 = zext i1 %94 to i32
%96 = call i32 @assert(i32 %95)
%97 = call i32 @mbtowc(i32* null, i8* null, i32 0)
%98 = icmp eq i32 %97, 0
%99 = zext i1 %98 to i32
%100 = call i32 @assert(i32 %99)
store i8 -63, i8* %88
%101 = call i32 @mbtowc(i32* %3, i8* %9, i32 2)
%102 = icmp eq i32 %101, 2
%103 = zext i1 %102 to i32
%104 = call i32 @assert(i32 %103)
%105 = load i32, i32* %3
%106 = icmp eq i32 %105, 41921
%107 = zext i1 %106 to i32
%108 = call i32 @assert(i32 %107)
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.3, i64 0, i64 0))
ret i32 0
}