#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 const *, char const *);
scalar_t__ strcmp(char const *, char const *);
char *xdg_mime_get_generic_icon(char const *);
void test_one_icon(const char *mimetype, const char *expected) {
  const char *actual;
  actual = xdg_mime_get_generic_icon(mimetype);
  if (actual != expected && strcmp(actual, expected) != 0) {
    printf("Test Failed: icon of %s is %s, expected %s\n", mimetype, actual,
           expected);
  }
}


x86 assembly (clang, -O0):
<test_one_icon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xdg_mime_get_generic_icon@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     118a <test_one_icon+0x5a>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     118a <test_one_icon+0x5a>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_one_icon>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1030 <xdg_mime_get_generic_icon@plt>
cmp    %r15,%rax
je     1172 <test_one_icon+0x42>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1172 <test_one_icon+0x42>
lea    0xea1(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r15,%rcx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <printf@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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