// File: /workspace/github_cpp_makefile_star2_O2/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 %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, (%rsp)
leaq 0x40a5(%rip), %rdi      # 0xa654
leaq 0x3c08(%rip), %rsi      # 0xa1be
leaq 0x409b(%rip), %rdx      # 0xa658
callq 0x6401
movq %rax, %r14
leaq 0x4088(%rip), %rdi      # 0xa654
leaq 0x3beb(%rip), %rsi      # 0xa1be
leaq 0x4089(%rip), %rdx      # 0xa663
callq 0x6401
movq %rax, %r15
cmpl $0x0, 0x9d7b(%rip)      # 0x10364
jle 0x6632
movq 0x99be(%rip), %rdi      # 0xffb0
leaq 0x4077(%rip), %rsi      # 0xa670
callq 0x42d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x42d0
leaq 0x4074(%rip), %rsi      # 0xa684
movq %rax, %rdi
callq 0x42d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
leaq 0x406d(%rip), %rsi      # 0xa697
movq %rax, %rdi
callq 0x42d0
leaq 0x4065(%rip), %rsi      # 0xa69e
movq %r14, %rdi
callq 0x4450
testl %eax, %eax
je 0x66c4
leaq 0x4107(%rip), %rsi      # 0xa753
movq %r14, %rdi
callq 0x4450
movl 0x9d0a(%rip), %ecx      # 0x10364
testl %eax, %eax
je 0x6834
testl %ecx, %ecx
jle 0x6693
movq 0x9943(%rip), %rdi      # 0xffb0
leaq 0x4150(%rip), %rsi      # 0xa7c4
callq 0x42d0
movq %rax, %rdi
movq %r14, %rsi
callq 0x42d0
leaq 0x4156(%rip), %rsi      # 0xa7e1
movq %rax, %rdi
callq 0x42d0
pushq $0x10
popq %rdi
callq 0x42e0
andq $0x0, 0x8(%rax)
leaq 0x94c9(%rip), %rcx      # 0xfb70
movq %rcx, (%rax)
movq %rsp, %rdi
movq %rax, %rsi
callq 0x72da
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x68a6
cmpl $0x0, 0x9c99(%rip)      # 0x10364
jle 0x66e0
movq 0x98dc(%rip), %rdi      # 0xffb0
leaq 0x3fc8(%rip), %rsi      # 0xa6a3
callq 0x42d0
leaq 0x4461(%rip), %rsi      # 0xab48
movq %r15, %rdi
callq 0x4450
testl %eax, %eax
jne 0x6743
cmpl $0x0, 0x9c6a(%rip)      # 0x10364
jle 0x670f
movq 0x98ad(%rip), %rdi      # 0xffb0
leaq 0x3fba(%rip), %rsi      # 0xa6c4
callq 0x42d0
pushq $0x10
popq %rdi
callq 0x42e0
andq $0x0, 0x8(%rax)
leaq 0x92bd(%rip), %rcx      # 0xf9e0
movq %rcx, (%rax)
movq %rsp, %rdi
movq %rax, %rsi
callq 0x7250
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x68aa
leaq 0x454c(%rip), %rsi      # 0xac96
movq %r15, %rdi
callq 0x4450
testl %eax, %eax
jne 0x67a6
cmpl $0x0, 0x9c07(%rip)      # 0x10364
jle 0x6772
movq 0x984a(%rip), %rdi      # 0xffb0
leaq 0x3f88(%rip), %rsi      # 0xa6f5
callq 0x42d0
pushq $0x10
popq %rdi
callq 0x42e0
andq $0x0, 0x8(%rax)
leaq 0x92fa(%rip), %rcx      # 0xfa80
movq %rcx, (%rax)
movq %rsp, %rdi
movq %rax, %rsi
callq 0x727e
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
jne 0x68aa
leaq 0x4572(%rip), %rsi      # 0xad1f
movq %r15, %rdi
callq 0x4450
testl %eax, %eax
je 0x67d0
leaq 0x3f63(%rip), %rsi      # 0xa723
movq %r15, %rdi
callq 0x4450
testl %eax, %eax
jne 0x68b7
cmpl $0x0, 0x9b8d(%rip)      # 0x10364
jle 0x6806
movq 0x97d0(%rip), %rdi      # 0xffb0
leaq 0x3f52(%rip), %rsi      # 0xa739
callq 0x42d0
movq %rax, %rdi
movq %r15, %rsi
callq 0x42d0
leaq 0x3ef4(%rip), %rsi      # 0xa6f2
movq %rax, %rdi
callq 0x42d0
pushq $0x10
popq %rdi
callq 0x42e0
andq $0x0, 0x8(%rax)
leaq 0x92de(%rip), %rcx      # 0xfaf8
movq %rcx, (%rax)
movq %rsp, %rdi
movq %rax, %rsi
callq 0x72ac
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
jmp 0x68a6
testl %ecx, %ecx
jle 0x684b
movq 0x9771(%rip), %rdi      # 0xffb0
leaq 0x3f14(%rip), %rsi      # 0xa75a
callq 0x42d0
leaq 0x3f2b(%rip), %rsi      # 0xa77d
movq %r15, %rdi
callq 0x4450
testl %eax, %eax
jne 0x68b7
cmpl $0x0, 0x9aff(%rip)      # 0x10364
jle 0x687a
movq 0x9742(%rip), %rdi      # 0xffb0
leaq 0x3f1e(%rip), %rsi      # 0xa793
callq 0x42d0
pushq $0x10
popq %rdi
callq 0x42e0
andq $0x0, 0x8(%rax)
leaq 0x9152(%rip), %rcx      # 0xf9e0
movq %rcx, (%rax)
movq %rsp, %rdi
movq %rax, %rsi
callq 0x7250
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x18(%rax)
testb %al, %al
je 0x68b7
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x83b4
jmp 0x68cd
movq %r14, %rdi
callq 0x4380
movq %r15, %rdi
callq 0x4380
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
leaq 0x8(%rsp), %rdi
callq 0x5758
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x68e6
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x5758
movq %rbx, %rdi
callq 0x4550