require '_h2ph_pre.ph';

unless(defined(&MCOUNT)) {
    sub MCOUNT () {	 &__asm__(" 		.section \".text\" \n		.align 2 \n		.globl _mcount \n		.type	_mcount,@function \n	_mcount: \n		lwz	11, 4(1) \n		mflr	0 \n		stw	0, 4(1) \n		stwu	1, -48(1) \n		stw	3, 8(1) \n		stw	4, 12(1) \n		stw	5, 16(1) \n		stw	6, 20(1) \n		stw	7, 24(1) \n		stw	8, 28(1) \n		stw	9, 32(1) \n		stw	10,36(1) \n		stw	11,40(1) \n		mr	4, 0 \n		mr 	3, 11 \n		bl __mcount \n		lwz	3, 8(1) \n		lwz	4, 12(1) \n		lwz	5, 16(1) \n		lwz	6, 20(1) \n		lwz	7, 24(1) \n		lwz	8, 28(1) \n		lwz	9, 32(1) \n		lwz	10,36(1) \n		lwz	11,40(1) \n		addi	1, 1, 48 \n		lwz	0, 4(1) \n		mtlr	11 \n		stw	11, 4(1) \n		mtctr	0 \n		bctr \n	.Lfe2: \n		.size _mcount, .Lfe2-_mcount \n	");;}
}
unless(defined(&_MCOUNT_DECL)) {
    sub _MCOUNT_DECL () {	 &static  &void  &__mcount;}
}
if(defined(&_KERNEL)) {
    eval 'sub MCOUNT_ENTER () { &__asm  &volatile("mfmsr %0" : "=r"( &s));  &if (( &s & ( &PSL_IR |  &PSL_DR)) != ( &PSL_IR |  &PSL_DR))  &return;  &s &= ~ &PSL_POW;  &__asm  &volatile("mtmsr %0" :: "r"( &s & ~ &PSL_EE));}' unless defined(&MCOUNT_ENTER);
    eval 'sub MCOUNT_EXIT () { &__asm  &volatile("mtmsr %0" :: "r"( &s));}' unless defined(&MCOUNT_EXIT);
}
1;
