#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 /*<<< orphan*/ temp;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
size_t strlcat(char *, char *, int);
size_t strlcpy(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
int main(void) {
  char temp[8];
  size_t len;
  printf("strlcpy:\n");
  len = strlcpy(temp, "123", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "123") != 0)
    goto error;
  len = strlcpy(temp, "", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "") != 0)
    goto error;
  len = strlcpy(temp, "1234567890", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "1234567") != 0)
    goto error;
  len = strlcpy(temp, "123", 1);
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "") != 0)
    goto error;
  len = strlcpy(temp, "1234567890", 1);
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "") != 0)
    goto error;
  len = strlcpy(temp, "123", 0);
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "") != 0)
    goto error;
  len = strlcpy(temp, "1234567890", 0);
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "") != 0)
    goto error;
  len = strlcpy(temp, "1234567", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "1234567") != 0)
    goto error;
  len = strlcpy(temp, "12345678", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "1234567") != 0)
    goto error;
  printf("\n");
  printf("strlcat:\n");
  strcpy(temp, "");
  len = strlcat(temp, "123", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "123") != 0)
    goto error;
  strcpy(temp, "ABC");
  len = strlcat(temp, "", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "ABC") != 0)
    goto error;
  strcpy(temp, "");
  len = strlcat(temp, "", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "") != 0)
    goto error;
  strcpy(temp, "ABC");
  len = strlcat(temp, "123", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "ABC123") != 0)
    goto error;
  strcpy(temp, "ABC");
  len = strlcat(temp, "1234567890", sizeof(temp));
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "ABC1234") != 0)
    goto error;
  strcpy(temp, "ABC");
  len = strlcat(temp, "123", 5);
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "ABC1") != 0)
    goto error;
  strcpy(temp, "ABC");
  len = strlcat(temp, "123", 1);
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "ABC") != 0)
    goto error;
  strcpy(temp, "ABC");
  len = strlcat(temp, "123", 0);
  printf("'%s'len:%zu strlen:%zu\n", temp, len, strlen(temp));
  if (strcmp(temp, "ABC") != 0)
    goto error;
  exit(0);
error:
  printf("unexpected result\n");
  exit(1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xeb4(%rip),%rsi
mov    $0x8,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xe6a(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     11f9 <main+0x89>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xe43(%rip),%rsi
mov    $0x8,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    %eax,%ecx
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xdf9(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1262 <main+0xf2>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xdb5(%rip),%rsi
mov    $0x8,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    %eax,%ecx
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xd76(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     12cb <main+0x15b>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xd79(%rip),%rsi
mov    $0x1,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x58(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    %eax,%ecx
lea    0xcfc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xd27(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1334 <main+0x1c4>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xce3(%rip),%rsi
mov    $0x1,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x68(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    %eax,%ecx
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xcbe(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     139d <main+0x22d>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xca7(%rip),%rsi
xor    %edx,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x78(%rbp),%rsi
mov    -0x70(%rbp),%rdx
mov    %eax,%ecx
lea    0xc2d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xc58(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1403 <main+0x293>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xc14(%rip),%rsi
xor    %edx,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x80(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    %eax,%ecx
lea    0xbc1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xbec(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     146f <main+0x2ff>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xbb3(%rip),%rsi
mov    $0x8,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x98(%rbp),%rsi
mov    -0x90(%rbp),%rdx
mov    %eax,%ecx
lea    0xb4c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xb5d(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     14e4 <main+0x374>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xb46(%rip),%rsi
mov    $0x8,%edx
call   1080 <strlcpy@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xa8(%rbp),%rsi
mov    -0xa0(%rbp),%rdx
mov    %eax,%ecx
lea    0xad7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xae8(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1559 <main+0x3e9>
jmp    19a1 <main+0x831>
lea    0xae6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xad0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xac7(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdi
lea    0xabf(%rip),%rsi
mov    $0x8,%edx
call   1040 <strlcat@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xb8(%rbp),%rsi
mov    -0xb0(%rbp),%rdx
mov    %eax,%ecx
lea    0xa36(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0xa69(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     15fa <main+0x48a>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0xa43(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdi
lea    0xa32(%rip),%rsi
mov    $0x8,%edx
call   1040 <strlcat@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xc0(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xc8(%rbp),%rsi
mov    -0xc0(%rbp),%rdx
mov    %eax,%ecx
lea    0x9b1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0x9dd(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     167f <main+0x50f>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0x9bd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdi
lea    0x9ad(%rip),%rsi
mov    $0x8,%edx
call   1040 <strlcat@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0xd8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xd0(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xd8(%rbp),%rsi
mov    -0xd0(%rbp),%rdx
mov    %eax,%ecx
lea    0x92c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0x957(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1704 <main+0x594>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0x939(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdi
lea    0x930(%rip),%rsi
mov    $0x8,%edx
call   1040 <strlcat@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0xe8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xe0(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xe8(%rbp),%rsi
mov    -0xe0(%rbp),%rdx
mov    %eax,%ecx
lea    0x8a7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0x8d7(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1789 <main+0x619>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0x8b4(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdi
lea    0x87e(%rip),%rsi
mov    $0x8,%edx
call   1040 <strlcat@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0xf8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xf0(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0xf8(%rbp),%rsi
mov    -0xf0(%rbp),%rdx
mov    %eax,%ecx
lea    0x822(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0x859(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     180e <main+0x69e>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0x82f(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdi
lea    0x826(%rip),%rsi
mov    $0x5,%edx
call   1040 <strlcat@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x108(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x100(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x108(%rbp),%rsi
mov    -0x100(%rbp),%rdx
mov    %eax,%ecx
lea    0x79d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0x7dc(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1893 <main+0x723>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0x7aa(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdi
lea    0x7a1(%rip),%rsi
mov    $0x1,%edx
call   1040 <strlcat@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x118(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x110(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x118(%rbp),%rsi
mov    -0x110(%rbp),%rdx
mov    %eax,%ecx
lea    0x718(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0x744(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     1918 <main+0x7a8>
jmp    19a1 <main+0x831>
lea    -0xc(%rbp),%rdi
lea    0x725(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xc(%rbp),%rdi
lea    0x71c(%rip),%rsi
xor    %edx,%edx
call   1040 <strlcat@plt>
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x120(%rbp)
lea    -0xc(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x128(%rbp),%rsi
mov    -0x120(%rbp),%rdx
mov    %eax,%ecx
lea    0x696(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    0x6c2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     199a <main+0x82a>
jmp    19a1 <main+0x831>
xor    %edi,%edi
call   1090 <exit@plt>
lea    0x6b8(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeac(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8f(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0xe2d(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xe1a(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0xddc(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xdca(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x8,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0xd8e(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd9b(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xd9b(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0xd3c(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd3d(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xd26(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x1,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0xcea(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xceb(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xcf7(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %edx,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0xc9b(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc9c(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xc85(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %edx,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0xc4c(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xc4d(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xc41(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0xbf7(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xbf8(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
mov    $0x8,%edx
call   10a0 <strlcpy@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0xba9(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xbb6(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xbc6(%rip),%rdi
call   1050 <puts@plt>
lea    0xb7c(%rip),%rsi
lea    0x8(%rsp),%r15
mov    %r15,%rdi
call   1040 <strcpy@plt>
lea    0xb8c(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1060 <strlcat@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0xb2f(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xb39(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
lea    0xb05(%rip),%rsi
mov    %r15,%rdi
mov    $0x8,%edx
call   1060 <strlcat@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0xacf(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xabc(%rip),%r14
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
call   1060 <strlcat@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1070 <strlen@plt>
lea    0xa73(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xa7d(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <strcpy@plt>
lea    0xa70(%rip),%rsi
mov    %r14,%rdi
mov    $0x8,%edx
call   1060 <strlcat@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0xa16(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xa38(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0xa1c(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <strcpy@plt>
lea    0x9ec(%rip),%rsi
mov    %r14,%rdi
mov    $0x8,%edx
call   1060 <strlcat@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0x9b5(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x9de(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0x9bb(%rip),%rsi
lea    0x8(%rsp),%r14
mov    %r14,%rdi
call   1040 <strcpy@plt>
lea    0x9ae(%rip),%rsi
mov    %r14,%rdi
mov    $0x5,%edx
call   1060 <strlcat@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1070 <strlen@plt>
lea    0x954(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
lea    0x985(%rip),%rsi
mov    %r14,%rdi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0x95a(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
lea    0x94a(%rip),%rsi
mov    %r15,%rdi
mov    $0x1,%edx
call   1060 <strlcat@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0x8f0(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
lea    0x8fe(%rip),%r14
lea    0x8(%rsp),%r15
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
lea    0x8ee(%rip),%rsi
mov    %r15,%rdi
xor    %edx,%edx
call   1060 <strlcat@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1070 <strlen@plt>
lea    0x897(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    178f <main+0x5ff>
xor    %edi,%edi
call   10b0 <exit@plt>
lea    0x8c8(%rip),%rdi
call   1050 <puts@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"strlcpy:\0A\00"
@.str.1 = [4 x i8] c"123\00"
@.str.2 = [24 x i8] c"'%s'len:%zu strlen:%zu\0A\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [11 x i8] c"1234567890\00"
@.str.5 = [8 x i8] c"1234567\00"
@.str.6 = [9 x i8] c"12345678\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [10 x i8] c"strlcat:\0A\00"
@.str.9 = [4 x i8] c"ABC\00"
@.str.10 = [7 x i8] c"ABC123\00"
@.str.11 = [8 x i8] c"ABC1234\00"
@.str.12 = [5 x i8] c"ABC1\00"
@.str.13 = [19 x i8] c"unexpected result\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%6 = call i64 @strlcpy(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
store i64 %6, i64* %3
%7 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%8 = load i64, i64* %3
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %7, i64 %8, i32 %10)
%12 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %0
br label %228
16: ; preds = %0
%17 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%18 = call i64 @strlcpy(i8* %17, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 8)
store i64 %18, i64* %3
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%20 = load i64, i64* %3
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %19, i64 %20, i32 %22)
%24 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%25 = call i64 @strcmp(i8* %24, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %16
br label %228
28: ; preds = %16
%29 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%30 = call i64 @strlcpy(i8* %29, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 8)
store i64 %30, i64* %3
%31 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%32 = load i64, i64* %3
%33 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%34 = call i32 @strlen(i8* %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %31, i64 %32, i32 %34)
%36 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%38 = icmp ne i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %28
br label %228
40: ; preds = %28
%41 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%42 = call i64 @strlcpy(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
store i64 %42, i64* %3
%43 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%44 = load i64, i64* %3
%45 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%46 = call i32 @strlen(i8* %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %43, i64 %44, i32 %46)
%48 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%49 = call i64 @strcmp(i8* %48, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %40
br label %228
52: ; preds = %40
%53 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%54 = call i64 @strlcpy(i8* %53, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 1)
store i64 %54, i64* %3
%55 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%56 = load i64, i64* %3
%57 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%58 = call i32 @strlen(i8* %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %55, i64 %56, i32 %58)
%60 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%61 = call i64 @strcmp(i8* %60, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%62 = icmp ne i64 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %52
br label %228
64: ; preds = %52
%65 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%66 = call i64 @strlcpy(i8* %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
store i64 %66, i64* %3
%67 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%68 = load i64, i64* %3
%69 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%70 = call i32 @strlen(i8* %69)
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %67, i64 %68, i32 %70)
%72 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%73 = call i64 @strcmp(i8* %72, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%74 = icmp ne i64 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %64
br label %228
76: ; preds = %64
%77 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%78 = call i64 @strlcpy(i8* %77, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 0)
store i64 %78, i64* %3
%79 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%80 = load i64, i64* %3
%81 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%82 = call i32 @strlen(i8* %81)
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %79, i64 %80, i32 %82)
%84 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%85 = call i64 @strcmp(i8* %84, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %88
87: ; preds = %76
br label %228
88: ; preds = %76
%89 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%90 = call i64 @strlcpy(i8* %89, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 8)
store i64 %90, i64* %3
%91 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%92 = load i64, i64* %3
%93 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%94 = call i32 @strlen(i8* %93)
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %91, i64 %92, i32 %94)
%96 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%97 = call i64 @strcmp(i8* %96, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%98 = icmp ne i64 %97, 0
br i1 %98, label %99, label %100
99: ; preds = %88
br label %228
100: ; preds = %88
%101 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%102 = call i64 @strlcpy(i8* %101, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 8)
store i64 %102, i64* %3
%103 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%104 = load i64, i64* %3
%105 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%106 = call i32 @strlen(i8* %105)
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %103, i64 %104, i32 %106)
%108 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%109 = call i64 @strcmp(i8* %108, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%110 = icmp ne i64 %109, 0
br i1 %110, label %111, label %112
111: ; preds = %100
br label %228
112: ; preds = %100
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0))
%115 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%116 = call i32 @strcpy(i8* %115, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%117 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%118 = call i64 @strlcat(i8* %117, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
store i64 %118, i64* %3
%119 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%120 = load i64, i64* %3
%121 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%122 = call i32 @strlen(i8* %121)
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %119, i64 %120, i32 %122)
%124 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%125 = call i64 @strcmp(i8* %124, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%126 = icmp ne i64 %125, 0
br i1 %126, label %127, label %128
127: ; preds = %112
br label %228
128: ; preds = %112
%129 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%130 = call i32 @strcpy(i8* %129, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%131 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%132 = call i64 @strlcat(i8* %131, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 8)
store i64 %132, i64* %3
%133 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%134 = load i64, i64* %3
%135 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%136 = call i32 @strlen(i8* %135)
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %133, i64 %134, i32 %136)
%138 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%139 = call i64 @strcmp(i8* %138, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%140 = icmp ne i64 %139, 0
br i1 %140, label %141, label %142
141: ; preds = %128
br label %228
142: ; preds = %128
%143 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%144 = call i32 @strcpy(i8* %143, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%145 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%146 = call i64 @strlcat(i8* %145, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 8)
store i64 %146, i64* %3
%147 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%148 = load i64, i64* %3
%149 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%150 = call i32 @strlen(i8* %149)
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %147, i64 %148, i32 %150)
%152 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%153 = call i64 @strcmp(i8* %152, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%154 = icmp ne i64 %153, 0
br i1 %154, label %155, label %156
155: ; preds = %142
br label %228
156: ; preds = %142
%157 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%158 = call i32 @strcpy(i8* %157, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%159 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%160 = call i64 @strlcat(i8* %159, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
store i64 %160, i64* %3
%161 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%162 = load i64, i64* %3
%163 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%164 = call i32 @strlen(i8* %163)
%165 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %161, i64 %162, i32 %164)
%166 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%167 = call i64 @strcmp(i8* %166, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%168 = icmp ne i64 %167, 0
br i1 %168, label %169, label %170
169: ; preds = %156
br label %228
170: ; preds = %156
%171 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%172 = call i32 @strcpy(i8* %171, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%173 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%174 = call i64 @strlcat(i8* %173, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 8)
store i64 %174, i64* %3
%175 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%176 = load i64, i64* %3
%177 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%178 = call i32 @strlen(i8* %177)
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %175, i64 %176, i32 %178)
%180 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%181 = call i64 @strcmp(i8* %180, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%182 = icmp ne i64 %181, 0
br i1 %182, label %183, label %184
183: ; preds = %170
br label %228
184: ; preds = %170
%185 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%186 = call i32 @strcpy(i8* %185, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%187 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%188 = call i64 @strlcat(i8* %187, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
store i64 %188, i64* %3
%189 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%190 = load i64, i64* %3
%191 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%192 = call i32 @strlen(i8* %191)
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %189, i64 %190, i32 %192)
%194 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%195 = call i64 @strcmp(i8* %194, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%196 = icmp ne i64 %195, 0
br i1 %196, label %197, label %198
197: ; preds = %184
br label %228
198: ; preds = %184
%199 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%200 = call i32 @strcpy(i8* %199, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%201 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%202 = call i64 @strlcat(i8* %201, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
store i64 %202, i64* %3
%203 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%204 = load i64, i64* %3
%205 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%206 = call i32 @strlen(i8* %205)
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %203, i64 %204, i32 %206)
%208 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%209 = call i64 @strcmp(i8* %208, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%210 = icmp ne i64 %209, 0
br i1 %210, label %211, label %212
211: ; preds = %198
br label %228
212: ; preds = %198
%213 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%214 = call i32 @strcpy(i8* %213, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%215 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%216 = call i64 @strlcat(i8* %215, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
store i64 %216, i64* %3
%217 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%218 = load i64, i64* %3
%219 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%220 = call i32 @strlen(i8* %219)
%221 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %217, i64 %218, i32 %220)
%222 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%223 = call i64 @strcmp(i8* %222, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%224 = icmp ne i64 %223, 0
br i1 %224, label %225, label %226
225: ; preds = %212
br label %228
226: ; preds = %212
%227 = call i32 @exit(i32 0)
unreachable
228: ; preds = %225, %211, %197, %183, %169, %155, %141, %127, %111, %99, %87, %75, %63, %51, %39, %27, %15
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0))
%230 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"123\00"
@.str.2 = [24 x i8] c"'%s'len:%zu strlen:%zu\0A\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [11 x i8] c"1234567890\00"
@.str.5 = [8 x i8] c"1234567\00"
@.str.6 = [9 x i8] c"12345678\00"
@.str.9 = [4 x i8] c"ABC\00"
@.str.10 = [7 x i8] c"ABC123\00"
@.str.11 = [8 x i8] c"ABC1234\00"
@.str.12 = [5 x i8] c"ABC1\00"
@str = [9 x i8] c"strlcpy:\00"
@str.14 = [9 x i8] c"strlcat:\00"
@str.15 = [18 x i8] c"unexpected result\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%4 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %4, i32 %5)
%7 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %117
9: ; preds = %0
%10 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 8)
%11 = call i32 @strlen(i8* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %10, i32 %11)
%13 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %117
15: ; preds = %9
%16 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 8)
%17 = call i32 @strlen(i8* %2)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %16, i32 %17)
%19 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %117
21: ; preds = %15
%22 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%23 = call i32 @strlen(i8* %2)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %22, i32 %23)
%25 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%26 = icmp eq i64 %25, 0
br i1 %26, label %27, label %117
27: ; preds = %21
%28 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 1)
%29 = call i32 @strlen(i8* %2)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %28, i32 %29)
%31 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %117
33: ; preds = %27
%34 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
%35 = call i32 @strlen(i8* %2)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %34, i32 %35)
%37 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %117
39: ; preds = %33
%40 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 0)
%41 = call i32 @strlen(i8* %2)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %40, i32 %41)
%43 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %45, label %117
45: ; preds = %39
%46 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 8)
%47 = call i32 @strlen(i8* %2)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %46, i32 %47)
%49 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %117
51: ; preds = %45
%52 = call i64 @strlcpy(i8* %2, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 8)
%53 = call i32 @strlen(i8* %2)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %52, i32 %53)
%55 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%56 = icmp eq i64 %55, 0
br i1 %56, label %57, label %117
57: ; preds = %51
%58 = call i32 @putchar(i32 10)
%59 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.14, i64 0, i64 0))
%60 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%61 = call i64 @strlcat(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
%62 = call i32 @strlen(i8* %2)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %61, i32 %62)
%64 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %66, label %117
66: ; preds = %57
%67 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%68 = call i64 @strlcat(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 8)
%69 = call i32 @strlen(i8* %2)
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %68, i32 %69)
%71 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%72 = icmp eq i64 %71, 0
br i1 %72, label %73, label %117
73: ; preds = %66
%74 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%75 = call i64 @strlcat(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0), i32 8)
%76 = call i32 @strlen(i8* %2)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %75, i32 %76)
%78 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %117
80: ; preds = %73
%81 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%82 = call i64 @strlcat(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 8)
%83 = call i32 @strlen(i8* %2)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %82, i32 %83)
%85 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %117
87: ; preds = %80
%88 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%89 = call i64 @strlcat(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 8)
%90 = call i32 @strlen(i8* %2)
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %89, i32 %90)
%92 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0))
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %117
94: ; preds = %87
%95 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%96 = call i64 @strlcat(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 5)
%97 = call i32 @strlen(i8* %2)
%98 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %96, i32 %97)
%99 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %101, label %117
101: ; preds = %94
%102 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%103 = call i64 @strlcat(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 1)
%104 = call i32 @strlen(i8* %2)
%105 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %103, i32 %104)
%106 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%107 = icmp eq i64 %106, 0
br i1 %107, label %108, label %117
108: ; preds = %101
%109 = call i32 @strcpy(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%110 = call i64 @strlcat(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0)
%111 = call i32 @strlen(i8* %2)
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %2, i64 %110, i32 %111)
%113 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0))
%114 = icmp eq i64 %113, 0
br i1 %114, label %115, label %117
115: ; preds = %108
%116 = call i32 @exit(i32 0)
unreachable
117: ; preds = %108, %101, %94, %87, %80, %73, %66, %57, %51, %45, %39, %33, %27, %21, %15, %9, %0
%118 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.15, i64 0, i64 0))
%119 = call i32 @exit(i32 1)
unreachable
}