LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: closetv
void
closetv(TV *tv)
{
	uint8 buf[3];
	int i;
	for(i = 0; i < NUMCONNECTIONS; i++)
		if(tv->cons[i].fd >= 0){
			msgheader(buf, MSG_CLOSE, 1);
			writen(tv->cons[i].fd, buf, 3);
			/* wait for close */
			read(tv->cons[i].fd, buf, 1);
			/* this will cause the handletv thread
			 * to close the connection...if it makes
			 * it that far */
		}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
xorl %r15d, %r15d
leaq 0xd(%rsp), %r14
movl 0x808e0(%rbx,%r15), %edi
testl %edi, %edi
js 0x4018
movw $0x1, 0xd(%rsp)
movb $0x4, 0xf(%rsp)
movq %r14, %rsi
movl $0x3, %edx
callq 0x719d
movl 0x808e0(%rbx,%r15), %edi
movl $0x1, %edx
movq %r14, %rsi
callq 0x2160
addq $0xc, %r15
cmpq $0x180, %r15            # imm = 0x180
jne 0x3fde
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: accepttv
void
accepttv(int fd, void *arg)
{
	TV *tv = arg;
	int c;
	TVcon *con;

	c = alloccon(tv);
	if(c < 0){
		/* Nothing free */
		setdpykbd(fd, -1, -1);
		close(fd);
		return;
	}
	con = &tv->cons[c];
	GUARD;
	con->dpy = dpykbdlist[c].dpy;
	con->kbd = dpykbdlist[c].kbd;
	con->fd = fd;
	nodelay(con->fd);
	tv->omap[con->dpy] = c;
	UNGUARD;
	setdpykbd(con->fd, con->dpy, con->kbd);
	printf("connected display %o\n", con->dpy);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebx
leaq 0x808e0(%rsi), %r12
leaq 0x42a3(%rip), %rax      # 0x82f0
xorl %r13d, %r13d
movq %r12, %rcx
cmpl $0x0, (%rcx)
jns 0x405d
cmpl $0x0, (%rax)
jns 0x4074
incq %r13
addq $0x8, %rax
addq $0xc, %rcx
cmpq $0x20, %r13
jne 0x4053
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testl %r13d, %r13d
js 0x40f7
movl %r13d, %r15d
leaq (%r15,%r15,2), %rbp
leaq 0x95f29(%rip), %rdi     # 0x99fb0
callq 0x2340
leaq 0x425d(%rip), %rax      # 0x82f0
movq (%rax,%r15,8), %rax
movq %rax, 0x4(%r12,%rbp,4)
movl %ebx, (%r12,%rbp,4)
movl %ebx, %edi
callq 0x72ba
movslq 0x4(%r12,%rbp,4), %rax
movl %r13d, 0x80a60(%r14,%rax,4)
leaq 0x95ef5(%rip), %rdi     # 0x99fb0
callq 0x21e0
movl (%r12,%rbp,4), %edi
movb 0x4(%r12,%rbp,4), %al
movb 0x8(%r12,%rbp,4), %cl
leaq 0x6(%rsp), %rsi
movb %al, (%rsi)
movb %cl, 0x1(%rsi)
movl $0x2, %edx
callq 0x719d
movl 0x4(%r12,%rbp,4), %esi
leaq 0xc362(%rip), %rdi      # 0x10450
xorl %eax, %eax
callq 0x20f0
jmp 0x4114
leaq 0x4(%rsp), %rsi
movw $0xffff, (%rsi)         # imm = 0xFFFF
movl %ebx, %edi
movl $0x2, %edx
callq 0x719d
movl %ebx, %edi
callq 0x2140
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: svc_tv
int
svc_tv(Bus *bus, void *dev)
{
	TV *tv = dev;
	word key, kbd;
	int ch;

	ch = (tv->kms&0100040) == 0100040 ? 5 : 0;
	if(!tv->km_haskey)
		return ch;
	pthread_mutex_lock(&kblock);
	tv->km_haskey = 0;
	key = tv->km_key;
	kbd = tv->km_kbd;
	pthread_cond_signal(&kbcond);
	pthread_mutex_unlock(&kblock);

	bus->addr = tv->kma_hi | tv->kma_lo;
	bus->data = key;
	dato_bus(bus);
	tv->kma_lo = tv->kma_lo+2 & 0177;
	bus->addr = tv->kma_hi | tv->kma_lo;
	bus->data = (kbd&077) << 8;
	dato_bus(bus);
	tv->kma_lo = tv->kma_lo+2 & 0177;
	tv->kms &= ~0200;	/* DMA done */
	tv->kms |= 0100000;	/* interrupt bit */
	ch = (tv->kms&0100040) == 0100040 ? 5 : 0;
	return ch;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
cmpl $0x0, 0x808d8(%rsi)
je 0x41f1
movq %rdi, %r14
leaq 0x95e93(%rip), %r15     # 0x99fd8
movq %r15, %rdi
callq 0x2340
movl $0x0, 0x808d8(%rbx)
movzwl 0x808de(%rbx), %r12d
movl 0x808dc(%rbx), %ebp
leaq 0x95e94(%rip), %rdi     # 0x9a000
callq 0x2180
movq %r15, %rdi
callq 0x21e0
movl 0x808d4(%rbx), %eax
orl 0x808d0(%rbx), %eax
movl %eax, 0x8(%r14)
movw %r12w, 0xc(%r14)
movq %r14, %rdi
callq 0x29d4
movl 0x808d4(%rbx), %eax
addl $0x2, %eax
andl $0x7f, %eax
movl %eax, 0x808d4(%rbx)
orl 0x808d0(%rbx), %eax
movl %eax, 0x8(%r14)
andl $0x3f, %ebp
shll $0x8, %ebp
movw %bp, 0xc(%r14)
movq %r14, %rdi
callq 0x29d4
movl 0x808d4(%rbx), %eax
addl $0x2, %eax
andl $0x7f, %eax
movl %eax, 0x808d4(%rbx)
movzwl 0x808cc(%rbx), %eax
andl $0x7f7f, %eax           # imm = 0x7F7F
orl $0x8000, %eax           # imm = 0x8000
movw %ax, 0x808cc(%rbx)
jmp 0x41f8
movzwl 0x808cc(%rbx), %eax
notl %eax
xorl %ecx, %ecx
testl $0x8020, %eax           # imm = 0x8020
sete %cl
leal (%rcx,%rcx,4), %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/aap[P]pdp11/tv.c
// Function: servetv
void
servetv(TV *tv, int port)
{
	pthread_t th;
	struct Serveargs *sa;
	sa = malloc(sizeof(struct Serveargs));
	sa->tv = tv;
	sa->port = port;
	pthread_create(&th, nil, servetv_thread, sa);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x10, %edi
callq 0x21f0
movq %r14, (%rax)
movl %ebx, 0x8(%rax)
leaq 0x15(%rip), %rdx        # 0x4269
movq %rsp, %rdi
xorl %esi, %esi
movq %rax, %rcx
callq 0x2240
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Liutos[P]Eloquent/main.c
// Function: main
int main(int argc, char *argv[])
{
    lexer_t *lexer = lexer_new(stdin);
    parser_t *parser = parser_new(lexer);
    interp_t *interp = interp_new();
    ast_t *ast = NULL;
    ast_kind_t kind = parser_getast(parser, &ast);
    while (kind != AST_INVALID) {
        if (kind == AST_END_OF_FILE)
            break;
        ast_print(ast, stdout);
        fprintf(stdout, "\n");

        value_t *value = NULL;
        interp_execute(interp, ast, &value);
        value_print(value, stdout);
        fprintf(stdout, "\n");
        kind = parser_getast(parser, &ast);
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq 0x8c98(%rip), %rax      # 0xafd8
movq (%rax), %rdi
callq 0x5a90
movq %rax, %rdi
callq 0x537c
movq %rax, %rbx
callq 0x367c
movq %rax, %r14
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5394
movq 0x8c57(%rip), %r13      # 0xafd0
movq %rsp, %r12
testl %eax, %eax
je 0x23e1
cmpl $0x3, %eax
je 0x23e1
movq 0x8(%rsp), %rdi
movq (%r13), %rsi
callq 0x593e
movq (%r13), %rsi
movl $0xa, %edi
callq 0x20a0
movq $0x0, (%rsp)
movq 0x8(%rsp), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x38cf
movq (%rsp), %rdi
movq (%r13), %rsi
callq 0x2659
movq (%r13), %rsi
movl $0xa, %edi
callq 0x20a0
movq %rbx, %rdi
movq %r15, %rsi
callq 0x5394
jmp 0x237c
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: parser_data_init
void parser_data_init(struct parser_data* data, const char* client_address) {
  data->url        = buffer_new();
  data->client_address = strdup(client_address);
  data->headers    = new_map();
  map_set_free_func(data->headers, free);
  data->header.key = buffer_new();
  data->header.val = buffer_new();
  data->complete = 0;

  // Log the current time
  time_t rawtime;
  time(&rawtime);
  gmtime_r(&rawtime, &data->timeinfo);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %eax, %eax
callq 0x64fc
movq %rax, (%rbx)
movq %r14, %rdi
callq 0x22d0
movq %rax, 0x8(%rbx)
xorl %eax, %eax
callq 0x6abc
movq %rax, 0x48(%rbx)
movq 0x9912(%rip), %rsi      # 0xbfc0
movq %rax, %rdi
callq 0x6ae7
xorl %eax, %eax
callq 0x64fc
movq %rax, 0x50(%rbx)
xorl %eax, %eax
callq 0x64fc
movq %rax, 0x58(%rbx)
movl $0x0, 0x60(%rbx)
movq %rsp, %r14
movq %r14, %rdi
callq 0x21e0
addq $0x10, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2110
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: parser_data_destroy
void parser_data_destroy(struct parser_data* data) {
  buffer_free(data->url);
  free(data->client_address);
  destroy_map(&data->headers);
  buffer_free(data->header.key);
  buffer_free(data->header.val);
  memset(&data, 0, sizeof(data));
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x6672
movq 0x8(%rbx), %rdi
callq 0x2320
leaq 0x48(%rbx), %rdi
callq 0x6af1
movq 0x50(%rbx), %rdi
callq 0x6672
movq 0x58(%rbx), %rdi
popq %rbx
jmp 0x6672
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: remove_query_string
void remove_query_string(buffer_t **path) {
  const ssize_t pos = buffer_indexof(*path, "?");

  if (pos == -1) {
    return;
  }

  buffer_t *result = buffer_slice(*path, 0, pos);
  buffer_free(*path);
  *path = result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
leaq 0x59e5(%rip), %rsi      # 0x811c
callq 0x6940
cmpq $-0x1, %rax
je 0x275d
movq (%rbx), %rdi
xorl %esi, %esi
movq %rax, %rdx
callq 0x68c0
movq %rax, %r14
movq (%rbx), %rdi
callq 0x6672
movq %r14, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: open_connection
int open_connection(int port)
{
  const int create_socket = socket(AF_INET, SOCK_STREAM, 0);
  if (create_socket < 1) {
    perror("opening socket\n");
    exit(EXIT_FAILURE);
  }

  const int yes = 1;
  if (setsockopt(create_socket, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int)) == -1) {
    perror("setsockopt");
    exit(EXIT_FAILURE);
  }

  struct sockaddr_in address;
  address.sin_family = AF_INET;
  address.sin_addr.s_addr = INADDR_ANY;
  address.sin_port = htons(port);

  const int bound = bind(create_socket, (struct sockaddr *)&address, sizeof(address));

  if (bound != 0) {
    fprintf(stderr, "Failed to bind to port %d", port);
    perror(" ");
    exit(EXIT_FAILURE);
  }

  return create_socket;
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0x18, %rsp
movl %edi, %ebx
movl $0x2, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x2310
testl %eax, %eax
jle 0x27df
movl %eax, %ebp
leaq 0x4(%rsp), %rcx
movl $0x1, (%rcx)
movl %eax, %edi
movl $0x1, %esi
movl $0x2, %edx
movl $0x4, %r8d
callq 0x2090
cmpl $-0x1, %eax
je 0x27e4
leaq 0x8(%rsp), %rsi
movw $0x2, (%rsi)
movl $0x0, 0x4(%rsi)
movl %ebx, %eax
rolw $0x8, %ax
movw %ax, 0x2(%rsi)
movl %ebp, %edi
movl $0x10, %edx
callq 0x2230
testl %eax, %eax
jne 0x27e9
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %rbp
retq
callq 0x2384
callq 0x236f
movl %ebx, %edi
callq 0x2340
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: set_root
static void set_root(command_t *self) {
  struct options* options = self->data;
  options->root = realpath(self->arg, NULL);
  if (!options->root) {
    fprintf(stderr, "Cannot find directory %s", self->arg);
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
movq 0x10(%rdi), %rdi
xorl %esi, %esi
callq 0x21c0
movq %rax, (%r14)
testq %rax, %rax
je 0x2d0c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
addq $0x10, %rbx
movq %rbx, %rdi
callq 0x2399
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: set_port
static void set_port(command_t *self) {
  struct options* options = self->data;
  char* endptr = 0;
  options->port = strtol(self->arg, &endptr, 10);
  if (*endptr) {
    fprintf(stderr, "Error: invalid port number: %s\n", self->arg);
    exit(EXIT_FAILURE);
  }

  if (options->port > USHRT_MAX) {
    fprintf(stderr, "Error: port number %ld is larger than the max %d\n",
        options->port,
        USHRT_MAX);
    exit(EXIT_FAILURE);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %r15
leaq 0x8(%rsp), %r14
movq $0x0, (%r14)
movq 0x10(%rdi), %rdi
movq %r14, %rsi
movl $0xa, %edx
callq 0x21b0
movq %rax, 0x8(%r15)
movq (%r14), %rcx
cmpb $0x0, (%rcx)
jne 0x2d62
cmpq $0x10000, %rax          # imm = 0x10000
jge 0x2d6e
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
addq $0x10, %rbx
movq %rbx, %rdi
callq 0x23c0
movq %rax, %rdi
callq 0x23e7
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: on_header_field
static int on_header_field(http_parser * parser, const char *at, size_t len) {
  struct parser_data *data = parser->data;

  if (buffer_length(data->header.val) > 0) {
    map_set(data->headers,  strdup(data->header.key->data),
        strdup(data->header.val->data));
    buffer_clear(data->header.key);
    buffer_clear(data->header.val);
  }
  buffer_append_n(data->header.key, at, len);
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq 0x18(%rdi), %r13
movq 0x58(%r13), %rdi
callq 0x6669
testq %rax, %rax
je 0x2dfb
movq 0x48(%r13), %r15
movq 0x50(%r13), %rax
movq 0x10(%rax), %rdi
callq 0x22d0
movq %rax, %r12
movq 0x58(%r13), %rax
movq 0x10(%rax), %rdi
callq 0x22d0
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x6bfe
movq 0x50(%r13), %rdi
callq 0x6a2b
movq 0x58(%r13), %rdi
callq 0x6a2b
movq 0x50(%r13), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x67fc
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: send_error
static void send_error(int socket, int status, const struct request* request) {
  buffer_t* buffer = buffer_new();
  buffer_appendf(buffer, "http error %d", status);

  int age = 0;

  buffer_t* headers = response_headers(buffer_length(buffer), age, request->time, request->uri);
  int header_bytes_written = write(socket, headers->data, buffer_length(headers));
  buffer_free(headers);

  if (header_bytes_written == -1) {
    fputs("Error -1 writting error headers to socket\n", stderr);
  }

  int written = write(socket, buffer->data, buffer_length(buffer));
  if (written == -1){
    fprintf(stderr, "Error -1 writing error message to socket");
  }
  buffer_free(buffer);
  log_request(status, request);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r15d
xorl %eax, %eax
callq 0x64fc
movq %rax, %r14
leaq 0x54c0(%rip), %rsi      # 0x8308
movq %rax, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x66d6
movq %r14, %rdi
callq 0x6669
movq (%rbx), %rdx
movq 0x20(%rbx), %rsi
movl %eax, %edi
callq 0x2ee5
movq %rax, %r12
movq 0x10(%rax), %r13
movq %rax, %rdi
callq 0x6669
movl %r15d, %edi
movq %r13, %rsi
movq %rax, %rdx
callq 0x20a0
movq %rax, %r13
movq %r12, %rdi
callq 0x6672
cmpl $-0x1, %r13d
je 0x2ed7
movq 0x10(%r14), %r12
movq %r14, %rdi
callq 0x6669
movl %r15d, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x20a0
cmpl $-0x1, %eax
je 0x2ede
movq %r14, %rdi
callq 0x6672
movl %ebp, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x301d
callq 0x2410
jmp 0x2e98
callq 0x2426
jmp 0x2eb7
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: response_headers
static buffer_t* response_headers(int length, int max_age, const struct tm *timeinfo, const char* uri)
{
  buffer_t *result = buffer_new();
  buffer_append(result, "HTTP/1.1 200 OK\r\n");

  char time_buffer[time_buffer_size];
  const size_t time_size = strftime(time_buffer, time_buffer_size, "%a, %d %h %Y %T %Z", timeinfo);

  if (time_size == 0) {
    fprintf(stderr, "Error formatting time");
    exit(EXIT_SUCCESS);
  }

  // Date: Sun, 07 Sep 2014 14: 51:17 GMT
  buffer_appendf(result, "Date: %s\r\n", time_buffer);

  // TODO:
  // Last-Modified: Sun, 07 Sep 2014 01: 37:26 GMT
  // Content-Type:image / gif

  max_age = 31536000;
  buffer_appendf(result, "cache-control: public, max-age=%d\r\n", max_age);

  // Content - Length:459211

  buffer_set_content_type(result, uri);

  buffer_appendf(result, "Content-Length: %d\r\n", length);
  buffer_append(result, "Access-Control-Allow-Methods: GET\r\n");
  buffer_append(result, "Access-Control-Allow-Origin: *\r\n");
  buffer_append(result, "Server: Garcon 1.0\r\n");
  buffer_append(result, "\r\n");

  return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
xorl %eax, %eax
callq 0x64fc
movq %rax, %rbx
leaq 0x5460(%rip), %rsi      # 0x836a
movq %rax, %rdi
callq 0x67d5
leaq 0x5463(%rip), %rdx      # 0x837c
movq %rsp, %rdi
movl $0x64, %esi
movq %r15, %rcx
callq 0x2240
testq %rax, %rax
je 0x3018
leaq 0x546c(%rip), %rsi      # 0x83a5
movq %rsp, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66d6
leaq 0x5463(%rip), %rsi      # 0x83b0
movq %rbx, %rdi
movl $0x1e13380, %edx        # imm = 0x1E13380
xorl %eax, %eax
callq 0x66d6
movq %r14, %rdi
movl $0x2e, %esi
callq 0x2100
testq %rax, %rax
je 0x2fb9
movq %rax, %r14
incq %r14
movl $0x8, %r15d
leaq 0x921f(%rip), %r12      # 0xc1a0
movq -0x8(%r15,%r12), %rsi
incq %rsi
movq %r14, %rdi
callq 0x2050
testl %eax, %eax
je 0x2fa4
addq $0x10, %r15
cmpq $0x118, %r15            # imm = 0x118
jne 0x2f81
jmp 0x2fb9
movq (%r15,%r12), %rdx
leaq 0x5494(%rip), %rsi      # 0x8443
movq %rbx, %rdi
xorl %eax, %eax
callq 0x66d6
leaq 0x5414(%rip), %rsi      # 0x83d4
movq %rbx, %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x66d6
leaq 0x5416(%rip), %rsi      # 0x83e9
movq %rbx, %rdi
callq 0x67d5
leaq 0x542b(%rip), %rsi      # 0x840d
movq %rbx, %rdi
callq 0x67d5
leaq 0x543d(%rip), %rsi      # 0x842e
movq %rbx, %rdi
callq 0x67d5
leaq 0x542b(%rip), %rsi      # 0x842b
movq %rbx, %rdi
callq 0x67d5
movq %rbx, %rax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2442
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/garcon.c
// Function: log_request
static void log_request(int status, const struct request* request) {

  char time_buffer[time_buffer_size];
  const size_t time_size = strftime(time_buffer,
      time_buffer_size, "%FT%T%z", request->time);

  if (time_size == 0) {
    // TODO: use longjmp back to the main loop rather than quitting
    // the server
    fprintf(stderr, "Error formatting time");
    exit(EXIT_SUCCESS);
  }

  // Log request in Apache "Combined Log Format"
  // http://httpd.apache.org/docs/1.3/logs.html
  // <ip-address> <identd> <user> [<time>] "<request>" <status> <bytes> "<Referer>" "<User-agent>"
  // 123.65.150.10 - - [23/Aug/2010:03:50:59 +0000] "POST /wordpress3/wp-admin/admin-ajax.php HTTP/1.1" 200 2 "http://www.example.com/wordpress3/wp-admin/post-new.php" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/534.3 (KHTML, like Gecko) Chrome/6.0.472.25 Safari/534.3"
  // 127.0.0.1 - frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "http://www.example.com/start.html" "Mozilla/4.08 [en] (Win98; I ;Nav)"
  printf("%s - - [%s] %s %s %d \"%s\"\n",
      request->client_address,
      time_buffer,
      request->method,
      request->uri,
      status,
      request->user_agent);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rsi, %r14
movl %edi, %ebx
movq 0x20(%rsi), %rcx
leaq 0x5422(%rip), %rdx      # 0x8456
leaq 0x10(%rsp), %rdi
movl $0x64, %esi
callq 0x2240
testq %rax, %rax
je 0x3079
movq 0x18(%r14), %rsi
movq 0x10(%r14), %rcx
movq (%r14), %r8
movq 0x8(%r14), %rax
movq %rax, (%rsp)
leaq 0x53fc(%rip), %rdi      # 0x845e
leaq 0x10(%rsp), %rdx
movl %ebx, %r9d
xorl %eax, %eax
callq 0x20f0
addq $0x78, %rsp
popq %rbx
popq %r14
retq
callq 0x2466
nop
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_new_with_size
buffer_t *
buffer_new_with_size(size_t n) {
  buffer_t *self = malloc(sizeof(buffer_t));
  if (!self) return NULL;
  self->len = n;
  self->data = self->alloc = calloc(n + 1, 1);
  return self;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x18, %edi
callq 0x21f0
testq %rax, %rax
je 0x653c
movq %rax, %rbx
movq %r14, (%rax)
incq %r14
movl $0x1, %esi
movq %r14, %rdi
callq 0x2190
movq %rax, 0x8(%rbx)
movq %rax, 0x10(%rbx)
jmp 0x653e
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_new_with_string_length
buffer_t *
buffer_new_with_string_length(char *str, size_t len) {
  buffer_t *self = malloc(sizeof(buffer_t));
  if (!self) return NULL;
  self->len = len;
  self->data = self->alloc = str;
  return self;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl $0x18, %edi
callq 0x21f0
testq %rax, %rax
je 0x65a4
movq %r14, (%rax)
movq %rbx, 0x8(%rax)
movq %rbx, 0x10(%rax)
jmp 0x65a6
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_new_with_copy
buffer_t *
buffer_new_with_copy(char *str) {
  size_t len = strlen(str);
  buffer_t *self = buffer_new_with_size(len);
  if (!self) return NULL;
  memcpy(self->alloc, str, len);
  self->data = self->alloc;
  return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
callq 0x20d0
movq %rax, %r15
movq %rax, %rdi
callq 0x6506
testq %rax, %rax
je 0x65e9
movq %rax, %rbx
movq 0x8(%rax), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x21d0
movq %r12, 0x10(%rbx)
jmp 0x65eb
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_compact
ssize_t
buffer_compact(buffer_t *self) {
  size_t len = buffer_length(self);
  size_t rem = self->len - len;
  char *buf = calloc(len + 1, 1);
  if (!buf) return -1;
  memcpy(buf, self->data, len);
  free(self->alloc);
  self->len = len;
  self->data = self->alloc = buf;
  return rem;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %r12
movq %r12, %rdi
callq 0x20d0
movq %rax, %r15
movq (%rbx), %r14
leaq 0x1(%rax), %rdi
movl $0x1, %esi
callq 0x2190
testq %rax, %rax
je 0x6655
movq %rax, %r13
subq %r15, %r14
movq %rax, %rdi
movq %r12, %rsi
movq %r15, %rdx
callq 0x21d0
movq 0x8(%rbx), %rdi
callq 0x2320
movq %r15, (%rbx)
movq %r13, 0x8(%rbx)
movq %r13, 0x10(%rbx)
jmp 0x665c
movq $-0x1, %r14
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_resize
int
buffer_resize(buffer_t *self, size_t n) {
  n = nearest_multiple_of(1024, n);
  self->len = n;
  self->alloc = self->data = realloc(self->alloc, n + 1);
  if (!self->alloc) return -1;
  self->alloc[n] = '\0';
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
addq $0x3ff, %rbx            # imm = 0x3FF
andq $-0x400, %rbx           # imm = 0xFC00
movq %rbx, (%rdi)
movq 0x8(%rdi), %rdi
leaq 0x1(%rbx), %rsi
callq 0x2220
movq %rax, 0x10(%r14)
movq %rax, 0x8(%r14)
testq %rax, %rax
je 0x66c9
movb $0x0, (%rax,%rbx)
xorl %eax, %eax
jmp 0x66ce
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_appendf
int buffer_appendf(buffer_t *self, const char *format, ...) {
  va_list ap;
  va_list tmpa;
  char *dst = NULL;
  int length = 0;
  int required = 0;
  int bytes = 0;

  va_start(ap, format);

  length = buffer_length(self);

  // First, we compute how many bytes are needed
  // for the formatted string and allocate that
  // much more space in the buffer.
  va_copy(tmpa, ap);
  required = vsnprintf(NULL, 0, format, tmpa);
  va_end(tmpa);
  if (-1 == buffer_resize(self, length + required)) {
    va_end(ap);
    return -1;
  }

  // Next format the string into the space that we
  // have made room for.
  dst = self->data + length;
  bytes = vsnprintf(dst, 1 + required, format, ap);
  va_end(ap);

  return bytes < 0
    ? -1
    : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x40(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0x6740
movaps %xmm0, 0x70(%rsp)
movaps %xmm1, 0x80(%rsp)
movaps %xmm2, 0x90(%rsp)
movaps %xmm3, 0xa0(%rsp)
movaps %xmm4, 0xb0(%rsp)
movaps %xmm5, 0xc0(%rsp)
movaps %xmm6, 0xd0(%rsp)
movaps %xmm7, 0xe0(%rsp)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rsp)
leaq 0x120(%rsp), %rax
movq %rax, 0x8(%rsp)
movq %rsi, 0x10(%rsp)
movq 0x10(%rdi), %rdi
callq 0x20d0
movq %rax, %r15
movaps (%rsp), %xmm0
leaq 0x20(%rsp), %rcx
movaps %xmm0, (%rcx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rcx)
xorl %edi, %edi
xorl %esi, %esi
movq %rbx, %rdx
callq 0x2080
movl %eax, %r12d
leal (%r12,%r15), %eax
movslq %eax, %rsi
movq %r14, %rdi
callq 0x668c
cmpl $-0x1, %eax
je 0x67c1
movslq %r15d, %rdi
addq 0x10(%r14), %rdi
incl %r12d
movslq %r12d, %rsi
movq %rsp, %rcx
movq %rbx, %rdx
callq 0x2080
sarl $0x1f, %eax
jmp 0x67c6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_append_n
int
buffer_append_n(buffer_t *self, const char *str, size_t len) {
  size_t prev = strlen(self->data);
  size_t needed = len + prev;

  // enough space
  if (self->len > needed) {
    strncat(self->data, str, len);
    return 0;
  }

  // resize
  int ret = buffer_resize(self, needed);
  if (-1 == ret) return -1;
  strncat(self->data, str, len);

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq 0x10(%rdi), %r12
movq %r12, %rdi
callq 0x20d0
addq %rbx, %rax
cmpq %rax, (%r15)
ja 0x6835
movq %r15, %rdi
movq %rax, %rsi
callq 0x668c
cmpl $-0x1, %eax
je 0x6851
movq 0x10(%r15), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x2160
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x6845
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_prepend
int
buffer_prepend(buffer_t *self, char *str) {
  size_t len = strlen(str);
  size_t prev = strlen(self->data);
  size_t needed = len + prev;

  // enough space
  if (self->len > needed) goto move;

  // resize
  int ret = buffer_resize(self, needed);
  if (-1 == ret) return -1;

  // move
  move:
  memmove(self->data + len, self->data, len + 1);
  memcpy(self->data, str, len);

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x20d0
movq %rax, %r15
movq 0x10(%r14), %rdi
callq 0x20d0
addq %r15, %rax
cmpq %rax, (%r14)
ja 0x688f
movq %r14, %rdi
movq %rax, %rsi
callq 0x668c
cmpl $-0x1, %eax
je 0x68b9
movq 0x10(%r14), %rsi
leaq (%rsi,%r15), %rdi
movq %r15, %rdx
incq %rdx
callq 0x2250
movq 0x10(%r14), %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21d0
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x68b3
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_slice
buffer_t *
buffer_slice(buffer_t *buf, size_t from, ssize_t to) {
  size_t len = strlen(buf->data);

  // bad range
  if (to < from) return NULL;

  // relative to end
  if (to < 0) to = len - ~to;

  // cap end
  if (to > len) to = len;

  size_t n = to - from;
  buffer_t *self = buffer_new_with_size(n);
  memcpy(self->data, buf->data + from, n);
  return self;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq %rsi, %rdx
jae 0x68d2
xorl %r15d, %r15d
jmp 0x6918
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rdi), %rdi
callq 0x20d0
testq %r15, %r15
leaq 0x1(%r15,%rax), %r12
cmovnsq %r15, %r12
cmpq %rax, %r12
cmovaeq %rax, %r12
subq %rbx, %r12
movq %r12, %rdi
callq 0x6506
movq %rax, %r15
movq 0x10(%rax), %rdi
addq 0x10(%r14), %rbx
movq %rbx, %rsi
movq %r12, %rdx
callq 0x21d0
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_trim_right
void
buffer_trim_right(buffer_t *self) {
  int c;
  size_t i = buffer_length(self) - 1;
  while ((c = self->data[i]) && isspace(c)) {
    self->data[i--] = 0;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x10(%rdi), %r15
movq %r15, %rdi
callq 0x20d0
movb -0x1(%r15,%rax), %bpl
testb %bpl, %bpl
je 0x6a04
movq %rax, %r14
leaq -0x1(%rax), %r12
addq %rax, %r15
decq %r15
callq 0x2300
addq $-0x2, %r14
movq (%rax), %rcx
movsbq %bpl, %rdx
testb $0x20, 0x1(%rcx,%rdx,2)
je 0x6a04
movb $0x0, (%r15)
movq 0x10(%rbx), %rcx
leaq (%rcx,%r12), %r15
decq %r15
decq %r12
movb (%rcx,%r14), %bpl
decq %r14
testb %bpl, %bpl
jne 0x69d8
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/buffer/buffer.c
// Function: buffer_print
void
buffer_print(buffer_t *self) {
  size_t len = self->len;

  printf("\n ");

  // hex
  for (int i = 0; i < len; ++i) {
    printf(" %02x", self->alloc[i]);
    if ((i + 1) % 8 == 0) printf("\n ");
  }

  printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r12
leaq 0x2911(%rip), %rdi      # 0x9360
xorl %eax, %eax
callq 0x20f0
testq %r12, %r12
je 0x6aa6
negq %r12
movl $0x1, %r13d
leaq 0x28f8(%rip), %r14      # 0x9363
leaq 0x28ee(%rip), %r15      # 0x9360
movq 0x8(%rbx), %rax
movsbl -0x1(%rax,%r13), %esi
movq %r14, %rdi
xorl %eax, %eax
callq 0x20f0
testb $0x7, %r13b
jne 0x6a96
movq %r15, %rdi
xorl %eax, %eax
callq 0x20f0
leaq (%r12,%r13), %rax
incq %rax
incq %r13
cmpq $0x1, %rax
jne 0x6a72
movl $0xa, %edi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x2040
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/cmap/map.c
// Function: destroy_map
void destroy_map(struct map_t** map)
{
    struct map_node_t* node;
    struct map_node_t* next_node;

    for (node = (*map)->head; node != NULL; node = next_node) {
        free(node->key);

        if ((*map)->free_func && node->value) {
            (*(*map)->free_func)(node->value);
        }

        next_node = node->next;
        free(node);
        node = NULL;
    }

    free(*map);
    *map = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x6b37
movq (%r14), %rdi
callq 0x2320
movq (%rbx), %rax
movq 0x18(%rax), %rax
testq %rax, %rax
je 0x6b23
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x6b23
callq *%rax
movq 0x10(%r14), %r15
movq %r14, %rdi
callq 0x2320
movq %r15, %r14
testq %r15, %r15
jne 0x6b04
movq (%rbx), %rdi
callq 0x2320
movq $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/cmap/map.c
// Function: map_find
static struct map_find_results_t map_find(struct map_t* map, const char* key)
{
    struct map_find_results_t results;

    results.prev_node = NULL;
    results.node = NULL;
    results.exact_match = 0;

    struct map_node_t* node;
    for (node = map->head; node != NULL; node = node->next) {
        int cmp = (*map->cmp_func)(key, node->key);

        if (cmp <= 0) {
            results.node = node;
            results.exact_match = (cmp == 0);
            return results;
        }

        results.prev_node = node;
    }

    return results;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq %rdi, (%rsp)
movw $0x0, 0x10(%rdi)
movq (%rsi), %rbx
testq %rbx, %rbx
je 0x6bd8
movq %rdx, %r14
movq %rsi, %r15
xorl %r13d, %r13d
xorl %ebp, %ebp
xorl %r12d, %r12d
movq (%rbx), %rsi
movq %r14, %rdi
callq *0x10(%r15)
xorl %ecx, %ecx
testl %eax, %eax
sete %cl
cmovgq %rbx, %r12
cmovlel %ecx, %ebp
cmovleq %rbx, %r13
jle 0x6be0
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
jne 0x6baf
jmp 0x6be0
xorl %r12d, %r12d
xorl %ebp, %ebp
xorl %r13d, %r13d
movq (%rsp), %rax
movq %r13, 0x8(%rax)
movw %bp, 0x10(%rax)
movq %r12, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/cmap/map.c
// Function: map_set
int map_set(struct map_t* map, const char* key, void* value)
{
    const struct map_find_results_t find_result = map_find(map, key);

    // found node with same key
    if (find_result.exact_match) {
        if (map->free_func && find_result.node->value) {
            (*map->free_func)(find_result.node->value);
        }

        find_result.node->value = value;
        return 0;
    }

    // create the new node.
    struct map_node_t* new_node = new_map_node(key, value);

    if (!new_node) {
        return -1;
    }

    // empty list
    if (map->head == NULL) {
        map->head = new_node;
        map->size = 1;
        return 0;
    }

    // put the new node in the proper place
    struct map_node_t* node = find_result.node;
    struct map_node_t* prev_node = find_result.prev_node;

    new_node->next = node;

    if (prev_node) {
        prev_node->next = new_node;
    } else {
        map->head = new_node;
    }

    map->size++;
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x6b7e
cmpw $0x0, 0x10(%r14)
je 0x6c5b
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x6c44
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rdi
testq %rdi, %rdi
je 0x6c44
callq *%rax
movq 0x8(%rsp), %rax
movq %r12, 0x8(%rax)
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movl $0x18, %edi
callq 0x21f0
movq %rax, %r14
testq %rax, %rax
je 0x6caa
movq $0x0, 0x10(%r14)
movq %r12, 0x8(%r14)
movq %r15, %rdi
callq 0x20d0
leaq 0x1(%rax), %rdi
callq 0x21f0
movq %rax, (%r14)
testq %rax, %rax
je 0x6c9f
movq %rax, %rdi
movq %r15, %rsi
callq 0x2060
jmp 0x6caa
movq %r14, %rdi
callq 0x2320
xorl %r14d, %r14d
testq %r14, %r14
je 0x6cd9
cmpq $0x0, (%rbx)
je 0x6ce3
movq (%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x10(%r14)
leaq 0x10(%rax), %rcx
testq %rax, %rax
cmoveq %rbx, %rcx
movq %r14, (%rcx)
incq 0x8(%rbx)
jmp 0x6c4d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x6c4f
movq %r14, (%rbx)
movq $0x1, 0x8(%rbx)
jmp 0x6c4d
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/cmap/map.c
// Function: map_del
void map_del(struct map_t* map, const char* key)
{
    struct map_find_results_t find_results = map_find(map, key);

    if (!find_results.exact_match) {
        return;
    }

    struct map_node_t* node = find_results.node;

    if (map->free_func && node->value) {
        (*map->free_func)(node->value);
    }

    if (node == map->head) {
        map->head = map->head->next;
    } else {
        find_results.prev_node->next = node->next;
    }

    free(node->key);
    free(node);

    map->size--;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rdx
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x6b7e
cmpw $0x0, 0x10(%r14)
je 0x6d60
movq 0x8(%rsp), %r14
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x6d2f
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x6d2f
callq *%rax
movq (%rbx), %rax
cmpq %rax, %r14
je 0x6d45
movq 0x10(%r14), %rax
movq (%rsp), %rcx
movq %rax, 0x10(%rcx)
jmp 0x6d4c
movq 0x10(%rax), %rax
movq %rax, (%rbx)
movq (%r14), %rdi
callq 0x2320
movq %r14, %rdi
callq 0x2320
decq 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/commander/commander.c
// Function: command_help
void
command_help(command_t *self) {
  printf("\n");
  printf("  Usage: %s %s\n", self->name, self->usage);
  printf("\n");
  printf("  Options:\n");
  printf("\n");

  int i;
  for (i = 0; i < self->option_count; ++i) {
    command_option_t *option = &self->options[i];
    printf("    %s, %-25s %s\n"
      , option->small
      , option->large_with_arg
      , option->description);
  }

  printf("\n");
  command_free(self);
  exit(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xa, %edi
callq 0x2040
movq 0x8(%rbx), %rdx
movq 0x18(%rbx), %rsi
leaq 0x25d5(%rip), %rdi      # 0x9369
xorl %eax, %eax
callq 0x20f0
movl $0xa, %edi
callq 0x2040
leaq 0x2743(%rip), %rdi      # 0x94ef
callq 0x2070
movl $0xa, %edi
callq 0x2040
cmpl $0x0, 0x28(%rbx)
jle 0x6df4
leaq 0x58(%rbx), %r15
leaq 0x25ad(%rip), %r14      # 0x9379
xorl %r12d, %r12d
movq -0x10(%r15), %rsi
movq -0x8(%r15), %rdx
movq (%r15), %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x20f0
incq %r12
movslq 0x28(%rbx), %rax
addq $0x38, %r15
cmpq %rax, %r12
jl 0x6dcf
movl $0xa, %edi
callq 0x2040
movq %rbx, %rdi
callq 0x6e0d
xorl %edi, %edi
callq 0x22b0
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/commander/commander.c
// Function: command_free
void
command_free(command_t *self) {
  int i;

  for (i = 0; i < self->option_count; ++i) {
    command_option_t *option = &self->options[i];
    free(option->argname);
    free(option->large);
  }

  if (self->nargv) {
    for (i = 0; self->nargv[i]; ++i) {
      free(self->nargv[i]);
    }
    free(self->nargv);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x28(%rdi)
jle 0x6e43
leaq 0x40(%rbx), %r14
xorl %r15d, %r15d
movq -0x8(%r14), %rdi
callq 0x2320
movq (%r14), %rdi
callq 0x2320
incq %r15
movslq 0x28(%rbx), %rax
addq $0x38, %r14
cmpq %rax, %r15
jl 0x6e22
cmpq $0x0, 0x838(%rbx)
je 0x6e88
movq 0x838(%rbx), %rax
movq (%rax), %rdi
testq %rdi, %rdi
je 0x6e7b
movl $0x8, %r14d
callq 0x2320
movq 0x838(%rbx), %rax
movq (%rax,%r14), %rdi
addq $0x8, %r14
testq %rdi, %rdi
jne 0x6e62
movq %rax, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x2320
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/commander/commander.c
// Function: command_init
void
command_init(command_t *self, const char *name, const char *version) {
  self->arg = NULL;
  self->name = name;
  self->version = version;
  self->option_count = self->argc = 0;
  self->usage = "[options]";
  self->nargv = NULL;
  command_option(self, "-V", "--version", "output program version", command_version);
  command_option(self, "-h", "--help", "output help information", command_help);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movq %rsi, 0x18(%rdi)
movq %rdx, 0x20(%rdi)
movl %eax, 0x730(%rdi)
movl %eax, 0x28(%rdi)
leaq 0x24db(%rip), %rcx      # 0x938b
movq %rcx, 0x8(%rdi)
movq %rax, 0x838(%rdi)
leaq 0x24d3(%rip), %rsi      # 0x9395
leaq 0x24cf(%rip), %rdx      # 0x9398
leaq 0x24d2(%rip), %rcx      # 0x93a2
leaq 0x18f(%rip), %r8        # 0x7066
callq 0x6f01
leaq 0x24d6(%rip), %rsi      # 0x93b9
leaq 0x24d2(%rip), %rdx      # 0x93bc
leaq 0x24d2(%rip), %rcx      # 0x93c3
leaq -0x188(%rip), %r8       # 0x6d70
movq %rbx, %rdi
popq %rbx
jmp 0x6f01
// File: /workspace/github_c_makefile_star2_O1/marcomorain[P]garcon/deps/commander/commander.c
// Function: command_option
void
command_option(command_t *self, const char *small, const char *large, const char *desc, command_callback_t cb) {
  if (self->option_count == COMMANDER_MAX_OPTIONS) {
    command_free(self);
    error("Maximum option definitions exceeded");
  }
  int n = self->option_count++;
  command_option_t *option = &self->options[n];
  option->cb = cb;
  option->small = small;
  option->description = desc;
  option->required_arg = option->optional_arg = 0;
  option->large_with_arg = large;
  option->argname = malloc(strlen(large) + 1);
  assert(option->argname);
  option->large = malloc(strlen(large) + 1);
  assert(option->large);
  parse_argname(large, option->large, option->argname);
  if ('[' == option->argname[0]) option->optional_arg = 1;
  if ('<' == option->argname[0]) option->required_arg = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
movslq 0x28(%rdi), %rax
cmpq $0x20, %rax
je 0x7020
movq %rdx, %rbx
leal 0x1(%rax), %edx
movl %edx, 0x28(%r15)
imulq $0x38, %rax, %r12
movq %r8, 0x60(%r15,%r12)
movq %rsi, 0x48(%r15,%r12)
movq %rcx, 0x58(%r15,%r12)
movq $0x0, 0x30(%r15,%r12)
movq %rbx, 0x50(%r15,%r12)
movq %rbx, %rdi
callq 0x20d0
leaq 0x1(%rax), %rdi
callq 0x21f0
movq %rax, 0x38(%r15,%r12)
testq %rax, %rax
je 0x7028
movq %rax, %r14
addq %r15, %r12
addq $0x30, %r12
movq %rbx, %rdi
callq 0x20d0
leaq 0x1(%rax), %rdi
callq 0x21f0
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x7047
movq %rax, %r15
movq %rbx, %rdi
callq 0x20d0
xorl %edi, %edi
testq %rax, %rax
je 0x6fe5
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
testl %edi, %edi
je 0x6fc3
movb (%rbx,%rsi), %dil
movb %dil, (%r14,%rdx)
incq %rdx
movl $0x1, %edi
incq %rsi
cmpq %rsi, %rax
jne 0x6fa5
jmp 0x6fe9
movzbl (%rbx,%rsi), %r8d
xorl %edi, %edi
cmpl $0x20, %r8d
je 0x6fb9
cmpl $0x5b, %r8d
je 0x6fa9
cmpl $0x3c, %r8d
je 0x6fa9
movb %r8b, (%r15,%rcx)
incq %rcx
jmp 0x6fb9
xorl %ecx, %ecx
xorl %edx, %edx
xorl %eax, %eax
movb %al, (%r14,%rdx)
movb %al, (%r15,%rcx)
movzbl (%r14), %eax
cmpl $0x3c, %eax
je 0x700b
cmpl $0x5b, %eax
jne 0x7014
movl $0x1, (%r12)
jmp 0x7014
movl $0x1, 0x4(%r12)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r15, %rdi
callq 0x24ca
leaq 0x23d0(%rip), %rdi      # 0x93ff
leaq 0x23d9(%rip), %rsi      # 0x940f
leaq 0x23ed(%rip), %rcx      # 0x942a
movl $0xb9, %edx
callq 0x2120
leaq 0x243b(%rip), %rdi      # 0x9489
leaq 0x23ba(%rip), %rsi      # 0x940f
leaq 0x23ce(%rip), %rcx      # 0x942a
movl $0xbb, %edx
callq 0x2120
// File: /workspace/github_c_makefile_star2_O1/ryo[P]shmqueue/shmclient.c
// Function: main
int
main(int argc, char *argv[])
{
	struct keyvalue kv;
	int ch, i, rc, nloop;
	int opt_d = 0, opt_t = 0;

	while ((ch = getopt(argc, argv, "dt")) != -1) {
		switch (ch) {
		case 'd':
			opt_d = 1;
			break;
		case 't':
			opt_t = 1;
			break;
		default:
			usage();
			return 1;
		}
	}
	argc -= optind;
	argv += optind;

	shmqueue = shmqueue_new(MEMID, 0, 1, 1);

	for (nloop = i = 0; i >= 0; i++, nloop++) {
#if 1
		char key[1024];
		char data[1024];

		sprintf(key, "%d", i);
		sprintf(data, "data of %d", i);

		rc = shmqueue_keyvalue_store(shmqueue, (uint8_t *)key, (uint8_t *)data, strlen(data));
		if (rc != 0) {
			if ((nloop & 0xffff) == 0)
				printf("���Ԥ���(%d)\n", i);
			i--;
			continue;
		}

		if ((i & 0xff) == 0)
			printf("��������(%d)\n", i);

		fflush(stdout);
#endif
	}

	(void)&rc;
	(void)&kv;
#if 0
	for (i = 0; i < 10000; i++) {
		rc = shmqueue_getoldest(shmqueue, &kv);
		printf("rc = %d\n", rc);
		fflush(stdout);

		if (rc == 0) {
			fprintf(stderr, "EXPIRE: key=<%s>, storage_size=%u, storage=<%s>\n",
			    KEYVALUE_KEY(&kv),
			    kv.kv_storagesize,
			    KEYVALUE_STORAGE(&kv));
		}
	}
#endif


	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x808, %rsp            # imm = 0x808
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x1df8(%rip), %r14      # 0x303d
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x10e0
cmpl $0x64, %eax
je 0x1245
cmpl $0x74, %eax
je 0x1245
cmpl $-0x1, %eax
jne 0x132f
movl $0x186a0, %edi          # imm = 0x186A0
xorl %esi, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x1891
movq %rax, 0x3e26(%rip)      # 0x50a8
leaq 0x400(%rsp), %r14
leaq 0x1d73(%rip), %r15      # 0x3004
movq %rsp, %r12
xorl %ebx, %ebx
xorl %r13d, %r13d
movq %r14, %rdi
leaq 0x1d69(%rip), %rsi      # 0x300c
movl %r13d, %edx
xorl %eax, %eax
callq 0x1110
movq %r12, %rdi
movq %r15, %rsi
movl %r13d, %edx
xorl %eax, %eax
callq 0x1110
movq 0x3de4(%rip), %rbp      # 0x50a8
movq %r12, %rdi
callq 0x1060
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
movl %eax, %ecx
callq 0x211c
testl %eax, %eax
je 0x12f8
testw %bx, %bx
jne 0x1320
leaq 0x1d23(%rip), %rdi      # 0x300f
movl %r13d, %esi
xorl %eax, %eax
callq 0x1070
jmp 0x1320
testb %r13b, %r13b
jne 0x130e
leaq 0x1d19(%rip), %rdi      # 0x301d
movl %r13d, %esi
xorl %eax, %eax
callq 0x1070
movq 0x3ccb(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
callq 0x10c0
incl %r13d
incl %ebx
testl %r13d, %r13d
jns 0x1299
xorl %eax, %eax
jmp 0x1340
leaq 0x1cf5(%rip), %rdi      # 0x302b
callq 0x1050
movl $0x1, %eax
addq $0x808, %rsp            # imm = 0x808
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/dlbeer[P]dhara/tests/jfill.c
// Function: main
int main(void)
{
	for (int i = 0; i < 100; i++) {
		printf("--------------------------------"
		       "--------------------------------\n");
		printf("Seed: %d\n", i);
		srandom(i);
		test();
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
leaq 0x1edf(%rip), %rbx      # 0x404e
leaq 0x1e8e(%rip), %r14      # 0x4004
xorl %ebp, %ebp
movq %rbx, %rdi
callq 0x1060
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1070
movl %ebp, %edi
callq 0x1050
callq 0x21a6
incl %ebp
cmpl $0x64, %ebp
jne 0x2178
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/dlbeer[P]dhara/tests/jfill.c
// Function: test
static void test(void)
{
	struct dhara_journal journal;
	const size_t page_size = 1 << sim_nand.log2_page_size;
	uint8_t page_buf[page_size];
	int rep;

	sim_reset();
	sim_inject_bad(10);
	sim_inject_failed(10);

	printf("Journal init\n");
	dhara_journal_init(&journal, &sim_nand, page_buf);
	printf("    capacity: %d\n", dhara_journal_capacity(&journal));
	printf("\n");

	for (rep = 0; rep < 5; rep++) {
		int count;

		printf("Rep: %d\n", rep);

		printf("    enqueue until error...\n");
		count = jt_enqueue_sequence(&journal, 0, -1);
		printf("    enqueue count: %d\n", count);
		printf("    size: %d\n", dhara_journal_size(&journal));

		printf("    dequeue...\n");
		jt_dequeue_sequence(&journal, 0, count);
		printf("    size: %d\n", dhara_journal_size(&journal));

		/* Only way to recover space here... */
		journal.tail_sync = journal.tail;
	}

	printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
leaq 0x1f1a(%rip), %r14      # 0x40d8
movb (%r14), %cl
movl $0x1, %eax
shll %cl, %eax
movq %rsp, -0x30(%rbp)
cltq
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
callq 0x22f8
movl $0xa, %edi
callq 0x2695
movl $0xa, %edi
callq 0x26e4
leaq 0x1e90(%rip), %rdi      # 0x408f
callq 0x1060
leaq -0x68(%rbp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x12ec
movq %rbx, %rdi
callq 0x186f
leaq 0x1de9(%rip), %rdi      # 0x400e
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movl $0xa, %edi
callq 0x1030
leaq 0x1e01(%rip), %r13      # 0x4040
leaq 0x1e71(%rip), %r14      # 0x40b7
xorl %r15d, %r15d
leaq 0x1dd0(%rip), %rdi      # 0x4020
movl %r15d, %esi
xorl %eax, %eax
callq 0x1070
leaq 0x1e3b(%rip), %rdi      # 0x409c
callq 0x1060
movq %rbx, %rdi
xorl %esi, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2b80
movl %eax, %r12d
leaq 0x1daa(%rip), %rdi      # 0x4029
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x1896
movq %r13, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movq %r14, %rdi
callq 0x1060
movq %rbx, %rdi
xorl %esi, %esi
movl %r12d, %edx
callq 0x2e3a
movq %rbx, %rdi
callq 0x1896
movq %r13, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0x1070
movl -0x48(%rbp), %eax
movl %eax, -0x4c(%rbp)
incl %r15d
cmpl $0x5, %r15d
jne 0x2249
movl $0xa, %edi
callq 0x1030
movq -0x30(%rbp), %rsp
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)