// File: /workspace/github_c_makefile_star2_O0/aquaxis[P]synverll/src/parser_ir_proc.c
// Function: output_verilog_sdiv
int output_verilog_sdiv(FILE *fp)
{
	PARSER_TREE_IR *now_parser_tree_ir = parser_tree_ir_top;
	int is_sdiv = 0;

    while(now_parser_tree_ir != NULL){
		if(now_parser_tree_ir->flag == PARSER_IR_FLAG_SCALL){
			is_sdiv = 1;
		}
        now_parser_tree_ir = now_parser_tree_ir->next_ptr;
	}

	if(!is_sdiv){
		return 0;
	}

	fprintf(fp, "// sdiv module;\n");
	fprintf(fp, "reg __call_sdiv_req;\n");
	fprintf(fp, "wire __call_sdiv_ready;\n");
	fprintf(fp, "wire __call_sdiv_done;\n");
	fprintf(fp, "reg [31:0] __call_sdiv_args_0;\n");
	fprintf(fp, "reg [31:0] __call_sdiv_args_1;\n");
	fprintf(fp, "wire [31:0] __call_sdiv_result;\n");

	fprintf(fp, "synverll_sdiv_32x32 u_synverll_sdiv_32x32(\n");
	fprintf(fp, "\t.system_clock(__func_clock),\n");
	fprintf(fp, "\t.system_reset(__func_reset),\n");

	fprintf(fp, "\t.__call_sdiv_req(__call_sdiv_req),\n");
	fprintf(fp, "\t.__call_sdiv_ready(__call_sdiv_ready),\n");
	fprintf(fp, "\t.__call_sdiv_done(__call_sdiv_done),\n");
	fprintf(fp, "\t.__call_sdiv_args_0(__call_sdiv_args_0),\n");
	fprintf(fp, "\t.__call_sdiv_args_1(__call_sdiv_args_1),\n");
	fprintf(fp, "\t.__call_sdiv_result(__call_sdiv_result)\n");

	fprintf(fp, ");\n\n");

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
leaq 0xd86d(%rip), %rax      # 0x18110
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0xa8d7
movq -0x18(%rbp), %rax
cmpl $0x13, 0x10(%rax)
jne 0xa8c9
movl $0x1, -0x1c(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0xa8b1
cmpl $0x0, -0x1c(%rbp)
jne 0xa8e9
movl $0x0, -0x4(%rbp)
jmp 0xaa22
movq -0x10(%rbp), %rdi
leaq 0x9f3e(%rip), %rsi      # 0x14832
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9f3d(%rip), %rsi      # 0x14843
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9f41(%rip), %rsi      # 0x14859
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9f48(%rip), %rsi      # 0x14872
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9f4e(%rip), %rsi      # 0x1488a
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9f5c(%rip), %rsi      # 0x148aa
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9f6a(%rip), %rsi      # 0x148ca
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9f79(%rip), %rsi      # 0x148eb
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9f93(%rip), %rsi      # 0x14917
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9fa0(%rip), %rsi      # 0x14936
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9fad(%rip), %rsi      # 0x14955
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9fc0(%rip), %rsi      # 0x1497a
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9fd7(%rip), %rsi      # 0x149a3
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x9fec(%rip), %rsi      # 0x149ca
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0xa005(%rip), %rsi      # 0x149f5
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0xa01e(%rip), %rsi      # 0x14a20
movb $0x0, %al
callq 0x10e0
movq -0x10(%rbp), %rdi
leaq 0x93ff(%rip), %rsi      # 0x13e13
movb $0x0, %al
callq 0x10e0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)