int main(int argc, char *argv[]) {
  int i, j, k, ret, fail = 0;
  void *buffs[16 + 1];
  char c;
  int serr, lerr;
  char *tmp_buf[16 + 1];
  printf("Test xor_check_test %d sources X %d bytes\n", 16, 1024);
  srand(0x1234);
  for (i = 0; i < 16 + 1; i++) {
    void *buf;
    if (posix_memalign(&buf, 16, 1024)) {
      printf("alloc error: Fail");
      return 1;
    }
    buffs[i] = buf;
  }
  for (i = 0; i < 16 + 1; i++)
    memset(buffs[i], 0, 1024);
  xor_gen_base(16 + 1, 1024, buffs);
  ret = xor_check(16 + 1, 1024, buffs);
  if (ret != 0) {
    fail++;
    printf("\nfail zero test %d\n", ret);
  }
  ((char *)(buffs[0]))[1024 - 2] = 0x7;
  ret = xor_check(16 + 1, 1024, buffs);
  if (ret == 0) {
    fail++;
    printf("\nfail corrupt buffer test %d\n", ret);
  }
  ((char *)(buffs[0]))[1024 - 2] = 0;
  for (j = 0; j < 16 + 1; j++) {
    for (i = 1024 - 1; i >= 0; i--) {
      ((char *)buffs[j])[i] = 0x5;
      ret = xor_check(16 + 1, 1024, buffs);
      if (ret == 0) {
        fail++;
        printf("\nfail corrupt buffer test j=%d, i=%d\n", j, i);
        return 1;
      }
      ((char *)buffs[j])[i] = 0;
    }
    putchar('.');
  }
  for (i = 0; i < 16 + 1; i++)
    rand_buffer(buffs[i], 1024);
  xor_gen_base(16 + 1, 1024, buffs);
  ret = xor_check(16 + 1, 1024, buffs);
  if (ret != 0) {
    fail++;
    printf("fail first rand test %d\n", ret);
  }
  c = ((char *)(buffs[0]))[1024 - 2];
  ((char *)(buffs[0]))[1024 - 2] = c ^ 0x1;
  ret = xor_check(16 + 1, 1024, buffs);
  if (ret == 0) {
    fail++;
    printf("\nFail corrupt buffer test, passed when should have failed\n");
  }
  ((char *)(buffs[0]))[1024 - 2] = c;
  for (j = 0; j < 16 + 1; j++) {
    for (i = 1024 - 1; i >= 0; i--) {
      ret = xor_check(16 + 1, 1024, buffs);
      if (ret != 0) {
        fail++;
        printf("\nFail rand test with un-corrupted buffer j=%d, i=%d\n", j, i);
        return 1;
      }
      c = ((char *)buffs[j])[i];
      ((char *)buffs[j])[i] = c ^ 1;
      ret = xor_check(16 + 1, 1024, buffs);
      if (ret == 0) {
        fail++;
        printf("\nfail corrupt buffer test j=%d, i=%d\n", j, i);
        return 1;
      }
      ((char *)buffs[j])[i] = c;
    }
    putchar('.');
  }
  for (j = 3; j <= 16 + 1; j++) {
    for (i = 0; i < j; i++)
      rand_buffer(buffs[i], 1024);
    xor_gen_base(j, 1024, buffs);
    for (i = 0; i < j; i++) {
      for (k = 0; k < 1024; k++) {
        ret = xor_check(j, 1024, buffs);
        if (ret != 0) {
          printf("\nfail rand test %d sources\n", j);
          fail++;
          return 1;
        }
        c = ((char *)buffs[i])[k];
        ((char *)buffs[i])[k] = c ^ 1;
        ret = xor_check(j, 1024, buffs);
        if (ret == 0) {
          printf("\nfail rand test corrupted buffer %d sources\n", j);
          fail++;
          return 1;
        }
        ((char *)buffs[i])[k] = c;
      }
    }
    putchar('.');
  }
  fflush(0);
  k = 1;
  while (k <= 1024) {
    for (j = 3; j <= 16 + 1; j++) {
      for (i = 0; i < j; i++)
        rand_buffer(buffs[i], k);
      xor_gen_base(j, k, buffs);
      for (lerr = 0; lerr < k; lerr += 10) {
        for (serr = 0; serr < j; serr++) {
          ret = xor_check(j, k, buffs);
          if (ret != 0) {
            printf("\nfail rand test %d sources\n", j);
            fail++;
            return 1;
          }
          c = ((char *)buffs[serr])[lerr];
          ((char *)buffs[serr])[lerr] = c ^ 1;
          ret = xor_check(j, k, buffs);
          if (ret == 0) {
            printf("\nfail rand test corrupted buffer "
                   "%d sources, len=%d, ret=%d\n",
                   j, k, ret);
            fail++;
            return 1;
          }
          ((char *)buffs[serr])[lerr] = c;
        }
      }
    }
    putchar('.');
    fflush(0);
    k += 1;
  }
  for (i = 0; i < 1024; i += 32) {
    for (j = 0; j < 16 + 1; j++) {
      rand_buffer(buffs[j], 1024 - i);
      tmp_buf[j] = (char *)buffs[j] + i;
    }
    xor_gen_base(16 + 1, 1024 - i, (void *)tmp_buf);
    ret = xor_check(16 + 1, 1024 - i, (void *)tmp_buf);
    if (ret != 0) {
      printf("fail end test - offset: %d, len: %d\n", i, 1024 - i);
      fail++;
      return 1;
    }
    for (serr = 0; serr < 16 + 1; serr++) {
      for (lerr = 0; lerr < (1024 - i); lerr++) {
        c = tmp_buf[serr][lerr];
        tmp_buf[serr][lerr] = c ^ 1;
        ret = xor_check(16 + 1, 1024 - i, (void *)tmp_buf);
        if (ret == 0) {
          printf("fail end test corrupted buffer - "
                 "offset: %d, len: %d, ret: %d\n",
                 i, 1024 - i, ret);
          fail++;
          return 1;
        }
        tmp_buf[serr][lerr] = c;
      }
    }
    putchar('.');
    fflush(0);
  }
  if (fail == 0)
    printf("Pass\n");
  return fail;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe49(%rip),%rdi
mov    $0x10,%esi
mov    $0x400,%edx
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x1234,%edi
mov    $0x0,%al
call   1080 <srand@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
jge    1241 <main+0xb1>
lea    -0x158(%rbp),%rdi
mov    $0x10,%esi
mov    $0x400,%edx
mov    $0x0,%al
call   10b0 <posix_memalign@plt>
cmp    $0x0,%eax
je     1220 <main+0x90>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
mov    -0x158(%rbp),%rcx
movslq -0x14(%rbp),%rax
mov    %rcx,-0xb0(%rbp,%rax,8)
ff
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11db <main+0x4b>
movl   $0x0,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
jge    1278 <main+0xe8>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
xor    %esi,%esi
mov    $0x400,%edx
call   1070 <memset@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1248 <main+0xb8>
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1040 <xor_gen_base@plt>
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     12cf <main+0x13f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%esi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xb0(%rbp),%rax
movb   $0x7,0x3fe(%rax)
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    131c <main+0x18c>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%esi
lea    0xd3c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xb0(%rbp),%rax
movb   $0x0,0x3fe(%rax)
movl   $0x0,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jge    13ea <main+0x25a>
movl   $0x3ff,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     13d0 <main+0x240>
movslq -0x18(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0x14(%rbp),%rcx
movb   $0x5,(%rax,%rcx,1)
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    13ae <main+0x21e>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xcd4(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
movslq -0x18(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    1342 <main+0x1b2>
mov    $0x2e,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1331 <main+0x1a1>
movl   $0x0,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
jge    1421 <main+0x291>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
mov    $0x400,%esi
mov    $0x0,%al
call   1090 <rand_buffer@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13f1 <main+0x261>
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1040 <xor_gen_base@plt>
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1478 <main+0x2e8>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%esi
lea    0xc24(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xb0(%rbp),%rax
mov    0x3fe(%rax),%al
mov    %al,-0xb1(%rbp)
movsbl -0xb1(%rbp),%eax
xor    $0x1,%eax
mov    %al,%cl
mov    -0xb0(%rbp),%rax
mov    %cl,0x3fe(%rax)
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    14e0 <main+0x350>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
lea    0xbd5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xb1(%rbp),%cl
mov    -0xb0(%rbp),%rax
mov    %cl,0x3fe(%rax)
movl   $0x0,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jge    162a <main+0x49a>
movl   $0x3ff,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     1610 <main+0x480>
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1563 <main+0x3d3>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xb99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
movslq -0x18(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xb1(%rbp)
movsbl -0xb1(%rbp),%eax
xor    $0x1,%eax
mov    %al,%dl
movslq -0x18(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    15e9 <main+0x459>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xa99(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
mov    -0xb1(%rbp),%dl
movslq -0x18(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    150b <main+0x37b>
mov    $0x2e,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    14fa <main+0x36a>
movl   $0x3,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jg     17cf <main+0x63f>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1674 <main+0x4e4>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
mov    $0x400,%esi
mov    $0x0,%al
call   1090 <rand_buffer@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1642 <main+0x4b2>
mov    -0x18(%rbp),%edi
lea    -0xb0(%rbp),%rdx
mov    $0x400,%esi
mov    $0x0,%al
call   1040 <xor_gen_base@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    17b5 <main+0x625>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x400,-0x1c(%rbp)
jge    17a2 <main+0x612>
mov    -0x18(%rbp),%edi
lea    -0xb0(%rbp),%rdx
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     16fa <main+0x56a>
mov    -0x18(%rbp),%esi
lea    0xa40(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xb1(%rbp)
movsbl -0xb1(%rbp),%eax
xor    $0x1,%eax
mov    %al,%dl
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%edi
lea    -0xb0(%rbp),%rdx
mov    $0x400,%esi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    177b <main+0x5eb>
mov    -0x18(%rbp),%esi
lea    0x9db(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
mov    -0xb1(%rbp),%dl
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    16a4 <main+0x514>
jmp    17a7 <main+0x617>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1691 <main+0x501>
mov    $0x2e,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1631 <main+0x4a1>
xor    %edi,%edi
mov    $0x0,%al
call   10a0 <fflush@plt>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x400,-0x1c(%rbp)
jg     19d4 <main+0x844>
movl   $0x3,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jg     19b1 <main+0x821>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1834 <main+0x6a4>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
mov    -0x1c(%rbp),%esi
mov    $0x0,%al
call   1090 <rand_buffer@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1804 <main+0x674>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0xb0(%rbp),%rdx
mov    $0x0,%al
call   1040 <xor_gen_base@plt>
movl   $0x0,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    199e <main+0x80e>
movl   $0x0,-0xb8(%rbp)
mov    -0xb8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1985 <main+0x7f5>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0xb0(%rbp),%rdx
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     18c1 <main+0x731>
mov    -0x18(%rbp),%esi
lea    0x879(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
movslq -0xb8(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0xbc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xb1(%rbp)
movsbl -0xb1(%rbp),%eax
xor    $0x1,%eax
mov    %al,%dl
movslq -0xb8(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0xbc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0xb0(%rbp),%rdx
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1952 <main+0x7c2>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0x831(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
mov    -0xb1(%rbp),%dl
movslq -0xb8(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rax
ff
movslq -0xbc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    186b <main+0x6db>
jmp    198a <main+0x7fa>
mov    -0xbc(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xbc(%rbp)
jmp    1852 <main+0x6c2>
jmp    19a3 <main+0x813>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    17f3 <main+0x663>
mov    $0x2e,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
xor    %edi,%edi
mov    $0x0,%al
call   10a0 <fflush@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    17df <main+0x64f>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1bf5 <main+0xa65>
movl   $0x0,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jge    1a41 <main+0x8b1>
movslq -0x18(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
mov    $0x400,%esi
sub    -0x14(%rbp),%esi
mov    $0x0,%al
call   1090 <rand_buffer@plt>
movslq -0x18(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rcx
ff
movslq -0x14(%rbp),%rax
add    %rax,%rcx
movslq -0x18(%rbp),%rax
mov    %rcx,-0x150(%rbp,%rax,8)
ff
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    19ef <main+0x85f>
mov    $0x400,%esi
sub    -0x14(%rbp),%esi
lea    -0x150(%rbp),%rdx
mov    $0x11,%edi
mov    $0x0,%al
call   1040 <xor_gen_base@plt>
mov    $0x400,%esi
sub    -0x14(%rbp),%esi
lea    -0x150(%rbp),%rdx
mov    $0x11,%edi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1ab2 <main+0x922>
mov    -0x14(%rbp),%esi
mov    $0x400,%edx
sub    -0x14(%rbp),%edx
lea    0x70e(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
movl   $0x0,-0xb8(%rbp)
cmpl   $0x11,-0xb8(%rbp)
jge    1bd2 <main+0xa42>
movl   $0x0,-0xbc(%rbp)
mov    -0xbc(%rbp),%eax
mov    $0x400,%ecx
sub    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    1bb9 <main+0xa29>
movslq -0xb8(%rbp),%rax
mov    -0x150(%rbp,%rax,8),%rax
ff
movslq -0xbc(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xb1(%rbp)
movsbl -0xb1(%rbp),%eax
xor    $0x1,%eax
mov    %al,%dl
movslq -0xb8(%rbp),%rax
mov    -0x150(%rbp,%rax,8),%rax
ff
movslq -0xbc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    $0x400,%esi
sub    -0x14(%rbp),%esi
lea    -0x150(%rbp),%rdx
mov    $0x11,%edi
mov    $0x0,%al
call   1050 <xor_check@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    1b86 <main+0x9f6>
mov    -0x14(%rbp),%esi
mov    $0x400,%edx
sub    -0x14(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0x65f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
movl   $0x1,-0x4(%rbp)
jmp    1c13 <main+0xa83>
mov    -0xb1(%rbp),%dl
movslq -0xb8(%rbp),%rax
mov    -0x150(%rbp,%rax,8),%rax
ff
movslq -0xbc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xbc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbc(%rbp)
jmp    1ad3 <main+0x943>
jmp    1bbe <main+0xa2e>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1abc <main+0x92c>
mov    $0x2e,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
xor    %edi,%edi
mov    $0x0,%al
call   10a0 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x14(%rbp)
jmp    19db <main+0x84b>
cmpl   $0x0,-0x24(%rbp)
jne    1c0d <main+0xa7d>
lea    0x602(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x128,%rsp
lea    0xe48(%rip),%rdi
mov    $0x10,%esi
mov    $0x400,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1234,%edi
xor    %eax,%eax
call   1090 <srand@plt>
lea    0xa0(%rsp),%rbx
xor    %ebp,%ebp
nop
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x400,%edx
xor    %eax,%eax
call   10c0 <posix_memalign@plt>
test   %eax,%eax
jne    1b04 <main+0x964>
mov    0xa0(%rsp),%rax
mov    %rax,0x10(%rsp,%rbp,8)
add    $0x1,%rbp
cmp    $0x11,%rbp
jne    11e0 <main+0x40>
mov    0x10(%rsp),%rdi
xor    %r12d,%r12d
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x18(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x20(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x28(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x30(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x38(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x40(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x48(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x50(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x58(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x60(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x68(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x70(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x78(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x80(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x88(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
mov    0x90(%rsp),%rdi
mov    $0x400,%edx
xor    %esi,%esi
call   1080 <memset@plt>
lea    0x10(%rsp),%rbx
mov    $0x11,%edi
mov    $0x400,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <xor_gen_base@plt>
mov    $0x11,%edi
mov    $0x400,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
je     1387 <main+0x1e7>
lea    0xcc5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r12d
mov    0x10(%rsp),%rax
movb   $0x7,0x3fe(%rax)
lea    0x10(%rsp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
jne    13c1 <main+0x221>
add    $0x1,%r12d
lea    0xc99(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x10(%rsp),%rax
movb   $0x0,0x3fe(%rax)
lea    0x10(%rsp),%r14
xor    %ebx,%ebx
mov    $0x3ff,%ebp
nopl   0x0(%rax)
mov    0x10(%rsp,%rbx,8),%rax
movb   $0x5,(%rax,%rbp,1)
mov    $0x11,%edi
mov    $0x400,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
je     1b14 <main+0x974>
mov    0x10(%rsp,%rbx,8),%rax
movb   $0x0,(%rax,%rbp,1)
add    $0xffffffffffffffff,%rbp
jb     13e0 <main+0x240>
mov    $0x2e,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x11,%rbx
jne    13d4 <main+0x234>
mov    0x10(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x18(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x20(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x28(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x30(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x38(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x40(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x48(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x50(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x58(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x60(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x68(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x70(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x78(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x80(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x88(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x90(%rsp),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
lea    0x10(%rsp),%rbx
mov    $0x11,%edi
mov    $0x400,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <xor_gen_base@plt>
mov    $0x11,%edi
mov    $0x400,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
je     1599 <main+0x3f9>
add    $0x1,%r12d
lea    0xb05(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x10(%rsp),%rax
mov    0x3fe(%rax),%bl
mov    %ebx,%ecx
xor    $0x1,%cl
mov    %cl,0x3fe(%rax)
lea    0x10(%rsp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
jne    15d9 <main+0x439>
add    $0x1,%r12d
lea    0xbfe(%rip),%rdi
call   1040 <puts@plt>
mov    0x10(%rsp),%rax
mov    %bl,0x3fe(%rax)
lea    0x10(%rsp),%r14
xor    %r15d,%r15d
mov    $0x3ff,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x11,%edi
mov    $0x400,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
jne    1b41 <main+0x9a1>
mov    0x10(%rsp,%r15,8),%rax
movzbl (%rax,%rbp,1),%ebx
mov    %ebx,%ecx
xor    $0x1,%cl
mov    %cl,(%rax,%rbp,1)
mov    $0x11,%edi
mov    $0x400,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
je     1b4a <main+0x9aa>
mov    0x10(%rsp,%r15,8),%rax
mov    %bl,(%rax,%rbp,1)
add    $0xffffffffffffffff,%rbp
jb     1600 <main+0x460>
mov    $0x2e,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0x1,%r15
cmp    $0x11,%r15
jne    15ec <main+0x44c>
mov    $0x3,%ebp
lea    0x10(%rsp),%r14
xor    %ebx,%ebx
mov    0x10(%rsp,%rbx,8),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    167d <main+0x4dd>
mov    %ebp,%edi
mov    $0x400,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1050 <xor_gen_base@plt>
xor    %r15d,%r15d
xor    %ebx,%ebx
mov    %ebp,%edi
mov    $0x400,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
jne    1b56 <main+0x9b6>
mov    0x10(%rsp,%r15,8),%rax
movzbl (%rax,%rbx,1),%r13d
mov    %r13d,%ecx
xor    $0x1,%cl
mov    %cl,(%rax,%rbx,1)
mov    %ebp,%edi
mov    $0x400,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
je     1b5f <main+0x9bf>
mov    0x10(%rsp,%r15,8),%rax
mov    %r13b,(%rax,%rbx,1)
add    $0x1,%rbx
cmp    $0x400,%rbx
jne    16ad <main+0x50d>
add    $0x1,%r15
cmp    %rbp,%r15
jne    16ab <main+0x50b>
mov    $0x2e,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
add    $0x1,%rbp
cmp    $0x12,%rbp
jne    167b <main+0x4db>
xor    %edi,%edi
xor    %eax,%eax
call   10b0 <fflush@plt>
mov    $0x1,%r15d
mov    $0x3,%r13d
xor    %ebx,%ebx
mov    0x10(%rsp,%rbx,8),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1742 <main+0x5a2>
mov    %r13d,%edi
mov    %r15d,%esi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1050 <xor_gen_base@plt>
xor    %ebx,%ebx
xor    %ebp,%ebp
mov    %r13d,%edi
mov    %r15d,%esi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
jne    1b71 <main+0x9d1>
mov    0x10(%rsp,%rbp,8),%rax
movzbl (%rax,%rbx,1),%r14d
mov    %r14d,%ecx
xor    $0x1,%cl
mov    %cl,(%rax,%rbx,1)
mov    %r13d,%edi
mov    %r15d,%esi
lea    0x10(%rsp),%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
je     1b7d <main+0x9dd>
mov    0x10(%rsp,%rbp,8),%rax
mov    %r14b,(%rax,%rbx,1)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1770 <main+0x5d0>
add    $0xa,%rbx
cmp    %r15,%rbx
jb     176e <main+0x5ce>
add    $0x1,%r13
cmp    $0x12,%r13
jne    1740 <main+0x5a0>
mov    $0x2e,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
xor    %edi,%edi
xor    %eax,%eax
call   10b0 <fflush@plt>
add    $0x1,%r15
cmp    $0x401,%r15
jne    173a <main+0x59a>
mov    $0x400,%r13d
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%rdi
mov    $0x400,%ebp
mov    0x8(%rsp),%rbx
sub    %ebx,%ebp
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x10(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xa0(%rsp)
mov    0x18(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x18(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xa8(%rsp)
mov    0x20(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x20(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xb0(%rsp)
mov    0x28(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x28(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xb8(%rsp)
mov    0x30(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x30(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xc0(%rsp)
mov    0x38(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x38(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xc8(%rsp)
mov    0x40(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x40(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xd0(%rsp)
mov    0x48(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x48(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xd8(%rsp)
mov    0x50(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x50(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xe0(%rsp)
mov    0x58(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x58(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xe8(%rsp)
mov    0x60(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x60(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xf0(%rsp)
mov    0x68(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x68(%rsp),%rax
add    %rbx,%rax
mov    %rax,0xf8(%rsp)
mov    0x70(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x70(%rsp),%rax
add    %rbx,%rax
mov    %rax,0x100(%rsp)
mov    0x78(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x78(%rsp),%rax
add    %rbx,%rax
mov    %rax,0x108(%rsp)
mov    0x80(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x80(%rsp),%rax
add    %rbx,%rax
mov    %rax,0x110(%rsp)
mov    0x88(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x88(%rsp),%rax
add    %rbx,%rax
mov    %rax,0x118(%rsp)
mov    0x90(%rsp),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   10a0 <rand_buffer@plt>
mov    0x90(%rsp),%rax
add    %rbx,%rax
mov    %rax,0x120(%rsp)
mov    $0x11,%edi
mov    %ebp,%esi
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <xor_gen_base@plt>
mov    $0x11,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
jne    1ba5 <main+0xa05>
xor    %ebx,%ebx
xor    %r15d,%r15d
mov    0xa0(%rsp,%rbx,8),%rax
movzbl (%rax,%r15,1),%r14d
mov    %r14d,%ecx
xor    $0x1,%cl
mov    %cl,(%rax,%r15,1)
mov    $0x11,%edi
mov    %ebp,%esi
lea    0xa0(%rsp),%rdx
xor    %eax,%eax
call   1060 <xor_check@plt>
test   %eax,%eax
je     1b95 <main+0x9f5>
mov    0xa0(%rsp,%rbx,8),%rax
mov    %r14b,(%rax,%r15,1)
add    $0x1,%r15
cmp    %r15,%r13
jne    1a66 <main+0x8c6>
add    $0x1,%rbx
cmp    $0x11,%rbx
jne    1a63 <main+0x8c3>
mov    $0x2e,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
xor    %edi,%edi
xor    %eax,%eax
call   10b0 <fflush@plt>
mov    0x8(%rsp),%rcx
lea    0x20(%rcx),%rax
add    $0xffffffffffffffe0,%r13
cmp    $0x3e0,%rcx
mov    %rax,0x8(%rsp)
jb     1813 <main+0x673>
test   %r12d,%r12d
jne    1b2c <main+0x98c>
lea    0x6d3(%rip),%rdi
call   1040 <puts@plt>
xor    %r12d,%r12d
jmp    1b2c <main+0x98c>
lea    0x520(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1b26 <main+0x986>
lea    0x554(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%r12d
mov    %r12d,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x566(%rip),%rdi
jmp    1b51 <main+0x9b1>
lea    0x51e(%rip),%rdi
mov    %r15d,%esi
jmp    1b1d <main+0x97d>
lea    0x586(%rip),%rdi
jmp    1b66 <main+0x9c6>
lea    0x599(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1b26 <main+0x986>
lea    0x56b(%rip),%rdi
mov    %r13d,%esi
jmp    1b68 <main+0x9c8>
lea    0x5a8(%rip),%rdi
mov    %r13d,%esi
mov    %r15d,%edx
xor    %ecx,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1b26 <main+0x986>
lea    0x5f2(%rip),%rdi
mov    0x8(%rsp),%rsi
mov    %ebp,%edx
jmp    1b8a <main+0x9ea>
lea    0x5bd(%rip),%rdi
mov    0x8(%rsp),%rsi
mov    %ebp,%edx
jmp    1b1f <main+0x97f>

LLVM IR (-O0):
@.str = [43 x i8] c"Test xor_check_test %d sources X %d bytes\0A\00"
@.str.1 = [18 x i8] c"alloc error: Fail\00"
@.str.2 = [20 x i8] c"\0Afail zero test %d\0A\00"
@.str.3 = [30 x i8] c"\0Afail corrupt buffer test %d\0A\00"
@.str.4 = [38 x i8] c"\0Afail corrupt buffer test j=%d, i=%d\0A\00"
@.str.5 = [25 x i8] c"fail first rand test %d\0A\00"
@.str.6 = [59 x i8] c"\0AFail corrupt buffer test, passed when should have failed\0A\00"
@.str.7 = [53 x i8] c"\0AFail rand test with un-corrupted buffer j=%d, i=%d\0A\00"
@.str.8 = [28 x i8] c"\0Afail rand test %d sources\0A\00"
@.str.9 = [45 x i8] c"\0Afail rand test corrupted buffer %d sources\0A\00"
@.str.10 = [61 x i8] c"\0Afail rand test corrupted buffer %d sources, len=%d, ret=%d\0A\00"
@.str.11 = [37 x i8] c"fail end test - offset: %d, len: %d\0A\00"
@.str.12 = [63 x i8] c"fail end test corrupted buffer - offset: %d, len: %d, ret: %d\0A\00"
@.str.13 = [6 x i8] c"Pass\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [17 x i8*]
%12 = alloca i8
%13 = alloca i32
%14 = alloca i32
%15 = alloca [17 x i8*]
%16 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 16, i32 1024)
%18 = call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 4660)
store i32 0, i32* %6
br label %19
19: ; preds = %32, %2
%20 = load i32, i32* %6
%21 = icmp slt i32 %20, 17
br i1 %21, label %22, label %35
22: ; preds = %19
%23 = call i32 (i8**, i32, i32, ...) bitcast (i32 (...)* @posix_memalign to i32 (i8**, i32, i32, ...)*)(i8** %16, i32 16, i32 1024)
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %555
27: ; preds = %22
%28 = load i8*, i8** %16
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %30
store i8* %28, i8** %31
br label %32
32: ; preds = %27
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 1
store i32 %34, i32* %6
br label %19
35: ; preds = %19
store i32 0, i32* %6
br label %36
36: ; preds = %44, %35
%37 = load i32, i32* %6
%38 = icmp slt i32 %37, 17
br i1 %38, label %39, label %47
39: ; preds = %36
%40 = load i32, i32* %6
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %41
%43 = load i8*, i8** %42
br label %44
44: ; preds = %39
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %36
47: ; preds = %36
%48 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%49 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %48)
%50 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%51 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %50)
store i32 %51, i32* %9
%52 = load i32, i32* %9
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %59
54: ; preds = %47
%55 = load i32, i32* %10
%56 = add nsw i32 %55, 1
store i32 %56, i32* %10
%57 = load i32, i32* %9
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %54, %47
%60 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%61 = load i8*, i8** %60
%62 = getelementptr inbounds i8, i8* %61, i64 1022
store i8 7, i8* %62
%63 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%64 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %63)
store i32 %64, i32* %9
%65 = load i32, i32* %9
%66 = icmp eq i32 %65, 0
br i1 %66, label %67, label %72
67: ; preds = %59
%68 = load i32, i32* %10
%69 = add nsw i32 %68, 1
store i32 %69, i32* %10
%70 = load i32, i32* %9
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 %70)
br label %72
72: ; preds = %67, %59
%73 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%74 = load i8*, i8** %73
%75 = getelementptr inbounds i8, i8* %74, i64 1022
store i8 0, i8* %75
store i32 0, i32* %7
br label %76
76: ; preds = %114, %72
%77 = load i32, i32* %7
%78 = icmp slt i32 %77, 17
br i1 %78, label %79, label %117
79: ; preds = %76
store i32 1023, i32* %6
br label %80
80: ; preds = %109, %79
%81 = load i32, i32* %6
%82 = icmp sge i32 %81, 0
br i1 %82, label %83, label %112
83: ; preds = %80
%84 = load i32, i32* %7
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %85
%87 = load i8*, i8** %86
%88 = load i32, i32* %6
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %87, i64 %89
store i8 5, i8* %90
%91 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%92 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %91)
store i32 %92, i32* %9
%93 = load i32, i32* %9
%94 = icmp eq i32 %93, 0
br i1 %94, label %95, label %101
95: ; preds = %83
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
%98 = load i32, i32* %7
%99 = load i32, i32* %6
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %98, i32 %99)
store i32 1, i32* %3
br label %555
101: ; preds = %83
%102 = load i32, i32* %7
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %103
%105 = load i8*, i8** %104
%106 = load i32, i32* %6
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %105, i64 %107
store i8 0, i8* %108
br label %109
109: ; preds = %101
%110 = load i32, i32* %6
%111 = add nsw i32 %110, -1
store i32 %111, i32* %6
br label %80
112: ; preds = %80
%113 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
br label %114
114: ; preds = %112
%115 = load i32, i32* %7
%116 = add nsw i32 %115, 1
store i32 %116, i32* %7
br label %76
117: ; preds = %76
store i32 0, i32* %6
br label %118
118: ; preds = %127, %117
%119 = load i32, i32* %6
%120 = icmp slt i32 %119, 17
br i1 %120, label %121, label %130
121: ; preds = %118
%122 = load i32, i32* %6
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %123
%125 = load i8*, i8** %124
%126 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %125, i32 1024)
br label %127
127: ; preds = %121
%128 = load i32, i32* %6
%129 = add nsw i32 %128, 1
store i32 %129, i32* %6
br label %118
130: ; preds = %118
%131 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%132 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %131)
%133 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%134 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %133)
store i32 %134, i32* %9
%135 = load i32, i32* %9
%136 = icmp ne i32 %135, 0
br i1 %136, label %137, label %142
137: ; preds = %130
%138 = load i32, i32* %10
%139 = add nsw i32 %138, 1
store i32 %139, i32* %10
%140 = load i32, i32* %9
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %140)
br label %142
142: ; preds = %137, %130
%143 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%144 = load i8*, i8** %143
%145 = getelementptr inbounds i8, i8* %144, i64 1022
%146 = load i8, i8* %145
store i8 %146, i8* %12
%147 = load i8, i8* %12
%148 = sext i8 %147 to i32
%149 = xor i32 %148, 1
%150 = trunc i32 %149 to i8
%151 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%152 = load i8*, i8** %151
%153 = getelementptr inbounds i8, i8* %152, i64 1022
store i8 %150, i8* %153
%154 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%155 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %154)
store i32 %155, i32* %9
%156 = load i32, i32* %9
%157 = icmp eq i32 %156, 0
br i1 %157, label %158, label %162
158: ; preds = %142
%159 = load i32, i32* %10
%160 = add nsw i32 %159, 1
store i32 %160, i32* %10
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.6, i64 0, i64 0))
br label %162
162: ; preds = %158, %142
%163 = load i8, i8* %12
%164 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%165 = load i8*, i8** %164
%166 = getelementptr inbounds i8, i8* %165, i64 1022
store i8 %163, i8* %166
store i32 0, i32* %7
br label %167
167: ; preds = %229, %162
%168 = load i32, i32* %7
%169 = icmp slt i32 %168, 17
br i1 %169, label %170, label %232
170: ; preds = %167
store i32 1023, i32* %6
br label %171
171: ; preds = %224, %170
%172 = load i32, i32* %6
%173 = icmp sge i32 %172, 0
br i1 %173, label %174, label %227
174: ; preds = %171
%175 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%176 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %175)
store i32 %176, i32* %9
%177 = load i32, i32* %9
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %185
179: ; preds = %174
%180 = load i32, i32* %10
%181 = add nsw i32 %180, 1
store i32 %181, i32* %10
%182 = load i32, i32* %7
%183 = load i32, i32* %6
%184 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0), i32 %182, i32 %183)
store i32 1, i32* %3
br label %555
185: ; preds = %174
%186 = load i32, i32* %7
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %187
%189 = load i8*, i8** %188
%190 = load i32, i32* %6
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds i8, i8* %189, i64 %191
%193 = load i8, i8* %192
store i8 %193, i8* %12
%194 = load i8, i8* %12
%195 = sext i8 %194 to i32
%196 = xor i32 %195, 1
%197 = trunc i32 %196 to i8
%198 = load i32, i32* %7
%199 = sext i32 %198 to i64
%200 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %199
%201 = load i8*, i8** %200
%202 = load i32, i32* %6
%203 = sext i32 %202 to i64
%204 = getelementptr inbounds i8, i8* %201, i64 %203
store i8 %197, i8* %204
%205 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%206 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %205)
store i32 %206, i32* %9
%207 = load i32, i32* %9
%208 = icmp eq i32 %207, 0
br i1 %208, label %209, label %215
209: ; preds = %185
%210 = load i32, i32* %10
%211 = add nsw i32 %210, 1
store i32 %211, i32* %10
%212 = load i32, i32* %7
%213 = load i32, i32* %6
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %212, i32 %213)
store i32 1, i32* %3
br label %555
215: ; preds = %185
%216 = load i8, i8* %12
%217 = load i32, i32* %7
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %218
%220 = load i8*, i8** %219
%221 = load i32, i32* %6
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds i8, i8* %220, i64 %222
store i8 %216, i8* %223
br label %224
224: ; preds = %215
%225 = load i32, i32* %6
%226 = add nsw i32 %225, -1
store i32 %226, i32* %6
br label %171
227: ; preds = %171
%228 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
br label %229
229: ; preds = %227
%230 = load i32, i32* %7
%231 = add nsw i32 %230, 1
store i32 %231, i32* %7
br label %167
232: ; preds = %167
store i32 3, i32* %7
br label %233
233: ; preds = %321, %232
%234 = load i32, i32* %7
%235 = icmp sle i32 %234, 17
br i1 %235, label %236, label %324
236: ; preds = %233
store i32 0, i32* %6
br label %237
237: ; preds = %247, %236
%238 = load i32, i32* %6
%239 = load i32, i32* %7
%240 = icmp slt i32 %238, %239
br i1 %240, label %241, label %250
241: ; preds = %237
%242 = load i32, i32* %6
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %243
%245 = load i8*, i8** %244
%246 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %245, i32 1024)
br label %247
247: ; preds = %241
%248 = load i32, i32* %6
%249 = add nsw i32 %248, 1
store i32 %249, i32* %6
br label %237
250: ; preds = %237
%251 = load i32, i32* %7
%252 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%253 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8**, ...)*)(i32 %251, i32 1024, i8** %252)
store i32 0, i32* %6
br label %254
254: ; preds = %316, %250
%255 = load i32, i32* %6
%256 = load i32, i32* %7
%257 = icmp slt i32 %255, %256
br i1 %257, label %258, label %319
258: ; preds = %254
store i32 0, i32* %8
br label %259
259: ; preds = %312, %258
%260 = load i32, i32* %8
%261 = icmp slt i32 %260, 1024
br i1 %261, label %262, label %315
262: ; preds = %259
%263 = load i32, i32* %7
%264 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%265 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 %263, i32 1024, i8** %264)
store i32 %265, i32* %9
%266 = load i32, i32* %9
%267 = icmp ne i32 %266, 0
br i1 %267, label %268, label %273
268: ; preds = %262
%269 = load i32, i32* %7
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %269)
%271 = load i32, i32* %10
%272 = add nsw i32 %271, 1
store i32 %272, i32* %10
store i32 1, i32* %3
br label %555
273: ; preds = %262
%274 = load i32, i32* %6
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %275
%277 = load i8*, i8** %276
%278 = load i32, i32* %8
%279 = sext i32 %278 to i64
%280 = getelementptr inbounds i8, i8* %277, i64 %279
%281 = load i8, i8* %280
store i8 %281, i8* %12
%282 = load i8, i8* %12
%283 = sext i8 %282 to i32
%284 = xor i32 %283, 1
%285 = trunc i32 %284 to i8
%286 = load i32, i32* %6
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %287
%289 = load i8*, i8** %288
%290 = load i32, i32* %8
%291 = sext i32 %290 to i64
%292 = getelementptr inbounds i8, i8* %289, i64 %291
store i8 %285, i8* %292
%293 = load i32, i32* %7
%294 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%295 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 %293, i32 1024, i8** %294)
store i32 %295, i32* %9
%296 = load i32, i32* %9
%297 = icmp eq i32 %296, 0
br i1 %297, label %298, label %303
298: ; preds = %273
%299 = load i32, i32* %7
%300 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0), i32 %299)
%301 = load i32, i32* %10
%302 = add nsw i32 %301, 1
store i32 %302, i32* %10
store i32 1, i32* %3
br label %555
303: ; preds = %273
%304 = load i8, i8* %12
%305 = load i32, i32* %6
%306 = sext i32 %305 to i64
%307 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %306
%308 = load i8*, i8** %307
%309 = load i32, i32* %8
%310 = sext i32 %309 to i64
%311 = getelementptr inbounds i8, i8* %308, i64 %310
store i8 %304, i8* %311
br label %312
312: ; preds = %303
%313 = load i32, i32* %8
%314 = add nsw i32 %313, 1
store i32 %314, i32* %8
br label %259
315: ; preds = %259
br label %316
316: ; preds = %315
%317 = load i32, i32* %6
%318 = add nsw i32 %317, 1
store i32 %318, i32* %6
br label %254
319: ; preds = %254
%320 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
br label %321
321: ; preds = %319
%322 = load i32, i32* %7
%323 = add nsw i32 %322, 1
store i32 %323, i32* %7
br label %233
324: ; preds = %233
%325 = call i32 (i32, ...) bitcast (i32 (...)* @fflush to i32 (i32, ...)*)(i32 0)
store i32 1, i32* %8
br label %326
326: ; preds = %427, %324
%327 = load i32, i32* %8
%328 = icmp sle i32 %327, 1024
br i1 %328, label %329, label %432
329: ; preds = %326
store i32 3, i32* %7
br label %330
330: ; preds = %424, %329
%331 = load i32, i32* %7
%332 = icmp sle i32 %331, 17
br i1 %332, label %333, label %427
333: ; preds = %330
store i32 0, i32* %6
br label %334
334: ; preds = %345, %333
%335 = load i32, i32* %6
%336 = load i32, i32* %7
%337 = icmp slt i32 %335, %336
br i1 %337, label %338, label %348
338: ; preds = %334
%339 = load i32, i32* %6
%340 = sext i32 %339 to i64
%341 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %340
%342 = load i8*, i8** %341
%343 = load i32, i32* %8
%344 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %342, i32 %343)
br label %345
345: ; preds = %338
%346 = load i32, i32* %6
%347 = add nsw i32 %346, 1
store i32 %347, i32* %6
br label %334
348: ; preds = %334
%349 = load i32, i32* %7
%350 = load i32, i32* %8
%351 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%352 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8**, ...)*)(i32 %349, i32 %350, i8** %351)
store i32 0, i32* %14
br label %353
353: ; preds = %420, %348
%354 = load i32, i32* %14
%355 = load i32, i32* %8
%356 = icmp slt i32 %354, %355
br i1 %356, label %357, label %423
357: ; preds = %353
store i32 0, i32* %13
br label %358
358: ; preds = %416, %357
%359 = load i32, i32* %13
%360 = load i32, i32* %7
%361 = icmp slt i32 %359, %360
br i1 %361, label %362, label %419
362: ; preds = %358
%363 = load i32, i32* %7
%364 = load i32, i32* %8
%365 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%366 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 %363, i32 %364, i8** %365)
store i32 %366, i32* %9
%367 = load i32, i32* %9
%368 = icmp ne i32 %367, 0
br i1 %368, label %369, label %374
369: ; preds = %362
%370 = load i32, i32* %7
%371 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %370)
%372 = load i32, i32* %10
%373 = add nsw i32 %372, 1
store i32 %373, i32* %10
store i32 1, i32* %3
br label %555
374: ; preds = %362
%375 = load i32, i32* %13
%376 = sext i32 %375 to i64
%377 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %376
%378 = load i8*, i8** %377
%379 = load i32, i32* %14
%380 = sext i32 %379 to i64
%381 = getelementptr inbounds i8, i8* %378, i64 %380
%382 = load i8, i8* %381
store i8 %382, i8* %12
%383 = load i8, i8* %12
%384 = sext i8 %383 to i32
%385 = xor i32 %384, 1
%386 = trunc i32 %385 to i8
%387 = load i32, i32* %13
%388 = sext i32 %387 to i64
%389 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %388
%390 = load i8*, i8** %389
%391 = load i32, i32* %14
%392 = sext i32 %391 to i64
%393 = getelementptr inbounds i8, i8* %390, i64 %392
store i8 %386, i8* %393
%394 = load i32, i32* %7
%395 = load i32, i32* %8
%396 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%397 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 %394, i32 %395, i8** %396)
store i32 %397, i32* %9
%398 = load i32, i32* %9
%399 = icmp eq i32 %398, 0
br i1 %399, label %400, label %407
400: ; preds = %374
%401 = load i32, i32* %7
%402 = load i32, i32* %8
%403 = load i32, i32* %9
%404 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0), i32 %401, i32 %402, i32 %403)
%405 = load i32, i32* %10
%406 = add nsw i32 %405, 1
store i32 %406, i32* %10
store i32 1, i32* %3
br label %555
407: ; preds = %374
%408 = load i8, i8* %12
%409 = load i32, i32* %13
%410 = sext i32 %409 to i64
%411 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %410
%412 = load i8*, i8** %411
%413 = load i32, i32* %14
%414 = sext i32 %413 to i64
%415 = getelementptr inbounds i8, i8* %412, i64 %414
store i8 %408, i8* %415
br label %416
416: ; preds = %407
%417 = load i32, i32* %13
%418 = add nsw i32 %417, 1
store i32 %418, i32* %13
br label %358
419: ; preds = %358
br label %420
420: ; preds = %419
%421 = load i32, i32* %14
%422 = add nsw i32 %421, 10
store i32 %422, i32* %14
br label %353
423: ; preds = %353
br label %424
424: ; preds = %423
%425 = load i32, i32* %7
%426 = add nsw i32 %425, 1
store i32 %426, i32* %7
br label %330
427: ; preds = %330
%428 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
%429 = call i32 (i32, ...) bitcast (i32 (...)* @fflush to i32 (i32, ...)*)(i32 0)
%430 = load i32, i32* %8
%431 = add nsw i32 %430, 1
store i32 %431, i32* %8
br label %326
432: ; preds = %326
store i32 0, i32* %6
br label %433
433: ; preds = %545, %432
%434 = load i32, i32* %6
%435 = icmp slt i32 %434, 1024
br i1 %435, label %436, label %548
436: ; preds = %433
store i32 0, i32* %7
br label %437
437: ; preds = %458, %436
%438 = load i32, i32* %7
%439 = icmp slt i32 %438, 17
br i1 %439, label %440, label %461
440: ; preds = %437
%441 = load i32, i32* %7
%442 = sext i32 %441 to i64
%443 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %442
%444 = load i8*, i8** %443
%445 = load i32, i32* %6
%446 = sub nsw i32 1024, %445
%447 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %444, i32 %446)
%448 = load i32, i32* %7
%449 = sext i32 %448 to i64
%450 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %449
%451 = load i8*, i8** %450
%452 = load i32, i32* %6
%453 = sext i32 %452 to i64
%454 = getelementptr inbounds i8, i8* %451, i64 %453
%455 = load i32, i32* %7
%456 = sext i32 %455 to i64
%457 = getelementptr inbounds [17 x i8*], [17 x i8*]* %15, i64 0, i64 %456
store i8* %454, i8** %457
br label %458
458: ; preds = %440
%459 = load i32, i32* %7
%460 = add nsw i32 %459, 1
store i32 %460, i32* %7
br label %437
461: ; preds = %437
%462 = load i32, i32* %6
%463 = sub nsw i32 1024, %462
%464 = getelementptr inbounds [17 x i8*], [17 x i8*]* %15, i64 0, i64 0
%465 = bitcast i8** %464 to i8*
%466 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8*, ...)*)(i32 17, i32 %463, i8* %465)
%467 = load i32, i32* %6
%468 = sub nsw i32 1024, %467
%469 = getelementptr inbounds [17 x i8*], [17 x i8*]* %15, i64 0, i64 0
%470 = bitcast i8** %469 to i8*
%471 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8*, ...)*)(i32 17, i32 %468, i8* %470)
store i32 %471, i32* %9
%472 = load i32, i32* %9
%473 = icmp ne i32 %472, 0
br i1 %473, label %474, label %481
474: ; preds = %461
%475 = load i32, i32* %6
%476 = load i32, i32* %6
%477 = sub nsw i32 1024, %476
%478 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %475, i32 %477)
%479 = load i32, i32* %10
%480 = add nsw i32 %479, 1
store i32 %480, i32* %10
store i32 1, i32* %3
br label %555
481: ; preds = %461
store i32 0, i32* %13
br label %482
482: ; preds = %539, %481
%483 = load i32, i32* %13
%484 = icmp slt i32 %483, 17
br i1 %484, label %485, label %542
485: ; preds = %482
store i32 0, i32* %14
br label %486
486: ; preds = %535, %485
%487 = load i32, i32* %14
%488 = load i32, i32* %6
%489 = sub nsw i32 1024, %488
%490 = icmp slt i32 %487, %489
br i1 %490, label %491, label %538
491: ; preds = %486
%492 = load i32, i32* %13
%493 = sext i32 %492 to i64
%494 = getelementptr inbounds [17 x i8*], [17 x i8*]* %15, i64 0, i64 %493
%495 = load i8*, i8** %494
%496 = load i32, i32* %14
%497 = sext i32 %496 to i64
%498 = getelementptr inbounds i8, i8* %495, i64 %497
%499 = load i8, i8* %498
store i8 %499, i8* %12
%500 = load i8, i8* %12
%501 = sext i8 %500 to i32
%502 = xor i32 %501, 1
%503 = trunc i32 %502 to i8
%504 = load i32, i32* %13
%505 = sext i32 %504 to i64
%506 = getelementptr inbounds [17 x i8*], [17 x i8*]* %15, i64 0, i64 %505
%507 = load i8*, i8** %506
%508 = load i32, i32* %14
%509 = sext i32 %508 to i64
%510 = getelementptr inbounds i8, i8* %507, i64 %509
store i8 %503, i8* %510
%511 = load i32, i32* %6
%512 = sub nsw i32 1024, %511
%513 = getelementptr inbounds [17 x i8*], [17 x i8*]* %15, i64 0, i64 0
%514 = bitcast i8** %513 to i8*
%515 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8*, ...)*)(i32 17, i32 %512, i8* %514)
store i32 %515, i32* %9
%516 = load i32, i32* %9
%517 = icmp eq i32 %516, 0
br i1 %517, label %518, label %526
518: ; preds = %491
%519 = load i32, i32* %6
%520 = load i32, i32* %6
%521 = sub nsw i32 1024, %520
%522 = load i32, i32* %9
%523 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.12, i64 0, i64 0), i32 %519, i32 %521, i32 %522)
%524 = load i32, i32* %10
%525 = add nsw i32 %524, 1
store i32 %525, i32* %10
store i32 1, i32* %3
br label %555
526: ; preds = %491
%527 = load i8, i8* %12
%528 = load i32, i32* %13
%529 = sext i32 %528 to i64
%530 = getelementptr inbounds [17 x i8*], [17 x i8*]* %15, i64 0, i64 %529
%531 = load i8*, i8** %530
%532 = load i32, i32* %14
%533 = sext i32 %532 to i64
%534 = getelementptr inbounds i8, i8* %531, i64 %533
store i8 %527, i8* %534
br label %535
535: ; preds = %526
%536 = load i32, i32* %14
%537 = add nsw i32 %536, 1
store i32 %537, i32* %14
br label %486
538: ; preds = %486
br label %539
539: ; preds = %538
%540 = load i32, i32* %13
%541 = add nsw i32 %540, 1
store i32 %541, i32* %13
br label %482
542: ; preds = %482
%543 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
%544 = call i32 (i32, ...) bitcast (i32 (...)* @fflush to i32 (i32, ...)*)(i32 0)
br label %545
545: ; preds = %542
%546 = load i32, i32* %6
%547 = add nsw i32 %546, 32
store i32 %547, i32* %6
br label %433
548: ; preds = %433
%549 = load i32, i32* %10
%550 = icmp eq i32 %549, 0
br i1 %550, label %551, label %553
551: ; preds = %548
%552 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
br label %553
553: ; preds = %551, %548
%554 = load i32, i32* %10
store i32 %554, i32* %3
br label %555
555: ; preds = %553, %518, %474, %400, %369, %298, %268, %209, %179, %95, %25
%556 = load i32, i32* %3
ret i32 %556
}

LLVM IR (-O2):
@.str = [43 x i8] c"Test xor_check_test %d sources X %d bytes\0A\00"
@.str.1 = [18 x i8] c"alloc error: Fail\00"
@.str.2 = [20 x i8] c"\0Afail zero test %d\0A\00"
@.str.3 = [30 x i8] c"\0Afail corrupt buffer test %d\0A\00"
@.str.4 = [38 x i8] c"\0Afail corrupt buffer test j=%d, i=%d\0A\00"
@.str.5 = [25 x i8] c"fail first rand test %d\0A\00"
@.str.7 = [53 x i8] c"\0AFail rand test with un-corrupted buffer j=%d, i=%d\0A\00"
@.str.8 = [28 x i8] c"\0Afail rand test %d sources\0A\00"
@.str.9 = [45 x i8] c"\0Afail rand test corrupted buffer %d sources\0A\00"
@.str.10 = [61 x i8] c"\0Afail rand test corrupted buffer %d sources, len=%d, ret=%d\0A\00"
@.str.11 = [37 x i8] c"fail end test - offset: %d, len: %d\0A\00"
@.str.12 = [63 x i8] c"fail end test corrupted buffer - offset: %d, len: %d, ret: %d\0A\00"
@str = [5 x i8] c"Pass\00"
@str.14 = [58 x i8] c"\0AFail corrupt buffer test, passed when should have failed\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [17 x i8*]
%4 = alloca [17 x i8*]
%5 = alloca i8*
%6 = bitcast [17 x i8*]* %3 to i8*
%7 = bitcast [17 x i8*]* %4 to i8*
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 16, i32 1024)
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 4660)
%10 = bitcast i8** %5 to i8*
br label %11
11: ; preds = %2, %17
%12 = phi i64 [ 0, %2 ], [ %20, %17 ]
%13 = call i32 (i8**, i32, i32, ...) bitcast (i32 (...)* @posix_memalign to i32 (i8**, i32, i32, ...)*)(i8** %5, i32 16, i32 1024)
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %11
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
br label %412
17: ; preds = %11
%18 = load i8*, i8** %5
%19 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %12
store i8* %18, i8** %19
%20 = add nuw nsw i64 %12, 1
%21 = icmp eq i64 %20, 17
br i1 %21, label %22, label %11
22: ; preds = %17
%23 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 0
%24 = load i8*, i8** %23
%25 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 1
%26 = load i8*, i8** %25
%27 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 2
%28 = load i8*, i8** %27
%29 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 3
%30 = load i8*, i8** %29
%31 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 4
%32 = load i8*, i8** %31
%33 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 5
%34 = load i8*, i8** %33
%35 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 6
%36 = load i8*, i8** %35
%37 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 7
%38 = load i8*, i8** %37
%39 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 8
%40 = load i8*, i8** %39
%41 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 9
%42 = load i8*, i8** %41
%43 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 10
%44 = load i8*, i8** %43
%45 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 11
%46 = load i8*, i8** %45
%47 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 12
%48 = load i8*, i8** %47
%49 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 13
%50 = load i8*, i8** %49
%51 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 14
%52 = load i8*, i8** %51
%53 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 15
%54 = load i8*, i8** %53
%55 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 16
%56 = load i8*, i8** %55
%57 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%58 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%59 = icmp eq i32 %58, 0
br i1 %59, label %62, label %60
60: ; preds = %22
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %58)
br label %62
62: ; preds = %60, %22
%63 = phi i32 [ 1, %60 ], [ 0, %22 ]
%64 = load i8*, i8** %23
%65 = getelementptr inbounds i8, i8* %64, i64 1022
store i8 7, i8* %65
%66 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%67 = icmp eq i32 %66, 0
br i1 %67, label %68, label %71
68: ; preds = %62
%69 = add nuw nsw i32 %63, 1
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i32 0)
br label %71
71: ; preds = %68, %62
%72 = phi i32 [ %69, %68 ], [ %63, %62 ]
%73 = load i8*, i8** %23
%74 = getelementptr inbounds i8, i8* %73, i64 1022
store i8 0, i8* %74
br label %75
75: ; preds = %71, %93
%76 = phi i64 [ 0, %71 ], [ %95, %93 ]
%77 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %76
br label %78
78: ; preds = %75, %88
%79 = phi i64 [ 1023, %75 ], [ %91, %88 ]
%80 = load i8*, i8** %77
%81 = getelementptr inbounds i8, i8* %80, i64 %79
store i8 5, i8* %81
%82 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%83 = icmp eq i32 %82, 0
br i1 %83, label %84, label %88
84: ; preds = %78
%85 = trunc i64 %76 to i32
%86 = trunc i64 %79 to i32
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %85, i32 %86)
br label %412
88: ; preds = %78
%89 = load i8*, i8** %77
%90 = getelementptr inbounds i8, i8* %89, i64 %79
store i8 0, i8* %90
%91 = add nsw i64 %79, -1
%92 = icmp eq i64 %79, 0
br i1 %92, label %93, label %78
93: ; preds = %88
%94 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
%95 = add nuw nsw i64 %76, 1
%96 = icmp eq i64 %95, 17
br i1 %96, label %97, label %75
97: ; preds = %93
%98 = load i8*, i8** %23
%99 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %98, i32 1024)
%100 = load i8*, i8** %25
%101 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %100, i32 1024)
%102 = load i8*, i8** %27
%103 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %102, i32 1024)
%104 = load i8*, i8** %29
%105 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %104, i32 1024)
%106 = load i8*, i8** %31
%107 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %106, i32 1024)
%108 = load i8*, i8** %33
%109 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %108, i32 1024)
%110 = load i8*, i8** %35
%111 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %110, i32 1024)
%112 = load i8*, i8** %37
%113 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %112, i32 1024)
%114 = load i8*, i8** %39
%115 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %114, i32 1024)
%116 = load i8*, i8** %41
%117 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %116, i32 1024)
%118 = load i8*, i8** %43
%119 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %118, i32 1024)
%120 = load i8*, i8** %45
%121 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %120, i32 1024)
%122 = load i8*, i8** %47
%123 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %122, i32 1024)
%124 = load i8*, i8** %49
%125 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %124, i32 1024)
%126 = load i8*, i8** %51
%127 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %126, i32 1024)
%128 = load i8*, i8** %53
%129 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %128, i32 1024)
%130 = load i8*, i8** %55
%131 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %130, i32 1024)
%132 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%133 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%134 = icmp eq i32 %133, 0
br i1 %134, label %138, label %135
135: ; preds = %97
%136 = add nsw i32 %72, 1
%137 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0), i32 %133)
br label %138
138: ; preds = %135, %97
%139 = phi i32 [ %136, %135 ], [ %72, %97 ]
%140 = load i8*, i8** %23
%141 = getelementptr inbounds i8, i8* %140, i64 1022
%142 = load i8, i8* %141
%143 = xor i8 %142, 1
store i8 %143, i8* %141
%144 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%145 = icmp eq i32 %144, 0
br i1 %145, label %146, label %149
146: ; preds = %138
%147 = add nsw i32 %139, 1
%148 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.14, i64 0, i64 0))
br label %149
149: ; preds = %146, %138
%150 = phi i32 [ %147, %146 ], [ %139, %138 ]
%151 = load i8*, i8** %23
%152 = getelementptr inbounds i8, i8* %151, i64 1022
store i8 %142, i8* %152
br label %153
153: ; preds = %149, %180
%154 = phi i64 [ 0, %149 ], [ %182, %180 ]
%155 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %154
br label %156
156: ; preds = %153, %175
%157 = phi i64 [ 1023, %153 ], [ %178, %175 ]
%158 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%159 = icmp eq i32 %158, 0
br i1 %159, label %164, label %160
160: ; preds = %156
%161 = trunc i64 %154 to i32
%162 = trunc i64 %157 to i32
%163 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0), i32 %161, i32 %162)
br label %412
164: ; preds = %156
%165 = load i8*, i8** %155
%166 = getelementptr inbounds i8, i8* %165, i64 %157
%167 = load i8, i8* %166
%168 = xor i8 %167, 1
store i8 %168, i8* %166
%169 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 17, i32 1024, i8** %23)
%170 = icmp eq i32 %169, 0
br i1 %170, label %171, label %175
171: ; preds = %164
%172 = trunc i64 %154 to i32
%173 = trunc i64 %157 to i32
%174 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.4, i64 0, i64 0), i32 %172, i32 %173)
br label %412
175: ; preds = %164
%176 = load i8*, i8** %155
%177 = getelementptr inbounds i8, i8* %176, i64 %157
store i8 %167, i8* %177
%178 = add nsw i64 %157, -1
%179 = icmp eq i64 %157, 0
br i1 %179, label %180, label %156
180: ; preds = %175
%181 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
%182 = add nuw nsw i64 %154, 1
%183 = icmp eq i64 %182, 17
br i1 %183, label %184, label %153
184: ; preds = %180, %224
%185 = phi i64 [ %226, %224 ], [ 3, %180 ]
br label %186
186: ; preds = %184, %186
%187 = phi i64 [ 0, %184 ], [ %191, %186 ]
%188 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %187
%189 = load i8*, i8** %188
%190 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %189, i32 1024)
%191 = add nuw nsw i64 %187, 1
%192 = icmp eq i64 %191, %185
br i1 %192, label %193, label %186
193: ; preds = %186
%194 = trunc i64 %185 to i32
%195 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8**, ...)*)(i32 %194, i32 1024, i8** %23)
br label %196
196: ; preds = %193, %221
%197 = phi i64 [ 0, %193 ], [ %222, %221 ]
%198 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %197
br label %199
199: ; preds = %196, %216
%200 = phi i64 [ 0, %196 ], [ %219, %216 ]
%201 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 %194, i32 1024, i8** %23)
%202 = icmp eq i32 %201, 0
br i1 %202, label %206, label %203
203: ; preds = %199
%204 = trunc i64 %185 to i32
%205 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %204)
br label %412
206: ; preds = %199
%207 = load i8*, i8** %198
%208 = getelementptr inbounds i8, i8* %207, i64 %200
%209 = load i8, i8* %208
%210 = xor i8 %209, 1
store i8 %210, i8* %208
%211 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 %194, i32 1024, i8** %23)
%212 = icmp eq i32 %211, 0
br i1 %212, label %213, label %216
213: ; preds = %206
%214 = trunc i64 %185 to i32
%215 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @.str.9, i64 0, i64 0), i32 %214)
br label %412
216: ; preds = %206
%217 = load i8*, i8** %198
%218 = getelementptr inbounds i8, i8* %217, i64 %200
store i8 %209, i8* %218
%219 = add nuw nsw i64 %200, 1
%220 = icmp eq i64 %219, 1024
br i1 %220, label %221, label %199
221: ; preds = %216
%222 = add nuw nsw i64 %197, 1
%223 = icmp eq i64 %222, %185
br i1 %223, label %224, label %196
224: ; preds = %221
%225 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
%226 = add nuw nsw i64 %185, 1
%227 = icmp eq i64 %226, 18
br i1 %227, label %228, label %184
228: ; preds = %224
%229 = call i32 (i32, ...) bitcast (i32 (...)* @fflush to i32 (i32, ...)*)(i32 0)
br label %230
230: ; preds = %228, %278
%231 = phi i64 [ 1, %228 ], [ %281, %278 ]
%232 = trunc i64 %231 to i32
%233 = trunc i64 %231 to i32
br label %234
234: ; preds = %230, %275
%235 = phi i64 [ 3, %230 ], [ %276, %275 ]
br label %236
236: ; preds = %234, %236
%237 = phi i64 [ 0, %234 ], [ %241, %236 ]
%238 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %237
%239 = load i8*, i8** %238
%240 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %239, i32 %232)
%241 = add nuw nsw i64 %237, 1
%242 = icmp eq i64 %241, %235
br i1 %242, label %243, label %236
243: ; preds = %236
%244 = trunc i64 %235 to i32
%245 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8**, ...)*)(i32 %244, i32 %233, i8** %23)
br label %246
246: ; preds = %243, %272
%247 = phi i64 [ 0, %243 ], [ %273, %272 ]
br label %248
248: ; preds = %246, %267
%249 = phi i64 [ 0, %246 ], [ %270, %267 ]
%250 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 %244, i32 %233, i8** %23)
%251 = icmp eq i32 %250, 0
br i1 %251, label %255, label %252
252: ; preds = %248
%253 = trunc i64 %235 to i32
%254 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %253)
br label %412
255: ; preds = %248
%256 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %249
%257 = load i8*, i8** %256
%258 = getelementptr inbounds i8, i8* %257, i64 %247
%259 = load i8, i8* %258
%260 = xor i8 %259, 1
store i8 %260, i8* %258
%261 = call i32 (i32, i32, i8**, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8**, ...)*)(i32 %244, i32 %233, i8** %23)
%262 = icmp eq i32 %261, 0
br i1 %262, label %263, label %267
263: ; preds = %255
%264 = trunc i64 %231 to i32
%265 = trunc i64 %235 to i32
%266 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.10, i64 0, i64 0), i32 %265, i32 %264, i32 0)
br label %412
267: ; preds = %255
%268 = load i8*, i8** %256
%269 = getelementptr inbounds i8, i8* %268, i64 %247
store i8 %259, i8* %269
%270 = add nuw nsw i64 %249, 1
%271 = icmp eq i64 %270, %235
br i1 %271, label %272, label %248
272: ; preds = %267
%273 = add nuw nsw i64 %247, 10
%274 = icmp ult i64 %273, %231
br i1 %274, label %246, label %275
275: ; preds = %272
%276 = add nuw nsw i64 %235, 1
%277 = icmp eq i64 %276, 18
br i1 %277, label %278, label %234
278: ; preds = %275
%279 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
%280 = call i32 (i32, ...) bitcast (i32 (...)* @fflush to i32 (i32, ...)*)(i32 0)
%281 = add nuw nsw i64 %231, 1
%282 = icmp eq i64 %281, 1025
br i1 %282, label %283, label %230
283: ; preds = %278
%284 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 0
%285 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 1
%286 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 2
%287 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 3
%288 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 4
%289 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 5
%290 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 6
%291 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 7
%292 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 8
%293 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 9
%294 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 10
%295 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 11
%296 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 12
%297 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 13
%298 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 14
%299 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 15
%300 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 16
br label %301
301: ; preds = %283, %402
%302 = phi i64 [ 0, %283 ], [ %405, %402 ]
%303 = phi i64 [ 1024, %283 ], [ %407, %402 ]
%304 = load i8*, i8** %23
%305 = trunc i64 %302 to i32
%306 = sub nuw nsw i32 1024, %305
%307 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %304, i32 %306)
%308 = load i8*, i8** %23
%309 = getelementptr inbounds i8, i8* %308, i64 %302
store i8* %309, i8** %284
%310 = load i8*, i8** %25
%311 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %310, i32 %306)
%312 = load i8*, i8** %25
%313 = getelementptr inbounds i8, i8* %312, i64 %302
store i8* %313, i8** %285
%314 = load i8*, i8** %27
%315 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %314, i32 %306)
%316 = load i8*, i8** %27
%317 = getelementptr inbounds i8, i8* %316, i64 %302
store i8* %317, i8** %286
%318 = load i8*, i8** %29
%319 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %318, i32 %306)
%320 = load i8*, i8** %29
%321 = getelementptr inbounds i8, i8* %320, i64 %302
store i8* %321, i8** %287
%322 = load i8*, i8** %31
%323 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %322, i32 %306)
%324 = load i8*, i8** %31
%325 = getelementptr inbounds i8, i8* %324, i64 %302
store i8* %325, i8** %288
%326 = load i8*, i8** %33
%327 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %326, i32 %306)
%328 = load i8*, i8** %33
%329 = getelementptr inbounds i8, i8* %328, i64 %302
store i8* %329, i8** %289
%330 = load i8*, i8** %35
%331 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %330, i32 %306)
%332 = load i8*, i8** %35
%333 = getelementptr inbounds i8, i8* %332, i64 %302
store i8* %333, i8** %290
%334 = load i8*, i8** %37
%335 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %334, i32 %306)
%336 = load i8*, i8** %37
%337 = getelementptr inbounds i8, i8* %336, i64 %302
store i8* %337, i8** %291
%338 = load i8*, i8** %39
%339 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %338, i32 %306)
%340 = load i8*, i8** %39
%341 = getelementptr inbounds i8, i8* %340, i64 %302
store i8* %341, i8** %292
%342 = load i8*, i8** %41
%343 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %342, i32 %306)
%344 = load i8*, i8** %41
%345 = getelementptr inbounds i8, i8* %344, i64 %302
store i8* %345, i8** %293
%346 = load i8*, i8** %43
%347 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %346, i32 %306)
%348 = load i8*, i8** %43
%349 = getelementptr inbounds i8, i8* %348, i64 %302
store i8* %349, i8** %294
%350 = load i8*, i8** %45
%351 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %350, i32 %306)
%352 = load i8*, i8** %45
%353 = getelementptr inbounds i8, i8* %352, i64 %302
store i8* %353, i8** %295
%354 = load i8*, i8** %47
%355 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %354, i32 %306)
%356 = load i8*, i8** %47
%357 = getelementptr inbounds i8, i8* %356, i64 %302
store i8* %357, i8** %296
%358 = load i8*, i8** %49
%359 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %358, i32 %306)
%360 = load i8*, i8** %49
%361 = getelementptr inbounds i8, i8* %360, i64 %302
store i8* %361, i8** %297
%362 = load i8*, i8** %51
%363 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %362, i32 %306)
%364 = load i8*, i8** %51
%365 = getelementptr inbounds i8, i8* %364, i64 %302
store i8* %365, i8** %298
%366 = load i8*, i8** %53
%367 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %366, i32 %306)
%368 = load i8*, i8** %53
%369 = getelementptr inbounds i8, i8* %368, i64 %302
store i8* %369, i8** %299
%370 = load i8*, i8** %55
%371 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @rand_buffer to i32 (i8*, i32, ...)*)(i8* %370, i32 %306)
%372 = load i8*, i8** %55
%373 = getelementptr inbounds i8, i8* %372, i64 %302
store i8* %373, i8** %300
%374 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @xor_gen_base to i32 (i32, i32, i8*, ...)*)(i32 17, i32 %306, i8* %7)
%375 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8*, ...)*)(i32 17, i32 %306, i8* %7)
%376 = icmp eq i32 %375, 0
br i1 %376, label %380, label %377
377: ; preds = %301
%378 = trunc i64 %302 to i32
%379 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %378, i32 %306)
br label %412
380: ; preds = %301, %399
%381 = phi i64 [ %400, %399 ], [ 0, %301 ]
%382 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 %381
br label %383
383: ; preds = %380, %394
%384 = phi i64 [ 0, %380 ], [ %397, %394 ]
%385 = load i8*, i8** %382
%386 = getelementptr inbounds i8, i8* %385, i64 %384
%387 = load i8, i8* %386
%388 = xor i8 %387, 1
store i8 %388, i8* %386
%389 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @xor_check to i32 (i32, i32, i8*, ...)*)(i32 17, i32 %306, i8* %7)
%390 = icmp eq i32 %389, 0
br i1 %390, label %391, label %394
391: ; preds = %383
%392 = trunc i64 %302 to i32
%393 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.12, i64 0, i64 0), i32 %392, i32 %306, i32 0)
br label %412
394: ; preds = %383
%395 = load i8*, i8** %382
%396 = getelementptr inbounds i8, i8* %395, i64 %384
store i8 %387, i8* %396
%397 = add nuw nsw i64 %384, 1
%398 = icmp eq i64 %397, %303
br i1 %398, label %399, label %383
399: ; preds = %394
%400 = add nuw nsw i64 %381, 1
%401 = icmp eq i64 %400, 17
br i1 %401, label %402, label %380
402: ; preds = %399
%403 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
%404 = call i32 (i32, ...) bitcast (i32 (...)* @fflush to i32 (i32, ...)*)(i32 0)
%405 = add nuw nsw i64 %302, 32
%406 = icmp ult i64 %302, 992
%407 = add nsw i64 %303, -32
br i1 %406, label %301, label %408
408: ; preds = %402
%409 = icmp eq i32 %150, 0
br i1 %409, label %410, label %412
410: ; preds = %408
%411 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %412
412: ; preds = %15, %408, %410, %391, %377, %263, %252, %213, %203, %171, %160, %84
%413 = phi i32 [ 1, %15 ], [ 1, %84 ], [ 1, %160 ], [ 1, %171 ], [ 1, %203 ], [ 1, %213 ], [ 1, %252 ], [ 1, %263 ], [ 1, %377 ], [ 1, %391 ], [ 0, %410 ], [ %150, %408 ]
ret i32 %413
}