LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/mleak.c
// Function: mleak_malloc
void *mleak_malloc(size_t size, const char *filename, int line)
{
	struct mleak_mem_t *ent;
	time_t now;
	ent = (struct mleak_mem_t *) malloc(sizeof(struct mleak_mem_t) + size);
	ent->ptr = (void *)(((char *)ent) + sizeof(struct mleak_mem_t));
	ent->size = size;
	ent->filename = filename;
	ent->line = line;
	now = time(NULL);
	strftime(ent->time, sizeof(ent->time), "%Y-%m-%d %H:%M:%S", localtime(&now));
	append_mem_ent(ent);
	return ent->ptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
addq $0x50, %rdi
callq 0x22e0
movq %rax, %rbx
addq $0x50, %rax
movq %rax, 0x10(%rbx)
movq %r15, 0x18(%rbx)
movq %r14, 0x20(%rbx)
movl %ebp, 0x28(%rbx)
xorl %edi, %edi
callq 0x21e0
movq %rsp, %rdi
movq %rax, (%rdi)
movq %rbx, %r14
addq $0x2c, %r14
callq 0x2160
leaq 0x1197(%rip), %rdx      # 0x7079
movl $0x20, %esi
movq %r14, %rdi
movq %rax, %rcx
callq 0x2190
movq 0x63f7(%rip), %rax      # 0xc2f0
testq %rax, %rax
je 0x5f0a
movq %rax, 0x8(%rbx)
movq (%rax), %rcx
movq %rcx, (%rbx)
jmp 0x5f17
movq %rbx, 0x63df(%rip)      # 0xc2f0
movq %rbx, %rcx
movq %rbx, %rax
movq %rbx, 0x8(%rcx)
movq %rbx, (%rax)
movq 0x10(%rbx), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/mleak.c
// Function: mleak_free
void mleak_free(void *ptr)
{
    if (!ptr) return;
	struct mleak_mem_t *ent;
	ent = (struct mleak_mem_t *)(((char *)ptr) - sizeof(struct mleak_mem_t));
	remove_mem_ent(ent);
	free(ent);
}

// Assembly:
testq %rdi, %rdi
je 0x5f7b
movq %rdi, %rax
addq $-0x50, %rdi
movq -0x48(%rax), %rcx
cmpq %rdi, %rcx
je 0x5f7c
movq 0x6399(%rip), %rdx      # 0xc2f0
cmpq %rdi, %rdx
jne 0x5f67
movq 0x8(%rdx), %rdx
movq %rdx, 0x6389(%rip)      # 0xc2f0
movq -0x50(%rax), %rdx
movq %rcx, 0x8(%rdx)
movq -0x48(%rax), %rax
movq %rdx, (%rax)
jmp 0x2290
retq
movq $0x0, 0x6369(%rip) # 0xc2f0
jmp 0x2290
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/mleak.c
// Function: mleak_realloc
void* mleak_realloc(void* ptr, size_t size, const char* filename, int line)
{
	void* newptr = mleak_malloc(size, filename, line);
	if (!newptr) return NULL;
	if (ptr) {
		struct mleak_mem_t* ent;
		ent = (struct mleak_mem_t*)(((char*)ptr) - sizeof(struct mleak_mem_t));
		memcpy(newptr, ptr, MIN(size, ent->size));
		mleak_free(ptr);
	}
	return newptr;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movq %rdx, %rsi
movl %ecx, %edx
callq 0x5e94
movq %rax, %r14
testq %rax, %rax
sete %al
testq %rbx, %rbx
sete %cl
orb %al, %cl
jne 0x5fd8
movq -0x38(%rbx), %rax
cmpq %r15, %rax
cmovbq %rax, %r15
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21a0
movq %rbx, %rdi
callq 0x5f3b
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/mleak.c
// Function: mleak_strdup
void* mleak_strdup(const char *s, const char* filename, int line)
{
	int len = strlen(s);
	void* newptr = mleak_malloc(len + 1, filename, line);
	if (!newptr) return NULL;
	memcpy(newptr, s, len + 1);
	return newptr;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
callq 0x20e0
incl %eax
movslq %eax, %r14
movq %r14, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x5e94
testq %rax, %rax
je 0x6024
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x21a0
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/mleak.c
// Function: mleak_print_leak
void mleak_print_leak()
{
	struct mleak_mem_t *ent, *p;
	if (!_mem) return;
	ent = _mem;
	do {
		_print(ent->ptr, ent->filename, ent->line, ent->time);
		ent = ent->next;
	} while(ent != _mem);
	ent = _mem;
	do {
		p = ent;
		ent = ent->next;
		free(p);
	} while(ent != _mem);
	_mem = 0;
}

// Assembly:
pushq %rbx
movq 0x62ab(%rip), %rbx      # 0xc2f0
testq %rbx, %rbx
je 0x608f
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rsi
movl 0x28(%rbx), %edx
leaq 0x2c(%rbx), %rcx
callq *0x61a9(%rip)           # 0xc208
movq 0x8(%rbx), %rbx
movq 0x6286(%rip), %rdi      # 0xc2f0
cmpq %rdi, %rbx
jne 0x604a
movq 0x8(%rdi), %rbx
callq 0x2290
movq %rbx, %rdi
cmpq 0x626e(%rip), %rbx      # 0xc2f0
jne 0x606f
movq $0x0, 0x6261(%rip) # 0xc2f0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/GangZhuo[P]dohclient/src/dohclient-cache.c
// Function: is_digitstr
static int is_digitstr(const char *s)
{
	const char *p = s;
	while (*p) {
		if (!isdigit(*p))
			return FALSE;
		p++;
	}
	return TRUE;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movb (%rdi), %bpl
movl $0x1, %ebx
testb %bpl, %bpl
je 0x6e20
movq %rdi, %r14
callq 0x2230
movq (%rax), %rax
incq %r14
movsbq %bpl, %rcx
testb $0x8, 0x1(%rax,%rcx,2)
je 0x6e1e
movb (%r14), %bpl
incq %r14
testb %bpl, %bpl
jne 0x6e06
jmp 0x6e20
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/chbarts[P]aa-tree/aa-test1.c
// Function: main
int main(int argc, char *argv[])
{
    aa *tree;
    FILE *fin;
    int i;

    if ((tree = aa_new(comparator)) == NULL) {
        fprintf(stderr, "aa_new error\n");
        exit(EXIT_FAILURE);
    }

    if (argc == 1) {
        dofile("stdin", stdin, tree);
    } else {
        for (i = 1; i < argc; i++) {
            if ((fin = fopen(argv[i], "rb")) == NULL) {
                handle_ferr(argv[i], "aa-test1");
                continue;
            }

            dofile(argv[i], fin, tree);

            if (fclose(fin) == EOF) {
                handle_ferr(argv[i], "aa-test1");
            }
        }
    }

    aa_print(tree, stdout, print);

    cleanup(tree);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movl %edi, %ebp
leaq 0xc9(%rip), %rdi        # 0x1d30
callq 0x13f8
testq %rax, %rax
je 0x1d2b
movq %rax, %rbx
cmpl $0x1, %ebp
jne 0x1c98
movq 0x2354(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
leaq 0x42f(%rip), %rdi       # 0x20bd
movq %rbx, %rdx
callq 0x1d47
jmp 0x1cf1
jle 0x1cf1
movl %ebp, %ebp
movl $0x1, %r12d
leaq 0x41a(%rip), %r15       # 0x20c3
movq (%r14,%r12,8), %rdi
movq %r15, %rsi
callq 0x10e0
movq (%r14,%r12,8), %rdi
testq %rax, %rax
je 0x1cdd
movq %rax, %r13
movq %rax, %rsi
movq %rbx, %rdx
callq 0x1d47
movq %r13, %rdi
callq 0x1050
cmpl $-0x1, %eax
jne 0x1ce9
movq (%r14,%r12,8), %rdi
leaq 0x3e2(%rip), %rsi       # 0x20c6
callq 0x1140
incq %r12
cmpq %r12, %rbp
jne 0x1ca9
movq 0x22d8(%rip), %rax      # 0x3fd0
movq (%rax), %rsi
leaq 0xca(%rip), %rdx        # 0x1dcc
movq %rbx, %rdi
callq 0x1acc
movq %rbx, %rdi
callq 0x1947
movq %rbx, %rdi
callq 0x1963
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1178
// File: /workspace/github_c_makefile_star2_O3/chbarts[P]aa-tree/aa-test1.c
// Function: dofile
static void dofile(char *fname, FILE * fin, aa * tree)
{
    char *ln;

    while (fggets(&ln, fin) == 0) {
        switch (aa_add(tree, ln, duplicate)) {
        case 0:                /* no error */
            break;
        case 2:                /* memory error */
            free(ln);
            error(tree);
            break;
        default:               /* can't happen */
            fprintf(stderr, "can't happen\n");
            free(ln);
            cleanup(tree);
            exit(EXIT_FAILURE);
            break;
        }
    }

    if (ferror(fin) != 0)
        handle_ferr(fname, "aa-test1");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rsp), %r12
leaq 0x83(%rip), %r13        # 0x1dec
movq %r12, %rdi
movq %r15, %rsi
callq 0x130c
testl %eax, %eax
jne 0x1d9e
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
movq %r13, %rdx
callq 0x1420
testl %eax, %eax
je 0x1d69
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
cmpl $0x2, %eax
jne 0x1dc7
callq 0x119d
movq %r15, %rdi
callq 0x1040
testl %eax, %eax
je 0x1db9
leaq 0x315(%rip), %rsi       # 0x20c6
movq %r14, %rdi
callq 0x1140
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x11d5
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_kv.c
// Function: dynamodb_kv_put
char *
dynamodb_kv_put(const char * table, const char * key,
    const uint8_t * buf, size_t len)
{
	/**
	 * The body of a PutItem request (with spaces added) is:
	 * { "TableName": "TABLE",
	 *   "Item": {
	 *     "K": { "S": "KEY" },
	 *     "V": { "B": "BASE64VALUE" }
	 *   },
	 *   "ReturnConsumedCapacity": "TOTAL"
	 * }
	 */
	const char * s1 = "{\"TableName\":\"";
	const char * s2 = "\",\"Item\":{\"K\":{\"S\":\"";
	const char * s3 = "\"},\"V\":{\"B\":\"";
	const char * s4 = "\"}},\"ReturnConsumedCapacity\":\"TOTAL\"}";
	size_t slen = strlen(s1) + strlen(table) + strlen(s2) + strlen(key) +
	    strlen(s3) + b64len(len) + strlen(s4);
	size_t spos = 0;
	char * s;

	/* Allocate request string. */
	if ((s = malloc(slen + 1)) == NULL)
		goto done;

	/* Construct the request, piece by piece. */
	COPYANDINCR(s, spos, s1);
	COPYANDINCR(s, spos, table);
	COPYANDINCR(s, spos, s2);
	COPYANDINCR(s, spos, key);
	COPYANDINCR(s, spos, s3);
	b64encode(buf, &s[spos], len);
	spos += b64len(len);
	COPYANDINCR(s, spos, s4);
	s[spos] = '\0';

	/* Check that we got the buffer size right. */
	assert(slen == spos);

done:
	/* Return string (or NULL if allocation failed). */
	return (s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, %r14
movq %rdx, 0x20(%rsp)
movq %rsi, %r15
movq %rdi, %rbx
callq 0x3190
movq %rax, %r12
movq %r15, 0x18(%rsp)
movq %r15, %rdi
callq 0x3190
movq %rax, 0x10(%rsp)
leaq (%r12,%rax), %rbp
addq $0x22, %rbp
leaq 0x2(%r14), %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
mulq %rcx
movq %rdx, %r15
addq %rdx, %r15
andq $-0x4, %r15
leaq (%r15,%rbp), %rdi
addq $0x33, %rdi
callq 0x34c0
movq %rax, %r13
testq %rax, %rax
je 0x5b3d
movq %r14, 0x8(%rsp)
movq %r12, %r14
addq $0x22, %r14
movabsq $0x223a22656d614e65, %rax # imm = 0x223A22656D614E65
movq %rax, 0x6(%r13)
movabsq $0x4e656c626154227b, %rax # imm = 0x4E656C626154227B
movq %rax, (%r13)
leaq 0xe(%r13), %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x3280
movups 0xbb18(%rip), %xmm0     # 0x115c4
movups %xmm0, 0xe(%r13,%r12)
movl $0x223a2253, 0x1e(%r13,%r12) # imm = 0x223A2253
addq %r13, %r14
movq %r14, %rdi
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdx
callq 0x3280
movq %r13, %rbx
addq %rbp, %rbx
movabsq $0x7b3a2256222c7d22, %rax # imm = 0x7B3A2256222C7D22
movq %rax, (%r13,%rbp)
movabsq $0x223a2242227b3a22, %rax # imm = 0x223A2242227B3A22
movq %rax, 0x5(%r13,%rbp)
leaq 0xd(,%rbp), %rsi
addq %r13, %rsi
movq 0x20(%rsp), %rdi
movq 0x8(%rsp), %rdx
callq 0xb144
movabsq $0x7d224c41544f5422, %rax # imm = 0x7D224C41544F5422
movq %rax, 0x2a(%r15,%rbx)
movups 0xbad3(%rip), %xmm0     # 0x115f7
movups %xmm0, 0x1d(%r15,%rbx)
movups 0xbab6(%rip), %xmm0     # 0x115e7
movups %xmm0, 0xd(%r15,%rbx)
movb $0x0, 0x32(%r15,%rbx)
movq %r13, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_kv.c
// Function: dynamodb_kv_get
char *
dynamodb_kv_get(const char * table, const char * key)
{
	/**
	 * The body of a GetItem request (with spaces added) is:
	 * { "TableName": "TABLE",
	 *   "Key": {
	 *     "K": { "S": "KEY" }
	 *   },
	 *   "ReturnConsumedCapacity": "TOTAL"
	 * }
	 */
	const char * s1 = "{\"TableName\":\"";
	const char * s2 = "\",\"Key\":{\"K\":{\"S\":\"";
	const char * s3 = "\"}},\"ReturnConsumedCapacity\":\"TOTAL\"}";
	size_t slen = strlen(s1) + strlen(table) + strlen(s2) + strlen(key) +
	    strlen(s3);
	size_t spos = 0;
	char * s;

	/* Allocate request string. */
	if ((s = malloc(slen + 1)) == NULL)
		goto done;

	/* Construct the request, piece by piece. */
	COPYANDINCR(s, spos, s1);
	COPYANDINCR(s, spos, table);
	COPYANDINCR(s, spos, s2);
	COPYANDINCR(s, spos, key);
	COPYANDINCR(s, spos, s3);
	s[spos] = '\0';

	/* Check that we got the buffer size right. */
	assert(slen == spos);

done:
	/* Return string (or NULL if allocation failed). */
	return (s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r13
callq 0x3190
movq %rax, %r12
movq %rbx, %rdi
callq 0x3190
movq %rax, %r15
leaq (%r12,%rax), %rdi
addq $0x47, %rdi
callq 0x34c0
movq %rax, %r14
testq %rax, %rax
je 0x5ffc
movq %rbx, (%rsp)
leaq (%r12,%r15), %rbx
addq $0x21, %rbx
movq %r12, %rbp
addq $0x21, %rbp
movabsq $0x223a22656d614e65, %rax # imm = 0x223A22656D614E65
movq %rax, 0x6(%r14)
movabsq $0x4e656c626154227b, %rax # imm = 0x4E656C626154227B
movq %rax, (%r14)
leaq 0xe(%r14), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3280
movups 0xb738(%rip), %xmm0     # 0x116e5
movups %xmm0, 0xe(%r14,%r12)
movl $0x223a2253, 0x1d(%r14,%r12) # imm = 0x223A2253
addq %r14, %rbp
movq %rbp, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x3280
movabsq $0x7d224c41544f5422, %rax # imm = 0x7D224C41544F5422
movq %rax, 0x1d(%r14,%rbx)
movups 0xb603(%rip), %xmm0     # 0x115e7
movups %xmm0, (%r14,%rbx)
movups 0xb607(%rip), %xmm0     # 0x115f7
movups %xmm0, 0x10(%r14,%rbx)
movb $0x0, 0x25(%r14,%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_kv.c
// Function: dynamodb_kv_getc
char *
dynamodb_kv_getc(const char * table, const char * key)
{
	/**
	 * The body of a strongly consistent GetItem request (with spaces
	 * added) is:
	 * { "ConsistentRead": true,
	 *   "TableName": "TABLE",
	 *   "Key": {
	 *     "K": { "S": "KEY" }
	 *   },
	 *   "ReturnConsumedCapacity": "TOTAL"
	 * }
	 */
	const char * s1 = "{\"ConsistentRead\":true,\"TableName\":\"";
	const char * s2 = "\",\"Key\":{\"K\":{\"S\":\"";
	const char * s3 = "\"}},\"ReturnConsumedCapacity\":\"TOTAL\"}";
	size_t slen = strlen(s1) + strlen(table) + strlen(s2) + strlen(key) +
	    strlen(s3);
	size_t spos = 0;
	char * s;

	/* Allocate request string. */
	if ((s = malloc(slen + 1)) == NULL)
		goto done;

	/* Construct the request, piece by piece. */
	COPYANDINCR(s, spos, s1);
	COPYANDINCR(s, spos, table);
	COPYANDINCR(s, spos, s2);
	COPYANDINCR(s, spos, key);
	COPYANDINCR(s, spos, s3);
	s[spos] = '\0';

	/* Check that we got the buffer size right. */
	assert(slen == spos);

done:
	/* Return string (or NULL if allocation failed). */
	return (s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r13
callq 0x3190
movq %rax, %r12
movq %rbx, %rdi
callq 0x3190
movq %rax, %r15
leaq (%r12,%rax), %rdi
addq $0x5d, %rdi
callq 0x34c0
movq %rax, %r14
testq %rax, %rax
je 0x60e2
movq %rbx, (%rsp)
leaq (%r12,%r15), %rbx
addq $0x37, %rbx
movq %r12, %rbp
addq $0x37, %rbp
movups 0xb6a4(%rip), %xmm0     # 0x11709
movups %xmm0, 0x10(%r14)
movups 0xb688(%rip), %xmm0     # 0x116f9
movups %xmm0, (%r14)
movl $0x223a2265, 0x20(%r14) # imm = 0x223A2265
leaq 0x24(%r14), %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x3280
movups 0xb652(%rip), %xmm0     # 0x116e5
movups %xmm0, 0x24(%r14,%r12)
movl $0x223a2253, 0x33(%r14,%r12) # imm = 0x223A2253
addq %r14, %rbp
movq %rbp, %rdi
movq (%rsp), %rsi
movq %r15, %rdx
callq 0x3280
movabsq $0x7d224c41544f5422, %rax # imm = 0x7D224C41544F5422
movq %rax, 0x1d(%r14,%rbx)
movups 0xb51d(%rip), %xmm0     # 0x115e7
movups %xmm0, (%r14,%rbx)
movups 0xb521(%rip), %xmm0     # 0x115f7
movups %xmm0, 0x10(%r14,%rbx)
movb $0x0, 0x25(%r14,%rbx)
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_kv.c
// Function: dynamodb_kv_extractv
int
dynamodb_kv_extractv(const uint8_t * inbuf, size_t inlen,
    uint8_t ** outbuf, uint32_t * outlen)
{
	const uint8_t * p = inbuf;
	const uint8_t * end = &inbuf[inlen];
	size_t slen;
	size_t vlen;

	/* If we have no response body, there is no value. */
	if (inbuf == NULL)
		goto novalue;

	/**
	 * We need to locate B64VALUE in the string
	 * {"Item":{"V":{"B":"dmFsdWUK"},"K":{"S":"key"}}}
	 * so we look for the json object associated with "Item"; then look
	 * for the json object associated with "V" inside that; then look
	 * for the json object associated with "B" inside that.
	 */
	p = json_find(p, end, "Item");
	p = json_find(p, end, "V");
	p = json_find(p, end, "B");

	/* We should be pointing at the opening '"' of a string. */
	if (p == end)
		goto novalue;
	if (*p++ != '"')
		goto novalue;

	/* How long is it? */
	for (slen = 0; &p[slen] != end; slen++) {
		if (p[slen] == '"')
			break;
	}

	/* We should have found a terminating '"'. */
	if (&p[slen] == end)
		goto novalue;

	/* Bail if the value of "B" is less than 4 characters. */
	if (slen < 4)
		goto novalue;

	/* Allocate a buffer. */
	if ((*outbuf = malloc((slen / 4) * 3)) == NULL)
		goto err0;

	/* Attempt to parse the base64-encoded data. */
	if (b64decode((const char *)p, slen, *outbuf, &vlen))
		goto novalue1;

	/* Record the size of the returned value. */
	if (vlen >= (uint32_t)(-1))
		goto novalue1;
	*outlen = (uint32_t)vlen;

	/* Success! */
	return (0);

novalue1:
	free(*outbuf);
novalue:
	/* We have no value. */
	*outbuf = NULL;

	/* Success!  (Or at least, no internal error.) */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
testq %rdi, %rdi
je 0x62b8
movq %rcx, %r14
movq %rsi, %r15
addq %rdi, %r15
leaq 0xaf7e(%rip), %rdx      # 0x1117d
movq %r15, %rsi
callq 0xb2e4
leaq 0xb510(%rip), %rdx      # 0x1171e
movq %rax, %rdi
movq %r15, %rsi
callq 0xb2e4
leaq 0xb500(%rip), %rdx      # 0x11720
movq %rax, %rdi
movq %r15, %rsi
callq 0xb2e4
cmpq %r15, %rax
je 0x62b8
movq %rax, %r12
incq %r12
cmpb $0x22, (%rax)
setne %al
cmpq %r15, %r12
sete %cl
orb %al, %cl
jne 0x62b8
xorl %r13d, %r13d
cmpb $0x22, (%r12,%r13)
je 0x6265
leaq (%r12,%r13), %rax
incq %rax
incq %r13
cmpq %r15, %rax
jne 0x624d
jmp 0x62b8
cmpq $0x4, %r13
jb 0x62b8
movq %r13, %rax
shrq $0x2, %rax
leaq (%rax,%rax,2), %rdi
callq 0x34c0
movq %rax, (%rbx)
testq %rax, %rax
je 0x62cf
leaq 0x8(%rsp), %r15
movq %r12, %rdi
movq %r13, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0xb1b8
testl %eax, %eax
setne %cl
movq (%r15), %rax
movl $0xfffffffe, %edx       # imm = 0xFFFFFFFE
cmpq %rdx, %rax
seta %dl
orb %cl, %dl
je 0x62d6
movq (%rbx), %rdi
callq 0x3450
movq $0x0, (%rbx)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x62c1
movl %eax, (%r14)
jmp 0x62bf
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_request_queue.c
// Function: dynamodb_request_queue
int
dynamodb_request_queue(struct dynamodb_request_queue * Q, int prio,
    const char * op, const char * body, size_t maxrlen, const char * logstr,
    int (* callback)(void *, struct http_response *, const char *),
    void * cookie)
{
	struct request * R;

	/* Allocate and fill request structure. */
	if ((R = malloc(sizeof(struct request))) == NULL)
		goto err0;
	R->Q = Q;
	R->op = op;
	R->body = (const uint8_t *)body;
	R->bodylen = strlen(body);
	R->maxrlen = maxrlen;
	R->callback = callback;
	R->cookie = cookie;
	R->http_cookie = NULL;
	R->timeout_cookie = NULL;
	R->addrs[0] = NULL;
	R->addrs[1] = NULL;
	R->prio = prio;
	R->reqnum = Q->reqnum++;
	R->rc = 0;
	R->ntries = 0;

	/* Duplicate the additional logging data. */
	if (logstr != NULL) {
		if ((R->logstr = strdup(logstr)) == NULL)
			goto err1;
	} else {
		R->logstr = NULL;
	}

	/* Add the request to the queue. */
	if (ptrheap_add(Q->reqs, R))
		goto err2;

	/* Poke the request queue if necessary. */
	if (poke(Q))
		goto err3;

	/* Success! */
	return (0);

err3:
	ptrheap_delete(Q->reqs, R->rc);
err2:
	free(R->logstr);
err1:
	free(R);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, 0x10(%rsp)
movq %r8, %r12
movq %rcx, %r15
movq %rdx, %rbp
movl %esi, 0xc(%rsp)
movq %rdi, %r14
movl $0x90, %edi
callq 0x34c0
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x65ab
movq %rax, %rbx
movq 0x50(%rsp), %r13
movq %r14, (%rax)
movq %rbp, 0x8(%rax)
movq %r15, 0x10(%rax)
movq %r15, %rdi
callq 0x3190
movq %rax, 0x18(%rbx)
movq %r12, 0x20(%rbx)
movq %r13, 0x30(%rbx)
movq 0x58(%rsp), %rax
movq %rax, 0x38(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rbx)
movups %xmm0, 0x50(%rbx)
movl 0xc(%rsp), %eax
movl %eax, 0x78(%rbx)
movq 0x78(%r14), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x78(%r14)
movq %rax, 0x80(%rbx)
xorl %eax, %eax
movq %rax, 0x88(%rbx)
movq %rax, 0x60(%rbx)
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x657c
callq 0x35e0
movq %rax, 0x28(%rbx)
testq %rax, %rax
jne 0x6584
jmp 0x659d
movq $0x0, 0x28(%rbx)
movq 0x70(%r14), %rdi
movq %rbx, %rsi
callq 0x859f
testl %eax, %eax
je 0x65bd
movq 0x28(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
callq 0x3450
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movl %r13d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %r13d, %r13d
cmpq $0x0, 0x60(%r14)
jne 0x65ab
leaq 0x114(%rip), %rdi       # 0x66e2
xorl %r13d, %r13d
movq %r14, %rsi
xorl %edx, %edx
callq 0x44ec
movq %rax, 0x60(%r14)
testq %rax, %rax
jne 0x65ab
movq 0x70(%r14), %rdi
movq 0x88(%rbx), %rsi
callq 0x86d3
jmp 0x6594
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_request_queue.c
// Function: dynamodb_request_queue_flush
void
dynamodb_request_queue_flush(struct dynamodb_request_queue * Q)
{
	struct request * R;

	/* Pull requests off the queue until there are none left. */
	while ((R = ptrheap_getmin(Q->reqs)) != NULL) {
		/* Delete it from the queue. */
		ptrheap_deletemin(Q->reqs);

		/* Cancel any in-progress operation. */
		if (R->timeout_cookie != NULL)
			events_timer_cancel(R->timeout_cookie);
		if (R->http_cookie != NULL) {
			http_request_cancel(R->http_cookie);
			sock_addr_free(R->addrs[0]);
			Q->inflight--;
		}

		/* Free the request. */
		free(R->logstr);
		free(R);
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rdi), %rdi
callq 0x86b0
testq %rax, %rax
je 0x6662
movq %rax, %r14
movq 0x70(%rbx), %rdi
callq 0x88c5
movq 0x58(%r14), %rdi
testq %rdi, %rdi
je 0x6625
callq 0x536e
movq 0x50(%r14), %rdi
testq %rdi, %rdi
je 0x6640
callq 0x8df7
movq 0x40(%r14), %rdi
callq 0xbf6e
decq 0x68(%rbx)
movq 0x28(%r14), %rdi
callq 0x3450
movq %r14, %rdi
callq 0x3450
movq 0x70(%rbx), %rdi
callq 0x86b0
movq %rax, %r14
testq %rax, %rax
jne 0x660e
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_request_queue.c
// Function: dynamodb_request_queue_free
void
dynamodb_request_queue_free(struct dynamodb_request_queue * Q)
{

	/* Flush the queue. */
	dynamodb_request_queue_flush(Q);

	/* Stop the rate-limiting timer (if any). */
	if (Q->timer_cookie != NULL)
		events_timer_cancel(Q->timer_cookie);

	/* Cancel the immediate callback (if any). */
	if (Q->immediate_cookie != NULL)
		events_immediate_cancel(Q->immediate_cookie);

	/* Free the (now empty) request queue. */
	ptrheap_free(Q->reqs);

	/* Free string allocated by strdup. */
	free(Q->region);

	/* Free the AWS keys. */
	insecure_memzero(Q->key_secret, strlen(Q->key_secret));
	free(Q->key_secret);
	free(Q->key_id);

	/* Free the request queue structure. */
	free(Q);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x65f6
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x6684
callq 0x536e
movq 0x60(%rbx), %rdi
testq %rdi, %rdi
je 0x6692
callq 0x45de
movq 0x70(%rbx), %rdi
callq 0x891b
movq 0x10(%rbx), %rdi
callq 0x3450
movq 0x8(%rbx), %r14
movq %r14, %rdi
callq 0x3190
leaq 0x11f21(%rip), %rcx     # 0x185d8
movq (%rcx), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq *%rcx
movq 0x8(%rbx), %rdi
callq 0x3450
movq (%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_request_queue.c
// Function: callback_timeout
static int
callback_timeout(void * cookie)
{
	struct request * R = cookie;
	struct dynamodb_request_queue * Q = R->Q;

	/* We are no longer waiting for a timer callback. */
	R->timeout_cookie = NULL;

	/* Clean up the HTTP request. */
	if ((R->http_cookie != NULL) && done_http(R, 1))
		goto err0;

	/* The priority of this request has changed. */
	ptrheap_decrease(Q->reqs, R->rc);

	/*
	 * Poke the queue -- this request has moved from "in progress" back
	 * to "waiting to be sent", so it might be possible to send it now.
	 */
	if (poke(Q))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq (%rdi), %rbx
movq $0x0, 0x58(%rdi)
cmpq $0x0, 0x50(%rdi)
je 0x6a01
movq %r14, %rdi
movl $0x1, %esi
callq 0x6e5b
testl %eax, %eax
je 0x6a01
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x6a36
movq 0x70(%rbx), %rdi
movq 0x88(%r14), %rsi
callq 0x88cc
xorl %ebp, %ebp
cmpq $0x0, 0x60(%rbx)
jne 0x6a36
leaq -0x33f(%rip), %rdi      # 0x66e2
xorl %ebp, %ebp
movq %rbx, %rsi
xorl %edx, %edx
callq 0x44ec
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x69fa
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_request_queue.c
// Function: done_http
static int
done_http(struct request * R, int timedout)
{
	struct dynamodb_request_queue * Q = R->Q;
	struct timeval t_end;
	int rc = 0;

	/* Cancel the request if we timed out. */
	if (timedout) {
		http_request_cancel(R->http_cookie);
		if (Q->logfile) {
			if (monoclock_get(&t_end)) {
				warnp("monoclock_get");
				t_end = R->t_start;
				rc = -1;
			}
			if (logreq(Q->logfile, R, NULL, 0.0, t_end, NULL))
				rc = -1;
		}
	}

	/* There is no longer a request in flight. */
	R->http_cookie = NULL;
	Q->inflight--;
	sock_addr_free(R->addrs[0]);
	R->addrs[0] = NULL;

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq (%rdi), %r12
xorl %r14d, %r14d
testl %esi, %esi
je 0x6f08
movq 0x50(%rbx), %rdi
callq 0x8df7
cmpq $0x0, 0x80(%r12)
je 0x6f08
movq %rsp, %rdi
callq 0x54fc
xorl %r14d, %r14d
movl $0x0, %ebp
testl %eax, %eax
je 0x6edf
callq 0x3040
cmpl $0x0, (%rax)
je 0x6ec4
movq %rax, %r15
leaq 0xa90c(%rip), %rdi      # 0x117c0
xorl %eax, %eax
callq 0x57b8
movl $0x0, (%r15)
jmp 0x6ed2
leaq 0xa8f5(%rip), %rdi      # 0x117c0
xorl %eax, %eax
callq 0x58d7
movups 0x68(%rbx), %xmm0
movaps %xmm0, (%rsp)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq 0x80(%r12), %rdi
movq (%rsp), %rcx
movq 0x8(%rsp), %r8
xorps %xmm0, %xmm0
movq %rbx, %rsi
xorl %edx, %edx
xorl %r9d, %r9d
callq 0x6f31
negl %eax
sbbl %r14d, %r14d
orl %ebp, %r14d
xorl %r15d, %r15d
movq %r15, 0x50(%rbx)
decq 0x68(%r12)
movq 0x40(%rbx), %rdi
callq 0xbf6e
movq %r15, 0x40(%rbx)
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/dynamodb/dynamodb_request_queue.c
// Function: logreq
static int
logreq(struct logging_file * F, struct request * R,
    struct http_response * res, double capacity,
    struct timeval t_end, char * ddberr)
{
	long t_micros;
	char * addr;
	int status;
	size_t bodylen;

	/* Compute how long the request took. */
	t_micros = (long)(t_end.tv_sec - R->t_start.tv_sec) * 1000000 +
	    t_end.tv_usec - R->t_start.tv_usec;

	/* Prettyprint the address we selected. */
	if ((addr = sock_addr_prettyprint(R->addrs[0])) == NULL)
		goto err0;

	/* Extract parameters from HTTP response. */
	if (res != NULL) {
		status = res->status;
		bodylen = res->bodylen;
	} else {
		status = 0;
		bodylen = 0;
	}

	/* Write to the log file. */
	if (logging_printf(F, "|%s|%s|%d|%s|%ld|%zu|%f|%s",
	    R->op, R->logstr ? R->logstr : "",
	    status, addr, t_micros, bodylen, capacity,
	    ddberr ? ddberr : ""))
		goto err1;

	/* Free string allocated by sock_addr_prettyprint. */
	free(addr);

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %r8, %rbx
movq %rcx, %r15
movsd %xmm0, 0x10(%rsp)
movq %rdx, %r13
movq %rsi, %rbp
subq 0x68(%rsi), %r15
movq %rdi, 0x8(%rsp)
subq 0x70(%rsi), %rbx
movq 0x40(%rsi), %rdi
callq 0xc67f
testq %rax, %rax
je 0x6f8e
movq %rax, %r12
imulq $0xf4240, %r15, %rax    # imm = 0xF4240
addq %rax, %rbx
xorl %r15d, %r15d
testq %r13, %r13
je 0x6f96
movl (%r13), %r8d
movq 0x18(%r13), %r10
jmp 0x6f9c
movl $0xffffffff, %r15d      # imm = 0xFFFFFFFF
jmp 0x6ff3
xorl %r8d, %r8d
xorl %r10d, %r10d
movq 0x28(%rbp), %rcx
testq %rcx, %rcx
leaq 0xaf30(%rip), %rax      # 0x11eda
cmoveq %rax, %rcx
movq 0x8(%rbp), %rdx
testq %r14, %r14
cmoveq %rax, %r14
subq $0x8, %rsp
leaq 0xa80a(%rip), %rsi      # 0x117ce
movq 0x10(%rsp), %rdi
movq %r12, %r9
movsd 0x18(%rsp), %xmm0
movb $0x1, %al
pushq %r14
pushq %r10
pushq %rbx
callq 0x7443
addq $0x20, %rsp
movq %rax, %rbx
movq %r12, %rdi
callq 0x3450
negq %rbx
sbbl %r15d, %r15d
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/logging/logging.c
// Function: logging_open
struct logging_file *
logging_open(const char * path)
{
	struct logging_file * F;

	/* Allocate a log file structure. */
	if ((F = malloc(sizeof(struct logging_file))) == NULL)
		goto err0;

	/* Duplicate the provided path. */
	if ((F->path = strdup(path)) == NULL)
		goto err1;

	/* Open the file. */
	if ((F->fd = doopen(F->path)) == -1)
		goto err2;

	/* Start the has-file-moved timer. */
	if ((F->timer_cookie =
	    events_timer_register_double(callback_timer, F, 1.0)) == NULL)
		goto err3;

	/* Success! */
	return (F);

err3:
	if (close(F->fd))
		warnp("close");
err2:
	free(F->path);
err1:
	free(F);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x18, %edi
callq 0x34c0
testq %rax, %rax
je 0x70b3
movq %rax, %rbx
movq %r14, %rdi
callq 0x35e0
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x70ab
movq %rax, %rdi
callq 0x70c0
movl %eax, (%rbx)
cmpl $-0x1, %eax
je 0x70a2
leaq 0x290(%rip), %rdi       # 0x72dc
movsd 0xa47c(%rip), %xmm0     # 0x114d0
movq %rbx, %rsi
callq 0x5339
movq %rax, 0x10(%rbx)
testq %rax, %rax
jne 0x70b5
movl (%rbx), %edi
callq 0x3640
testl %eax, %eax
je 0x70a2
callq 0x3040
cmpl $0x0, (%rax)
je 0x7094
movq %rax, %r14
leaq 0xa1b8(%rip), %rdi      # 0x1123c
xorl %eax, %eax
callq 0x57b8
movl $0x0, (%r14)
jmp 0x70a2
leaq 0xa1a1(%rip), %rdi      # 0x1123c
xorl %eax, %eax
callq 0x58d7
movq 0x8(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
callq 0x3450
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/logging/logging.c
// Function: callback_timer
static int
callback_timer(void * cookie)
{
	struct stat sb_fd;
	struct stat sb_path;
	struct logging_file * F = cookie;

	/* Timer callback is no longer pending. */
	F->timer_cookie = NULL;

	/* Stat the file and the path. */
	if (fstat(F->fd, &sb_fd)) {
		warnp("fstat(%s)", F->path);
		goto err0;
	}
	if (stat(F->path, &sb_path)) {
		/* If the path doesn't exist, we need to reopen the file. */
		if (errno == ENOENT)
			goto reopen;

		/* Any other error is bad. */
		warnp("stat(%s)", F->path);
		goto err0;
	}

	/* If the path still points at the same file, do nothing. */
	if (S_ISREG(sb_fd.st_mode) && S_ISREG(sb_path.st_mode) &&
	    (sb_fd.st_dev == sb_path.st_dev) &&
	    (sb_fd.st_ino == sb_path.st_ino))
		goto done;

reopen:
	/* We need to close and re-open the log file. */
	if (close(F->fd))
		warnp("close");
	if ((F->fd = doopen(F->path)) == -1)
		goto err0;

done:
	/* Reset the callback. */
	if ((F->timer_cookie =
	    events_timer_register_double(callback_timer, F, 1.0)) == NULL)
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r14
pushq %rbx
subq $0x128, %rsp            # imm = 0x128
movq %rdi, %rbx
movq $0x0, 0x10(%rdi)
movl (%rdi), %edi
leaq 0x98(%rsp), %rsi
callq 0x35b0
testl %eax, %eax
je 0x732f
callq 0x3040
cmpl $0x0, (%rax)
movq 0x8(%rbx), %rsi
je 0x7365
movq %rax, %r14
leaq 0xa617(%rip), %rdi      # 0x11933
xorl %eax, %eax
callq 0x57b8
movl $0x0, (%r14)
jmp 0x7433
movq 0x8(%rbx), %rdi
leaq 0x8(%rsp), %rsi
callq 0x3300
testl %eax, %eax
je 0x736e
callq 0x3040
movq %rax, %r14
movl (%rax), %eax
testl %eax, %eax
je 0x73dc
cmpl $0x2, %eax
je 0x73ad
movq 0x8(%rbx), %rsi
leaq 0xa5d1(%rip), %rdi      # 0x11934
jmp 0x731c
leaq 0xa5c7(%rip), %rdi      # 0x11933
jmp 0x73e7
movl $0xf000, %eax           # imm = 0xF000
movl 0xb0(%rsp), %ecx
andl %eax, %ecx
cmpl $0x8000, %ecx           # imm = 0x8000
jne 0x73ad
andl 0x20(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x73ad
movq 0x98(%rsp), %rax
cmpq 0x8(%rsp), %rax
jne 0x73ad
movq 0xa0(%rsp), %rax
cmpq 0x10(%rsp), %rax
je 0x740e
movl (%rbx), %edi
callq 0x3640
testl %eax, %eax
je 0x73fe
callq 0x3040
cmpl $0x0, (%rax)
je 0x73f0
movq %rax, %r14
leaq 0x9e70(%rip), %rdi      # 0x1123c
xorl %eax, %eax
callq 0x57b8
movl $0x0, (%r14)
jmp 0x73fe
movq 0x8(%rbx), %rsi
leaq 0xa54d(%rip), %rdi      # 0x11934
xorl %eax, %eax
callq 0x58d7
jmp 0x7433
leaq 0x9e45(%rip), %rdi      # 0x1123c
xorl %eax, %eax
callq 0x58d7
movq 0x8(%rbx), %rdi
callq 0x70c0
movl %eax, (%rbx)
cmpl $-0x1, %eax
je 0x7433
leaq -0x139(%rip), %rdi      # 0x72dc
movsd 0xa0b3(%rip), %xmm0     # 0x114d0
movq %rbx, %rsi
callq 0x5339
movq %rax, %rcx
movq %rax, 0x10(%rbx)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x7438
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../lib/logging/logging.c
// Function: logging_close
void
logging_close(struct logging_file * F)
{

	/* Stop the has-file-moved timer if it's running. */
	if (F->timer_cookie != NULL)
		events_timer_cancel(F->timer_cookie);

	/* Close the log file if we have it open. */
	if ((F->fd != -1) && close(F->fd))
		warnp("close");

	/* Free the duplicated path string. */
	free(F->path);

	/* Free the structure. */
	free(F);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x10(%rdi), %rdi
testq %rdi, %rdi
je 0x76ae
callq 0x536e
movl (%rbx), %edi
cmpl $-0x1, %edi
je 0x76f0
callq 0x3640
testl %eax, %eax
je 0x76f0
callq 0x3040
cmpl $0x0, (%rax)
je 0x76e2
movq %rax, %r14
leaq 0x9b6a(%rip), %rdi      # 0x1123c
xorl %eax, %eax
callq 0x57b8
movl $0x0, (%r14)
jmp 0x76f0
leaq 0x9b53(%rip), %rdi      # 0x1123c
xorl %eax, %eax
callq 0x58d7
movq 0x8(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: callback_connected
static int
callback_connected(void * cookie, int s)
{
	struct http_cookie * H = cookie;

	/* We're not connecting any more. */
	H->connect_cookie = NULL;

	/* Did we fail? */
	if (s == -1)
		return (fail(H));

	/* We have a connected socket. */
	H->s = s;

	/* Create a reader and a writer. */
	if (H->sslhost != NULL) {
		if ((H->ssl =
		    (network_ssl_open_func)(H->s, H->sslhost)) == NULL)
			return (die(H));
		if ((H->R =
		    (netbuf_ssl_read_init_func)(H->ssl)) == NULL)
			return (die(H));
		if ((H->W =
		    (netbuf_ssl_write_init_func)(H->ssl, fail, H)) == NULL)
			return (die(H));
	} else {
		if ((H->R = netbuf_read_init(H->s)) == NULL)
			return (die(H));
		if ((H->W = netbuf_write_init(H->s, fail, H)) == NULL)
			return (die(H));
	}

	/* Send the request. */
	if (netbuf_write_write(H->W, H->req_head, H->req_headlen))
		return (die(H));
	if ((H->req_bodylen > 0) &&
	    netbuf_write_write(H->W, H->req_body, H->req_bodylen))
		return (die(H));

	/* Enter response-reading loop. */
	return (callback_read_header(H, 0));
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x0, 0x18(%rdi)
cmpl $-0x1, %esi
je 0x8d65
movl %esi, 0x8(%rbx)
movq 0x58(%rbx), %rax
movl %esi, %edi
testq %rax, %rax
je 0x8d7c
movq %rax, %rsi
callq *0x1fa64(%rip)          # 0x28798
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x8db9
movq %rax, %rdi
callq *0x1fa62(%rip)          # 0x287a8
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x8db9
movq 0x10(%rbx), %rdi
leaq 0x1f1(%rip), %rsi       # 0x8f4b
movq %rbx, %rdx
callq *0x1fa4d(%rip)          # 0x287b0
jmp 0x8d9c
movq 0x68(%rbx), %rdi
xorl %esi, %esi
callq *0x60(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x8df7
movl %ebp, %eax
jmp 0x8dc6
callq 0x9a50
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x8db9
movl 0x8(%rbx), %edi
leaq 0x1b7(%rip), %rsi       # 0x8f4b
movq %rbx, %rdx
callq 0x9de8
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x8db9
movq 0x38(%rbx), %rdx
movq 0x40(%rbx), %rsi
movq %rax, %rdi
callq 0xa0f1
testl %eax, %eax
je 0x8dcd
movq %rbx, %rdi
callq 0x8df7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x48(%rbx), %rdx
testq %rdx, %rdx
je 0x8de7
movq 0x20(%rbx), %rdi
movq 0x50(%rbx), %rsi
callq 0xa0f1
testl %eax, %eax
jne 0x8db9
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x8f6d
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: http_request_cancel
void
http_request_cancel(void * cookie)
{
	struct http_cookie * H = cookie;

	/* Stop connecting if we're in the process of doing so. */
	if (H->connect_cookie != NULL)
		network_connect_cancel(H->connect_cookie);

	/* If we have a network reader, cancel any in-progress read. */
	if (H->R != NULL)
		netbuf_read_wait_cancel(H->R);

	/* Free the network reader and writer if they exist. */
	if (H->W != NULL)
		netbuf_write_free(H->W);
	if (H->R != NULL)
		netbuf_read_free(H->R);

	/* Close SSL context if we have one. */
	if (H->ssl != NULL)
		(network_ssl_close_func)(H->ssl);

	/* Close the socket if we are connected. */
	if ((H->s != -1) && close(H->s))
		warnp("close");

	/* Free duplicated SSL target hostname if we have one. */
	free(H->sslhost);

	/*
	 * Free internal buffers.  (req_body does not need to be freed since
	 * it is owned by the caller; res_body does need to be freed, since
	 * it is set to NULL if/when it is passed off to the caller).
	 */
	free(H->req_head);
	free(H->res_head);
	free(H->res.headers);
	free(H->res.body);

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

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
testq %rdi, %rdi
je 0x8e0c
callq 0xa372
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x8e1a
callq 0x9d05
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x8e28
callq 0xa147
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x8e36
callq 0x9d7e
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x8e45
callq *0x1f95b(%rip)          # 0x287a0
movl 0x8(%rbx), %edi
cmpl $-0x1, %edi
je 0x8e88
callq 0x3640
testl %eax, %eax
je 0x8e88
callq 0x3040
cmpl $0x0, (%rax)
je 0x8e7a
movq %rax, %r14
leaq 0x83d2(%rip), %rdi      # 0x1123c
xorl %eax, %eax
callq 0x57b8
movl $0x0, (%r14)
jmp 0x8e88
leaq 0x83bb(%rip), %rdi      # 0x1123c
xorl %eax, %eax
callq 0x58d7
movq 0x58(%rbx), %rdi
callq 0x3450
movq 0x40(%rbx), %rdi
callq 0x3450
movq 0x80(%rbx), %rdi
callq 0x3450
movq 0xb8(%rbx), %rdi
callq 0x3450
movq 0xc8(%rbx), %rdi
callq 0x3450
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3450
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: http_findheader
const char *
http_findheader(struct http_header * headers, size_t nheaders,
    const char * header)
{
	size_t i;

	/* Sanity check. */
	assert((headers != NULL) || (nheaders == 0));

	/* Search for the header. */
	for (i = 0; i < nheaders; i++) {
		if (strcmp(headers[i].header, header) == 0)
			return (headers[i].value);
	}

	/* Didn't find it. */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
setne %cl
testb %cl, %al
jne 0x8f2c
movq %rsi, %r15
testq %rsi, %rsi
je 0x8f15
movq %rdx, %rbx
movq %rdi, %r14
addq $0x8, %r14
xorl %r12d, %r12d
movq -0x8(%r14), %rdi
movq %rbx, %rsi
callq 0x3500
testl %eax, %eax
je 0x8f1a
addq $0x10, %r14
decq %r15
jne 0x8efa
jmp 0x8f1d
xorl %r12d, %r12d
jmp 0x8f1d
movq (%r14), %r12
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x8e10(%rip), %rdi      # 0x11d43
leaq 0x8d67(%rip), %rsi      # 0x11ca1
leaq 0x8e27(%rip), %rcx      # 0x11d68
movl $0x355, %edx            # imm = 0x355
callq 0x3200
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: sgetline
static char *
sgetline(uint8_t * buf, size_t buflen, size_t * bufpos, size_t * linelen)
{
	uint8_t * s = &buf[*bufpos];

	/* Find the \r\n. */
	*linelen = findeol(s, buflen - *bufpos);

	/* It had better be there. */
	assert(*linelen < buflen - *bufpos);

	/* Add NUL-terminator. */
	s[*linelen] = '\0';

	/* Adjust buffer position. */
	*bufpos += *linelen + 2;

	/* Return string. */
	return (char *)(s);
}

// Assembly:
movq (%rdx), %r8
addq %r8, %rdi
movq %rsi, %rax
subq %r8, %rax
cmpq $0x2, %rax
jb 0x94cf
xorl %r8d, %r8d
cmpw $0xa0d, (%rdi,%r8)      # imm = 0xA0D
je 0x94cc
leaq 0x1(%r8), %r9
addq $0x3, %r8
cmpq %rax, %r8
movq %r9, %r8
jbe 0x94b1
jmp 0x94cf
movq %r8, %rax
movq %rax, (%rcx)
subq (%rdx), %rsi
cmpq %rsi, %rax
jae 0x94f2
movb $0x0, (%rdi,%rax)
movq (%rcx), %rax
movq (%rdx), %rcx
addq %rcx, %rax
addq $0x2, %rax
movq %rax, (%rdx)
movq %rdi, %rax
retq
pushq %rax
leaq 0x8a42(%rip), %rdi      # 0x11f3c
leaq 0x87a0(%rip), %rsi      # 0x11ca1
leaq 0x8a50(%rip), %rcx      # 0x11f58
movl $0xa7, %edx
callq 0x3200
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/util/parsenum.h
// Function: parsenum_unsigned
static inline uintmax_t
parsenum_unsigned(const char * s, uintmax_t min, uintmax_t max,
    uintmax_t typemax, int base, int trailing)
{
	char * eptr;
	uintmax_t val;

	/* Sanity check. */
	assert(s != NULL);

	val = strtoumax(s, &eptr, base);
	if (eptr == s || (!trailing && (*eptr != '\0')))
		errno = EINVAL;
	else if ((val < min) || (val > max) || (val > typemax))
		errno = ERANGE;
	return (val);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x9727
movl %edx, %ebp
movl %esi, %edx
movq %rdi, %r14
movq %rsp, %r15
movq %r15, %rsi
callq 0x3340
movq %rax, %rbx
movq (%r15), %rax
cmpq %r14, %rax
je 0x970e
testl %ebp, %ebp
jne 0x9719
cmpb $0x0, (%rax)
je 0x9719
callq 0x3040
movl $0x16, (%rax)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8878(%rip), %rdi      # 0x11fa6
leaq 0x887b(%rip), %rsi      # 0x11fb0
leaq 0x88f6(%rip), %rcx      # 0x12032
movl $0xbb, %edx
callq 0x3200
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: callback_read_toeof
static int
callback_read_toeof(void * cookie, int status)
{
	struct http_cookie * H = cookie;
	uint8_t * buf;
	size_t buflen;

	/* Did we fail? */
	if (status == -1)
		return (fail(H));

	/* Did we hit EOF? */
	if (status == 1)
		return (docallback(H));

	/* How much data is there? */
	netbuf_read_peek(H->R, &buf, &buflen);

	/* Is it too much? */
	if (buflen > H->res_bodylen_max - H->res.bodylen)
		return (toobig(H));

	/* Add this to our internal buffer. */
	if (addbody(H, buf, buflen))
		return (die(H));

	/* Consume the data. */
	netbuf_read_consume(H->R, buflen);

	/* Wait for at least one more byte to arrive. */
	if (netbuf_read_wait(H->R, 1, callback_read_toeof, H))
		return (die(H));

	/* Success! */
	return (0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpl $0x1, %esi
je 0x978e
cmpl $-0x1, %esi
jne 0x97bc
movq 0x68(%rbx), %rdi
xorl %esi, %esi
callq *0x60(%rbx)
movl %eax, %ebp
jmp 0x97a9
movq 0x68(%rbx), %rdi
leaq 0xa8(%rbx), %rsi
callq *0x60(%rbx)
movl %eax, %ebp
movq $0x0, 0xc8(%rbx)
movq %rbx, %rdi
callq 0x8df7
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x28(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x9ab5
movq (%r14), %rdx
movq 0x98(%rbx), %rax
subq 0xc0(%rbx), %rax
cmpq %rax, %rdx
jbe 0x97f0
movq %rbx, %rdi
callq 0x9843
jmp 0x97b3
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x998f
testl %eax, %eax
jne 0x982a
movq 0x28(%rbx), %rdi
movq (%rsp), %rsi
callq 0x9d46
movq 0x28(%rbx), %rdi
leaq -0xad(%rip), %rdx       # 0x976c
movl $0x1, %esi
movq %rbx, %rcx
callq 0x9ace
testl %eax, %eax
je 0x983c
movq %rbx, %rdi
callq 0x8df7
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x97b3
xorl %eax, %eax
jmp 0x97b3
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/liball/../libcperciva/http/http.c
// Function: callback_readdata
static int
callback_readdata(void * cookie, int status)
{
	struct http_cookie * H = cookie;
	uint8_t * buf;
	size_t buflen;
	size_t waitlen;

	/*
	 * Did we fail to read?  (EOF counts as a failure in this case, since
	 * we know exactly how many bytes of data should be arriving.)
	 */
	if (status)
		return (fail(H));

	/* What data has arrived? */
	netbuf_read_peek(H->R, &buf, &buflen);

	/* Don't bite off more than we can chew. */
	if (buflen > H->readlen)
		buflen = H->readlen;

	/* Add this to our internal buffer. */
	if (addbody(H, buf, buflen))
		return (die(H));

	/* Consume the data. */
	netbuf_read_consume(H->R, buflen);

	/* Adjust our remaining-read-length value. */
	H->readlen -= buflen;

	/* Are we done reading this block? */
	if (H->readlen == 0) {
		/* Was this just one chunk from a chunked encoding? */
		if (H->chunked) {
			/* Strip the trailing EOL. */
			H->res.bodylen -= 2;

			/* Get the next chunk. */
			return (callback_chunkedheader(H, 0));
		}

		/* If not, just do the callback. */
		return (docallback(H));
	}

	/*
	 * Wait for the MIN(remaining read length, 1 MB) to arrive.  This is
	 * a compromise between performance (larger reads have less overhead)
	 * and saving memory (if we're reading a large block, we don't want
	 * to buffer the whole thing twice).
	 */
	if (H->readlen > 1024 * 1024)
		waitlen = 1024 * 1024;
	else
		waitlen = H->readlen;

	/* Wait for more data to arrive. */
	if (netbuf_read_wait(H->R, waitlen, callback_readdata, H))
		return (die(H));

	/* Success! */
	return (0);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testl %esi, %esi
je 0x98b5
movq 0x68(%rbx), %rdi
xorl %esi, %esi
callq *0x60(%rbx)
movl %eax, %ebp
movq %rbx, %rdi
callq 0x8df7
jmp 0x98fd
movq 0x28(%rbx), %rdi
leaq 0x8(%rsp), %rsi
movq %rsp, %r14
movq %r14, %rdx
callq 0x9ab5
movq (%r14), %rdx
movq 0x90(%rbx), %rax
cmpq %rax, %rdx
jbe 0x98df
movq %rax, (%rsp)
movq %rax, %rdx
movq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x998f
testl %eax, %eax
je 0x9908
movq %rbx, %rdi
callq 0x8df7
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq 0x28(%rbx), %rdi
movq (%rsp), %rsi
callq 0x9d46
movq 0x90(%rbx), %rax
subq (%rsp), %rax
movq %rax, 0x90(%rbx)
jne 0x9948
cmpl $0x0, 0x88(%rbx)
je 0x996f
addq $-0x2, 0xc0(%rbx)
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9512
movl %eax, %ebp
jmp 0x98fd
movl $0x100000, %esi         # imm = 0x100000
cmpq %rsi, %rax
cmovbq %rax, %rsi
movq 0x28(%rbx), %rdi
leaq -0xce(%rip), %rdx       # 0x9891
movq %rbx, %rcx
callq 0x9ace
testl %eax, %eax
jne 0x98f0
xorl %ebp, %ebp
jmp 0x98fd
movq 0x68(%rbx), %rdi
leaq 0xa8(%rbx), %rsi
callq *0x60(%rbx)
movl %eax, %ebp
movq $0x0, 0xc8(%rbx)
jmp 0x98ab