
;CodeVisionAVR C Compiler V2.05.0 Professional
;(C) Copyright 1998-2010 Pavel Haiduc, HP InfoTech s.r.l.
;http://www.hpinfotech.com

;Chip type                : ATmega644
;Program type             : Application
;Clock frequency          : 8.000000 MHz
;Memory model             : Small
;Optimize for             : Size
;(s)printf features       : int, width
;(s)scanf features        : int, width
;External RAM size        : 0
;Data Stack size          : 1024 byte(s)
;Heap size                : 0 byte(s)
;Promote 'char' to 'int'  : Yes
;'char' is unsigned       : Yes
;8 bit enums              : Yes
;global 'const' stored in FLASH: No
;Enhanced core instructions    : On
;Smart register allocation     : On
;Automatic register allocation : On

	#pragma AVRPART ADMIN PART_NAME ATmega644
	#pragma AVRPART MEMORY PROG_FLASH 65536
	#pragma AVRPART MEMORY EEPROM 2048
	#pragma AVRPART MEMORY INT_SRAM SIZE 4351
	#pragma AVRPART MEMORY INT_SRAM START_ADDR 0x100

	#define CALL_SUPPORTED 1

	.LISTMAC
	.EQU EERE=0x0
	.EQU EEWE=0x1
	.EQU EEMWE=0x2
	.EQU UDRE=0x5
	.EQU RXC=0x7
	.EQU EECR=0x1F
	.EQU EEDR=0x20
	.EQU EEARL=0x21
	.EQU EEARH=0x22
	.EQU SPSR=0x2D
	.EQU SPDR=0x2E
	.EQU SMCR=0x33
	.EQU MCUSR=0x34
	.EQU MCUCR=0x35
	.EQU WDTCSR=0x60
	.EQU UCSR0A=0xC0
	.EQU UDR0=0xC6
	.EQU SPL=0x3D
	.EQU SPH=0x3E
	.EQU SREG=0x3F
	.EQU GPIOR0=0x1E

	.DEF R0X0=R0
	.DEF R0X1=R1
	.DEF R0X2=R2
	.DEF R0X3=R3
	.DEF R0X4=R4
	.DEF R0X5=R5
	.DEF R0X6=R6
	.DEF R0X7=R7
	.DEF R0X8=R8
	.DEF R0X9=R9
	.DEF R0XA=R10
	.DEF R0XB=R11
	.DEF R0XC=R12
	.DEF R0XD=R13
	.DEF R0XE=R14
	.DEF R0XF=R15
	.DEF R0X10=R16
	.DEF R0X11=R17
	.DEF R0X12=R18
	.DEF R0X13=R19
	.DEF R0X14=R20
	.DEF R0X15=R21
	.DEF R0X16=R22
	.DEF R0X17=R23
	.DEF R0X18=R24
	.DEF R0X19=R25
	.DEF R0X1A=R26
	.DEF R0X1B=R27
	.DEF R0X1C=R28
	.DEF R0X1D=R29
	.DEF R0X1E=R30
	.DEF R0X1F=R31

	.EQU __SRAM_START=0x0100
	.EQU __SRAM_END=0x10FF
	.EQU __DSTACK_SIZE=0x0400
	.EQU __HEAP_SIZE=0x0000
	.EQU __CLEAR_SRAM_SIZE=__SRAM_END-__SRAM_START+1

	.MACRO __CPD1N
	CPI  R30,LOW(@0)
	LDI  R26,HIGH(@0)
	CPC  R31,R26
	LDI  R26,BYTE3(@0)
	CPC  R22,R26
	LDI  R26,BYTE4(@0)
	CPC  R23,R26
	.ENDM

	.MACRO __CPD2N
	CPI  R26,LOW(@0)
	LDI  R30,HIGH(@0)
	CPC  R27,R30
	LDI  R30,BYTE3(@0)
	CPC  R24,R30
	LDI  R30,BYTE4(@0)
	CPC  R25,R30
	.ENDM

	.MACRO __CPWRR
	CP   R@0,R@2
	CPC  R@1,R@3
	.ENDM

	.MACRO __CPWRN
	CPI  R@0,LOW(@2)
	LDI  R30,HIGH(@2)
	CPC  R@1,R30
	.ENDM

	.MACRO __ADDB1MN
	SUBI R30,LOW(-@0-(@1))
	.ENDM

	.MACRO __ADDB2MN
	SUBI R26,LOW(-@0-(@1))
	.ENDM

	.MACRO __ADDW1MN
	SUBI R30,LOW(-@0-(@1))
	SBCI R31,HIGH(-@0-(@1))
	.ENDM

	.MACRO __ADDW2MN
	SUBI R26,LOW(-@0-(@1))
	SBCI R27,HIGH(-@0-(@1))
	.ENDM

	.MACRO __ADDW1FN
	SUBI R30,LOW(-2*@0-(@1))
	SBCI R31,HIGH(-2*@0-(@1))
	.ENDM

	.MACRO __ADDD1FN
	SUBI R30,LOW(-2*@0-(@1))
	SBCI R31,HIGH(-2*@0-(@1))
	SBCI R22,BYTE3(-2*@0-(@1))
	.ENDM

	.MACRO __ADDD1N
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	SBCI R22,BYTE3(-@0)
	SBCI R23,BYTE4(-@0)
	.ENDM

	.MACRO __ADDD2N
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	SBCI R24,BYTE3(-@0)
	SBCI R25,BYTE4(-@0)
	.ENDM

	.MACRO __SUBD1N
	SUBI R30,LOW(@0)
	SBCI R31,HIGH(@0)
	SBCI R22,BYTE3(@0)
	SBCI R23,BYTE4(@0)
	.ENDM

	.MACRO __SUBD2N
	SUBI R26,LOW(@0)
	SBCI R27,HIGH(@0)
	SBCI R24,BYTE3(@0)
	SBCI R25,BYTE4(@0)
	.ENDM

	.MACRO __ANDBMNN
	LDS  R30,@0+(@1)
	ANDI R30,LOW(@2)
	STS  @0+(@1),R30
	.ENDM

	.MACRO __ANDWMNN
	LDS  R30,@0+(@1)
	ANDI R30,LOW(@2)
	STS  @0+(@1),R30
	LDS  R30,@0+(@1)+1
	ANDI R30,HIGH(@2)
	STS  @0+(@1)+1,R30
	.ENDM

	.MACRO __ANDD1N
	ANDI R30,LOW(@0)
	ANDI R31,HIGH(@0)
	ANDI R22,BYTE3(@0)
	ANDI R23,BYTE4(@0)
	.ENDM

	.MACRO __ANDD2N
	ANDI R26,LOW(@0)
	ANDI R27,HIGH(@0)
	ANDI R24,BYTE3(@0)
	ANDI R25,BYTE4(@0)
	.ENDM

	.MACRO __ORBMNN
	LDS  R30,@0+(@1)
	ORI  R30,LOW(@2)
	STS  @0+(@1),R30
	.ENDM

	.MACRO __ORWMNN
	LDS  R30,@0+(@1)
	ORI  R30,LOW(@2)
	STS  @0+(@1),R30
	LDS  R30,@0+(@1)+1
	ORI  R30,HIGH(@2)
	STS  @0+(@1)+1,R30
	.ENDM

	.MACRO __ORD1N
	ORI  R30,LOW(@0)
	ORI  R31,HIGH(@0)
	ORI  R22,BYTE3(@0)
	ORI  R23,BYTE4(@0)
	.ENDM

	.MACRO __ORD2N
	ORI  R26,LOW(@0)
	ORI  R27,HIGH(@0)
	ORI  R24,BYTE3(@0)
	ORI  R25,BYTE4(@0)
	.ENDM

	.MACRO __DELAY_USB
	LDI  R24,LOW(@0)
__DELAY_USB_LOOP:
	DEC  R24
	BRNE __DELAY_USB_LOOP
	.ENDM

	.MACRO __DELAY_USW
	LDI  R24,LOW(@0)
	LDI  R25,HIGH(@0)
__DELAY_USW_LOOP:
	SBIW R24,1
	BRNE __DELAY_USW_LOOP
	.ENDM

	.MACRO __GETD1S
	LDD  R30,Y+@0
	LDD  R31,Y+@0+1
	LDD  R22,Y+@0+2
	LDD  R23,Y+@0+3
	.ENDM

	.MACRO __GETD2S
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	LDD  R24,Y+@0+2
	LDD  R25,Y+@0+3
	.ENDM

	.MACRO __PUTD1S
	STD  Y+@0,R30
	STD  Y+@0+1,R31
	STD  Y+@0+2,R22
	STD  Y+@0+3,R23
	.ENDM

	.MACRO __PUTD2S
	STD  Y+@0,R26
	STD  Y+@0+1,R27
	STD  Y+@0+2,R24
	STD  Y+@0+3,R25
	.ENDM

	.MACRO __PUTDZ2
	STD  Z+@0,R26
	STD  Z+@0+1,R27
	STD  Z+@0+2,R24
	STD  Z+@0+3,R25
	.ENDM

	.MACRO __CLRD1S
	STD  Y+@0,R30
	STD  Y+@0+1,R30
	STD  Y+@0+2,R30
	STD  Y+@0+3,R30
	.ENDM

	.MACRO __POINTB1MN
	LDI  R30,LOW(@0+(@1))
	.ENDM

	.MACRO __POINTW1MN
	LDI  R30,LOW(@0+(@1))
	LDI  R31,HIGH(@0+(@1))
	.ENDM

	.MACRO __POINTD1M
	LDI  R30,LOW(@0)
	LDI  R31,HIGH(@0)
	LDI  R22,BYTE3(@0)
	LDI  R23,BYTE4(@0)
	.ENDM

	.MACRO __POINTW1FN
	LDI  R30,LOW(2*@0+(@1))
	LDI  R31,HIGH(2*@0+(@1))
	.ENDM

	.MACRO __POINTD1FN
	LDI  R30,LOW(2*@0+(@1))
	LDI  R31,HIGH(2*@0+(@1))
	LDI  R22,BYTE3(2*@0+(@1))
	LDI  R23,BYTE4(2*@0+(@1))
	.ENDM

	.MACRO __POINTB2MN
	LDI  R26,LOW(@0+(@1))
	.ENDM

	.MACRO __POINTW2MN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	.ENDM

	.MACRO __POINTBRM
	LDI  R@0,LOW(@1)
	.ENDM

	.MACRO __POINTWRM
	LDI  R@0,LOW(@2)
	LDI  R@1,HIGH(@2)
	.ENDM

	.MACRO __POINTBRMN
	LDI  R@0,LOW(@1+(@2))
	.ENDM

	.MACRO __POINTWRMN
	LDI  R@0,LOW(@2+(@3))
	LDI  R@1,HIGH(@2+(@3))
	.ENDM

	.MACRO __POINTWRFN
	LDI  R@0,LOW(@2*2+(@3))
	LDI  R@1,HIGH(@2*2+(@3))
	.ENDM

	.MACRO __GETD1N
	LDI  R30,LOW(@0)
	LDI  R31,HIGH(@0)
	LDI  R22,BYTE3(@0)
	LDI  R23,BYTE4(@0)
	.ENDM

	.MACRO __GETD2N
	LDI  R26,LOW(@0)
	LDI  R27,HIGH(@0)
	LDI  R24,BYTE3(@0)
	LDI  R25,BYTE4(@0)
	.ENDM

	.MACRO __GETB1MN
	LDS  R30,@0+(@1)
	.ENDM

	.MACRO __GETB1HMN
	LDS  R31,@0+(@1)
	.ENDM

	.MACRO __GETW1MN
	LDS  R30,@0+(@1)
	LDS  R31,@0+(@1)+1
	.ENDM

	.MACRO __GETD1MN
	LDS  R30,@0+(@1)
	LDS  R31,@0+(@1)+1
	LDS  R22,@0+(@1)+2
	LDS  R23,@0+(@1)+3
	.ENDM

	.MACRO __GETBRMN
	LDS  R@0,@1+(@2)
	.ENDM

	.MACRO __GETWRMN
	LDS  R@0,@2+(@3)
	LDS  R@1,@2+(@3)+1
	.ENDM

	.MACRO __GETWRZ
	LDD  R@0,Z+@2
	LDD  R@1,Z+@2+1
	.ENDM

	.MACRO __GETD2Z
	LDD  R26,Z+@0
	LDD  R27,Z+@0+1
	LDD  R24,Z+@0+2
	LDD  R25,Z+@0+3
	.ENDM

	.MACRO __GETB2MN
	LDS  R26,@0+(@1)
	.ENDM

	.MACRO __GETW2MN
	LDS  R26,@0+(@1)
	LDS  R27,@0+(@1)+1
	.ENDM

	.MACRO __GETD2MN
	LDS  R26,@0+(@1)
	LDS  R27,@0+(@1)+1
	LDS  R24,@0+(@1)+2
	LDS  R25,@0+(@1)+3
	.ENDM

	.MACRO __PUTB1MN
	STS  @0+(@1),R30
	.ENDM

	.MACRO __PUTW1MN
	STS  @0+(@1),R30
	STS  @0+(@1)+1,R31
	.ENDM

	.MACRO __PUTD1MN
	STS  @0+(@1),R30
	STS  @0+(@1)+1,R31
	STS  @0+(@1)+2,R22
	STS  @0+(@1)+3,R23
	.ENDM

	.MACRO __PUTB1EN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	CALL __EEPROMWRB
	.ENDM

	.MACRO __PUTW1EN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	CALL __EEPROMWRW
	.ENDM

	.MACRO __PUTD1EN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	CALL __EEPROMWRD
	.ENDM

	.MACRO __PUTBR0MN
	STS  @0+(@1),R0
	.ENDM

	.MACRO __PUTBMRN
	STS  @0+(@1),R@2
	.ENDM

	.MACRO __PUTWMRN
	STS  @0+(@1),R@2
	STS  @0+(@1)+1,R@3
	.ENDM

	.MACRO __PUTBZR
	STD  Z+@1,R@0
	.ENDM

	.MACRO __PUTWZR
	STD  Z+@2,R@0
	STD  Z+@2+1,R@1
	.ENDM

	.MACRO __GETW1R
	MOV  R30,R@0
	MOV  R31,R@1
	.ENDM

	.MACRO __GETW2R
	MOV  R26,R@0
	MOV  R27,R@1
	.ENDM

	.MACRO __GETWRN
	LDI  R@0,LOW(@2)
	LDI  R@1,HIGH(@2)
	.ENDM

	.MACRO __PUTW1R
	MOV  R@0,R30
	MOV  R@1,R31
	.ENDM

	.MACRO __PUTW2R
	MOV  R@0,R26
	MOV  R@1,R27
	.ENDM

	.MACRO __ADDWRN
	SUBI R@0,LOW(-@2)
	SBCI R@1,HIGH(-@2)
	.ENDM

	.MACRO __ADDWRR
	ADD  R@0,R@2
	ADC  R@1,R@3
	.ENDM

	.MACRO __SUBWRN
	SUBI R@0,LOW(@2)
	SBCI R@1,HIGH(@2)
	.ENDM

	.MACRO __SUBWRR
	SUB  R@0,R@2
	SBC  R@1,R@3
	.ENDM

	.MACRO __ANDWRN
	ANDI R@0,LOW(@2)
	ANDI R@1,HIGH(@2)
	.ENDM

	.MACRO __ANDWRR
	AND  R@0,R@2
	AND  R@1,R@3
	.ENDM

	.MACRO __ORWRN
	ORI  R@0,LOW(@2)
	ORI  R@1,HIGH(@2)
	.ENDM

	.MACRO __ORWRR
	OR   R@0,R@2
	OR   R@1,R@3
	.ENDM

	.MACRO __EORWRR
	EOR  R@0,R@2
	EOR  R@1,R@3
	.ENDM

	.MACRO __GETWRS
	LDD  R@0,Y+@2
	LDD  R@1,Y+@2+1
	.ENDM

	.MACRO __PUTBSR
	STD  Y+@1,R@0
	.ENDM

	.MACRO __PUTWSR
	STD  Y+@2,R@0
	STD  Y+@2+1,R@1
	.ENDM

	.MACRO __MOVEWRR
	MOV  R@0,R@2
	MOV  R@1,R@3
	.ENDM

	.MACRO __INWR
	IN   R@0,@2
	IN   R@1,@2+1
	.ENDM

	.MACRO __OUTWR
	OUT  @2+1,R@1
	OUT  @2,R@0
	.ENDM

	.MACRO __CALL1MN
	LDS  R30,@0+(@1)
	LDS  R31,@0+(@1)+1
	ICALL
	.ENDM

	.MACRO __CALL1FN
	LDI  R30,LOW(2*@0+(@1))
	LDI  R31,HIGH(2*@0+(@1))
	CALL __GETW1PF
	ICALL
	.ENDM

	.MACRO __CALL2EN
	LDI  R26,LOW(@0+(@1))
	LDI  R27,HIGH(@0+(@1))
	CALL __EEPROMRDW
	ICALL
	.ENDM

	.MACRO __GETW1STACK
	IN   R26,SPL
	IN   R27,SPH
	ADIW R26,@0+1
	LD   R30,X+
	LD   R31,X
	.ENDM

	.MACRO __GETD1STACK
	IN   R26,SPL
	IN   R27,SPH
	ADIW R26,@0+1
	LD   R30,X+
	LD   R31,X+
	LD   R22,X
	.ENDM

	.MACRO __NBST
	BST  R@0,@1
	IN   R30,SREG
	LDI  R31,0x40
	EOR  R30,R31
	OUT  SREG,R30
	.ENDM


	.MACRO __PUTB1SN
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1SN
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1SN
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1SNS
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	ADIW R26,@1
	ST   X,R30
	.ENDM

	.MACRO __PUTW1SNS
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	ADIW R26,@1
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1SNS
	LDD  R26,Y+@0
	LDD  R27,Y+@0+1
	ADIW R26,@1
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1PMN
	LDS  R26,@0
	LDS  R27,@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1PMN
	LDS  R26,@0
	LDS  R27,@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1PMN
	LDS  R26,@0
	LDS  R27,@0+1
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1PMNS
	LDS  R26,@0
	LDS  R27,@0+1
	ADIW R26,@1
	ST   X,R30
	.ENDM

	.MACRO __PUTW1PMNS
	LDS  R26,@0
	LDS  R27,@0+1
	ADIW R26,@1
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1PMNS
	LDS  R26,@0
	LDS  R27,@0+1
	ADIW R26,@1
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1RN
	MOVW R26,R@0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1RN
	MOVW R26,R@0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1RN
	MOVW R26,R@0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1RNS
	MOVW R26,R@0
	ADIW R26,@1
	ST   X,R30
	.ENDM

	.MACRO __PUTW1RNS
	MOVW R26,R@0
	ADIW R26,@1
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1RNS
	MOVW R26,R@0
	ADIW R26,@1
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1RON
	MOV  R26,R@0
	MOV  R27,R@1
	SUBI R26,LOW(-@2)
	SBCI R27,HIGH(-@2)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1RON
	MOV  R26,R@0
	MOV  R27,R@1
	SUBI R26,LOW(-@2)
	SBCI R27,HIGH(-@2)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1RON
	MOV  R26,R@0
	MOV  R27,R@1
	SUBI R26,LOW(-@2)
	SBCI R27,HIGH(-@2)
	CALL __PUTDP1
	.ENDM

	.MACRO __PUTB1RONS
	MOV  R26,R@0
	MOV  R27,R@1
	ADIW R26,@2
	ST   X,R30
	.ENDM

	.MACRO __PUTW1RONS
	MOV  R26,R@0
	MOV  R27,R@1
	ADIW R26,@2
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1RONS
	MOV  R26,R@0
	MOV  R27,R@1
	ADIW R26,@2
	CALL __PUTDP1
	.ENDM


	.MACRO __GETB1SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R30,Z
	.ENDM

	.MACRO __GETB1HSX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R31,Z
	.ENDM

	.MACRO __GETW1SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R0,Z+
	LD   R31,Z
	MOV  R30,R0
	.ENDM

	.MACRO __GETD1SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R0,Z+
	LD   R1,Z+
	LD   R22,Z+
	LD   R23,Z
	MOVW R30,R0
	.ENDM

	.MACRO __GETB2SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R26,X
	.ENDM

	.MACRO __GETW2SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R27,X
	MOV  R26,R0
	.ENDM

	.MACRO __GETD2SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R1,X+
	LD   R24,X+
	LD   R25,X
	MOVW R26,R0
	.ENDM

	.MACRO __GETBRSX
	MOVW R30,R28
	SUBI R30,LOW(-@1)
	SBCI R31,HIGH(-@1)
	LD   R@0,Z
	.ENDM

	.MACRO __GETWRSX
	MOVW R30,R28
	SUBI R30,LOW(-@2)
	SBCI R31,HIGH(-@2)
	LD   R@0,Z+
	LD   R@1,Z
	.ENDM

	.MACRO __GETBRSX2
	MOVW R26,R28
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	LD   R@0,X
	.ENDM

	.MACRO __GETWRSX2
	MOVW R26,R28
	SUBI R26,LOW(-@2)
	SBCI R27,HIGH(-@2)
	LD   R@0,X+
	LD   R@1,X
	.ENDM

	.MACRO __LSLW8SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	LD   R31,Z
	CLR  R30
	.ENDM

	.MACRO __PUTB1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X+,R30
	ST   X+,R31
	ST   X+,R22
	ST   X,R23
	.ENDM

	.MACRO __CLRW1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X+,R30
	ST   X,R30
	.ENDM

	.MACRO __CLRD1SX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	ST   X+,R30
	ST   X+,R30
	ST   X+,R30
	ST   X,R30
	.ENDM

	.MACRO __PUTB2SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	ST   Z,R26
	.ENDM

	.MACRO __PUTW2SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	ST   Z+,R26
	ST   Z,R27
	.ENDM

	.MACRO __PUTD2SX
	MOVW R30,R28
	SUBI R30,LOW(-@0)
	SBCI R31,HIGH(-@0)
	ST   Z+,R26
	ST   Z+,R27
	ST   Z+,R24
	ST   Z,R25
	.ENDM

	.MACRO __PUTBSRX
	MOVW R30,R28
	SUBI R30,LOW(-@1)
	SBCI R31,HIGH(-@1)
	ST   Z,R@0
	.ENDM

	.MACRO __PUTWSRX
	MOVW R30,R28
	SUBI R30,LOW(-@2)
	SBCI R31,HIGH(-@2)
	ST   Z+,R@0
	ST   Z,R@1
	.ENDM

	.MACRO __PUTB1SNX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R27,X
	MOV  R26,R0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X,R30
	.ENDM

	.MACRO __PUTW1SNX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R27,X
	MOV  R26,R0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X,R31
	.ENDM

	.MACRO __PUTD1SNX
	MOVW R26,R28
	SUBI R26,LOW(-@0)
	SBCI R27,HIGH(-@0)
	LD   R0,X+
	LD   R27,X
	MOV  R26,R0
	SUBI R26,LOW(-@1)
	SBCI R27,HIGH(-@1)
	ST   X+,R30
	ST   X+,R31
	ST   X+,R22
	ST   X,R23
	.ENDM

	.MACRO __MULBRR
	MULS R@0,R@1
	MOVW R30,R0
	.ENDM

	.MACRO __MULBRRU
	MUL  R@0,R@1
	MOVW R30,R0
	.ENDM

	.MACRO __MULBRR0
	MULS R@0,R@1
	.ENDM

	.MACRO __MULBRRU0
	MUL  R@0,R@1
	.ENDM

	.MACRO __MULBNWRU
	LDI  R26,@2
	MUL  R26,R@0
	MOVW R30,R0
	MUL  R26,R@1
	ADD  R31,R0
	.ENDM

;NAME DEFINITIONS FOR GLOBAL VARIABLES ALLOCATED TO REGISTERS
	.DEF __lcd_x=R4
	.DEF __lcd_y=R3
	.DEF __lcd_maxx=R6

;GPIOR0 INITIALIZATION VALUE
	.EQU __GPIOR0_INIT=0x00

	.CSEG
	.ORG 0x00

;START OF CODE MARKER
__START_OF_CODE:

;INTERRUPT VECTORS
	JMP  __RESET
	JMP  _ext_int0_isr
	JMP  _ext_int1_isr
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  _timer1_compa_isr
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  _timer0_ovf_isr
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00
	JMP  0x00

_sgn1:
	.DB  0x45,0x4B,0x47,0x20,0x31,0x0
_sgn2:
	.DB  0x4F,0x42,0x44,0x45,0x4C,0x4E,0x49,0x4B
	.DB  0x0
_sgn3:
	.DB  0x46,0x69,0x62,0x2E,0x73,0x69,0x6E,0x69
	.DB  0x0
_sgn4:
	.DB  0x53,0x49,0x4E,0x55,0x53,0x0
_sgn5:
	.DB  0x50,0x49,0x4C,0x41,0x0
_ecgwave1:
	.DB  0x2B,0x2B,0x2B,0x2B,0x2B,0x2A,0x2B,0x29
	.DB  0x2A,0x2A,0x29,0x2A,0x28,0x2B,0x2E,0x30
	.DB  0x35,0x37,0x36,0x32,0x2F,0x2E,0x2D,0x28
	.DB  0x27,0x26,0x26,0x26,0x25,0x26,0x27,0x28
	.DB  0x2B,0x2A,0x2B,0x32,0x53,0x91,0xC5,0x88
	.DB  0x2D,0x2C,0x2C,0x2D,0x2A,0x28,0x29,0x2A
	.DB  0x2B,0x2A,0x2C,0x2C,0x2D,0x2D,0x2F,0x32
	.DB  0x33,0x35,0x37,0x3A,0x3C,0x3F,0x44,0x49
	.DB  0x4D,0x51,0x54,0x55,0x57,0x55,0x50,0x48
	.DB  0x41,0x3A,0x33,0x2E,0x2B,0x28,0x28,0x27
	.DB  0x28,0x28,0x26,0x28,0x28,0x28,0x29,0x29
	.DB  0x29,0x2B,0x2A,0x2A,0x2A,0x28,0x2A,0x29
_obdelnik:
	.DB  0x2B,0x2B,0x2B,0x2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C,0x1D,0x1E,0x1F,0x20
	.DB  0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28
	.DB  0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,0x30
	.DB  0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38
	.DB  0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,0x40
	.DB  0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48
	.DB  0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50
	.DB  0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58
	.DB  0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,0x60
	.DB  0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68
	.DB  0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,0x70
	.DB  0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78
	.DB  0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,0x80
	.DB  0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88
	.DB  0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,0x90
	.DB  0x91,0x92,0x93,0x94,0x95,0x96,0x97,0x98
	.DB  0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,0xA0
	.DB  0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8
	.DB  0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,0xB0
	.DB  0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8
	.DB  0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,0xC0
	.DB  0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8
	.DB  0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,0xD0
	.DB  0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8
	.DB  0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,0xE0
	.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x64,0x64,0x63
	.DB  0x62,0x61,0x60,0x5F,0x5E,0x5D,0x5C,0x5B
	.DB  0x5A,0x59,0x58,0x57,0x56,0x55,0x55,0x54
	.DB  0x53,0x52,0x51,0x50,0x4F,0x4E,0x4D,0x4D
	.DB  0x4C,0x4B,0x4A,0x49,0x48,0x47,0x47,0x46
	.DB  0x45,0x44,0x43,0x43,0x42,0x41,0x40,0x3F
	.DB  0x3F,0x3E,0x3D,0x3C,0x3C,0x3B,0x3A,0x3A
	.DB  0x39,0x38,0x37,0x37,0x36,0x35,0x35,0x34
	.DB  0x33,0x33,0x32,0x31,0x31,0x30,0x30,0x2F
	.DB  0x2E,0x2E,0x2D,0x2D,0x2C,0x2B,0x2B,0x2A
	.DB  0x2A,0x29,0x29,0x28,0x28,0x27,0x27,0x26
	.DB  0x26,0x26,0x25,0x25,0x24,0x24,0x23,0x23
	.DB  0x23,0x22,0x22,0x21,0x21,0x21,0x20,0x20
	.DB  0x20,0x20,0x1F,0x1F,0x1F,0x1E,0x1E,0x1E
	.DB  0x1E,0x1D,0x1D,0x1D,0x1D,0x1D,0x1C,0x1C
	.DB  0x1C,0x1C,0x1C,0x1C,0x1C,0x1C,0x1B,0x1B
	.DB  0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B
	.DB  0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B,0x1B
	.DB  0x1B,0x1B,0x1C,0x1C,0x1C,0x1C,0x1C,0x1C
	.DB  0x1C,0x1D,0x1D,0x1D,0x1D,0x1D,0x1E,0x1E
	.DB  0x1E,0x1E,0x1F,0x1F,0x1F,0x1F,0x20,0x20
	.DB  0x20,0x21,0x21,0x21,0x22,0x22,0x22,0x23
	.DB  0x23,0x24,0x24,0x24,0x25,0x25,0x26,0x26
	.DB  0x27,0x27,0x28,0x28,0x29,0x29,0x2A,0x2A
	.DB  0x2B,0x2B,0x2C,0x2C,0x2D,0x2D,0x2E,0x2F
	.DB  0x2F,0x30,0x30,0x31,0x32,0x32,0x33,0x34
	.DB  0x34,0x35,0x36,0x36,0x37,0x38,0x38,0x39
	.DB  0x3A,0x3B,0x3B,0x3C,0x3D,0x3E,0x3E,0x3F
	.DB  0x40,0x41,0x41,0x42,0x43,0x44,0x45,0x45
	.DB  0x46,0x47,0x48,0x49,0x4A,0x4A,0x4B,0x4C
	.DB  0x4D,0x4E,0x4F,0x50,0x51,0x51,0x52,0x53
	.DB  0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B
	.DB  0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x62
	.DB  0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A
	.DB  0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72
	.DB  0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A
	.DB  0x7B,0x7C,0x7D,0x7E,0x7F

_0x3:
	.DB  0x1
_0x4:
	.DB  0x0,0x0,0x2,0x0,0x0,0x0,0x2
_0x0:
	.DB  0x56,0x79,0x62,0x65,0x72,0x20,0x73,0x69
	.DB  0x67,0x6E,0x61,0x6C,0x20,0x31,0x0,0x2C
	.DB  0x0,0x56,0x7A,0x6F,0x72,0x65,0x6B,0x3A
	.DB  0x0,0x50,0x6F,0x63,0x65,0x74,0x20,0x76
	.DB  0x7A,0x6F,0x72,0x6B,0x75,0x3A,0x0,0x20
	.DB  0x20,0x20,0x0,0x56,0x79,0x62,0x65,0x72
	.DB  0x20,0x73,0x69,0x67,0x6E,0x61,0x6C,0x20
	.DB  0x32,0x0,0x56,0x79,0x62,0x65,0x72,0x20
	.DB  0x73,0x69,0x67,0x6E,0x61,0x6C,0x20,0x33
	.DB  0x0,0x56,0x79,0x62,0x65,0x72,0x20,0x73
	.DB  0x69,0x67,0x6E,0x61,0x6C,0x20,0x34,0x0
	.DB  0x56,0x79,0x62,0x65,0x72,0x20,0x73,0x69
	.DB  0x67,0x6E,0x61,0x6C,0x20,0x35,0x0,0x54
	.DB  0x65,0x70,0x6F,0x76,0x61,0x20,0x66,0x72
	.DB  0x65,0x6B,0x76,0x65,0x6E,0x63,0x65,0x0
	.DB  0x56,0x79,0x73,0x6F,0x6B,0x61,0x20,0x66
	.DB  0x2E,0x20,0x70,0x72,0x6F,0x0,0x46,0x72
	.DB  0x65,0x6B,0x76,0x65,0x6E,0x63,0x65,0x20
	.DB  0x4F,0x4B,0x0,0x54,0x65,0x70,0x75,0x20
	.DB  0x7A,0x61,0x20,0x6D,0x69,0x6E,0x75,0x74
	.DB  0x75,0x0
_0x2000060:
	.DB  0x1
_0x2000000:
	.DB  0x2D,0x4E,0x41,0x4E,0x0,0x49,0x4E,0x46
	.DB  0x0
_0x2020003:
	.DB  0x80,0xC0

__GLOBAL_INI_TBL:
	.DW  0x01
	.DW  _n
	.DW  _0x3*2

	.DW  0x07
	.DW  _Sequence
	.DW  _0x4*2

	.DW  0x01
	.DW  __seed_G100
	.DW  _0x2000060*2

	.DW  0x02
	.DW  __base_y_G101
	.DW  _0x2020003*2

_0xFFFFFFFF:
	.DW  0

__RESET:
	CLI
	CLR  R30
	OUT  EECR,R30

;INTERRUPT VECTORS ARE PLACED
;AT THE START OF FLASH
	LDI  R31,1
	OUT  MCUCR,R31
	OUT  MCUCR,R30

;DISABLE WATCHDOG
	LDI  R31,0x18
	WDR
	IN   R26,MCUSR
	CBR  R26,8
	OUT  MCUSR,R26
	STS  WDTCSR,R31
	STS  WDTCSR,R30

;CLEAR R2-R14
	LDI  R24,(14-2)+1
	LDI  R26,2
	CLR  R27
__CLEAR_REG:
	ST   X+,R30
	DEC  R24
	BRNE __CLEAR_REG

;CLEAR SRAM
	LDI  R24,LOW(__CLEAR_SRAM_SIZE)
	LDI  R25,HIGH(__CLEAR_SRAM_SIZE)
	LDI  R26,LOW(__SRAM_START)
	LDI  R27,HIGH(__SRAM_START)
__CLEAR_SRAM:
	ST   X+,R30
	SBIW R24,1
	BRNE __CLEAR_SRAM

;GLOBAL VARIABLES INITIALIZATION
	LDI  R30,LOW(__GLOBAL_INI_TBL*2)
	LDI  R31,HIGH(__GLOBAL_INI_TBL*2)
__GLOBAL_INI_NEXT:
	LPM  R24,Z+
	LPM  R25,Z+
	SBIW R24,0
	BREQ __GLOBAL_INI_END
	LPM  R26,Z+
	LPM  R27,Z+
	LPM  R0,Z+
	LPM  R1,Z+
	MOVW R22,R30
	MOVW R30,R0
__GLOBAL_INI_LOOP:
	LPM  R0,Z+
	ST   X+,R0
	SBIW R24,1
	BRNE __GLOBAL_INI_LOOP
	MOVW R30,R22
	RJMP __GLOBAL_INI_NEXT
__GLOBAL_INI_END:

;GPIOR0 INITIALIZATION
	LDI  R30,__GPIOR0_INIT
	OUT  GPIOR0,R30

;HARDWARE STACK POINTER INITIALIZATION
	LDI  R30,LOW(__SRAM_END-__HEAP_SIZE)
	OUT  SPL,R30
	LDI  R30,HIGH(__SRAM_END-__HEAP_SIZE)
	OUT  SPH,R30

;DATA STACK POINTER INITIALIZATION
	LDI  R28,LOW(__SRAM_START+__DSTACK_SIZE)
	LDI  R29,HIGH(__SRAM_START+__DSTACK_SIZE)

	JMP  _main

	.ESEG
	.ORG 0

	.DSEG
	.ORG 0x500

	.CSEG
;/*****************************************************
;Chip type               : ATmega644
;Program type            : Application
;AVR Core Clock frequency: 8.000000 MHz
;Memory model            : Small
;External RAM size       : 0
;Data Stack size         : 1024
;*****************************************************/
;
;#include <mega644.h>
	#ifndef __SLEEP_DEFINED__
	#define __SLEEP_DEFINED__
	.EQU __se_bit=0x01
	.EQU __sm_mask=0x0E
	.EQU __sm_powerdown=0x04
	.EQU __sm_powersave=0x06
	.EQU __sm_standby=0x0C
	.EQU __sm_ext_standby=0x0E
	.EQU __sm_adc_noise_red=0x02
	.SET power_ctrl_reg=smcr
	#endif
;#include <stdlib.h>
;
;
;
;// Alphanumeric LCD Module functions
;#include <alcd.h>
;#include <delay.h>
;
;interrupt [TIM0_OVF] void timer0_ovf_isr(void);
;interrupt [14] void   timer1_compa_isr(void);
;interrupt [EXT_INT0] void ext_int0_isr(void);
;interrupt [3] void ext_int1_isr(void);
;
;// External Interrupt 0 service routine
;volatile unsigned char tlacitka1;
;volatile int i = 0;
;volatile unsigned int j = 0;
;volatile int k = 0;
;volatile unsigned int n = 1;

	.DSEG
;volatile bit status1 = 0;
;volatile bit stop1 = 0, stop2 = 0;
;volatile int pom = 0;
;
;
;volatile int xy_f = 0;
;volatile unsigned char events = 0;
;volatile int Sequence[5] = {0,2,0,2,0};
;
;
; volatile unsigned  char highbyte = 0;
; volatile unsigned char lowbyte = 0;
;
;volatile int CountType = 0;
;
;
;
;volatile float TF = 0, TF1 = 0, TF2 = 0;
;volatile unsigned int Freq = 0;
;
;
;
;
;flash unsigned char sgn1[]="EKG 1";
;flash unsigned char sgn2[]="OBDELNIK";
;flash unsigned char sgn3[]="Fib.sini";
;flash unsigned char sgn4[]="SINUS";
;flash unsigned char sgn5[]="PILA";
;
;
;
;
;const flash unsigned char ecgwave1[96]={
;0x2B,0x2B,0x2B,0x2B,0x2B,0x2A,0x2B,0x29,0x2A,0x2A,0x29,0x2A,0x28,0x2B,0x2E,0x30,0x35,
;0x37,0x36,0x32,0x2F,0x2E,0x2D,0x28,0x27,0x26,0x26,0x26,0x25,0x26,0x27,0x28,0x2B,0x2A,
;0x2B,0x32,0x53,0x91,0xC5,0x88,0x2D,0x2C,0x2C,0x2D,0x2A,0x28,0x29,0x2A,0x2B,0x2A,0x2C,
;0x2C,0x2D,0x2D,0x2F,0x32,0x33,0x35,0x37,0x3A,0x3C,0x3F,0x44,0x49,0x4D,0x51,0x54,0x55,
;0x57,0x55,0x50,0x48,0x41,0x3A,0x33,0x2E,0x2B,0x28,0x28,0x27,0x28,0x28,0x26,0x28,0x28,
;0x28,0x29,0x29,0x29,0x2B,0x2A,0x2A,0x2A,0x28,0x2A,0x29};
;
;const flash unsigned char obdelnik[501]= {
;0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B,0x2B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,0x20,0x20,
;0x1E,0x1D,0x1D,0x1F,0x1E,0x1C,0x1F,0x1F,0x1F,0x1F,0x1D,0x1E,0x1E,0x1F,0x1E,0x1E,0x1F,
;0x1C,0x1E,0x1C,0x1D,0x1C,0x1C,0x1B,0x1A,0x1A,0x1A,0x19,0x18,0x18,0x1B,0x19,0x19,0x18,
;0x17,0x18,0x18,0x19,0x19,0x1A,0x1E,0x1D,0x1F,0x22,0x24,0x25,0x28,0x27,0x28,0x2C,0x2D,
;0x2E,0x2D,0x2E,0x2E,0x32,0x30,0x2F,0x2E,0x30,0x2E,0x2E,0x2E,0x2E,0x2C,0x2D,0x2D,0x2E,
;0x2E,0x2D,0x2D,0x2C,0x2C,0x2D,0x2C,0x2C,0x2D,0x2D,0x2C,0x2C,0x2C,0x2B,0x2B,0x2B,0x2C,
;0x2B,0x2D,0x2C,0x2D,0x2D,0x2B,0x2E,0x2C,0x2B,0x2C,0x2C
;};
;
;
;const flash unsigned char Pila[256]={
;0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10
;,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21
;,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32
;,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,0x40,0x41,0x42,0x43
;,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54
;,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,0x60,0x61,0x62,0x63,0x64,0x65
;,0x66,0x67,0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,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50, 0x51, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57
;, 0x58, 0x59, 0x5A, 0x5B, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F, 0x60, 0x61, 0x62, 0x63, 0x64
;, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72
;, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F
;};
;
;struct signal {
;volatile int order;        //poradie vzorku
;flash unsigned char *name; //nazov vzokru
;const flash unsigned char *type; //typ vzorku
;volatile  int number;      //pocet vzorkov
;volatile unsigned int type_frequency;         //zakladna frekvencia vzorku bez deformacie{rozsirenia alebo zuzenia}
;volatile unsigned  int wait_loop; // pocet cakania cyklov zavisiacichod frakvencie
;};
;
;
;struct signal Data[6];
;
;interrupt [EXT_INT0] void ext_int0_isr(void)
; 0000 00C8 {

	.CSEG
_ext_int0_isr:
	ST   -Y,R26
	ST   -Y,R27
	ST   -Y,R30
	IN   R30,SREG
	ST   -Y,R30
; 0000 00C9 
; 0000 00CA     tlacitka1 = PIND;
	IN   R30,0x9
	STS  _tlacitka1,R30
; 0000 00CB     EIMSK = 0x02;
	LDI  R30,LOW(2)
	OUT  0x1D,R30
; 0000 00CC     EIFR=0x03;
	LDI  R30,LOW(3)
	OUT  0x1C,R30
; 0000 00CD     events = (~tlacitka1 )& 0x77;
	LDS  R30,_tlacitka1
	COM  R30
	ANDI R30,LOW(0x77)
	CALL SUBOPT_0x0
; 0000 00CE 
; 0000 00CF     if(CountType == 2)
	SBIW R26,2
	BRNE _0x5
; 0000 00D0     {
; 0000 00D1     TCNT0=0x00;
	LDI  R30,LOW(0)
	OUT  0x26,R30
; 0000 00D2     TCCR0B=0x04;
	LDI  R30,LOW(4)
	RJMP _0x6E
; 0000 00D3     TIMSK0=0x01;
; 0000 00D4     }
; 0000 00D5     else
_0x5:
; 0000 00D6     {
; 0000 00D7     TCNT0=0x00;
	LDI  R30,LOW(0)
	OUT  0x26,R30
; 0000 00D8     TCCR0B=0x05;
	LDI  R30,LOW(5)
_0x6E:
	OUT  0x25,R30
; 0000 00D9     TIMSK0=0x01;
	LDI  R30,LOW(1)
	STS  110,R30
; 0000 00DA     }
; 0000 00DB 
; 0000 00DC 
; 0000 00DD // Place your code here
; 0000 00DE 
; 0000 00DF }
	LD   R30,Y+
	OUT  SREG,R30
	LD   R30,Y+
	LD   R27,Y+
	LD   R26,Y+
	RETI
;interrupt [3] void ext_int1_isr(void)
; 0000 00E1 {
_ext_int1_isr:
	CALL SUBOPT_0x1
; 0000 00E2  //inicializaci Timeru_1
; 0000 00E3 
; 0000 00E4 
; 0000 00E5 //highbyte = Freq>>8;
; 0000 00E6 //lowbyte = Freq;
; 0000 00E7 
; 0000 00E8 TIFR1 = 0x02;
	LDI  R30,LOW(2)
	OUT  0x16,R30
; 0000 00E9 TIMSK1 = 0x02;
	STS  111,R30
; 0000 00EA 
; 0000 00EB TCCR1A = 0;
	LDI  R30,LOW(0)
	STS  128,R30
; 0000 00EC TCCR1B |= (1 << WGM12)  |(1 << CS12); //(1 << CS11)|(0 << CS10);  // (1 << CS12);
	LDS  R30,129
	ORI  R30,LOW(0xC)
	STS  129,R30
; 0000 00ED OCR1AH =Data[Sequence[0]].type_frequency>>8;//highbyte;
	CALL SUBOPT_0x2
	CALL SUBOPT_0x3
; 0000 00EE OCR1AL =Data[Sequence[0]].type_frequency;//lowbyte;
	CALL SUBOPT_0x2
	CALL SUBOPT_0x4
; 0000 00EF n = 0;
	CALL SUBOPT_0x5
; 0000 00F0 i=0;
	CALL SUBOPT_0x6
; 0000 00F1 j=0;
	LDI  R30,LOW(0)
	STS  _j,R30
	STS  _j+1,R30
; 0000 00F2 }
	RJMP _0x70
;
;
;
;interrupt [TIM0_OVF] void timer0_ovf_isr(void)
; 0000 00F7 {
_timer0_ovf_isr:
	ST   -Y,R26
	ST   -Y,R27
	ST   -Y,R30
	ST   -Y,R31
	IN   R30,SREG
	ST   -Y,R30
; 0000 00F8 
; 0000 00F9 
; 0000 00FA     TCNT0=0x00;
	LDI  R30,LOW(0)
	OUT  0x26,R30
; 0000 00FB 
; 0000 00FC    if (n>6)
	LDS  R26,_n
	LDS  R27,_n+1
	SBIW R26,7
	BRLO _0x7
; 0000 00FD    {
; 0000 00FE    TCCR0B=0x00;
	OUT  0x25,R30
; 0000 00FF    EIMSK = 0x03;
	LDI  R30,LOW(3)
	OUT  0x1D,R30
; 0000 0100    n=0;
	LDI  R30,LOW(0)
	CALL SUBOPT_0x5
; 0000 0101    }
; 0000 0102    else
	RJMP _0x8
_0x7:
; 0000 0103    n++;
	CALL SUBOPT_0x7
; 0000 0104 
; 0000 0105 
; 0000 0106 
; 0000 0107 
; 0000 0108  }
_0x8:
	LD   R30,Y+
	OUT  SREG,R30
	LD   R31,Y+
	LD   R30,Y+
	LD   R27,Y+
	LD   R26,Y+
	RETI
;
; interrupt [14] void   timer1_compa_isr(void)
; 0000 010B  {
_timer1_compa_isr:
	CALL SUBOPT_0x1
; 0000 010C    TCNT1H=0x00;
	CALL SUBOPT_0x8
; 0000 010D   TCNT1L=0x00;
; 0000 010E 
; 0000 010F 
; 0000 0110   if((Data[Sequence[i]].type[j]) && (stop1 == 0))
	CALL SUBOPT_0x9
	LPM  R30,Z
	CPI  R30,0
	BREQ _0xA
	LDI  R26,0
	SBIC 0x1E,1
	LDI  R26,1
	CPI  R26,LOW(0x0)
	BREQ _0xB
_0xA:
	RJMP _0x9
_0xB:
; 0000 0111   {
; 0000 0112       PORTC = Data[Sequence[i]].type[j];//Data[Sequence[i]].type[j];
	CALL SUBOPT_0x9
	LPM  R0,Z
	OUT  0x8,R0
; 0000 0113       j++;
	LDI  R26,LOW(_j)
	LDI  R27,HIGH(_j)
	CALL SUBOPT_0xA
; 0000 0114 
; 0000 0115   }
; 0000 0116   else
	RJMP _0xC
_0x9:
; 0000 0117   {
; 0000 0118    if((stop1 == 0))
	SBIC 0x1E,1
	RJMP _0xD
; 0000 0119     {
; 0000 011A       j=0;
	LDI  R30,LOW(0)
	STS  _j,R30
	STS  _j+1,R30
; 0000 011B       n++;
	CALL SUBOPT_0x7
; 0000 011C       stop1 = 1;
	SBI  0x1E,1
; 0000 011D       }
; 0000 011E 
; 0000 011F       }
_0xD:
_0xC:
; 0000 0120 
; 0000 0121 
; 0000 0122 
; 0000 0123   if(n > Data[i].number)
	CALL SUBOPT_0xB
	LDI  R30,LOW(12)
	CALL __MULB1W2U
	CALL SUBOPT_0xC
	LDS  R26,_n
	LDS  R27,_n+1
	CP   R30,R26
	CPC  R31,R27
	BRSH _0x10
; 0000 0124        {
; 0000 0125        i++;
	LDI  R26,LOW(_i)
	LDI  R27,HIGH(_i)
	CALL SUBOPT_0xA
; 0000 0126        n = 0;
	LDI  R30,LOW(0)
	CALL SUBOPT_0x5
; 0000 0127 
; 0000 0128        if(i ==5) i = 0;
	CALL SUBOPT_0xB
	SBIW R26,5
	BRNE _0x11
	CALL SUBOPT_0x6
; 0000 0129        }
_0x11:
; 0000 012A 
; 0000 012B     if(stop2 == 1)
_0x10:
	SBIS 0x1E,2
	RJMP _0x12
; 0000 012C   {
; 0000 012D   stop1 = 0;
	CBI  0x1E,1
; 0000 012E   stop2 = 0;
	CBI  0x1E,2
; 0000 012F   OCR1AH =Data[Sequence[i]].type_frequency>>8;//highbyte;
	CALL SUBOPT_0xD
	CALL SUBOPT_0x3
; 0000 0130   OCR1AL =Data[Sequence[i]].type_frequency;//lowbyte;
	CALL SUBOPT_0xD
	CALL SUBOPT_0x4
; 0000 0131   TCNT1H=0x00;
	STS  133,R30
; 0000 0132   TCNT1L=0x00;
	LDI  R30,LOW(0)
	STS  132,R30
; 0000 0133 
; 0000 0134   }
; 0000 0135 
; 0000 0136 
; 0000 0137     if((stop1 == 1))
_0x12:
	SBIS 0x1E,1
	RJMP _0x17
; 0000 0138   {
; 0000 0139    OCR1AH =Data[Sequence[i]].wait_loop>>8;
	CALL SUBOPT_0xE
	CALL SUBOPT_0x3
; 0000 013A    OCR1AL =Data[Sequence[i]].wait_loop;
	CALL SUBOPT_0xE
	CALL SUBOPT_0x4
; 0000 013B    TCNT1H=0x00;
	STS  133,R30
; 0000 013C    TCNT1L=0x00;
	LDI  R30,LOW(0)
	STS  132,R30
; 0000 013D 
; 0000 013E    stop2 = 1;
	SBI  0x1E,2
; 0000 013F 
; 0000 0140   }
; 0000 0141 
; 0000 0142 
; 0000 0143 }
_0x17:
_0x70:
	LD   R30,Y+
	OUT  SREG,R30
	LD   R31,Y+
	LD   R30,Y+
	LD   R27,Y+
	LD   R26,Y+
	LD   R22,Y+
	LD   R1,Y+
	LD   R0,Y+
	RETI
;
;
;
;
;void main(void)
; 0000 0149 {
_main:
; 0000 014A  int x = 0;
; 0000 014B  int y = 0;
; 0000 014C 
; 0000 014D  float jm = 0.000064;
; 0000 014E 
; 0000 014F 
; 0000 0150  char *Cycle = (char*)malloc(sizeof( char)*5);
; 0000 0151 char *Frequency = (char*)malloc(sizeof(char)*10);
; 0000 0152 
; 0000 0153 
; 0000 0154 
; 0000 0155  Data[0].order = 0;
	SBIW R28,6
	LDI  R30,LOW(189)
	STD  Y+2,R30
	LDI  R30,LOW(55)
	STD  Y+3,R30
	LDI  R30,LOW(134)
	STD  Y+4,R30
	LDI  R30,LOW(56)
	STD  Y+5,R30
;	x -> R16,R17
;	y -> R18,R19
;	jm -> Y+2
;	*Cycle -> R20,R21
;	*Frequency -> Y+0
	__GETWRN 16,17,0
	__GETWRN 18,19,0
	LDI  R30,LOW(5)
	LDI  R31,HIGH(5)
	ST   -Y,R31
	ST   -Y,R30
	CALL _malloc
	MOVW R20,R30
	LDI  R30,LOW(10)
	LDI  R31,HIGH(10)
	ST   -Y,R31
	ST   -Y,R30
	CALL _malloc
	ST   Y,R30
	STD  Y+1,R31
	LDI  R30,LOW(0)
	STS  _Data,R30
	STS  _Data+1,R30
; 0000 0156  Data[0].name = sgn1;         //EKG 1
	LDI  R30,LOW(_sgn1*2)
	LDI  R31,HIGH(_sgn1*2)
	__PUTW1MN _Data,2
; 0000 0157  Data[0].type = ecgwave1;
	LDI  R30,LOW(_ecgwave1*2)
	LDI  R31,HIGH(_ecgwave1*2)
	__PUTW1MN _Data,4
; 0000 0158  Data[0].number = 4;
	LDI  R30,LOW(4)
	LDI  R31,HIGH(4)
	__PUTW1MN _Data,6
; 0000 0159  Data[0].type_frequency = 122;
	LDI  R30,LOW(122)
	LDI  R31,HIGH(122)
	__PUTW1MN _Data,8
; 0000 015A  Data[0].wait_loop = 0 ;
	LDI  R30,LOW(0)
	LDI  R31,HIGH(0)
	__PUTW1MN _Data,10
; 0000 015B 
; 0000 015C  Data[1].order = 1;
	__POINTW1MN _Data,12
	LDI  R26,LOW(1)
	LDI  R27,HIGH(1)
	STD  Z+0,R26
	STD  Z+1,R27
; 0000 015D  Data[1].name = sgn2;
	__POINTW2MN _Data,14
	LDI  R30,LOW(_sgn2*2)
	LDI  R31,HIGH(_sgn2*2)
	ST   X+,R30
	ST   X,R31
; 0000 015E  Data[1].type = obdelnik;          //OBDELNIK
	__POINTW2MN _Data,16
	LDI  R30,LOW(_obdelnik*2)
	LDI  R31,HIGH(_obdelnik*2)
	ST   X+,R30
	ST   X,R31
; 0000 015F  Data[1].number = 4;
	__POINTW1MN _Data,18
	CALL SUBOPT_0xF
; 0000 0160  Data[1].type_frequency = 16;
	__POINTW1MN _Data,20
	LDI  R26,LOW(16)
	LDI  R27,HIGH(16)
	STD  Z+0,R26
	STD  Z+1,R27
; 0000 0161  Data[1].wait_loop = 0 ;
	__POINTW1MN _Data,22
	CALL SUBOPT_0x10
; 0000 0162 
; 0000 0163  Data[2].order = 2;
	__POINTW1MN _Data,24
	LDI  R26,LOW(2)
	LDI  R27,HIGH(2)
	STD  Z+0,R26
	STD  Z+1,R27
; 0000 0164  Data[2].name = sgn3;
	__POINTW2MN _Data,26
	LDI  R30,LOW(_sgn3*2)
	LDI  R31,HIGH(_sgn3*2)
	ST   X+,R30
	ST   X,R31
; 0000 0165  Data[2].type = ecgwave2;          //EKG 2
	__POINTW2MN _Data,28
	LDI  R30,LOW(_ecgwave2*2)
	LDI  R31,HIGH(_ecgwave2*2)
	ST   X+,R30
	ST   X,R31
; 0000 0166  Data[2].number =4;
	__POINTW1MN _Data,30
	CALL SUBOPT_0xF
; 0000 0167  Data[2].type_frequency = 63;    //nastavenie  OCR1AH,OCR1AL
	__POINTW1MN _Data,32
	LDI  R26,LOW(63)
	LDI  R27,HIGH(63)
	STD  Z+0,R26
	STD  Z+1,R27
; 0000 0168  Data[2].wait_loop = 0 ;
	__POINTW1MN _Data,34
	CALL SUBOPT_0x10
; 0000 0169 
; 0000 016A  Data[3].order = 3;
	__POINTW1MN _Data,36
	LDI  R26,LOW(3)
	LDI  R27,HIGH(3)
	STD  Z+0,R26
	STD  Z+1,R27
; 0000 016B  Data[3].name = sgn4;
	__POINTW2MN _Data,38
	LDI  R30,LOW(_sgn4*2)
	LDI  R31,HIGH(_sgn4*2)
	ST   X+,R30
	ST   X,R31
; 0000 016C  Data[3].type = Sine;// Sine;
	__POINTW2MN _Data,40
	LDI  R30,LOW(_Sine*2)
	LDI  R31,HIGH(_Sine*2)
	ST   X+,R30
	ST   X,R31
; 0000 016D  Data[3].number = 4;
	__POINTW1MN _Data,42
	CALL SUBOPT_0xF
; 0000 016E  Data[3].type_frequency = 28;
	__POINTW1MN _Data,44
	LDI  R26,LOW(28)
	LDI  R27,HIGH(28)
	STD  Z+0,R26
	STD  Z+1,R27
; 0000 016F  Data[3].wait_loop = 0 ;
	__POINTW1MN _Data,46
	CALL SUBOPT_0x10
; 0000 0170 
; 0000 0171  Data[4].order = 4;
	__POINTW1MN _Data,48
	CALL SUBOPT_0xF
; 0000 0172  Data[4].name = sgn5;
	__POINTW2MN _Data,50
	LDI  R30,LOW(_sgn5*2)
	LDI  R31,HIGH(_sgn5*2)
	ST   X+,R30
	ST   X,R31
; 0000 0173  Data[4].type = Pila;          //pila
	__POINTW2MN _Data,52
	LDI  R30,LOW(_Pila*2)
	LDI  R31,HIGH(_Pila*2)
	ST   X+,R30
	ST   X,R31
; 0000 0174  Data[4].number = 4;
	__POINTW1MN _Data,54
	CALL SUBOPT_0xF
; 0000 0175  Data[4].type_frequency = 30;
	__POINTW1MN _Data,56
	LDI  R26,LOW(30)
	LDI  R27,HIGH(30)
	STD  Z+0,R26
	STD  Z+1,R27
; 0000 0176  Data[4].wait_loop = 0 ;
	__POINTW1MN _Data,58
	CALL SUBOPT_0x10
; 0000 0177 
; 0000 0178  Data[5].number = 50;   //prednastavena tepova frekvencia
	__POINTW1MN _Data,66
	LDI  R26,LOW(50)
	LDI  R27,HIGH(50)
	STD  Z+0,R26
	STD  Z+1,R27
; 0000 0179 
; 0000 017A #pragma optsize-
; 0000 017B CLKPR=0x80;
	LDI  R30,LOW(128)
	STS  97,R30
; 0000 017C CLKPR=0x01;
	LDI  R30,LOW(1)
	STS  97,R30
; 0000 017D #ifdef _OPTIMIZE_SIZE_
; 0000 017E #pragma optsize+
; 0000 017F #endif
; 0000 0180 
; 0000 0181 // Reset Source checking
; 0000 0182 if (MCUSR & 1)
	IN   R30,0x34
	SBRC R30,0
; 0000 0183    {
; 0000 0184    // Power-on Reset
; 0000 0185    MCUSR&=0xE0;
	RJMP _0x6F
; 0000 0186    // Place your code here
; 0000 0187 
; 0000 0188    }
; 0000 0189 else if (MCUSR & 2)
	IN   R30,0x34
	SBRC R30,1
; 0000 018A    {
; 0000 018B    // External Reset
; 0000 018C    MCUSR&=0xE0;
	RJMP _0x6F
; 0000 018D    // Place your code here
; 0000 018E 
; 0000 018F    }
; 0000 0190 else if (MCUSR & 4)
	IN   R30,0x34
	SBRC R30,2
; 0000 0191    {
; 0000 0192    // Brown-Out Reset
; 0000 0193    MCUSR&=0xE0;
	RJMP _0x6F
; 0000 0194    // Place your code here
; 0000 0195 
; 0000 0196    }
; 0000 0197 else if (MCUSR & 8)
	IN   R30,0x34
	SBRC R30,3
; 0000 0198    {
; 0000 0199    // Watchdog Reset
; 0000 019A    MCUSR&=0xE0;
	RJMP _0x6F
; 0000 019B    // Place your code here
; 0000 019C 
; 0000 019D    }
; 0000 019E else if (MCUSR & 0x10)
	IN   R30,0x34
	SBRS R30,4
	RJMP _0x22
; 0000 019F    {
; 0000 01A0    // JTAG Reset
; 0000 01A1    MCUSR&=0xE0;
_0x6F:
	IN   R30,0x34
	ANDI R30,LOW(0xE0)
	OUT  0x34,R30
; 0000 01A2    // Place your code here
; 0000 01A3 
; 0000 01A4    }
; 0000 01A5 
; 0000 01A6 // Input/Output Ports initialization
; 0000 01A7 // Port A initialization
; 0000 01A8 // Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
; 0000 01A9 // State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
; 0000 01AA PORTA=0x00;
_0x22:
	LDI  R30,LOW(0)
	OUT  0x2,R30
; 0000 01AB DDRA=0x00;
	OUT  0x1,R30
; 0000 01AC 
; 0000 01AD // Port B initialization
; 0000 01AE // Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
; 0000 01AF // State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
; 0000 01B0 PORTB=0x00;
	OUT  0x5,R30
; 0000 01B1 DDRB=0x00;
	OUT  0x4,R30
; 0000 01B2 
; 0000 01B3 // Port C initialization
; 0000 01B4 // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out
; 0000 01B5 // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0
; 0000 01B6 PORTC=0x00;
	OUT  0x8,R30
; 0000 01B7 DDRC=0xFF;
	LDI  R30,LOW(255)
	OUT  0x7,R30
; 0000 01B8 
; 0000 01B9 // Port D initialization
; 0000 01BA // Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
; 0000 01BB // State7=P State6=P State5=P State4=P State3=P State2=P State1=P State0=P
; 0000 01BC PORTD=0xFF;
	OUT  0xB,R30
; 0000 01BD DDRD=0x00;
	LDI  R30,LOW(0)
	OUT  0xA,R30
; 0000 01BE 
; 0000 01BF // Timer/Counter 0 initialization
; 0000 01C0 // Clock source: System Clock
; 0000 01C1 // Clock value: Timer 0 Stopped
; 0000 01C2 // Mode: Normal top=0xFF
; 0000 01C3 // OC0A output: Disconnected
; 0000 01C4 // OC0B output: Disconnected
; 0000 01C5 TCCR0A=0x00;
	OUT  0x24,R30
; 0000 01C6 TCCR0B=0x00;
	OUT  0x25,R30
; 0000 01C7 TCNT0=0x00;
	OUT  0x26,R30
; 0000 01C8 OCR0A=0x00;
	OUT  0x27,R30
; 0000 01C9 OCR0B=0x00;
	OUT  0x28,R30
; 0000 01CA 
; 0000 01CB // Timer/Counter 1 initialization
; 0000 01CC // Clock source: System Clock
; 0000 01CD // Clock value: Timer1 Stopped
; 0000 01CE // Mode: Normal top=0xFFFF
; 0000 01CF // OC1A output: Discon.
; 0000 01D0 // OC1B output: Discon.
; 0000 01D1 // Noise Canceler: Off
; 0000 01D2 // Input Capture on Falling Edge
; 0000 01D3 // Timer1 Overflow Interrupt: Off
; 0000 01D4 // Input Capture Interrupt: Off
; 0000 01D5 // Compare A Match Interrupt: Off
; 0000 01D6 // Compare B Match Interrupt: Off
; 0000 01D7 
; 0000 01D8 
; 0000 01D9 TCNT1H=0x00;
	CALL SUBOPT_0x8
; 0000 01DA TCNT1L=0x00;
; 0000 01DB 
; 0000 01DC ICR1H=0x00;
	LDI  R30,LOW(0)
	STS  135,R30
; 0000 01DD ICR1L=0x00;
	STS  134,R30
; 0000 01DE OCR1AH=0x00;
	STS  137,R30
; 0000 01DF OCR1AL=0x00;
	STS  136,R30
; 0000 01E0 OCR1BH=0x00;
	STS  139,R30
; 0000 01E1 OCR1BL=0x00;
	STS  138,R30
; 0000 01E2 
; 0000 01E3 // Timer/Counter 2 initialization
; 0000 01E4 // Clock source: System Clock
; 0000 01E5 // Clock value: Timer2 Stopped
; 0000 01E6 // Mode: Normal top=0xFF
; 0000 01E7 // OC2A output: Disconnected
; 0000 01E8 // OC2B output: Disconnected
; 0000 01E9 ASSR=0x00;
	STS  182,R30
; 0000 01EA TCCR2A=0x00;
	STS  176,R30
; 0000 01EB TCCR2B=0x00;
	STS  177,R30
; 0000 01EC TCNT2=0x00;
	STS  178,R30
; 0000 01ED OCR2A=0x00;
	STS  179,R30
; 0000 01EE OCR2B=0x00;
	STS  180,R30
; 0000 01EF 
; 0000 01F0 // External Interrupt(s) initialization
; 0000 01F1 // INT0: On
; 0000 01F2 // INT0 Mode: Low level
; 0000 01F3 // INT1: On
; 0000 01F4 // INT1 Mode: Low level
; 0000 01F5 // INT2: Off
; 0000 01F6 // Interrupt on any change on pins PCINT0-7: Off
; 0000 01F7 // Interrupt on any change on pins PCINT8-15: Off
; 0000 01F8 // Interrupt on any change on pins PCINT16-23: Off
; 0000 01F9 // Interrupt on any change on pins PCINT24-31: Off
; 0000 01FA EICRA=0x00;
	STS  105,R30
; 0000 01FB EIMSK=0x03;
	LDI  R30,LOW(3)
	OUT  0x1D,R30
; 0000 01FC EIFR=0x03;
	OUT  0x1C,R30
; 0000 01FD PCICR=0x00;
	LDI  R30,LOW(0)
	STS  104,R30
; 0000 01FE 
; 0000 01FF // Timer/Counter 0 Interrupt(s) initialization
; 0000 0200 TIMSK0=0x00;
	STS  110,R30
; 0000 0201 
; 0000 0202 // Timer/Counter 1 Interrupt(s) initialization
; 0000 0203 TIMSK1=0x00;
	STS  111,R30
; 0000 0204 
; 0000 0205 // Timer/Counter 2 Interrupt(s) initialization
; 0000 0206 TIMSK2=0x00;
	STS  112,R30
; 0000 0207 
; 0000 0208 // USART initialization
; 0000 0209 // USART disabled
; 0000 020A UCSR0B=0x00;
	STS  193,R30
; 0000 020B 
; 0000 020C // Analog Comparator initialization
; 0000 020D // Analog Comparator: Off
; 0000 020E // Analog Comparator Input Capture by Timer/Counter 1: Off
; 0000 020F ACSR=0x80;
	LDI  R30,LOW(128)
	OUT  0x30,R30
; 0000 0210 ADCSRB=0x00;
	LDI  R30,LOW(0)
	STS  123,R30
; 0000 0211 DIDR1=0x00;
	STS  127,R30
; 0000 0212 
; 0000 0213 // ADC initialization
; 0000 0214 // ADC disabled
; 0000 0215 ADCSRA=0x00;
	STS  122,R30
; 0000 0216 
; 0000 0217 // SPI initialization
; 0000 0218 // SPI disabled
; 0000 0219 SPCR=0x00;
	OUT  0x2C,R30
; 0000 021A 
; 0000 021B // TWI initialization
; 0000 021C // TWI disabled
; 0000 021D TWCR=0x00;
	STS  188,R30
; 0000 021E 
; 0000 021F // Alphanumeric LCD initialization
; 0000 0220 // Connections specified in the
; 0000 0221 // Project|Configure|C Compiler|Libraries|Alphanumeric LCD menu:
; 0000 0222 // RS - PORTB Bit 0
; 0000 0223 // RD - PORTB Bit 1
; 0000 0224 // EN - PORTB Bit 2
; 0000 0225 // D4 - PORTB Bit 3
; 0000 0226 // D5 - PORTB Bit 4
; 0000 0227 // D6 - PORTB Bit 5
; 0000 0228 // D7 - PORTB Bit 6
; 0000 0229 // Characters/line: 16
; 0000 022A lcd_init(16);
	LDI  R30,LOW(16)
	ST   -Y,R30
	CALL _lcd_init
; 0000 022B 
; 0000 022C // Global enable interrupts
; 0000 022D #asm("sei");
	sei
; 0000 022E 
; 0000 022F while (1)
_0x23:
; 0000 0230       {
; 0000 0231 
; 0000 0232 
; 0000 0233 
; 0000 0234       //sipka hore PD0
; 0000 0235 
; 0000 0236       if(events == 0x05)
	LDS  R26,_events
	CPI  R26,LOW(0x5)
	BRNE _0x26
; 0000 0237       {     events &= ~0x05;
	LDS  R30,_events
	ANDI R30,LOW(0xFA)
	CALL SUBOPT_0x0
; 0000 0238           if(( CountType == 0) || ( CountType == 1) )
	SBIW R26,0
	BREQ _0x28
	CALL SUBOPT_0x11
	SBIW R26,1
	BRNE _0x27
_0x28:
; 0000 0239           {
; 0000 023A           lcd_clear();
	CALL _lcd_clear
; 0000 023B           y++;
	__ADDWRN 18,19,1
; 0000 023C           if(y >5 ){ y = 4;}
	__CPWRN 18,19,6
	BRLT _0x2A
	__GETWRN 18,19,4
; 0000 023D 
; 0000 023E           }
_0x2A:
; 0000 023F 
; 0000 0240          if(CountType == 2)
_0x27:
	CALL SUBOPT_0x11
	SBIW R26,2
	BRNE _0x2B
; 0000 0241           {
; 0000 0242 
; 0000 0243               xy_f++;
	LDI  R26,LOW(_xy_f)
	LDI  R27,HIGH(_xy_f)
	CALL SUBOPT_0xA
; 0000 0244               if(xy_f >= 999)
	CALL SUBOPT_0x12
	CPI  R26,LOW(0x3E7)
	LDI  R30,HIGH(0x3E7)
	CPC  R27,R30
	BRLT _0x2C
; 0000 0245               {
; 0000 0246               xy_f = 999;
	LDI  R30,LOW(999)
	LDI  R31,HIGH(999)
	STS  _xy_f,R30
	STS  _xy_f+1,R31
; 0000 0247               }
; 0000 0248 
; 0000 0249           }
_0x2C:
; 0000 024A 
; 0000 024B 
; 0000 024C 
; 0000 024D       }
_0x2B:
; 0000 024E       //sipka dole  PD1
; 0000 024F       if(events == 0x06)
_0x26:
	LDS  R26,_events
	CPI  R26,LOW(0x6)
	BRNE _0x2D
; 0000 0250       {   events &= ~0x06;
	LDS  R30,_events
	ANDI R30,LOW(0xF9)
	CALL SUBOPT_0x0
; 0000 0251           if(( CountType == 0) || ( CountType == 1))
	SBIW R26,0
	BREQ _0x2F
	CALL SUBOPT_0x11
	SBIW R26,1
	BRNE _0x2E
_0x2F:
; 0000 0252           {
; 0000 0253             lcd_clear();
	CALL _lcd_clear
; 0000 0254             y--;
	__SUBWRN 18,19,1
; 0000 0255             if(y < 0){y = 0;}
	TST  R19
	BRPL _0x31
	__GETWRN 18,19,0
; 0000 0256 
; 0000 0257           }
_0x31:
; 0000 0258 
; 0000 0259           if(CountType == 2)
_0x2E:
	CALL SUBOPT_0x11
	SBIW R26,2
	BRNE _0x32
; 0000 025A           {
; 0000 025B 
; 0000 025C             xy_f--;
	LDI  R26,LOW(_xy_f)
	LDI  R27,HIGH(_xy_f)
	LD   R30,X+
	LD   R31,X+
	SBIW R30,1
	ST   -X,R31
	ST   -X,R30
; 0000 025D             if(xy_f < 0)
	LDS  R26,_xy_f+1
	TST  R26
	BRPL _0x33
; 0000 025E             {
; 0000 025F              xy_f = 0;
	LDI  R30,LOW(0)
	STS  _xy_f,R30
	STS  _xy_f+1,R30
; 0000 0260             }
; 0000 0261 
; 0000 0262           }
_0x33:
; 0000 0263       }
_0x32:
; 0000 0264       //sipka doprava  PD4
; 0000 0265       if(events == 0x24)
_0x2D:
	LDS  R26,_events
	CPI  R26,LOW(0x24)
	BRNE _0x34
; 0000 0266       {
; 0000 0267        events &= ~0x24;
	LDS  R30,_events
	ANDI R30,LOW(0xDB)
	STS  _events,R30
; 0000 0268 
; 0000 0269         lcd_clear();
	CALL _lcd_clear
; 0000 026A        if(CountType == 0)
	CALL SUBOPT_0x13
	BRNE _0x35
; 0000 026B        {
; 0000 026C         x++;
	__ADDWRN 16,17,1
; 0000 026D         if(x > 5)
	__CPWRN 16,17,6
	BRLT _0x36
; 0000 026E         {
; 0000 026F 
; 0000 0270         x =5;
	__GETWRN 16,17,5
; 0000 0271         }
; 0000 0272 
; 0000 0273         }
_0x36:
; 0000 0274       }
_0x35:
; 0000 0275       //sipka dolava  PD5
; 0000 0276      if(events == 0x14)
_0x34:
	LDS  R26,_events
	CPI  R26,LOW(0x14)
	BRNE _0x37
; 0000 0277       {
; 0000 0278        events &= ~0x14;
	LDS  R30,_events
	ANDI R30,LOW(0xEB)
	STS  _events,R30
; 0000 0279        if(CountType == 0)
	CALL SUBOPT_0x13
	BRNE _0x38
; 0000 027A        {
; 0000 027B         lcd_clear();
	CALL _lcd_clear
; 0000 027C 
; 0000 027D          x--;
	__SUBWRN 16,17,1
; 0000 027E          if(x <0)
	TST  R17
	BRPL _0x39
; 0000 027F          {x = 0;
	__GETWRN 16,17,0
; 0000 0280 
; 0000 0281          }
; 0000 0282 
; 0000 0283         }
_0x39:
; 0000 0284 
; 0000 0285        }
_0x38:
; 0000 0286 
; 0000 0287         // potvrd
; 0000 0288       if(events == 0x44)
_0x37:
	LDS  R26,_events
	CPI  R26,LOW(0x44)
	BRNE _0x3A
; 0000 0289       {
; 0000 028A       events &= ~0x44;
	LDS  R30,_events
	ANDI R30,LOW(0xBB)
	STS  _events,R30
; 0000 028B        lcd_clear();
	CALL _lcd_clear
; 0000 028C       CountType++;
	LDI  R26,LOW(_CountType)
	LDI  R27,HIGH(_CountType)
	CALL SUBOPT_0xA
; 0000 028D       if(CountType == 3)
	CALL SUBOPT_0x11
	SBIW R26,3
	BRNE _0x3B
; 0000 028E       {
; 0000 028F       CountType = 0;
	LDI  R30,LOW(0)
	STS  _CountType,R30
	STS  _CountType+1,R30
; 0000 0290       }
; 0000 0291 
; 0000 0292 
; 0000 0293       }
_0x3B:
; 0000 0294       switch (x) {
_0x3A:
	MOVW R30,R16
; 0000 0295 
; 0000 0296     case 0 :
	SBIW R30,0
	BRNE _0x3F
; 0000 0297      if((CountType==0))
	CALL SUBOPT_0x13
	BRNE _0x40
; 0000 0298               {
; 0000 0299             lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 029A             lcd_putsf("Vyber signal 1");
	__POINTW1FN _0x0,0
	CALL SUBOPT_0x15
; 0000 029B 
; 0000 029C             lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 029D             lcd_putsf(Data[Sequence[x]].name);
; 0000 029E            // Sequence[x] = Data[y].order;
; 0000 029F              lcd_gotoxy(10, 1);
	CALL SUBOPT_0x17
; 0000 02A0             lcd_putsf(","); //6,7,8 misto na displeji v 2 radku     0123456
; 0000 02A1             itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 02A2 
; 0000 02A3 
; 0000 02A4             lcd_puts(Cycle);
; 0000 02A5 
; 0000 02A6              }
; 0000 02A7 
; 0000 02A8              if((CountType == 1))
_0x40:
	CALL SUBOPT_0x11
	SBIW R26,1
	BRNE _0x41
; 0000 02A9              {
; 0000 02AA              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 02AB              lcd_putsf("Vzorek:");
	CALL SUBOPT_0x1A
; 0000 02AC              lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 02AD              lcd_putsf(Data[Sequence[x]].name);
; 0000 02AE              Sequence[x] = Data[y].order;
	CALL SUBOPT_0x1B
; 0000 02AF              }
; 0000 02B0 
; 0000 02B1 
; 0000 02B2             if((CountType == 2))
_0x41:
	CALL SUBOPT_0x11
	SBIW R26,2
	BRNE _0x42
; 0000 02B3             {
; 0000 02B4              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 02B5             lcd_putsf("Pocet vzorku:");
	CALL SUBOPT_0x1C
; 0000 02B6              Data[x].number = xy_f;
	CALL SUBOPT_0x18
	CALL SUBOPT_0x1D
; 0000 02B7              if(xy_f <100)
	BRGE _0x43
; 0000 02B8              {
; 0000 02B9              lcd_gotoxy(0,1);
	CALL SUBOPT_0x1E
; 0000 02BA              lcd_putsf("   ");
	CALL SUBOPT_0x1F
; 0000 02BB              }
; 0000 02BC             lcd_gotoxy(0, 1);
_0x43:
	CALL SUBOPT_0x1E
; 0000 02BD              itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 02BE             lcd_puts(Cycle);
; 0000 02BF 
; 0000 02C0              }
; 0000 02C1 
; 0000 02C2     break;
_0x42:
	RJMP _0x3E
; 0000 02C3 
; 0000 02C4     case 1 :
_0x3F:
	CPI  R30,LOW(0x1)
	LDI  R26,HIGH(0x1)
	CPC  R31,R26
	BRNE _0x44
; 0000 02C5     if((CountType==0))
	CALL SUBOPT_0x13
	BRNE _0x45
; 0000 02C6               {
; 0000 02C7             lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 02C8             lcd_putsf("Vyber signal 2");
	__POINTW1FN _0x0,43
	CALL SUBOPT_0x15
; 0000 02C9 
; 0000 02CA             lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 02CB             lcd_putsf(Data[Sequence[x]].name);
; 0000 02CC            // Sequence[x] = Data[y].order;
; 0000 02CD              lcd_gotoxy(10, 1);
	CALL SUBOPT_0x17
; 0000 02CE             lcd_putsf(","); //6,7,8 misto na displeji v 2 radku     0123456
; 0000 02CF             itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 02D0 
; 0000 02D1 
; 0000 02D2             lcd_puts(Cycle);
; 0000 02D3 
; 0000 02D4              }
; 0000 02D5 
; 0000 02D6              if((CountType == 1))
_0x45:
	CALL SUBOPT_0x11
	SBIW R26,1
	BRNE _0x46
; 0000 02D7              {
; 0000 02D8              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 02D9              lcd_putsf("Vzorek:");
	CALL SUBOPT_0x1A
; 0000 02DA              lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 02DB              lcd_putsf(Data[Sequence[x]].name);
; 0000 02DC              Sequence[x] = Data[y].order;
	CALL SUBOPT_0x1B
; 0000 02DD              }
; 0000 02DE 
; 0000 02DF 
; 0000 02E0             if((CountType == 2))
_0x46:
	CALL SUBOPT_0x11
	SBIW R26,2
	BRNE _0x47
; 0000 02E1             {
; 0000 02E2              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 02E3             lcd_putsf("Pocet vzorku:");
	CALL SUBOPT_0x1C
; 0000 02E4              Data[x].number = xy_f;
	CALL SUBOPT_0x18
	CALL SUBOPT_0x1D
; 0000 02E5              if(xy_f <100)
	BRGE _0x48
; 0000 02E6              {
; 0000 02E7              lcd_gotoxy(0,1);
	CALL SUBOPT_0x1E
; 0000 02E8              lcd_putsf("   ");
	CALL SUBOPT_0x1F
; 0000 02E9              }
; 0000 02EA             lcd_gotoxy(0, 1);
_0x48:
	CALL SUBOPT_0x1E
; 0000 02EB              itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 02EC             lcd_puts(Cycle);
; 0000 02ED 
; 0000 02EE              }
; 0000 02EF 
; 0000 02F0 
; 0000 02F1 
; 0000 02F2     break;
_0x47:
	RJMP _0x3E
; 0000 02F3 
; 0000 02F4     case 2 :
_0x44:
	CPI  R30,LOW(0x2)
	LDI  R26,HIGH(0x2)
	CPC  R31,R26
	BRNE _0x49
; 0000 02F5     if((CountType==0))
	CALL SUBOPT_0x13
	BRNE _0x4A
; 0000 02F6               {
; 0000 02F7             lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 02F8             lcd_putsf("Vyber signal 3");
	__POINTW1FN _0x0,58
	CALL SUBOPT_0x15
; 0000 02F9 
; 0000 02FA             lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 02FB             lcd_putsf(Data[Sequence[x]].name);
; 0000 02FC            // Sequence[x] = Data[y].order;
; 0000 02FD              lcd_gotoxy(10, 1);
	CALL SUBOPT_0x17
; 0000 02FE             lcd_putsf(","); //6,7,8 misto na displeji v 2 radku     0123456
; 0000 02FF             itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 0300 
; 0000 0301 
; 0000 0302             lcd_puts(Cycle);
; 0000 0303 
; 0000 0304              }
; 0000 0305 
; 0000 0306              if((CountType == 1))
_0x4A:
	CALL SUBOPT_0x11
	SBIW R26,1
	BRNE _0x4B
; 0000 0307              {
; 0000 0308              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 0309              lcd_putsf("Vzorek:");
	CALL SUBOPT_0x1A
; 0000 030A              lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 030B              lcd_putsf(Data[Sequence[x]].name);
; 0000 030C              Sequence[x] = Data[y].order;
	CALL SUBOPT_0x1B
; 0000 030D              }
; 0000 030E 
; 0000 030F 
; 0000 0310             if((CountType == 2))
_0x4B:
	CALL SUBOPT_0x11
	SBIW R26,2
	BRNE _0x4C
; 0000 0311             {
; 0000 0312              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 0313             lcd_putsf("Pocet vzorku:");
	CALL SUBOPT_0x1C
; 0000 0314              Data[x].number = xy_f;
	CALL SUBOPT_0x18
	CALL SUBOPT_0x1D
; 0000 0315              if(xy_f <100)
	BRGE _0x4D
; 0000 0316              {
; 0000 0317              lcd_gotoxy(0,1);
	CALL SUBOPT_0x1E
; 0000 0318              lcd_putsf("   ");
	CALL SUBOPT_0x1F
; 0000 0319              }
; 0000 031A             lcd_gotoxy(0, 1);
_0x4D:
	CALL SUBOPT_0x1E
; 0000 031B              itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 031C             lcd_puts(Cycle);
; 0000 031D 
; 0000 031E              }
; 0000 031F 
; 0000 0320 
; 0000 0321 
; 0000 0322     break;
_0x4C:
	RJMP _0x3E
; 0000 0323 
; 0000 0324     case 3 :
_0x49:
	CPI  R30,LOW(0x3)
	LDI  R26,HIGH(0x3)
	CPC  R31,R26
	BRNE _0x4E
; 0000 0325     if((CountType==0))
	CALL SUBOPT_0x13
	BRNE _0x4F
; 0000 0326               {
; 0000 0327             lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 0328             lcd_putsf("Vyber signal 4");
	__POINTW1FN _0x0,73
	CALL SUBOPT_0x15
; 0000 0329 
; 0000 032A             lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 032B             lcd_putsf(Data[Sequence[x]].name);
; 0000 032C            // Sequence[x] = Data[y].order;
; 0000 032D              lcd_gotoxy(10, 1);
	CALL SUBOPT_0x17
; 0000 032E             lcd_putsf(","); //6,7,8 misto na displeji v 2 radku     0123456
; 0000 032F             itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 0330 
; 0000 0331 
; 0000 0332             lcd_puts(Cycle);
; 0000 0333 
; 0000 0334              }
; 0000 0335 
; 0000 0336              if((CountType == 1))
_0x4F:
	CALL SUBOPT_0x11
	SBIW R26,1
	BRNE _0x50
; 0000 0337              {
; 0000 0338              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 0339              lcd_putsf("Vzorek:");
	CALL SUBOPT_0x1A
; 0000 033A              lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 033B              lcd_putsf(Data[Sequence[x]].name);
; 0000 033C              Sequence[x] = Data[y].order;
	CALL SUBOPT_0x1B
; 0000 033D              }
; 0000 033E 
; 0000 033F 
; 0000 0340             if((CountType == 2))
_0x50:
	CALL SUBOPT_0x11
	SBIW R26,2
	BRNE _0x51
; 0000 0341             {
; 0000 0342              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 0343             lcd_putsf("Pocet vzorku:");
	CALL SUBOPT_0x1C
; 0000 0344              Data[x].number = xy_f;
	CALL SUBOPT_0x18
	CALL SUBOPT_0x1D
; 0000 0345              if(xy_f <100)
	BRGE _0x52
; 0000 0346              {
; 0000 0347              lcd_gotoxy(0,1);
	CALL SUBOPT_0x1E
; 0000 0348              lcd_putsf("   ");
	CALL SUBOPT_0x1F
; 0000 0349              }
; 0000 034A             lcd_gotoxy(0, 1);
_0x52:
	CALL SUBOPT_0x1E
; 0000 034B              itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 034C             lcd_puts(Cycle);
; 0000 034D 
; 0000 034E              }
; 0000 034F 
; 0000 0350 
; 0000 0351     break;
_0x51:
	RJMP _0x3E
; 0000 0352 
; 0000 0353     case 4 :
_0x4E:
	CPI  R30,LOW(0x4)
	LDI  R26,HIGH(0x4)
	CPC  R31,R26
	BRNE _0x53
; 0000 0354     if((CountType==0))
	CALL SUBOPT_0x13
	BRNE _0x54
; 0000 0355               {
; 0000 0356             lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 0357             lcd_putsf("Vyber signal 5");
	__POINTW1FN _0x0,88
	CALL SUBOPT_0x15
; 0000 0358 
; 0000 0359             lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 035A             lcd_putsf(Data[Sequence[x]].name);
; 0000 035B            // Sequence[x] = Data[y].order;
; 0000 035C              lcd_gotoxy(10, 1);
	CALL SUBOPT_0x17
; 0000 035D             lcd_putsf(","); //6,7,8 misto na displeji v 2 radku     0123456
; 0000 035E             itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 035F 
; 0000 0360 
; 0000 0361             lcd_puts(Cycle);
; 0000 0362 
; 0000 0363              }
; 0000 0364 
; 0000 0365              if((CountType == 1))
_0x54:
	CALL SUBOPT_0x11
	SBIW R26,1
	BRNE _0x55
; 0000 0366              {
; 0000 0367              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 0368              lcd_putsf("Vzorek:");
	CALL SUBOPT_0x1A
; 0000 0369              lcd_gotoxy(0,1);
	CALL SUBOPT_0x16
; 0000 036A              lcd_putsf(Data[Sequence[x]].name);
; 0000 036B              Sequence[x] = Data[y].order;
	CALL SUBOPT_0x1B
; 0000 036C              }
; 0000 036D 
; 0000 036E 
; 0000 036F             if((CountType == 2))
_0x55:
	CALL SUBOPT_0x11
	SBIW R26,2
	BRNE _0x56
; 0000 0370             {
; 0000 0371              lcd_gotoxy(0, 0);
	CALL SUBOPT_0x14
; 0000 0372             lcd_putsf("Pocet vzorku:");
	CALL SUBOPT_0x1C
; 0000 0373              Data[x].number = xy_f;
	CALL SUBOPT_0x18
	CALL SUBOPT_0x1D
; 0000 0374              if(xy_f <100)
	BRGE _0x57
; 0000 0375              {
; 0000 0376              lcd_gotoxy(0,1);
	CALL SUBOPT_0x1E
; 0000 0377              lcd_putsf("   ");
	CALL SUBOPT_0x1F
; 0000 0378              }
; 0000 0379             lcd_gotoxy(0, 1);
_0x57:
	CALL SUBOPT_0x1E
; 0000 037A              itoa(Data[x].number,Cycle);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x19
; 0000 037B             lcd_puts(Cycle);
; 0000 037C 
; 0000 037D              }
; 0000 037E 
; 0000 037F 
; 0000 0380     break;
_0x56:
	RJMP _0x3E
; 0000 0381 
; 0000 0382 
; 0000 0383     case 5 :
_0x53:
	CPI  R30,LOW(0x5)
	LDI  R26,HIGH(0x5)
	CPC  R31,R26
	BREQ PC+3
	JMP _0x3E
; 0000 0384             if(((CountType == 0)||(CountType == 1)))
	CALL SUBOPT_0x11
	SBIW R26,0
	BREQ _0x5A
	CALL SUBOPT_0x11
	SBIW R26,1
	BREQ _0x5A
	RJMP _0x59
_0x5A:
; 0000 0385             {
; 0000 0386 
; 0000 0387             lcd_gotoxy(0,0);
	CALL SUBOPT_0x14
; 0000 0388             lcd_putsf("Tepova frekvence");
	__POINTW1FN _0x0,103
	CALL SUBOPT_0x15
; 0000 0389 
; 0000 038A              lcd_gotoxy(0,1);
	CALL SUBOPT_0x1E
; 0000 038B              itoa(Data[x].number,Frequency);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x20
; 0000 038C 
; 0000 038D              lcd_puts(Frequency);
; 0000 038E 
; 0000 038F              TF =(float)Data[x].number;
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL __CWD1
	CALL __CDF1
	STS  _TF,R30
	STS  _TF+1,R31
	STS  _TF+2,R22
	STS  _TF+3,R23
; 0000 0390              TF1 = TF / 60;
	LDS  R26,_TF
	LDS  R27,_TF+1
	LDS  R24,_TF+2
	LDS  R25,_TF+3
	__GETD1N 0x42700000
	CALL SUBOPT_0x21
; 0000 0391              TF2 = 1/TF1;
	__GETD2N 0x3F800000
	CALL __DIVF21
	STS  _TF2,R30
	STS  _TF2+1,R31
	STS  _TF2+2,R22
	STS  _TF2+3,R23
; 0000 0392              TF1 = (TF2 / jm);
	__GETD1S 2
	LDS  R26,_TF2
	LDS  R27,_TF2+1
	LDS  R24,_TF2+2
	LDS  R25,_TF2+3
	CALL SUBOPT_0x21
; 0000 0393 
; 0000 0394              Freq =(unsigned int)TF1;
	CALL __CFD1U
	STS  _Freq,R30
	STS  _Freq+1,R31
; 0000 0395              //highbyte = Freq>>8;
; 0000 0396              //lowbyte = Freq;
; 0000 0397            if(status1 == 0)
	SBIC 0x1E,0
	RJMP _0x5C
; 0000 0398             {
; 0000 0399             for(k = 0; k <= 4;k++)    //for(k = 0; k <=4;k++)horna hranica je pocet vzorkov
	LDI  R30,LOW(0)
	STS  _k,R30
	STS  _k+1,R30
_0x5E:
	LDS  R26,_k
	LDS  R27,_k+1
	SBIW R26,5
	BRLT PC+3
	JMP _0x5F
; 0000 039A                 {  i=0;
	CALL SUBOPT_0x6
; 0000 039B                   while(Data[Sequence[k]].type[i])
_0x60:
	CALL SUBOPT_0x22
	__ADDW1MN _Data,4
	MOVW R26,R30
	CALL SUBOPT_0x23
	ADD  R30,R26
	ADC  R31,R27
	LPM  R30,Z
	CPI  R30,0
	BREQ _0x62
; 0000 039C                   {
; 0000 039D                   i++;
	LDI  R26,LOW(_i)
	LDI  R27,HIGH(_i)
	CALL SUBOPT_0xA
; 0000 039E 
; 0000 039F                   }
	RJMP _0x60
_0x62:
; 0000 03A0 
; 0000 03A1 
; 0000 03A2 
; 0000 03A3                  Data[Sequence[k]].wait_loop = Freq -  Data[Sequence[k]].type_frequency*i;
	CALL SUBOPT_0x22
	MOVW R26,R30
	__ADDW1MN _Data,10
	MOVW R22,R30
	__ADDW2MN _Data,8
	CALL SUBOPT_0x23
	CALL SUBOPT_0x24
	CALL __SWAPW12
	SUB  R30,R26
	SBC  R31,R27
	MOVW R26,R22
	ST   X+,R30
	ST   X,R31
; 0000 03A4                  pom =(long int) (Freq -  Data[Sequence[k]].type_frequency*i);
	CALL SUBOPT_0x22
	__ADDW1MN _Data,8
	MOVW R26,R30
	CALL SUBOPT_0x23
	CALL SUBOPT_0x24
	SUB  R26,R30
	SBC  R27,R31
	STS  _pom,R26
	STS  _pom+1,R27
; 0000 03A5                    if(pom<0)
	LDS  R26,_pom+1
	TST  R26
	BRPL _0x63
; 0000 03A6                     {
; 0000 03A7                     lcd_clear();
	CALL _lcd_clear
; 0000 03A8                     lcd_gotoxy(0,0);
	CALL SUBOPT_0x14
; 0000 03A9                     lcd_putsf("Vysoka f. pro");
	__POINTW1FN _0x0,120
	CALL SUBOPT_0x15
; 0000 03AA                     lcd_gotoxy(0,1);
	CALL SUBOPT_0x1E
; 0000 03AB                     lcd_putsf(Data[Sequence[k]].name);
	CALL SUBOPT_0x22
	__ADDW1MN _Data,2
	MOVW R26,R30
	CALL __GETW1P
	CALL SUBOPT_0x15
; 0000 03AC                     delay_ms(500);
	CALL SUBOPT_0x25
; 0000 03AD                     CountType = 2;
	LDI  R30,LOW(2)
	LDI  R31,HIGH(2)
	STS  _CountType,R30
	STS  _CountType+1,R31
; 0000 03AE                     status1=1;
	SBI  0x1E,0
; 0000 03AF                     }
; 0000 03B0                     i=0;
_0x63:
	CALL SUBOPT_0x6
; 0000 03B1                     pom = 0;
	LDI  R30,LOW(0)
	STS  _pom,R30
	STS  _pom+1,R30
; 0000 03B2                 }
	LDI  R26,LOW(_k)
	LDI  R27,HIGH(_k)
	CALL SUBOPT_0xA
	RJMP _0x5E
_0x5F:
; 0000 03B3                 if(status1==0)
	SBIC 0x1E,0
	RJMP _0x66
; 0000 03B4                 {
; 0000 03B5 
; 0000 03B6                   lcd_clear();
	CALL _lcd_clear
; 0000 03B7                   lcd_gotoxy(0,0);
	CALL SUBOPT_0x14
; 0000 03B8                   lcd_putsf("Frekvence OK");
	__POINTW1FN _0x0,134
	CALL SUBOPT_0x15
; 0000 03B9                   delay_ms(500);
	CALL SUBOPT_0x25
; 0000 03BA                   lcd_clear();
	CALL _lcd_clear
; 0000 03BB                   status1= 1;
	SBI  0x1E,0
; 0000 03BC                 }
; 0000 03BD 
; 0000 03BE 
; 0000 03BF 
; 0000 03C0              }
_0x66:
; 0000 03C1 
; 0000 03C2 
; 0000 03C3             }
_0x5C:
; 0000 03C4 //            if((CountType == 1) && (status == 0))
; 0000 03C5 //            {
; 0000 03C6 //
; 0000 03C7 //
; 0000 03C8 //            }
; 0000 03C9 
; 0000 03CA               if((CountType == 2))
_0x59:
	CALL SUBOPT_0x11
	SBIW R26,2
	BRNE _0x69
; 0000 03CB 
; 0000 03CC               {
; 0000 03CD                 status1=0;
	CBI  0x1E,0
; 0000 03CE               lcd_gotoxy(0,0);
	CALL SUBOPT_0x14
; 0000 03CF               lcd_putsf("Tepu za minutu");
	__POINTW1FN _0x0,147
	CALL SUBOPT_0x15
; 0000 03D0 
; 0000 03D1              Data[x].number = xy_f;
	CALL SUBOPT_0x18
	CALL SUBOPT_0x1D
; 0000 03D2 
; 0000 03D3                if(xy_f <100)
	BRGE _0x6C
; 0000 03D4                  {
; 0000 03D5                  lcd_gotoxy(0,1);
	CALL SUBOPT_0x1E
; 0000 03D6                 lcd_putsf("   ");
	CALL SUBOPT_0x1F
; 0000 03D7                  }
; 0000 03D8 
; 0000 03D9              lcd_gotoxy(0, 1);
_0x6C:
	CALL SUBOPT_0x1E
; 0000 03DA              itoa(Data[x].number,Frequency);
	CALL SUBOPT_0x18
	CALL SUBOPT_0xC
	CALL SUBOPT_0x20
; 0000 03DB              lcd_puts(Frequency);
; 0000 03DC 
; 0000 03DD 
; 0000 03DE              }
; 0000 03DF 
; 0000 03E0 
; 0000 03E1 
; 0000 03E2 
; 0000 03E3 
; 0000 03E4     break;
_0x69:
; 0000 03E5 
; 0000 03E6    }
_0x3E:
; 0000 03E7 
; 0000 03E8       //koniec if(status == 0)
; 0000 03E9 
; 0000 03EA 
; 0000 03EB 
; 0000 03EC 
; 0000 03ED   }
	RJMP _0x23
; 0000 03EE 
; 0000 03EF   }
_0x6D:
	RJMP _0x6D

	.CSEG
_itoa:
    ld   r26,y+
    ld   r27,y+
    ld   r30,y+
    ld   r31,y+
    adiw r30,0
    brpl __itoa0
    com  r30
    com  r31
    adiw r30,1
    ldi  r22,'-'
    st   x+,r22
__itoa0:
    clt
    ldi  r24,low(10000)
    ldi  r25,high(10000)
    rcall __itoa1
    ldi  r24,low(1000)
    ldi  r25,high(1000)
    rcall __itoa1
    ldi  r24,100
    clr  r25
    rcall __itoa1
    ldi  r24,10
    rcall __itoa1
    mov  r22,r30
    rcall __itoa5
    clr  r22
    st   x,r22
    ret

__itoa1:
    clr	 r22
__itoa2:
    cp   r30,r24
    cpc  r31,r25
    brlo __itoa3
    inc  r22
    sub  r30,r24
    sbc  r31,r25
    brne __itoa2
__itoa3:
    tst  r22
    brne __itoa4
    brts __itoa5
    ret
__itoa4:
    set
__itoa5:
    subi r22,-0x30
    st   x+,r22
    ret

	.DSEG

	.CSEG
_malloc:
	LDI  R30,LOW(0)
	LDI  R31,HIGH(0)
	RJMP _0x20A0003
	#ifndef __SLEEP_DEFINED__
	#define __SLEEP_DEFINED__
	.EQU __se_bit=0x01
	.EQU __sm_mask=0x0E
	.EQU __sm_powerdown=0x04
	.EQU __sm_powersave=0x06
	.EQU __sm_standby=0x0C
	.EQU __sm_ext_standby=0x0E
	.EQU __sm_adc_noise_red=0x02
	.SET power_ctrl_reg=smcr
	#endif

	.DSEG

	.CSEG
__lcd_write_nibble_G101:
	LD   R30,Y
	ANDI R30,LOW(0x10)
	BREQ _0x2020004
	SBI  0x5,3
	RJMP _0x2020005
_0x2020004:
	CBI  0x5,3
_0x2020005:
	LD   R30,Y
	ANDI R30,LOW(0x20)
	BREQ _0x2020006
	SBI  0x5,4
	RJMP _0x2020007
_0x2020006:
	CBI  0x5,4
_0x2020007:
	LD   R30,Y
	ANDI R30,LOW(0x40)
	BREQ _0x2020008
	SBI  0x5,5
	RJMP _0x2020009
_0x2020008:
	CBI  0x5,5
_0x2020009:
	LD   R30,Y
	ANDI R30,LOW(0x80)
	BREQ _0x202000A
	SBI  0x5,6
	RJMP _0x202000B
_0x202000A:
	CBI  0x5,6
_0x202000B:
	__DELAY_USB 5
	SBI  0x5,2
	__DELAY_USB 13
	CBI  0x5,2
	__DELAY_USB 13
	RJMP _0x20A0001
__lcd_write_data:
	LD   R30,Y
	ST   -Y,R30
	RCALL __lcd_write_nibble_G101
    ld    r30,y
    swap  r30
    st    y,r30
	LD   R30,Y
	ST   -Y,R30
	RCALL __lcd_write_nibble_G101
	__DELAY_USB 133
	RJMP _0x20A0001
_lcd_gotoxy:
	LD   R30,Y
	LDI  R31,0
	SUBI R30,LOW(-__base_y_G101)
	SBCI R31,HIGH(-__base_y_G101)
	LD   R30,Z
	LDD  R26,Y+1
	ADD  R30,R26
	ST   -Y,R30
	RCALL __lcd_write_data
	LDD  R4,Y+1
	LDD  R3,Y+0
_0x20A0003:
	ADIW R28,2
	RET
_lcd_clear:
	LDI  R30,LOW(2)
	CALL SUBOPT_0x26
	LDI  R30,LOW(12)
	ST   -Y,R30
	RCALL __lcd_write_data
	LDI  R30,LOW(1)
	CALL SUBOPT_0x26
	LDI  R30,LOW(0)
	MOV  R3,R30
	MOV  R4,R30
	RET
_lcd_putchar:
	LD   R26,Y
	CPI  R26,LOW(0xA)
	BREQ _0x2020011
	CP   R4,R6
	BRLO _0x2020010
_0x2020011:
	LDI  R30,LOW(0)
	ST   -Y,R30
	INC  R3
	ST   -Y,R3
	RCALL _lcd_gotoxy
	LD   R26,Y
	CPI  R26,LOW(0xA)
	BRNE _0x2020013
	RJMP _0x20A0001
_0x2020013:
_0x2020010:
	INC  R4
	SBI  0x5,0
	LD   R30,Y
	ST   -Y,R30
	RCALL __lcd_write_data
	CBI  0x5,0
	RJMP _0x20A0001
_lcd_puts:
	ST   -Y,R17
_0x2020014:
	LDD  R26,Y+1
	LDD  R27,Y+1+1
	LD   R30,X+
	STD  Y+1,R26
	STD  Y+1+1,R27
	MOV  R17,R30
	CPI  R30,0
	BREQ _0x2020016
	ST   -Y,R17
	RCALL _lcd_putchar
	RJMP _0x2020014
_0x2020016:
	RJMP _0x20A0002
_lcd_putsf:
	ST   -Y,R17
_0x2020017:
	LDD  R30,Y+1
	LDD  R31,Y+1+1
	ADIW R30,1
	STD  Y+1,R30
	STD  Y+1+1,R31
	SBIW R30,1
	LPM  R30,Z
	MOV  R17,R30
	CPI  R30,0
	BREQ _0x2020019
	ST   -Y,R17
	RCALL _lcd_putchar
	RJMP _0x2020017
_0x2020019:
_0x20A0002:
	LDD  R17,Y+0
	ADIW R28,3
	RET
_lcd_init:
	SBI  0x4,3
	SBI  0x4,4
	SBI  0x4,5
	SBI  0x4,6
	SBI  0x4,2
	SBI  0x4,0
	SBI  0x4,1
	CBI  0x5,2
	CBI  0x5,0
	CBI  0x5,1
	LDD  R6,Y+0
	LD   R30,Y
	SUBI R30,-LOW(128)
	__PUTB1MN __base_y_G101,2
	LD   R30,Y
	SUBI R30,-LOW(192)
	__PUTB1MN __base_y_G101,3
	LDI  R30,LOW(20)
	LDI  R31,HIGH(20)
	ST   -Y,R31
	ST   -Y,R30
	CALL _delay_ms
	CALL SUBOPT_0x27
	CALL SUBOPT_0x27
	CALL SUBOPT_0x27
	LDI  R30,LOW(32)
	ST   -Y,R30
	RCALL __lcd_write_nibble_G101
	__DELAY_USW 200
	LDI  R30,LOW(40)
	ST   -Y,R30
	RCALL __lcd_write_data
	LDI  R30,LOW(4)
	ST   -Y,R30
	RCALL __lcd_write_data
	LDI  R30,LOW(133)
	ST   -Y,R30
	RCALL __lcd_write_data
	LDI  R30,LOW(6)
	ST   -Y,R30
	RCALL __lcd_write_data
	RCALL _lcd_clear
_0x20A0001:
	ADIW R28,1
	RET

	.CSEG

	.CSEG

	.CSEG

	.DSEG
_tlacitka1:
	.BYTE 0x1
_i:
	.BYTE 0x2
_j:
	.BYTE 0x2
_k:
	.BYTE 0x2
_n:
	.BYTE 0x2
_pom:
	.BYTE 0x2
_xy_f:
	.BYTE 0x2
_events:
	.BYTE 0x1
_Sequence:
	.BYTE 0xA
_CountType:
	.BYTE 0x2
_TF:
	.BYTE 0x4
_TF1:
	.BYTE 0x4
_TF2:
	.BYTE 0x4
_Freq:
	.BYTE 0x2
_Data:
	.BYTE 0x48
__seed_G100:
	.BYTE 0x4
__base_y_G101:
	.BYTE 0x4

	.CSEG
;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:5 WORDS
SUBOPT_0x0:
	STS  _events,R30
	LDS  R26,_CountType
	LDS  R27,_CountType+1
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x1:
	ST   -Y,R0
	ST   -Y,R1
	ST   -Y,R22
	ST   -Y,R26
	ST   -Y,R27
	ST   -Y,R30
	ST   -Y,R31
	IN   R30,SREG
	ST   -Y,R30
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x2:
	LDS  R26,_Sequence
	LDS  R27,_Sequence+1
	LDI  R30,LOW(12)
	CALL __MULB1W2U
	__ADDW1MN _Data,8
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:7 WORDS
SUBOPT_0x3:
	MOVW R26,R30
	CALL __GETW1P
	MOV  R30,R31
	LDI  R31,0
	STS  137,R30
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x4:
	LD   R30,Z
	STS  136,R30
	LDI  R30,LOW(0)
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x5:
	STS  _n,R30
	STS  _n+1,R30
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:6 WORDS
SUBOPT_0x6:
	LDI  R30,LOW(0)
	STS  _i,R30
	STS  _i+1,R30
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:2 WORDS
SUBOPT_0x7:
	LDI  R26,LOW(_n)
	LDI  R27,HIGH(_n)
	LD   R30,X+
	LD   R31,X+
	ADIW R30,1
	ST   -X,R31
	ST   -X,R30
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x8:
	LDI  R30,LOW(0)
	STS  133,R30
	STS  132,R30
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:22 WORDS
SUBOPT_0x9:
	LDS  R30,_i
	LDS  R31,_i+1
	LDI  R26,LOW(_Sequence)
	LDI  R27,HIGH(_Sequence)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	LDI  R26,LOW(12)
	LDI  R27,HIGH(12)
	CALL __MULW12U
	__ADDW1MN _Data,4
	MOVW R26,R30
	CALL __GETW1P
	LDS  R26,_j
	LDS  R27,_j+1
	ADD  R30,R26
	ADC  R31,R27
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 6 TIMES, CODE SIZE REDUCTION:12 WORDS
SUBOPT_0xA:
	LD   R30,X+
	LD   R31,X+
	ADIW R30,1
	ST   -X,R31
	ST   -X,R30
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:5 WORDS
SUBOPT_0xB:
	LDS  R26,_i
	LDS  R27,_i+1
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 14 TIMES, CODE SIZE REDUCTION:36 WORDS
SUBOPT_0xC:
	__ADDW1MN _Data,6
	MOVW R26,R30
	CALL __GETW1P
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0xD:
	LDS  R30,_i
	LDS  R31,_i+1
	LDI  R26,LOW(_Sequence)
	LDI  R27,HIGH(_Sequence)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	LDI  R26,LOW(12)
	LDI  R27,HIGH(12)
	CALL __MULW12U
	__ADDW1MN _Data,8
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0xE:
	LDS  R30,_i
	LDS  R31,_i+1
	LDI  R26,LOW(_Sequence)
	LDI  R27,HIGH(_Sequence)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	LDI  R26,LOW(12)
	LDI  R27,HIGH(12)
	CALL __MULW12U
	__ADDW1MN _Data,10
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:5 WORDS
SUBOPT_0xF:
	LDI  R26,LOW(4)
	LDI  R27,HIGH(4)
	STD  Z+0,R26
	STD  Z+1,R27
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:3 WORDS
SUBOPT_0x10:
	LDI  R26,LOW(0)
	LDI  R27,HIGH(0)
	STD  Z+0,R26
	STD  Z+1,R27
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 18 TIMES, CODE SIZE REDUCTION:31 WORDS
SUBOPT_0x11:
	LDS  R26,_CountType
	LDS  R27,_CountType+1
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 13 TIMES, CODE SIZE REDUCTION:21 WORDS
SUBOPT_0x12:
	LDS  R26,_xy_f
	LDS  R27,_xy_f+1
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 7 TIMES, CODE SIZE REDUCTION:15 WORDS
SUBOPT_0x13:
	LDS  R30,_CountType
	LDS  R31,_CountType+1
	SBIW R30,0
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 19 TIMES, CODE SIZE REDUCTION:69 WORDS
SUBOPT_0x14:
	LDI  R30,LOW(0)
	ST   -Y,R30
	ST   -Y,R30
	JMP  _lcd_gotoxy

;OPTIMIZER ADDED SUBROUTINE, CALLED 41 TIMES, CODE SIZE REDUCTION:77 WORDS
SUBOPT_0x15:
	ST   -Y,R31
	ST   -Y,R30
	JMP  _lcd_putsf

;OPTIMIZER ADDED SUBROUTINE, CALLED 10 TIMES, CODE SIZE REDUCTION:213 WORDS
SUBOPT_0x16:
	LDI  R30,LOW(0)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _lcd_gotoxy
	MOVW R30,R16
	LDI  R26,LOW(_Sequence)
	LDI  R27,HIGH(_Sequence)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	LDI  R26,LOW(12)
	LDI  R27,HIGH(12)
	CALL __MULW12U
	__ADDW1MN _Data,2
	MOVW R26,R30
	CALL __GETW1P
	RJMP SUBOPT_0x15

;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:29 WORDS
SUBOPT_0x17:
	LDI  R30,LOW(10)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	CALL _lcd_gotoxy
	__POINTW1FN _0x0,15
	RJMP SUBOPT_0x15

;OPTIMIZER ADDED SUBROUTINE, CALLED 19 TIMES, CODE SIZE REDUCTION:51 WORDS
SUBOPT_0x18:
	__MULBNWRU 16,17,12
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 10 TIMES, CODE SIZE REDUCTION:69 WORDS
SUBOPT_0x19:
	ST   -Y,R31
	ST   -Y,R30
	ST   -Y,R21
	ST   -Y,R20
	CALL _itoa
	ST   -Y,R21
	ST   -Y,R20
	JMP  _lcd_puts

;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:5 WORDS
SUBOPT_0x1A:
	__POINTW1FN _0x0,17
	RJMP SUBOPT_0x15

;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:73 WORDS
SUBOPT_0x1B:
	MOVW R30,R16
	LDI  R26,LOW(_Sequence)
	LDI  R27,HIGH(_Sequence)
	LSL  R30
	ROL  R31
	ADD  R30,R26
	ADC  R31,R27
	MOVW R22,R30
	__MULBNWRU 18,19,12
	SUBI R30,LOW(-_Data)
	SBCI R31,HIGH(-_Data)
	MOVW R26,R30
	CALL __GETW1P
	MOVW R26,R22
	ST   X+,R30
	ST   X,R31
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 5 TIMES, CODE SIZE REDUCTION:5 WORDS
SUBOPT_0x1C:
	__POINTW1FN _0x0,25
	RJMP SUBOPT_0x15

;OPTIMIZER ADDED SUBROUTINE, CALLED 6 TIMES, CODE SIZE REDUCTION:42 WORDS
SUBOPT_0x1D:
	__ADDW1MN _Data,6
	RCALL SUBOPT_0x12
	STD  Z+0,R26
	STD  Z+1,R27
	RCALL SUBOPT_0x12
	CPI  R26,LOW(0x64)
	LDI  R30,HIGH(0x64)
	CPC  R27,R30
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 14 TIMES, CODE SIZE REDUCTION:49 WORDS
SUBOPT_0x1E:
	LDI  R30,LOW(0)
	ST   -Y,R30
	LDI  R30,LOW(1)
	ST   -Y,R30
	JMP  _lcd_gotoxy

;OPTIMIZER ADDED SUBROUTINE, CALLED 6 TIMES, CODE SIZE REDUCTION:7 WORDS
SUBOPT_0x1F:
	__POINTW1FN _0x0,39
	RJMP SUBOPT_0x15

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:9 WORDS
SUBOPT_0x20:
	ST   -Y,R31
	ST   -Y,R30
	LDD  R30,Y+2
	LDD  R31,Y+2+1
	ST   -Y,R31
	ST   -Y,R30
	CALL _itoa
	LD   R30,Y
	LDD  R31,Y+1
	ST   -Y,R31
	ST   -Y,R30
	JMP  _lcd_puts

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:13 WORDS
SUBOPT_0x21:
	CALL __DIVF21
	STS  _TF1,R30
	STS  _TF1+1,R31
	STS  _TF1+2,R22
	STS  _TF1+3,R23
	LDS  R30,_TF1
	LDS  R31,_TF1+1
	LDS  R22,_TF1+2
	LDS  R23,_TF1+3
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 4 TIMES, CODE SIZE REDUCTION:39 WORDS
SUBOPT_0x22:
	LDS  R30,_k
	LDS  R31,_k+1
	LDI  R26,LOW(_Sequence)
	LDI  R27,HIGH(_Sequence)
	LSL  R30
	ROL  R31
	ADD  R26,R30
	ADC  R27,R31
	CALL __GETW1P
	LDI  R26,LOW(12)
	LDI  R27,HIGH(12)
	CALL __MULW12U
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x23:
	CALL __GETW1P
	RJMP SUBOPT_0xB

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x24:
	CALL __MULW12U
	LDS  R26,_Freq
	LDS  R27,_Freq+1
	RET

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:1 WORDS
SUBOPT_0x25:
	LDI  R30,LOW(500)
	LDI  R31,HIGH(500)
	ST   -Y,R31
	ST   -Y,R30
	JMP  _delay_ms

;OPTIMIZER ADDED SUBROUTINE, CALLED 2 TIMES, CODE SIZE REDUCTION:4 WORDS
SUBOPT_0x26:
	ST   -Y,R30
	CALL __lcd_write_data
	LDI  R30,LOW(3)
	LDI  R31,HIGH(3)
	ST   -Y,R31
	ST   -Y,R30
	JMP  _delay_ms

;OPTIMIZER ADDED SUBROUTINE, CALLED 3 TIMES, CODE SIZE REDUCTION:9 WORDS
SUBOPT_0x27:
	LDI  R30,LOW(48)
	ST   -Y,R30
	CALL __lcd_write_nibble_G101
	__DELAY_USW 200
	RET


	.CSEG
_delay_ms:
	ld   r30,y+
	ld   r31,y+
	adiw r30,0
	breq __delay_ms1
__delay_ms0:
	__DELAY_USW 0x7D0
	wdr
	sbiw r30,1
	brne __delay_ms0
__delay_ms1:
	ret

__ROUND_REPACK:
	TST  R21
	BRPL __REPACK
	CPI  R21,0x80
	BRNE __ROUND_REPACK0
	SBRS R30,0
	RJMP __REPACK
__ROUND_REPACK0:
	ADIW R30,1
	ADC  R22,R25
	ADC  R23,R25
	BRVS __REPACK1

__REPACK:
	LDI  R21,0x80
	EOR  R21,R23
	BRNE __REPACK0
	PUSH R21
	RJMP __ZERORES
__REPACK0:
	CPI  R21,0xFF
	BREQ __REPACK1
	LSL  R22
	LSL  R0
	ROR  R21
	ROR  R22
	MOV  R23,R21
	RET
__REPACK1:
	PUSH R21
	TST  R0
	BRMI __REPACK2
	RJMP __MAXRES
__REPACK2:
	RJMP __MINRES

__UNPACK:
	LDI  R21,0x80
	MOV  R1,R25
	AND  R1,R21
	LSL  R24
	ROL  R25
	EOR  R25,R21
	LSL  R21
	ROR  R24

__UNPACK1:
	LDI  R21,0x80
	MOV  R0,R23
	AND  R0,R21
	LSL  R22
	ROL  R23
	EOR  R23,R21
	LSL  R21
	ROR  R22
	RET

__CFD1U:
	SET
	RJMP __CFD1U0
__CFD1:
	CLT
__CFD1U0:
	PUSH R21
	RCALL __UNPACK1
	CPI  R23,0x80
	BRLO __CFD10
	CPI  R23,0xFF
	BRCC __CFD10
	RJMP __ZERORES
__CFD10:
	LDI  R21,22
	SUB  R21,R23
	BRPL __CFD11
	NEG  R21
	CPI  R21,8
	BRTC __CFD19
	CPI  R21,9
__CFD19:
	BRLO __CFD17
	SER  R30
	SER  R31
	SER  R22
	LDI  R23,0x7F
	BLD  R23,7
	RJMP __CFD15
__CFD17:
	CLR  R23
	TST  R21
	BREQ __CFD15
__CFD18:
	LSL  R30
	ROL  R31
	ROL  R22
	ROL  R23
	DEC  R21
	BRNE __CFD18
	RJMP __CFD15
__CFD11:
	CLR  R23
__CFD12:
	CPI  R21,8
	BRLO __CFD13
	MOV  R30,R31
	MOV  R31,R22
	MOV  R22,R23
	SUBI R21,8
	RJMP __CFD12
__CFD13:
	TST  R21
	BREQ __CFD15
__CFD14:
	LSR  R23
	ROR  R22
	ROR  R31
	ROR  R30
	DEC  R21
	BRNE __CFD14
__CFD15:
	TST  R0
	BRPL __CFD16
	RCALL __ANEGD1
__CFD16:
	POP  R21
	RET

__CDF1U:
	SET
	RJMP __CDF1U0
__CDF1:
	CLT
__CDF1U0:
	SBIW R30,0
	SBCI R22,0
	SBCI R23,0
	BREQ __CDF10
	CLR  R0
	BRTS __CDF11
	TST  R23
	BRPL __CDF11
	COM  R0
	RCALL __ANEGD1
__CDF11:
	MOV  R1,R23
	LDI  R23,30
	TST  R1
__CDF12:
	BRMI __CDF13
	DEC  R23
	LSL  R30
	ROL  R31
	ROL  R22
	ROL  R1
	RJMP __CDF12
__CDF13:
	MOV  R30,R31
	MOV  R31,R22
	MOV  R22,R1
	PUSH R21
	RCALL __REPACK
	POP  R21
__CDF10:
	RET

__ZERORES:
	CLR  R30
	CLR  R31
	CLR  R22
	CLR  R23
	POP  R21
	RET

__MINRES:
	SER  R30
	SER  R31
	LDI  R22,0x7F
	SER  R23
	POP  R21
	RET

__MAXRES:
	SER  R30
	SER  R31
	LDI  R22,0x7F
	LDI  R23,0x7F
	POP  R21
	RET

__DIVF21:
	PUSH R21
	RCALL __UNPACK
	CPI  R23,0x80
	BRNE __DIVF210
	TST  R1
__DIVF211:
	BRPL __DIVF219
	RJMP __MINRES
__DIVF219:
	RJMP __MAXRES
__DIVF210:
	CPI  R25,0x80
	BRNE __DIVF218
__DIVF217:
	RJMP __ZERORES
__DIVF218:
	EOR  R0,R1
	SEC
	SBC  R25,R23
	BRVC __DIVF216
	BRLT __DIVF217
	TST  R0
	RJMP __DIVF211
__DIVF216:
	MOV  R23,R25
	PUSH R17
	PUSH R18
	PUSH R19
	PUSH R20
	CLR  R1
	CLR  R17
	CLR  R18
	CLR  R19
	CLR  R20
	CLR  R21
	LDI  R25,32
__DIVF212:
	CP   R26,R30
	CPC  R27,R31
	CPC  R24,R22
	CPC  R20,R17
	BRLO __DIVF213
	SUB  R26,R30
	SBC  R27,R31
	SBC  R24,R22
	SBC  R20,R17
	SEC
	RJMP __DIVF214
__DIVF213:
	CLC
__DIVF214:
	ROL  R21
	ROL  R18
	ROL  R19
	ROL  R1
	ROL  R26
	ROL  R27
	ROL  R24
	ROL  R20
	DEC  R25
	BRNE __DIVF212
	MOVW R30,R18
	MOV  R22,R1
	POP  R20
	POP  R19
	POP  R18
	POP  R17
	TST  R22
	BRMI __DIVF215
	LSL  R21
	ROL  R30
	ROL  R31
	ROL  R22
	DEC  R23
	BRVS __DIVF217
__DIVF215:
	RCALL __ROUND_REPACK
	POP  R21
	RET

__ANEGD1:
	COM  R31
	COM  R22
	COM  R23
	NEG  R30
	SBCI R31,-1
	SBCI R22,-1
	SBCI R23,-1
	RET

__CWD1:
	MOV  R22,R31
	ADD  R22,R22
	SBC  R22,R22
	MOV  R23,R22
	RET

__MULW12U:
	MUL  R31,R26
	MOV  R31,R0
	MUL  R30,R27
	ADD  R31,R0
	MUL  R30,R26
	MOV  R30,R0
	ADD  R31,R1
	RET

__MULB1W2U:
	MOV  R22,R30
	MUL  R22,R26
	MOVW R30,R0
	MUL  R22,R27
	ADD  R31,R0
	RET

__GETW1P:
	LD   R30,X+
	LD   R31,X
	SBIW R26,1
	RET

__SWAPW12:
	MOV  R1,R27
	MOV  R27,R31
	MOV  R31,R1

__SWAPB12:
	MOV  R1,R26
	MOV  R26,R30
	MOV  R30,R1
	RET

;END OF CODE MARKER
__END_OF_CODE:
