LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/motet-a[P]libforks/tests/file_descriptor_leaks.c
// Function: main
int main() {
  struct rlimit l;
  l.rlim_cur = l.rlim_max = 9;
  check(setrlimit(RLIMIT_NOFILE, &l) == 0);

  for (size_t i = 0; i < LOOPS; i++) {
    libforks_ServerConn conn;
    check(libforks_start(&conn) == libforks_OK);
    check(libforks_stop(conn) == libforks_OK);
  }

  libforks_ServerConn conn;
  check(libforks_start(&conn) == libforks_OK);

  for (size_t i = 0; i < LOOPS; i++) {
    int exit_fd;

    libforks_Result r = libforks_fork(
      conn,
      NULL, // pid_ptr
      NULL, // socket_fd_ptr
      &exit_fd, // exit_fd_ptr
      child_main
    );
    check(r == libforks_OK);

    libforks_ExitEvent event;
    check(read(exit_fd, &event, sizeof event) == sizeof event);

    check(close(exit_fd) == 0);
  }

  check(libforks_stop(conn) == libforks_OK);

  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl $0x9, %eax
leaq 0x18(%rsp), %rsi
movq %rax, 0x8(%rsi)
movq %rax, (%rsi)
movl $0x7, %edi
callq 0x1170
testl %eax, %eax
jne 0x145f
movl $0x13, %r14d
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x1837
testl %eax, %eax
jne 0x141b
movq 0x8(%rsp), %rdi
callq 0x2446
testl %eax, %eax
jne 0x140a
decq %r14
jne 0x1355
leaq 0x8(%rsp), %rdi
callq 0x1837
testl %eax, %eax
jne 0x1470
movl $0x13, %r12d
leaq 0x122(%rip), %rbx       # 0x14bd
leaq 0x4(%rsp), %r14
leaq 0x10(%rsp), %r15
movq 0x8(%rsp), %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r14, %rcx
movq %rbx, %r8
callq 0x228b
testl %eax, %eax
jne 0x144e
movl 0x4(%rsp), %edi
movl $0x8, %edx
movq %r15, %rsi
callq 0x10f0
cmpq $0x8, %rax
jne 0x143d
movl 0x4(%rsp), %edi
callq 0x10c0
testl %eax, %eax
jne 0x142c
decq %r12
jne 0x13a5
movq 0x8(%rsp), %rdi
callq 0x2446
testl %eax, %eax
jne 0x1481
xorl %eax, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1c58(%rip), %rdi      # 0x3069
movl $0x1a, %esi
callq 0x1492
leaq 0x1c22(%rip), %rdi      # 0x3044
movl $0x19, %esi
callq 0x1492
leaq 0x1c9e(%rip), %rdi      # 0x30d1
movl $0x2f, %esi
callq 0x1492
leaq 0x1c59(%rip), %rdi      # 0x309d
movl $0x2d, %esi
callq 0x1492
leaq 0x1c37(%rip), %rdi      # 0x308c
movl $0x2a, %esi
callq 0x1492
leaq 0x1b9e(%rip), %rdi      # 0x3004
movl $0x15, %esi
callq 0x1492
leaq 0x1bcd(%rip), %rdi      # 0x3044
movl $0x1e, %esi
callq 0x1492
leaq 0x1be1(%rip), %rdi      # 0x3069
movl $0x32, %esi
callq 0x1492
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/dispatch.c
// Function: dispatch_accept
struct dispatch_state *
dispatch_accept(struct s3state * S, int s)
{
	struct dispatch_state * D;

	/* Allocate space for dispatcher state. */
	if ((D = malloc(sizeof(struct dispatch_state))) == NULL)
		goto err0;

	/* Initialize dispatcher. */
	D->S = S;

	/* Accept a connection. */
	D->accepting = 1;
	if (network_accept(s, callback_accept, D) == NULL)
		goto err1;

	/* Success! */
	return (D);

err1:
	free(D);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %r14
movl $0x38, %edi
callq 0x2270
testq %rax, %rax
je 0x338f
movq %rax, %rbx
movq %r14, (%rax)
movl $0x1, 0x8(%rax)
leaq 0x21(%rip), %rsi        # 0x3399
movl %ebp, %edi
movq %rax, %rdx
callq 0x6c64
testq %rax, %rax
jne 0x3391
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/s3state.c
// Function: s3state_get
int
s3state_get(struct s3state * S, struct proto_lbs_request * R,
    int (* callback)(void *, struct proto_lbs_request *,
        const uint8_t *, size_t), void * cookie)
{
	struct get_cookie * C;

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct get_cookie))) == NULL)
		goto err0;
	C->S = S;
	C->R = R;
	C->callback = callback;
	C->cookie = cookie;

	/* Send the S3 request. */
	if (proto_s3_request_range(S->Q_S3, S->bucket,
	    objmap(BLK2OBJECT(R->r.get.blkno)),
	    BLKOFFSET(R->r.get.blkno, S->blklen), S->blklen,
	    callback_get, C))
		goto err1;

	/* We will be performing a callback later. */
	S->npending += 1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r14
movl $0x20, %edi
callq 0x2270
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3bca
movq %rax, %r15
movq %r14, (%rax)
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %r13, 0x18(%rax)
movq 0x18(%r14), %r13
movq 0x28(%r14), %rbp
movq 0x10(%r12), %rdi
shrq $0x18, %rdi
incq %rdi
callq 0x4418
movl (%r14), %r8d
movl $0xffffff, %ecx         # imm = 0xFFFFFF
andl 0x10(%r12), %ecx
imull %r8d, %ecx
movq %r15, (%rsp)
leaq 0x33(%rip), %r9         # 0x3bdb
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0xa388
testl %eax, %eax
je 0x3bc4
movq %r15, %rdi
callq 0x2040
jmp 0x3bca
incq 0x30(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/s3state.c
// Function: callback_get
static int
callback_get(void * cookie, int failed, size_t buflen, const uint8_t * buf)
{
	struct get_cookie * C = cookie;
	struct s3state * S = C->S;
	int rc;

	/* If we failed or have the wrong size of buffer, we have no block. */
	if ((failed != 0) || (buflen != S->blklen))
		buf = NULL;

	/* Tell the dispatcher to send its response back. */
	rc = (C->callback)(C->cookie, C->R, buf, buflen);

	/* We've done a callback. */
	S->npending -= 1;

	/* Free our cookie. */
	free(C);

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

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rcx, %rax
movq %rdx, %rcx
movq %rdi, %rbx
movq (%rdi), %r14
testl %esi, %esi
jne 0x3bf7
movl (%r14), %edx
cmpq %rcx, %rdx
je 0x3bf9
xorl %eax, %eax
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %rdi
movq %rax, %rdx
callq *0x10(%rbx)
movl %eax, %ebp
decq 0x30(%r14)
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/s3state.c
// Function: s3state_append
int
s3state_append(struct s3state * S, struct proto_lbs_request * R,
    int (* callback)(void *, struct proto_lbs_request *, uint64_t),
    void * cookie)
{
	struct append_cookie * C;

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct append_cookie))) == NULL)
		goto err0;
	C->S = S;
	C->R = R;
	C->callback = callback;
	C->cookie = cookie;

	/* Sanity check. */
	assert(R->r.append.blkno % BLKSPEROBJECT == 0);

	/* Send the S3 request. */
	if (proto_s3_request_put(S->Q_S3, S->bucket,
	    objmap(BLK2OBJECT(R->r.append.blkno)),
	    R->r.append.nblks * S->blklen, R->r.append.buf,
	    callback_append, C))
		goto err1;

	/* We will be performing a callback later. */
	S->npending += 1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %r14
movl $0x20, %edi
callq 0x2270
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x3cb5
movq %rax, %r15
movq %r14, (%rax)
movq %r12, 0x8(%rax)
movq %rbp, 0x10(%rax)
movq %r13, 0x18(%rax)
movq 0x18(%r12), %rdi
testl $0xffffff, %edi         # imm = 0xFFFFFF
jne 0x3cc6
movq 0x18(%r14), %r13
movq 0x28(%r14), %rbp
shrq $0x18, %rdi
incq %rdi
callq 0x4418
movl (%r14), %ecx
imull 0x10(%r12), %ecx
movq 0x20(%r12), %r8
movq %r15, (%rsp)
leaq 0x52(%rip), %r9         # 0x3ce5
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x9ec0
testl %eax, %eax
je 0x3caf
movq %r15, %rdi
callq 0x2040
jmp 0x3cb5
incq 0x30(%r14)
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x98cd(%rip), %rdi      # 0xd59a
leaq 0x9826(%rip), %rsi      # 0xd4fa
leaq 0x98e6(%rip), %rcx      # 0xd5c1
movl $0xe0, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/s3state.c
// Function: s3state_free
void
s3state_free(struct s3state * S)
{

	/* Sanity-check. */
	assert(S->npending == 0);

	/* Free allocations. */
	free(S->bucket);
	free(S);
}

// Assembly:
pushq %rbx
cmpq $0x0, 0x30(%rdi)
jne 0x3d63
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
leaq 0x98d7(%rip), %rdi      # 0xd641
leaq 0x9789(%rip), %rsi      # 0xd4fa
leaq 0x98da(%rip), %rcx      # 0xd652
movl $0x130, %edx            # imm = 0x130
callq 0x21a0
nop
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/deleteto.c
// Function: deleteto_init
struct deleteto *
deleteto_init(struct wire_requestqueue * Q_S3, const char * bucket)
{
	struct deleteto * D;

	/* Allocate and initialize a DeleteTo structure. */
	if ((D = malloc(sizeof(struct deleteto))) == NULL)
		goto err0;
	D->Q = Q_S3;
	D->N = 0;
	D->npending = 0;
	D->idle = 1;
	D->updateDeletedTo = 0;
	D->shuttingdown = 0;
	if ((D->bucket = strdup(bucket)) == NULL)
		goto err1;

	/* Check if a DeletedMarker exists (if not, we treat it as 1). */
	D->done = 0;
	if (proto_s3_request_head(D->Q, D->bucket, "DeletedMarker",
	    callback_deletedmarker_head, D))
		goto err2;
	if (events_spin(&D->done))
		goto err2;

	/*
	 * If a marker exists, read it.  Eventual consistency is fine here
	 * since at worst we'll get an old marker and re-issue some deletes.
	 */
	if (D->M == 0) {
		D->done = 0;
		if (proto_s3_request_get(D->Q, D->bucket, "DeletedMarker", 8,
		    callback_deletedmarker_get, D))
			goto err2;
		if (events_spin(&D->done))
			goto err2;
	}

	/* Success! */
	return (D);

err2:
	free(D->bucket);
err1:
	free(D);
err0:
	/* Failure! */
	return (NULL);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %r14
movl $0x40, %edi
callq 0x2270
testq %rax, %rax
je 0x3e19
movq %rax, %rbx
movq %r14, (%rax)
xorl %eax, %eax
movq %rax, 0x10(%rbx)
movq %rax, 0x28(%rbx)
movq $0x1, 0x30(%rbx)
movl $0x0, 0x38(%rbx)
movq %r15, %rdi
callq 0x2390
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x3e11
movl $0x0, 0x20(%rbx)
leaq 0x989a(%rip), %rdx      # 0xd676
leaq 0x83(%rip), %rcx        # 0x3e66
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %r8
callq 0xa65e
testl %eax, %eax
jne 0x3e08
movq %rbx, %r14
addq $0x20, %r14
movq %r14, %rdi
callq 0x5261
testl %eax, %eax
je 0x3e24
movq 0x8(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
cmpq $0x0, 0x18(%rbx)
jne 0x3e1b
movl $0x0, 0x20(%rbx)
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
leaq 0x9836(%rip), %rdx      # 0xd676
leaq 0x81(%rip), %r8         # 0x3ec8
movl $0x8, %ecx
movq %rbx, %r9
callq 0xa101
testl %eax, %eax
jne 0x3e08
movq %r14, %rdi
callq 0x5261
testl %eax, %eax
jne 0x3e08
jmp 0x3e1b
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/deleteto.c
// Function: deleteto_stop
int
deleteto_stop(struct deleteto * D)
{
	int rc;

	/* We don't want to do any more DELETEs, just shut down. */
	D->shuttingdown = 1;

	/* Wait for S3 operations to finish. */
	rc = events_spin(&D->idle);

	/* Free the DeleteTo structure. */
	free(D->bucket);
	free(D);

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

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x1, 0x38(%rdi)
addq $0x30, %rdi
callq 0x5261
movl %eax, %ebp
movq 0x8(%rbx), %rdi
callq 0x2040
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/deleteto.c
// Function: callback_done
static int
callback_done(void * cookie, int failed)
{
	struct deleteto * D = cookie;

	/* Sanity-checks. */
	assert(D->idle == 0);
	assert(D->npending > 0);

	/* Failures are bad, m'kay? */
	if (failed)
		goto err0;

	/* We've finished an operation. */
	D->npending -= 1;

	/* Have we finished all of them? */
	if (D->npending == 0) {
		D->idle = 1;
		if (poke(D))
			goto err0;
	}

	/* Success! */
	return (0);

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

// Assembly:
pushq %rbx
cmpl $0x0, 0x30(%rdi)
jne 0x4197
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x41b6
testl %esi, %esi
je 0x4176
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x4181
xorl %ebx, %ebx
decq %rax
movq %rax, 0x28(%rdi)
je 0x4185
movl %ebx, %eax
popq %rbx
retq
movl $0x1, 0x30(%rdi)
callq 0x3f27
testl %eax, %eax
jne 0x416f
jmp 0x4181
leaq 0x9582(%rip), %rdi      # 0xd720
leaq 0x9554(%rip), %rsi      # 0xd6f9
leaq 0x9581(%rip), %rcx      # 0xd72d
movl $0x106, %edx            # imm = 0x106
callq 0x21a0
leaq 0x958f(%rip), %rdi      # 0xd74c
leaq 0x9535(%rip), %rsi      # 0xd6f9
leaq 0x9562(%rip), %rcx      # 0xd72d
movl $0x107, %edx            # imm = 0x107
callq 0x21a0
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/findlast.c
// Function: findlast
int
findlast(struct wire_requestqueue * Q_S3, const char * bucket,
    uint64_t * L, size_t * olen)
{
	uint64_t N;
	int i;
	int status;
	size_t clen;

	/* We have no objects yet. */
	*L = 0;
	*olen = 0;

	/* See Algorithm FindLast in the DESIGN file. */
	for (i = 0; i < 64; i++) {
		if (head(Q_S3, bucket, (uint64_t)(1) << i, &status, &clen))
			goto err0;
		if (status == 404)
			break;
		if (status != 200)
			goto err1;
		*L = (uint64_t)(1) << i;
		*olen = clen;
	}
	for (N = *L / 2; N > 0; N = N / 2) {
		if (head(Q_S3, bucket, *L + N, &status, &clen))
			goto err0;
		if (status == 200) {
			*L = *L + N;
			*olen = clen;
		} else if (status != 404)
			goto err1;
	}

	/* If necessary, scan backwards until we find a non-empty object. */
	while ((*olen == 0) && (*L > 1)) {
		*L -= 1;
		if (head(Q_S3, bucket, *L, &status, &clen))
			goto err0;
		if (status == 404) {
			warn0("Cannot find non-empty S3 object");
			goto err0;
		} else if (status != 200)
			goto err1;
		*olen = clen;
	}

	/* Success! */
	return (0);

err1:
	warn0("HEAD returned status %d!", status);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %r15
movq %rsi, 0x10(%rsp)
movq %rdi, %r13
xorl %ebp, %ebp
movq %rbp, (%rdx)
movq %rcx, %r12
movq %rbp, (%rcx)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl $0x1, %r14d
movl %ebp, %ecx
shlq %cl, %r14
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rdx
leaq 0x4(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x4355
testl %eax, %eax
jne 0x4344
movl 0x4(%rsp), %eax
cmpl $0xc8, %eax
jne 0x4250
movq %r14, (%r15)
movq 0x8(%rsp), %rax
movq %rax, (%r12)
incq %rbp
cmpq $0x40, %rbp
jne 0x4201
jmp 0x425b
cmpl $0x194, %eax            # imm = 0x194
jne 0x4327
movq (%r15), %rbp
cmpq $0x2, %rbp
jb 0x42ba
movq %rbp, %r14
shrq %r14
movq (%r15), %rdx
addq %r14, %rdx
movq %r13, %rdi
movq 0x10(%rsp), %rsi
leaq 0x4(%rsp), %rcx
leaq 0x8(%rsp), %r8
callq 0x4355
testl %eax, %eax
jne 0x4344
movl 0x4(%rsp), %eax
cmpl $0x194, %eax            # imm = 0x194
je 0x42b1
cmpl $0xc8, %eax
jne 0x4327
addq %r14, (%r15)
movq 0x8(%rsp), %rax
movq %rax, (%r12)
cmpq $0x4, %rbp
movq %r14, %rbp
jae 0x4267
cmpq $0x0, (%r12)
je 0x42c5
xorl %ebx, %ebx
jmp 0x4344
leaq 0x4(%rsp), %r14
leaq 0x8(%rsp), %rbp
movq (%r15), %rdx
cmpq $0x2, %rdx
jb 0x42c1
decq %rdx
movq %rdx, (%r15)
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rcx
movq %rbp, %r8
callq 0x4355
testl %eax, %eax
jne 0x4344
movl 0x4(%rsp), %eax
cmpl $0xc8, %eax
jne 0x4310
movq 0x8(%rsp), %rax
movq %rax, (%r12)
testq %rax, %rax
je 0x42cf
jmp 0x42c1
cmpl $0x194, %eax            # imm = 0x194
jne 0x4327
leaq 0x943e(%rip), %rdi      # 0xd75c
xorl %eax, %eax
callq 0x9997
jmp 0x4339
movl 0x4(%rsp), %esi
leaq 0x944a(%rip), %rdi      # 0xd77c
xorl %eax, %eax
callq 0x9997
callq 0x20a0
movl $0x0, (%rax)
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/findlast.c
// Function: head
static int
head(struct wire_requestqueue * Q_S3, const char * bucket, uint64_t N,
    int * status, size_t * clen)
{
	struct headdata hd;

	/* Issue a HEAD request. */
	hd.done = 0;
	if (proto_s3_request_head(Q_S3, bucket, objmap(N), callback_head, &hd))
		goto err1;

	/* Wait for the request to finish. */
	if (events_spin(&hd.done))
		goto err1;

	/* If the status is 0, we failed. */
	if (status == 0)
		goto err1;

	/* Return results. */
	*status = hd.status;
	*clen = hd.clen;

	/* Success! */
	return (0);

err1:
	warnp("Error issuing HEAD request");

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

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %r8, %rbx
movq %rcx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq %rsp, %r13
movl $0x0, (%r13)
movq %rdx, %rdi
callq 0x4418
leaq 0x7d(%rip), %rcx        # 0x4405
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r13, %r8
callq 0xa65e
testl %eax, %eax
je 0x43c0
callq 0x20a0
cmpl $0x0, (%rax)
je 0x43e4
movq %rax, %rbx
leaq 0x93e4(%rip), %rdi      # 0xd795
xorl %eax, %eax
callq 0x9878
movl $0x0, (%rbx)
jmp 0x43f2
movq %rsp, %rdi
callq 0x5261
testq %r14, %r14
je 0x439d
testl %eax, %eax
jne 0x439d
movl 0x4(%rsp), %eax
movl %eax, (%r14)
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
xorl %eax, %eax
jmp 0x43f7
leaq 0x93aa(%rip), %rdi      # 0xd795
xorl %eax, %eax
callq 0x9997
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/lbs-s3/objmap.c
// Function: objmap
const char *
objmap(uint64_t N)
{
	uint8_t Nbuf[8];
	uint8_t hbuf[16];
	static char oname[22]; /* HASH_0123456789012345 */

	/* Serialize the value N. */
	be64enc(Nbuf, N);

	/* Hash the (serialized) value. */
	MD5_Buf(Nbuf, 8, hbuf);

	/* Hexify the first two bytes of hash. */
	hexify(hbuf, &oname[0], 2);

	/* Separator character. */
	oname[4] = '_';

	/* Hexify the 8-byte integer. */
	hexify(Nbuf, &oname[5], 8);

	/* NUL-terminate. */
	oname[21] = '\0';

	/* Return the constructed string. */
	return (oname);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
bswapq %rdi
leaq 0x8(%rsp), %rbx
movq %rdi, (%rbx)
leaq 0x10(%rsp), %r14
movl $0x8, %esi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x4d7c
leaq 0x101e8(%rip), %r15     # 0x14630
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x8060
movb $0x5f, 0x101d5(%rip)    # 0x14634
leaq 0x101cf(%rip), %rsi     # 0x14635
movl $0x8, %edx
movq %rbx, %rdi
callq 0x8060
movb $0x0, 0x101cb(%rip)     # 0x14645
movq %r15, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/trumabrat[P]GrandProjet/chaineMain.c
// Function: main
int main()
{
    /* 
        lecture et creation d'une instance de Chaines
        on peut decommenter pour choisir l'instance qu'on va verifier
    */

    // FILE* f = fopen("00014_burma.cha", "r");
    // FILE* f = fopen("05000_USA-road-d-NY.cha", "r");
    FILE* f = fopen("07397_pla.cha", "r");
    // FILE* f = fopen("test.cha", "r");
    
    // FILE *f2 = fopen("00014_burma_res.txt", "w");
    // FILE* f2 = fopen("05000_USA-road-d-NY_res.txt", "w");
    FILE* f2 = fopen("07397_pla.cha_res", "w");
    // FILE* f2 = fopen("test_res.cha", "w");
    Chaines *c = lectureChaines(f);
    ecrireChaines(c, f2);

    // affichage de cette Chaines
    afficheChainesSVG(c, "Chaines");
    printf("LongueurTotal = %lf, nombre de points = %d\n", longueurTotale(c), comptePointsTotal(c));

    // fermeture des fichiers et liberation
    liberer_chaines(c);
    fclose(f);
    fclose(f2);
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0xdd8(%rip), %rdi       # 0x2004
leaq 0xddf(%rip), %rsi       # 0x2012
callq 0x10d0
movq %rax, %rbx
leaq 0xdd2(%rip), %rdi       # 0x2014
leaq 0xddd(%rip), %rsi       # 0x2026
callq 0x10d0
movq %rax, %r14
movq %rbx, %rdi
callq 0x12c8
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1431
leaq 0xdba(%rip), %rsi       # 0x2028
movq %r15, %rdi
callq 0x150a
movq %r15, %rdi
callq 0x180e
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
callq 0x18b0
leaq 0xd9d(%rip), %rdi       # 0x2030
movsd 0x8(%rsp), %xmm0
movl %eax, %esi
movb $0x1, %al
callq 0x1080
movq %r15, %rdi
callq 0x1922
movq %rbx, %rdi
callq 0x1060
movq %r14, %rdi
callq 0x1060
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/giometti[P]mastering_UNIX_programming/chapter_01/buffered.c
// Function: main
int main(void)
{
	int n;
	char buf[DATA_SIZE];

	memset(buf, 0, DATA_SIZE);
	for (n = 0; n < DATA_SIZE; n++)
		if (fputc(buf[n], stdout) != buf[n]) {
			err("write error\n");
			break;
		}

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20000, %rsp          # imm = 0x20000
movq %rsp, %rdi
xorl %r14d, %r14d
movl $0x20000, %edx          # imm = 0x20000
xorl %esi, %esi
callq 0x1040
movq 0x2e37(%rip), %r15      # 0x3fd8
movsbl (%rsp,%r14), %ebx
movq (%r15), %rsi
movl %ebx, %edi
callq 0x1050
cmpl %ebx, %eax
jne 0x11cf
incq %r14
cmpq $0x20000, %r14          # imm = 0x20000
jne 0x11a1
xorl %eax, %eax
addq $0x20000, %rsp          # imm = 0x20000
popq %rbx
popq %r14
popq %r15
retq
callq 0x1070
jmp 0x11c0
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: xcb_remove_property
void xcb_remove_property(xcb_connection_t *con, xcb_window_t win, xcb_atom_t prop, xcb_atom_t atom)
{
    xcb_grab_server(con);

    xcb_get_property_reply_t *reply =
        xcb_get_property_reply(con,
                               xcb_get_property(con, False, win, prop, XCB_GET_PROPERTY_TYPE_ANY, 0, 4096), NULL);
    if (reply == NULL || xcb_get_property_value_length(reply) == 0)
        goto release_grab;
    xcb_atom_t *atoms = xcb_get_property_value(reply);
    if (atoms == NULL) {
        goto release_grab;
    }

    {
        int num = 0;
        const int current_size = xcb_get_property_value_length(reply) / (reply->format / 8);
        xcb_atom_t values[current_size];
        for (int i = 0; i < current_size; i++) {
            if (atoms[i] != atom)
                values[num++] = atoms[i];
        }

        xcb_change_property(con, XCB_PROP_MODE_REPLACE, win, prop, XCB_ATOM_ATOM, 32, num, values);
    }

release_grab:
    if (reply)
        free(reply);
    xcb_ungrab_server(con);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r12d
movl %edx, %r14d
movl %esi, %r15d
movq %rdi, %rbx
callq 0x3420
subq $0x8, %rsp
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %r14d, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x1000                 # imm = 0x1000
callq 0x3080
addq $0x10, %rsp
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3500
testq %rax, %rax
je 0x38cf
movq %rax, %r13
movl %r14d, -0x2c(%rbp)
movq %rax, %rdi
callq 0x3480
testl %eax, %eax
je 0x38c7
movq %r13, %rdi
callq 0x3100
testq %rax, %rax
je 0x38c7
movq %rax, %r14
movq %r13, %rdi
callq 0x3480
movq %rsp, -0x38(%rbp)
movzbl 0x1(%r13), %ecx
shrl $0x3, %ecx
cltd
idivl %ecx
leaq 0xf(,%rax,4), %rcx
andq $-0x10, %rcx
movq %rsp, %r10
subq %rcx, %r10
movq %r10, %rsp
testl %eax, %eax
jle 0x389e
movl %eax, %ecx
xorl %edx, %edx
xorl %eax, %eax
movl (%r14,%rdx,4), %esi
cmpl %r12d, %esi
je 0x3894
movslq %eax, %rdi
incl %eax
movl %esi, (%r10,%rdi,4)
incq %rdx
cmpq %rdx, %rcx
jne 0x3882
jmp 0x38a0
xorl %eax, %eax
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl -0x2c(%rbp), %ecx
movl $0x4, %r8d
movl $0x20, %r9d
pushq %r10
pushq %rax
callq 0x35d0
addq $0x10, %rsp
movq -0x38(%rbp), %rsp
movq %r13, %rdi
callq 0x3050
movq %rbx, %rdi
callq 0x3130
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: setup_keyboard
int setup_keyboard(void)
{
    xcb_get_modifier_mapping_reply_t *reply;
    xcb_keycode_t                    *modmap;
    xcb_keycode_t                    *numlock;

    if (!(keysyms = xcb_key_symbols_alloc(dis)))
        return -1;

    reply = xcb_get_modifier_mapping_reply(dis,
                            xcb_get_modifier_mapping_unchecked(dis), NULL);
                            /* TODO: error checking */
    if (!reply)
        return -1;

    modmap = xcb_get_modifier_mapping_keycodes(reply);
    if (!modmap) {
        free(reply);
        return -1;
    }

    numlock = xcb_get_keycodes(XK_Num_Lock);
    if (numlock) {
        for (unsigned int i = 0; i < 8; i++) {
            for (unsigned int j = 0; j < reply->keycodes_per_modifier; j++) {
                xcb_keycode_t keycode =
                        modmap[i * reply->keycodes_per_modifier +
                                               j];
                if (keycode == XCB_NO_SYMBOL)
                    continue;
                for (unsigned int n = 0; numlock[n] != XCB_NO_SYMBOL; n++) {
                    if (numlock[n] == keycode) {
                        DEBUGP("xcb: found num-lock %d\n", 1 << i);
                        numlockmask = 1 << i;
                        break;
                    }
                }
            }
        }
        free(numlock);
    }
    free(reply);


    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq 0x7e5f(%rip), %rdi      # 0xb750
callq 0x3150
movq %rax, 0x7e5b(%rip)      # 0xb758
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x39d8
movq 0x7e3e(%rip), %rbx      # 0xb750
movq %rbx, %rdi
callq 0x3690
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3630
testq %rax, %rax
je 0x39d8
movq %rax, %rbx
movq %rax, %rdi
callq 0x30b0
testq %rax, %rax
je 0x39cb
movq %rax, %r14
movq 0x7e0b(%rip), %rdi      # 0xb758
movl $0xff7f, %esi           # imm = 0xFF7F
callq 0x3370
testq %rax, %rax
je 0x39c7
movzbl 0x1(%rbx), %edx
xorl %ecx, %ecx
testq %rdx, %rdx
je 0x39b6
movl $0x1, %esi
shll %cl, %esi
movq %rcx, %rdi
imulq %rdx, %rdi
addq %r14, %rdi
xorl %r8d, %r8d
movb (%rdi,%r8), %r9b
testb %r9b, %r9b
je 0x39ae
movb (%rax), %r11b
testb %r11b, %r11b
je 0x39ae
movl $0x1, %r10d
cmpb %r9b, %r11b
je 0x39a8
movl %r10d, %r11d
movb (%rax,%r11), %r11b
incl %r10d
testb %r11b, %r11b
jne 0x3992
jmp 0x39ae
movl %esi, 0x7db2(%rip)      # 0xb760
incq %r8
cmpq %rdx, %r8
jne 0x397b
incq %rcx
cmpq $0x8, %rcx
jne 0x3962
movq %rax, %rdi
callq 0x3050
xorl %ebp, %ebp
jmp 0x39d0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x3050
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: destroy_display
static void destroy_display(client *c)
{
    desktop *desk=NULL;
    monitor *moni=NULL;
    display *disp=NULL, *next;

    getparents(c, &disp, &moni, &desk);     /* get the client's display, monitor and desktop. */
    if (!(next = (display *)get_next(&disp->link)))     /* cannot destroy the last display. */
        return;
    for (client *t = (client *)rem_head(&disp->clients); t; t = (client *)rem_head(&disp->clients)) {
    /* relink entire clientlist to the tail of next display clientlist. */
        add_tail(&next->clients, &t->link);
    }
    rem_node(&disp->link);                   /* unlink now empty display */
    select_desktop(current_desktop_number);     /* update global pointers */
    for (alien *t = (alien *)get_head(&aliens); t; t = (alien *)get_next(&t->link))   /* show aliens */
        xcb_move(dis, t->win, t->position_info.previous_x, t->position_info.previous_y, &t->position_info);
    if (current_display == next) {
        update_current(c);
    }
    free(disp);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
testq %rdi, %rdi
je 0x3cca
movq 0x10(%rbx), %rax
movq 0x10(%rax), %r14
jmp 0x3ccd
xorl %r14d, %r14d
testq %r14, %r14
je 0x3cd8
movq 0x8(%r14), %r12
jmp 0x3cdb
xorl %r12d, %r12d
testq %r12, %r12
je 0x3dbd
movq 0x18(%r14), %rdi
callq 0x4f4a
testq %rax, %rax
je 0x3d3f
leaq 0x18(%r12), %r15
cmpq $0x0, (%r15)
je 0x3d17
movq 0x20(%r12), %rcx
movq %rax, 0x20(%r12)
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
movl $0x8, %ecx
xorl %edx, %edx
jmp 0x3d29
movq %rax, 0x18(%r12)
movq %rax, 0x20(%r12)
movl $0x10, %ecx
movq %r15, %rdx
movq %rdx, (%rax,%rcx)
movq %r15, 0x10(%rax)
movq 0x18(%r14), %rdi
callq 0x4f4a
testq %rax, %rax
jne 0x3cf7
movq %r14, %rdi
callq 0x4f4a
movl 0x7a5b(%rip), %edi      # 0xb7a8
callq 0x4fc0
movq 0x7a37(%rip), %r13      # 0xb790
testq %r13, %r13
je 0x3da4
leaq 0x8(%rsp), %r15
movq 0x79e6(%rip), %rdi      # 0xb750
movl 0x18(%r13), %esi
movl 0x20(%r13), %eax
movl 0x24(%r13), %ecx
movl %eax, 0x8(%rsp)
movl %ecx, 0xc(%rsp)
movq 0x28(%r13), %rdx
movq %rdx, 0x20(%r13)
movl %eax, 0x28(%r13)
movl %ecx, 0x2c(%r13)
movl $0x3, %edx
movq %r15, %rcx
callq 0x32c0
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0x3d63
cmpq %r12, 0x79d5(%rip)      # 0xb780
jne 0x3db5
movq %rbx, %rdi
callq 0x3dcb
movq %r14, %rdi
callq 0x3050
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: desktopinfo
void desktopinfo(void)
{
#ifndef EWMH_TASKBAR
    bool urgent = false;
    int cd = current_desktop_number, n = 0, d = 0;
    xcb_get_property_cookie_t cookie;
    xcb_ewmh_get_utf8_strings_reply_t wtitle;
    wtitle.strings = NULL;

    if (M_CURRENT) {
        cookie = xcb_ewmh_get_wm_name_unchecked(ewmh, M_CURRENT->win);
        xcb_ewmh_get_wm_name_reply(ewmh, cookie, &wtitle, (void *)0);
    }

    for (client *c; d < DESKTOPS; d++) {
        for (select_desktop(d), c = M_HEAD, n = 0, urgent = false;
             c; c = M_GETNEXT(c), ++n)
            if (c->isurgent)
                urgent = true;
        fprintf(stdout, "%d:%d:%d:%d:%d ", d, n, M_MODE, current_desktop_number == cd,
                urgent);
    }

    if (wtitle.strings) {
        xcb_ewmh_get_utf8_strings_reply_wipe(&wtitle);
    }

    fflush(stdout);
    if (cd != d - 1)
        select_desktop(cd);
#else
    Update_EWMH_Taskbar_Properties();
#endif /* EWMH_TASKBAR */
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl 0x6952(%rip), %ebx      # 0xb7a8
movq $0x0, 0x10(%rsp)
movq 0x691a(%rip), %rax      # 0xb780
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x4e93
movq 0x68f2(%rip), %rdi      # 0xb768
movl 0x20(%rax), %esi
callq 0x3470
movq 0x68e3(%rip), %rdi      # 0xb768
leaq 0x8(%rsp), %rdx
movl %eax, %esi
xorl %ecx, %ecx
callq 0x31c0
movq 0x6136(%rip), %r15      # 0xafd0
leaq 0x33b5(%rip), %r14      # 0x8256
movl $0x1, %r12d
xorl %ebp, %ebp
movl %ebp, %edi
callq 0x4fc0
movq 0x68c9(%rip), %rax      # 0xb780
movq 0x18(%rax), %rdx
movl $0x0, %ecx
movl $0x0, %esi
testq %rdx, %rdx
je 0x4eed
xorl %esi, %esi
xorl %ecx, %ecx
movzbl %sil, %esi
cmpb $0x0, 0x18(%rdx)
cmovnel %r12d, %esi
incl %ecx
movq 0x8(%rdx), %rdx
testq %rdx, %rdx
jne 0x4ece
andb $0x1, %sil
movzbl %sil, %esi
movq (%r15), %rdi
movl 0x5c(%rax), %r8d
xorl %r9d, %r9d
cmpl %ebx, 0x68ab(%rip)      # 0xb7a8
sete %r9b
movl %esi, (%rsp)
movq %r14, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3380
incl %ebp
cmpl $0xa, %ebp
jne 0x4ea9
cmpq $0x0, 0x10(%rsp)
je 0x4f29
leaq 0x8(%rsp), %rdi
callq 0x35c0
movq (%r15), %rdi
callq 0x3410
cmpl $0x9, %ebx
je 0x4f3d
movl %ebx, %edi
callq 0x4fc0
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: rem_node
static node *rem_node(node *n)
{
    list *l;

    if (!n)
        return NULL;
    l = n->parent;
    if (l) {
        if (n == l->head) {
            l->head = l->head->next;
            if(l->head)
                l->head->prev = NULL;
            else
                l->tail = NULL;
        }
        else if (n == l->tail) {
            l->tail = l->tail->prev;
            l->tail->next = NULL;
        }
        else {
            n->prev->next = n->next;
            n->next->prev = n->prev;
        }
    }
    n->prev = n->next = NULL;
    n->parent = NULL;
    return n;
}

// Assembly:
testq %rdi, %rdi
je 0x4f7d
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x4fae
movq (%rax), %rcx
cmpq %rdi, %rcx
je 0x4f80
movq 0x8(%rax), %rcx
cmpq %rdi, %rcx
je 0x4f95
movq (%rdi), %rax
movq 0x8(%rdi), %rcx
movq %rcx, 0x8(%rax)
movq 0x8(%rdi), %rcx
movq %rax, (%rcx)
jmp 0x4fae
xorl %eax, %eax
retq
movq 0x8(%rcx), %rcx
movq %rcx, (%rax)
testq %rcx, %rcx
je 0x4fa6
movq $0x0, (%rcx)
jmp 0x4fae
movq (%rcx), %rcx
movq %rcx, 0x8(%rax)
movq $0x0, 0x8(%rcx)
jmp 0x4fae
movq $0x0, 0x8(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
movq %rdi, %rax
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: select_desktop
void select_desktop(int i)
{
    if (i < 0 || i >= DESKTOPS)
        return;
    current_desktop = find_desktop(i);
    if (!current_desktop)
        current_desktop = (desktop *)get_head(&desktops);
    current_desktop_number = current_desktop->num;
    current_monitor = (monitor *)get_head(&current_desktop->monitors);
    current_display = (display *)get_head(&current_monitor->displays);
}

// Assembly:
cmpl $0x9, %edi
ja 0x5012
movq 0x67ec(%rip), %rax      # 0xb7b8
movq %rax, %rcx
testq %rax, %rax
je 0x4fe5
movq %rax, %rcx
cmpl %edi, 0x30(%rcx)
je 0x4fe5
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x4fd7
testq %rcx, %rcx
cmovneq %rcx, %rax
movq %rax, 0x67bd(%rip)      # 0xb7b0
movl 0x30(%rax), %ecx
movl %ecx, 0x67ac(%rip)      # 0xb7a8
movq 0x18(%rax), %rax
movq %rax, 0x6781(%rip)      # 0xb788
movq 0x18(%rax), %rax
movq %rax, 0x676e(%rip)      # 0xb780
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: sendevent
static bool sendevent(xcb_window_t win, xcb_atom_t proto)
{
    bool got = check_wmproto(win, proto);
    if (got) {
        xcb_client_message_event_t ev = {0};

        ev.response_type = XCB_CLIENT_MESSAGE;
        ev.window = win;
        ev.format = 32;
        ev.sequence = 0;
        ev.type = wmatoms[WM_PROTOCOLS];
        ev.data.data32[0] = proto;
        ev.data.data32[1] = XCB_CURRENT_TIME;
        xcb_send_event(dis, 0, win, XCB_EVENT_MASK_NO_EVENT, (char *)&ev);
    }

    return got;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x28, %rsp
movl %esi, %ebp
movl %edi, %ebx
movq 0x6700(%rip), %r15      # 0xb750
movl 0x678a(%rip), %edx      # 0xb7e0
movq %r15, %rdi
movl %ebx, %esi
callq 0x30c0
xorl %r14d, %r14d
movq %rsp, %rdx
movq %r15, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x3110
testb %al, %al
je 0x50a1
movl (%rsp), %eax
testq %rax, %rax
je 0x5096
movq 0x8(%rsp), %rcx
xorl %edx, %edx
cmpl %ebp, (%rcx,%rdx,4)
sete %r14b
je 0x5099
incq %rdx
cmpq %rdx, %rax
jne 0x5085
xorl %r14d, %r14d
movq %rsp, %rdi
callq 0x30a0
testb %r14b, %r14b
je 0x50e8
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, (%r8)
movaps %xmm0, 0x10(%r8)
movl $0x2021, (%r8)          # imm = 0x2021
movl %ebx, 0x4(%r8)
movl 0x671a(%rip), %eax      # 0xb7e0
movl %eax, 0x8(%r8)
movl %ebp, 0xc(%r8)
movl $0x0, 0x10(%r8)
movq 0x6673(%rip), %rdi      # 0xb750
xorl %esi, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x3540
movl %r14d, %eax
addq $0x28, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: getcolor
unsigned int getcolor(char *color)
{
    xcb_colormap_t map = screen->default_colormap;
    xcb_alloc_color_reply_t *c;
    unsigned int r, g, b, rgb, pixel;

    rgb = xcb_get_colorpixel(color);
    r = rgb >> 16; g = rgb >> 8 & 0xFF; b = rgb & 0xFF;
    c = xcb_alloc_color_reply(dis, xcb_alloc_color(dis, map, r * 257, g * 257,
                                                   b * 257), NULL);
    if (!c)
        errx(EXIT_FAILURE, "error: cannot allocate color '%s'\n", color);

    pixel = c->pixel;
    free(c);

    return pixel;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %r14
movq 0x619e(%rip), %rax      # 0xb770
movl 0x4(%rax), %ebp
movb 0x1(%rdi), %al
leaq 0xa(%rsp), %rbx
movb %al, -0x3(%rbx)
movb 0x2(%rdi), %al
movb %al, -0x2(%rbx)
xorl %eax, %eax
movb %al, -0x1(%rbx)
movb 0x3(%rdi), %cl
movb %cl, (%rbx)
movb 0x4(%rdi), %cl
movb %cl, 0x1(%rbx)
movb %al, 0x2(%rbx)
leaq 0xd(%rsp), %r15
movb 0x5(%rdi), %cl
movb %cl, (%r15)
movb 0x6(%rdi), %cl
movb %cl, 0x1(%r15)
movb %al, 0x2(%r15)
leaq 0x7(%rsp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3390
movq %rax, %r12
movq %rbx, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3390
movq %rax, %rbx
movq %r15, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3390
shll $0x10, %r12d
shll $0x8, %ebx
addl %r12d, %ebx
addl %eax, %ebx
movl %ebx, %eax
shrl $0x10, %eax
movq 0x60f4(%rip), %r15      # 0xb750
movl %eax, %edx
shll $0x8, %edx
addl %eax, %edx
movzbl %bh, %eax
movl %ebx, %ecx
andl $0xff00, %ecx           # imm = 0xFF00
orl %eax, %ecx
movzbl %bl, %eax
movl %eax, %r8d
shll $0x8, %r8d
orl %eax, %r8d
andl $0xffff, %edx           # imm = 0xFFFF
movq %r15, %rdi
movl %ebp, %esi
callq 0x34b0
movq %r15, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3450
testq %rax, %rax
je 0x56b8
movl 0x10(%rax), %ebx
movq %rax, %rdi
callq 0x3050
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2acc(%rip), %rsi      # 0x818b
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: buttonpress
void buttonpress(xcb_generic_event_t *e)
{
    xcb_button_press_event_t *ev = (xcb_button_press_event_t *)e;
    DEBUGP("xcb: button press: %d state: %d\n", ev->detail, ev->state);

    client *c = wintoclient(ev->event);

	if (CLICK_TO_FOCUS && M_CURRENT != c && ev->detail == XCB_BUTTON_INDEX_1) {
		update_current(c);
	}

	for (unsigned int i = 0; i < LENGTH(buttons); i++)
		if (buttons[i].func && buttons[i].button == ev->detail &&
			CLEANMASK(buttons[i].mask) == CLEANMASK(ev->state)) {
			if (M_CURRENT != c)
				update_current(c);
			if (buttons[i].root_only) {
				if (ev->event == ev->root && ev->child == 0)
					buttons[i].func(&(buttons[i].arg));
			}
			else {
				buttons[i].func(&(buttons[i].arg));
			}
		}

    if (CLICK_TO_FOCUS) {
        xcb_allow_events(dis, XCB_ALLOW_REPLAY_POINTER, ev->time);
        xcb_flush(dis);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl 0xc(%rdi), %edi
callq 0x6c8f
movq %rax, %r14
movq 0x6094(%rip), %rax      # 0xb780
cmpq %r14, 0x30(%rax)
je 0x5700
cmpb $0x1, 0x1(%rbx)
jne 0x5700
movq %r14, %rdi
callq 0x3dcb
leaq 0x5fa9(%rip), %r15      # 0xb6b0
movl $0x5, %r12d
cmpq $0x0, -0x8(%r15)
je 0x5769
movzbl 0x1(%rbx), %eax
cmpl %eax, -0xc(%r15)
jne 0x5769
movl 0x603c(%rip), %eax      # 0xb760
notl %eax
movzwl 0x1c(%rbx), %ecx
xorl -0x10(%r15), %ecx
andl %eax, %ecx
testl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
jne 0x5769
movq 0x6041(%rip), %rax      # 0xb780
cmpq %r14, 0x30(%rax)
je 0x574d
movq %r14, %rdi
callq 0x3dcb
cmpb $0x1, 0x8(%r15)
jne 0x5762
movl 0xc(%rbx), %eax
cmpl 0x8(%rbx), %eax
jne 0x5769
cmpl $0x0, 0x10(%rbx)
jne 0x5769
movq %r15, %rdi
callq *-0x8(%r15)
addq $0x20, %r15
decq %r12
jne 0x570d
movq 0x5fd7(%rip), %rdi      # 0xb750
movl 0x4(%rbx), %edx
movl $0x2, %esi
callq 0x3160
movq 0x5fc3(%rip), %rdi      # 0xb750
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3190
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: clientmessage
void clientmessage(xcb_generic_event_t *e)
{
    xcb_client_message_event_t *ev = (xcb_client_message_event_t *)e;
    client *c = wintoclient(ev->window);

    DEBUG("xcb: client message");

    if (c && ev->type == ewmh->_NET_WM_STATE) {
        if (((unsigned)ev->data.data32[1] == ewmh->_NET_WM_STATE_FULLSCREEN
          || (unsigned)ev->data.data32[2] == ewmh->_NET_WM_STATE_FULLSCREEN)) {
            uint32_t mode = ev->data.data32[0];

            if (mode == _NET_WM_STATE_TOGGLE)
                mode = (c->isfullscreen) ? _NET_WM_STATE_REMOVE : _NET_WM_STATE_ADD;
            setfullscreen(c, mode == _NET_WM_STATE_ADD);
        }
    }
    else {
        if (ev->type == ewmh->_NET_CURRENT_DESKTOP
            && ev->data.data32[0] < DESKTOPS)
            change_desktop(&(Arg){.i = ev->data.data32[0]});
        else {
            if (c && ev->type == ewmh->_NET_CLOSE_WINDOW)
                killclient(c);
            else {
                if (ev->type == ewmh->_NET_ACTIVE_WINDOW) {
                    if (c) {
                        client *t = NULL;
                        for (t = M_HEAD; t && t != c; t = M_GETNEXT(t))
                            ;
                        if (t)
                            update_current(c);
                    }
                }
                else {
                    if (c && ev->type == ewmh->_NET_WM_DESKTOP
                          && ev->data.data32[0] < DESKTOPS) {
                        client_to_desktop(&(Arg){.i = ev->data.data32[0]});
                    }
                }
            }
        }
    }
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x4(%rdi), %edi
callq 0x6c8f
testq %rax, %rax
je 0x57fd
movl 0x8(%rbx), %edx
movq 0x5fac(%rip), %rcx      # 0xb768
cmpl 0x84(%rcx), %edx
jne 0x57fd
movl 0x128(%rcx), %ecx
cmpl %ecx, 0x10(%rbx)
je 0x57d8
cmpl %ecx, 0x14(%rbx)
jne 0x588a
movl 0xc(%rbx), %ecx
cmpl $0x2, %ecx
jne 0x57e7
movzbl 0x1b(%rax), %ecx
xorl $0x1, %ecx
xorl %esi, %esi
cmpl $0x1, %ecx
sete %sil
movq %rax, %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x39df
movl 0x8(%rbx), %ecx
movq 0x5f61(%rip), %rdx      # 0xb768
cmpl 0x38(%rdx), %ecx
jne 0x5822
movl 0xc(%rbx), %esi
cmpl $0x9, %esi
ja 0x5822
leaq 0x8(%rsp), %rdi
movl %esi, (%rdi)
callq 0x62e4
jmp 0x588a
testq %rax, %rax
je 0x5836
cmpl 0x58(%rdx), %ecx
jne 0x5836
addq $0x10, %rsp
popq %rbx
jmp 0x6aa8
cmpl 0x40(%rdx), %ecx
jne 0x586e
testq %rax, %rax
je 0x588a
movq 0x5f39(%rip), %rdx      # 0xb780
addq $0x18, %rdx
movq (%rdx), %rcx
testq %rcx, %rcx
je 0x585c
leaq 0x8(%rcx), %rdx
cmpq %rax, %rcx
jne 0x584b
testq %rcx, %rcx
je 0x588a
movq %rax, %rdi
addq $0x10, %rsp
popq %rbx
jmp 0x3dcb
testq %rax, %rax
je 0x588a
cmpl 0x7c(%rdx), %ecx
jne 0x588a
movl 0xc(%rbx), %eax
cmpl $0x9, %eax
ja 0x588a
movq %rsp, %rdi
movl %eax, (%rdi)
callq 0x65f0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: configurerequest
void configurerequest(xcb_generic_event_t *e)
{
    xcb_configure_request_event_t *ev = (xcb_configure_request_event_t *)e;
    client *c = wintoclient(ev->window);

    DEBUG("xcb: configure request");

    if (c && c->ismaximized) {
        setmaximize(c, true);
    } else {
        unsigned int v[7];
        unsigned int i = 0;
        int borders = c ? client_borders(c) : 0;
        if (ev->value_mask & XCB_CONFIG_WINDOW_X)
            v[i++] = ev->x;
        if (ev->value_mask & XCB_CONFIG_WINDOW_Y) {
            int y = ev->y;
            if (c && c->type == ewmh->_NET_WM_WINDOW_TYPE_NORMAL) {
#ifndef EWMH_TASKBAR
                if (M_SHOWPANEL && TOP_PANEL && y < PANEL_HEIGHT)
#else
                if (y < M_WY)
#endif /* EWMH_TASKBAR */
                     y = PANEL_HEIGHT;
            }
            v[i++] = y;
        }
        if (ev->value_mask & XCB_CONFIG_WINDOW_WIDTH)
            v[i++] = (ev->width < M_WW - borders) ? ev->width : M_WW + borders;
        if (ev->value_mask & XCB_CONFIG_WINDOW_HEIGHT)
            v[i++] = (ev->height < M_WH - borders) ? ev->height : M_WH + borders;
        if (ev->value_mask & XCB_CONFIG_WINDOW_BORDER_WIDTH)
            v[i++] = ev->border_width;
        if (ev->value_mask & XCB_CONFIG_WINDOW_SIBLING)
            v[i++] = ev->sibling;
        if (ev->value_mask & XCB_CONFIG_WINDOW_STACK_MODE)
            v[i++] = ev->stack_mode;
        xcb_configure_window(dis, ev->window, ev->value_mask, v);
    }
    tile();
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r14
movl 0x8(%rdi), %ebx
movl %ebx, %edi
callq 0x6c8f
testq %rax, %rax
je 0x58c1
cmpb $0x1, 0x1c(%rax)
jne 0x58c5
movq %rax, %rdi
movl $0x1, %esi
callq 0x6972
jmp 0x5988
xorl %edx, %edx
jmp 0x58cf
movl 0x40(%rax), %eax
xorl %edx, %edx
testl %eax, %eax
cmovgl %eax, %edx
movzwl 0x1a(%r14), %eax
xorl %ecx, %ecx
testb $0x1, %al
je 0x58e7
movswl 0x10(%r14), %ecx
movl %ecx, (%rsp)
movl $0x1, %ecx
testb $0x2, %al
je 0x58f7
movswl 0x12(%r14), %esi
movl %ecx, %edi
incl %ecx
movl %esi, (%rsp,%rdi,4)
testb $0x4, %al
je 0x591f
movzwl 0x14(%r14), %esi
movq 0x5e81(%rip), %rdi      # 0xb788
movl 0x34(%rdi), %edi
movl %edi, %r8d
subl %edx, %r8d
addl %edx, %edi
cmpl %esi, %r8d
cmovgl %esi, %edi
movl %ecx, %esi
incl %ecx
movl %edi, (%rsp,%rsi,4)
testb $0x8, %al
je 0x5947
movzwl 0x16(%r14), %esi
movq 0x5e59(%rip), %rdi      # 0xb788
movl 0x38(%rdi), %edi
movl %edi, %r8d
subl %edx, %r8d
addl %edx, %edi
cmpl %esi, %r8d
cmovgl %esi, %edi
movl %ecx, %edx
incl %ecx
movl %edi, (%rsp,%rdx,4)
testb $0x10, %al
je 0x5957
movzwl 0x18(%r14), %edx
movl %ecx, %esi
incl %ecx
movl %edx, (%rsp,%rsi,4)
testb $0x20, %al
je 0x5966
movl 0xc(%r14), %edx
movl %ecx, %esi
incl %ecx
movl %edx, (%rsp,%rsi,4)
testb $0x40, %al
je 0x5974
movzbl 0x1(%r14), %edx
movl %ecx, %ecx
movl %edx, (%rsp,%rcx,4)
movq 0x5dd5(%rip), %rdi      # 0xb750
movzwl %ax, %edx
movq %rsp, %rcx
movl %ebx, %esi
callq 0x32c0
callq 0x5013
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: destroynotify
void destroynotify(xcb_generic_event_t *e)
{
    xcb_destroy_notify_event_t *ev = (xcb_destroy_notify_event_t *)e;
    client *c = wintoclient(ev->window);

    DEBUG("xcb: destroy notify");

    if (c) {
        if (c->isfullscreen)
            destroy_display(c);
        removeclient(c);
    }
   else {
        alien *a;

        if((a = wintoalien(&aliens, ev->window))) {
            DEBUG("unlink selfmapped window");
            rem_node(&a->link);
            free(a);
        }
    }
    desktopinfo();
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl 0x8(%rdi), %ebp
movl %ebp, %edi
callq 0x6c8f
testq %rax, %rax
je 0x59c2
movq %rax, %rbx
cmpb $0x1, 0x1b(%rax)
jne 0x59b8
movq %rbx, %rdi
callq 0x3cab
movq %rbx, %rdi
callq 0x6c09
jmp 0x59f4
testl %ebp, %ebp
je 0x59dd
movq 0x5dc3(%rip), %rbx      # 0xb790
testq %rbx, %rbx
je 0x59df
cmpl %ebp, 0x18(%rbx)
je 0x59df
movq 0x8(%rbx), %rbx
jmp 0x59cd
xorl %ebx, %ebx
testq %rbx, %rbx
je 0x59f4
movq %rbx, %rdi
callq 0x4f4a
movq %rbx, %rdi
callq 0x3050
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x4e44
// File: /workspace/github_c_makefile_star2_O1/kaugm[P]mmwm/mmwm.c
// Function: keypress
void keypress(xcb_generic_event_t *e)
{
    xcb_key_press_event_t *ev       = (xcb_key_press_event_t *)e;
    xcb_keysym_t           keysym   = xcb_get_keysym(ev->detail);

    DEBUGP("xcb: keypress: code: %d mod: %d\n", ev->detail, ev->state);
    for (unsigned int i = 0; i < LENGTH(keys); i++)
        if (keysym == keys[i].keysym &&
            CLEANMASK(keys[i].mod) == CLEANMASK(ev->state) &&
            keys[i].func)
                keys[i].func(&keys[i].arg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movzbl 0x1(%rdi), %esi
movq 0x5d43(%rip), %rdi      # 0xb758
xorl %edx, %edx
callq 0x33f0
movl %eax, %ebp
leaq 0x595b(%rip), %r14      # 0xb380
movl $0x21, %r15d
cmpl -0xc(%r14), %ebp
jne 0x5a59
movl 0x5d29(%rip), %eax      # 0xb760
notl %eax
movzwl 0x1c(%rbx), %ecx
xorl -0x10(%r14), %ecx
andl %eax, %ecx
testl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
jne 0x5a59
movq -0x8(%r14), %rax
testq %rax, %rax
je 0x5a59
movq %r14, %rdi
callq *%rax
addq $0x18, %r14
decq %r15
jne 0x5a2b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq