#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 */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  scalar_t__ fts_info;
  int /*<<< orphan*/ fts_name;
};
typedef TYPE_1__ FTSENT;

/* Variables and functions */
scalar_t__ FTS_F;
int strcmp(int /*<<< orphan*/, int /*<<< orphan*/);
int fts_sort(const FTSENT *const *a, const FTSENT *const *b) {
  if ((*a)->fts_info != FTS_F)
    return (0);
  if ((*a)->fts_info != FTS_F)
    return (0);
  return (strcmp((*a)->fts_name, (*b)->fts_name));
}


x86 assembly (clang, -O0):
<fts_sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    0x2eb7(%rip),%rcx
cmp    (%rcx),%rax
je     1146 <fts_sort+0x36>
movl   $0x0,-0x4(%rbp)
jmp    1188 <fts_sort+0x78>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rax
mov    0x2e91(%rip),%rcx
cmp    (%rcx),%rax
je     116c <fts_sort+0x5c>
movl   $0x0,-0x4(%rbp)
jmp    1188 <fts_sort+0x78>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%esi
call   1030 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_sort>:
mov    (%rdi),%rax
mov    (%rax),%rcx
mov    0x2ecb(%rip),%rdx
cmp    (%rdx),%rcx
jne    1130 <fts_sort+0x20>
mov    0x8(%rax),%edi
mov    (%rsi),%rax
mov    0x8(%rax),%esi
jmp    1030 <strcmp@plt>
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { i64, i32 }
@FTS_F = global i64 0
define i32 @fts_sort(%struct.TYPE_4__** %0, %struct.TYPE_4__** %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_4__**
%5 = alloca %struct.TYPE_4__**
store %struct.TYPE_4__** %0, %struct.TYPE_4__*** %4
store %struct.TYPE_4__** %1, %struct.TYPE_4__*** %5
%6 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%7 = load %struct.TYPE_4__*, %struct.TYPE_4__** %6
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = load i64, i64* @FTS_F
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 0, i32* %3
br label %31
13: ; preds = %2
%14 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%15 = load %struct.TYPE_4__*, %struct.TYPE_4__** %14
%16 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %15, i32 0, i32 0
%17 = load i64, i64* %16
%18 = load i64, i64* @FTS_F
%19 = icmp ne i64 %17, %18
br i1 %19, label %20, label %21
20: ; preds = %13
store i32 0, i32* %3
br label %31
21: ; preds = %13
%22 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %4
%23 = load %struct.TYPE_4__*, %struct.TYPE_4__** %22
%24 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %23, i32 0, i32 1
%25 = load i32, i32* %24
%26 = load %struct.TYPE_4__**, %struct.TYPE_4__*** %5
%27 = load %struct.TYPE_4__*, %struct.TYPE_4__** %26
%28 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %27, i32 0, i32 1
%29 = load i32, i32* %28
%30 = call i32 @strcmp(i32 %25, i32 %29)
store i32 %30, i32* %3
br label %31
31: ; preds = %21, %20, %12
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64, i32 }
@FTS_F = global i64 0
define i32 @fts_sort(%struct.TYPE_4__** nocapture %0, %struct.TYPE_4__** nocapture %1) {
%3 = load %struct.TYPE_4__*, %struct.TYPE_4__** %0
%4 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 0
%5 = load i64, i64* %4
%6 = load i64, i64* @FTS_F
%7 = icmp eq i64 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %3, i64 0, i32 1
%10 = load i32, i32* %9
%11 = load %struct.TYPE_4__*, %struct.TYPE_4__** %1
%12 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %11, i64 0, i32 1
%13 = load i32, i32* %12
%14 = tail call i32 @strcmp(i32 %10, i32 %13)
br label %15
15: ; preds = %2, %8
%16 = phi i32 [ %14, %8 ], [ 0, %2 ]
ret i32 %16
}