#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*/ O_RDWR;
int /*<<< orphan*/ PrintUsage(char *);
int ioctl(int, int, unsigned int *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
unsigned int strtoul(char *, int /*<<< orphan*/, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  int fd;
  int i;
  int ret;
  unsigned int adwParams[20];
  int width;
  int num = 1;
  if ((argc == 2) && (strcmp(argv[1], "v") == 0)) {
    printf("%s, regeditor V1.00\n", argv[0]);
    printf("Compile date and time: %s %s\n", argv[0], "Mar 16 2022",
           "14:45:01");
    return 0;
  }
  fd = open("/dev/ker_r_w", O_RDWR);
  if (fd < 0) {
    fd = open("/dev/ker_rw", O_RDWR);
    if (fd < 0) {
      printf("can't open /dev/ker_r_w: %d\n", fd);
      return 0;
    }
  }
  if (argc < 2) {
    goto err;
  }
  for (i = 0; i < 3; i++) {
    adwParams[i] = ~0UL;
  }
  for (i = 2; i < argc; i++) {
    adwParams[i - 2] = strtoul(argv[i], 0, 0);
  }
  if (!strcmp(argv[1], "r32")) {
    if (adwParams[0] == ~0UL) {
      goto err;
    }
    if (adwParams[1] == ~0UL) {
      adwParams[1] = 1;
    }
    adwParams[2] = adwParams[1];
    for (i = 0; i < adwParams[2]; i++) {
      if ((ret = ioctl(fd, 0, adwParams))) {
        printf("Error, can't Read Reg: 0x%x, ret: %d\n", adwParams[0], ret);
        return 0;
      } else {
        printf("Reg: 0x%08x, Value: 0x%08x\n", adwParams[0], adwParams[1]);
        adwParams[0] += 4;
      }
    }
  } else if (!strcmp(argv[1], "w32")) {
    if (adwParams[0] == ~0UL) {
      goto err;
    }
    if (adwParams[1] == ~0UL) {
      goto err;
    }
    if (adwParams[2] == ~0UL) {
      adwParams[2] = 1;
    }
    for (i = 0; i < adwParams[2]; i++) {
      if ((ret = ioctl(fd, 1, adwParams))) {
        printf("Error, can't Write Reg: 0x%x, ret: %d\n", adwParams[0], ret);
        return 0;
      } else {
        adwParams[0] += 4;
      }
    }
  } else if (!strcmp(argv[1], "r16")) {
    if (adwParams[0] == ~0UL) {
      goto err;
    }
    if (adwParams[1] == ~0UL) {
      adwParams[1] = 1;
    }
    adwParams[2] = adwParams[1];
    for (i = 0; i < adwParams[2]; i++) {
      if ((ret = ioctl(fd, 10, adwParams))) {
        printf("Error, can't Read Reg: 0x%x, ret: %d\n", adwParams[0], ret);
        return 0;
      } else {
        printf("Reg: 0x%08x, Value: 0x%08x\n", adwParams[0], adwParams[1]);
        adwParams[0] += 4;
      }
    }
  } else if (!strcmp(argv[1], "w16")) {
    if (adwParams[0] == ~0UL) {
      goto err;
    }
    if (adwParams[1] == ~0UL) {
      goto err;
    }
    if (adwParams[2] == ~0UL) {
      adwParams[2] = 1;
    }
    for (i = 0; i < adwParams[2]; i++) {
      if ((ret = ioctl(fd, 11, adwParams))) {
        printf("Error, can't Write Reg: 0x%x, ret: %d\n", adwParams[0], ret);
        return 0;
      } else {
        adwParams[0] += 4;
      }
    }
  } else if (!strcmp(argv[1], "r8")) {
    if (adwParams[0] == ~0UL) {
      goto err;
    }
    if (adwParams[1] == ~0UL) {
      adwParams[1] = 1;
    }
    adwParams[2] = adwParams[1];
    for (i = 0; i < adwParams[2]; i++) {
      if ((ret = ioctl(fd, 20, adwParams))) {
        printf("Error, can't Read Reg: 0x%x, ret: %d\n", adwParams[0], ret);
        return 0;
      } else {
        printf("Reg: 0x%08x, Value: 0x%08x\n", adwParams[0], adwParams[1]);
        adwParams[0] += 4;
      }
    }
  } else if (!strcmp(argv[1], "w8")) {
    if (adwParams[0] == ~0UL) {
      goto err;
    }
    if (adwParams[1] == ~0UL) {
      goto err;
    }
    if (adwParams[2] == ~0UL) {
      adwParams[2] = 1;
    }
    for (i = 0; i < adwParams[2]; i++) {
      if ((ret = ioctl(fd, 21, adwParams))) {
        printf("Error, can't Write Reg: 0x%x, ret: %d\n", adwParams[0], ret);
        return 0;
      } else {
        adwParams[0] += 4;
      }
    }
  } else if (!strcmp(argv[1], "dr8")) {
    if (adwParams[0] == ~0UL) {
      goto err;
    }
    if (adwParams[1] == ~0UL) {
      adwParams[1] = 1;
    }
    adwParams[2] = adwParams[1];
    for (i = 0; i < adwParams[2]; i++) {
      if ((ret = ioctl(fd, 70, adwParams))) {
        printf("Error, can't Read Reg: 0x%x, ret: %d\n", adwParams[0], ret);
        return 0;
      } else {
        printf("Reg: 0x%08x, Value: 0x%08x\n", adwParams[0], adwParams[1]);
        adwParams[0] += 4;
      }
    }
  } else if (!strcmp(argv[1], "dw8")) {
    if (adwParams[0] == ~0UL) {
      goto err;
    }
    if (adwParams[1] == ~0UL) {
      goto err;
    }
    if (adwParams[2] == ~0UL) {
      adwParams[2] = 1;
    }
    for (i = 0; i < adwParams[2]; i++) {
      if ((ret = ioctl(fd, 71, adwParams))) {
        printf("Error, can't Write Reg: 0x%x, ret: %d\n", adwParams[0], ret);
        return 0;
      } else {
        adwParams[0] += 4;
      }
    }
  } else {
    PrintUsage(argv[0]);
  }
  return 0;
err:
  PrintUsage(argv[0]);
  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)
movl   $0x1,-0x78(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11ec <main+0x8c>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe67(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    11ec <main+0x8c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe4c(%rip),%rdi
lea    0xe63(%rip),%rdx
lea    0xe68(%rip),%rcx
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    0x2df5(%rip),%rax
mov    (%rax),%esi
lea    0xe4e(%rip),%rdi
call   1070 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1252 <main+0xf2>
mov    0x2dd3(%rip),%rax
mov    (%rax),%esi
lea    0xe39(%rip),%rdi
call   1070 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    124d <main+0xed>
mov    -0x14(%rbp),%esi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
jmp    1252 <main+0xf2>
cmpl   $0x2,-0x8(%rbp)
jge    1261 <main+0x101>
jmp    1960 <main+0x800>
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    128c <main+0x12c>
movslq -0x18(%rbp),%rax
movl   $0xffffffff,-0x70(%rbp,%rax,4)
ff
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1268 <main+0x108>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12d0 <main+0x170>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1080 <strtoul@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
cltq
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1293 <main+0x133>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda1(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    139c <main+0x23c>
mov    -0x70(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    1300 <main+0x1a0>
jmp    1960 <main+0x800>
mov    -0x6c(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    1314 <main+0x1b4>
movl   $0x1,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x68(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x68(%rbp),%eax
jae    1397 <main+0x237>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rdx
xor    %esi,%esi
call   1050 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1367 <main+0x207>
mov    -0x70(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xd30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x70(%rbp),%esi
mov    -0x6c(%rbp),%edx
lea    0xd36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x70(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x70(%rbp)
jmp    1389 <main+0x229>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1321 <main+0x1c1>
jmp    1954 <main+0x7f4>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd1b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1463 <main+0x303>
mov    -0x70(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    13cc <main+0x26c>
jmp    1960 <main+0x800>
mov    -0x6c(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    13de <main+0x27e>
jmp    1960 <main+0x800>
mov    -0x68(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    13f2 <main+0x292>
movl   $0x1,-0x68(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x68(%rbp),%eax
jae    145e <main+0x2fe>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x1,%esi
call   1050 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1442 <main+0x2e2>
mov    -0x70(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xc9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x70(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x70(%rbp)
jmp    1450 <main+0x2f0>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    13f9 <main+0x299>
jmp    194f <main+0x7ef>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc7f(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1532 <main+0x3d2>
mov    -0x70(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    1493 <main+0x333>
jmp    1960 <main+0x800>
mov    -0x6c(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    14a7 <main+0x347>
movl   $0x1,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x68(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x68(%rbp),%eax
jae    152d <main+0x3cd>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0xa,%esi
call   1050 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     14fd <main+0x39d>
mov    -0x70(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xb9a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x70(%rbp),%esi
mov    -0x6c(%rbp),%edx
lea    0xba0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x70(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x70(%rbp)
jmp    151f <main+0x3bf>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    14b4 <main+0x354>
jmp    194a <main+0x7ea>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xbb4(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    15f9 <main+0x499>
mov    -0x70(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    1562 <main+0x402>
jmp    1960 <main+0x800>
mov    -0x6c(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    1574 <main+0x414>
jmp    1960 <main+0x800>
mov    -0x68(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    1588 <main+0x428>
movl   $0x1,-0x68(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x68(%rbp),%eax
jae    15f4 <main+0x494>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0xb,%esi
call   1050 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     15d8 <main+0x478>
mov    -0x70(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xb05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x70(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x70(%rbp)
jmp    15e6 <main+0x486>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    158f <main+0x42f>
jmp    1945 <main+0x7e5>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xaf2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    16c8 <main+0x568>
mov    -0x70(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    1629 <main+0x4c9>
jmp    1960 <main+0x800>
mov    -0x6c(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    163d <main+0x4dd>
movl   $0x1,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x68(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x68(%rbp),%eax
jae    16c3 <main+0x563>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x14,%esi
call   1050 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1693 <main+0x533>
mov    -0x70(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0xa04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x70(%rbp),%esi
mov    -0x6c(%rbp),%edx
lea    0xa0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x70(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x70(%rbp)
jmp    16b5 <main+0x555>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    164a <main+0x4ea>
jmp    1940 <main+0x7e0>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xa27(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    178f <main+0x62f>
mov    -0x70(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    16f8 <main+0x598>
jmp    1960 <main+0x800>
mov    -0x6c(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    170a <main+0x5aa>
jmp    1960 <main+0x800>
mov    -0x68(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    171e <main+0x5be>
movl   $0x1,-0x68(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x68(%rbp),%eax
jae    178a <main+0x62a>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x15,%esi
call   1050 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     176e <main+0x60e>
mov    -0x70(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0x96f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x70(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x70(%rbp)
jmp    177c <main+0x61c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1725 <main+0x5c5>
jmp    193b <main+0x7db>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x95b(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    185e <main+0x6fe>
mov    -0x70(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    17bf <main+0x65f>
jmp    1960 <main+0x800>
mov    -0x6c(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    17d3 <main+0x673>
movl   $0x1,-0x6c(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x68(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x68(%rbp),%eax
jae    1859 <main+0x6f9>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x46,%esi
call   1050 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1829 <main+0x6c9>
mov    -0x70(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0x86e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x70(%rbp),%esi
mov    -0x6c(%rbp),%edx
lea    0x874(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x70(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x70(%rbp)
jmp    184b <main+0x6eb>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    17e0 <main+0x680>
jmp    1936 <main+0x7d6>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0x890(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%rax
jne    1925 <main+0x7c5>
mov    -0x70(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    188e <main+0x72e>
jmp    1960 <main+0x800>
mov    -0x6c(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    18a0 <main+0x740>
jmp    1960 <main+0x800>
mov    -0x68(%rbp),%eax
cmp    $0xffffffffffffffff,%rax
jne    18b4 <main+0x754>
movl   $0x1,-0x68(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x68(%rbp),%eax
jae    1920 <main+0x7c0>
mov    -0x14(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x47,%esi
call   1050 <ioctl@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     1904 <main+0x7a4>
mov    -0x70(%rbp),%esi
mov    -0x1c(%rbp),%edx
lea    0x7d9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x70(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x70(%rbp)
jmp    1912 <main+0x7b2>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    18bb <main+0x75b>
jmp    1931 <main+0x7d1>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <PrintUsage@plt>
jmp    1936 <main+0x7d6>
jmp    193b <main+0x7db>
jmp    1940 <main+0x7e0>
jmp    1945 <main+0x7e5>
jmp    194a <main+0x7ea>
jmp    194f <main+0x7ef>
jmp    1954 <main+0x7f4>
movl   $0x0,-0x4(%rbp)
jmp    1973 <main+0x813>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <PrintUsage@plt>
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   %rbx
sub    $0x58,%rsp
mov    %rsi,%r15
mov    %edi,%ebp
cmp    $0x2,%edi
jne    118d <main+0x2d>
mov    0x8(%r15),%rdi
lea    0xe81(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1311 <main+0x1b1>
mov    0x2e54(%rip),%rbx
mov    (%rbx),%esi
lea    0xead(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%r14d
test   %eax,%eax
jns    11c2 <main+0x62>
mov    (%rbx),%esi
lea    0xea5(%rip),%rdi
call   1070 <open@plt>
mov    %eax,%r14d
test   %eax,%eax
js     13a8 <main+0x248>
cmp    $0x2,%ebp
jge    11d4 <main+0x74>
mov    (%r15),%rdi
call   1030 <PrintUsage@plt>
jmp    1598 <main+0x438>
movl   $0xffffffff,0x8(%rsp)
ff
movq   $0xffffffffffffffff,(%rsp)
ff
je     120a <main+0xaa>
mov    %ebp,%ebp
add    $0xfffffffffffffffe,%rbp
xor    %ebx,%ebx
xchg   %ax,%ax
mov    0x10(%r15,%rbx,8),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <strtoul@plt>
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11f0 <main+0x90>
mov    0x8(%r15),%rdi
lea    0xe6b(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1346 <main+0x1e6>
mov    0x8(%r15),%rdi
lea    0xe98(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     13be <main+0x25e>
mov    0x8(%r15),%rdi
lea    0xeaa(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     13ff <main+0x29f>
mov    0x8(%r15),%rdi
lea    0xe95(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     145b <main+0x2fb>
mov    0x8(%r15),%rdi
lea    0xe81(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     149f <main+0x33f>
mov    0x8(%r15),%rdi
lea    0xe6c(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     14fb <main+0x39b>
mov    0x8(%r15),%rdi
lea    0xe4e(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     153c <main+0x3dc>
mov    0x8(%r15),%rdi
lea    0xe39(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
jne    11c7 <main+0x67>
cmpl   $0x0,0x8(%rsp)
je     1598 <main+0x438>
xor    %ebp,%ebp
mov    %rsp,%rbx
mov    %r14d,%edi
mov    $0x47,%esi
mov    %rbx,%rdx
call   1050 <ioctl@plt>
mov    (%rsp),%esi
test   %eax,%eax
jne    1533 <main+0x3d3>
add    $0x4,%esi
mov    %esi,(%rsp)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     12e2 <main+0x182>
jmp    1598 <main+0x438>
mov    (%r15),%rsi
lea    0xce7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%r15),%rsi
lea    0xceb(%rip),%rdi
lea    0xd02(%rip),%rdx
lea    0xd07(%rip),%rcx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1598 <main+0x438>
mov    0x4(%rsp),%eax
mov    %eax,0x8(%rsp)
test   %eax,%eax
je     1598 <main+0x438>
mov    %rsp,%rbx
lea    0xd4a(%rip),%r15
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14d,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1050 <ioctl@plt>
mov    (%rsp),%esi
test   %eax,%eax
jne    1588 <main+0x428>
mov    0x4(%rsp),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x4,(%rsp)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     1370 <main+0x210>
jmp    1598 <main+0x438>
lea    0xcb4(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1598 <main+0x438>
cmpl   $0x0,0x8(%rsp)
je     1598 <main+0x438>
xor    %ebp,%ebp
mov    %rsp,%rbx
xchg   %ax,%ax
mov    %r14d,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1050 <ioctl@plt>
mov    (%rsp),%esi
test   %eax,%eax
jne    1533 <main+0x3d3>
add    $0x4,%esi
mov    %esi,(%rsp)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     13d0 <main+0x270>
jmp    1598 <main+0x438>
mov    0x4(%rsp),%eax
mov    %eax,0x8(%rsp)
test   %eax,%eax
je     1598 <main+0x438>
mov    %rsp,%rbx
lea    0xc91(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    $0xa,%esi
mov    %rbx,%rdx
call   1050 <ioctl@plt>
mov    (%rsp),%esi
test   %eax,%eax
jne    1588 <main+0x428>
mov    0x4(%rsp),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x4,(%rsp)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     1420 <main+0x2c0>
jmp    1598 <main+0x438>
cmpl   $0x0,0x8(%rsp)
je     1598 <main+0x438>
xor    %ebp,%ebp
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    $0xb,%esi
mov    %rbx,%rdx
call   1050 <ioctl@plt>
mov    (%rsp),%esi
test   %eax,%eax
jne    1533 <main+0x3d3>
add    $0x4,%esi
mov    %esi,(%rsp)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     1470 <main+0x310>
jmp    1598 <main+0x438>
mov    0x4(%rsp),%eax
mov    %eax,0x8(%rsp)
test   %eax,%eax
je     1598 <main+0x438>
mov    %rsp,%rbx
lea    0xbf1(%rip),%r15
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14d,%edi
mov    $0x14,%esi
mov    %rbx,%rdx
call   1050 <ioctl@plt>
mov    (%rsp),%esi
test   %eax,%eax
jne    1588 <main+0x428>
mov    0x4(%rsp),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x4,(%rsp)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     14c0 <main+0x360>
jmp    1598 <main+0x438>
cmpl   $0x0,0x8(%rsp)
je     1598 <main+0x438>
xor    %ebp,%ebp
mov    %rsp,%rbx
mov    %r14d,%edi
mov    $0x15,%esi
mov    %rbx,%rdx
call   1050 <ioctl@plt>
mov    (%rsp),%esi
test   %eax,%eax
jne    1533 <main+0x3d3>
add    $0x4,%esi
mov    %esi,(%rsp)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     150b <main+0x3ab>
jmp    1598 <main+0x438>
lea    0xb90(%rip),%rdi
jmp    158f <main+0x42f>
mov    0x4(%rsp),%eax
mov    %eax,0x8(%rsp)
test   %eax,%eax
je     1598 <main+0x438>
mov    %rsp,%rbx
lea    0xb58(%rip),%r15
xor    %ebp,%ebp
mov    %r14d,%edi
mov    $0x46,%esi
mov    %rbx,%rdx
call   1050 <ioctl@plt>
mov    (%rsp),%esi
test   %eax,%eax
jne    1588 <main+0x428>
mov    0x4(%rsp),%edx
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
addl   $0x4,(%rsp)
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jb     1554 <main+0x3f4>
jmp    1598 <main+0x438>
lea    0xaf5(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"v\00"
@.str.1 = [21 x i8] c"%s, regeditor V1.00\0A\00"
@.str.2 = [30 x i8] c"Compile date and time: %s %s\0A\00"
@.str.3 = [12 x i8] c"Mar 16 2022\00"
@.str.4 = [9 x i8] c"14:45:01\00"
@.str.5 = [13 x i8] c"/dev/ker_r_w\00"
@O_RDWR = global i32 0
@.str.6 = [12 x i8] c"/dev/ker_rw\00"
@.str.7 = [29 x i8] c"can't open /dev/ker_r_w: %d\0A\00"
@.str.8 = [4 x i8] c"r32\00"
@.str.9 = [38 x i8] c"Error, can't Read Reg: 0x%x, ret: %d\0A\00"
@.str.10 = [28 x i8] c"Reg: 0x%08x, Value: 0x%08x\0A\00"
@.str.11 = [4 x i8] c"w32\00"
@.str.12 = [39 x i8] c"Error, can't Write Reg: 0x%x, ret: %d\0A\00"
@.str.13 = [4 x i8] c"r16\00"
@.str.14 = [4 x i8] c"w16\00"
@.str.15 = [3 x i8] c"r8\00"
@.str.16 = [3 x i8] c"w8\00"
@.str.17 = [4 x i8] c"dr8\00"
@.str.18 = [4 x i8] c"dw8\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [20 x i32]
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %11
%12 = load i32, i32* %4
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %29
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %14
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 0
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %23)
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %27, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %3
br label %503
29: ; preds = %14, %2
%30 = load i32, i32* @O_RDWR
%31 = call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %30)
store i32 %31, i32* %6
%32 = load i32, i32* %6
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %43
34: ; preds = %29
%35 = load i32, i32* @O_RDWR
%36 = call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %35)
store i32 %36, i32* %6
%37 = load i32, i32* %6
%38 = icmp slt i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %34
%40 = load i32, i32* %6
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %40)
store i32 0, i32* %3
br label %503
42: ; preds = %34
br label %43
43: ; preds = %42, %29
%44 = load i32, i32* %4
%45 = icmp slt i32 %44, 2
br i1 %45, label %46, label %47
46: ; preds = %43
br label %498
47: ; preds = %43
store i32 0, i32* %7
br label %48
48: ; preds = %55, %47
%49 = load i32, i32* %7
%50 = icmp slt i32 %49, 3
br i1 %50, label %51, label %58
51: ; preds = %48
%52 = load i32, i32* %7
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %53
store i32 -1, i32* %54
br label %55
55: ; preds = %51
%56 = load i32, i32* %7
%57 = add nsw i32 %56, 1
store i32 %57, i32* %7
br label %48
58: ; preds = %48
store i32 2, i32* %7
br label %59
59: ; preds = %74, %58
%60 = load i32, i32* %7
%61 = load i32, i32* %4
%62 = icmp slt i32 %60, %61
br i1 %62, label %63, label %77
63: ; preds = %59
%64 = load i8**, i8*** %5
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8*, i8** %64, i64 %66
%68 = load i8*, i8** %67
%69 = call i32 @strtoul(i8* %68, i32 0, i32 0)
%70 = load i32, i32* %7
%71 = sub nsw i32 %70, 2
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 %72
store i32 %69, i32* %73
br label %74
74: ; preds = %63
%75 = load i32, i32* %7
%76 = add nsw i32 %75, 1
store i32 %76, i32* %7
br label %59
77: ; preds = %59
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = call i64 @strcmp(i8* %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%82 = icmp ne i64 %81, 0
br i1 %82, label %129, label %83
83: ; preds = %77
%84 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%85 = load i32, i32* %84
%86 = zext i32 %85 to i64
%87 = icmp eq i64 %86, -1
br i1 %87, label %88, label %89
88: ; preds = %83
br label %498
89: ; preds = %83
%90 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%91 = load i32, i32* %90
%92 = zext i32 %91 to i64
%93 = icmp eq i64 %92, -1
br i1 %93, label %94, label %96
94: ; preds = %89
%95 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
store i32 1, i32* %95
br label %96
96: ; preds = %94, %89
%97 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%98 = load i32, i32* %97
%99 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
store i32 %98, i32* %99
store i32 0, i32* %7
br label %100
100: ; preds = %125, %96
%101 = load i32, i32* %7
%102 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%103 = load i32, i32* %102
%104 = icmp ult i32 %101, %103
br i1 %104, label %105, label %128
105: ; preds = %100
%106 = load i32, i32* %6
%107 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%108 = call i32 @ioctl(i32 %106, i32 0, i32* %107)
store i32 %108, i32* %8
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %115
110: ; preds = %105
%111 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%112 = load i32, i32* %111
%113 = load i32, i32* %8
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 %112, i32 %113)
store i32 0, i32* %3
br label %503
115: ; preds = %105
%116 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%117 = load i32, i32* %116
%118 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%119 = load i32, i32* %118
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %117, i32 %119)
%121 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%122 = load i32, i32* %121
%123 = add i32 %122, 4
store i32 %123, i32* %121
br label %124
124: ; preds = %115
br label %125
125: ; preds = %124
%126 = load i32, i32* %7
%127 = add nsw i32 %126, 1
store i32 %127, i32* %7
br label %100
128: ; preds = %100
br label %497
129: ; preds = %77
%130 = load i8**, i8*** %5
%131 = getelementptr inbounds i8*, i8** %130, i64 1
%132 = load i8*, i8** %131
%133 = call i64 @strcmp(i8* %132, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%134 = icmp ne i64 %133, 0
br i1 %134, label %179, label %135
135: ; preds = %129
%136 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%137 = load i32, i32* %136
%138 = zext i32 %137 to i64
%139 = icmp eq i64 %138, -1
br i1 %139, label %140, label %141
140: ; preds = %135
br label %498
141: ; preds = %135
%142 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%143 = load i32, i32* %142
%144 = zext i32 %143 to i64
%145 = icmp eq i64 %144, -1
br i1 %145, label %146, label %147
146: ; preds = %141
br label %498
147: ; preds = %141
%148 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%149 = load i32, i32* %148
%150 = zext i32 %149 to i64
%151 = icmp eq i64 %150, -1
br i1 %151, label %152, label %154
152: ; preds = %147
%153 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
store i32 1, i32* %153
br label %154
154: ; preds = %152, %147
store i32 0, i32* %7
br label %155
155: ; preds = %175, %154
%156 = load i32, i32* %7
%157 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%158 = load i32, i32* %157
%159 = icmp ult i32 %156, %158
br i1 %159, label %160, label %178
160: ; preds = %155
%161 = load i32, i32* %6
%162 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%163 = call i32 @ioctl(i32 %161, i32 1, i32* %162)
store i32 %163, i32* %8
%164 = icmp ne i32 %163, 0
br i1 %164, label %165, label %170
165: ; preds = %160
%166 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%167 = load i32, i32* %166
%168 = load i32, i32* %8
%169 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i32 %167, i32 %168)
store i32 0, i32* %3
br label %503
170: ; preds = %160
%171 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%172 = load i32, i32* %171
%173 = add i32 %172, 4
store i32 %173, i32* %171
br label %174
174: ; preds = %170
br label %175
175: ; preds = %174
%176 = load i32, i32* %7
%177 = add nsw i32 %176, 1
store i32 %177, i32* %7
br label %155
178: ; preds = %155
br label %496
179: ; preds = %129
%180 = load i8**, i8*** %5
%181 = getelementptr inbounds i8*, i8** %180, i64 1
%182 = load i8*, i8** %181
%183 = call i64 @strcmp(i8* %182, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%184 = icmp ne i64 %183, 0
br i1 %184, label %231, label %185
185: ; preds = %179
%186 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%187 = load i32, i32* %186
%188 = zext i32 %187 to i64
%189 = icmp eq i64 %188, -1
br i1 %189, label %190, label %191
190: ; preds = %185
br label %498
191: ; preds = %185
%192 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%193 = load i32, i32* %192
%194 = zext i32 %193 to i64
%195 = icmp eq i64 %194, -1
br i1 %195, label %196, label %198
196: ; preds = %191
%197 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
store i32 1, i32* %197
br label %198
198: ; preds = %196, %191
%199 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%200 = load i32, i32* %199
%201 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
store i32 %200, i32* %201
store i32 0, i32* %7
br label %202
202: ; preds = %227, %198
%203 = load i32, i32* %7
%204 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%205 = load i32, i32* %204
%206 = icmp ult i32 %203, %205
br i1 %206, label %207, label %230
207: ; preds = %202
%208 = load i32, i32* %6
%209 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%210 = call i32 @ioctl(i32 %208, i32 10, i32* %209)
store i32 %210, i32* %8
%211 = icmp ne i32 %210, 0
br i1 %211, label %212, label %217
212: ; preds = %207
%213 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%214 = load i32, i32* %213
%215 = load i32, i32* %8
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 %214, i32 %215)
store i32 0, i32* %3
br label %503
217: ; preds = %207
%218 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%219 = load i32, i32* %218
%220 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%221 = load i32, i32* %220
%222 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %219, i32 %221)
%223 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%224 = load i32, i32* %223
%225 = add i32 %224, 4
store i32 %225, i32* %223
br label %226
226: ; preds = %217
br label %227
227: ; preds = %226
%228 = load i32, i32* %7
%229 = add nsw i32 %228, 1
store i32 %229, i32* %7
br label %202
230: ; preds = %202
br label %495
231: ; preds = %179
%232 = load i8**, i8*** %5
%233 = getelementptr inbounds i8*, i8** %232, i64 1
%234 = load i8*, i8** %233
%235 = call i64 @strcmp(i8* %234, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%236 = icmp ne i64 %235, 0
br i1 %236, label %281, label %237
237: ; preds = %231
%238 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%239 = load i32, i32* %238
%240 = zext i32 %239 to i64
%241 = icmp eq i64 %240, -1
br i1 %241, label %242, label %243
242: ; preds = %237
br label %498
243: ; preds = %237
%244 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%245 = load i32, i32* %244
%246 = zext i32 %245 to i64
%247 = icmp eq i64 %246, -1
br i1 %247, label %248, label %249
248: ; preds = %243
br label %498
249: ; preds = %243
%250 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%251 = load i32, i32* %250
%252 = zext i32 %251 to i64
%253 = icmp eq i64 %252, -1
br i1 %253, label %254, label %256
254: ; preds = %249
%255 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
store i32 1, i32* %255
br label %256
256: ; preds = %254, %249
store i32 0, i32* %7
br label %257
257: ; preds = %277, %256
%258 = load i32, i32* %7
%259 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%260 = load i32, i32* %259
%261 = icmp ult i32 %258, %260
br i1 %261, label %262, label %280
262: ; preds = %257
%263 = load i32, i32* %6
%264 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%265 = call i32 @ioctl(i32 %263, i32 11, i32* %264)
store i32 %265, i32* %8
%266 = icmp ne i32 %265, 0
br i1 %266, label %267, label %272
267: ; preds = %262
%268 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%269 = load i32, i32* %268
%270 = load i32, i32* %8
%271 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i32 %269, i32 %270)
store i32 0, i32* %3
br label %503
272: ; preds = %262
%273 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%274 = load i32, i32* %273
%275 = add i32 %274, 4
store i32 %275, i32* %273
br label %276
276: ; preds = %272
br label %277
277: ; preds = %276
%278 = load i32, i32* %7
%279 = add nsw i32 %278, 1
store i32 %279, i32* %7
br label %257
280: ; preds = %257
br label %494
281: ; preds = %231
%282 = load i8**, i8*** %5
%283 = getelementptr inbounds i8*, i8** %282, i64 1
%284 = load i8*, i8** %283
%285 = call i64 @strcmp(i8* %284, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%286 = icmp ne i64 %285, 0
br i1 %286, label %333, label %287
287: ; preds = %281
%288 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%289 = load i32, i32* %288
%290 = zext i32 %289 to i64
%291 = icmp eq i64 %290, -1
br i1 %291, label %292, label %293
292: ; preds = %287
br label %498
293: ; preds = %287
%294 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%295 = load i32, i32* %294
%296 = zext i32 %295 to i64
%297 = icmp eq i64 %296, -1
br i1 %297, label %298, label %300
298: ; preds = %293
%299 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
store i32 1, i32* %299
br label %300
300: ; preds = %298, %293
%301 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%302 = load i32, i32* %301
%303 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
store i32 %302, i32* %303
store i32 0, i32* %7
br label %304
304: ; preds = %329, %300
%305 = load i32, i32* %7
%306 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%307 = load i32, i32* %306
%308 = icmp ult i32 %305, %307
br i1 %308, label %309, label %332
309: ; preds = %304
%310 = load i32, i32* %6
%311 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%312 = call i32 @ioctl(i32 %310, i32 20, i32* %311)
store i32 %312, i32* %8
%313 = icmp ne i32 %312, 0
br i1 %313, label %314, label %319
314: ; preds = %309
%315 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%316 = load i32, i32* %315
%317 = load i32, i32* %8
%318 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 %316, i32 %317)
store i32 0, i32* %3
br label %503
319: ; preds = %309
%320 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%321 = load i32, i32* %320
%322 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%323 = load i32, i32* %322
%324 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %321, i32 %323)
%325 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%326 = load i32, i32* %325
%327 = add i32 %326, 4
store i32 %327, i32* %325
br label %328
328: ; preds = %319
br label %329
329: ; preds = %328
%330 = load i32, i32* %7
%331 = add nsw i32 %330, 1
store i32 %331, i32* %7
br label %304
332: ; preds = %304
br label %493
333: ; preds = %281
%334 = load i8**, i8*** %5
%335 = getelementptr inbounds i8*, i8** %334, i64 1
%336 = load i8*, i8** %335
%337 = call i64 @strcmp(i8* %336, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%338 = icmp ne i64 %337, 0
br i1 %338, label %383, label %339
339: ; preds = %333
%340 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%341 = load i32, i32* %340
%342 = zext i32 %341 to i64
%343 = icmp eq i64 %342, -1
br i1 %343, label %344, label %345
344: ; preds = %339
br label %498
345: ; preds = %339
%346 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%347 = load i32, i32* %346
%348 = zext i32 %347 to i64
%349 = icmp eq i64 %348, -1
br i1 %349, label %350, label %351
350: ; preds = %345
br label %498
351: ; preds = %345
%352 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%353 = load i32, i32* %352
%354 = zext i32 %353 to i64
%355 = icmp eq i64 %354, -1
br i1 %355, label %356, label %358
356: ; preds = %351
%357 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
store i32 1, i32* %357
br label %358
358: ; preds = %356, %351
store i32 0, i32* %7
br label %359
359: ; preds = %379, %358
%360 = load i32, i32* %7
%361 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%362 = load i32, i32* %361
%363 = icmp ult i32 %360, %362
br i1 %363, label %364, label %382
364: ; preds = %359
%365 = load i32, i32* %6
%366 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%367 = call i32 @ioctl(i32 %365, i32 21, i32* %366)
store i32 %367, i32* %8
%368 = icmp ne i32 %367, 0
br i1 %368, label %369, label %374
369: ; preds = %364
%370 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%371 = load i32, i32* %370
%372 = load i32, i32* %8
%373 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i32 %371, i32 %372)
store i32 0, i32* %3
br label %503
374: ; preds = %364
%375 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%376 = load i32, i32* %375
%377 = add i32 %376, 4
store i32 %377, i32* %375
br label %378
378: ; preds = %374
br label %379
379: ; preds = %378
%380 = load i32, i32* %7
%381 = add nsw i32 %380, 1
store i32 %381, i32* %7
br label %359
382: ; preds = %359
br label %492
383: ; preds = %333
%384 = load i8**, i8*** %5
%385 = getelementptr inbounds i8*, i8** %384, i64 1
%386 = load i8*, i8** %385
%387 = call i64 @strcmp(i8* %386, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%388 = icmp ne i64 %387, 0
br i1 %388, label %435, label %389
389: ; preds = %383
%390 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%391 = load i32, i32* %390
%392 = zext i32 %391 to i64
%393 = icmp eq i64 %392, -1
br i1 %393, label %394, label %395
394: ; preds = %389
br label %498
395: ; preds = %389
%396 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%397 = load i32, i32* %396
%398 = zext i32 %397 to i64
%399 = icmp eq i64 %398, -1
br i1 %399, label %400, label %402
400: ; preds = %395
%401 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
store i32 1, i32* %401
br label %402
402: ; preds = %400, %395
%403 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%404 = load i32, i32* %403
%405 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
store i32 %404, i32* %405
store i32 0, i32* %7
br label %406
406: ; preds = %431, %402
%407 = load i32, i32* %7
%408 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%409 = load i32, i32* %408
%410 = icmp ult i32 %407, %409
br i1 %410, label %411, label %434
411: ; preds = %406
%412 = load i32, i32* %6
%413 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%414 = call i32 @ioctl(i32 %412, i32 70, i32* %413)
store i32 %414, i32* %8
%415 = icmp ne i32 %414, 0
br i1 %415, label %416, label %421
416: ; preds = %411
%417 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%418 = load i32, i32* %417
%419 = load i32, i32* %8
%420 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 %418, i32 %419)
store i32 0, i32* %3
br label %503
421: ; preds = %411
%422 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%423 = load i32, i32* %422
%424 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%425 = load i32, i32* %424
%426 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %423, i32 %425)
%427 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%428 = load i32, i32* %427
%429 = add i32 %428, 4
store i32 %429, i32* %427
br label %430
430: ; preds = %421
br label %431
431: ; preds = %430
%432 = load i32, i32* %7
%433 = add nsw i32 %432, 1
store i32 %433, i32* %7
br label %406
434: ; preds = %406
br label %491
435: ; preds = %383
%436 = load i8**, i8*** %5
%437 = getelementptr inbounds i8*, i8** %436, i64 1
%438 = load i8*, i8** %437
%439 = call i64 @strcmp(i8* %438, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%440 = icmp ne i64 %439, 0
br i1 %440, label %485, label %441
441: ; preds = %435
%442 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%443 = load i32, i32* %442
%444 = zext i32 %443 to i64
%445 = icmp eq i64 %444, -1
br i1 %445, label %446, label %447
446: ; preds = %441
br label %498
447: ; preds = %441
%448 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 1
%449 = load i32, i32* %448
%450 = zext i32 %449 to i64
%451 = icmp eq i64 %450, -1
br i1 %451, label %452, label %453
452: ; preds = %447
br label %498
453: ; preds = %447
%454 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%455 = load i32, i32* %454
%456 = zext i32 %455 to i64
%457 = icmp eq i64 %456, -1
br i1 %457, label %458, label %460
458: ; preds = %453
%459 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
store i32 1, i32* %459
br label %460
460: ; preds = %458, %453
store i32 0, i32* %7
br label %461
461: ; preds = %481, %460
%462 = load i32, i32* %7
%463 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 2
%464 = load i32, i32* %463
%465 = icmp ult i32 %462, %464
br i1 %465, label %466, label %484
466: ; preds = %461
%467 = load i32, i32* %6
%468 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%469 = call i32 @ioctl(i32 %467, i32 71, i32* %468)
store i32 %469, i32* %8
%470 = icmp ne i32 %469, 0
br i1 %470, label %471, label %476
471: ; preds = %466
%472 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%473 = load i32, i32* %472
%474 = load i32, i32* %8
%475 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i32 %473, i32 %474)
store i32 0, i32* %3
br label %503
476: ; preds = %466
%477 = getelementptr inbounds [20 x i32], [20 x i32]* %9, i64 0, i64 0
%478 = load i32, i32* %477
%479 = add i32 %478, 4
store i32 %479, i32* %477
br label %480
480: ; preds = %476
br label %481
481: ; preds = %480
%482 = load i32, i32* %7
%483 = add nsw i32 %482, 1
store i32 %483, i32* %7
br label %461
484: ; preds = %461
br label %490
485: ; preds = %435
%486 = load i8**, i8*** %5
%487 = getelementptr inbounds i8*, i8** %486, i64 0
%488 = load i8*, i8** %487
%489 = call i32 @PrintUsage(i8* %488)
br label %490
490: ; preds = %485, %484
br label %491
491: ; preds = %490, %434
br label %492
492: ; preds = %491, %382
br label %493
493: ; preds = %492, %332
br label %494
494: ; preds = %493, %280
br label %495
495: ; preds = %494, %230
br label %496
496: ; preds = %495, %178
br label %497
497: ; preds = %496, %128
store i32 0, i32* %3
br label %503
498: ; preds = %452, %446, %394, %350, %344, %292, %248, %242, %190, %146, %140, %88, %46
%499 = load i8**, i8*** %5
%500 = getelementptr inbounds i8*, i8** %499, i64 0
%501 = load i8*, i8** %500
%502 = call i32 @PrintUsage(i8* %501)
store i32 0, i32* %3
br label %503
503: ; preds = %498, %497, %471, %416, %369, %314, %267, %212, %165, %110, %39, %20
%504 = load i32, i32* %3
ret i32 %504
}

LLVM IR (-O2):
@.str = [2 x i8] c"v\00"
@.str.1 = [21 x i8] c"%s, regeditor V1.00\0A\00"
@.str.2 = [30 x i8] c"Compile date and time: %s %s\0A\00"
@.str.3 = [12 x i8] c"Mar 16 2022\00"
@.str.4 = [9 x i8] c"14:45:01\00"
@.str.5 = [13 x i8] c"/dev/ker_r_w\00"
@O_RDWR = global i32 0
@.str.6 = [12 x i8] c"/dev/ker_rw\00"
@.str.7 = [29 x i8] c"can't open /dev/ker_r_w: %d\0A\00"
@.str.8 = [4 x i8] c"r32\00"
@.str.9 = [38 x i8] c"Error, can't Read Reg: 0x%x, ret: %d\0A\00"
@.str.10 = [28 x i8] c"Reg: 0x%08x, Value: 0x%08x\0A\00"
@.str.11 = [4 x i8] c"w32\00"
@.str.12 = [39 x i8] c"Error, can't Write Reg: 0x%x, ret: %d\0A\00"
@.str.13 = [4 x i8] c"r16\00"
@.str.14 = [4 x i8] c"w16\00"
@.str.15 = [3 x i8] c"r8\00"
@.str.16 = [3 x i8] c"w8\00"
@.str.17 = [4 x i8] c"dr8\00"
@.str.18 = [4 x i8] c"dw8\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [20 x i32]
%4 = bitcast [20 x i32]* %3 to i8*
%5 = icmp eq i32 %0, 2
br i1 %5, label %6, label %16
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %6
%12 = load i8*, i8** %1
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i8*, i8** %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
br label %233
16: ; preds = %6, %2
%17 = load i32, i32* @O_RDWR
%18 = tail call i32 @open(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %17)
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %26
20: ; preds = %16
%21 = load i32, i32* @O_RDWR
%22 = tail call i32 @open(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %21)
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %20
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i32 %22)
br label %233
26: ; preds = %20, %16
%27 = phi i32 [ %22, %20 ], [ %18, %16 ]
%28 = icmp slt i32 %0, 2
br i1 %28, label %230, label %29
29: ; preds = %26
%30 = icmp eq i32 %0, 2
br i1 %30, label %42, label %31
31: ; preds = %29
%32 = zext i32 %0 to i64
br label %33
33: ; preds = %31, %33
%34 = phi i64 [ 2, %31 ], [ %40, %33 ]
%35 = getelementptr inbounds i8*, i8** %1, i64 %34
%36 = load i8*, i8** %35
%37 = tail call i32 @strtoul(i8* %36, i32 0, i32 0)
%38 = add nsw i64 %34, -2
%39 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %38
store i32 %37, i32* %39
%40 = add nuw nsw i64 %34, 1
%41 = icmp eq i64 %40, %32
br i1 %41, label %42, label %33
42: ; preds = %33, %29
%43 = getelementptr inbounds i8*, i8** %1, i64 1
%44 = load i8*, i8** %43
%45 = tail call i64 @strcmp(i8* %44, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0))
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %68
47: ; preds = %42
%48 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%49 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 1
%50 = load i32, i32* %49
%51 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 2
store i32 %50, i32* %51
%52 = icmp eq i32 %50, 0
br i1 %52, label %233, label %53
53: ; preds = %47, %60
%54 = phi i32 [ %65, %60 ], [ 0, %47 ]
%55 = call i32 @ioctl(i32 %27, i32 0, i32* %48)
%56 = icmp eq i32 %55, 0
%57 = load i32, i32* %48
br i1 %56, label %60, label %58
58: ; preds = %53
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 %57, i32 %55)
br label %233
60: ; preds = %53
%61 = load i32, i32* %49
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %57, i32 %61)
%63 = load i32, i32* %48
%64 = add i32 %63, 4
store i32 %64, i32* %48
%65 = add nuw nsw i32 %54, 1
%66 = load i32, i32* %51
%67 = icmp ult i32 %65, %66
br i1 %67, label %53, label %233
68: ; preds = %42
%69 = load i8*, i8** %43
%70 = tail call i64 @strcmp(i8* %69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %89
72: ; preds = %68
%73 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%74 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 2
%75 = load i32, i32* %74
%76 = icmp eq i32 %75, 0
br i1 %76, label %233, label %77
77: ; preds = %72, %84
%78 = phi i32 [ %86, %84 ], [ 0, %72 ]
%79 = call i32 @ioctl(i32 %27, i32 1, i32* %73)
%80 = icmp eq i32 %79, 0
%81 = load i32, i32* %73
br i1 %80, label %84, label %82
82: ; preds = %77
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i32 %81, i32 %79)
br label %233
84: ; preds = %77
%85 = add i32 %81, 4
store i32 %85, i32* %73
%86 = add nuw nsw i32 %78, 1
%87 = load i32, i32* %74
%88 = icmp ult i32 %86, %87
br i1 %88, label %77, label %233
89: ; preds = %68
%90 = load i8*, i8** %43
%91 = tail call i64 @strcmp(i8* %90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i64 0, i64 0))
%92 = icmp eq i64 %91, 0
br i1 %92, label %93, label %114
93: ; preds = %89
%94 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%95 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 1
%96 = load i32, i32* %95
%97 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 2
store i32 %96, i32* %97
%98 = icmp eq i32 %96, 0
br i1 %98, label %233, label %99
99: ; preds = %93, %106
%100 = phi i32 [ %111, %106 ], [ 0, %93 ]
%101 = call i32 @ioctl(i32 %27, i32 10, i32* %94)
%102 = icmp eq i32 %101, 0
%103 = load i32, i32* %94
br i1 %102, label %106, label %104
104: ; preds = %99
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 %103, i32 %101)
br label %233
106: ; preds = %99
%107 = load i32, i32* %95
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %103, i32 %107)
%109 = load i32, i32* %94
%110 = add i32 %109, 4
store i32 %110, i32* %94
%111 = add nuw nsw i32 %100, 1
%112 = load i32, i32* %97
%113 = icmp ult i32 %111, %112
br i1 %113, label %99, label %233
114: ; preds = %89
%115 = load i8*, i8** %43
%116 = tail call i64 @strcmp(i8* %115, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.14, i64 0, i64 0))
%117 = icmp eq i64 %116, 0
br i1 %117, label %118, label %135
118: ; preds = %114
%119 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%120 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 2
%121 = load i32, i32* %120
%122 = icmp eq i32 %121, 0
br i1 %122, label %233, label %123
123: ; preds = %118, %130
%124 = phi i32 [ %132, %130 ], [ 0, %118 ]
%125 = call i32 @ioctl(i32 %27, i32 11, i32* %119)
%126 = icmp eq i32 %125, 0
%127 = load i32, i32* %119
br i1 %126, label %130, label %128
128: ; preds = %123
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i32 %127, i32 %125)
br label %233
130: ; preds = %123
%131 = add i32 %127, 4
store i32 %131, i32* %119
%132 = add nuw nsw i32 %124, 1
%133 = load i32, i32* %120
%134 = icmp ult i32 %132, %133
br i1 %134, label %123, label %233
135: ; preds = %114
%136 = load i8*, i8** %43
%137 = tail call i64 @strcmp(i8* %136, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%138 = icmp eq i64 %137, 0
br i1 %138, label %139, label %160
139: ; preds = %135
%140 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%141 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 1
%142 = load i32, i32* %141
%143 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 2
store i32 %142, i32* %143
%144 = icmp eq i32 %142, 0
br i1 %144, label %233, label %145
145: ; preds = %139, %152
%146 = phi i32 [ %157, %152 ], [ 0, %139 ]
%147 = call i32 @ioctl(i32 %27, i32 20, i32* %140)
%148 = icmp eq i32 %147, 0
%149 = load i32, i32* %140
br i1 %148, label %152, label %150
150: ; preds = %145
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 %149, i32 %147)
br label %233
152: ; preds = %145
%153 = load i32, i32* %141
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %149, i32 %153)
%155 = load i32, i32* %140
%156 = add i32 %155, 4
store i32 %156, i32* %140
%157 = add nuw nsw i32 %146, 1
%158 = load i32, i32* %143
%159 = icmp ult i32 %157, %158
br i1 %159, label %145, label %233
160: ; preds = %135
%161 = load i8*, i8** %43
%162 = tail call i64 @strcmp(i8* %161, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.16, i64 0, i64 0))
%163 = icmp eq i64 %162, 0
br i1 %163, label %164, label %181
164: ; preds = %160
%165 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%166 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 2
%167 = load i32, i32* %166
%168 = icmp eq i32 %167, 0
br i1 %168, label %233, label %169
169: ; preds = %164, %176
%170 = phi i32 [ %178, %176 ], [ 0, %164 ]
%171 = call i32 @ioctl(i32 %27, i32 21, i32* %165)
%172 = icmp eq i32 %171, 0
%173 = load i32, i32* %165
br i1 %172, label %176, label %174
174: ; preds = %169
%175 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i32 %173, i32 %171)
br label %233
176: ; preds = %169
%177 = add i32 %173, 4
store i32 %177, i32* %165
%178 = add nuw nsw i32 %170, 1
%179 = load i32, i32* %166
%180 = icmp ult i32 %178, %179
br i1 %180, label %169, label %233
181: ; preds = %160
%182 = load i8*, i8** %43
%183 = tail call i64 @strcmp(i8* %182, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i64 0, i64 0))
%184 = icmp eq i64 %183, 0
br i1 %184, label %185, label %206
185: ; preds = %181
%186 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%187 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 1
%188 = load i32, i32* %187
%189 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 2
store i32 %188, i32* %189
%190 = icmp eq i32 %188, 0
br i1 %190, label %233, label %191
191: ; preds = %185, %198
%192 = phi i32 [ %203, %198 ], [ 0, %185 ]
%193 = call i32 @ioctl(i32 %27, i32 70, i32* %186)
%194 = icmp eq i32 %193, 0
%195 = load i32, i32* %186
br i1 %194, label %198, label %196
196: ; preds = %191
%197 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 %195, i32 %193)
br label %233
198: ; preds = %191
%199 = load i32, i32* %187
%200 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.10, i64 0, i64 0), i32 %195, i32 %199)
%201 = load i32, i32* %186
%202 = add i32 %201, 4
store i32 %202, i32* %186
%203 = add nuw nsw i32 %192, 1
%204 = load i32, i32* %189
%205 = icmp ult i32 %203, %204
br i1 %205, label %191, label %233
206: ; preds = %181
%207 = load i8*, i8** %43
%208 = tail call i64 @strcmp(i8* %207, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i64 0, i64 0))
%209 = icmp eq i64 %208, 0
br i1 %209, label %210, label %227
210: ; preds = %206
%211 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%212 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 2
%213 = load i32, i32* %212
%214 = icmp eq i32 %213, 0
br i1 %214, label %233, label %215
215: ; preds = %210, %222
%216 = phi i32 [ %224, %222 ], [ 0, %210 ]
%217 = call i32 @ioctl(i32 %27, i32 71, i32* %211)
%218 = icmp eq i32 %217, 0
%219 = load i32, i32* %211
br i1 %218, label %222, label %220
220: ; preds = %215
%221 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.12, i64 0, i64 0), i32 %219, i32 %217)
br label %233
222: ; preds = %215
%223 = add i32 %219, 4
store i32 %223, i32* %211
%224 = add nuw nsw i32 %216, 1
%225 = load i32, i32* %212
%226 = icmp ult i32 %224, %225
br i1 %226, label %215, label %233
227: ; preds = %206
%228 = load i8*, i8** %1
%229 = tail call i32 @PrintUsage(i8* %228)
br label %233
230: ; preds = %26
%231 = load i8*, i8** %1
%232 = tail call i32 @PrintUsage(i8* %231)
br label %233
233: ; preds = %222, %198, %176, %152, %130, %106, %84, %60, %210, %185, %164, %139, %118, %93, %72, %47, %227, %230, %220, %196, %174, %150, %128, %104, %82, %58, %24, %11
ret i32 0
}