#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 *);
int /*<<< orphan*/ test_aliasing();
int /*<<< orphan*/ test_glob_type();
int /*<<< orphan*/ test_icons();
int /*<<< orphan*/ test_matches();
int /*<<< orphan*/ test_subclassing();
char *xdg_mime_get_mime_type_for_file(char const *, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  const char *result;
  const char *file_name;
  int i;
  test_glob_type();
  test_aliasing();
  test_subclassing();
  test_matches();
  test_icons();
  for (i = 1; i < argc; i++) {
    file_name = argv[i];
    result = xdg_mime_get_mime_type_for_file(file_name, NULL);
    printf("File \"%s\" has a mime-type of %s\n", file_name, result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_glob_type@plt>
mov    $0x0,%al
call   1060 <test_aliasing@plt>
mov    $0x0,%al
call   1090 <test_subclassing@plt>
mov    $0x0,%al
call   1080 <test_matches@plt>
mov    $0x0,%al
call   1070 <test_icons@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ff <main+0x8f>
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <xdg_mime_get_mime_type_for_file@plt>
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe14(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b0 <main+0x40>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <test_glob_type@plt>
xor    %eax,%eax
call   1060 <test_aliasing@plt>
xor    %eax,%eax
call   1090 <test_subclassing@plt>
xor    %eax,%eax
call   1080 <test_matches@plt>
xor    %eax,%eax
call   1070 <test_icons@plt>
cmp    $0x2,%ebp
jl     11e5 <main+0x75>
mov    %ebp,%r12d
mov    $0x1,%ebx
lea    0xe4c(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r15,%rbx,8),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
call   1050 <xdg_mime_get_mime_type_for_file@plt>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    %rax,%rdx
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11c0 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"File \22%s\22 has a mime-type of %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (...) @test_glob_type()
%10 = call i32 (...) @test_aliasing()
%11 = call i32 (...) @test_subclassing()
%12 = call i32 (...) @test_matches()
%13 = call i32 (...) @test_icons()
store i32 1, i32* %8
br label %14
14: ; preds = %29, %2
%15 = load i32, i32* %8
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %32
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %8
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
store i8* %23, i8** %7
%24 = load i8*, i8** %7
%25 = call i8* @xdg_mime_get_mime_type_for_file(i8* %24, i32* null)
store i8* %25, i8** %6
%26 = load i8*, i8** %7
%27 = load i8*, i8** %6
%28 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %26, i8* %27)
br label %29
29: ; preds = %18
%30 = load i32, i32* %8
%31 = add nsw i32 %30, 1
store i32 %31, i32* %8
br label %14
32: ; preds = %14
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"File \22%s\22 has a mime-type of %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @test_glob_type()
%4 = tail call i32 (...) @test_aliasing()
%5 = tail call i32 (...) @test_subclassing()
%6 = tail call i32 (...) @test_matches()
%7 = tail call i32 (...) @test_icons()
%8 = icmp sgt i32 %0, 1
br i1 %8, label %9, label %19
9: ; preds = %2
%10 = zext i32 %0 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 1, %9 ], [ %17, %11 ]
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = tail call i8* @xdg_mime_get_mime_type_for_file(i8* %14, i32* null)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
%17 = add nuw nsw i64 %12, 1
%18 = icmp eq i64 %17, %10
br i1 %18, label %19, label %11
19: ; preds = %11, %2
ret i32 0
}