// File: merelin[P]mediasmartserverd/src/led_control_sch5127_base.h
// Function: LedControlSCH5127Base::setGpioSelInput_(int, int)
void setGpioSelInput_( int bits1, int bits2 ) {
		// Use Select (0 = native function, 1 = GPIO)
		{
			const unsigned int gpio_use_sel  = io_lpc_gpiobase_ + GPIO_USE_SEL;
			const unsigned int gpio_use_sel2 = io_lpc_gpiobase_ + GPIO_USE_SEL2;
			if ( ioperm(gpio_use_sel,  4, 1) ) throw ErrnoException("ioperm");
			if ( ioperm(gpio_use_sel2, 4, 1) ) throw ErrnoException("ioperm");
			
			outl( inl(gpio_use_sel)  | bits1, gpio_use_sel  );
			outl( inl(gpio_use_sel2) | bits2, gpio_use_sel2 );
			
			ioperm( gpio_use_sel, 4, 0 );
			ioperm( gpio_use_sel2, 4, 0 );
		}
		// Input/Output select (0 = Output, 1 = Input)
		{
			const unsigned int gp_io_sel  = io_lpc_gpiobase_ + GP_IO_SEL;
			const unsigned int gp_io_sel2 = io_lpc_gpiobase_ + GP_IO_SEL2;
			if ( ioperm(gp_io_sel,  4, 1) ) throw ErrnoException("ioperm");
			if ( ioperm(gp_io_sel2, 4, 1) ) throw ErrnoException("ioperm");
			
			outl( inl(gp_io_sel)  & ~bits1, gp_io_sel  );
			outl( inl(gp_io_sel2) & ~bits2, gp_io_sel2 );
			
			ioperm( gp_io_sel, 4, 0 );
			ioperm( gp_io_sel2, 4, 0 );
		}
	}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
movl 0x8(%rax), %ecx
addl $0x0, %ecx
movl %ecx, -0x14(%rbp)
movl 0x8(%rax), %eax
addl $0x30, %eax
movl %eax, -0x18(%rbp)
movl -0x14(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0xd4ce
movb $0x1, -0x4d(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0xe8(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x56c0
movq -0xe0(%rbp), %rdx
leaq 0x57a4(%rip), %rsi      # 0x12be6
leaq -0x38(%rbp), %rdi
callq 0x7600
jmp 0xd44d
callq 0x5030
movq -0xe8(%rbp), %rdi
movl (%rax), %edx
leaq -0x38(%rbp), %rsi
callq 0x76b0
jmp 0xd466
movq -0xe8(%rbp), %rdi
movb $0x0, -0x4d(%rbp)
leaq 0xa188(%rip), %rsi      # 0x17600
leaq -0x5cff(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0xd874
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd4ac
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x5230
leaq -0x39(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x4d(%rbp)
jne 0xd4bd
jmp 0xd4c9
movq -0xe8(%rbp), %rdi
callq 0x52a0
jmp 0xd86b
movl -0x18(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0xd5aa
movb $0x1, -0x72(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0xf8(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x56c0
movq -0xf0(%rbp), %rdx
leaq 0x56c8(%rip), %rsi      # 0x12be6
leaq -0x70(%rbp), %rdi
callq 0x7600
jmp 0xd529
callq 0x5030
movq -0xf8(%rbp), %rdi
movl (%rax), %edx
leaq -0x70(%rbp), %rsi
callq 0x76b0
jmp 0xd542
movq -0xf8(%rbp), %rdi
movb $0x0, -0x72(%rbp)
leaq 0xa0ac(%rip), %rsi      # 0x17600
leaq -0x5ddb(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0xd874
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd588
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x5230
leaq -0x71(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x72(%rbp)
jne 0xd599
jmp 0xd5a5
movq -0xf8(%rbp), %rdi
callq 0x52a0
jmp 0xd86b
movl -0x14(%rbp), %eax
movzwl %ax, %edi
callq 0xb090
movl %eax, %edi
orl -0xc(%rbp), %edi
movl -0x14(%rbp), %eax
movzwl %ax, %esi
callq 0xb070
movl -0x18(%rbp), %eax
movzwl %ax, %edi
callq 0xb090
movl %eax, %edi
orl -0x10(%rbp), %edi
movl -0x18(%rbp), %eax
movzwl %ax, %esi
callq 0xb070
movl -0x14(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
xorl %edx, %edx
callq 0x5620
movl -0x18(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
xorl %edx, %edx
callq 0x5620
movq -0xd8(%rbp), %rax
movl 0x8(%rax), %ecx
addl $0x4, %ecx
movl %ecx, -0x78(%rbp)
movl 0x8(%rax), %eax
addl $0x34, %eax
movl %eax, -0x7c(%rbp)
movl -0x78(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0xd70f
movb $0x1, -0xa2(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x108(%rbp)
leaq -0xa1(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x56c0
movq -0x100(%rbp), %rdx
leaq 0x5575(%rip), %rsi      # 0x12be6
leaq -0xa0(%rbp), %rdi
callq 0x7600
jmp 0xd67f
callq 0x5030
movq -0x108(%rbp), %rdi
movl (%rax), %edx
leaq -0xa0(%rbp), %rsi
callq 0x76b0
jmp 0xd69b
movq -0x108(%rbp), %rdi
movb $0x0, -0xa2(%rbp)
leaq 0x9f50(%rip), %rsi      # 0x17600
leaq -0x5f37(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0xd874
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd6e7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa0(%rbp), %rdi
callq 0x5230
leaq -0xa1(%rbp), %rdi
callq 0x53f0
testb $0x1, -0xa2(%rbp)
jne 0xd6fe
jmp 0xd70a
movq -0x108(%rbp), %rdi
callq 0x52a0
jmp 0xd86b
movl -0x7c(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
movl $0x1, %edx
callq 0x5620
cmpl $0x0, %eax
je 0xd800
movb $0x1, -0xca(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x118(%rbp)
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x110(%rbp)
callq 0x56c0
movq -0x110(%rbp), %rdx
leaq 0x5481(%rip), %rsi      # 0x12be6
leaq -0xc8(%rbp), %rdi
callq 0x7600
jmp 0xd773
callq 0x5030
movq -0x118(%rbp), %rdi
movl (%rax), %edx
leaq -0xc8(%rbp), %rsi
callq 0x76b0
jmp 0xd78f
movq -0x118(%rbp), %rdi
movb $0x0, -0xca(%rbp)
leaq 0x9e5c(%rip), %rsi      # 0x17600
leaq -0x602b(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0xd874
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xd7db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x5230
leaq -0xc9(%rbp), %rdi
callq 0x53f0
testb $0x1, -0xca(%rbp)
jne 0xd7f2
jmp 0xd7fe
movq -0x118(%rbp), %rdi
callq 0x52a0
jmp 0xd86b
movl -0x78(%rbp), %eax
movzwl %ax, %edi
callq 0xb090
movl %eax, %edi
movl -0xc(%rbp), %eax
xorl $-0x1, %eax
andl %eax, %edi
movl -0x78(%rbp), %eax
movzwl %ax, %esi
callq 0xb070
movl -0x7c(%rbp), %eax
movzwl %ax, %edi
callq 0xb090
movl %eax, %edi
movl -0x10(%rbp), %eax
xorl $-0x1, %eax
andl %eax, %edi
movl -0x7c(%rbp), %eax
movzwl %ax, %esi
callq 0xb070
movl -0x78(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
xorl %edx, %edx
callq 0x5620
movl -0x7c(%rbp), %eax
movl %eax, %edi
movl $0x4, %esi
xorl %edx, %edx
callq 0x5620
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x56b0
nopw %cs:(%rax,%rax)
nop