   1               		.file	"wiring_pulse.c"
   2               	__SP_H__ = 0x3e
   3               	__SP_L__ = 0x3d
   4               	__SREG__ = 0x3f
   5               	__tmp_reg__ = 0
   6               	__zero_reg__ = 1
   9               		.text
  10               	.Ltext0:
 136               	.global	pulseInLong
 138               	pulseInLong:
 139               		.stabd	46,0,0
   1:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** /*
   2:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   wiring_pulse.c - pulseIn() function
   3:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   Part of Arduino - http://www.arduino.cc/
   4:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
   5:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   Copyright (c) 2005-2006 David A. Mellis
   6:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
   7:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   This library is free software; you can redistribute it and/or
   8:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   modify it under the terms of the GNU Lesser General Public
   9:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   License as published by the Free Software Foundation; either
  10:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   version 2.1 of the License, or (at your option) any later version.
  11:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  12:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   This library is distributed in the hope that it will be useful,
  13:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   but WITHOUT ANY WARRANTY; without even the implied warranty of
  14:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   Lesser General Public License for more details.
  16:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  17:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   You should have received a copy of the GNU Lesser General
  18:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   Public License along with this library; if not, write to the
  19:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  20:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****   Boston, MA  02111-1307  USA
  21:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** */
  22:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  23:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** #include "wiring_private.h"
  24:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** #include "pins_arduino.h"
  25:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  26:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** /* Measures the length (in microseconds) of a pulse on the pin; state is HIGH
  27:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * or LOW, the type of pulse to measure.  Works on pulses from 2-3 microseconds
  28:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * to 3 minutes in length, but must be called at least a few dozen microseconds
  29:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * before the start of the pulse.
  30:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  *
  31:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * This function performs better with short pulses in noInterrupt() context
  32:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  */
  33:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout)
  34:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** {
  35:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// cache the port and bit of the pin in order to speed up the
  36:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// pulse width measuring loop and achieve finer resolution.  calling
  37:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// digitalRead() instead yields much coarser resolution.
  38:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	uint8_t bit = digitalPinToBitMask(pin);
  39:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	uint8_t port = digitalPinToPort(pin);
  40:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	uint8_t stateMask = (state ? bit : 0);
  41:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  42:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// convert the timeout from microseconds to a number of times through
  43:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// the initial loop; it takes approximately 16 clock cycles per iteration
  44:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	unsigned long maxloops = microsecondsToClockCycles(timeout)/16;
  45:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  46:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	unsigned long width = countPulseASM(portInputRegister(port), bit, stateMask, maxloops);
  47:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  48:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// prevent clockCyclesToMicroseconds to return bogus values if countPulseASM timed out
  49:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	if (width)
  50:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 		return clockCyclesToMicroseconds(width * 16 + 16);
  51:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	else
  52:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 		return 0;
  53:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** }
  54:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  55:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** /* Measures the length (in microseconds) of a pulse on the pin; state is HIGH
  56:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * or LOW, the type of pulse to measure.  Works on pulses from 2-3 microseconds
  57:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * to 3 minutes in length, but must be called at least a few dozen microseconds
  58:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * before the start of the pulse.
  59:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  *
  60:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * ATTENTION:
  61:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  * this function relies on micros() so cannot be used in noInterrupt() context
  62:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  */
  63:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout)
  64:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** {
 141               	.LM0:
 142               	.LFBB1:
 143 0000 4F92      		push r4
 144 0002 5F92      		push r5
 145 0004 6F92      		push r6
 146 0006 7F92      		push r7
 147 0008 8F92      		push r8
 148 000a 9F92      		push r9
 149 000c AF92      		push r10
 150 000e BF92      		push r11
 151 0010 CF92      		push r12
 152 0012 DF92      		push r13
 153 0014 EF92      		push r14
 154 0016 FF92      		push r15
 155 0018 0F93      		push r16
 156 001a 1F93      		push r17
 157 001c CF93      		push r28
 158 001e DF93      		push r29
 159               	/* prologue: function */
 160               	/* frame size = 0 */
 161               	/* stack size = 16 */
 162               	.L__stack_usage = 16
 163 0020 4901      		movw r8,r18
 164 0022 5A01      		movw r10,r20
 165               	.LBB2:
  65:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// cache the port and bit of the pin in order to speed up the
  66:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// pulse width measuring loop and achieve finer resolution.  calling
  67:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// digitalRead() instead yields much coarser resolution.
  68:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	uint8_t bit = digitalPinToBitMask(pin);
 167               	.LM1:
 168 0024 90E0      		ldi r25,0
 169 0026 FC01      		movw r30,r24
 170 0028 E050      		subi r30,lo8(-(digital_pin_to_bit_mask_PGM))
 171 002a F040      		sbci r31,hi8(-(digital_pin_to_bit_mask_PGM))
 172               	/* #APP */
 173               	 ;  68 "/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino
 174 002c 1491      		lpm r17, Z
 175               		
 176               	 ;  0 "" 2
 177               	/* #NOAPP */
 178               	.LBE2:
 179               	.LBB3:
  69:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	uint8_t port = digitalPinToPort(pin);
 181               	.LM2:
 182 002e FC01      		movw r30,r24
 183 0030 E050      		subi r30,lo8(-(digital_pin_to_port_PGM))
 184 0032 F040      		sbci r31,hi8(-(digital_pin_to_port_PGM))
 185               	/* #APP */
 186               	 ;  69 "/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino
 187 0034 C491      		lpm r28, Z
 188               		
 189               	 ;  0 "" 2
 190               	/* #NOAPP */
 191               	.LBE3:
  70:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	uint8_t stateMask = (state ? bit : 0);
 193               	.LM3:
 194 0036 6623      		tst r22
 195 0038 01F0      		breq .L11
 196 003a 012F      		mov r16,r17
 197 003c 00C0      		rjmp .L2
 198               	.L11:
 199 003e 00E0      		ldi r16,0
 200               	.L2:
  71:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  72:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	unsigned long startMicros = micros();
 202               	.LM4:
 203 0040 0E94 0000 		call micros
 204 0044 6B01      		movw r12,r22
 205 0046 7C01      		movw r14,r24
 206               	.LBB4:
  73:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  74:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// wait for any previous pulse to end
  75:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	while ((*portInputRegister(port) & bit) == stateMask) {
 208               	.LM5:
 209 0048 D0E0      		ldi r29,0
 210 004a CC0F      		lsl r28
 211 004c DD1F      		rol r29
 212 004e C050      		subi r28,lo8(-(port_to_input_PGM))
 213 0050 D040      		sbci r29,hi8(-(port_to_input_PGM))
 214               	.L3:
 216               	.LM6:
 217 0052 FE01      		movw r30,r28
 218               	/* #APP */
 219               	 ;  75 "/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino
 220 0054 A591      		lpm r26, Z+
 221 0056 B491      		lpm r27, Z
 222               		
 223               	 ;  0 "" 2
 224               	/* #NOAPP */
 225               	.LBE4:
 226 0058 8C91      		ld r24,X
 227 005a 8123      		and r24,r17
 228 005c 0813      		cpse r16,r24
 229 005e 00C0      		rjmp .L6
  76:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 		if (micros() - startMicros > timeout)
 231               	.LM7:
 232 0060 0E94 0000 		call micros
 233 0064 DC01      		movw r26,r24
 234 0066 CB01      		movw r24,r22
 235 0068 8C19      		sub r24,r12
 236 006a 9D09      		sbc r25,r13
 237 006c AE09      		sbc r26,r14
 238 006e BF09      		sbc r27,r15
 239 0070 8816      		cp r8,r24
 240 0072 9906      		cpc r9,r25
 241 0074 AA06      		cpc r10,r26
 242 0076 BB06      		cpc r11,r27
 243 0078 00F4      		brsh .L3
 244               	.L7:
  77:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 			return 0;
 246               	.LM8:
 247 007a 60E0      		ldi r22,0
 248 007c 70E0      		ldi r23,0
 249 007e CB01      		movw r24,r22
 250 0080 00C0      		rjmp .L4
 251               	.L8:
  78:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	}
  79:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  80:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// wait for the pulse to start
  81:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	while ((*portInputRegister(port) & bit) != stateMask) {
  82:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 		if (micros() - startMicros > timeout)
 253               	.LM9:
 254 0082 0E94 0000 		call micros
 255 0086 DC01      		movw r26,r24
 256 0088 CB01      		movw r24,r22
 257 008a 8C19      		sub r24,r12
 258 008c 9D09      		sbc r25,r13
 259 008e AE09      		sbc r26,r14
 260 0090 BF09      		sbc r27,r15
 261 0092 8816      		cp r8,r24
 262 0094 9906      		cpc r9,r25
 263 0096 AA06      		cpc r10,r26
 264 0098 BB06      		cpc r11,r27
 265 009a 00F0      		brlo .L7
 266               	.L6:
 267               	.LBB5:
  81:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 		if (micros() - startMicros > timeout)
 269               	.LM10:
 270 009c FE01      		movw r30,r28
 271               	/* #APP */
 272               	 ;  81 "/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino
 273 009e A591      		lpm r26, Z+
 274 00a0 B491      		lpm r27, Z
 275               		
 276               	 ;  0 "" 2
 277               	/* #NOAPP */
 278               	.LBE5:
 279 00a2 8C91      		ld r24,X
 280 00a4 8123      		and r24,r17
 281 00a6 0813      		cpse r16,r24
 282 00a8 00C0      		rjmp .L8
  83:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 			return 0;
  84:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	}
  85:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  86:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	unsigned long start = micros();
 284               	.LM11:
 285 00aa 0E94 0000 		call micros
 286 00ae 2B01      		movw r4,r22
 287 00b0 3C01      		movw r6,r24
 288               	.L9:
 289               	.LBB6:
  87:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// wait for the pulse to stop
  88:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	while ((*portInputRegister(port) & bit) == stateMask) {
 291               	.LM12:
 292 00b2 FE01      		movw r30,r28
 293               	/* #APP */
 294               	 ;  88 "/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino
 295 00b4 A591      		lpm r26, Z+
 296 00b6 B491      		lpm r27, Z
 297               		
 298               	 ;  0 "" 2
 299               	/* #NOAPP */
 300               	.LBE6:
 301 00b8 8C91      		ld r24,X
 302 00ba 8123      		and r24,r17
 303 00bc 0813      		cpse r16,r24
 304 00be 00C0      		rjmp .L14
  89:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 		if (micros() - startMicros > timeout)
 306               	.LM13:
 307 00c0 0E94 0000 		call micros
 308 00c4 DC01      		movw r26,r24
 309 00c6 CB01      		movw r24,r22
 310 00c8 8C19      		sub r24,r12
 311 00ca 9D09      		sbc r25,r13
 312 00cc AE09      		sbc r26,r14
 313 00ce BF09      		sbc r27,r15
 314 00d0 8816      		cp r8,r24
 315 00d2 9906      		cpc r9,r25
 316 00d4 AA06      		cpc r10,r26
 317 00d6 BB06      		cpc r11,r27
 318 00d8 00F4      		brsh .L9
 319 00da 00C0      		rjmp .L7
 320               	.L14:
  90:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 			return 0;
  91:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	}
  92:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	return micros() - start;
 322               	.LM14:
 323 00dc 0E94 0000 		call micros
 324 00e0 6419      		sub r22,r4
 325 00e2 7509      		sbc r23,r5
 326 00e4 8609      		sbc r24,r6
 327 00e6 9709      		sbc r25,r7
 328               	.L4:
 329               	/* epilogue start */
  93:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** }
 331               	.LM15:
 332 00e8 DF91      		pop r29
 333 00ea CF91      		pop r28
 334 00ec 1F91      		pop r17
 335 00ee 0F91      		pop r16
 336 00f0 FF90      		pop r15
 337 00f2 EF90      		pop r14
 338 00f4 DF90      		pop r13
 339 00f6 CF90      		pop r12
 340 00f8 BF90      		pop r11
 341 00fa AF90      		pop r10
 342 00fc 9F90      		pop r9
 343 00fe 8F90      		pop r8
 344 0100 7F90      		pop r7
 345 0102 6F90      		pop r6
 346 0104 5F90      		pop r5
 347 0106 4F90      		pop r4
 348 0108 0895      		ret
 355               	.Lscope1:
 357               		.stabd	78,0,0
 363               	.global	countPulseASM
 365               	countPulseASM:
 366               		.stabd	46,0,0
  94:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  95:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** #include <Arduino.h>
  96:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** #include <stdlib.h>
  97:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
  98:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** unsigned long countPulseASM(volatile uint8_t *port, uint8_t bit, uint8_t stateMask, unsigned long m
  99:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  {
 368               	.LM16:
 369               	.LFBB2:
 370 010a CF92      		push r12
 371 010c DF92      		push r13
 372 010e EF92      		push r14
 373 0110 FF92      		push r15
 374 0112 0F93      		push r16
 375 0114 1F93      		push r17
 376               	/* prologue: function */
 377               	/* frame size = 0 */
 378               	/* stack size = 6 */
 379               	.L__stack_usage = 6
 380 0116 FC01      		movw r30,r24
 381               	.L16:
 100:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****      unsigned long width = 0;
 101:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****      // wait for any previous pulse to end
 102:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****      while ((*port & bit) == stateMask)
 383               	.LM17:
 384 0118 8081      		ld r24,Z
 385 011a 8623      		and r24,r22
 386 011c 8413      		cpse r24,r20
 387 011e 00C0      		rjmp .L20
 103:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****          if (--maxloops == 0)
 389               	.LM18:
 390 0120 0150      		subi r16,1
 391 0122 1109      		sbc r17,__zero_reg__
 392 0124 2109      		sbc r18,__zero_reg__
 393 0126 3109      		sbc r19,__zero_reg__
 394 0128 01F4      		brne .L16
 395 012a 00C0      		rjmp .L27
 396               	.L21:
 104:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****              return 0;
 105:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
 106:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****      // wait for the pulse to start
 107:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****      while ((*port & bit) != stateMask)
 108:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****          if (--maxloops == 0)
 398               	.LM19:
 399 012c 0150      		subi r16,1
 400 012e 1109      		sbc r17,__zero_reg__
 401 0130 2109      		sbc r18,__zero_reg__
 402 0132 3109      		sbc r19,__zero_reg__
 403 0134 01F0      		breq .L27
 404               	.L20:
 107:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****          if (--maxloops == 0)
 406               	.LM20:
 407 0136 8081      		ld r24,Z
 408 0138 8623      		and r24,r22
 409 013a 4813      		cpse r20,r24
 410 013c 00C0      		rjmp .L21
 411 013e C12C      		mov r12,__zero_reg__
 412 0140 D12C      		mov r13,__zero_reg__
 413 0142 7601      		movw r14,r12
 414               	.L23:
 109:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****              return 0;
 110:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
 111:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****       // wait for the pulse to stop
 112:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****       while ((*port & bit) == stateMask) {
 416               	.LM21:
 417 0144 9081      		ld r25,Z
 418 0146 9623      		and r25,r22
 419 0148 4913      		cpse r20,r25
 420 014a 00C0      		rjmp .L28
 113:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****           if (++width == maxloops)
 422               	.LM22:
 423 014c 8FEF      		ldi r24,-1
 424 014e C81A      		sub r12,r24
 425 0150 D80A      		sbc r13,r24
 426 0152 E80A      		sbc r14,r24
 427 0154 F80A      		sbc r15,r24
 428 0156 0C15      		cp r16,r12
 429 0158 1D05      		cpc r17,r13
 430 015a 2E05      		cpc r18,r14
 431 015c 3F05      		cpc r19,r15
 432 015e 01F4      		brne .L23
 433 0160 00C0      		rjmp .L27
 434               	.L28:
 435 0162 B601      		movw r22,r12
 436 0164 C701      		movw r24,r14
 437 0166 00C0      		rjmp .L17
 438               	.L27:
 104:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
 440               	.LM23:
 441 0168 60E0      		ldi r22,0
 442 016a 70E0      		ldi r23,0
 443 016c 80E0      		ldi r24,0
 444 016e 90E0      		ldi r25,0
 445               	.L17:
 446               	/* epilogue start */
 114:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****               return 0;
 115:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****       }
 116:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****       return width;
 117:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c ****  }
 448               	.LM24:
 449 0170 1F91      		pop r17
 450 0172 0F91      		pop r16
 451 0174 FF90      		pop r15
 452 0176 EF90      		pop r14
 453 0178 DF90      		pop r13
 454 017a CF90      		pop r12
 455 017c 0895      		ret
 460               	.Lscope2:
 462               		.stabd	78,0,0
 467               	.global	pulseIn
 469               	pulseIn:
 470               		.stabd	46,0,0
  34:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	// cache the port and bit of the pin in order to speed up the
 472               	.LM25:
 473               	.LFBB3:
 474 017e 0F93      		push r16
 475 0180 1F93      		push r17
 476               	/* prologue: function */
 477               	/* frame size = 0 */
 478               	/* stack size = 2 */
 479               	.L__stack_usage = 2
 480               	.LBB7:
  38:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	uint8_t port = digitalPinToPort(pin);
 482               	.LM26:
 483 0182 90E0      		ldi r25,0
 484 0184 FC01      		movw r30,r24
 485 0186 E050      		subi r30,lo8(-(digital_pin_to_bit_mask_PGM))
 486 0188 F040      		sbci r31,hi8(-(digital_pin_to_bit_mask_PGM))
 487               	/* #APP */
 488               	 ;  38 "/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino
 489 018a 7491      		lpm r23, Z
 490               		
 491               	 ;  0 "" 2
 492               	/* #NOAPP */
 493               	.LBE7:
 494               	.LBB8:
  39:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	uint8_t stateMask = (state ? bit : 0);
 496               	.LM27:
 497 018c FC01      		movw r30,r24
 498 018e E050      		subi r30,lo8(-(digital_pin_to_port_PGM))
 499 0190 F040      		sbci r31,hi8(-(digital_pin_to_port_PGM))
 500               	/* #APP */
 501               	 ;  39 "/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino
 502 0192 E491      		lpm r30, Z
 503               		
 504               	 ;  0 "" 2
 505               	/* #NOAPP */
 506               	.LBE8:
  40:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
 508               	.LM28:
 509 0194 6623      		tst r22
 510 0196 01F0      		breq .L32
 511 0198 672F      		mov r22,r23
 512 019a 00C0      		rjmp .L30
 513               	.L32:
 514 019c 60E0      		ldi r22,0
 515               	.L30:
 516               	.LBB9:
  46:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
 518               	.LM29:
 519 019e F0E0      		ldi r31,0
 520 01a0 EE0F      		lsl r30
 521 01a2 FF1F      		rol r31
 522 01a4 E050      		subi r30,lo8(-(port_to_input_PGM))
 523 01a6 F040      		sbci r31,hi8(-(port_to_input_PGM))
 524               	/* #APP */
 525               	 ;  46 "/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino
 526 01a8 8591      		lpm r24, Z+
 527 01aa 9491      		lpm r25, Z
 528               		
 529               	 ;  0 "" 2
 530               	/* #NOAPP */
 531               	.LBE9:
 532 01ac 8901      		movw r16,r18
 533 01ae 9A01      		movw r18,r20
 534 01b0 3F70      		andi r19,15
 535 01b2 462F      		mov r20,r22
 536 01b4 672F      		mov r22,r23
 537 01b6 0E94 0000 		call countPulseASM
  49:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 		return clockCyclesToMicroseconds(width * 16 + 16);
 539               	.LM30:
 540 01ba 6115      		cp r22,__zero_reg__
 541 01bc 7105      		cpc r23,__zero_reg__
 542 01be 8105      		cpc r24,__zero_reg__
 543 01c0 9105      		cpc r25,__zero_reg__
 544 01c2 01F0      		breq .L33
  50:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 	else
 546               	.LM31:
 547 01c4 DC01      		movw r26,r24
 548 01c6 CB01      		movw r24,r22
 549 01c8 0196      		adiw r24,1
 550 01ca A11D      		adc r26,__zero_reg__
 551 01cc B11D      		adc r27,__zero_reg__
 552 01ce BC01      		movw r22,r24
 553 01d0 CD01      		movw r24,r26
 554 01d2 9F70      		andi r25,15
 555 01d4 00C0      		rjmp .L31
 556               	.L33:
  52:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** }
 558               	.LM32:
 559 01d6 60E0      		ldi r22,0
 560 01d8 70E0      		ldi r23,0
 561 01da CB01      		movw r24,r22
 562               	.L31:
 563               	/* epilogue start */
  53:/home/mrh/Downloads/arduino-1.8.8-linux64/arduino-1.8.8//hardware/arduino/avr/cores/arduino/wiring_pulse.c **** 
 565               	.LM33:
 566 01dc 1F91      		pop r17
 567 01de 0F91      		pop r16
 568 01e0 0895      		ret
 577               	.Lscope3:
 579               		.stabd	78,0,0
 595               	.Letext0:
 596               		.ident	"GCC: (GNU) 5.4.0"
DEFINED SYMBOLS
                            *ABS*:0000000000000000 wiring_pulse.c
     /tmp/cctF37QZ.s:2      *ABS*:000000000000003e __SP_H__
     /tmp/cctF37QZ.s:3      *ABS*:000000000000003d __SP_L__
     /tmp/cctF37QZ.s:4      *ABS*:000000000000003f __SREG__
     /tmp/cctF37QZ.s:5      *ABS*:0000000000000000 __tmp_reg__
     /tmp/cctF37QZ.s:6      *ABS*:0000000000000001 __zero_reg__
     /tmp/cctF37QZ.s:138    .text:0000000000000000 pulseInLong
     /tmp/cctF37QZ.s:365    .text:000000000000010a countPulseASM
     /tmp/cctF37QZ.s:469    .text:000000000000017e pulseIn

UNDEFINED SYMBOLS
digital_pin_to_bit_mask_PGM
digital_pin_to_port_PGM
micros
port_to_input_PGM
