// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/perftests/standalone-enc/standalone_transfer_noencrypt.c
// Function: perftest_init
static int
perftest_init(void * cookie, uint8_t * buf, size_t buflen)
{
	struct shared * shared = cookie;
	size_t i;
	int rc;

	/* Sanity checks. */
	assert(buflen <= MAXOUTSIZE);

	/* Create communication endpoints. */
	if (shared->method == 0) {
		/* Use pipes. */
		if (pipe(shared->in)) {
			warnp("pipe");
			goto err0;
		}
		if (pipe(shared->out)) {
			warnp("pipe");
			goto err0;
		}
		if (pipe(shared->finished)) {
			warnp("pipe");
			goto err0;
		}
	} else if (shared->method == 1) {
		/* Use socketpairs. */
		if (socketpair(AF_UNIX, SOCK_STREAM, 0, shared->in)) {
			warnp("socketpair");
			goto err0;
		}
		if (socketpair(AF_UNIX, SOCK_STREAM, 0, shared->out)) {
			warnp("socketpair");
			goto err0;
		}
		if (socketpair(AF_UNIX, SOCK_STREAM, 0, shared->finished)) {
			warnp("socketpair");
			goto err0;
		}
	} else
		goto err0;

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

	/* Create the threads. */
	if ((rc = pthread_create_blocking_np(&shared->output_thr, NULL,
	    drain_output, shared))) {
		warn0("pthread_create: %s", strerror(rc));
		goto err0;
	}
	if ((rc = pthread_create_blocking_np(&shared->data_thr, NULL,
	    transfer_data, shared))) {
		warn0("pthread_create: %s", strerror(rc));
		goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x4001, %rdx           # imm = 0x4001
jae 0x4d9e
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl 0x28(%rdi), %eax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x1, %eax
je 0x472b
testl %eax, %eax
jne 0x47b6
leaq 0x10(%rbx), %rdi
callq 0x2250
testl %eax, %eax
jne 0x4715
leaq 0x18(%rbx), %rdi
callq 0x2250
testl %eax, %eax
jne 0x4715
leaq 0x20(%rbx), %rdi
callq 0x2250
testl %eax, %eax
je 0x47c5
callq 0x2370
cmpl $0x0, (%rax)
je 0x4799
movq %rax, %rbx
leaq 0xacc0(%rip), %rdi      # 0xf3e9
jmp 0x478a
leaq 0x10(%rbx), %rcx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
jne 0x4776
leaq 0x18(%rbx), %rcx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
jne 0x4776
leaq 0x20(%rbx), %rcx
movl $0x1, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x22b0
testl %eax, %eax
je 0x47c5
callq 0x2370
cmpl $0x0, (%rax)
je 0x47a2
movq %rax, %rbx
leaq 0xacd4(%rip), %rdi      # 0xf45e
xorl %eax, %eax
callq 0xc0bc
movl $0x0, (%rbx)
jmp 0x47b0
leaq 0xac49(%rip), %rdi      # 0xf3e9
jmp 0x47a9
leaq 0xacb5(%rip), %rdi      # 0xf45e
xorl %eax, %eax
callq 0xc1db
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
testq %r15, %r15
je 0x4d3e
leal 0xf(%r15), %eax
andl $0xfff0, %eax           # imm = 0xFFF0
decq %r15
movq %r15, %xmm0
pshufd $0x44, %xmm0, %xmm0     # xmm0 = xmm0[0,1,0,1]
movdqa %xmm0, (%rsp)
movdqa 0xa9df(%rip), %xmm1     # 0xf1d0
movdqa 0xa9e7(%rip), %xmm2     # 0xf1e0
movdqa 0xa9ef(%rip), %xmm3     # 0xf1f0
movdqa 0xa9f7(%rip), %xmm4     # 0xf200
movdqa 0xa9ff(%rip), %xmm5     # 0xf210
movdqa 0xaa07(%rip), %xmm6     # 0xf220
movdqa 0xaa0f(%rip), %xmm7     # 0xf230
movdqa 0xaa16(%rip), %xmm8     # 0xf240
xorl %ecx, %ecx
movdqa 0xaa1b(%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 0x48a2
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 0x48d5
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 0x4933
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 0x4970
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 0x49d6
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 0x4a08
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 0x4a64
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 0x4aa2
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 0x4b09
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 0x4b3c
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 0x4b98
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 0x4bd6
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 0x4c3c
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 0x4c6e
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 0x4cca
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 0x4d08
leal 0xf(%rcx), %edx
movb %dl, 0xf(%r14,%rcx)
addq $0x10, %rcx
movdqa 0xa54c(%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 0x483a
leaq 0x8(%rbx), %rdi
leaq 0x23b(%rip), %rdx       # 0x4f84
xorl %r12d, %r12d
xorl %esi, %esi
movq %rbx, %rcx
callq 0xc62c
testl %eax, %eax
jne 0x4d76
leaq 0x28d(%rip), %rdx       # 0x4fee
movq %rbx, %rdi
xorl %esi, %esi
movq %rbx, %rcx
callq 0xc62c
testl %eax, %eax
je 0x47b6
movl %eax, %edi
callq 0x22a0
leaq 0xa632(%rip), %rdi      # 0xf3b6
movq %rax, %rsi
xorl %eax, %eax
callq 0xc1db
callq 0x2370
movl $0x0, (%rax)
jmp 0x47b0
leaq 0xa5af(%rip), %rdi      # 0xf354
leaq 0xa5bd(%rip), %rsi      # 0xf369
leaq 0xa5d6(%rip), %rcx      # 0xf389
movl $0x8a, %edx
callq 0x2130