// File: /workspace/github_c_makefile_star2_O1/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 0xc694(%rip), %rax      # 0x14140
movq (%rax), %rax
testq %rax, %rax
je 0x7c83
movq %rdi, %rbx
xorl %ecx, %ecx
movl $0x1, %edx
cmpl $0x13, 0x10(%rax)
cmovel %edx, %ecx
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0x7ac2
testl %ecx, %ecx
je 0x7c83
leaq 0x7d08(%rip), %rdi      # 0xf7e9
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d00(%rip), %rdi      # 0xf7fa
movl $0x15, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7cfd(%rip), %rdi      # 0xf810
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7cfd(%rip), %rdi      # 0xf829
movl $0x17, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7cfc(%rip), %rdi      # 0xf841
movl $0x1f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d03(%rip), %rdi      # 0xf861
movl $0x1f, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d0a(%rip), %rdi      # 0xf881
movl $0x20, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d12(%rip), %rdi      # 0xf8a2
movl $0x2b, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d25(%rip), %rdi      # 0xf8ce
movl $0x1e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d2b(%rip), %rdi      # 0xf8ed
movl $0x1e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d31(%rip), %rdi      # 0xf90c
movl $0x24, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d3d(%rip), %rdi      # 0xf931
movl $0x28, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d4d(%rip), %rdi      # 0xf95a
movl $0x26, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d5b(%rip), %rdi      # 0xf981
movl $0x2a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d6d(%rip), %rdi      # 0xf9ac
movl $0x2a, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x7d7f(%rip), %rdi      # 0xf9d7
movl $0x29, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
leaq 0x71aa(%rip), %rdi      # 0xee1b
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x11d0
xorl %eax, %eax
popq %rbx
retq