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

/* Forward declarations */

/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ buf2;
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int EINVAL;
int ENAMETOOLONG;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int pack_str(char *, int *, int, char *);
int /*<<< orphan*/ stderr;
int strcmp(char *, char *);
int unpack_str(char *, int *, int, char *, int);
int test_packed_string_functions(void) {
  char buf[128] = {0};
  char buf2[128] = {0};
  uint32_t off, off2;
  off = 0;
  do {
    int __my_ret__ = pack_str(buf, &off, sizeof(buf), "swubu");
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 82,
              "pack_str(buf, &off, sizeof(buf), \"swubu\")");
      return __my_ret__;
    }
  } while (0);
  ;
  off2 = 0;
  do {
    int __my_ret__ = unpack_str(buf, &off2, sizeof(buf), buf2, sizeof(buf2));
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 85,
              "unpack_str(buf, &off2, sizeof(buf), buf2, sizeof(buf2))");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = strcmp("swubu", buf2);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 86, "strcmp(\"swubu\", buf2)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pack_str(buf, &off, sizeof(buf), "zub-zub");
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 88,
              "pack_str(buf, &off, sizeof(buf), \"zub-zub\")");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pack_str(buf, &off, sizeof(buf), "glor-duk");
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 89,
              "pack_str(buf, &off, sizeof(buf), \"glor-duk\")");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = pack_str(buf, &off, sizeof(buf), "loktar");
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 90,
              "pack_str(buf, &off, sizeof(buf), \"loktar\")");
      return __my_ret__;
    }
  } while (0);
  ;
  off2 = 0;
  unpack_str(buf, &off2, off, buf2, sizeof(buf2));
  do {
    int __my_ret__ = strcmp("swubu", buf2);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 94, "strcmp(\"swubu\", buf2)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = unpack_str(buf, &off2, off, buf2, sizeof(buf2));
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 95,
              "unpack_str(buf, &off2, off, buf2, sizeof(buf2))");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = strcmp("zub-zub", buf2);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 96,
              "strcmp(\"zub-zub\", buf2)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = unpack_str(buf, &off2, off, buf2, sizeof(buf2));
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 97,
              "unpack_str(buf, &off2, off, buf2, sizeof(buf2))");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = strcmp("glor-duk", buf2);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 98,
              "strcmp(\"glor-duk\", buf2)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = unpack_str(buf, &off2, off, buf2, sizeof(buf2));
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 99,
              "unpack_str(buf, &off2, off, buf2, sizeof(buf2))");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    int __my_ret__ = strcmp("loktar", buf2);
    if (__my_ret__) {
      fprintf(stderr, "failed on line %d: %s\n", 100,
              "strcmp(\"loktar\", buf2)");
      return __my_ret__;
    }
  } while (0);
  ;
  do {
    if ((-EINVAL) != (unpack_str(buf, &off2, off, buf2, sizeof(buf2)))) {
      fprintf(stderr, "failed on line %d: %s\n", 101, "-EINVAL");
      return 1;
    }
  } while (0);
  ;
  off = 0;
  memset(buf, 0, sizeof(buf));
  do {
    if ((-ENAMETOOLONG) != (pack_str(buf, &off, 4, "toolongstring"))) {
      fprintf(stderr, "failed on line %d: %s\n", 105, "-ENAMETOOLONG");
      return 1;
    }
  } while (0);
  ;
  return 0;
}


x86 assembly (clang, -O0):
<test_packed_string_functions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
movl   $0x0,-0x114(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x114(%rbp),%rsi
mov    $0x80,%edx
lea    0xe5b(%rip),%rcx
call   1070 <pack_str@plt>
mov    %eax,-0x11c(%rbp)
cmpl   $0x0,-0x11c(%rbp)
je     11ec <test_packed_string_functions+0x9c>
mov    0x2e1c(%rip),%rax
mov    (%rax),%edi
lea    0xe39(%rip),%rsi
mov    $0x52,%edx
lea    0xe44(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x11c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    11f1 <test_packed_string_functions+0xa1>
movl   $0x0,-0x118(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x110(%rbp),%rcx
lea    -0x118(%rbp),%rsi
mov    $0x80,%r8d
mov    %r8d,%edx
call   1060 <unpack_str@plt>
mov    %eax,-0x120(%rbp)
cmpl   $0x0,-0x120(%rbp)
je     1260 <test_packed_string_functions+0x110>
mov    0x2da8(%rip),%rax
mov    (%rax),%edi
lea    0xdc5(%rip),%rsi
mov    $0x55,%edx
lea    0xdfa(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x120(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    1265 <test_packed_string_functions+0x115>
jmp    126a <test_packed_string_functions+0x11a>
lea    -0x110(%rbp),%rsi
lea    0xd88(%rip),%rdi
call   1040 <strcmp@plt>
mov    %eax,-0x124(%rbp)
cmpl   $0x0,-0x124(%rbp)
je     12bf <test_packed_string_functions+0x16f>
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
lea    0xd66(%rip),%rsi
mov    $0x56,%edx
lea    0xdd3(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x124(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    12c4 <test_packed_string_functions+0x174>
jmp    12c9 <test_packed_string_functions+0x179>
lea    -0x90(%rbp),%rdi
lea    -0x114(%rbp),%rsi
mov    $0x80,%edx
lea    0xdb2(%rip),%rcx
call   1070 <pack_str@plt>
mov    %eax,-0x128(%rbp)
cmpl   $0x0,-0x128(%rbp)
je     132a <test_packed_string_functions+0x1da>
mov    0x2cde(%rip),%rax
mov    (%rax),%edi
lea    0xcfb(%rip),%rsi
mov    $0x58,%edx
lea    0xd86(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x128(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    132f <test_packed_string_functions+0x1df>
jmp    1334 <test_packed_string_functions+0x1e4>
lea    -0x90(%rbp),%rdi
lea    -0x114(%rbp),%rsi
mov    $0x80,%edx
lea    0xd7b(%rip),%rcx
call   1070 <pack_str@plt>
mov    %eax,-0x12c(%rbp)
cmpl   $0x0,-0x12c(%rbp)
je     1395 <test_packed_string_functions+0x245>
mov    0x2c73(%rip),%rax
mov    (%rax),%edi
lea    0xc90(%rip),%rsi
mov    $0x59,%edx
lea    0xd50(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x12c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    139a <test_packed_string_functions+0x24a>
jmp    139f <test_packed_string_functions+0x24f>
lea    -0x90(%rbp),%rdi
lea    -0x114(%rbp),%rsi
mov    $0x80,%edx
lea    0xd46(%rip),%rcx
call   1070 <pack_str@plt>
mov    %eax,-0x130(%rbp)
cmpl   $0x0,-0x130(%rbp)
je     1400 <test_packed_string_functions+0x2b0>
mov    0x2c08(%rip),%rax
mov    (%rax),%edi
lea    0xc25(%rip),%rsi
mov    $0x5a,%edx
lea    0xd19(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x130(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    1405 <test_packed_string_functions+0x2b5>
movl   $0x0,-0x118(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x114(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    -0x118(%rbp),%rsi
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
lea    -0x110(%rbp),%rsi
lea    0xbbd(%rip),%rdi
call   1040 <strcmp@plt>
mov    %eax,-0x134(%rbp)
cmpl   $0x0,-0x134(%rbp)
je     148a <test_packed_string_functions+0x33a>
mov    0x2b7e(%rip),%rax
mov    (%rax),%edi
lea    0xb9b(%rip),%rsi
mov    $0x5e,%edx
lea    0xc08(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x134(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    148f <test_packed_string_functions+0x33f>
jmp    1494 <test_packed_string_functions+0x344>
lea    -0x90(%rbp),%rdi
mov    -0x114(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    -0x118(%rbp),%rsi
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
mov    %eax,-0x138(%rbp)
cmpl   $0x0,-0x138(%rbp)
je     14fc <test_packed_string_functions+0x3ac>
mov    0x2b0c(%rip),%rax
mov    (%rax),%edi
lea    0xb29(%rip),%rsi
mov    $0x5f,%edx
lea    0xc48(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x138(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    1501 <test_packed_string_functions+0x3b1>
jmp    1506 <test_packed_string_functions+0x3b6>
lea    -0x110(%rbp),%rsi
lea    0xb81(%rip),%rdi
call   1040 <strcmp@plt>
mov    %eax,-0x13c(%rbp)
cmpl   $0x0,-0x13c(%rbp)
je     155b <test_packed_string_functions+0x40b>
mov    0x2aad(%rip),%rax
mov    (%rax),%edi
lea    0xaca(%rip),%rsi
mov    $0x60,%edx
lea    0xc19(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x13c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    1560 <test_packed_string_functions+0x410>
jmp    1565 <test_packed_string_functions+0x415>
lea    -0x90(%rbp),%rdi
mov    -0x114(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    -0x118(%rbp),%rsi
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
mov    %eax,-0x140(%rbp)
cmpl   $0x0,-0x140(%rbp)
je     15cd <test_packed_string_functions+0x47d>
mov    0x2a3b(%rip),%rax
mov    (%rax),%edi
lea    0xa58(%rip),%rsi
mov    $0x61,%edx
lea    0xb77(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x140(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    15d2 <test_packed_string_functions+0x482>
jmp    15d7 <test_packed_string_functions+0x487>
lea    -0x110(%rbp),%rsi
lea    0xae4(%rip),%rdi
call   1040 <strcmp@plt>
mov    %eax,-0x144(%rbp)
cmpl   $0x0,-0x144(%rbp)
je     162c <test_packed_string_functions+0x4dc>
mov    0x29dc(%rip),%rax
mov    (%rax),%edi
lea    0x9f9(%rip),%rsi
mov    $0x62,%edx
lea    0xb60(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x144(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    1631 <test_packed_string_functions+0x4e1>
jmp    1636 <test_packed_string_functions+0x4e6>
lea    -0x90(%rbp),%rdi
mov    -0x114(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    -0x118(%rbp),%rsi
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
mov    %eax,-0x148(%rbp)
cmpl   $0x0,-0x148(%rbp)
je     169e <test_packed_string_functions+0x54e>
mov    0x296a(%rip),%rax
mov    (%rax),%edi
lea    0x987(%rip),%rsi
mov    $0x63,%edx
lea    0xaa6(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x148(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    16a3 <test_packed_string_functions+0x553>
jmp    16a8 <test_packed_string_functions+0x558>
lea    -0x110(%rbp),%rsi
lea    0xa49(%rip),%rdi
call   1040 <strcmp@plt>
mov    %eax,-0x14c(%rbp)
cmpl   $0x0,-0x14c(%rbp)
je     16fd <test_packed_string_functions+0x5ad>
mov    0x290b(%rip),%rax
mov    (%rax),%edi
lea    0x928(%rip),%rsi
mov    $0x64,%edx
lea    0xaa8(%rip),%rcx
call   1050 <fprintf@plt>
mov    -0x14c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    1702 <test_packed_string_functions+0x5b2>
jmp    1707 <test_packed_string_functions+0x5b7>
xor    %eax,%eax
mov    0x28c8(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x150(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x114(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    -0x118(%rbp),%rsi
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
mov    %eax,%ecx
mov    -0x150(%rbp),%eax
cmp    %ecx,%eax
je     177b <test_packed_string_functions+0x62b>
mov    0x288b(%rip),%rax
mov    (%rax),%edi
lea    0x8a8(%rip),%rsi
mov    $0x65,%edx
lea    0xa3f(%rip),%rcx
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    1780 <test_packed_string_functions+0x630>
movl   $0x0,-0x114(%rbp)
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
xor    %eax,%eax
mov    0x282a(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x154(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x114(%rbp),%rsi
mov    $0x4,%edx
lea    0x9e9(%rip),%rcx
call   1070 <pack_str@plt>
mov    %eax,%ecx
mov    -0x154(%rbp),%eax
cmp    %ecx,%eax
je     180a <test_packed_string_functions+0x6ba>
mov    0x27fc(%rip),%rax
mov    (%rax),%edi
lea    0x819(%rip),%rsi
mov    $0x69,%edx
lea    0x9c6(%rip),%rcx
call   1050 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1816 <test_packed_string_functions+0x6c6>
jmp    180f <test_packed_string_functions+0x6bf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_packed_string_functions>:
push   %rbp
push   %r14
push   %rbx
sub    $0x110,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xe28(%rip),%rcx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x80,%edx
call   1070 <pack_str@plt>
test   %eax,%eax
je     1218 <test_packed_string_functions+0xc8>
mov    %eax,%ebx
mov    0x2de7(%rip),%rax
mov    (%rax),%edi
lea    0xe04(%rip),%rsi
lea    0xe14(%rip),%rcx
mov    $0x52,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x90(%rsp),%rcx
mov    $0x80,%edx
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
test   %eax,%eax
je     126e <test_packed_string_functions+0x11e>
mov    %eax,%ebx
mov    0x2d91(%rip),%rax
mov    (%rax),%edi
lea    0xdae(%rip),%rsi
lea    0xde8(%rip),%rcx
mov    $0x55,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
lea    0xd8b(%rip),%rdi
lea    0x90(%rsp),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     12ae <test_packed_string_functions+0x15e>
mov    %eax,%ebx
mov    0x2d51(%rip),%rax
mov    (%rax),%edi
lea    0xd6e(%rip),%rsi
lea    0xde0(%rip),%rcx
mov    $0x56,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
lea    0xde0(%rip),%rcx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x80,%edx
call   1070 <pack_str@plt>
test   %eax,%eax
je     12f5 <test_packed_string_functions+0x1a5>
mov    %eax,%ebx
mov    0x2d0a(%rip),%rax
mov    (%rax),%edi
lea    0xd27(%rip),%rsi
lea    0xdb7(%rip),%rcx
mov    $0x58,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
lea    0xdcd(%rip),%rcx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x80,%edx
call   1070 <pack_str@plt>
test   %eax,%eax
je     133c <test_packed_string_functions+0x1ec>
mov    %eax,%ebx
mov    0x2cc3(%rip),%rax
mov    (%rax),%edi
lea    0xce0(%rip),%rsi
lea    0xda5(%rip),%rcx
mov    $0x59,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
lea    0xdbc(%rip),%rcx
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x80,%edx
call   1070 <pack_str@plt>
test   %eax,%eax
je     1383 <test_packed_string_functions+0x233>
mov    %eax,%ebx
mov    0x2c7c(%rip),%rax
mov    (%rax),%edi
lea    0xc99(%rip),%rsi
lea    0xd92(%rip),%rcx
mov    $0x5a,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
movl   $0x0,0xc(%rsp)
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x90(%rsp),%rbx
mov    %rbx,%rcx
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
lea    0xc4a(%rip),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     13ea <test_packed_string_functions+0x29a>
mov    %eax,%ebx
mov    0x2c15(%rip),%rax
mov    (%rax),%edi
lea    0xc32(%rip),%rsi
lea    0xca4(%rip),%rcx
mov    $0x5e,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x90(%rsp),%rcx
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
test   %eax,%eax
je     1437 <test_packed_string_functions+0x2e7>
mov    %eax,%ebx
mov    0x2bc8(%rip),%rax
mov    (%rax),%edi
lea    0xbe5(%rip),%rsi
lea    0xd09(%rip),%rcx
mov    $0x5f,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
lea    0xc57(%rip),%rdi
lea    0x90(%rsp),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1477 <test_packed_string_functions+0x327>
mov    %eax,%ebx
mov    0x2b88(%rip),%rax
mov    (%rax),%edi
lea    0xba5(%rip),%rsi
lea    0xcf9(%rip),%rcx
mov    $0x60,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x90(%rsp),%rcx
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
test   %eax,%eax
je     14c4 <test_packed_string_functions+0x374>
mov    %eax,%ebx
mov    0x2b3b(%rip),%rax
mov    (%rax),%edi
lea    0xb58(%rip),%rsi
lea    0xc7c(%rip),%rcx
mov    $0x61,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
lea    0xbfe(%rip),%rdi
lea    0x90(%rsp),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1504 <test_packed_string_functions+0x3b4>
mov    %eax,%ebx
mov    0x2afb(%rip),%rax
mov    (%rax),%edi
lea    0xb18(%rip),%rsi
lea    0xc84(%rip),%rcx
mov    $0x62,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x90(%rsp),%rcx
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
test   %eax,%eax
je     1551 <test_packed_string_functions+0x401>
mov    %eax,%ebx
mov    0x2aae(%rip),%rax
mov    (%rax),%edi
lea    0xacb(%rip),%rsi
lea    0xbef(%rip),%rcx
mov    $0x63,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
lea    0xba7(%rip),%rdi
lea    0x90(%rsp),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1591 <test_packed_string_functions+0x441>
mov    %eax,%ebx
mov    0x2a6e(%rip),%rax
mov    (%rax),%edi
lea    0xa8b(%rip),%rsi
lea    0xc10(%rip),%rcx
mov    $0x64,%edx
call   1050 <fprintf@plt>
jmp    1647 <test_packed_string_functions+0x4f7>
mov    0x2a40(%rip),%rax
mov    (%rax),%ebx
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x90(%rsp),%rcx
mov    $0x80,%r8d
call   1060 <unpack_str@plt>
add    %ebx,%eax
jne    1621 <test_packed_string_functions+0x4d1>
movl   $0x0,0x8(%rsp)
lea    0x10(%rsp),%r14
xor    %ebx,%ebx
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x80,%edx
call   1030 <memset@plt>
mov    0x29ec(%rip),%rax
mov    (%rax),%ebp
lea    0xbc4(%rip),%rcx
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
mov    $0x4,%edx
call   1070 <pack_str@plt>
add    %ebp,%eax
je     1647 <test_packed_string_functions+0x4f7>
mov    0x29d6(%rip),%rax
mov    (%rax),%edi
lea    0x9f3(%rip),%rsi
lea    0xba5(%rip),%rcx
mov    $0x69,%edx
jmp    163d <test_packed_string_functions+0x4ed>
mov    0x29b8(%rip),%rax
mov    (%rax),%edi
lea    0x9d5(%rip),%rsi
lea    0xb71(%rip),%rcx
mov    $0x65,%edx
call   1050 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"swubu\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.2 = [42 x i8] c"pack_str(buf, &off, sizeof(buf), \22swubu\22)\00"
@.str.3 = [56 x i8] c"unpack_str(buf, &off2, sizeof(buf), buf2, sizeof(buf2))\00"
@.str.4 = [22 x i8] c"strcmp(\22swubu\22, buf2)\00"
@.str.5 = [8 x i8] c"zub-zub\00"
@.str.6 = [44 x i8] c"pack_str(buf, &off, sizeof(buf), \22zub-zub\22)\00"
@.str.7 = [9 x i8] c"glor-duk\00"
@.str.8 = [45 x i8] c"pack_str(buf, &off, sizeof(buf), \22glor-duk\22)\00"
@.str.9 = [7 x i8] c"loktar\00"
@.str.10 = [43 x i8] c"pack_str(buf, &off, sizeof(buf), \22loktar\22)\00"
@.str.11 = [48 x i8] c"unpack_str(buf, &off2, off, buf2, sizeof(buf2))\00"
@.str.12 = [24 x i8] c"strcmp(\22zub-zub\22, buf2)\00"
@.str.13 = [25 x i8] c"strcmp(\22glor-duk\22, buf2)\00"
@.str.14 = [23 x i8] c"strcmp(\22loktar\22, buf2)\00"
@EINVAL = global i32 0
@.str.15 = [8 x i8] c"-EINVAL\00"
@ENAMETOOLONG = global i32 0
@.str.16 = [14 x i8] c"toolongstring\00"
@.str.17 = [14 x i8] c"-ENAMETOOLONG\00"
define i32 @test_packed_string_functions() {
%1 = alloca i32
%2 = alloca [128 x i8]
%3 = alloca [128 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = bitcast [128 x i8]* %2 to i8*
%20 = bitcast [128 x i8]* %3 to i8*
store i32 0, i32* %4
br label %21
21: ; preds = %0
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%23 = call i32 @pack_str(i8* %22, i32* %4, i32 128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %23, i32* %6
%24 = load i32, i32* %6
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %21
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 82, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%29 = load i32, i32* %6
store i32 %29, i32* %1
br label %201
30: ; preds = %21
br label %31
31: ; preds = %30
store i32 0, i32* %5
br label %32
32: ; preds = %31
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%34 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%35 = call i32 @unpack_str(i8* %33, i32* %5, i32 128, i8* %34, i32 128)
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %42
38: ; preds = %32
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
%41 = load i32, i32* %7
store i32 %41, i32* %1
br label %201
42: ; preds = %32
br label %43
43: ; preds = %42
br label %44
44: ; preds = %43
%45 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%46 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %45)
store i32 %46, i32* %8
%47 = load i32, i32* %8
%48 = icmp ne i32 %47, 0
br i1 %48, label %49, label %53
49: ; preds = %44
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 86, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%52 = load i32, i32* %8
store i32 %52, i32* %1
br label %201
53: ; preds = %44
br label %54
54: ; preds = %53
br label %55
55: ; preds = %54
%56 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%57 = call i32 @pack_str(i8* %56, i32* %4, i32 128, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i32 %57, i32* %9
%58 = load i32, i32* %9
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %64
60: ; preds = %55
%61 = load i32, i32* @stderr
%62 = call i32 @fprintf(i32 %61, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 88, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%63 = load i32, i32* %9
store i32 %63, i32* %1
br label %201
64: ; preds = %55
br label %65
65: ; preds = %64
br label %66
66: ; preds = %65
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%68 = call i32 @pack_str(i8* %67, i32* %4, i32 128, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
store i32 %68, i32* %10
%69 = load i32, i32* %10
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %75
71: ; preds = %66
%72 = load i32, i32* @stderr
%73 = call i32 @fprintf(i32 %72, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 89, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
%74 = load i32, i32* %10
store i32 %74, i32* %1
br label %201
75: ; preds = %66
br label %76
76: ; preds = %75
br label %77
77: ; preds = %76
%78 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%79 = call i32 @pack_str(i8* %78, i32* %4, i32 128, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
store i32 %79, i32* %11
%80 = load i32, i32* %11
%81 = icmp ne i32 %80, 0
br i1 %81, label %82, label %86
82: ; preds = %77
%83 = load i32, i32* @stderr
%84 = call i32 @fprintf(i32 %83, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0))
%85 = load i32, i32* %11
store i32 %85, i32* %1
br label %201
86: ; preds = %77
br label %87
87: ; preds = %86
store i32 0, i32* %5
%88 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%89 = load i32, i32* %4
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%91 = call i32 @unpack_str(i8* %88, i32* %5, i32 %89, i8* %90, i32 128)
br label %92
92: ; preds = %87
%93 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%94 = call i32 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %93)
store i32 %94, i32* %12
%95 = load i32, i32* %12
%96 = icmp ne i32 %95, 0
br i1 %96, label %97, label %101
97: ; preds = %92
%98 = load i32, i32* @stderr
%99 = call i32 @fprintf(i32 %98, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 94, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
%100 = load i32, i32* %12
store i32 %100, i32* %1
br label %201
101: ; preds = %92
br label %102
102: ; preds = %101
br label %103
103: ; preds = %102
%104 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%105 = load i32, i32* %4
%106 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%107 = call i32 @unpack_str(i8* %104, i32* %5, i32 %105, i8* %106, i32 128)
store i32 %107, i32* %13
%108 = load i32, i32* %13
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %114
110: ; preds = %103
%111 = load i32, i32* @stderr
%112 = call i32 @fprintf(i32 %111, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
%113 = load i32, i32* %13
store i32 %113, i32* %1
br label %201
114: ; preds = %103
br label %115
115: ; preds = %114
br label %116
116: ; preds = %115
%117 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%118 = call i32 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %117)
store i32 %118, i32* %14
%119 = load i32, i32* %14
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %125
121: ; preds = %116
%122 = load i32, i32* @stderr
%123 = call i32 @fprintf(i32 %122, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 96, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0))
%124 = load i32, i32* %14
store i32 %124, i32* %1
br label %201
125: ; preds = %116
br label %126
126: ; preds = %125
br label %127
127: ; preds = %126
%128 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%129 = load i32, i32* %4
%130 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%131 = call i32 @unpack_str(i8* %128, i32* %5, i32 %129, i8* %130, i32 128)
store i32 %131, i32* %15
%132 = load i32, i32* %15
%133 = icmp ne i32 %132, 0
br i1 %133, label %134, label %138
134: ; preds = %127
%135 = load i32, i32* @stderr
%136 = call i32 @fprintf(i32 %135, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 97, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
%137 = load i32, i32* %15
store i32 %137, i32* %1
br label %201
138: ; preds = %127
br label %139
139: ; preds = %138
br label %140
140: ; preds = %139
%141 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%142 = call i32 @strcmp(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* %141)
store i32 %142, i32* %16
%143 = load i32, i32* %16
%144 = icmp ne i32 %143, 0
br i1 %144, label %145, label %149
145: ; preds = %140
%146 = load i32, i32* @stderr
%147 = call i32 @fprintf(i32 %146, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 98, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
%148 = load i32, i32* %16
store i32 %148, i32* %1
br label %201
149: ; preds = %140
br label %150
150: ; preds = %149
br label %151
151: ; preds = %150
%152 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%153 = load i32, i32* %4
%154 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%155 = call i32 @unpack_str(i8* %152, i32* %5, i32 %153, i8* %154, i32 128)
store i32 %155, i32* %17
%156 = load i32, i32* %17
%157 = icmp ne i32 %156, 0
br i1 %157, label %158, label %162
158: ; preds = %151
%159 = load i32, i32* @stderr
%160 = call i32 @fprintf(i32 %159, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 99, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
%161 = load i32, i32* %17
store i32 %161, i32* %1
br label %201
162: ; preds = %151
br label %163
163: ; preds = %162
br label %164
164: ; preds = %163
%165 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%166 = call i32 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %165)
store i32 %166, i32* %18
%167 = load i32, i32* %18
%168 = icmp ne i32 %167, 0
br i1 %168, label %169, label %173
169: ; preds = %164
%170 = load i32, i32* @stderr
%171 = call i32 @fprintf(i32 %170, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%172 = load i32, i32* %18
store i32 %172, i32* %1
br label %201
173: ; preds = %164
br label %174
174: ; preds = %173
br label %175
175: ; preds = %174
%176 = load i32, i32* @EINVAL
%177 = sub nsw i32 0, %176
%178 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%179 = load i32, i32* %4
%180 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%181 = call i32 @unpack_str(i8* %178, i32* %5, i32 %179, i8* %180, i32 128)
%182 = icmp ne i32 %177, %181
br i1 %182, label %183, label %186
183: ; preds = %175
%184 = load i32, i32* @stderr
%185 = call i32 @fprintf(i32 %184, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 101, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
store i32 1, i32* %1
br label %201
186: ; preds = %175
br label %187
187: ; preds = %186
store i32 0, i32* %4
%188 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%189 = call i32 @memset(i8* %188, i32 0, i32 128)
br label %190
190: ; preds = %187
%191 = load i32, i32* @ENAMETOOLONG
%192 = sub nsw i32 0, %191
%193 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%194 = call i32 @pack_str(i8* %193, i32* %4, i32 4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
%195 = icmp ne i32 %192, %194
br i1 %195, label %196, label %199
196: ; preds = %190
%197 = load i32, i32* @stderr
%198 = call i32 @fprintf(i32 %197, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
store i32 1, i32* %1
br label %201
199: ; preds = %190
br label %200
200: ; preds = %199
store i32 0, i32* %1
br label %201
201: ; preds = %200, %196, %183, %169, %158, %145, %134, %121, %110, %97, %82, %71, %60, %49, %38, %26
%202 = load i32, i32* %1
ret i32 %202
}

LLVM IR (-O2):
@.str = [6 x i8] c"swubu\00"
@stderr = global i32 0
@.str.1 = [23 x i8] c"failed on line %d: %s\0A\00"
@.str.2 = [42 x i8] c"pack_str(buf, &off, sizeof(buf), \22swubu\22)\00"
@.str.3 = [56 x i8] c"unpack_str(buf, &off2, sizeof(buf), buf2, sizeof(buf2))\00"
@.str.4 = [22 x i8] c"strcmp(\22swubu\22, buf2)\00"
@.str.5 = [8 x i8] c"zub-zub\00"
@.str.6 = [44 x i8] c"pack_str(buf, &off, sizeof(buf), \22zub-zub\22)\00"
@.str.7 = [9 x i8] c"glor-duk\00"
@.str.8 = [45 x i8] c"pack_str(buf, &off, sizeof(buf), \22glor-duk\22)\00"
@.str.9 = [7 x i8] c"loktar\00"
@.str.10 = [43 x i8] c"pack_str(buf, &off, sizeof(buf), \22loktar\22)\00"
@.str.11 = [48 x i8] c"unpack_str(buf, &off2, off, buf2, sizeof(buf2))\00"
@.str.12 = [24 x i8] c"strcmp(\22zub-zub\22, buf2)\00"
@.str.13 = [25 x i8] c"strcmp(\22glor-duk\22, buf2)\00"
@.str.14 = [23 x i8] c"strcmp(\22loktar\22, buf2)\00"
@EINVAL = global i32 0
@.str.15 = [8 x i8] c"-EINVAL\00"
@ENAMETOOLONG = global i32 0
@.str.16 = [14 x i8] c"toolongstring\00"
@.str.17 = [14 x i8] c"-ENAMETOOLONG\00"
define i32 @test_packed_string_functions() {
%1 = alloca [128 x i8]
%2 = alloca [128 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %2, i64 0, i64 0
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %3
%9 = call i32 @pack_str(i8* %5, i32* %3, i32 128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %0
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 82, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
br label %109
14: ; preds = %0
store i32 0, i32* %4
%15 = call i32 @unpack_str(i8* %5, i32* %4, i32 128, i8* %6, i32 128)
%16 = icmp eq i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 85, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.3, i64 0, i64 0))
br label %109
20: ; preds = %14
%21 = call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%22 = icmp eq i32 %21, 0
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i32, i32* @stderr
%25 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 86, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %109
26: ; preds = %20
%27 = call i32 @pack_str(i8* %5, i32* %3, i32 128, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%28 = icmp eq i32 %27, 0
br i1 %28, label %32, label %29
29: ; preds = %26
%30 = load i32, i32* @stderr
%31 = call i32 @fprintf(i32 %30, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 88, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %109
32: ; preds = %26
%33 = call i32 @pack_str(i8* %5, i32* %3, i32 128, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%34 = icmp eq i32 %33, 0
br i1 %34, label %38, label %35
35: ; preds = %32
%36 = load i32, i32* @stderr
%37 = call i32 @fprintf(i32 %36, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 89, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.8, i64 0, i64 0))
br label %109
38: ; preds = %32
%39 = call i32 @pack_str(i8* %5, i32* %3, i32 128, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%40 = icmp eq i32 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.10, i64 0, i64 0))
br label %109
44: ; preds = %38
store i32 0, i32* %4
%45 = load i32, i32* %3
%46 = call i32 @unpack_str(i8* %5, i32* %4, i32 %45, i8* %6, i32 128)
%47 = call i32 @strcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6)
%48 = icmp eq i32 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %44
%50 = load i32, i32* @stderr
%51 = call i32 @fprintf(i32 %50, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 94, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0))
br label %109
52: ; preds = %44
%53 = load i32, i32* %3
%54 = call i32 @unpack_str(i8* %5, i32* %4, i32 %53, i8* %6, i32 128)
%55 = icmp eq i32 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %52
%57 = load i32, i32* @stderr
%58 = call i32 @fprintf(i32 %57, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 95, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
br label %109
59: ; preds = %52
%60 = call i32 @strcmp(i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%61 = icmp eq i32 %60, 0
br i1 %61, label %65, label %62
62: ; preds = %59
%63 = load i32, i32* @stderr
%64 = call i32 @fprintf(i32 %63, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 96, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.12, i64 0, i64 0))
br label %109
65: ; preds = %59
%66 = load i32, i32* %3
%67 = call i32 @unpack_str(i8* %5, i32* %4, i32 %66, i8* %6, i32 128)
%68 = icmp eq i32 %67, 0
br i1 %68, label %72, label %69
69: ; preds = %65
%70 = load i32, i32* @stderr
%71 = call i32 @fprintf(i32 %70, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 97, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
br label %109
72: ; preds = %65
%73 = call i32 @strcmp(i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* %6)
%74 = icmp eq i32 %73, 0
br i1 %74, label %78, label %75
75: ; preds = %72
%76 = load i32, i32* @stderr
%77 = call i32 @fprintf(i32 %76, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 98, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
br label %109
78: ; preds = %72
%79 = load i32, i32* %3
%80 = call i32 @unpack_str(i8* %5, i32* %4, i32 %79, i8* %6, i32 128)
%81 = icmp eq i32 %80, 0
br i1 %81, label %85, label %82
82: ; preds = %78
%83 = load i32, i32* @stderr
%84 = call i32 @fprintf(i32 %83, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 99, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.11, i64 0, i64 0))
br label %109
85: ; preds = %78
%86 = call i32 @strcmp(i8* dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %6)
%87 = icmp eq i32 %86, 0
br i1 %87, label %91, label %88
88: ; preds = %85
%89 = load i32, i32* @stderr
%90 = call i32 @fprintf(i32 %89, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 100, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
br label %109
91: ; preds = %85
%92 = load i32, i32* @EINVAL
%93 = sub nsw i32 0, %92
%94 = load i32, i32* %3
%95 = call i32 @unpack_str(i8* %5, i32* %4, i32 %94, i8* %6, i32 128)
%96 = icmp eq i32 %95, %93
br i1 %96, label %100, label %97
97: ; preds = %91
%98 = load i32, i32* @stderr
%99 = call i32 @fprintf(i32 %98, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 101, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
br label %109
100: ; preds = %91
store i32 0, i32* %3
%101 = call i32 @memset(i8* %5, i32 0, i32 128)
%102 = load i32, i32* @ENAMETOOLONG
%103 = sub nsw i32 0, %102
%104 = call i32 @pack_str(i8* %5, i32* %3, i32 4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0))
%105 = icmp eq i32 %104, %103
br i1 %105, label %109, label %106
106: ; preds = %100
%107 = load i32, i32* @stderr
%108 = call i32 @fprintf(i32 %107, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 105, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
br label %109
109: ; preds = %88, %82, %75, %69, %62, %56, %49, %41, %35, %29, %23, %17, %11, %100, %106, %97
%110 = phi i32 [ 1, %97 ], [ 1, %106 ], [ %86, %88 ], [ %80, %82 ], [ %73, %75 ], [ %67, %69 ], [ %60, %62 ], [ %54, %56 ], [ %47, %49 ], [ %39, %41 ], [ %33, %35 ], [ %27, %29 ], [ %21, %23 ], [ %15, %17 ], [ %9, %11 ], [ 0, %100 ]
ret i32 %110
}