///////////////////////////////////////////////////////////////////////////////
//                                                                            /
// IAR 8051 C/C++ Compiler V7.30B/W32                   12/Sep/2010  21:57:29 /
// Copyright 2004-2007 IAR Systems. All rights reserved.                      /
//                                                                            /
//    Core               =  plain                                             /
//    Code model         =  banked                                            /
//    Data model         =  large                                             /
//    Calling convention =  xdata reentrant                                   /
//    Constant location  =  data                                              /
//    Dptr setup         =  1,16                                              /
//    Source file        =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Compon /
//                          ents\mac\low_level\srf03\mac_backoff_timer.c      /
//    Command line       =  -f "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\Tools\CC2430DB\f8wRouter. /
//                          cfg" (-DCPU32MHZ -DFORCE_MAC_NEAR                 /
//                          -DROOT=__near_func -DMAC_CFG_APP_PENDING_QUEUE=TR /
//                          UE -DRTR_NWK -DBLINK_LEDS "-DCONST=const __code"  /
//                          -DGENERIC=__generic) -f "C:\Texas Instruments     /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\Tools\CC2430DB\f8wConfig. /
//                          cfg" (-DSECURE=1 -DDEFAULT_CHANLIST=0x04000000    /
//                          -DZDAPP_CONFIG_PAN_ID=0x00FF                      /
//                          -DNWK_START_DELAY=100 -DEXTENDED_JOINING_RANDOM_M /
//                          ASK=0x007F -DBEACON_REQUEST_DELAY=100             /
//                          -DBEACON_REQ_DELAY_MASK=0x00FF                    /
//                          -DROUTE_EXPIRY_TIME=30 -DAPSC_ACK_WAIT_DURATION_P /
//                          OLLED=3000 -DNWK_INDIRECT_MSG_TIMEOUT=7           /
//                          -DMAX_RREQ_ENTRIES=10 -DAPSC_MAX_FRAME_RETRIES=3  /
//                          -DNWK_MAX_DATA_RETRIES=2                          /
//                          -DMAX_POLL_FAILURE_RETRIES=2 -DMAX_BCAST=9        /
//                          -DAPS_MAX_GROUPS=16 -DMAX_RTG_ENTRIES=20          /
//                          -DNWK_MAX_BINDING_ENTRIES=10                      /
//                          -DMAX_BINDING_CLUSTER_IDS=5                       /
//                          "-DDEFAULT_KEY={0x02, 0x03, 0x05, 0x07, 0x09,     /
//                          0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08,   /
//                          0x0A, 0x0C, 0x0D}" -DRFD_RCVC_ALWAYS_ON=FALSE     /
//                          -DPOLL_RATE=1000 -DQUEUED_POLL_RATE=100           /
//                          -DRESPONSE_POLL_RATE=100) -DREJOIN_POLL_RATE=440  /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Compo /
//                          nents\mac\low_level\srf03\mac_backoff_timer.c"    /
//                          -D CC2430EB -D LOCATION_REFNODE -D xNV_RESTORE    /
//                          -D ZTOOL_P1 -D MT_TASK -D POWER_SAVING -D         /
//                          HAL_UART_BIG_TX_BUF=1 -D                          /
//                          SPI_MGR_DEFAULT_MAX_TX_BUFF=1024 -D               /
//                          SPI_MGR_DEFAULT_OVERFLOW=1 -lC "C:\Texas          /
//                          Instruments 33\ZStack-1.4.3-1.2.1\Projects\zstack /
//                          \Project\Location\CC2430DB\RefNode\List\" -lA     /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\RefNode\List /
//                          \" --diag_suppress Pe001,Pa010 --diag_remark      /
//                          pe550 -o "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\RefNode\Obj\" -e                   /
//                          --require_prototypes -z9 --no_code_motion         /
//                          --debug --core=plain --dptr=16,1                  /
//                          --data_model=large --code_model=banked            /
//                          --calling_convention=xdata_reentrant              /
//                          --place_constants=data --nr_virtual_regs 8 -I     /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\" -I         /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\..\SOURCE\"  /
//                          -I "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\ZMAIN\TI2430DB\" -I       /
//                          "C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Proje /
//                          cts\zstack\Project\Location\CC2430DB\..\..\..\..\ /
//                          ..\COMPONENTS\MT\" -I "C:\Texas Instruments       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\HAL\INCL /
//                          UDE\" -I "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\HAL\TARG /
//                          ET\CC2430BB\" -I "C:\Texas Instruments            /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\MCU /
//                          \CCSOC\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\OSAL\INC /
//                          LUDE\" -I "C:\Texas Instruments                   /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\AF /
//                          \" -I "C:\Texas Instruments                       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\NW /
//                          K\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SE /
//                          C\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\SY /
//                          S\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\STACK\ZD /
//                          O\" -I "C:\Texas Instruments                      /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\F8W /
//                          \" -I "C:\Texas Instruments                       /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\ZMAC\"   /
//                          -I "C:\Texas Instruments                          /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\SERVICES /
//                          \SADDR\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\SERVICES /
//                          \SDATA\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\INCL /
//                          UDE\" -I "C:\Texas Instruments                    /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\HIGH /
//                          _LEVEL\" -I "C:\Texas Instruments                 /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_ /
//                          LEVEL\SRF03\" -I "C:\Texas Instruments            /
//                          33\ZStack-1.4.3-1.2.1\Projects\zstack\Project\Loc /
//                          ation\CC2430DB\..\..\..\..\..\COMPONENTS\MAC\LOW_ /
//                          LEVEL\SRF03\SINGLE_CHIP\" -I "C:\Program          /
//                          Files\IAR Systems\Embedded Workbench 4.0          /
//                          Evaluation version\8051\INC\" -I "C:\Program      /
//                          Files\IAR Systems\Embedded Workbench 4.0          /
//                          Evaluation version\8051\INC\CLIB\"                /
//    List file          =  C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Projec /
//                          ts\zstack\Project\Location\CC2430DB\RefNode\List\ /
//                          mac_backoff_timer.s51                             /
//                                                                            /
//                                                                            /
///////////////////////////////////////////////////////////////////////////////

        NAME mac_backoff_timer

        RTMODEL "__calling_convention", "xdata_reentrant"
        RTMODEL "__code_model", "banked"
        RTMODEL "__core", "plain"
        RTMODEL "__data_model", "large"
        RTMODEL "__dptr_size", "16"
        RTMODEL "__extended_stack", "disabled"
        RTMODEL "__location_for_constants", "data"
        RTMODEL "__number_of_dptrs", "1"
        RTMODEL "__rt_version", "1"

        RSEG DOVERLAY:DATA:NOROOT(0)
        RSEG IOVERLAY:IDATA:NOROOT(0)
        RSEG ISTACK:IDATA:NOROOT(0)
        RSEG PSTACK:XDATA:NOROOT(0)
        RSEG XSTACK:XDATA:NOROOT(0)

        EXTERN ??macBackoffTimerInit?relay
        EXTERN ??macBackoffTimerSetRollover?relay
        EXTERN ?ALLOC_XSTACK8
        EXTERN ?BANKED_ENTER_XDATA
        EXTERN ?BANKED_LEAVE_XDATA
        EXTERN ?BDISPATCH
        EXTERN ?BRET
        EXTERN ?DEALLOC_XSTACK8
        EXTERN ?L_ADD_TO_X
        EXTERN ?L_ADD_X
        EXTERN ?L_AND_X
        EXTERN ?L_EQ_X
        EXTERN ?L_MOV_TO_X
        EXTERN ?L_MOV_X
        EXTERN ?L_SUB
        EXTERN ?L_SUB_FROM_X
        EXTERN ?L_SUB_X
        EXTERN ?SL_GT_X
        EXTERN ?UL_GT
        EXTERN ?UL_SHR
        EXTERN ?V0
        EXTERN ?XSP
        EXTERN __INIT_XDATA_I
        EXTERN __INIT_XDATA_Z

        PUBLIC ??macBackoffTimerCancelTrigger?relay
        FUNCTION ??macBackoffTimerCancelTrigger?relay,0203H
        PUBLIC ??macBackoffTimerCapture?relay
        FUNCTION ??macBackoffTimerCapture?relay,0203H
        PUBLIC ??macBackoffTimerCompareIsr?relay
        FUNCTION ??macBackoffTimerCompareIsr?relay,0203H
        PUBLIC ??macBackoffTimerCount?relay
        FUNCTION ??macBackoffTimerCount?relay,0203H
        PUBLIC ??macBackoffTimerGetTrigger?relay
        FUNCTION ??macBackoffTimerGetTrigger?relay,0203H
        PUBLIC ??macBackoffTimerInit?relay
        FUNCTION ??macBackoffTimerInit?relay,0203H
        PUBLIC ??macBackoffTimerRealign?relay
        FUNCTION ??macBackoffTimerRealign?relay,0203H
        PUBLIC ??macBackoffTimerReset?relay
        FUNCTION ??macBackoffTimerReset?relay,0203H
        PUBLIC ??macBackoffTimerSetCount?relay
        FUNCTION ??macBackoffTimerSetCount?relay,0203H
        PUBLIC ??macBackoffTimerSetRollover?relay
        FUNCTION ??macBackoffTimerSetRollover?relay,0203H
        PUBLIC ??macBackoffTimerSetTrigger?relay
        FUNCTION ??macBackoffTimerSetTrigger?relay,0203H
        PUBWEAK T2CNF
        PUBWEAK T2THD
        PUBWEAK T2TLD
        PUBWEAK _A_IEN0
        PUBWEAK __Constant_0
        PUBWEAK __Constant_80000000
        PUBWEAK __Constant_c0000
        PUBWEAK __Constant_ffffffff
        PUBLIC macBackoffTimerCancelTrigger
        FUNCTION macBackoffTimerCancelTrigger,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC macBackoffTimerCapture
        FUNCTION macBackoffTimerCapture,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        PUBLIC macBackoffTimerCompareIsr
        FUNCTION macBackoffTimerCompareIsr,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC macBackoffTimerCount
        FUNCTION macBackoffTimerCount,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        PUBLIC macBackoffTimerGetTrigger
        FUNCTION macBackoffTimerGetTrigger,0203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        PUBLIC macBackoffTimerInit
        FUNCTION macBackoffTimerInit,021203H
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 12, STACK
        PUBLIC macBackoffTimerRealign
        FUNCTION macBackoffTimerRealign,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME XSTACK, 20, STACK
        PUBLIC macBackoffTimerReset
        FUNCTION macBackoffTimerReset,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME ISTACK, 2, STACK
        PUBLIC macBackoffTimerSetCount
        FUNCTION macBackoffTimerSetCount,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        PUBLIC macBackoffTimerSetRollover
        FUNCTION macBackoffTimerSetRollover,021203H
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        LOCFRAME XSTACK, 16, STACK
        PUBLIC macBackoffTimerSetTrigger
        FUNCTION macBackoffTimerSetTrigger,021203H
        ARGFRAME XSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        
        CFI Names cfiNames0
        CFI StackFrame CFA_SP SP DATA
        CFI StackFrame CFA_PSP16 PSP16 XDATA
        CFI StackFrame CFA_XSP16 XSP16 XDATA
        CFI StaticOverlayFrame CFA_IOVERLAY IOVERLAY
        CFI StaticOverlayFrame CFA_DOVERLAY DOVERLAY
        CFI Resource `PSW.CY`:1, `B.BR0`:1, `B.BR1`:1, `B.BR2`:1, `B.BR3`:1
        CFI Resource `B.BR4`:1, `B.BR5`:1, `B.BR6`:1, `B.BR7`:1, `VB.BR8`:1
        CFI Resource `VB.BR9`:1, `VB.BR10`:1, `VB.BR11`:1, `VB.BR12`:1
        CFI Resource `VB.BR13`:1, `VB.BR14`:1, `VB.BR15`:1, VB:8, B:8, A:8
        CFI Resource PSW:8, DPL0:8, DPH0:8, R0:8, R1:8, R2:8, R3:8, R4:8, R5:8
        CFI Resource R6:8, R7:8, V0:8, V1:8, V2:8, V3:8, V4:8, V5:8, V6:8, V7:8
        CFI Resource SP:8, PSPH:8, PSPL:8, PSP16:16, XSPH:8, XSPL:8, XSP16:16
        CFI VirtualResource ?RET:24
        CFI Resource ?BRET_EXT:8
        CFI VirtualResource ?RET_HIGH:8, ?RET_LOW:8
        CFI ResourceParts PSP16 PSPH, PSPL
        CFI ResourceParts XSP16 XSPH, XSPL
        CFI ResourceParts ?RET ?BRET_EXT, ?RET_HIGH, ?RET_LOW
        CFI EndNames cfiNames0
        
        CFI Common cfiCommon0 Using cfiNames0
        CFI CodeAlign 1
        CFI DataAlign -1
        CFI ReturnAddress ?RET CODE
        CFI CFA_DOVERLAY Used
        CFI CFA_IOVERLAY Used
        CFI CFA_SP SP+-3
        CFI CFA_PSP16 PSP16+0
        CFI CFA_XSP16 XSP16+0
        CFI `PSW.CY` SameValue
        CFI `B.BR0` SameValue
        CFI `B.BR1` SameValue
        CFI `B.BR2` SameValue
        CFI `B.BR3` SameValue
        CFI `B.BR4` SameValue
        CFI `B.BR5` SameValue
        CFI `B.BR6` SameValue
        CFI `B.BR7` SameValue
        CFI `VB.BR8` SameValue
        CFI `VB.BR9` SameValue
        CFI `VB.BR10` SameValue
        CFI `VB.BR11` SameValue
        CFI `VB.BR12` SameValue
        CFI `VB.BR13` SameValue
        CFI `VB.BR14` SameValue
        CFI `VB.BR15` SameValue
        CFI VB SameValue
        CFI B Undefined
        CFI A Undefined
        CFI PSW SameValue
        CFI DPL0 SameValue
        CFI DPH0 SameValue
        CFI R0 Undefined
        CFI R1 Undefined
        CFI R2 Undefined
        CFI R3 Undefined
        CFI R4 Undefined
        CFI R5 Undefined
        CFI R6 SameValue
        CFI R7 SameValue
        CFI V0 SameValue
        CFI V1 SameValue
        CFI V2 SameValue
        CFI V3 SameValue
        CFI V4 SameValue
        CFI V5 SameValue
        CFI V6 SameValue
        CFI V7 SameValue
        CFI PSPH Undefined
        CFI PSPL Undefined
        CFI XSPH Undefined
        CFI XSPL Undefined
        CFI ?RET Concat
        CFI ?BRET_EXT Frame(CFA_SP, 3)
        CFI ?RET_HIGH Frame(CFA_SP, 2)
        CFI ?RET_LOW Frame(CFA_SP, 1)
        CFI EndCommon cfiCommon0
        
        
        CFI Common cfiCommon1 Using cfiNames0
        CFI CodeAlign 1
        CFI DataAlign -1
        CFI ReturnAddress ?RET CODE
        CFI CFA_DOVERLAY Used
        CFI CFA_IOVERLAY Used
        CFI CFA_SP SP+-2
        CFI CFA_PSP16 PSP16+0
        CFI CFA_XSP16 XSP16+0
        CFI `PSW.CY` SameValue
        CFI `B.BR0` SameValue
        CFI `B.BR1` SameValue
        CFI `B.BR2` SameValue
        CFI `B.BR3` SameValue
        CFI `B.BR4` SameValue
        CFI `B.BR5` SameValue
        CFI `B.BR6` SameValue
        CFI `B.BR7` SameValue
        CFI `VB.BR8` SameValue
        CFI `VB.BR9` SameValue
        CFI `VB.BR10` SameValue
        CFI `VB.BR11` SameValue
        CFI `VB.BR12` SameValue
        CFI `VB.BR13` SameValue
        CFI `VB.BR14` SameValue
        CFI `VB.BR15` SameValue
        CFI VB SameValue
        CFI B SameValue
        CFI A SameValue
        CFI PSW SameValue
        CFI DPL0 SameValue
        CFI DPH0 SameValue
        CFI R0 SameValue
        CFI R1 SameValue
        CFI R2 SameValue
        CFI R3 SameValue
        CFI R4 SameValue
        CFI R5 SameValue
        CFI R6 SameValue
        CFI R7 SameValue
        CFI V0 SameValue
        CFI V1 SameValue
        CFI V2 SameValue
        CFI V3 SameValue
        CFI V4 SameValue
        CFI V5 SameValue
        CFI V6 SameValue
        CFI V7 SameValue
        CFI PSPH Undefined
        CFI PSPL Undefined
        CFI XSPH Undefined
        CFI XSPL Undefined
        CFI ?RET Concat
        CFI ?BRET_EXT SameValue
        CFI ?RET_HIGH Frame(CFA_SP, 2)
        CFI ?RET_LOW Frame(CFA_SP, 1)
        CFI EndCommon cfiCommon1
        
macMcuOverflowSetCount SYMBOL "macMcuOverflowSetCount"
macMcuOrT2PEROF2    SYMBOL "macMcuOrT2PEROF2"
macMcuAndT2PEROF2   SYMBOL "macMcuAndT2PEROF2"
macMcuOverflowCount SYMBOL "macMcuOverflowCount"
halAssertHandler    SYMBOL "halAssertHandler"
macMcuOverflowSetCompare SYMBOL "macMcuOverflowSetCompare"
macMcuOverflowCapture SYMBOL "macMcuOverflowCapture"
macBackoffTimerRolloverCallback SYMBOL "macBackoffTimerRolloverCallback"
macBackoffTimerTriggerCallback SYMBOL "macBackoffTimerTriggerCallback"
??halAssertHandler?relay SYMBOL "?relay", halAssertHandler
??macBackoffTimerRolloverCallback?relay SYMBOL "?relay", macBackoffTimerRolloverCallback
??macBackoffTimerTriggerCallback?relay SYMBOL "?relay", macBackoffTimerTriggerCallback
??macMcuAndT2PEROF2?relay SYMBOL "?relay", macMcuAndT2PEROF2
??macMcuOrT2PEROF2?relay SYMBOL "?relay", macMcuOrT2PEROF2
??macMcuOverflowCapture?relay SYMBOL "?relay", macMcuOverflowCapture
??macMcuOverflowCount?relay SYMBOL "?relay", macMcuOverflowCount
??macMcuOverflowSetCompare?relay SYMBOL "?relay", macMcuOverflowSetCompare
??macMcuOverflowSetCount?relay SYMBOL "?relay", macMcuOverflowSetCount
macBackoffTimerCancelTrigger SYMBOL "macBackoffTimerCancelTrigger"
??macBackoffTimerCancelTrigger?relay SYMBOL "?relay", macBackoffTimerCancelTrigger
macBackoffTimerCapture SYMBOL "macBackoffTimerCapture"
??macBackoffTimerCapture?relay SYMBOL "?relay", macBackoffTimerCapture
macBackoffTimerCompareIsr SYMBOL "macBackoffTimerCompareIsr"
??macBackoffTimerCompareIsr?relay SYMBOL "?relay", macBackoffTimerCompareIsr
macBackoffTimerCount SYMBOL "macBackoffTimerCount"
??macBackoffTimerCount?relay SYMBOL "?relay", macBackoffTimerCount
macBackoffTimerGetTrigger SYMBOL "macBackoffTimerGetTrigger"
??macBackoffTimerGetTrigger?relay SYMBOL "?relay", macBackoffTimerGetTrigger
macBackoffTimerInit SYMBOL "macBackoffTimerInit"
??macBackoffTimerInit?relay SYMBOL "?relay", macBackoffTimerInit
macBackoffTimerRealign SYMBOL "macBackoffTimerRealign"
??macBackoffTimerRealign?relay SYMBOL "?relay", macBackoffTimerRealign
macBackoffTimerReset SYMBOL "macBackoffTimerReset"
??macBackoffTimerReset?relay SYMBOL "?relay", macBackoffTimerReset
macBackoffTimerSetCount SYMBOL "macBackoffTimerSetCount"
??macBackoffTimerSetCount?relay SYMBOL "?relay", macBackoffTimerSetCount
macBackoffTimerSetRollover SYMBOL "macBackoffTimerSetRollover"
??macBackoffTimerSetRollover?relay SYMBOL "?relay", macBackoffTimerSetRollover
macBackoffTimerSetTrigger SYMBOL "macBackoffTimerSetTrigger"
??macBackoffTimerSetTrigger?relay SYMBOL "?relay", macBackoffTimerSetTrigger

        EXTERN macMcuOverflowSetCount
        FUNCTION macMcuOverflowSetCount,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macMcuOrT2PEROF2
        FUNCTION macMcuOrT2PEROF2,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macMcuAndT2PEROF2
        FUNCTION macMcuAndT2PEROF2,0202H
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macMcuOverflowCount
        FUNCTION macMcuOverflowCount,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN halAssertHandler
        FUNCTION halAssertHandler,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macMcuOverflowSetCompare
        FUNCTION macMcuOverflowSetCompare,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macMcuOverflowCapture
        FUNCTION macMcuOverflowCapture,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macBackoffTimerRolloverCallback
        FUNCTION macBackoffTimerRolloverCallback,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN macBackoffTimerTriggerCallback
        FUNCTION macBackoffTimerTriggerCallback,0202H
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        EXTERN ??halAssertHandler?relay
        FUNCTION ??halAssertHandler?relay,00H
        EXTERN ??macBackoffTimerRolloverCallback?relay
        FUNCTION ??macBackoffTimerRolloverCallback?relay,00H
        EXTERN ??macBackoffTimerTriggerCallback?relay
        FUNCTION ??macBackoffTimerTriggerCallback?relay,00H
        EXTERN ??macMcuAndT2PEROF2?relay
        FUNCTION ??macMcuAndT2PEROF2?relay,00H
        EXTERN ??macMcuOrT2PEROF2?relay
        FUNCTION ??macMcuOrT2PEROF2?relay,00H
        EXTERN ??macMcuOverflowCapture?relay
        FUNCTION ??macMcuOverflowCapture?relay,00H
        EXTERN ??macMcuOverflowCount?relay
        FUNCTION ??macMcuOverflowCount?relay,00H
        EXTERN ??macMcuOverflowSetCompare?relay
        FUNCTION ??macMcuOverflowSetCompare?relay,00H
        EXTERN ??macMcuOverflowSetCount?relay
        FUNCTION ??macMcuOverflowSetCount?relay,00H
        EXTERN macTxActive

// C:\Texas Instruments 33\ZStack-1.4.3-1.2.1\Components\mac\low_level\srf03\mac_backoff_timer.c
//    1 /**************************************************************************************************
//    2   Filename:       mac_backoff_timer.c
//    3   Revised:        $Date: 2007-10-29 22:38:47 -0700 (Mon, 29 Oct 2007) $
//    4   Revision:       $Revision: 15812 $
//    5 
//    6   Description:    Describe the purpose and contents of the file.
//    7 
//    8 
//    9   Copyright 2006-2007 Texas Instruments Incorporated. All rights reserved.
//   10 
//   11   IMPORTANT: Your use of this Software is limited to those specific rights
//   12   granted under the terms of a software license agreement between the user
//   13   who downloaded the software, his/her employer (which must be your employer)
//   14   and Texas Instruments Incorporated (the "License").  You may not use this
//   15   Software unless you agree to abide by the terms of the License. The License
//   16   limits your use, and you acknowledge, that the Software may not be modified,
//   17   copied or distributed unless embedded on a Texas Instruments microcontroller
//   18   or used solely and exclusively in conjunction with a Texas Instruments radio
//   19   frequency transceiver, which is integrated into your product.  Other than for
//   20   the foregoing purpose, you may not use, reproduce, copy, prepare derivative
//   21   works of, modify, distribute, perform, display or sell this Software and/or
//   22   its documentation for any purpose.
//   23 
//   24   YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
//   25   PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, 
//   26   INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, 
//   27   NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
//   28   TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
//   29   NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
//   30   LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
//   31   INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
//   32   OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
//   33   OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
//   34   (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
//   35 
//   36   Should you have any questions regarding your right to use this Software,
//   37   contact Texas Instruments Incorporated at www.TI.com. 
//   38 **************************************************************************************************/
//   39 
//   40 /* ------------------------------------------------------------------------------------------------
//   41  *                                           Includes
//   42  * ------------------------------------------------------------------------------------------------
//   43  */
//   44 
//   45 /* hal */
//   46 #include "hal_types.h"
//   47 #include "hal_mcu.h"

        ASEGN SFR_AN:DATA:NOROOT,0a6H
// unsigned char volatile __sfr T2TLD
T2TLD:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0a7H
// unsigned char volatile __sfr T2THD
T2THD:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0a8H
// union <unnamed> volatile __sfr _A_IEN0
_A_IEN0:
        DS 1

        ASEGN SFR_AN:DATA:NOROOT,0c3H
// unsigned char volatile __sfr T2CNF
T2CNF:
        DS 1
//   48 
//   49 /* high-level specific */
//   50 #include "mac_spec.h"
//   51 
//   52 /* exported low-level */
//   53 #include "mac_low_level.h"
//   54 
//   55 /* low-level specific */
//   56 #include "mac_backoff_timer.h"
//   57 #include "mac_tx.h"
//   58 
//   59 /* target specific */
//   60 #include "mac_radio_defs.h"
//   61 
//   62 /* debug */
//   63 #include "mac_assert.h"
//   64 
//   65 
//   66 /* ------------------------------------------------------------------------------------------------
//   67  *                                            Defines
//   68  * ------------------------------------------------------------------------------------------------
//   69  */
//   70 #define COMPARE_STATE_ROLLOVER_BV                 BV(0)
//   71 #define COMPARE_STATE_TRIGGER_BV                  BV(1)
//   72 #define COMPARE_STATE_ARM_BV                      BV(2)
//   73 
//   74 #define COMPARE_STATE_TRIGGER                     COMPARE_STATE_TRIGGER_BV
//   75 #define COMPARE_STATE_ROLLOVER                    COMPARE_STATE_ROLLOVER_BV
//   76 #define COMPARE_STATE_ROLLOVER_AND_TRIGGER        (COMPARE_STATE_ROLLOVER_BV | COMPARE_STATE_TRIGGER_BV)
//   77 #define COMPARE_STATE_ROLLOVER_AND_ARM_TRIGGER    (COMPARE_STATE_ROLLOVER_BV | COMPARE_STATE_ARM_BV)
//   78 
//   79 
//   80 /*
//   81  *  The datasheet mentions a small delay on both receive and transmit side of approximately
//   82  *  two microseconds.  The precise characterization is given below.
//   83  *  (This data is not given in rev 1.03 datasheet)
//   84  */
//   85 #define RX_TX_PROP_DELAY_AVG_USEC         ((MAC_RADIO_RX_TX_PROP_DELAY_MIN_USEC + MAC_RADIO_RX_TX_PROP_DELAY_MAX_USEC) / 2)
//   86 #define RX_TX_PROP_DELAY_AVG_TIMER_TICKS  ((uint16)(MAC_RADIO_TIMER_TICKS_PER_USEC() * RX_TX_PROP_DELAY_AVG_USEC + 0.5))
//   87 
//   88 /*
//   89  *  For slotted receives, the SFD signal is expected to occur on a specifc symbol boundary.
//   90  *  This does *not* correspond to the backoff boundary.  The SFD signal occurs at an
//   91  *  offset from the backoff boundary.  This is done for efficiency of related algorithms.
//   92  *
//   93  *  Once transmit is strobed there is a fixed delay until the SFD signal occurs.  The frame
//   94  *  does not start over-the-air transmit until after an internal radio delay of 12 symbols.
//   95  *  Once transmitting over-the-air, the preamble is sent (8 symbols) followed by the
//   96  *  SFD field (2 symbols). After the SFD field completes, the SFD signal occurs.  This
//   97  *  adds up to a total of 22 symbols from strobe to SFD signal.
//   98  *
//   99  *  Since 22 symbols spans more than a backoff (20 symbols) the modulus operation is used
//  100  *  to find the symbol offset which is 2 symbols.
//  101  *
//  102  *  This math is derived formally via the pre-processor.
//  103  */
//  104 #define SYMBOLS_FROM_STROBE_TO_PREAMBLE   12 /* from datasheet */
//  105 #define SYMBOLS_FROM_PREAMBLE_TO_SFD      (MAC_SPEC_PREAMBLE_FIELD_LENGTH + MAC_SPEC_SFD_FIELD_LENGTH)
//  106 #define SYMBOLS_FROM_STROBE_TO_SFD        (SYMBOLS_FROM_STROBE_TO_PREAMBLE + SYMBOLS_FROM_PREAMBLE_TO_SFD)
//  107 #define SYMBOLS_EXPECTED_AT_SFD           (SYMBOLS_FROM_STROBE_TO_SFD % MAC_A_UNIT_BACKOFF_PERIOD)
//  108 
//  109 /* after all that formal math, make sure the result is as expected */
//  110 #if (SYMBOLS_EXPECTED_AT_SFD != 2)
//  111 #error "ERROR! Internal problem with pre-processor math of slotted alignment."
//  112 #endif
//  113 
//  114 
//  115 /*
//  116  *  The expected SFD signal occurs at the symbol offset *plus* a small internal propagation delay
//  117  *  internal to the radio.  This delay is given as the sum of a receive side delay and a transmit
//  118  *  side delay.  When this delay is subtracted from the internal timer, the internal time base
//  119  *  actually becomes the actual receive time *minus* the transmit delay.  This works out though.
//  120  *  The transmit logic does *not* take into account this delay.  Since the timer is skewed by the
//  121  *  transmit delay already, the transmits go out precisely on time.
//  122  */
//  123 #define TIMER_TICKS_EXPECTED_AT_SFD   ((SYMBOLS_EXPECTED_AT_SFD * MAC_RADIO_TIMER_TICKS_PER_SYMBOL()) \ 
//  124                                           + RX_TX_PROP_DELAY_AVG_TIMER_TICKS)
//  125 
//  126 
//  127 /* ------------------------------------------------------------------------------------------------
//  128  *                                         Local Variables
//  129  * ------------------------------------------------------------------------------------------------
//  130  */

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  131 static uint32 backoffTimerRollover;
backoffTimerRollover:
        DS 4
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  132 static uint32 backoffTimerTrigger;
backoffTimerTrigger:
        DS 4
        REQUIRE __INIT_XDATA_Z

        RSEG XDATA_Z:XDATA:NOROOT(0)
//  133 static uint8 compareState;
compareState:
        DS 1
        REQUIRE __INIT_XDATA_Z
//  134 
//  135 
//  136 /**************************************************************************************************
//  137  * @fn          macBackoffTimerInit
//  138  *
//  139  * @brief       Intializes backoff timer.
//  140  *
//  141  * @param       none
//  142  *
//  143  * @return      none
//  144  **************************************************************************************************
//  145  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  146 void macBackoffTimerInit(void)
macBackoffTimerInit:
        CFI Block cfiBlock0 Using cfiCommon0
        CFI Function macBackoffTimerInit
//  147 {
        FUNCALL macBackoffTimerInit, macMcuOverflowSetCount
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerInit, macBackoffTimerSetRollover
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerInit, macMcuOrT2PEROF2
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  148   compareState = COMPARE_STATE_ROLLOVER;
        MOV     A,#0x1
        MOV     DPTR,#compareState
        MOVX    @DPTR,A
//  149   MAC_RADIO_BACKOFF_SET_COUNT(0);
        ; Setup parameters for call to function macMcuOverflowSetCount
        MOV     DPTR,#__Constant_0
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        LCALL   ??macMcuOverflowSetCount?relay
//  150   macBackoffTimerSetRollover(MAC_BACKOFF_TIMER_DEFAULT_ROLLOVER);
        ; Setup parameters for call to function macBackoffTimerSetRollover
        MOV     DPTR,#__Constant_c0000
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        LCALL   ??macBackoffTimerSetRollover?relay
//  151   MAC_RADIO_BACKOFF_COMPARE_CLEAR_INTERRUPT();
        MOV     0xc3,#-0x3d
//  152   MAC_RADIO_BACKOFF_COMPARE_ENABLE_INTERRUPT();
        ; Setup parameters for call to function macMcuOrT2PEROF2
        MOV     R1,#0x20
        LCALL   ??macMcuOrT2PEROF2?relay
//  153 }
        LJMP    ?Subroutine6 & 0xFFFF
        CFI EndBlock cfiBlock0
        REQUIRE T2CNF
//  154 
//  155 
//  156 /**************************************************************************************************
//  157  * @fn          macBackoffTimerReset
//  158  *
//  159  * @brief       Resets backoff timer.
//  160  *
//  161  * @param       none
//  162  *
//  163  * @return      none
//  164  **************************************************************************************************
//  165  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  166 void macBackoffTimerReset(void)
macBackoffTimerReset:
        CFI Block cfiBlock1 Using cfiCommon0
        CFI Function macBackoffTimerReset
//  167 {
        FUNCALL macBackoffTimerReset, macMcuAndT2PEROF2
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerReset, macBackoffTimerInit
        LOCFRAME ISTACK, 2, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 0, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 2, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 0, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        PUSH    DPL
        CFI DPL0 Frame(CFA_SP, 4)
        CFI CFA_SP SP+-4
        PUSH    DPH
        CFI DPH0 Frame(CFA_SP, 5)
        CFI CFA_SP SP+-5
        ; Saved register size: 2
        ; Auto size: 0
//  168   MAC_RADIO_BACKOFF_COMPARE_DISABLE_INTERRUPT();
        ; Setup parameters for call to function macMcuAndT2PEROF2
        MOV     R1,#-0x21
        LCALL   ??macMcuAndT2PEROF2?relay
//  169   macBackoffTimerInit();
        ; Setup parameters for call to function macBackoffTimerInit
        LCALL   ??macBackoffTimerInit?relay
//  170 }
        POP     DPH
        CFI DPH0 SameValue
        CFI CFA_SP SP+-4
        POP     DPL
        CFI DPL0 SameValue
        CFI CFA_SP SP+-3
        LJMP    ?BRET
        CFI EndBlock cfiBlock1
//  171 
//  172 
//  173 /**************************************************************************************************
//  174  * @fn          macBackoffTimerSetRollover
//  175  *
//  176  * @brief       Set rollover count of backoff timer.
//  177  *
//  178  * @param       rolloverBackoff - backoff count where count is reset to zero
//  179  *
//  180  * @return      none
//  181  **************************************************************************************************
//  182  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  183 void macBackoffTimerSetRollover(uint32 rolloverBackoff)
macBackoffTimerSetRollover:
        CFI Block cfiBlock2 Using cfiCommon0
        CFI Function macBackoffTimerSetRollover
//  184 {
        FUNCALL macBackoffTimerSetRollover, macMcuOverflowCount
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerSetRollover, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerSetRollover, macMcuOverflowSetCompare
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 0
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     ?V0 + 2,R4
        MOV     ?V0 + 3,R5
//  185   halIntState_t  s;
//  186 
//  187   MAC_ASSERT(rolloverBackoff > MAC_RADIO_BACKOFF_COUNT());  /* rollover value must be greater than count */
        ; Setup parameters for call to function macMcuOverflowCount
        LCALL   ?Subroutine0 & 0xFFFF
??CrossCallReturnLabel_0:
        LCALL   ?UL_GT
        JC      ??macBackoffTimerSetRollover_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  188 
//  189   HAL_ENTER_CRITICAL_SECTION(s);
??macBackoffTimerSetRollover_0:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  190   backoffTimerRollover = rolloverBackoff;
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_TO_X
        CFI EndBlock cfiBlock2
//  191   MAC_RADIO_BACKOFF_SET_COMPARE(rolloverBackoff);
        ; Setup parameters for call to function macMcuOverflowSetCompare
        REQUIRE ?Subroutine7
        REQUIRE _A_IEN0
        ; // Fall through to label ?Subroutine7
//  192   HAL_EXIT_CRITICAL_SECTION(s);
//  193 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine7:
        CFI Block cfiBlock3 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        LCALL   ?Subroutine2 & 0xFFFF
??CrossCallReturnLabel_9:
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock3
//  194 
//  195 
//  196 /**************************************************************************************************
//  197  * @fn          macBackoffTimerSetCount
//  198  *
//  199  * @brief       Sets the count of the backoff timer.
//  200  *
//  201  * @param       backoff - new count
//  202  *
//  203  * @return      none
//  204  **************************************************************************************************
//  205  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  206 void macBackoffTimerSetCount(uint32 backoff)
macBackoffTimerSetCount:
        CFI Block cfiBlock4 Using cfiCommon0
        CFI Function macBackoffTimerSetCount
//  207 {
        FUNCALL macBackoffTimerSetCount, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerSetCount, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerSetCount, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerSetCount, macMcuOverflowSetCount
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 0
        MOV     ?V0 + 4,R2
        MOV     ?V0 + 5,R3
        MOV     ?V0 + 6,R4
        MOV     ?V0 + 7,R5
//  208   halIntState_t  s;
//  209 
//  210   MAC_ASSERT(compareState == COMPARE_STATE_ROLLOVER);   /* trigger cannot be active if changing count */
        MOV     DPTR,#compareState
        MOVX    A,@DPTR
        XRL     A,#0x1
        JZ      ??macBackoffTimerSetCount_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  211   MAC_ASSERT(backoff < backoffTimerRollover);  /* count must be less than rollover value */
??macBackoffTimerSetCount_0:
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R0,#?V0 + 0
        MOV     R1,#?V0 + 4
        LCALL   ?UL_GT
        JC      ??macBackoffTimerSetCount_1
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  212   MAC_ASSERT(!(backoff & 0x80000000));  /* count must not represent negative value for int32 */
??macBackoffTimerSetCount_1:
        MOV     ?V0 + 0,?V0 + 4
        MOV     ?V0 + 1,?V0 + 5
        MOV     ?V0 + 2,?V0 + 6
        MOV     ?V0 + 3,?V0 + 7
        MOV     DPTR,#__Constant_80000000
        MOV     R0,#?V0 + 0
        LCALL   ?L_AND_X
        MOV     DPTR,#__Constant_0
        MOV     R0,#?V0 + 0
        LCALL   ?L_EQ_X
        JZ      ??macBackoffTimerSetCount_2
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  213 
//  214   HAL_ENTER_CRITICAL_SECTION(s);
??macBackoffTimerSetCount_2:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  215   MAC_RADIO_BACKOFF_SET_COUNT(backoff);
        ; Setup parameters for call to function macMcuOverflowSetCount
        MOV     R2,?V0 + 4
        MOV     R3,?V0 + 5
        MOV     R4,?V0 + 6
        MOV     R5,?V0 + 7
        LCALL   ??macMcuOverflowSetCount?relay
//  216   HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  217 }
        SJMP    ?Subroutine8
        CFI EndBlock cfiBlock4
        REQUIRE _A_IEN0
//  218 
//  219 
//  220 /**************************************************************************************************
//  221  * @fn          macBackoffTimerCount
//  222  *
//  223  * @brief       Returns the current backoff count.
//  224  *
//  225  * @param       none
//  226  *
//  227  * @return      current backoff count
//  228  **************************************************************************************************
//  229  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  230 uint32 macBackoffTimerCount(void)
macBackoffTimerCount:
        CFI Block cfiBlock5 Using cfiCommon0
        CFI Function macBackoffTimerCount
//  231 {
        FUNCALL macBackoffTimerCount, macMcuOverflowCount
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 0
//  232   halIntState_t  s;
//  233   uint32 backoffCount;
//  234 
//  235   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  236   backoffCount = MAC_RADIO_BACKOFF_COUNT();
        ; Setup parameters for call to function macMcuOverflowCount
        LCALL   ?Subroutine1 & 0xFFFF
//  237   HAL_EXIT_CRITICAL_SECTION(s);
??CrossCallReturnLabel_2:
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  238   
//  239 #ifdef MAC_RADIO_FEATURE_HARDWARE_OVERFLOW_NO_ROLLOVER
//  240   /*
//  241    *  Extra processing is required if the radio has a special hardware overflow
//  242    *  count feature.  Unfortunately this feature does not provide for setting a
//  243    *  rollover value.  This must be done manually.
//  244    *
//  245    *  This means there is a small window in time when reading the hardware count
//  246    *  will be inaccurate.  It's possible it could be one more than the allowable
//  247    *  count.  This happens if the count has just incremented beyond the maximum
//  248    *  and is queried before the ISR has a chance to run and reset the backoff
//  249    *  count back to zero.  (Pure software implementation of backoff count does
//  250    *  not have this problem.)
//  251    *
//  252    *  To solve this, before returning a value for the backoff count, the value
//  253    *  must be tested to see if it is beyond the maximum value.  If so, a rollover
//  254    *  interrupt that will set backoff count to zero is imminent.  In that case,
//  255    *  the correct backoff count of zero is returned.
//  256    */
//  257   if (backoffCount >= backoffTimerRollover)
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 4
        LCALL   ?L_MOV_X
        MOV     R0,#?V0 + 4
        MOV     R1,#?V0 + 0
        LCALL   ?UL_GT
        JC      ??macBackoffTimerCount_0
//  258   {
//  259     return(0);
        MOV     R2,#0x0
        MOV     R3,#0x0
        MOV     R4,#0x0
        MOV     R5,#0x0
//  260   }
//  261 #endif
//  262   
//  263   return(backoffCount);
??macBackoffTimerCount_0:
        SJMP    ?Subroutine8
        CFI EndBlock cfiBlock5
        REQUIRE _A_IEN0
//  264 }
//  265 
//  266 
//  267 /**************************************************************************************************
//  268  * @fn          macBackoffTimerCapture
//  269  *
//  270  * @brief       Returns the most recently captured backoff count
//  271  *
//  272  * @param       none
//  273  *
//  274  * @return      last backoff count that was captured
//  275  **************************************************************************************************
//  276  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  277 uint32 macBackoffTimerCapture(void)
macBackoffTimerCapture:
        CFI Block cfiBlock6 Using cfiCommon0
        CFI Function macBackoffTimerCapture
//  278 {
        FUNCALL macBackoffTimerCapture, macMcuOverflowCapture
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 0
//  279   halIntState_t  s;
//  280   uint32 backoffCapture;
//  281 
//  282   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  283   backoffCapture = MAC_RADIO_BACKOFF_CAPTURE();
        ; Setup parameters for call to function macMcuOverflowCapture
        LCALL   ??macMcuOverflowCapture?relay
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     ?V0 + 2,R4
        MOV     ?V0 + 3,R5
//  284   HAL_EXIT_CRITICAL_SECTION(s);
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  285 
//  286 #ifdef MAC_RADIO_FEATURE_HARDWARE_OVERFLOW_NO_ROLLOVER
//  287   /*
//  288    *  See other instance of this #ifdef for detailed comments.
//  289    *  Those comments apply to the backoff capture value too.
//  290    */
//  291   if (backoffCapture >= backoffTimerRollover)
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 4
        LCALL   ?L_MOV_X
        MOV     R0,#?V0 + 4
        MOV     R1,#?V0 + 0
        LCALL   ?UL_GT
        JC      ??macBackoffTimerCapture_0
//  292   {
//  293     return(0);
        MOV     R2,#0x0
        MOV     R3,#0x0
        MOV     R4,#0x0
        MOV     R5,#0x0
        CFI EndBlock cfiBlock6
//  294   }
//  295 #endif
//  296   
//  297   return(backoffCapture);
??macBackoffTimerCapture_0:
        REQUIRE ?Subroutine8
        REQUIRE _A_IEN0
        ; // Fall through to label ?Subroutine8
//  298 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine8:
        CFI Block cfiBlock7 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     R7,#0x8
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock7
//  299 
//  300 
//  301 /**************************************************************************************************
//  302  * @fn          macBackoffTimerGetTrigger
//  303  *
//  304  * @brief       Returns the trigger set for the backoff timer.
//  305  *
//  306  * @param       none
//  307  *
//  308  * @return      backoff count of trigger
//  309  **************************************************************************************************
//  310  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  311 uint32 macBackoffTimerGetTrigger(void)
macBackoffTimerGetTrigger:
        CFI Block cfiBlock8 Using cfiCommon0
        CFI Function macBackoffTimerGetTrigger
//  312 {
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  313   return(backoffTimerTrigger);
        MOV     DPTR,#backoffTimerTrigger
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        LJMP    ?Subroutine6 & 0xFFFF
        CFI EndBlock cfiBlock8
//  314 }
//  315 
//  316 
//  317 /**************************************************************************************************
//  318  * @fn          macBackoffTimerSetTrigger
//  319  *
//  320  * @brief       Sets the trigger count for the backoff counter.  A callback is exectuted when
//  321  *              the backoff count reaches the trigger
//  322  *
//  323  * @param       triggerBackoff - backoff count for new trigger
//  324  *
//  325  * @return      none
//  326  **************************************************************************************************
//  327  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  328 void macBackoffTimerSetTrigger(uint32 triggerBackoff)
macBackoffTimerSetTrigger:
        CFI Block cfiBlock9 Using cfiCommon0
        CFI Function macBackoffTimerSetTrigger
//  329 {
        FUNCALL macBackoffTimerSetTrigger, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerSetTrigger, macMcuOverflowCount
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerSetTrigger, macMcuOverflowSetCompare
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerSetTrigger, macMcuOverflowSetCompare
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 16, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 16, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 0
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     ?V0 + 2,R4
        MOV     ?V0 + 3,R5
//  330   halIntState_t  s;
//  331 
//  332   MAC_ASSERT(triggerBackoff < backoffTimerRollover); /* trigger backoff must be less than rollover backoff */
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 4
        LCALL   ?L_MOV_X
        MOV     R0,#?V0 + 4
        MOV     R1,#?V0 + 0
        LCALL   ?UL_GT
        JC      ??macBackoffTimerSetTrigger_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  333 
//  334   HAL_ENTER_CRITICAL_SECTION(s);
??macBackoffTimerSetTrigger_0:
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  335   backoffTimerTrigger = triggerBackoff;
        MOV     DPTR,#backoffTimerTrigger
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_TO_X
//  336   if (triggerBackoff > MAC_RADIO_BACKOFF_COUNT())
        ; Setup parameters for call to function macMcuOverflowCount
        LCALL   ?Subroutine0 & 0xFFFF
??CrossCallReturnLabel_1:
        LCALL   ?UL_GT
        JNC     ??macBackoffTimerSetTrigger_1
//  337   {
//  338     compareState = COMPARE_STATE_TRIGGER;
        MOV     A,#0x2
        MOV     DPTR,#compareState
        MOVX    @DPTR,A
//  339     MAC_RADIO_BACKOFF_SET_COMPARE(triggerBackoff);
        ; Setup parameters for call to function macMcuOverflowSetCompare
        SJMP    ??macBackoffTimerSetTrigger_2
//  340   }
//  341   else
//  342   {
//  343     if (triggerBackoff == 0)
??macBackoffTimerSetTrigger_1:
        MOV     DPTR,#__Constant_0
        MOV     R0,#?V0 + 0
        LCALL   ?L_EQ_X
        JNZ     ??macBackoffTimerSetTrigger_3
//  344     {
//  345       compareState = COMPARE_STATE_ROLLOVER_AND_TRIGGER;
        MOV     A,#0x3
        SJMP    ??macBackoffTimerSetTrigger_4
//  346     }
//  347     else
//  348     {
//  349       compareState = COMPARE_STATE_ROLLOVER_AND_ARM_TRIGGER;
??macBackoffTimerSetTrigger_3:
        MOV     A,#0x5
??macBackoffTimerSetTrigger_4:
        LCALL   ??Subroutine3_0 & 0xFFFF
//  350     }
//  351     MAC_RADIO_BACKOFF_SET_COMPARE(backoffTimerRollover);
??CrossCallReturnLabel_6:
        LCALL   ?L_MOV_X
??macBackoffTimerSetTrigger_2:
        LJMP    ?Subroutine7 & 0xFFFF
        CFI EndBlock cfiBlock9
        REQUIRE _A_IEN0
//  352   }
//  353   HAL_EXIT_CRITICAL_SECTION(s);
//  354 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine2:
        CFI Block cfiCond10 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_9
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        CFI Block cfiCond11 Using cfiCommon0
        CFI (cfiCond11) NoFunction
        CFI (cfiCond11) Conditional ??CrossCallReturnLabel_9
        CFI (cfiCond11) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond11) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond11) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond11) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond11) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond11) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond11) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond11) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond11) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond11) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond11) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond11) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond11) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond11) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond11) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond11) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond11) CFA_SP SP+0
        CFI (cfiCond11) CFA_XSP16 add(XSP16, 16)
        CFI Block cfiPicker12 Using cfiCommon1
        CFI (cfiPicker12) NoFunction
        CFI (cfiPicker12) Picker
        LCALL   ?Subroutine5 & 0xFFFF
??CrossCallReturnLabel_10:
        MOV     R7,#0x8
        RET
        CFI EndBlock cfiCond10
        CFI EndBlock cfiCond11
        CFI EndBlock cfiPicker12

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine0:
        CFI Block cfiCond13 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_0
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        CFI Block cfiCond14 Using cfiCommon0
        CFI (cfiCond14) NoFunction
        CFI (cfiCond14) Conditional ??CrossCallReturnLabel_1
        CFI (cfiCond14) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond14) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond14) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond14) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond14) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond14) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond14) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond14) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond14) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond14) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond14) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond14) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond14) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond14) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond14) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond14) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond14) CFA_SP SP+0
        CFI (cfiCond14) CFA_XSP16 add(XSP16, 16)
        CFI Block cfiPicker15 Using cfiCommon1
        CFI (cfiPicker15) NoFunction
        CFI (cfiPicker15) Picker
        LCALL   ??macMcuOverflowCount?relay
        MOV     ?V0 + 4,R2
        MOV     ?V0 + 5,R3
        MOV     ?V0 + 6,R4
        MOV     ?V0 + 7,R5
        MOV     R0,#?V0 + 0
        MOV     R1,#?V0 + 4
        RET
        CFI EndBlock cfiCond13
        CFI EndBlock cfiCond14
        CFI EndBlock cfiPicker15
//  355 
//  356 
//  357 /**************************************************************************************************
//  358  * @fn          macBackoffTimerCancelTrigger
//  359  *
//  360  * @brief       Cancels the trigger for the backoff counter.
//  361  *
//  362  * @param       none
//  363  *
//  364  * @return      none
//  365  **************************************************************************************************
//  366  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  367 void macBackoffTimerCancelTrigger(void)
macBackoffTimerCancelTrigger:
        CFI Block cfiBlock16 Using cfiCommon0
        CFI Function macBackoffTimerCancelTrigger
//  368 {
        FUNCALL macBackoffTimerCancelTrigger, macMcuOverflowSetCompare
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  369   halIntState_t  s;
//  370 
//  371   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  372   compareState = COMPARE_STATE_ROLLOVER;
        LCALL   ?Subroutine3 & 0xFFFF
//  373   MAC_RADIO_BACKOFF_SET_COMPARE(backoffTimerRollover);
??CrossCallReturnLabel_4:
        LCALL   ?L_MOV_X
        LCALL   ?Subroutine4 & 0xFFFF
        CFI EndBlock cfiBlock16
//  374   HAL_EXIT_CRITICAL_SECTION(s);
//  375 }
??CrossCallReturnLabel_7:
        REQUIRE ?Subroutine6
        REQUIRE _A_IEN0
        ; // Fall through to label ?Subroutine6

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine6:
        CFI Block cfiBlock17 Using cfiCommon0
        CFI NoFunction
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        MOV     R7,#0x4
        LJMP    ?BANKED_LEAVE_XDATA
        CFI EndBlock cfiBlock17

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine3:
        CFI Block cfiCond18 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_4
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        CFI Block cfiCond19 Using cfiCommon0
        CFI (cfiCond19) NoFunction
        CFI (cfiCond19) Conditional ??CrossCallReturnLabel_5
        CFI (cfiCond19) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond19) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond19) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond19) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond19) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond19) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond19) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond19) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond19) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond19) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond19) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond19) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond19) CFA_SP SP+0
        CFI (cfiCond19) CFA_XSP16 add(XSP16, 12)
        CFI Block cfiPicker20 Using cfiCommon1
        CFI (cfiPicker20) NoFunction
        CFI (cfiPicker20) Picker
        MOV     A,#0x1
        CFI Block cfiCond21 Using cfiCommon0
        CFI (cfiCond21) NoFunction
        CFI (cfiCond21) Conditional ??CrossCallReturnLabel_6
        CFI (cfiCond21) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond21) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond21) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond21) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond21) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond21) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond21) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond21) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond21) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond21) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond21) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond21) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond21) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond21) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond21) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond21) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond21) CFA_SP SP+0
        CFI (cfiCond21) CFA_XSP16 add(XSP16, 16)
??Subroutine3_0:
        MOV     DPTR,#compareState
        MOVX    @DPTR,A
        ; Setup parameters for call to function macMcuOverflowSetCompare
        ; Setup parameters for call to function macMcuOverflowSetCompare
        ; Setup parameters for call to function macMcuOverflowSetCompare
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 0
        RET
        CFI EndBlock cfiCond18
        CFI EndBlock cfiCond19
        CFI EndBlock cfiPicker20
        CFI EndBlock cfiCond21
//  376 
//  377 
//  378 /**************************************************************************************************
//  379  * @fn          macBackoffTimerRealign
//  380  *
//  381  * @brief       
//  382  *
//  383  *  Realignment is accomplished by adjusting the internal time base to align with the expected
//  384  *  reception time of an incoming frame.  The difference between the expected reception time and
//  385  *  the actual reception time is computed and this difference is used to adjust the hardware
//  386  *  timer count and backoff count.
//  387  *
//  388  *  The realignment is based on the SFD signal for the incoming frame.  The timer is aligned
//  389  *  by adjusting it with the difference between the expected SFD time and the actual SFD time.
//  390  *
//  391  * @param       none
//  392  *
//  393  * @return      none
//  394  **************************************************************************************************
//  395  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  396 int32 macBackoffTimerRealign(macRx_t *pMsg)
macBackoffTimerRealign:
        CFI Block cfiBlock22 Using cfiCommon0
        CFI Function macBackoffTimerRealign
//  397 {
        FUNCALL macBackoffTimerRealign, halAssertHandler
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerRealign, macMcuOverflowCount
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerRealign, macMcuOverflowSetCount
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 20, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 20, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0x10
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        ; Saved register size: 16
        ; Auto size: 4
        MOV     A,#-0x4
        LCALL   ?ALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 20)
        MOV     A,R2
        MOV     R6,A
        MOV     A,R3
        MOV     R7,A
//  398   uint16 timerDelayTicks;
//  399   int32 backoffDelta;
//  400   int32 backoffCount;
//  401 
//  402   MAC_ASSERT(!MAC_TX_IS_PHYSICALLY_ACTIVE()); /* realignment during actual transmit corrupts timing */
        MOV     DPTR,#macTxActive
        MOVX    A,@DPTR
        MOV     C,0xE0 /* A   */.7
        JNC     ??macBackoffTimerRealign_0
        ; Setup parameters for call to function halAssertHandler
        LCALL   ??halAssertHandler?relay
//  403 
//  404   /*-------------------------------------------------------------------------------
//  405    *  Calculate the delta backoff difference between expected backoff count,
//  406    *  which is zero, and the backoff count of the received frame.
//  407    */
//  408 
//  409   /* since expected receive time is zero, the delta is simply the receive time */
//  410   backoffDelta = pMsg->mac.timestamp;
??macBackoffTimerRealign_0:
        MOV     A,R6
        ADD     A,#0x24
        MOV     DPL,A
        MOV     A,R7
        ADDC    A,#0x0
        MOV     DPH,A
        MOV     R0,#?V0 + 4
        LCALL   ?L_MOV_X
//  411 
//  412   /* if the frame was received more than halfway to the rollover count, use a negative delta value */
//  413   if (((uint32) backoffDelta) > (backoffTimerRollover / 2))
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     A,#0x1
        MOV     R0,#?V0 + 0
        LCALL   ?UL_SHR
        MOV     R0,#?V0 + 4
        MOV     R1,#?V0 + 0
        LCALL   ?UL_GT
        JNC     ??macBackoffTimerRealign_1
//  414   {
//  415     backoffDelta = backoffDelta - backoffTimerRollover;    /* result will be negative */
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 4
        LCALL   ?L_SUB_X
//  416   }
//  417 
//  418   /*-------------------------------------------------------------------------------
//  419    *  Calculate the number of timer ticks to delay that will align the internal
//  420    *  time base with the received frame.
//  421    */
//  422 
//  423   /* retrieve the timer count when frame was received */
//  424   timerDelayTicks = pMsg->mac.timestamp2;
??macBackoffTimerRealign_1:
        MOV     A,R6
        ADD     A,#0x28
        MOV     DPL,A
        MOV     A,R7
        ADDC    A,#0x0
        MOV     DPH,A
        MOVX    A,@DPTR
        MOV     R6,A
        INC     DPTR
        MOVX    A,@DPTR
        MOV     R7,A
//  425 
//  426   /*
//  427    *  Subtract the expected SFD time from the actual SFD time to find the needed
//  428    *  timer adjustment. If subtracting the offset would result in a negative value,
//  429    *  the tick delay must wrap around.
//  430    */
//  431   if (timerDelayTicks >= TIMER_TICKS_EXPECTED_AT_SFD)
        CLR     C
        MOV     A,R6
        SUBB    A,#0x66
        MOV     A,R7
        SUBB    A,#0x4
        MOV     A,R6
        JC      ??macBackoffTimerRealign_2
//  432   {
//  433     /* since delay count is greater than or equal to offset, subtract it directly */
//  434     timerDelayTicks = timerDelayTicks - TIMER_TICKS_EXPECTED_AT_SFD;
        ADD     A,#-0x66
        MOV     R6,A
        MOV     A,R7
        ADDC    A,#-0x5
        MOV     R7,A
        SJMP    ??macBackoffTimerRealign_3
//  435   }
//  436   else
//  437   {
//  438     /*
//  439      *  The expected time is greater that actualy time so it cannot be subtracted directly.
//  440      *  The tick count per backoff is added to wrap around within the backoff.
//  441      *  Since a wrap around did happen, the backoff delta is adjusted by one.
//  442      */
//  443     timerDelayTicks = timerDelayTicks - TIMER_TICKS_EXPECTED_AT_SFD + MAC_RADIO_TIMER_TICKS_PER_BACKOFF();
??macBackoffTimerRealign_2:
        ADD     A,#-0x66
        MOV     R6,A
        MOV     A,R7
        ADDC    A,#0x23
        MOV     R7,A
//  444     backoffDelta--;
        MOV     DPTR,#__Constant_ffffffff
        MOV     R0,#?V0 + 4
        LCALL   ?L_ADD_X
//  445   }
//  446 
//  447   /*-------------------------------------------------------------------------------
//  448    *  Calculate the new backoff count.
//  449    */
//  450 
//  451   backoffCount = MAC_RADIO_BACKOFF_COUNT() - backoffDelta;
??macBackoffTimerRealign_3:
        ; Setup parameters for call to function macMcuOverflowCount
        LCALL   ?Subroutine1 & 0xFFFF
??CrossCallReturnLabel_3:
        MOV     R0,#?V0 + 0
        MOV     R1,#?V0 + 4
        LCALL   ?L_SUB
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_TO_X
//  452 
//  453   if (backoffCount >= ((int32) backoffTimerRollover))
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        PUSH    DPL
        CFI CFA_SP SP+-1
        PUSH    DPH
        CFI CFA_SP SP+-2
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        POP     DPH
        CFI CFA_SP SP+-1
        POP     DPL
        CFI CFA_SP SP+0
        MOV     R0,#?V0 + 0
        LCALL   ?SL_GT_X
        JC      ??macBackoffTimerRealign_4
//  454   {
//  455     backoffCount -= backoffTimerRollover;
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R0,#?V0 + 0
        LCALL   ?L_SUB_FROM_X
        SJMP    ??macBackoffTimerRealign_5
//  456   }
//  457   else if (backoffCount < 0)
??macBackoffTimerRealign_4:
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        PUSH    DPL
        CFI CFA_SP SP+-1
        PUSH    DPH
        CFI CFA_SP SP+-2
        MOV     DPTR,#__Constant_0
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        POP     DPH
        CFI CFA_SP SP+-1
        POP     DPL
        CFI CFA_SP SP+0
        MOV     R0,#?V0 + 0
        LCALL   ?SL_GT_X
        JNC     ??macBackoffTimerRealign_5
//  458   {
//  459     backoffCount += backoffTimerRollover;
        MOV     DPTR,#backoffTimerRollover
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R0,#?V0 + 0
        LCALL   ?L_ADD_TO_X
//  460   }
//  461 
//  462   MAC_RADIO_TIMER_FORCE_DELAY(timerDelayTicks);
??macBackoffTimerRealign_5:
        MOV     A,R6
        MOV     0xa6,A
        MOV     A,R7
        MOV     0xa7,A
//  463   MAC_RADIO_BACKOFF_SET_COUNT(backoffCount);
        ; Setup parameters for call to function macMcuOverflowSetCount
        MOV     DPL,?XSP + 0
        MOV     DPH,?XSP + 1
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        LCALL   ??macMcuOverflowSetCount?relay
//  464 
//  465   return(backoffDelta);
        MOV     R2,?V0 + 4
        MOV     R3,?V0 + 5
        MOV     R4,?V0 + 6
        MOV     R5,?V0 + 7
        MOV     A,#0x4
        LCALL   ?DEALLOC_XSTACK8
        CFI CFA_XSP16 add(XSP16, 16)
        LJMP    ?Subroutine8 & 0xFFFF
        CFI EndBlock cfiBlock22
        REQUIRE T2TLD
        REQUIRE T2THD
//  466 }

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine1:
        CFI Block cfiCond23 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_2
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        CFI Block cfiCond24 Using cfiCommon0
        CFI (cfiCond24) NoFunction
        CFI (cfiCond24) Conditional ??CrossCallReturnLabel_3
        CFI (cfiCond24) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond24) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond24) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond24) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond24) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond24) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond24) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond24) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond24) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond24) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond24) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond24) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond24) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond24) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond24) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond24) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond24) CFA_SP SP+0
        CFI (cfiCond24) CFA_XSP16 add(XSP16, 20)
        CFI Block cfiPicker25 Using cfiCommon1
        CFI (cfiPicker25) NoFunction
        CFI (cfiPicker25) Picker
        LCALL   ??macMcuOverflowCount?relay
        MOV     ?V0 + 0,R2
        MOV     ?V0 + 1,R3
        MOV     ?V0 + 2,R4
        MOV     ?V0 + 3,R5
        RET
        CFI EndBlock cfiCond23
        CFI EndBlock cfiCond24
        CFI EndBlock cfiPicker25
//  467 
//  468 
//  469 /**************************************************************************************************
//  470  * @fn          macBackoffTimerCompareIsr
//  471  *
//  472  * @brief       Interrupt service routine that fires when the backoff count is equal
//  473  *              to the trigger count.
//  474  *
//  475  * @param       none
//  476  *
//  477  * @return      none
//  478  **************************************************************************************************
//  479  */

        RSEG BANKED_CODE:CODE:NOROOT(0)
//  480 void macBackoffTimerCompareIsr(void)
macBackoffTimerCompareIsr:
        CFI Block cfiBlock26 Using cfiCommon0
        CFI Function macBackoffTimerCompareIsr
//  481 {
        FUNCALL macBackoffTimerCompareIsr, macMcuOverflowSetCount
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerCompareIsr, macBackoffTimerRolloverCallback
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerCompareIsr, macMcuOverflowSetCompare
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerCompareIsr, macBackoffTimerTriggerCallback
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        FUNCALL macBackoffTimerCompareIsr, macMcuOverflowSetCompare
        LOCFRAME ISTACK, 0, STACK
        LOCFRAME PSTACK, 0, STACK
        LOCFRAME XSTACK, 12, STACK
        LOCFRAME IOVERLAY, 0, STATIC
        LOCFRAME DOVERLAY, 0, STATIC
        ARGFRAME ISTACK, 0, STACK
        ARGFRAME PSTACK, 0, STACK
        ARGFRAME XSTACK, 12, STACK
        ARGFRAME IOVERLAY, 0, STATIC
        ARGFRAME DOVERLAY, 0, STATIC
        MOV     A,#-0xc
        LCALL   ?BANKED_ENTER_XDATA
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        ; Saved register size: 12
        ; Auto size: 0
//  482   uint8 oldState;
//  483   halIntState_t  s;
//  484 
//  485   HAL_ENTER_CRITICAL_SECTION(s);
        MOV     C,0xa8.7
        CLR     A
        MOV     0xE0 /* A   */.0,C
        MOV     R6,A
        CLR     0xa8.7
//  486   oldState = compareState;
        MOV     DPTR,#compareState
        MOVX    A,@DPTR
        MOV     R7,A
//  487 
//  488   /* if compare is a rollover, set count to zero */
//  489   if (oldState & COMPARE_STATE_ROLLOVER_BV)
        MOV     C,0xE0 /* A   */.0
        JNC     ??macBackoffTimerCompareIsr_0
//  490   {
//  491     MAC_RADIO_BACKOFF_SET_COUNT(0);
        ; Setup parameters for call to function macMcuOverflowSetCount
        MOV     DPTR,#__Constant_0
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        LCALL   ??macMcuOverflowSetCount?relay
//  492     macBackoffTimerRolloverCallback();
        ; Setup parameters for call to function macBackoffTimerRolloverCallback
        LCALL   ??macBackoffTimerRolloverCallback?relay
//  493   }
//  494 
//  495   /* if compare is a trigger, reset for rollover and run the trigger callback */
//  496   if (oldState & COMPARE_STATE_TRIGGER_BV)
??macBackoffTimerCompareIsr_0:
        MOV     A,R7
        MOV     C,0xE0 /* A   */.1
        JNC     ??macBackoffTimerCompareIsr_1
//  497   {
//  498     compareState = COMPARE_STATE_ROLLOVER;
        LCALL   ?Subroutine3 & 0xFFFF
//  499     MAC_RADIO_BACKOFF_SET_COMPARE(backoffTimerRollover);
??CrossCallReturnLabel_5:
        LCALL   ?L_MOV_X
        LCALL   ?Subroutine4 & 0xFFFF
//  500     HAL_EXIT_CRITICAL_SECTION(s);
//  501     macBackoffTimerTriggerCallback();
??CrossCallReturnLabel_8:
        ; Setup parameters for call to function macBackoffTimerTriggerCallback
        LCALL   ??macBackoffTimerTriggerCallback?relay
        SJMP    ??macBackoffTimerCompareIsr_2
//  502   }
//  503   else if (oldState == COMPARE_STATE_ROLLOVER_AND_ARM_TRIGGER)
??macBackoffTimerCompareIsr_1:
        MOV     A,#0x5
        XRL     A,R7
        JNZ     ??macBackoffTimerCompareIsr_3
//  504   {
//  505     compareState = COMPARE_STATE_TRIGGER;
        MOV     A,#0x2
        MOV     DPTR,#compareState
        MOVX    @DPTR,A
//  506     MAC_RADIO_BACKOFF_SET_COMPARE(backoffTimerTrigger);
        ; Setup parameters for call to function macMcuOverflowSetCompare
        MOV     DPTR,#backoffTimerTrigger
        MOV     R0,#?V0 + 0
        LCALL   ?L_MOV_X
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        LCALL   ??macMcuOverflowSetCompare?relay
//  507     HAL_EXIT_CRITICAL_SECTION(s);
//  508   }
//  509   else
//  510   {
//  511     HAL_EXIT_CRITICAL_SECTION(s);
??macBackoffTimerCompareIsr_3:
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
//  512   }
//  513 }
??macBackoffTimerCompareIsr_2:
        LJMP    ?Subroutine6 & 0xFFFF
        CFI EndBlock cfiBlock26
        REQUIRE _A_IEN0

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine4:
        CFI Block cfiCond27 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_7
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 12)
        CFI Block cfiCond28 Using cfiCommon0
        CFI (cfiCond28) NoFunction
        CFI (cfiCond28) Conditional ??CrossCallReturnLabel_8
        CFI (cfiCond28) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond28) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond28) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond28) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond28) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond28) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond28) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond28) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond28) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond28) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond28) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond28) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond28) CFA_SP SP+0
        CFI (cfiCond28) CFA_XSP16 add(XSP16, 12)
        CFI Block cfiPicker29 Using cfiCommon1
        CFI (cfiPicker29) NoFunction
        CFI (cfiPicker29) Picker
        LCALL   ?Subroutine5 & 0xFFFF
??CrossCallReturnLabel_11:
        RET
        CFI EndBlock cfiCond27
        CFI EndBlock cfiCond28
        CFI EndBlock cfiPicker29

        RSEG BANKED_CODE:CODE:NOROOT(0)
?Subroutine5:
        CFI Block cfiCond30 Using cfiCommon0
        CFI NoFunction
        CFI Conditional ??CrossCallReturnLabel_10, ??CrossCallReturnLabel_9
        CFI R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI CFA_SP SP+0
        CFI CFA_XSP16 add(XSP16, 16)
        CFI Block cfiCond31 Using cfiCommon0
        CFI (cfiCond31) NoFunction
        CFI (cfiCond31) Conditional ??CrossCallReturnLabel_10, ??CrossCallReturnLabel_9
        CFI (cfiCond31) R6 load(1, XDATA, add(CFA_XSP16, literal(-16)))
        CFI (cfiCond31) VB load(1, XDATA, add(CFA_XSP16, literal(-15)))
        CFI (cfiCond31) V0 load(1, XDATA, add(CFA_XSP16, literal(-14)))
        CFI (cfiCond31) V1 load(1, XDATA, add(CFA_XSP16, literal(-13)))
        CFI (cfiCond31) V2 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond31) V3 load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond31) V4 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond31) V5 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond31) V6 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond31) V7 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond31) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond31) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond31) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond31) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond31) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond31) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond31) CFA_SP SP+0
        CFI (cfiCond31) CFA_XSP16 add(XSP16, 16)
        CFI Block cfiCond32 Using cfiCommon0
        CFI (cfiCond32) NoFunction
        CFI (cfiCond32) Conditional ??CrossCallReturnLabel_11, ??CrossCallReturnLabel_7
        CFI (cfiCond32) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond32) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond32) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond32) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond32) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond32) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond32) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond32) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond32) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond32) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond32) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond32) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond32) CFA_SP SP+0
        CFI (cfiCond32) CFA_XSP16 add(XSP16, 12)
        CFI Block cfiCond33 Using cfiCommon0
        CFI (cfiCond33) NoFunction
        CFI (cfiCond33) Conditional ??CrossCallReturnLabel_11, ??CrossCallReturnLabel_8
        CFI (cfiCond33) R6 load(1, XDATA, add(CFA_XSP16, literal(-12)))
        CFI (cfiCond33) VB load(1, XDATA, add(CFA_XSP16, literal(-11)))
        CFI (cfiCond33) V0 load(1, XDATA, add(CFA_XSP16, literal(-10)))
        CFI (cfiCond33) V1 load(1, XDATA, add(CFA_XSP16, literal(-9)))
        CFI (cfiCond33) V2 load(1, XDATA, add(CFA_XSP16, literal(-8)))
        CFI (cfiCond33) V3 load(1, XDATA, add(CFA_XSP16, literal(-7)))
        CFI (cfiCond33) R7 load(1, XDATA, add(CFA_XSP16, literal(-6)))
        CFI (cfiCond33) ?RET_LOW load(1, XDATA, add(CFA_XSP16, literal(-5)))
        CFI (cfiCond33) ?RET_HIGH load(1, XDATA, add(CFA_XSP16, literal(-4)))
        CFI (cfiCond33) ?BRET_EXT load(1, XDATA, add(CFA_XSP16, literal(-3)))
        CFI (cfiCond33) DPL0 load(1, XDATA, add(CFA_XSP16, literal(-2)))
        CFI (cfiCond33) DPH0 load(1, XDATA, add(CFA_XSP16, literal(-1)))
        CFI (cfiCond33) CFA_SP SP+0
        CFI (cfiCond33) CFA_XSP16 add(XSP16, 12)
        CFI Block cfiPicker34 Using cfiCommon1
        CFI (cfiPicker34) NoFunction
        CFI (cfiPicker34) Picker
        MOV     R2,?V0 + 0
        MOV     R3,?V0 + 1
        MOV     R4,?V0 + 2
        MOV     R5,?V0 + 3
        LCALL   ??macMcuOverflowSetCompare?relay
        MOV     A,R6
        MOV     C,0xE0 /* A   */.0
        MOV     0xa8.7,C
        RET
        CFI EndBlock cfiCond30
        CFI EndBlock cfiCond31
        CFI EndBlock cfiCond32
        CFI EndBlock cfiCond33
        CFI EndBlock cfiPicker34

        RSEG XDATA_I:XDATA:NOROOT(0)
        DATA
__Constant_0:
        DS 4
        REQUIRE `?<Initializer for __Constant_0>`
        REQUIRE __INIT_XDATA_I

        RSEG XDATA_ID:CODE:NOROOT(0)
        DATA
`?<Initializer for __Constant_0>`:
        DD 0

        RSEG XDATA_I:XDATA:NOROOT(0)
        DATA
__Constant_c0000:
        DS 4
        REQUIRE `?<Initializer for __Constant_c0000>`
        REQUIRE __INIT_XDATA_I

        RSEG XDATA_ID:CODE:NOROOT(0)
        DATA
`?<Initializer for __Constant_c0000>`:
        DD 786432

        RSEG XDATA_I:XDATA:NOROOT(0)
        DATA
__Constant_80000000:
        DS 4
        REQUIRE `?<Initializer for __Constant_80000000>`
        REQUIRE __INIT_XDATA_I

        RSEG XDATA_ID:CODE:NOROOT(0)
        DATA
`?<Initializer for __Constant_80000000>`:
        DD 2147483648

        RSEG XDATA_I:XDATA:NOROOT(0)
        DATA
__Constant_ffffffff:
        DS 4
        REQUIRE `?<Initializer for __Constant_ffffffff>`
        REQUIRE __INIT_XDATA_I

        RSEG XDATA_ID:CODE:NOROOT(0)
        DATA
`?<Initializer for __Constant_ffffffff>`:
        DD -1

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerInit?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerInit

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerReset?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerReset

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerSetRollover?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerSetRollover

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerSetCount?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerSetCount

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerCount?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerCount

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerCapture?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerCapture

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerGetTrigger?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerGetTrigger

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerSetTrigger?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerSetTrigger

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerCancelTrigger?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerCancelTrigger

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerRealign?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerRealign

        RSEG BANK_RELAYS:CODE:REORDER:NOROOT(0)
??macBackoffTimerCompareIsr?relay:
        LCALL   ?BDISPATCH
        DATA
        DC24    macBackoffTimerCompareIsr

        END
//  514 
//  515 
//  516 /**************************************************************************************************
//  517 */
// 
// 928 bytes in segment BANKED_CODE
//  66 bytes in segment BANK_RELAYS
//   4 bytes in segment SFR_AN
//  16 bytes in segment XDATA_I
//  16 bytes in segment XDATA_ID
//   9 bytes in segment XDATA_Z
// 
// 994 bytes of CODE  memory (+ 16 bytes shared)
//   0 bytes of DATA  memory (+  4 bytes shared)
//   9 bytes of XDATA memory (+ 16 bytes shared)
//
//Errors: none
//Warnings: none
