LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/eval.c
// Function: lair_add_simple_function
static int _lair_add_simple_function(struct _lair_env *env, const char *name, const struct _lair_type *value) {
	/* This is kind of dumb but whatever. */
	struct _lair_ast val = {
		.atom = {
			.type = value->type,
			/* HOLY SHIT UNIONS ARE AWESOME */
			.value = value->value
		}
	};

	return _tst_map_insert(&(env->not_variables), name, strlen(name), &val, sizeof(struct _lair_ast));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %rbx
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %r15
movaps %xmm0, 0x20(%r15)
movaps %xmm0, 0x10(%r15)
movaps %xmm0, (%r15)
movl (%rdx), %eax
movl %eax, 0x28(%r15)
movq 0x8(%rdx), %rax
movq %rax, 0x30(%r15)
addq $0x18, %r14
movq %rsi, %rdi
callq 0x1080
pushq $0x38
popq %r8
movq %r14, %rdi
movq %rbx, %rsi
movq %rax, %rdx
movq %r15, %rcx
callq 0x2844
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/eval.c
// Function: continue
static inline const struct _lair_ast *_continue(const struct _lair_ast *ast) {
	/* Jump to next line here. */
	while (ast->atom.type != LR_INDENT) {
		ast = ast->next;
		if (ast == NULL || ast->atom.type == LR_EOF)
			break;
	}
	return ast;
}

// Assembly:
movq %rdi, %rax
movl 0x28(%rdi), %ecx
cmpl $0x7, %ecx
je 0x24f4
movq 0x8(%rax), %rax
testq %rax, %rax
je 0x24f5
movl 0x28(%rax), %ecx
cmpl $0x9, %ecx
jne 0x24de
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/eval.c
// Function: lair_eval
int _lair_eval(struct _lair_runtime *r, const struct _lair_ast *root) {
	struct _lair_env *std_env = _lair_standard_env(r);
	const struct _lair_ast *cur_ast_node = root->children;

	while (cur_ast_node != NULL) {
		if (cur_ast_node->atom.type == LR_CALL) {
			_lair_env_eval(r, cur_ast_node, std_env);
		} else if (cur_ast_node->atom.type == LR_FUNCTION_DEF) {
			const char *func_name = cur_ast_node->atom.value.str;
			const size_t func_name_len = strlen(func_name);

			const void *is_std_func = _tst_map_get(
					std_env->functions, func_name, func_name_len);
			const void *is_c_func = _tst_map_get(
					std_env->c_functions, func_name, func_name_len);
			if (!is_std_func && !is_c_func) {
				/* We're defining a function so insert it. */
				_tst_map_insert(&std_env->functions,
						func_name,
						func_name_len,
						cur_ast_node,
						sizeof(struct _lair_ast));
			} else {
				/* Call the function instead of defining it. */
				_lair_call_function(r, cur_ast_node, std_env);
			}
		}

		cur_ast_node = cur_ast_node->sibling;
	}

	_lair_free_env(std_env);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x1c80
movq %rax, %r15
addq $0x10, %rbx
addq $0x10, %rax
movq %rax, (%rsp)
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x25aa
movl 0x28(%rbx), %eax
cmpl $0x1, %eax
je 0x2546
cmpl $0xb, %eax
jne 0x25a1
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x1eb9
jmp 0x25a1
movq 0x30(%rbx), %rbp
movq %rbp, %rdi
callq 0x1080
movq %rax, %r13
movq 0x10(%r15), %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x293c
movq %rax, %r12
movq 0x8(%r15), %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x293c
orq %r12, %rax
je 0x258b
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x21fa
jmp 0x25a1
movq (%rsp), %rdi
movq %rbp, %rsi
movq %r13, %rdx
movq %rbx, %rcx
pushq $0x38
popq %r8
callq 0x2844
addq $0x18, %rbx
jmp 0x251d
movq %r15, %rdi
callq 0x25c3
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/qpfiffer[P]lair/src/map.c
// Function: tst_map_insert
int _tst_map_insert(struct _tst_map_node **root, const char *key, const size_t klen, const void *value, const size_t vsiz) {
	assert(key != NULL);
	assert(klen > 0);

	size_t _klen = klen;
	return _tst_insert(root, key, _klen, value, vsiz);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rsi, %rsi
je 0x2906
movq %rdx, %r12
movq %rcx, 0x8(%rsp)
movq %r8, 0x10(%rsp)
testq %rdx, %rdx
je 0x291f
movq %rsi, %r13
movq %rdi, %r15
pushq $0x28
popq %r14
movb (%r13), %bpl
movq %r15, %rbx
movq (%r15), %r15
testq %r15, %r15
je 0x289a
cmpb 0x18(%r15), %bpl
jge 0x2896
addq $0x10, %r15
jmp 0x287f
jne 0x287f
jmp 0x28af
pushq $0x1
popq %rdi
movq %r14, %rsi
callq 0x1130
movq %rax, %r15
movq %rax, (%rbx)
movb %bpl, 0x18(%rax)
cmpq $0x2, %r12
jb 0x28c1
addq $0x8, %r15
incq %r13
decq %r12
jmp 0x287b
cmpq $0x0, 0x20(%r15)
je 0x28cd
pushq $0x1
popq %rax
jmp 0x28f7
pushq $0x1
popq %rdi
movq 0x10(%rsp), %r14
movq %r14, %rsi
callq 0x1130
movq %rax, 0x20(%r15)
movq (%rbx), %rax
movq 0x20(%rax), %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x1160
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1d34(%rip), %rdi      # 0x4641
leaq 0x1d39(%rip), %rsi      # 0x464d
leaq 0x1d3c(%rip), %rcx      # 0x4657
pushq $0x24
jmp 0x2936
leaq 0x1d96(%rip), %rdi      # 0x46bc
leaq 0x1d20(%rip), %rsi      # 0x464d
leaq 0x1d23(%rip), %rcx      # 0x4657
pushq $0x25
popq %rdx
callq 0x10c0
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/map.c
// Function: tst_map_get
const void *_tst_map_get(struct _tst_map_node *current_node, const char *key, const size_t klen) {
	const char current_char = key[0];

	if (current_node == NULL)
		return NULL;

	if (current_char < current_node->node_char) {
		return _tst_map_get(current_node->lokid, key, klen);
	} else if (current_char == current_node->node_char) {
		if (klen > 1)
			return _tst_map_get(current_node->eqkid, key + 1, klen - 1);
		return current_node->value;
	} else {
		return _tst_map_get(current_node->hikid, key, klen);
	}
}

// Assembly:
xorl %eax, %eax
testq %rdi, %rdi
je 0x296d
movb 0x18(%rdi), %cl
cmpb %cl, (%rsi)
jge 0x2950
addq $0x10, %rdi
jmp 0x2952
je 0x2957
movq (%rdi), %rdi
jmp 0x293e
cmpq $0x2, %rdx
jb 0x2969
movq 0x8(%rdi), %rdi
incq %rsi
decq %rdx
jmp 0x293e
movq 0x20(%rdi), %rax
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/map.c
// Function: tst_map_destroy
void _tst_map_destroy(struct _tst_map_node *root, void (*per_value_cleanup)(void *data)) {
	if (root == NULL)
		return;
	/* TODO: This whole function. */
	struct destroy_queue *top = calloc(1, sizeof(struct destroy_queue));
	dq_push(&top, root);

	while (top->next != NULL) {
		struct _tst_map_node *cur_node = (struct _tst_map_node *)dq_pop(&top);

		if (cur_node->lokid != NULL)
			dq_push(&top, (void *)cur_node->lokid);

		if (cur_node->eqkid != NULL)
			dq_push(&top, (void *)cur_node->eqkid);

		if (cur_node->hikid != NULL)
			dq_push(&top, (void *)cur_node->hikid);

		if (per_value_cleanup != NULL && cur_node->value != NULL)
			per_value_cleanup(cur_node->value);
		free(cur_node->value);
		free(cur_node);
	}

	free(top);
}

// Assembly:
testq %rdi, %rdi
je 0x2a22
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movq %rdi, %r15
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x1130
leaq 0x8(%rsp), %r14
movq %rax, (%r14)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2a23
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
testq %rax, %rax
je 0x2a14
movq %rax, 0x8(%rsp)
movq 0x8(%rdi), %r15
callq 0x1030
movq 0x10(%r15), %rsi
testq %rsi, %rsi
je 0x29d0
movq %r14, %rdi
callq 0x2a23
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x29e1
movq %r14, %rdi
callq 0x2a23
movq (%r15), %rsi
testq %rsi, %rsi
je 0x29f1
movq %r14, %rdi
callq 0x2a23
testq %rbx, %rbx
je 0x2a01
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x2a01
callq *%rbx
movq 0x20(%r15), %rdi
callq 0x1030
movq %r15, %rdi
callq 0x1030
jmp 0x29a4
callq 0x1030
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/map.c
// Function: dq_push
static inline void dq_push(struct destroy_queue **top, void *data) {
	struct destroy_queue *to_push = NULL;
	to_push = calloc(1, sizeof(struct destroy_queue));
	to_push->next = *top;
	to_push->data = data;
	*top = to_push;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x1130
movq (%r14), %rcx
movq %rcx, (%rax)
movq %rbx, 0x8(%rax)
movq %rax, (%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/parse.c
// Function: lair_print_tokens
void lair_print_tokens(const struct _lair_token *tokens) {
	const struct _lair_token *cur_tok = tokens;
	unsigned int last_indent_level = 0;
	while (cur_tok != NULL) {
		const char *frnd = _friendly_enum(cur_tok->token_type);
		switch (cur_tok->token_type) {
			case LR_FUNCTION_DEF:
			case LR_FUNCTION_CALL:
				printf("%s %s ", frnd, cur_tok->token_str);
				break;
			case LR_DEDENT:
				printf("\n}\n");
				break;
			case LR_INDENT: {
				char lvl[cur_tok->indent_level + 1];
				memset(lvl, ' ', cur_tok->indent_level);
				lvl[cur_tok->indent_level] = '\0';
				if (last_indent_level < cur_tok->indent_level) {
					printf("{\n%s", lvl);
				} else {
					printf("\n%s", lvl);
				}
				last_indent_level = cur_tok->indent_level;
				break;
			}
			case LR_ERR:
			default:
				printf("%s ", frnd);
		}
		cur_tok = cur_tok->next;
	}
	printf("\n---\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x1cf9(%rip), %r14      # 0x4781
xorl %r12d, %r12d
testq %rbx, %rbx
je 0x2b47
movl 0x8(%rbx), %r15d
movl %r15d, %edi
callq 0x2a50
leal -0x1(%r15), %ecx
cmpl $0x2, %ecx
jb 0x2ac3
cmpl $0x7, %r15d
je 0x2ad5
cmpl $0x8, %r15d
jne 0x2b2d
leaq 0x1d5e(%rip), %rdi      # 0x481a
callq 0x1070
jmp 0x2b3e
movq (%rbx), %rdx
movq %r14, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x10a0
jmp 0x2b3e
movq %rsp, %r13
movl 0xc(%rbx), %eax
incl %eax
movq %rsp, %r15
addq $0xf, %rax
andq $-0x10, %rax
subq %rax, %r15
movq %r15, %rsp
movl 0xc(%rbx), %edx
movq %r15, %rdi
pushq $0x20
popq %rsi
callq 0x10d0
movl 0xc(%rbx), %eax
movb $0x0, (%rax,%r15)
cmpl 0xc(%rbx), %r12d
leaq 0x1c7a(%rip), %rdi      # 0x4789
leaq 0x1c72(%rip), %rax      # 0x4788
cmovbq %rax, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10a0
movl 0xc(%rbx), %r12d
movq %r13, %rsp
jmp 0x2b3e
leaq 0x1c50(%rip), %rdi      # 0x4784
movq %rax, %rsi
xorl %eax, %eax
callq 0x10a0
movq 0x10(%rbx), %rbx
jmp 0x2a8b
leaq 0x1cc7(%rip), %rdi      # 0x4815
callq 0x1070
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/parse.c
// Function: intuit_token_type
void _intuit_token_type(
		struct _lair_runtime *r,
		struct _lair_token *new_token,
		const char *stripped) {
	const size_t stripped_len = strlen(stripped);
	if (stripped_len == 1) {
		if (stripped[0] == ':')
			new_token->token_type = LR_RETURN;
		else if (stripped[0] == '!')
			new_token->token_type = LR_CALL;
		else if (stripped[0] == '?')
			new_token->token_type = LR_IF;
		else if (_is_operator(stripped, stripped_len))
			new_token->token_type = LR_OPERATOR;
		else if (_is_valid_string(stripped, stripped_len))
			new_token->token_type = LR_STRING;
		else if (_is_all_numbers(stripped))
			new_token->token_type = LR_NUM;
		else
			new_token->token_type = LR_ATOM;
	} else {
		if (stripped[0] == '"') {
			if (!_is_valid_string(stripped, stripped_len))
				throw_exception(r, ERR_SYNTAX, "String has no ending \".");
			else
				new_token->token_type = LR_STRING;
		} else if (_is_all_numbers(stripped))
			new_token->token_type = LR_NUM;
		else
			new_token->token_type = LR_ATOM;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rdx, %rdi
callq 0x1080
movzbl (%r14), %ecx
cmpq $0x1, %rax
jne 0x2b9f
cmpl $0x21, %ecx
je 0x2bf3
cmpl $0x22, %ecx
je 0x2bac
cmpl $0x3f, %ecx
je 0x2bea
cmpl $0x3a, %ecx
jne 0x2bb5
movl $0x4, 0x8(%rbx)
jmp 0x2bfa
cmpl $0x22, %ecx
jne 0x2bb5
cmpb $0x22, -0x1(%r14,%rax)
jne 0x2bd3
movl $0xa, 0x8(%rbx)
jmp 0x2bfa
movq %r14, %rdi
callq 0x2c00
testl %eax, %eax
je 0x2bca
movl $0xf, 0x8(%rbx)
jmp 0x2bfa
movl $0xe, 0x8(%rbx)
jmp 0x2bfa
leaq 0x1bb3(%rip), %rdx      # 0x478d
pushq $0x1
popq %rsi
movq %r15, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x15d8
movl $0xc, 0x8(%rbx)
jmp 0x2bfa
movl $0xb, 0x8(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/parse.c
// Function: is_all_numbers
static inline int _is_all_numbers(const char *token) {
	unsigned int i = 0;
	for (; i < strlen(token); i++) {
		/* ASCII numerical values are between 0x30 and 0x39. */
		if ((int)token[i] < 0x30 || (int)token[i] > 0x39)
			return 0;
	}
	return 1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x1080
movq %rax, %rcx
xorl %edx, %edx
pushq $0x1
popq %rax
movl %edx, %edx
cmpq %rdx, %rcx
jbe 0x2c2a
movb (%rbx,%rdx), %sil
addb $-0x3a, %sil
incl %edx
cmpb $-0xb, %sil
ja 0x2c11
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/parse.c
// Function: insert_token
static void _insert_token(struct _lair_token **head, struct _lair_token *to_insert) {
	if (*head == NULL) {
		*head = to_insert;
		return;
	}

	struct _lair_token *current = *head;
	while (current->next != NULL) {
		current = current->next;
	}
	current->next = to_insert;
	to_insert->prev = current;
}

// Assembly:
movq (%rdi), %rax
testq %rax, %rax
je 0x310d
movq %rax, %rcx
movq 0x10(%rax), %rax
testq %rax, %rax
jne 0x30f8
movq %rsi, 0x10(%rcx)
movq %rcx, 0x18(%rsi)
retq
movq %rsi, (%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/parse.c
// Function: lair_atomize_token
struct _lair_type _lair_atomize_token(const struct _lair_token *token) {
	/* This is where we do parse-time type coersion into things that
	 * better represent the types we're eventually going to want out
	 * of whatever it is they are in.
	 */
	switch (token->token_type) {
		case LR_NUM: {
			struct _lair_type num = {
				.type = LR_NUM,
				.value = {
					.num = atoi(token->token_str)
				}
			};
			return num;
		}
		case LR_STRING: {
			struct _lair_type def = {
				.type = token->token_type,
				.value = {0}
			};
			if (token->token_str != NULL)
				def.value.str = _convert_str_token_to_str(token->token_str);
			return def;
		}
		default: {
			struct _lair_type def = {
				.type = token->token_type,
				.value = {0}
			};
			if (token->token_str != NULL) {
				def.value.str = calloc(1, strlen(token->token_str) + 1);
				memcpy(def.value.str, token->token_str, strlen(token->token_str));
			}
			return def;
		}
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl 0x8(%rdi), %ebx
movq (%rdi), %r14
cmpl $0xa, %ebx
je 0x3140
cmpl $0xf, %ebx
jne 0x31be
movq %r14, %rdi
callq 0x11d0
movl %eax, %r15d
pushq $0xf
popq %rbx
jmp 0x31f7
pushq $0xa
popq %rbx
testq %r14, %r14
je 0x31ed
movq %r14, %rdi
callq 0x1080
leaq -0x2(%rax), %r12
leaq -0x1(%rax), %rdi
callq 0x1170
movq %rax, %r15
pushq $0x1
popq %rcx
xorl %eax, %eax
cmpq %rax, %r12
je 0x31f2
movslq %ecx, %rsi
movb (%r14,%rsi), %dl
cmpb $0x5c, %dl
jne 0x319f
movzbl 0x1(%r14,%rsi), %edx
incq %rsi
movl %esi, %ecx
cmpl $0x74, %edx
je 0x31b1
cmpl $0x72, %edx
je 0x31aa
cmpl $0x6e, %edx
jne 0x31b8
movb $0xa, (%r15,%rax)
jmp 0x31a3
movb %dl, (%r15,%rax)
incq %rax
incl %ecx
jmp 0x3169
movb $0xd, (%r15,%rax)
jmp 0x31a3
movb $0x9, (%r15,%rax)
jmp 0x31a3
movb %dl, (%r15,%rax)
jmp 0x31a3
testq %r14, %r14
je 0x31ed
movq %r14, %rdi
callq 0x1080
movq %rax, %r12
leaq 0x1(%rax), %rsi
pushq $0x1
popq %rdi
callq 0x1130
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1160
jmp 0x31f7
xorl %r15d, %r15d
jmp 0x31f7
movb $0x0, (%r15,%r12)
movl %ebx, %eax
movq %r15, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/parse.c
// Function: lair_free_tokens
void _lair_free_tokens(struct _lair_token *tokens) {
	while (tokens != NULL) {
		struct _lair_token *to_free = (struct _lair_token *)tokens;
		tokens = tokens->next;
		_lair_free_token(to_free);
	}
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x321c
movq 0x10(%rdi), %rbx
callq 0x321e
movq %rbx, %rdi
jmp 0x3209
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/parse.c
// Function: lair_parse_from_tokens
struct _lair_ast *_lair_parse_from_tokens(
		struct _lair_runtime *r,
		struct _lair_token **tokens) {
	check(r, tokens != NULL, ERR_PARSE, "No tokens to parse.");
	struct _lair_ast *ast_root = calloc(1, sizeof(struct _lair_ast));
	struct _lair_ast *child_loc = ast_root->children;

	while ((*tokens) != NULL) {
		struct _lair_ast *to_append = _parse_from_token(tokens);

		struct _lair_token *unused = _pop_token(tokens);
		if (unused != NULL)
			_lair_free_token(unused);

		if (ast_root->children == NULL) {
			ast_root->children = to_append;
			child_loc = ast_root->children;
		} else {
			child_loc->sibling = to_append;
			child_loc = child_loc->sibling;
		}
	}

	/* The root node should never have any siblings. */
	check(r, ast_root->next == NULL, ERR_PARSE, "The tree got messed up somehow.");
	return ast_root;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
xorl %esi, %esi
testq %r14, %r14
setne %sil
leaq 0x1590(%rip), %rcx      # 0x47e1
xorl %r13d, %r13d
movq %rdi, (%rsp)
xorl %edx, %edx
callq 0x15c8
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x1130
movq %rax, %r15
movq %rax, %rbp
addq $0x10, %rbp
xorl %r12d, %r12d
cmpq $0x0, (%r14)
je 0x32b4
movq %r14, %rdi
callq 0x32db
movq %rax, %rbx
movq (%r14), %rdi
testq %rdi, %rdi
je 0x329c
movq 0x10(%rdi), %rax
movq %rax, (%r14)
callq 0x321e
addq $0x18, %r12
testq %r13, %r13
cmoveq %rbp, %r12
cmoveq %rbx, %r13
movq %rbx, (%r12)
movq %rbx, %r12
jmp 0x3277
leaq 0x153a(%rip), %rcx      # 0x47f5
pushq $0x1
popq %rsi
movq (%rsp), %rdi
xorl %edx, %edx
callq 0x15c8
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/parse.c
// Function: parse_from_token
static struct _lair_ast *_parse_from_token(struct _lair_token **tokens) {
	/* "pop" the token off of the top of the stack. */
	struct _lair_token *current_token = _pop_token(tokens);

	/* Atomize the function, stick it at the head of the list. */
	struct _lair_ast _stack_ast = {
		.atom = _lair_atomize_token(current_token),
		.indent_level = current_token->indent_level
	};

	if (current_token->token_type == LR_FUNCTION_CALL ||
			current_token->token_type == LR_FUNCTION_DEF ||
			current_token->token_type == LR_CALL) {
		struct _lair_ast *list = calloc(1, sizeof(struct _lair_ast));
		memcpy(list, &_stack_ast, sizeof(struct _lair_ast));

		/* We break out of the loop when we find an EOF or a DEDENT. */
		struct _lair_ast *cur_ast_item = list;
		struct _lair_ast *prev = NULL;
		while (current_token->token_type != LR_DEDENT &&
			   current_token->token_type != LR_EOF) {
			struct _lair_ast *to_append = _parse_from_token(tokens);
			cur_ast_item->next = to_append;
			cur_ast_item->prev = prev;

			/* Get the next token in line. */
			prev = cur_ast_item;
			cur_ast_item = cur_ast_item->next;
			current_token = (*tokens);
			if (current_token == NULL) {
				/* This happens sometimes if we have a statement like the following:
				 * ! print ! return 10<EOF>
				 */
				return list;
			}
		}

		if (current_token->token_type == LR_EOF) {
			struct _lair_ast *to_append = _parse_from_token(tokens);
			cur_ast_item->next = to_append;
			cur_ast_item->prev = prev;

			prev = cur_ast_item;
			cur_ast_item = cur_ast_item->next;
			current_token = (*tokens);
		}
		return list;
	} else {
		struct _lair_ast *to_return = calloc(1, sizeof(struct _lair_ast));
		memcpy(to_return, &_stack_ast, sizeof(struct _lair_ast));
		_lair_free_token(current_token);
		return to_return;
	}

	_lair_free_tokens(current_token);

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %r14
testq %r14, %r14
je 0x32f8
movq 0x10(%r14), %rax
movq %rax, (%rbx)
movl 0xc(%r14), %r13d
movq %r14, %rdi
callq 0x3111
movl %eax, %ebp
movq %rdx, %r12
movl 0x8(%r14), %eax
cmpl $0xb, %eax
ja 0x337d
movl $0x806, %ecx            # imm = 0x806
btl %eax, %ecx
jae 0x337d
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x1130
movq %rax, %r15
movl %r13d, 0x20(%rax)
movl %ebp, 0x28(%rax)
movq %r12, 0x30(%rax)
xorl %r12d, %r12d
movq %rax, %r13
movl 0x8(%r14), %eax
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0x8, %ecx
je 0x3366
movq %rbx, %rdi
callq 0x32db
movq %rax, 0x8(%r13)
movq %r12, (%r13)
movq (%rbx), %r14
movq %r13, %r12
testq %r14, %r14
jne 0x3338
jmp 0x339e
cmpl $0x9, %eax
jne 0x339e
movq %rbx, %rdi
callq 0x32db
movq %rax, 0x8(%r13)
movq %r12, (%r13)
jmp 0x339e
pushq $0x1
popq %rdi
pushq $0x38
popq %rsi
callq 0x1130
movq %rax, %r15
movl %r13d, 0x20(%rax)
movl %ebp, 0x28(%rax)
movq %r12, 0x30(%rax)
movq %r14, %rdi
callq 0x321e
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/lair.c
// Function: lair_load_file
char *lair_load_file(const char *file_path, size_t *buf_size) {
	struct stat st = {0};
	if (stat(file_path, &st) == -1)
		return NULL;

	int fd = open(file_path, O_RDONLY);
	if (fd <= 0)
		return NULL;

	*buf_size = st.st_size;
	char *loaded = mmap(NULL, *buf_size, PROT_READ, MAP_PRIVATE, fd, 0);
	if (loaded == MAP_FAILED || loaded == NULL)
		return NULL;

	close(fd);

	return loaded;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x90, %rsp
movq %rsi, %r14
movq %rdi, %r15
movq %rsp, %r12
xorl %ebx, %ebx
movl $0x90, %edx
movq %r12, %rdi
xorl %esi, %esi
callq 0x10d0
movq %r15, %rdi
movq %r12, %rsi
callq 0x1150
cmpl $-0x1, %eax
je 0x3442
xorl %ebx, %ebx
movq %r15, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x11b0
testl %eax, %eax
jle 0x3442
movl %eax, %ebp
movq 0x30(%rsp), %rsi
movq %rsi, (%r14)
xorl %ebx, %ebx
pushq $0x1
popq %rdx
pushq $0x2
popq %rcx
xorl %edi, %edi
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x1090
movq %rax, %r14
incq %rax
cmpq $0x2, %rax
jb 0x3442
movl %ebp, %edi
callq 0x1100
movq %r14, %rbx
movq %rbx, %rax
addq $0x90, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/qpfiffer[P]lair/src/lair.c
// Function: lair_execute
int lair_execute(const char *program, const size_t len) {
	struct _lair_runtime *runtime = _lair_runtime_start();
	if (setjmp(runtime->exception_buffer)) {
		if (runtime->exception_msg) {
			print_error(runtime->exception_type, runtime->exception_msg);
		}
		goto error;
	}

	struct _lair_token *tokens = _lair_tokenize(runtime, program, len);
	if (tokens == NULL)
		goto error;

#ifdef DEBUG
	lair_print_tokens(tokens);
#endif
	const struct _lair_ast *ast = _lair_parse_from_tokens(runtime, &tokens);
	if (ast == NULL)
		return 1;

	_lair_eval(runtime, ast);
	_lair_free_tokens(tokens);
	_lair_runtime_end(runtime);
	return 0;

error:
	_lair_free_tokens(tokens);
	_lair_runtime_end(runtime);
	return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0x33b0
movq %rax, %rbx
leaq 0x10(%rax), %rdi
callq 0x1120
testl %eax, %eax
je 0x348c
movq 0x8(%rbx), %rsi
pushq $0x1
popq %rbp
testq %rsi, %rsi
je 0x34c9
movl (%rbx), %edi
callq 0x1607
jmp 0x34c9
movq %rbx, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x2c2c
movq %rax, (%rsp)
testq %rax, %rax
je 0x34c6
movq %rsp, %rsi
movq %rbx, %rdi
callq 0x3233
testq %rax, %rax
je 0x34e7
movq %rax, %rsi
movq %rbx, %rdi
callq 0x24f8
xorl %ebp, %ebp
movq (%rsp), %rdi
jmp 0x34cd
pushq $0x1
popq %rbp
xorl %eax, %eax
movl %eax, %edi
callq 0x3208
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rax
jmp 0x34dc
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ibperfcli.c
// Function: test_ibperf
int
test_ibperf(const int argc, char ** const argv)
{
  if (argc < 6 || (strcmp(argv[0], "api") != 0)) {
    return -1;
  }
  const u64 pid = strtoull(argv[1], NULL, 10);
  char * const host = argv[2];
  const int pn = atoi(argv[3]);
  const u64 depth = strtoull(argv[4], NULL, 10);
  const u64 unit = strtoull(argv[5], NULL, 10);

  char *pref[64] = {};
  for (int i = 0; i < 6; i++) {
    pref[i] = argv[i];
  }
  pref[6] = NULL;

  struct worker_info wi = {};
  wi.port = ib_port_create(pid);
  wi.host = host;
  wi.pn = pn;
  wi.depth = depth;
  wi.unit = unit;

  struct pass_info pi = {};
  pi.api = &wi;
  pi.vctr_size = 1;
  pi.wf = ibperf_worker;
  pi.af = ibperf_analyze;

  const int n2 = maptest_passes(argc - 6, argv + 6, pref, &pi);
  ib_port_destroy(wi.port);
  if (n2 < 0) {
    return n2;
  }
  return 6 + n2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
pushq $-0x1
popq %r15
cmpl $0x6, %edi
jl 0x695d
movq %rsi, %rbx
movl %edi, %r14d
movq (%rsi), %rdi
leaq 0xb7d3(%rip), %rsi      # 0x12010
callq 0x64b0
testl %eax, %eax
jne 0x695d
movq 0x8(%rbx), %rdi
xorl %r12d, %r12d
pushq $0xa
popq %r15
xorl %esi, %esi
movl %r15d, %edx
callq 0x6580
movq %rax, -0x38(%rbp)
movq 0x10(%rbx), %rax
movq %rax, -0x40(%rbp)
movq 0x18(%rbx), %rdi
callq 0x63e0
movl %eax, -0x2c(%rbp)
movq 0x20(%rbx), %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x6580
movq %rax, %r13
movq 0x28(%rbx), %rdi
xorl %esi, %esi
movl %r15d, %edx
callq 0x6580
movq %rax, %r15
leaq -0x290(%rbp), %rdi
movl $0x200, %edx            # imm = 0x200
xorl %esi, %esi
callq 0x6080
cmpq $0x6, %r12
je 0x68c3
movq (%rbx,%r12,8), %rax
movq %rax, -0x290(%rbp,%r12,8)
incq %r12
jmp 0x68ac
leaq -0x290(%rbp), %rax
andq $0x0, 0x30(%rax)
leaq -0x90(%rbp), %r12
andq $0x0, 0x10(%r12)
movq -0x38(%rbp), %rdi
callq 0x112cc
movq %rax, (%r12)
movq -0x40(%rbp), %rax
movq %rax, 0x8(%r12)
movl -0x2c(%rbp), %eax
movl %eax, 0x10(%r12)
movq %r13, 0x18(%r12)
movq %r15, 0x20(%r12)
leaq -0x68(%rbp), %rcx
andq $0x0, (%rcx)
movq %r12, 0x8(%rcx)
movq $0x1, 0x10(%rcx)
leaq 0x53(%rip), %rax        # 0x6972
movq %rax, 0x18(%rcx)
leaq 0x399(%rip), %rax       # 0x6cc3
movq %rax, 0x20(%rcx)
addl $-0x6, %r14d
addq $0x30, %rbx
movl %r14d, %edi
movq %rbx, %rsi
leaq -0x290(%rbp), %rdx
callq 0x105d3
movl %eax, %ebx
movq (%r12), %rdi
callq 0x11403
leal 0x6(%rbx), %r15d
testl %ebx, %ebx
cmovsl %ebx, %r15d
movl %r15d, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ibperfcli.c
// Function: ibperf_analyze
static bool
ibperf_analyze(struct vctr * const va, const double dt, struct damp * const damp, char * const out)
{
  const u64 nb = vctr_get(va, 0);
  const double mbps = ((double)nb) / (dt * (1024.0*1024.0));
  const bool done = damp_add_test(damp, mbps);
  const double havg = damp_average(damp);
  const char * const pat = " bytes %"PRIu64" mbps %.4lf havg %.4lf\n";
  sprintf(out, pat, nb, mbps, havg);
  return done;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movq %rsi, %r14
vmovsd %xmm0, -0x28(%rbp)
xorl %esi, %esi
callq 0x9384
movq %rax, %r15
vcvtusi2sd %rax, %xmm1, %xmm0
vmovsd -0x28(%rbp), %xmm1
vmulsd 0xb30e(%rip), %xmm1, %xmm1 # 0x12008
vdivsd %xmm1, %xmm0, %xmm0
vmovsd %xmm0, -0x28(%rbp)
movq %r14, %rdi
callq 0x91dd
movl %eax, %r12d
movq %r14, %rdi
callq 0x90ea
vmovapd %xmm0, %xmm1
leaq 0xb2f3(%rip), %rsi      # 0x12014
movq %rbx, %rdi
movq %r15, %rdx
vmovsd -0x28(%rbp), %xmm0
movb $0x2, %al
callq 0x6300
movl %r12d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_port_create
struct ib_port *
ib_port_create(const u64 index)
{
  int num = 0;
  struct ibv_device ** const list = ibv_get_device_list(&num);
  u64 base = 0;
  for (int i = 0; i < num; i++) {
    struct ibv_context * const ctx = ibv_open_device(list[i]);
    if (ctx == NULL) {
      ibv_free_device_list(list);
      return NULL;
    }
    struct ibv_device_attr attr = {};
    const int q = ibv_query_device(ctx, &attr);
    debug_assert(q == 0);

    const u8 np = attr.phys_port_cnt;
    if ((base + np) > index) {
      struct ib_port * const port = (typeof(port))malloc(sizeof(*port));
      debug_assert(port);
      port->ctx = ctx;
      port->port_id = index - base + 1;
      port->pd = ibv_alloc_pd(ctx);
      debug_assert(port->pd);
      ibv_free_device_list(list);
      return port;
    }
    ibv_close_device(ctx);
    base += np;
  }
  ibv_free_device_list(list);
  return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movq %rdi, %r14
leaq -0x34(%rbp), %rdi
andl $0x0, (%rdi)
callq 0x6460
movq %rax, -0x30(%rbp)
xorl %r12d, %r12d
xorl %ebx, %ebx
movslq -0x34(%rbp), %rax
cmpq %rax, %r12
jge 0x11394
movq -0x30(%rbp), %rax
movq (%rax,%r12,8), %rdi
callq 0x6230
testq %rax, %rax
je 0x11394
movq %rax, %r15
vxorps %xmm0, %xmm0, %xmm0
vmovups %ymm0, -0x60(%rbp)
vmovups %ymm0, -0x80(%rbp)
vmovups %ymm0, -0xa0(%rbp)
vmovups %ymm0, -0xc0(%rbp)
vmovups %ymm0, -0xe0(%rbp)
vmovups %ymm0, -0x100(%rbp)
vmovups %ymm0, -0x120(%rbp)
andq $0x0, -0x40(%rbp)
movq %rax, %rdi
leaq -0x120(%rbp), %rsi
vzeroupper
callq 0x62c0
xorl %edi, %edi
testl %eax, %eax
sete %dil
callq 0x723c
movzbl -0x3d(%rbp), %r13d
addq %rbx, %r13
cmpq %r14, %r13
ja 0x113a2
movq %r15, %rdi
callq 0x63b0
incq %r12
movq %r13, %rbx
jmp 0x112f8
movq -0x30(%rbp), %rdi
callq 0x60e0
xorl %r12d, %r12d
jmp 0x113ee
pushq $0x18
popq %rdi
callq 0x61b0
movq %rax, %r12
xorl %edi, %edi
testq %rax, %rax
setne %dil
callq 0x723c
movq %r15, (%r12)
subl %ebx, %r14d
incb %r14b
movb %r14b, 0x8(%r12)
movq %r15, %rdi
callq 0x6610
movq %rax, 0x10(%r12)
xorl %edi, %edi
testq %rax, %rax
setne %dil
callq 0x723c
movq -0x30(%rbp), %rdi
callq 0x60e0
movq %r12, %rax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_sge_refill_ptr
u64
ib_sge_refill_ptr(struct ibv_sge * const sg, struct ibv_mr * const mr, void * const ptr, const size_t size)
{
  debug_assert((((u64)ptr) + size - ((u64)mr->addr)) <= mr->length);
  debug_assert(ptr >= mr->addr);
  sg->addr = (u64)ptr;
  sg->length = size;
  sg->lkey = mr->lkey;
  return ptr - mr->addr;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %r15
movq %rdx, %rbx
movq %rsi, %r14
leaq (%rdx,%rcx), %rax
subq 0x10(%rsi), %rax
movq %rdi, %r12
xorl %edi, %edi
cmpq 0x18(%rsi), %rax
setbe %dil
callq 0x723c
xorl %edi, %edi
cmpq %rbx, 0x10(%r14)
setbe %dil
callq 0x723c
movq %rbx, (%r12)
movl %r15d, 0x8(%r12)
movl 0x24(%r14), %eax
movl %eax, 0xc(%r12)
subq 0x10(%r14), %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_create
struct ib_socket *
ib_socket_create(struct ib_port * const port, const u64 depth)
{
  struct ib_socket * const s = (typeof(s))calloc(1, sizeof(*s));
  debug_assert(s);
  s->port = port;

  struct ibv_cq * const cqs = ibv_create_cq(port->ctx, depth, NULL, NULL, 0);
  struct ibv_cq * const cqr = ibv_create_cq(port->ctx, depth, NULL, NULL, 0);
  debug_assert(cqs);
  debug_assert(cqr);
  s->cqs = cqs;
  s->cqr = cqr;

  // qp
  struct ibv_qp_init_attr iattr = {};
  iattr.send_cq = cqs;
  iattr.recv_cq = cqr;
  iattr.qp_type = IBV_QPT_RC;
  iattr.sq_sig_all = 0;

  iattr.cap.max_send_wr = depth;
  iattr.cap.max_recv_wr = depth;
  iattr.cap.max_send_sge = IB1_SGE_DEPTH;
  iattr.cap.max_recv_sge = IB1_SGE_DEPTH;
  iattr.cap.max_inline_data = 60;

  s->qp = ibv_create_qp(port->pd, &iattr);
  debug_assert(s->qp);

  // qp init state
  struct ibv_qp_attr qattr = {};
  qattr.qp_state = IBV_QPS_INIT;
  qattr.pkey_index = 0;
  qattr.port_num = port->port_id;
  qattr.qp_access_flags = IB1_MR_FLAGS;
  const int r = ibv_modify_qp(s->qp, &qattr, IB1_SOCKET_QP_INIT);
  debug_assert(r == 0);

  // wc
  s->wc = (typeof(s->wc))calloc(depth, sizeof(s->wc[0]));
  debug_assert(s->wc);

  // wr/sg
  s->swr.num_sge = 1;
  s->rwr.num_sge = 1;
  s->depth = depth;
  return s;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movq %rdi, %r15
pushq $0x1
popq %rdi
movl $0xe8, %esi
callq 0x64f0
movq %rax, %r14
xorl %edi, %edi
testq %rax, %rax
setne %dil
callq 0x723c
movq %r15, (%r14)
movq (%r15), %rdi
movl %ebx, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6170
movq %rax, %r12
movq (%r15), %rdi
movl %ebx, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x6170
movq %rax, %r13
xorl %edi, %edi
testq %r12, %r12
setne %dil
callq 0x723c
xorl %edi, %edi
testq %r13, %r13
setne %dil
callq 0x723c
movq %r12, 0x10(%r14)
vxorps %xmm0, %xmm0, %xmm0
leaq -0x70(%rbp), %rsi
vmovups %ymm0, (%rsi)
movq %r13, 0x18(%r14)
vmovups %ymm0, 0x20(%rsi)
movq %r12, 0x8(%rsi)
movq %r13, 0x10(%rsi)
movl %ebx, 0x20(%rsi)
movl %ebx, 0x24(%rsi)
movabsq $0x100000001, %rax      # imm = 0x100000001
movq %rax, 0x28(%rsi)
movabsq $0x20000003c, %rax      # imm = 0x20000003C
movq %rax, 0x30(%rsi)
movq 0x10(%r15), %rdi
vzeroupper
callq 0x6100
movq %rax, %r12
movq %rax, 0x8(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
callq 0x723c
leaq -0x100(%rbp), %rsi
vxorps %xmm0, %xmm0, %xmm0
vmovups %ymm0, (%rsi)
vmovups %ymm0, 0x70(%rsi)
vmovups %ymm0, 0x60(%rsi)
vmovups %ymm0, 0x40(%rsi)
vmovups %ymm0, 0x20(%rsi)
pushq $0x1
popq %r13
movl %r13d, (%rsi)
movb 0x8(%r15), %al
movb %al, 0x81(%rsi)
movl $0xf, 0x20(%rsi)
pushq $0x39
popq %rdx
movq %r12, %rdi
vzeroupper
callq 0x62b0
xorl %edi, %edi
testl %eax, %eax
sete %dil
callq 0x723c
pushq $0x30
popq %rsi
movq %rbx, %rdi
callq 0x64f0
movq %rax, 0x20(%r14)
xorl %edi, %edi
testq %rax, %rax
setne %dil
callq 0x723c
movl %r13d, 0x40(%r14)
movl %r13d, 0xc0(%r14)
movq %rbx, 0xc8(%r14)
movq %r14, %rax
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_export
bool
ib_socket_export(struct ib_socket * const s, struct ib_remote * const r)
{
  struct ibv_port_attr attr = {};
  if (ibv_query_port(s->port->ctx, s->port->port_id, &attr) != 0) {
    return false;
  }
  r->lid = attr.lid;
  r->qpn = s->qp->qp_num;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x40, %rsp
vxorps %xmm0, %xmm0, %xmm0
vmovups %ymm0, -0x3c(%rbp)
vmovups %ymm0, -0x50(%rbp)
movq %rsi, %rbx
movq %rdi, %r14
movq (%rdi), %rax
movq (%rax), %rdi
movb 0x8(%rax), %al
cmpq $-0x1, 0x140(%rdi)
jne 0x116c0
cmpq $0x288, -0x8(%rdi)      # imm = 0x288
jb 0x116c0
movq -0x140(%rdi), %r8
testq %r8, %r8
je 0x116c0
movzbl %al, %esi
leaq -0x50(%rbp), %rdx
pushq $0x34
popq %rcx
vzeroupper
callq *%r8
jmp 0x116cf
movzbl %al, %esi
leaq -0x50(%rbp), %rdx
vzeroupper
callq 0x64c0
testl %eax, %eax
jne 0x116e3
movzwl -0x2e(%rbp), %ecx
movl %ecx, (%rbx)
movq 0x8(%r14), %rcx
movl 0x34(%rcx), %ecx
movl %ecx, 0x4(%rbx)
testl %eax, %eax
sete %al
addq $0x40, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_connect
bool
ib_socket_connect(struct ib_socket * const s, struct ib_remote * const r)
{
  // RTR
  struct ibv_qp_attr qattr = {};
  qattr.qp_state = IBV_QPS_RTR;
  qattr.path_mtu = IBV_MTU_4096;
  qattr.dest_qp_num = r->qpn;
  qattr.rq_psn = IB1_PSN;

  qattr.ah_attr.is_global = 0;
  qattr.ah_attr.dlid = r->lid;
  qattr.ah_attr.sl = 0;
  qattr.ah_attr.src_path_bits = 0;
  qattr.ah_attr.port_num = s->port->port_id;

  // RC only
  qattr.max_dest_rd_atomic = 16;
  qattr.min_rnr_timer = 12;
  const int mask1 = IB1_SOCKET_QP_RTR_RC;
  const int r1 = ibv_modify_qp(s->qp, &qattr, mask1);
  if (r1 != 0) return false;

  // RTS
  qattr.qp_state = IBV_QPS_RTS;
  qattr.sq_psn = IB1_PSN;
  // RC only
  qattr.timeout = 14;
  qattr.retry_cnt = 7;
  qattr.rnr_retry = 7;
  qattr.max_rd_atomic = 16;
  qattr.max_dest_rd_atomic = 16;
  const int mask2 = IB1_SOCKET_QP_RTS_RC;
  const int r2 = ibv_modify_qp(s->qp, &qattr, mask2);
  if (r2 != 0) return false;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x98, %rsp
vxorps %xmm0, %xmm0, %xmm0
leaq -0xa0(%rbp), %rax
vmovups %ymm0, (%rax)
vmovups %ymm0, 0x70(%rax)
vmovups %ymm0, 0x60(%rax)
movq %rdi, %rbx
vmovups %ymm0, 0x40(%rax)
vmovups %ymm0, 0x20(%rax)
movl $0x2, (%rax)
movl $0x5, 0x8(%rax)
movl 0x4(%rsi), %ecx
movl %ecx, 0x1c(%rax)
movl $0x3e8, 0x14(%rax)      # imm = 0x3E8
movzwl (%rsi), %ecx
movw %cx, 0x50(%rax)
movb $0x0, 0x53(%rax)
movq (%rdi), %rcx
movb 0x8(%rcx), %cl
movb %cl, 0x56(%rax)
movw $0xc10, 0x7f(%rax)      # imm = 0xC10
movq 0x8(%rdi), %rdi
movq %rax, %rsi
movl $0x129181, %edx         # imm = 0x129181
vzeroupper
callq 0x62b0
testl %eax, %eax
je 0x11773
xorl %eax, %eax
jmp 0x117b0
leaq -0xa0(%rbp), %rsi
movl $0x3, (%rsi)
movl $0x3e8, 0x18(%rsi)      # imm = 0x3E8
movw $0x70e, 0x82(%rsi)      # imm = 0x70E
movb $0x7, 0x84(%rsi)
movw $0x1010, 0x7e(%rsi)     # imm = 0x1010
movq 0x8(%rbx), %rdi
movl $0x12e01, %edx          # imm = 0x12E01
callq 0x62b0
testl %eax, %eax
sete %al
addq $0x98, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_connect_stream2
bool
ib_socket_connect_stream2(struct ib_socket * const s, struct stream2 * const s2)
{
  struct ib_remote local = {};
  if (ib_socket_export(s, &local) == false) {
    fprintf(stderr, "export failed\n");
    return false;
  }
  fwrite(&local, sizeof(local), 1, s2->w);
  fflush(s2->w);

  struct ib_remote remote = {};
  if (1 != fread(&remote, sizeof(remote), 1, s2->r)) {
    fprintf(stderr, "read remote failed\n");
    return false;
  }

  const bool rc = ib_socket_connect(s, &remote);
  if (rc == false) {
    fprintf(stderr, "connect failed\n");
  }
  return rc;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq -0x30(%rbp), %rsi
andq $0x0, (%rsi)
callq 0x11666
testb %al, %al
je 0x11840
movq (%r14), %rcx
leaq -0x30(%rbp), %rdi
pushq $0x8
popq %r15
pushq $0x1
popq %r12
movq %r15, %rsi
movq %r12, %rdx
callq 0x65d0
movq (%r14), %rdi
callq 0x66f0
leaq -0x28(%rbp), %rdi
andq $0x0, (%rdi)
movq 0x8(%r14), %rcx
movq %r15, %rsi
movq %r12, %rdx
callq 0x6440
cmpq $0x1, %rax
jne 0x11855
leaq -0x28(%rbp), %rsi
movq %rbx, %rdi
callq 0x116f1
movl %eax, %ecx
movb $0x1, %al
testb %cl, %cl
je 0x1186a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x77a1(%rip), %rax      # 0x18fe8
movq (%rax), %rcx
leaq 0x1537(%rip), %rdi      # 0x12d88
pushq $0xe
jmp 0x1187d
movq 0x778c(%rip), %rax      # 0x18fe8
movq (%rax), %rcx
leaq 0x1531(%rip), %rdi      # 0x12d97
pushq $0x13
jmp 0x1187d
movq 0x7777(%rip), %rax      # 0x18fe8
movq (%rax), %rcx
leaq 0x1530(%rip), %rdi      # 0x12dab
pushq $0xf
popq %rsi
pushq $0x1
popq %rdx
callq 0x65d0
xorl %eax, %eax
jmp 0x11833
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_post_send
bool
ib_socket_post_send(struct ib_socket * const s, struct ibv_sge * const sg, const bool signaled)
{
  if (s->nr_sending >= s->depth) return false;
  struct ibv_send_wr * const wr = &(s->swr);
  wr->wr_id = s->wid++;
  wr->sg_list = sg;
  wr->opcode = IBV_WR_SEND;
  wr->send_flags = signaled ? IBV_SEND_SIGNALED : 0;
  if (signaled) s->nr_sending++;
  struct ibv_send_wr * bad_wr = NULL;
  const int r = ibv_post_send(s->qp, wr, &bad_wr);
  return r == 0 ? true : false;
}

// Assembly:
movq 0xd8(%rdi), %rcx
cmpq 0xc8(%rdi), %rcx
jae 0x11901
movq %rsi, %rax
leaq 0x28(%rdi), %rsi
movq 0xd0(%rdi), %r8
leaq 0x1(%r8), %r9
movq %r9, 0xd0(%rdi)
movq %r8, 0x28(%rdi)
movq %rax, 0x38(%rdi)
movl $0x2, 0x44(%rdi)
movzbl %dl, %eax
leal (%rax,%rax), %edx
movl %edx, 0x48(%rdi)
testb %al, %al
je 0x118d9
incq %rcx
movq %rcx, 0xd8(%rdi)
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq -0x8(%rbp), %rdx
andq $0x0, (%rdx)
movq 0x8(%rdi), %rdi
movq (%rdi), %rax
callq *0xd0(%rax)
testl %eax, %eax
sete %al
addq $0x10, %rsp
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_post_recv
bool
ib_socket_post_recv(struct ib_socket * const s, struct ibv_sge * const sg)
{
  if (s->nr_recving >= s->depth) return false;
  struct ibv_recv_wr * const wr = &(s->rwr);
  wr->wr_id = s->wid++;
  wr->sg_list = sg;
  struct ibv_recv_wr * bad_wr = NULL;
  const int r = ibv_post_recv(s->qp, wr, &bad_wr);
  s->nr_recving++;
  return r == 0 ? true : false;
}

// Assembly:
movq 0xe0(%rdi), %rax
cmpq 0xc8(%rdi), %rax
jae 0x1196f
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xa8(%rdi), %rax
movq 0xd0(%rdi), %rcx
leaq 0x1(%rcx), %rdx
movq %rdx, 0xd0(%rdi)
movq %rcx, 0xa8(%rdi)
movq %rsi, 0xb8(%rdi)
leaq -0x10(%rbp), %rdx
andq $0x0, (%rdx)
movq 0x8(%rdi), %rdi
movq (%rdi), %rcx
movq %rax, %rsi
callq *0xd8(%rcx)
incq 0xe0(%rbx)
testl %eax, %eax
sete %al
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_flush_send
bool
ib_socket_flush_send(struct ib_socket * const s)
{
  while (s->nr_sending) {
    const int n = ibv_poll_cq(s->cqs, s->depth, s->wc);
    if (n < 0) {
      return false;
    }
    if (n == 0) continue;
    for (int i = 0; i < n; i++) {
      if (s->wc[i].status != IBV_WC_SUCCESS) {
        return false;
      }
    }
    s->nr_sending -= n;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0xd8(%rbx), %r14
testq %r14, %r14
je 0x119d0
movl 0xc8(%rbx), %esi
movq 0x10(%rbx), %rdi
movq 0x20(%rbx), %rdx
movq (%rdi), %rax
callq *0x60(%rax)
testl %eax, %eax
js 0x119d0
je 0x1197c
movl %eax, %eax
movq 0x20(%rbx), %rcx
imulq $0x30, %rax, %rdx
addq $0x30, %rdx
xorl %esi, %esi
leaq 0x30(%rsi), %rdi
cmpq %rdi, %rdx
je 0x119c7
cmpl $0x0, 0x8(%rcx,%rsi)
movq %rdi, %rsi
je 0x119b2
jmp 0x119d0
subq %rax, 0xd8(%rbx)
jmp 0x1197c
testq %r14, %r14
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_flush_recv
bool
ib_socket_flush_recv(struct ib_socket * const s)
{
  while (s->nr_recving) {
    const int n = ibv_poll_cq(s->cqr, s->depth, s->wc);
    if (n < 0) {
      return false;
    }
    if (n == 0) continue;
    for (int i = 0; i < n; i++) {
      if (s->wc[i].status != IBV_WC_SUCCESS) {
        return false;
      }
    }
    s->nr_recving -= n;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0xe0(%rbx), %r14
testq %r14, %r14
je 0x11a39
movl 0xc8(%rbx), %esi
movq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rdx
movq (%rdi), %rax
callq *0x60(%rax)
testl %eax, %eax
js 0x11a39
je 0x119e5
movl %eax, %eax
movq 0x20(%rbx), %rcx
imulq $0x30, %rax, %rdx
addq $0x30, %rdx
xorl %esi, %esi
leaq 0x30(%rsi), %rdi
cmpq %rdi, %rdx
je 0x11a30
cmpl $0x0, 0x8(%rcx,%rsi)
movq %rdi, %rsi
je 0x11a1b
jmp 0x11a39
subq %rax, 0xe0(%rbx)
jmp 0x119e5
testq %r14, %r14
sete %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/wuxb45[P]SLB/ib1.c
// Function: ib_socket_poll_send
bool
ib_socket_poll_send(struct ib_socket * const s, u64 * const nr)
{
  const int n = ibv_poll_cq(s->cqs, s->depth, s->wc);
  if (n >= 0) {
    *nr = n;
    s->nr_sending -= n;
    return true;
  } else {
    return false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0xc8(%rdi), %esi
movq 0x10(%rdi), %rdi
movq 0x20(%rbx), %rdx
movq (%rdi), %rax
callq *0x60(%rax)
testl %eax, %eax
js 0x11a75
movl %eax, %ecx
movq %rcx, (%r14)
subq %rcx, 0xd8(%rbx)
testl %eax, %eax
setns %al
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/xtanitfy[P]Murphy/test/test_tree.c
// Function: main
int main(void)
{
	MTREE_s *pTree = MTREE_create(NULL);

	for (int i = 0;i < DIM_OF(gArr);i++) {
		MTREE_addItem(pTree,gArr[i][0],gArr[i][1]);
	}

	printf("MTREE_forward:\n");
	MTREE_forward(pTree,forwardPrint);

	printf("MTREE_backward:\n");
	MTREE_backward(pTree,backwardPrint);

	MTREE_printByList(pTree);

	printf("MTREE_forward:\n");
	MTREE_forward(pTree,forwardPrint);

	printf("MTREE_backward:\n");
	MTREE_backward(pTree,backwardPrint);

	
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
xorl %r14d, %r14d
xorl %edi, %edi
callq 0x1268
movq %rax, %rbx
leaq 0xe61(%rip), %r15       # 0x2030
cmpq $0x1a, %r14
je 0x11eb
movl (%r15,%r14,8), %esi
movl 0x4(%r15,%r14,8), %edx
movq %rbx, %rdi
callq 0x1330
incq %r14
jmp 0x11cf
leaq 0xe1b(%rip), %r14       # 0x200d
movq %r14, %rdi
callq 0x1080
leaq -0x75(%rip), %r15       # 0x118c
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15f9
leaq 0xe09(%rip), %r12       # 0x201c
movq %r12, %rdi
callq 0x1080
leaq -0x83(%rip), %r13       # 0x119f
movq %rbx, %rdi
movq %r13, %rsi
callq 0x184d
movq %rbx, %rdi
callq 0x175c
movq %r14, %rdi
callq 0x1080
movq %rbx, %rdi
movq %r15, %rsi
callq 0x15f9
movq %r12, %rdi
callq 0x1080
movq %rbx, %rdi
movq %r13, %rsi
callq 0x184d
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O2/xtanitfy[P]Murphy/src/muti_tree.c
// Function: MTREE_create
MTREE_s *MTREE_create(void *usr)
{
	MTREE_s *pTree = (MTREE_s *)malloc(sizeof(MTREE_s));
	CHECK_EXPR_RET(pTree == NULL,NULL);
	memset(pTree,0,sizeof(MTREE_s));
	
	pTree->root = NULL;
	pTree->pQAdd = QUEUE_create(sizeof(MTREE_ITEM_s *),QUEUE_MAX_N);
	pTree->pQForward = QUEUE_create(sizeof(MTREE_ITEM_s *),QUEUE_MAX_N);
	pTree->pQBackward = QUEUE_create(sizeof(MTREE_ITEM_s *),QUEUE_MAX_N);
	pTree->num = 0;
	pTree->rootInverse = (MTREE_ITEM_s *)malloc(sizeof(MTREE_ITEM_s));
	CHECK_EXPR_RET(pTree->rootInverse == NULL,NULL);
	pTree->usr = usr;
	
	INIT_LIST_HEAD(&pTree->head);
	
	return pTree;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rdi
movl $0x90, %esi
callq 0x1040
testq %rax, %rax
je 0x12e6
movq %rax, %rbx
pushq $0x8
popq %rbp
pushq $0x40
popq %r15
movl %ebp, %edi
movl %r15d, %esi
callq 0x1a38
movq %rax, 0x10(%rbx)
movl %ebp, %edi
movl %r15d, %esi
callq 0x1a38
movq %rax, 0x18(%rbx)
movl %ebp, %edi
movl %r15d, %esi
callq 0x1a38
movq %rax, 0x20(%rbx)
movl $0xa8, %edi
callq 0x1070
movq %rax, 0x78(%rbx)
testq %rax, %rax
je 0x1301
movq %r14, 0x70(%rbx)
movq %rbx, %rax
subq $-0x80, %rax
movq %rax, 0x80(%rbx)
movq %rax, 0x88(%rbx)
jmp 0x1322
leaq 0xe13(%rip), %rdi       # 0x2100
leaq 0xe22(%rip), %rsi       # 0x2116
leaq 0xe27(%rip), %rdx       # 0x2122
xorl %ebx, %ebx
pushq $0xa
jmp 0x131a
leaq 0xdf8(%rip), %rdi       # 0x2100
leaq 0xe07(%rip), %rsi       # 0x2116
leaq 0xe0c(%rip), %rdx       # 0x2122
xorl %ebx, %ebx
pushq $0x13
popq %rcx
xorl %eax, %eax
callq 0x1030
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq