#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*/ printf(char *, char const *, char *, char const *);
int xdg_mime_mime_type_subclass(char const *, char const *);
void test_subclass(const char *mime_a, const char *mime_b, int expected) {
  int actual;
  actual = xdg_mime_mime_type_subclass(mime_a, mime_b);
  if (actual != expected) {
    printf("Test Failed: %s is %s of %s\n", mime_a,
           actual ? "subclass" : "not subclass", mime_b);
  }
}


x86 assembly (clang, -O0):
<test_subclass>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <xdg_mime_mime_type_subclass@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     117b <test_subclass+0x5b>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%ecx
lea    0xec0(%rip),%rdx
lea    0xebd(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
mov    -0x10(%rbp),%rcx
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_subclass>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <xdg_mime_mime_type_subclass@plt>
cmp    %ebp,%eax
jne    113a <test_subclass+0x1a>
pop    %rbx
pop    %r14
pop    %rbp
ret
test   %eax,%eax
lea    0xeda(%rip),%rax
lea    0xed7(%rip),%rdx
cmove  %rax,%rdx
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Test Failed: %s is %s of %s\0A\00"
@.str.1 = [9 x i8] c"subclass\00"
@.str.2 = [13 x i8] c"not subclass\00"
define void @test_subclass(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @xdg_mime_mime_type_subclass(i8* %8, i8* %9)
store i32 %10, i32* %7
%11 = load i32, i32* %7
%12 = load i32, i32* %6
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %22
14: ; preds = %3
%15 = load i8*, i8** %4
%16 = load i32, i32* %7
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0)
%20 = load i8*, i8** %5
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %19, i8* %20)
br label %22
22: ; preds = %14, %3
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Test Failed: %s is %s of %s\0A\00"
@.str.1 = [9 x i8] c"subclass\00"
@.str.2 = [13 x i8] c"not subclass\00"
define void @test_subclass(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @xdg_mime_mime_type_subclass(i8* %0, i8* %1)
%5 = icmp eq i32 %4, %2
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = icmp eq i32 %4, 0
%8 = select i1 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %8, i8* %1)
br label %10
10: ; preds = %6, %3
ret void
}