LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/main.c
// Function: process_options
static void
process_options(int argc, char *argv[], struct program_options *po, char *ar,
		size_t ar_sz)
{
	const char opt_string[] = ":hcx:DoB";
	enum { MISSING_OPTARG = ':', UNRECOGNIZED_OPTION = '?' };
	int opt = -1;

	while ((opt = getopt(argc, argv, opt_string)) != -1) {
		switch (opt) {
		case MISSING_OPTARG:
		case UNRECOGNIZED_OPTION:
			if (opt == MISSING_OPTARG) {
				fprintf(stderr, "Option '%c' requires an "
				    "argument.\n", optopt);
			} else {
				fprintf(stderr, "Unrecognized option '%c'.\n",
				    optopt);
			}
			/*FALLTHROUGH*/
		case 'h':
			po->want_usage = true;
			return;
		case 'c':
			po->want_create_config_file = true;
			return;
		case 'x':
			snprintf(ar, ar_sz, "%s", optarg);
			break;
		case 'D':
			po->want_debug = true;
			break;
		case 'o':
			po->want_update_once = true;
			break;
		case 'B':
			po->want_daemon = true;
			break;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq 0x5339(%rip), %rax      # 0xb8cb
movq %rax, -0x31(%rbp)
movb 0x5337(%rip), %al       # 0xb8d3
movb %al, -0x29(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %edi
movq -0x10(%rbp), %rsi
leaq -0x31(%rbp), %rdx
callq 0x40c0
movl %eax, -0x38(%rbp)
cmpl $-0x1, %eax
je 0x668d
movl -0x38(%rbp), %eax
addl $-0x3a, %eax
movl %eax, %ecx
movq %rcx, -0x40(%rbp)
subl $0x3e, %eax
ja 0x6688
movq -0x40(%rbp), %rax
leaq 0x4ebe(%rip), %rcx      # 0xb4a0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x3a, -0x38(%rbp)
jne 0x6614
movq 0x99c8(%rip), %rax      # 0xffc0
movq (%rax), %rdi
movq 0x99b6(%rip), %rax      # 0xffb8
movl (%rax), %edx
leaq 0x52c9(%rip), %rsi      # 0xb8d4
movb $0x0, %al
callq 0x4650
jmp 0x6635
movq 0x99a5(%rip), %rax      # 0xffc0
movq (%rax), %rdi
movq 0x9993(%rip), %rax      # 0xffb8
movl (%rax), %edx
leaq 0x52c9(%rip), %rsi      # 0xb8f7
movb $0x0, %al
callq 0x4650
jmp 0x6637
movq -0x18(%rbp), %rax
movb $0x1, (%rax)
jmp 0x668d
movq -0x18(%rbp), %rax
movb $0x1, 0x1(%rax)
jmp 0x668d
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq 0x9937(%rip), %rax      # 0xff90
movq (%rax), %rcx
leaq 0x594a(%rip), %rdx      # 0xbfad
movb $0x0, %al
callq 0x46f0
jmp 0x6688
movq -0x18(%rbp), %rax
movb $0x1, 0x2(%rax)
jmp 0x6688
movq -0x18(%rbp), %rax
movb $0x1, 0x3(%rax)
jmp 0x6688
movq -0x18(%rbp), %rax
movb $0x1, 0x4(%rax)
jmp 0x65a6
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/main.c
// Function: usage
static __dead void
usage(void)
{
	extern char *__progname;
	char *msgVersion = strdup_printf("%s%s%s %s by %s\n",
	    MAGENTA, g_programName, NORMAL,
	    g_programVersion,
	    g_programAuthor);
	char *msgUsage = strdup_printf("Usage: %s [OPTION] ...\n", __progname);

	(void) fputs(msgVersion, stderr);

	(void) fputc('\n', stderr);
	(void) fputs(msgUsage, stderr);

	free(msgVersion);
	free(msgUsage);

	for (const char **ppcc = &help_text[0];
	     ppcc < &help_text[nitems(help_text)]; ppcc++)
		(void) fputs(*ppcc, stderr);
	exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x5263(%rip), %rdi      # 0xb912
leaq 0x526d(%rip), %rsi      # 0xb923
leaq 0x4f03(%rip), %rdx      # 0xb5c0
leaq 0x5265(%rip), %rcx      # 0xb929
leaq 0x4f02(%rip), %r8       # 0xb5cd
leaq 0x4f00(%rip), %r9       # 0xb5d2
movb $0x0, %al
callq 0xa540
movq %rax, -0x8(%rbp)
movq 0x98c4(%rip), %rax      # 0xffa8
movq (%rax), %rsi
leaq 0x5240(%rip), %rdi      # 0xb92e
movb $0x0, %al
callq 0xa540
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq 0x98bc(%rip), %rax      # 0xffc0
movq (%rax), %rsi
callq 0x44d0
movq 0x98ad(%rip), %rax      # 0xffc0
movq (%rax), %rsi
movl $0xa, %edi
callq 0x4530
movq -0x10(%rbp), %rdi
movq 0x9895(%rip), %rax      # 0xffc0
movq (%rax), %rsi
callq 0x44d0
movq -0x8(%rbp), %rdi
callq 0x4510
movq -0x10(%rbp), %rdi
callq 0x4510
leaq 0x9ce4(%rip), %rax      # 0x10430
movq %rax, -0x18(%rbp)
leaq 0x9cd9(%rip), %rax      # 0x10430
addq $0x60, %rax
cmpq %rax, -0x18(%rbp)
jae 0x6785
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq 0x9851(%rip), %rax      # 0xffc0
movq (%rax), %rsi
callq 0x44d0
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
jmp 0x6750
movl $0x1, %edi
callq 0x4520
nop
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/main.c
// Function: force_priv_drop
static void
force_priv_drop(void)
{
	struct passwd *pw = getpwnam(enhanced_duc_user);

	log_msg("dropping root privileges...");

	if (pw == NULL)
		fatal(0, "getpwnam: no such user %s", enhanced_duc_user);
	else if (!is_directory(enhanced_duc_dir) ||
		 chdir(enhanced_duc_dir) != 0)
		fatal(errno, "chdir %s", enhanced_duc_dir);
	else if (setgid(pw->pw_gid) == -1)
		fatal(errno, "setgid");
	else if (setegid(pw->pw_gid) == -1)
		fatal(errno, "setegid");
	else if (setuid(pw->pw_uid) == -1)
		fatal(errno, "setuid");
	else if (seteuid(pw->pw_uid) == -1)
		fatal(errno, "seteuid");
	else
		return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x5035(%rip), %rdi      # 0xb7f4
callq 0x4330
movq %rax, -0x8(%rbp)
leaq 0x5391(%rip), %rdi      # 0xbb60
movb $0x0, %al
callq 0x6260
cmpq $0x0, -0x8(%rbp)
jne 0x67f4
xorl %edi, %edi
leaq 0x5396(%rip), %rsi      # 0xbb7c
leaq 0x5007(%rip), %rdx      # 0xb7f4
movb $0x0, %al
callq 0x5fa0
leaq 0x5000(%rip), %rdi      # 0xb7fb
callq 0xa0a0
testb $0x1, %al
jne 0x6806
jmp 0x6817
leaq 0x4fee(%rip), %rdi      # 0xb7fb
callq 0x4680
cmpl $0x0, %eax
je 0x6833
callq 0x4050
movl (%rax), %edi
leaq 0x5371(%rip), %rsi      # 0xbb96
leaq 0x4fcf(%rip), %rdx      # 0xb7fb
movb $0x0, %al
callq 0x5fa0
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
callq 0x4780
cmpl $-0x1, %eax
jne 0x6859
callq 0x4050
movl (%rax), %edi
leaq 0x534d(%rip), %rsi      # 0xbb9f
movb $0x0, %al
callq 0x5fa0
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
callq 0x45a0
cmpl $-0x1, %eax
jne 0x687f
callq 0x4050
movl (%rax), %edi
leaq 0x532e(%rip), %rsi      # 0xbba6
movb $0x0, %al
callq 0x5fa0
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x47b0
cmpl $-0x1, %eax
jne 0x68a5
callq 0x4050
movl (%rax), %edi
leaq 0x5310(%rip), %rsi      # 0xbbae
movb $0x0, %al
callq 0x5fa0
movq -0x8(%rbp), %rax
movl 0x10(%rax), %edi
callq 0x41a0
cmpl $-0x1, %eax
jne 0x68cb
callq 0x4050
movl (%rax), %edi
leaq 0x52f1(%rip), %rsi      # 0xbbb5
movb $0x0, %al
callq 0x5fa0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/main.c
// Function: hostname_array_assign
static void
hostname_array_assign(void)
{
	char *dump = xstrdup(setting("hostname"));
	static const char legal_index[] =
	    "abcdefghijklmnopqrstuvwxyz-0123456789.ABCDEFGHIJKLMNOPQRSTUVWXYZ|";

	if (strings_match(dump, "")) {
		fatal(EINVAL, "hostname_array_assign: no hostnames to update"
		    "  --  setting empty");
	}

	for (const char *cp = dump; *cp; cp++) {
		if (strchr(legal_index, *cp) == NULL) {
			fatal(0, "hostname_array_assign: "
			    "invalid chars in setting: "
			    "first invalid char is '%c'...", *cp);
		}
	}

	for (size_t hosts_assigned = 0;; hosts_assigned++) {
		char *token = strtok(hosts_assigned == 0 ? dump : NULL, "|");

		if (token && hosts_assigned < nitems(hostname_array)) {
			hostname_array[hosts_assigned] = xstrdup(token);
		} else if (hosts_assigned == 0) {
			fatal(0, "hostname_array_assign: fatal: "
			    "zero assigned hosts!");
		} else {
			log_debug("hostname_array_assign: "
			    "a total of %zu hosts were assigned!",
			    hosts_assigned);
			break;
		}
	}

	free(dump);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0x514b(%rip), %rdi      # 0xbbea
callq 0x9060
movq %rax, %rdi
callq 0xa610
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x5570(%rip), %rsi      # 0xc02b
callq 0x6db0
testb $0x1, %al
jne 0x6ac6
jmp 0x6ad9
movl $0x16, %edi
leaq 0x5152(%rip), %rsi      # 0xbc24
movb $0x0, %al
callq 0x5fa0
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x6b2a
movq -0x10(%rbp), %rax
movsbl (%rax), %esi
leaq 0x4d08(%rip), %rdi      # 0xb800
callq 0x4170
cmpq $0x0, %rax
jne 0x6b1a
movq -0x10(%rbp), %rax
movsbl (%rax), %edx
xorl %edi, %edi
leaq 0x5152(%rip), %rsi      # 0xbc65
movb $0x0, %al
callq 0x5fa0
jmp 0x6b1c
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x6ae1
movq $0x0, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x6b43
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
jmp 0x6b4b
xorl %eax, %eax
movq %rax, -0x28(%rbp)
jmp 0x6b4b
movq -0x28(%rbp), %rdi
leaq 0x515e(%rip), %rsi      # 0xbcb4
callq 0x46d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x6b8a
cmpq $0xa, -0x18(%rbp)
jae 0x6b8a
movq -0x20(%rbp), %rdi
callq 0xa610
movq %rax, %rdx
movq -0x18(%rbp), %rcx
leaq 0x9e1c(%rip), %rax      # 0x109a0
movq %rdx, (%rax,%rcx,8)
jmp 0x6bb5
cmpq $0x0, -0x18(%rbp)
jne 0x6ba1
xorl %edi, %edi
leaq 0x511c(%rip), %rsi      # 0xbcb6
movb $0x0, %al
callq 0x5fa0
movq -0x18(%rbp), %rsi
leaq 0x513d(%rip), %rdi      # 0xbce9
movb $0x0, %al
callq 0x6170
jmp 0x6bc8
jmp 0x6bb7
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x6b32
movq -0x8(%rbp), %rdi
callq 0x4510
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/main.c
// Function: store_server_resp_in_buffer
static int
store_server_resp_in_buffer(char **buf)
{
	const size_t sz = 2000;

	if (*buf) {
		free(*buf);
		*buf = NULL;
	}

	*buf = xcalloc(sz, 1);

	if (net_recv(*buf, sz) == -1)
		return -1;

	char concatSource[500] = { '\0' };

	(void) net_recv(concatSource, nitems(concatSource));

	if (!strings_match(concatSource, "") &&
	    strlcat(*buf, concatSource, sz) >= sz) {
		log_warn(0, "warning: store_server_resp_in_buffer: strlcat: "
		    "response truncated!");
		return -1;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x210, %rsp            # imm = 0x210
movq %rdi, -0x10(%rbp)
movq $0x7d0, -0x18(%rbp)     # imm = 0x7D0
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x7038
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x4510
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
movl $0x7d0, %edi            # imm = 0x7D0
movl $0x1, %esi
callq 0xa6d0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
leaq 0x9448(%rip), %rax      # 0x104a0
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rdi
movl $0x7d0, %esi            # imm = 0x7D0
callq *%rax
cmpl $-0x1, %eax
jne 0x707a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x70fc
leaq -0x210(%rbp), %rdi
xorl %esi, %esi
movl $0x1f4, %edx            # imm = 0x1F4
callq 0x4210
leaq 0x940c(%rip), %rax      # 0x104a0
movq (%rax), %rax
leaq -0x210(%rbp), %rdi
movl $0x1f4, %esi            # imm = 0x1F4
callq *%rax
leaq -0x210(%rbp), %rdi
leaq 0x4f78(%rip), %rsi      # 0xc02b
callq 0x6db0
testb $0x1, %al
jne 0x70f5
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x210(%rbp), %rsi
movl $0x7d0, %edx            # imm = 0x7D0
callq 0x9e00
cmpq $0x7d0, %rax            # imm = 0x7D0
jb 0x70f5
xorl %edi, %edi
leaq 0x4ecb(%rip), %rsi      # 0xbfb0
movb $0x0, %al
callq 0x6300
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x70fc
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/my_vasprintf.c
// Function: my_vasprintf
int
my_vasprintf(char **ret, const char *format, va_list ap)
{
	va_list ap_copy;
	int sz;

	if (ret == NULL || format == NULL) {
		errno = EINVAL;
		return -1;
	}

	va_copy(ap_copy, ap);
	sz = vsnprintf(NULL, 0, format, ap_copy);
	va_end(ap_copy);

	if (sz < 0) {
		*ret = NULL;
		errno = ENOSYS;
		return -1;
	} else {
		sz += 1; /* +1 for `\0'. */
	}

	if ((*ret = malloc(sz)) == NULL) {
		errno = ENOMEM;
		return -1;
	}

	return vsnprintf(*ret, sz, format, ap);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x73a2
cmpq $0x0, -0x18(%rbp)
jne 0x73b9
callq 0x4050
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x745d
leaq -0x40(%rbp), %rax
movq -0x20(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq -0x18(%rbp), %rdx
leaq -0x40(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x4290
movl %eax, -0x44(%rbp)
leaq -0x40(%rbp), %rax
cmpl $0x0, -0x44(%rbp)
jge 0x740f
movq -0x10(%rbp), %rax
movq $0x0, (%rax)
callq 0x4050
movl $0x26, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x745d
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movslq -0x44(%rbp), %rdi
callq 0x45b0
movq -0x10(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
jne 0x7442
callq 0x4050
movl $0xc, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x745d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movslq -0x44(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
callq 0x4290
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/log.h
// Function: log_assert_arg_nonnull
__DUC_END_DECLS

static inline void
log_assert_arg_nonnull(const char *in_func, const char *arg_name,
		       const void *arg)
{
	if (arg == NULL) {
		fatal(EINVAL, "In %s: Argument \"%s\" is null  --  "
		    "assertion failed!",
		    (in_func ? in_func : "(no in_func)"),
		    (arg_name ? arg_name : "(no arg_name)"));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x77fa
cmpq $0x0, -0x8(%rbp)
je 0x77ac
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x77b9
leaq 0x4bdc(%rip), %rax      # 0xc38f
movq %rax, -0x20(%rbp)
jmp 0x77b9
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x77d2
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x77df
leaq 0x4bc3(%rip), %rax      # 0xc39c
movq %rax, -0x30(%rbp)
jmp 0x77df
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movl $0x16, %edi
leaq 0x4b68(%rip), %rsi      # 0xc35b
movb $0x0, %al
callq 0x5fa0
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network-openssl.c
// Function: net_ssl_begin
int
net_ssl_begin(void)
{
	const char		*err_reason = "";
	static const int	 VALUE_HANDSHAKE_OK = 1;

	if (ssl != NULL) {
		err_reason = "the ssl object appears to be non-null";
		goto err;
	} else if ((ssl = SSL_new(ssl_ctx)) == NULL) {
		fatal(ENOMEM, "%s: unable to create a new ssl object",
		    __func__);
	} else if (!SSL_set_fd(ssl, g_socket)) {
		err_reason = "unable to associate the global socket fd with "
		    "the ssl object";
		goto err;
	}

	SSL_set_connect_state(ssl);

	if (SSL_connect(ssl) != VALUE_HANDSHAKE_OK) {
		err_reason = "handshake not ok!";
		goto err;
	}

	return 0;

  err:
	log_warn(0, "%s: %s", __func__, err_reason);
	return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x454c(%rip), %rax      # 0xc02b
movq %rax, -0x10(%rbp)
cmpq $0x0, 0x8f05(%rip)      # 0x109f0
je 0x7afd
leaq 0x46e1(%rip), %rax      # 0xc1d5
movq %rax, -0x10(%rbp)
jmp 0x7b8e
movq 0x8ef4(%rip), %rdi      # 0x109f8
callq 0x4420
movq %rax, 0x8ee0(%rip)      # 0x109f0
cmpq $0x0, %rax
jne 0x7b30
movl $0xc, %edi
leaq 0x46d9(%rip), %rsi      # 0xc1fb
leaq 0x46f8(%rip), %rdx      # 0xc221
movb $0x0, %al
callq 0x5fa0
movq 0x8eb9(%rip), %rdi      # 0x109f0
leaq 0x896a(%rip), %rax      # 0x104a8
movl (%rax), %esi
callq 0x4280
cmpl $0x0, %eax
jne 0x7b57
leaq 0x46de(%rip), %rax      # 0xc22f
movq %rax, -0x10(%rbp)
jmp 0x7b8e
jmp 0x7b59
jmp 0x7b5b
movq 0x8e8e(%rip), %rdi      # 0x109f0
callq 0x4160
movq 0x8e82(%rip), %rdi      # 0x109f0
callq 0x4630
cmpl $0x1, %eax
je 0x7b85
leaq 0x46ed(%rip), %rax      # 0xc26c
movq %rax, -0x10(%rbp)
jmp 0x7b8e
movl $0x0, -0x4(%rbp)
jmp 0x7bb0
movq -0x10(%rbp), %rcx
xorl %edi, %edi
leaq 0x46e3(%rip), %rsi      # 0xc27e
leaq 0x467f(%rip), %rdx      # 0xc221
movb $0x0, %al
callq 0x6300
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network-openssl.c
// Function: net_ssl_end
void
net_ssl_end(void)
{
	if (ssl) {
		switch (SSL_shutdown(ssl)) {
		case 0:
			log_debug("%s: SSL_shutdown: not yet finished",
			    __func__);
			(void) SSL_shutdown(ssl);
			break;
		case 1:
			/* success! */
			break;
		default:
			log_warn(0, "%s: SSL_shutdown: error", __func__);
			break;
		}

		SSL_free(ssl);
		ssl = NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpq $0x0, 0x8e20(%rip)      # 0x109f0
je 0x7c46
movq 0x8e17(%rip), %rdi      # 0x109f0
callq 0x44c0
movl %eax, %ecx
movl %ecx, -0x4(%rbp)
testl %eax, %eax
je 0x7bf3
jmp 0x7be9
movl -0x4(%rbp), %eax
subl $0x1, %eax
je 0x7c16
jmp 0x7c18
leaq 0x468b(%rip), %rdi      # 0xc285
leaq 0x46a7(%rip), %rsi      # 0xc2a8
movb $0x0, %al
callq 0x6170
movq 0x8de1(%rip), %rdi      # 0x109f0
callq 0x44c0
jmp 0x7c2f
jmp 0x7c2f
xorl %edi, %edi
leaq 0x4693(%rip), %rsi      # 0xc2b4
leaq 0x4680(%rip), %rdx      # 0xc2a8
movb $0x0, %al
callq 0x6300
movq 0x8dba(%rip), %rdi      # 0x109f0
callq 0x4240
movq $0x0, 0x8daa(%rip) # 0x109f0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network-openssl.c
// Function: net_ssl_init
void
net_ssl_init(void)
{
	SSL_load_error_strings();
	(void) SSL_library_init();

	if (RAND_load_file("/dev/urandom", 1024) <= 0)
		log_warn(ENOSYS, "%s: error seeding the prng!", __func__);

#if OPENSSL_VERSION_NUMBER >= 0x10100000L
	create_ssl_context_obj();
#else
#pragma message("Consider updating your TLS/SSL library")
	create_ssl_context_obj_insecure();
#endif

	if (!SSL_CTX_set_default_verify_paths(ssl_ctx)) {
		log_warn(ENOSYS, "%s: error loading default ca file and/or "
		    "directory", __func__);
	}

	SSL_CTX_set_verify(ssl_ctx, SSL_VERIFY_PEER, verify_callback);
	SSL_CTX_set_verify_depth(ssl_ctx, 4);

	if (!SSL_CTX_set_cipher_list(ssl_ctx, cipher_list))
		log_warn(EINVAL, "%s: bogus cipher list", __func__);

	net_send = net_ssl_send;
	net_recv = net_ssl_recv;

	log_msg("TLS/SSL enabled");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl $0x200002, %edi         # imm = 0x200002
xorl %eax, %eax
movl %eax, %esi
callq 0x4380
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x4380
leaq 0x4657(%rip), %rdi      # 0xc2cc
movl $0x400, %esi            # imm = 0x400
callq 0x4470
cmpl $0x0, %eax
jg 0x7c9e
movl $0x26, %edi
leaq 0x4649(%rip), %rsi      # 0xc2d9
leaq 0x465e(%rip), %rdx      # 0xc2f5
movb $0x0, %al
callq 0x6300
callq 0x7d60
movq 0x8d4e(%rip), %rdi      # 0x109f8
callq 0x4490
cmpl $0x0, %eax
jne 0x7cce
movl $0x26, %edi
leaq 0x4642(%rip), %rsi      # 0xc302
leaq 0x462e(%rip), %rdx      # 0xc2f5
movb $0x0, %al
callq 0x6300
movq 0x8d23(%rip), %rdi      # 0x109f8
movl $0x1, %esi
leaq 0x17f(%rip), %rdx       # 0x7e60
callq 0x40d0
movq 0x8d0b(%rip), %rdi      # 0x109f8
movl $0x4, %esi
callq 0x4320
movq 0x8cfa(%rip), %rdi      # 0x109f8
leaq 0x478b(%rip), %rsi      # 0xc490
callq 0x43d0
cmpl $0x0, %eax
jne 0x7d29
movl $0x16, %edi
leaq 0x461a(%rip), %rsi      # 0xc335
leaq 0x45d3(%rip), %rdx      # 0xc2f5
movb $0x0, %al
callq 0x6300
leaq 0x8768(%rip), %rax      # 0x10498
leaq -0x897(%rip), %rcx      # 0x74a0
movq %rcx, (%rax)
leaq 0x875f(%rip), %rax      # 0x104a0
leaq -0x548(%rip), %rcx      # 0x7800
movq %rcx, (%rax)
leaq 0x45f9(%rip), %rdi      # 0xc34b
movb $0x0, %al
callq 0x6260
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network-openssl.c
// Function: create_ssl_context_obj
static void
create_ssl_context_obj(void)
{
	if ((ssl_ctx = SSL_CTX_new(TLS_client_method())) == NULL) {
		fatal(ENOMEM, "%s: unable to create a new ssl_ctx object",
		    __func__);
	}

	(void) SSL_CTX_set_mode(ssl_ctx, SSL_MODE_ENABLE_PARTIAL_WRITE);
	(void) SSL_CTX_set_mode(ssl_ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
	(void) SSL_CTX_set_mode(ssl_ctx, SSL_MODE_AUTO_RETRY);
	(void) SSL_CTX_set_mode(ssl_ctx, SSL_MODE_RELEASE_BUFFERS);

	(void) SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv2);
	(void) SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_SSLv3);

	if (!SSL_CTX_set_min_proto_version(ssl_ctx, TLS1_2_VERSION)) {
		log_warn(0, "%s: error setting minimum supported "
		    "protocol version", __func__);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x4200
movq %rax, %rdi
callq 0x4640
movq %rax, 0x8c80(%rip)      # 0x109f8
cmpq $0x0, %rax
jne 0x7d98
movl $0xc, %edi
leaq 0x4620(%rip), %rsi      # 0xc3aa
leaq 0x4643(%rip), %rdx      # 0xc3d4
movb $0x0, %al
callq 0x5fa0
movq 0x8c59(%rip), %rdi      # 0x109f8
movl $0x21, %esi
movl $0x1, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x43a0
movq 0x8c3f(%rip), %rdi      # 0x109f8
movl $0x21, %esi
movl $0x2, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x43a0
movq 0x8c25(%rip), %rdi      # 0x109f8
movl $0x21, %esi
movl $0x4, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x43a0
movq 0x8c0b(%rip), %rdi      # 0x109f8
movl $0x21, %esi
movl $0x10, %edx
xorl %eax, %eax
movl %eax, %ecx
callq 0x43a0
movq 0x8bf1(%rip), %rdi      # 0x109f8
xorl %eax, %eax
movl %eax, %esi
callq 0x47a0
movq 0x8be1(%rip), %rdi      # 0x109f8
movl $0x2000000, %esi        # imm = 0x2000000
callq 0x47a0
movq 0x8bd0(%rip), %rdi      # 0x109f8
movl $0x7b, %esi
movl $0x303, %edx            # imm = 0x303
xorl %eax, %eax
movl %eax, %ecx
callq 0x43a0
cmpq $0x0, %rax
jne 0x7e58
xorl %edi, %edi
leaq 0x45a1(%rip), %rsi      # 0xc3eb
leaq 0x4583(%rip), %rdx      # 0xc3d4
movb $0x0, %al
callq 0x6300
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network-openssl.c
// Function: verify_callback
static int
verify_callback(int ok, X509_STORE_CTX *ctx)
{
	X509		*cert = X509_STORE_CTX_get_current_cert(ctx);
	char		 issuer[256] = { '\0' };
	char		 subject[256] = { '\0' };
	const int	 depth = X509_STORE_CTX_get_error_depth(ctx);
	const int	 err = X509_STORE_CTX_get_error(ctx);

	(void) X509_NAME_oneline(X509_get_issuer_name(cert), issuer,
	    sizeof issuer);
	(void) X509_NAME_oneline(X509_get_subject_name(cert), subject,
	    sizeof subject);

	if (!ok) {
		log_warn(0, "Error with certificate at depth: %d", depth);
		log_warn(0, "  issuer  = %s", issuer);
		log_warn(0, "  subject = %s", subject);
		log_warn(0, "Reason: %s", X509_verify_cert_error_string(err));
	} else {
		log_debug("Cert verification OK!");
		log_debug("  issuer  = %s", issuer);
		log_debug("  subject = %s", subject);
	}
	return (ok);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x230, %rsp            # imm = 0x230
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4730
movq %rax, -0x18(%rbp)
leaq -0x120(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x4210
leaq -0x220(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x4210
movq -0x10(%rbp), %rdi
callq 0x42b0
movl %eax, -0x224(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4310
movl %eax, -0x228(%rbp)
movq -0x18(%rbp), %rdi
callq 0x4410
movq %rax, %rdi
leaq -0x120(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x42f0
movq -0x18(%rbp), %rdi
callq 0x4450
movq %rax, %rdi
leaq -0x220(%rbp), %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x42f0
cmpl $0x0, -0x4(%rbp)
jne 0x7f68
movl -0x224(%rbp), %edx
xorl %edi, %edi
leaq 0x450e(%rip), %rsi      # 0xc420
movb $0x0, %al
callq 0x6300
leaq -0x120(%rbp), %rdx
xorl %edi, %edi
leaq 0x451b(%rip), %rsi      # 0xc444
movb $0x0, %al
callq 0x6300
leaq -0x220(%rbp), %rdx
xorl %edi, %edi
leaq 0x4513(%rip), %rsi      # 0xc453
movb $0x0, %al
callq 0x6300
movslq -0x228(%rbp), %rdi
callq 0x42d0
movq %rax, %rdx
xorl %edi, %edi
leaq 0x4503(%rip), %rsi      # 0xc462
movb $0x0, %al
callq 0x6300
jmp 0x7fa0
leaq 0x44fe(%rip), %rdi      # 0xc46d
movb $0x0, %al
callq 0x6170
leaq -0x120(%rbp), %rsi
leaq 0x44c0(%rip), %rdi      # 0xc444
movb $0x0, %al
callq 0x6170
leaq -0x220(%rbp), %rsi
leaq 0x44ba(%rip), %rdi      # 0xc453
movb $0x0, %al
callq 0x6170
movl -0x4(%rbp), %eax
addq $0x230, %rsp            # imm = 0x230
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network-openssl.c
// Function: net_ssl_deinit
void
net_ssl_deinit(void)
{
	net_ssl_end();

	if (ssl_ctx) {
		SSL_CTX_free(ssl_ctx);
		ssl_ctx = NULL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x7bc0
cmpq $0x0, 0x8a37(%rip)      # 0x109f8
je 0x7fda
movq 0x8a2e(%rip), %rdi      # 0x109f8
callq 0x4090
movq $0x0, 0x8a1e(%rip) # 0x109f8
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network.c
// Function: net_send_plain
int
net_send_plain(const char *fmt, ...)
{
	bool		 ok = true;
	char		*buf = NULL;
	size_t		 newSize = 0;
	static const char
			 message_terminate[] = "\r\n\r\n";
	va_list		 ap;

	log_assert_arg_nonnull("net_send_plain", "fmt", fmt);

	va_start(ap, fmt);
	if (errno = 0, my_vasprintf(&buf, fmt, ap) < 0)
		fatal(errno, "net_send_plain: my_vasprintf");
	va_end(ap);

	newSize = strlen(buf) + nitems(message_terminate);
	buf = xrealloc(buf, newSize);

	if (strlcat(buf, message_terminate, newSize) >= newSize)
		fatal(EOVERFLOW, "net_send_plain: strlcat");
	if (errno = 0, send(g_socket, buf, strlen(buf), 0) == -1)
		ok = false;
	if (!ok)
		log_warn(errno, "net_send_plain: send");
	free(buf);
	return (ok ? 0 : -1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
testb %al, %al
je 0x801b
movaps %xmm0, -0xc0(%rbp)
movaps %xmm1, -0xb0(%rbp)
movaps %xmm2, -0xa0(%rbp)
movaps %xmm3, -0x90(%rbp)
movaps %xmm4, -0x80(%rbp)
movaps %xmm5, -0x70(%rbp)
movaps %xmm6, -0x60(%rbp)
movaps %xmm7, -0x50(%rbp)
movq %r9, -0xc8(%rbp)
movq %r8, -0xd0(%rbp)
movq %rcx, -0xd8(%rbp)
movq %rdx, -0xe0(%rbp)
movq %rsi, -0xe8(%rbp)
movq %rdi, -0x8(%rbp)
movb $0x1, -0x9(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdx
leaq 0x4548(%rip), %rdi      # 0xc5a9
leaq 0x4087(%rip), %rsi      # 0xc0ef
callq 0x8670
leaq -0x40(%rbp), %rax
leaq -0xf0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
callq 0x4050
movl $0x0, (%rax)
movq -0x8(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x18(%rbp), %rdi
callq 0x7380
cmpl $0x0, %eax
jge 0x80c7
callq 0x4050
movl (%rax), %edi
leaq 0x44f8(%rip), %rsi      # 0xc5b8
movb $0x0, %al
callq 0x5fa0
leaq -0x40(%rbp), %rax
movq -0x18(%rbp), %rdi
callq 0x41b0
addq $0x5, %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xa800
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rdx
leaq 0x46d8(%rip), %rsi      # 0xc7d4
callq 0x9e00
cmpq -0x20(%rbp), %rax
jb 0x811a
movl $0x4b, %edi
leaq 0x44c2(%rip), %rsi      # 0xc5d5
movb $0x0, %al
callq 0x5fa0
callq 0x4050
movl $0x0, (%rax)
movl 0x837d(%rip), %eax      # 0x104a8
movl %eax, -0xfc(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x18(%rbp), %rdi
callq 0x41b0
movl -0xfc(%rbp), %edi
movq -0xf8(%rbp), %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x41f0
cmpq $-0x1, %rax
jne 0x8166
movb $0x0, -0x9(%rbp)
testb $0x1, -0x9(%rbp)
jne 0x8181
callq 0x4050
movl (%rax), %edi
leaq 0x4473(%rip), %rsi      # 0xc5ed
movb $0x0, %al
callq 0x6300
movq -0x18(%rbp), %rdi
callq 0x4510
movzbl -0x9(%rbp), %eax
andl $0x1, %eax
decl %eax
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network.c
// Function: net_addr_resolve
static struct addrinfo *
net_addr_resolve(const char *host, const char *port)
{
	struct addrinfo		*res;
	struct addrinfo		 hints = { 0 };

	if (host == NULL || port == NULL)
		return NULL;

	hints.ai_flags     = AI_CANONNAME;
	hints.ai_family    = AF_UNSPEC;
	hints.ai_socktype  = SOCK_STREAM;
	hints.ai_protocol  = 0;
	hints.ai_addrlen   = 0;
	hints.ai_addr      = NULL;
	hints.ai_canonname = NULL;
	hints.ai_next      = NULL;

	if (getaddrinfo(host, port, &hints, &res) != 0)
		return NULL;
	return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x4210
cmpq $0x0, -0x10(%rbp)
je 0x857e
cmpq $0x0, -0x18(%rbp)
jne 0x8588
movq $0x0, -0x8(%rbp)
jmp 0x85ef
movl $0x2, -0x50(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x1, -0x48(%rbp)
movl $0x0, -0x44(%rbp)
movl $0x0, -0x40(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x50(%rbp), %rdx
leaq -0x20(%rbp), %rcx
callq 0x4560
cmpl $0x0, %eax
je 0x85e7
movq $0x0, -0x8(%rbp)
jmp 0x85ef
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network.c
// Function: net_disconnect
void
net_disconnect(void)
{
	if (ssl_is_enabled())
		net_ssl_end();
	if (g_socket != -1) {
		(void) close(g_socket);
		g_socket = -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x8600
testb $0x1, %al
jne 0x863f
jmp 0x8644
callq 0x7bc0
cmpl $-0x1, 0x7e5d(%rip)     # 0x104a8
je 0x8662
movl 0x7e55(%rip), %edi      # 0x104a8
callq 0x47e0
movl $0xffffffff, 0x7e46(%rip) # imm = 0xFFFFFFFF
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/network.c
// Function: net_deinit
void
net_deinit(void)
{
	if (ssl_is_enabled())
		net_ssl_deinit();
	if (g_socket != -1) {
		(void) close(g_socket);
		g_socket = -1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
callq 0x8600
testb $0x1, %al
jne 0x8a9f
jmp 0x8aa4
callq 0x7fb0
cmpl $-0x1, 0x79fd(%rip)     # 0x104a8
je 0x8ac2
movl 0x79f5(%rip), %edi      # 0x104a8
callq 0x47e0
movl $0xffffffff, 0x79e6(%rip) # imm = 0xFFFFFFFF
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: setting_bool
bool
setting_bool(const char *setting_name, const bool fallback_val)
{
	if (setting_name == NULL)
		return fallback_val;
	FOREACH_CDV() {
		if (strings_match(setting_name, cdv->setting_name)) {
			const char *value =
			    (cdv->custom_val ? cdv->custom_val : cdv->value);

			if (cdv->type != TYPE_BOOLEAN) {
				log_warn(0, "setting_bool: %s: "
				    "setting not a boolean!", setting_name);
				break;
			} else if (strings_match(value, "yes") ||
				   strings_match(value, "YES")) {
				return true;
			} else if (strings_match(value, "no") ||
				   strings_match(value, "NO")) {
				return false;
			} else {
				log_warn(0, "setting_bool: %s: "
				    "setting has an invalid value!",
				    setting_name);
				break;
			}
		}
	}
	return fallback_val;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8af8
movb -0x11(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x8c14
leaq 0x79b1(%rip), %rax      # 0x104b0
movq %rax, -0x20(%rbp)
leaq 0x79a6(%rip), %rax      # 0x104b0
addq $0x190, %rax            # imm = 0x190
cmpq %rax, -0x20(%rbp)
jae 0x8c0c
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x8c20
testb $0x1, %al
jne 0x8b33
jmp 0x8bf9
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8b4c
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x8b58
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x8b83
movq -0x10(%rbp), %rdx
xorl %edi, %edi
leaq 0x3c62(%rip), %rsi      # 0xc7d9
movb $0x0, %al
callq 0x6300
jmp 0x8c0c
movq -0x28(%rbp), %rdi
leaq 0x3c74(%rip), %rsi      # 0xc802
callq 0x8c20
testb $0x1, %al
jne 0x8bad
movq -0x28(%rbp), %rdi
leaq 0x3c64(%rip), %rsi      # 0xc806
callq 0x8c20
testb $0x1, %al
jne 0x8bad
jmp 0x8bb3
movb $0x1, -0x1(%rbp)
jmp 0x8c14
movq -0x28(%rbp), %rdi
leaq 0x3c4c(%rip), %rsi      # 0xc80a
callq 0x8c20
testb $0x1, %al
jne 0x8bdd
movq -0x28(%rbp), %rdi
leaq 0x4013(%rip), %rsi      # 0xcbe5
callq 0x8c20
testb $0x1, %al
jne 0x8bdd
jmp 0x8be3
movb $0x0, -0x1(%rbp)
jmp 0x8c14
movq -0x10(%rbp), %rdx
xorl %edi, %edi
leaq 0x3c1d(%rip), %rsi      # 0xc80d
movb $0x0, %al
callq 0x6300
jmp 0x8c0c
jmp 0x8bfb
movq -0x20(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x20(%rbp)
jmp 0x8b03
movb -0x11(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: is_setting_ok
static bool
is_setting_ok(const char *value, enum setting_type type)
{
	if (value == NULL)
		return false;

	switch (type) {
	case TYPE_BOOLEAN: {
		if (!strings_match(value, "yes") &&
		    !strings_match(value, "YES") &&
		    !strings_match(value, "no") &&
		    !strings_match(value, "NO")) {
			log_warn(0, "%s is_setting_ok: "
			    "booleans must be either: yes, YES, no or NO",
			    GfxFailure);
			return false;
		}
		break;
	}
	case TYPE_INTEGER: {
		if (!is_numeric(value)) {
			log_warn(0, "%s is_setting_ok: integer not all numeric",
			    GfxFailure);
			return false;
		}
		break;
	}
	case TYPE_STRING: {
		if (strpbrk(value, " \f\n\r\t\v\"") != NULL) {
			log_warn(0, "%s is_setting_ok: "
			    "illegal characters in string", GfxFailure);
			return false;
		}
		break;
	}
	default:
		fatal(0, "is_setting_ok: statement reached unexpectedly");
		break;
	}

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8f3f
movb $0x0, -0x1(%rbp)
jmp 0x904e
movl -0x14(%rbp), %eax
movl %eax, -0x18(%rbp)
testl %eax, %eax
je 0x8f6a
jmp 0x8f4b
movl -0x18(%rbp), %eax
subl $0x1, %eax
je 0x8fd9
jmp 0x8f59
movl -0x18(%rbp), %eax
subl $0x2, %eax
je 0x9005
jmp 0x903a
movq -0x10(%rbp), %rdi
leaq 0x388d(%rip), %rsi      # 0xc802
callq 0x8c20
testb $0x1, %al
jne 0x8fd7
movq -0x10(%rbp), %rdi
leaq 0x387d(%rip), %rsi      # 0xc806
callq 0x8c20
testb $0x1, %al
jne 0x8fd7
movq -0x10(%rbp), %rdi
leaq 0x386d(%rip), %rsi      # 0xc80a
callq 0x8c20
testb $0x1, %al
jne 0x8fd7
movq -0x10(%rbp), %rdi
leaq 0x3c34(%rip), %rsi      # 0xcbe5
callq 0x8c20
testb $0x1, %al
jne 0x8fd7
xorl %edi, %edi
leaq 0x3be7(%rip), %rsi      # 0xcbaa
leaq 0x3ce6(%rip), %rdx      # 0xccb0
movb $0x0, %al
callq 0x6300
movb $0x0, -0x1(%rbp)
jmp 0x904e
jmp 0x904a
movq -0x10(%rbp), %rdi
callq 0xa130
testb $0x1, %al
jne 0x9003
xorl %edi, %edi
leaq 0x3bf9(%rip), %rsi      # 0xcbe8
leaq 0x3cba(%rip), %rdx      # 0xccb0
movb $0x0, %al
callq 0x6300
movb $0x0, -0x1(%rbp)
jmp 0x904e
jmp 0x904a
movq -0x10(%rbp), %rdi
leaq 0x3c02(%rip), %rsi      # 0xcc12
callq 0x4760
cmpq $0x0, %rax
je 0x9038
xorl %edi, %edi
leaq 0x3bf6(%rip), %rsi      # 0xcc1a
leaq 0x3c85(%rip), %rdx      # 0xccb0
movb $0x0, %al
callq 0x6300
movb $0x0, -0x1(%rbp)
jmp 0x904e
jmp 0x904a
xorl %edi, %edi
leaq 0x3c06(%rip), %rsi      # 0xcc49
movb $0x0, %al
callq 0x5fa0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: setting
const char *
setting(const char *setting_name)
{
	if (setting_name == NULL) {
		return ("");
	}

	FOREACH_CDV() {
		if (strings_match(setting_name, cdv->setting_name))
			return (cdv->custom_val ? cdv->custom_val : cdv->value);
	}

	return ("");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x9080
leaq 0x2fb1(%rip), %rax      # 0xc02b
movq %rax, -0x8(%rbp)
jmp 0x90fe
leaq 0x7429(%rip), %rax      # 0x104b0
movq %rax, -0x18(%rbp)
leaq 0x741e(%rip), %rax      # 0x104b0
addq $0x190, %rax            # imm = 0x190
cmpq %rax, -0x18(%rbp)
jae 0x90f3
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
callq 0x8c20
testb $0x1, %al
jne 0x90b4
jmp 0x90e3
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x90cd
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x90d9
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x90fe
jmp 0x90e5
movq -0x18(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x18(%rbp)
jmp 0x908b
leaq 0x2f31(%rip), %rax      # 0xc02b
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: setting_integer
long int
setting_integer(const struct integer_context *ctx)
{
	long int val = 0;

	log_assert_arg_nonnull("setting_integer", "ctx", ctx);

	FOREACH_CDV() {
		if (strings_match(ctx->setting_name, cdv->setting_name)) {
			const char *str =
			    (cdv->custom_val ? cdv->custom_val : cdv->value);
			errno = 0;
			val = strtol(str, NULL, 10);

			if (errno != 0 ||
			    (val < ctx->lo_limit || val > ctx->hi_limit)) {
				log_warn(ERANGE, "warning: setting %s "
				    "out of range %ld-%ld: "
				    "fallback value is %ld", ctx->setting_name,
				    ctx->lo_limit, ctx->hi_limit,
				    ctx->fallback_val);
				break;
			} else {
				return val;
			}
		}
	}

	return (ctx->fallback_val);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdx
leaq 0x3783(%rip), %rdi      # 0xc8b2
leaq 0x378c(%rip), %rsi      # 0xc8c2
callq 0x8ea0
leaq 0x736e(%rip), %rax      # 0x104b0
movq %rax, -0x20(%rbp)
leaq 0x7363(%rip), %rax      # 0x104b0
addq $0x190, %rax            # imm = 0x190
cmpq %rax, -0x20(%rbp)
jae 0x923e
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq (%rax), %rsi
callq 0x8c20
testb $0x1, %al
jne 0x9179
jmp 0x922b
movq -0x20(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x9192
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x919e
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x28(%rbp)
callq 0x4050
movl $0x0, (%rax)
movq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x4620
movq %rax, -0x18(%rbp)
callq 0x4050
cmpl $0x0, (%rax)
jne 0x91ed
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jl 0x91ed
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jle 0x9221
movq -0x10(%rbp), %rax
movq (%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %r8
movq -0x10(%rbp), %rax
movq 0x18(%rax), %r9
movl $0x22, %edi
leaq 0x36ae(%rip), %rsi      # 0xc8c6
movb $0x0, %al
callq 0x6300
jmp 0x923e
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x924a
jmp 0x922d
movq -0x20(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x20(%rbp)
jmp 0x9146
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: is_ip_addr_ok
static bool
is_ip_addr_ok(const char **reason)
{
	const char	*ip = setting("ip_addr");
	unsigned char	 buf[sizeof(struct in_addr)];

	if (strings_match(ip, "")) {
		*reason = "empty setting";
		return false;
	} else if (strings_match(ip, "WAN_address")) {
		*reason = "";
		return true;
	} else if (inet_pton(AF_INET, ip, buf) == 0) {
		*reason = "bogus ipv4 address";
		return false;
	}

	*reason = "";
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq 0x27be(%rip), %rdi      # 0xbbd1
callq 0x9060
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x2c04(%rip), %rsi      # 0xc02b
callq 0x8c20
testb $0x1, %al
jne 0x9432
jmp 0x9446
movq -0x10(%rbp), %rax
leaq 0x383a(%rip), %rcx      # 0xcc77
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x94b1
movq -0x18(%rbp), %rdi
leaq 0x2a83(%rip), %rsi      # 0xbed4
callq 0x8c20
testb $0x1, %al
jne 0x945c
jmp 0x9470
movq -0x10(%rbp), %rax
leaq 0x2bc4(%rip), %rcx      # 0xc02b
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x94b1
movq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
movl $0x2, %edi
callq 0x47c0
cmpl $0x0, %eax
jne 0x949b
movq -0x10(%rbp), %rax
leaq 0x32e8(%rip), %rcx      # 0xc77a
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x94b1
jmp 0x949d
jmp 0x949f
movq -0x10(%rbp), %rax
leaq 0x2b81(%rip), %rcx      # 0xc02b
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: is_hostname_ok
static bool
is_hostname_ok(const char *host, const char **reason)
{
	const char host_chars[] =
	    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
	    "abcdefghijklmnopqrstuvwxyz"
	    "0123456789-.:";
	const size_t host_maxlen = 255;

	if (strings_match(host, "")) {
		*reason = "empty setting";
		return false;
	} else if (strlen(host) > host_maxlen) {
		*reason = "name too long";
		return false;
	} else {
		for (const char *cp = host; *cp; cp++) {
			if (strchr(host_chars, *cp) == NULL) {
				*reason = "invalid chars found!";
				return false;
			}
		}
	}

	*reason = "";
	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x60(%rbp), %rdi
leaq 0x3b95(%rip), %rsi      # 0xd070
movl $0x42, %edx
callq 0x4340
movq $0xff, -0x68(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x2b33(%rip), %rsi      # 0xc02b
callq 0x8c20
testb $0x1, %al
jne 0x9503
jmp 0x951a
movq -0x18(%rbp), %rax
leaq 0x3769(%rip), %rcx      # 0xcc77
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x95a0
movq -0x10(%rbp), %rdi
callq 0x41b0
cmpq $0xff, %rax
jbe 0x953f
movq -0x18(%rbp), %rax
leaq 0x374f(%rip), %rcx      # 0xcc85
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x95a0
movq -0x10(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
cmpb $0x0, (%rax)
je 0x958a
leaq -0x60(%rbp), %rdi
movq -0x70(%rbp), %rax
movsbl (%rax), %esi
callq 0x4170
cmpq $0x0, %rax
jne 0x957a
movq -0x18(%rbp), %rax
leaq 0x3722(%rip), %rcx      # 0xcc93
movq %rcx, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x95a0
jmp 0x957c
movq -0x70(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x70(%rbp)
jmp 0x9547
jmp 0x958c
jmp 0x958e
movq -0x18(%rbp), %rax
leaq 0x2a92(%rip), %rcx      # 0xc02b
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: is_port_ok
static bool
is_port_ok(void)
{
	const char *port = setting("port");

	if (strings_match(port, "80"))
		return true;
	else if (strings_match(port, "443"))
		return true;
	else if (strings_match(port, "8245"))
		return true;
	return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x2edd(%rip), %rdi      # 0xc49c
callq 0x9060
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x30d9(%rip), %rsi      # 0xc6ac
callq 0x8c20
testb $0x1, %al
jne 0x95de
jmp 0x95e4
movb $0x1, -0x1(%rbp)
jmp 0x9624
movq -0x10(%rbp), %rdi
leaq 0x31e1(%rip), %rsi      # 0xc7d0
callq 0x8c20
testb $0x1, %al
jne 0x95fa
jmp 0x9600
movb $0x1, -0x1(%rbp)
jmp 0x9624
movq -0x10(%rbp), %rdi
leaq 0x369d(%rip), %rsi      # 0xcca8
callq 0x8c20
testb $0x1, %al
jne 0x9616
jmp 0x961c
movb $0x1, -0x1(%rbp)
jmp 0x9624
jmp 0x961e
jmp 0x9620
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: create_config_file
void
create_config_file(const char *path)
{
	const mode_t	 mode = (S_IRUSR | S_IWUSR);
	int		 fd;

	log_assert_arg_nonnull("create_config_file", "path", path);

	if (file_exists(path)) {
		fatal(EEXIST, "%s %s: can't create config file  --  "
		    "it's already existent", GfxFailure, __func__);
	} else if ((fd = creat(path, mode)) < 0) {
		fatal(errno, "%s %s: creat", GfxFailure, __func__);
	}

	FOREACH_CDV() {
		char	*ans = NULL;
		int	 ret = -1;

		while ((ans = get_answer(cdv->description, cdv->type,
		    cdv->value)) == NULL)
			/* continue */;
		ret = dprintf(fd, "%s = \"%s\";\n", cdv->setting_name, ans);
		if (ret < 0) {
			fatal(0, "%s %s: failed to write to the file stream",
			    GfxFailure, __func__);
		}
		free(ans);
	}

	if (!(fd < 0) && close(fd) != 0)
		fatal(errno, "%s %s: close", GfxFailure, __func__);
	printf("%s %s successfully written!\n", GfxSuccess, path);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x180, -0xc(%rbp)      # imm = 0x180
movq -0x8(%rbp), %rdx
leaq 0x33c4(%rip), %rdi      # 0xca12
leaq 0x33d0(%rip), %rsi      # 0xca25
callq 0x8ea0
movq -0x8(%rbp), %rdi
callq 0xa020
testb $0x1, %al
jne 0x9669
jmp 0x968a
movl $0x11, %edi
leaq 0x33b5(%rip), %rsi      # 0xca2a
leaq 0x3634(%rip), %rdx      # 0xccb0
leaq 0x338f(%rip), %rcx      # 0xca12
movb $0x0, %al
callq 0x5fa0
movq -0x8(%rbp), %rdi
movl $0x180, %esi            # imm = 0x180
callq 0x42c0
movl %eax, -0x10(%rbp)
cmpl $0x0, %eax
jge 0x96c3
callq 0x4050
movl (%rax), %edi
leaq 0x33b7(%rip), %rsi      # 0xca65
leaq 0x35fb(%rip), %rdx      # 0xccb0
leaq 0x3356(%rip), %rcx      # 0xca12
movb $0x0, %al
callq 0x5fa0
jmp 0x96c5
leaq 0x6de4(%rip), %rax      # 0x104b0
movq %rax, -0x18(%rbp)
leaq 0x6dd9(%rip), %rax      # 0x104b0
addq $0x190, %rax            # imm = 0x190
cmpq %rax, -0x18(%rbp)
jae 0x977b
movq $0x0, -0x20(%rbp)
movl $0xffffffff, -0x24(%rbp) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdx
callq 0x8c50
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x971e
jmp 0x96f6
movl -0x10(%rbp), %edi
movq -0x18(%rbp), %rax
movq (%rax), %rdx
movq -0x20(%rbp), %rcx
leaq 0x333f(%rip), %rsi      # 0xca72
movb $0x0, %al
callq 0x4230
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
jge 0x9761
xorl %edi, %edi
leaq 0x3332(%rip), %rsi      # 0xca7e
leaq 0x355d(%rip), %rdx      # 0xccb0
leaq 0x32b8(%rip), %rcx      # 0xca12
movb $0x0, %al
callq 0x5fa0
movq -0x20(%rbp), %rdi
callq 0x4510
movq -0x18(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x18(%rbp)
jmp 0x96d0
cmpl $0x0, -0x10(%rbp)
jl 0x97b1
movl -0x10(%rbp), %edi
callq 0x47e0
cmpl $0x0, %eax
je 0x97b1
callq 0x4050
movl (%rax), %edi
leaq 0x330c(%rip), %rsi      # 0xcaa8
leaq 0x350d(%rip), %rdx      # 0xccb0
leaq 0x3268(%rip), %rcx      # 0xca12
movb $0x0, %al
callq 0x5fa0
movq -0x8(%rbp), %rdx
leaq 0x32f9(%rip), %rdi      # 0xcab5
leaq 0x34fc(%rip), %rsi      # 0xccbf
movb $0x0, %al
callq 0x4060
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/uhlin[P]enhanced-duc/source/settings.c
// Function: destroy_config_custom_values
void
destroy_config_custom_values(void)
{
	FOREACH_CDV() {
		if (cdv->custom_val) {
			free(cdv->custom_val);
			cdv->custom_val = NULL;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x6cd1(%rip), %rax      # 0x104b0
movq %rax, -0x8(%rbp)
leaq 0x6cc6(%rip), %rax      # 0x104b0
addq $0x190, %rax            # imm = 0x190
cmpq %rax, -0x8(%rbp)
jae 0x982a
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x981a
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x4510
movq -0x8(%rbp), %rax
movq $0x0, 0x18(%rax)
jmp 0x981c
movq -0x8(%rbp), %rax
addq $0x28, %rax
movq %rax, -0x8(%rbp)
jmp 0x97e3
addq $0x10, %rsp
popq %rbp
retq