// File: /workspace/github_cpp_makefile_star2_O2/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
andl $0x0, 0x14(%rsp)
leaq 0xef3(%rip), %rsi       # 0x331c
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rdx
callq 0x2744
movq 0x2b89(%rip), %rdi      # 0x4fc8
leaq 0xbca(%rip), %rsi       # 0x3010
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq 0x2b6e(%rip), %rdi      # 0x4fc8
leaq 0xbe5(%rip), %rsi       # 0x3046
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq 0x2b53(%rip), %rdi      # 0x4fc8
leaq 0xbe0(%rip), %rsi       # 0x305c
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq 0x2b38(%rip), %rdi      # 0x4fc8
leaq 0xbd9(%rip), %rsi       # 0x3070
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq 0x2b2d(%rip), %rdi      # 0x4fd8
leaq 0x14(%rsp), %rsi
callq 0x20b0
movl 0x14(%rsp), %eax
cmpl $0x1, %eax
je 0x24fb
cmpl $0x2, %eax
je 0x24d5
cmpl $0x3, %eax
jne 0x250e
callq 0x2705
movsd %xmm0, 0x8(%rsp)
jmp 0x2533
leaq 0x38(%rsp), %rdi
callq 0x26a6
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %r14
movq %r14, %rsi
callq 0x2160
movq %r14, %rdi
callq 0x2090
jmp 0x2529
callq 0x266a
movl %eax, %ebp
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
jmp 0x2535
movq 0x2ab3(%rip), %rdi      # 0x4fc8
leaq 0xb69(%rip), %rsi       # 0x3085
callq 0x2130
movq %rax, %rdi
callq 0x20a0
xorpd %xmm0, %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %ebp, %ebp
leaq 0x4(%rbx), %r12
xorl %r13d, %r13d
movq 0x2a85(%rip), %r14      # 0x4fc8
leaq 0xb87(%rip), %r15       # 0x30d1
cmpq $0x42790, %r13          # imm = 0x42790
je 0x2638
testl %ebp, %ebp
je 0x2561
cmpl %ebp, (%rbx,%r13)
je 0x25b2
leaq (%r12,%r13), %rdi
leaq 0x18(%rsp), %rsi
callq 0x277f
testb %al, %al
je 0x2588
leaq 0x18(%rsp), %rdi
leaq 0xd9d(%rip), %rsi       # 0x331c
callq 0x2795
testb %al, %al
jne 0x25b2
movsd 0x8(%rsp), %xmm0
ucomisd 0xa72(%rip), %xmm0      # 0x3008
jne 0x259e
jnp 0x262c
movsd 0x108(%rbx,%r13), %xmm0
ucomisd 0x8(%rsp), %xmm0
jne 0x262c
jp 0x262c
movq %r14, %rdi
leaq 0xae2(%rip), %rsi       # 0x309e
callq 0x2130
movl (%rbx,%r13), %esi
movq %rax, %rdi
callq 0x2210
movq %rax, %rdi
callq 0x20a0
movq %r14, %rdi
leaq 0xad0(%rip), %rsi       # 0x30af
callq 0x2130
leaq (%r12,%r13), %rsi
movq %rax, %rdi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
movq %r14, %rdi
leaq 0xabe(%rip), %rsi       # 0x30c0
callq 0x2130
movsd 0x108(%rbx,%r13), %xmm0
movq %rax, %rdi
callq 0x2200
movq %rax, %rdi
movq %r15, %rsi
callq 0x2130
movq %rax, %rdi
callq 0x20a0
addq $0x110, %r13            # imm = 0x110
jmp 0x254a
leaq 0x18(%rsp), %rdi
callq 0x2090
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2655
jmp 0x2655
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2220