require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_MCOUNT_DECL)) {
    sub _MCOUNT_DECL () {	 &void  &_mcount;}
}
if(defined(&PIC)) {
    eval 'sub __MCPLT () {"@PLT";}' unless defined(&__MCPLT);
} else {
    eval 'sub __MCPLT () {1;}' unless defined(&__MCPLT);
}
unless(defined(&MCOUNT)) {
    sub MCOUNT () {	 &__asm(" .globl __mcount		\n" "	.type __mcount,@function\n" "__mcount:			\n" "	pushq	%rbp		\n" "	movq	%rsp,%rbp	\n" "	subq	$56,%rsp	\n" "	movq	%rdi,0(%rsp)	\n" "	movq	%rsi,8(%rsp)	\n" "	movq	%rdx,16(%rsp)	\n" "	movq	%rcx,24(%rsp)	\n" "	movq	%r8,32(%rsp)	\n" "	movq	%r9,40(%rsp)	\n" "	movq	%rax,48(%rsp)	\n" "	movq	0(%rbp),%r11	\n" "	movq	8(%r11),%rdi	\n" "	movq	8(%rbp),%rsi	\n" "	call	_mcount" &__MCPLT"\n" "	movq	0(%rsp),%rdi	\n" "	movq	8(%rsp),%rsi	\n" "	movq	16(%rsp),%rdx	\n" "	movq	24(%rsp),%rcx	\n" "	movq	32(%rsp),%r8	\n" "	movq	40(%rsp),%r9	\n" "	movq	48(%rsp),%rax	\n" "	leave			\n" "	ret			\n" "	.size __mcount,.-__mcount");;}
}
if(defined(&_KERNEL)) {
    eval 'sub MCOUNT_ENTER () {"(assembly code)";}' unless defined(&MCOUNT_ENTER);
    eval 'sub MCOUNT_EXIT () {"(assembly code)";}' unless defined(&MCOUNT_EXIT);
}
1;
