// File: /workspace/github_c_makefile_star2_O0/lmcilroy[P]lzm/lzm.c
// Function: benchmark_init_chunk
static unsigned int
benchmark_init_chunk(const int fd_in, struct chunk * const chunk,
    const unsigned int chunk_size, struct compress_args * const args)
{
	int ret;

	chunk->size_orig = chunk_size;
	ret = posix_memalign((void **)&chunk->data_orig, pagesize,
	    chunk->size_orig);
	if (ret != 0) {
		ret = ENOMEM;
		fprintf(stderr, "File %s: failed to allocate %d bytes: %s\n",
		    args->filename, chunk->size_orig, strerror(ret));
		goto out;
	}

	ret = posix_memalign((void **)&chunk->data_decomp, pagesize,
	    chunk->size_orig);
	if (ret != 0) {
		ret = ENOMEM;
		fprintf(stderr, "File %s: failed to allocate %d bytes: %s\n",
		    args->filename, chunk->size_orig, strerror(ret));
		goto out;
	}

	chunk->size_comp = lzm_compressed_size(chunk->size_orig);
	ret = posix_memalign((void **)&chunk->data_comp, pagesize,
	    chunk->size_comp);
	if (ret != 0) {
		ret = ENOMEM;
		fprintf(stderr, "File %s: failed to allocate %d bytes: %s\n",
		    args->filename, chunk->size_comp, strerror(ret));
		goto out;
	}

	ret = read_data(fd_in, chunk->data_orig, &chunk->size_orig);
	if (ret != 0) {
		fprintf(stderr, "File %s: failed to read data: %s\n",
		    args->filename, strerror(ret));
		goto out;
	}

	if (chunk->size_orig != chunk_size) {
		ret = EINVAL;
		fprintf(stderr, "File %s: not enough data read\n",
		    args->filename);
		goto out;
	}

 out:
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x18(%rax)
movq -0x10(%rbp), %rdi
movq 0x6cda(%rip), %rsi      # 0xa248
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edx
callq 0x1240
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x35d9
movl $0xc, -0x24(%rbp)
movq 0x6a65(%rip), %rax      # 0x9ff8
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %edi
callq 0x1250
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
movl -0x28(%rbp), %ecx
movq %rax, %r8
leaq 0x3de7(%rip), %rsi      # 0x73b4
movb $0x0, %al
callq 0x1190
jmp 0x3776
movq -0x10(%rbp), %rdi
addq $0x10, %rdi
movq 0x6c60(%rip), %rsi      # 0xa248
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, %edx
callq 0x1240
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x3653
movl $0xc, -0x24(%rbp)
movq 0x69eb(%rip), %rax      # 0x9ff8
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
movl %eax, -0x3c(%rbp)
movl -0x24(%rbp), %edi
callq 0x1250
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rdx
movl -0x3c(%rbp), %ecx
movq %rax, %r8
leaq 0x3d6d(%rip), %rsi      # 0x73b4
movb $0x0, %al
callq 0x1190
jmp 0x3776
movq -0x10(%rbp), %rax
movl 0x18(%rax), %edi
callq 0x3ff0
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x1c(%rax)
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq 0x6bd1(%rip), %rsi      # 0xa248
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x1240
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x36e2
movl $0xc, -0x24(%rbp)
movq 0x695c(%rip), %rax      # 0x9ff8
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, -0x54(%rbp)
movl -0x24(%rbp), %edi
callq 0x1250
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rdx
movl -0x54(%rbp), %ecx
movq %rax, %r8
leaq 0x3cde(%rip), %rsi      # 0x73b4
movb $0x0, %al
callq 0x1190
jmp 0x3776
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
addq $0x18, %rdx
callq 0x2ee0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x373f
movq 0x68ef(%rip), %rax      # 0x9ff8
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
movl -0x24(%rbp), %edi
callq 0x1250
movq -0x78(%rbp), %rdi
movq -0x70(%rbp), %rdx
movq %rax, %rcx
leaq 0x3cec(%rip), %rsi      # 0x7422
movb $0x0, %al
callq 0x1190
jmp 0x3776
movq -0x10(%rbp), %rax
movl 0x18(%rax), %eax
cmpl -0x14(%rbp), %eax
je 0x3774
movl $0x16, -0x24(%rbp)
movq 0x689f(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x3f48(%rip), %rsi      # 0x76b3
movb $0x0, %al
callq 0x1190
jmp 0x3776
jmp 0x3776
movl -0x24(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)