// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]spiped/liball/../lib/dnsthread/dnsthread.c
// Function: dnsthread_spawn
DNSTHREAD
dnsthread_spawn(void)
{
	struct dnsthread_internal * T;
	int rc;

	/* Allocate a thread management structure. */
	if ((T = malloc(sizeof(struct dnsthread_internal))) == NULL)
		goto err0;

	/* Create and lock a mutex. */
	if ((rc = pthread_mutex_init(&T->mtx, NULL)) != 0) {
		warn0("pthread_mutex_init: %s", strerror(rc));
		goto err1;
	}
	if ((rc = pthread_mutex_lock(&T->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err2;
	}

	/* Create state-changed condition variable. */
	if ((rc = pthread_cond_init(&T->cv, NULL)) != 0) {
		warn0("pthread_cond_init: %s", strerror(rc));
		goto err3;
	}

	/* Create wakeup socketpair. */
	if (socketpair(AF_UNIX, SOCK_STREAM, 0, T->wakeupsock)) {
		warnp("socketpair");
		goto err4;
	}

	/* The thread starts out sleeping. */
	T->state = THREAD_SLEEPING;

	/* Create the thread. */
	if ((rc = pthread_create(&T->thr, NULL, workthread, T)) != 0) {
		warn0("pthread_create: %s", strerror(rc));
		goto err5;
	}

	/* Unlock the mutex. */
	if ((rc = pthread_mutex_unlock(&T->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* Success! */
	return (T);

err5:
	if (close(T->wakeupsock[1]))
		warnp("close");
	if (close(T->wakeupsock[0]))
		warnp("close");
err4:
	pthread_cond_destroy(&T->cv);
err3:
	pthread_mutex_unlock(&T->mtx);
err2:
	pthread_mutex_destroy(&T->mtx);
err1:
	free(T);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x98, %edi
callq 0x2260
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
jne 0x6931
jmp 0x6bb6
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2390
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x6975
jmp 0x694c
movl -0x14(%rbp), %edi
callq 0x2380
movq %rax, %rsi
leaq 0x2eaf(%rip), %rdi      # 0x980d
movb $0x0, %al
callq 0x66d0
callq 0x2090
movl $0x0, (%rax)
jmp 0x6bad
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x23a0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x69b5
jmp 0x698c
movl -0x14(%rbp), %edi
callq 0x2380
movq %rax, %rsi
leaq 0x2e86(%rip), %rdi      # 0x9824
movb $0x0, %al
callq 0x66d0
callq 0x2090
movl $0x0, (%rax)
jmp 0x6ba0
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2240
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x69f9
jmp 0x69d0
movl -0x14(%rbp), %edi
callq 0x2380
movq %rax, %rsi
leaq 0x2e59(%rip), %rdi      # 0x983b
movb $0x0, %al
callq 0x66d0
callq 0x2090
movl $0x0, (%rax)
jmp 0x6b93
movq -0x10(%rbp), %rcx
addq $0x64, %rcx
movl $0x1, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x2220
cmpl $0x0, %eax
je 0x6a50
jmp 0x6a16
callq 0x2090
cmpl $0x0, (%rax)
je 0x6a3b
leaq 0x2e2a(%rip), %rdi      # 0x9851
movb $0x0, %al
callq 0x6480
callq 0x2090
movl $0x0, (%rax)
jmp 0x6a49
leaq 0x2e0f(%rip), %rdi      # 0x9851
movb $0x0, %al
callq 0x66d0
jmp 0x6a4b
jmp 0x6b86
movq -0x10(%rbp), %rax
movl $0x0, 0x60(%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq 0x162(%rip), %rdx       # 0x6bd0
callq 0x22e0
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x6aa3
jmp 0x6a7d
movl -0x14(%rbp), %edi
callq 0x2380
movq %rax, %rsi
leaq 0x2dcd(%rip), %rdi      # 0x985c
movb $0x0, %al
callq 0x66d0
callq 0x2090
movl $0x0, (%rax)
jmp 0x6af0
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x2250
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
je 0x6ae3
jmp 0x6aba
movl -0x14(%rbp), %edi
callq 0x2380
movq %rax, %rsi
leaq 0x2da3(%rip), %rdi      # 0x986f
movb $0x0, %al
callq 0x66d0
callq 0x2090
movl $0x0, (%rax)
jmp 0x6bb6
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x6bbe
movq -0x10(%rbp), %rax
movl 0x68(%rax), %edi
callq 0x21a0
cmpl $0x0, %eax
je 0x6b3a
jmp 0x6b03
callq 0x2090
cmpl $0x0, (%rax)
je 0x6b28
leaq 0x2a22(%rip), %rdi      # 0x9536
movb $0x0, %al
callq 0x6480
callq 0x2090
movl $0x0, (%rax)
jmp 0x6b36
leaq 0x2a07(%rip), %rdi      # 0x9536
movb $0x0, %al
callq 0x66d0
jmp 0x6b38
jmp 0x6b3a
movq -0x10(%rbp), %rax
movl 0x64(%rax), %edi
callq 0x21a0
cmpl $0x0, %eax
je 0x6b84
jmp 0x6b4d
callq 0x2090
cmpl $0x0, (%rax)
je 0x6b72
leaq 0x29d8(%rip), %rdi      # 0x9536
movb $0x0, %al
callq 0x6480
callq 0x2090
movl $0x0, (%rax)
jmp 0x6b80
leaq 0x29bd(%rip), %rdi      # 0x9536
movb $0x0, %al
callq 0x66d0
jmp 0x6b82
jmp 0x6b84
jmp 0x6b86
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x22f0
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x2250
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
callq 0x2150
movq -0x10(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)