#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 */
struct passwd_test_data {
  int dummy;
};

/* Variables and functions */
int __passwd_test_data_compare(
    struct passwd_test_data *, struct passwd_test_data *,
    int (*)(struct passwd *, struct passwd *, void *), void *);
int __passwd_2pass_test(struct passwd_test_data *td1,
                        struct passwd_test_data *td2,
                        int (*cmp_func)(struct passwd *, struct passwd *,
                                        void *),
                        void *cmp_mdata) {
  int rv;
  rv = __passwd_test_data_compare(td1, td2, cmp_func, cmp_mdata);
  return (rv);
}


x86 assembly (clang, -O0):
<__passwd_2pass_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <__passwd_test_data_compare@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__passwd_2pass_test>:
jmp    1030 <__passwd_test_data_compare@plt>

LLVM IR (-O0):
%struct.passwd_test_data = type { i32 }
%struct.passwd = type opaque
%struct.passwd.0 = type opaque
define i32 @__passwd_2pass_test(%struct.passwd_test_data* %0, %struct.passwd_test_data* %1, i32 (%struct.passwd*, %struct.passwd*, i8*)* %2, i8* %3) {
%5 = alloca %struct.passwd_test_data*
%6 = alloca %struct.passwd_test_data*
%7 = alloca i32 (%struct.passwd*, %struct.passwd*, i8*)*
%8 = alloca i8*
%9 = alloca i32
store %struct.passwd_test_data* %0, %struct.passwd_test_data** %5
store %struct.passwd_test_data* %1, %struct.passwd_test_data** %6
store i32 (%struct.passwd*, %struct.passwd*, i8*)* %2, i32 (%struct.passwd*, %struct.passwd*, i8*)** %7
store i8* %3, i8** %8
%10 = load %struct.passwd_test_data*, %struct.passwd_test_data** %5
%11 = load %struct.passwd_test_data*, %struct.passwd_test_data** %6
%12 = load i32 (%struct.passwd*, %struct.passwd*, i8*)*, i32 (%struct.passwd*, %struct.passwd*, i8*)** %7
%13 = bitcast i32 (%struct.passwd*, %struct.passwd*, i8*)* %12 to i32 (%struct.passwd.0*, %struct.passwd.0*, i8*)*
%14 = load i8*, i8** %8
%15 = call i32 @__passwd_test_data_compare(%struct.passwd_test_data* %10, %struct.passwd_test_data* %11, i32 (%struct.passwd.0*, %struct.passwd.0*, i8*)* %13, i8* %14)
store i32 %15, i32* %9
%16 = load i32, i32* %9
ret i32 %16
}

LLVM IR (-O2):
%struct.passwd_test_data = type { i32 }
%struct.passwd = type opaque
%struct.passwd.0 = type opaque
define i32 @__passwd_2pass_test(%struct.passwd_test_data* %0, %struct.passwd_test_data* %1, i32 (%struct.passwd*, %struct.passwd*, i8*)* %2, i8* %3) {
%5 = bitcast i32 (%struct.passwd*, %struct.passwd*, i8*)* %2 to i32 (%struct.passwd.0*, %struct.passwd.0*, i8*)*
%6 = tail call i32 @__passwd_test_data_compare(%struct.passwd_test_data* %0, %struct.passwd_test_data* %1, i32 (%struct.passwd.0*, %struct.passwd.0*, i8*)* %5, i8* %3)
ret i32 %6
}