#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 */

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ pause();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_data16();
int /*<<< orphan*/ reset();
char *rl_gets(char *);
int /*<<< orphan*/ sprintf(char *, char *);
int sscanf(char *, char *, char *, int *, int *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ write_data00_to_reg(int);
int /*<<< orphan*/ write_data16(int);
void wtest_read(int *adest, int *reg, int *value) {
  char *cmd;
  char rw[100];
  int arg1, arg2;
  char prompt[100];
  sprintf(prompt, "entrer r|w|? [reg] [val] > ");
  while (1) {
    cmd = rl_gets(prompt);
    if (cmd == 0) {
      printf("\n");
      printf("EOF \n");
      while (1)
        pause();
    }
    int status = sscanf(cmd, "%s%x%x", rw, &arg1, &arg2);
    fprintf(stderr, "st=%d ;%s;%x;%x;\n", status, rw, arg1, arg2);
    switch (status) {
    case 1:
      if (rw[0] == 'w') {
        fprintf(stderr, "write require a reg or a data\n");
      } else if (rw[0] == 'i') {
        reset();
        continue;
      } else if (rw[0] == 'e') {
        *adest = 0xF0 + 6;
        *reg = 0;
        *value = 0;
        return;
      } else if (rw[0] == 'd' && rw[1] == 'a') {
        write_data00_to_reg(0x00F4);
        write_data00_to_reg(0x0070 | 0);
      } else if (rw[0] == 'd' && rw[1] == 'r') {
        write_data00_to_reg(0x0050 + 2);
        write_data00_to_reg(0x0010 + 2);
        read_data16();
        read_data16();
        read_data16();
        write_data00_to_reg(0x0070 + 2);
      } else if (rw[0] == 'd' && rw[1] == 'w' && rw[2] == '3') {
        write_data00_to_reg(0x0000 + 3);
        write_data16(4);
        write_data16(0x3132);
        write_data16(0x3334);
        write_data00_to_reg(0x0060 + 3);
      } else if (rw[0] == 'd' && rw[1] == 'w' && rw[2] == '4') {
        write_data00_to_reg(0x0000 + 4);
        write_data16(4);
        write_data16(0x4142);
        write_data16(0x4344);
        write_data00_to_reg(0x0060 + 4);
      } else if (rw[0] == 'd' && rw[1] == 'w' && rw[2] == 'i') {
        write_data00_to_reg(0x0000 + 3);
        write_data16(4);
        write_data16(0x3132);
        write_data16(0x3334);
        write_data00_to_reg(0x0060 + 3);
        write_data00_to_reg(0x0000 + 4);
        write_data16(4);
        write_data16(0x4142);
        write_data16(0x4344);
        write_data00_to_reg(0x0060 + 4);
      } else if (rw[0] == 'd' && rw[1] == 's') {
        write_data00_to_reg(0x00D0 + 0);
        read_data16();
        write_data00_to_reg(0x00D0 + 1);
        read_data16();
        write_data00_to_reg(0x00D0 + 2);
        read_data16();
        write_data00_to_reg(0x00D0 + 3);
        read_data16();
      } else if (rw[0] == 'r' && rw[1] == 0) {
        *adest = 0xF0 + 2;
        *reg = 0;
        *value = 0;
        return;
      } else if (rw[0] == 'r' && rw[1] == 'e' && rw[2] == 'a') {
        *adest = 0xF0 + 5;
        *reg = 0;
        *value = 0;
        return;
      } else
        fprintf(stderr, "invalid command\n");
      break;
    case 2:
      if (rw[0] == 'w') {
        *adest = 0xF0 + 1;
        *reg = 0;
        *value = arg1;
        return;
      } else if (rw[0] == 'c') {
        *adest = 0xF0 + 0;
        *reg = arg1;
        *value = 0;
        return;
      } else if (rw[0] == 'r') {
        *adest = 0xF0 + 4;
        *reg = arg1;
        *value = 0;
        return;
      } else
        fprintf(stderr, "invalid command\n");
      break;
    case 3:
      if (rw[0] == 'w') {
        *adest = 0xF0 + 3;
        *reg = arg1;
        *value = arg2;
        return;
      } else if (rw[0] == 'r') {
        fprintf(stderr, "to many arguments for read (0 or 1)\n");
      } else
        fprintf(stderr, "invalid command\n");
      break;
    }
  }
}


x86 assembly (clang, -O0):
<wtest_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x100(%rbp),%rdi
lea    0xe3b(%rip),%rsi
call   10c0 <sprintf@plt>
lea    -0x100(%rbp),%rdi
call   1050 <rl_gets@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1209 <wtest_read+0x69>
lea    0xe34(%rip),%rdi
call   1030 <printf@plt>
lea    0xe24(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <pause@plt>
jmp    11fd <wtest_read+0x5d>
mov    -0x20(%rbp),%rdi
lea    0xe0e(%rip),%rsi
lea    -0x90(%rbp),%rdx
mov    %rdx,-0x110(%rbp)
lea    -0x94(%rbp),%rcx
lea    -0x98(%rbp),%r8
call   1080 <sscanf@plt>
mov    -0x110(%rbp),%rcx
mov    %eax,-0x104(%rbp)
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
mov    -0x104(%rbp),%edx
mov    -0x94(%rbp),%r8d
mov    -0x98(%rbp),%r9d
lea    0xdc3(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    -0x104(%rbp),%eax
mov    %eax,-0x108(%rbp)
sub    $0x1,%eax
je     12af <wtest_read+0x10f>
jmp    1287 <wtest_read+0xe7>
mov    -0x108(%rbp),%eax
sub    $0x2,%eax
je     166f <wtest_read+0x4cf>
jmp    129b <wtest_read+0xfb>
mov    -0x108(%rbp),%eax
sub    $0x3,%eax
je     1734 <wtest_read+0x594>
jmp    17b8 <wtest_read+0x618>
movsbl -0x90(%rbp),%eax
cmp    $0x77,%eax
jne    12db <wtest_read+0x13b>
mov    0x2d1a(%rip),%rax
mov    (%rax),%edi
lea    0xd6c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    166a <wtest_read+0x4ca>
movsbl -0x90(%rbp),%eax
cmp    $0x69,%eax
jne    12f7 <wtest_read+0x157>
mov    $0x0,%al
call   1090 <reset@plt>
jmp    11ca <wtest_read+0x2a>
movsbl -0x90(%rbp),%eax
cmp    $0x65,%eax
jne    132a <wtest_read+0x18a>
mov    -0x8(%rbp),%rax
movl   $0xf6,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    17bd <wtest_read+0x61d>
movsbl -0x90(%rbp),%eax
cmp    $0x64,%eax
jne    1363 <wtest_read+0x1c3>
movsbl -0x8f(%rbp),%eax
cmp    $0x61,%eax
jne    1363 <wtest_read+0x1c3>
mov    $0xf4,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x70,%edi
call   10b0 <write_data00_to_reg@plt>
jmp    165b <wtest_read+0x4bb>
movsbl -0x90(%rbp),%eax
cmp    $0x64,%eax
jne    13bb <wtest_read+0x21b>
movsbl -0x8f(%rbp),%eax
cmp    $0x72,%eax
jne    13bb <wtest_read+0x21b>
mov    $0x52,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x12,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x0,%al
call   10a0 <read_data16@plt>
mov    $0x0,%al
call   10a0 <read_data16@plt>
mov    $0x0,%al
call   10a0 <read_data16@plt>
mov    $0x72,%edi
call   10b0 <write_data00_to_reg@plt>
jmp    1656 <wtest_read+0x4b6>
movsbl -0x90(%rbp),%eax
cmp    $0x64,%eax
jne    1422 <wtest_read+0x282>
movsbl -0x8f(%rbp),%eax
cmp    $0x77,%eax
jne    1422 <wtest_read+0x282>
movsbl -0x8e(%rbp),%eax
cmp    $0x33,%eax
jne    1422 <wtest_read+0x282>
mov    $0x3,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   1070 <write_data16@plt>
mov    $0x3132,%edi
call   1070 <write_data16@plt>
mov    $0x3334,%edi
call   1070 <write_data16@plt>
mov    $0x63,%edi
call   10b0 <write_data00_to_reg@plt>
jmp    1651 <wtest_read+0x4b1>
movsbl -0x90(%rbp),%eax
cmp    $0x64,%eax
jne    1489 <wtest_read+0x2e9>
movsbl -0x8f(%rbp),%eax
cmp    $0x77,%eax
jne    1489 <wtest_read+0x2e9>
movsbl -0x8e(%rbp),%eax
cmp    $0x34,%eax
jne    1489 <wtest_read+0x2e9>
mov    $0x4,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   1070 <write_data16@plt>
mov    $0x4142,%edi
call   1070 <write_data16@plt>
mov    $0x4344,%edi
call   1070 <write_data16@plt>
mov    $0x64,%edi
call   10b0 <write_data00_to_reg@plt>
jmp    164c <wtest_read+0x4ac>
movsbl -0x90(%rbp),%eax
cmp    $0x64,%eax
jne    1522 <wtest_read+0x382>
movsbl -0x8f(%rbp),%eax
cmp    $0x77,%eax
jne    1522 <wtest_read+0x382>
movsbl -0x8e(%rbp),%eax
cmp    $0x69,%eax
jne    1522 <wtest_read+0x382>
mov    $0x3,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   1070 <write_data16@plt>
mov    $0x3132,%edi
call   1070 <write_data16@plt>
mov    $0x3334,%edi
call   1070 <write_data16@plt>
mov    $0x63,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   1070 <write_data16@plt>
mov    $0x4142,%edi
call   1070 <write_data16@plt>
mov    $0x4344,%edi
call   1070 <write_data16@plt>
mov    $0x64,%edi
call   10b0 <write_data00_to_reg@plt>
jmp    1647 <wtest_read+0x4a7>
movsbl -0x90(%rbp),%eax
cmp    $0x64,%eax
jne    158b <wtest_read+0x3eb>
movsbl -0x8f(%rbp),%eax
cmp    $0x73,%eax
jne    158b <wtest_read+0x3eb>
mov    $0xd0,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x0,%al
call   10a0 <read_data16@plt>
mov    $0xd1,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x0,%al
call   10a0 <read_data16@plt>
mov    $0xd2,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x0,%al
call   10a0 <read_data16@plt>
mov    $0xd3,%edi
call   10b0 <write_data00_to_reg@plt>
mov    $0x0,%al
call   10a0 <read_data16@plt>
jmp    1642 <wtest_read+0x4a2>
movsbl -0x90(%rbp),%eax
cmp    $0x72,%eax
jne    15ce <wtest_read+0x42e>
movsbl -0x8f(%rbp),%eax
cmp    $0x0,%eax
jne    15ce <wtest_read+0x42e>
mov    -0x8(%rbp),%rax
movl   $0xf2,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    17bd <wtest_read+0x61d>
movsbl -0x90(%rbp),%eax
cmp    $0x72,%eax
jne    1621 <wtest_read+0x481>
movsbl -0x8f(%rbp),%eax
cmp    $0x65,%eax
jne    1621 <wtest_read+0x481>
movsbl -0x8e(%rbp),%eax
cmp    $0x61,%eax
jne    1621 <wtest_read+0x481>
mov    -0x8(%rbp),%rax
movl   $0xf5,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    17bd <wtest_read+0x61d>
mov    0x29b8(%rip),%rax
mov    (%rax),%edi
lea    0xa29(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    163d <wtest_read+0x49d>
jmp    1642 <wtest_read+0x4a2>
jmp    1647 <wtest_read+0x4a7>
jmp    164c <wtest_read+0x4ac>
jmp    1651 <wtest_read+0x4b1>
jmp    1656 <wtest_read+0x4b6>
jmp    165b <wtest_read+0x4bb>
jmp    1660 <wtest_read+0x4c0>
jmp    1665 <wtest_read+0x4c5>
jmp    166a <wtest_read+0x4ca>
jmp    17b8 <wtest_read+0x618>
movsbl -0x90(%rbp),%eax
cmp    $0x77,%eax
jne    16a4 <wtest_read+0x504>
mov    -0x8(%rbp),%rax
movl   $0xf1,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x94(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    17bd <wtest_read+0x61d>
movsbl -0x90(%rbp),%eax
cmp    $0x63,%eax
jne    16d9 <wtest_read+0x539>
mov    -0x8(%rbp),%rax
movl   $0xf0,(%rax)
mov    -0x94(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    17bd <wtest_read+0x61d>
movsbl -0x90(%rbp),%eax
cmp    $0x72,%eax
jne    170e <wtest_read+0x56e>
mov    -0x8(%rbp),%rax
movl   $0xf4,(%rax)
mov    -0x94(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
jmp    17bd <wtest_read+0x61d>
mov    0x28cb(%rip),%rax
mov    (%rax),%edi
lea    0x93c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    172a <wtest_read+0x58a>
jmp    172f <wtest_read+0x58f>
jmp    17b8 <wtest_read+0x618>
movsbl -0x90(%rbp),%eax
cmp    $0x77,%eax
jne    176b <wtest_read+0x5cb>
mov    -0x8(%rbp),%rax
movl   $0xf3,(%rax)
mov    -0x94(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x98(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
jmp    17bd <wtest_read+0x61d>
movsbl -0x90(%rbp),%eax
cmp    $0x72,%eax
jne    1797 <wtest_read+0x5f7>
mov    0x285e(%rip),%rax
mov    (%rax),%edi
lea    0x8e0(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    17ae <wtest_read+0x60e>
mov    0x2842(%rip),%rax
mov    (%rax),%edi
lea    0x8b3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    17b3 <wtest_read+0x613>
jmp    17b8 <wtest_read+0x618>
jmp    11ca <wtest_read+0x2a>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wtest_read>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x108,%rsp
mov    %rdx,0x28(%rsp)
mov    %rsi,0x18(%rsp)
mov    %rdi,0x10(%rsp)
movups 0xe45(%rip),%xmm0
movups %xmm0,0xac(%rsp)
movups 0xe2a(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
lea    0xa0(%rsp),%rdi
call   1060 <rl_gets@plt>
test   %rax,%rax
je     14e4 <wtest_read+0x344>
lea    0x30(%rsp),%rbx
lea    0xc(%rsp),%rbp
lea    0x24(%rsp),%r14
mov    0x2dd6(%rip),%r13
lea    0xe12(%rip),%r15
jmp    125d <wtest_read+0xbd>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x30(%rsp),%eax
cmp    $0x72,%al
je     1312 <wtest_read+0x172>
cmp    $0x77,%al
je     154c <wtest_read+0x3ac>
mov    0x0(%r13),%edi
lea    0xe14(%rip),%rsi
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xa0(%rsp),%rdi
call   1060 <rl_gets@plt>
test   %rax,%rax
je     14e4 <wtest_read+0x344>
mov    %rax,%rdi
lea    0xdb5(%rip),%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    %r14,%r8
call   1090 <sscanf@plt>
mov    %eax,%r12d
mov    0x0(%r13),%edi
mov    0xc(%rsp),%r8d
mov    0x24(%rsp),%r9d
mov    %r15,%rsi
mov    %eax,%edx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <fprintf@plt>
cmp    $0x3,%r12d
je     1220 <wtest_read+0x80>
cmp    $0x2,%r12d
je     12f0 <wtest_read+0x150>
cmp    $0x1,%r12d
jne    1247 <wtest_read+0xa7>
movzbl 0x30(%rsp),%eax
cmp    $0x69,%al
je     1322 <wtest_read+0x182>
cmp    $0x77,%al
je     132e <wtest_read+0x18e>
cmp    $0x65,%al
je     157f <wtest_read+0x3df>
movzbl 0x31(%rsp),%edi
cmp    $0x64,%al
jne    133e <wtest_read+0x19e>
cmp    $0x61,%dil
jne    133e <wtest_read+0x19e>
mov    $0xf4,%edi
call   10c0 <write_data00_to_reg@plt>
mov    $0x70,%edi
call   10c0 <write_data00_to_reg@plt>
jmp    1247 <wtest_read+0xa7>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl 0x30(%rsp),%eax
cmp    $0x63,%al
je     1509 <wtest_read+0x369>
cmp    $0x72,%al
je     1516 <wtest_read+0x376>
cmp    $0x77,%al
jne    1235 <wtest_read+0x95>
jmp    1530 <wtest_read+0x390>
mov    0x0(%r13),%edi
lea    0xd48(%rip),%rsi
jmp    1240 <wtest_read+0xa0>
xor    %eax,%eax
call   10a0 <reset@plt>
jmp    1247 <wtest_read+0xa7>
mov    0x0(%r13),%edi
lea    0xcfc(%rip),%rsi
jmp    1240 <wtest_read+0xa0>
cmp    $0x64,%al
jne    1380 <wtest_read+0x1e0>
cmp    $0x72,%dil
jne    1380 <wtest_read+0x1e0>
mov    $0x52,%edi
call   10c0 <write_data00_to_reg@plt>
mov    $0x12,%edi
call   10c0 <write_data00_to_reg@plt>
xor    %eax,%eax
call   10b0 <read_data16@plt>
xor    %eax,%eax
call   10b0 <read_data16@plt>
xor    %eax,%eax
call   10b0 <read_data16@plt>
mov    $0x72,%edi
call   10c0 <write_data00_to_reg@plt>
jmp    1247 <wtest_read+0xa7>
mov    %eax,%edx
xor    $0x64,%dl
mov    %edi,%ecx
xor    $0x77,%cl
or     %dl,%cl
sete   %dl
movzbl 0x32(%rsp),%esi
jne    13d3 <wtest_read+0x233>
cmp    $0x33,%sil
jne    13d3 <wtest_read+0x233>
mov    $0x3,%edi
call   10c0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   1080 <write_data16@plt>
mov    $0x3132,%edi
call   1080 <write_data16@plt>
mov    $0x3334,%edi
call   1080 <write_data16@plt>
mov    $0x63,%edi
call   10c0 <write_data00_to_reg@plt>
jmp    1247 <wtest_read+0xa7>
cmp    $0x34,%sil
sete   %cl
and    %dl,%cl
cmp    $0x1,%cl
je     1421 <wtest_read+0x281>
cmp    $0x69,%sil
sete   %cl
and    %cl,%dl
cmp    $0x1,%dl
jne    1458 <wtest_read+0x2b8>
mov    $0x3,%edi
call   10c0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   1080 <write_data16@plt>
mov    $0x3132,%edi
call   1080 <write_data16@plt>
mov    $0x3334,%edi
call   1080 <write_data16@plt>
mov    $0x63,%edi
call   10c0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   10c0 <write_data00_to_reg@plt>
mov    $0x4,%edi
call   1080 <write_data16@plt>
mov    $0x4142,%edi
call   1080 <write_data16@plt>
mov    $0x4344,%edi
call   1080 <write_data16@plt>
mov    $0x64,%edi
call   10c0 <write_data00_to_reg@plt>
jmp    1247 <wtest_read+0xa7>
cmp    $0x64,%al
jne    14ab <wtest_read+0x30b>
cmp    $0x73,%dil
jne    14ab <wtest_read+0x30b>
mov    $0xd0,%edi
call   10c0 <write_data00_to_reg@plt>
xor    %eax,%eax
call   10b0 <read_data16@plt>
mov    $0xd1,%edi
call   10c0 <write_data00_to_reg@plt>
xor    %eax,%eax
call   10b0 <read_data16@plt>
mov    $0xd2,%edi
call   10c0 <write_data00_to_reg@plt>
xor    %eax,%eax
call   10b0 <read_data16@plt>
mov    $0xd3,%edi
call   10c0 <write_data00_to_reg@plt>
xor    %eax,%eax
call   10b0 <read_data16@plt>
jmp    1247 <wtest_read+0xa7>
cmp    $0x72,%al
jne    14b8 <wtest_read+0x318>
test   %dil,%dil
je     1597 <wtest_read+0x3f7>
cmp    $0x72,%al
jne    1235 <wtest_read+0x95>
cmp    $0x65,%dil
jne    1235 <wtest_read+0x95>
cmp    $0x61,%sil
jne    1235 <wtest_read+0x95>
mov    0x10(%rsp),%rax
movl   $0xf5,(%rax)
jmp    158a <wtest_read+0x3ea>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xb95(%rip),%rdi
call   1040 <puts@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <pause@plt>
jmp    1500 <wtest_read+0x360>
mov    0x10(%rsp),%rax
movl   $0xf0,(%rax)
jmp    1521 <wtest_read+0x381>
mov    0x10(%rsp),%rax
movl   $0xf4,(%rax)
mov    0xc(%rsp),%eax
mov    0x18(%rsp),%rcx
mov    %eax,(%rcx)
xor    %eax,%eax
jmp    1566 <wtest_read+0x3c6>
mov    0x10(%rsp),%rax
movl   $0xf1,(%rax)
mov    0x18(%rsp),%rax
movl   $0x0,(%rax)
mov    0xc(%rsp),%eax
jmp    1566 <wtest_read+0x3c6>
mov    0x10(%rsp),%rax
movl   $0xf3,(%rax)
mov    0xc(%rsp),%eax
mov    0x18(%rsp),%rcx
mov    %eax,(%rcx)
mov    0x24(%rsp),%eax
mov    0x28(%rsp),%rcx
mov    %eax,(%rcx)
add    $0x108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x10(%rsp),%rax
movl   $0xf6,(%rax)
mov    0x18(%rsp),%rax
movl   $0x0,(%rax)
jmp    152c <wtest_read+0x38c>
mov    0x10(%rsp),%rax
movl   $0xf2,(%rax)
jmp    158a <wtest_read+0x3ea>

LLVM IR (-O0):
@.str = [28 x i8] c"entrer r|w|? [reg] [val] > \00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [6 x i8] c"EOF \0A\00"
@.str.3 = [7 x i8] c"%s%x%x\00"
@stderr = global i32 0
@.str.4 = [18 x i8] c"st=%d ;%s;%x;%x;\0A\00"
@.str.5 = [31 x i8] c"write require a reg or a data\0A\00"
@.str.6 = [17 x i8] c"invalid command\0A\00"
@.str.7 = [37 x i8] c"to many arguments for read (0 or 1)\0A\00"
define void @wtest_read(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca [100 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca [100 x i8]
%12 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%14 = call i32 @sprintf(i8* %13, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %3, %49, %284
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%17 = call i8* @rl_gets(i8* %16)
store i8* %17, i8** %7
%18 = load i8*, i8** %7
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %25
20: ; preds = %15
%21 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %20, %23
%24 = call i32 (...) @pause()
br label %23
25: ; preds = %15
%26 = load i8*, i8** %7
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%28 = call i32 @sscanf(i8* %26, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %27, i32* %9, i32* %10)
store i32 %28, i32* %12
%29 = load i32, i32* @stderr
%30 = load i32, i32* %12
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%32 = load i32, i32* %9
%33 = load i32, i32* %10
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %30, i8* %31, i32 %32, i32 %33)
%35 = load i32, i32* %12
switch i32 %35, label %284 [
i32 1, label %36
i32 2, label %224
i32 3, label %260
]
36: ; preds = %25
%37 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 119
br i1 %40, label %41, label %44
41: ; preds = %36
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
br label %223
44: ; preds = %36
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 105
br i1 %48, label %49, label %51
49: ; preds = %44
%50 = call i32 (...) @reset()
br label %15
51: ; preds = %44
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 101
br i1 %55, label %56, label %60
56: ; preds = %51
%57 = load i32*, i32** %4
store i32 246, i32* %57
%58 = load i32*, i32** %5
store i32 0, i32* %58
%59 = load i32*, i32** %6
store i32 0, i32* %59
br label %285
60: ; preds = %51
%61 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%62 = load i8, i8* %61
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 100
br i1 %64, label %65, label %73
65: ; preds = %60
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%67 = load i8, i8* %66
%68 = sext i8 %67 to i32
%69 = icmp eq i32 %68, 97
br i1 %69, label %70, label %73
70: ; preds = %65
%71 = call i32 @write_data00_to_reg(i32 244)
%72 = call i32 @write_data00_to_reg(i32 112)
br label %220
73: ; preds = %65, %60
%74 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = icmp eq i32 %76, 100
br i1 %77, label %78, label %90
78: ; preds = %73
%79 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 114
br i1 %82, label %83, label %90
83: ; preds = %78
%84 = call i32 @write_data00_to_reg(i32 82)
%85 = call i32 @write_data00_to_reg(i32 18)
%86 = call i32 (...) @read_data16()
%87 = call i32 (...) @read_data16()
%88 = call i32 (...) @read_data16()
%89 = call i32 @write_data00_to_reg(i32 114)
br label %219
90: ; preds = %78, %73
%91 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%92 = load i8, i8* %91
%93 = sext i8 %92 to i32
%94 = icmp eq i32 %93, 100
br i1 %94, label %95, label %111
95: ; preds = %90
%96 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = icmp eq i32 %98, 119
br i1 %99, label %100, label %111
100: ; preds = %95
%101 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 2
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 51
br i1 %104, label %105, label %111
105: ; preds = %100
%106 = call i32 @write_data00_to_reg(i32 3)
%107 = call i32 @write_data16(i32 4)
%108 = call i32 @write_data16(i32 12594)
%109 = call i32 @write_data16(i32 13108)
%110 = call i32 @write_data00_to_reg(i32 99)
br label %218
111: ; preds = %100, %95, %90
%112 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%113 = load i8, i8* %112
%114 = sext i8 %113 to i32
%115 = icmp eq i32 %114, 100
br i1 %115, label %116, label %132
116: ; preds = %111
%117 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %119, 119
br i1 %120, label %121, label %132
121: ; preds = %116
%122 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 2
%123 = load i8, i8* %122
%124 = sext i8 %123 to i32
%125 = icmp eq i32 %124, 52
br i1 %125, label %126, label %132
126: ; preds = %121
%127 = call i32 @write_data00_to_reg(i32 4)
%128 = call i32 @write_data16(i32 4)
%129 = call i32 @write_data16(i32 16706)
%130 = call i32 @write_data16(i32 17220)
%131 = call i32 @write_data00_to_reg(i32 100)
br label %217
132: ; preds = %121, %116, %111
%133 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp eq i32 %135, 100
br i1 %136, label %137, label %158
137: ; preds = %132
%138 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%139 = load i8, i8* %138
%140 = sext i8 %139 to i32
%141 = icmp eq i32 %140, 119
br i1 %141, label %142, label %158
142: ; preds = %137
%143 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 2
%144 = load i8, i8* %143
%145 = sext i8 %144 to i32
%146 = icmp eq i32 %145, 105
br i1 %146, label %147, label %158
147: ; preds = %142
%148 = call i32 @write_data00_to_reg(i32 3)
%149 = call i32 @write_data16(i32 4)
%150 = call i32 @write_data16(i32 12594)
%151 = call i32 @write_data16(i32 13108)
%152 = call i32 @write_data00_to_reg(i32 99)
%153 = call i32 @write_data00_to_reg(i32 4)
%154 = call i32 @write_data16(i32 4)
%155 = call i32 @write_data16(i32 16706)
%156 = call i32 @write_data16(i32 17220)
%157 = call i32 @write_data00_to_reg(i32 100)
br label %216
158: ; preds = %142, %137, %132
%159 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = icmp eq i32 %161, 100
br i1 %162, label %163, label %177
163: ; preds = %158
%164 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%165 = load i8, i8* %164
%166 = sext i8 %165 to i32
%167 = icmp eq i32 %166, 115
br i1 %167, label %168, label %177
168: ; preds = %163
%169 = call i32 @write_data00_to_reg(i32 208)
%170 = call i32 (...) @read_data16()
%171 = call i32 @write_data00_to_reg(i32 209)
%172 = call i32 (...) @read_data16()
%173 = call i32 @write_data00_to_reg(i32 210)
%174 = call i32 (...) @read_data16()
%175 = call i32 @write_data00_to_reg(i32 211)
%176 = call i32 (...) @read_data16()
br label %215
177: ; preds = %163, %158
%178 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%179 = load i8, i8* %178
%180 = sext i8 %179 to i32
%181 = icmp eq i32 %180, 114
br i1 %181, label %182, label %191
182: ; preds = %177
%183 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = icmp eq i32 %185, 0
br i1 %186, label %187, label %191
187: ; preds = %182
%188 = load i32*, i32** %4
store i32 242, i32* %188
%189 = load i32*, i32** %5
store i32 0, i32* %189
%190 = load i32*, i32** %6
store i32 0, i32* %190
br label %285
191: ; preds = %182, %177
%192 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%193 = load i8, i8* %192
%194 = sext i8 %193 to i32
%195 = icmp eq i32 %194, 114
br i1 %195, label %196, label %210
196: ; preds = %191
%197 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 1
%198 = load i8, i8* %197
%199 = sext i8 %198 to i32
%200 = icmp eq i32 %199, 101
br i1 %200, label %201, label %210
201: ; preds = %196
%202 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 2
%203 = load i8, i8* %202
%204 = sext i8 %203 to i32
%205 = icmp eq i32 %204, 97
br i1 %205, label %206, label %210
206: ; preds = %201
%207 = load i32*, i32** %4
store i32 245, i32* %207
%208 = load i32*, i32** %5
store i32 0, i32* %208
%209 = load i32*, i32** %6
store i32 0, i32* %209
br label %285
210: ; preds = %201, %196, %191
%211 = load i32, i32* @stderr
%212 = call i32 (i32, i8*, ...) @fprintf(i32 %211, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %213
213: ; preds = %210
br label %214
214: ; preds = %213
br label %215
215: ; preds = %214, %168
br label %216
216: ; preds = %215, %147
br label %217
217: ; preds = %216, %126
br label %218
218: ; preds = %217, %105
br label %219
219: ; preds = %218, %83
br label %220
220: ; preds = %219, %70
br label %221
221: ; preds = %220
br label %222
222: ; preds = %221
br label %223
223: ; preds = %222, %41
br label %284
224: ; preds = %25
%225 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%226 = load i8, i8* %225
%227 = sext i8 %226 to i32
%228 = icmp eq i32 %227, 119
br i1 %228, label %229, label %234
229: ; preds = %224
%230 = load i32*, i32** %4
store i32 241, i32* %230
%231 = load i32*, i32** %5
store i32 0, i32* %231
%232 = load i32, i32* %9
%233 = load i32*, i32** %6
store i32 %232, i32* %233
br label %285
234: ; preds = %224
%235 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%236 = load i8, i8* %235
%237 = sext i8 %236 to i32
%238 = icmp eq i32 %237, 99
br i1 %238, label %239, label %244
239: ; preds = %234
%240 = load i32*, i32** %4
store i32 240, i32* %240
%241 = load i32, i32* %9
%242 = load i32*, i32** %5
store i32 %241, i32* %242
%243 = load i32*, i32** %6
store i32 0, i32* %243
br label %285
244: ; preds = %234
%245 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%246 = load i8, i8* %245
%247 = sext i8 %246 to i32
%248 = icmp eq i32 %247, 114
br i1 %248, label %249, label %254
249: ; preds = %244
%250 = load i32*, i32** %4
store i32 244, i32* %250
%251 = load i32, i32* %9
%252 = load i32*, i32** %5
store i32 %251, i32* %252
%253 = load i32*, i32** %6
store i32 0, i32* %253
br label %285
254: ; preds = %244
%255 = load i32, i32* @stderr
%256 = call i32 (i32, i8*, ...) @fprintf(i32 %255, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %257
257: ; preds = %254
br label %258
258: ; preds = %257
br label %259
259: ; preds = %258
br label %284
260: ; preds = %25
%261 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%262 = load i8, i8* %261
%263 = sext i8 %262 to i32
%264 = icmp eq i32 %263, 119
br i1 %264, label %265, label %271
265: ; preds = %260
%266 = load i32*, i32** %4
store i32 243, i32* %266
%267 = load i32, i32* %9
%268 = load i32*, i32** %5
store i32 %267, i32* %268
%269 = load i32, i32* %10
%270 = load i32*, i32** %6
store i32 %269, i32* %270
br label %285
271: ; preds = %260
%272 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%273 = load i8, i8* %272
%274 = sext i8 %273 to i32
%275 = icmp eq i32 %274, 114
br i1 %275, label %276, label %279
276: ; preds = %271
%277 = load i32, i32* @stderr
%278 = call i32 (i32, i8*, ...) @fprintf(i32 %277, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
br label %282
279: ; preds = %271
%280 = load i32, i32* @stderr
%281 = call i32 (i32, i8*, ...) @fprintf(i32 %280, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %282
282: ; preds = %279, %276
br label %283
283: ; preds = %282
br label %284
284: ; preds = %25, %283, %259, %223
br label %15
285: ; preds = %265, %249, %239, %229, %206, %187, %56
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"entrer r|w|? [reg] [val] > \00"
@.str.3 = [7 x i8] c"%s%x%x\00"
@stderr = global i32 0
@.str.4 = [18 x i8] c"st=%d ;%s;%x;%x;\0A\00"
@.str.5 = [31 x i8] c"write require a reg or a data\0A\00"
@.str.6 = [17 x i8] c"invalid command\0A\00"
@.str.7 = [37 x i8] c"to many arguments for read (0 or 1)\0A\00"
@str = [5 x i8] c"EOF \00"
define void @wtest_read(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca [100 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%12 = call i8* @rl_gets(i8* %11)
%13 = icmp eq i8* %12, null
br i1 %13, label %17, label %14
14: ; preds = %3
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 1
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 2
br label %22
17: ; preds = %138, %3
%18 = call i32 @putchar(i32 10)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %20
20: ; preds = %20, %17
%21 = call i32 (...) @pause()
br label %20
22: ; preds = %14, %138
%23 = phi i8* [ %12, %14 ], [ %139, %138 ]
%24 = call i32 @sscanf(i8* %23, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %8, i32* %5, i32* %6)
%25 = load i32, i32* @stderr
%26 = load i32, i32* %5
%27 = load i32, i32* %6
%28 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %24, i8* %8, i32 %26, i32 %27)
switch i32 %24, label %138 [
i32 1, label %29
i32 2, label %116
i32 3, label %127
]
29: ; preds = %22
%30 = load i8, i8* %8
switch i8 %30, label %37 [
i8 119, label %31
i8 105, label %34
i8 101, label %36
]
31: ; preds = %29
%32 = load i32, i32* @stderr
%33 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
br label %138
34: ; preds = %29
%35 = call i32 (...) @reset()
br label %138
36: ; preds = %29
store i32 246, i32* %0
store i32 0, i32* %1
br label %141
37: ; preds = %29
%38 = icmp eq i8 %30, 100
%39 = load i8, i8* %15
%40 = icmp eq i8 %39, 97
%41 = select i1 %38, i1 %40, i1 false
br i1 %41, label %42, label %45
42: ; preds = %37
%43 = call i32 @write_data00_to_reg(i32 244)
%44 = call i32 @write_data00_to_reg(i32 112)
br label %138
45: ; preds = %37
%46 = icmp eq i8 %39, 114
%47 = select i1 %38, i1 %46, i1 false
br i1 %47, label %48, label %55
48: ; preds = %45
%49 = call i32 @write_data00_to_reg(i32 82)
%50 = call i32 @write_data00_to_reg(i32 18)
%51 = call i32 (...) @read_data16()
%52 = call i32 (...) @read_data16()
%53 = call i32 (...) @read_data16()
%54 = call i32 @write_data00_to_reg(i32 114)
br label %138
55: ; preds = %45
%56 = icmp eq i8 %39, 119
%57 = select i1 %38, i1 %56, i1 false
%58 = load i8, i8* %16
%59 = icmp eq i8 %58, 51
%60 = select i1 %57, i1 %59, i1 false
br i1 %60, label %61, label %67
61: ; preds = %55
%62 = call i32 @write_data00_to_reg(i32 3)
%63 = call i32 @write_data16(i32 4)
%64 = call i32 @write_data16(i32 12594)
%65 = call i32 @write_data16(i32 13108)
%66 = call i32 @write_data00_to_reg(i32 99)
br label %138
67: ; preds = %55
%68 = icmp eq i8 %58, 52
%69 = select i1 %57, i1 %68, i1 false
br i1 %69, label %70, label %76
70: ; preds = %67
%71 = call i32 @write_data00_to_reg(i32 4)
%72 = call i32 @write_data16(i32 4)
%73 = call i32 @write_data16(i32 16706)
%74 = call i32 @write_data16(i32 17220)
%75 = call i32 @write_data00_to_reg(i32 100)
br label %138
76: ; preds = %67
%77 = icmp eq i8 %58, 105
%78 = select i1 %57, i1 %77, i1 false
br i1 %78, label %79, label %90
79: ; preds = %76
%80 = call i32 @write_data00_to_reg(i32 3)
%81 = call i32 @write_data16(i32 4)
%82 = call i32 @write_data16(i32 12594)
%83 = call i32 @write_data16(i32 13108)
%84 = call i32 @write_data00_to_reg(i32 99)
%85 = call i32 @write_data00_to_reg(i32 4)
%86 = call i32 @write_data16(i32 4)
%87 = call i32 @write_data16(i32 16706)
%88 = call i32 @write_data16(i32 17220)
%89 = call i32 @write_data00_to_reg(i32 100)
br label %138
90: ; preds = %76
%91 = icmp eq i8 %39, 115
%92 = select i1 %38, i1 %91, i1 false
br i1 %92, label %93, label %102
93: ; preds = %90
%94 = call i32 @write_data00_to_reg(i32 208)
%95 = call i32 (...) @read_data16()
%96 = call i32 @write_data00_to_reg(i32 209)
%97 = call i32 (...) @read_data16()
%98 = call i32 @write_data00_to_reg(i32 210)
%99 = call i32 (...) @read_data16()
%100 = call i32 @write_data00_to_reg(i32 211)
%101 = call i32 (...) @read_data16()
br label %138
102: ; preds = %90
%103 = icmp eq i8 %30, 114
%104 = icmp eq i8 %39, 0
%105 = select i1 %103, i1 %104, i1 false
br i1 %105, label %106, label %107
106: ; preds = %102
store i32 242, i32* %0
store i32 0, i32* %1
br label %141
107: ; preds = %102
%108 = icmp eq i8 %39, 101
%109 = select i1 %103, i1 %108, i1 false
%110 = icmp eq i8 %58, 97
%111 = select i1 %109, i1 %110, i1 false
br i1 %111, label %112, label %113
112: ; preds = %107
store i32 245, i32* %0
store i32 0, i32* %1
br label %141
113: ; preds = %107
%114 = load i32, i32* @stderr
%115 = call i32 (i32, i8*, ...) @fprintf(i32 %114, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %138
116: ; preds = %22
%117 = load i8, i8* %8
switch i8 %117, label %124 [
i8 119, label %118
i8 99, label %120
i8 114, label %122
]
118: ; preds = %116
store i32 241, i32* %0
store i32 0, i32* %1
%119 = load i32, i32* %5
br label %141
120: ; preds = %116
store i32 240, i32* %0
%121 = load i32, i32* %5
store i32 %121, i32* %1
br label %141
122: ; preds = %116
store i32 244, i32* %0
%123 = load i32, i32* %5
store i32 %123, i32* %1
br label %141
124: ; preds = %116
%125 = load i32, i32* @stderr
%126 = call i32 (i32, i8*, ...) @fprintf(i32 %125, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %138
127: ; preds = %22
%128 = load i8, i8* %8
switch i8 %128, label %135 [
i8 119, label %129
i8 114, label %132
]
129: ; preds = %127
store i32 243, i32* %0
%130 = load i32, i32* %5
store i32 %130, i32* %1
%131 = load i32, i32* %6
br label %141
132: ; preds = %127
%133 = load i32, i32* @stderr
%134 = call i32 (i32, i8*, ...) @fprintf(i32 %133, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.7, i64 0, i64 0))
br label %138
135: ; preds = %127
%136 = load i32, i32* @stderr
%137 = call i32 (i32, i8*, ...) @fprintf(i32 %136, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
br label %138
138: ; preds = %124, %22, %42, %61, %79, %113, %93, %70, %48, %31, %132, %135, %34
%139 = call i8* @rl_gets(i8* %11)
%140 = icmp eq i8* %139, null
br i1 %140, label %17, label %22
141: ; preds = %129, %118, %120, %122, %36, %106, %112
%142 = phi i32 [ %131, %129 ], [ %119, %118 ], [ 0, %120 ], [ 0, %122 ], [ 0, %36 ], [ 0, %106 ], [ 0, %112 ]
store i32 %142, i32* %2
ret void
}