LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/weapons.c
// Function: do_motion
void do_motion(struct object *obj,int ydelta,int xdelta)
{
	int ch, y, x;

	obj->o_pos = hero;
	while (1) {
		y = obj->o_pos.y;
		x = obj->o_pos.x;
		if (!ce(obj->o_pos, hero) && cansee(unc(obj->o_pos)) &&
		  mvwinch(cw, y, x) != ' ')
			mvwaddch(cw, y, x, show(y, x));
		/*
		 * Get the new position
		 */
		obj->o_pos.y += ydelta;
		obj->o_pos.x += xdelta;
		y = obj->o_pos.y;
		x = obj->o_pos.x;
		ch = winat(y, x);
		if (step_ok(ch) && ch != DOOR) {
			if (cansee(unc(obj->o_pos)) && mvwinch(cw, y, x) != ' ') {
				mvwaddch(cw, y, x, obj->o_type);
				draw(cw);
			}
			continue;
		}
		break;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, 0x4(%rsp)
movl %esi, %ebp
movq %rdi, %r14
leaq 0x113a5(%rip), %rax     # 0x2dc60
movq 0x50(%rax), %r15
movq %r15, (%rdi)
movq %r15, %r12
shrq $0x20, %r12
leaq 0x14110(%rip), %rbx     # 0x309e0
leaq 0x11389(%rip), %rax     # 0x2dc60
cmpl 0x50(%rax), %r15d
jne 0x1c8ea
leaq 0x1137c(%rip), %rax     # 0x2dc60
cmpl 0x54(%rax), %r12d
je 0x1c945
movl %r12d, %edi
movl %r15d, %esi
callq 0x6f96
testb %al, %al
je 0x1c945
movq (%rbx), %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0x1c919
movq (%rbx), %rdi
callq 0x6330
cmpl $0x20, %eax
je 0x1c945
movq (%rbx), %rdi
movl %r12d, %esi
movl %r15d, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0x1c945
movq (%rbx), %r13
movl %r12d, %edi
movl %r15d, %esi
callq 0xe2de
movsbl %al, %esi
movq %r13, %rdi
callq 0x64c0
movl 0x4(%r14), %r15d
addl %ebp, %r15d
movl %r15d, 0x4(%r14)
movl (%r14), %r12d
addl 0x4(%rsp), %r12d
movl %r12d, (%r14)
movl %r15d, %edi
movl %r12d, %esi
callq 0x9492
movl %eax, %r13d
movsbq %al, %rdi
callq 0xb8d5
testb %al, %al
je 0x1c9df
cmpb $0x2b, %r13b
je 0x1c9df
movl (%r14), %esi
movl 0x4(%r14), %edi
callq 0x6f96
testb %al, %al
je 0x1c9d3
movq (%rbx), %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0x1c9ac
movq (%rbx), %rdi
callq 0x6330
cmpl $0x20, %eax
je 0x1c9d3
movq (%rbx), %rdi
movl %r15d, %esi
movl %r12d, %edx
callq 0x6490
cmpl $-0x1, %eax
je 0x1c9cb
movq (%rbx), %rdi
movl 0x20(%r14), %esi
callq 0x64c0
movq (%rbx), %rdi
callq 0x6200
movl (%r14), %r15d
movl 0x4(%r14), %r12d
jmp 0x1c8d0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/weapons.c
// Function: fall
int fall(struct linked_list *item,bool pr)
{
	struct object *obj;
	struct room *rp;
	static struct coord fpos;

	obj = OBJPTR(item);
	if (fallpos(&obj->o_pos, &fpos, TRUE)) {
		mvaddch(fpos.y, fpos.x, obj->o_type);
		obj->o_pos = fpos;
		rp = player.t_room;
		if (rp != NULL && !rf_on(rp,ISDARK)) {
			light(&hero);
			mvwaddch(cw, hero.y, hero.x, PLAYER);
		}
		attach(lvl_obj, item);
		return 0;
	}

	if (pr) {
        if (obj->o_type == WEAPON) { /* BUGFIX: Identification trick */
            msg("Your %s vanishes as it hits the ground.", w_magic[obj->o_which].mi_name);
        } else {
            msg("%s vanishes as it hits the ground.", inv_name(obj,TRUE));
        }
  }

	discard(item);
  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x10(%rdi), %r14
leaq 0x16ad1(%rip), %rsi     # 0x334e0
movq %r14, %rdi
movl $0x1, %edx
callq 0x1cb16
testb %al, %al
je 0x1cabb
movq 0xd505(%rip), %r15      # 0x29f30
movq (%r15), %rdi
movl 0x16ab0(%rip), %esi     # 0x334e4
movl 0x16aa6(%rip), %edx     # 0x334e0
callq 0x6490
cmpl $-0x1, %eax
je 0x1ca50
movq (%r15), %rdi
movl 0x20(%r14), %esi
callq 0x64c0
movq 0x16a89(%rip), %rax     # 0x334e0
movq %rax, (%r14)
leaq 0x111ff(%rip), %r14     # 0x2dc60
movq 0x70(%r14), %rdi
testq %rdi, %rdi
je 0x1caaa
movl $0x1, %esi
callq 0x13d18
testl %eax, %eax
jne 0x1caaa
leaq 0x50(%r14), %rdi
callq 0xeba8
leaq 0x13f58(%rip), %r15     # 0x309e0
movq (%r15), %rdi
movl 0x50(%r14), %edx
movl 0x54(%r14), %esi
callq 0x6490
cmpl $-0x1, %eax
je 0x1caaa
movq (%r15), %rdi
movl $0x40, %esi
callq 0x64c0
leaq 0x10d97(%rip), %rdi     # 0x2d848
movq %rbx, %rsi
callq 0xbd73
jmp 0x1cb09
testb %bpl, %bpl
je 0x1cb01
cmpl $0x29, 0x20(%r14)
jne 0x1cae3
movslq 0x28(%r14), %rax
shlq $0x4, %rax
leaq 0xf4ba(%rip), %rcx      # 0x2bf90
movq (%rcx,%rax), %rsi
leaq 0x6e44(%rip), %rdi      # 0x23925
jmp 0x1cafa
movq %r14, %rdi
movl $0x1, %esi
callq 0x1aa04
leaq 0x6e33(%rip), %rdi      # 0x2392a
movq %rax, %rsi
xorl %eax, %eax
callq 0xb620
movq %rbx, %rdi
callq 0xbdda
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/weapons.c
// Function: fallpos
bool fallpos(struct coord *pos,struct coord *newpos,bool passages)
{
	int y, x, ch;

	for (y = pos->y - 1; y <= pos->y + 1; y++) {
		for (x = pos->x - 1; x <= pos->x + 1; x++) {
			/*
			 * check to make certain the spot is empty, if it is,
			 * put the object there, set it in the level list
			 * and re-draw the room if he can see it
			 */
			if (y == hero.y && x == hero.x)
				continue;
			ch = winat(y, x);
			if (ch == FLOOR || (passages && ch == PASSAGE)) {
				newpos->y = y;
				newpos->x = x;
				return TRUE;
			}
		}
	}
	return FALSE;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %eax
movl 0x4(%rdi), %r15d
decl %r15d
leaq 0x11127(%rip), %r13     # 0x2dc60
leal -0x1(%rax), %r12d
movl 0x50(%r13), %ecx
movl 0x54(%r13), %edx
cmpl %edx, %r15d
jne 0x1cb52
movl %r15d, %edx
cmpl %ecx, %r12d
je 0x1cb76
movl %r15d, %edi
movl %r12d, %esi
callq 0x9492
cmpb $0x23, %al
sete %cl
cmpb $0x2e, %al
je 0x1cb94
andb %bpl, %cl
jne 0x1cb94
movl 0x50(%r13), %ecx
movl 0x54(%r13), %edx
movl (%r14), %eax
leal 0x1(%r12), %esi
cmpl %eax, %r12d
movl %esi, %r12d
jle 0x1cb45
leal 0x1(%r15), %ecx
cmpl 0x4(%r14), %r15d
movl %ecx, %r15d
jle 0x1cb39
xorl %eax, %eax
jmp 0x1cb9d
movl %r15d, 0x4(%rbx)
movl %r12d, (%rbx)
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/weapons.c
// Function: init_weapon
void init_weapon(struct object *weap,int type)
{
	struct init_weps *iwp;

	weap->o_type = WEAPON;
	weap->o_which = type;
	iwp = &weaps[type];
	strcpy(weap->o_damage,iwp->w_dam);
	strcpy(weap->o_hurldmg,iwp->w_hrl);
	weap->o_launch = iwp->w_launch;
	weap->o_flags = iwp->w_flags;
	weap->o_weight = iwp->w_wght;
	weap->o_typname = things[TYP_WEAPON].mi_name;
	if (o_on(weap,ISMANY))
		weap->o_count = rnd(8) + 8;
	else
		weap->o_count = 1;
	weap->o_group = newgrp();
	weap->o_vol = itemvol(weap);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0x29, 0x20(%rdi)
movl %esi, 0x28(%rdi)
movslq %esi, %r14
shlq $0x5, %r14
leaq 0xf4f4(%rip), %r15      # 0x2c0c0
addq $0x8, %rdi
movq (%r15,%r14), %rsi
callq 0x60e0
leaq 0x10(%rbx), %rdi
movq 0x8(%r15,%r14), %rsi
callq 0x60e0
movb 0x1c(%r15,%r14), %al
movb %al, 0x48(%rbx)
movl 0x10(%r15,%r14), %eax
movl %eax, 0x38(%rbx)
movl 0x14(%r15,%r14), %eax
movl %eax, 0x40(%rbx)
leaq 0xf1ca(%rip), %rax      # 0x2bdd0
movq 0x30(%rax), %rax
movq %rax, 0x18(%rbx)
movl $0x4000, %esi           # imm = 0x4000
movq %rbx, %rdi
callq 0x9531
movl %eax, %ecx
movl $0x1, %eax
testb %cl, %cl
je 0x1cc35
movl $0x8, %edi
xorl %eax, %eax
callq 0xc674
addl $0x8, %eax
movl %eax, 0x24(%rbx)
leaq 0xd6c5(%rip), %rax      # 0x2a304
movl (%rax), %ecx
incl %ecx
movl %ecx, (%rax)
movl %ecx, 0x3c(%rbx)
movq %rbx, %rdi
callq 0x978c
movl %eax, 0x44(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/weapons.c
// Function: num
char *num(int n1,int n2)
{
	static char numbuf[LINLEN];

	if (n1 == 0 && n2 == 0)
		return "+0";
	if (n2 == 0)
		sprintf(numbuf, "%s%d", n1 < 0 ? "" : "+", n1);
	else
		sprintf(numbuf,"%s%d,%s%d",n1<0 ? "":"+",n1,n2<0 ? "":"+",n2);  
	return numbuf;
}

// Assembly:
pushq %rbx
movl %esi, %eax
orl %edi, %eax
je 0x1cc9e
movl %esi, %r9d
movl %edi, %ecx
testl %edi, %edi
leaq 0x6d1b(%rip), %rax      # 0x23989
leaq 0x6cdb(%rip), %r8       # 0x23950
movq %r8, %rdx
cmovsq %rax, %rdx
testl %esi, %esi
je 0x1cca7
cmovsq %rax, %r8
leaq 0x16865(%rip), %rbx     # 0x334f0
leaq 0x6cc0(%rip), %rsi      # 0x23952
movq %rbx, %rdi
xorl %eax, %eax
callq 0x64f0
jmp 0x1ccbf
leaq 0x6ca8(%rip), %rbx      # 0x2394d
jmp 0x1ccbf
leaq 0x16842(%rip), %rbx     # 0x334f0
leaq 0x6ca2(%rip), %rsi      # 0x23957
movq %rbx, %rdi
xorl %eax, %eax
callq 0x64f0
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/weapons.c
// Function: wield
int wield()
{
	struct linked_list *item;
	struct object *obj, *oweapon;

	oweapon = cur_weapon;
	if (!dropcheck(cur_weapon)) {
		cur_weapon = oweapon;
		return 0;
	}
	cur_weapon = oweapon;
	if ((item = get_item("wield", WEAPON)) == NULL)
		return 0;
	obj = OBJPTR(item);
	if (is_current(obj)) {
		after = FALSE;
		return 0;
	}
	msg("Wielding %s", inv_name(obj, TRUE));
	cur_weapon = obj;
  return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x10b81(%rip), %r14     # 0x2d850
movq (%r14), %rbx
movq %rbx, %rdi
callq 0x1b54e
movq %rbx, (%r14)
testb %al, %al
je 0x1cd34
leaq 0x6c74(%rip), %rdi      # 0x2395c
movl $0x29, %esi
callq 0x10749
testq %rax, %rax
je 0x1cd34
movq 0x10(%rax), %rbx
movq %rbx, %rdi
callq 0xd2fe
testb %al, %al
je 0x1cd13
leaq 0xd5ff(%rip), %rax      # 0x2a30d
movb $0x0, (%rax)
jmp 0x1cd34
movq %rbx, %rdi
movl $0x1, %esi
callq 0x1aa04
leaq 0x6c3b(%rip), %rdi      # 0x23962
movq %rax, %rsi
xorl %eax, %eax
callq 0xb620
movq %rbx, (%r14)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/wizard.c
// Function: whatis
int whatis(struct linked_list *what)
{
	struct object *obj;
	struct linked_list *item;
	int wh;

	if (what == NULL) {				/* we need to ask */
		if ((item = get_item("identify", 0)) == NULL)
			return 0;
	}
	else							/* no need to ask */
		item = what;
	obj = OBJPTR(item);
	setoflg(obj, ISKNOW);
	wh = obj->o_which;
	switch (obj->o_type) {
		case SCROLL:
			s_know[wh] = TRUE;
			if (s_guess[wh]) {
				free(s_guess[wh]);
				s_guess[wh] = NULL;
			}
	    when POTION:
			p_know[wh] = TRUE;
			if (p_guess[wh]) {
				free(p_guess[wh]);
				p_guess[wh] = NULL;
			}
		when STICK:
			ws_know[wh] = TRUE;
			if (ws_guess[wh]) {
				free(ws_guess[wh]);
			ws_guess[wh] = NULL;
			}
	    when RING:
			r_know[wh] = TRUE;
			if (r_guess[wh]) {
				free(r_guess[wh]);
				r_guess[wh] = NULL;
			}
	}
	if (what == NULL)
		msg(inv_name(obj, FALSE));
  return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq %rdi, %rax
testq %rdi, %rdi
jne 0x1cd67
leaq 0x33f0(%rip), %rdi      # 0x20147
xorl %esi, %esi
callq 0x10749
testq %rax, %rax
je 0x1ce19
movq 0x10(%rax), %r14
movl $0x2, %esi
movq %r14, %rdi
callq 0x9553
movslq 0x28(%r14), %rax
movl 0x20(%r14), %ecx
cmpl $0x3c, %ecx
jg 0x1cda3
cmpl $0x21, %ecx
je 0x1cdc1
cmpl $0x2f, %ecx
jne 0x1ce00
leaq 0x136aa(%rip), %rcx     # 0x30440
movb $0x1, (%rcx,%rax)
leaq 0x1356f(%rip), %rcx     # 0x30310
jmp 0x1cde7
cmpl $0x3d, %ecx
je 0x1cdd5
cmpl $0x3f, %ecx
jne 0x1ce00
leaq 0x1362c(%rip), %rcx     # 0x303e0
movb $0x1, (%rcx,%rax)
leaq 0x13301(%rip), %rcx     # 0x300c0
jmp 0x1cde7
leaq 0x13638(%rip), %rcx     # 0x30400
movb $0x1, (%rcx,%rax)
leaq 0x133bd(%rip), %rcx     # 0x30190
jmp 0x1cde7
leaq 0x13644(%rip), %rcx     # 0x30420
movb $0x1, (%rcx,%rax)
leaq 0x13459(%rip), %rcx     # 0x30240
movq (%rcx,%rax,8), %rdi
testq %rdi, %rdi
je 0x1ce00
leaq (%rcx,%rax,8), %r15
callq 0x6050
movq $0x0, (%r15)
testq %rbx, %rbx
jne 0x1ce19
movq %r14, %rdi
xorl %esi, %esi
callq 0x1aa04
movq %rax, %rdi
xorl %eax, %eax
callq 0xb620
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/wizard.c
// Function: makemons
int makemons(int what)
{
	int x, y, oktomake = FALSE, appear = 1;
	struct coord mp;

	oktomake = FALSE;
	for (x = hero.x - 1 ; x <= hero.x + 1 ; x++) {
		for (y = hero.y - 1 ; y <= hero.y + 1 ; y++) {
			if (x != hero.x || y != hero.y) {
				if (step_ok(winat(y, x)) && rnd(++appear) == 0) {
					mp.x = x;
					mp.y = y;
					oktomake = TRUE;
					break;
				}
			}
		}
	}
	if (oktomake) {
		new_monster(midx(what), &mp, FALSE);
		look(FALSE);
	}
	return oktomake;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edi, 0x14(%rsp)
leaq 0x10884(%rip), %r13     # 0x2dc60
movl 0x50(%r13), %eax
decl %eax
movb $0x1, %cl
movl %ecx, 0x8(%rsp)
movl $0x1, %ebp
xorl %ecx, %ecx
movl %ecx, 0x4(%rsp)
movl %eax, %r14d
movl 0x54(%r13), %eax
leal -0x1(%rax), %r15d
cmpl %eax, %r15d
jne 0x1d409
cmpl 0x50(%r13), %r14d
je 0x1d430
movl %r15d, %edi
movl %r14d, %esi
callq 0x9492
movsbq %al, %rdi
callq 0xb8d5
testb %al, %al
je 0x1d430
incl %ebp
movl %ebp, %edi
xorl %eax, %eax
callq 0xc674
testl %eax, %eax
je 0x1d44f
leal 0x1(%r15), %ecx
movl 0x54(%r13), %eax
cmpl %eax, %r15d
movl %ecx, %r15d
jle 0x1d3fe
leal 0x1(%r14), %eax
cmpl 0x50(%r13), %r14d
movl %eax, %r14d
jle 0x1d3f6
jmp 0x1d480
leal 0x1(%r14), %eax
movl $0x1, %ecx
movl $0x0, 0x8(%rsp)
movl %r15d, %r12d
movl %r14d, %ebx
cmpl 0x50(%r13), %r14d
jle 0x1d3ef
movl %r15d, 0x10(%rsp)
movl %r14d, 0xc(%rsp)
movl $0x1, 0x4(%rsp)
jmp 0x1d492
movl %r12d, 0x10(%rsp)
movl %ebx, 0xc(%rsp)
xorl %eax, %eax
testb $0x1, 0x8(%rsp)
jne 0x1d4b6
movsbl 0x14(%rsp), %edi
callq 0xd595
movsbl %al, %edi
leaq 0xc(%rsp), %rsi
xorl %edx, %edx
callq 0xd635
xorl %edi, %edi
callq 0xcae0
movl 0x4(%rsp), %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/wizard.c
// Function: getbless
int getbless()
{
	int bless;

	msg("Blessing: ");
	prbuf[0] = '\0';
	bless = get_str(prbuf, cw);
	if (bless == NORM)
		bless = atoi(prbuf);
	else
		bless = 0;
	return bless;
}

// Assembly:
pushq %rax
leaq 0x653c(%rip), %rdi      # 0x23a09
xorl %eax, %eax
callq 0xb620
leaq 0x109b5(%rip), %rdi     # 0x2de90
movb $0x0, (%rdi)
leaq 0x134fb(%rip), %rax     # 0x309e0
movq (%rax), %rsi
callq 0xfd31
testl %eax, %eax
je 0x1d4f5
xorl %eax, %eax
popq %rcx
retq
leaq 0x10994(%rip), %rdi     # 0x2de90
popq %rax
jmp 0x64b0
// File: /workspace/github_c_makefile_star2_O3/ajpaulson[P]srogue11/wizard.c
// Function: passwd
bool passwd()
{
	char *sp, c;
	bool passok;
	char buf[LINLEN], *xcrypt();

	msg(wizstr);
	mpos = 0;
	sp = buf;
	while ((c = getchar()) != '\n' && c != '\r' && c != ESCAPE)
	if (c == terminal.c_cc[VKILL])
		sp = buf;
	else if (c == terminal.c_cc[VERASE] && sp > buf)
		sp--;
	else
		*sp++ = c;
	if (sp == buf)
		passok = FALSE;
	else {
		*sp = '\0';
		passok = (strcmp(PASSWD, xcrypt(buf, "mT")) == 0);
	}
	return passok;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x50, %rsp
leaq 0xcc74(%rip), %rdi      # 0x2a360
xorl %eax, %eax
callq 0xb620
leaq 0x10176(%rip), %rax     # 0x2d870
movl $0x0, (%rax)
movq %rsp, %rbx
leaq 0x15356(%rip), %r14     # 0x32a60
movq %rbx, %rcx
movq %rcx, %r15
callq 0x6270
movl %eax, %ecx
shll $0x18, %ecx
cmpl $0xa000000, %ecx        # imm = 0xA000000
je 0x1d76b
cmpl $0xd000000, %ecx        # imm = 0xD000000
je 0x1d76b
cmpl $0x1b000000, %ecx       # imm = 0x1B000000
je 0x1d76b
movsbl %al, %edx
movzbl 0x14(%r14), %esi
movq %rbx, %rcx
cmpl %esi, %edx
je 0x1d70d
movzbl 0x13(%r14), %ecx
cmpl %ecx, %edx
sete %cl
cmpq %rbx, %r15
seta %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0x1d760
decq %r15
movq %r15, %rcx
jmp 0x1d70d
movb %al, (%r15)
incq %r15
movq %r15, %rcx
jmp 0x1d70d
movq %rsp, %rax
cmpq %rax, %r15
je 0x1d79e
movb $0x0, (%r15)
leaq 0x3471(%rip), %rsi      # 0x20bef
movq %rsp, %rdi
xorl %eax, %eax
callq 0x1d7ac
leaq 0x3452(%rip), %rdi      # 0x20be1
movq %rax, %rsi
callq 0x6250
testl %eax, %eax
sete %al
jmp 0x1d7a0
xorl %eax, %eax
addq $0x50, %rsp
popq %rbx
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/tests/dnsthread-resolve/main.c
// Function: main
int
main(int argc, char ** argv)
{

	WARNP_INIT;

	/* Usage. */
	if (argc < 2) {
		fprintf(stderr, "usage: dnsthread-resolve ADDRESS\n");
		goto err0;
	}

	/* Look for address given. */
	if (dnsthread_resolve(argv[1], found, NULL)) {
		warn0("fail dns");
		goto err0;
	}

	/* Loop until we're done. */
	if (events_spin(&doneloop)) {
		warn0("Error running event loop");
		goto err0;
	}

	/* Success! */
	exit(0);

err0:
	/* Failure! */
	exit(1);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x25e1
callq 0x4d8c
cmpl $0x1, %ebp
jg 0x2610
movq 0x8a0b(%rip), %rax      # 0xaff8
movq (%rax), %rcx
leaq 0x4a0d(%rip), %rdi      # 0x7004
movl $0x21, %esi
movl $0x1, %edx
callq 0x2320
movl $0x1, %edi
callq 0x2300
movq 0x8(%rbx), %rdi
leaq 0x46(%rip), %rsi        # 0x2661
xorl %edx, %edx
callq 0x57d8
testl %eax, %eax
jne 0x263d
leaq 0x8e57(%rip), %rdi      # 0xb484
callq 0x29a1
testl %eax, %eax
jne 0x2646
xorl %edi, %edi
callq 0x2300
leaq 0x49e2(%rip), %rdi      # 0x7026
jmp 0x264d
leaq 0x49e2(%rip), %rdi      # 0x702f
xorl %eax, %eax
callq 0x4f2b
callq 0x2080
movl $0x0, (%rax)
jmp 0x2606
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/tests/dnsthread-resolve/main.c
// Function: found
static int
found(void * cookie, struct sock_addr ** sas)
{
	char * addr;
	int i;

	(void)cookie; /* UNUSED */

	/* Sanity check. */
	if (sas == NULL)
		goto err0;

	/* Print each address. */
	for (i = 0; i < MAX_ADDRS; i++) {
		if (sas[i] == NULL)
			break;

		/* Extract address and print it. */
		if ((addr = sock_addr_prettyprint(sas[i])) == NULL) {
			warn0("sock_addr_prettyprint()");
			goto err1;
		}
		printf("%s\n", addr);

		/* Clean up. */
		free(addr);
	}

	/* Clean up. */
	sock_addr_freelist(sas);

	/* Quit event loop. */
	doneloop = 1;

	/* Success! */
	return (0);

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

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rsi, %rsi
je 0x26df
movq %rsi, %r14
xorl %r12d, %r12d
movq (%r14,%r12,8), %rdi
testq %rdi, %rdi
je 0x26a8
callq 0x4b8f
testq %rax, %rax
je 0x26be
movq %rax, %r15
movq %rax, %rdi
callq 0x20a0
movq %r15, %rdi
callq 0x2040
incq %r12
cmpq $0x8, %r12
jne 0x2679
movq %r14, %rdi
callq 0x449a
movl $0x1, 0x8dca(%rip)      # 0xb484
xorl %ebx, %ebx
jmp 0x26df
leaq 0x4983(%rip), %rdi      # 0x7048
xorl %eax, %eax
callq 0x4f2b
callq 0x2080
movl $0x0, (%rax)
movq %r14, %rdi
callq 0x449a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/liball/../lib/dnsthread/dnsthread.c
// Function: dnsthread_resolveone
int
dnsthread_resolveone(DNSTHREAD T, const char * addr,
    int (* callback)(void *, struct sock_addr **), void * cookie)
{
	int err = 0;
	int rc;

	/* Grab the mutex. */
	if ((rc = pthread_mutex_lock(&T->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* If the resolver is already busy, fail. */
	if (T->state == THREAD_HASWORK) {
		err = EALREADY;
		goto ealready;
	}

	/* Duplicate the address to be resolved. */
	if ((T->addr = strdup(addr)) == NULL)
		goto err1;

	/* Remember what callback we'll need to do eventually. */
	T->callback = callback;
	T->cookie = cookie;

	/* There is now work for the thread to do. */
	T->state = THREAD_HASWORK;

	/* Wake up the worker thread. */
	if ((rc = pthread_cond_signal(&T->cv)) != 0) {
		warn0("pthread_cond_signal: %s", strerror(rc));
		goto err1;
	}

	/* We want a callback when the worker thread pokes us. */
	if (events_network_register(callback_resolveone, T, T->wakeupsock[1],
	    EVENTS_NETWORK_OP_READ)) {
		warnp("Error registering wakeup listener");
		goto err1;
	}

ealready:
	/* Release the mutex. */
	if ((rc = pthread_mutex_unlock(&T->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* If err was set earlier, store the value in errno. */
	if (err)
		errno = err;

	/* Success! */
	return (0);

err1:
	pthread_mutex_unlock(&T->mtx);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r14
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x2380
testl %eax, %eax
je 0x5516
movl %eax, %edi
callq 0x2360
leaq 0x2241(%rip), %rdi      # 0x772c
movq %rax, %rsi
xorl %eax, %eax
callq 0x4f2b
callq 0x2080
movl $0x0, (%rax)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1, 0x60(%r14)
jne 0x5539
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x559d
movl %eax, %edi
callq 0x2360
leaq 0x2240(%rip), %rdi      # 0x7777
jmp 0x54eb
movq %r13, %rdi
callq 0x2350
movq %rax, 0x70(%r14)
testq %rax, %rax
je 0x5590
movq %r12, 0x88(%r14)
movq %r15, 0x90(%r14)
movl $0x1, 0x60(%r14)
leaq 0x30(%r14), %rdi
callq 0x21c0
testl %eax, %eax
je 0x55af
movl %eax, %edi
callq 0x2360
leaq 0x2215(%rip), %rdi      # 0x7790
movq %rax, %rsi
xorl %eax, %eax
callq 0x4f2b
callq 0x2080
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2230
jmp 0x5500
callq 0x2080
movl $0x72, (%rax)
xorl %ebp, %ebp
jmp 0x5505
movl 0x68(%r14), %edx
leaq 0x5c(%rip), %rdi        # 0x5616
xorl %ebp, %ebp
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x2f4c
testl %eax, %eax
je 0x55ee
callq 0x2080
cmpl $0x0, (%rax)
je 0x5603
movq %rax, %r14
leaq 0x21ca(%rip), %rdi      # 0x77a8
xorl %eax, %eax
callq 0x4e0c
movl $0x0, (%r14)
jmp 0x5590
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
jne 0x5529
jmp 0x5505
leaq 0x219e(%rip), %rdi      # 0x77a8
xorl %eax, %eax
callq 0x4f2b
jmp 0x5590
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/liball/../lib/dnsthread/dnsthread.c
// Function: callback_resolveone
static int
callback_resolveone(void * cookie)
{
	struct dnsthread_internal * T = cookie;
	struct sock_addr ** sas;
	uint8_t zero;
	int res_errno = 0;
	int (* callback)(void *, struct sock_addr **);
	void * cb_cookie;
	int rc;

	/* Drain the byte from the socketpair. */
	if (read(T->wakeupsock[1], &zero, 1) != 1) {
		warn0("Error reading from wakeup socket");
		goto err0;
	}

	/* Grab the mutex. */
	if ((rc = pthread_mutex_lock(&T->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* Free the (strduped) address which was to be resolved. */
	free(T->addr);

	/* Grab the result. */
	sas = T->sas;
	res_errno = T->res_errno;

	/* Grab the callback. */
	callback = T->callback;
	cb_cookie = T->cookie;

	/* Release the mutex. */
	if ((rc = pthread_mutex_unlock(&T->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* Perform the callback. */
	if (sas == NULL)
		errno = res_errno;
	return ((callback)(cb_cookie, sas));

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

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movl 0x68(%rdi), %edi
leaq 0xf(%rsp), %rsi
movl $0x1, %edx
callq 0x21b0
cmpq $0x1, %rax
jne 0x565d
leaq 0x8(%rbx), %r15
movq %r15, %rdi
callq 0x2380
testl %eax, %eax
je 0x566d
movl %eax, %edi
callq 0x2360
leaq 0x20d1(%rip), %rdi      # 0x772c
jmp 0x56a8
leaq 0x21df(%rip), %rdi      # 0x7843
xorl %eax, %eax
callq 0x4f2b
jmp 0x56b2
movq 0x70(%rbx), %rdi
callq 0x2040
movq 0x78(%rbx), %r14
movl 0x80(%rbx), %ebp
movq 0x88(%rbx), %r12
movq 0x90(%rbx), %rbx
movq %r15, %rdi
callq 0x2230
testl %eax, %eax
je 0x56cf
movl %eax, %edi
callq 0x2360
leaq 0x20cf(%rip), %rdi      # 0x7777
movq %rax, %rsi
xorl %eax, %eax
callq 0x4f2b
callq 0x2080
movl $0x0, (%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %r15
testq %r14, %r14
jne 0x56de
callq 0x2080
movl %ebp, (%rax)
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/liball/../lib/dnsthread/dnsthread.c
// Function: dnsthread_kill
int
dnsthread_kill(DNSTHREAD T)
{
	int rc;
	int ostate;
	pthread_t thr;

	/* Lock the control structure. */
	if ((rc = pthread_mutex_lock(&T->mtx)) != 0) {
		warn0("pthread_mutex_lock: %s", strerror(rc));
		goto err0;
	}

	/* Remember what state the thread is currently in. */
	ostate = T->state;

	/* Grab the thread ID. */
	thr = T->thr;

	/* Tell the thread to die, and wake it up. */
	T->state = THREAD_SUICIDE;
	if ((rc = pthread_cond_signal(&T->cv)) != 0) {
		warn0("pthread_cond_signal: %s", strerror(rc));
		goto err1;
	}

	/* Unlock the control structure. */
	if ((rc = pthread_mutex_unlock(&T->mtx)) != 0) {
		warn0("pthread_mutex_unlock: %s", strerror(rc));
		goto err0;
	}

	/* If the thread was sleeping, wait for it to wake up and die. */
	if (ostate == THREAD_SLEEPING) {
		if ((rc = pthread_join(thr, NULL)) != 0) {
			warn0("pthread_join: %s", strerror(rc));
			goto err0;
		}
	}

	/* Success! */
	return (0);

err1:
	pthread_mutex_unlock(&T->mtx);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x8(%rdi), %rbx
movq %rbx, %rdi
callq 0x2380
testl %eax, %eax
je 0x5734
movl %eax, %edi
callq 0x2360
leaq 0x200f(%rip), %rdi      # 0x772c
movq %rax, %rsi
xorl %eax, %eax
callq 0x4f2b
callq 0x2080
movl $0x0, (%rax)
jmp 0x577e
movl 0x60(%r15), %ebp
movq (%r15), %r14
movl $0x2, 0x60(%r15)
addq $0x30, %r15
movq %r15, %rdi
callq 0x21c0
testl %eax, %eax
je 0x5790
movl %eax, %edi
callq 0x2360
leaq 0x202f(%rip), %rdi      # 0x7790
movq %rax, %rsi
xorl %eax, %eax
callq 0x4f2b
callq 0x2080
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x2230
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x2230
testl %eax, %eax
je 0x57af
movl %eax, %edi
callq 0x2360
leaq 0x1fcd(%rip), %rdi      # 0x7777
jmp 0x571d
xorl %ebx, %ebx
testl %ebp, %ebp
jne 0x5783
xorl %ebx, %ebx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2340
testl %eax, %eax
je 0x5783
movl %eax, %edi
callq 0x2360
leaq 0x1ff7(%rip), %rdi      # 0x77ca
jmp 0x571d
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/liball/../lib/dnsthread/dnsthread.c
// Function: dnsthread_resolve
int
dnsthread_resolve(const char * addr,
    int (* callback)(void *, struct sock_addr **), void * cookie)
{
	struct resolve_cookie * R;

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

	/* Spawn a thread. */
	if ((R->T = dnsthread_spawn()) == NULL)
		goto err1;

	/* Launch the request. */
	if (dnsthread_resolveone(R->T, addr, callback_resolve, R))
		goto err2;

	/* Success! */
	return (0);

err2:
	dnsthread_kill(R->T);
err1:
	free(R);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %r15
movl $0x18, %edi
callq 0x2240
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x5844
movq %rax, %r14
movq %r13, (%rax)
movq %r12, 0x8(%rax)
callq 0x5050
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x5838
leaq 0x33(%rip), %rdx        # 0x5850
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rcx
callq 0x54b6
testl %eax, %eax
je 0x5842
movq 0x10(%r14), %rdi
callq 0x56f5
movq %r14, %rdi
callq 0x2040
jmp 0x5844
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]spiped/liball/../lib/dnsthread/dnsthread.c
// Function: callback_resolve
static int
callback_resolve(void * cookie, struct sock_addr ** sas)
{
	struct resolve_cookie * R = cookie;
	int rc;

	/* Invoke the upstream callback. */
	rc = (R->callback)(R->cookie, sas);

	/* Kill the resolver thread. */
	if (dnsthread_kill(R->T))
		rc = -1;

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

	/* Return upstream return code or failure. */
	return (rc);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq *(%rbx)
movl %eax, %ebp
movq 0x10(%rbx), %rdi
callq 0x56f5
xorl %r14d, %r14d
negl %eax
sbbl %r14d, %r14d
orl %ebp, %r14d
movq %rbx, %rdi
callq 0x2040
movl %r14d, %eax
popq %rbx
popq %r14
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O3/dolphinking[P]slimox/src/slimox-pack.c
// Function: file_item_get
static inline void file_item_get(struct file_item* item, FILE* fp) {
    size_t len;
    size_t i;
    int c;

    fread(&item->m_mode, sizeof(item->m_mode), 1, fp);
    fread(&item->m_size, sizeof(item->m_size), 1, fp);
    fread(&len, sizeof(item->m_path_to_root->len), 1, fp);

    str_assign(item->m_path_to_root, "");
    for(i = 0; i < len; i++) {
        if((c = getc(fp)) == 0) { /* replace 0 with path seperator */
            str_concat_chr(item->m_path_to_root, PATH_SEP[0]);
        } else {
            str_concat_chr(item->m_path_to_root, c);
        }
    }
    return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1070
leaq 0x4(%r14), %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1070
movq %rsp, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x1070
movq 0x8(%r14), %r15
movq 0x10(%r15), %rdi
movl $0x4, %esi
callq 0x11b0
testq %rax, %rax
je 0xa6f6
movq %rax, 0x10(%r15)
movb $0x0, (%rax)
movq $0x0, (%r15)
movq $0x4, 0x8(%r15)
movq (%rsp), %r12
testq %r12, %r12
je 0xa6dd
movq %rbx, %rdi
callq 0x1230
movl %eax, %ebp
movq 0x8(%r14), %r13
movq (%r13), %rcx
movq 0x8(%r13), %rax
leaq 0x2(%rcx), %rdx
testl %ebp, %ebp
je 0xa681
cmpq %rax, %rdx
jbe 0xa6ad
leaq 0x4(,%rcx,2), %r15
movq 0x10(%r13), %rdi
movq %r15, %rsi
callq 0x11b0
testq %rax, %rax
je 0xa6ec
movq %r15, 0x8(%r13)
movq %rax, 0x10(%r13)
movq (%r13), %rcx
jmp 0xa6b1
cmpq %rax, %rdx
jbe 0xa6b7
leaq 0x4(,%rcx,2), %r15
movq 0x10(%r13), %rdi
movq %r15, %rsi
callq 0x11b0
testq %rax, %rax
je 0xa6f1
movq %r15, 0x8(%r13)
movq %rax, 0x10(%r13)
movq (%r13), %rcx
jmp 0xa6bb
movq 0x10(%r13), %rax
movb %bpl, (%rax,%rcx)
jmp 0xa6bf
movq 0x10(%r13), %rax
movb $0x2f, (%rax,%rcx)
movq (%r13), %rax
movq 0x10(%r13), %rcx
leaq 0x1(%rax), %rdx
movq %rdx, (%r13)
movb $0x0, 0x1(%rcx,%rax)
decq %r12
jne 0xa637
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1532
callq 0x1554
callq 0x1576
// File: /workspace/github_c_makefile_star2_O3/dolphinking[P]slimox/src/utils/string-utils.h
// Function: str_sprintf
static inline int str_sprintf(string_t* str, const char* format, ...) {
    va_list args[2];
    size_t newcapacity;
    void*  newp;
    int    ret;

    va_start(args[0], format);
    ret = vsnprintf(str->str, str->capacity, format, args[0]);
    va_end(args[0]);

    if((newcapacity = ret + 4) > str->capacity) {
        if((newp = realloc(str->str, newcapacity)) != NULL) {
            str->capacity = newcapacity;
            str->str = newp;

            va_start(args[1], format);
            ret = vsnprintf(str->str, str->capacity, format, args[0]);
            va_end(args[1]);
        } else {
            STRING_UTILS_ON_ALLOC_FAIL();
            return -1;
        }
    }
    str->len = strlen(str->str);

    va_end(args[0]);
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe0, %rsp
movq %rdi, %rbx
leaq 0x30(%rsp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0xa761
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
movq %rsp, %rcx
movq %r15, 0x10(%rcx)
leaq 0x110(%rsp), %r12
movq %r12, 0x8(%rcx)
movabsq $0x3000000010, %r13     # imm = 0x3000000010
movq %r13, (%rcx)
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
leaq 0xfa2(%rip), %rdx       # 0xb732
callq 0x1080
addl $0x4, %eax
movslq %eax, %r14
cmpq %r14, 0x8(%rbx)
jae 0xa7dd
movq 0x10(%rbx), %rdi
movq %r14, %rsi
callq 0x11b0
testq %rax, %rax
je 0xa7fa
movq %r14, 0x8(%rbx)
movq %rax, 0x10(%rbx)
movq %rsp, %rcx
movq %r15, 0x28(%rcx)
movq %r12, 0x20(%rcx)
movq %r13, 0x18(%rcx)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdi
leaq 0xf5a(%rip), %rdx       # 0xb732
callq 0x1080
movq 0x10(%rbx), %rdi
callq 0x10b0
movq %rax, (%rbx)
addq $0xe0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x1598
// File: /workspace/github_c_makefile_star2_O3/dolphinking[P]slimox/src/slimox-pack.c
// Function: encode_block
static inline int encode_block(buf_t* ib, ppm_model_t* ppm, FILE* fout) {
    buf_t* ob = buf_new();
    size_t pos_sync;
    size_t out_size;

    /* put block header */
    pos_sync = ftell(fout);
    if(fwrite(&ob->m_size, sizeof(ob->m_size), 1, fout) != 1) {
        buf_del(ob);
        return -1;
    }

    /* encode */
    out_size = slimox_encode(ib, ob, ppm, fout);

    /* rewrite block header */
    fseek(fout, pos_sync, SEEK_SET);
    if(fwrite(&out_size, sizeof(ob->m_size), 1, fout) != 1) {
        buf_del(ob);
        return -1;
    }
    fseek(fout, 0, SEEK_END);

    buf_del(ob);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl $0x1, %edi
movl $0x10, %esi
callq 0x1120
movq %rax, %rbx
movq %r14, %rdi
callq 0x1150
movq %rax, %r13
movq %rbx, %rdi
addq $0x8, %rdi
movl $0x4, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x1210
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x1, %rax
jne 0xa8a6
movq %r12, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x176c
cltq
movq %rsp, %r15
movq %rax, (%r15)
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x11a0
movl $0x4, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %r14, %rcx
callq 0x1210
cmpq $0x1, %rax
jne 0xa8a6
movq %r14, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x11a0
xorl %ebp, %ebp
movq (%rbx), %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: tlinehistlen
int
tlinehistlen(int y)
{
	int i = term.col;

	if (TLINE_HIST(y)[i - 1].mode & ATTR_WRAP)
		return i;

	while (i > 0 && TLINE_HIST(y)[i - 1].u == ' ')
		--i;

	return i;
}

// Assembly:
movl 0x12856(%rip), %eax     # 0x188e4
movslq %eax, %r8
movl 0x12849(%rip), %ecx     # 0x188e0
movl $0x7d2, %edx            # imm = 0x7D2
subl %ecx, %edx
movslq %edi, %rsi
cmpl %edi, %edx
jge 0x60c4
movq 0x1283c(%rip), %r9      # 0x188e8
leal (%rdi,%rcx), %r10d
addl $0xfffff830, %r10d      # imm = 0xFFFFF830
movslq %r10d, %r10
leaq (%r9,%r10,8), %r9
addq $-0x18, %r9
jmp 0x60d3
leaq 0x12815(%rip), %r9      # 0x188e0
leaq (%r9,%rsi,8), %r9
addq $0x10, %r9
movq (%r9), %r9
movq %r8, %r10
shlq $0x4, %r10
testb $0x2, -0xb(%r9,%r10)
sete %r9b
testl %r8d, %r8d
setg %r8b
andb %r9b, %r8b
cmpb $0x1, %r8b
jne 0x613e
cmpl %edi, %edx
leaq 0x127e0(%rip), %rdx     # 0x188e0
leaq 0x10(%rdx,%rsi,8), %rdx
movq 0x127dc(%rip), %rsi     # 0x188e8
leal -0x7d0(%rdi,%rcx), %ecx
movslq %ecx, %rcx
leaq -0x18(%rsi,%rcx,8), %rcx
cmovgeq %rdx, %rcx
movq (%rcx), %rcx
addq $-0x10, %rcx
movl %eax, %edx
shlq $0x4, %rdx
cmpl $0x20, (%rcx,%rdx)
jne 0x613e
leal -0x1(%rax), %edx
cmpl $0x1, %eax
movl %edx, %eax
jg 0x6126
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: selclear
void
selclear(void)
{
	if (sel.ob.x == -1)
		return;
	selremove();
	tsetdirt(sel.nb.y, sel.ne.y);
}

// Assembly:
cmpl $-0x1, 0x126de(%rip)    # 0x188cc
je 0x6215
movl $0x0, 0x126b6(%rip)     # 0x188b0
movl $0xffffffff, 0x126c8(%rip) # imm = 0xFFFFFFFF
movl 0x126b6(%rip), %edi     # 0x188c0
movl 0x126b8(%rip), %esi     # 0x188c8
jmp 0x641b
retq
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: regionselected
int
regionselected(int x1, int y1, int x2, int y2)
{
	if (sel.ob.x == -1 || sel.mode == SEL_EMPTY ||
	    sel.alt != IS_SET(MODE_ALTSCREEN) || sel.nb.y > y2 || sel.ne.y < y1)
		return 0;

	return (sel.type == SEL_RECTANGULAR) ? sel.nb.x <= x2 && sel.ne.x >= x1
		: (sel.nb.y != y2 || sel.nb.x <= x2) &&
		  (sel.ne.y != y1 || sel.ne.x >= x1);
}

// Assembly:
xorl %eax, %eax
cmpl $-0x1, 0x12267(%rip)    # 0x188cc
je 0x66a4
cmpl $0x1, 0x12242(%rip)     # 0x188b0
je 0x66a4
movl 0x12266(%rip), %eax     # 0x188dc
btl $0x2, 0x1613e(%rip)     # 0x1c7bc
sbbl $0x0, %eax
jne 0x66a2
movl 0x12236(%rip), %r8d     # 0x188c0
cmpl %ecx, %r8d
setg %r9b
movl 0x12231(%rip), %eax     # 0x188c8
cmpl %esi, %eax
setl %r10b
orb %r9b, %r10b
je 0x66a8
xorl %eax, %eax
movzbl %al, %eax
retq
cmpl $0x2, 0x12205(%rip)     # 0x188b4
jne 0x66c7
cmpl %edx, 0x12205(%rip)     # 0x188bc
setle %cl
cmpl %edi, 0x12204(%rip)     # 0x188c4
setge %al
andb %cl, %al
jmp 0x66a4
cmpl %ecx, %r8d
jne 0x66d4
cmpl %edx, 0x121ea(%rip)     # 0x188bc
jg 0x66a2
cmpl %esi, %eax
setne %cl
cmpl %edi, 0x121e5(%rip)     # 0x188c4
setge %al
orb %cl, %al
jmp 0x66a4
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: sigchld
void
sigchld(int a)
{
	int stat;
	pid_t p;

	if ((p = waitpid(pid, &stat, WNOHANG)) < 0)
		die("waiting for pid %hd failed: %s\n", pid, strerror(errno));

	if (pid != p) {
		if (p == 0 && wait(&stat) < 0)
			die("wait: %s\n", strerror(errno));

		/* reinstall sigchld handler */
		signal(SIGCHLD, sigchld);
		return;
	}

	if (WIFEXITED(stat) && WEXITSTATUS(stat))
		die("child exited with status %d\n", WEXITSTATUS(stat));
	else if (WIFSIGNALED(stat))
		die("child terminated due to signal %d\n", WTERMSIG(stat));
	_exit(0);
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl 0x15ac2(%rip), %edi     # 0x1c7e4
leaq 0xc(%rsp), %rsi
movl $0x1, %edx
callq 0x5530
movl 0x15aad(%rip), %ebx     # 0x1c7e4
testl %eax, %eax
js 0x6d68
cmpl %eax, %ebx
je 0x6d87
testl %eax, %eax
jne 0x6d51
leaq 0xc(%rsp), %rdi
callq 0x5100
testl %eax, %eax
js 0x6dcd
leaq -0x41(%rip), %rsi       # 0x6d17
movl $0x11, %edi
callq 0x5060
addq $0x10, %rsp
popq %rbx
retq
callq 0x55a0
movl (%rax), %edi
callq 0x5460
leaq 0xa9ea(%rip), %rdi      # 0x11765
movl %ebx, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x5f06
movl 0xc(%rsp), %eax
movl %eax, %esi
andl $0x7f, %esi
jne 0x6da7
shrl $0x8, %eax
andl $0xff, %eax
je 0x6dc6
leaq 0xa9ec(%rip), %rdi      # 0x1178f
movl %eax, %esi
jmp 0x6dbf
movl %esi, %eax
shll $0x18, %eax
addl $0x1000000, %eax        # imm = 0x1000000
cmpl $0x2000000, %eax        # imm = 0x2000000
jl 0x6dc6
leaq 0xa9ed(%rip), %rdi      # 0x117ac
xorl %eax, %eax
callq 0x5f06
xorl %edi, %edi
callq 0x5230
callq 0x55a0
movl (%rax), %edi
callq 0x5460
leaq 0xa9a5(%rip), %rdi      # 0x11785
movq %rax, %rsi
xorl %eax, %eax
callq 0x5f06
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: kscrolldown
void
kscrolldown(const Arg* a)
{
	int n = a->i;

	if (!term.scr || IS_SET(MODE_ALTSCREEN))
		return;

	if (n < 0)
		n = MAX(term.row / -n, 1);

	if (n <= term.scr) {
		term.scr -= n;
	} else {
		n = term.scr;
		term.scr = 0;
	}

	if (sel.ob.x != -1 && !sel.alt)
		selmove(-n); /* negate change in term.scr */
	tfulldirt();
}

// Assembly:
movl 0x15721(%rip), %ecx     # 0x1c778
testl %ecx, %ecx
je 0x70ee
testb $0x4, 0x15756(%rip)     # 0x1c7bc
jne 0x70ee
movl (%rdi), %esi
testl %esi, %esi
jns 0x7088
movl 0x11868(%rip), %eax     # 0x188e0
negl %esi
cltd
idivl %esi
cmpl $0x2, %eax
movl $0x1, %esi
cmovgel %eax, %esi
xorl %eax, %eax
movl %ecx, %edx
subl %esi, %edx
cmovll %eax, %edx
movl %edx, 0x156e1(%rip)     # 0x1c778
cmpl $-0x1, 0x1182e(%rip)    # 0x188cc
je 0x70c6
cmpl $0x0, 0x11835(%rip)     # 0x188dc
jne 0x70c6
cmpl %ecx, %esi
cmovll %esi, %ecx
subl %ecx, 0x1181c(%rip)     # 0x188d0
subl %ecx, 0x11806(%rip)     # 0x188c0
subl %ecx, 0x11818(%rip)     # 0x188d8
subl %ecx, 0x11802(%rip)     # 0x188c8
cmpl $0x0, 0x11813(%rip)     # 0x188e0
jle 0x70ee
movq 0x156b2(%rip), %rax     # 0x1c788
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x117f7(%rip), %rdx     # 0x188e0
cmpq %rdx, %rcx
jl 0x70d8
retq
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: tsetdirtattr
void
tsetdirtattr(int attr)
{
	int i, j;

	for (i = 0; i < term.row-1; i++) {
		for (j = 0; j < term.col-1; j++) {
			if (term.line[i][j].mode & attr) {
				term.dirty[i] = 1;
				break;
			}
		}
	}
}

// Assembly:
movl 0x11562(%rip), %eax     # 0x188e0
cmpl $0x2, %eax
jl 0x73e9
pushq %rbx
movq 0x1155d(%rip), %rcx     # 0x188e8
movq 0x153f6(%rip), %rdx     # 0x1c788
movl 0x1154b(%rip), %r8d     # 0x188e4
xorl %esi, %esi
cmpl $0x2, %r8d
jl 0x73d9
leal -0x1(%r8), %r9d
movq (%rcx,%rsi,8), %r10
shlq $0x4, %r9
xorl %r11d, %r11d
movzwl 0x4(%r10,%r11), %ebx
testl %edi, %ebx
jne 0x73c5
addq $0x10, %r11
cmpq %r11, %r9
jne 0x73b0
jmp 0x73d9
movl $0x1, (%rdx,%rsi,4)
movl 0x11511(%rip), %r8d     # 0x188e4
movl 0x11507(%rip), %eax     # 0x188e0
incq %rsi
leal -0x1(%rax), %r9d
movslq %r9d, %r9
cmpq %r9, %rsi
jl 0x739b
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: tnew
void
tnew(int col, int row)
{
	int i, j;

	for (i = 0; i < 2; i++) {
		term.line = xmalloc(row * sizeof(Line));
		for (j = 0; j < row; j++)
			term.line[j] = xmalloc(col * sizeof(Glyph));
		term.col = col, term.row = row;
		tswapscreen();
	}
	term.dirty = xmalloc(row * sizeof(*term.dirty));
	term.tabs = xmalloc(col * sizeof(*term.tabs));
	for (i = 0; i < HISTSIZE; i++)
		term.hist[i] = xmalloc(col * sizeof(Glyph));
  treset();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %ebp
movl %edi, %r12d
movslq %esi, %rax
leaq (,%rax,8), %rcx
movq %rcx, 0x10(%rsp)
movslq %edi, %rbx
movq %rbx, 0x8(%rsp)
shlq $0x4, %rbx
movq %rax, (%rsp)
movl %eax, %r14d
movb $0x1, %r15b
movq 0x10(%rsp), %rdi
callq 0x5edc
movq %rax, 0x114b4(%rip)     # 0x188e8
testl %ebp, %ebp
jle 0x745d
xorl %r13d, %r13d
movq %rbx, %rdi
callq 0x5edc
movq 0x1149e(%rip), %rcx     # 0x188e8
movq %rax, (%rcx,%r13,8)
incq %r13
cmpq %r13, %r14
jne 0x743b
movq 0x1148b(%rip), %rax     # 0x188e8
movq 0x173d4(%rip), %rcx     # 0x1e838
movq %rcx, 0x1147d(%rip)     # 0x188e8
movl 0x173cf(%rip), %ecx     # 0x1e840
movl %ecx, 0x1146d(%rip)     # 0x188e4
movl 0x173c7(%rip), %ecx     # 0x1e844
movl %ecx, 0x1145d(%rip)     # 0x188e0
movq %rax, 0x173ae(%rip)     # 0x1e838
xorb $0x4, 0x1532b(%rip)     # 0x1c7bc
movl %r12d, 0x173a8(%rip)    # 0x1e840
movl %ebp, 0x173a6(%rip)     # 0x1e844
testb $0x1, %r15b
movl $0x0, %r15d
jne 0x7423
movq (%rsp), %rdi
shlq $0x2, %rdi
callq 0x5edc
movq %rax, 0x152c6(%rip)     # 0x1c788
movq 0x8(%rsp), %rdi
shlq $0x2, %rdi
callq 0x5edc
movq %rax, 0x152f9(%rip)     # 0x1c7d0
movl $0x2, %r14d
leaq 0x113fc(%rip), %r15     # 0x188e0
movq %rbx, %rdi
callq 0x5edc
movq %rax, (%r15,%r14,8)
incq %r14
cmpq $0x7d2, %r14            # imm = 0x7D2
jne 0x74e4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x750c
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: kscrollup
void
kscrollup(const Arg* a)
{
	int n = a->i;

	if (!term.histf || IS_SET(MODE_ALTSCREEN))
		return;

	if (n < 0)
		n = MAX(term.row / -n, 1);

	if (term.scr + n <= term.histf) {
		term.scr += n;
	} else {
		n = term.histf - term.scr;
		term.scr = term.histf;
	}

	if (sel.ob.x != -1 && !sel.alt)
		selmove(n); /* negate change in term.scr */
	tfulldirt();
}

// Assembly:
movl 0x15039(%rip), %ecx     # 0x1c774
testl %ecx, %ecx
je 0x77dd
testb $0x4, 0x15072(%rip)     # 0x1c7bc
jne 0x77dd
movl (%rdi), %esi
testl %esi, %esi
jns 0x776c
movl 0x11184(%rip), %eax     # 0x188e0
negl %esi
cltd
idivl %esi
cmpl $0x2, %eax
movl $0x1, %esi
cmovgel %eax, %esi
movl 0x15006(%rip), %eax     # 0x1c778
leal (%rax,%rsi), %edx
cmpl %ecx, %edx
movl %ecx, %edi
cmovll %edx, %edi
movl %edi, 0x14ff6(%rip)     # 0x1c778
cmpl $-0x1, 0x11143(%rip)    # 0x188cc
je 0x77b5
cmpl $0x0, 0x1114a(%rip)     # 0x188dc
jne 0x77b5
movl %ecx, %edi
subl %eax, %edi
cmpl %ecx, %edx
cmovgl %edi, %esi
addl %esi, 0x1112d(%rip)     # 0x188d0
addl %esi, 0x11117(%rip)     # 0x188c0
addl %esi, 0x11129(%rip)     # 0x188d8
addl %esi, 0x11113(%rip)     # 0x188c8
cmpl $0x0, 0x11124(%rip)     # 0x188e0
jle 0x77dd
movq 0x14fc3(%rip), %rax     # 0x1c788
xorl %ecx, %ecx
movl $0x1, (%rax,%rcx,4)
incq %rcx
movslq 0x11108(%rip), %rdx     # 0x188e0
cmpq %rdx, %rcx
jl 0x77c7
retq
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: tresize
void
tresize(int col, int row)
{
	int *bp;

	/* col and row are always MAX(_, 1)
	if (col < 1 || row < 1) {
		fprintf(stderr, "tresize: error resizing to %dx%d\n", col, row);
		return;
	} */

	term.dirty = xrealloc(term.dirty, row * sizeof(*term.dirty));
	term.tabs = xrealloc(term.tabs, col * sizeof(*term.tabs));
	if (col > term.col) {
		bp = term.tabs + term.col;
		memset(bp, 0, sizeof(*term.tabs) * (col - term.col));
		while (--bp > term.tabs && !*bp)
			/* nothing */ ;
		for (bp += tabspaces; bp < term.tabs + col; bp += tabspaces)
			*bp = 1;
	}

	if (IS_SET(MODE_ALTSCREEN))
		tresizealt(col, row);
	else
		tresizedef(col, row);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebx
movl %edi, %ebp
movq 0x14cf7(%rip), %rdi     # 0x1c788
movslq %esi, %rsi
shlq $0x2, %rsi
callq 0x5fa0
movq %rax, 0x14ce4(%rip)     # 0x1c788
movq 0x14d25(%rip), %rdi     # 0x1c7d0
movslq %ebp, %r15
leaq (,%r15,4), %rsi
callq 0x5fa0
movq %rax, 0x14d0e(%rip)     # 0x1c7d0
movslq 0x10e1b(%rip), %r12     # 0x188e4
cmpl %r12d, %r15d
jle 0x7b25
movq %rax, %r14
movl %ebp, %eax
subl %r12d, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
leaq (%r14,%r12,4), %rdi
xorl %esi, %esi
callq 0x50a0
leaq (%r14,%r12,4), %rax
addq $-0x4, %rax
movq %rax, %rcx
cmpq %r14, %rax
jbe 0x7b01
leaq -0x4(%rcx), %rax
cmpl $0x0, (%rcx)
je 0x7af0
leaq 0x109d0(%rip), %rax     # 0x184d8
movl (%rax), %edx
leaq (%rcx,%rdx,4), %rcx
leaq (%r14,%r15,4), %rdx
cmpq %rdx, %rcx
jae 0x7b25
movl $0x1, (%rcx)
movl (%rax), %esi
leaq (%rcx,%rsi,4), %rcx
jmp 0x7b12
testb $0x4, 0x14c90(%rip)     # 0x1c7bc
jne 0x7b3f
movl %ebp, %edi
movl %ebx, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7e47
movl %ebp, %edi
movl %ebx, %esi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x7b4d
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: tnewline
void
tnewline(int first_col)
{
	int y = term.c.y;

	if (y == term.bot) {
		tscrollup(term.top, term.bot, 1, SCROLL_SAVEHIST);
	} else {
		y++;
	}
	tmoveto(first_col ? 0 : term.c.x, y);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movl 0x12399(%rip), %ebx     # 0x1c7a4
cmpl 0x123a7(%rip), %ebx     # 0x1c7b8
jne 0xa42c
movl 0x1239b(%rip), %edi     # 0x1c7b4
movl %ebx, %esi
movl $0x1, %edx
movl $0x1, %ecx
callq 0xad57
jmp 0xa42e
incl %ebx
xorl %edi, %edi
testl %ebp, %ebp
jne 0xa43a
movl 0x12366(%rip), %edi     # 0x1c7a0
movl %ebx, %esi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x9017
// File: /workspace/github_c_makefile_star2_O3/anachronic[P]st/st.c
// Function: tinsertblank
void
tinsertblank(int n)
{
	int src, dst, size;
	Line line;

	if (n <= 0)
		return;
	dst = MIN(term.c.x + n, term.col);
	src = term.c.x;
	size = term.col - dst;
	if (size > 0) { /* otherwise dst would point beyond the array */
		line = term.line[term.c.y];
		memmove(&line[dst], &line[src], size * sizeof(Glyph));
	}
	tclearregion(src, term.c.y, dst - 1, term.c.y, 1);
}

// Assembly:
testl %edi, %edi
jle 0xac9d
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movslq 0x11b5e(%rip), %r14     # 0x1c7a0
addl %r14d, %ebx
movl 0xdc99(%rip), %eax      # 0x188e4
cmpl %eax, %ebx
cmovgel %eax, %ebx
subl %ebx, %eax
jle 0xac85
movq 0xdc8d(%rip), %rcx      # 0x188e8
movslq 0x11b42(%rip), %rdx     # 0x1c7a4
movq (%rcx,%rdx,8), %rcx
movslq %ebx, %rdi
shlq $0x4, %rdi
addq %rcx, %rdi
movq %r14, %rsi
shlq $0x4, %rsi
addq %rcx, %rsi
movl %eax, %edx
shlq $0x4, %rdx
callq 0x5510
movl 0x11b19(%rip), %ecx     # 0x1c7a4
decl %ebx
movl %r14d, %edi
movl %ecx, %esi
movl %ebx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xac9e
retq