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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, char *, int);
int /*<<< orphan*/ memset(int *, char, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ run_test(int *, int, int *, int, char);
int main() {
  uint8_t byte, buf[10], small[5], i;
  uint32_t dst_offset, dst_len, src_offset, src_len;
  printf("--- test 1 ---\n");
  run_test(NULL, 0, NULL, 0, 0x00);
  run_test(NULL, 0, NULL, 0, 0xFF);
  run_test(NULL, 0, NULL, 5, 0x00);
  run_test(NULL, 0, NULL, 5, 0xFF);
  run_test(NULL, 0, buf, sizeof buf, 0x00);
  run_test(NULL, 0, buf, sizeof buf, 0xFF);
  printf("--- test 2 ---\n");
  run_test(&byte, 1, NULL, 0, 'a');
  memset(buf, 'x', sizeof buf);
  run_test(buf, sizeof buf, NULL, 0, 'a');
  printf("--- test 3 ---\n");
  byte = 'x';
  run_test(&byte, 1, &byte, 1, 'a');
  memset(buf, 'x', sizeof buf);
  for (i = 0; i <= sizeof buf; ++i)
    run_test(buf, i, buf, sizeof buf, 'a');
  printf("--- test 4 ---\n");
  memset(buf, 'b', sizeof buf);
  memset(small, 's', sizeof small);
  run_test(buf, sizeof buf, small, sizeof small, 'a');
  printf("--- test 5 ---\n");
  memset(buf, 'b', sizeof buf);
  memset(small, 's', sizeof small);
  run_test(small, sizeof small, buf, sizeof buf, 'a');
  printf("--- test 6 ---\n");
  memcpy(buf, "0123456789", 10);
  run_test(buf, sizeof buf, buf + 5, 5, 'x');
  printf("--- test 7 ---\n");
  memcpy(buf, "0123456789", 10);
  run_test(buf, 5, buf + 4, 3, 'x');
  printf("--- test 8 ---\n");
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 1, buf, 10, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 2, buf, 10, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 3, buf, 10, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 4, buf, 10, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 5, buf, 10, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 6, buf, 10, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 7, buf, 10, 'x');
  printf("--- test 9 ---\n");
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 1, buf, 0, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 2, buf, 0, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 3, buf, 0, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 4, buf, 0, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 4, buf, 0, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 5, buf, 0, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 6, buf, 0, 'x');
  memcpy(buf, "0123456789", 10);
  run_test(buf + 3, 7, buf, 0, 'x');
  printf("--- test 9 ---\n");
  for (dst_offset = 0; dst_offset < sizeof buf; ++dst_offset)
    for (dst_len = 0; dst_len <= sizeof buf - dst_offset; ++dst_len)
      for (src_offset = 0; src_offset < sizeof buf; ++src_offset)
        for (src_len = 0; src_len <= sizeof buf - src_offset; ++src_len)
          run_test(buf + dst_offset, dst_len, buf + src_offset, src_len, 'x');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edx
xor    %r8d,%r8d
mov    %rdx,%rdi
mov    %r8d,%esi
mov    %r8d,%ecx
call   1060 <run_test@plt>
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
mov    %rdx,%rdi
mov    %ecx,%esi
call   1060 <run_test@plt>
xor    %eax,%eax
mov    %eax,%edx
xor    %r8d,%r8d
mov    $0x5,%ecx
mov    %rdx,%rdi
mov    %r8d,%esi
call   1060 <run_test@plt>
xor    %eax,%eax
mov    %eax,%edx
xor    %esi,%esi
mov    $0x5,%ecx
mov    $0xffffffff,%r8d
mov    %rdx,%rdi
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
xor    %r8d,%r8d
mov    $0x28,%ecx
mov    %r8d,%esi
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
mov    $0x28,%ecx
mov    $0xffffffff,%r8d
call   1060 <run_test@plt>
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
mov    $0x78,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
mov    $0x28,%esi
xor    %eax,%eax
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
lea    0xdde(%rip),%rdi
call   1030 <printf@plt>
movl   $0x78,-0x8(%rbp)
lea    -0x8(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x61,%r8d
mov    %rdx,%rdi
mov    %ecx,%esi
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
mov    $0x78,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movl   $0x0,-0x54(%rbp)
movslq -0x54(%rbp),%rax
cmp    $0x28,%rax
ja     12b8 <main+0x178>
lea    -0x30(%rbp),%rdi
mov    -0x54(%rbp),%esi
lea    -0x30(%rbp),%rdx
mov    $0x28,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1281 <main+0x141>
lea    0xd71(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x62,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    $0x73,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rdx
mov    $0x28,%esi
mov    $0x14,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
lea    0xd32(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x62,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
mov    $0x73,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x14,%esi
mov    $0x28,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
lea    0xcf3(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xcf3(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x14,%rdx
mov    $0x28,%esi
mov    $0x5,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    0xccc(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xcb1(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x30(%rbp),%rdx
add    $0x10,%rdx
mov    $0x5,%esi
mov    $0x3,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    0xc9a(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xc6f(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x1,%esi
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xc39(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x2,%esi
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xc03(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x3,%esi
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xbcd(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x4,%esi
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xb97(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x5,%esi
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xb61(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x6,%esi
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xb2b(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x7,%esi
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    0xb24(%rip),%rdi
call   1030 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    0xae9(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x1,%esi
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xab6(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x2,%esi
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xa83(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x3,%esi
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xa50(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x4,%esi
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0xa1d(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x4,%esi
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0x9ea(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x5,%esi
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0x9b7(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x6,%esi
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    -0x30(%rbp),%rdi
lea    0x984(%rip),%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0xc,%rdi
lea    -0x30(%rbp),%rdx
mov    $0x7,%esi
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    0x980(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x58(%rbp)
movslq -0x58(%rbp),%rax
cmp    $0x28,%rax
jae    17f0 <main+0x6b0>
movl   $0x0,-0x5c(%rbp)
movslq -0x5c(%rbp),%rax
movslq -0x58(%rbp),%rdx
mov    $0x28,%ecx
sub    %rdx,%rcx
cmp    %rcx,%rax
ja     17dd <main+0x69d>
movl   $0x0,-0x60(%rbp)
movslq -0x60(%rbp),%rax
cmp    $0x28,%rax
jae    17ca <main+0x68a>
movl   $0x0,-0x64(%rbp)
movslq -0x64(%rbp),%rax
movslq -0x60(%rbp),%rdx
mov    $0x28,%ecx
sub    %rdx,%rcx
cmp    %rcx,%rax
ja     17b7 <main+0x677>
lea    -0x30(%rbp),%rdi
movslq -0x58(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x5c(%rbp),%esi
lea    -0x30(%rbp),%rdx
movslq -0x60(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x64(%rbp),%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    1761 <main+0x621>
jmp    17bc <main+0x67c>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    174c <main+0x60c>
jmp    17cf <main+0x68f>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    172c <main+0x5ec>
jmp    17e2 <main+0x6a2>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1717 <main+0x5d7>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1060 <run_test@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
call   1060 <run_test@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x5,%ecx
xor    %r8d,%r8d
call   1060 <run_test@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x5,%ecx
mov    $0xffffffff,%r8d
call   1060 <run_test@plt>
lea    0x20(%rsp),%r14
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0x28,%ecx
xor    %r8d,%r8d
call   1060 <run_test@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    %r14,%rdx
mov    $0x28,%ecx
mov    $0xffffffff,%r8d
call   1060 <run_test@plt>
lea    0xe3b(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%r15
mov    %r15,%rdi
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
mov    %r14,%rdi
mov    $0x78,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    $0x28,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
lea    0xdf9(%rip),%rdi
call   1030 <puts@plt>
movl   $0x78,0xc(%rsp)
mov    %r15,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    $0x1,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
mov    %r14,%rdi
mov    $0x78,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r14,%rdx
mov    $0x28,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
add    $0x1,%ebx
cmp    $0x29,%ebx
jne    1270 <main+0x130>
lea    0xda1(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x62,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0x50(%rsp),%r14
mov    %r14,%rdi
mov    $0x73,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
mov    $0x28,%esi
mov    %r14,%rdx
mov    $0x14,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
lea    0xd5b(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x62,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    $0x73,%esi
mov    $0x14,%edx
call   1040 <memset@plt>
mov    %r14,%rdi
mov    $0x14,%esi
mov    %rbx,%rdx
mov    $0x28,%ecx
mov    $0x61,%r8d
call   1060 <run_test@plt>
lea    0xd1f(%rip),%rdi
call   1030 <puts@plt>
lea    0xcbd(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    0x34(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x28,%esi
mov    $0x5,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    0xcee(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    0x30(%rsp),%rdx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x3,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    0xcc4(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
lea    0x2c(%rsp),%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x2,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x3,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x4,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x5,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x6,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x7,%esi
mov    %rbx,%rdx
mov    $0xa,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
lea    0xb95(%rip),%r12
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
xor    %ebp,%ebp
mov    %r15,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x2,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x3,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x4,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x4,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x5,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x6,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
call   1050 <memcpy@plt>
mov    %r15,%rdi
mov    $0x7,%esi
mov    %rbx,%rdx
xor    %ecx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    $0x29,%eax
mov    %rax,0x10(%rsp)
nopw   0x0(%rax,%rax,1)
mov    %rbp,0x18(%rsp)
lea    (%rsp,%rbp,4),%r14
add    $0x20,%r14
xor    %r15d,%r15d
mov    $0x29,%r13d
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
lea    (%rsp,%rbp,4),%r12
add    $0x20,%r12
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15d,%esi
mov    %r12,%rdx
mov    %ebx,%ecx
mov    $0x78,%r8d
call   1060 <run_test@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1680 <main+0x540>
add    $0x1,%rbp
add    $0xffffffffffffffff,%r13
cmp    $0x28,%rbp
jne    1670 <main+0x530>
add    $0x1,%r15
cmp    0x10(%rsp),%r15
jne    1660 <main+0x520>
mov    0x18(%rsp),%rbp
add    $0x1,%rbp
addq   $0xffffffffffffffff,0x10(%rsp)
cmp    $0x28,%rbp
jne    1650 <main+0x510>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.6 = [11 x i8] c"0123456789\00"
@str = [15 x i8] c"--- test 1 ---\00"
@str.10 = [15 x i8] c"--- test 2 ---\00"
@str.11 = [15 x i8] c"--- test 3 ---\00"
@str.12 = [15 x i8] c"--- test 4 ---\00"
@str.13 = [15 x i8] c"--- test 5 ---\00"
@str.14 = [15 x i8] c"--- test 6 ---\00"
@str.15 = [15 x i8] c"--- test 7 ---\00"
@str.16 = [15 x i8] c"--- test 8 ---\00"
@str.18 = [15 x i8] c"--- test 9 ---\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [5 x i32]
%4 = bitcast i32* %1 to i8*
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast [5 x i32]* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @run_test(i32* null, i32 0, i32* null, i32 0, i8 signext 0)
%9 = tail call i32 @run_test(i32* null, i32 0, i32* null, i32 0, i8 signext -1)
%10 = tail call i32 @run_test(i32* null, i32 0, i32* null, i32 5, i8 signext 0)
%11 = tail call i32 @run_test(i32* null, i32 0, i32* null, i32 5, i8 signext -1)
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%13 = call i32 @run_test(i32* null, i32 0, i32* %12, i32 40, i8 signext 0)
%14 = call i32 @run_test(i32* null, i32 0, i32* %12, i32 40, i8 signext -1)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.10, i64 0, i64 0))
%16 = call i32 @run_test(i32* %1, i32 1, i32* null, i32 0, i8 signext 97)
%17 = call i32 @memset(i32* %12, i8 signext 120, i32 40)
%18 = call i32 @run_test(i32* %12, i32 40, i32* null, i32 0, i8 signext 97)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.11, i64 0, i64 0))
store i32 120, i32* %1
%20 = call i32 @run_test(i32* %1, i32 1, i32* %1, i32 1, i8 signext 97)
%21 = call i32 @memset(i32* %12, i8 signext 120, i32 40)
br label %22
22: ; preds = %0, %22
%23 = phi i32 [ 0, %0 ], [ %25, %22 ]
%24 = call i32 @run_test(i32* %12, i32 %23, i32* %12, i32 40, i8 signext 97)
%25 = add nuw nsw i32 %23, 1
%26 = icmp eq i32 %25, 41
br i1 %26, label %27, label %22
27: ; preds = %22
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.12, i64 0, i64 0))
%29 = call i32 @memset(i32* %12, i8 signext 98, i32 40)
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%31 = call i32 @memset(i32* %30, i8 signext 115, i32 20)
%32 = call i32 @run_test(i32* %12, i32 40, i32* %30, i32 20, i8 signext 97)
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.13, i64 0, i64 0))
%34 = call i32 @memset(i32* %12, i8 signext 98, i32 40)
%35 = call i32 @memset(i32* %30, i8 signext 115, i32 20)
%36 = call i32 @run_test(i32* %30, i32 20, i32* %12, i32 40, i8 signext 97)
%37 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.14, i64 0, i64 0))
%38 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%39 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
%40 = call i32 @run_test(i32* %12, i32 40, i32* %39, i32 5, i8 signext 120)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.15, i64 0, i64 0))
%42 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
%44 = call i32 @run_test(i32* %12, i32 5, i32* %43, i32 3, i8 signext 120)
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.16, i64 0, i64 0))
%46 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
%48 = call i32 @run_test(i32* %47, i32 1, i32* %12, i32 10, i8 signext 120)
%49 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%50 = call i32 @run_test(i32* %47, i32 2, i32* %12, i32 10, i8 signext 120)
%51 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%52 = call i32 @run_test(i32* %47, i32 3, i32* %12, i32 10, i8 signext 120)
%53 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%54 = call i32 @run_test(i32* %47, i32 4, i32* %12, i32 10, i8 signext 120)
%55 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%56 = call i32 @run_test(i32* %47, i32 5, i32* %12, i32 10, i8 signext 120)
%57 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%58 = call i32 @run_test(i32* %47, i32 6, i32* %12, i32 10, i8 signext 120)
%59 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%60 = call i32 @run_test(i32* %47, i32 7, i32* %12, i32 10, i8 signext 120)
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.18, i64 0, i64 0))
%62 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%63 = call i32 @run_test(i32* %47, i32 1, i32* %12, i32 0, i8 signext 120)
%64 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%65 = call i32 @run_test(i32* %47, i32 2, i32* %12, i32 0, i8 signext 120)
%66 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%67 = call i32 @run_test(i32* %47, i32 3, i32* %12, i32 0, i8 signext 120)
%68 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%69 = call i32 @run_test(i32* %47, i32 4, i32* %12, i32 0, i8 signext 120)
%70 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%71 = call i32 @run_test(i32* %47, i32 4, i32* %12, i32 0, i8 signext 120)
%72 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%73 = call i32 @run_test(i32* %47, i32 5, i32* %12, i32 0, i8 signext 120)
%74 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%75 = call i32 @run_test(i32* %47, i32 6, i32* %12, i32 0, i8 signext 120)
%76 = call i32 @memcpy(i32* %12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 10)
%77 = call i32 @run_test(i32* %47, i32 7, i32* %12, i32 0, i8 signext 120)
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.18, i64 0, i64 0))
br label %79
79: ; preds = %27, %103
%80 = phi i64 [ 0, %27 ], [ %104, %103 ]
%81 = phi i64 [ 41, %27 ], [ %105, %103 ]
%82 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %80
br label %83
83: ; preds = %79, %100
%84 = phi i64 [ 0, %79 ], [ %101, %100 ]
%85 = trunc i64 %84 to i32
br label %86
86: ; preds = %83, %96
%87 = phi i64 [ 0, %83 ], [ %97, %96 ]
%88 = phi i64 [ 41, %83 ], [ %98, %96 ]
%89 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %87
br label %90
90: ; preds = %86, %90
%91 = phi i64 [ 0, %86 ], [ %94, %90 ]
%92 = trunc i64 %91 to i32
%93 = call i32 @run_test(i32* %82, i32 %85, i32* %89, i32 %92, i8 signext 120)
%94 = add nuw nsw i64 %91, 1
%95 = icmp eq i64 %94, %88
br i1 %95, label %96, label %90
96: ; preds = %90
%97 = add nuw nsw i64 %87, 1
%98 = add nsw i64 %88, -1
%99 = icmp eq i64 %97, 40
br i1 %99, label %100, label %86
100: ; preds = %96
%101 = add nuw nsw i64 %84, 1
%102 = icmp eq i64 %101, %81
br i1 %102, label %103, label %83
103: ; preds = %100
%104 = add nuw nsw i64 %80, 1
%105 = add nsw i64 %81, -1
%106 = icmp eq i64 %104, 40
br i1 %106, label %107, label %79
107: ; preds = %103
ret i32 0
}