// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/perftests/standalone-enc/standalone_pipe_socketpair_one.c
// Function: pipe_init
static int
pipe_init(void * cookie, uint8_t * buf, size_t buflen)
{
	struct pipeinfo * pipeinfo = cookie;
	uint8_t kbuf[64];
	size_t i;

	/* Set up encryption key. */
	memset(kbuf, 0, 64);
	if ((pipeinfo->k = mkkeypair(kbuf)) == NULL)
		goto err0;

	/* Create socket pairs for the input and output. */
	if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipeinfo->in)) {
		warnp("socketpair");
		goto err0;
	}
	if (socketpair(AF_UNIX, SOCK_STREAM, 0, pipeinfo->out)) {
		warnp("socketpair");
		goto err0;
	}

	/* Set the input. */
	for (i = 0; i < buflen; i++)
		buf[i] = (uint8_t)(i & 0xff);

	/* We haven't finished the event loop. */
	pipeinfo->done = 0;

	/* Create the pipe processes. */
	if ((pipeinfo->out_pid = fd_drain_fork(pipeinfo->out[R])) == -1)
		goto err0;
	if ((pipeinfo->enc_pid = fork_func(pipe_enc, pipeinfo)) == -1)
		goto err0;

	/* Success! */
	return (0);

err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
pxor %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movdqa %xmm0, 0x30(%rdi)
movdqa %xmm0, 0x20(%rdi)
movdqa %xmm0, 0x10(%rdi)
movdqa %xmm0, (%rdi)
callq 0x59c4
movq %rax, (%rbx)
testq %rax, %rax
je 0x51ee
leaq 0x10(%rbx), %rcx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
jne 0x51bd
leaq 0x18(%rbx), %rcx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
je 0x51fd
callq 0x2370
cmpl $0x0, (%rax)
je 0x51e0
movq %rax, %rbx
leaq 0xa28d(%rip), %rdi      # 0xf45e
xorl %eax, %eax
callq 0xc0bc
movl $0x0, (%rbx)
jmp 0x51ee
leaq 0xa277(%rip), %rdi      # 0xf45e
xorl %eax, %eax
callq 0xc1db
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
testq %r15, %r15
je 0x5775
leaq 0xf(%r15), %rax
andq $-0x10, %rax
decq %r15
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, (%rsp)
movdqa 0x9fa8(%rip), %xmm1     # 0xf1d0
movdqa 0x9fb0(%rip), %xmm2     # 0xf1e0
movdqa 0x9fb8(%rip), %xmm3     # 0xf1f0
movdqa 0x9fc0(%rip), %xmm4     # 0xf200
movdqa 0x9fc8(%rip), %xmm5     # 0xf210
movdqa 0x9fd0(%rip), %xmm6     # 0xf220
movdqa 0x9fd8(%rip), %xmm7     # 0xf230
movdqa 0x9fdf(%rip), %xmm8     # 0xf240
xorl %ecx, %ecx
movdqa 0x9fe4(%rip), %xmm9     # 0xf250
pcmpeqd %xmm10, %xmm10
movdqa (%rsp), %xmm12
pxor %xmm9, %xmm12
movdqa %xmm8, %xmm13
pxor %xmm9, %xmm13
movdqa %xmm13, %xmm15
pcmpgtd %xmm12, %xmm15
pshufd $0xa0, %xmm15, %xmm14   # xmm14 = xmm15[0,0,2,2]
pshuflw $0xe8, %xmm14, %xmm0    # xmm0 = xmm14[0,2,2,3,4,5,6,7]
pcmpeqd %xmm12, %xmm13
pshufd $0xf5, %xmm13, %xmm13   # xmm13 = xmm13[1,1,3,3]
pshuflw $0xe8, %xmm13, %xmm11   # xmm11 = xmm13[0,2,2,3,4,5,6,7]
pand %xmm0, %xmm11
pshufd $0xf5, %xmm15, %xmm15   # xmm15 = xmm15[1,1,3,3]
pshuflw $0xe8, %xmm15, %xmm0    # xmm0 = xmm15[0,2,2,3,4,5,6,7]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
movd %xmm0, %edx
testb $0x1, %dl
je 0x52d9
movb %cl, (%r14,%rcx)
pand %xmm14, %xmm13
por %xmm15, %xmm13
packssdw %xmm13, %xmm13
pxor %xmm10, %xmm13
packssdw %xmm13, %xmm13
packsswb %xmm13, %xmm13
movd %xmm13, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x530c
leal 0x1(%rcx), %edx
movb %dl, 0x1(%r14,%rcx)
movdqa %xmm7, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm14    # xmm14 = xmm0[1,1,3,3]
movdqa %xmm14, %xmm0
pand %xmm13, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
por %xmm15, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
movd %xmm0, %edx
shrl $0x10, %edx
testb $0x1, %dl
je 0x536a
leal 0x2(%rcx), %edx
movb %dl, 0x2(%r14,%rcx)
pshufhw $0x84, %xmm13, %xmm0    # xmm0 = xmm13[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm14, %xmm11   # xmm11 = xmm14[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm11
pshufhw $0x84, %xmm15, %xmm0    # xmm0 = xmm15[0,1,2,3,4,5,4,6]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
movd %xmm0, %edx
shrl $0x18, %edx
testb $0x1, %dl
je 0x53a7
leal 0x3(%rcx), %edx
movb %dl, 0x3(%r14,%rcx)
movdqa %xmm6, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm14   # xmm14 = xmm11[0,0,2,2]
pshuflw $0xe8, %xmm14, %xmm15   # xmm15 = xmm14[0,2,2,3,4,5,6,7]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm13    # xmm13 = xmm0[1,1,3,3]
pshuflw $0xe8, %xmm13, %xmm0    # xmm0 = xmm13[0,2,2,3,4,5,6,7]
pand %xmm15, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
pshuflw $0xe8, %xmm15, %xmm11   # xmm11 = xmm15[0,2,2,3,4,5,6,7]
por %xmm0, %xmm11
pxor %xmm10, %xmm11
packssdw %xmm11, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x2, %xmm0, %edx
testb $0x1, %dl
je 0x540d
leal 0x4(%rcx), %edx
movb %dl, 0x4(%r14,%rcx)
pand %xmm14, %xmm13
por %xmm15, %xmm13
packssdw %xmm13, %xmm13
pxor %xmm10, %xmm13
packssdw %xmm13, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x2, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x543f
leal 0x5(%rcx), %edx
movb %dl, 0x5(%r14,%rcx)
movdqa %xmm5, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm14    # xmm14 = xmm0[1,1,3,3]
movdqa %xmm14, %xmm0
pand %xmm13, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
por %xmm15, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x3, %xmm0, %edx
testb $0x1, %dl
je 0x549b
leal 0x6(%rcx), %edx
movb %dl, 0x6(%r14,%rcx)
pshufhw $0x84, %xmm13, %xmm0    # xmm0 = xmm13[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm14, %xmm11   # xmm11 = xmm14[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm11
pshufhw $0x84, %xmm15, %xmm0    # xmm0 = xmm15[0,1,2,3,4,5,4,6]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x3, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x54d9
leal 0x7(%rcx), %edx
movb %dl, 0x7(%r14,%rcx)
movdqa %xmm4, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm14   # xmm14 = xmm11[0,0,2,2]
pshuflw $0xe8, %xmm14, %xmm15   # xmm15 = xmm14[0,2,2,3,4,5,6,7]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm13    # xmm13 = xmm0[1,1,3,3]
pshuflw $0xe8, %xmm13, %xmm0    # xmm0 = xmm13[0,2,2,3,4,5,6,7]
pand %xmm15, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
pshuflw $0xe8, %xmm15, %xmm11   # xmm11 = xmm15[0,2,2,3,4,5,6,7]
por %xmm0, %xmm11
pxor %xmm10, %xmm11
packssdw %xmm11, %xmm11
packsswb %xmm11, %xmm0
pextrw $0x4, %xmm0, %edx
testb $0x1, %dl
je 0x5540
leal 0x8(%rcx), %edx
movb %dl, 0x8(%r14,%rcx)
pand %xmm14, %xmm13
por %xmm15, %xmm13
packssdw %xmm13, %xmm13
pxor %xmm10, %xmm13
packssdw %xmm13, %xmm13
packsswb %xmm13, %xmm0
pextrw $0x4, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x5573
leal 0x9(%rcx), %edx
movb %dl, 0x9(%r14,%rcx)
movdqa %xmm3, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm14    # xmm14 = xmm0[1,1,3,3]
movdqa %xmm14, %xmm0
pand %xmm13, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
por %xmm15, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x5, %xmm0, %edx
testb $0x1, %dl
je 0x55cf
leal 0xa(%rcx), %edx
movb %dl, 0xa(%r14,%rcx)
pshufhw $0x84, %xmm13, %xmm0    # xmm0 = xmm13[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm14, %xmm11   # xmm11 = xmm14[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm11
pshufhw $0x84, %xmm15, %xmm0    # xmm0 = xmm15[0,1,2,3,4,5,4,6]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x5, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x560d
leal 0xb(%rcx), %edx
movb %dl, 0xb(%r14,%rcx)
movdqa %xmm2, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm14   # xmm14 = xmm11[0,0,2,2]
pshuflw $0xe8, %xmm14, %xmm15   # xmm15 = xmm14[0,2,2,3,4,5,6,7]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm13    # xmm13 = xmm0[1,1,3,3]
pshuflw $0xe8, %xmm13, %xmm0    # xmm0 = xmm13[0,2,2,3,4,5,6,7]
pand %xmm15, %xmm0
pshufd $0xf5, %xmm11, %xmm15   # xmm15 = xmm11[1,1,3,3]
pshuflw $0xe8, %xmm15, %xmm11   # xmm11 = xmm15[0,2,2,3,4,5,6,7]
por %xmm0, %xmm11
pxor %xmm10, %xmm11
packssdw %xmm11, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x6, %xmm0, %edx
testb $0x1, %dl
je 0x5673
leal 0xc(%rcx), %edx
movb %dl, 0xc(%r14,%rcx)
pand %xmm14, %xmm13
por %xmm15, %xmm13
packssdw %xmm13, %xmm13
pxor %xmm10, %xmm13
packssdw %xmm13, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x6, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x56a5
leal 0xd(%rcx), %edx
movb %dl, 0xd(%r14,%rcx)
movdqa %xmm1, %xmm0
pxor %xmm9, %xmm0
movdqa %xmm0, %xmm11
pcmpgtd %xmm12, %xmm11
pshufd $0xa0, %xmm11, %xmm13   # xmm13 = xmm11[0,0,2,2]
pcmpeqd %xmm12, %xmm0
pshufd $0xf5, %xmm0, %xmm12    # xmm12 = xmm0[1,1,3,3]
movdqa %xmm12, %xmm0
pand %xmm13, %xmm0
pshufd $0xf5, %xmm11, %xmm14   # xmm14 = xmm11[1,1,3,3]
por %xmm14, %xmm0
packssdw %xmm0, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x7, %xmm0, %edx
testb $0x1, %dl
je 0x5701
leal 0xe(%rcx), %edx
movb %dl, 0xe(%r14,%rcx)
pshufhw $0x84, %xmm13, %xmm0    # xmm0 = xmm13[0,1,2,3,4,5,4,6]
pshufhw $0x84, %xmm12, %xmm11   # xmm11 = xmm12[0,1,2,3,4,5,4,6]
pand %xmm0, %xmm11
pshufhw $0x84, %xmm14, %xmm0    # xmm0 = xmm14[0,1,2,3,4,5,4,6]
por %xmm11, %xmm0
pxor %xmm10, %xmm0
packssdw %xmm0, %xmm0
packsswb %xmm0, %xmm0
pextrw $0x7, %xmm0, %edx
shrl $0x8, %edx
testb $0x1, %dl
je 0x573f
leal 0xf(%rcx), %edx
movb %dl, 0xf(%r14,%rcx)
addq $0x10, %rcx
movdqa 0x9b15(%rip), %xmm0     # 0xf260
paddq %xmm0, %xmm8
paddq %xmm0, %xmm7
paddq %xmm0, %xmm6
paddq %xmm0, %xmm5
paddq %xmm0, %xmm4
paddq %xmm0, %xmm3
paddq %xmm0, %xmm2
paddq %xmm0, %xmm1
cmpq %rcx, %rax
jne 0x5271
movl $0x0, 0x24(%rbx)
movl 0x18(%rbx), %edi
callq 0x2b2d
movl %eax, 0x8(%rbx)
cmpl $-0x1, %eax
je 0x51ee
leaq 0x154(%rip), %rdi       # 0x58eb
movq %rbx, %rsi
callq 0xb828
movl %eax, %ecx
movl %eax, 0xc(%rbx)
xorl %eax, %eax
cmpl $-0x1, %ecx
jne 0x51f3
jmp 0x51ee