// File: merelin[P]mediasmartserverd/src/led_hpex485.h
// Function: LedHpEx48X::Init()
virtual bool Init( ) {
		// initialise SCH5127
		if ( !LedControlSCH5127Base::Init() ) return false;
		
		// set up io permissions to other ports we may use
		if ( ioperm(io_sch5127_regs_ + REG_HWM_INDEX, 1, 1) ) throw ErrnoException("ioperm");
		if ( ioperm(io_sch5127_regs_ + REG_HWM_DATA,  1, 1) ) throw ErrnoException("ioperm");
		
		//
		if ( ioperm(io_lpc_gpiobase_ + GPO_BLINK,	4, 1) ) throw ErrnoException("ioperm");
		if ( ioperm(io_lpc_gpiobase_ + GP_IO_SEL,	4, 1) ) throw ErrnoException("ioperm");
		if ( ioperm(io_lpc_gpiobase_ + GP_IO_SEL2,	4, 1) ) throw ErrnoException("ioperm");
		if ( ioperm(io_lpc_gpiobase_ + GP_LVL,		4, 1) ) throw ErrnoException("ioperm");
		if ( ioperm(io_lpc_gpiobase_ + GP_LVL2,		4, 1) ) throw ErrnoException("ioperm");
		
		enableLeds_( );
		
		return true;
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1b0, %rsp            # imm = 0x1B0
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x140(%rbp)
callq 0xc670
testb $0x1, %al
jne 0xfebc
movb $0x0, -0x1(%rbp)
jmp 0x10596
movq -0x140(%rbp), %rax
movl 0xc(%rax), %eax
addl $0x70, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0xffa4
movb $0x1, -0x45(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x150(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x148(%rbp)
callq 0x56c0
movq -0x148(%rbp), %rdx
leaq 0x2cce(%rip), %rsi      # 0x12be6
leaq -0x30(%rbp), %rdi
callq 0x7600
jmp 0xff23
callq 0x5030
movq -0x150(%rbp), %rdi
movl (%rax), %edx
leaq -0x30(%rbp), %rsi
callq 0x76b0
jmp 0xff3c
movq -0x150(%rbp), %rdi
movb $0x0, -0x45(%rbp)
leaq 0x76b2(%rip), %rsi      # 0x17600
leaq -0x87d5(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0x105ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xff82
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x5230
leaq -0x31(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x45(%rbp)
jne 0xff93
jmp 0xff9f
movq -0x150(%rbp), %rdi
callq 0x52a0
jmp 0x105a4
movq -0x140(%rbp), %rax
movl 0xc(%rax), %eax
addl $0x71, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0x1008c
movb $0x1, -0x6a(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x160(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x158(%rbp)
callq 0x56c0
movq -0x158(%rbp), %rdx
leaq 0x2be6(%rip), %rsi      # 0x12be6
leaq -0x68(%rbp), %rdi
callq 0x7600
jmp 0x1000b
callq 0x5030
movq -0x160(%rbp), %rdi
movl (%rax), %edx
leaq -0x68(%rbp), %rsi
callq 0x76b0
jmp 0x10024
movq -0x160(%rbp), %rdi
movb $0x0, -0x6a(%rbp)
leaq 0x75ca(%rip), %rsi      # 0x17600
leaq -0x88bd(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0x105ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1006a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x5230
leaq -0x69(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x6a(%rbp)
jne 0x1007b
jmp 0x10087
movq -0x160(%rbp), %rdi
callq 0x52a0
jmp 0x105a4
movq -0x140(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x18, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0x1018c
movb $0x1, -0x92(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x170(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0x168(%rbp)
callq 0x56c0
movq -0x168(%rbp), %rdx
leaq 0x2af8(%rip), %rsi      # 0x12be6
leaq -0x90(%rbp), %rdi
callq 0x7600
jmp 0x100fc
callq 0x5030
movq -0x170(%rbp), %rdi
movl (%rax), %edx
leaq -0x90(%rbp), %rsi
callq 0x76b0
jmp 0x10118
movq -0x170(%rbp), %rdi
movb $0x0, -0x92(%rbp)
leaq 0x74d3(%rip), %rsi      # 0x17600
leaq -0x89b4(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0x105ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x10164
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x5230
leaq -0x91(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x92(%rbp)
jne 0x1017b
jmp 0x10187
movq -0x170(%rbp), %rdi
callq 0x52a0
jmp 0x105a4
movq -0x140(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x4, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0x1028c
movb $0x1, -0xba(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x180(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x178(%rbp)
callq 0x56c0
movq -0x178(%rbp), %rdx
leaq 0x29f8(%rip), %rsi      # 0x12be6
leaq -0xb8(%rbp), %rdi
callq 0x7600
jmp 0x101fc
callq 0x5030
movq -0x180(%rbp), %rdi
movl (%rax), %edx
leaq -0xb8(%rbp), %rsi
callq 0x76b0
jmp 0x10218
movq -0x180(%rbp), %rdi
movb $0x0, -0xba(%rbp)
leaq 0x73d3(%rip), %rsi      # 0x17600
leaq -0x8ab4(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0x105ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x10264
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0x5230
leaq -0xb9(%rbp), %rdi
callq 0x53f0
testb $0x1, -0xba(%rbp)
jne 0x1027b
jmp 0x10287
movq -0x180(%rbp), %rdi
callq 0x52a0
jmp 0x105a4
movq -0x140(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x34, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0x1038c
movb $0x1, -0xe2(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x190(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x188(%rbp)
callq 0x56c0
movq -0x188(%rbp), %rdx
leaq 0x28f8(%rip), %rsi      # 0x12be6
leaq -0xe0(%rbp), %rdi
callq 0x7600
jmp 0x102fc
callq 0x5030
movq -0x190(%rbp), %rdi
movl (%rax), %edx
leaq -0xe0(%rbp), %rsi
callq 0x76b0
jmp 0x10318
movq -0x190(%rbp), %rdi
movb $0x0, -0xe2(%rbp)
leaq 0x72d3(%rip), %rsi      # 0x17600
leaq -0x8bb4(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0x105ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x10364
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x5230
leaq -0xe1(%rbp), %rdi
callq 0x53f0
testb $0x1, -0xe2(%rbp)
jne 0x1037b
jmp 0x10387
movq -0x190(%rbp), %rdi
callq 0x52a0
jmp 0x105a4
movq -0x140(%rbp), %rax
movl 0x8(%rax), %eax
addl $0xc, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0x1048c
movb $0x1, -0x10a(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x1a0(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x198(%rbp)
callq 0x56c0
movq -0x198(%rbp), %rdx
leaq 0x27f8(%rip), %rsi      # 0x12be6
leaq -0x108(%rbp), %rdi
callq 0x7600
jmp 0x103fc
callq 0x5030
movq -0x1a0(%rbp), %rdi
movl (%rax), %edx
leaq -0x108(%rbp), %rsi
callq 0x76b0
jmp 0x10418
movq -0x1a0(%rbp), %rdi
movb $0x0, -0x10a(%rbp)
leaq 0x71d3(%rip), %rsi      # 0x17600
leaq -0x8cb4(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0x105ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x10464
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x108(%rbp), %rdi
callq 0x5230
leaq -0x109(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x10a(%rbp)
jne 0x1047b
jmp 0x10487
movq -0x1a0(%rbp), %rdi
callq 0x52a0
jmp 0x105a4
movq -0x140(%rbp), %rax
movl 0x8(%rax), %eax
addl $0x38, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0x10586
movb $0x1, -0x132(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x1b0(%rbp)
leaq -0x131(%rbp), %rdi
movq %rdi, -0x1a8(%rbp)
callq 0x56c0
movq -0x1a8(%rbp), %rdx
leaq 0x26f8(%rip), %rsi      # 0x12be6
leaq -0x130(%rbp), %rdi
callq 0x7600
jmp 0x104fc
callq 0x5030
movq -0x1b0(%rbp), %rdi
movl (%rax), %edx
leaq -0x130(%rbp), %rsi
callq 0x76b0
jmp 0x10518
movq -0x1b0(%rbp), %rdi
movb $0x0, -0x132(%rbp)
leaq 0x70d3(%rip), %rsi      # 0x17600
leaq -0x8db4(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0x105ad
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x10561
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x130(%rbp), %rdi
callq 0x5230
leaq -0x131(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x132(%rbp)
jne 0x10578
jmp 0x10584
movq -0x1b0(%rbp), %rdi
callq 0x52a0
jmp 0x105a4
movq -0x140(%rbp), %rdi
callq 0x10800
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x1b0, %rsp            # imm = 0x1B0
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x56b0
nopl (%rax)