// File: /workspace/github_cpp_makefile_star2_O1/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 0x487f(%rip), %rdi      # 0xb66c
leaq 0x43ca(%rip), %rsi      # 0xb1be
leaq 0x4875(%rip), %rdx      # 0xb670
callq 0x6bc1
movq %rax, %r14
leaq 0x4862(%rip), %rdi      # 0xb66c
leaq 0x43ad(%rip), %rsi      # 0xb1be
leaq 0x4863(%rip), %rdx      # 0xb67b
callq 0x6bc1
movq %rax, %r15
cmpl $0x0, 0x952d(%rip)      # 0x10354
jle 0x6eef
movq 0x917c(%rip), %r12      # 0xffb0
leaq 0x484d(%rip), %rsi      # 0xb688
movl $0x13, %edx
movq %r12, %rdi
callq 0x4310
testq %r14, %r14
je 0x6e69
movq %r14, %rdi
callq 0x4130
movq 0x9154(%rip), %rdi      # 0xffb0
movq %r14, %rsi
movq %rax, %rdx
callq 0x4310
jmp 0x6e82
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4510
movq 0x9127(%rip), %r12      # 0xffb0
leaq 0x480c(%rip), %rsi      # 0xb69c
movl $0x12, %edx
movq %r12, %rdi
callq 0x4310
testq %r15, %r15
je 0x6ebe
movq %r15, %rdi
callq 0x4130
movq 0x90ff(%rip), %rdi      # 0xffb0
movq %r15, %rsi
movq %rax, %rdx
callq 0x4310
jmp 0x6ed7
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4510
movq 0x90d2(%rip), %rdi      # 0xffb0
leaq 0x47ca(%rip), %rsi      # 0xb6af
movl $0x6, %edx
callq 0x4310
leaq 0x47c0(%rip), %rsi      # 0xb6b6
movq %r14, %rdi
callq 0x43f0
testl %eax, %eax
je 0x6f6a
leaq 0x4862(%rip), %rsi      # 0xb76b
movq %r14, %rdi
callq 0x43f0
movl 0x943d(%rip), %ecx      # 0x10354
testl %eax, %eax
je 0x7127
testl %ecx, %ecx
jle 0x7206
movq 0x9082(%rip), %r12      # 0xffb0
leaq 0x48a7(%rip), %rsi      # 0xb7dc
movl $0x1c, %edx
movq %r12, %rdi
callq 0x4310
testq %r14, %r14
je 0x71d5
movq %r14, %rdi
callq 0x4130
movq 0x9056(%rip), %rdi      # 0xffb0
movq %r14, %rsi
movq %rax, %rdx
callq 0x4310
jmp 0x71ee
cmpl $0x0, 0x93e3(%rip)      # 0x10354
jle 0x6f8b
movq 0x9036(%rip), %rdi      # 0xffb0
leaq 0x473a(%rip), %rsi      # 0xb6bb
movl $0x20, %edx
callq 0x4310
leaq 0x4bce(%rip), %rsi      # 0xbb60
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
jne 0x701c
cmpl $0x0, 0x93af(%rip)      # 0x10354
jle 0x6fbf
movq 0x9002(%rip), %rdi      # 0xffb0
leaq 0x4727(%rip), %rsi      # 0xb6dc
movl $0x30, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x89e8(%rip), %rcx      # 0xf9c0
movq %rcx, (%rax)
leaq 0x20(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xa97e
movups 0x18(%rsp), %xmm0
movaps (%rsp), %xmm1
movups %xmm1, 0x18(%rsp)
movaps %xmm0, (%rsp)
movq %r12, %rdi
callq 0x5d12
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x72ea
leaq 0x4bb5(%rip), %rsi      # 0xbbd8
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
jne 0x70ad
cmpl $0x0, 0x931e(%rip)      # 0x10354
jle 0x7050
movq 0x8f71(%rip), %rdi      # 0xffb0
leaq 0x46c7(%rip), %rsi      # 0xb70d
movl $0x2d, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x8a57(%rip), %rcx      # 0xfac0
movq %rcx, (%rax)
leaq 0x20(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xaa4e
movups 0x18(%rsp), %xmm0
movaps (%rsp), %xmm1
movups %xmm1, 0x18(%rsp)
movaps %xmm0, (%rsp)
movq %r12, %rdi
callq 0x5d12
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x72ea
leaq 0x4b3c(%rip), %rsi      # 0xbbf0
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
je 0x70d7
leaq 0x4674(%rip), %rsi      # 0xb73b
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
jne 0x7310
cmpl $0x0, 0x9276(%rip)      # 0x10354
jle 0x7291
movq 0x8ec5(%rip), %r12      # 0xffb0
leaq 0x465f(%rip), %rsi      # 0xb751
movl $0x19, %edx
movq %r12, %rdi
callq 0x4310
testq %r15, %r15
je 0x7260
movq %r15, %rdi
callq 0x4130
movq 0x8e99(%rip), %rdi      # 0xffb0
movq %r15, %rsi
movq %rax, %rdx
callq 0x4310
jmp 0x7279
testl %ecx, %ecx
jle 0x7143
movq 0x8e7e(%rip), %rdi      # 0xffb0
leaq 0x4639(%rip), %rsi      # 0xb772
movl $0x22, %edx
callq 0x4310
leaq 0x464b(%rip), %rsi      # 0xb795
movq %r15, %rdi
callq 0x43f0
testl %eax, %eax
jne 0x7310
cmpl $0x0, 0x91f3(%rip)      # 0x10354
jle 0x717b
movq 0x8e46(%rip), %rdi      # 0xffb0
leaq 0x463a(%rip), %rsi      # 0xb7ab
movl $0x30, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x882c(%rip), %rcx      # 0xf9c0
movq %rcx, (%rax)
leaq 0x20(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xa97e
movups 0x18(%rsp), %xmm0
movaps (%rsp), %xmm1
movups %xmm1, 0x18(%rsp)
movaps %xmm0, (%rsp)
movq %r12, %rdi
callq 0x5d12
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x72e6
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4510
movq 0x8dbb(%rip), %rdi      # 0xffb0
leaq 0x45fd(%rip), %rsi      # 0xb7f9
movl $0xe, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x8991(%rip), %rcx      # 0xfbb0
movq %rcx, (%rax)
leaq 0x20(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xabee
movups 0x18(%rsp), %xmm0
movaps (%rsp), %xmm1
movups %xmm1, 0x18(%rsp)
movaps %xmm0, (%rsp)
movq %r12, %rdi
callq 0x5d12
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x72e6
movq (%r12), %rax
movq -0x18(%rax), %rax
leaq (%r12,%rax), %rdi
movl 0x20(%r12,%rax), %esi
orl $0x1, %esi
callq 0x4510
movq 0x8d30(%rip), %rdi      # 0xffb0
leaq 0x4483(%rip), %rsi      # 0xb70a
movl $0x2, %edx
callq 0x4310
movl $0x10, %edi
callq 0x42a0
movq $0x0, 0x8(%rax)
leaq 0x888e(%rip), %rcx      # 0xfb38
movq %rcx, (%rax)
leaq 0x20(%rsp), %r12
movq %rax, -0x8(%r12)
movq %r12, %rdi
movq %rax, %rsi
callq 0xab1e
movups 0x18(%rsp), %xmm0
movaps (%rsp), %xmm1
movups %xmm1, 0x18(%rsp)
movaps %xmm0, (%rsp)
movq %r12, %rdi
callq 0x5d12
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
je 0x7310
movq (%rsp), %rax
movq %rax, (%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x7326
movq 0x8ca2(%rip), %rcx      # 0xffa8
cmpb $0x0, (%rcx)
je 0x733f
incl 0x8(%rax)
jmp 0x7326
movq %r14, %rdi
callq 0x4340
movq %r15, %rdi
callq 0x4340
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0x5d12
movq %rbx, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
lock
incl 0x8(%rax)
jmp 0x7326
jmp 0x7347
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5d12
movq %rbx, %rdi
callq 0x4550