// File: /workspace/github_cpp_makefile_star2_O1/bastelfreak[P]erp-system/articlesearch.cpp
// Function: ArtikelSuche(TArticle*)
void ArtikelSuche (TArticle MeineArtikel[])
{
  //TArtikel MeineArtikel[1000];

	int Auswahl1 = 0;
	int ArtikelNummer = 0;
  std::string ArtikelName = "";
	double ArtikelPreis = 0.0;

	//cout << " Bitte w�hlen Sie das Atribut, wonach Sie suchen m�chten " <<endl;
  std::cout << " Please choose an Atribute which you want to search  " << std::endl;
  std::cout << " 1 for Articel Number" << std::endl;
  std::cout << " 2 for Articel Name" << std::endl;
  std::cout << " 3 for Articel Price" << std::endl;

  std::cin >> Auswahl1;

	switch (Auswahl1)
	{
	case 1: ArtikelNummer = ArtikelNummerSuche();
		break;

	case 2: ArtikelName = ArtikelNameSuche ();
		break;

	case 3: ArtikelPreis = ArtikelPreisSuche();
		break;


	default:
    std::cout << "Error, please try again!" << std::endl;
	}


	for (int i=0; i<=1000;i++)
	{ 
		if ((MeineArtikel[i].id == ArtikelNummer && ArtikelNummer != 0) || (MeineArtikel[i].name == ArtikelName && ArtikelName != "") || (MeineArtikel[i].price == ArtikelPreis  && ArtikelPreis != 0))
		{
      std::cout << "Article Number: " << MeineArtikel[i].id << std::endl;
      std::cout << "Article Name:   " <<MeineArtikel[i].name << std::endl;
      std::cout << "Article Price:  " << MeineArtikel[i].price << "Euro" << std::endl;
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movl $0x0, 0x14(%rsp)
leaq 0x28(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x1ec7(%rip), %rdx      # 0x431c
leaq 0x18(%rsp), %rdi
movq %rdx, %rsi
callq 0x2986
movq 0x3b5f(%rip), %r14      # 0x5fc8
leaq 0x1ba0(%rip), %rsi      # 0x4010
movl $0x35, %edx
movq %r14, %rdi
callq 0x2160
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x3b2d(%rip), %rdi      # 0x5fc8
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x3b19(%rip), %r14      # 0x5fc8
leaq 0x1b90(%rip), %rsi      # 0x4046
movl $0x15, %edx
movq %r14, %rdi
callq 0x2160
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x3ae7(%rip), %rdi      # 0x5fc8
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x3ad3(%rip), %r14      # 0x5fc8
leaq 0x1b60(%rip), %rsi      # 0x405c
movl $0x13, %edx
movq %r14, %rdi
callq 0x2160
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x3aa1(%rip), %rdi      # 0x5fc8
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x3a8d(%rip), %r14      # 0x5fc8
leaq 0x1b2e(%rip), %rsi      # 0x4070
movl $0x14, %edx
movq %r14, %rdi
callq 0x2160
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x3a5b(%rip), %r14      # 0x5fc8
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movq 0x3a54(%rip), %rdi      # 0x5fd8
leaq 0x14(%rsp), %rsi
callq 0x20a0
movl 0x14(%rsp), %eax
cmpl $0x1, %eax
je 0x25e9
cmpl $0x2, %eax
je 0x25b1
cmpl $0x3, %eax
jne 0x25fc
callq 0x2921
movsd %xmm0, 0x8(%rsp)
jmp 0x264c
leaq 0x38(%rsp), %rdi
callq 0x288a
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %r15
movq %r15, %rsi
callq 0x2180
movq (%r15), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x2642
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2140
jmp 0x2642
callq 0x2827
movl %eax, %ebp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x264e
movq 0x39c5(%rip), %r15      # 0x5fc8
leaq 0x1a7b(%rip), %rsi      # 0x4085
movl $0x18, %edx
movq %r15, %rdi
callq 0x2160
movq (%r15), %rax
addq -0x18(%rax), %r15
movq %r15, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq 0x3993(%rip), %rdi      # 0x5fc8
callq 0x2030
movq %rax, %rdi
callq 0x20c0
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0x4(%rbx), %r13
xorl %r15d, %r15d
testl %ebp, %ebp
je 0x265f
cmpl %ebp, (%rbx,%r15)
je 0x26b9
leaq (%r15,%r13), %rsi
leaq 0x18(%rsp), %rdi
callq 0x2070
testl %eax, %eax
je 0x26a4
movsd 0x8(%rsp), %xmm0
ucomisd 0x1989(%rip), %xmm0     # 0x4008
jne 0x2687
jnp 0x27bd
movsd 0x108(%rbx,%r15), %xmm0
ucomisd 0x8(%rsp), %xmm0
jne 0x27bd
jnp 0x26b9
jmp 0x27bd
leaq 0x18(%rsp), %rdi
leaq 0x1c6c(%rip), %rsi      # 0x431c
callq 0x2070
testl %eax, %eax
je 0x2671
movl $0x10, %edx
movq %r14, %rdi
leaq 0x19d6(%rip), %rsi      # 0x409e
callq 0x2160
movl (%rbx,%r15), %esi
movq %r14, %rdi
callq 0x2220
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x10, %edx
movq %r14, %rdi
leaq 0x199d(%rip), %rsi      # 0x40af
callq 0x2160
leaq (%r15,%r13), %r12
movq %r12, %rdi
callq 0x2090
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x2160
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
movl $0x10, %edx
movq %r14, %rdi
leaq 0x1959(%rip), %rsi      # 0x40c0
callq 0x2160
movsd 0x108(%rbx,%r15), %xmm0
movq %r14, %rdi
callq 0x2210
movq %rax, %r12
movl $0x4, %edx
movq %rax, %rdi
leaq 0x1941(%rip), %rsi      # 0x40d1
callq 0x2160
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2130
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x20c0
addq $0x110, %r15            # imm = 0x110
cmpq $0x42790, %r15          # imm = 0x42790
jne 0x2655
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x27ed
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2140
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2800
jmp 0x2800
movq %rax, %rbx
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x281f
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2140
movq %rbx, %rdi
callq 0x2230