#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 */
struct charset {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int charset_mbtowc(struct charset *, int *, char *, int);
int charset_wctomb(struct charset *, char *, char);
void test_any(struct charset *charset) {
  int wc;
  char s[2];
  assert(charset);
  assert(charset_mbtowc(charset, 0, 0, 0) == 0);
  assert(charset_mbtowc(charset, 0, 0, 1) == 0);
  assert(charset_mbtowc(charset, 0, (char *)(-1), 0) == 0);
  assert(charset_mbtowc(charset, 0, "a", 0) == 0);
  assert(charset_mbtowc(charset, 0, "", 1) == 0);
  assert(charset_mbtowc(charset, 0, "b", 1) == 1);
  assert(charset_mbtowc(charset, 0, "", 2) == 0);
  assert(charset_mbtowc(charset, 0, "c", 2) == 1);
  wc = 'x';
  assert(charset_mbtowc(charset, &wc, "a", 0) == 0 && wc == 'x');
  assert(charset_mbtowc(charset, &wc, "", 1) == 0 && wc == 0);
  assert(charset_mbtowc(charset, &wc, "b", 1) == 1 && wc == 'b');
  assert(charset_mbtowc(charset, &wc, "", 2) == 0 && wc == 0);
  assert(charset_mbtowc(charset, &wc, "c", 2) == 1 && wc == 'c');
  assert(charset_wctomb(charset, 0, 0) == 0);
  s[0] = s[1] = '.';
  assert(charset_wctomb(charset, s, 0) == 1 && s[0] == '\0' && s[1] == '.');
  assert(charset_wctomb(charset, s, 'x') == 1 && s[0] == 'x' && s[1] == '.');
}


x86 assembly (clang, -O0):
<test_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
mov    %rdx,%rsi
call   1040 <charset_mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x1,%ecx
mov    %rdx,%rsi
call   1040 <charset_mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xffffffffffffffff,%rdx
xor    %ecx,%ecx
call   1040 <charset_mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xe3d(%rip),%rdx
xor    %ecx,%ecx
call   1040 <charset_mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xe18(%rip),%rdx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xdf0(%rip),%rdx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xdc6(%rip),%rdx
mov    $0x2,%ecx
call   1040 <charset_mbtowc@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
lea    0xda0(%rip),%rdx
mov    $0x2,%ecx
call   1040 <charset_mbtowc@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movl   $0x78,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    0xd6c(%rip),%rdx
xor    %ecx,%ecx
call   1040 <charset_mbtowc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xf(%rbp)
jne    12b5 <test_any+0x185>
cmpl   $0x78,-0xc(%rbp)
sete   %al
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    0xd30(%rip),%rdx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x10(%rbp)
jne    12f5 <test_any+0x1c5>
cmpl   $0x0,-0xc(%rbp)
sete   %al
mov    %al,-0x10(%rbp)
mov    -0x10(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    0xcf1(%rip),%rdx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x11(%rbp)
jne    1335 <test_any+0x205>
cmpl   $0x62,-0xc(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    0xcb0(%rip),%rdx
mov    $0x2,%ecx
call   1040 <charset_mbtowc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x12(%rbp)
jne    1375 <test_any+0x245>
cmpl   $0x0,-0xc(%rbp)
sete   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
lea    0xc73(%rip),%rdx
mov    $0x2,%ecx
call   1040 <charset_mbtowc@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x13(%rbp)
jne    13b5 <test_any+0x285>
cmpl   $0x63,-0xc(%rbp)
sete   %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1030 <charset_wctomb@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movb   $0x2e,-0xd(%rbp)
movb   $0x2e,-0xe(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xe(%rbp),%rsi
xor    %edx,%edx
call   1030 <charset_wctomb@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x14(%rbp)
jne    1427 <test_any+0x2f7>
movsbl -0xe(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x14(%rbp)
jne    1427 <test_any+0x2f7>
movsbl -0xd(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x14(%rbp)
mov    -0x14(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    -0xe(%rbp),%rsi
mov    $0x78,%edx
call   1030 <charset_wctomb@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
mov    %al,-0x15(%rbp)
jne    1475 <test_any+0x345>
movsbl -0xe(%rbp),%ecx
xor    %eax,%eax
cmp    $0x78,%ecx
mov    %al,-0x15(%rbp)
jne    1475 <test_any+0x345>
movsbl -0xd(%rbp),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_any>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xffffffffffffffff,%rdx
xor    %ecx,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe5d(%rip),%r13
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r13,%rdx
xor    %ecx,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe3b(%rip),%r14
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xe16(%rip),%r12
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r12,%rdx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0x2,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
lea    0xdd2(%rip),%r15
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
mov    $0x2,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
movl   $0x78,0x4(%rsp)
lea    0x4(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
xor    %ecx,%ecx
call   1040 <charset_mbtowc@plt>
mov    0x4(%rsp),%ecx
xor    $0x78,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
or     0x4(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    $0x1,%ecx
call   1040 <charset_mbtowc@plt>
xor    $0x1,%eax
mov    0x4(%rsp),%ecx
xor    $0x62,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    $0x2,%ecx
call   1040 <charset_mbtowc@plt>
xor    %edi,%edi
or     0x4(%rsp),%eax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    $0x2,%ecx
call   1040 <charset_mbtowc@plt>
xor    $0x1,%eax
mov    0x4(%rsp),%ecx
xor    $0x63,%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <charset_wctomb@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
movw   $0x2e2e,0x2(%rsp)
lea    0x2(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %edx,%edx
call   1030 <charset_wctomb@plt>
cmp    $0x1,%eax
sete   %al
cmpb   $0x0,0x2(%rsp)
sete   %cl
and    %al,%cl
cmpb   $0x2e,0x3(%rsp)
sete   %al
and    %cl,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x78,%edx
call   1030 <charset_wctomb@plt>
cmp    $0x1,%eax
sete   %al
cmpb   $0x78,0x2(%rsp)
sete   %cl
and    %al,%cl
cmpb   $0x2e,0x3(%rsp)
sete   %al
and    %cl,%al
movzbl %al,%edi
call   1050 <assert@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.charset = type { i32 }
@.str = [2 x i8] c"a\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"b\00"
@.str.3 = [2 x i8] c"c\00"
define void @test_any(%struct.charset* %0) {
%2 = alloca %struct.charset*
%3 = alloca i32
%4 = alloca [2 x i8]
store %struct.charset* %0, %struct.charset** %2
%5 = load %struct.charset*, %struct.charset** %2
%6 = ptrtoint %struct.charset* %5 to i32
%7 = call i32 @assert(i32 %6)
%8 = load %struct.charset*, %struct.charset** %2
%9 = call i32 @charset_mbtowc(%struct.charset* %8, i32* null, i8* null, i32 0)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load %struct.charset*, %struct.charset** %2
%14 = call i32 @charset_mbtowc(%struct.charset* %13, i32* null, i8* null, i32 1)
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = load %struct.charset*, %struct.charset** %2
%19 = call i32 @charset_mbtowc(%struct.charset* %18, i32* null, i8* inttoptr (i64 -1 to i8*), i32 0)
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load %struct.charset*, %struct.charset** %2
%24 = call i32 @charset_mbtowc(%struct.charset* %23, i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @assert(i32 %26)
%28 = load %struct.charset*, %struct.charset** %2
%29 = call i32 @charset_mbtowc(%struct.charset* %28, i32* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%30 = icmp eq i32 %29, 0
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = load %struct.charset*, %struct.charset** %2
%34 = call i32 @charset_mbtowc(%struct.charset* %33, i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%35 = icmp eq i32 %34, 1
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = load %struct.charset*, %struct.charset** %2
%39 = call i32 @charset_mbtowc(%struct.charset* %38, i32* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 2)
%40 = icmp eq i32 %39, 0
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = load %struct.charset*, %struct.charset** %2
%44 = call i32 @charset_mbtowc(%struct.charset* %43, i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 2)
%45 = icmp eq i32 %44, 1
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
store i32 120, i32* %3
%48 = load %struct.charset*, %struct.charset** %2
%49 = call i32 @charset_mbtowc(%struct.charset* %48, i32* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%50 = icmp eq i32 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %1
%52 = load i32, i32* %3
%53 = icmp eq i32 %52, 120
br label %54
54: ; preds = %51, %1
%55 = phi i1 [ false, %1 ], [ %53, %51 ]
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
%58 = load %struct.charset*, %struct.charset** %2
%59 = call i32 @charset_mbtowc(%struct.charset* %58, i32* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%60 = icmp eq i32 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %54
%62 = load i32, i32* %3
%63 = icmp eq i32 %62, 0
br label %64
64: ; preds = %61, %54
%65 = phi i1 [ false, %54 ], [ %63, %61 ]
%66 = zext i1 %65 to i32
%67 = call i32 @assert(i32 %66)
%68 = load %struct.charset*, %struct.charset** %2
%69 = call i32 @charset_mbtowc(%struct.charset* %68, i32* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %74
71: ; preds = %64
%72 = load i32, i32* %3
%73 = icmp eq i32 %72, 98
br label %74
74: ; preds = %71, %64
%75 = phi i1 [ false, %64 ], [ %73, %71 ]
%76 = zext i1 %75 to i32
%77 = call i32 @assert(i32 %76)
%78 = load %struct.charset*, %struct.charset** %2
%79 = call i32 @charset_mbtowc(%struct.charset* %78, i32* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 2)
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %74
%82 = load i32, i32* %3
%83 = icmp eq i32 %82, 0
br label %84
84: ; preds = %81, %74
%85 = phi i1 [ false, %74 ], [ %83, %81 ]
%86 = zext i1 %85 to i32
%87 = call i32 @assert(i32 %86)
%88 = load %struct.charset*, %struct.charset** %2
%89 = call i32 @charset_mbtowc(%struct.charset* %88, i32* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 2)
%90 = icmp eq i32 %89, 1
br i1 %90, label %91, label %94
91: ; preds = %84
%92 = load i32, i32* %3
%93 = icmp eq i32 %92, 99
br label %94
94: ; preds = %91, %84
%95 = phi i1 [ false, %84 ], [ %93, %91 ]
%96 = zext i1 %95 to i32
%97 = call i32 @assert(i32 %96)
%98 = load %struct.charset*, %struct.charset** %2
%99 = call i32 @charset_wctomb(%struct.charset* %98, i8* null, i8 signext 0)
%100 = icmp eq i32 %99, 0
%101 = zext i1 %100 to i32
%102 = call i32 @assert(i32 %101)
%103 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
store i8 46, i8* %103
%104 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
store i8 46, i8* %104
%105 = load %struct.charset*, %struct.charset** %2
%106 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%107 = call i32 @charset_wctomb(%struct.charset* %105, i8* %106, i8 signext 0)
%108 = icmp eq i32 %107, 1
br i1 %108, label %109, label %119
109: ; preds = %94
%110 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%111 = load i8, i8* %110
%112 = sext i8 %111 to i32
%113 = icmp eq i32 %112, 0
br i1 %113, label %114, label %119
114: ; preds = %109
%115 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%116 = load i8, i8* %115
%117 = sext i8 %116 to i32
%118 = icmp eq i32 %117, 46
br label %119
119: ; preds = %114, %109, %94
%120 = phi i1 [ false, %109 ], [ false, %94 ], [ %118, %114 ]
%121 = zext i1 %120 to i32
%122 = call i32 @assert(i32 %121)
%123 = load %struct.charset*, %struct.charset** %2
%124 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%125 = call i32 @charset_wctomb(%struct.charset* %123, i8* %124, i8 signext 120)
%126 = icmp eq i32 %125, 1
br i1 %126, label %127, label %137
127: ; preds = %119
%128 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%129 = load i8, i8* %128
%130 = sext i8 %129 to i32
%131 = icmp eq i32 %130, 120
br i1 %131, label %132, label %137
132: ; preds = %127
%133 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp eq i32 %135, 46
br label %137
137: ; preds = %132, %127, %119
%138 = phi i1 [ false, %127 ], [ false, %119 ], [ %136, %132 ]
%139 = zext i1 %138 to i32
%140 = call i32 @assert(i32 %139)
ret void
}

LLVM IR (-O2):
%struct.charset = type { i32 }
@.str = [2 x i8] c"a\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"b\00"
@.str.3 = [2 x i8] c"c\00"
define void @test_any(%struct.charset* %0) {
%2 = alloca i32
%3 = alloca [2 x i8]
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%6 = ptrtoint %struct.charset* %0 to i64
%7 = trunc i64 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32 @charset_mbtowc(%struct.charset* %0, i32* null, i8* null, i32 0)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @charset_mbtowc(%struct.charset* %0, i32* null, i8* null, i32 1)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 @charset_mbtowc(%struct.charset* %0, i32* null, i8* inttoptr (i64 -1 to i8*), i32 0)
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @charset_mbtowc(%struct.charset* %0, i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @charset_mbtowc(%struct.charset* %0, i32* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%26 = icmp eq i32 %25, 0
%27 = zext i1 %26 to i32
%28 = tail call i32 @assert(i32 %27)
%29 = tail call i32 @charset_mbtowc(%struct.charset* %0, i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%30 = icmp eq i32 %29, 1
%31 = zext i1 %30 to i32
%32 = tail call i32 @assert(i32 %31)
%33 = tail call i32 @charset_mbtowc(%struct.charset* %0, i32* null, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 2)
%34 = icmp eq i32 %33, 0
%35 = zext i1 %34 to i32
%36 = tail call i32 @assert(i32 %35)
%37 = tail call i32 @charset_mbtowc(%struct.charset* %0, i32* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 2)
%38 = icmp eq i32 %37, 1
%39 = zext i1 %38 to i32
%40 = tail call i32 @assert(i32 %39)
store i32 120, i32* %2
%41 = call i32 @charset_mbtowc(%struct.charset* %0, i32* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 0)
%42 = icmp eq i32 %41, 0
%43 = load i32, i32* %2
%44 = icmp eq i32 %43, 120
%45 = select i1 %42, i1 %44, i1 false
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = call i32 @charset_mbtowc(%struct.charset* %0, i32* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 1)
%49 = icmp eq i32 %48, 0
%50 = load i32, i32* %2
%51 = icmp eq i32 %50, 0
%52 = select i1 %49, i1 %51, i1 false
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = call i32 @charset_mbtowc(%struct.charset* %0, i32* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1)
%56 = icmp eq i32 %55, 1
%57 = load i32, i32* %2
%58 = icmp eq i32 %57, 98
%59 = select i1 %56, i1 %58, i1 false
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = call i32 @charset_mbtowc(%struct.charset* %0, i32* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 2)
%63 = icmp eq i32 %62, 0
%64 = load i32, i32* %2
%65 = icmp eq i32 %64, 0
%66 = select i1 %63, i1 %65, i1 false
%67 = zext i1 %66 to i32
%68 = call i32 @assert(i32 %67)
%69 = call i32 @charset_mbtowc(%struct.charset* %0, i32* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 2)
%70 = icmp eq i32 %69, 1
%71 = load i32, i32* %2
%72 = icmp eq i32 %71, 99
%73 = select i1 %70, i1 %72, i1 false
%74 = zext i1 %73 to i32
%75 = call i32 @assert(i32 %74)
%76 = call i32 @charset_wctomb(%struct.charset* %0, i8* null, i8 signext 0)
%77 = icmp eq i32 %76, 0
%78 = zext i1 %77 to i32
%79 = call i32 @assert(i32 %78)
%80 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 1
store i8 46, i8* %80
store i8 46, i8* %5
%81 = call i32 @charset_wctomb(%struct.charset* %0, i8* %5, i8 signext 0)
%82 = icmp eq i32 %81, 1
%83 = load i8, i8* %5
%84 = icmp eq i8 %83, 0
%85 = select i1 %82, i1 %84, i1 false
%86 = load i8, i8* %80
%87 = icmp eq i8 %86, 46
%88 = select i1 %85, i1 %87, i1 false
%89 = zext i1 %88 to i32
%90 = call i32 @assert(i32 %89)
%91 = call i32 @charset_wctomb(%struct.charset* %0, i8* %5, i8 signext 120)
%92 = icmp eq i32 %91, 1
%93 = load i8, i8* %5
%94 = icmp eq i8 %93, 120
%95 = select i1 %92, i1 %94, i1 false
%96 = load i8, i8* %80
%97 = icmp eq i8 %96, 46
%98 = select i1 %95, i1 %97, i1 false
%99 = zext i1 %98 to i32
%100 = call i32 @assert(i32 %99)
ret void
}