require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_MIPS_PROFILE_H_)) {
    eval 'sub _MIPS_PROFILE_H_ () {1;}' unless defined(&_MIPS_PROFILE_H_);
    eval 'sub _MCOUNT_DECL () { &static  &void  &___mcount;}' unless defined(&_MCOUNT_DECL);
    eval 'sub MCOUNT () { &__asm(".globl _mcount;" ".type _mcount,@function;" "_mcount:;" ".set noreorder;" ".set noat;" ".cpload $25;" ".cprestore 4;" "sw $4,8($29);" "sw $5,12($29);" "sw $6,16($29);" "sw $7,20($29);" "sw $1,0($29);" "sw $31,4($29);" "move $5,$31;" "jal ___mcount;" "move $4,$1;" "lw $4,8($29);" "lw $5,12($29);" "lw $6,16($29);" "lw $7,20($29);" "lw $31,4($29);" "lw $1,0($29);" "addu $29,$29,8;" "j $31;" "move $31,$1;" ".set reorder;" ".set at");;}' unless defined(&MCOUNT);
    if(defined(&_KERNEL)) {
	eval 'sub MCOUNT_ENTER () { &s =  &_splhigh();}' unless defined(&MCOUNT_ENTER);
	eval 'sub MCOUNT_EXIT () { &_splx( &s);}' unless defined(&MCOUNT_EXIT);
    }
}
1;
