LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/texas.c
// Function: putword
void
putword(word w)
{
	static char left[64];

	if(pass2){
		/* listing */
		sprintf(left, "%06o  %06o\t", dot->val, w);
		list(left);

		fprintf(outfp, "%o: %o\n", dot->val++, w);
	}else{
		// this is probably useless...
		memory[dot->val++] = w;
	}
	dot->val &= W;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movl %edi, %ebx
cmpl $0x0, 0x1aff2(%rip)     # 0x1cba4
movq 0x1b00f(%rip), %rax     # 0x1cbc8
movl 0x10(%rax), %edx
je 0x1c10
leaq 0x1b00b(%rip), %r14     # 0x1cbd0
leaq 0x1547(%rip), %rsi      # 0x3113
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x1140
movq %r14, %rdi
callq 0x156f
movq 0x1b029(%rip), %rdi     # 0x1cc10
movq 0x1afda(%rip), %rax     # 0x1cbc8
movl 0x10(%rax), %edx
leal 0x1(%rdx), %ecx
movl %ecx, 0x10(%rax)
leaq 0x1521(%rip), %rsi      # 0x311f
movl %ebx, %ecx
xorl %eax, %eax
callq 0x10d0
movq 0x1afba(%rip), %rax     # 0x1cbc8
jmp 0x1c20
leal 0x1(%rdx), %ecx
movl %ecx, 0x10(%rax)
leaq 0x1b003(%rip), %rcx     # 0x1cc20
movl %ebx, (%rcx,%rdx,4)
andl $0x3ffff, 0x10(%rax)    # imm = 0x3FFFF
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/texas.c
// Function: writelits
void
writelits(void)
{
	word a;
	static char left[64];

	fprintf(lstfp, "\n    LITERALS\n");
	for(a = litdot; a < litend; a++){
		/* listing */
		sprintf(left, "%06o  %06o\t", a, memory[a]);
		list(left);

		fprintf(outfp, "%o: %o\n", a, memory[a]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x384f(%rip), %rcx      # 0x5490
leaq 0x14df(%rip), %rdi      # 0x3127
movl $0xe, %esi
movl $0x1, %edx
callq 0x1160
movl 0x5b003(%rip), %ebx     # 0x5cc60
cmpl 0x5b001(%rip), %ebx     # 0x5cc64
jae 0x1cc9
leaq 0x1afb4(%rip), %rax     # 0x1cc20
leaq (%rax,%rbx,4), %r13
leaq 0x5afa9(%rip), %r14     # 0x5cc20
leaq 0x1495(%rip), %r15      # 0x3113
leaq 0x149a(%rip), %r12      # 0x311f
movl (%r13), %ecx
movq %r14, %rdi
movq %r15, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x1140
movq %r14, %rdi
callq 0x156f
movq 0x1af69(%rip), %rdi     # 0x1cc10
movl (%r13), %ecx
movq %r12, %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x10d0
incq %rbx
movl 0x5afa4(%rip), %eax     # 0x5cc64
addq $0x4, %r13
cmpq %rax, %rbx
jb 0x1c85
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/texas.c
// Function: putlit
word
putlit(word w)
{
	word a;

	maxlits++;
	for(a = litdot; a < MAXMEM; a++)
		if(memory[a] == w)
			return a;
	if(litdot == 0)
		err(1, "error: too many literals");
	a = --litdot;
	memory[a] = w;
	return a;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
incl 0x5af83(%rip)           # 0x5cc68
movl %edi, %ebx
movl 0x5af73(%rip), %eax     # 0x5cc60
leaq 0x1af2c(%rip), %r14     # 0x1cc20
cmpq $0xffff, %rax           # imm = 0xFFFF
ja 0x1d1a
leaq (%r14,%rax,4), %rdx
movq %rax, %rcx
cmpl %ebx, (%rdx)
je 0x1d28
incq %rcx
addq $0x4, %rdx
cmpl $0x10000, %ecx          # imm = 0x10000
jne 0x1d03
testl %eax, %eax
je 0x1d2f
decl %eax
movl %eax, 0x5af3e(%rip)     # 0x5cc60
movl %ebx, (%r14,%rax,4)
jmp 0x1d2a
movl %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x1400(%rip), %rsi      # 0x3136
movl $0x1, %edi
xorl %eax, %eax
callq 0x11a0
movl 0x5af18(%rip), %eax     # 0x5cc60
jmp 0x1d1a
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/texas.c
// Function: combine
word
combine(int op, word w1, word w2)
{
	switch(op){
	case 0:
		return w2;
	case '+':
		w1 += w2;
		if(w1 & 01000000)
			w1 += 1;
		return w1 & W;
	case '-':
		w1 += ~w2 & W;
		if(w1 & 01000000)
			w1 += 1;
		return w1 & W;
	case ' ':
	case '!':
		return (w1 | w2) & W;
	case '&':
		return (w1 & w2) & W;
	default:
		panic("unknown operator %c", op);
	}
	return 0;
}

// Assembly:
movl %edi, %eax
cmpl $0x25, %edi
jg 0x1d5d
leal -0x20(%rax), %ecx
cmpl $0x2, %ecx
jae 0x1d77
orl %esi, %edx
jmp 0x1da7
cmpl $0x26, %eax
je 0x1da5
cmpl $0x2d, %eax
je 0x1d8f
cmpl $0x2b, %eax
jne 0x1d7b
leal (%rdx,%rsi), %eax
btl $0x12, %eax
adcl %esi, %edx
jmp 0x1da7
testl %eax, %eax
je 0x1dad
pushq %rbp
movq %rsp, %rbp
leaq 0x13c9(%rip), %rdi      # 0x314f
movl %eax, %esi
xorl %eax, %eax
callq 0x148c
notl %edx
movl $0x3ffff, %eax          # imm = 0x3FFFF
andl %eax, %edx
leal (%rdx,%rsi), %ecx
btl $0x12, %ecx
adcl %esi, %edx
andl %eax, %edx
jmp 0x1dad
andl %esi, %edx
andl $0x3ffff, %edx          # imm = 0x3FFFF
movl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/aap[P]rx-0/misc/texas.c
// Function: main
int
main(int argc, char *argv[])
{
	int i;

	infp = stdin;
	filename = "<stdin>";
	tmpfp = mustopen("tmptmp", "wb");

	initsymtab();

	litdot = MAXMEM;
	dot->val = 040;
	pass2 = 0;
	assemble();

	checkundef();

	pass2 = 1;
	fclose(tmpfp);
	tmpfp = nil;
	infp = mustopen("tmptmp", "rb");
	outfp = mustopen("out.mem", "wb");

	lstfp = mustopen("out.lst", "w");
	litend = dot->val + maxlits;	// dot->val + (MAXMEM-litdot);
	litdot = litend;
	dot->val = 040;
	lineno = 1;
	peekc = 0;
	memset(memory, 0, sizeof(memory));
	assemble();

	writelits();

	fclose(infp);
	fclose(outfp);

	listsyms();

	printf("start: %o\n", startaddr);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x2e0a(%rip), %rax      # 0x4fd8
movq (%rax), %rax
movq %rax, 0x1a9d0(%rip)     # 0x1cba8
leaq 0x112b(%rip), %rax      # 0x330a
movq %rax, 0x324a(%rip)      # 0x5430
leaq 0x1125(%rip), %r14      # 0x3312
leaq 0x1125(%rip), %rbx      # 0x3319
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1526
movq %rax, 0x1a9aa(%rip)     # 0x1cbb0
callq 0x2139
movl $0x10000, 0x5aa4b(%rip) # imm = 0x10000
movq 0x1a9ac(%rip), %rax     # 0x1cbc8
movl $0x20, %r15d
movl %r15d, 0x10(%rax)
xorl %r12d, %r12d
movl %r12d, 0x1a974(%rip)    # 0x1cba4
callq 0x2081
callq 0x20c2
movl $0x1, %r13d
movl %r13d, 0x1a95d(%rip)    # 0x1cba4
movq 0x1a962(%rip), %rdi     # 0x1cbb0
callq 0x1060
movq $0x0, 0x1a952(%rip) # 0x1cbb0
leaq 0x10b7(%rip), %rsi      # 0x331c
movq %r14, %rdi
callq 0x1526
movq %rax, 0x1a934(%rip)     # 0x1cba8
leaq 0x10a4(%rip), %rdi      # 0x331f
movq %rbx, %rsi
callq 0x1526
movq %rax, 0x1a986(%rip)     # 0x1cc10
leaq 0x1096(%rip), %rdi      # 0x3327
leaq 0x1097(%rip), %rsi      # 0x332f
callq 0x1526
movq %rax, 0x31ec(%rip)      # 0x5490
movq 0x1a91d(%rip), %rax     # 0x1cbc8
movl 0x5a9b7(%rip), %ecx     # 0x5cc68
addl 0x10(%rax), %ecx
movl %ecx, 0x5a9aa(%rip)     # 0x5cc64
movl %ecx, 0x5a9a0(%rip)     # 0x5cc60
movl %r15d, 0x10(%rax)
movl %r13d, 0x2e19(%rip)     # 0x50e4
movl %r12d, 0x1a8ce(%rip)    # 0x1cba0
leaq 0x1a947(%rip), %rdi     # 0x1cc20
movl $0x40000, %edx          # imm = 0x40000
xorl %esi, %esi
callq 0x1080
callq 0x2081
callq 0x1c2c
movq 0x1a8b2(%rip), %rdi     # 0x1cba8
callq 0x1060
movq 0x1a90e(%rip), %rdi     # 0x1cc10
callq 0x1060
callq 0x15cf
movl 0x5a95a(%rip), %esi     # 0x5cc6c
leaq 0x1018(%rip), %rdi      # 0x3331
xorl %eax, %eax
callq 0x1070
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_O3/albinoloverats[P]hide/src/bmp.c
// Function: init
extern image_type_t *init(void)
{
	static image_type_t bmp;
	bmp.type = "BMP";
	bmp.is_type = is_bmp;
	bmp.read = read_bmp;
	bmp.write = write_bmp;
	bmp.info = info_bmp;
	bmp.free = free_bmp;
	return &bmp;
}

// Assembly:
leaq 0xe7d(%rip), %rax       # 0x2000
movq %rax, 0x2ede(%rip)      # 0x4068
leaq 0x2ed7(%rip), %rax      # 0x4068
leaq 0x40(%rip), %rcx        # 0x11d8
movq %rcx, 0x2ed1(%rip)      # 0x4070
leaq 0x81(%rip), %rcx        # 0x1227
movq %rcx, 0x2ecb(%rip)      # 0x4078
leaq 0x2bb(%rip), %rcx       # 0x146f
movq %rcx, 0x2ec5(%rip)      # 0x4080
leaq 0x3e1(%rip), %rcx       # 0x15a3
movq %rcx, 0x2ebf(%rip)      # 0x4088
leaq 0x3ed(%rip), %rcx       # 0x15bd
movq %rcx, 0x2eb9(%rip)      # 0x4090
retq
// File: /workspace/github_c_makefile_star2_O3/albinoloverats[P]hide/src/bmp.c
// Function: write_bmp
static int write_bmp(image_info_t image_info, void (*progress_update)(uint64_t, uint64_t))
{
	errno = EXIT_SUCCESS;

	FILE *bmp = fopen(image_info.file, "wb");
	if (!bmp)
		return errno;

	bmp_extra_t *extra = image_info.extra;
	fwrite(extra->data, extra->size, 1, bmp);

	uint32_t padding = image_info.width % 4;
	if (padding == 4)
		padding = 0;

	fseek(bmp, extra->size, SEEK_SET);
	for (uint64_t y = 0; y < image_info.height; y++)
	{
		fwrite(image_info.buffer[y], image_info.width, image_info.bpp, bmp);
		free(image_info.buffer[y]);
		uint32_t ignored = 0;
		if (padding)
			fwrite(&ignored, padding, 1, bmp);
		if (progress_update)
			progress_update(y, image_info.height);
	}
	free(image_info.buffer);

	free(extra->data);
	free(extra);

	fclose(bmp);

	return errno;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %r15
callq 0x1040
movq %rax, %rbx
movl $0x0, (%rax)
movq 0x60(%rsp), %rdi
leaq 0xb6d(%rip), %rsi       # 0x2007
callq 0x1070
testq %rax, %rax
je 0x1592
movq %rax, %r14
movq %rbx, 0x18(%rsp)
leaq 0x60(%rsp), %r12
movq 0x48(%r12), %rbx
movq 0x8(%rbx), %rdi
movl (%rbx), %esi
movl $0x1, %edx
movq %rax, %rcx
callq 0x10a0
movq 0x30(%r12), %rax
movq %rax, 0x8(%rsp)
movq %rbx, 0x10(%rsp)
movl (%rbx), %esi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1090
movq 0x28(%r12), %rbx
movq 0x40(%r12), %rbp
testq %rbx, %rbx
je 0x1567
movzwl 0x38(%r12), %eax
movq %rax, 0x20(%rsp)
movq 0x8(%rsp), %r13
andl $0x3, %r13d
xorl %r12d, %r12d
movq (%rbp,%r12,8), %rdi
movq 0x8(%rsp), %rsi
movq 0x20(%rsp), %rdx
movq %r14, %rcx
callq 0x10a0
movq (%rbp,%r12,8), %rdi
callq 0x1030
movl $0x0, 0x4(%rsp)
testq %r13, %r13
je 0x1551
movl $0x1, %edx
leaq 0x4(%rsp), %rdi
movq %r13, %rsi
movq %r14, %rcx
callq 0x10a0
testq %r15, %r15
je 0x155f
movq %r12, %rdi
movq %rbx, %rsi
callq *%r15
incq %r12
cmpq %r12, %rbx
jne 0x150e
movq %rbp, %rdi
callq 0x1030
movq 0x10(%rsp), %rbx
movq 0x8(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1060
movq 0x18(%rsp), %rbx
movl (%rbx), %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/albinoloverats[P]hide/src/bmp.c
// Function: free_bmp
static void free_bmp(image_info_t image_info)
{
	for (uint64_t y = 0; y < image_info.height; y++)
		free(image_info.buffer[y]);
	free(image_info.buffer);
	bmp_extra_t *extra = image_info.extra;
	free(extra->data);
	free(extra);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 0x30(%rsp), %r14
movq 0x28(%r14), %r15
movq 0x40(%r14), %rbx
testq %r15, %r15
je 0x15eb
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
callq 0x1030
incq %r12
cmpq %r12, %r15
jne 0x15da
movq %rbx, %rdi
callq 0x1030
movq 0x48(%r14), %rbx
movq 0x8(%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x1030
// File: /workspace/github_c_makefile_star2_O3/gadget114514[P]fatfs-example/rf2.c
// Function: main
void main()
{
  FIL f;
  int w;
  FATFS fs;
  char buf[1024];
  FCHK(f_mount(&fs, "", 1)); 
  if (f_open(&f, "0:a.txt", FA_OPEN_EXISTING|FA_READ) == FR_OK) {
    FCHK(f_read(&f, buf, 9, &w));
    printf("open & write %d %s\n", w, buf);
  } else {
    printf("open error\n");
    FCHK(f_close(&f));    
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x8b8, %rsp            # imm = 0x8B8
leaq 0x42d9(%rip), %rsi      # 0x548c
leaq -0x4c8(%rbp), %rdi
movl $0x1, %edx
callq 0x1430
movl %eax, %ebx
movl %eax, %edi
callq 0x12a9
leaq 0x3e30(%rip), %rdi      # 0x5004
leaq 0x3e3c(%rip), %rsi      # 0x5017
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
leaq 0x3e3d(%rip), %rsi      # 0x502b
leaq -0x270(%rbp), %rdi
movl $0x1, %edx
callq 0x1821
testl %eax, %eax
je 0x1240
leaq 0x41e7(%rip), %rdi      # 0x53f1
callq 0x1030
leaq -0x270(%rbp), %rdi
callq 0x2a52
movl %eax, %ebx
movl %eax, %edi
callq 0x12a9
leaq 0x3dd9(%rip), %rdi      # 0x5004
leaq 0x3e2c(%rip), %rsi      # 0x505e
movl %ebx, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
jmp 0x129b
leaq -0x270(%rbp), %rdi
leaq -0x8d0(%rbp), %rbx
leaq -0x1c(%rbp), %r14
movq %rbx, %rsi
movl $0x9, %edx
movq %r14, %rcx
callq 0x2152
movl %eax, %r15d
movl %eax, %edi
callq 0x12a9
leaq 0x3d91(%rip), %rdi      # 0x5004
leaq 0x3db9(%rip), %rsi      # 0x5033
movl %r15d, %edx
movq %rax, %rcx
xorl %eax, %eax
callq 0x1050
movl (%r14), %esi
leaq 0x3db9(%rip), %rdi      # 0x504a
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1050
addq $0x8b8, %rsp            # imm = 0x8B8
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3377
movq %rax, %rbx
movq %r14, (%rax)
movl $0x1, 0x8(%rax)
leaq 0x21(%rip), %rsi        # 0x3381
movl %ebp, %edi
movq %rax, %rdx
callq 0x6c20
testq %rax, %rax
jne 0x3379
movq %rbx, %rdi
callq 0x2040
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3bae
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 0x4400
movl (%r14), %r8d
movl $0xffffff, %ecx         # imm = 0xFFFFFF
andl 0x10(%r12), %ecx
imull %r8d, %ecx
movq %r15, (%rsp)
leaq 0x33(%rip), %r9         # 0x3bbf
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0xa3ca
testl %eax, %eax
je 0x3ba8
movq %r15, %rdi
callq 0x2040
jmp 0x3bae
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_O3/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 0x3bdb
movl (%r14), %edx
cmpq %rcx, %rdx
je 0x3bdd
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_O3/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 0x3c99
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 0x3caa
movq 0x18(%r14), %r13
movq 0x28(%r14), %rbp
shrq $0x18, %rdi
incq %rdi
callq 0x4400
movl (%r14), %ecx
imull 0x10(%r12), %ecx
movq 0x20(%r12), %r8
movq %r15, (%rsp)
leaq 0x52(%rip), %r9         # 0x3cc9
movq %r13, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x9f04
testl %eax, %eax
je 0x3c93
movq %r15, %rdi
callq 0x2040
jmp 0x3c99
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 0x9875(%rip), %rdi      # 0xd526
leaq 0x97ce(%rip), %rsi      # 0xd486
leaq 0x988e(%rip), %rcx      # 0xd54d
movl $0xe0, %edx
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/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 0x3d47
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x2040
movq %rbx, %rdi
popq %rbx
jmp 0x2040
leaq 0x987f(%rip), %rdi      # 0xd5cd
leaq 0x9731(%rip), %rsi      # 0xd486
leaq 0x9882(%rip), %rcx      # 0xd5de
movl $0x130, %edx            # imm = 0x130
callq 0x21a0
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x3dfd
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 0x3df5
movl $0x0, 0x20(%rbx)
leaq 0x9842(%rip), %rdx      # 0xd602
leaq 0x83(%rip), %rcx        # 0x3e4a
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %r8
callq 0xa6a0
testl %eax, %eax
jne 0x3dec
movq %rbx, %r14
addq $0x20, %r14
movq %r14, %rdi
callq 0x51fd
testl %eax, %eax
je 0x3e08
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 0x3dff
movl $0x0, 0x20(%rbx)
movq (%rbx), %rdi
movq 0x8(%rbx), %rsi
leaq 0x97de(%rip), %rdx      # 0xd602
leaq 0x81(%rip), %r8         # 0x3eac
movl $0x8, %ecx
movq %rbx, %r9
callq 0xa145
testl %eax, %eax
jne 0x3dec
movq %r14, %rdi
callq 0x51fd
testl %eax, %eax
jne 0x3dec
jmp 0x3dff
// File: /workspace/github_c_makefile_star2_O3/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 0x51fd
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_O3/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 0x4182
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x41a1
testl %esi, %esi
je 0x4161
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x416c
xorl %ebx, %ebx
decq %rax
movq %rax, 0x28(%rdi)
je 0x4170
movl %ebx, %eax
popq %rbx
retq
movl $0x1, 0x30(%rdi)
callq 0x3f0b
testl %eax, %eax
jne 0x415a
jmp 0x416c
leaq 0x9523(%rip), %rdi      # 0xd6ac
leaq 0x94f5(%rip), %rsi      # 0xd685
leaq 0x9522(%rip), %rcx      # 0xd6b9
movl $0x106, %edx            # imm = 0x106
callq 0x21a0
leaq 0x9530(%rip), %rdi      # 0xd6d8
leaq 0x94d6(%rip), %rsi      # 0xd685
leaq 0x9503(%rip), %rcx      # 0xd6b9
movl $0x107, %edx            # imm = 0x107
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/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 0x433f
testl %eax, %eax
jne 0x432e
movl 0x4(%rsp), %esi
cmpl $0xc8, %esi
jne 0x4239
movq %r14, (%r15)
movq 0x8(%rsp), %rax
movq %rax, (%r12)
incq %rbp
cmpq $0x40, %rbp
jne 0x41e9
jmp 0x4245
cmpl $0x194, %esi            # imm = 0x194
jne 0x4315
movq (%r15), %rbp
cmpq $0x2, %rbp
jb 0x42a6
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 0x433f
testl %eax, %eax
jne 0x432e
movl 0x4(%rsp), %esi
cmpl $0x194, %esi            # imm = 0x194
je 0x429d
cmpl $0xc8, %esi
jne 0x4315
addq %r14, (%r15)
movq 0x8(%rsp), %rax
movq %rax, (%r12)
cmpq $0x3, %rbp
movq %r14, %rbp
ja 0x4251
cmpq $0x0, (%r12)
je 0x42b1
xorl %ebx, %ebx
jmp 0x432e
leaq 0x4(%rsp), %r14
leaq 0x8(%rsp), %rbp
movq (%r15), %rdx
cmpq $0x2, %rdx
jb 0x42ad
decq %rdx
movq %rdx, (%r15)
movq %r13, %rdi
movq 0x10(%rsp), %rsi
movq %r14, %rcx
movq %rbp, %r8
callq 0x433f
testl %eax, %eax
jne 0x432e
movl 0x4(%rsp), %esi
cmpl $0xc8, %esi
jne 0x42fd
movq 0x8(%rsp), %rax
movq %rax, (%r12)
testq %rax, %rax
je 0x42bb
jmp 0x42ad
cmpl $0x194, %esi            # imm = 0x194
jne 0x4315
leaq 0x93dc(%rip), %rdi      # 0xd6e8
xorl %eax, %eax
callq 0x99df
jmp 0x4323
leaq 0x93ec(%rip), %rdi      # 0xd708
xorl %eax, %eax
callq 0x99df
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_O3/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 0x4400
leaq 0x7d(%rip), %rcx        # 0x43ef
movq %r12, %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %r13, %r8
callq 0xa6a0
testl %eax, %eax
je 0x43aa
callq 0x20a0
cmpl $0x0, (%rax)
je 0x43ce
movq %rax, %rbx
leaq 0x9386(%rip), %rdi      # 0xd721
xorl %eax, %eax
callq 0x98c0
movl $0x0, (%rbx)
jmp 0x43dc
movq %rsp, %rdi
callq 0x51fd
testq %r14, %r14
je 0x4387
testl %eax, %eax
jne 0x4387
movl 0x4(%rsp), %eax
movl %eax, (%r14)
movq 0x8(%rsp), %rax
movq %rax, (%rbx)
xorl %eax, %eax
jmp 0x43e1
leaq 0x934c(%rip), %rdi      # 0xd721
xorl %eax, %eax
callq 0x99df
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_O3/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 0x4d28
leaq 0x10200(%rip), %r15     # 0x14630
movl $0x2, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x8104
movb $0x5f, 0x101ed(%rip)    # 0x14634
leaq 0x101e7(%rip), %rsi     # 0x14635
movl $0x8, %edx
movq %rbx, %rdi
callq 0x8104
movb $0x0, 0x101e3(%rip)     # 0x14645
movq %r15, %rax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/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 0xde8(%rip), %rdi       # 0x2004
leaq 0xdef(%rip), %rsi       # 0x2012
callq 0x10d0
movq %rax, %rbx
leaq 0xde2(%rip), %rdi       # 0x2014
leaq 0xded(%rip), %rsi       # 0x2026
callq 0x10d0
movq %rax, %r14
movq %rbx, %rdi
callq 0x12b8
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x1421
leaq 0xdca(%rip), %rsi       # 0x2028
movq %r15, %rdi
callq 0x14fa
movq %r15, %rdi
callq 0x179a
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
callq 0x17f1
leaq 0xdad(%rip), %rdi       # 0x2030
movsd 0x8(%rsp), %xmm0
movl %eax, %esi
movb $0x1, %al
callq 0x1080
movq %r15, %rdi
callq 0x1863
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_O3/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 0x38d5
movq %rax, %r13
movl %r14d, -0x2c(%rbp)
movq %rax, %rdi
callq 0x3480
testl %eax, %eax
je 0x38cd
movq %r13, %rdi
callq 0x3100
testq %rax, %rax
je 0x38cd
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 0x38a2
xorl %ecx, %ecx
xorl %r11d, %r11d
movl (%r14,%rcx,4), %edx
cmpl %r12d, %edx
je 0x3898
movslq %r11d, %rsi
incl %r11d
movl %edx, (%r10,%rsi,4)
incq %rcx
cmpq %rcx, %rax
jne 0x3885
jmp 0x38a5
xorl %r11d, %r11d
movq %rbx, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl -0x2c(%rbp), %ecx
movl $0x4, %r8d
movl $0x20, %r9d
pushq %r10
pushq %r11
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_O3/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 0x6e59(%rip), %rdi      # 0xa750
callq 0x3150
movq %rax, 0x6e55(%rip)      # 0xa758
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x39de
movq 0x6e38(%rip), %rbx      # 0xa750
movq %rbx, %rdi
callq 0x3690
movq %rbx, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3630
testq %rax, %rax
je 0x39de
movq %rax, %rbx
movq %rax, %rdi
callq 0x30b0
testq %rax, %rax
je 0x39d1
movq %rax, %r14
movq 0x6e05(%rip), %rdi      # 0xa758
movl $0xff7f, %esi           # imm = 0xFF7F
callq 0x3370
testq %rax, %rax
je 0x39cd
movzbl 0x1(%rbx), %edx
xorl %ecx, %ecx
testq %rdx, %rdx
je 0x39bc
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 0x39b4
movb (%rax), %r11b
testb %r11b, %r11b
je 0x39b4
movl $0x1, %r10d
cmpb %r9b, %r11b
je 0x39ae
movl %r10d, %r11d
movb (%rax,%r11), %r11b
incl %r10d
testb %r11b, %r11b
jne 0x3998
jmp 0x39b4
movl %esi, 0x6dac(%rip)      # 0xa760
incq %r8
cmpq %rdx, %r8
jne 0x3981
incq %rcx
cmpq $0x8, %rcx
jne 0x3968
movq %rax, %rdi
callq 0x3050
xorl %ebp, %ebp
jmp 0x39d6
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_O3/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:
testq %rdi, %rdi
je 0x3dbf
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x3db2
movq 0x8(%r14), %r12
testq %r12, %r12
je 0x3db2
movq 0x18(%r14), %r15
movq %r15, %rdi
callq 0x4e73
testq %r15, %r15
je 0x3d32
leaq 0x18(%r12), %r13
cmpq $0x0, (%r13)
je 0x3d14
movq 0x20(%r12), %rax
movq %r15, 0x8(%rax)
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
jmp 0x3d18
movq %r15, (%r13)
movq %r15, 0x20(%r12)
movq %r13, 0x10(%r15)
movq 0x18(%r14), %r15
movq %r15, %rdi
callq 0x4e73
testq %r15, %r15
jne 0x3cf7
movq %r14, %rdi
callq 0x4e73
movl 0x6a68(%rip), %edi      # 0xa7a8
callq 0x4ee2
movq 0x6a44(%rip), %r13      # 0xa790
testq %r13, %r13
je 0x3d99
leaq 0x8(%rsp), %r15
movq 0x69f3(%rip), %rdi      # 0xa750
movl 0x18(%r13), %esi
movdqu 0x20(%r13), %xmm0
movd %xmm0, 0x8(%rsp)
pshufd $0x55, %xmm0, %xmm1     # xmm1 = xmm0[1,1,1,1]
movd %xmm1, 0xc(%rsp)
pshufd $0x4e, %xmm0, %xmm0     # xmm0 = xmm0[2,3,0,1]
movdqu %xmm0, 0x20(%r13)
movl $0x3, %edx
movq %r15, %rcx
callq 0x32c0
movq 0x8(%r13), %r13
testq %r13, %r13
jne 0x3d56
cmpq %r12, 0x69e0(%rip)      # 0xa780
jne 0x3daa
movq %rbx, %rdi
callq 0x3dc0
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_O3/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 0x5a29(%rip), %ebx      # 0xa7a8
movq $0x0, 0x10(%rsp)
movq 0x59f1(%rip), %rax      # 0xa780
movq 0x30(%rax), %rax
testq %rax, %rax
je 0x4dbc
movq 0x59c9(%rip), %rdi      # 0xa768
movl 0x20(%rax), %esi
callq 0x3470
movq 0x59ba(%rip), %rdi      # 0xa768
leaq 0x8(%rsp), %rdx
movl %eax, %esi
xorl %ecx, %ecx
callq 0x31c0
movq 0x520d(%rip), %r15      # 0x9fd0
leaq 0x24a4(%rip), %r14      # 0x726e
movl $0x1, %r12d
xorl %ebp, %ebp
movl %ebp, %edi
callq 0x4ee2
movq 0x59a0(%rip), %rax      # 0xa780
movq 0x18(%rax), %rdx
movl $0x0, %ecx
movl $0x0, %esi
testq %rdx, %rdx
je 0x4e16
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 0x4df7
andb $0x1, %sil
movzbl %sil, %esi
movq (%r15), %rdi
movl 0x5c(%rax), %r8d
xorl %r9d, %r9d
cmpl %ebx, 0x5982(%rip)      # 0xa7a8
sete %r9b
movl %esi, (%rsp)
movq %r14, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x3380
incl %ebp
cmpl $0xa, %ebp
jne 0x4dd2
cmpq $0x0, 0x10(%rsp)
je 0x4e52
leaq 0x8(%rsp), %rdi
callq 0x35c0
movq (%r15), %rdi
callq 0x3410
cmpl $0x9, %ebx
je 0x4e66
movl %ebx, %edi
callq 0x4ee2
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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:
movq %rdi, %rax
testq %rdi, %rdi
je 0x4ee1
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x4ed3
movq (%rcx), %rdx
cmpq %rax, %rdx
je 0x4ea5
movq 0x8(%rcx), %rdx
cmpq %rax, %rdx
je 0x4eba
movq (%rax), %rcx
movq 0x8(%rax), %rdx
movq %rdx, 0x8(%rcx)
movq %rcx, (%rdx)
jmp 0x4ed3
movq 0x8(%rdx), %rdx
movq %rdx, (%rcx)
testq %rdx, %rdx
je 0x4ecb
movq $0x0, (%rdx)
jmp 0x4ed3
movq (%rdx), %rdx
movq %rdx, 0x8(%rcx)
movq $0x0, 0x8(%rdx)
jmp 0x4ed3
movq $0x0, 0x8(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4f2f
movq 0x58ca(%rip), %rax      # 0xa7b8
testq %rax, %rax
je 0x4f04
movq %rax, %rcx
cmpl %edi, 0x30(%rcx)
je 0x4f09
movq 0x8(%rcx), %rcx
testq %rcx, %rcx
jne 0x4ef6
movl 0x30(%rax), %edi
jmp 0x4f0c
movq %rcx, %rax
movq %rax, 0x589d(%rip)      # 0xa7b0
movl %edi, 0x588f(%rip)      # 0xa7a8
movq 0x18(%rax), %rax
movq %rax, 0x5864(%rip)      # 0xa788
movq 0x18(%rax), %rax
movq %rax, 0x5851(%rip)      # 0xa780
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movl %edi, %ebx
movq 0x57e5(%rip), %r14      # 0xa750
movl 0x586f(%rip), %edx      # 0xa7e0
movq %r14, %rdi
movl %ebx, %esi
callq 0x30c0
movq %rsp, %rdx
movq %r14, %rdi
movl %eax, %esi
xorl %ecx, %ecx
callq 0x3110
testb %al, %al
je 0x4fb2
movl (%rsp), %eax
testq %rax, %rax
je 0x4faa
movq 0x8(%rsp), %rcx
xorl %edx, %edx
cmpl %ebp, (%rcx,%rdx,4)
je 0x4fbd
incq %rdx
cmpq %rdx, %rax
jne 0x4f9d
movq %rsp, %rdi
callq 0x30a0
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movq %rsp, %r14
movq %r14, %rdi
callq 0x30a0
xorl %eax, %eax
movl %eax, 0x1c(%r14)
movq $0x0, 0x14(%r14)
movl $0x2021, (%r14)         # imm = 0x2021
movl %ebx, 0x4(%r14)
movl 0x57f9(%rip), %ecx      # 0xa7e0
movl %ecx, 0x8(%r14)
movl %ebp, 0xc(%r14)
movl %eax, 0x10(%r14)
movq 0x5756(%rip), %rdi      # 0xa750
movq %rsp, %r8
xorl %esi, %esi
movl %ebx, %edx
xorl %ecx, %ecx
callq 0x3540
movb $0x1, %al
jmp 0x4fb4
// File: /workspace/github_c_makefile_star2_O3/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 0x52f1(%rip), %rax      # 0xa770
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 0x5247(%rip), %r15      # 0xa750
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 0x5565
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 0x1c37(%rip), %rsi      # 0x71a3
movl $0x1, %edi
movq %r14, %rdx
xorl %eax, %eax
callq 0x31b0
// File: /workspace/github_c_makefile_star2_O3/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 0x6aca
movq %rax, %r14
movq 0x51e7(%rip), %rax      # 0xa780
cmpq %r14, 0x30(%rax)
je 0x55ad
cmpb $0x1, 0x1(%rbx)
jne 0x55ad
movq %r14, %rdi
callq 0x3dc0
leaq 0x50fc(%rip), %r15      # 0xa6b0
movl $0x5, %r12d
cmpq $0x0, -0x8(%r15)
je 0x5616
movzbl 0x1(%rbx), %eax
cmpl %eax, -0xc(%r15)
jne 0x5616
movl 0x518f(%rip), %eax      # 0xa760
notl %eax
movzwl 0x1c(%rbx), %ecx
xorl -0x10(%r15), %ecx
andl %eax, %ecx
testl $0xfffffffd, %ecx       # imm = 0xFFFFFFFD
jne 0x5616
movq 0x5194(%rip), %rax      # 0xa780
cmpq %r14, 0x30(%rax)
je 0x55fa
movq %r14, %rdi
callq 0x3dc0
cmpb $0x1, 0x8(%r15)
jne 0x560f
movl 0xc(%rbx), %eax
cmpl 0x8(%rbx), %eax
jne 0x5616
cmpl $0x0, 0x10(%rbx)
jne 0x5616
movq %r15, %rdi
callq *-0x8(%r15)
addq $0x20, %r15
decq %r12
jne 0x55ba
movq 0x512a(%rip), %rdi      # 0xa750
movl 0x4(%rbx), %edx
movl $0x2, %esi
callq 0x3160
movq 0x5116(%rip), %rdi      # 0xa750
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x3190