#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 scalar_t__ uintmax_t;
typedef int uint8_t;

/* Variables and functions */
int EOF;
int /*<<< orphan*/ O_WRONLY;
int /*<<< orphan*/ SEEK_SET;
int close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int hex_digit_value(char);
int lseek(int, long, int /*<<< orphan*/);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int sscanf(char *, char *, scalar_t__ *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int strlen(char *);
int write(int, ...);
int main(int argc, char *argv[]) {
  if (argc < 5) {
    fprintf(stderr, "Usage: %s filename offset type data\n", argv[0]);
    fprintf(stderr, " - type can be: bytes | string\n");
    fprintf(stderr, "ex: %s /proc/1234/mem 8f000014 bytes 01 ff 02\n", argv[0]);
    return 2;
  }
  uintmax_t offset;
  int scanf_result = sscanf(argv[2], "%jx", &offset);
  if (scanf_result == 0 || scanf_result == EOF) {
    fprintf(stderr, "%s: invalid offset '%s'\n", argv[0], argv[2]);
    return 2;
  }
  enum { TYPE_BYTES, TYPE_STRING } datatype;
  if (!strcmp(argv[3], "b") || !strcmp(argv[3], "bytes")) {
    datatype = TYPE_BYTES;
  } else if (!strcmp(argv[3], "s") || !strcmp(argv[3], "str") ||
             !strcmp(argv[3], "string")) {
    datatype = TYPE_STRING;
  } else {
    fprintf(stderr, "%s: unknown type argument '%s'\n", argv[0], argv[3]);
    return 2;
  }
  int fd = open(argv[1], O_WRONLY);
  if (fd == -1) {
    perror(argv[1]);
    return 1;
  }
  if (lseek(fd, (long)offset, SEEK_SET) == -1) {
    close(fd);
    perror(argv[1]);
    return 1;
  }
  if (datatype == TYPE_BYTES) {
    size_t i;
    for (i = 4; i < argc; ++i) {
      char *ptr = argv[i];
      while (*ptr) {
        if (*ptr != ' ' && hex_digit_value(*ptr) == -1) {
          fprintf(stderr, "%s: invalid hex digit '%c'\n", argv[0], *ptr);
          close(fd);
          return 2;
        }
        ++ptr;
      }
    }
    i = 4;
    char *ptr = argv[i];
    while (i < argc) {
      int digit_num = 0;
      char *beginning = ptr;
      while (*ptr && *ptr != ' ') {
        digit_num ^= 1;
        ++ptr;
      }
      ptr = beginning;
      uint8_t byte = 0;
      while (*ptr && *ptr != ' ') {
        int value = hex_digit_value(*ptr);
        if (value != -1) {
          if (digit_num == 0) {
            byte = value << 4;
            digit_num = 1;
          } else {
            byte |= value;
            if (write(fd, &byte, 1) == -1) {
              close(fd);
              perror(argv[1]);
              return 1;
            }
            digit_num = 0;
          }
        }
        ++ptr;
      }
      if (*ptr == '\0')
        ptr = argv[++i];
      else
        ++ptr;
    }
  } else if (datatype == TYPE_STRING) {
    size_t i;
    for (i = 4; i < argc; ++i) {
      int error = 0;
      if (i > 4) {
        char space = ' ';
        error = (write(fd, &space, 1) == -1);
      }
      if (!error)
        error = (write(fd, argv[i], strlen(argv[i])) == -1);
      if (error) {
        close(fd);
        perror(argv[1]);
        return 1;
      }
    }
  }
  if (close(fd) == -1) {
    perror(argv[1]);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1222 <main+0x82>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe26(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2df0(%rip),%rax
mov    (%rax),%edi
lea    0xe34(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    0x2dd9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe36(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    177d <main+0x5dd>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe43(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   10a0 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1259 <main+0xb9>
mov    -0x1c(%rbp),%eax
mov    0x2d97(%rip),%rcx
cmp    (%rcx),%eax
jne    128b <main+0xeb>
mov    0x2d78(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xe00(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    177d <main+0x5dd>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdf7(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
je     12c5 <main+0x125>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xddc(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12d1 <main+0x131>
movl   $0x0,-0x20(%rbp)
jmp    136b <main+0x1cb>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdb7(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
je     1328 <main+0x188>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd9c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
je     1328 <main+0x188>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xd83(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1334 <main+0x194>
movl   $0x1,-0x20(%rbp)
jmp    1366 <main+0x1c6>
mov    0x2c9d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rcx
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    177d <main+0x5dd>
jmp    136b <main+0x1cb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2c46(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0xffffffff,-0x24(%rbp)
jne    13a7 <main+0x207>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5dd>
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    0x2c1b(%rip),%rax
mov    (%rax),%edx
call   1050 <lseek@plt>
cmp    $0xffffffff,%eax
jne    13e6 <main+0x246>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5dd>
cmpl   $0x0,-0x20(%rbp)
jne    1658 <main+0x4b8>
movq   $0x4,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    14ab <main+0x30b>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmpb   $0x0,(%rax)
je     1495 <main+0x2f5>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1484 <main+0x2e4>
mov    -0x38(%rbp),%rax
movsbl (%rax),%edi
call   1090 <hex_digit_value@plt>
cmp    $0xffffffff,%eax
jne    1484 <main+0x2e4>
mov    0x2b86(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x38(%rbp),%rax
movsbl (%rax),%ecx
lea    0xc5b(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
movl   $0x2,-0x4(%rbp)
jmp    177d <main+0x5dd>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1419 <main+0x279>
jmp    149a <main+0x2fa>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    13f8 <main+0x258>
movq   $0x4,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    1653 <main+0x4b3>
movl   $0x0,-0x44(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x66(%rbp)
je     1508 <main+0x368>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x66(%rbp)
mov    -0x66(%rbp),%al
test   $0x1,%al
jne    1518 <main+0x378>
jmp    1532 <main+0x392>
mov    -0x44(%rbp),%eax
xor    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    14e3 <main+0x343>
mov    -0x50(%rbp),%rax
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x67(%rbp)
je     1566 <main+0x3c6>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x67(%rbp)
mov    -0x67(%rbp),%al
test   $0x1,%al
jne    1576 <main+0x3d6>
jmp    1611 <main+0x471>
mov    -0x40(%rbp),%rax
movsbl (%rax),%edi
call   1090 <hex_digit_value@plt>
mov    %eax,-0x58(%rbp)
cmpl   $0xffffffff,-0x58(%rbp)
je     1600 <main+0x460>
cmpl   $0x0,-0x44(%rbp)
jne    15ae <main+0x40e>
mov    -0x58(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x54(%rbp)
movl   $0x1,-0x44(%rbp)
jmp    15fb <main+0x45b>
mov    -0x58(%rbp),%eax
or     -0x54(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x54(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    15f4 <main+0x454>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5dd>
movl   $0x0,-0x44(%rbp)
jmp    1600 <main+0x460>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1541 <main+0x3a1>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1642 <main+0x4a2>
mov    -0x10(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x30(%rbp)
mov    0x8(%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
jmp    164e <main+0x4ae>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    14c3 <main+0x323>
jmp    174c <main+0x5ac>
cmpl   $0x1,-0x20(%rbp)
jne    1747 <main+0x5a7>
movq   $0x4,-0x60(%rbp)
mov    -0x60(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    1742 <main+0x5a2>
movl   $0x0,-0x64(%rbp)
cmpq   $0x4,-0x60(%rbp)
jbe    16b2 <main+0x512>
movb   $0x20,-0x65(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x65(%rbp),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
jne    1701 <main+0x561>
mov    -0x24(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x60(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <strlen@plt>
mov    -0x74(%rbp),%edi
mov    -0x70(%rbp),%rsi
mov    %eax,%edx
mov    $0x0,%al
call   1030 <write@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x64(%rbp)
cmpl   $0x0,-0x64(%rbp)
je     172c <main+0x58c>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5dd>
jmp    1731 <main+0x591>
mov    -0x60(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x60(%rbp)
jmp    166a <main+0x4ca>
jmp    1747 <main+0x5a7>
jmp    174c <main+0x5ac>
mov    -0x24(%rbp),%edi
call   1060 <close@plt>
cmp    $0xffffffff,%eax
jne    1776 <main+0x5d6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10c0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    177d <main+0x5dd>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r15
cmp    $0x4,%edi
jg     11f8 <main+0x58>
mov    0x2e1b(%rip),%rbx
mov    (%rbx),%edi
mov    (%r15),%rdx
lea    0xe37(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
lea    0xe4c(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r15),%rdx
lea    0xe59(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    13ff <main+0x25f>
mov    %edi,%r14d
mov    0x10(%r15),%rdi
lea    0xe6e(%rip),%rsi
lea    0x10(%rsp),%rdx
call   10a0 <sscanf@plt>
test   %eax,%eax
je     12a8 <main+0x108>
mov    0x2dc9(%rip),%rcx
cmp    (%rcx),%eax
je     12a8 <main+0x108>
mov    0x18(%r15),%rbp
lea    0xe5f(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
mov    $0x1,%bl
test   %eax,%eax
je     12cd <main+0x12d>
lea    0xe48(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12cd <main+0x12d>
lea    0xe39(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12cb <main+0x12b>
lea    0xe28(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12cb <main+0x12b>
lea    0xe19(%rip),%rsi
mov    %rbp,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12cb <main+0x12b>
mov    0x2d41(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
lea    0xe01(%rip),%rsi
mov    %rbp,%rcx
jmp    12bf <main+0x11f>
mov    0x2d29(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
mov    0x10(%r15),%rcx
lea    0xdb9(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    13ff <main+0x25f>
xor    %ebx,%ebx
mov    0x8(%r15),%rdi
mov    0x2ce8(%rip),%rax
mov    (%rax),%esi
call   10b0 <open@plt>
cmp    $0xffffffff,%eax
je     14a7 <main+0x307>
mov    %eax,%r13d
mov    0x10(%rsp),%rsi
mov    0x2cd9(%rip),%rax
mov    (%rax),%edx
mov    %r13d,%edi
call   1050 <lseek@plt>
cmp    $0xffffffff,%eax
je     149f <main+0x2ff>
mov    %r14d,%r12d
test   %bl,%bl
je     1359 <main+0x1b9>
mov    $0x4,%ebx
mov    (%r15,%rbx,8),%rbp
jmp    1324 <main+0x184>
nopl   0x0(%rax)
add    $0x1,%rbp
movzbl 0x0(%rbp),%eax
cmp    $0x20,%al
je     1320 <main+0x180>
test   %al,%al
je     1342 <main+0x1a2>
movsbl %al,%edi
call   1090 <hex_digit_value@plt>
cmp    $0xffffffff,%eax
jne    1320 <main+0x180>
jmp    13d9 <main+0x239>
add    $0x1,%rbx
cmp    %r12,%rbx
jne    1316 <main+0x176>
mov    0x20(%r15),%rbx
mov    $0x4,%ebp
jmp    1421 <main+0x281>
mov    $0x4,%ebp
lea    0xb(%rsp),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x5,%rbp
jb     1396 <main+0x1f6>
movb   $0x20,0xb(%rsp)
mov    %r13d,%edi
mov    %r14,%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     149f <main+0x2ff>
mov    (%r15,%rbp,8),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r13d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
je     149f <main+0x2ff>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1370 <main+0x1d0>
mov    %r13d,%edi
call   1060 <close@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
jne    1404 <main+0x264>
jmp    14a7 <main+0x307>
mov    0x2bf8(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
movsbl 0x0(%rbp),%ecx
lea    0xcd4(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r13d,%edi
call   1060 <close@plt>
mov    $0x2,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%r15,%rbp,8),%rbx
add    $0x1,%rbp
cmp    %r12,%rbp
jae    13c3 <main+0x223>
xor    %r14d,%r14d
mov    %rbx,%rax
testb  $0xdf,(%rax)
je     143d <main+0x29d>
nopl   0x0(%rax)
xor    $0x1,%r14d
add    $0x1,%rax
testb  $0xdf,(%rax)
jne    1430 <main+0x290>
movl   $0x0,0xc(%rsp)
jmp    145d <main+0x2bd>
nopw   0x0(%rax,%rax,1)
shl    $0x4,%eax
mov    %eax,0xc(%rsp)
mov    $0x1,%r14d
add    $0x1,%rbx
movzbl -0x1(%rbx),%eax
test   %al,%al
je     1413 <main+0x273>
cmp    $0x20,%al
je     141c <main+0x27c>
movsbl %al,%edi
call   1090 <hex_digit_value@plt>
cmp    $0xffffffff,%eax
je     145d <main+0x2bd>
test   %r14d,%r14d
je     1450 <main+0x2b0>
or     %eax,0xc(%rsp)
xor    %r14d,%r14d
mov    %r13d,%edi
lea    0xc(%rsp),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1030 <write@plt>
cmp    $0xffffffff,%eax
jne    145d <main+0x2bd>
mov    %r13d,%edi
call   1060 <close@plt>
mov    0x8(%r15),%rdi
call   10c0 <perror@plt>
mov    $0x1,%eax
jmp    1404 <main+0x264>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s filename offset type data\0A\00"
@.str.1 = [32 x i8] c" - type can be: bytes | string\0A\00"
@.str.2 = [47 x i8] c"ex: %s /proc/1234/mem 8f000014 bytes 01 ff 02\0A\00"
@.str.3 = [4 x i8] c"%jx\00"
@EOF = global i32 0
@.str.4 = [25 x i8] c"%s: invalid offset '%s'\0A\00"
@.str.5 = [2 x i8] c"b\00"
@.str.6 = [6 x i8] c"bytes\00"
@.str.7 = [2 x i8] c"s\00"
@.str.8 = [4 x i8] c"str\00"
@.str.9 = [7 x i8] c"string\00"
@.str.10 = [32 x i8] c"%s: unknown type argument '%s'\0A\00"
@O_WRONLY = global i32 0
@SEEK_SET = global i32 0
@.str.11 = [28 x i8] c"%s: invalid hex digit '%c'\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i64
%18 = alloca i32
%19 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 5
br i1 %21, label %22, label %35
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 0
%26 = load i8*, i8** %25
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 0
%33 = load i8*, i8** %32
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %33)
store i32 2, i32* %3
br label %319
35: ; preds = %2
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 2
%38 = load i8*, i8** %37
%39 = call i32 @sscanf(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64* %6)
store i32 %39, i32* %7
%40 = load i32, i32* %7
%41 = icmp eq i32 %40, 0
br i1 %41, label %46, label %42
42: ; preds = %35
%43 = load i32, i32* %7
%44 = load i32, i32* @EOF
%45 = icmp eq i32 %43, %44
br i1 %45, label %46, label %55
46: ; preds = %42, %35
%47 = load i32, i32* @stderr
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 0
%50 = load i8*, i8** %49
%51 = load i8**, i8*** %5
%52 = getelementptr inbounds i8*, i8** %51, i64 2
%53 = load i8*, i8** %52
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i8* %50, i8* %53)
store i32 2, i32* %3
br label %319
55: ; preds = %42
%56 = load i8**, i8*** %5
%57 = getelementptr inbounds i8*, i8** %56, i64 3
%58 = load i8*, i8** %57
%59 = call i32 @strcmp(i8* %58, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %67
61: ; preds = %55
%62 = load i8**, i8*** %5
%63 = getelementptr inbounds i8*, i8** %62, i64 3
%64 = load i8*, i8** %63
%65 = call i32 @strcmp(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%66 = icmp ne i32 %65, 0
br i1 %66, label %68, label %67
67: ; preds = %61, %55
store i32 0, i32* %8
br label %97
68: ; preds = %61
%69 = load i8**, i8*** %5
%70 = getelementptr inbounds i8*, i8** %69, i64 3
%71 = load i8*, i8** %70
%72 = call i32 @strcmp(i8* %71, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%73 = icmp ne i32 %72, 0
br i1 %73, label %74, label %86
74: ; preds = %68
%75 = load i8**, i8*** %5
%76 = getelementptr inbounds i8*, i8** %75, i64 3
%77 = load i8*, i8** %76
%78 = call i32 @strcmp(i8* %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %86
80: ; preds = %74
%81 = load i8**, i8*** %5
%82 = getelementptr inbounds i8*, i8** %81, i64 3
%83 = load i8*, i8** %82
%84 = call i32 @strcmp(i8* %83, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%85 = icmp ne i32 %84, 0
br i1 %85, label %87, label %86
86: ; preds = %80, %74, %68
store i32 1, i32* %8
br label %96
87: ; preds = %80
%88 = load i32, i32* @stderr
%89 = load i8**, i8*** %5
%90 = getelementptr inbounds i8*, i8** %89, i64 0
%91 = load i8*, i8** %90
%92 = load i8**, i8*** %5
%93 = getelementptr inbounds i8*, i8** %92, i64 3
%94 = load i8*, i8** %93
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i8* %91, i8* %94)
store i32 2, i32* %3
br label %319
96: ; preds = %86
br label %97
97: ; preds = %96, %67
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 1
%100 = load i8*, i8** %99
%101 = load i32, i32* @O_WRONLY
%102 = call i32 @open(i8* %100, i32 %101)
store i32 %102, i32* %9
%103 = load i32, i32* %9
%104 = icmp eq i32 %103, -1
br i1 %104, label %105, label %110
105: ; preds = %97
%106 = load i8**, i8*** %5
%107 = getelementptr inbounds i8*, i8** %106, i64 1
%108 = load i8*, i8** %107
%109 = call i32 @perror(i8* %108)
store i32 1, i32* %3
br label %319
110: ; preds = %97
%111 = load i32, i32* %9
%112 = load i64, i64* %6
%113 = load i32, i32* @SEEK_SET
%114 = call i32 @lseek(i32 %111, i64 %112, i32 %113)
%115 = icmp eq i32 %114, -1
br i1 %115, label %116, label %123
116: ; preds = %110
%117 = load i32, i32* %9
%118 = call i32 @close(i32 %117)
%119 = load i8**, i8*** %5
%120 = getelementptr inbounds i8*, i8** %119, i64 1
%121 = load i8*, i8** %120
%122 = call i32 @perror(i8* %121)
store i32 1, i32* %3
br label %319
123: ; preds = %110
%124 = load i32, i32* %8
%125 = icmp eq i32 %124, 0
br i1 %125, label %126, label %259
126: ; preds = %123
store i64 4, i64* %10
br label %127
127: ; preds = %166, %126
%128 = load i64, i64* %10
%129 = load i32, i32* %4
%130 = sext i32 %129 to i64
%131 = icmp ult i64 %128, %130
br i1 %131, label %132, label %169
132: ; preds = %127
%133 = load i8**, i8*** %5
%134 = load i64, i64* %10
%135 = getelementptr inbounds i8*, i8** %133, i64 %134
%136 = load i8*, i8** %135
store i8* %136, i8** %11
br label %137
137: ; preds = %162, %132
%138 = load i8*, i8** %11
%139 = load i8, i8* %138
%140 = icmp ne i8 %139, 0
br i1 %140, label %141, label %165
141: ; preds = %137
%142 = load i8*, i8** %11
%143 = load i8, i8* %142
%144 = sext i8 %143 to i32
%145 = icmp ne i32 %144, 32
br i1 %145, label %146, label %162
146: ; preds = %141
%147 = load i8*, i8** %11
%148 = load i8, i8* %147
%149 = call i32 @hex_digit_value(i8 signext %148)
%150 = icmp eq i32 %149, -1
br i1 %150, label %151, label %162
151: ; preds = %146
%152 = load i32, i32* @stderr
%153 = load i8**, i8*** %5
%154 = getelementptr inbounds i8*, i8** %153, i64 0
%155 = load i8*, i8** %154
%156 = load i8*, i8** %11
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
%159 = call i32 (i32, i8*, ...) @fprintf(i32 %152, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i8* %155, i32 %158)
%160 = load i32, i32* %9
%161 = call i32 @close(i32 %160)
store i32 2, i32* %3
br label %319
162: ; preds = %146, %141
%163 = load i8*, i8** %11
%164 = getelementptr inbounds i8, i8* %163, i32 1
store i8* %164, i8** %11
br label %137
165: ; preds = %137
br label %166
166: ; preds = %165
%167 = load i64, i64* %10
%168 = add i64 %167, 1
store i64 %168, i64* %10
br label %127
169: ; preds = %127
store i64 4, i64* %10
%170 = load i8**, i8*** %5
%171 = load i64, i64* %10
%172 = getelementptr inbounds i8*, i8** %170, i64 %171
%173 = load i8*, i8** %172
store i8* %173, i8** %12
br label %174
174: ; preds = %257, %169
%175 = load i64, i64* %10
%176 = load i32, i32* %4
%177 = sext i32 %176 to i64
%178 = icmp ult i64 %175, %177
br i1 %178, label %179, label %258
179: ; preds = %174
store i32 0, i32* %13
%180 = load i8*, i8** %12
store i8* %180, i8** %14
br label %181
181: ; preds = %193, %179
%182 = load i8*, i8** %12
%183 = load i8, i8* %182
%184 = sext i8 %183 to i32
%185 = icmp ne i32 %184, 0
br i1 %185, label %186, label %191
186: ; preds = %181
%187 = load i8*, i8** %12
%188 = load i8, i8* %187
%189 = sext i8 %188 to i32
%190 = icmp ne i32 %189, 32
br label %191
191: ; preds = %186, %181
%192 = phi i1 [ false, %181 ], [ %190, %186 ]
br i1 %192, label %193, label %198
193: ; preds = %191
%194 = load i32, i32* %13
%195 = xor i32 %194, 1
store i32 %195, i32* %13
%196 = load i8*, i8** %12
%197 = getelementptr inbounds i8, i8* %196, i32 1
store i8* %197, i8** %12
br label %181
198: ; preds = %191
%199 = load i8*, i8** %14
store i8* %199, i8** %12
store i32 0, i32* %15
br label %200
200: ; preds = %240, %198
%201 = load i8*, i8** %12
%202 = load i8, i8* %201
%203 = sext i8 %202 to i32
%204 = icmp ne i32 %203, 0
br i1 %204, label %205, label %210
205: ; preds = %200
%206 = load i8*, i8** %12
%207 = load i8, i8* %206
%208 = sext i8 %207 to i32
%209 = icmp ne i32 %208, 32
br label %210
210: ; preds = %205, %200
%211 = phi i1 [ false, %200 ], [ %209, %205 ]
br i1 %211, label %212, label %243
212: ; preds = %210
%213 = load i8*, i8** %12
%214 = load i8, i8* %213
%215 = call i32 @hex_digit_value(i8 signext %214)
store i32 %215, i32* %16
%216 = load i32, i32* %16
%217 = icmp ne i32 %216, -1
br i1 %217, label %218, label %240
218: ; preds = %212
%219 = load i32, i32* %13
%220 = icmp eq i32 %219, 0
br i1 %220, label %221, label %224
221: ; preds = %218
%222 = load i32, i32* %16
%223 = shl i32 %222, 4
store i32 %223, i32* %15
store i32 1, i32* %13
br label %239
224: ; preds = %218
%225 = load i32, i32* %16
%226 = load i32, i32* %15
%227 = or i32 %226, %225
store i32 %227, i32* %15
%228 = load i32, i32* %9
%229 = call i32 (i32, ...) @write(i32 %228, i32* %15, i32 1)
%230 = icmp eq i32 %229, -1
br i1 %230, label %231, label %238
231: ; preds = %224
%232 = load i32, i32* %9
%233 = call i32 @close(i32 %232)
%234 = load i8**, i8*** %5
%235 = getelementptr inbounds i8*, i8** %234, i64 1
%236 = load i8*, i8** %235
%237 = call i32 @perror(i8* %236)
store i32 1, i32* %3
br label %319
238: ; preds = %224
store i32 0, i32* %13
br label %239
239: ; preds = %238, %221
br label %240
240: ; preds = %239, %212
%241 = load i8*, i8** %12
%242 = getelementptr inbounds i8, i8* %241, i32 1
store i8* %242, i8** %12
br label %200
243: ; preds = %210
%244 = load i8*, i8** %12
%245 = load i8, i8* %244
%246 = sext i8 %245 to i32
%247 = icmp eq i32 %246, 0
br i1 %247, label %248, label %254
248: ; preds = %243
%249 = load i8**, i8*** %5
%250 = load i64, i64* %10
%251 = add i64 %250, 1
store i64 %251, i64* %10
%252 = getelementptr inbounds i8*, i8** %249, i64 %251
%253 = load i8*, i8** %252
store i8* %253, i8** %12
br label %257
254: ; preds = %243
%255 = load i8*, i8** %12
%256 = getelementptr inbounds i8, i8* %255, i32 1
store i8* %256, i8** %12
br label %257
257: ; preds = %254, %248
br label %174
258: ; preds = %174
br label %309
259: ; preds = %123
%260 = load i32, i32* %8
%261 = icmp eq i32 %260, 1
br i1 %261, label %262, label %308
262: ; preds = %259
store i64 4, i64* %17
br label %263
263: ; preds = %304, %262
%264 = load i64, i64* %17
%265 = load i32, i32* %4
%266 = sext i32 %265 to i64
%267 = icmp ult i64 %264, %266
br i1 %267, label %268, label %307
268: ; preds = %263
store i32 0, i32* %18
%269 = load i64, i64* %17
%270 = icmp ugt i64 %269, 4
br i1 %270, label %271, label %276
271: ; preds = %268
store i8 32, i8* %19
%272 = load i32, i32* %9
%273 = call i32 (i32, ...) @write(i32 %272, i8* %19, i32 1)
%274 = icmp eq i32 %273, -1
%275 = zext i1 %274 to i32
store i32 %275, i32* %18
br label %276
276: ; preds = %271, %268
%277 = load i32, i32* %18
%278 = icmp ne i32 %277, 0
br i1 %278, label %293, label %279
279: ; preds = %276
%280 = load i32, i32* %9
%281 = load i8**, i8*** %5
%282 = load i64, i64* %17
%283 = getelementptr inbounds i8*, i8** %281, i64 %282
%284 = load i8*, i8** %283
%285 = load i8**, i8*** %5
%286 = load i64, i64* %17
%287 = getelementptr inbounds i8*, i8** %285, i64 %286
%288 = load i8*, i8** %287
%289 = call i32 @strlen(i8* %288)
%290 = call i32 (i32, ...) @write(i32 %280, i8* %284, i32 %289)
%291 = icmp eq i32 %290, -1
%292 = zext i1 %291 to i32
store i32 %292, i32* %18
br label %293
293: ; preds = %279, %276
%294 = load i32, i32* %18
%295 = icmp ne i32 %294, 0
br i1 %295, label %296, label %303
296: ; preds = %293
%297 = load i32, i32* %9
%298 = call i32 @close(i32 %297)
%299 = load i8**, i8*** %5
%300 = getelementptr inbounds i8*, i8** %299, i64 1
%301 = load i8*, i8** %300
%302 = call i32 @perror(i8* %301)
store i32 1, i32* %3
br label %319
303: ; preds = %293
br label %304
304: ; preds = %303
%305 = load i64, i64* %17
%306 = add i64 %305, 1
store i64 %306, i64* %17
br label %263
307: ; preds = %263
br label %308
308: ; preds = %307, %259
br label %309
309: ; preds = %308, %258
%310 = load i32, i32* %9
%311 = call i32 @close(i32 %310)
%312 = icmp eq i32 %311, -1
br i1 %312, label %313, label %318
313: ; preds = %309
%314 = load i8**, i8*** %5
%315 = getelementptr inbounds i8*, i8** %314, i64 1
%316 = load i8*, i8** %315
%317 = call i32 @perror(i8* %316)
store i32 1, i32* %3
br label %319
318: ; preds = %309
store i32 0, i32* %3
br label %319
319: ; preds = %318, %313, %296, %231, %151, %116, %105, %87, %46, %22
%320 = load i32, i32* %3
ret i32 %320
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Usage: %s filename offset type data\0A\00"
@.str.1 = [32 x i8] c" - type can be: bytes | string\0A\00"
@.str.2 = [47 x i8] c"ex: %s /proc/1234/mem 8f000014 bytes 01 ff 02\0A\00"
@.str.3 = [4 x i8] c"%jx\00"
@EOF = global i32 0
@.str.4 = [25 x i8] c"%s: invalid offset '%s'\0A\00"
@.str.5 = [2 x i8] c"b\00"
@.str.6 = [6 x i8] c"bytes\00"
@.str.7 = [2 x i8] c"s\00"
@.str.8 = [4 x i8] c"str\00"
@.str.9 = [7 x i8] c"string\00"
@.str.10 = [32 x i8] c"%s: unknown type argument '%s'\0A\00"
@O_WRONLY = global i32 0
@SEEK_SET = global i32 0
@.str.11 = [28 x i8] c"%s: invalid hex digit '%c'\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i8
%6 = icmp slt i32 %0, 5
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = load i32, i32* @stderr
%9 = load i8*, i8** %1
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %1
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* %14)
br label %169
16: ; preds = %2
%17 = bitcast i64* %3 to i8*
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @sscanf(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64* %3)
%21 = icmp eq i32 %20, 0
%22 = load i32, i32* @EOF
%23 = icmp eq i32 %20, %22
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %25, label %30
25: ; preds = %16
%26 = load i32, i32* @stderr
%27 = load i8*, i8** %1
%28 = load i8*, i8** %18
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i8* %27, i8* %28)
br label %167
30: ; preds = %16
%31 = getelementptr inbounds i8*, i8** %1, i64 3
%32 = load i8*, i8** %31
%33 = call i32 @strcmp(i8* dereferenceable(1) %32, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %51, label %35
35: ; preds = %30
%36 = call i32 @strcmp(i8* dereferenceable(1) %32, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
%37 = icmp eq i32 %36, 0
br i1 %37, label %51, label %38
38: ; preds = %35
%39 = call i32 @strcmp(i8* dereferenceable(1) %32, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %51, label %41
41: ; preds = %38
%42 = call i32 @strcmp(i8* dereferenceable(1) %32, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%43 = icmp eq i32 %42, 0
br i1 %43, label %51, label %44
44: ; preds = %41
%45 = call i32 @strcmp(i8* dereferenceable(1) %32, i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%46 = icmp eq i32 %45, 0
br i1 %46, label %51, label %47
47: ; preds = %44
%48 = load i32, i32* @stderr
%49 = load i8*, i8** %1
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.10, i64 0, i64 0), i8* %49, i8* %32)
br label %167
51: ; preds = %38, %41, %44, %30, %35
%52 = phi i1 [ true, %35 ], [ true, %30 ], [ false, %44 ], [ false, %41 ], [ false, %38 ]
%53 = getelementptr inbounds i8*, i8** %1, i64 1
%54 = load i8*, i8** %53
%55 = load i32, i32* @O_WRONLY
%56 = call i32 @open(i8* %54, i32 %55)
%57 = icmp eq i32 %56, -1
br i1 %57, label %58, label %61
58: ; preds = %51
%59 = load i8*, i8** %53
%60 = call i32 @perror(i8* %59)
br label %167
61: ; preds = %51
%62 = load i64, i64* %3
%63 = load i32, i32* @SEEK_SET
%64 = call i32 @lseek(i32 %56, i64 %62, i32 %63)
%65 = icmp eq i32 %64, -1
br i1 %65, label %66, label %70
66: ; preds = %61
%67 = call i32 @close(i32 %56)
%68 = load i8*, i8** %53
%69 = call i32 @perror(i8* %68)
br label %167
70: ; preds = %61
%71 = zext i32 %0 to i64
br i1 %52, label %72, label %144
72: ; preds = %70, %91
%73 = phi i64 [ %92, %91 ], [ 4, %70 ]
%74 = getelementptr inbounds i8*, i8** %1, i64 %73
%75 = load i8*, i8** %74
br label %76
76: ; preds = %82, %72
%77 = phi i8* [ %75, %72 ], [ %83, %82 ]
%78 = load i8, i8* %77
switch i8 %78, label %79 [
i8 0, label %91
i8 32, label %82
]
79: ; preds = %76
%80 = call i32 @hex_digit_value(i8 signext %78)
%81 = icmp eq i32 %80, -1
br i1 %81, label %84, label %82
82: ; preds = %76, %79
%83 = getelementptr inbounds i8, i8* %77, i64 1
br label %76
84: ; preds = %79
%85 = load i32, i32* @stderr
%86 = load i8*, i8** %1
%87 = load i8, i8* %77
%88 = sext i8 %87 to i32
%89 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i8* %86, i32 %88)
%90 = call i32 @close(i32 %56)
br label %167
91: ; preds = %76
%92 = add nuw i64 %73, 1
%93 = icmp eq i64 %92, %71
br i1 %93, label %94, label %72
94: ; preds = %91
%95 = getelementptr inbounds i8*, i8** %1, i64 4
%96 = load i8*, i8** %95
%97 = bitcast i32* %4 to i8*
br label %98
98: ; preds = %94, %138
%99 = phi i8* [ %96, %94 ], [ %140, %138 ]
%100 = phi i64 [ 4, %94 ], [ %139, %138 ]
br label %101
101: ; preds = %98, %105
%102 = phi i8* [ %107, %105 ], [ %99, %98 ]
%103 = phi i32 [ %106, %105 ], [ 0, %98 ]
%104 = load i8, i8* %102
switch i8 %104, label %105 [
i8 0, label %108
i8 32, label %108
]
105: ; preds = %101
%106 = xor i32 %103, 1
%107 = getelementptr inbounds i8, i8* %102, i64 1
br label %101
108: ; preds = %101, %101
store i32 0, i32* %4
br label %109
109: ; preds = %129, %108
%110 = phi i8* [ %99, %108 ], [ %131, %129 ]
%111 = phi i32 [ %103, %108 ], [ %130, %129 ]
%112 = load i8, i8* %110
switch i8 %112, label %113 [
i8 0, label %132
i8 32, label %136
]
113: ; preds = %109
%114 = call i32 @hex_digit_value(i8 signext %112)
%115 = icmp eq i32 %114, -1
br i1 %115, label %129, label %116
116: ; preds = %113
%117 = icmp eq i32 %111, 0
br i1 %117, label %118, label %120
118: ; preds = %116
%119 = shl i32 %114, 4
store i32 %119, i32* %4
br label %129
120: ; preds = %116
%121 = load i32, i32* %4
%122 = or i32 %121, %114
store i32 %122, i32* %4
%123 = call i32 (i32, ...) @write(i32 %56, i32* %4, i32 1)
%124 = icmp eq i32 %123, -1
br i1 %124, label %125, label %129
125: ; preds = %120
%126 = call i32 @close(i32 %56)
%127 = load i8*, i8** %53
%128 = call i32 @perror(i8* %127)
br label %167
129: ; preds = %113, %118, %120
%130 = phi i32 [ 1, %118 ], [ %111, %113 ], [ 0, %120 ]
%131 = getelementptr inbounds i8, i8* %110, i64 1
br label %109
132: ; preds = %109
%133 = add i64 %100, 1
%134 = getelementptr inbounds i8*, i8** %1, i64 %133
%135 = load i8*, i8** %134
br label %138
136: ; preds = %109
%137 = getelementptr inbounds i8, i8* %110, i64 1
br label %138
138: ; preds = %132, %136
%139 = phi i64 [ %133, %132 ], [ %100, %136 ]
%140 = phi i8* [ %135, %132 ], [ %137, %136 ]
%141 = icmp ult i64 %139, %71
br i1 %141, label %98, label %161
142: ; preds = %150
%143 = icmp eq i64 %156, %71
br i1 %143, label %161, label %144
144: ; preds = %70, %142
%145 = phi i64 [ %156, %142 ], [ 4, %70 ]
%146 = icmp ugt i64 %145, 4
br i1 %146, label %147, label %150
147: ; preds = %144
store i8 32, i8* %5
%148 = call i32 (i32, ...) @write(i32 %56, i8* %5, i32 1)
%149 = icmp eq i32 %148, -1
br i1 %149, label %157, label %150
150: ; preds = %144, %147
%151 = getelementptr inbounds i8*, i8** %1, i64 %145
%152 = load i8*, i8** %151
%153 = call i32 @strlen(i8* %152)
%154 = call i32 (i32, ...) @write(i32 %56, i8* %152, i32 %153)
%155 = icmp eq i32 %154, -1
%156 = add nuw i64 %145, 1
br i1 %155, label %157, label %142
157: ; preds = %150, %147
%158 = call i32 @close(i32 %56)
%159 = load i8*, i8** %53
%160 = call i32 @perror(i8* %159)
br label %167
161: ; preds = %142, %138
%162 = call i32 @close(i32 %56)
%163 = icmp eq i32 %162, -1
br i1 %163, label %164, label %167
164: ; preds = %161
%165 = load i8*, i8** %53
%166 = call i32 @perror(i8* %165)
br label %167
167: ; preds = %125, %84, %157, %47, %161, %164, %66, %58, %25
%168 = phi i32 [ 2, %25 ], [ 2, %47 ], [ 1, %58 ], [ 1, %66 ], [ 1, %164 ], [ 0, %161 ], [ 1, %157 ], [ 1, %125 ], [ 2, %84 ]
br label %169
169: ; preds = %167, %7
%170 = phi i32 [ 2, %7 ], [ %168, %167 ]
ret i32 %170
}