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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int has_common_character(char *, char *, int);
int /*<<< orphan*/ load_mapping_tables();
int /*<<< orphan*/ stderr;
void test_mapping() {
  int result;
  result = has_common_character("樱花", "桜がさく", 1);
  fprintf(stderr, "樱花 - 桜がさく, result = %d\n", result);
  result = has_common_character("桜がさく", "樱花", 2);
  fprintf(stderr, "桜がさく - 樱花, result = %d\n", result);
  result = has_common_character("国家", "桜がさく", 1);
  fprintf(stderr, "国家 - 桜がさく, result = %d\n", result);
  result = has_common_character("国家", "王国", 2);
  fprintf(stderr, "国家 - 王国, result = %d\n", result);
}
int main(int argc, char **argv) {
  load_mapping_tables();
  test_mapping();
}


x86 assembly (clang, -O0):
<test_mapping>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
lea    0xeb1(%rip),%rsi
mov    $0x1,%edx
call   1040 <has_common_character@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9e(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xe85(%rip),%rdi
lea    0xe77(%rip),%rsi
mov    $0x2,%edx
call   1040 <has_common_character@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e43(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe8f(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xea7(%rip),%rdi
lea    0xe4b(%rip),%rsi
mov    $0x1,%edx
call   1040 <has_common_character@plt>
mov    %eax,-0x4(%rbp)
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe87(%rip),%rsi
call   1050 <fprintf@plt>
lea    0xe74(%rip),%rdi
lea    0xe98(%rip),%rsi
mov    $0x2,%edx
call   1040 <has_common_character@plt>
mov    %eax,-0x4(%rbp)
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe7f(%rip),%rsi
call   1050 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret
nopw   0x0(%rax,%rax,1)

x86 assembly (clang, -O2):
<test_mapping>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xeb1(%rip),%r14
lea    0xeb1(%rip),%r15
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1040 <has_common_character@plt>
mov    0x2e73(%rip),%r12
mov    (%r12),%edi
lea    0xe9c(%rip),%rsi
mov    %eax,%edx
call   1050 <fprintf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
call   1040 <has_common_character@plt>
mov    (%r12),%edi
lea    0xe9e(%rip),%rsi
mov    %eax,%edx
call   1050 <fprintf@plt>
lea    0xeb4(%rip),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1040 <has_common_character@plt>
mov    (%r12),%edi
lea    0xea0(%rip),%rsi
mov    %eax,%edx
call   1050 <fprintf@plt>
lea    0xeb6(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%edx
call   1040 <has_common_character@plt>
mov    (%r12),%edi
lea    0xea5(%rip),%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <fprintf@plt>
nopl   0x0(%rax,%rax,1)

LLVM IR (-O0):
@.str = [7 x i8] c"\E6\A8\B1\E8\8A\B1\00"
@.str.1 = [13 x i8] c"\E6\A1\9C\E3\81\8C\E3\81\95\E3\81\8F\00"
@stderr = global i32 0
@.str.2 = [36 x i8] c"\E6\A8\B1\E8\8A\B1 - \E6\A1\9C\E3\81\8C\E3\81\95\E3\81\8F, result = %d\0A\00"
@.str.3 = [36 x i8] c"\E6\A1\9C\E3\81\8C\E3\81\95\E3\81\8F - \E6\A8\B1\E8\8A\B1, result = %d\0A\00"
@.str.4 = [7 x i8] c"\E5\9B\BD\E5\AE\B6\00"
@.str.5 = [36 x i8] c"\E5\9B\BD\E5\AE\B6 - \E6\A1\9C\E3\81\8C\E3\81\95\E3\81\8F, result = %d\0A\00"
@.str.6 = [7 x i8] c"\E7\8E\8B\E5\9B\BD\00"
@.str.7 = [30 x i8] c"\E5\9B\BD\E5\AE\B6 - \E7\8E\8B\E5\9B\BD, result = %d\0A\00"
define void @test_mapping() {
%1 = alloca i32
%2 = call i32 @has_common_character(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
store i32 %2, i32* %1
%3 = load i32, i32* @stderr
%4 = load i32, i32* %1
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = call i32 @has_common_character(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2)
store i32 %6, i32* %1
%7 = load i32, i32* @stderr
%8 = load i32, i32* %1
%9 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = call i32 @has_common_character(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
store i32 %10, i32* %1
%11 = load i32, i32* @stderr
%12 = load i32, i32* %1
%13 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %12)
%14 = call i32 @has_common_character(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 2)
store i32 %14, i32* %1
%15 = load i32, i32* @stderr
%16 = load i32, i32* %1
%17 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %16)
ret void
}
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @load_mapping_tables()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"\E6\A8\B1\E8\8A\B1\00"
@.str.1 = [13 x i8] c"\E6\A1\9C\E3\81\8C\E3\81\95\E3\81\8F\00"
@stderr = global i32 0
@.str.2 = [36 x i8] c"\E6\A8\B1\E8\8A\B1 - \E6\A1\9C\E3\81\8C\E3\81\95\E3\81\8F, result = %d\0A\00"
@.str.3 = [36 x i8] c"\E6\A1\9C\E3\81\8C\E3\81\95\E3\81\8F - \E6\A8\B1\E8\8A\B1, result = %d\0A\00"
@.str.4 = [7 x i8] c"\E5\9B\BD\E5\AE\B6\00"
@.str.5 = [36 x i8] c"\E5\9B\BD\E5\AE\B6 - \E6\A1\9C\E3\81\8C\E3\81\95\E3\81\8F, result = %d\0A\00"
@.str.6 = [7 x i8] c"\E7\8E\8B\E5\9B\BD\00"
@.str.7 = [30 x i8] c"\E5\9B\BD\E5\AE\B6 - \E7\8E\8B\E5\9B\BD, result = %d\0A\00"
define void @test_mapping() {
%1 = tail call i32 @has_common_character(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%4 = tail call i32 @has_common_character(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 2)
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 %4)
%7 = tail call i32 @has_common_character(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0), i32 %7)
%10 = tail call i32 @has_common_character(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i32 2)
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.7, i64 0, i64 0), i32 %10)
ret void
}
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @load_mapping_tables()
tail call void @test_mapping()
ret i32 0
}