LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/bench/random_read/main.c
// Function: main
int
main(int argc, char * argv[])
{
	struct sock_addr ** sas;
	uintmax_t N;
	int s;
	struct wire_requestqueue * Q;

	WARNP_INIT;

	/* Check number of arguments. */
	if (argc != 3) {
		fprintf(stderr, "usage: random_read %s N\n", "<socketname>");
		exit(1);
	}

	/* Parse N. */
	if (PARSENUM(&N, argv[2])) {
		warnp("Invalid value for N: %s", argv[2]);
		exit(1);
	}

	/* Resolve the socket address and connect. */
	if ((sas = sock_resolve(argv[1])) == NULL) {
		warnp("Error resolving socket address: %s", argv[1]);
		exit(1);
	}
	if (sas[0] == NULL) {
		warn0("No addresses found for %s", argv[1]);
		exit(1);
	}
	if ((s = sock_connect(sas)) == -1)
		exit(1);

	/* Create a request queue. */
	if ((Q = wire_requestqueue_init(s)) == NULL) {
		warnp("Cannot create packet write queue");
		exit(1);
	}

	/* Start issuing random read requests. */
	if (randomread(Q, N))
		exit(1);

	/* Free the request queue. */
	wire_requestqueue_destroy(Q);
	wire_requestqueue_free(Q);

	/* Free socket addresses. */
	sock_addr_freelist(sas);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movl %edi, %ebx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x258b
callq 0x4fa4
cmpl $0x3, %ebx
jne 0x25c3
callq 0x2090
movl $0x0, (%rax)
movq 0x10(%r14), %r12
testq %r12, %r12
jne 0x25e4
leaq 0xaaf5(%rip), %rdi      # 0xd0a0
leaq 0xaaf8(%rip), %rsi      # 0xd0aa
leaq 0xab13(%rip), %rcx      # 0xd0cc
movl $0xbb, %edx
callq 0x2160
movq 0x10a2e(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
leaq 0xaa30(%rip), %rsi      # 0xd004
leaq 0xaa42(%rip), %rdx      # 0xd01d
xorl %eax, %eax
callq 0x21d0
jmp 0x2654
movq %rax, %rbx
leaq 0x8(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x22a0
movq %rax, %r15
movq (%r13), %rax
cmpq %r12, %rax
je 0x260a
cmpb $0x0, (%rax)
je 0x2610
movl $0x16, (%rbx)
cmpl $0x0, (%rbx)
jne 0x263c
movq 0x8(%r14), %rdi
callq 0x3f7c
testq %rax, %rax
jne 0x265e
cmpl $0x0, (%rbx)
movq 0x8(%r14), %rsi
leaq 0xaa11(%rip), %rdi      # 0xd042
jne 0x2647
xorl %eax, %eax
callq 0x5143
jmp 0x2654
movq 0x10(%r14), %rsi
leaq 0xa9e3(%rip), %rdi      # 0xd02a
xorl %eax, %eax
callq 0x5024
movl $0x0, (%rbx)
movl $0x1, %edi
callq 0x22d0
movq %rax, %r12
cmpq $0x0, (%rax)
jne 0x267b
movq 0x8(%r14), %rsi
leaq 0xa9f3(%rip), %rdi      # 0xd065
xorl %eax, %eax
callq 0x5143
jmp 0x264e
movq %r12, %rdi
callq 0x4899
cmpl $-0x1, %eax
je 0x2654
movl %eax, %edi
callq 0x6ddc
testq %rax, %rax
jne 0x26a9
cmpl $0x0, (%rbx)
jne 0x26da
leaq 0xa9df(%rip), %rdi      # 0xd07f
xorl %eax, %eax
callq 0x5143
jmp 0x2654
movq %rax, %r14
movq %rax, %rdi
movq %r15, %rsi
callq 0x26ed
testl %eax, %eax
jne 0x2654
movq %r14, %rdi
callq 0x74a1
movq %r14, %rdi
callq 0x74b5
movq %r12, %rdi
callq 0x4693
xorl %edi, %edi
callq 0x22d0
leaq 0xa99e(%rip), %rdi      # 0xd07f
xorl %eax, %eax
callq 0x5024
jmp 0x264e
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/bench/random_read/main.c
// Function: randomread
static int
randomread(struct wire_requestqueue * Q, uint64_t N)
{
	struct randomread_state C;
	uint8_t buf[40];	/* dummy */

	/* Initialize. */
	C.Q = Q;
	C.Nip = 0;
	C.Nmax = N;
	C.failed = 0;
	C.done = 0;

	/* Allocate key structure. */
	memset(buf, 0, 40);
	if ((C.key = kvldskey_create(buf, 40)) == NULL)
		goto err0;

	/* Prepare benchmark time handling. */
	if ((C.B = bench_init(BENCHMARK_START, BENCHMARK_SECONDS)) == NULL) {
		warn0("bench_init");
		goto err1;
	}

	/* Send an initial batch of 4096 requests. */
	if (sendbatch(&C))
		goto err2;

	/* Wait until we've finished. */
	if (events_spin(&C.done) || C.failed) {
		warnp("SET request failed");
		goto err2;
	}

	/* Print median number of reads performed in a single second. */
	printf("%" PRIu64 "\n", bench_median(C.B));

	/* Free the key structure. */
	bench_free(C.B);
	kvldskey_free(C.key);

	/* Success! */
	return (0);

err2:
	bench_free(C.B);
err1:
	kvldskey_free(C.key);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movq %rdi, 0x8(%rsp)
xorl %eax, %eax
movq %rax, 0x18(%rsp)
movq %rsi, 0x20(%rsp)
movq %rax, 0x28(%rsp)
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
movq %rax, 0x20(%rdi)
movl $0x28, %esi
callq 0x57d0
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x2762
movl $0x32, %edi
movl $0x64, %esi
callq 0x5268
movq %rax, 0x38(%rsp)
testq %rax, %rax
je 0x2769
leaq 0x8(%rsp), %rdi
callq 0x280a
testl %eax, %eax
je 0x2799
movq 0x38(%rsp), %rdi
callq 0x55a0
jmp 0x2782
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x2791
leaq 0xa9b1(%rip), %rdi      # 0xd121
xorl %eax, %eax
callq 0x5143
callq 0x2090
movl $0x0, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq 0x30(%rsp), %rdi
callq 0x2040
movl %ebx, %eax
addq $0x70, %rsp
popq %rbx
retq
leaq 0x2c(%rsp), %rbx
movq %rbx, %rdi
callq 0x2bd1
orl -0x4(%rbx), %eax
je 0x27ce
callq 0x2090
cmpl $0x0, (%rax)
je 0x27f7
movq %rax, %rbx
leaq 0xa96d(%rip), %rdi      # 0xd12c
xorl %eax, %eax
callq 0x5024
movl $0x0, (%rbx)
jmp 0x2756
movq 0x38(%rsp), %rdi
callq 0x5535
leaq 0xa960(%rip), %rdi      # 0xd13f
xorl %ebx, %ebx
movq %rax, %rsi
xorl %eax, %eax
callq 0x2130
movq 0x38(%rsp), %rdi
callq 0x55a0
jmp 0x2787
leaq 0xa92e(%rip), %rdi      # 0xd12c
xorl %eax, %eax
callq 0x5143
jmp 0x2756
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/bench/random_read/main.c
// Function: sendbatch
static int
sendbatch(struct randomread_state * C)
{
	unsigned long N;
	uint64_t X, Y;

	while (C->Nip < 4096) {
		/* Generate a random key. */
		N = (size_t)random() % C->Nmax;
		X = N >> 16;
		Y = N - (X << 16);
		mkkey(X, Y, C->key->buf);

		/* Send the request. */
		if (proto_kvlds_request_get(C->Q, C->key,
		    callback_get, C))
			goto err0;
		C->Nip += 1;
	}

	/* Success! */
	return (0);

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

// Assembly:
cmpq $0xfff, 0x10(%rdi)      # imm = 0xFFF
ja 0x2870
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x5e(%rip), %r14        # 0x2880
callq 0x2200
xorl %edx, %edx
divq 0x18(%rbx)
movzwl %dx, %esi
movq %rdx, %rdi
shrq $0x10, %rdi
movq 0x28(%rbx), %rdx
incq %rdx
callq 0x55c8
movq (%rbx), %rdi
movq 0x28(%rbx), %rsi
movq %r14, %rdx
movq %rbx, %rcx
callq 0x6326
testl %eax, %eax
jne 0x2873
movq 0x10(%rbx), %rax
incq %rax
movq %rax, 0x10(%rbx)
cmpq $0x1000, %rax           # imm = 0x1000
jb 0x2822
xorl %eax, %eax
jmp 0x2878
xorl %eax, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/bench/random_read/main.c
// Function: callback_get
static int
callback_get(void * cookie, int failed, struct kvldskey * value)
{
	struct randomread_state * C = cookie;

	/* This request is no longer in progress. */
	C->Nip -= 1;

	/* Did we fail? */
	if (failed) {
		C->done = 1;
		C->failed = 1;
	}

	/* If we have a value, free it. */
	if (failed == 0)
		kvldskey_free(value);

	/* Notify the benchmarking code, and check if we should quit. */
	if (bench_tick(C->B, &C->done)) {
		warnp("bench_tick");
		goto err0;
	}

	/* Send more requests if possible. */
	if ((!C->done) && sendbatch(C))
		goto err0;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
decq 0x10(%rdi)
testl %esi, %esi
je 0x289f
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x20(%rbx)
jmp 0x28a7
movq %rdx, %rdi
callq 0x2040
movq 0x30(%rbx), %rdi
leaq 0x24(%rbx), %r14
movq %r14, %rsi
callq 0x5411
testl %eax, %eax
je 0x28de
callq 0x2090
cmpl $0x0, (%rax)
je 0x28f4
movq %rax, %rbx
leaq 0xa875(%rip), %rdi      # 0xd144
xorl %eax, %eax
callq 0x5024
movl $0x0, (%rbx)
jmp 0x2902
xorl %ebp, %ebp
cmpl $0x0, (%r14)
jne 0x2907
movq %rbx, %rdi
callq 0x280a
testl %eax, %eax
jne 0x2902
jmp 0x2907
leaq 0xa849(%rip), %rdi      # 0xd144
xorl %eax, %eax
callq 0x5143
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/bench/mkpair.c
// Function: mkkey
void
mkkey(uint64_t X, uint64_t Y, uint8_t * buf)
{
	SHA256_CTX ctx;
	uint8_t hbuf[17];

	/* Store big-endian X. */
	be64enc(&buf[0], X);

	/* Generate \000.X.Y. */
	hbuf[0] = 0;
	be64enc(&hbuf[1], X);
	be64enc(&hbuf[9], Y);

	/* Compute sha256(\000.X.Y). */
	SHA256_Init(&ctx);
	SHA256_Update(&ctx, hbuf, 17);
	SHA256_Final(&buf[8], &ctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %rdx
movl %edx, %ecx
movq %rdi, %rsi
movq %rdi, %r8
movq %rdi, %r9
movq %rdi, %r10
bswapq %r10
movq %r10, (%rbx)
movq %rsp, %r14
movb $0x0, (%r14)
movb %dl, 0x8(%r14)
movb %dh, 0x7(%rsp)
shrl $0x10, %edx
shrl $0x18, %ecx
shrq $0x20, %rsi
shrq $0x28, %rdi
shrq $0x30, %r8
shrq $0x38, %r9
movb %dl, 0x6(%r14)
movb %cl, 0x5(%r14)
movb %sil, 0x4(%r14)
movb %dil, 0x3(%r14)
movb %r8b, 0x2(%r14)
movb %r9b, 0x1(%r14)
movb %al, 0x10(%r14)
movb %ah, 0xf(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0xe(%r14)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0xd(%r14)
movq %rax, %rcx
shrq $0x20, %rcx
movb %cl, 0xc(%r14)
movq %rax, %rcx
shrq $0x28, %rcx
movb %cl, 0xb(%r14)
movq %rax, %rcx
shrq $0x30, %rcx
movb %cl, 0xa(%r14)
shrq $0x38, %rax
movb %al, 0x9(%r14)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x7ba4
movl $0x11, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x7e36
addq $0x8, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7f2e
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/bench/mkpair.c
// Function: mkval
void
mkval(uint64_t X, uint64_t Y, uint8_t * buf)
{
	SHA256_CTX ctx;
	uint8_t hbuf[17];

	/* Store big-endian X * 2^16 + Y. */
	be64enc(&buf[0], (X << 16) + Y);

	/* Generate \001.X.Y. */
	hbuf[0] = 0;
	be64enc(&hbuf[1], X);
	be64enc(&hbuf[9], Y);

	/* Compute sha256(\001.X.Y). */
	SHA256_Init(&ctx);
	SHA256_Update(&ctx, hbuf, 17);
	SHA256_Final(&buf[8], &ctx);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdx, %rbx
movq %rsi, %rax
movq %rdi, %rcx
movq %rdi, %rdx
shlq $0x10, %rdx
addq %rsi, %rdx
rolw $0x8, %si
movw %si, 0x6(%rbx)
movl %edx, %esi
shrl $0x10, %esi
movb %sil, 0x5(%rbx)
movl %edx, %esi
shrl $0x18, %esi
movb %sil, 0x4(%rbx)
movq %rdx, %rsi
shrq $0x20, %rsi
movb %sil, 0x3(%rbx)
movq %rdx, %rsi
shrq $0x28, %rsi
movb %sil, 0x2(%rbx)
movq %rdx, %rsi
shrq $0x30, %rsi
movb %sil, 0x1(%rbx)
shrq $0x38, %rdx
movb %dl, (%rbx)
movq %rsp, %r14
movb $0x0, (%r14)
movb %cl, 0x8(%r14)
movb %ch, 0x7(%rsp)
movl %ecx, %edx
shrl $0x10, %edx
movb %dl, 0x6(%r14)
movl %ecx, %edx
shrl $0x18, %edx
movb %dl, 0x5(%r14)
movq %rdi, %rdx
shrq $0x20, %rdx
movb %dl, 0x4(%r14)
movq %rdi, %rdx
shrq $0x28, %rdx
movb %dl, 0x3(%r14)
movq %rdi, %rdx
shrq $0x30, %rdx
movb %dl, 0x2(%r14)
shrq $0x38, %rcx
movb %cl, 0x1(%r14)
movb %al, 0x10(%r14)
movb %ah, 0xf(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0xe(%r14)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0xd(%r14)
movq %rax, %rcx
shrq $0x20, %rcx
movb %cl, 0xc(%r14)
movq %rax, %rcx
shrq $0x28, %rcx
movb %cl, 0xb(%r14)
movq %rax, %rcx
shrq $0x30, %rcx
movb %cl, 0xa(%r14)
shrq $0x38, %rax
movb %al, 0x9(%r14)
leaq 0x18(%rsp), %r15
movq %r15, %rdi
callq 0x7ba4
movl $0x11, %edx
movq %r15, %rdi
movq %r14, %rsi
callq 0x7e36
addq $0x8, %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x7f2e
addq $0x80, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/main.c
// Function: main
int main(int argc, char *argv[])
{
	int i;
	if (argc < 2)
		goto over;
	EXEC = argv[0];
	for (i = 0; i < ARRAYSIZE(cmds); i++) {
		if (strcmp(cmds[i].cmd, argv[1]) == 0) {
			cmds[i].handler(argc-1, &argv[1]);
			break;
		}
	}
	if (i >= ARRAYSIZE(cmds)) {
		over:
		fprintf(stderr, "usage: %s <command> [<args>]\n", argv[0]);
		exit(EINVAL);
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
cmpl $0x2, %edi
jl 0x27ba
movl %edi, %r14d
movq (%rbx), %rax
movq %rax, 0xa9e9(%rip)      # 0xd178
movq 0x8(%rbx), %r15
leaq 0xa5ce(%rip), %r13      # 0xcd68
xorl %r12d, %r12d
movq -0x8(%r13), %rdi
movq %r15, %rsi
callq 0x2180
testl %eax, %eax
je 0x27c2
incq %r12
addq $0x10, %r13
cmpq $0x8, %r12
jne 0x279d
movq %rbx, %rdi
callq 0x22d0
leaq 0x8(%rbx), %rsi
decl %r14d
movl %r14d, %edi
callq *(%r13)
cmpq $0x7, %r12
ja 0x27ba
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/main.c
// Function: history_h
static void
history_h(int argc, char *argv[])
{
	int c, n = 0;
	(void)argc;
	(void)argv;
	while ((c = getopt(argc, argv, "n:?")) != -1) {
		switch (c) {
		case 'n':
			n = strtol(optarg, NULL, 0);
			break;
		case '?':
			exit(EINVAL);
			break;
		}
	}
	history(n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
xorl %r12d, %r12d
leaq 0x77f4(%rip), %r15      # 0xa068
movq 0xa75d(%rip), %r13      # 0xcfd8
movl %r14d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x2250
cmpl $-0x1, %eax
je 0x28ac
cmpl $0x6e, %eax
je 0x289a
cmpl $0x3f, %eax
jne 0x287b
jmp 0x28c2
movq (%r13), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x21b0
movq %rax, %r12
jmp 0x287b
movl %r12d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x37b0
movl $0x16, %edi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/main.c
// Function: list_h
static void
list_h(int argc, char *argv[])
{
	(void)argc;
	(void)argv;
	struct list_args args;
	if (argc < 2) {
		fprintf(stderr, "usage: %s list hash\n", EXEC);
		exit(EINVAL);
	}
	args.hash = dr_newstr(argv[1]);
	list(&args);
	dr_unref(args.hash);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jle 0x2954
movq 0x8(%rsi), %rbx
movq %rbx, %rdi
callq 0x20e0
movslq %eax, %r14
leaq 0xc(%r14), %rdi
callq 0x21f0
movq %rax, %r15
movl $0x1, (%rax)
movl %r14d, 0x4(%rax)
testq %rbx, %rbx
je 0x2917
movq %r15, %rdi
addq $0x8, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x21c0
movb $0x0, 0x8(%r15,%r14)
leaq -0x20(%rbp), %rbx
movq %r15, (%rbx)
movq %rbx, %rdi
callq 0x4cfc
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x2949
movl (%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rdi)
cmpl $0x1, %ecx
jg 0x2949
testl %eax, %eax
jne 0x2959
callq 0x2030
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x22fa
leaq 0x7721(%rip), %rdi      # 0xa081
leaq 0x7726(%rip), %rsi      # 0xa08d
leaq 0x7726(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/main.c
// Function: checkout_h
static void
checkout_h(int argc, char *argv[])
{
	dr_t hash, outdir;
	if (argc < 3) {
		fprintf(stderr, "usage: %s checkout hash outdir\n", EXEC);
		exit(EINVAL);
	}
	hash = dr_newstr(argv[1]);
	outdir = dr_newstr(argv[2]);
	checkout(hash, outdir);
	dr_unref(hash);
	dr_unref(outdir);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
cmpl $0x2, %edi
jle 0x2cff
movq %rsi, %r14
movq 0x8(%rsi), %r15
movq %r15, %rdi
callq 0x20e0
movslq %eax, %r12
leaq 0xc(%r12), %rdi
callq 0x21f0
movq %rax, %rbx
movl $0x1, (%rax)
movl %r12d, 0x4(%rax)
testq %r15, %r15
je 0x2c68
movq %rbx, %rdi
addq $0x8, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21c0
movb $0x0, 0x8(%rbx,%r12)
movq 0x10(%r14), %r15
movq %r15, %rdi
callq 0x20e0
movslq %eax, %r12
leaq 0xc(%r12), %rdi
callq 0x21f0
movq %rax, %r14
movl $0x1, (%rax)
movl %r12d, 0x4(%rax)
testq %r15, %r15
je 0x2cab
movq %r14, %rdi
addq $0x8, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x21c0
movb $0x0, 0x8(%r14,%r12)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x4de8
movl (%rbx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rbx)
cmpl $0x1, %ecx
jg 0x2cd4
testl %eax, %eax
jne 0x2d04
movq %rbx, %rdi
callq 0x2030
movl (%r14), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r14)
cmpl $0x1, %ecx
jg 0x2cf6
testl %eax, %eax
jne 0x2d04
movq %r14, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x2030
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
callq 0x2350
leaq 0x7376(%rip), %rdi      # 0xa081
leaq 0x737b(%rip), %rsi      # 0xa08d
leaq 0x737b(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/history.c
// Function: history
void
history(int n)
{
	dr_t h;
	int i = 0;
	struct release rel;
	h = db_readhead(&rel, NULL);
	if (h->size == 0) {
		printf("Empty db\n");
	} else {
		for (;;) {
			struct tm *t;
			char datetime[200];
			t = localtime(&rel.time);
			strftime(datetime, sizeof(datetime),
				"%a %b %d %H:%M:%S %Z", t);
			printf("release:%s\n", h->buf);
			printf("finger:%s\n", rel.finger->buf);
			printf("Version:%s\n", rel.ver->buf);
			printf("Date:%s\n", datetime);
			printf("\n\t%s\n\n", rel.note->buf);
			if (rel.prev->size <= 0 || (n > 0 && ++i >= n))
				break;
			dr_unref(h);
			h = dr_ref(rel.prev);
			release_destroy(&rel);
			memset(&rel, 0, sizeof(rel));
			db_readrel(&rel, h);
		}
	}
	dr_unref(h);
	release_destroy(&rel);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movl %edi, %r14d
xorl %r12d, %r12d
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
callq 0x5ba6
movq %rax, %rbx
cmpl $0x0, 0x4(%rax)
je 0x38ed
leaq -0x130(%rbp), %r13
leaq -0x60(%rbp), %rdi
callq 0x2040
movl $0xc8, %esi
movq %r13, %rdi
leaq 0x69f2(%rip), %rdx      # 0xa1f3
movq %rax, %rcx
callq 0x2220
leaq 0x8(%rbx), %rsi
xorl %r15d, %r15d
leaq 0x69f1(%rip), %rdi      # 0xa208
xorl %eax, %eax
callq 0x2110
movq -0x38(%rbp), %rsi
addq $0x8, %rsi
leaq 0x69e7(%rip), %rdi      # 0xa214
xorl %eax, %eax
callq 0x2110
movq -0x48(%rbp), %rsi
addq $0x8, %rsi
leaq 0x69dc(%rip), %rdi      # 0xa21f
xorl %eax, %eax
callq 0x2110
leaq 0x69da(%rip), %rdi      # 0xa22b
movq %r13, %rsi
xorl %eax, %eax
callq 0x2110
movq -0x40(%rbp), %rsi
addq $0x8, %rsi
leaq 0x69ca(%rip), %rdi      # 0xa234
xorl %eax, %eax
callq 0x2110
movq -0x58(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jle 0x38e2
testl %r14d, %r14d
jle 0x3888
incl %r12d
cmpl %r14d, %r12d
jge 0x38df
testq %rbx, %rbx
je 0x38a9
movl (%rbx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rbx)
cmpl $0x1, %ecx
jg 0x38a9
testl %eax, %eax
jne 0x3931
movq %rbx, %rdi
callq 0x2030
movq -0x58(%rbp), %rbx
testq %rbx, %rbx
je 0x38b4
incl (%rbx)
leaq -0x60(%rbp), %r15
movq %r15, %rdi
callq 0x6574
xorps %xmm0, %xmm0
movaps %xmm0, -0x40(%rbp)
movaps %xmm0, -0x50(%rbp)
movaps %xmm0, -0x60(%rbp)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5adc
movb $0x1, %r15b
jmp 0x38e2
xorl %r15d, %r15d
testb %r15b, %r15b
jne 0x37e9
jmp 0x38f9
leaq 0x6947(%rip), %rdi      # 0xa23b
callq 0x20a0
testq %rbx, %rbx
je 0x3916
movl (%rbx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rbx)
cmpl $0x1, %ecx
jg 0x3916
testl %eax, %eax
jne 0x3931
movq %rbx, %rdi
callq 0x2030
leaq -0x60(%rbp), %rdi
callq 0x6574
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6749(%rip), %rdi      # 0xa081
leaq 0x674e(%rip), %rsi      # 0xa08d
leaq 0x674e(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/diff.c
// Function: diff
void
diff(struct diff_args *args)
{
	dr_t head;
	struct release rel;
	if (args->r == 0)
		return diff_tree(args->a, args->b, args->o);
	head = db_readhead(&rel, NULL);
	if (head->size == 0) {
		printf("Empty db\n");
	} else {
		int i;
		for (i = 0; i < args->r || args->r < 0; i++) {
			dr_t h;
			if (rel.prev->size <= 0)
				break;
			h = dr_ref(rel.prev);
			diff_tree(h, head, args->o);
			release_destroy(&rel);
			db_readrel(&rel, h);
			dr_unref(h);
		}
	}
	dr_unref(head);
	release_destroy(&rel);
	return ;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
cmpl $0x0, (%rdi)
je 0x3a36
leaq -0x60(%rbp), %rdi
xorl %esi, %esi
callq 0x5ba6
movq %rax, %rbx
cmpl $0x0, 0x4(%rax)
je 0x3a52
cmpl $0x0, (%r14)
je 0x3a5e
xorl %r13d, %r13d
movq %rbx, -0x30(%rbp)
movq -0x58(%rbp), %r12
movl 0x4(%r12), %r15d
testl %r15d, %r15d
jle 0x3a5e
testq %r12, %r12
je 0x39f9
incl (%r12)
movq 0x18(%r14), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3ab2
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x6574
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5adc
movl (%r12), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r12)
cmpl $0x1, %ecx
jg 0x3a1f
testl %eax, %eax
jne 0x3a93
movq %r12, %rdi
callq 0x2030
jmp 0x3a1f
movq 0x18(%r14), %rdx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x3ab2
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x6574
movq %rbx, %rdi
movq %r12, %rsi
callq 0x5adc
testl %r15d, %r15d
movq -0x30(%rbp), %rbx
jle 0x3a5e
incl %r13d
cmpl %r13d, (%r14)
ja 0x3996
jmp 0x3a5e
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rsi
movq 0x18(%r14), %rdx
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3ab2
leaq 0x67e2(%rip), %rdi      # 0xa23b
callq 0x20a0
testq %rbx, %rbx
je 0x3a7b
movl (%rbx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rbx)
cmpl $0x1, %ecx
jg 0x3a7b
testl %eax, %eax
jne 0x3a93
movq %rbx, %rdi
callq 0x2030
leaq -0x60(%rbp), %rdi
callq 0x6574
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x65e7(%rip), %rdi      # 0xa081
leaq 0x65ec(%rip), %rsi      # 0xa08d
leaq 0x65ec(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/diff.c
// Function: search
static int
search(dr_t old, int *SA, const uint8_t *ns, int nsize, int *pos)
{
	int n = 0, sim = 0;
	int osize = old->size;
	int m = 0, l = 0, r = osize;
	const uint8_t *p = old->buf;
	*pos = -1;
	while (l < r) {
		int c, s;
		m = (l + r) / 2;
		n = SA[m];
		c = match(&p[n], osize - n, ns, nsize, &s);
		if (c == 0) {	//contain
			*pos = n;
			sim = s;
			assert(s == nsize);
			break;
		} else {
			if (sim < s) {
				*pos = n;
				sim = s;
			}
			if (c < 0)
				l = m + 1;
			else
				r = m;
		}
	}
	return sim;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, -0x48(%rbp)
movl 0x4(%rdi), %eax
addq $0x8, %rdi
movq %rdi, -0x40(%rbp)
movq %r8, -0x38(%rbp)
movl $0xffffffff, (%r8)      # imm = 0xFFFFFFFF
xorl %r10d, %r10d
movl %eax, -0x2c(%rbp)
movl %eax, %r11d
xorl %ebx, %ebx
cmpl %r11d, %r10d
jge 0x484f
leal (%r11,%r10), %r14d
shrl %r14d
movq -0x48(%rbp), %rax
movslq (%rax,%r14,4), %r15
movl -0x2c(%rbp), %r13d
subl %r15d, %r13d
cmpl %ecx, %r13d
movl %ecx, %eax
cmovll %r13d, %eax
testl %eax, %eax
jle 0x47ed
movq %r15, %r12
addq -0x40(%rbp), %r12
movl %eax, %r8d
xorl %r9d, %r9d
movb (%r12,%r9), %dil
movb (%rdx,%r9), %sil
cmpb %sil, %dil
jne 0x47fe
incq %r9
cmpq %r9, %r8
jne 0x47d6
jmp 0x47ef
xorl %eax, %eax
xorl %r12d, %r12d
cmpl %ecx, %r13d
setl %r12b
negl %r12d
jmp 0x4812
jae 0x4808
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
jmp 0x480f
seta %al
movzbl %al, %r12d
movl %r9d, %eax
testl %r12d, %r12d
je 0x4837
cmpl %eax, %ebx
jae 0x4824
movq -0x38(%rbp), %rsi
movl %r15d, (%rsi)
movl %eax, %ebx
leal 0x1(%r14), %eax
testl %r12d, %r12d
cmovsl %eax, %r10d
cmovnsl %r14d, %r11d
movl %ebx, %eax
jmp 0x4842
movq -0x38(%rbp), %rsi
movl %r15d, (%rsi)
cmpl %ecx, %eax
jne 0x4860
movl %eax, %ebx
testl %r12d, %r12d
jne 0x479d
jmp 0x4851
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5a9d(%rip), %rdi      # 0xa304
leaq 0x5a5e(%rip), %rsi      # 0xa2cc
leaq 0x5a9a(%rip), %rcx      # 0xa30f
movl $0x3b, %edx
callq 0x2130
nop
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/list.c
// Function: list
void
list(struct list_args *args)
{
	int i, n;
	struct release r;
	struct tree t;
	dr_t hash = db_aliashash(args->hash);
	db_readrel(&r, args->hash);
	db_readtree(&t, r.tree);
	release_destroy(&r);
	dr_unref(hash);
	n = t.refn;
	for (i = 0; i < n; i++) {
		printf("%s ==> %s\n",
			t.refs[i].name->buf,
			t.refs[i].hash->buf);
	}
	printf("total:%d\n", n);
	tree_destroy(&t);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rdi, %r14
movq (%rdi), %rdi
callq 0x5ca0
movq %rax, %rbx
movq (%r14), %rsi
leaq -0x60(%rbp), %r14
movq %r14, %rdi
callq 0x5adc
movq 0x10(%r14), %rsi
leaq -0x30(%rbp), %rdi
callq 0x5b41
movq %r14, %rdi
callq 0x6574
testq %rbx, %rbx
je 0x4d5a
movl (%rbx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rbx)
cmpl $0x1, %ecx
jg 0x4d5a
testl %eax, %eax
jne 0x4dc7
movq %rbx, %rdi
callq 0x2030
movslq -0x30(%rbp), %rbx
testq %rbx, %rbx
jle 0x4da1
leaq (,%rbx,8), %rax
leaq (%rax,%rax,2), %r15
leaq 0x5732(%rip), %r14      # 0xa4a8
xorl %r12d, %r12d
movq -0x28(%rbp), %rax
movq (%rax,%r12), %rdx
movq 0x8(%rax,%r12), %rsi
addq $0x8, %rsi
addq $0x8, %rdx
movq %r14, %rdi
xorl %eax, %eax
callq 0x2110
addq $0x18, %r12
cmpq %r12, %r15
jne 0x4d79
leaq 0x5662(%rip), %rdi      # 0xa40a
movl %ebx, %esi
xorl %eax, %eax
callq 0x2110
leaq -0x30(%rbp), %rdi
callq 0x6100
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x52b3(%rip), %rdi      # 0xa081
leaq 0x52b8(%rip), %rsi      # 0xa08d
leaq 0x52b8(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
nop
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/checkout.c
// Function: checkout
void
checkout(dr_t hash, dr_t outdir)
{
	int i;
	struct release r;
	struct tree t;
	hash = db_aliashash(hash);
	db_readrel(&r, hash);
	dr_unref(hash);
	db_readtree(&t, r.tree);
	printf("checkout tree:%s->%s\n", r.tree->buf, str(outdir));
	release_destroy(&r);
	dir_ensure(str(outdir));
	if (errno == EEXIST)
		printf("warning: checkout folder '%s' is exist\n", str(outdir));
	for (i = 0; i < t.refn; i++) {
		struct ref *f;
		f = &t.refs[i];
		f->data = db_read(f->hash);
		dir_writefile(str(f->name), f->data, outdir);
	}
	tree_destroy(&t);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
callq 0x5ca0
movq %rax, %r14
leaq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x5adc
testq %r14, %r14
je 0x4e31
movl (%r14), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r14)
cmpl $0x1, %ecx
jg 0x4e31
testl %eax, %eax
jne 0x4ee5
movq %r14, %rdi
callq 0x2030
leaq -0x60(%rbp), %r15
movq 0x10(%r15), %rsi
leaq -0x30(%rbp), %rdi
callq 0x5b41
movq 0x10(%r15), %rsi
addq $0x8, %rsi
leaq 0x8(%rbx), %r14
leaq 0x565e(%rip), %rdi      # 0xa4b3
movq %r14, %rdx
xorl %eax, %eax
callq 0x2110
movq %r15, %rdi
callq 0x6574
movq %r14, %rdi
callq 0x5140
callq 0x2050
cmpl $0x11, (%rax)
jne 0x4e8a
leaq 0x5649(%rip), %rdi      # 0xa4c9
movq %r14, %rsi
xorl %eax, %eax
callq 0x2110
cmpl $0x0, -0x30(%rbp)
jle 0x4ecf
movl $0x10, %r14d
xorl %r15d, %r15d
movq -0x28(%rbp), %r12
movq -0x10(%r12,%r14), %rdi
callq 0x5941
movq %rax, (%r12,%r14)
movq -0x8(%r12,%r14), %rdi
addq $0x8, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x530e
incq %r15
movslq -0x30(%rbp), %rax
addq $0x18, %r14
cmpq %rax, %r15
jl 0x4e99
leaq -0x30(%rbp), %rdi
callq 0x6100
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5195(%rip), %rdi      # 0xa081
leaq 0x519a(%rip), %rsi      # 0xa08d
leaq 0x519a(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/dir.c
// Function: dir_scan
int
dir_scan(const char *path, dr_t **res, int skip)
{
	struct args args;
	args.num = 0;
	args.cap = 128;
	if (skip)
		args.prefix = strlen(path) + 1;
	else
		args.prefix = 0;
	args.list = malloc(128 * sizeof(dr_t));
	scan_r(path, &args);
	if (res == NULL) {
		int i;
		for (i = 0; i < args.num; i++)
			dr_unref(args.list[i]);
		free(args.list);
	} else {
		*res = args.list;
	}
	return args.num;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movabsq $0x8000000000, %rax     # imm = 0x8000000000
movq %rax, -0x30(%rbp)
testl %edx, %edx
je 0x4f35
movq %r14, %rdi
callq 0x20e0
incl %eax
jmp 0x4f37
xorl %eax, %eax
leaq -0x30(%rbp), %r15
movl %eax, 0x8(%r15)
movl $0x400, %edi            # imm = 0x400
callq 0x21f0
movq %rax, 0x10(%r15)
movq %r14, %rdi
movq %r15, %rsi
callq 0x4fd2
testq %rbx, %rbx
je 0x4f66
movq -0x20(%rbp), %rax
movq %rax, (%rbx)
jmp 0x4fa5
movslq -0x30(%rbp), %rbx
testq %rbx, %rbx
jle 0x4f9c
movq -0x20(%rbp), %r14
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
testq %rdi, %rdi
je 0x4f94
movl (%rdi), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rdi)
cmpl $0x1, %ecx
jg 0x4f94
testl %eax, %eax
jne 0x4fb3
callq 0x2030
incq %r15
cmpq %r15, %rbx
jne 0x4f76
movq -0x20(%rbp), %rdi
callq 0x2030
movl -0x30(%rbp), %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x50c7(%rip), %rdi      # 0xa081
leaq 0x50cc(%rip), %rsi      # 0xa08d
leaq 0x50cc(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/dir.c
// Function: scan_r
static void
scan_r(const char *prefix, struct args *args)
{
	DIR *dir;
	struct stat st;
	struct dirent *ent;
	dir = scanbegin(prefix);
	while ((ent = readdir(dir))) {
		char buf[PATH_MAX];
		if (ent->d_name[0] == '.')
			continue;
		snprintf(buf, PATH_MAX, "%s/%s", prefix, ent->d_name);
		stat(buf, &st);
		if (S_ISDIR(st.st_mode)) {
			scan_r(buf, args);
		} else if (S_ISREG(st.st_mode)) {
			args->list[args->num++] = dr_newstr(buf + args->prefix);
			if (args->num >= args->cap) {
				int size;
				args->cap *= 2;
				size = args->cap * sizeof(dr_t);
				args->list = realloc(args->list, size);
			}
		}
	}
	scanend(dir);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1098, %rsp           # imm = 0x1098
movq %rsi, %r14
movq %rdi, %rbx
callq 0x20d0
testq %rax, %rax
je 0x5138
movq %rax, %r15
movq %rax, %rdi
callq 0x21e0
testq %rax, %rax
je 0x511e
leaq 0x55c9(%rip), %r12      # 0xa5de
leaq -0x10c0(%rbp), %r13
movq %rbx, -0x30(%rbp)
cmpb $0x2e, 0x13(%rax)
je 0x510d
addq $0x13, %rax
movl $0x1000, %esi           # imm = 0x1000
movq %r13, %rdi
movq %r12, %rdx
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2120
movq %r13, %rdi
leaq -0xc0(%rbp), %rsi
callq 0x21a0
movl -0xa8(%rbp), %eax
movl $0xf000, %ecx           # imm = 0xF000
andl %ecx, %eax
movl %eax, %ecx
negw %cx
jo 0x5084
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x510d
movq %r13, %rdi
movq %r14, %rsi
callq 0x4fd2
jmp 0x510d
movslq 0x8(%r14), %rax
leaq (%rax,%rbp), %r12
addq $-0x10c0, %r12          # imm = 0xEF40
movq %r12, %rdi
callq 0x20e0
movslq %eax, %rbx
leaq 0xc(%rbx), %rdi
callq 0x21f0
movq %rax, %r13
movl $0x1, (%rax)
movl %ebx, 0x4(%rax)
leaq 0x8(%rax), %rdi
movq %r12, %rsi
leaq 0x551d(%rip), %r12      # 0xa5de
movq %rbx, %rdx
callq 0x21c0
movb $0x0, 0x8(%r13,%rbx)
movq -0x30(%rbp), %rbx
movq 0x10(%r14), %rax
movslq (%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, (%r14)
movq %r13, (%rax,%rcx,8)
leaq -0x10c0(%rbp), %r13
movl 0x4(%r14), %eax
cmpl %eax, %edx
jl 0x510d
leal (%rax,%rax), %ecx
movl %ecx, 0x4(%r14)
shll $0x4, %eax
movq 0x10(%r14), %rdi
movslq %eax, %rsi
callq 0x2210
movq %rax, 0x10(%r14)
movq %r15, %rdi
callq 0x21e0
testq %rax, %rax
jne 0x5020
movq %r15, %rdi
callq 0x2160
addq $0x1098, %rsp           # imm = 0x1098
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x2440
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/dir.c
// Function: dir_ensure
void
dir_ensure(const char *path)
{
	char buf[PATH_MAX];
	char *p, *s, *e;
	strcpy(buf, path);
	path = buf;
	p = s = (char *)path;
	errno = 0;
	while ((e = strchr(s+1, '/'))) {
		int ret;
		*e = 0;
		errno = 0;
		ret = MKDIR(p);
		if (ret == -1 && errno != EEXIST) {
			fprintf(stderr, "mkdir '%s' %s\n", p, strerror(errno));
			exit(errno);
		}
		*e = '/';
		s = e + 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rdi, %rsi
leaq -0x1020(%rbp), %rdi
callq 0x2080
callq 0x2050
movq %rax, %rbx
movl $0x0, (%rax)
leaq -0x101f(%rbp), %rdi
movl $0x2f, %esi
callq 0x2100
testq %rax, %rax
je 0x51cd
movq %rax, %r14
leaq -0x1020(%rbp), %r15
movb $0x0, (%r14)
movl $0x0, (%rbx)
movq %r15, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x2090
cmpl $-0x1, %eax
jne 0x51b0
movl (%rbx), %edi
cmpl $0x11, %edi
jne 0x51db
movb $0x2f, (%r14)
addq $0x2, %r14
movq %r14, %rdi
movl $0x2f, %esi
callq 0x2100
movq %rax, %r14
testq %rax, %rax
jne 0x518d
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq -0x1020(%rbp), %rsi
movq %rbx, %rdx
callq 0x2485
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/dir.c
// Function: dir_readfile
dr_t
dir_readfile(const char *path, dr_t root)
{
	int fd;
	dr_t content;
	char buf[PATH_MAX];
	struct stat stat;
	path = changedir(buf, path, root);
	fd = open(path, O_RDONLY | O_BINARY);
	if (fd < 0)
		return NULL;
	fstat(fd, &stat);
	content = dr_new(stat.st_size, NULL);
	read(fd, content->buf, stat.st_size);
	close(fd);
	return content;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1090, %rsp           # imm = 0x1090
movq %rsi, %rdx
movq %rdi, %rsi
leaq -0x10b0(%rbp), %rdi
callq 0x5282
xorl %ebx, %ebx
movq %rax, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x526f
movl %eax, %r14d
leaq -0xb0(%rbp), %rbx
movl %eax, %edi
movq %rbx, %rsi
callq 0x22b0
movq 0x30(%rbx), %r15
movslq %r15d, %r12
leaq 0xc(%r12), %rdi
callq 0x21f0
movq %rax, %rbx
movl $0x1, (%rax)
movl %r12d, 0x4(%rax)
movb $0x0, 0x8(%rax,%r12)
leaq 0x8(%rax), %rsi
movl %r14d, %edi
movq %r15, %rdx
callq 0x2170
movl %r14d, %edi
callq 0x2150
movq %rbx, %rax
addq $0x1090, %rsp           # imm = 0x1090
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/dir.c
// Function: changedir
static const char *
changedir(char buf[PATH_MAX], const char *path, dr_t root)
{
	if (root != NULL) {
		int n = strlen(path);
		int sz = root->size;
		memcpy(buf, root->buf, sz);
		if (buf[sz-1] != '/') {
			buf[sz] = '/';
			sz += 1;
		}
		memcpy(&buf[sz], path, n);
		buf[sz + n] = 0;
		path = buf;
	}
	return path;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
testq %rdx, %rdx
je 0x52f9
movq %rdx, %r12
movq %rdi, %rbx
movq %r14, %rdi
callq 0x20e0
movq %rax, -0x30(%rbp)
movl 0x4(%r12), %r15d
addq $0x8, %r12
movslq %r15d, %r13
movq %rbx, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21c0
cmpb $0x2f, -0x1(%rbx,%r13)
je 0x52d7
movb $0x2f, (%rbx,%r13)
incl %r13d
movl %r13d, %r15d
movslq %r15d, %r15
leaq (%rbx,%r15), %rdi
movq -0x30(%rbp), %r12
movslq %r12d, %rdx
movq %r14, %rsi
callq 0x21c0
addl %r12d, %r15d
movslq %r15d, %rax
movb $0x0, (%rbx,%rax)
jmp 0x52fc
movq %r14, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/dir.c
// Function: dir_writefile
void
dir_writefile(const char *path, dr_t d, dr_t root)
{
	int fd, ret;
	char buf[PATH_MAX];
	path = changedir(buf, path, root);
	dir_ensure(path);
	fd = open(path, O_CREAT | O_RDWR | O_TRUNC | O_BINARY, 0644);
	if (fd < 0) {
		fprintf(stderr, "FATAL: write %s errno:%s\n",
			path, strerror(errno));
		exit(errno);
	}
	ret = write(fd, d->buf, d->size);
	assert(ret == d->size);
	close(fd);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movq %rsi, %rbx
movq %rdi, %rsi
leaq -0x1020(%rbp), %rdi
callq 0x5282
movq %rax, %r14
movq %rax, %rdi
callq 0x5140
movq %r14, %rdi
movl $0x242, %esi            # imm = 0x242
movl $0x1a4, %edx            # imm = 0x1A4
xorl %eax, %eax
callq 0x2230
testl %eax, %eax
js 0x5380
movl %eax, %r15d
leaq 0x8(%rbx), %rsi
movslq 0x4(%rbx), %rdx
movl %eax, %edi
callq 0x20c0
cmpl %eax, 0x4(%rbx)
jne 0x5388
movl %r15d, %edi
callq 0x2150
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x24c2
leaq 0x518b(%rip), %rdi      # 0xa51a
leaq 0x5193(%rip), %rsi      # 0xa529
leaq 0x5192(%rip), %rcx      # 0xa52f
movl $0xa4, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/dir.c
// Function: dir_rename
void
dir_rename(const char *from, const char *to, dr_t root)
{
	int ret;
	char fbuf[PATH_MAX], tbuf[PATH_MAX];
	from = changedir(fbuf, from, root);
	to = changedir(tbuf, to, root);
	dir_ensure(to);
	ret = rename(from, to);
	assert(ret == 0);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x2008, %rsp           # imm = 0x2008
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %rsi
leaq -0x2020(%rbp), %rdi
callq 0x5282
movq %rax, %r15
leaq -0x1020(%rbp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x5282
movq %rax, %rbx
movq %rax, %rdi
callq 0x5140
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2240
testl %eax, %eax
jne 0x5409
addq $0x2008, %rsp           # imm = 0x2008
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x514c(%rip), %rdi      # 0xa55c
leaq 0x5112(%rip), %rsi      # 0xa529
leaq 0x5147(%rip), %rcx      # 0xa565
movl $0xb2, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/dir.c
// Function: dir_movdir
void
dir_movdir(dr_t from, dr_t to)
{
	int i, n, ret;
	int flen, tlen;
	dr_t *list;
	char buf[PATH_MAX];
	n = dir_scan(str(from), &list, 0);
	flen = from->size;
	tlen = to->size;
	memcpy(buf, to->buf, tlen);
	for (i = 0; i < n; i++) {
		dr_t d = list[i];
		memcpy(&buf[tlen], &d->buf[flen], d->size - flen);
		buf[d->size - flen + tlen] = 0;
		dir_ensure(buf);
		ret = remove(buf);
		assert(ret == 0 || (ret == -1 && errno == ENOENT));
		ret = rename((char *)d->buf, buf);
		assert(ret == 0);
		dr_unref(d);
	}
	free(list);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1028, %rsp           # imm = 0x1028
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movabsq $0x8000000000, %rax     # imm = 0x8000000000
leaq -0x1050(%rbp), %r12
movq %rax, (%r12)
movl $0x0, 0x8(%r12)
movl $0x400, %edi            # imm = 0x400
callq 0x21f0
movq %rax, 0x10(%r12)
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4fd2
movq 0x10(%r12), %rax
movq %rax, -0x38(%rbp)
movslq (%r12), %rbx
movslq 0x4(%r14), %r14
movslq 0x4(%r15), %rdx
addq $0x8, %r15
leaq -0x1050(%rbp), %rdi
movq %r15, %rsi
movq %rdx, -0x30(%rbp)
callq 0x21c0
movq %rbx, -0x48(%rbp)
testq %rbx, %rbx
jle 0x5591
movq -0x30(%rbp), %rax
addq %rbp, %rax
addq $-0x1050, %rax          # imm = 0xEFB0
movq %rax, -0x40(%rbp)
xorl %r15d, %r15d
movq -0x38(%rbp), %rax
movq (%rax,%r15,8), %r13
leaq (%r14,%r13), %rsi
addq $0x8, %rsi
movslq 0x4(%r13), %rbx
subq %r14, %rbx
movq -0x40(%rbp), %rdi
movq %rbx, %rdx
callq 0x21c0
movq -0x30(%rbp), %rax
addl %ebx, %eax
cltq
movb $0x0, -0x1050(%rbp,%rax)
movq %r12, %rdi
callq 0x5140
movq %r12, %rdi
callq 0x2060
testl %eax, %eax
je 0x5553
cmpl $-0x1, %eax
jne 0x55ca
callq 0x2050
cmpl $0x2, (%rax)
jne 0x55ca
leaq 0x8(%r13), %rdi
movq %r12, %rsi
callq 0x2240
testl %eax, %eax
jne 0x55ab
testq %r13, %r13
je 0x5584
movl (%r13), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r13)
cmpl $0x1, %ecx
jg 0x5584
testl %eax, %eax
jne 0x55e9
movq %r13, %rdi
callq 0x2030
incq %r15
cmpq %r15, -0x48(%rbp)
jne 0x54f9
movq -0x38(%rbp), %rdi
addq $0x1028, %rsp           # imm = 0x1028
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2030
leaq 0x4faa(%rip), %rdi      # 0xa55c
leaq 0x4f70(%rip), %rsi      # 0xa529
leaq 0x5002(%rip), %rcx      # 0xa5c2
movl $0xd2, %edx
callq 0x2130
leaq 0x4fc6(%rip), %rdi      # 0xa597
leaq 0x4f51(%rip), %rsi      # 0xa529
leaq 0x4fe3(%rip), %rcx      # 0xa5c2
movl $0xd0, %edx
callq 0x2130
leaq 0x4a91(%rip), %rdi      # 0xa081
leaq 0x4a96(%rip), %rsi      # 0xa08d
leaq 0x4a96(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/db.c
// Function: db_hash
dr_t
db_hash(dr_t d)
{
	int i;
	char *p;
	dr_t hash;
	uint8_t digest[HASH_SIZE];
	HASH_CTX ctx;
	hash = dr_new(HASH_SIZE * 2, NULL);
	HASH_Init(&ctx);
	HASH_Update(&ctx, d->buf, d->size);
	HASH_Final(digest, &ctx);
	p = (char *)hash->buf;
	for (i = 0; i < HASH_SIZE; i++) {
		sprintf(p, "%02x", digest[i]);
		p += 2;
	}
	return hash;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x80, %rsp
movq %rdi, %r15
movl $0x34, %edi
callq 0x21f0
movq %rax, %rbx
movabsq $0x2800000001, %rax     # imm = 0x2800000001
movq %rax, (%rbx)
movb $0x0, 0x30(%rbx)
movq %rbx, %r14
addq $0x8, %r14
leaq -0xa0(%rbp), %r12
movq %r12, %rdi
callq 0x7bec
movslq 0x4(%r15), %rdx
addq $0x8, %r15
movq %r12, %rdi
movq %r15, %rsi
callq 0x7c0b
leaq -0x40(%rbp), %rdi
movq %r12, %rsi
callq 0x8f88
leaq 0x4f8a(%rip), %r15      # 0xa601
xorl %r12d, %r12d
movzbl -0x40(%rbp,%r12), %edx
movq %r14, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x2260
addq $0x2, %r14
incq %r12
cmpq $0x14, %r12
jne 0x567a
movq %rbx, %rax
addq $0x80, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/db.c
// Function: db_read
dr_t
db_read(dr_t name)
{
	dr_t d;
	d = db_tryread(name);
	if (d == NULL) {
		fprintf(stderr, "FATAL:db_read %s errno:%s\n",
			name->buf, strerror(errno));
		exit(errno);
	}
	return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x56ad
testq %rax, %rax
je 0x595b
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rbx, %rdi
callq 0x2559
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/db.c
// Function: db_write
dr_t
db_write(dr_t name, dr_t d)
{
	dr_t hash, read;
	int n, ret;
	char path[PATH_MAX] ;
	hash = db_hash(d);
	read = db_tryread(hash);
	if (read) {
		int same;
		same = dr_cmp(d, read);
		dr_unref(read);
		if (same != 0) {
			fprintf(stderr, "FATAL:db_write %s hash conflict:%s\n",
				name->buf, hash->buf);
			exit(EEXIST);
		}
	} else {
		char *p;
		p = (char *)hash->buf;
		n = sprintf(path, ROOT"/%c%c", p[0], p[1]);
		ret = MKDIR(path);
		if (ret == -1 && errno != EEXIST) {
			fprintf(stderr, "FATAL:db_write %s hash %s errno:%s\n",
				path, p, strerror(errno));
			exit(errno);
		}
		sprintf(&path[n], "/%s", &p[2]);
		dir_writefile(path, d, NULL);
	}
	return hash;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1000, %rsp           # imm = 0x1000
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
callq 0x5608
movq %rax, %rbx
movq %rax, %rdi
callq 0x56ad
testq %rax, %rax
je 0x59f1
movq %rax, %r12
movslq 0x4(%r14), %rdx
cmpl 0x4(%rax), %edx
jne 0x59ba
addq $0x8, %r14
movq %r12, %rsi
addq $0x8, %rsi
movq %r14, %rdi
callq 0x2200
testl %eax, %eax
je 0x5a79
xorl %r14d, %r14d
movl (%r12), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%r12)
cmpl $0x1, %ecx
jg 0x59dd
testl %eax, %eax
jne 0x5a81
movq %r12, %rdi
callq 0x2030
testb %r14b, %r14b
jne 0x5a66
movq %r15, %rdi
movq %rbx, %rsi
callq 0x25a2
movsbl 0x8(%rbx), %edx
movsbl 0x9(%rbx), %ecx
leaq 0x4c7f(%rip), %rsi      # 0xa67f
leaq -0x1020(%rbp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x2260
movl %eax, %r12d
movq %r15, %rdi
movl $0x1ed, %esi            # imm = 0x1ED
callq 0x2090
cmpl $-0x1, %eax
jne 0x5a32
callq 0x2050
movl (%rax), %edi
cmpl $0x11, %edi
jne 0x5aa0
movslq %r12d, %rax
leaq (%rax,%rbp), %rdi
addq $-0x1020, %rdi          # imm = 0xEFE0
movq %rbx, %rdx
addq $0xa, %rdx
leaq 0x4bc8(%rip), %rsi      # 0xa616
xorl %eax, %eax
callq 0x2260
leaq -0x1020(%rbp), %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x530e
movq %rbx, %rax
addq $0x1000, %rsp           # imm = 0x1000
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movb $0x1, %r14b
jmp 0x59bd
leaq 0x45f9(%rip), %rdi      # 0xa081
leaq 0x45fe(%rip), %rsi      # 0xa08d
leaq 0x45fe(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
movq %rax, %r15
addq $0x8, %rbx
movq 0x754a(%rip), %rax      # 0xcff8
movq (%rax), %r14
callq 0x22a0
leaq 0x4bd3(%rip), %rsi      # 0xa690
leaq -0x1020(%rbp), %rdx
movq %r14, %rdi
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0x2190
movl (%r15), %edi
callq 0x2270
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/db.c
// Function: db_readrel
void
db_readrel(struct release *rel, dr_t hash)
{
	dr_t relobj;
	relobj = db_read(hash);
	release_unmarshal(rel, relobj);
	dr_unref(relobj);
	return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0x5941
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
callq 0x63c0
testq %rbx, %rbx
je 0x5b1d
movl (%rbx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rbx)
cmpl $0x1, %ecx
jg 0x5b1d
testl %eax, %eax
jne 0x5b22
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x2030
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x4558(%rip), %rdi      # 0xa081
leaq 0x455d(%rip), %rsi      # 0xa08d
leaq 0x455d(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/db.c
// Function: db_readhead
dr_t
db_readhead(struct release *rel, struct tree *tree)
{
	dr_t h;
	h = dir_readfile(HEAD, NULL);
	if (h == NULL) {
		h = dr_new(0, NULL);
		memset(rel, 0, sizeof(*rel));
		if (tree != NULL)
			memset(tree, 0, sizeof(*tree));
	} else {
		db_readrel(rel, h);
		if (tree != NULL)
			db_readtree(tree, rel->tree);
	}
	return h;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
leaq 0x4af7(%rip), %rdi      # 0xa6b4
xorl %esi, %esi
callq 0x51ea
testq %rax, %rax
je 0x5bea
movq %rax, %rbx
movq %r15, %rdi
movq %rax, %rsi
callq 0x5adc
testq %r14, %r14
je 0x5c1c
movq 0x10(%r15), %rsi
movq %r14, %rdi
callq 0x5b41
jmp 0x5c1c
movl $0xc, %edi
callq 0x21f0
movq %rax, %rbx
movq $0x1, (%rax)
movb $0x0, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%r15)
movups %xmm0, 0x10(%r15)
movups %xmm0, 0x20(%r15)
testq %r14, %r14
je 0x5c1c
movups %xmm0, (%r14)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/findstr[P]version-database/db.c
// Function: db_writehead
dr_t
db_writehead(struct release *rel)
{
	dr_t relobj, relhash;
	relobj = release_marshal(rel);
	relhash = db_write(rel->ver, relobj);
	dir_writefile(HEAD, relhash, NULL);
	dr_unref(relobj);
	return relhash;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
callq 0x6274
movq %rax, %rbx
movq 0x18(%r14), %rdi
movq %rax, %rsi
callq 0x5963
movq %rax, %r14
leaq 0x4a62(%rip), %rdi      # 0xa6b4
movq %rax, %rsi
xorl %edx, %edx
callq 0x530e
testq %rbx, %rbx
je 0x5c79
movl (%rbx), %ecx
leal -0x1(%rcx), %eax
movl %eax, (%rbx)
cmpl $0x1, %ecx
jg 0x5c79
testl %eax, %eax
jne 0x5c81
movq %rbx, %rdi
callq 0x2030
movq %r14, %rax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x43f9(%rip), %rdi      # 0xa081
leaq 0x43fe(%rip), %rsi      # 0xa08d
leaq 0x43fe(%rip), %rcx      # 0xa094
movl $0x2d, %edx
callq 0x2130