// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]spiped/tests/pushbits/main.c
// Function: basic_copy
static int
basic_copy(const char * filename_in, const char * filename_out)
{
	pthread_t thread;
	int in, out;
	int rc;

	/* Open input and output. */
	if ((in = open(filename_in, O_RDONLY)) == -1) {
		warnp("open(%s)", filename_in);
		goto err0;
	}
	if ((out = open(filename_out, O_WRONLY | O_CREAT | O_TRUNC,
	    S_IRUSR | S_IWUSR)) == -1) {
		warnp("open(%s)", filename_out);
		goto err1;
	}

	/* Start copying. */
	if (pushbits(in, out, &thread)) {
		warnp("pushbits");
		goto err2;
	}

	/* Wait for thread to finish. */
	if ((rc = pthread_join(thread, NULL)) != 0) {
		warn0("pthread_join: %s", strerror(rc));
		goto err2;
	}

	/* Clean up. */
	if (close(out))
		warnp("close");
	if (close(in))
		warnp("close");

	/* Success! */
	return (0);

err2:
	if (close(out))
		warnp("close");
err1:
	if (close(in))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
movb $0x0, %al
callq 0x2230
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x2b79
jmp 0x2b37
callq 0x2080
cmpl $0x0, (%rax)
je 0x2b60
movq -0x10(%rbp), %rsi
leaq 0x36ad(%rip), %rdi      # 0x61f9
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x2b72
movq -0x10(%rbp), %rsi
leaq 0x368e(%rip), %rdi      # 0x61f9
movb $0x0, %al
callq 0x5090
jmp 0x2b74
jmp 0x2d92
movq -0x18(%rbp), %rdi
movl $0x241, %esi            # imm = 0x241
movl $0x180, %edx            # imm = 0x180
movb $0x0, %al
callq 0x2230
movl %eax, -0x28(%rbp)
cmpl $-0x1, %eax
jne 0x2bda
jmp 0x2b98
callq 0x2080
cmpl $0x0, (%rax)
je 0x2bc1
movq -0x18(%rbp), %rsi
leaq 0x364c(%rip), %rdi      # 0x61f9
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x2bd3
movq -0x18(%rbp), %rsi
leaq 0x362d(%rip), %rdi      # 0x61f9
movb $0x0, %al
callq 0x5090
jmp 0x2bd5
jmp 0x2d4a
movl -0x24(%rbp), %edi
movl -0x28(%rbp), %esi
leaq -0x20(%rbp), %rdx
callq 0x3c80
cmpl $0x0, %eax
je 0x2c2a
jmp 0x2bf0
callq 0x2080
cmpl $0x0, (%rax)
je 0x2c15
leaq 0x3601(%rip), %rdi      # 0x6202
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x2c23
leaq 0x35e6(%rip), %rdi      # 0x6202
movb $0x0, %al
callq 0x5090
jmp 0x2c25
jmp 0x2d02
movq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2290
movl %eax, -0x2c(%rbp)
cmpl $0x0, %eax
je 0x2c6a
jmp 0x2c41
movl -0x2c(%rbp), %edi
callq 0x22b0
movq %rax, %rsi
leaq 0x35b8(%rip), %rdi      # 0x620b
movb $0x0, %al
callq 0x5090
callq 0x2080
movl $0x0, (%rax)
jmp 0x2d02
movl -0x28(%rbp), %edi
callq 0x2140
cmpl $0x0, %eax
je 0x2cb0
jmp 0x2c79
callq 0x2080
cmpl $0x0, (%rax)
je 0x2c9e
leaq 0x3592(%rip), %rdi      # 0x621c
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x2cac
leaq 0x3577(%rip), %rdi      # 0x621c
movb $0x0, %al
callq 0x5090
jmp 0x2cae
jmp 0x2cb0
movl -0x24(%rbp), %edi
callq 0x2140
cmpl $0x0, %eax
je 0x2cf6
jmp 0x2cbf
callq 0x2080
cmpl $0x0, (%rax)
je 0x2ce4
leaq 0x354c(%rip), %rdi      # 0x621c
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x2cf2
leaq 0x3531(%rip), %rdi      # 0x621c
movb $0x0, %al
callq 0x5090
jmp 0x2cf4
jmp 0x2cf6
movl $0x0, -0x4(%rbp)
jmp 0x2d99
movl -0x28(%rbp), %edi
callq 0x2140
cmpl $0x0, %eax
je 0x2d48
jmp 0x2d11
callq 0x2080
cmpl $0x0, (%rax)
je 0x2d36
leaq 0x34fa(%rip), %rdi      # 0x621c
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x2d44
leaq 0x34df(%rip), %rdi      # 0x621c
movb $0x0, %al
callq 0x5090
jmp 0x2d46
jmp 0x2d48
jmp 0x2d4a
movl -0x24(%rbp), %edi
callq 0x2140
cmpl $0x0, %eax
je 0x2d90
jmp 0x2d59
callq 0x2080
cmpl $0x0, (%rax)
je 0x2d7e
leaq 0x34b2(%rip), %rdi      # 0x621c
movb $0x0, %al
callq 0x4e40
callq 0x2080
movl $0x0, (%rax)
jmp 0x2d8c
leaq 0x3497(%rip), %rdi      # 0x621c
movb $0x0, %al
callq 0x5090
jmp 0x2d8e
jmp 0x2d90
jmp 0x2d92
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)