#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;
typedef int /*<<< orphan*/ rsp;
typedef int int8_t;

/* Variables and functions */
scalar_t__ memcmp(int *, char *, int);
int /*<<< orphan*/ memcpy(int *, char *, int);
int pCT_data(int, int *, int *, int, int *, int *, int *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sleep(int);
int read_geldkarte(uint16_t ctn) {
  uint8_t cmd[5 + 255 + 1], rsp[256 + 2];
  uint8_t sad, dad;
  uint16_t lenc, lenr = 256 + 2;
  int8_t ret;
  memcpy(cmd, "\x20\x11\x01\x01\x00", 5);
  lenc = 5;
  lenr = sizeof(rsp);
  sad = 2;
  dad = 1;
  ret = pCT_data(ctn, &dad, &sad, lenc, cmd, &lenr, rsp);
  if (ret != 0)
    goto err_return;
  ;
  if ((ret != 0) || (sad != 1)) {
    printf("Error sending command to reader. (Return code:%d)\n", ret);
    memcpy(cmd, "\x20\x15\x01\x00", 5);
    lenc = 5;
    lenr = sizeof(rsp);
    sad = 2;
    dad = 1;
    ret = pCT_data(ctn, &dad, &sad, lenc, cmd, &lenr, rsp);
    if (ret != 0)
      goto err_return;
    ;
    sleep(2);
    return 3;
  }
  if (lenr == 24 + 2) {
    if (memcmp(rsp + 7, "\x45\x65\x63", 3)) {
      printf("Unknown card.\n");
      goto err_icccmd;
    }
    memcpy(cmd, "\x00\xA4\x04\x0C\x09\xD2\x76\x00\x00\x25\x45\x50\x01\x00", 14);
    lenc = 14;
    lenr = sizeof(rsp);
    sad = 2;
    dad = 0;
    ret = pCT_data(ctn, &dad, &sad, lenc, cmd, &lenr, rsp);
    if (ret != 0)
      goto err_return;
    ;
    if (sad != 0)
      goto err_sad;
    if ((lenr != 2) || (rsp[0] != 0x90) || (rsp[1] != 0x00)) {
      printf("Error selecting GeldKarte application.\n");
      goto err_icccmd;
    }
    memcpy(cmd, "\x00\xB2\x01\xC4\x09", 5);
    lenc = 5;
    lenr = sizeof(rsp);
    sad = 2;
    dad = 0;
    ret = pCT_data(ctn, &dad, &sad, lenc, cmd, &lenr, rsp);
    if (ret != 0)
      goto err_return;
    ;
    if (sad != 0)
      goto err_sad;
    if ((lenr < 5) || (rsp[lenr - 2] != 0x90) || (rsp[lenr - 1] != 0x00)) {
      printf("Error reading account balance.\n");
      goto err_icccmd;
    }
  } else if (lenr == 25 + 2) {
    if (memcmp(rsp + 8, "\x45\x65\x63", 3)) {
      printf("Unknown card.\n");
      goto err_icccmd;
    }
    memcpy(cmd, "\x00\xA4\x04\x0C\x09\xD2\x76\x00\x00\x25\x45\x50\x02\x00", 14);
    lenc = 14;
    lenr = sizeof(rsp);
    sad = 2;
    dad = 0;
    ret = pCT_data(ctn, &dad, &sad, lenc, cmd, &lenr, rsp);
    if (ret != 0)
      goto err_return;
    ;
    if (sad != 0)
      goto err_sad;
    if ((lenr != 2) || (rsp[0] != 0x90) || (rsp[1] != 0x00)) {
      printf("Error selecting GeldKarte application.\n");
      goto err_icccmd;
    }
    memcpy(cmd, "\x00\xB2\x01\xC4\x00", 5);
    lenc = 5;
    lenr = sizeof(rsp);
    sad = 2;
    dad = 0;
    ret = pCT_data(ctn, &dad, &sad, lenc, cmd, &lenr, rsp);
    if (ret != 0)
      goto err_return;
    ;
    if (sad != 0)
      goto err_sad;
    if ((lenr < 5) || (rsp[lenr - 2] != 0x90) || (rsp[lenr - 1] != 0x00)) {
      printf("Error reading account balance.\n");
      goto err_icccmd;
    }
  } else if ((lenr > 2) && (rsp[lenr - 2] == 0x90)) {
    printf("Unknown card.\n");
    goto err_icccmd;
  } else {
    printf("No card.\n");
    sleep(2);
    return 0;
  }
  printf("Current account balance: %.2X%.2X.%.2X\n", rsp[0], rsp[1], rsp[2]);
err_icccmd:
  memcpy(cmd, "\x20\x15\x01\x00", 5);
  lenc = 5;
  lenr = sizeof(rsp);
  sad = 2;
  dad = 1;
  ret = pCT_data(ctn, &dad, &sad, lenc, cmd, &lenr, rsp);
  if (ret != 0)
    goto err_return;
  ;
  sleep(2);
  return 0;
err_return:
  printf("Error sending command to card. (Return code:%d)\n", ret);
  sleep(2);
  return 3;
err_sad:
  printf("Error sending command to card. (sad:%d)\n", sad);
  sleep(2);
  return 3;
}


x86 assembly (clang, -O0):
<read_geldkarte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x850,%rsp
mov    %edi,-0x8(%rbp)
movl   $0x102,-0x840(%rbp)
lea    -0x420(%rbp),%rdi
lea    0xe8a(%rip),%rsi
mov    $0x5,%edx
call   1060 <memcpy@plt>
movl   $0x5,-0x83c(%rbp)
movl   $0x408,-0x840(%rbp)
movl   $0x2,-0x834(%rbp)
movl   $0x1,-0x838(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x83c(%rbp),%ecx
lea    -0x420(%rbp),%r8
lea    -0x830(%rbp),%rax
lea    -0x838(%rbp),%rsi
lea    -0x834(%rbp),%rdx
lea    -0x840(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <pCT_data@plt>
mov    %eax,-0x844(%rbp)
cmpl   $0x0,-0x844(%rbp)
je     11f5 <read_geldkarte+0xa5>
jmp    1824 <read_geldkarte+0x6d4>
cmpl   $0x0,-0x844(%rbp)
jne    120f <read_geldkarte+0xbf>
cmpl   $0x1,-0x834(%rbp)
je     12c6 <read_geldkarte+0x176>
mov    -0x844(%rbp),%esi
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x420(%rbp),%rdi
lea    0xdd5(%rip),%rsi
mov    $0x5,%edx
call   1060 <memcpy@plt>
movl   $0x5,-0x83c(%rbp)
movl   $0x408,-0x840(%rbp)
movl   $0x2,-0x834(%rbp)
movl   $0x1,-0x838(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x83c(%rbp),%ecx
lea    -0x420(%rbp),%r8
lea    -0x830(%rbp),%rax
lea    -0x838(%rbp),%rsi
lea    -0x834(%rbp),%rdx
lea    -0x840(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <pCT_data@plt>
mov    %eax,-0x844(%rbp)
cmpl   $0x0,-0x844(%rbp)
je     12b0 <read_geldkarte+0x160>
jmp    1824 <read_geldkarte+0x6d4>
mov    $0x2,%edi
call   1070 <sleep@plt>
movl   $0x3,-0x4(%rbp)
jmp    1873 <read_geldkarte+0x723>
cmpl   $0x1a,-0x840(%rbp)
jne    14e1 <read_geldkarte+0x391>
lea    -0x830(%rbp),%rdi
add    $0x1c,%rdi
lea    0xd83(%rip),%rsi
mov    $0x3,%edx
call   1050 <memcmp@plt>
cmp    $0x0,%rax
je     130c <read_geldkarte+0x1bc>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1781 <read_geldkarte+0x631>
lea    -0x420(%rbp),%rdi
lea    0xcf1(%rip),%rsi
mov    $0xe,%edx
call   1060 <memcpy@plt>
movl   $0xe,-0x83c(%rbp)
movl   $0x408,-0x840(%rbp)
movl   $0x2,-0x834(%rbp)
movl   $0x0,-0x838(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x83c(%rbp),%ecx
lea    -0x420(%rbp),%r8
lea    -0x830(%rbp),%rax
lea    -0x838(%rbp),%rsi
lea    -0x834(%rbp),%rdx
lea    -0x840(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <pCT_data@plt>
mov    %eax,-0x844(%rbp)
cmpl   $0x0,-0x844(%rbp)
je     1399 <read_geldkarte+0x249>
jmp    1824 <read_geldkarte+0x6d4>
cmpl   $0x0,-0x834(%rbp)
je     13ab <read_geldkarte+0x25b>
jmp    184e <read_geldkarte+0x6fe>
cmpl   $0x2,-0x840(%rbp)
jne    13d5 <read_geldkarte+0x285>
cmpl   $0x90,-0x830(%rbp)
jne    13d5 <read_geldkarte+0x285>
cmpl   $0x0,-0x82c(%rbp)
je     13e8 <read_geldkarte+0x298>
lea    0xc9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1781 <read_geldkarte+0x631>
lea    -0x420(%rbp),%rdi
lea    0xc24(%rip),%rsi
mov    $0x5,%edx
call   1060 <memcpy@plt>
movl   $0x5,-0x83c(%rbp)
movl   $0x408,-0x840(%rbp)
movl   $0x2,-0x834(%rbp)
movl   $0x0,-0x838(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x83c(%rbp),%ecx
lea    -0x420(%rbp),%r8
lea    -0x830(%rbp),%rax
lea    -0x838(%rbp),%rsi
lea    -0x834(%rbp),%rdx
lea    -0x840(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <pCT_data@plt>
mov    %eax,-0x844(%rbp)
cmpl   $0x0,-0x844(%rbp)
je     1475 <read_geldkarte+0x325>
jmp    1824 <read_geldkarte+0x6d4>
cmpl   $0x0,-0x834(%rbp)
je     1487 <read_geldkarte+0x337>
jmp    184e <read_geldkarte+0x6fe>
cmpl   $0x5,-0x840(%rbp)
jl     14c9 <read_geldkarte+0x379>
mov    -0x840(%rbp),%eax
sub    $0x2,%eax
cltq
cmpl   $0x90,-0x830(%rbp,%rax,4)
jne    14c9 <read_geldkarte+0x379>
mov    -0x840(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x0,-0x830(%rbp,%rax,4)
je     14dc <read_geldkarte+0x38c>
lea    0xbd3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1781 <read_geldkarte+0x631>
jmp    1761 <read_geldkarte+0x611>
cmpl   $0x1b,-0x840(%rbp)
jne    16fc <read_geldkarte+0x5ac>
lea    -0x830(%rbp),%rdi
add    $0x20,%rdi
lea    0xb68(%rip),%rsi
mov    $0x3,%edx
call   1050 <memcmp@plt>
cmp    $0x0,%rax
je     1527 <read_geldkarte+0x3d7>
lea    0xb51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1781 <read_geldkarte+0x631>
lea    -0x420(%rbp),%rdi
lea    0xaeb(%rip),%rsi
mov    $0xe,%edx
call   1060 <memcpy@plt>
movl   $0xe,-0x83c(%rbp)
movl   $0x408,-0x840(%rbp)
movl   $0x2,-0x834(%rbp)
movl   $0x0,-0x838(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x83c(%rbp),%ecx
lea    -0x420(%rbp),%r8
lea    -0x830(%rbp),%rax
lea    -0x838(%rbp),%rsi
lea    -0x834(%rbp),%rdx
lea    -0x840(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <pCT_data@plt>
mov    %eax,-0x844(%rbp)
cmpl   $0x0,-0x844(%rbp)
je     15b4 <read_geldkarte+0x464>
jmp    1824 <read_geldkarte+0x6d4>
cmpl   $0x0,-0x834(%rbp)
je     15c6 <read_geldkarte+0x476>
jmp    184e <read_geldkarte+0x6fe>
cmpl   $0x2,-0x840(%rbp)
jne    15f0 <read_geldkarte+0x4a0>
cmpl   $0x90,-0x830(%rbp)
jne    15f0 <read_geldkarte+0x4a0>
cmpl   $0x0,-0x82c(%rbp)
je     1603 <read_geldkarte+0x4b3>
lea    0xa84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1781 <read_geldkarte+0x631>
lea    -0x420(%rbp),%rdi
lea    0xa1e(%rip),%rsi
mov    $0x5,%edx
call   1060 <memcpy@plt>
movl   $0x5,-0x83c(%rbp)
movl   $0x408,-0x840(%rbp)
movl   $0x2,-0x834(%rbp)
movl   $0x0,-0x838(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x83c(%rbp),%ecx
lea    -0x420(%rbp),%r8
lea    -0x830(%rbp),%rax
lea    -0x838(%rbp),%rsi
lea    -0x834(%rbp),%rdx
lea    -0x840(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <pCT_data@plt>
mov    %eax,-0x844(%rbp)
cmpl   $0x0,-0x844(%rbp)
je     1690 <read_geldkarte+0x540>
jmp    1824 <read_geldkarte+0x6d4>
cmpl   $0x0,-0x834(%rbp)
je     16a2 <read_geldkarte+0x552>
jmp    184e <read_geldkarte+0x6fe>
cmpl   $0x5,-0x840(%rbp)
jl     16e4 <read_geldkarte+0x594>
mov    -0x840(%rbp),%eax
sub    $0x2,%eax
cltq
cmpl   $0x90,-0x830(%rbp,%rax,4)
jne    16e4 <read_geldkarte+0x594>
mov    -0x840(%rbp),%eax
sub    $0x1,%eax
cltq
cmpl   $0x0,-0x830(%rbp,%rax,4)
je     16f7 <read_geldkarte+0x5a7>
lea    0x9b8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1781 <read_geldkarte+0x631>
jmp    175c <read_geldkarte+0x60c>
cmpl   $0x2,-0x840(%rbp)
jle    1738 <read_geldkarte+0x5e8>
mov    -0x840(%rbp),%eax
sub    $0x2,%eax
cltq
cmpl   $0x90,-0x830(%rbp,%rax,4)
jne    1738 <read_geldkarte+0x5e8>
lea    0x940(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1781 <read_geldkarte+0x631>
lea    0x984(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
movl   $0x0,-0x4(%rbp)
jmp    1873 <read_geldkarte+0x723>
jmp    1761 <read_geldkarte+0x611>
mov    -0x830(%rbp),%esi
mov    -0x82c(%rbp),%edx
mov    -0x828(%rbp),%ecx
lea    0x953(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x420(%rbp),%rdi
lea    0x877(%rip),%rsi
mov    $0x5,%edx
call   1060 <memcpy@plt>
movl   $0x5,-0x83c(%rbp)
movl   $0x408,-0x840(%rbp)
movl   $0x2,-0x834(%rbp)
movl   $0x1,-0x838(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x83c(%rbp),%ecx
lea    -0x420(%rbp),%r8
lea    -0x830(%rbp),%rax
lea    -0x838(%rbp),%rsi
lea    -0x834(%rbp),%rdx
lea    -0x840(%rbp),%r9
mov    %rax,(%rsp)
call   1030 <pCT_data@plt>
mov    %eax,-0x844(%rbp)
cmpl   $0x0,-0x844(%rbp)
je     180e <read_geldkarte+0x6be>
jmp    1824 <read_geldkarte+0x6d4>
mov    $0x2,%edi
call   1070 <sleep@plt>
movl   $0x0,-0x4(%rbp)
jmp    1873 <read_geldkarte+0x723>
mov    -0x844(%rbp),%esi
lea    0x8c4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
movl   $0x3,-0x4(%rbp)
jmp    1873 <read_geldkarte+0x723>
mov    -0x834(%rbp),%esi
lea    0x8cb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x2,%edi
call   1070 <sleep@plt>
movl   $0x3,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x850,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_geldkarte>:
push   %rbp
push   %r14
push   %rbx
sub    $0x850,%rsp
mov    %edi,%ebp
movl   $0x102,0x14(%rsp)
lea    0xe84(%rip),%rsi
lea    0x430(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%edx
call   1070 <memcpy@plt>
movl   $0x408,0x14(%rsp)
movl   $0x2,0x18(%rsp)
movl   $0x1,0x1c(%rsp)
lea    0x20(%rsp),%r14
mov    %r14,(%rsp)
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%r9
mov    %ebp,%edi
mov    $0x5,%ecx
mov    %rbx,%r8
call   1030 <pCT_data@plt>
test   %eax,%eax
je     1201 <read_geldkarte+0xa1>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x3,%ebx
mov    $0x2,%edi
call   1080 <sleep@plt>
mov    %ebx,%eax
add    $0x850,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
cmpl   $0x1,0x18(%rsp)
jne    12db <read_geldkarte+0x17b>
mov    0x14(%rsp),%eax
cmp    $0x1b,%eax
je     134e <read_geldkarte+0x1ee>
cmp    $0x1a,%eax
jne    13e3 <read_geldkarte+0x283>
lea    0x3c(%rsp),%rdi
lea    0xe3a(%rip),%rsi
mov    $0x3,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
jne    13f5 <read_geldkarte+0x295>
lea    0xdc3(%rip),%rsi
lea    0x430(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xe,%edx
call   1070 <memcpy@plt>
movl   $0x408,0x14(%rsp)
movl   $0x2,0x18(%rsp)
movl   $0x0,0x1c(%rsp)
mov    %r14,(%rsp)
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%r9
mov    %ebp,%edi
mov    $0xe,%ecx
mov    %rbx,%r8
call   1030 <pCT_data@plt>
test   %eax,%eax
jne    11d4 <read_geldkarte+0x74>
mov    0x18(%rsp),%esi
test   %esi,%esi
jne    13d7 <read_geldkarte+0x277>
cmpl   $0x2,0x14(%rsp)
jne    152e <read_geldkarte+0x3ce>
cmpl   $0x90,0x20(%rsp)
jne    152e <read_geldkarte+0x3ce>
cmpl   $0x0,0x24(%rsp)
jne    152e <read_geldkarte+0x3ce>
lea    0xd44(%rip),%rsi
jmp    149f <read_geldkarte+0x33f>
lea    0xd53(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd14(%rip),%rsi
lea    0x430(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%edx
call   1070 <memcpy@plt>
movl   $0x408,0x14(%rsp)
movl   $0x2,0x18(%rsp)
movl   $0x1,0x1c(%rsp)
mov    %r14,(%rsp)
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%r9
mov    %ebp,%edi
mov    $0x5,%ecx
mov    %rbx,%r8
call   1030 <pCT_data@plt>
test   %eax,%eax
jne    11d4 <read_geldkarte+0x74>
jmp    11e4 <read_geldkarte+0x84>
lea    0x40(%rsp),%rdi
lea    0xd0e(%rip),%rsi
mov    $0x3,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
jne    13f5 <read_geldkarte+0x295>
lea    0xcac(%rip),%rsi
lea    0x430(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xe,%edx
call   1070 <memcpy@plt>
movl   $0x408,0x14(%rsp)
movl   $0x2,0x18(%rsp)
movl   $0x0,0x1c(%rsp)
mov    %r14,(%rsp)
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%r9
mov    %ebp,%edi
mov    $0xe,%ecx
mov    %rbx,%r8
call   1030 <pCT_data@plt>
test   %eax,%eax
jne    11d4 <read_geldkarte+0x74>
mov    0x18(%rsp),%esi
test   %esi,%esi
je     1474 <read_geldkarte+0x314>
lea    0xce7(%rip),%rdi
jmp    11dd <read_geldkarte+0x7d>
cmp    $0x3,%eax
jl     1461 <read_geldkarte+0x301>
add    $0xfffffffe,%eax
cmpl   $0x90,0x20(%rsp,%rax,4)
jne    1461 <read_geldkarte+0x301>
lea    0xd41(%rip),%rdi
call   1040 <puts@plt>
lea    0xbfe(%rip),%rsi
lea    0x430(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%edx
call   1070 <memcpy@plt>
movl   $0x408,0x14(%rsp)
movl   $0x2,0x18(%rsp)
movl   $0x1,0x1c(%rsp)
mov    %r14,(%rsp)
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%r9
mov    %ebp,%edi
mov    $0x5,%ecx
mov    %rbx,%r8
call   1030 <pCT_data@plt>
test   %eax,%eax
jne    11d4 <read_geldkarte+0x74>
jmp    146d <read_geldkarte+0x30d>
lea    0xc86(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
jmp    11e9 <read_geldkarte+0x89>
cmpl   $0x2,0x14(%rsp)
jne    152e <read_geldkarte+0x3ce>
cmpl   $0x90,0x20(%rsp)
jne    152e <read_geldkarte+0x3ce>
cmpl   $0x0,0x24(%rsp)
jne    152e <read_geldkarte+0x3ce>
lea    0xb90(%rip),%rsi
lea    0x430(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%edx
call   1070 <memcpy@plt>
movl   $0x408,0x14(%rsp)
movl   $0x2,0x18(%rsp)
movl   $0x0,0x1c(%rsp)
mov    %r14,(%rsp)
lea    0x1c(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x14(%rsp),%r9
mov    %ebp,%edi
mov    $0x5,%ecx
mov    %rbx,%r8
call   1030 <pCT_data@plt>
test   %eax,%eax
jne    11d4 <read_geldkarte+0x74>
mov    0x18(%rsp),%esi
test   %esi,%esi
jne    13d7 <read_geldkarte+0x277>
mov    0x14(%rsp),%eax
cmp    $0x5,%eax
jl     1522 <read_geldkarte+0x3c2>
lea    -0x2(%rax),%ecx
cmpl   $0x90,0x20(%rsp,%rcx,4)
jne    1522 <read_geldkarte+0x3c2>
add    $0xffffffff,%eax
cmpl   $0x0,0x20(%rsp,%rax,4)
je     153a <read_geldkarte+0x3da>
lea    0xbce(%rip),%rdi
jmp    13fc <read_geldkarte+0x29c>
lea    0xbe1(%rip),%rdi
jmp    13fc <read_geldkarte+0x29c>
mov    0x20(%rsp),%esi
mov    0x24(%rsp),%edx
mov    0x28(%rsp),%ecx
lea    0xb1f(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1401 <read_geldkarte+0x2a1>

LLVM IR (-O0):
@.str = [6 x i8] c" \11\01\01\00\00"
@.str.1 = [51 x i8] c"Error sending command to reader. (Return code:%d)\0A\00"
@.str.2 = [5 x i8] c" \15\01\00\00"
@.str.3 = [4 x i8] c"Eec\00"
@.str.4 = [15 x i8] c"Unknown card.\0A\00"
@.str.5 = [15 x i8] c"\00\A4\04\0C\09\D2v\00\00%EP\01\00\00"
@.str.6 = [40 x i8] c"Error selecting GeldKarte application.\0A\00"
@.str.7 = [6 x i8] c"\00\B2\01\C4\09\00"
@.str.8 = [32 x i8] c"Error reading account balance.\0A\00"
@.str.9 = [15 x i8] c"\00\A4\04\0C\09\D2v\00\00%EP\02\00\00"
@.str.10 = [6 x i8] c"\00\B2\01\C4\00\00"
@.str.11 = [10 x i8] c"No card.\0A\00"
@.str.12 = [40 x i8] c"Current account balance: %.2X%.2X.%.2X\0A\00"
@.str.13 = [49 x i8] c"Error sending command to card. (Return code:%d)\0A\00"
@.str.14 = [41 x i8] c"Error sending command to card. (sad:%d)\0A\00"
define i32 @read_geldkarte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [261 x i32]
%5 = alloca [258 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i32 258, i32* %9
%11 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%12 = call i32 @memcpy(i32* %11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
store i32 5, i32* %8
store i32 1032, i32* %9
store i32 2, i32* %6
store i32 1, i32* %7
%13 = load i32, i32* %3
%14 = load i32, i32* %8
%15 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%16 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%17 = call i32 @pCT_data(i32 %13, i32* %7, i32* %6, i32 %14, i32* %15, i32* %9, i32* %16)
store i32 %17, i32* %10
%18 = load i32, i32* %10
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %1
br label %225
21: ; preds = %1
%22 = load i32, i32* %10
%23 = icmp ne i32 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %6
%26 = icmp ne i32 %25, 1
br i1 %26, label %27, label %42
27: ; preds = %24, %21
%28 = load i32, i32* %10
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%31 = call i32 @memcpy(i32* %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 5)
store i32 5, i32* %8
store i32 1032, i32* %9
store i32 2, i32* %6
store i32 1, i32* %7
%32 = load i32, i32* %3
%33 = load i32, i32* %8
%34 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%35 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%36 = call i32 @pCT_data(i32 %32, i32* %7, i32* %6, i32 %33, i32* %34, i32* %9, i32* %35)
store i32 %36, i32* %10
%37 = load i32, i32* %10
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %27
br label %225
40: ; preds = %27
%41 = call i32 @sleep(i32 2)
store i32 3, i32* %2
br label %233
42: ; preds = %24
%43 = load i32, i32* %9
%44 = icmp eq i32 %43, 26
br i1 %44, label %45, label %115
45: ; preds = %42
%46 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%47 = getelementptr inbounds i32, i32* %46, i64 7
%48 = call i64 @memcmp(i32* %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %45
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %212
52: ; preds = %45
%53 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%54 = call i32 @memcpy(i32* %53, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 14)
store i32 14, i32* %8
store i32 1032, i32* %9
store i32 2, i32* %6
store i32 0, i32* %7
%55 = load i32, i32* %3
%56 = load i32, i32* %8
%57 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%58 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%59 = call i32 @pCT_data(i32 %55, i32* %7, i32* %6, i32 %56, i32* %57, i32* %9, i32* %58)
store i32 %59, i32* %10
%60 = load i32, i32* %10
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %63
62: ; preds = %52
br label %225
63: ; preds = %52
%64 = load i32, i32* %6
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %63
br label %229
67: ; preds = %63
%68 = load i32, i32* %9
%69 = icmp ne i32 %68, 2
br i1 %69, label %78, label %70
70: ; preds = %67
%71 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%72 = load i32, i32* %71
%73 = icmp ne i32 %72, 144
br i1 %73, label %78, label %74
74: ; preds = %70
%75 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 1
%76 = load i32, i32* %75
%77 = icmp ne i32 %76, 0
br i1 %77, label %78, label %80
78: ; preds = %74, %70, %67
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %212
80: ; preds = %74
%81 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%82 = call i32 @memcpy(i32* %81, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 5)
store i32 5, i32* %8
store i32 1032, i32* %9
store i32 2, i32* %6
store i32 0, i32* %7
%83 = load i32, i32* %3
%84 = load i32, i32* %8
%85 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%86 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%87 = call i32 @pCT_data(i32 %83, i32* %7, i32* %6, i32 %84, i32* %85, i32* %9, i32* %86)
store i32 %87, i32* %10
%88 = load i32, i32* %10
%89 = icmp ne i32 %88, 0
br i1 %89, label %90, label %91
90: ; preds = %80
br label %225
91: ; preds = %80
%92 = load i32, i32* %6
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %95
94: ; preds = %91
br label %229
95: ; preds = %91
%96 = load i32, i32* %9
%97 = icmp slt i32 %96, 5
br i1 %97, label %112, label %98
98: ; preds = %95
%99 = load i32, i32* %9
%100 = sub nsw i32 %99, 2
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 %101
%103 = load i32, i32* %102
%104 = icmp ne i32 %103, 144
br i1 %104, label %112, label %105
105: ; preds = %98
%106 = load i32, i32* %9
%107 = sub nsw i32 %106, 1
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 %108
%110 = load i32, i32* %109
%111 = icmp ne i32 %110, 0
br i1 %111, label %112, label %114
112: ; preds = %105, %98, %95
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %212
114: ; preds = %105
br label %204
115: ; preds = %42
%116 = load i32, i32* %9
%117 = icmp eq i32 %116, 27
br i1 %117, label %118, label %188
118: ; preds = %115
%119 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%120 = getelementptr inbounds i32, i32* %119, i64 8
%121 = call i64 @memcmp(i32* %120, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%122 = icmp ne i64 %121, 0
br i1 %122, label %123, label %125
123: ; preds = %118
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %212
125: ; preds = %118
%126 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%127 = call i32 @memcpy(i32* %126, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 14)
store i32 14, i32* %8
store i32 1032, i32* %9
store i32 2, i32* %6
store i32 0, i32* %7
%128 = load i32, i32* %3
%129 = load i32, i32* %8
%130 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%131 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%132 = call i32 @pCT_data(i32 %128, i32* %7, i32* %6, i32 %129, i32* %130, i32* %9, i32* %131)
store i32 %132, i32* %10
%133 = load i32, i32* %10
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %136
135: ; preds = %125
br label %225
136: ; preds = %125
%137 = load i32, i32* %6
%138 = icmp ne i32 %137, 0
br i1 %138, label %139, label %140
139: ; preds = %136
br label %229
140: ; preds = %136
%141 = load i32, i32* %9
%142 = icmp ne i32 %141, 2
br i1 %142, label %151, label %143
143: ; preds = %140
%144 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%145 = load i32, i32* %144
%146 = icmp ne i32 %145, 144
br i1 %146, label %151, label %147
147: ; preds = %143
%148 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 1
%149 = load i32, i32* %148
%150 = icmp ne i32 %149, 0
br i1 %150, label %151, label %153
151: ; preds = %147, %143, %140
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0))
br label %212
153: ; preds = %147
%154 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%155 = call i32 @memcpy(i32* %154, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 5)
store i32 5, i32* %8
store i32 1032, i32* %9
store i32 2, i32* %6
store i32 0, i32* %7
%156 = load i32, i32* %3
%157 = load i32, i32* %8
%158 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%159 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%160 = call i32 @pCT_data(i32 %156, i32* %7, i32* %6, i32 %157, i32* %158, i32* %9, i32* %159)
store i32 %160, i32* %10
%161 = load i32, i32* %10
%162 = icmp ne i32 %161, 0
br i1 %162, label %163, label %164
163: ; preds = %153
br label %225
164: ; preds = %153
%165 = load i32, i32* %6
%166 = icmp ne i32 %165, 0
br i1 %166, label %167, label %168
167: ; preds = %164
br label %229
168: ; preds = %164
%169 = load i32, i32* %9
%170 = icmp slt i32 %169, 5
br i1 %170, label %185, label %171
171: ; preds = %168
%172 = load i32, i32* %9
%173 = sub nsw i32 %172, 2
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 %174
%176 = load i32, i32* %175
%177 = icmp ne i32 %176, 144
br i1 %177, label %185, label %178
178: ; preds = %171
%179 = load i32, i32* %9
%180 = sub nsw i32 %179, 1
%181 = sext i32 %180 to i64
%182 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 %181
%183 = load i32, i32* %182
%184 = icmp ne i32 %183, 0
br i1 %184, label %185, label %187
185: ; preds = %178, %171, %168
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.8, i64 0, i64 0))
br label %212
187: ; preds = %178
br label %203
188: ; preds = %115
%189 = load i32, i32* %9
%190 = icmp sgt i32 %189, 2
br i1 %190, label %191, label %200
191: ; preds = %188
%192 = load i32, i32* %9
%193 = sub nsw i32 %192, 2
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 %194
%196 = load i32, i32* %195
%197 = icmp eq i32 %196, 144
br i1 %197, label %198, label %200
198: ; preds = %191
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
br label %212
200: ; preds = %191, %188
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%202 = call i32 @sleep(i32 2)
store i32 0, i32* %2
br label %233
203: ; preds = %187
br label %204
204: ; preds = %203, %114
%205 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%206 = load i32, i32* %205
%207 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 1
%208 = load i32, i32* %207
%209 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 2
%210 = load i32, i32* %209
%211 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0), i32 %206, i32 %208, i32 %210)
br label %212
212: ; preds = %204, %198, %185, %151, %123, %112, %78, %50
%213 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%214 = call i32 @memcpy(i32* %213, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 5)
store i32 5, i32* %8
store i32 1032, i32* %9
store i32 2, i32* %6
store i32 1, i32* %7
%215 = load i32, i32* %3
%216 = load i32, i32* %8
%217 = getelementptr inbounds [261 x i32], [261 x i32]* %4, i64 0, i64 0
%218 = getelementptr inbounds [258 x i32], [258 x i32]* %5, i64 0, i64 0
%219 = call i32 @pCT_data(i32 %215, i32* %7, i32* %6, i32 %216, i32* %217, i32* %9, i32* %218)
store i32 %219, i32* %10
%220 = load i32, i32* %10
%221 = icmp ne i32 %220, 0
br i1 %221, label %222, label %223
222: ; preds = %212
br label %225
223: ; preds = %212
%224 = call i32 @sleep(i32 2)
store i32 0, i32* %2
br label %233
225: ; preds = %222, %163, %135, %90, %62, %39, %20
%226 = load i32, i32* %10
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.13, i64 0, i64 0), i32 %226)
%228 = call i32 @sleep(i32 2)
store i32 3, i32* %2
br label %233
229: ; preds = %167, %139, %94, %66
%230 = load i32, i32* %6
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.14, i64 0, i64 0), i32 %230)
%232 = call i32 @sleep(i32 2)
store i32 3, i32* %2
br label %233
233: ; preds = %229, %225, %223, %200, %40
%234 = load i32, i32* %2
ret i32 %234
}

LLVM IR (-O2):
@.str = [6 x i8] c" \11\01\01\00\00"
@.str.1 = [51 x i8] c"Error sending command to reader. (Return code:%d)\0A\00"
@.str.2 = [5 x i8] c" \15\01\00\00"
@.str.3 = [4 x i8] c"Eec\00"
@.str.5 = [15 x i8] c"\00\A4\04\0C\09\D2v\00\00%EP\01\00\00"
@.str.7 = [6 x i8] c"\00\B2\01\C4\09\00"
@.str.9 = [15 x i8] c"\00\A4\04\0C\09\D2v\00\00%EP\02\00\00"
@.str.10 = [6 x i8] c"\00\B2\01\C4\00\00"
@.str.12 = [40 x i8] c"Current account balance: %.2X%.2X.%.2X\0A\00"
@.str.13 = [49 x i8] c"Error sending command to card. (Return code:%d)\0A\00"
@.str.14 = [41 x i8] c"Error sending command to card. (sad:%d)\0A\00"
@str = [9 x i8] c"No card.\00"
@str.19 = [31 x i8] c"Error reading account balance.\00"
@str.20 = [39 x i8] c"Error selecting GeldKarte application.\00"
@str.21 = [14 x i8] c"Unknown card.\00"
define i32 @read_geldkarte(i32 %0) {
%2 = alloca [261 x i32]
%3 = alloca [258 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast [261 x i32]* %2 to i8*
%8 = bitcast [258 x i32]* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
store i32 258, i32* %6
%12 = getelementptr inbounds [261 x i32], [261 x i32]* %2, i64 0, i64 0
%13 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
store i32 1032, i32* %6
store i32 2, i32* %4
store i32 1, i32* %5
%14 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 0
%15 = call i32 @pCT_data(i32 %0, i32* %5, i32* %4, i32 5, i32* %12, i32* %6, i32* %14)
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %148
17: ; preds = %1
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 1
br i1 %19, label %25, label %20
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0), i32 0)
%22 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 5)
store i32 1032, i32* %6
store i32 2, i32* %4
store i32 1, i32* %5
%23 = call i32 @pCT_data(i32 %0, i32* %5, i32* %4, i32 5, i32* %12, i32* %6, i32* %14)
%24 = icmp eq i32 %23, 0
br i1 %24, label %154, label %148
25: ; preds = %17
%26 = load i32, i32* %6
switch i32 %26, label %125 [
i32 26, label %27
i32 27, label %76
]
27: ; preds = %25
%28 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 7
%29 = call i64 @memcmp(i32* %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%30 = icmp eq i64 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %27
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
br label %144
33: ; preds = %27
%34 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i32 14)
store i32 1032, i32* %6
store i32 2, i32* %4
store i32 0, i32* %5
%35 = call i32 @pCT_data(i32 %0, i32* %5, i32* %4, i32 14, i32* %12, i32* %6, i32* %14)
%36 = icmp eq i32 %35, 0
br i1 %36, label %37, label %148
37: ; preds = %33
%38 = load i32, i32* %4
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %151
40: ; preds = %37
%41 = load i32, i32* %6
%42 = icmp ne i32 %41, 2
%43 = load i32, i32* %14
%44 = icmp ne i32 %43, 144
%45 = select i1 %42, i1 true, i1 %44
%46 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 1
%47 = load i32, i32* %46
%48 = icmp ne i32 %47, 0
%49 = select i1 %45, i1 true, i1 %48
br i1 %49, label %50, label %52
50: ; preds = %40
%51 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.20, i64 0, i64 0))
br label %144
52: ; preds = %40
%53 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 5)
store i32 1032, i32* %6
store i32 2, i32* %4
store i32 0, i32* %5
%54 = call i32 @pCT_data(i32 %0, i32* %5, i32* %4, i32 5, i32* %12, i32* %6, i32* %14)
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %148
56: ; preds = %52
%57 = load i32, i32* %4
%58 = icmp eq i32 %57, 0
br i1 %58, label %59, label %151
59: ; preds = %56
%60 = load i32, i32* %6
%61 = icmp slt i32 %60, 5
br i1 %61, label %74, label %62
62: ; preds = %59
%63 = add nsw i32 %60, -2
%64 = zext i32 %63 to i64
%65 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 %64
%66 = load i32, i32* %65
%67 = icmp eq i32 %66, 144
br i1 %67, label %68, label %74
68: ; preds = %62
%69 = add nsw i32 %60, -1
%70 = zext i32 %69 to i64
%71 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 %70
%72 = load i32, i32* %71
%73 = icmp eq i32 %72, 0
br i1 %73, label %137, label %74
74: ; preds = %68, %62, %59
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.19, i64 0, i64 0))
br label %144
76: ; preds = %25
%77 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 8
%78 = call i64 @memcmp(i32* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%79 = icmp eq i64 %78, 0
br i1 %79, label %82, label %80
80: ; preds = %76
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
br label %144
82: ; preds = %76
%83 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 14)
store i32 1032, i32* %6
store i32 2, i32* %4
store i32 0, i32* %5
%84 = call i32 @pCT_data(i32 %0, i32* %5, i32* %4, i32 14, i32* %12, i32* %6, i32* %14)
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %148
86: ; preds = %82
%87 = load i32, i32* %4
%88 = icmp eq i32 %87, 0
br i1 %88, label %89, label %151
89: ; preds = %86
%90 = load i32, i32* %6
%91 = icmp ne i32 %90, 2
%92 = load i32, i32* %14
%93 = icmp ne i32 %92, 144
%94 = select i1 %91, i1 true, i1 %93
%95 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 1
%96 = load i32, i32* %95
%97 = icmp ne i32 %96, 0
%98 = select i1 %94, i1 true, i1 %97
br i1 %98, label %99, label %101
99: ; preds = %89
%100 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.20, i64 0, i64 0))
br label %144
101: ; preds = %89
%102 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 5)
store i32 1032, i32* %6
store i32 2, i32* %4
store i32 0, i32* %5
%103 = call i32 @pCT_data(i32 %0, i32* %5, i32* %4, i32 5, i32* %12, i32* %6, i32* %14)
%104 = icmp eq i32 %103, 0
br i1 %104, label %105, label %148
105: ; preds = %101
%106 = load i32, i32* %4
%107 = icmp eq i32 %106, 0
br i1 %107, label %108, label %151
108: ; preds = %105
%109 = load i32, i32* %6
%110 = icmp slt i32 %109, 5
br i1 %110, label %123, label %111
111: ; preds = %108
%112 = add nsw i32 %109, -2
%113 = zext i32 %112 to i64
%114 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 %113
%115 = load i32, i32* %114
%116 = icmp eq i32 %115, 144
br i1 %116, label %117, label %123
117: ; preds = %111
%118 = add nsw i32 %109, -1
%119 = zext i32 %118 to i64
%120 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 %119
%121 = load i32, i32* %120
%122 = icmp eq i32 %121, 0
br i1 %122, label %137, label %123
123: ; preds = %117, %111, %108
%124 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.19, i64 0, i64 0))
br label %144
125: ; preds = %25
%126 = icmp sgt i32 %26, 2
br i1 %126, label %127, label %135
127: ; preds = %125
%128 = add nsw i32 %26, -2
%129 = zext i32 %128 to i64
%130 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 %129
%131 = load i32, i32* %130
%132 = icmp eq i32 %131, 144
br i1 %132, label %133, label %135
133: ; preds = %127
%134 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.21, i64 0, i64 0))
br label %144
135: ; preds = %127, %125
%136 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %154
137: ; preds = %117, %68
%138 = load i32, i32* %14
%139 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 1
%140 = load i32, i32* %139
%141 = getelementptr inbounds [258 x i32], [258 x i32]* %3, i64 0, i64 2
%142 = load i32, i32* %141
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.12, i64 0, i64 0), i32 %138, i32 %140, i32 %142)
br label %144
144: ; preds = %137, %133, %123, %99, %80, %74, %50, %31
%145 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 5)
store i32 1032, i32* %6
store i32 2, i32* %4
store i32 1, i32* %5
%146 = call i32 @pCT_data(i32 %0, i32* %5, i32* %4, i32 5, i32* %12, i32* %6, i32* %14)
%147 = icmp eq i32 %146, 0
br i1 %147, label %154, label %148
148: ; preds = %144, %101, %82, %52, %33, %20, %1
%149 = phi i32 [ %15, %1 ], [ %23, %20 ], [ %146, %144 ], [ %35, %33 ], [ %54, %52 ], [ %84, %82 ], [ %103, %101 ]
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.13, i64 0, i64 0), i32 %149)
br label %154
151: ; preds = %105, %86, %56, %37
%152 = phi i32 [ %106, %105 ], [ %87, %86 ], [ %57, %56 ], [ %38, %37 ]
%153 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.14, i64 0, i64 0), i32 %152)
br label %154
154: ; preds = %144, %20, %151, %148, %135
%155 = phi i32 [ 3, %148 ], [ 3, %151 ], [ 0, %135 ], [ 3, %20 ], [ 0, %144 ]
%156 = call i32 @sleep(i32 2)
ret i32 %155
}