LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/sat/picosat961/picosat-961/picomcs.c
// Function: dump
void dump (void) {
  Clause * p;
  printf ("p cnf %d %d\n", nvars, nclauses);
  for (p = first_clause; p; p = p->next)
    dump_clause (p);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x14e06(%rip), %esi     # 0x16130
movl 0x14e04(%rip), %edx     # 0x16134
leaq 0xdccd(%rip), %rdi      # 0xf004
xorl %eax, %eax
callq 0x10d0
leaq 0x14df3(%rip), %r15     # 0x16138
leaq 0xf302(%rip), %rbx      # 0x1064e
leaq 0xdd55(%rip), %r14      # 0xf0a8
movq (%r15), %r15
testq %r15, %r15
je 0x1385
movq 0x8(%r15), %r12
movl (%r12), %esi
testl %esi, %esi
je 0x1377
movq %r14, %rdi
xorl %eax, %eax
callq 0x10d0
addq $0x4, %r12
jmp 0x135f
movq %rbx, %rdi
callq 0x1090
addq $0x10, %r15
jmp 0x1353
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/sat/picosat961/picosat-961/picomcs.c
// Function: msg
static void msg (int level, const char * fmt, ...) {
  va_list ap;
  if (level > verbose) return;
  printf ("c [picomcs] ");
  va_start (ap, fmt);
  vprintf (fmt, ap);
  va_end (ap);
  fputc ('\n', stdout);
  fflush (stdout);
}

// Assembly:
pushq %rbx
subq $0xd0, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x1d75
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
cmpl %edi, 0x143c5(%rip)     # 0x16140
jl 0x1dd5
movq %rsi, %rbx
leaq 0xd45e(%rip), %rdi      # 0xf1e5
xorl %eax, %eax
callq 0x10d0
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rsp, %rsi
movq %rax, (%rsi)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rsi)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rsi)
movq %rbx, %rdi
callq 0x1180
movq 0x1420e(%rip), %rbx     # 0x15fd0
movq (%rbx), %rsi
pushq $0xa
popq %rdi
callq 0x1110
movq (%rbx), %rdi
callq 0x1160
addq $0xd0, %rsp
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/biotomas[P]ipasir/sat/picosat961/picosat-961/picomcs.c
// Function: cumcscb
static void cumcscb (void * state, int nmcs, int nhumus) {
  int * ptr = state;
  *ptr = nmcs;
  ptr[0] = nmcs, ptr[1] = nhumus;
  if (!verbose || (!isatty (1) && verbose == 1)) return;
  if (verbose == 1) fputc ('\r', stdout);
  printf ("c [picomcs] mcs %d humus %d", nmcs, nhumus);
  if (verbose >= 2) fputc ('\n', stdout);
  fflush (stdout);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
cmpl $0x0, 0x142a4(%rip)     # 0x16140
je 0x1eb9
movl %edx, %ebx
movl %esi, %ebp
pushq $0x1
popq %rdi
callq 0x10a0
movl 0x14290(%rip), %ecx     # 0x16140
movl %ecx, %edx
xorl $0x1, %edx
orl %eax, %edx
jne 0x1ec0
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
cmpl $0x1, %ecx
jne 0x1ed7
movq 0x14104(%rip), %rax     # 0x15fd0
movq (%rax), %rsi
pushq $0xd
popq %rdi
callq 0x1110
leaq 0xd40c(%rip), %rdi      # 0xf2ea
movl %ebp, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x10d0
cmpl $0x2, 0x14250(%rip)     # 0x16140
jl 0x1f04
movq 0x140d7(%rip), %rax     # 0x15fd0
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x1110
movq 0x140c5(%rip), %rax     # 0x15fd0
movq (%rax), %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x1160
nopl (%rax)
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/httpd.cpp
// Function: get_line(int, char*, int)
int get_line(int sock, char *buf, int size)
{
	int i = 0;
	char c = '\0';
	int n;

	while ((i < size - 1) && (c != '\n'))
	{
		n = recv(sock, &c, 1, 0);
  /* DEBUG printf("%02X\n", c); */
		if (n > 0)
		{
			if (c == '\r')
			{
				n = recv(sock, &c, 1, MSG_PEEK);
    /* DEBUG printf("%02X\n", c); */
				if ((n > 0) && (c == '\n'))
					recv(sock, &c, 1, 0);
				else
					c = '\n';
			}
			buf[i] = c;
			i++;
		}
		else
			c = '\n';
	}
	buf[i] = '\0';

	return(i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %r14d
movq %rsi, -0x38(%rbp)
movl %edi, %r15d
leaq -0x29(%rbp), %rax
movb $0x0, (%rax)
decl %r14d
xorl %eax, %eax
pushq $0x1
popq %rbx
xorl %r13d, %r13d
cmpb $0xa, %al
setne %al
movl %r13d, %r12d
cmpl %r14d, %r13d
jge 0x3a03
testb $0x1, %al
je 0x3a03
movl %r15d, %edi
leaq -0x29(%rbp), %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x30f0
testl %eax, %eax
jg 0x39b7
movb $0xa, -0x29(%rbp)
xorl %eax, %eax
jmp 0x398e
movb -0x29(%rbp), %al
cmpb $0xd, %al
jne 0x39f6
movl %r15d, %edi
leaq -0x29(%rbp), %rsi
movq %rbx, %rdx
pushq $0x2
popq %rcx
callq 0x30f0
testl %eax, %eax
jle 0x39f0
cmpb $0xa, -0x29(%rbp)
jne 0x39f0
movl %r15d, %edi
leaq -0x29(%rbp), %rsi
movq %rbx, %rdx
xorl %ecx, %ecx
callq 0x30f0
movb -0x29(%rbp), %al
jmp 0x39f6
movb $0xa, -0x29(%rbp)
movb $0xa, %al
movq -0x38(%rbp), %rcx
movb %al, (%rcx,%r12)
incl %r13d
jmp 0x3989
movq -0x38(%rbp), %rax
movb $0x0, (%rax,%r12)
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/httpd.cpp
// Function: unimplemented(int)
void unimplemented(int client)
{
	char buf[1024];
//发送501说明相应方法没有实现
	sprintf(buf, "HTTP/1.0 501 Method Not Implemented\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, SERVER_STRING);
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "Content-Type: text/html\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "<HTML><HEAD><TITLE>Method Not Implemented\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "</TITLE></HEAD>\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "<BODY><P>HTTP request method not supported.\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "</BODY></HTML>\r\n");
	send(client, buf, strlen(buf), 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movl %edi, %ebx
movups 0x3846(%rip), %xmm0     # 0x727d
leaq -0x420(%rbp), %r14
movaps %xmm0, 0x10(%r14)
movups 0x3823(%rip), %xmm0     # 0x726d
movaps %xmm0, (%r14)
movabsq $0xa0d6465746e65, %rax  # imm = 0xA0D6465746E65
movq %rax, 0x1e(%r14)
movq %r14, %rdi
callq 0x3150
xorl %r15d, %r15d
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movups 0x36da(%rip), %xmm0     # 0x7157
movaps %xmm0, (%r14)
movups 0x36d8(%rip), %xmm0     # 0x7160
movups %xmm0, 0x9(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movups 0x36c5(%rip), %xmm0     # 0x7170
movaps %xmm0, (%r14)
movups 0x36c4(%rip), %xmm0     # 0x717a
movups %xmm0, 0xa(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movb %r15b, 0x2(%r14)
movw $0xa0d, (%r14)          # imm = 0xA0D
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movups 0x3799(%rip), %xmm0     # 0x7293
movaps %xmm0, (%r14)
movups 0x379e(%rip), %xmm0     # 0x72a3
movaps %xmm0, 0x10(%r14)
movups 0x379e(%rip), %xmm0     # 0x72af
movups %xmm0, 0x1c(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movups 0x378b(%rip), %xmm0     # 0x72bf
movaps %xmm0, (%r14)
movw $0xa, 0x10(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movups 0x3774(%rip), %xmm0     # 0x72d1
movaps %xmm0, (%r14)
movups 0x3779(%rip), %xmm0     # 0x72e1
movaps %xmm0, 0x10(%r14)
movups 0x377b(%rip), %xmm0     # 0x72ef
movups %xmm0, 0x1e(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movb %r15b, 0x10(%r14)
movups 0x36a0(%rip), %xmm0     # 0x723b
movaps %xmm0, (%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/httpd.cpp
// Function: serve_file(int, char const*)
void serve_file(int client, const char *filename)
{
	FILE *resource = NULL;
	int numchars = 1;
	char buf[1024];
	buf[0] = 'A'; buf[1] = '\0';//这个赋值不清楚是干什么的
	while ((numchars > 0) && strcmp("\n", buf)) //将HTTP请求头读取并丢弃
		numchars = get_line(client, buf, sizeof(buf));
//打开文件
	resource = fopen(filename, "r");
	if (resource == NULL)
 //如果文件不存在，则返回not_found
		not_found(client);
	else
	{
 //添加HTTP头
		headers(client, filename);
 //并发送文件内容
		cat(client, resource);
	}
	fclose(resource);//关闭文件句柄
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x408, %rsp            # imm = 0x408
movq %rsi, %r14
movl %edi, %ebx
leaq -0x420(%rbp), %r15
movw $0x41, (%r15)
pushq $0x1
popq %rax
testl %eax, %eax
jle 0x3ddd
cmpw $0xa, -0x420(%rbp)
je 0x3ddd
movl %ebx, %edi
movq %r15, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x395c
jmp 0x3dbe
leaq 0x3468(%rip), %rsi      # 0x724c
movq %r14, %rdi
callq 0x33b0
movq %rax, %r14
testq %rax, %rax
je 0x3e07
movl %ebx, %edi
callq 0x435f
movl %ebx, %edi
movq %r14, %rsi
callq 0x4202
jmp 0x3e0e
movl %ebx, %edi
callq 0x3bc4
movq %r14, %rdi
addq $0x408, %rsp            # imm = 0x408
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3340
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/httpd.cpp
// Function: bad_request(int)
void bad_request(int client)
{
	char buf[1024];
//发送400
	sprintf(buf, "HTTP/1.0 400 BAD REQUEST\r\n");
	send(client, buf, sizeof(buf), 0);
	sprintf(buf, "Content-type: text/html\r\n");
	send(client, buf, sizeof(buf), 0);
	sprintf(buf, "\r\n");
	send(client, buf, sizeof(buf), 0);
	sprintf(buf, "<P>Your browser sent a bad request, ");
	send(client, buf, sizeof(buf), 0);
	sprintf(buf, "such as a POST without a Content-Length.\r\n");
	send(client, buf, sizeof(buf), 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movl %edi, %ebx
movups 0x2f1b(%rip), %xmm0     # 0x703d
leaq -0x410(%rbp), %r14
movups %xmm0, 0xb(%r14)
movups 0x2efd(%rip), %xmm0     # 0x7032
movaps %xmm0, (%r14)
movl $0x400, %edx            # imm = 0x400
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x31d0
movups 0x2efe(%rip), %xmm0     # 0x704d
movaps %xmm0, (%r14)
movups 0x2efd(%rip), %xmm0     # 0x7057
movups %xmm0, 0xa(%r14)
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x31d0
movw $0xa0d, (%r14)          # imm = 0xA0D
movb $0x0, 0x2(%r14)
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x31d0
movabsq $0x202c7473657571, %rax # imm = 0x202C7473657571
movq %rax, 0x1d(%r14)
movups 0x2ec6(%rip), %xmm0     # 0x7067
movaps %xmm0, (%r14)
movups 0x2ecb(%rip), %xmm0     # 0x7077
movaps %xmm0, 0x10(%r14)
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x31d0
movups 0x2ec3(%rip), %xmm0     # 0x708c
movaps %xmm0, (%r14)
movups 0x2ec8(%rip), %xmm0     # 0x709c
movaps %xmm0, 0x10(%r14)
movups 0x2ec7(%rip), %xmm0     # 0x70a7
movups %xmm0, 0x1b(%r14)
movl $0x400, %edx            # imm = 0x400
movl %ebx, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x31d0
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/httpd.cpp
// Function: cannot_execute(int)
void cannot_execute(int client)
{
	char buf[1024];
//发送500
	sprintf(buf, "HTTP/1.0 500 Internal Server Error\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "Content-type: text/html\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "\r\n");
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "<P>Error prohibited CGI execution.\r\n");
	send(client, buf, strlen(buf), 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movl %edi, %ebx
movups 0x2e4d(%rip), %xmm0     # 0x70c7
leaq -0x410(%rbp), %r14
movaps %xmm0, 0x10(%r14)
movups 0x2e2a(%rip), %xmm0     # 0x70b7
movaps %xmm0, (%r14)
movabsq $0xa0d726f727245, %rax  # imm = 0xA0D726F727245
movq %rax, 0x1d(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movups 0x2d90(%rip), %xmm0     # 0x704d
movaps %xmm0, (%r14)
movups 0x2d8f(%rip), %xmm0     # 0x7057
movups %xmm0, 0xa(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movw $0xa0d, (%r14)          # imm = 0xA0D
movb $0x0, 0x2(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movabsq $0xa0d2e6e6f6974, %rax  # imm = 0xA0D2E6E6F6974
movq %rax, 0x1d(%r14)
movups 0x2dc1(%rip), %xmm0     # 0x70dc
movaps %xmm0, (%r14)
movups 0x2dc6(%rip), %xmm0     # 0x70ec
movaps %xmm0, 0x10(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/httpd.cpp
// Function: headers(int, char const*)
void headers(int client, const char *filename)
{
	char buf[1024];
	(void)filename;  /* could use filename to determine file type */
//发送HTTP头
	strcpy(buf, "HTTP/1.0 200 OK\r\n");
	send(client, buf, strlen(buf), 0);
	strcpy(buf, SERVER_STRING);
	send(client, buf, strlen(buf), 0);
	sprintf(buf, "Content-Type: text/html\r\n");
	send(client, buf, strlen(buf), 0);
	strcpy(buf, "\r\n");
	send(client, buf, strlen(buf), 0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x400, %rsp            # imm = 0x400
movl %edi, %ebx
movups 0x2d9b(%rip), %xmm0     # 0x7111
leaq -0x410(%rbp), %r14
movaps %xmm0, (%r14)
movw $0xa, 0x10(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movups 0x2db1(%rip), %xmm0     # 0x7157
movaps %xmm0, (%r14)
movups 0x2daf(%rip), %xmm0     # 0x7160
movups %xmm0, 0x9(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movups 0x2d9c(%rip), %xmm0     # 0x7170
movaps %xmm0, (%r14)
movups 0x2d9b(%rip), %xmm0     # 0x717a
movups %xmm0, 0xa(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
movw $0xa0d, (%r14)          # imm = 0xA0D
movb $0x0, 0x2(%r14)
movq %r14, %rdi
callq 0x3150
movl %ebx, %edi
movq %r14, %rsi
movq %rax, %rdx
xorl %ecx, %ecx
callq 0x31d0
addq $0x400, %rsp            # imm = 0x400
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/httpd.cpp
// Function: startup(unsigned short*)
int startup(u_short *port)
{

//服务器处理步骤
/*
第一步：创建端口号，使用函数int socketid = socket(family, type, protocol);;
第二步：将地址结构体绑定在端口号上，使用函数int bind(int fd, const struct sockaddr *, socklen_t);
第三步：循环监听客户端请求，使用函数listen(sockfd, 5);（第一个参数是 socket 描述符，第二个参数是最大连接数）

第四步：接受客户端的请求，new_socket = accept(socket_desc, (struct sockaddr *)&client, (socklen_t*)&c);
第五步：使用read()/write()进行数据交换
第六步：关闭连接，使用close(socketid);
*/


//客户端处理步骤
/*
第一步：创建端口号，使用函数int socketid = socket(family, type, protocol);
第二步：将地址结构体绑定在端口号上，使用函数int bind(int fd, const struct sockaddr *, socklen_t);
第三步：请求连接，使用函数int connect(int socket, const struct sockaddr* address, size_t address_len)；

第四步：使用read()/write()进行数据交换；
第五步：关闭连接，使用close(socketid);
*/
	int httpd = 0;
	struct sockaddr_in name;
//设置http socket
	httpd = socket(PF_INET, SOCK_STREAM, 0);
	if (httpd == -1)
		error_die("socket");
	memset(&name, 0, sizeof(name));

 //创建地址结构体struct sockaddr_in，主要包含地址和端口号
	name.sin_family = AF_INET;
	name.sin_port = htons(*port);
	name.sin_addr.s_addr = htonl(INADDR_ANY);


 //绑定端口
	if (bind(httpd, (struct sockaddr *)&name, sizeof(name)) < 0)
		error_die("bind");
	if (*port == 0)  /*动态分配一个端口 */
	{
		socklen_t  namelen = sizeof(name);
		if (getsockname(httpd, (struct sockaddr *)&name, &namelen) == -1)
			error_die("getsockname");
		*port = ntohs(name.sin_port);
	}
 //监听连接
	if (listen(httpd, 5) < 0)
		error_die("listen");
	return(httpd);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
pushq $0x2
popq %rdi
pushq $0x1
popq %rsi
xorl %edx, %edx
callq 0x3080
cmpl $-0x1, %eax
je 0x44bd
movl %eax, %ebx
leaq -0x24(%rbp), %rsi
andq $0x0, 0x8(%rsi)
movw $0x2, (%rsi)
movzwl (%r14), %eax
rolw $0x8, %ax
movw %ax, 0x2(%rsi)
andl $0x0, 0x4(%rsi)
pushq $0x10
popq %rdx
movl %ebx, %edi
callq 0x3050
testl %eax, %eax
js 0x44c9
cmpw $0x0, (%r14)
jne 0x44a4
leaq -0x14(%rbp), %rdx
movl $0x10, (%rdx)
leaq -0x24(%rbp), %rsi
movl %ebx, %edi
callq 0x3300
cmpl $-0x1, %eax
je 0x44e1
movzwl -0x22(%rbp), %eax
rolw $0x8, %ax
movw %ax, (%r14)
pushq $0x5
popq %rsi
movl %ebx, %edi
callq 0x33a0
testl %eax, %eax
js 0x44d5
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x2d8a(%rip), %rdi      # 0x724e
callq 0x434e
leaq 0x2d85(%rip), %rdi      # 0x7255
callq 0x434e
leaq 0x2d8a(%rip), %rdi      # 0x7266
callq 0x434e
leaq 0x2d72(%rip), %rdi      # 0x725a
callq 0x434e
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/./ThreadPool.h
// Function: ThreadPool::ThreadPool(unsigned long)
inline ThreadPool::ThreadPool(size_t threads)
    :   stop(false)
{
    for(size_t i = 0;i<threads;++i)
        workers.emplace_back(
            [this]
            {
                for(;;)
                {
                    std::function<void()> task;

                    {
                        std::unique_lock<std::mutex> lock(this->queue_mutex);
                        this->condition.wait(lock,
                            [this]{ return this->stop || !this->tasks.empty(); });
                        if(this->stop && this->tasks.empty())
                            return;
                        task = std::move(this->tasks.front());
                        this->tasks.pop();
                    }

                    task();
                }
            }
        );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x18(%rdi), %r14
movq %r14, %rdi
callq 0x4978
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x68(%rbx)
andq $0x0, 0x88(%rbx)
leaq 0x90(%rbx), %r12
movq %r12, %rdi
callq 0x3430
movb $0x0, 0xc0(%rbx)
leaq -0x30(%rbp), %r13
subq $0x1, %r15
jb 0x4775
movq %rbx, -0x30(%rbp)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x4998
jmp 0x475e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
jmp 0x479c
movq %rax, %r15
movq %r12, %rdi
callq 0x3530
movq %r14, %rdi
callq 0x51fe
movq %rbx, %rdi
callq 0x49de
movq %r15, %rdi
callq 0x3520
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/./ThreadPool.h
// Function: std::future<std::result_of<void* (& (void*))(void*)>::type> ThreadPool::enqueue<void* (&)(void*), void*>(void* (&)(void*), void*&&)
auto ThreadPool::enqueue(F&& f, Args&&... args) 
    -> std::future<typename std::result_of<F(Args...)>::type>
{
    using return_type = typename std::result_of<F(Args...)>::type;

    auto task = std::make_shared< std::packaged_task<return_type()> >(
            std::bind(std::forward<F>(f), std::forward<Args>(args)...)
        );
        
    std::future<return_type> res = task->get_future();
    {
        std::unique_lock<std::mutex> lock(queue_mutex);

        // don't allow enqueueing after stopping the pool
        if(stop)
            throw std::runtime_error("enqueue on stopped ThreadPool");

        tasks.emplace([task](){ (*task)(); });
    }
    condition.notify_one();
    return res;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x30(%rbp), %rsi
movq %rdx, (%rsi)
movq (%rcx), %rax
movq %rax, 0x8(%rsi)
leaq -0x40(%rbp), %r15
movq %r15, %rdi
callq 0x5438
movq (%r15), %rsi
movq %rbx, %rdi
callq 0x5458
leaq 0x68(%r14), %rsi
leaq -0x30(%rbp), %rdi
callq 0x4ecc
cmpb $0x1, 0xc0(%r14)
je 0x4872
leaq 0x18(%r14), %r15
leaq -0x50(%rbp), %r12
leaq -0x40(%rbp), %rsi
movq %r12, %rdi
callq 0x694a
movq %r15, %rdi
movq %r12, %rsi
callq 0x64fa
leaq -0x48(%rbp), %rdi
callq 0x53a8
leaq -0x30(%rbp), %rdi
callq 0x4f98
addq $0x90, %r14
movq %r14, %rdi
callq 0x31c0
leaq -0x38(%rbp), %rdi
callq 0x53a8
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x31b0
movq %rax, %r15
leaq 0x2b14(%rip), %rsi      # 0x7398
movq %rax, %rdi
callq 0x3130
movq 0x675d(%rip), %rsi      # 0xaff0
movq 0x670e(%rip), %rdx      # 0xafa8
movq %r15, %rdi
callq 0x3510
movq %rax, %r14
jmp 0x48c0
movq %rax, %r14
movq %r15, %rdi
callq 0x3230
jmp 0x48c0
movq %rax, %r14
leaq -0x48(%rbp), %rdi
callq 0x53a8
leaq -0x30(%rbp), %rdi
callq 0x4f98
jmp 0x48ce
movq %rax, %r14
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x53a8
jmp 0x48df
movq %rax, %r14
leaq -0x38(%rbp), %rdi
callq 0x53a8
movq %r14, %rdi
callq 0x3520
// File: /workspace/github_cpp_makefile_star2_O2/fltflt[P]Tinyhttpd_with_threadpool_epoll/./ThreadPool.h
// Function: ThreadPool::~ThreadPool()
inline ThreadPool::~ThreadPool()
{
    {
        std::unique_lock<std::mutex> lock(queue_mutex);
        stop = true;
    }
    condition.notify_all();
    for(std::thread &worker: workers)
        worker.join();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
leaq 0x68(%rdi), %rsi
leaq -0x30(%rbp), %rdi
callq 0x4ecc
movb $0x1, 0xc0(%rbx)
leaq -0x30(%rbp), %rdi
callq 0x4f98
leaq 0x90(%rbx), %r14
movq %r14, %rdi
callq 0x34f0
movq (%rbx), %r15
movq 0x8(%rbx), %r12
cmpq %r12, %r15
je 0x4948
movq %r15, %rdi
callq 0x3500
addq $0x8, %r15
jmp 0x4935
movq %r14, %rdi
callq 0x3530
leaq 0x18(%rbx), %rdi
callq 0x51fe
movq %rbx, %rdi
callq 0x49de
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4970
movq %rax, %rdi
callq 0x4b91
// File: /workspace/github_cpp_makefile_star2_O2/111116[P]console/example.cpp
// Function: main
int main()
{
	console.log("Here prints a log");
	console.info("Here prints an info.");
	console.warn("Here prints a warning!");
	console.error("Here prints an error!!");
	console.log("multiple variables",1,2,3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x18, %rsp
leaq 0x2dd4(%rip), %rbx      # 0x40d0
leaq 0xd01(%rip), %rsi       # 0x2004
movq %rbx, %rdi
callq 0x14ae
leaq 0xd04(%rip), %rsi       # 0x2016
movq %rbx, %rdi
callq 0x1500
leaq 0xd0a(%rip), %rsi       # 0x202b
movq %rbx, %rdi
callq 0x157c
leaq 0xd12(%rip), %rsi       # 0x2042
movq %rbx, %rdi
callq 0x15f8
leaq -0x14(%rbp), %rdx
movl $0x1, (%rdx)
leaq -0x10(%rbp), %rcx
movl $0x2, (%rcx)
leaq -0xc(%rbp), %r8
movl $0x3, (%r8)
leaq 0xcfb(%rip), %rsi       # 0x2059
movq %rbx, %rdi
callq 0x1674
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./utils.h
// Function: getopt(int, char* const*, char const*, char*&)
char getopt(int argc, char * const argv[], char const *optstr, char *&optarg) {
    static int optind = 1;
    if (optind >= argc || *argv[optind] != '-')
        return -1;
    auto opt = *(argv[optind++] + 1);
    auto p = strchr(optstr, opt);
    if (!p)
        return '?';
    if (p[1] == ':') {
        if (optind >= argc)
            return ':';
        optarg = argv[optind++];
    }
    return opt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movslq 0x5d7a(%rip), %r15      # 0x8198
movb $-0x1, %al
cmpl %edi, %r15d
jge 0x247c
movq %rcx, %rbx
movq %rsi, %r14
movq (%rsi,%r15,8), %rcx
cmpb $0x2d, (%rcx)
jne 0x247c
movl %edi, %ebp
leal 0x1(%r15), %r13d
movl %r13d, 0x5d57(%rip)     # 0x8198
movb 0x1(%rcx), %r12b
movsbl %r12b, %esi
movq %rdx, %rdi
callq 0x20d0
testq %rax, %rax
je 0x247a
cmpb $0x3a, 0x1(%rax)
jne 0x2475
movb $0x3a, %al
cmpl %ebp, %r13d
jge 0x247c
leal 0x2(%r15), %eax
movl %eax, 0x5d2b(%rip)      # 0x8198
movq 0x8(%r14,%r15,8), %rax
movq %rax, (%rbx)
movl %r12d, %eax
jmp 0x247c
movb $0x3f, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./utils.h
// Function: sample_data(array2d<unsigned int>*, array1d<int>*, array2d<unsigned int>*&, array1d<int>*&, int)
void sample_data(array2d<word> *x, array1d<int> *y, array2d<word> *&xs, array1d<int> *&ys, int size) {
    array1d<int> idx{x->rows};
    for (int i = 0; i < idx.columns; ++i)
        idx(i) = i;
    xs = new array2d<word>{size, x->columns};
    ys = new array1d<int>{size};
    for (int i = 0; i < xs->rows; ++i) {
        std::swap(idx(i), idx(i + fastrandrange(x->rows - i)));
        std::copy((*x)(idx(i)), (*x)(idx(i) + 1), (*xs)(i));
        (*ys)(i) = (*y)(idx(i));
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %ebp
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, 0x10(%rsp)
movq %rdi, %r12
movl (%rdi), %esi
movq %rsp, %r13
movq %r13, %rdi
callq 0x322e
xorl %eax, %eax
movq 0x8(%r13), %rcx
movslq (%rsp), %rdx
cmpq %rdx, %rax
jge 0x2b3f
movl %eax, (%rcx,%rax,4)
incq %rax
jmp 0x2b2e
pushq $0x10
popq %rdi
callq 0x21c0
movq %rax, %r13
movl 0x4(%r12), %edx
movq %rax, %rdi
movl %ebp, %esi
callq 0x3210
movq %r13, (%r14)
pushq $0x10
popq %rdi
callq 0x21c0
movq %rax, %r13
movq %rax, %rdi
movl %ebp, %esi
callq 0x322e
movq %r13, (%rbx)
xorl %r13d, %r13d
xorl %ebp, %ebp
movq (%r14), %rax
movslq (%rax), %rax
cmpq %rax, %rbp
jge 0x2c1f
movq 0x8(%rsp), %r15
movl (%r12), %edi
addl %r13d, %edi
callq 0x2c58
addl %ebp, %eax
movq 0x8(%rsp), %rcx
cltq
movl (%r15,%rbp,4), %edx
movl (%rcx,%rax,4), %esi
movl %esi, (%r15,%rbp,4)
movl %edx, (%rcx,%rax,4)
movl (%rcx,%rbp,4), %eax
movl 0x4(%r12), %ecx
leal 0x1(%rax), %edx
imull %ecx, %edx
imull %eax, %ecx
movslq %ecx, %rsi
shlq $0x2, %rsi
movslq %edx, %rdx
shlq $0x2, %rdx
subq %rsi, %rdx
je 0x2bfc
addq 0x8(%r12), %rsi
movq (%r14), %rax
movslq 0x4(%rax), %rcx
movslq %ebp, %rdi
imulq %rcx, %rdi
shlq $0x2, %rdi
addq 0x8(%rax), %rdi
callq 0x22b0
movq 0x8(%rsp), %rax
movl (%rax,%rbp,4), %eax
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
cltq
movl (%rcx,%rax,4), %eax
movq (%rbx), %rcx
movq 0x8(%rcx), %rcx
movl %eax, (%rcx,%rbp,4)
incq %rbp
decl %r13d
jmp 0x2b79
movq %rsp, %rdi
callq 0x32fc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2c38
movq %rax, %rbx
movq %r13, %rdi
callq 0x21b0
jmp 0x2c48
movq %rax, %rbx
movq %rsp, %rdi
callq 0x32fc
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/implementations.cpp
// Function: main
int main(int argc, char * const argv[]) {
#if defined imdb
    int clauses = 3200, threshold = 12, epochs = 35;
    double p = .012, gamma = .0006;
    std::string const experiment = "imdb";
#elif defined connect4
    int clauses = 200, threshold = 12, epochs = 200;
    double p = .037, gamma = .0001;
    std::string const experiment = "con4";
#else // default: mnist
    int clauses = 500, threshold = 25, epochs = 400;
    double p = .085, gamma = .0025;
    std::string const experiment = "mnist";
#endif

    bool shuffle = false, resume = false, write = false;
    update(argc, argv, clauses, p, threshold, gamma, epochs, shuffle, write, resume);
    fit(experiment, clauses, p, gamma, threshold, epochs, shuffle, write, resume);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r15
movl %edi, %ebx
leaq 0x14(%rsp), %rax
movl $0x1f4, (%rax)          # imm = 0x1F4
leaq 0x10(%rsp), %rax
movl $0x19, (%rax)
leaq 0xc(%rsp), %rax
movl $0x190, (%rax)          # imm = 0x190
movabsq $0x3fb5c28f5c28f5c3, %rax # imm = 0x3FB5C28F5C28F5C3
leaq 0x18(%rsp), %rcx
movq %rax, (%rcx)
movabsq $0x3f647ae147ae147b, %rax # imm = 0x3F647AE147AE147B
leaq 0x40(%rsp), %r13
movq %rax, (%r13)
leaq 0x21b1(%rip), %rsi      # 0x5237
leaq 0x20(%rsp), %rdi
leaq 0xb(%rsp), %rbp
movq %rbp, %rdx
callq 0x20e0
xorl %eax, %eax
movb %al, (%rbp)
leaq 0xa(%rsp), %r14
movb %al, (%r14)
leaq 0x9(%rsp), %r12
movb %al, (%r12)
movl %ebx, %edi
movq %r15, %rsi
leaq 0x14(%rsp), %rdx
leaq 0x18(%rsp), %rcx
leaq 0x10(%rsp), %r8
movq %r13, %r9
pushq %r14
pushq %r12
pushq %rbp
leaq 0x24(%rsp), %rax
pushq %rax
callq 0x248b
addq $0x20, %rsp
leaq 0x14(%rsp), %rax
movl (%rax), %esi
leaq 0x18(%rsp), %rax
movsd (%rax), %xmm0
movsd (%r13), %xmm1
leaq 0x10(%rsp), %rax
movl (%rax), %edx
leaq 0xc(%rsp), %rax
movl (%rax), %ecx
movzbl (%rbp), %r8d
movzbl (%r12), %r9d
movzbl (%r14), %eax
subq $0x8, %rsp
leaq 0x28(%rsp), %rdi
pushq %rax
callq 0x2c6c
popq %rax
popq %rcx
leaq 0x20(%rsp), %rdi
callq 0x2120
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./multiweightm.h
// Function: multiweightm::multiweightm(std::istream&)
explicit multiweightm(std::istream &is)
    : epoch{get<int>(is)},
    classes{get<int>(is)},
    machine{classes} {
        for (int c = 0; c < classes; ++c)
            new (&machine(c)) weightm(is);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x35c5
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x35c5
movl %eax, 0x4(%r14)
leaq 0x8(%r14), %r15
movq %r15, %rdi
movl %eax, %esi
callq 0x35e2
xorl %r12d, %r12d
xorl %r13d, %r13d
movslq 0x4(%r14), %rax
cmpq %rax, %r13
jge 0x3365
movq 0x10(%r14), %rdi
addq %r12, %rdi
movq %rbx, %rsi
callq 0x35fa
incq %r13
addq $0x70, %r12
jmp 0x3344
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %r15, %rdi
callq 0x37ba
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./multiweightm.h
// Function: multiweightm::multiweightm(int, int, int, double, double, int, int)
multiweightm(int classes, int features, int clauses, double p, double gamma, int threshold, int state_bits = 8)
    : epoch{0},
    classes{classes},
    machine{classes} {
        while (classes--)
            new (&machine(classes)) weightm(features, clauses, p, gamma, threshold, state_bits);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %r9d, 0xc(%rsp)
movl %r8d, %ebp
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movl %ecx, %r14d
movq %rdi, %r15
andl $0x0, (%rdi)
movl %edx, %r13d
movl %esi, %r12d
movl %esi, 0x4(%rdi)
addq $0x8, %rdi
movq %rdi, 0x10(%rsp)
callq 0x35e2
movslq %r12d, %r12
imulq $0x70, %r12, %rdi
incq %r12
addq $-0x70, %rdi
decq %r12
je 0x3402
leaq -0x70(%rdi), %rbx
addq 0x10(%r15), %rdi
movl %r13d, %esi
movl %r14d, %edx
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
movl %ebp, %ecx
movl 0xc(%rsp), %r8d
callq 0x38a2
movq %rbx, %rdi
jmp 0x33d2
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
callq 0x37ba
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./multiweightm.h
// Function: multiweightm::fit(array2d<unsigned int>&, array1d<int>&, int, bool)
void fit(array2d<word> &x, array1d<int> &y, int epochs, bool mix = false) {
        array1d<int> idx{x.rows};
        // no need to serialize
        for (int i = 0; i < idx.columns; ++i)
            idx(i) = i;
        while (epochs--) {
            if (mix)
                shuffle(idx);
            for (int i = 0; i < x.rows; ++i)
                train(x(idx(i)), y(idx(i)));
            ++epoch;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0x14(%rsp)
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl (%rsi), %esi
movq %rsp, %r13
movq %r13, %rdi
callq 0x322e
xorl %eax, %eax
movq 0x8(%r13), %rcx
movslq (%rsp), %rdx
cmpq %rdx, %rax
jge 0x34dc
movl %eax, (%rcx,%rax,4)
incq %rax
jmp 0x3457
cmpb $0x0, 0x14(%rsp)
je 0x34a0
movslq (%rsp), %rdi
movq %rdi, %r13
subq $0x1, %r13
jb 0x34a0
movq 0x8(%rsp), %rbx
callq 0x2c58
movq 0x8(%rsp), %rcx
cltq
movl (%rbx,%r13,4), %edx
movl (%rcx,%rax,4), %esi
movl %esi, (%rbx,%r13,4)
movl %edx, (%rcx,%rax,4)
movq %r13, %rdi
jmp 0x3476
xorl %r13d, %r13d
movslq (%r15), %rax
cmpq %rax, %r13
jge 0x34d8
movq 0x8(%rsp), %rax
movslq (%rax,%r13,4), %rax
movslq 0x4(%r15), %rsi
imulq %rax, %rsi
shlq $0x2, %rsi
addq 0x8(%r15), %rsi
movq 0x8(%r14), %rcx
movl (%rcx,%rax,4), %edx
movq %r12, %rdi
callq 0x39f4
incq %r13
jmp 0x34a3
incl (%r12)
subl $0x1, %ebp
jae 0x3468
movq %rsp, %rdi
callq 0x32fc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x32fc
movq %rbx, %rdi
callq 0x22d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./multiweightm.h
// Function: multiweightm::evaluate(array2d<unsigned int>&, array1d<int>&)
double evaluate(array2d<word> &x, array1d<int> &y) {
        int correct = 0;
        for (int i = 0; i < x.rows; ++i)
            correct += predict(x(i)) == y(i);
        return (double) correct / x.rows;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
xorl %r12d, %r12d
xorl %ebp, %ebp
movslq (%r14), %rax
cmpq %rax, %r12
jge 0x3559
movslq 0x4(%r14), %rax
movslq %r12d, %rsi
imulq %rax, %rsi
shlq $0x2, %rsi
addq 0x8(%r14), %rsi
movq %r15, %rdi
callq 0x3f08
movq 0x8(%rbx), %rcx
xorl %edx, %edx
cmpl (%rcx,%r12,4), %eax
sete %dl
addl %edx, %ebp
incq %r12
jmp 0x3522
cvtsi2sd %ebp, %xmm0
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./multiweightm.h
// Function: multiweightm::serialize(std::ostream&)
void serialize(std::ostream &os) {
        put(os, epoch);
        put(os, classes);
        for (int c = 0; c < classes; ++c)
            machine(c).serialize(os);
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %esi
movq %rbx, %rdi
callq 0x3f79
movl 0x4(%r14), %esi
movq %rbx, %rdi
callq 0x3f79
xorl %r15d, %r15d
xorl %r12d, %r12d
movslq 0x4(%r14), %rax
cmpq %rax, %r12
jge 0x35b9
movq 0x10(%r14), %rdi
addq %r15, %rdi
movq %rbx, %rsi
callq 0x3f8e
incq %r12
addq $0x70, %r15
jmp 0x3598
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./weightm.h
// Function: weightm::weightm(std::istream&)
explicit weightm(std::istream &is)
    : features{get<int>(is)},
      clauses{get<int>(is)},
      p{get<double>(is)},
      gamma{get<double>(is)},
      threshold{get<int>(is)},
      states{get<int>(is)},
      literals{(2 * features - 1) / word_bits + 1},
      actmask{~((bool) (2 * features % word_bits) * ~((word) 0) << 2 * features % word_bits)},
      state{clauses, literals, states},
      lmask{literals},
      clause{clauses},
      weight{clauses} {
        mcg_state = get<uint64_t>(is);
        for (int c = 0; c < clauses; ++c)
            for (int l = 0; l < literals; ++l)
                for (int b = 0; b < states; ++b)
                    state(c, l, b) = get<word>(is);
        for (int c = 0; c < clauses; ++c)
            weight(c) = get<double>(is);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x35c5
movl %eax, (%r14)
movq %rbx, %rdi
callq 0x35c5
movl %eax, 0x4(%r14)
movq %rbx, %rdi
callq 0x37c8
movsd %xmm0, 0x8(%r14)
movq %rbx, %rdi
callq 0x37c8
movsd %xmm0, 0x10(%r14)
movq %rbx, %rdi
callq 0x35c5
movl %eax, 0x18(%r14)
movq %rbx, %rdi
callq 0x35c5
movl %eax, %r8d
movl %eax, 0x1c(%r14)
movl (%r14), %ecx
movl 0x4(%r14), %esi
leal -0x1(,%rcx,2), %eax
addl %ecx, %ecx
pushq $0x20
popq %rdi
cltd
idivl %edi
leal 0x1(%rax), %r9d
movl %r9d, 0x20(%r14)
movl %ecx, %eax
cltd
idivl %edi
movl %edx, %ecx
xorl %eax, %eax
negl %edx
sbbl %eax, %eax
shll %cl, %eax
notl %eax
movl %eax, 0x24(%r14)
leaq 0x28(%r14), %r15
movq %r15, %rdi
movl %r9d, %edx
movl %r8d, %ecx
callq 0x37e8
leaq 0x40(%r14), %r12
movl 0x20(%r14), %esi
movq %r12, %rdi
callq 0x380c
movq %r12, (%rsp)
movq %r15, 0x8(%rsp)
leaq 0x50(%r14), %rdi
movl 0x4(%r14), %esi
movq %rdi, 0x10(%rsp)
callq 0x322e
leaq 0x60(%r14), %rbp
movl 0x4(%r14), %esi
movq %rbp, %rdi
callq 0x3824
movq %rbx, %rdi
callq 0x383c
movq %rax, 0x4ab5(%rip)      # 0x81a0
xorl %r15d, %r15d
movl 0x4(%r14), %eax
cmpl %eax, %r15d
jge 0x3740
xorl %r12d, %r12d
cmpl 0x20(%r14), %r12d
jge 0x373b
xorl %r13d, %r13d
cmpl 0x1c(%r14), %r13d
jge 0x3736
movq %rbx, %rdi
callq 0x385a
movq 0x38(%r14), %rcx
movslq 0x30(%r14), %rdx
movl 0x2c(%r14), %esi
imull %r15d, %esi
addl %r12d, %esi
movslq %esi, %rsi
imulq %rdx, %rsi
addq %r13, %rsi
movl %eax, (%rcx,%rsi,4)
incq %r13
jmp 0x3703
incl %r12d
jmp 0x36fa
incl %r15d
jmp 0x36ee
xorl %r15d, %r15d
cltq
cmpq %rax, %r15
jge 0x3765
movq %rbx, %rdi
callq 0x37c8
movq 0x68(%r14), %rax
movsd %xmm0, (%rax,%r15,8)
incq %r15
movl 0x4(%r14), %eax
jmp 0x3743
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x3787
movq %rax, %rbx
jmp 0x3792
movq %rax, %rbx
jmp 0x379c
movq %rax, %rbx
jmp 0x37aa
jmp 0x3787
movq %rax, %rbx
movq %rbp, %rdi
callq 0x3878
movq 0x10(%rsp), %rdi
callq 0x32fc
movq 0x8(%rsp), %r15
movq (%rsp), %rdi
callq 0x3886
movq %r15, %rdi
callq 0x3894
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./array.h
// Function: array3d<unsigned int>::array3d(int, int, int)
array3d(int aisles, int rows, int columns)
    : aisles{aisles},
    rows{rows},
    columns{columns},
    data{(T*) new char[aisles * rows * columns * sizeof(T)]} {
    }

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movl %ecx, 0x8(%rdi)
imull %esi, %edx
imull %ecx, %edx
movslq %edx, %rdi
shlq $0x2, %rdi
callq 0x2030
movq %rax, 0x10(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./weightm.h
// Function: weightm::weightm(int, int, double, double, int, int)
weightm(int features, int clauses, double p, double gamma, int threshold, int states = 8)
    : features{features},
      clauses{clauses},
      p{p},
      gamma{gamma},
      threshold{threshold},
      states{states},
      literals{(2 * features - 1) / word_bits + 1},
      actmask{~((bool) (2 * features % word_bits) * ~((word) 0) << 2 * features % word_bits)},
      state{clauses, literals, states},
      lmask{literals},
      clause{clauses},
      weight{clauses} {
        for (int c = 0; c < clauses; ++c) {
            // even clauses are positive and and odds are negative
            weight(c) = c & 1? -1: +1;
            // initialize all the states to 2^states - 1
            for (int l = 0; l < literals; ++l) {
                for (int b = 0; b < states - 1; ++b)
                    state(c, l, b) = ~((word) 0);
                state(c, l, states - 1) = 0;
            }
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %edx, %r14d
movq %rdi, %r15
movl %esi, (%rdi)
movl %edx, 0x4(%rdi)
movsd %xmm0, 0x8(%rdi)
movsd %xmm1, 0x10(%rdi)
movl %ecx, 0x18(%rdi)
movl %r8d, 0x1c(%rdi)
leal (%rsi,%rsi), %ecx
leal -0x1(%rsi,%rsi), %eax
pushq $0x20
popq %rsi
cltd
idivl %esi
leal 0x1(%rax), %r8d
movl %r8d, 0x20(%rdi)
movl %ecx, %eax
cltd
idivl %esi
movl %edx, %ecx
xorl %eax, %eax
negl %edx
sbbl %eax, %eax
shll %cl, %eax
notl %eax
movl %eax, 0x24(%rdi)
leaq 0x28(%rdi), %r12
movq %r12, %rdi
movl %r14d, %esi
movl %r8d, %edx
movl %ebx, %ecx
callq 0x37e8
leaq 0x40(%r15), %r13
movl 0x20(%r15), %esi
movq %r13, %rdi
callq 0x380c
leaq 0x50(%r15), %rbp
movq %rbp, %rdi
movl %r14d, %esi
callq 0x322e
leaq 0x60(%r15), %rdi
movl %r14d, %esi
callq 0x3824
decl %ebx
xorl %eax, %eax
testl %ebx, %ebx
movl $0x0, %ecx
cmovgl %ebx, %ecx
movq 0x68(%r15), %rdx
testl %r14d, %r14d
cmovlel %eax, %r14d
cmpq %r14, %rax
je 0x39b8
movl %eax, %esi
andl $0x1, %esi
negl %esi
orl $0x1, %esi
cvtsi2sd %esi, %xmm0
movsd %xmm0, (%rdx,%rax,8)
movq 0x38(%r15), %rsi
xorl %edi, %edi
cmpl 0x20(%r15), %edi
jge 0x39b3
movq 0x38(%r15), %r8
xorl %r9d, %r9d
movl 0x2c(%r15), %r10d
movl 0x30(%r15), %r11d
imull %eax, %r10d
addl %edi, %r10d
cmpl %r9d, %ecx
je 0x39a0
imull %r10d, %r11d
addl %r9d, %r11d
movslq %r11d, %r10
orl $-0x1, (%r8,%r10,4)
incl %r9d
jmp 0x3978
imull %r11d, %r10d
addl %ebx, %r10d
movslq %r10d, %r8
andl $0x0, (%rsi,%r8,4)
incl %edi
jmp 0x396b
incq %rax
jmp 0x394d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rbp, %rdi
callq 0x32fc
jmp 0x39d7
movq %rax, %rbx
movq %r13, %rdi
callq 0x3886
jmp 0x39e4
movq %rax, %rbx
movq %r12, %rdi
callq 0x3894
movq %rbx, %rdi
callq 0x22d0
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./multiweightm.h
// Function: multiweightm::train(unsigned int*, int)
void train(word *x, int y) {
        int zero = fastrandrange(classes - 1), one = y;
        zero += zero >= one;
        machine(zero).train(x, 0);
        machine(one).train(x, 1);
    }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %edi
decl %edi
callq 0x2c58
xorl %ecx, %ecx
cmpl %ebp, %eax
setge %cl
addl %eax, %ecx
movslq %ecx, %rax
imulq $0x70, %rax, %rdi
addq 0x10(%r14), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x3a42
movslq %ebp, %rax
imulq $0x70, %rax, %rdi
addq 0x10(%r14), %rdi
pushq $0x1
popq %rdx
movq %rbx, %rsi
popq %rbx
popq %r14
popq %rbp
jmp 0x3a42
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./weightm.h
// Function: weightm::train(unsigned int const*, int)
void train(word const *x, int y) {
        double const diversion = .5 + (.5 - y) * infer(x, true) / threshold;
        for (int c = 0; c < clauses; ++c)
            if (fastrandom() < diversion)
                y != (c & 1)? setter(c, x): clearer(c, x);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
cvtsi2sd %edx, %xmm0
movq %rdi, %r15
movsd 0x1633(%rip), %xmm1     # 0x5090
subsd %xmm0, %xmm1
movsd %xmm1, (%rsp)
pushq $0x1
popq %rdx
callq 0x3ace
cvtsi2sdl 0x18(%r15), %xmm1
mulsd (%rsp), %xmm0
divsd %xmm1, %xmm0
addsd 0x160b(%rip), %xmm0     # 0x5090
movsd %xmm0, (%rsp)
xorl %ebp, %ebp
cmpl 0x4(%r15), %ebp
jge 0x3ac3
callq 0x317d
movsd (%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x3abf
movl %ebp, %eax
andl $0x1, %eax
movq %r15, %rdi
movl %ebp, %esi
movq %r14, %rdx
cmpl %ebx, %eax
jne 0x3aba
callq 0x3c2e
jmp 0x3abf
callq 0x3b30
incl %ebp
jmp 0x3a8c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./weightm.h
// Function: weightm::infer(unsigned int const*, bool)
double infer(word const *x, bool training = false) {
        double inference = 0;
        for (int c = 0; c < clauses; ++c)
            if (value(c, x, training))
                inference += weight(c);
        return inference;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
xorpd %xmm0, %xmm0
movsd %xmm0, (%rsp)
xorl %r15d, %r15d
movzbl %dl, %ebp
movslq 0x4(%r14), %rax
cmpq %rax, %r15
jge 0x3b20
movq %r14, %rdi
movl %r15d, %esi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x3cbe
testl %eax, %eax
je 0x3b1b
movq 0x68(%r14), %rax
movsd (%rsp), %xmm0
addsd (%rax,%r15,8), %xmm0
movsd %xmm0, (%rsp)
incq %r15
jmp 0x3aea
movsd (%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./weightm.h
// Function: weightm::setter(int, unsigned int const*)
void setter(int c, word const *x) {
        literal_mask();
        if (clause(c)) {
            weight(c) *= 1 + gamma;
            for (int l = 0; l < literals; ++l) {
                add(state(c, l), x[l]);
                subtract(state(c, l), lmask(l) & ~x[l]);
            }
        }
        else
            for (int l = 0; l < literals; ++l)
                subtract(state(c, l), lmask(l));
    }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movl %esi, %ebx
movq %rdi, %r14
callq 0x3d56
movq 0x58(%r14), %rcx
movslq %ebx, %rax
cmpl $0x0, (%rcx,%rax,4)
je 0x3be3
movsd 0x10(%r14), %xmm0
addsd 0x153c(%rip), %xmm0     # 0x50a0
movq 0x68(%r14), %rcx
mulsd (%rcx,%rax,8), %xmm0
movsd %xmm0, (%rcx,%rax,8)
xorl %r12d, %r12d
movslq 0x20(%r14), %rax
cmpq %rax, %r12
jge 0x3c21
movl 0x2c(%r14), %eax
imull %ebx, %eax
addl %r12d, %eax
movslq 0x30(%r14), %rcx
movslq %eax, %rsi
imulq %rcx, %rsi
shlq $0x2, %rsi
addq 0x38(%r14), %rsi
movl (%r15,%r12,4), %edx
movq %r14, %rdi
callq 0x3e86
movl 0x2c(%r14), %eax
imull %ebx, %eax
addl %r12d, %eax
movslq 0x30(%r14), %rcx
movslq %eax, %rsi
imulq %rcx, %rsi
shlq $0x2, %rsi
addq 0x38(%r14), %rsi
movq 0x48(%r14), %rax
movl (%r15,%r12,4), %edx
notl %edx
andl (%rax,%r12,4), %edx
movq %r14, %rdi
callq 0x3ec6
incq %r12
jmp 0x3b75
xorl %r15d, %r15d
movslq 0x20(%r14), %rax
cmpq %rax, %r15
jge 0x3c21
movl 0x2c(%r14), %eax
imull %ebx, %eax
addl %r15d, %eax
movslq 0x30(%r14), %rcx
movslq %eax, %rsi
imulq %rcx, %rsi
shlq $0x2, %rsi
addq 0x38(%r14), %rsi
movq 0x48(%r14), %rax
movl (%rax,%r15,4), %edx
movq %r14, %rdi
callq 0x3ec6
incq %r15
jmp 0x3be6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/adrianphoulady[P]weighted-tsetlin-machine-cpp/./weightm.h
// Function: weightm::value(int, unsigned int const*, bool)
int value(int c, word const *x, bool training = false) {
        word active = 0;
        state(c, literals, -1) &= actmask; // == state(c, literals - 1, states - 1)
        for (int l = 0; l < literals; ++l) {
            auto s = state(c, l, states - 1); // bit (states - 1) is the action bit of the automata
            if ((s & x[l]) != s)
                return clause(c) = 0;
            active |= s;
        }
        return clause(c) = training || active;
    }

// Assembly:
pushq %rbp
pushq %rbx
movl 0x24(%rdi), %eax
movslq 0x20(%rdi), %r8
movq 0x38(%rdi), %r10
movslq 0x2c(%rdi), %r9
movslq %esi, %rsi
imulq %rsi, %r9
addq %r8, %r9
movslq 0x30(%rdi), %r8
imulq %r9, %r8
andl %eax, -0x4(%r10,%r8,4)
movl 0x20(%rdi), %eax
movslq 0x1c(%rdi), %r11
movl 0x2c(%rdi), %r9d
imull %esi, %r9d
movslq 0x30(%rdi), %r8
movslq %r9d, %rbx
xorl %r9d, %r9d
testl %eax, %eax
cmovlel %r9d, %eax
imulq %r8, %rbx
shlq $0x2, %r11
leaq (%r11,%rbx,4), %r11
addq %r11, %r10
addq $-0x4, %r10
shlq $0x2, %r8
xorl %r11d, %r11d
cmpq %r9, %rax
je 0x3d3c
movl (%r10), %ebx
movl (%rdx,%r9,4), %ebp
notl %ebp
testl %ebp, %ebx
jne 0x3d49
orl %ebx, %r11d
incq %r9
addq %r8, %r10
jmp 0x3d1f
testl %r11d, %r11d
setne %al
orb %al, %cl
movzbl %cl, %eax
jmp 0x3d4b
xorl %eax, %eax
movq 0x58(%rdi), %rcx
movl %eax, (%rcx,%rsi,4)
popq %rbx
popq %rbp
retq
nop