#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_subclass(char *, char *, int);
void test_subclassing(void) {
  test_subclass("application/rtf", "text/plain", 1);
  test_subclass("message/news", "text/plain", 1);
  test_subclass("message/news", "message/*", 1);
  test_subclass("message/news", "text/*", 1);
  test_subclass("message/news", "application/octet-stream", 1);
  test_subclass("application/rtf", "application/octet-stream", 1);
  test_subclass("application/x-gnome-app-info", "text/plain", 1);
  test_subclass("image/x-djvu", "image/vnd.djvu", 1);
  test_subclass("image/vnd.djvu", "image/x-djvu", 1);
  test_subclass("image/vnd.djvu", "text/plain", 0);
  test_subclass("image/vnd.djvu", "text/*", 0);
  test_subclass("text/*", "text/plain", 1);
}


x86 assembly (clang, -O0):
<test_subclassing>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeee(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xee8(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xed0(%rip),%rdi
lea    0xed6(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xeb8(%rip),%rdi
lea    0xec8(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xea0(%rip),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xe6d(%rip),%rdi
lea    0xe9f(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xea7(%rip),%rdi
lea    0xe5e(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xeac(%rip),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xea1(%rip),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xe89(%rip),%rdi
lea    0xe16(%rip),%rsi
xor    %edx,%edx
call   1030 <test_subclass@plt>
lea    0xe74(%rip),%rdi
lea    0xe23(%rip),%rsi
xor    %edx,%edx
call   1030 <test_subclass@plt>
lea    0xe15(%rip),%rdi
lea    0xdec(%rip),%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_subclassing>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xee0(%rip),%r15
lea    0xee9(%rip),%r12
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xedd(%rip),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xed3(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xec9(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xeb9(%rip),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xeab(%rip),%rdi
mov    %r12,%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
lea    0xeb4(%rip),%r15
lea    0xeba(%rip),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1030 <test_subclass@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %edx,%edx
call   1030 <test_subclass@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <test_subclass@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <test_subclass@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"application/rtf\00"
@.str.1 = [11 x i8] c"text/plain\00"
@.str.2 = [13 x i8] c"message/news\00"
@.str.3 = [10 x i8] c"message/*\00"
@.str.4 = [7 x i8] c"text/*\00"
@.str.5 = [25 x i8] c"application/octet-stream\00"
@.str.6 = [29 x i8] c"application/x-gnome-app-info\00"
@.str.7 = [13 x i8] c"image/x-djvu\00"
@.str.8 = [15 x i8] c"image/vnd.djvu\00"
define void @test_subclassing() {
%1 = call i32 @test_subclass(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 1)
%4 = call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1)
%5 = call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 1)
%6 = call i32 @test_subclass(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 1)
%7 = call i32 @test_subclass(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 1)
%9 = call i32 @test_subclass(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 1)
%10 = call i32 @test_subclass(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0)
%11 = call i32 @test_subclass(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 0)
%12 = call i32 @test_subclass(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"application/rtf\00"
@.str.1 = [11 x i8] c"text/plain\00"
@.str.2 = [13 x i8] c"message/news\00"
@.str.3 = [10 x i8] c"message/*\00"
@.str.4 = [7 x i8] c"text/*\00"
@.str.5 = [25 x i8] c"application/octet-stream\00"
@.str.6 = [29 x i8] c"application/x-gnome-app-info\00"
@.str.7 = [13 x i8] c"image/x-djvu\00"
@.str.8 = [15 x i8] c"image/vnd.djvu\00"
define void @test_subclassing() {
%1 = tail call i32 @test_subclass(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%2 = tail call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 1)
%4 = tail call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 1)
%5 = tail call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 1)
%6 = tail call i32 @test_subclass(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 1)
%7 = tail call i32 @test_subclass(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
%8 = tail call i32 @test_subclass(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 1)
%9 = tail call i32 @test_subclass(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 1)
%10 = tail call i32 @test_subclass(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 0)
%11 = tail call i32 @test_subclass(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 0)
%12 = tail call i32 @test_subclass(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 1)
ret void
}