// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/graph.c
// Function: graph_calls
static void graph_calls(struct entrypoint *ep, int internal)
{
	struct basic_block *bb;
	struct instruction *insn;

	show_ident(ep->name->ident);
	stream_name(ep->entry->bb->pos.stream);

	FOR_EACH_PTR(ep->bbs, bb) {
		if (!bb)
			continue;
		if (!bb->parents && !bb->children && !bb->insns && verbose < 2)
			continue;

		FOR_EACH_PTR(bb->insns, insn) {
			if (!insn->bb)
				continue;
			if (insn->opcode == OP_CALL &&
			    internal == !(insn->func->sym->ctype.modifiers & MOD_EXTERN)) {

				/* Find the symbol for the callee's definition */
				struct symbol * sym;
				if (insn->func->type == PSEUDO_SYM) {
					for (sym = insn->func->sym->ident->symbols;
					     sym; sym = sym->next_id) {
						if (sym->namespace & NS_SYMBOL && sym->ep)
							break;
					}

					if (sym)
						printf("bb%p -> bb%p"
						       "[label=%d,line=%d,col=%d,op=call,style=bold,weight=30];\n",
						       bb, sym->ep->entry->bb,
						       insn->pos.line, insn->pos.line, insn->pos.pos);
					else
						printf("bb%p -> \"%s\" "
						       "[label=%d,line=%d,col=%d,op=extern,style=dashed];\n",
						       bb, show_pseudo(insn->func),
						       insn->pos.line, insn->pos.line, insn->pos.pos);
				}
			}
		} END_FOR_EACH_PTR(insn);
	} END_FOR_EACH_PTR(bb);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdi
callq 0x44b40
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rax
movq (%rax), %rax
shrq $0x6, %rax
andq $0x3fff, %rax           # imm = 0x3FFF
movl %eax, %edi
callq 0x44a20
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x11d07
jmp 0x11ff7
jmp 0x11d09
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movq -0x30(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x11fdf
movq -0x30(%rbp), %rax
movslq -0x3c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x11d5b
cmpq $0x0, -0x18(%rbp)
jne 0x11d5b
jmp 0x11fd1
cmpq $0x0, -0x18(%rbp)
jne 0x11d67
jmp 0x11fd1
movq -0x18(%rbp), %rax
cmpq $0x0, 0x18(%rax)
jne 0x11d99
movq -0x18(%rbp), %rax
cmpq $0x0, 0x20(%rax)
jne 0x11d99
movq -0x18(%rbp), %rax
cmpq $0x0, 0x28(%rax)
jne 0x11d99
leaq 0x7c4b5(%rip), %rax     # 0x8e244
cmpl $0x2, (%rax)
jge 0x11d99
jmp 0x11fd1
jmp 0x11d9b
movq -0x18(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x11dc3
jmp 0x11fcf
jmp 0x11dc5
movl $0x0, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movq -0x50(%rbp), %rcx
movw (%rcx), %cx
shlw $0x8, %cx
sarw $0x8, %cx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x11fb7
movq -0x50(%rbp), %rax
movslq -0x5c(%rbp), %rcx
movq 0x18(%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x50(%rbp), %rax
movw (%rax), %ax
sarw $0x8, %ax
cwtl
cmpl $0x0, %eax
je 0x11e17
cmpq $0x0, -0x20(%rbp)
jne 0x11e17
jmp 0x11fa9
movq -0x20(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x11e27
jmp 0x11fa9
movq -0x20(%rbp), %rax
movl (%rax), %eax
andl $0x7f, %eax
cmpl $0x4a, %eax
jne 0x11fa7
movl -0xc(%rbp), %eax
movq -0x20(%rbp), %rcx
movq 0x30(%rcx), %rcx
movq 0x18(%rcx), %rcx
movq 0x68(%rcx), %rcx
andq $0x8, %rcx
cmpq $0x0, %rcx
setne %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
cmpl %ecx, %eax
jne 0x11fa7
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
cmpl $0x5, 0x4(%rax)
jne 0x11fa5
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rax
movq 0x18(%rax), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
cmpq $0x0, -0x68(%rbp)
je 0x11ecf
movq -0x68(%rbp), %rax
movl (%rax), %eax
shrl $0x8, %eax
andl $0x1ff, %eax            # imm = 0x1FF
andl $0x10, %eax
cmpl $0x0, %eax
je 0x11ebf
movq -0x68(%rbp), %rax
cmpq $0x0, 0xc0(%rax)
je 0x11ebf
jmp 0x11ecf
jmp 0x11ec1
movq -0x68(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x11e92
cmpq $0x0, -0x68(%rbp)
je 0x11f3b
movq -0x18(%rbp), %rsi
movq -0x68(%rbp), %rax
movq 0xc0(%rax), %rax
movq 0x28(%rax), %rax
movq 0x8(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, %r8d
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x16, %rax
andq $0x3ff, %rax            # imm = 0x3FF
movl %eax, %r9d
leaq 0x50271(%rip), %rdi     # 0x621a3
movb $0x0, %al
callq 0x110f0
jmp 0x11fa3
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x18870
movq -0x70(%rbp), %rsi
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, %ecx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x20, %rax
andq $0x7fffffff, %rax       # imm = 0x7FFFFFFF
movl %eax, %r8d
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
shrq $0x16, %rax
andq $0x3ff, %rax            # imm = 0x3FF
movl %eax, %r9d
leaq 0x5024c(%rip), %rdi     # 0x621e8
movb $0x0, %al
callq 0x110f0
jmp 0x11fa5
jmp 0x11fa7
jmp 0x11fa9
movl -0x5c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x5c(%rbp)
jmp 0x11dcc
jmp 0x11fb9
movq -0x50(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq -0x48(%rbp), %rax
jne 0x11dc5
jmp 0x11fd1
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x11d10
jmp 0x11fe1
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq -0x28(%rbp), %rax
jne 0x11d09
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)