#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*/ getsn(char *, int);
unsigned int htoi(char *);
int /*<<< orphan*/ memmap();
char peek3(unsigned int, unsigned int);
int /*<<< orphan*/ poke(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ putch(char);
int /*<<< orphan*/ puthex(unsigned int);
int /*<<< orphan*/ puthex_b(char);
int /*<<< orphan*/ puts0(char *);
char toupper(char);
void memd(void) {
  char c;
  int i;
  char Option = 'M';
  unsigned int segm, off;
  char cmd[256];
  segm = 0;
  off = 0;
  puts0("Use /? command for help\r\n");
  while (1) {
    puthex(segm);
    putch(':');
    puthex(off);
    putch(' ');
    {
      if (Option == 'A') {
        for (i = 0; i < 16; i++) {
          if ((c = peek3(segm, (off + i))) >= ' ')
            putch(c);
          else
            putch('.');
        }
      } else if (Option == 'M') {
        for (i = 0; i < 16; i++) {
          puthex_b(peek3(segm, (off + i)));
          putch(' ');
        }
        for (i = 0; i < 16; i++) {
          if ((c = peek3(segm, (off + i))) >= ' ')
            putch(c);
          else
            putch('.');
        }
      } else if (Option == 'H') {
        for (i = 0; i < 16; i++) {
          puthex_b(peek3(segm, (off + i)));
          putch(' ');
        }
      }
    }
    puts0("\r\n");
    putch(':');
    getsn(cmd, 256);
    i = 0;
    while (cmd[i])
      if (cmd[i] == '\r') {
        cmd[i] = 0;
        break;
      } else
        i++;
    if (cmd[0] == '/') {
      c = toupper(cmd[1]);
      {
        if (c == 'Q') {
          puts0("\r\n");
          return;
        } else if ((c == 'A') || (c == 'H') || (c == 'M'))
          Option = c;
        else if (c == 'S')
          segm = htoi(cmd + 2);
        else if (c == 'O')
          off = htoi(cmd + 2);
        else if (c == 'K')
          memmap();
        else if (c == 'Z')
          poke(htoi(cmd + 2), segm, off);
        else if (c == '?')
          puts0("Commands:\r\n/Q - Quit\r\n/A - Ascii mode\r\n/H - Hex "
                "mode\r\n/M - Mix (hex & ascii) mode\r\n/S<hex_value> - set "
                "Segment\r\n/O<hex_value> - set Offset\r\n/K - print memory "
                "map\r\nEnter - next string\r\n/Z<hex_value> - poke hex_value "
                "to memory\r\n");
        else
          puts0("Invalid command\r\n");
      }
      puts0("\r\n");
    } else if (!cmd[0]) {
      off = (off + 16);
    } else
      ;
  }
}


x86 assembly (clang, -O0):
<memd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movb   $0x4d,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe3c(%rip),%rdi
call   10a0 <puts0@plt>
mov    -0x10(%rbp),%edi
call   1080 <puthex@plt>
mov    $0x3a,%edi
call   10b0 <putch@plt>
mov    -0x14(%rbp),%edi
call   1080 <puthex@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
movsbl -0x9(%rbp),%eax
cmp    $0x41,%eax
jne    1258 <memd+0xb8>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    1253 <memd+0xb3>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
add    -0x8(%rbp),%esi
call   1050 <peek3@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
cmp    $0x20,%eax
jl     1236 <memd+0x96>
movsbl -0x1(%rbp),%edi
call   10b0 <putch@plt>
jmp    1240 <memd+0xa0>
mov    $0x2e,%edi
call   10b0 <putch@plt>
jmp    1245 <memd+0xa5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1201 <memd+0x61>
jmp    135d <memd+0x1bd>
movsbl -0x9(%rbp),%eax
cmp    $0x4d,%eax
jne    1302 <memd+0x162>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    12a4 <memd+0x104>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
add    -0x8(%rbp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    126c <memd+0xcc>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    12fd <memd+0x15d>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
add    -0x8(%rbp),%esi
call   1050 <peek3@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%eax
cmp    $0x20,%eax
jl     12e0 <memd+0x140>
movsbl -0x1(%rbp),%edi
call   10b0 <putch@plt>
jmp    12ea <memd+0x14a>
mov    $0x2e,%edi
call   10b0 <putch@plt>
jmp    12ef <memd+0x14f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12ab <memd+0x10b>
jmp    1358 <memd+0x1b8>
movsbl -0x9(%rbp),%eax
cmp    $0x48,%eax
jne    1353 <memd+0x1b3>
movl   $0x0,-0x8(%rbp)
cmpl   $0x10,-0x8(%rbp)
jge    134e <memd+0x1ae>
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
add    -0x8(%rbp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1316 <memd+0x176>
jmp    1353 <memd+0x1b3>
jmp    1358 <memd+0x1b8>
jmp    135d <memd+0x1bd>
lea    0xda8(%rip),%rdi
call   10a0 <puts0@plt>
mov    $0x3a,%edi
call   10b0 <putch@plt>
lea    -0x120(%rbp),%rdi
mov    $0x100,%esi
call   1030 <getsn@plt>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
cmpb   $0x0,-0x120(%rbp,%rax,1)
je     13d1 <memd+0x231>
movslq -0x8(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%eax
ff
cmp    $0xd,%eax
jne    13c3 <memd+0x223>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x120(%rbp,%rax,1)
jmp    13d1 <memd+0x231>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    138b <memd+0x1eb>
movsbl -0x120(%rbp),%eax
cmp    $0x2f,%eax
jne    152f <memd+0x38f>
movsbl -0x11f(%rbp),%edi
call   1070 <toupper@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x51,%eax
jne    1412 <memd+0x272>
lea    0xd08(%rip),%rdi
call   10a0 <puts0@plt>
add    $0x120,%rsp
pop    %rbp
ret
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
je     1439 <memd+0x299>
movsbl -0x1(%rbp),%eax
cmp    $0x48,%eax
je     1439 <memd+0x299>
movsbl -0x1(%rbp),%eax
cmp    $0x4d,%eax
jne    1444 <memd+0x2a4>
mov    -0x1(%rbp),%al
mov    %al,-0x9(%rbp)
jmp    1519 <memd+0x379>
movsbl -0x1(%rbp),%eax
cmp    $0x53,%eax
jne    1469 <memd+0x2c9>
lea    -0x120(%rbp),%rdi
add    $0x2,%rdi
call   1090 <htoi@plt>
mov    %eax,-0x10(%rbp)
jmp    1514 <memd+0x374>
movsbl -0x1(%rbp),%eax
cmp    $0x4f,%eax
jne    148e <memd+0x2ee>
lea    -0x120(%rbp),%rdi
add    $0x2,%rdi
call   1090 <htoi@plt>
mov    %eax,-0x14(%rbp)
jmp    150f <memd+0x36f>
movsbl -0x1(%rbp),%eax
cmp    $0x4b,%eax
jne    14a7 <memd+0x307>
mov    $0x0,%al
call   10c0 <memmap@plt>
jmp    150a <memd+0x36a>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
jne    14d6 <memd+0x336>
lea    -0x120(%rbp),%rdi
add    $0x2,%rdi
call   1090 <htoi@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <poke@plt>
jmp    1505 <memd+0x365>
movsbl -0x1(%rbp),%eax
cmp    $0x3f,%eax
jne    14f4 <memd+0x354>
lea    0xb30(%rip),%rdi
call   10a0 <puts0@plt>
jmp    1500 <memd+0x360>
lea    0xc02(%rip),%rdi
call   10a0 <puts0@plt>
jmp    1505 <memd+0x365>
jmp    150a <memd+0x36a>
jmp    150f <memd+0x36f>
jmp    1514 <memd+0x374>
jmp    1519 <memd+0x379>
jmp    151e <memd+0x37e>
lea    0xbe7(%rip),%rdi
call   10a0 <puts0@plt>
jmp    1554 <memd+0x3b4>
cmpb   $0x0,-0x120(%rbp)
jne    154a <memd+0x3aa>
mov    -0x14(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x14(%rbp)
jmp    154f <memd+0x3af>
jmp    154f <memd+0x3af>
jmp    1554 <memd+0x3b4>
jmp    11c9 <memd+0x29>

x86 assembly (clang, -O2):
<memd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
lea    0xeb8(%rip),%rdi
call   10a0 <puts0@plt>
mov    $0x4d,%r12b
mov    $0x2e,%r13d
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    11ea <memd+0x4a>
lea    0xf9a(%rip),%rdi
call   10a0 <puts0@plt>
mov    %r12d,%r14d
lea    0xf9a(%rip),%rdi
call   10a0 <puts0@plt>
mov    %r14d,%r12d
mov    %r12b,0x3(%rsp)
lea    0x1(%rbx),%eax
mov    %eax,0x34(%rsp)
lea    0x2(%rbx),%r15d
lea    0x3(%rbx),%r14d
lea    0x4(%rbx),%eax
mov    %eax,0x30(%rsp)
lea    0x5(%rbx),%eax
mov    %eax,0x2c(%rsp)
lea    0x6(%rbx),%eax
mov    %eax,0x28(%rsp)
lea    0x7(%rbx),%eax
mov    %eax,0x24(%rsp)
lea    0x8(%rbx),%eax
mov    %eax,0x20(%rsp)
lea    0x9(%rbx),%eax
mov    %eax,0x1c(%rsp)
lea    0xa(%rbx),%eax
mov    %eax,0x18(%rsp)
lea    0xb(%rbx),%eax
mov    %eax,0x14(%rsp)
lea    0xc(%rbx),%eax
mov    %eax,0x10(%rsp)
lea    0xd(%rbx),%eax
mov    %eax,0xc(%rsp)
lea    0xe(%rbx),%eax
mov    %eax,0x8(%rsp)
lea    0xf(%rbx),%eax
mov    %eax,0x4(%rsp)
mov    %rbx,0x38(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1080 <puthex@plt>
mov    $0x3a,%edi
call   10b0 <putch@plt>
mov    %ebx,%edi
call   1080 <puthex@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
cmp    $0x41,%r12b
je     1470 <memd+0x2d0>
cmp    $0x4d,%r12b
je     14f0 <memd+0x350>
cmp    $0x48,%r12b
jne    1888 <memd+0x6e8>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x34(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r15d,%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x30(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x2c(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x28(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x24(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x20(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x1c(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x18(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x14(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x10(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0xc(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x8(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x4(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
jmp    1883 <memd+0x6e3>
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x34(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r15d,%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x30(%rsp),%esi
jmp    173e <memd+0x59e>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x34(%rsp),%r12d
mov    %r12d,%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r15d,%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x30(%rsp),%ebx
mov    %ebx,%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x2c(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x28(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x24(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x20(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x1c(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x18(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x14(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x10(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0xc(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x8(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x4(%rsp),%esi
call   1050 <peek3@plt>
movsbl %al,%edi
call   1060 <puthex_b@plt>
mov    $0x20,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x38(%rsp),%rsi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r12d,%esi
mov    0x3(%rsp),%r12b
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r15d,%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    0x38(%rsp),%rbx
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x2c(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x28(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x24(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x20(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x1c(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x18(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x14(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x10(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0xc(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x8(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
mov    %ebp,%edi
mov    0x4(%rsp),%esi
call   1050 <peek3@plt>
cmp    $0x20,%al
movzbl %al,%eax
cmovl  %r13d,%eax
movsbl %al,%edi
call   10b0 <putch@plt>
lea    0x8ed(%rip),%rdi
call   10a0 <puts0@plt>
mov    $0x3a,%edi
call   10b0 <putch@plt>
lea    0x40(%rsp),%rdi
mov    $0x100,%esi
call   1030 <getsn@plt>
xor    %eax,%eax
nop
movzbl 0x40(%rsp,%rax,1),%ecx
test   %cl,%cl
je     18d7 <memd+0x737>
cmp    $0xd,%cl
je     18d0 <memd+0x730>
add    $0x1,%rax
jmp    18b0 <memd+0x710>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %eax,%eax
movb   $0x0,0x40(%rsp,%rax,1)
mov    0x40(%rsp),%al
test   %al,%al
je     18f0 <memd+0x750>
cmp    $0x2f,%al
jne    1260 <memd+0xc0>
jmp    1900 <memd+0x760>
nopl   0x0(%rax)
add    $0x10,%ebx
jmp    11ef <memd+0x4f>
nopl   0x0(%rax,%rax,1)
movsbl 0x41(%rsp),%edi
call   1070 <toupper@plt>
mov    %eax,%r14d
lea    -0x3f(%r14),%eax
cmp    $0x1b,%al
ja     11cc <memd+0x2c>
movzbl %al,%eax
lea    0x6dd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x757(%rip),%rdi
jmp    11d3 <memd+0x33>
xor    %eax,%eax
call   10c0 <memmap@plt>
jmp    11d8 <memd+0x38>
lea    0x42(%rsp),%rdi
call   1090 <htoi@plt>
mov    %eax,%ebx
jmp    11d8 <memd+0x38>
lea    0x42(%rsp),%rdi
call   1090 <htoi@plt>
mov    %eax,%ebp
jmp    11d8 <memd+0x38>
lea    0x42(%rsp),%rdi
call   1090 <htoi@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
call   1040 <poke@plt>
jmp    11d8 <memd+0x38>
lea    0x7f5(%rip),%rdi
call   10a0 <puts0@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Use /? command for help\0D\0A\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [227 x i8] c"Commands:\0D\0A/Q - Quit\0D\0A/A - Ascii mode\0D\0A/H - Hex mode\0D\0A/M - Mix (hex & ascii) mode\0D\0A/S<hex_value> - set Segment\0D\0A/O<hex_value> - set Offset\0D\0A/K - print memory map\0D\0AEnter - next string\0D\0A/Z<hex_value> - poke hex_value to memory\0D\0A\00"
@.str.3 = [18 x i8] c"Invalid command\0D\0A\00"
define void @memd() {
%1 = alloca i8
%2 = alloca i32
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca [256 x i8]
store i8 77, i8* %3
store i32 0, i32* %4
store i32 0, i32* %5
%7 = call i32 @puts0(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %0, %215
%9 = load i32, i32* %4
%10 = call i32 @puthex(i32 %9)
%11 = call i32 @putch(i8 signext 58)
%12 = load i32, i32* %5
%13 = call i32 @puthex(i32 %12)
%14 = call i32 @putch(i8 signext 32)
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 65
br i1 %17, label %18, label %40
18: ; preds = %8
store i32 0, i32* %2
br label %19
19: ; preds = %36, %18
%20 = load i32, i32* %2
%21 = icmp slt i32 %20, 16
br i1 %21, label %22, label %39
22: ; preds = %19
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = load i32, i32* %2
%26 = add i32 %24, %25
%27 = call signext i8 @peek3(i32 %23, i32 %26)
store i8 %27, i8* %1
%28 = sext i8 %27 to i32
%29 = icmp sge i32 %28, 32
br i1 %29, label %30, label %33
30: ; preds = %22
%31 = load i8, i8* %1
%32 = call i32 @putch(i8 signext %31)
br label %35
33: ; preds = %22
%34 = call i32 @putch(i8 signext 46)
br label %35
35: ; preds = %33, %30
br label %36
36: ; preds = %35
%37 = load i32, i32* %2
%38 = add nsw i32 %37, 1
store i32 %38, i32* %2
br label %19
39: ; preds = %19
br label %103
40: ; preds = %8
%41 = load i8, i8* %3
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 77
br i1 %43, label %44, label %81
44: ; preds = %40
store i32 0, i32* %2
br label %45
45: ; preds = %56, %44
%46 = load i32, i32* %2
%47 = icmp slt i32 %46, 16
br i1 %47, label %48, label %59
48: ; preds = %45
%49 = load i32, i32* %4
%50 = load i32, i32* %5
%51 = load i32, i32* %2
%52 = add i32 %50, %51
%53 = call signext i8 @peek3(i32 %49, i32 %52)
%54 = call i32 @puthex_b(i8 signext %53)
%55 = call i32 @putch(i8 signext 32)
br label %56
56: ; preds = %48
%57 = load i32, i32* %2
%58 = add nsw i32 %57, 1
store i32 %58, i32* %2
br label %45
59: ; preds = %45
store i32 0, i32* %2
br label %60
60: ; preds = %77, %59
%61 = load i32, i32* %2
%62 = icmp slt i32 %61, 16
br i1 %62, label %63, label %80
63: ; preds = %60
%64 = load i32, i32* %4
%65 = load i32, i32* %5
%66 = load i32, i32* %2
%67 = add i32 %65, %66
%68 = call signext i8 @peek3(i32 %64, i32 %67)
store i8 %68, i8* %1
%69 = sext i8 %68 to i32
%70 = icmp sge i32 %69, 32
br i1 %70, label %71, label %74
71: ; preds = %63
%72 = load i8, i8* %1
%73 = call i32 @putch(i8 signext %72)
br label %76
74: ; preds = %63
%75 = call i32 @putch(i8 signext 46)
br label %76
76: ; preds = %74, %71
br label %77
77: ; preds = %76
%78 = load i32, i32* %2
%79 = add nsw i32 %78, 1
store i32 %79, i32* %2
br label %60
80: ; preds = %60
br label %102
81: ; preds = %40
%82 = load i8, i8* %3
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 72
br i1 %84, label %85, label %101
85: ; preds = %81
store i32 0, i32* %2
br label %86
86: ; preds = %97, %85
%87 = load i32, i32* %2
%88 = icmp slt i32 %87, 16
br i1 %88, label %89, label %100
89: ; preds = %86
%90 = load i32, i32* %4
%91 = load i32, i32* %5
%92 = load i32, i32* %2
%93 = add i32 %91, %92
%94 = call signext i8 @peek3(i32 %90, i32 %93)
%95 = call i32 @puthex_b(i8 signext %94)
%96 = call i32 @putch(i8 signext 32)
br label %97
97: ; preds = %89
%98 = load i32, i32* %2
%99 = add nsw i32 %98, 1
store i32 %99, i32* %2
br label %86
100: ; preds = %86
br label %101
101: ; preds = %100, %81
br label %102
102: ; preds = %101, %80
br label %103
103: ; preds = %102, %39
%104 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%105 = call i32 @putch(i8 signext 58)
%106 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%107 = call i32 @getsn(i8* %106, i32 256)
store i32 0, i32* %2
br label %108
108: ; preds = %128, %103
%109 = load i32, i32* %2
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %110
%112 = load i8, i8* %111
%113 = icmp ne i8 %112, 0
br i1 %113, label %114, label %129
114: ; preds = %108
%115 = load i32, i32* %2
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %116
%118 = load i8, i8* %117
%119 = sext i8 %118 to i32
%120 = icmp eq i32 %119, 13
br i1 %120, label %121, label %125
121: ; preds = %114
%122 = load i32, i32* %2
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 %123
store i8 0, i8* %124
br label %129
125: ; preds = %114
%126 = load i32, i32* %2
%127 = add nsw i32 %126, 1
store i32 %127, i32* %2
br label %128
128: ; preds = %125
br label %108
129: ; preds = %121, %108
%130 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%131 = load i8, i8* %130
%132 = sext i8 %131 to i32
%133 = icmp eq i32 %132, 47
br i1 %133, label %134, label %206
134: ; preds = %129
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 1
%136 = load i8, i8* %135
%137 = call signext i8 @toupper(i8 signext %136)
store i8 %137, i8* %1
%138 = load i8, i8* %1
%139 = sext i8 %138 to i32
%140 = icmp eq i32 %139, 81
br i1 %140, label %141, label %143
141: ; preds = %134
%142 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
143: ; preds = %134
%144 = load i8, i8* %1
%145 = sext i8 %144 to i32
%146 = icmp eq i32 %145, 65
br i1 %146, label %155, label %147
147: ; preds = %143
%148 = load i8, i8* %1
%149 = sext i8 %148 to i32
%150 = icmp eq i32 %149, 72
br i1 %150, label %155, label %151
151: ; preds = %147
%152 = load i8, i8* %1
%153 = sext i8 %152 to i32
%154 = icmp eq i32 %153, 77
br i1 %154, label %155, label %157
155: ; preds = %151, %147, %143
%156 = load i8, i8* %1
store i8 %156, i8* %3
br label %203
157: ; preds = %151
%158 = load i8, i8* %1
%159 = sext i8 %158 to i32
%160 = icmp eq i32 %159, 83
br i1 %160, label %161, label %165
161: ; preds = %157
%162 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%163 = getelementptr inbounds i8, i8* %162, i64 2
%164 = call i32 @htoi(i8* %163)
store i32 %164, i32* %4
br label %202
165: ; preds = %157
%166 = load i8, i8* %1
%167 = sext i8 %166 to i32
%168 = icmp eq i32 %167, 79
br i1 %168, label %169, label %173
169: ; preds = %165
%170 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%171 = getelementptr inbounds i8, i8* %170, i64 2
%172 = call i32 @htoi(i8* %171)
store i32 %172, i32* %5
br label %201
173: ; preds = %165
%174 = load i8, i8* %1
%175 = sext i8 %174 to i32
%176 = icmp eq i32 %175, 75
br i1 %176, label %177, label %179
177: ; preds = %173
%178 = call i32 (...) @memmap()
br label %200
179: ; preds = %173
%180 = load i8, i8* %1
%181 = sext i8 %180 to i32
%182 = icmp eq i32 %181, 90
br i1 %182, label %183, label %190
183: ; preds = %179
%184 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%185 = getelementptr inbounds i8, i8* %184, i64 2
%186 = call i32 @htoi(i8* %185)
%187 = load i32, i32* %4
%188 = load i32, i32* %5
%189 = call i32 @poke(i32 %186, i32 %187, i32 %188)
br label %199
190: ; preds = %179
%191 = load i8, i8* %1
%192 = sext i8 %191 to i32
%193 = icmp eq i32 %192, 63
br i1 %193, label %194, label %196
194: ; preds = %190
%195 = call i32 @puts0(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str.2, i64 0, i64 0))
br label %198
196: ; preds = %190
%197 = call i32 @puts0(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %198
198: ; preds = %196, %194
br label %199
199: ; preds = %198, %183
br label %200
200: ; preds = %199, %177
br label %201
201: ; preds = %200, %169
br label %202
202: ; preds = %201, %161
br label %203
203: ; preds = %202, %155
br label %204
204: ; preds = %203
%205 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %215
206: ; preds = %129
%207 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%208 = load i8, i8* %207
%209 = icmp ne i8 %208, 0
br i1 %209, label %213, label %210
210: ; preds = %206
%211 = load i32, i32* %5
%212 = add i32 %211, 16
store i32 %212, i32* %5
br label %214
213: ; preds = %206
br label %214
214: ; preds = %213, %210
br label %215
215: ; preds = %214, %204
br label %8
}

LLVM IR (-O2):
@.str = [26 x i8] c"Use /? command for help\0D\0A\00"
@.str.1 = [3 x i8] c"\0D\0A\00"
@.str.2 = [227 x i8] c"Commands:\0D\0A/Q - Quit\0D\0A/A - Ascii mode\0D\0A/H - Hex mode\0D\0A/M - Mix (hex & ascii) mode\0D\0A/S<hex_value> - set Segment\0D\0A/O<hex_value> - set Offset\0D\0A/K - print memory map\0D\0AEnter - next string\0D\0A/Z<hex_value> - poke hex_value to memory\0D\0A\00"
@.str.3 = [18 x i8] c"Invalid command\0D\0A\00"
define void @memd() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts0(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 1
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 2
br label %6
6: ; preds = %337, %0
%7 = phi i8 [ %338, %337 ], [ 77, %0 ]
%8 = phi i32 [ %339, %337 ], [ 0, %0 ]
%9 = phi i32 [ %340, %337 ], [ 0, %0 ]
br label %10
10: ; preds = %6, %342
%11 = phi i32 [ %9, %6 ], [ %343, %342 ]
%12 = add i32 %11, 1
%13 = add i32 %11, 2
%14 = add i32 %11, 3
%15 = add i32 %11, 4
%16 = add i32 %11, 5
%17 = add i32 %11, 6
%18 = add i32 %11, 7
%19 = add i32 %11, 8
%20 = add i32 %11, 9
%21 = add i32 %11, 10
%22 = add i32 %11, 11
%23 = add i32 %11, 12
%24 = add i32 %11, 13
%25 = add i32 %11, 14
%26 = add i32 %11, 15
%27 = add i32 %11, 1
%28 = add i32 %11, 2
%29 = add i32 %11, 3
%30 = add i32 %11, 4
%31 = add i32 %11, 5
%32 = add i32 %11, 6
%33 = add i32 %11, 7
%34 = add i32 %11, 8
%35 = add i32 %11, 9
%36 = add i32 %11, 10
%37 = add i32 %11, 11
%38 = add i32 %11, 12
%39 = add i32 %11, 13
%40 = add i32 %11, 14
%41 = add i32 %11, 15
%42 = add i32 %11, 1
%43 = add i32 %11, 2
%44 = add i32 %11, 3
%45 = add i32 %11, 4
%46 = add i32 %11, 5
%47 = add i32 %11, 6
%48 = add i32 %11, 7
%49 = add i32 %11, 8
%50 = add i32 %11, 9
%51 = add i32 %11, 10
%52 = add i32 %11, 11
%53 = add i32 %11, 12
%54 = add i32 %11, 13
%55 = add i32 %11, 14
%56 = add i32 %11, 15
%57 = add i32 %11, 1
%58 = add i32 %11, 2
%59 = add i32 %11, 3
%60 = add i32 %11, 4
%61 = add i32 %11, 5
%62 = add i32 %11, 6
%63 = add i32 %11, 7
%64 = add i32 %11, 8
%65 = add i32 %11, 9
%66 = add i32 %11, 10
%67 = add i32 %11, 11
%68 = add i32 %11, 12
%69 = add i32 %11, 13
%70 = add i32 %11, 14
%71 = add i32 %11, 15
br label %72
72: ; preds = %10, %317
%73 = call i32 @puthex(i32 %8)
%74 = call i32 @putch(i8 signext 58)
%75 = call i32 @puthex(i32 %11)
%76 = call i32 @putch(i8 signext 32)
switch i8 %7, label %304 [
i8 65, label %239
i8 77, label %126
i8 72, label %77
]
77: ; preds = %72
%78 = call signext i8 @peek3(i32 %8, i32 %11)
%79 = call i32 @puthex_b(i8 signext %78)
%80 = call i32 @putch(i8 signext 32)
%81 = call signext i8 @peek3(i32 %8, i32 %12)
%82 = call i32 @puthex_b(i8 signext %81)
%83 = call i32 @putch(i8 signext 32)
%84 = call signext i8 @peek3(i32 %8, i32 %13)
%85 = call i32 @puthex_b(i8 signext %84)
%86 = call i32 @putch(i8 signext 32)
%87 = call signext i8 @peek3(i32 %8, i32 %14)
%88 = call i32 @puthex_b(i8 signext %87)
%89 = call i32 @putch(i8 signext 32)
%90 = call signext i8 @peek3(i32 %8, i32 %15)
%91 = call i32 @puthex_b(i8 signext %90)
%92 = call i32 @putch(i8 signext 32)
%93 = call signext i8 @peek3(i32 %8, i32 %16)
%94 = call i32 @puthex_b(i8 signext %93)
%95 = call i32 @putch(i8 signext 32)
%96 = call signext i8 @peek3(i32 %8, i32 %17)
%97 = call i32 @puthex_b(i8 signext %96)
%98 = call i32 @putch(i8 signext 32)
%99 = call signext i8 @peek3(i32 %8, i32 %18)
%100 = call i32 @puthex_b(i8 signext %99)
%101 = call i32 @putch(i8 signext 32)
%102 = call signext i8 @peek3(i32 %8, i32 %19)
%103 = call i32 @puthex_b(i8 signext %102)
%104 = call i32 @putch(i8 signext 32)
%105 = call signext i8 @peek3(i32 %8, i32 %20)
%106 = call i32 @puthex_b(i8 signext %105)
%107 = call i32 @putch(i8 signext 32)
%108 = call signext i8 @peek3(i32 %8, i32 %21)
%109 = call i32 @puthex_b(i8 signext %108)
%110 = call i32 @putch(i8 signext 32)
%111 = call signext i8 @peek3(i32 %8, i32 %22)
%112 = call i32 @puthex_b(i8 signext %111)
%113 = call i32 @putch(i8 signext 32)
%114 = call signext i8 @peek3(i32 %8, i32 %23)
%115 = call i32 @puthex_b(i8 signext %114)
%116 = call i32 @putch(i8 signext 32)
%117 = call signext i8 @peek3(i32 %8, i32 %24)
%118 = call i32 @puthex_b(i8 signext %117)
%119 = call i32 @putch(i8 signext 32)
%120 = call signext i8 @peek3(i32 %8, i32 %25)
%121 = call i32 @puthex_b(i8 signext %120)
%122 = call i32 @putch(i8 signext 32)
%123 = call signext i8 @peek3(i32 %8, i32 %26)
%124 = call i32 @puthex_b(i8 signext %123)
%125 = call i32 @putch(i8 signext 32)
br label %304
126: ; preds = %72
%127 = call signext i8 @peek3(i32 %8, i32 %11)
%128 = call i32 @puthex_b(i8 signext %127)
%129 = call i32 @putch(i8 signext 32)
%130 = call signext i8 @peek3(i32 %8, i32 %27)
%131 = call i32 @puthex_b(i8 signext %130)
%132 = call i32 @putch(i8 signext 32)
%133 = call signext i8 @peek3(i32 %8, i32 %28)
%134 = call i32 @puthex_b(i8 signext %133)
%135 = call i32 @putch(i8 signext 32)
%136 = call signext i8 @peek3(i32 %8, i32 %29)
%137 = call i32 @puthex_b(i8 signext %136)
%138 = call i32 @putch(i8 signext 32)
%139 = call signext i8 @peek3(i32 %8, i32 %30)
%140 = call i32 @puthex_b(i8 signext %139)
%141 = call i32 @putch(i8 signext 32)
%142 = call signext i8 @peek3(i32 %8, i32 %31)
%143 = call i32 @puthex_b(i8 signext %142)
%144 = call i32 @putch(i8 signext 32)
%145 = call signext i8 @peek3(i32 %8, i32 %32)
%146 = call i32 @puthex_b(i8 signext %145)
%147 = call i32 @putch(i8 signext 32)
%148 = call signext i8 @peek3(i32 %8, i32 %33)
%149 = call i32 @puthex_b(i8 signext %148)
%150 = call i32 @putch(i8 signext 32)
%151 = call signext i8 @peek3(i32 %8, i32 %34)
%152 = call i32 @puthex_b(i8 signext %151)
%153 = call i32 @putch(i8 signext 32)
%154 = call signext i8 @peek3(i32 %8, i32 %35)
%155 = call i32 @puthex_b(i8 signext %154)
%156 = call i32 @putch(i8 signext 32)
%157 = call signext i8 @peek3(i32 %8, i32 %36)
%158 = call i32 @puthex_b(i8 signext %157)
%159 = call i32 @putch(i8 signext 32)
%160 = call signext i8 @peek3(i32 %8, i32 %37)
%161 = call i32 @puthex_b(i8 signext %160)
%162 = call i32 @putch(i8 signext 32)
%163 = call signext i8 @peek3(i32 %8, i32 %38)
%164 = call i32 @puthex_b(i8 signext %163)
%165 = call i32 @putch(i8 signext 32)
%166 = call signext i8 @peek3(i32 %8, i32 %39)
%167 = call i32 @puthex_b(i8 signext %166)
%168 = call i32 @putch(i8 signext 32)
%169 = call signext i8 @peek3(i32 %8, i32 %40)
%170 = call i32 @puthex_b(i8 signext %169)
%171 = call i32 @putch(i8 signext 32)
%172 = call signext i8 @peek3(i32 %8, i32 %41)
%173 = call i32 @puthex_b(i8 signext %172)
%174 = call i32 @putch(i8 signext 32)
%175 = call signext i8 @peek3(i32 %8, i32 %11)
%176 = icmp sgt i8 %175, 31
%177 = select i1 %176, i8 %175, i8 46
%178 = call i32 @putch(i8 signext %177)
%179 = call signext i8 @peek3(i32 %8, i32 %42)
%180 = icmp sgt i8 %179, 31
%181 = select i1 %180, i8 %179, i8 46
%182 = call i32 @putch(i8 signext %181)
%183 = call signext i8 @peek3(i32 %8, i32 %43)
%184 = icmp sgt i8 %183, 31
%185 = select i1 %184, i8 %183, i8 46
%186 = call i32 @putch(i8 signext %185)
%187 = call signext i8 @peek3(i32 %8, i32 %44)
%188 = icmp sgt i8 %187, 31
%189 = select i1 %188, i8 %187, i8 46
%190 = call i32 @putch(i8 signext %189)
%191 = call signext i8 @peek3(i32 %8, i32 %45)
%192 = icmp sgt i8 %191, 31
%193 = select i1 %192, i8 %191, i8 46
%194 = call i32 @putch(i8 signext %193)
%195 = call signext i8 @peek3(i32 %8, i32 %46)
%196 = icmp sgt i8 %195, 31
%197 = select i1 %196, i8 %195, i8 46
%198 = call i32 @putch(i8 signext %197)
%199 = call signext i8 @peek3(i32 %8, i32 %47)
%200 = icmp sgt i8 %199, 31
%201 = select i1 %200, i8 %199, i8 46
%202 = call i32 @putch(i8 signext %201)
%203 = call signext i8 @peek3(i32 %8, i32 %48)
%204 = icmp sgt i8 %203, 31
%205 = select i1 %204, i8 %203, i8 46
%206 = call i32 @putch(i8 signext %205)
%207 = call signext i8 @peek3(i32 %8, i32 %49)
%208 = icmp sgt i8 %207, 31
%209 = select i1 %208, i8 %207, i8 46
%210 = call i32 @putch(i8 signext %209)
%211 = call signext i8 @peek3(i32 %8, i32 %50)
%212 = icmp sgt i8 %211, 31
%213 = select i1 %212, i8 %211, i8 46
%214 = call i32 @putch(i8 signext %213)
%215 = call signext i8 @peek3(i32 %8, i32 %51)
%216 = icmp sgt i8 %215, 31
%217 = select i1 %216, i8 %215, i8 46
%218 = call i32 @putch(i8 signext %217)
%219 = call signext i8 @peek3(i32 %8, i32 %52)
%220 = icmp sgt i8 %219, 31
%221 = select i1 %220, i8 %219, i8 46
%222 = call i32 @putch(i8 signext %221)
%223 = call signext i8 @peek3(i32 %8, i32 %53)
%224 = icmp sgt i8 %223, 31
%225 = select i1 %224, i8 %223, i8 46
%226 = call i32 @putch(i8 signext %225)
%227 = call signext i8 @peek3(i32 %8, i32 %54)
%228 = icmp sgt i8 %227, 31
%229 = select i1 %228, i8 %227, i8 46
%230 = call i32 @putch(i8 signext %229)
%231 = call signext i8 @peek3(i32 %8, i32 %55)
%232 = icmp sgt i8 %231, 31
%233 = select i1 %232, i8 %231, i8 46
%234 = call i32 @putch(i8 signext %233)
%235 = call signext i8 @peek3(i32 %8, i32 %56)
%236 = icmp sgt i8 %235, 31
%237 = select i1 %236, i8 %235, i8 46
%238 = call i32 @putch(i8 signext %237)
br label %304
239: ; preds = %72
%240 = call signext i8 @peek3(i32 %8, i32 %11)
%241 = icmp sgt i8 %240, 31
%242 = select i1 %241, i8 %240, i8 46
%243 = call i32 @putch(i8 signext %242)
%244 = call signext i8 @peek3(i32 %8, i32 %57)
%245 = icmp sgt i8 %244, 31
%246 = select i1 %245, i8 %244, i8 46
%247 = call i32 @putch(i8 signext %246)
%248 = call signext i8 @peek3(i32 %8, i32 %58)
%249 = icmp sgt i8 %248, 31
%250 = select i1 %249, i8 %248, i8 46
%251 = call i32 @putch(i8 signext %250)
%252 = call signext i8 @peek3(i32 %8, i32 %59)
%253 = icmp sgt i8 %252, 31
%254 = select i1 %253, i8 %252, i8 46
%255 = call i32 @putch(i8 signext %254)
%256 = call signext i8 @peek3(i32 %8, i32 %60)
%257 = icmp sgt i8 %256, 31
%258 = select i1 %257, i8 %256, i8 46
%259 = call i32 @putch(i8 signext %258)
%260 = call signext i8 @peek3(i32 %8, i32 %61)
%261 = icmp sgt i8 %260, 31
%262 = select i1 %261, i8 %260, i8 46
%263 = call i32 @putch(i8 signext %262)
%264 = call signext i8 @peek3(i32 %8, i32 %62)
%265 = icmp sgt i8 %264, 31
%266 = select i1 %265, i8 %264, i8 46
%267 = call i32 @putch(i8 signext %266)
%268 = call signext i8 @peek3(i32 %8, i32 %63)
%269 = icmp sgt i8 %268, 31
%270 = select i1 %269, i8 %268, i8 46
%271 = call i32 @putch(i8 signext %270)
%272 = call signext i8 @peek3(i32 %8, i32 %64)
%273 = icmp sgt i8 %272, 31
%274 = select i1 %273, i8 %272, i8 46
%275 = call i32 @putch(i8 signext %274)
%276 = call signext i8 @peek3(i32 %8, i32 %65)
%277 = icmp sgt i8 %276, 31
%278 = select i1 %277, i8 %276, i8 46
%279 = call i32 @putch(i8 signext %278)
%280 = call signext i8 @peek3(i32 %8, i32 %66)
%281 = icmp sgt i8 %280, 31
%282 = select i1 %281, i8 %280, i8 46
%283 = call i32 @putch(i8 signext %282)
%284 = call signext i8 @peek3(i32 %8, i32 %67)
%285 = icmp sgt i8 %284, 31
%286 = select i1 %285, i8 %284, i8 46
%287 = call i32 @putch(i8 signext %286)
%288 = call signext i8 @peek3(i32 %8, i32 %68)
%289 = icmp sgt i8 %288, 31
%290 = select i1 %289, i8 %288, i8 46
%291 = call i32 @putch(i8 signext %290)
%292 = call signext i8 @peek3(i32 %8, i32 %69)
%293 = icmp sgt i8 %292, 31
%294 = select i1 %293, i8 %292, i8 46
%295 = call i32 @putch(i8 signext %294)
%296 = call signext i8 @peek3(i32 %8, i32 %70)
%297 = icmp sgt i8 %296, 31
%298 = select i1 %297, i8 %296, i8 46
%299 = call i32 @putch(i8 signext %298)
%300 = call signext i8 @peek3(i32 %8, i32 %71)
%301 = icmp sgt i8 %300, 31
%302 = select i1 %301, i8 %300, i8 46
%303 = call i32 @putch(i8 signext %302)
br label %304
304: ; preds = %126, %239, %77, %72
%305 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%306 = call i32 @putch(i8 signext 58)
%307 = call i32 @getsn(i8* %2, i32 256)
br label %308
308: ; preds = %315, %304
%309 = phi i64 [ %316, %315 ], [ 0, %304 ]
%310 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %309
%311 = load i8, i8* %310
switch i8 %311, label %315 [
i8 0, label %317
i8 13, label %312
]
312: ; preds = %308
%313 = and i64 %309, 4294967295
%314 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 %313
store i8 0, i8* %314
br label %317
315: ; preds = %308
%316 = add nuw i64 %309, 1
br label %308
317: ; preds = %308, %312
%318 = load i8, i8* %2
switch i8 %318, label %72 [
i8 47, label %319
i8 0, label %342
]
319: ; preds = %317
%320 = load i8, i8* %4
%321 = call signext i8 @toupper(i8 signext %320)
switch i8 %321, label %335 [
i8 81, label %322
i8 77, label %337
i8 72, label %337
i8 65, label %337
i8 83, label %324
i8 79, label %326
i8 75, label %328
i8 90, label %330
i8 63, label %333
]
322: ; preds = %319
%323 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret void
324: ; preds = %319
%325 = call i32 @htoi(i8* %5)
br label %337
326: ; preds = %319
%327 = call i32 @htoi(i8* %5)
br label %337
328: ; preds = %319
%329 = call i32 (...) @memmap()
br label %337
330: ; preds = %319
%331 = call i32 @htoi(i8* %5)
%332 = call i32 @poke(i32 %331, i32 %8, i32 %11)
br label %337
333: ; preds = %319
%334 = call i32 @puts0(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str.2, i64 0, i64 0))
br label %337
335: ; preds = %319
%336 = call i32 @puts0(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
br label %337
337: ; preds = %319, %319, %319, %326, %330, %335, %333, %328, %324
%338 = phi i8 [ %7, %324 ], [ %7, %326 ], [ %7, %328 ], [ %7, %330 ], [ %7, %333 ], [ %7, %335 ], [ %321, %319 ], [ %321, %319 ], [ %321, %319 ]
%339 = phi i32 [ %325, %324 ], [ %8, %326 ], [ %8, %328 ], [ %8, %330 ], [ %8, %333 ], [ %8, %335 ], [ %8, %319 ], [ %8, %319 ], [ %8, %319 ]
%340 = phi i32 [ %11, %324 ], [ %327, %326 ], [ %11, %328 ], [ %11, %330 ], [ %11, %333 ], [ %11, %335 ], [ %11, %319 ], [ %11, %319 ], [ %11, %319 ]
%341 = call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %6
342: ; preds = %317
%343 = add i32 %11, 16
br label %10
}