// File: /workspace/github_c_makefile_star2_O3/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 %rbx
leaq 0xc7a8(%rip), %rax      # 0x14130
movq (%rax), %rax
testq %rax, %rax
je 0x7b5f
movq %rdi, %rbx
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x13, 0x10(%rax)
cmovel %edx, %ecx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x799e
testl %ecx, %ecx
je 0x7b5f
leaq 0x7e20(%rip), %rdi      # 0xf7dd
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e18(%rip), %rdi      # 0xf7ee
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e15(%rip), %rdi      # 0xf804
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e15(%rip), %rdi      # 0xf81d
movl $0x17, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e14(%rip), %rdi      # 0xf835
movl $0x1f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e1b(%rip), %rdi      # 0xf855
movl $0x1f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e22(%rip), %rdi      # 0xf875
movl $0x20, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e2a(%rip), %rdi      # 0xf896
movl $0x2b, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e3d(%rip), %rdi      # 0xf8c2
movl $0x1e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e43(%rip), %rdi      # 0xf8e1
movl $0x1e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e49(%rip), %rdi      # 0xf900
movl $0x24, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e55(%rip), %rdi      # 0xf925
movl $0x28, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e65(%rip), %rdi      # 0xf94e
movl $0x26, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e73(%rip), %rdi      # 0xf975
movl $0x2a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e85(%rip), %rdi      # 0xf9a0
movl $0x2a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x7e97(%rip), %rdi      # 0xf9cb
movl $0x29, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
leaq 0x72c2(%rip), %rdi      # 0xee0f
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11c0
xorl %eax, %eax
popq %rbx
retq