LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_64.c
// Function: generate_far_jump_code
static u_char* generate_far_jump_code(struct sljit_jump *jump, u_char *code_ptr, int type)
{
	if (type < SLJIT_JUMP) {
		/* Invert type. */
		*code_ptr++ = get_jump_code(type ^ 0x1) - 0x10;
		*code_ptr++ = 10 + 3;
	}

	SLJIT_COMPILE_ASSERT(reg_map[TMP_REG3] == 9, tmp3_is_9_first);
	*code_ptr++ = REX_W | REX_B;
	*code_ptr++ = MOV_r_i32 + 1;
	jump->addr = (unsigned long)code_ptr;

	if (jump->flags & JUMP_LABEL)
		jump->flags |= PATCH_MD;
	else
		*(long*)code_ptr = jump->u.target;

	code_ptr += sizeof(long);
	*code_ptr++ = REX_B;
	*code_ptr++ = GROUP_FF;
	*code_ptr++ = (type >= SLJIT_FAST_CALL) ? (MOD_REG | CALL_rm | 1) : (MOD_REG | JMP_rm | 1);

	return code_ptr;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movq %rsi, %rbx
movq %rdi, %r14
cmpl $0x15, %edx
jg 0x1317e
movl %ebp, %edi
xorl $0x1, %edi
callq 0x1b935
addb $-0x10, %al
movb %al, (%rbx)
movb $0xd, 0x1(%rbx)
addq $0x2, %rbx
movw $0xb949, (%rbx)         # imm = 0xB949
leaq 0x2(%rbx), %rax
movq %rax, 0x8(%r14)
movq 0x10(%r14), %rcx
testb $0x1, %cl
jne 0x1319d
movq 0x18(%r14), %rcx
movq %rcx, (%rax)
jmp 0x131a5
orq $0x10, %rcx
movq %rcx, 0x10(%r14)
movw $0xff41, 0xa(%rbx)      # imm = 0xFF41
cmpl $0x17, %ebp
setl %al
shlb $0x4, %al
addb $-0x2f, %al
movb %al, 0xc(%rbx)
addq $0xd, %rbx
movq %rbx, %rax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitLir.c
// Function: ensure_buf
static void* ensure_buf(struct sljit_compiler *compiler, unsigned long size)
{
	u_char *ret;
	struct sljit_memory_fragment *new_frag;

	SLJIT_ASSERT(size <= 256);
	if (compiler->buf->used_size + size <= (BUF_SIZE - (unsigned long)SLJIT_OFFSETOF(struct sljit_memory_fragment, memory))) {
		ret = compiler->buf->memory + compiler->buf->used_size;
		compiler->buf->used_size += size;
		return ret;
	}
	new_frag = malloc(BUF_SIZE);
	PTR_FAIL_IF_NULL(new_frag);
	new_frag->next = compiler->buf;
	compiler->buf = new_frag;
	new_frag->used_size = size;
	return new_frag->memory;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpq $0x101, %rsi            # imm = 0x101
jae 0x135b4
movq %rsi, %rbx
movq %rdi, %r14
movq 0x38(%rdi), %r15
movq 0x8(%r15), %rax
leaq (%rax,%rsi), %rcx
cmpq $0xff0, %rcx            # imm = 0xFF0
ja 0x13585
addq %r15, %rax
addq $0x10, %rax
movq %rcx, 0x8(%r15)
jmp 0x135ae
movl $0x1000, %edi           # imm = 0x1000
callq 0x20e0
testq %rax, %rax
je 0x135a5
movq %r15, (%rax)
movq %rax, 0x38(%r14)
movq %rbx, 0x8(%rax)
addq $0x10, %rax
jmp 0x135ae
movl $0x2, (%r14)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
leaq 0xdd44(%rip), %rdi      # 0x212ff
movl $0x1d7, %esi            # imm = 0x1D7
xorl %eax, %eax
callq 0x2080
callq 0x2040
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_64.c
// Function: emit_load_imm64
static int emit_load_imm64(struct sljit_compiler *compiler, int reg, long imm)
{
	u_char *inst;

	inst = ensure_buf(compiler, 1 + 2 + sizeof(long));
	FAIL_IF(!inst);
	INC_SIZE(2 + sizeof(long));
	*inst++ = REX_W | ((reg_map[reg] <= 7) ? 0 : REX_B);
	*inst++ = MOV_r_i32 + (reg_map[reg] & 0x7);
	*(long*)inst = imm;
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
pushq $0xb
popq %rsi
callq 0x1354f
testq %rax, %rax
je 0x14af5
movb $0xa, (%rax)
addq $0xa, 0x60(%r14)
movslq %ebp, %rcx
leaq 0xc6c4(%rip), %rdx      # 0x21190
movl $0xf10f, %esi           # imm = 0xF10F
btq %rcx, %rsi
setb %sil
xorb $0x49, %sil
movb %sil, 0x1(%rax)
movb (%rcx,%rdx), %cl
andb $0x7, %cl
orb $-0x48, %cl
movb %cl, 0x2(%rax)
movq %rbx, 0x3(%rax)
xorl %eax, %eax
jmp 0x14af8
movl (%r14), %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: emit_mov_half
static int emit_mov_half(struct sljit_compiler *compiler, int sign,
	int dst, long dstw,
	int src, long srcw)
{
	u_char* inst;
	int dst_r;

#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
	compiler->mode32 = 0;
#endif

	if (dst == SLJIT_UNUSED && !(src & SLJIT_MEM))
		return SLJIT_SUCCESS; /* Empty instruction. */

	if (src & SLJIT_IMM) {
		if (FAST_IS_REG(dst)) {
#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
			return emit_do_imm(compiler, MOV_r_i32 + reg_map[dst], srcw);
#else
			inst = emit_x86_instruction(compiler, 1, SLJIT_IMM, srcw, dst, 0);
			FAIL_IF(!inst);
			*inst = MOV_rm_i32;
			return SLJIT_SUCCESS;
#endif
		}
		inst = emit_x86_instruction(compiler, 1 | EX86_HALF_ARG | EX86_NO_REXW | EX86_PREF_66, SLJIT_IMM, srcw, dst, dstw);
		FAIL_IF(!inst);
		*inst = MOV_rm_i32;
		return SLJIT_SUCCESS;
	}

	dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;

	if ((dst & SLJIT_MEM) && FAST_IS_REG(src))
		dst_r = src;
	else {
		inst = emit_x86_instruction(compiler, 2, dst_r, 0, src, srcw);
		FAIL_IF(!inst);
		*inst++ = GROUP_0F;
		*inst = sign ? MOVSX_r_rm16 : MOVZX_r_rm16;
	}

	if (dst & SLJIT_MEM) {
		inst = emit_x86_instruction(compiler, 1 | EX86_NO_REXW | EX86_PREF_66, dst_r, 0, dst, dstw);
		FAIL_IF(!inst);
		*inst = MOV_rm_r;
	}

	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
andl $0x0, 0x70(%rdi)
movl %r8d, %eax
andl $0x80, %eax
xorl %r14d, %r14d
orl %edx, %eax
je 0x15ee8
movq %rcx, %r15
movl %edx, %ebp
movq %rdi, %rbx
testb $0x40, %r8b
jne 0x15e4f
cmpl $0x40, %ebp
pushq $0xe
popq %r12
cmovll %ebp, %r12d
testb %bpl, %bpl
sets %al
cmpl $0x40, %r8d
setl %cl
testb %cl, %al
je 0x15e6b
movl %r8d, %r12d
jmp 0x15e9d
cmpl $0x3f, %ebp
jg 0x15ec2
xorl %r14d, %r14d
pushq $0x1
popq %rsi
pushq $0x40
popq %rdx
movq %rbx, %rdi
movq %r9, %rcx
movl %ebp, %r8d
xorl %r9d, %r9d
jmp 0x15ed6
movl %esi, %r13d
xorl %r14d, %r14d
pushq $0x2
popq %rsi
movq %rbx, %rdi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0x14061
testq %rax, %rax
je 0x15ee5
testl %r13d, %r13d
setne %cl
shlb $0x3, %cl
orb $-0x49, %cl
movb $0xf, (%rax)
movb %cl, 0x1(%rax)
testb %bpl, %bpl
jns 0x15ee8
xorl %r14d, %r14d
movq %rbx, %rdi
movl $0x481, %esi            # imm = 0x481
movl %r12d, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
movq %r15, %r9
callq 0x14061
testq %rax, %rax
je 0x15ee5
movb $-0x77, (%rax)
jmp 0x15ee8
pushq $0x40
popq %rdx
movq %rbx, %rdi
movl $0x681, %esi            # imm = 0x681
movq %r9, %rcx
movl %ebp, %r8d
movq %r15, %r9
callq 0x14061
testq %rax, %rax
je 0x15ee5
movb $-0x39, (%rax)
jmp 0x15ee8
movl (%rbx), %r14d
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_64.c
// Function: emit_mov_int
static int emit_mov_int(struct sljit_compiler *compiler, int sign,
	int dst, long dstw,
	int src, long srcw)
{
	u_char* inst;
	int dst_r;

	compiler->mode32 = 0;

	if (dst == SLJIT_UNUSED && !(src & SLJIT_MEM))
		return SLJIT_SUCCESS; /* Empty instruction. */

	if (src & SLJIT_IMM) {
		if (FAST_IS_REG(dst)) {
			if (sign || ((unsigned long)srcw <= 0x7fffffff)) {
				inst = emit_x86_instruction(compiler, 1, SLJIT_IMM, (long)(int)srcw, dst, dstw);
				FAIL_IF(!inst);
				*inst = MOV_rm_i32;
				return SLJIT_SUCCESS;
			}
			return emit_load_imm64(compiler, dst, srcw);
		}
		compiler->mode32 = 1;
		inst = emit_x86_instruction(compiler, 1, SLJIT_IMM, (long)(int)srcw, dst, dstw);
		FAIL_IF(!inst);
		*inst = MOV_rm_i32;
		compiler->mode32 = 0;
		return SLJIT_SUCCESS;
	}

	dst_r = FAST_IS_REG(dst) ? dst : TMP_REG1;

	if ((dst & SLJIT_MEM) && FAST_IS_REG(src))
		dst_r = src;
	else {
		if (sign) {
			inst = emit_x86_instruction(compiler, 1, dst_r, 0, src, srcw);
			FAIL_IF(!inst);
			*inst++ = MOVSXD_r_rm;
		} else {
			compiler->mode32 = 1;
			FAIL_IF(emit_mov(compiler, dst_r, 0, src, srcw));
			compiler->mode32 = 0;
		}
	}

	if (dst & SLJIT_MEM) {
		compiler->mode32 = 1;
		inst = emit_x86_instruction(compiler, 1, dst_r, 0, dst, dstw);
		FAIL_IF(!inst);
		*inst = MOV_rm_r;
		compiler->mode32 = 0;
	}

	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
andl $0x0, 0x70(%rdi)
movl %r8d, %eax
andl $0x80, %eax
xorl %ebx, %ebx
orl %edx, %eax
je 0x16045
movq %rcx, %r15
movl %edx, %ebp
movq %rdi, %r14
testb $0x40, %r8b
jne 0x15f4a
cmpl $0x40, %ebp
pushq $0xe
popq %r12
cmovll %ebp, %r12d
testb %bpl, %bpl
sets %al
cmpl $0x40, %r8d
setl %cl
testb %cl, %al
je 0x15f8a
movl %r8d, %r12d
jmp 0x16013
cmpl $0x3f, %ebp
jg 0x15fac
testl %esi, %esi
sete %al
cmpq $0x7fffffff, %r9        # imm = 0x7FFFFFFF
seta %cl
testb %cl, %al
jne 0x15fd5
movslq %r9d, %rcx
pushq $0x1
popq %rsi
pushq $0x40
popq %rdx
movq %r14, %rdi
movl %ebp, %r8d
movq %r15, %r9
callq 0x14061
testq %rax, %rax
je 0x16042
movb $-0x39, (%rax)
jmp 0x16045
testl %esi, %esi
je 0x15fea
pushq $0x1
popq %rsi
movq %r14, %rdi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0x14061
testq %rax, %rax
je 0x16042
movb $0x63, (%rax)
jmp 0x1600e
movl $0x1, 0x70(%r14)
movslq %r9d, %rcx
pushq $0x1
popq %rsi
pushq $0x40
popq %rdx
movq %r14, %rdi
movl %ebp, %r8d
movq %r15, %r9
callq 0x14061
testq %rax, %rax
je 0x16042
movb $-0x39, (%rax)
jmp 0x1603b
movq %r14, %rdi
movl %ebp, %esi
movq %r9, %rdx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x14aa1
movl $0x1, 0x70(%r14)
movq %r14, %rdi
movl %r12d, %esi
xorl %edx, %edx
movl %r8d, %ecx
movq %r9, %r8
callq 0x14d14
testl %eax, %eax
jne 0x16042
andl $0x0, 0x70(%r14)
testb %bpl, %bpl
jns 0x16045
movl $0x1, 0x70(%r14)
xorl %ebx, %ebx
pushq $0x1
popq %rsi
movq %r14, %rdi
movl %r12d, %edx
xorl %ecx, %ecx
movl %ebp, %r8d
movq %r15, %r9
callq 0x14061
testq %rax, %rax
je 0x16042
movb $-0x77, (%rax)
andl $0x0, 0x70(%r14)
jmp 0x16045
movl (%r14), %ebx
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: emit_unary
static int emit_unary(struct sljit_compiler *compiler, u_char opcode,
	int dst, long dstw,
	int src, long srcw)
{
	u_char* inst;

	if (dst == SLJIT_UNUSED) {
		EMIT_MOV(compiler, TMP_REG1, 0, src, srcw);
		inst = emit_x86_instruction(compiler, 1, 0, 0, TMP_REG1, 0);
		FAIL_IF(!inst);
		*inst++ = GROUP_F7;
		*inst |= opcode;
		return SLJIT_SUCCESS;
	}
	if (dst == src && dstw == srcw) {
		/* Same input and output */
		inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
		FAIL_IF(!inst);
		*inst++ = GROUP_F7;
		*inst |= opcode;
		return SLJIT_SUCCESS;
	}
	if (FAST_IS_REG(dst)) {
		EMIT_MOV(compiler, dst, 0, src, srcw);
		inst = emit_x86_instruction(compiler, 1, 0, 0, dst, dstw);
		FAIL_IF(!inst);
		*inst++ = GROUP_F7;
		*inst |= opcode;
		return SLJIT_SUCCESS;
	}
	EMIT_MOV(compiler, TMP_REG1, 0, src, srcw);
	inst = emit_x86_instruction(compiler, 1, 0, 0, TMP_REG1, 0);
	FAIL_IF(!inst);
	*inst++ = GROUP_F7;
	*inst |= opcode;
	EMIT_MOV(compiler, dst, dstw, TMP_REG1, 0);
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
testl %edx, %edx
je 0x1608c
movq %rcx, %r15
movl %edx, %r12d
cmpl %r8d, %edx
setne %al
cmpq %r9, %rcx
setne %cl
orb %al, %cl
jne 0x160ca
xorl %r14d, %r14d
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
movl %r12d, %r8d
movq %r15, %r9
jmp 0x160b7
pushq $0xe
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl %r8d, %ecx
movq %r9, %r8
callq 0x14d14
testl %eax, %eax
jne 0x16100
xorl %r14d, %r14d
pushq $0x1
popq %rsi
pushq $0xe
popq %r8
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x14061
testq %rax, %rax
je 0x16100
movb $-0x9, (%rax)
orb %bpl, 0x1(%rax)
jmp 0x16103
cmpl $0x3f, %r12d
jg 0x160e9
movq %rbx, %rdi
movl %r12d, %esi
xorl %edx, %edx
movl %r8d, %ecx
movq %r9, %r8
callq 0x14d14
testl %eax, %eax
jne 0x16100
jmp 0x16077
pushq $0xe
popq %rsi
movq %rbx, %rdi
xorl %edx, %edx
movl %r8d, %ecx
movq %r9, %r8
callq 0x14d14
testl %eax, %eax
je 0x1610f
movl (%rbx), %r14d
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r14d, %r14d
pushq $0x1
popq %rsi
pushq $0xe
popq %r8
movq %rbx, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r9d, %r9d
callq 0x14061
testq %rax, %rax
je 0x16100
movb $-0x9, (%rax)
orb %bpl, 0x1(%rax)
pushq $0xe
popq %rcx
movq %rbx, %rdi
movl %r12d, %esi
movq %r15, %rdx
xorl %r8d, %r8d
callq 0x14d14
testl %eax, %eax
jne 0x16100
jmp 0x16103
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: emit_restore_flags
static __inline int emit_restore_flags(struct sljit_compiler *compiler, int keep_flags)
{
	u_char *inst;

#if (defined SLJIT_CONFIG_X86_32 && SLJIT_CONFIG_X86_32)
	inst = ensure_buf(compiler, 1 + 5);
	FAIL_IF(!inst);
	INC_SIZE(5);
	*inst++ = POPF;
#else
	inst = ensure_buf(compiler, 1 + 6);
	FAIL_IF(!inst);
	INC_SIZE(6);
	*inst++ = POPF;
	*inst++ = REX_W;
#endif
	*inst++ = LEA_r_m; /* lea esp/rsp, [esp/rsp - sizeof(long)] */
	*inst++ = 0x64;
	*inst++ = 0x24;
	*inst++ = (u_char)-(s_char)sizeof(long);
	compiler->flags_saved = keep_flags;
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
pushq $0x7
popq %rsi
callq 0x1354f
testq %rax, %rax
je 0x17b79
movb $0x6, (%rax)
addq $0x6, 0x60(%rbx)
movl $0x648d489d, 0x1(%rax)  # imm = 0x648D489D
movw $0xf824, 0x5(%rax)      # imm = 0xF824
movl %ebp, 0x74(%rbx)
xorl %eax, %eax
jmp 0x17b7b
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: emit_shift_with_flags
static int emit_shift_with_flags(struct sljit_compiler *compiler,
	u_char mode, int set_flags,
	int dst, long dstw,
	int src1, long src1w,
	int src2, long src2w)
{
	/* The CPU does not set flags if the shift count is 0. */
	if (src2 & SLJIT_IMM) {
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
		if ((src2w & 0x3f) != 0 || (compiler->mode32 && (src2w & 0x1f) != 0))
			return emit_shift(compiler, mode, dst, dstw, src1, src1w, src2, src2w);
#else
		if ((src2w & 0x1f) != 0)
			return emit_shift(compiler, mode, dst, dstw, src1, src1w, src2, src2w);
#endif
		if (!set_flags)
			return emit_mov(compiler, dst, dstw, src1, src1w);
		/* OR dst, src, 0 */
		return emit_cum_binary(compiler, OR_r_rm, OR_rm_r, OR, OR_EAX_i32,
			dst, dstw, src1, src1w, SLJIT_IMM, 0);
	}

	if (!set_flags)
		return emit_shift(compiler, mode, dst, dstw, src1, src1w, src2, src2w);

	if (!FAST_IS_REG(dst))
		FAIL_IF(emit_cmp_binary(compiler, src1, src1w, SLJIT_IMM, 0));

	FAIL_IF(emit_shift(compiler,mode, dst, dstw, src1, src1w, src2, src2w));

	if (FAST_IS_REG(dst))
		return emit_cmp_binary(compiler, dst, dstw, SLJIT_IMM, 0);
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r10d
movq %r8, %rax
movl %ecx, %ebp
movl %esi, %r13d
movq %rdi, %r15
movq 0x60(%rsp), %r14
movl 0x58(%rsp), %ebx
movq 0x50(%rsp), %r12
testb $0x40, %bl
jne 0x18211
testl %edx, %edx
je 0x18217
cmpl $0x40, %ebp
jl 0x181e5
pushq $0x40
popq %rcx
movq %r15, %rdi
movl %r10d, %esi
movq %r12, %rdx
xorl %r8d, %r8d
movq %rax, 0x10(%rsp)
movq %r10, 0x8(%rsp)
callq 0x17b82
movq 0x8(%rsp), %r10
testl %eax, %eax
movq 0x10(%rsp), %rax
jne 0x18208
movzbl %r13b, %esi
movq %r15, %rdi
movl %ebp, %edx
movq %rax, %rcx
movl %r10d, %r8d
movq %r12, %r9
pushq %r14
pushq %rbx
movq %rax, %rbx
callq 0x1ce1d
popq %rcx
popq %rdx
testl %eax, %eax
je 0x1826f
movl (%r15), %eax
addq $0x18, %rsp
jmp 0x18235
testb $0x3f, %r14b
je 0x18240
movzbl %r13b, %esi
movq %r15, %rdi
movl %ebp, %edx
movq %rax, %rcx
movl %r10d, %r8d
movq %r12, %r9
pushq %r14
pushq %rbx
callq 0x1ce1d
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %edx, %edx
je 0x18297
subq $0x8, %rsp
pushq $0xb
popq %rsi
pushq $0x9
popq %rdx
pushq $0x8
popq %rcx
pushq $0xd
popq %r8
movq %r15, %rdi
movl %ebp, %r9d
pushq $0x0
pushq $0x40
pushq %r12
pushq %r10
pushq %rax
callq 0x17651
addq $0x48, %rsp
jmp 0x18235
xorl %eax, %eax
cmpl $0x3f, %ebp
jg 0x1820b
movq %rbx, %rdx
pushq $0x40
popq %rcx
movq %r15, %rdi
movl %ebp, %esi
xorl %r8d, %r8d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17b82
movq %r15, %rdi
movl %ebp, %esi
movq %rax, %rdx
movl %r10d, %ecx
movq %r12, %r8
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14d14
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: sljit_emit_op_custom
int sljit_emit_op_custom(struct sljit_compiler *compiler,
	void *instruction, int size)
{
	u_char *inst;

	CHECK_ERROR();
	CHECK(check_sljit_emit_op_custom(compiler, instruction, size));

	inst = ensure_buf(compiler, 1 + size);
	FAIL_IF(!inst);
	INC_SIZE(size);
	memmove(inst, instruction, size);
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %eax
testl %eax, %eax
jne 0x183bd
movq %rsi, %rbx
testq %rsi, %rsi
je 0x183cc
movl %edx, %r15d
leal -0x1(%r15), %eax
cmpl $0xf, %eax
jae 0x183da
movq %rdi, %r14
movq 0x78(%rdi), %rcx
movl %r15d, %r12d
testq %rcx, %rcx
je 0x1838d
leaq 0x91ec(%rip), %rdi      # 0x2153e
pushq $0xb
popq %rsi
pushq $0x1
popq %rdx
callq 0x2130
leaq 0x91e6(%rip), %r13      # 0x2154a
xorl %ebp, %ebp
movq 0x78(%r14), %rsi
cmpq %rbp, %r12
je 0x18385
movzbl (%rbx,%rbp), %edx
movq %rsi, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x20c0
incq %rbp
jmp 0x18366
pushq $0xa
popq %rdi
callq 0x20a0
leal 0x1(%r15), %esi
movq %r14, %rdi
callq 0x1354f
testq %rax, %rax
je 0x183ba
movq %rax, %rdi
incq %rdi
movb %r15b, (%rax)
addq %r12, 0x60(%r14)
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2110
xorl %eax, %eax
jmp 0x183bd
movl (%r14), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8f2c(%rip), %rdi      # 0x212ff
movl $0x45e, %esi            # imm = 0x45E
jmp 0x183e6
leaq 0x8f1e(%rip), %rdi      # 0x212ff
movl $0x460, %esi            # imm = 0x460
xorl %eax, %eax
callq 0x2080
callq 0x2040
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: emit_sse2_logic
static int emit_sse2_logic(struct sljit_compiler *compiler, u_char opcode,
	int pref66, int xmm1, int xmm2, long xmm2w)
{
	u_char *inst;

	inst = emit_x86_instruction(compiler, 2 | (pref66 ? EX86_PREF_66 : 0) | EX86_SSE2, xmm1, 0, xmm2, xmm2w);
	FAIL_IF(!inst);
	*inst++ = GROUP_0F;
	*inst = opcode;
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %esi, %esi
testl %edx, %edx
setne %sil
shll $0xa, %esi
orl $0x6002, %esi           # imm = 0x6002
xorl %r15d, %r15d
movl %ecx, %edx
xorl %ecx, %ecx
callq 0x14061
testq %rax, %rax
je 0x1a076
movb $0xf, (%rax)
movb %bl, 0x1(%rax)
jmp 0x1a079
movl (%r14), %r15d
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: emit_sse2
static int emit_sse2(struct sljit_compiler *compiler, u_char opcode,
	int single, int xmm1, int xmm2, long xmm2w)
{
	u_char *inst;

	inst = emit_x86_instruction(compiler, 2 | (single ? EX86_PREF_F3 : EX86_PREF_F2) | EX86_SSE2, xmm1, 0, xmm2, xmm2w);
	FAIL_IF(!inst);
	*inst++ = GROUP_0F;
	*inst = opcode;
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %esi, %esi
testl %edx, %edx
setne %sil
shll $0xb, %esi
addl $0x6802, %esi           # imm = 0x6802
xorl %r15d, %r15d
movl %ecx, %edx
xorl %ecx, %ecx
callq 0x14061
testq %rax, %rax
je 0x1aa67
movb $0xf, (%rax)
movb %bl, 0x1(%rax)
jmp 0x1aa6a
movl (%r14), %r15d
movl %r15d, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_common.c
// Function: sljit_emit_label
struct sljit_label* sljit_emit_label(struct sljit_compiler *compiler)
{
	u_char *inst;
	struct sljit_label *label;

	CHECK_ERROR_PTR();
	CHECK_PTR(check_sljit_emit_label(compiler));

	/* We should restore the flags before the label,
	   since other taken jumps has their own flags as well. */
	if (compiler->flags_saved) {
		if (emit_restore_flags(compiler, 0))
			return NULL;
	}

	if (compiler->last_label && compiler->last_label->size == compiler->size)
		return compiler->last_label;

	label = ensure_abuf(compiler, sizeof(struct sljit_label));
	if (!label)
		return NULL;
	set_label(label, compiler);

	inst = ensure_buf(compiler, 2);
	if (!inst)
		return NULL;

	*inst++ = 0;
	*inst++ = 0;

	return label;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpl $0x0, (%rdi)
je 0x1aa8a
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rdi, %rbx
movq 0x78(%rdi), %rcx
testq %rcx, %rcx
je 0x1aaa8
leaq 0x6afd(%rip), %rdi      # 0x2159a
pushq $0x7
popq %rsi
pushq $0x1
popq %rdx
callq 0x2130
cmpl $0x0, 0x74(%rbx)
je 0x1aabf
xorl %r14d, %r14d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x17b48
testl %eax, %eax
jne 0x1aa7f
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x1aad2
movq 0x10(%r14), %rax
cmpq 0x60(%rbx), %rax
je 0x1aa7f
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0x12cc6
testq %rax, %rax
je 0x1aa7c
movq %rax, %r14
andq $0x0, (%rax)
movq 0x60(%rbx), %rax
movq %rax, 0x10(%r14)
movq 0x20(%rbx), %rax
leaq 0x8(%rbx), %rcx
testq %rax, %rax
cmovneq %rax, %rcx
movq %r14, (%rcx)
movq %r14, 0x20(%rbx)
pushq $0x2
popq %rsi
movq %rbx, %rdi
callq 0x1354f
testq %rax, %rax
je 0x1aa7c
andw $0x0, (%rax)
jmp 0x1aa7f
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_64.c
// Function: call_with_args
static __inline int call_with_args(struct sljit_compiler *compiler, int type)
{
	u_char *inst;

#ifndef _WIN64
	SLJIT_COMPILE_ASSERT(reg_map[SLJIT_R1] == 6 && reg_map[SLJIT_R0] < 8 && reg_map[SLJIT_R2] < 8, args_regs);

	inst = ensure_buf(compiler, 1 + ((type < SLJIT_CALL3) ? 3 : 6));
	FAIL_IF(!inst);
	INC_SIZE((type < SLJIT_CALL3) ? 3 : 6);
	if (type >= SLJIT_CALL3) {
		*inst++ = REX_W;
		*inst++ = MOV_r_rm;
		*inst++ = MOD_REG | (0x2 /* rdx */ << 3) | reg_lmap[SLJIT_R2];
	}
	*inst++ = REX_W;
	*inst++ = MOV_r_rm;
	*inst++ = MOD_REG | (0x7 /* rdi */ << 3) | reg_lmap[SLJIT_R0];
#else
	SLJIT_COMPILE_ASSERT(reg_map[SLJIT_R1] == 2 && reg_map[SLJIT_R0] < 8 && reg_map[SLJIT_R2] < 8, args_regs);

	inst = ensure_buf(compiler, 1 + ((type < SLJIT_CALL3) ? 3 : 6));
	FAIL_IF(!inst);
	INC_SIZE((type < SLJIT_CALL3) ? 3 : 6);
	if (type >= SLJIT_CALL3) {
		*inst++ = REX_W | REX_R;
		*inst++ = MOV_r_rm;
		*inst++ = MOD_REG | (0x0 /* r8 */ << 3) | reg_lmap[SLJIT_R2];
	}
	*inst++ = REX_W;
	*inst++ = MOV_r_rm;
	*inst++ = MOD_REG | (0x1 /* rcx */ << 3) | reg_lmap[SLJIT_R0];
#endif
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
xorl %r15d, %r15d
cmpl $0x1b, %esi
setge %r15b
leal (%r15,%r15,2), %esi
addl $0x4, %esi
callq 0x1354f
testq %rax, %rax
je 0x1ad23
leal (%r15,%r15,2), %ecx
addl $0x3, %ecx
movb %cl, (%rax)
movl %ecx, %ecx
addq %rcx, 0x60(%r14)
cmpl $0x1b, %ebx
jl 0x1ad28
movw $0x8b48, 0x1(%rax)      # imm = 0x8B48
movb $-0x2f, 0x3(%rax)
addq $0x4, %rax
jmp 0x1ad2b
movl (%r14), %eax
jmp 0x1ad36
incq %rax
movw $0x8b48, (%rax)         # imm = 0x8B48
movb $-0x8, 0x2(%rax)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/mmcco[P]sljit/sljit_src/sljitNativeX86_64.c
// Function: emit_do_imm32
static int emit_do_imm32(struct sljit_compiler *compiler, u_char rex, u_char opcode, long imm)
{
	u_char *inst;
	int length = 1 + (rex ? 1 : 0) + sizeof(int);

	inst = ensure_buf(compiler, 1 + length);
	FAIL_IF(!inst);
	INC_SIZE(length);
	if (rex)
		*inst++ = rex;
	*inst++ = opcode;
	*(int*)inst = imm;
	return SLJIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %r15
xorl %r12d, %r12d
testl %esi, %esi
sete %r12b
movl %r12d, %esi
xorl $0x7, %esi
callq 0x1354f
testq %rax, %rax
je 0x1ce04
pushq $0x6
popq %rcx
subl %r12d, %ecx
movb %cl, (%rax)
movl %ecx, %ecx
addq %rcx, 0x60(%r15)
testb %r14b, %r14b
je 0x1ce09
movb %r14b, 0x1(%rax)
addq $0x2, %rax
jmp 0x1ce0c
movl (%r15), %eax
jmp 0x1ce14
incq %rax
movb %bpl, (%rax)
movl %ebx, 0x1(%rax)
xorl %eax, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: newNode
node* newNode(int id, pid_t pid, char* name) {
  node* Node = (node*) malloc(sizeof(node));
  Node->id = id;
  Node->pid = pid;
  Node->priority = 0; // All processes are initiated with LOW priority.
  // Copy name to the struct
  Node->name = strdup(name);
  return Node;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r14d
pushq $0x28
popq %rdi
callq 0x11a0
movq %rax, %r15
movl %r14d, (%rax)
movl %ebp, 0x4(%rax)
andl $0x0, 0x10(%rax)
movq %rbx, %rdi
callq 0x1220
movq %rax, 0x8(%r15)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: addNode
node* addNode(node* list, pid_t pid, char* name) {
  node* head = list;
  if (head == NULL) {
    head = newNode(0, pid, name);
    head->next = head;
    head->prev = head;
  } else {
    while (list->next != head) {
      list = list->next;
    }
    list->next = newNode(list->id + 1, pid, name);
    list->next->next = head;
    list->next->prev = list;
    head->prev = list->next;
  }
  return head;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x13cd
movq %rdi, %rbx
movq %rdi, %rax
movq %rax, %r14
movq 0x18(%rax), %rax
cmpq %rbx, %rax
jne 0x13a9
movl (%r14), %edi
incl %edi
callq 0x135c
movq %rax, 0x18(%r14)
movq %rbx, 0x18(%rax)
movq %r14, 0x20(%rax)
jmp 0x13db
xorl %edi, %edi
callq 0x135c
movq %rax, %rbx
movq %rax, 0x18(%rax)
movq %rax, 0x20(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: printList
void printList(node* list) {
  node* head = list;
  char priority[5];
  do {
    if (list->priority) {
      strcpy(priority, "HIGH");
    } else {
      strcpy(priority, "LOW");
    }
    printf("id: %d\tpid: %d\tname: %s\tpriority: %s\n", list->id, list->pid, list->name, priority);
    list = list->next;
  } while (list != head);
  printf("\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xc21(%rip), %r14       # 0x201d
movq %rsp, %r15
movq %rdi, %r12
cmpl $0x0, 0x10(%r12)
je 0x1418
movb $0x0, 0x4(%rsp)
movl $0x48474948, (%rsp)     # imm = 0x48474948
jmp 0x141f
movl $0x574f4c, (%rsp)       # imm = 0x574F4C
movl (%r12), %esi
movl 0x4(%r12), %edx
movq 0x8(%r12), %rcx
movq %r14, %rdi
movq %r15, %r8
xorl %eax, %eax
callq 0x10d0
movq 0x18(%r12), %r12
cmpq %rbx, %r12
jne 0x1402
pushq $0xa
popq %rdi
callq 0x1060
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: deleteNode
node* deleteNode(node* list, pid_t pid, int id) {
  // Search by pid
  node* head = list;
  if (id == -1) {
    if (list->pid == pid) {
      disconnectNode(list);
      head = list->next;
      free(list);
      return head;
    }
    list = list->next;
    while (list != head) {
      if (list->pid == pid) {
        disconnectNode(list);
        free(list);
        break;
      }
      list = list->next;
    }
  } else {
    // Search by id
    if (list->id == id) {
      list->next->prev = head->prev;
      head->prev->next = list->next;
      head = list->next;
      free(list);
      return head;
    }
    list = list->next;
    while (list != head) {
      if (list->id == id) {
        list->prev->next = list->next;
        list->next->prev = list->prev;
        free(list);
        break;
      }
      list = list->next;
    }
  }
  return head;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpl $-0x1, %edx
je 0x148b
cmpl %edx, (%rbx)
jne 0x14a5
movq 0x20(%rbx), %rax
movq %rbx, %rdi
movq 0x18(%rbx), %rbx
movq %rax, 0x20(%rbx)
movq %rbx, 0x18(%rax)
jmp 0x14d8
cmpl %esi, 0x4(%rbx)
jne 0x14b7
movq 0x20(%rbx), %rax
movq %rbx, %rdi
movq 0x18(%rbx), %rbx
movq %rbx, 0x18(%rax)
movq %rax, 0x20(%rbx)
jmp 0x14d8
movq %rbx, %rdi
movq 0x18(%rdi), %rdi
cmpq %rbx, %rdi
je 0x14dd
cmpl %edx, (%rdi)
jne 0x14a8
jmp 0x14c8
movq %rbx, %rdi
movq 0x18(%rdi), %rdi
cmpq %rbx, %rdi
je 0x14dd
cmpl %esi, 0x4(%rdi)
jne 0x14ba
movq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
movq %rax, 0x18(%rcx)
movq %rcx, 0x20(%rax)
callq 0x1050
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: accessNode
node* accessNode(node* list, pid_t pid, int id) {
  node* head = list;
  if (id == -1 && pid >= 0) {
    do {
      if (list->pid == pid) {
        return list;
      }
      list = list->next;
    } while (list != head);
    printf("Error: The node with pid: %d, doesn't exist!\n", pid);
  } else {
    do {
      if (list->id == id) {
        return list;
      }
      list = list->next;
    } while (list != head);
    printf("Error: The node with id: %d, doesn't exist!\n", id);
  }
  return NULL;
}

// Assembly:
pushq %rbx
cmpl $-0x1, %edx
sete %al
testl %esi, %esi
setns %cl
movq %rdi, %rbx
testb %al, %cl
je 0x150e
cmpl %esi, 0x4(%rbx)
je 0x152d
movq 0x18(%rbx), %rbx
cmpq %rdi, %rbx
jne 0x14f5
leaq 0xb39(%rip), %rdi       # 0x2043
xorl %ebx, %ebx
jmp 0x1526
cmpl %edx, (%rbx)
je 0x152d
movq 0x18(%rbx), %rbx
cmpq %rdi, %rbx
jne 0x150e
leaq 0xb4f(%rip), %rdi       # 0x2071
xorl %ebx, %ebx
movl %edx, %esi
xorl %eax, %eax
callq 0x10d0
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: sched_create_task
static void sched_create_task(char *executable) {
	pid_t pid = fork();
	if (pid < 0) {
		// Error code
		perror("fork");
	} else if (pid == 0) {
		// Child process code
		free(proc_list);
		char *newargv[] = { executable, NULL, NULL, NULL };
		char *newenviron[] = { NULL };
		raise(SIGSTOP);
		execve(executable, newargv, newenviron);
		// Unreachable point. Execve only returns on error.
		perror("execve");
		exit(1);
	} else {
		// Parent Code
		proc_list = addNode(proc_list, pid, executable);
		nproc++;  /* number of proccesses goes here */
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
callq 0x1250
testl %eax, %eax
js 0x1a2f
movq 0x273c(%rip), %rdi      # 0x4148
je 0x1a44
movl %eax, %esi
movq %rbx, %rdx
callq 0x139a
movq %rax, 0x2729(%rip)      # 0x4148
incl 0x2733(%rip)            # 0x4158
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x699(%rip), %rdi       # 0x20cf
addq $0x30, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x11d0
callq 0x1050
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movq %rbx, (%r14)
leaq 0x8(%rsp), %r15
andq $0x0, (%r15)
pushq $0x13
popq %rdi
callq 0x1040
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1130
leaq 0x668(%rip), %rdi       # 0x20eb
callq 0x11d0
pushq $0x1
popq %rdi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O2/chrispanag[P]operating-systems-scheduler/scheduler-shell.c
// Function: do_shell
static void do_shell(char *executable, int wfd, int rfd) {
	char arg1[10], arg2[10];
	char *newargv[] = { executable, NULL, NULL, NULL };
	char *newenviron[] = { NULL };

	sprintf(arg1, "%05d", wfd);
	sprintf(arg2, "%05d", rfd);
	newargv[1] = arg1;
	newargv[2] = arg2;

	raise(SIGSTOP);
	execve(executable, newargv, newenviron);

	/* execve() only returns on error */
	perror("scheduler: child: execve");
	exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebp
movl %edi, %edx
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %rbx
movaps %xmm0, 0x10(%rbx)
leaq 0x6be(%rip), %rax       # 0x2173
movq %rax, (%rbx)
movq %rsp, %r15
andq $0x0, (%r15)
leaq 0x60e(%rip), %r12       # 0x20d4
leaq 0x16(%rsp), %r13
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x11f0
leaq 0xc(%rsp), %r14
movq %r14, %rdi
movq %r12, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x11f0
movq %r13, 0x8(%rbx)
movq %r14, 0x10(%rbx)
pushq $0x13
popq %rdi
callq 0x1040
leaq 0x670(%rip), %rdi       # 0x2173
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1130
leaq 0x5c4(%rip), %rdi       # 0x20d9
callq 0x11d0
pushq $0x1
popq %rdi
callq 0x1200
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/./evec.h
// Function: evdumphdr
void _evdumphdr(int ln, char* fn, const char* fu, evhd_t* hdr)
{
    dprintf(STDERR_FILENO,"[HEADER :   %s:%i:%s()] ", basename(fn), ln, fu);
    dprintf(STDERR_FILENO,"magic1: %s, ", hdr->magic1);
    dprintf(STDERR_FILENO,"slt_size: %" PRId64 ", ", hdr->slt_size);
    dprintf(STDERR_FILENO,"slt_count: %" PRId64 ", ", hdr->slt_count);
    dprintf(STDERR_FILENO,"obj_count: %" PRId64 ", ", hdr->obj_count);
    dprintf(STDERR_FILENO,"magic2: %s\n", hdr->magic2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movl %edi, %r15d
movq %rsi, %rdi
callq 0x10d0
leaq 0x1dc9(%rip), %rsi      # 0x3004
pushq $0x2
popq %rbp
movl %ebp, %edi
movq %rax, %rdx
movl %r15d, %ecx
movq %r14, %r8
xorl %eax, %eax
callq 0x1090
leaq 0x1dc6(%rip), %rsi      # 0x301d
movl %ebp, %edi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1090
movq 0x8(%rbx), %rdx
leaq 0x1dbc(%rip), %rsi      # 0x302a
movl %ebp, %edi
xorl %eax, %eax
callq 0x1090
movq 0x18(%rbx), %rdx
leaq 0x1db8(%rip), %rsi      # 0x303a
movl %ebp, %edi
xorl %eax, %eax
callq 0x1090
movq 0x10(%rbx), %rdx
leaq 0x1db5(%rip), %rsi      # 0x304b
movl %ebp, %edi
xorl %eax, %eax
callq 0x1090
addq $0x28, %rbx
leaq 0x1db2(%rip), %rsi      # 0x305c
movl %ebp, %edi
movq %rbx, %rdx
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1090
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/./evec.h
// Function: evini
void* evini(size_t slt_size, size_t count)
{
    size_t store_bytes  = count * slt_size;
    size_t full_bytes = EV_HDR_BYTES + store_bytes;

    evhd_t *hdr = (evhd_t*)malloc(full_bytes);
    ifp(!hdr,
        EV_FAIL("No memory to init vector with %" PRId64 "B\n", full_bytes);
                return NULL;
    );


    memset(hdr,0x00,full_bytes);

    memcpy(hdr->magic1,EV_MAGIC1,sizeof(hdr->magic1));
    hdr->slt_size   = slt_size;
    hdr->slt_count  = count;
    hdr->obj_count  = 0;
    memcpy(hdr->magic2,EV_MAGIC2,sizeof(hdr->magic2));

    void *vec_start = (char*)hdr + EV_HDR_BYTES;
    return vec_start;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rbx
imulq %rdi, %rbx
addq $0x30, %rbx
pushq $0x1
popq %rdi
movq %rbx, %rsi
callq 0x10a0
testq %rax, %rax
je 0x131b
movabsq $0x434947414d5645, %rcx # imm = 0x434947414D5645
movq %rcx, (%rax)
movq %r15, 0x8(%rax)
movq %r14, 0x18(%rax)
movabsq $0x5645434947414d, %rcx # imm = 0x5645434947414D
movq %rcx, 0x28(%rax)
addq $0x30, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1e43(%rip), %rax      # 0x3165
movq %rax, (%rsp)
leaq 0x1d44(%rip), %rcx      # 0x3071
leaq 0x1d43(%rip), %r8       # 0x3077
movl $0x1d3, %esi            # imm = 0x1D3
movq %rbx, %r9
xorl %eax, %eax
callq 0x1343
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/./evec.h
// Function: evmsg
static inline void _evmsg(evdbg_e mode, int ln, char* fn, const char* fu, const char* msg, ... )
{
    va_list args;
    va_start(args,msg);
    char* mode_str = NULL;
    switch(mode){
        case EV_MSG_ERR:   mode_str = "Error  :"; break;
        case EV_MSG_DBG:   mode_str = "Debug  :"; break;
        case EV_MSG_WARN:  mode_str = "Warning:"; break;
    }
    dprintf(STDERR_FILENO,"[%s %s:%i:%s()]  ", mode_str, basename(fn), ln, fu);
    vdprintf(STDERR_FILENO,msg,args);

    if(mode == EV_MSG_ERR && EV_HARD_EXIT){
        exit(0xDEAD);
    }
    va_end(args);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %r8, %rbx
movq %rcx, %r14
movl %esi, %ebp
leaq 0x20(%rsp), %rcx
movq %r9, 0x28(%rcx)
testb %al, %al
je 0x139e
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r15
movq %rcx, 0x10(%r15)
leaq 0x100(%rsp), %rax
movq %rax, 0x8(%r15)
movabsq $0x3000000028, %rax     # imm = 0x3000000028
movq %rax, (%r15)
leaq 0x1ca3(%rip), %rdi      # 0x3068
callq 0x10d0
leaq 0x213c(%rip), %rsi      # 0x350d
leaq 0x212c(%rip), %rdx      # 0x3504
pushq $0x2
popq %r12
movl %r12d, %edi
movq %rax, %rcx
movl %ebp, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0x1090
movl %r12d, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x10f0
movl $0xdead, %edi           # imm = 0xDEAD
callq 0x1100
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/./evec.h
// Function: evhdrcheck
int _evhdrcheck(evhd_t* hdr)
{
    if(strncmp(hdr->magic1, EV_MAGIC1, sizeof(EV_MAGIC1)) != 0){
        EV_FAIL("Header magic 1 should be '%s' but found '%.*s'\n", EV_MAGIC1, sizeof(EV_MAGIC1), hdr->magic1);
        return -1;
    };
    if(strncmp(hdr->magic2, EV_MAGIC2, sizeof(EV_MAGIC2)) != 0){
        EV_FAIL("Header magic 2 should be '%s' but found '%.*s'\n", EV_MAGIC2, sizeof(EV_MAGIC2), hdr->magic2);
        return -1;
    };

    if(hdr->obj_count < 0){
        EV_FAIL("Object count cannot be less than zero!\n");
        return -1;
    }

    if(hdr->index < 0){
        EV_FAIL("Index value cannot be less than zero!\n");
        return -1;
    }

    if(hdr->slt_count < 0){
        EV_FAIL("Slot count cannot be less than zero\n");
        return -1;
    }

    if(hdr->obj_count > hdr->slt_count){
        EV_FAIL("More items in vector (%" PRId64 ") than there is space (%" PRId64 ")\n",
                hdr->obj_count,
                hdr->slt_count);
        return -1;
    }

    if(hdr->slt_size < 0){
        EV_FAIL("Slot size cannot be less than zero\n");
        return -1;
    }

    return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1c86(%rip), %rsi      # 0x309b
pushq $0x8
popq %rdx
callq 0x1040
testl %eax, %eax
jne 0x147e
leaq 0x28(%rbx), %r14
leaq 0x1c77(%rip), %rsi      # 0x30a3
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x1040
testl %eax, %eax
jne 0x14a9
movq 0x10(%rbx), %r9
testq %r9, %r9
js 0x14da
cmpq $0x0, 0x20(%rbx)
js 0x14f6
movq 0x18(%rbx), %rdx
testq %rdx, %rdx
js 0x1512
cmpq %rdx, %r9
ja 0x152e
cmpq $0x0, 0x8(%rbx)
js 0x1551
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
subq $0x8, %rsp
leaq 0x1cdc(%rip), %rdx      # 0x3165
leaq 0x1c1b(%rip), %rcx      # 0x30ab
leaq 0x1c20(%rip), %r8       # 0x30b7
leaq 0x1bfd(%rip), %r9       # 0x309b
movl $0x1e8, %esi            # imm = 0x1E8
xorl %eax, %eax
pushq %rdx
pushq %rbx
jmp 0x14d3
subq $0x8, %rsp
leaq 0x1cb1(%rip), %rdx      # 0x3165
leaq 0x1bf0(%rip), %rcx      # 0x30ab
leaq 0x1c25(%rip), %r8       # 0x30e7
leaq 0x1bda(%rip), %r9       # 0x30a3
movl $0x1ec, %esi            # imm = 0x1EC
xorl %eax, %eax
pushq %rdx
pushq %r14
pushq $0x8
callq 0x1343
leaq 0x1bca(%rip), %rcx      # 0x30ab
leaq 0x1c2f(%rip), %r8       # 0x3117
leaq 0x1c76(%rip), %r9       # 0x3165
movl $0x1f1, %esi            # imm = 0x1F1
jmp 0x156b
leaq 0x1bae(%rip), %rcx      # 0x30ab
leaq 0x1c3b(%rip), %r8       # 0x313f
leaq 0x1c5a(%rip), %r9       # 0x3165
movl $0x1f6, %esi            # imm = 0x1F6
jmp 0x156b
leaq 0x1b92(%rip), %rcx      # 0x30ab
leaq 0x1c46(%rip), %r8       # 0x3166
leaq 0x1c3e(%rip), %r9       # 0x3165
movl $0x1fb, %esi            # imm = 0x1FB
jmp 0x156b
leaq 0x1c30(%rip), %rdi      # 0x3165
leaq 0x1b6f(%rip), %rcx      # 0x30ab
leaq 0x1c48(%rip), %r8       # 0x318b
movl $0x202, %esi            # imm = 0x202
xorl %eax, %eax
pushq %rdi
pushq %rdx
callq 0x1343
leaq 0x1b53(%rip), %rcx      # 0x30ab
leaq 0x1c62(%rip), %r8       # 0x31c1
leaq 0x1bff(%rip), %r9       # 0x3165
movl $0x207, %esi            # imm = 0x207
xorl %eax, %eax
callq 0x1343
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/./evec.h
// Function: evgrow
void* _evgrow(void* vec)
{
    ifp(!vec,
        EV_FAIL("Cannot grow an empty vector!\n");
    );

    evhd_t* hdr = EV_HDR(vec);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
                return NULL;
    );


    const size_t storage_bytes      = hdr->slt_size * hdr->slt_count;
    const size_t new_storage_bytes  = hdr->slt_count ? storage_bytes * EV_GROWTH_FACTOR :
                                      EV_INIT_COUNT * hdr->slt_size;
    const size_t full_bytes         = EV_HDR_BYTES + new_storage_bytes;

    hdr = realloc(hdr, full_bytes);
    if (!hdr){
        EV_FAIL("No memory to grow vector up to %" PRId64 "B\n", full_bytes);
        return NULL;
    }

    memset((char*)hdr + EV_HDR_BYTES + storage_bytes, 0x00, new_storage_bytes - storage_bytes);

    hdr->slt_count  = hdr->slt_count ? hdr->slt_count * EV_GROWTH_FACTOR : EV_INIT_COUNT;

    void *vec_start = (char*)hdr + EV_HDR_BYTES;

    return vec_start;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x1610
movq %rdi, %r15
leaq -0x30(%rdi), %r14
movq %r14, %rdi
callq 0x1407
testl %eax, %eax
jne 0x162c
movq -0x28(%r15), %rbx
movq -0x18(%r15), %rax
movq %rax, %r12
imulq %rbx, %r12
leaq (%r12,%r12), %rcx
shlq $0x3, %rbx
testq %rax, %rax
cmovneq %rcx, %rbx
leaq 0x30(%rbx), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x10e0
testq %rax, %rax
je 0x1648
movq %rax, %r14
leaq (%rax,%r12), %rdi
addq $0x30, %rdi
movq %rax, %r15
addq $0x30, %r15
subq %r12, %rbx
xorl %esi, %esi
movq %rbx, %rdx
callq 0x1080
movq 0x18(%r14), %rax
leaq (%rax,%rax), %rcx
testq %rax, %rax
pushq $0x8
popq %rax
cmovneq %rcx, %rax
movq %rax, 0x18(%r14)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1bce(%rip), %rcx      # 0x31e5
leaq 0x1bcf(%rip), %r8       # 0x31ed
leaq 0x1b40(%rip), %r9       # 0x3165
movl $0x212, %esi            # imm = 0x212
jmp 0x1669
leaq 0x1bb2(%rip), %rcx      # 0x31e5
leaq 0x1bd1(%rip), %r8       # 0x320b
leaq 0x1b24(%rip), %r9       # 0x3165
movl $0x217, %esi            # imm = 0x217
jmp 0x1669
leaq 0x1b16(%rip), %rax      # 0x3165
movq %rax, (%rsp)
leaq 0x1b8b(%rip), %rcx      # 0x31e5
leaq 0x1bc6(%rip), %r8       # 0x3227
movl $0x223, %esi            # imm = 0x223
movq %r15, %r9
xorl %eax, %eax
callq 0x1343
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/./evec.h
// Function: evpush
void* evpush(void* vec, void* obj, size_t obj_size)
{
    void* result = vec;
    if(!vec){
        //Get some memory
        result = evinisz(obj_size);
    }

    evhd_t* hdr = EV_HDR(result);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
                return NULL;
    );

    //Sanity check
    ifp(obj_size > hdr->slt_size,
        EV_FAIL("Object size (%" PRId64 ") is larger than there is space (%" PRId64 ")\n",
                obj_size,
                hdr->slt_size);
                return NULL;
    );

    //Enough space?
    if(hdr->obj_count == hdr->slt_count){
        //Get some more
        result = _evgrow(result);
        hdr = EV_HDR(result);
    }

    void* next_obj = ((char*)result) + hdr->slt_size * hdr->obj_count;
    memcpy(next_obj,obj,obj_size);
    hdr->obj_count++;

    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rdi, %rdi
jne 0x1694
pushq $0x8
popq %rsi
movq %rbx, %rdi
callq 0x12c0
movq %rax, %r15
leaq -0x30(%r15), %r12
movq %r12, %rdi
callq 0x1407
testl %eax, %eax
jne 0x16f6
movq -0x28(%r15), %rdx
cmpq %rbx, %rdx
jb 0x1717
movq -0x20(%r15), %rax
cmpq -0x18(%r15), %rax
jne 0x16c9
movq %r15, %rdi
callq 0x1572
movq %rax, %r15
movq %rax, %r12
addq $-0x30, %r12
movq 0x10(%r12), %rdi
imulq 0x8(%r12), %rdi
addq %r15, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x10c0
incq 0x10(%r12)
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x1b4f(%rip), %rcx      # 0x324c
leaq 0x1b07(%rip), %r8       # 0x320b
leaq 0x1a5a(%rip), %r9       # 0x3165
movl $0x23b, %esi            # imm = 0x23B
xorl %eax, %eax
callq 0x1343
leaq 0x1a47(%rip), %rdi      # 0x3165
leaq 0x1b27(%rip), %rcx      # 0x324c
leaq 0x1b27(%rip), %r8       # 0x3253
movl $0x243, %esi            # imm = 0x243
movq %rbx, %r9
xorl %eax, %eax
pushq %rdi
pushq %rdx
callq 0x1343
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/./evec.h
// Function: evcnt
size_t evcnt(void* vec)
{
    if(!vec){
        return 0;
    };

    evhd_t *hdr =  EV_HDR(vec);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
                return -1;
    );

    return hdr->obj_count;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x1759
movq %rdi, %rbx
addq $-0x30, %rdi
callq 0x1407
testl %eax, %eax
jne 0x175d
movq -0x20(%rbx), %rax
jmp 0x175b
xorl %eax, %eax
popq %rbx
retq
leaq 0x1b26(%rip), %rcx      # 0x328a
leaq 0x1aa0(%rip), %r8       # 0x320b
leaq 0x19f3(%rip), %r9       # 0x3165
movl $0x25e, %esi            # imm = 0x25E
xorl %eax, %eax
callq 0x1343
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/./evec.h
// Function: evpop
void evpop(void *vec)
{
    ifp(!vec,
        //Uh ohhh....
        EV_FAIL("Cannot pop a NULL vector\n");
        return;
    );

    evhd_t* hdr =  EV_HDR(vec);
    ifp(_evhdrcheck(hdr),
        EV_FAIL("Header sanity check failed\n");
        return;
    );

    if(hdr->obj_count)
        hdr->obj_count--;

}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x19a8
movq %rdi, %rbx
addq $-0x30, %rdi
callq 0x1407
testl %eax, %eax
jne 0x19c4
movq -0x20(%rbx), %rax
testq %rax, %rax
je 0x19a6
decq %rax
movq %rax, -0x20(%rbx)
popq %rbx
retq
leaq 0x19d1(%rip), %rcx      # 0x3380
leaq 0x19d0(%rip), %r8       # 0x3386
leaq 0x17a8(%rip), %r9       # 0x3165
movl $0x2d5, %esi            # imm = 0x2D5
jmp 0x19de
leaq 0x19b5(%rip), %rcx      # 0x3380
leaq 0x1839(%rip), %r8       # 0x320b
leaq 0x178c(%rip), %r9       # 0x3165
movl $0x2db, %esi            # imm = 0x2DB
xorl %eax, %eax
callq 0x1343
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: main
int main(void)
{

    for(int i = 0; tests[i].name != 0; i++){
        printf("Running test %i: %s ...", i+1, tests[i].name);
        int result = tests[i].run();
        printf("%s\n", result ? "Success" : "Fail");
        if(!result){
            return -1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x43ac(%rip), %r12      # 0x60a8
pushq $0x1
popq %rbp
leaq 0x17d9(%rip), %r14      # 0x34df
leaq 0x17f2(%rip), %r13      # 0x34ff
leaq 0x17e3(%rip), %rbx      # 0x34f7
movq -0x8(%r12), %rdx
testq %rdx, %rdx
je 0x1d51
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x1070
xorl %eax, %eax
callq *(%r12)
movl %eax, %r15d
testl %eax, %eax
movq %rbx, %rdi
cmoveq %r13, %rdi
callq 0x1050
addq $0x10, %r12
incl %ebp
testl %r15d, %r15d
jne 0x1d14
pushq $-0x1
popq %rax
jmp 0x1d53
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_O2/mgrosvenor[P]evec/test.c
// Function: test1
static int test1()
{
    EV_DBG("test 1\n");
    int* a = evinit(int);
    if(evcnt(a) != 0) return 0;
    if(evvsz(a) != EV_INIT_COUNT) return 0;
    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x4
popq %rdi
pushq $0x8
popq %rsi
callq 0x12c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x173d
xorl %ebp, %ebp
testq %rax, %rax
jne 0x1d9b
movq %rbx, %rdi
callq 0x1aa4
cmpq $0x8, %rax
jne 0x1d9b
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mgrosvenor[P]evec/test.c
// Function: test2
static int test2()
{
    int* a = evinisz(128);
    if(evcnt(a) != 0) return 0;
    if(evvsz(a) != EV_INIT_COUNT) return 0;
    evfree(a);
    return 1;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
pushq $0x8
popq %rsi
movl $0x80, %edi
callq 0x12c0
movq %rax, %rbx
movq %rax, %rdi
callq 0x173d
xorl %ebp, %ebp
testq %rax, %rax
jne 0x1ddf
movq %rbx, %rdi
callq 0x1aa4
cmpq $0x8, %rax
jne 0x1ddf
movq %rbx, %rdi
callq 0x193a
pushq $0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq