// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]spiped/tests/nc-server/main.c
// Function: main
int
main(int argc, char ** argv)
{
	struct nc_cookie cookie;
	struct nc_cookie * C = &cookie;
	const char * sockname;
	const char * filename;

	WARNP_INIT;

	/* Parse command-line arguments. */
	if (argc < 3) {
		fprintf(stderr, "usage: %s ADDRESS FILENAME [ECHO_BPS]\n",
		    argv[0]);
		goto err0;
	}
	sockname = argv[1];
	filename = argv[2];
	if (argc > 3) {
		/* Allow up to 1 MB per second of echoing. */
		if (PARSENUM(&C->bps, argv[3], 0, 1000000)) {
			warnp("parsenum");
			goto err0;
		}
		if ((C->bps % 100) != 0) {
			warn0("BPS must be a multiple of 100");
			goto err0;
		}
	} else
		C->bps = 0;

	/* Open the output file; can be /dev/null. */
	if ((C->out = fopen(filename, "wb")) == NULL) {
		warnp("fopen");
		goto err0;
	}

	/* Run the server. */
	if (simple_server(sockname, MAX_CONNECTIONS, SHUTDOWN_AFTER,
	    &callback_snc_response, C)) {
		warn0("simple_server failed");
		goto err1;
	}

	/* Write the output file. */
	if (fclose(C->out) != 0) {
		warnp("fclose");
		goto err0;
	}

	/* Success! */
	exit(0);

err1:
	if (fclose(C->out))
		warnp("fclose");
err0:
	/* Failure! */
	exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r12
movl %edi, %ebx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x245b
callq 0x5420
cmpl $0x2, %ebx
jg 0x2484
movq 0x8b91(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq (%r12), %rdx
leaq 0x4bcb(%rip), %rsi      # 0x7040
xorl %eax, %eax
callq 0x21c0
pushq $0x1
popq %rdi
callq 0x22c0
movq 0x8(%r12), %r14
movq 0x10(%r12), %r15
cmpl $0x3, %ebx
jne 0x24cb
andq $0x0, 0x8(%rsp)
leaq 0x4bee(%rip), %rsi      # 0x708e
movq %r15, %rdi
callq 0x2270
movq %rax, (%rsp)
testq %rax, %rax
jne 0x24fc
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2573
leaq 0x4bcb(%rip), %rdi      # 0x7091
jmp 0x25c1
callq 0x2090
andl $0x0, (%rax)
movq 0x18(%r12), %r12
testq %r12, %r12
jne 0x2530
leaq 0x4bcf(%rip), %rdi      # 0x70b3
leaq 0x4bd2(%rip), %rsi      # 0x70bd
leaq 0x4bed(%rip), %rcx      # 0x70df
movl $0xbb, %edx
callq 0x2160
leaq 0x110(%rip), %rcx       # 0x2613
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rsp, %r8
movq %r14, %rdi
callq 0x27b8
testl %eax, %eax
jne 0x257f
movq (%rsp), %rdi
callq 0x2100
testl %eax, %eax
jne 0x25b0
xorl %edi, %edi
callq 0x22c0
movq %rax, %rbx
movq %rsp, %r13
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2280
movq (%r13), %rdx
pushq $0x16
popq %rcx
cmpq %r12, %rdx
je 0x2563
cmpb $0x0, (%rdx)
jne 0x2563
cmpq $0xf4241, %rax          # imm = 0xF4241
jb 0x25e6
pushq $0x22
popq %rcx
movl %ecx, (%rbx)
movq %rax, 0x8(%rsp)
leaq 0x4af6(%rip), %rdi      # 0x7067
jmp 0x25d7
movq %rax, %rbx
leaq 0x4b14(%rip), %rdi      # 0x7091
jmp 0x25d7
leaq 0x4b11(%rip), %rdi      # 0x7097
xorl %eax, %eax
callq 0x562c
callq 0x2090
movq %rax, %rbx
andl $0x0, (%rax)
movq (%rsp), %rdi
callq 0x2100
testl %eax, %eax
je 0x247c
cmpl $0x0, (%rbx)
je 0x25ba
jmp 0x25d0
callq 0x2090
cmpl $0x0, (%rax)
jne 0x25cd
leaq 0x4aeb(%rip), %rdi      # 0x70ac
xorl %eax, %eax
callq 0x562c
jmp 0x247c
movq %rax, %rbx
leaq 0x4ad5(%rip), %rdi      # 0x70ac
xorl %eax, %eax
callq 0x549d
andl $0x0, (%rbx)
jmp 0x247c
cmpl $0x0, (%rbx)
movq %rax, 0x8(%rsp)
jne 0x256a
pushq $0x64
popq %rcx
xorl %edx, %edx
divl %ecx
testl %edx, %edx
je 0x2499
leaq 0x4a66(%rip), %rdi      # 0x7070
xorl %eax, %eax
callq 0x562c
jmp 0x25de