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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, int);
int posix_memalign(void **, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ rand_buffer(unsigned char *, int);
int /*<<< orphan*/ srand(int);
int xor_check_base(int, int, void *);
int /*<<< orphan*/ xor_gen(int, int, void *);
int main(int argc, char *argv[]) {
  int i, j, k, ret, fail = 0;
  void *buffs[16 + 1];
  char *tmp_buf[16 + 1];
  printf("Test xor_gen_test ");
  srand(0x1234);
  for (i = 0; i < 16 + 1; i++) {
    void *buf;
    ret = posix_memalign(&buf, 32, 1024);
    if (ret) {
      printf("alloc error: Fail");
      return 1;
    }
    buffs[i] = buf;
  }
  for (i = 0; i < 16 + 1; i++)
    memset(buffs[i], 0, 1024);
  xor_gen(16 + 1, 1024, buffs);
  for (i = 0; i < 1024; i++) {
    if (((char *)buffs[16])[i] != 0)
      fail++;
  }
  if (fail > 0) {
    printf("fail zero test");
    return 1;
  } else
    putchar('.');
  for (i = 0; i < 16 + 1; i++)
    rand_buffer(buffs[i], 1024);
  xor_gen(16 + 1, 1024, buffs);
  fail |= xor_check_base(16 + 1, 1024, buffs);
  if (fail > 0) {
    printf("fail rand test %d\n", fail);
    return 1;
  } else
    putchar('.');
  for (j = 3; j <= 16 + 1; j++) {
    for (i = 0; i < j; i++)
      rand_buffer(buffs[i], 1024);
    xor_gen(j, 1024, buffs);
    fail |= xor_check_base(j, 1024, buffs);
    if (fail > 0) {
      printf("fail rand test %d sources\n", j);
      return 1;
    } else
      putchar('.');
  }
  fflush(0);
  k = 0;
  while (k <= 1024) {
    for (j = 3; j <= 16 + 1; j++) {
      for (i = 0; i < j; i++)
        rand_buffer(buffs[i], k);
      xor_gen(j, k, buffs);
      fail |= xor_check_base(j, k, buffs);
      if (fail > 0) {
        printf("fail rand test %d sources, len=%d, ret=%d\n", j, k, fail);
        return 1;
      }
    }
    putchar('.');
    k += 1;
  }
  for (i = 0; i < 1024; i += 32) {
    for (j = 0; j < 16 + 1; j++) {
      rand_buffer((unsigned char *)buffs[j] + i, 1024 - i);
      tmp_buf[j] = (char *)buffs[j] + i;
    }
    xor_gen(16 + 1, 1024 - i, (void *)tmp_buf);
    fail |= xor_check_base(16 + 1, 1024 - i, (void *)tmp_buf);
    if (fail > 0) {
      printf("fail end test - offset: %d, len: %d\n", i, 1024 - i);
      return 1;
    }
    putchar('.');
    fflush(0);
  }
  if (!fail)
    printf(" done: Pass\n");
  return fail;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1234,%edi
call   1060 <srand@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
jge    1237 <main+0xa7>
lea    -0x148(%rbp),%rdi
mov    $0x20,%esi
mov    $0x400,%edx
call   1090 <posix_memalign@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1216 <main+0x86>
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1642 <main+0x4b2>
mov    -0x148(%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    11cf <main+0x3f>
movl   $0x0,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
jge    126e <main+0xde>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    123e <main+0xae>
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
call   10a0 <xor_gen@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    12c9 <main+0x139>
mov    -0x30(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     12b6 <main+0x126>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12bb <main+0x12b>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    128b <main+0xfb>
cmpl   $0x0,-0x24(%rbp)
jle    12ed <main+0x15d>
lea    0xd4b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1642 <main+0x4b2>
mov    $0x2e,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x11,-0x14(%rbp)
jge    132c <main+0x19c>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
mov    $0x400,%esi
call   1070 <rand_buffer@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12fe <main+0x16e>
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
call   10a0 <xor_gen@plt>
lea    -0xb0(%rbp),%rdx
mov    $0x11,%edi
mov    $0x400,%esi
call   10b0 <xor_check_base@plt>
or     -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    1385 <main+0x1f5>
mov    -0x24(%rbp),%esi
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1642 <main+0x4b2>
mov    $0x2e,%edi
call   1030 <putchar@plt>
movl   $0x3,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jg     1449 <main+0x2b9>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    13d7 <main+0x247>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
mov    $0x400,%esi
call   1070 <rand_buffer@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13a7 <main+0x217>
mov    -0x18(%rbp),%edi
lea    -0xb0(%rbp),%rdx
mov    $0x400,%esi
call   10a0 <xor_gen@plt>
mov    -0x18(%rbp),%edi
lea    -0xb0(%rbp),%rdx
mov    $0x400,%esi
call   10b0 <xor_check_base@plt>
or     -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    142c <main+0x29c>
mov    -0x18(%rbp),%esi
lea    0xc2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1642 <main+0x4b2>
mov    $0x2e,%edi
call   1030 <putchar@plt>
jmp    143b <main+0x2ab>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1396 <main+0x206>
xor    %edi,%edi
call   1080 <fflush@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x400,-0x1c(%rbp)
jg     152c <main+0x39c>
movl   $0x3,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jg     1514 <main+0x384>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    14aa <main+0x31a>
movslq -0x14(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
mov    -0x1c(%rbp),%esi
call   1070 <rand_buffer@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    147c <main+0x2ec>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0xb0(%rbp),%rdx
call   10a0 <xor_gen@plt>
mov    -0x18(%rbp),%edi
mov    -0x1c(%rbp),%esi
lea    -0xb0(%rbp),%rdx
call   10b0 <xor_check_base@plt>
or     -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    1501 <main+0x371>
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0xb74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1642 <main+0x4b2>
jmp    1506 <main+0x376>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    146b <main+0x2db>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1457 <main+0x2c7>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1624 <main+0x494>
movl   $0x0,-0x18(%rbp)
cmpl   $0x11,-0x18(%rbp)
jge    159e <main+0x40e>
movslq -0x18(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
movslq -0x14(%rbp),%rax
add    %rax,%rdi
mov    $0x400,%esi
sub    -0x14(%rbp),%esi
call   1070 <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,-0x140(%rbp,%rax,8)
ff
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1547 <main+0x3b7>
mov    $0x400,%esi
sub    -0x14(%rbp),%esi
lea    -0x140(%rbp),%rdx
mov    $0x11,%edi
call   10a0 <xor_gen@plt>
mov    $0x400,%esi
sub    -0x14(%rbp),%esi
lea    -0x140(%rbp),%rdx
mov    $0x11,%edi
call   10b0 <xor_check_base@plt>
or     -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jle    1605 <main+0x475>
mov    -0x14(%rbp),%esi
mov    $0x400,%edx
sub    -0x14(%rbp),%edx
lea    0xa9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1642 <main+0x4b2>
mov    $0x2e,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1080 <fflush@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x14(%rbp)
jmp    1533 <main+0x3a3>
cmpl   $0x0,-0x24(%rbp)
jne    163c <main+0x4ac>
lea    0xa7d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x120,%rsp
lea    0xe5a(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1234,%edi
call   1070 <srand@plt>
lea    0x90(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x20,%esi
mov    $0x400,%edx
call   10a0 <posix_memalign@plt>
test   %eax,%eax
jne    141f <main+0x27f>
mov    0x90(%rsp),%rax
mov    %rax,(%rsp,%rbp,8)
add    $0x1,%rbp
cmp    $0x11,%rbp
jne    11e0 <main+0x40>
mov    (%rsp),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x10(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x18(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x20(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x28(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x30(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x38(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x40(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x48(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x50(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x58(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x60(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x68(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x70(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x78(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    0x80(%rsp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1060 <memset@plt>
mov    %rsp,%rdx
mov    $0x11,%edi
mov    $0x400,%esi
call   10b0 <xor_gen@plt>
pxor   %xmm0,%xmm0
mov    0x80(%rsp),%rax
pcmpeqd %xmm1,%xmm1
movdqa 0xca1(%rip),%xmm3
pxor   %xmm4,%xmm4
pxor   %xmm2,%xmm2
nopw   0x0(%rax,%rax,1)
movd   (%rax,%rbx,1),%xmm6
movd   0x4(%rax,%rbx,1),%xmm5
pcmpeqb %xmm0,%xmm6
pxor   %xmm1,%xmm6
punpcklbw %xmm6,%xmm6
punpcklwd %xmm6,%xmm6
pand   %xmm3,%xmm6
paddd  %xmm4,%xmm6
pcmpeqb %xmm0,%xmm5
pxor   %xmm1,%xmm5
punpcklbw %xmm5,%xmm5
punpcklwd %xmm5,%xmm5
pand   %xmm3,%xmm5
paddd  %xmm2,%xmm5
movd   0x8(%rax,%rbx,1),%xmm4
movd   0xc(%rax,%rbx,1),%xmm2
pcmpeqb %xmm0,%xmm4
pxor   %xmm1,%xmm4
punpcklbw %xmm4,%xmm4
punpcklwd %xmm4,%xmm4
pand   %xmm3,%xmm4
paddd  %xmm6,%xmm4
pcmpeqb %xmm0,%xmm2
pxor   %xmm1,%xmm2
punpcklbw %xmm2,%xmm2
punpcklwd %xmm2,%xmm2
pand   %xmm3,%xmm2
paddd  %xmm5,%xmm2
add    $0x10,%rbx
cmp    $0x400,%rbx
jne    1370 <main+0x1d0>
paddd  %xmm4,%xmm2
pshufd $0xee,%xmm2,%xmm0
paddd  %xmm2,%xmm0
pshufd $0x55,%xmm0,%xmm1
paddd  %xmm0,%xmm1
movd   %xmm1,%eax
test   %eax,%eax
je     1446 <main+0x2a6>
lea    0xc18(%rip),%rdi
jmp    1426 <main+0x286>
lea    0xbfd(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%r12d
mov    %r12d,%eax
add    $0x120,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    (%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x8(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x10(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x18(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x20(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x28(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x30(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x38(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x40(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x48(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x50(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x58(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x60(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x68(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x70(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x78(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    0x80(%rsp),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
mov    %rsp,%rbx
mov    $0x11,%edi
mov    $0x400,%esi
mov    %rbx,%rdx
call   10b0 <xor_gen@plt>
mov    $0x11,%edi
mov    $0x400,%esi
mov    %rbx,%rdx
call   10c0 <xor_check_base@plt>
mov    %eax,%r12d
test   %eax,%eax
jle    158e <main+0x3ee>
lea    0xabe(%rip),%rdi
mov    %r12d,%esi
jmp    19d2 <main+0x832>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x3,%ebx
mov    %rsp,%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsp,%rbp,8),%rdi
mov    $0x400,%esi
call   1080 <rand_buffer@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    15b0 <main+0x410>
mov    %ebx,%edi
mov    $0x400,%esi
mov    %r14,%rdx
call   10b0 <xor_gen@plt>
mov    %ebx,%edi
mov    $0x400,%esi
mov    %r14,%rdx
call   10c0 <xor_check_base@plt>
or     %eax,%r12d
jg     19c9 <main+0x829>
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x12,%rbx
jne    15a0 <main+0x400>
xor    %r15d,%r15d
xor    %edi,%edi
call   1090 <fflush@plt>
mov    %rsp,%r14
mov    $0x3,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rsp,%rbx,8),%rdi
mov    %r15d,%esi
call   1080 <rand_buffer@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1630 <main+0x490>
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   10b0 <xor_gen@plt>
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   10c0 <xor_check_base@plt>
or     %eax,%r12d
jg     19de <main+0x83e>
add    $0x1,%rbp
cmp    $0x12,%rbp
jne    1620 <main+0x480>
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0x1,%r15d
cmp    $0x401,%r15d
jne    160f <main+0x46f>
mov    $0xffffffffffffffe0,%rbx
mov    $0x400,%r14d
lea    0x90(%rsp),%r15
mov    %r12d,%ebp
mov    (%rsp),%rax
lea    (%rax,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    (%rsp),%rax
mov    0x8(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0x90(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x8(%rsp),%rax
mov    0x10(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0x98(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x10(%rsp),%rax
mov    0x18(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xa0(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x18(%rsp),%rax
mov    0x20(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xa8(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x20(%rsp),%rax
mov    0x28(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xb0(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x28(%rsp),%rax
mov    0x30(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xb8(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x30(%rsp),%rax
mov    0x38(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xc0(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x38(%rsp),%rax
mov    0x40(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xc8(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x40(%rsp),%rax
mov    0x48(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xd0(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x48(%rsp),%rax
mov    0x50(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xd8(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x50(%rsp),%rax
mov    0x58(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xe0(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x58(%rsp),%rax
mov    0x60(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xe8(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x60(%rsp),%rax
mov    0x68(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xf0(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x68(%rsp),%rax
mov    0x70(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0xf8(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x70(%rsp),%rax
mov    0x78(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0x100(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x78(%rsp),%rax
mov    0x80(%rsp),%rcx
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0x108(%rsp)
lea    (%rcx,%rbx,1),%rdi
add    $0x20,%rdi
mov    %r14d,%esi
call   1080 <rand_buffer@plt>
mov    0x80(%rsp),%rax
add    %rbx,%rax
add    $0x20,%rax
mov    %rax,0x110(%rsp)
mov    $0x11,%edi
mov    %r14d,%esi
mov    %r15,%rdx
call   10b0 <xor_gen@plt>
mov    $0x11,%edi
mov    %r14d,%esi
mov    %r15,%rdx
call   10c0 <xor_check_base@plt>
mov    %eax,%r12d
or     %ebp,%r12d
jg     19f9 <main+0x859>
mov    $0x2e,%edi
call   1030 <putchar@plt>
xor    %edi,%edi
call   1090 <fflush@plt>
add    $0x20,%rbx
add    $0xffffffe0,%r14d
cmp    $0x3e0,%rbx
jb     169e <main+0x4fe>
test   %r12d,%r12d
jne    1433 <main+0x293>
lea    0x706(%rip),%rdi
call   1040 <puts@plt>
xor    %r12d,%r12d
jmp    1433 <main+0x293>
lea    0x687(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    142d <main+0x28d>
lea    0x68d(%rip),%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    %r12d,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    142d <main+0x28d>
add    $0x20,%ebx
lea    0x69a(%rip),%rdi
mov    %ebx,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
jmp    142d <main+0x28d>

LLVM IR (-O0):
@.str = [19 x i8] c"Test xor_gen_test \00"
@.str.1 = [18 x i8] c"alloc error: Fail\00"
@.str.2 = [15 x i8] c"fail zero test\00"
@.str.3 = [19 x i8] c"fail rand test %d\0A\00"
@.str.4 = [27 x i8] c"fail rand test %d sources\0A\00"
@.str.5 = [43 x i8] c"fail rand test %d sources, len=%d, ret=%d\0A\00"
@.str.6 = [37 x i8] c"fail end test - offset: %d, len: %d\0A\00"
@.str.7 = [13 x i8] c" done: 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 [17 x i8*]
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @srand(i32 4660)
store i32 0, i32* %6
br label %16
16: ; preds = %30, %2
%17 = load i32, i32* %6
%18 = icmp slt i32 %17, 17
br i1 %18, label %19, label %33
19: ; preds = %16
%20 = call i32 @posix_memalign(i8** %13, i32 32, i32 1024)
store i32 %20, i32* %9
%21 = load i32, i32* %9
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %19
%24 = 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 %262
25: ; preds = %19
%26 = load i8*, i8** %13
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %28
store i8* %26, i8** %29
br label %30
30: ; preds = %25
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %16
33: ; preds = %16
store i32 0, i32* %6
br label %34
34: ; preds = %43, %33
%35 = load i32, i32* %6
%36 = icmp slt i32 %35, 17
br i1 %36, label %37, label %46
37: ; preds = %34
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 @memset(i8* %41, i32 0, i32 1024)
br label %43
43: ; preds = %37
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %34
46: ; preds = %34
%47 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%48 = bitcast i8** %47 to i8*
%49 = call i32 @xor_gen(i32 17, i32 1024, i8* %48)
store i32 0, i32* %6
br label %50
50: ; preds = %66, %46
%51 = load i32, i32* %6
%52 = icmp slt i32 %51, 1024
br i1 %52, label %53, label %69
53: ; preds = %50
%54 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 16
%55 = load i8*, i8** %54
%56 = load i32, i32* %6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %53
%63 = load i32, i32* %10
%64 = add nsw i32 %63, 1
store i32 %64, i32* %10
br label %65
65: ; preds = %62, %53
br label %66
66: ; preds = %65
%67 = load i32, i32* %6
%68 = add nsw i32 %67, 1
store i32 %68, i32* %6
br label %50
69: ; preds = %50
%70 = load i32, i32* %10
%71 = icmp sgt i32 %70, 0
br i1 %71, label %72, label %74
72: ; preds = %69
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %3
br label %262
74: ; preds = %69
%75 = call i32 @putchar(i8 signext 46)
br label %76
76: ; preds = %74
store i32 0, i32* %6
br label %77
77: ; preds = %86, %76
%78 = load i32, i32* %6
%79 = icmp slt i32 %78, 17
br i1 %79, label %80, label %89
80: ; preds = %77
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %82
%84 = load i8*, i8** %83
%85 = call i32 @rand_buffer(i8* %84, i32 1024)
br label %86
86: ; preds = %80
%87 = load i32, i32* %6
%88 = add nsw i32 %87, 1
store i32 %88, i32* %6
br label %77
89: ; preds = %77
%90 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%91 = bitcast i8** %90 to i8*
%92 = call i32 @xor_gen(i32 17, i32 1024, i8* %91)
%93 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%94 = bitcast i8** %93 to i8*
%95 = call i32 @xor_check_base(i32 17, i32 1024, i8* %94)
%96 = load i32, i32* %10
%97 = or i32 %96, %95
store i32 %97, i32* %10
%98 = load i32, i32* %10
%99 = icmp sgt i32 %98, 0
br i1 %99, label %100, label %103
100: ; preds = %89
%101 = load i32, i32* %10
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %101)
store i32 1, i32* %3
br label %262
103: ; preds = %89
%104 = call i32 @putchar(i8 signext 46)
br label %105
105: ; preds = %103
store i32 3, i32* %7
br label %106
106: ; preds = %142, %105
%107 = load i32, i32* %7
%108 = icmp sle i32 %107, 17
br i1 %108, label %109, label %145
109: ; preds = %106
store i32 0, i32* %6
br label %110
110: ; preds = %120, %109
%111 = load i32, i32* %6
%112 = load i32, i32* %7
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %123
114: ; preds = %110
%115 = load i32, i32* %6
%116 = sext i32 %115 to i64
%117 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %116
%118 = load i8*, i8** %117
%119 = call i32 @rand_buffer(i8* %118, i32 1024)
br label %120
120: ; preds = %114
%121 = load i32, i32* %6
%122 = add nsw i32 %121, 1
store i32 %122, i32* %6
br label %110
123: ; preds = %110
%124 = load i32, i32* %7
%125 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%126 = bitcast i8** %125 to i8*
%127 = call i32 @xor_gen(i32 %124, i32 1024, i8* %126)
%128 = load i32, i32* %7
%129 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%130 = bitcast i8** %129 to i8*
%131 = call i32 @xor_check_base(i32 %128, i32 1024, i8* %130)
%132 = load i32, i32* %10
%133 = or i32 %132, %131
store i32 %133, i32* %10
%134 = load i32, i32* %10
%135 = icmp sgt i32 %134, 0
br i1 %135, label %136, label %139
136: ; preds = %123
%137 = load i32, i32* %7
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %137)
store i32 1, i32* %3
br label %262
139: ; preds = %123
%140 = call i32 @putchar(i8 signext 46)
br label %141
141: ; preds = %139
br label %142
142: ; preds = %141
%143 = load i32, i32* %7
%144 = add nsw i32 %143, 1
store i32 %144, i32* %7
br label %106
145: ; preds = %106
%146 = call i32 @fflush(i32 0)
store i32 0, i32* %8
br label %147
147: ; preds = %193, %145
%148 = load i32, i32* %8
%149 = icmp sle i32 %148, 1024
br i1 %149, label %150, label %197
150: ; preds = %147
store i32 3, i32* %7
br label %151
151: ; preds = %190, %150
%152 = load i32, i32* %7
%153 = icmp sle i32 %152, 17
br i1 %153, label %154, label %193
154: ; preds = %151
store i32 0, i32* %6
br label %155
155: ; preds = %166, %154
%156 = load i32, i32* %6
%157 = load i32, i32* %7
%158 = icmp slt i32 %156, %157
br i1 %158, label %159, label %169
159: ; preds = %155
%160 = load i32, i32* %6
%161 = sext i32 %160 to i64
%162 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %161
%163 = load i8*, i8** %162
%164 = load i32, i32* %8
%165 = call i32 @rand_buffer(i8* %163, i32 %164)
br label %166
166: ; preds = %159
%167 = load i32, i32* %6
%168 = add nsw i32 %167, 1
store i32 %168, i32* %6
br label %155
169: ; preds = %155
%170 = load i32, i32* %7
%171 = load i32, i32* %8
%172 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%173 = bitcast i8** %172 to i8*
%174 = call i32 @xor_gen(i32 %170, i32 %171, i8* %173)
%175 = load i32, i32* %7
%176 = load i32, i32* %8
%177 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 0
%178 = bitcast i8** %177 to i8*
%179 = call i32 @xor_check_base(i32 %175, i32 %176, i8* %178)
%180 = load i32, i32* %10
%181 = or i32 %180, %179
store i32 %181, i32* %10
%182 = load i32, i32* %10
%183 = icmp sgt i32 %182, 0
br i1 %183, label %184, label %189
184: ; preds = %169
%185 = load i32, i32* %7
%186 = load i32, i32* %8
%187 = load i32, i32* %10
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %185, i32 %186, i32 %187)
store i32 1, i32* %3
br label %262
189: ; preds = %169
br label %190
190: ; preds = %189
%191 = load i32, i32* %7
%192 = add nsw i32 %191, 1
store i32 %192, i32* %7
br label %151
193: ; preds = %151
%194 = call i32 @putchar(i8 signext 46)
%195 = load i32, i32* %8
%196 = add nsw i32 %195, 1
store i32 %196, i32* %8
br label %147
197: ; preds = %147
store i32 0, i32* %6
br label %198
198: ; preds = %252, %197
%199 = load i32, i32* %6
%200 = icmp slt i32 %199, 1024
br i1 %200, label %201, label %255
201: ; preds = %198
store i32 0, i32* %7
br label %202
202: ; preds = %226, %201
%203 = load i32, i32* %7
%204 = icmp slt i32 %203, 17
br i1 %204, label %205, label %229
205: ; preds = %202
%206 = load i32, i32* %7
%207 = sext i32 %206 to i64
%208 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %207
%209 = load i8*, i8** %208
%210 = load i32, i32* %6
%211 = sext i32 %210 to i64
%212 = getelementptr inbounds i8, i8* %209, i64 %211
%213 = load i32, i32* %6
%214 = sub nsw i32 1024, %213
%215 = call i32 @rand_buffer(i8* %212, i32 %214)
%216 = load i32, i32* %7
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [17 x i8*], [17 x i8*]* %11, i64 0, i64 %217
%219 = load i8*, i8** %218
%220 = load i32, i32* %6
%221 = sext i32 %220 to i64
%222 = getelementptr inbounds i8, i8* %219, i64 %221
%223 = load i32, i32* %7
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds [17 x i8*], [17 x i8*]* %12, i64 0, i64 %224
store i8* %222, i8** %225
br label %226
226: ; preds = %205
%227 = load i32, i32* %7
%228 = add nsw i32 %227, 1
store i32 %228, i32* %7
br label %202
229: ; preds = %202
%230 = load i32, i32* %6
%231 = sub nsw i32 1024, %230
%232 = getelementptr inbounds [17 x i8*], [17 x i8*]* %12, i64 0, i64 0
%233 = bitcast i8** %232 to i8*
%234 = call i32 @xor_gen(i32 17, i32 %231, i8* %233)
%235 = load i32, i32* %6
%236 = sub nsw i32 1024, %235
%237 = getelementptr inbounds [17 x i8*], [17 x i8*]* %12, i64 0, i64 0
%238 = bitcast i8** %237 to i8*
%239 = call i32 @xor_check_base(i32 17, i32 %236, i8* %238)
%240 = load i32, i32* %10
%241 = or i32 %240, %239
store i32 %241, i32* %10
%242 = load i32, i32* %10
%243 = icmp sgt i32 %242, 0
br i1 %243, label %244, label %249
244: ; preds = %229
%245 = load i32, i32* %6
%246 = load i32, i32* %6
%247 = sub nsw i32 1024, %246
%248 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %245, i32 %247)
store i32 1, i32* %3
br label %262
249: ; preds = %229
%250 = call i32 @putchar(i8 signext 46)
%251 = call i32 @fflush(i32 0)
br label %252
252: ; preds = %249
%253 = load i32, i32* %6
%254 = add nsw i32 %253, 32
store i32 %254, i32* %6
br label %198
255: ; preds = %198
%256 = load i32, i32* %10
%257 = icmp ne i32 %256, 0
br i1 %257, label %260, label %258
258: ; preds = %255
%259 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
br label %260
260: ; preds = %258, %255
%261 = load i32, i32* %10
store i32 %261, i32* %3
br label %262
262: ; preds = %260, %244, %184, %136, %100, %72, %23
%263 = load i32, i32* %3
ret i32 %263
}

LLVM IR (-O2):
@.str = [19 x i8] c"Test xor_gen_test \00"
@.str.1 = [18 x i8] c"alloc error: Fail\00"
@.str.2 = [15 x i8] c"fail zero test\00"
@.str.3 = [19 x i8] c"fail rand test %d\0A\00"
@.str.4 = [27 x i8] c"fail rand test %d sources\0A\00"
@.str.5 = [43 x i8] c"fail rand test %d sources, len=%d, ret=%d\0A\00"
@.str.6 = [37 x i8] c"fail end test - offset: %d, len: %d\0A\00"
@str = [12 x i8] c" done: Pass\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 ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @srand(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 @posix_memalign(i8** %5, i32 32, 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 %334
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 = call i32 @memset(i8* %24, i32 0, i32 1024)
%26 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @memset(i8* %27, i32 0, i32 1024)
%29 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 2
%30 = load i8*, i8** %29
%31 = call i32 @memset(i8* %30, i32 0, i32 1024)
%32 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 3
%33 = load i8*, i8** %32
%34 = call i32 @memset(i8* %33, i32 0, i32 1024)
%35 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 4
%36 = load i8*, i8** %35
%37 = call i32 @memset(i8* %36, i32 0, i32 1024)
%38 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 5
%39 = load i8*, i8** %38
%40 = call i32 @memset(i8* %39, i32 0, i32 1024)
%41 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 6
%42 = load i8*, i8** %41
%43 = call i32 @memset(i8* %42, i32 0, i32 1024)
%44 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 7
%45 = load i8*, i8** %44
%46 = call i32 @memset(i8* %45, i32 0, i32 1024)
%47 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 8
%48 = load i8*, i8** %47
%49 = call i32 @memset(i8* %48, i32 0, i32 1024)
%50 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 9
%51 = load i8*, i8** %50
%52 = call i32 @memset(i8* %51, i32 0, i32 1024)
%53 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 10
%54 = load i8*, i8** %53
%55 = call i32 @memset(i8* %54, i32 0, i32 1024)
%56 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 11
%57 = load i8*, i8** %56
%58 = call i32 @memset(i8* %57, i32 0, i32 1024)
%59 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 12
%60 = load i8*, i8** %59
%61 = call i32 @memset(i8* %60, i32 0, i32 1024)
%62 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 13
%63 = load i8*, i8** %62
%64 = call i32 @memset(i8* %63, i32 0, i32 1024)
%65 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 14
%66 = load i8*, i8** %65
%67 = call i32 @memset(i8* %66, i32 0, i32 1024)
%68 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 15
%69 = load i8*, i8** %68
%70 = call i32 @memset(i8* %69, i32 0, i32 1024)
%71 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 16
%72 = load i8*, i8** %71
%73 = call i32 @memset(i8* %72, i32 0, i32 1024)
%74 = call i32 @xor_gen(i32 17, i32 1024, i8* %6)
%75 = load i8*, i8** %71
br label %76
76: ; preds = %76, %22
%77 = phi i64 [ 0, %22 ], [ %105, %76 ]
%78 = phi <4 x i32> [ zeroinitializer, %22 ], [ %103, %76 ]
%79 = phi <4 x i32> [ zeroinitializer, %22 ], [ %104, %76 ]
%80 = getelementptr inbounds i8, i8* %75, i64 %77
%81 = bitcast i8* %80 to <4 x i8>*
%82 = load <4 x i8>, <4 x i8>* %81
%83 = getelementptr inbounds i8, i8* %80, i64 4
%84 = bitcast i8* %83 to <4 x i8>*
%85 = load <4 x i8>, <4 x i8>* %84
%86 = icmp ne <4 x i8> %82, zeroinitializer
%87 = icmp ne <4 x i8> %85, zeroinitializer
%88 = zext <4 x i1> %86 to <4 x i32>
%89 = zext <4 x i1> %87 to <4 x i32>
%90 = add <4 x i32> %78, %88
%91 = add <4 x i32> %79, %89
%92 = or i64 %77, 8
%93 = getelementptr inbounds i8, i8* %75, i64 %92
%94 = bitcast i8* %93 to <4 x i8>*
%95 = load <4 x i8>, <4 x i8>* %94
%96 = getelementptr inbounds i8, i8* %93, i64 4
%97 = bitcast i8* %96 to <4 x i8>*
%98 = load <4 x i8>, <4 x i8>* %97
%99 = icmp ne <4 x i8> %95, zeroinitializer
%100 = icmp ne <4 x i8> %98, zeroinitializer
%101 = zext <4 x i1> %99 to <4 x i32>
%102 = zext <4 x i1> %100 to <4 x i32>
%103 = add <4 x i32> %90, %101
%104 = add <4 x i32> %91, %102
%105 = add nuw nsw i64 %77, 16
%106 = icmp eq i64 %105, 1024
br i1 %106, label %107, label %76
107: ; preds = %76
%108 = add <4 x i32> %104, %103
%109 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %108)
%110 = icmp eq i32 %109, 0
br i1 %110, label %113, label %111
111: ; preds = %107
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
br label %334
113: ; preds = %107
%114 = call i32 @putchar(i8 signext 46)
%115 = load i8*, i8** %23
%116 = call i32 @rand_buffer(i8* %115, i32 1024)
%117 = load i8*, i8** %26
%118 = call i32 @rand_buffer(i8* %117, i32 1024)
%119 = load i8*, i8** %29
%120 = call i32 @rand_buffer(i8* %119, i32 1024)
%121 = load i8*, i8** %32
%122 = call i32 @rand_buffer(i8* %121, i32 1024)
%123 = load i8*, i8** %35
%124 = call i32 @rand_buffer(i8* %123, i32 1024)
%125 = load i8*, i8** %38
%126 = call i32 @rand_buffer(i8* %125, i32 1024)
%127 = load i8*, i8** %41
%128 = call i32 @rand_buffer(i8* %127, i32 1024)
%129 = load i8*, i8** %44
%130 = call i32 @rand_buffer(i8* %129, i32 1024)
%131 = load i8*, i8** %47
%132 = call i32 @rand_buffer(i8* %131, i32 1024)
%133 = load i8*, i8** %50
%134 = call i32 @rand_buffer(i8* %133, i32 1024)
%135 = load i8*, i8** %53
%136 = call i32 @rand_buffer(i8* %135, i32 1024)
%137 = load i8*, i8** %56
%138 = call i32 @rand_buffer(i8* %137, i32 1024)
%139 = load i8*, i8** %59
%140 = call i32 @rand_buffer(i8* %139, i32 1024)
%141 = load i8*, i8** %62
%142 = call i32 @rand_buffer(i8* %141, i32 1024)
%143 = load i8*, i8** %65
%144 = call i32 @rand_buffer(i8* %143, i32 1024)
%145 = load i8*, i8** %68
%146 = call i32 @rand_buffer(i8* %145, i32 1024)
%147 = load i8*, i8** %71
%148 = call i32 @rand_buffer(i8* %147, i32 1024)
%149 = call i32 @xor_gen(i32 17, i32 1024, i8* %6)
%150 = call i32 @xor_check_base(i32 17, i32 1024, i8* %6)
%151 = icmp sgt i32 %150, 0
br i1 %151, label %152, label %154
152: ; preds = %113
%153 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %150)
br label %334
154: ; preds = %113
%155 = call i32 @putchar(i8 signext 46)
br label %156
156: ; preds = %154, %175
%157 = phi i64 [ 3, %154 ], [ %177, %175 ]
%158 = phi i32 [ %150, %154 ], [ %170, %175 ]
br label %159
159: ; preds = %156, %159
%160 = phi i64 [ 0, %156 ], [ %164, %159 ]
%161 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %160
%162 = load i8*, i8** %161
%163 = call i32 @rand_buffer(i8* %162, i32 1024)
%164 = add nuw nsw i64 %160, 1
%165 = icmp eq i64 %164, %157
br i1 %165, label %166, label %159
166: ; preds = %159
%167 = trunc i64 %157 to i32
%168 = call i32 @xor_gen(i32 %167, i32 1024, i8* %6)
%169 = call i32 @xor_check_base(i32 %167, i32 1024, i8* %6)
%170 = or i32 %169, %158
%171 = icmp sgt i32 %170, 0
br i1 %171, label %172, label %175
172: ; preds = %166
%173 = trunc i64 %157 to i32
%174 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %173)
br label %334
175: ; preds = %166
%176 = call i32 @putchar(i8 signext 46)
%177 = add nuw nsw i64 %157, 1
%178 = icmp eq i64 %177, 18
br i1 %178, label %179, label %156
179: ; preds = %175
%180 = call i32 @fflush(i32 0)
br label %181
181: ; preds = %179, %206
%182 = phi i32 [ %170, %179 ], [ %198, %206 ]
%183 = phi i32 [ 0, %179 ], [ %208, %206 ]
br label %184
184: ; preds = %181, %203
%185 = phi i64 [ 3, %181 ], [ %204, %203 ]
%186 = phi i32 [ %182, %181 ], [ %198, %203 ]
br label %187
187: ; preds = %184, %187
%188 = phi i64 [ 0, %184 ], [ %192, %187 ]
%189 = getelementptr inbounds [17 x i8*], [17 x i8*]* %3, i64 0, i64 %188
%190 = load i8*, i8** %189
%191 = call i32 @rand_buffer(i8* %190, i32 %183)
%192 = add nuw nsw i64 %188, 1
%193 = icmp eq i64 %192, %185
br i1 %193, label %194, label %187
194: ; preds = %187
%195 = trunc i64 %185 to i32
%196 = call i32 @xor_gen(i32 %195, i32 %183, i8* %6)
%197 = call i32 @xor_check_base(i32 %195, i32 %183, i8* %6)
%198 = or i32 %197, %186
%199 = icmp sgt i32 %198, 0
br i1 %199, label %200, label %203
200: ; preds = %194
%201 = trunc i64 %185 to i32
%202 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %201, i32 %183, i32 %198)
br label %334
203: ; preds = %194
%204 = add nuw nsw i64 %185, 1
%205 = icmp eq i64 %204, 18
br i1 %205, label %206, label %184
206: ; preds = %203
%207 = call i32 @putchar(i8 signext 46)
%208 = add nuw nsw i32 %183, 1
%209 = icmp eq i32 %208, 1025
br i1 %209, label %210, label %181
210: ; preds = %206
%211 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 0
%212 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 1
%213 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 2
%214 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 3
%215 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 4
%216 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 5
%217 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 6
%218 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 7
%219 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 8
%220 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 9
%221 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 10
%222 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 11
%223 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 12
%224 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 13
%225 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 14
%226 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 15
%227 = getelementptr inbounds [17 x i8*], [17 x i8*]* %4, i64 0, i64 16
br label %228
228: ; preds = %210, %325
%229 = phi i64 [ 0, %210 ], [ %328, %325 ]
%230 = phi i32 [ %198, %210 ], [ %320, %325 ]
%231 = load i8*, i8** %23
%232 = getelementptr inbounds i8, i8* %231, i64 %229
%233 = trunc i64 %229 to i32
%234 = sub nuw nsw i32 1024, %233
%235 = call i32 @rand_buffer(i8* %232, i32 %234)
%236 = load i8*, i8** %23
%237 = getelementptr inbounds i8, i8* %236, i64 %229
store i8* %237, i8** %211
%238 = load i8*, i8** %26
%239 = getelementptr inbounds i8, i8* %238, i64 %229
%240 = call i32 @rand_buffer(i8* %239, i32 %234)
%241 = load i8*, i8** %26
%242 = getelementptr inbounds i8, i8* %241, i64 %229
store i8* %242, i8** %212
%243 = load i8*, i8** %29
%244 = getelementptr inbounds i8, i8* %243, i64 %229
%245 = call i32 @rand_buffer(i8* %244, i32 %234)
%246 = load i8*, i8** %29
%247 = getelementptr inbounds i8, i8* %246, i64 %229
store i8* %247, i8** %213
%248 = load i8*, i8** %32
%249 = getelementptr inbounds i8, i8* %248, i64 %229
%250 = call i32 @rand_buffer(i8* %249, i32 %234)
%251 = load i8*, i8** %32
%252 = getelementptr inbounds i8, i8* %251, i64 %229
store i8* %252, i8** %214
%253 = load i8*, i8** %35
%254 = getelementptr inbounds i8, i8* %253, i64 %229
%255 = call i32 @rand_buffer(i8* %254, i32 %234)
%256 = load i8*, i8** %35
%257 = getelementptr inbounds i8, i8* %256, i64 %229
store i8* %257, i8** %215
%258 = load i8*, i8** %38
%259 = getelementptr inbounds i8, i8* %258, i64 %229
%260 = call i32 @rand_buffer(i8* %259, i32 %234)
%261 = load i8*, i8** %38
%262 = getelementptr inbounds i8, i8* %261, i64 %229
store i8* %262, i8** %216
%263 = load i8*, i8** %41
%264 = getelementptr inbounds i8, i8* %263, i64 %229
%265 = call i32 @rand_buffer(i8* %264, i32 %234)
%266 = load i8*, i8** %41
%267 = getelementptr inbounds i8, i8* %266, i64 %229
store i8* %267, i8** %217
%268 = load i8*, i8** %44
%269 = getelementptr inbounds i8, i8* %268, i64 %229
%270 = call i32 @rand_buffer(i8* %269, i32 %234)
%271 = load i8*, i8** %44
%272 = getelementptr inbounds i8, i8* %271, i64 %229
store i8* %272, i8** %218
%273 = load i8*, i8** %47
%274 = getelementptr inbounds i8, i8* %273, i64 %229
%275 = call i32 @rand_buffer(i8* %274, i32 %234)
%276 = load i8*, i8** %47
%277 = getelementptr inbounds i8, i8* %276, i64 %229
store i8* %277, i8** %219
%278 = load i8*, i8** %50
%279 = getelementptr inbounds i8, i8* %278, i64 %229
%280 = call i32 @rand_buffer(i8* %279, i32 %234)
%281 = load i8*, i8** %50
%282 = getelementptr inbounds i8, i8* %281, i64 %229
store i8* %282, i8** %220
%283 = load i8*, i8** %53
%284 = getelementptr inbounds i8, i8* %283, i64 %229
%285 = call i32 @rand_buffer(i8* %284, i32 %234)
%286 = load i8*, i8** %53
%287 = getelementptr inbounds i8, i8* %286, i64 %229
store i8* %287, i8** %221
%288 = load i8*, i8** %56
%289 = getelementptr inbounds i8, i8* %288, i64 %229
%290 = call i32 @rand_buffer(i8* %289, i32 %234)
%291 = load i8*, i8** %56
%292 = getelementptr inbounds i8, i8* %291, i64 %229
store i8* %292, i8** %222
%293 = load i8*, i8** %59
%294 = getelementptr inbounds i8, i8* %293, i64 %229
%295 = call i32 @rand_buffer(i8* %294, i32 %234)
%296 = load i8*, i8** %59
%297 = getelementptr inbounds i8, i8* %296, i64 %229
store i8* %297, i8** %223
%298 = load i8*, i8** %62
%299 = getelementptr inbounds i8, i8* %298, i64 %229
%300 = call i32 @rand_buffer(i8* %299, i32 %234)
%301 = load i8*, i8** %62
%302 = getelementptr inbounds i8, i8* %301, i64 %229
store i8* %302, i8** %224
%303 = load i8*, i8** %65
%304 = getelementptr inbounds i8, i8* %303, i64 %229
%305 = call i32 @rand_buffer(i8* %304, i32 %234)
%306 = load i8*, i8** %65
%307 = getelementptr inbounds i8, i8* %306, i64 %229
store i8* %307, i8** %225
%308 = load i8*, i8** %68
%309 = getelementptr inbounds i8, i8* %308, i64 %229
%310 = call i32 @rand_buffer(i8* %309, i32 %234)
%311 = load i8*, i8** %68
%312 = getelementptr inbounds i8, i8* %311, i64 %229
store i8* %312, i8** %226
%313 = load i8*, i8** %71
%314 = getelementptr inbounds i8, i8* %313, i64 %229
%315 = call i32 @rand_buffer(i8* %314, i32 %234)
%316 = load i8*, i8** %71
%317 = getelementptr inbounds i8, i8* %316, i64 %229
store i8* %317, i8** %227
%318 = call i32 @xor_gen(i32 17, i32 %234, i8* %7)
%319 = call i32 @xor_check_base(i32 17, i32 %234, i8* %7)
%320 = or i32 %319, %230
%321 = icmp sgt i32 %320, 0
br i1 %321, label %322, label %325
322: ; preds = %228
%323 = trunc i64 %229 to i32
%324 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.6, i64 0, i64 0), i32 %323, i32 %234)
br label %334
325: ; preds = %228
%326 = call i32 @putchar(i8 signext 46)
%327 = call i32 @fflush(i32 0)
%328 = add nuw nsw i64 %229, 32
%329 = icmp ult i64 %229, 992
br i1 %329, label %228, label %330
330: ; preds = %325
%331 = icmp eq i32 %320, 0
br i1 %331, label %332, label %334
332: ; preds = %330
%333 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %334
334: ; preds = %15, %330, %332, %322, %200, %172, %152, %111
%335 = phi i32 [ 1, %15 ], [ 1, %111 ], [ 1, %152 ], [ 1, %172 ], [ 1, %200 ], [ 1, %322 ], [ 0, %332 ], [ %320, %330 ]
ret i32 %335
}