LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/hkshenSmart[P]ONVIF-discovery_cs/discovery-nvt.c
// Function: main
int main(int argc, char *argv[])
{
	struct soap soap;
	struct ip_mreq mcast;
	int count=1;
	
	soap_init2(&soap, SOAP_IO_UDP|SOAP_IO_FLUSH, SOAP_IO_UDP|SOAP_IO_FLUSH);
	
    soap_set_namespaces(&soap, namespaces); 
	//soap_set_mode(&soap, SOAP_C_UTFSTRING);
	
	if(!soap_valid_socket(soap_bind(&soap, NULL, 3702, 10)))
	{ 
		soap_print_fault(&soap, stderr);
		exit(1);
	}
	
	mcast.imr_multiaddr.s_addr = inet_addr("239.255.255.250");
	mcast.imr_interface.s_addr = htonl(INADDR_ANY);
	if(setsockopt(soap.master, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*)&mcast, sizeof(mcast)) < 0)
	{
		printf("setsockopt error!\n");
		return 0;
	}	

	for(;;)
	{ 
		printf("Now Accepting requests...waiting\n");
		if(soap_serve(&soap))
			soap_print_fault(&soap, stderr);
	
		soap_destroy(&soap);
		soap_end(&soap);

		printf("�ͻ��˵�IP��ַ��\n");
		printf("Accepted count:%d, connection from IP = %lu.%lu.%lu.%lu socket = %d \r\n",
				count, ((soap.ip)>>24)&0xFF, ((soap.ip)>>16)&0xFF, ((soap.ip)>>8)&0xFF, (soap.ip)&0xFF, (soap.socket));
		count++;
		printf("====================================================================\r\n");

	}
	
	soap_done(&soap);
	
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x27888, %rsp          # imm = 0x27888
leaq 0x18(%rsp), %rbx
movq %rbx, %rdi
movl $0x4, %esi
movl $0x4, %edx
callq 0x17d7b
leaq 0x30bac(%rip), %rsi     # 0x341d0
movq %rbx, %rdi
callq 0x1a5ae
movq %rbx, %rdi
xorl %esi, %esi
movl $0xe76, %edx            # imm = 0xE76
movl $0xa, %ecx
callq 0x1457a
cmpl $-0x1, %eax
je 0x3753
leaq 0x21b76(%rip), %rdi     # 0x251c6
callq 0x31f0
leaq 0x10(%rsp), %rcx
movl %eax, (%rcx)
movl $0x0, 0x4(%rcx)
movl 0xc148(%rsp), %edi
xorl %esi, %esi
movl $0x23, %edx
movl $0x8, %r8d
callq 0x30b0
testl %eax, %eax
js 0x3733
movl $0x1, %ebx
leaq 0x18(%rsp), %r15
leaq 0x21ba9(%rip), %r12     # 0x2523e
movl $0xff, %r14d
leaq 0x21b34(%rip), %r13     # 0x251d6
leaq 0x21ba6(%rip), %rbp     # 0x2524f
leaq 0x21b6d(%rip), %rdi     # 0x2521d
callq 0x3090
movq %r15, %rdi
callq 0xfcf8
testl %eax, %eax
je 0x36d3
movq 0x30930(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
movq %r15, %rdi
callq 0x24853
movq %r15, %rdi
xorl %esi, %esi
callq 0x18ed1
movq %r15, %rdi
callq 0x1ae4e
movq %r12, %rdi
callq 0x3090
movq 0x1f238(%rsp), %rdx
movl %edx, %ecx
movl %edx, %r8d
movzbl %dl, %r9d
shrl $0x18, %edx
shrl $0x10, %ecx
andl %r14d, %ecx
shrl $0x8, %r8d
andl %r14d, %r8d
movl 0xc14c(%rsp), %eax
movl %eax, (%rsp)
movq %r13, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x3150
incl %ebx
movq %rbp, %rdi
callq 0x3090
jmp 0x36a9
leaq 0x21b5b(%rip), %rdi     # 0x25295
callq 0x3090
xorl %eax, %eax
addq $0x27888, %rsp          # imm = 0x27888
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x3089e(%rip), %rax     # 0x33ff8
movq (%rax), %rsi
leaq 0x18(%rsp), %rdi
callq 0x24853
movl $0x1, %edi
callq 0x3320
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/hkshenSmart[P]ONVIF-discovery_cs/soapServer.c
// Function: soap_serve
int SOAP_FMAC6 soap_serve(struct soap *soap)
{
#ifndef WITH_FASTCGI
	unsigned int k = soap->max_keep_alive;
#endif
	do
	{
#ifndef WITH_FASTCGI
		if (soap->max_keep_alive > 0 && !--k)
			soap->keep_alive = 0;
#endif
		if (soap_begin_serve(soap))
		{	if (soap->error >= SOAP_STOP)
				continue;
			return soap->error;
		}
		if (soap_serve_request(soap) || (soap->fserveloop && soap->fserveloop(soap)))
		{
#ifdef WITH_FASTCGI
			soap_send_fault(soap);
#else
			return soap_send_fault(soap);
#endif
		}

#ifdef WITH_FASTCGI
		soap_destroy(soap);
		soap_end(soap);
	} while (1);
#else
	}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0x1f23c(%rdi), %ebp
cmpl $0x0, 0x1f23c(%rbx)
je 0xfd1c
decl %ebp
jne 0xfd1c
movw $0x0, 0x1f22c(%rbx)
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x22426
testl %eax, %eax
je 0xfd37
movl 0x1f274(%rbx), %eax
cmpl $0x3e7, %eax            # imm = 0x3E7
jg 0xfd58
jmp 0xfd64
movq %rbx, %rdi
callq 0xfd79
testl %eax, %eax
jne 0xfd6b
movq 0xc050(%rbx), %rax
testq %rax, %rax
je 0xfd58
movq %rbx, %rdi
callq *%rax
testl %eax, %eax
jne 0xfd6b
cmpw $0x0, 0x1f22c(%rbx)
jne 0xfd04
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x22a84
// File: /workspace/github_c_makefile_star2_O1/hkshenSmart[P]ONVIF-discovery_cs/soapServer.c
// Function: soap_serve_request
SOAP_FMAC6 soap_serve_request(struct soap *soap)
{
	soap_peek_element(soap);
	if (!soap_match_tag(soap, soap->tag, "d:Probe"))
		return soap_serve___dndl__Probe(soap);
	if (!soap_match_tag(soap, soap->tag, "d:Hello"))
		return soap_serve___dnrd__Hello(soap);
	if (!soap_match_tag(soap, soap->tag, "d:Bye"))
		return soap_serve___dnrd__Bye(soap);
	return soap->error = SOAP_NO_METHOD;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x123c8
leaq 0x1c998(%rbx), %r14
leaq 0x15b95(%rip), %rdx     # 0x25928
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1440a
testl %eax, %eax
je 0xfde5
leaq 0x15d78(%rip), %rdx     # 0x25b21
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1440a
testl %eax, %eax
je 0xfdf4
leaq 0x15d7f(%rip), %rdx     # 0x25b3e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1440a
testl %eax, %eax
je 0xfe03
movl $0xd, 0x1f274(%rbx)
movl $0xd, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xfe12
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xffe4
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x101b6
// File: /workspace/github_c_makefile_star2_O1/openshmem-org[P]openshmem-examples/c/amo-fetch.c
// Function: main
int
main()
{
    int me;

    shmem_init();
    me = shmem_my_pe();

    if (me == 0) {
        const int fetched = shmem_int_atomic_fetch(&dst, 1);

        printf("%d: dst = %d, fetched value = %d\n", me, dst, fetched);
    }

    shmem_barrier_all();

    printf("%d: dst = %d\n", me, dst);

    shmem_finalize();

    return 0;
}

// Assembly:
pushq %rbx
callq 0x1080
callq 0x1060
movl %eax, %ebx
testl %eax, %eax
jne 0x11c6
leaq 0x2eb4(%rip), %rdi      # 0x4058
movl $0x1, %esi
callq 0x1040
movl 0x2ea4(%rip), %edx      # 0x4058
leaq 0xe49(%rip), %rdi       # 0x2004
xorl %esi, %esi
movl %eax, %ecx
xorl %eax, %eax
callq 0x1030
callq 0x1070
movl 0x2e87(%rip), %edx      # 0x4058
leaq 0xe4e(%rip), %rdi       # 0x2026
movl %ebx, %esi
xorl %eax, %eax
callq 0x1030
callq 0x1050
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/dlbeer[P]dhara/ecc/hamming.c
// Function: hamming_generate
void hamming_generate(const uint8_t *chunk, size_t len, uint8_t *ecc)
{
	hamming_ecc_t p = parity_scan(chunk, len);

	ecc[0] = p;
	p >>= 8;
	ecc[1] = p;
	p >>= 8;
	ecc[2] = p;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
callq 0x11a2
movb %al, (%rbx)
movb %ah, 0x1(%rbx)
shrl $0x10, %eax
movb %al, 0x2(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/dlbeer[P]dhara/ecc/hamming.c
// Function: hamming_syndrome
hamming_ecc_t hamming_syndrome(const uint8_t *chunk, size_t len,
			       const uint8_t *ecc)
{
	const hamming_ecc_t p = parity_scan(chunk, len);
	hamming_ecc_t q = 0;

	q |= ecc[2];
	q <<= 8;
	q |= ecc[1];
	q <<= 8;
	q |= ecc[0];

	return p ^ q;
}

// Assembly:
pushq %rbx
movq %rdx, %rbx
callq 0x11a2
movzbl 0x2(%rbx), %ecx
movzbl 0x1(%rbx), %edx
shll $0x10, %ecx
shll $0x8, %edx
orl %ecx, %edx
movzbl (%rbx), %ecx
orl %edx, %ecx
xorl %ecx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/dlbeer[P]dhara/ecc/hamming.c
// Function: hamming_repair
int hamming_repair(uint8_t *chunk, size_t len, hamming_ecc_t syndrome)
{
	int pos = 0;
	int pos_bit = 1;
	int i;

	/* There might be no error */
	if (!syndrome)
		return 0;

	/* The single-bit error might be in the ECC data itself. */
	if (!(syndrome & (syndrome - 1)))
		return 0;

	/* Otherwise, go on the assumption that there's a single-bit
	 * error in the chunk. If this is true, then exactly one out of
	 * every complementary pair of syndrome bits should be set.
	 */
	for (i = 0; i < HAMMING_LOG2_CHUNK_BITS; i++) {
		const int s = syndrome & 3;

		if (s == 1)
			pos |= pos_bit;
		else if (s != 2)
			return -1;

		syndrome >>= 2;
		pos_bit <<= 1;
	}

	/* Flip the bit back */
	if ((pos >> 3) < len)
		chunk[pos >> 3] ^= 1 << (pos & 7);

	return 0;
}

// Assembly:
leal -0x1(%rdx), %ecx
xorl %eax, %eax
testl %ecx, %edx
jne 0x12b4
retq
xorl %ecx, %ecx
movl $0x1, %eax
movl $0xc, %r8d
movl %edx, %r9d
andl $0x3, %r9d
cmpl $0x2, %r9d
je 0x12d6
cmpl $0x1, %r9d
jne 0x12e0
orl %eax, %ecx
shrl $0x2, %edx
addl %eax, %eax
movb $0x1, %r9b
jmp 0x12e3
xorl %r9d, %r9d
testb %r9b, %r9b
je 0x130b
decl %r8d
jne 0x12c1
movl %ecx, %eax
sarl $0x3, %eax
movslq %eax, %rdx
xorl %eax, %eax
cmpq %rsi, %rdx
jae 0x12b3
andb $0x7, %cl
movl $0x1, %esi
shll %cl, %esi
xorb %sil, (%rdi,%rdx)
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/dlbeer[P]dhara/tests/hamming.c
// Function: test_properties
static void test_properties(const uint8_t *block)
{
	hamming_ecc_t e;
	int i;

	e = hamming_syndrome(block, HAMMING_CHUNK_SIZE,
			     block + HAMMING_CHUNK_SIZE);
	assert(!e);

	for (i = 0; i < 20; i++)
		flip_test(block);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rbx
leaq 0x200(%rdi), %rdx
movl $0x200, %esi            # imm = 0x200
callq 0x1288
testl %eax, %eax
jne 0x14bc
movl $0x14, %ebp
leaq 0x200(%rsp), %r14
movq %rsp, %r15
movabsq $0x3fa08f29421cd4c1, %r12 # imm = 0x3FA08F29421CD4C1
movl $0x203, %edx            # imm = 0x203
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1060
callq 0x1070
movq %rax, %rcx
imulq %r12
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0xa, %rdx
addq %rax, %rdx
imulq $0x1018, %rdx, %rax     # imm = 0x1018
subq %rax, %rcx
movl %ecx, %eax
sarl $0x3, %eax
andb $0x7, %cl
movl $0x1, %edx
shll %cl, %edx
cltq
xorb %dl, (%rsp,%rax)
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
movq %r14, %rdx
callq 0x1288
testl %eax, %eax
je 0x147e
movl $0x200, %esi            # imm = 0x200
movq %r15, %rdi
movl %eax, %edx
callq 0x12aa
movl $0x200, %edx            # imm = 0x200
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1080
testl %eax, %eax
jne 0x149d
decl %ebp
jne 0x13e8
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0xc8c(%rip), %rdi       # 0x2111
leaq 0xc87(%rip), %rsi       # 0x2113
leaq 0xcb6(%rip), %rcx       # 0x2149
movl $0x2e, %edx
callq 0x1040
leaq 0xcc5(%rip), %rdi       # 0x2169
leaq 0xc68(%rip), %rsi       # 0x2113
leaq 0xc97(%rip), %rcx       # 0x2149
movl $0x32, %edx
callq 0x1040
leaq 0xc4d(%rip), %rdi       # 0x2110
leaq 0xc49(%rip), %rsi       # 0x2113
leaq 0xc52(%rip), %rcx       # 0x2123
movl $0x3c, %edx
callq 0x1040
// File: /workspace/github_c_makefile_star2_O1/robertdavidgraham[P]wc2/wc2.c
// Function: build_urow
void build_urow(unsigned ubase, unsigned id, unsigned next)
{
    size_t i;
    unsigned default_state;

    default_state = table[ubase + ILLEGAL][0];

    if (next == 0)
        next = default_state;
    else
        next = ubase + next;

    memcpy(table[ubase + id], table[ubase + ILLEGAL], 256);

    for (i=0x80; i<0xC0; i++) {
        table[ubase + id][i] = next;
    }
    for (i=0xC0; i<0x100; i++) {
        table[ubase + id][i] = ubase + ILLEGAL;
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
leal 0x1e(%rdi), %r15d
movq %r15, %rsi
shlq $0x8, %rsi
leaq 0x4bee(%rip), %r14      # 0x60f0
addq %r14, %rsi
testl %edx, %edx
je 0x150f
movl %edx, %ebp
addl %edi, %ebp
jmp 0x1512
movb (%rsi), %bpl
addl %edi, %ebx
shlq $0x8, %rbx
leaq (%r14,%rbx), %rdi
movl $0x100, %edx            # imm = 0x100
callq 0x1100
movzbl %bpl, %eax
movd %eax, %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0x80(%rbx,%r14)
movdqa %xmm0, 0x90(%rbx,%r14)
movdqa %xmm0, 0xa0(%rbx,%r14)
movdqa %xmm0, 0xb0(%rbx,%r14)
movd %r15d, %xmm0
punpcklbw %xmm0, %xmm0    # xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
pshuflw $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0,4,5,6,7]
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
movdqa %xmm0, 0xf0(%rbx,%r14)
movdqa %xmm0, 0xe0(%rbx,%r14)
movdqa %xmm0, 0xd0(%rbx,%r14)
movdqa %xmm0, 0xc0(%rbx,%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/robertdavidgraham[P]wc2/wc2.c
// Function: print_results
static void
print_results(const char *filename, struct results *results, struct config *cfg)
{
    int needs_space = 0; /* space needed between output */
    unsigned width = cfg->column_width;

    /* -l */
    if (cfg->is_counting_lines)
        printf("%s%*lu", needs_space++?" ":"", width, results->line_count);

    /* -w */
    if (cfg->is_counting_words)
        printf("%s%*lu", needs_space++?" ":"", width, results->word_count);

    /* -c */
    if (cfg->is_counting_bytes)
        printf("%s%*lu", needs_space++?" ":"", width, results->byte_count);

    /* -m */
    if (cfg->is_counting_chars)
        printf("%s%*lu", needs_space++?" ":"", width, results->char_count);

    /* NULL if <stdin>, "total" for the last line showing totals, otherwise,
     * the name of the file that was processed */
    if (filename)
        printf("%s%s", needs_space++?" ":"", filename);
    printf("\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc(%rdx), %r13d
movl 0x20(%rdx), %ebp
testl %r13d, %r13d
je 0x305d
movq (%r14), %rcx
leaq 0x105e(%rip), %rdi      # 0x40a3
leaq 0x1046(%rip), %rsi      # 0x4092
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
movl $0x1, %r12d
jmp 0x3060
xorl %r12d, %r12d
cmpl $0x0, 0x10(%r15)
je 0x3093
incl %r12d
testl %r13d, %r13d
leaq 0x101e(%rip), %rax      # 0x4092
leaq 0x102f(%rip), %rsi      # 0x40aa
cmoveq %rax, %rsi
movq 0x8(%r14), %rcx
leaq 0x1019(%rip), %rdi      # 0x40a3
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
cmpl $0x0, 0x14(%r15)
je 0x30cb
leal 0x1(%r12), %r13d
testl %r12d, %r12d
leaq 0xfe9(%rip), %rax       # 0x4092
leaq 0xffa(%rip), %rsi       # 0x40aa
cmoveq %rax, %rsi
movq 0x18(%r14), %rcx
leaq 0xfe4(%rip), %rdi       # 0x40a3
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
movl %r13d, %r12d
cmpl $0x0, 0x18(%r15)
je 0x3101
testl %r12d, %r12d
leaq 0xfb6(%rip), %rax       # 0x4092
leaq 0xfc7(%rip), %rsi       # 0x40aa
cmoveq %rax, %rsi
movq 0x10(%r14), %rcx
leaq 0xfb1(%rip), %rdi       # 0x40a3
movl %ebp, %edx
xorl %eax, %eax
callq 0x10c0
movl $0x1, %r12d
testq %rbx, %rbx
je 0x312c
testl %r12d, %r12d
leaq 0xf82(%rip), %rax       # 0x4092
leaq 0xf93(%rip), %rsi       # 0x40aa
cmoveq %rax, %rsi
leaq 0xf8a(%rip), %rdi       # 0x40ac
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10c0
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O1/robertdavidgraham[P]wc2/wc2.c
// Function: print_help
static void
print_help(void)
{
    printf("wc -- word, line, and byte or character count\n");
    printf("use:\n wc [-c|-m][-lw][file...]\n");
    printf("where:\n");
    printf(" -c\tPrint the number of bytes in each input file.\n");
    printf(" -l\tPrint the number of newlines in each input file.\n");
    printf(" -m\tPrint number of multibyte characters in each input file.\n");
    printf(" -w\tPrint the number of words in each input file.\n");
    printf("If no files specified, reads from stdin.\n");
    printf("If no options specified, -lwc will be used.\n");
}

// Assembly:
pushq %rax
leaq 0xf65(%rip), %rdi       # 0x40b1
callq 0x1070
leaq 0xf87(%rip), %rdi       # 0x40df
callq 0x1070
leaq 0xf9a(%rip), %rdi       # 0x40fe
callq 0x1070
leaq 0xf95(%rip), %rdi       # 0x4105
callq 0x1070
leaq 0xfbb(%rip), %rdi       # 0x4137
callq 0x1070
leaq 0xfe4(%rip), %rdi       # 0x416c
callq 0x1070
leaq 0x1015(%rip), %rdi      # 0x41a9
callq 0x1070
leaq 0x103b(%rip), %rdi      # 0x41db
callq 0x1070
leaq 0x1058(%rip), %rdi      # 0x4204
popq %rax
jmp 0x1070
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/spiped/dispatch.c
// Function: dispatch_accept
void *
dispatch_accept(int s, const char * tgt, double rtime, struct sock_addr ** sas,
    const struct sock_addr * sa_b, int decr, int nopfs, int requirepfs,
    int nokeepalive, const struct proto_secret * K, size_t nconn_max,
    double timeo, int * conndone)
{
	struct accept_state * A;

	/* Bake a cookie. */
	if ((A = malloc(sizeof(struct accept_state))) == NULL)
		goto err0;
	A->s = s;
	A->tgt = tgt;
	A->sas = sas;
	A->sa_b = sa_b;
	A->rtime = rtime;
	A->decr = decr;
	A->nopfs = nopfs;
	A->requirepfs = requirepfs;
	A->nokeepalive = nokeepalive;
	A->conndone = conndone;
	A->shutdown_requested = 0;
	A->K = K;
	A->nconn = 0;
	A->nconn_max = nconn_max;
	A->timeo = timeo;
	A->T = NULL;
	A->accept_cookie = NULL;
	A->dnstimer_cookie = NULL;
	LIST_INIT(&A->conn_cookies);

	/* If address re-resolution is enabled... */
	if (rtime > 0.0) {
		/* Launch an address resolution thread. */
		if ((A->T = dnsthread_spawn()) == NULL)
			goto err1;

		/* Re-resolve the target address after a while. */
		if ((A->dnstimer_cookie = events_timer_register_double(
		    callback_resolveagain, A, A->rtime)) == NULL)
			goto err2;
	}

	/* Accept a connection. */
	if (doaccept(A))
		goto err3;

	/* Success! */
	return (A);

err3:
	if (A->dnstimer_cookie != NULL)
		events_timer_cancel(A->dnstimer_cookie);
err2:
	if (A->T != NULL)
		dnsthread_kill(A->T);
err1:
	free(A);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm1, 0x10(%rsp)
movl %r9d, 0x4(%rsp)
movl %r8d, %r14d
movq %rcx, %r15
movq %rdx, %r12
movsd %xmm0, 0x8(%rsp)
movq %rsi, %r13
movl %edi, %ebp
movl $0x88, %edi
callq 0x31a0
testq %rax, %rax
je 0x4fe5
movq %rax, %rbx
xorpd %xmm0, %xmm0
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
movq 0x70(%rsp), %rax
movq 0x68(%rsp), %rcx
movq 0x60(%rsp), %rdx
movl 0x58(%rsp), %esi
movl 0x50(%rsp), %edi
movl %ebp, (%rbx)
movq %r13, 0x8(%rbx)
movq %r12, 0x10(%rbx)
movq %r15, 0x18(%rbx)
movsd %xmm1, 0x20(%rbx)
movl %r14d, 0x28(%rbx)
movl 0x4(%rsp), %r8d
movl %r8d, 0x2c(%rbx)
movl %edi, 0x30(%rbx)
movl %esi, 0x34(%rbx)
movq %rax, 0x38(%rbx)
movl $0x0, 0x40(%rbx)
movq %rdx, 0x48(%rbx)
movq $0x0, 0x50(%rbx)
movq %rcx, 0x58(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x60(%rbx)
xorpd %xmm0, %xmm0
movupd %xmm0, 0x68(%rbx)
movupd %xmm0, 0x78(%rbx)
jbe 0x4fb2
callq 0x8f5c
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x4fdd
movsd 0x20(%rbx), %xmm0
leaq 0x58(%rip), %rdi        # 0x4ff9
movq %rbx, %rsi
callq 0x6628
movq %rax, 0x70(%rbx)
testq %rax, %rax
je 0x4fcc
movq %rbx, %rdi
callq 0x501b
testl %eax, %eax
je 0x4fe7
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x4fcc
callq 0x665d
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x4fdd
callq 0x9600
movq %rbx, %rdi
callq 0x32b0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/spiped/dispatch.c
// Function: doaccept
static int
doaccept(struct accept_state * A)
{
	int rc = 0;

	/* Warn about reaching nconn_max. */
	if (A->nconn >= A->nconn_max) {
		warn0("Maximum number of connections (%zu) reached",
		    A->nconn_max);
	}

	/* If we can, accept a new connection. */
	if ((A->nconn < A->nconn_max) && (A->accept_cookie == NULL) &&
	    !A->shutdown_requested) {
		if ((A->accept_cookie =
		    network_accept(A->s, callback_gotconn, A)) == NULL)
			rc = -1;
	}

	/* Return success/fail status. */
	return (rc);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rsi
cmpq %rsi, 0x50(%rdi)
jb 0x5042
leaq 0xc38b(%rip), %rdi      # 0x113bb
xorl %eax, %eax
callq 0x8e37
callq 0x3480
movl $0x0, (%rax)
movq 0x50(%rbx), %rcx
xorl %eax, %eax
cmpq 0x58(%rbx), %rcx
jae 0x507b
cmpq $0x0, 0x68(%rbx)
jne 0x507b
cmpl $0x0, 0x40(%rbx)
jne 0x507b
movl (%rbx), %edi
leaq 0x157(%rip), %rsi       # 0x51bb
movq %rbx, %rdx
callq 0x67d0
movq %rax, %rcx
movq %rax, 0x68(%rbx)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/spiped/dispatch.c
// Function: dispatch_shutdown
void
dispatch_shutdown(void * dispatch_cookie)
{
	struct accept_state * A = dispatch_cookie;
	struct conn_list_node * C;

	/*
	 * Shutdown any open connections.  proto_conn_drop() will call
	 * callback_conndied(), which removes the relevant conn_list_node from
	 * the list of conn_cookies.
	 */
	while ((C = LIST_FIRST(&A->conn_cookies)) != NULL) {
		proto_conn_drop(C->conn_cookie, PROTO_CONN_CANCELLED);

		/*
		 * Convince static analyzers that C->conn_cookie is no longer
		 * in the list.
		 */
		assert(C != LIST_FIRST(&A->conn_cookies));
	}

	if (A->accept_cookie != NULL)
		network_accept_cancel(A->accept_cookie);
	if (A->dnstimer_cookie != NULL)
		events_timer_cancel(A->dnstimer_cookie);
	if (A->T != NULL)
		dnsthread_kill(A->T);
	sock_addr_freelist(A->sas);
	if (close(A->s))
		warnp("close");
	free(A);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x78(%rbx), %r14
testq %r14, %r14
je 0x50bf
movq (%r14), %rdi
movl $0x1, %esi
callq 0x9790
cmpq 0x78(%rbx), %r14
jne 0x5084
leaq 0xc2c8(%rip), %rdi      # 0x1136f
leaq 0xc2e3(%rip), %rsi      # 0x11391
leaq 0xc2e7(%rip), %rcx      # 0x1139c
movl $0x132, %edx            # imm = 0x132
callq 0x3150
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x50cd
callq 0x688e
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x50db
callq 0x665d
movq 0x80(%rbx), %rdi
testq %rdi, %rdi
je 0x50ec
callq 0x9600
movq 0x10(%rbx), %rdi
callq 0x8387
movl (%rbx), %edi
callq 0x30d0
testl %eax, %eax
je 0x5132
callq 0x3480
cmpl $0x0, (%rax)
je 0x5124
movq %rax, %r14
leaq 0xc5b9(%rip), %rdi      # 0x116cd
xorl %eax, %eax
callq 0x8d18
movl $0x0, (%r14)
jmp 0x5132
leaq 0xc5a2(%rip), %rdi      # 0x116cd
xorl %eax, %eax
callq 0x8e37
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x32b0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/spiped/dispatch.c
// Function: callback_gotconn
static int
callback_gotconn(void * cookie, int s)
{
	struct accept_state * A = cookie;
	struct sock_addr ** sas;
	struct conn_list_node * node_new;

	/* This accept is no longer in progress. */
	A->accept_cookie = NULL;

	/* If we got a -1 descriptor, something went seriously wrong. */
	if (s == -1) {
		warnp("network_accept failed");
		goto err0;
	}

	/* We have gained a connection. */
	A->nconn += 1;

	/* Duplicate the target address list. */
	if ((sas = sock_addr_duplist(A->sas)) == NULL)
		goto err1;

	/* Create new conn_list_node. */
	if ((node_new = malloc(sizeof(struct conn_list_node))) == NULL)
		goto err2;
	node_new->A = A;

	/* Create a new connection. */
	if ((node_new->conn_cookie = proto_conn_create(s, sas, A->sa_b,
	    A->decr, A->nopfs, A->requirepfs, A->nokeepalive, A->K,
	    A->timeo, callback_conndied, node_new)) == NULL) {
		warnp("Failure setting up new connection");
		goto err3;
	}

	/* Insert node_new to the beginning of the conn_cookies list. */
	LIST_INSERT_HEAD(&A->conn_cookies, node_new, entries);

	/* Accept another connection if we can. */
	if (doaccept(A))
		goto err0;

	/* Success! */
	return (0);

err3:
	free(node_new);
err2:
	sock_addr_freelist(sas);
err1:
	A->nconn -= 1;
	if (close(s))
		warnp("close");
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq $0x0, 0x68(%rdi)
cmpl $-0x1, %esi
je 0x5283
movl %esi, %ebp
movq %rdi, %rbx
incq 0x50(%rdi)
movq 0x10(%rdi), %rdi
callq 0x8966
testq %rax, %rax
je 0x52e5
movq %rax, %r14
movl $0x20, %edi
callq 0x31a0
testq %rax, %rax
je 0x52dd
movq %rax, %r15
movq %rbx, 0x18(%rax)
movq 0x18(%rbx), %rdx
movl 0x28(%rbx), %ecx
movl 0x2c(%rbx), %r8d
movl 0x30(%rbx), %r9d
movl 0x34(%rbx), %eax
movsd 0x60(%rbx), %xmm0
leaq 0x109(%rip), %r10       # 0x5333
movl %ebp, %edi
movq %r14, %rsi
pushq %r15
pushq %r10
pushq 0x48(%rbx)
pushq %rax
callq 0x98a2
addq $0x20, %rsp
movq %rax, (%r15)
testq %rax, %rax
je 0x52a2
leaq 0x78(%rbx), %rax
movq 0x78(%rbx), %rcx
movq %rcx, 0x8(%r15)
testq %rcx, %rcx
je 0x5264
movq %r15, %rdx
addq $0x8, %rdx
movq %rdx, 0x10(%rcx)
movq %r15, 0x78(%rbx)
movq %rax, 0x10(%r15)
movq %rbx, %rdi
callq 0x501b
testl %eax, %eax
jne 0x5325
xorl %eax, %eax
jmp 0x532a
callq 0x3480
cmpl $0x0, (%rax)
je 0x5299
movq %rax, %rbx
leaq 0xc150(%rip), %rdi      # 0x113e7
jmp 0x5308
leaq 0xc147(%rip), %rdi      # 0x113e7
jmp 0x531e
callq 0x3480
cmpl $0x0, (%rax)
je 0x52c7
movq %rax, %r12
leaq 0xc147(%rip), %rdi      # 0x113fd
xorl %eax, %eax
callq 0x8d18
movl $0x0, (%r12)
jmp 0x52d5
leaq 0xc12f(%rip), %rdi      # 0x113fd
xorl %eax, %eax
callq 0x8e37
movq %r15, %rdi
callq 0x32b0
movq %r14, %rdi
callq 0x8387
decq 0x50(%rbx)
movl %ebp, %edi
callq 0x30d0
testl %eax, %eax
je 0x5325
callq 0x3480
cmpl $0x0, (%rax)
je 0x5317
movq %rax, %rbx
leaq 0xc3c5(%rip), %rdi      # 0x116cd
xorl %eax, %eax
callq 0x8d18
movl $0x0, (%rbx)
jmp 0x5325
leaq 0xc3af(%rip), %rdi      # 0x116cd
xorl %eax, %eax
callq 0x8e37
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/spiped/dispatch.c
// Function: callback_conndied
static int
callback_conndied(void * cookie, int reason)
{
	struct conn_list_node * node_ptr = cookie;
	struct accept_state * A = node_ptr->A;

	(void)reason; /* UNUSED */

	/* We should always have a non-empty list of conn_cookies. */
	assert(!LIST_EMPTY(&A->conn_cookies));

	/* We've lost a connection. */
	A->nconn -= 1;

	/* Remove the closed connection from the list of conn_cookies. */
	LIST_REMOVE(node_ptr, entries);

	/* Clean up the now-unused node. */
	free(node_ptr);

	/* If requested to do so, indicate that all connections are closed. */
	if (A->shutdown_requested && (A->nconn == 0))
		*A->conndone = 1;

	/* Maybe accept more connections. */
	return (doaccept(A));
}

// Assembly:
pushq %rbx
movq 0x18(%rdi), %rbx
cmpq $0x0, 0x78(%rbx)
je 0x5380
decq 0x50(%rbx)
movq 0x8(%rdi), %rax
testq %rax, %rax
je 0x5354
movq 0x10(%rdi), %rcx
movq %rcx, 0x10(%rax)
movq 0x10(%rdi), %rcx
movq %rax, (%rcx)
callq 0x32b0
cmpl $0x0, 0x40(%rbx)
je 0x5377
cmpq $0x0, 0x50(%rbx)
jne 0x5377
movq 0x38(%rbx), %rax
movl $0x1, (%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x501b
leaq 0xc098(%rip), %rdi      # 0x1141f
leaq 0xc003(%rip), %rsi      # 0x11391
leaq 0xc0a8(%rip), %rcx      # 0x1143d
movl $0x7c, %edx
callq 0x3150
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_conn.c
// Function: proto_conn_drop
int
proto_conn_drop(void * conn_cookie, int reason)
{
	struct conn_state * C = conn_cookie;
	int rc;

	/* Close the incoming connection. */
	if (close(C->s))
		warnp("close");

	/* Close the outgoing connection if it is open. */
	if ((C->t != -1) && close(C->t))
		warnp("close");

	/* Stop connecting if a connection is in progress. */
	if (C->connect_cookie != NULL)
		network_connect_cancel(C->connect_cookie);

	/* Free the target addresses if we haven't already done so. */
	sock_addr_freelist(C->sas);

	/* Stop handshaking if a handshake is in progress. */
	if (C->handshake_cookie != NULL)
		proto_handshake_cancel(C->handshake_cookie);

	/* Kill timeouts if they are pending. */
	if (C->connect_timeout_cookie != NULL)
		events_timer_cancel(C->connect_timeout_cookie);
	if (C->handshake_timeout_cookie != NULL)
		events_timer_cancel(C->handshake_timeout_cookie);

	/* Free protocol keys. */
	proto_crypt_free(C->k_f);
	proto_crypt_free(C->k_r);

	/* Shut down pipes. */
	if (C->pipe_f != NULL)
		proto_pipe_cancel(C->pipe_f);
	if (C->pipe_r != NULL)
		proto_pipe_cancel(C->pipe_r);

	/* Notify the upstream that we've dropped a connection. */
	rc = (C->callback_dead)(C->cookie, reason);

	/* Free the connection cookie. */
	free(C);

	/* Return success/fail status. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movl 0x38(%rdi), %edi
callq 0x30d0
testl %eax, %eax
je 0x97d7
callq 0x3480
cmpl $0x0, (%rax)
je 0x97c9
movq %rax, %r14
leaq 0x7f14(%rip), %rdi      # 0x116cd
xorl %eax, %eax
callq 0x8d18
movl $0x0, (%r14)
jmp 0x97d7
leaq 0x7efd(%rip), %rdi      # 0x116cd
xorl %eax, %eax
callq 0x8e37
movl 0x3c(%rbx), %edi
cmpl $-0x1, %edi
je 0x981a
callq 0x30d0
testl %eax, %eax
je 0x981a
callq 0x3480
cmpl $0x0, (%rax)
je 0x980c
movq %rax, %r14
leaq 0x7ed1(%rip), %rdi      # 0x116cd
xorl %eax, %eax
callq 0x8d18
movl $0x0, (%r14)
jmp 0x981a
leaq 0x7eba(%rip), %rdi      # 0x116cd
xorl %eax, %eax
callq 0x8e37
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x9828
callq 0xf626
movq 0x10(%rbx), %rdi
callq 0x8387
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x983f
callq 0xa5ae
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x984d
callq 0x665d
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x985b
callq 0x665d
movq 0x60(%rbx), %rdi
callq 0xa26f
movq 0x68(%rbx), %rdi
callq 0xa26f
movq 0x70(%rbx), %rdi
testq %rdi, %rdi
je 0x987b
callq 0xab17
movq 0x78(%rbx), %rdi
testq %rdi, %rdi
je 0x9889
callq 0xab17
movq 0x8(%rbx), %rdi
movl %ebp, %esi
callq *(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x32b0
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_conn.c
// Function: proto_conn_create
void *
proto_conn_create(int s, struct sock_addr ** sas,
    const struct sock_addr * sa_b, int decr, int nopfs,
    int requirepfs, int nokeepalive, const struct proto_secret * K,
    double timeo, int (* callback_dead)(void *, int), void * cookie)
{
	struct conn_state * C;

	/* Bake a cookie for this connection. */
	if ((C = malloc(sizeof(struct conn_state))) == NULL)
		goto err0;
	C->callback_dead = callback_dead;
	C->cookie = cookie;
	C->sas = sas;
	C->decr = decr;
	C->nopfs = nopfs;
	C->requirepfs = requirepfs;
	C->nokeepalive = nokeepalive;
	C->K = K;
	C->timeo = timeo;
	C->s = s;
	C->t = -1;
	C->connect_cookie = NULL;
	C->connect_timeout_cookie = NULL;
	C->handshake_cookie = NULL;
	C->handshake_timeout_cookie = NULL;
	C->k_f = C->k_r = NULL;
	C->pipe_f = C->pipe_r = NULL;
	C->stat_f = C->stat_r = 1;

	/* Start the connect timer. */
	if ((C->connect_timeout_cookie = events_timer_register_double(
	    callback_connect_timeout, C, C->timeo)) == NULL)
		goto err1;

	/* Connect to target. */
	if ((C->connect_cookie =
	    network_connect_bind(C->sas, sa_b, callback_connect_done, C))
	    == NULL)
		goto err2;

	/* If we're decrypting, start the handshake. */
	if (C->decr) {
		if (starthandshake(C, C->s, C->decr))
			goto err3;
	}

	/* Success! */
	return (C);

err3:
	network_connect_cancel(C->connect_cookie);
err2:
	events_timer_cancel(C->connect_timeout_cookie);
err1:
	free(C);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm0, 0x10(%rsp)
movl %r9d, %ebp
movl %r8d, %r12d
movl %ecx, %r13d
movq %rdx, 0x8(%rsp)
movq %rsi, %r14
movl %edi, %r15d
movl $0x88, %edi
callq 0x31a0
testq %rax, %rax
je 0x99b9
movq %rax, %rbx
movq 0x68(%rsp), %rax
movq 0x60(%rsp), %rcx
movq 0x58(%rsp), %rdx
movl 0x50(%rsp), %esi
movq %rcx, (%rbx)
movq %rax, 0x8(%rbx)
movq %r14, 0x10(%rbx)
movl %r13d, 0x18(%rbx)
movl %r12d, 0x1c(%rbx)
movl %ebp, 0x20(%rbx)
movl %esi, 0x24(%rbx)
movq %rdx, 0x28(%rbx)
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x30(%rbx)
movl %r15d, 0x38(%rbx)
movl $0xffffffff, 0x3c(%rbx) # imm = 0xFFFFFFFF
xorps %xmm1, %xmm1
movups %xmm1, 0x40(%rbx)
movups %xmm1, 0x50(%rbx)
movups %xmm1, 0x60(%rbx)
movups %xmm1, 0x70(%rbx)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x80(%rbx)
leaq 0x7c(%rip), %rdi        # 0x99cd
movq %rbx, %rsi
callq 0x6628
movq %rax, 0x48(%rbx)
testq %rax, %rax
je 0x99b1
movq 0x10(%rbx), %rdi
leaq 0x72(%rip), %rdx        # 0x99df
movq 0x8(%rsp), %rsi
movq %rbx, %rcx
callq 0xf609
movq %rax, 0x40(%rbx)
testq %rax, %rax
je 0x99a8
movl 0x18(%rbx), %edx
testl %edx, %edx
je 0x99bb
movl 0x38(%rbx), %esi
movq %rbx, %rdi
callq 0x9a75
testl %eax, %eax
je 0x99bb
movq %rbx, %rax
addq $0x40, %rax
movq (%rax), %rdi
callq 0xf626
movq 0x48(%rbx), %rdi
callq 0x665d
movq %rbx, %rdi
callq 0x32b0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_conn.c
// Function: callback_connect_done
static int
callback_connect_done(void * cookie, int t)
{
	struct conn_state * C = cookie;

	/* This connection attempt is no longer pending. */
	C->connect_cookie = NULL;

	/* Don't need the target address any more. */
	sock_addr_freelist(C->sas);
	C->sas = NULL;

	/* We beat the clock. */
	events_timer_cancel(C->connect_timeout_cookie);
	C->connect_timeout_cookie = NULL;

	/* Did we manage to connect? */
	if ((C->t = t) == -1)
		return (proto_conn_drop(C, PROTO_CONN_CONNECT_FAILED));

	/* If we're encrypting, start the handshake. */
	if (!C->decr) {
		if (starthandshake(C, C->t, C->decr))
			goto err1;
	}

	/* If the handshake already finished, start shuttling data. */
	if ((C->t != -1) && (C->k_f != NULL) && (C->k_r != NULL)) {
		if (launchpipes(C))
			goto err1;
	}

	/* Success! */
	return (0);

err1:
	proto_conn_drop(C, PROTO_CONN_ERROR);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
xorl %r14d, %r14d
movq %r14, 0x40(%rdi)
movq 0x10(%rdi), %rdi
callq 0x8387
movq %r14, 0x10(%rbx)
movq 0x48(%rbx), %rdi
callq 0x665d
movq %r14, 0x48(%rbx)
movl %ebp, 0x3c(%rbx)
cmpl $-0x1, %ebp
je 0x9a3b
cmpl $0x0, 0x18(%rbx)
je 0x9a4c
xorl %ebp, %ebp
cmpl $-0x1, 0x3c(%rbx)
je 0x9a6e
cmpq $0x0, 0x60(%rbx)
je 0x9a6e
cmpq $0x0, 0x68(%rbx)
je 0x9a6e
movq %rbx, %rdi
callq 0x9bcb
testl %eax, %eax
jne 0x9a5c
jmp 0x9a6e
movq %rbx, %rdi
movl $0x2, %esi
popq %rbx
popq %r14
popq %rbp
jmp 0x9790
movq %rbx, %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x9a75
testl %eax, %eax
je 0x9a17
movq %rbx, %rdi
movl $0x4, %esi
callq 0x9790
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_conn.c
// Function: starthandshake
static int
starthandshake(struct conn_state * C, int s, int decr)
{

	/* Start the handshake timer. */
	if ((C->handshake_timeout_cookie = events_timer_register_double(
	    callback_handshake_timeout, C, C->timeo)) == NULL)
		goto err0;

	/* Start the handshake. */
	if ((C->handshake_cookie = proto_handshake(s, decr, C->nopfs,
	    C->requirepfs, C->K, callback_handshake_done, C)) == NULL)
		goto err1;

	/* Success! */
	return (0);

err1:
	events_timer_cancel(C->handshake_timeout_cookie);
	C->handshake_timeout_cookie = NULL;
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
movsd 0x30(%rdi), %xmm0
leaq 0x65(%rip), %rdi        # 0x9af6
movq %rbx, %rsi
callq 0x6628
movq %rax, %rcx
movq %rax, 0x58(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rcx, %rcx
je 0x9aed
movl 0x1c(%rbx), %edx
movl 0x20(%rbx), %ecx
movq 0x28(%rbx), %r8
movq %rbx, (%rsp)
leaq 0x49(%rip), %r9         # 0x9b08
movl %r14d, %edi
movl %ebp, %esi
callq 0xa480
movq %rax, %rcx
movq %rax, 0x50(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x9aed
movq 0x58(%rbx), %rdi
callq 0x665d
movq $0x0, 0x58(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_conn.c
// Function: callback_handshake_done
static int
callback_handshake_done(void * cookie, struct proto_keys * f,
    struct proto_keys * r)
{
	struct conn_state * C = cookie;

	/* The handshake is no longer in progress. */
	C->handshake_cookie = NULL;

	/* We beat the clock. */
	events_timer_cancel(C->handshake_timeout_cookie);
	C->handshake_timeout_cookie = NULL;

	/* If the protocol handshake failed, drop the connection. */
	if ((f == NULL) && (r == NULL))
		return (proto_conn_drop(C, PROTO_CONN_HANDSHAKE_FAILED));

	/* We should have two keys. */
	assert(f != NULL);
	assert(r != NULL);

	/* Record the keys so we can free them later. */
	C->k_f = f;
	C->k_r = r;

	/* If we already connected to the target, start shuttling data. */
	if ((C->t != -1) && (C->k_f != NULL) && (C->k_r != NULL)) {
		if (launchpipes(C))
			goto err1;
	}

	/* Success! */
	return (0);

err1:
	proto_conn_drop(C, PROTO_CONN_ERROR);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
xorl %r12d, %r12d
movq %r12, 0x50(%rdi)
movq 0x58(%rdi), %rdi
callq 0x665d
movq %r12, 0x58(%rbx)
movq %r15, %rax
orq %r14, %rax
jne 0x9b4a
movq %rbx, %rdi
movl $0x3, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x9790
testq %r15, %r15
je 0x9b8d
testq %r14, %r14
je 0x9bac
movq %r15, 0x60(%rbx)
movq %r14, 0x68(%rbx)
xorl %ebp, %ebp
cmpl $-0x1, 0x3c(%rbx)
je 0x9b82
movq %rbx, %rdi
callq 0x9bcb
testl %eax, %eax
je 0x9b82
movq %rbx, %rdi
movl $0x4, %esi
callq 0x9790
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8518(%rip), %rdi      # 0x120ac
leaq 0x851b(%rip), %rsi      # 0x120b6
leaq 0x852e(%rip), %rcx      # 0x120d0
movl $0x163, %edx            # imm = 0x163
callq 0x3150
leaq 0x82ec(%rip), %rdi      # 0x11e9f
leaq 0x84fc(%rip), %rsi      # 0x120b6
leaq 0x850f(%rip), %rcx      # 0x120d0
movl $0x164, %edx            # imm = 0x164
callq 0x3150
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_handshake.c
// Function: proto_handshake
void *
proto_handshake(int s, int decr, int nopfs, int requirepfs,
    const struct proto_secret * K,
    int (* callback)(void *, struct proto_keys *, struct proto_keys *),
    void * cookie)
{
	struct handshake_cookie * H;

	/* Bake a cookie. */
	if ((H = malloc(sizeof(struct handshake_cookie))) == NULL)
		goto err0;
	H->callback = callback;
	H->cookie = cookie;
	H->s = s;
	H->decr = decr;
	H->nopfs = nopfs;
	H->requirepfs = requirepfs;
	H->K = K;

	/* Generate a 32-byte connection nonce. */
	if (crypto_entropy_read(H->nonce_local, 32))
		goto err1;

	/* Send our nonce. */
	if ((H->write_cookie = network_write(s, H->nonce_local, 32, 32,
	    callback_nonce_write, H)) == NULL)
		goto err1;

	/* Read the other party's nonce. */
	if ((H->read_cookie = network_read(s, H->nonce_remote, 32, 32,
	    callback_nonce_read, H)) == NULL)
		goto err2;

	/* Success! */
	return (H);

err2:
	network_write_cancel(H->write_cookie);
err1:
	free(H);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r14
movq %r8, (%rsp)
movl %ecx, %r15d
movl %edx, %r12d
movl %esi, %ebp
movl %edi, %r13d
movl $0x318, %edi            # imm = 0x318
callq 0x31a0
testq %rax, %rax
je 0xa4ef
movq %rax, %rbx
movq 0x40(%rsp), %rax
movq %r14, (%rbx)
movq %rax, 0x8(%rbx)
movl %r13d, 0x10(%rbx)
movl %ebp, 0x14(%rbx)
movl %r12d, 0x18(%rbx)
movl %r15d, 0x1c(%rbx)
movq (%rsp), %rax
movq %rax, 0x20(%rbx)
leaq 0x28(%rbx), %r14
movl $0x20, %esi
movq %r14, %rdi
callq 0xe880
testl %eax, %eax
je 0xa503
movq %rbx, %rdi
callq 0x32b0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x64(%rip), %r8         # 0xa56e
movl $0x20, %edx
movl $0x20, %ecx
movl %r13d, %edi
movq %r14, %rsi
movq %rbx, %r9
callq 0xfe90
movq %rax, 0x310(%rbx)
testq %rax, %rax
je 0xa4e7
movq %rbx, %rsi
addq $0x48, %rsi
leaq 0x54(%rip), %r8         # 0xa590
movl $0x20, %edx
movl $0x20, %ecx
movl %r13d, %edi
movq %rbx, %r9
callq 0xf984
movq %rax, 0x308(%rbx)
testq %rax, %rax
jne 0xa4f1
movq 0x310(%rbx), %rdi
callq 0x1015e
jmp 0xa4e7
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_handshake.c
// Function: proto_handshake_cancel
void
proto_handshake_cancel(void * cookie)
{
	struct handshake_cookie * H = cookie;

	/* Cancel any in-progress network operations. */
	if (H->read_cookie != NULL)
		network_read_cancel(H->read_cookie);
	if (H->write_cookie != NULL)
		network_write_cancel(H->write_cookie);

	/* Free the cookie. */
	free(H);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x308(%rdi), %rdi
testq %rdi, %rdi
je 0xa5c3
callq 0xfc2f
movq 0x310(%rbx), %rdi
testq %rdi, %rdi
je 0xa5d4
callq 0x1015e
movq %rbx, %rdi
popq %rbx
jmp 0x32b0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_handshake.c
// Function: handshakefail
static int
handshakefail(struct handshake_cookie * H)
{
	int rc;

	/* Cancel any pending network read or write. */
	if (H->read_cookie != NULL)
		network_read_cancel(H->read_cookie);
	if (H->write_cookie != NULL)
		network_write_cancel(H->write_cookie);

	/* Perform the callback. */
	rc = (H->callback)(H->cookie, NULL, NULL);

	/* Free the cookie. */
	free(H);

	/* Return status from callback. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x308(%rdi), %rdi
testq %rdi, %rdi
je 0xa5f4
callq 0xfc2f
movq 0x310(%rbx), %rdi
testq %rdi, %rdi
je 0xa605
callq 0x1015e
movq 0x8(%rbx), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq *(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x32b0
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_handshake.c
// Function: gotnonces
static int
gotnonces(struct handshake_cookie * H)
{

	/* Compute the diffie-hellman parameter MAC keys. */
	proto_crypt_dhmac(H->K, H->nonce_local, H->nonce_remote,
	    H->dhmac_local, H->dhmac_remote, H->decr);

	/*
	 * If we're the server, we need to read the client's diffie-hellman
	 * parameter.  If we're the client, we need to generate and send our
	 * diffie-hellman parameter.
	 */
	if (H->decr)
		return (dhread(H));
	else
		return (dhwrite(H));

	/* NOTREACHED */
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %rdi
leaq 0x28(%rbx), %rsi
leaq 0x48(%rbx), %rdx
leaq 0x68(%rbx), %rcx
leaq 0x88(%rbx), %r8
movl 0x14(%rbx), %r9d
callq 0x9f6a
cmpl $0x0, 0x14(%rbx)
je 0xa682
movl 0x10(%rbx), %edi
leaq 0x1e8(%rbx), %rsi
leaq 0x92(%rip), %r8         # 0xa6ef
movl $0x120, %edx            # imm = 0x120
movl $0x120, %ecx            # imm = 0x120
movq %rbx, %r9
callq 0xf984
movq %rax, 0x308(%rbx)
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
retq
movq %rbx, %rdi
popq %rbx
jmp 0xa688
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_handshake.c
// Function: dhwrite
static int
dhwrite(struct handshake_cookie * H)
{

	/* Generate a signed diffie-hellman parameter. */
	if (proto_crypt_dh_generate(H->yh_local, H->x, H->dhmac_local,
	    H->nopfs))
		goto err0;

	/* Write our signed diffie-hellman parameter. */
	if ((H->write_cookie = network_write(H->s, H->yh_local, PCRYPT_YH_LEN,
	    PCRYPT_YH_LEN, callback_dh_write, H)) == NULL)
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc8(%rdi), %r14
leaq 0xa8(%rdi), %rsi
leaq 0x68(%rdi), %rdx
movl 0x18(%rdi), %ecx
movq %r14, %rdi
callq 0xa097
testl %eax, %eax
je 0xa6b7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0xa6e7
movl 0x10(%rbx), %edi
leaq 0x146(%rip), %r8        # 0xa807
movl $0x120, %edx            # imm = 0x120
movl $0x120, %ecx            # imm = 0x120
movq %r14, %rsi
movq %rbx, %r9
callq 0xfe90
movq %rax, %rcx
movq %rax, 0x310(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
je 0xa6b0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_handshake.c
// Function: handshakedone
static int
handshakedone(struct handshake_cookie * H)
{
	struct proto_keys * c;
	struct proto_keys * s;
	int rc;

	/* Sanity-check: There should be no callbacks in progress. */
	assert(H->read_cookie == NULL);
	assert(H->write_cookie == NULL);

	/* Perform the final computation. */
	if (proto_crypt_mkkeys(H->K, H->nonce_local, H->nonce_remote,
	    H->yh_remote, H->x, H->nopfs, H->decr, &c, &s))
		goto err0;

	/* Perform the callback. */
	rc = (H->callback)(H->cookie, c, s);

	/* Free the cookie. */
	free(H);

	/* Return status code from callback. */
	return (rc);

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

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
cmpq $0x0, 0x308(%rdi)
jne 0xa7c9
movq %rdi, %rbx
cmpq $0x0, 0x310(%rdi)
jne 0xa7e8
movq 0x20(%rbx), %rdi
leaq 0x28(%rbx), %rsi
leaq 0x48(%rbx), %rdx
leaq 0x1e8(%rbx), %rcx
leaq 0xa8(%rbx), %r8
movl 0x14(%rbx), %eax
movl 0x18(%rbx), %r9d
subq $0x8, %rsp
leaq 0x10(%rsp), %r10
leaq 0x18(%rsp), %r11
pushq %r10
pushq %r11
pushq %rax
callq 0xa0f7
addq $0x20, %rsp
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0xa7c0
movq 0x8(%rbx), %rdi
movq 0x10(%rsp), %rsi
movq 0x8(%rsp), %rdx
callq *(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x32b0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
leaq 0x7a0d(%rip), %rdi      # 0x121dd
leaq 0x7a1d(%rip), %rsi      # 0x121f4
leaq 0x7a35(%rip), %rcx      # 0x12213
movl $0x122, %edx            # imm = 0x122
callq 0x3150
leaq 0x7a51(%rip), %rdi      # 0x12240
leaq 0x79fe(%rip), %rsi      # 0x121f4
leaq 0x7a16(%rip), %rcx      # 0x12213
movl $0x123, %edx            # imm = 0x123
callq 0x3150
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/proto/proto_handshake.c
// Function: callback_dh_write
static int
callback_dh_write(void * cookie, ssize_t len)
{
	struct handshake_cookie * H = cookie;

	/* This write is no longer pending. */
	H->write_cookie = NULL;

	/* Did we successfully write? */
	if (len < PCRYPT_YH_LEN)
		return (handshakefail(H));

	/*
	 * If we're the server, move on to the final computation.  If we're
	 * the client, we need to read the server's parameter next.
	 */
	if (H->decr)
		return (handshakedone(H));
	else
		return (dhread(H));

	/* NOTREACHED */
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq $0x0, 0x310(%rdi)
cmpq $0x11f, %rsi            # imm = 0x11F
jg 0xa828
movq %rbx, %rdi
popq %rbx
jmp 0xa5dd
cmpl $0x0, 0x14(%rbx)
je 0xa837
movq %rbx, %rdi
popq %rbx
jmp 0xa73f
movl 0x10(%rbx), %edi
leaq 0x1e8(%rbx), %rsi
leaq -0x159(%rip), %r8       # 0xa6ef
movl $0x120, %edx            # imm = 0x120
movl $0x120, %ecx            # imm = 0x120
movq %rbx, %r9
callq 0xf984
movq %rax, 0x308(%rbx)
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbl %ecx, %ecx
movl %ecx, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]spiped/liball/../lib/util/graceful_shutdown.c
// Function: graceful_shutdown_initialize
int
graceful_shutdown_initialize(int (* begin_shutdown_parent)(void *),
    void * caller_cookie_parent)
{

	/* Record callback data. */
	begin_shutdown = begin_shutdown_parent;
	caller_cookie = caller_cookie_parent;

	/* Start signal handler and save the original one. */
	if ((sighandler_sigterm_orig = signal(SIGTERM,
	    graceful_shutdown_handler)) == SIG_ERR) {
		warnp("signal");
		goto err0;
	}

	/* Clean up the timer cookie at exit. */
	if (atexit(graceful_shutdown_atexit))
		goto err0;

	/* Periodically check whether a signal was received. */
	if ((timer_cookie = events_timer_register_double(
	    graceful_shutdown, NULL, 1.0)) == NULL) {
		warnp("Failed to register the graceful shutdown timer");
		goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbx
movq %rdi, 0x1dc9c(%rip)     # 0x28840
movq %rsi, 0x1dc9d(%rip)     # 0x28848
leaq 0xa9(%rip), %rsi        # 0xac5b
movl $0xf, %edi
callq 0x3050
movq %rax, 0x1dc8d(%rip)     # 0x28850
cmpq $-0x1, %rax
je 0xac18
leaq 0x96(%rip), %rdi        # 0xac66
callq 0x10ca0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0xac4e
leaq 0xa3(%rip), %rdi        # 0xac88
xorl %ebx, %ebx
movsd 0x6aa1(%rip), %xmm0     # 0x11690
xorl %esi, %esi
callq 0x6628
movq %rax, 0x1dc5b(%rip)     # 0x28858
testq %rax, %rax
jne 0xac4e
callq 0x3480
cmpl $0x0, (%rax)
je 0xac52
movq %rax, %rbx
leaq 0x7649(%rip), %rdi      # 0x1225f
jmp 0xac2c
callq 0x3480
cmpl $0x0, (%rax)
je 0xac3b
movq %rax, %rbx
leaq 0x762c(%rip), %rdi      # 0x12258
xorl %eax, %eax
callq 0x8d18
movl $0x0, (%rbx)
jmp 0xac49
leaq 0x7616(%rip), %rdi      # 0x12258
xorl %eax, %eax
callq 0x8e37
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
retq
leaq 0x7606(%rip), %rdi      # 0x1225f
jmp 0xac42