#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*/ test_alias(char *, char *, int);
void test_aliasing(void) {
  test_alias("application/x-wordperfect", "application/vnd.wordperfect", 1);
  test_alias("application/x-gnome-app-info", "application/x-desktop", 1);
  test_alias("application/x-wordperfect", "application/vnd.wordperfect", 1);
  test_alias("application/x-wordperfect", "audio/x-midi", 0);
  test_alias("/", "vnd/vnd", 0);
  test_alias("application/octet-stream", "text/plain", 0);
  test_alias("text/plain", "text/*", 0);
}


x86 assembly (clang, -O0):
<test_aliasing>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xef8(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_alias@plt>
lea    0xf03(%rip),%rdi
lea    0xf19(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_alias@plt>
lea    0xeb5(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_alias@plt>
lea    0xe9d(%rip),%rdi
lea    0xeff(%rip),%rsi
xor    %edx,%edx
call   1030 <test_alias@plt>
lea    0xefe(%rip),%rdi
lea    0xef9(%rip),%rsi
xor    %edx,%edx
call   1030 <test_alias@plt>
lea    0xef3(%rip),%rdi
lea    0xf05(%rip),%rsi
xor    %edx,%edx
call   1030 <test_alias@plt>
lea    0xef7(%rip),%rdi
lea    0xefb(%rip),%rsi
xor    %edx,%edx
call   1030 <test_alias@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_aliasing>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rbx
lea    0xef8(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <test_alias@plt>
lea    0xefd(%rip),%rdi
lea    0xf13(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_alias@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <test_alias@plt>
lea    0xf08(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <test_alias@plt>
lea    0xf04(%rip),%rdi
lea    0xeff(%rip),%rsi
xor    %edx,%edx
call   1030 <test_alias@plt>
lea    0xef9(%rip),%rdi
lea    0xf0b(%rip),%rbx
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <test_alias@plt>
lea    0xf05(%rip),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <test_alias@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"application/x-wordperfect\00"
@.str.1 = [28 x i8] c"application/vnd.wordperfect\00"
@.str.2 = [29 x i8] c"application/x-gnome-app-info\00"
@.str.3 = [22 x i8] c"application/x-desktop\00"
@.str.4 = [13 x i8] c"audio/x-midi\00"
@.str.5 = [2 x i8] c"/\00"
@.str.6 = [8 x i8] c"vnd/vnd\00"
@.str.7 = [25 x i8] c"application/octet-stream\00"
@.str.8 = [11 x i8] c"text/plain\00"
@.str.9 = [7 x i8] c"text/*\00"
define void @test_aliasing() {
%1 = call i32 @test_alias(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = call i32 @test_alias(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 1)
%3 = call i32 @test_alias(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = call i32 @test_alias(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 0)
%5 = call i32 @test_alias(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 0)
%6 = call i32 @test_alias(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 0)
%7 = call i32 @test_alias(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"application/x-wordperfect\00"
@.str.1 = [28 x i8] c"application/vnd.wordperfect\00"
@.str.2 = [29 x i8] c"application/x-gnome-app-info\00"
@.str.3 = [22 x i8] c"application/x-desktop\00"
@.str.4 = [13 x i8] c"audio/x-midi\00"
@.str.5 = [2 x i8] c"/\00"
@.str.6 = [8 x i8] c"vnd/vnd\00"
@.str.7 = [25 x i8] c"application/octet-stream\00"
@.str.8 = [11 x i8] c"text/plain\00"
@.str.9 = [7 x i8] c"text/*\00"
define void @test_aliasing() {
%1 = tail call i32 @test_alias(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 @test_alias(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 1)
%3 = tail call i32 @test_alias(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = tail call i32 @test_alias(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 0)
%5 = tail call i32 @test_alias(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 0)
%6 = tail call i32 @test_alias(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 0)
%7 = tail call i32 @test_alias(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i32 0)
ret void
}