// File: /workspace/github_cpp_makefile_star2_O3/merelin[P]mediasmartserverd/src/mediasmartserverd.cpp
// Function: get_led_interface()
LedControlPtr get_led_interface( ) {
	LedControlPtr control;
	
	const char *systemVendor = GetUdevDeviceAttribute("dmi", "id", "sys_vendor");
	const char *productName = GetUdevDeviceAttribute("dmi", "id", "product_name");
	
	if(verbose > 0) cout << "--- SystemVendor: \"" << systemVendor
		<< "\" - ProductName: \"" << productName << "\" ---\n";
	
	if (strcmp(systemVendor, "Acer") == 0) {
		if(verbose > 0) cout << "Recognized SystemVendor: \"Acer\"\n";
		if (strcmp(productName, "Aspire easyStore H340") == 0) {
			// H340
			if(verbose > 0) cout << "Recognized ProductName: \"Aspire easyStore H340\"\n";
			control.reset( new LedAcerH340 );
			if ( control->Init( ) ) return control;
		}
		if (strcmp(productName, "Altos easyStore M2") == 0) {
			// Altos M2
			if(verbose > 0) cout << "Recognized ProductName: \"Altos easyStore M2\"\n";
			control.reset( new LedAcerAltosM2 );
			if ( control->Init( ) ) return control;
		}
		if (strcmp(productName, "Aspire easyStore H341") == 0 || strcmp(productName, "Aspire easyStore H342") == 0) {
			// H341 or H342
			if(verbose > 0) cout << "Recognized ProductName: \"" << productName << "\"\n";
			control.reset( new LedAcerH341 );
			if ( control->Init( ) ) return control;
		}
	}
	else if (strcmp(systemVendor, "LENOVO") == 0) {
		if(verbose > 0) cout << "Recognized SystemVendor: \"Lenovo\"\n";
		if (strcmp(productName, "IdeaCentre D400 10023") == 0) {
			// IdeaCentre D400
			if(verbose > 0) cout << "Recognized ProductName: \"IdeaCentre D400 10023\"\n";
			control.reset( new LedAcerH340 ); //Compatiple with H340.
			if ( control->Init( ) ) return control;
		}
	}
	else { // HP // If you have the system vendor and product name please add.
		// HP48X
		if(verbose > 0) cout << "Unrecognized SystemVendor: \"" 
			<< systemVendor << "\"\nAssuming HP\n";
		control.reset( new LedHpEx48X );
		if ( control->Init( ) ) return control;
	}
	//free
	free((char*)systemVendor);
	free((char*)productName);
	return LedControlPtr( );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x4882(%rip), %rdi      # 0xb66c
leaq 0x43cd(%rip), %rsi      # 0xb1be
leaq 0x4878(%rip), %rdx      # 0xb670
callq 0x6bc2
movq %rax, %r14
leaq 0x4865(%rip), %rdi      # 0xb66c
leaq 0x43b0(%rip), %rsi      # 0xb1be
leaq 0x4866(%rip), %rdx      # 0xb67b
callq 0x6bc2
movq %rax, %r15
cmpl $0x0, 0x9530(%rip)      # 0x10354
jle 0x6eec
movq 0x917f(%rip), %r12      # 0xffb0
leaq 0x4850(%rip), %rsi      # 0xb688
movl $0x13, %edx
movq %r12, %rdi
callq 0x4310
testq %r14, %r14
je 0x6e66
movq %r14, %rdi
callq 0x4130
movq 0x9157(%rip), %rdi      # 0xffb0
movq %r14, %rsi
movq %rax, %rdx
callq 0x4310
jmp 0x6e7f
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4510
movq 0x912a(%rip), %r12      # 0xffb0
leaq 0x480f(%rip), %rsi      # 0xb69c
movl $0x12, %edx
movq %r12, %rdi
callq 0x4310
testq %r15, %r15
je 0x6ebb
movq %r15, %rdi
callq 0x4130
movq 0x9102(%rip), %rdi      # 0xffb0
movq %r15, %rsi
movq %rax, %rdx
callq 0x4310
jmp 0x6ed4
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4510
movq 0x90d5(%rip), %rdi      # 0xffb0
leaq 0x47cd(%rip), %rsi      # 0xb6af
movl $0x6, %edx
callq 0x4310
leaq 0x47c3(%rip), %rsi      # 0xb6b6
movq %r14, %rdi
callq 0x43f0
testl %eax, %eax
je 0x6f67
leaq 0x4865(%rip), %rsi      # 0xb76b
movq %r14, %rdi
callq 0x43f0
movl 0x9440(%rip), %ecx      # 0x10354
testl %eax, %eax
je 0x7124
testl %ecx, %ecx
jle 0x7203
movq 0x9085(%rip), %r12      # 0xffb0
leaq 0x48aa(%rip), %rsi      # 0xb7dc
movl $0x1c, %edx
movq %r12, %rdi
callq 0x4310
testq %r14, %r14
je 0x71d2
movq %r14, %rdi
callq 0x4130
movq 0x9059(%rip), %rdi      # 0xffb0
movq %r14, %rsi
movq %rax, %rdx
callq 0x4310
jmp 0x71eb
cmpl $0x0, 0x93e6(%rip)      # 0x10354
jle 0x6f88
movq 0x9039(%rip), %rdi      # 0xffb0
leaq 0x473d(%rip), %rsi      # 0xb6bb
movl $0x20, %edx
callq 0x4310
leaq 0x4bd1(%rip), %rsi      # 0xbb60
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
jne 0x7019
cmpl $0x0, 0x93b2(%rip)      # 0x10354
jle 0x6fbc
movq 0x9005(%rip), %rdi      # 0xffb0
leaq 0x472a(%rip), %rsi      # 0xb6dc
movl $0x30, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x8a4b(%rip), %rcx      # 0xfa20
movq %rcx, (%rax)
leaq 0x18(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xa95a
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps %xmm1, (%rsp)
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
callq 0x5d10
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x72e7
leaq 0x4bb8(%rip), %rsi      # 0xbbd8
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
jne 0x70aa
cmpl $0x0, 0x9321(%rip)      # 0x10354
jle 0x704d
movq 0x8f74(%rip), %rdi      # 0xffb0
leaq 0x46ca(%rip), %rsi      # 0xb70d
movl $0x2d, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x8a5a(%rip), %rcx      # 0xfac0
movq %rcx, (%rax)
leaq 0x18(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xaa2a
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps %xmm1, (%rsp)
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
callq 0x5d10
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x72e7
leaq 0x4b3f(%rip), %rsi      # 0xbbf0
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
je 0x70d4
leaq 0x4677(%rip), %rsi      # 0xb73b
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
jne 0x730d
cmpl $0x0, 0x9279(%rip)      # 0x10354
jle 0x728e
movq 0x8ec8(%rip), %r12      # 0xffb0
leaq 0x4662(%rip), %rsi      # 0xb751
movl $0x19, %edx
movq %r12, %rdi
callq 0x4310
testq %r15, %r15
je 0x725d
movq %r15, %rdi
callq 0x4130
movq 0x8e9c(%rip), %rdi      # 0xffb0
movq %r15, %rsi
movq %rax, %rdx
callq 0x4310
jmp 0x7276
testl %ecx, %ecx
jle 0x7140
movq 0x8e81(%rip), %rdi      # 0xffb0
leaq 0x463c(%rip), %rsi      # 0xb772
movl $0x22, %edx
callq 0x4310
leaq 0x464e(%rip), %rsi      # 0xb795
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
jne 0x730d
cmpl $0x0, 0x91f6(%rip)      # 0x10354
jle 0x7178
movq 0x8e49(%rip), %rdi      # 0xffb0
leaq 0x463d(%rip), %rsi      # 0xb7ab
movl $0x30, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x888f(%rip), %rcx      # 0xfa20
movq %rcx, (%rax)
leaq 0x18(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xa95a
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps %xmm1, (%rsp)
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
callq 0x5d10
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x72e3
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4510
movq 0x8dbe(%rip), %rdi      # 0xffb0
leaq 0x4600(%rip), %rsi      # 0xb7f9
movl $0xe, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x8994(%rip), %rcx      # 0xfbb0
movq %rcx, (%rax)
leaq 0x18(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xabca
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps %xmm1, (%rsp)
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
callq 0x5d10
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x72e3
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4510
movq 0x8d33(%rip), %rdi      # 0xffb0
leaq 0x4486(%rip), %rsi      # 0xb70a
movl $0x2, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x8891(%rip), %rcx      # 0xfb38
movq %rcx, (%rax)
leaq 0x18(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xaafa
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movaps %xmm1, (%rsp)
movaps %xmm0, 0x10(%rsp)
movq %r12, %rdi
callq 0x5d10
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
je 0x730d
movq (%rsp), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x7323
movq 0x8ca5(%rip), %rcx      # 0xffa8
cmpb $0x0, (%rcx)
je 0x733c
incl 0x8(%rax)
jmp 0x7323
movq %r14, %rdi
callq 0x4340
movq %r15, %rdi
callq 0x4340
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0x5d10
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
lock
incl 0x8(%rax)
jmp 0x7323
jmp 0x7344
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5d10
movq %rbx, %rdi
callq 0x4550