#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
void move_d(int order_r, int order_c, int c_point, char matrix[]) {
  if (c_point <= (order_r * order_c) - 1) {
    matrix[c_point] = ' ';
    matrix[c_point + order_c] = '*';
    system("cls");
  } else {
    printf("error");
  }
}


x86 assembly (clang, -O0):
<move_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jg     1178 <move_d+0x58>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    -0x8(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x2a,(%rax,%rcx,1)
lea    0xe92(%rip),%rdi
call   1030 <system@plt>
jmp    1184 <move_d+0x64>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_d>:
imul   %esi,%edi
cmp    %edx,%edi
jle    1143 <move_d+0x23>
movslq %edx,%rax
movb   $0x20,(%rcx,%rax,1)
add    %edx,%esi
movslq %esi,%rax
movb   $0x2a,(%rcx,%rax,1)
lea    0xec2(%rip),%rdi
jmp    1030 <system@plt>
lea    0xeba(%rip),%rdi
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"error\00"
define void @move_d(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i32, i32* %7
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = sub nsw i32 %12, 1
%14 = icmp sle i32 %9, %13
br i1 %14, label %15, label %27
15: ; preds = %4
%16 = load i8*, i8** %8
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 32, i8* %19
%20 = load i8*, i8** %8
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = add nsw i32 %21, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %20, i64 %24
store i8 42, i8* %25
%26 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %29
27: ; preds = %4
%28 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %27, %15
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"error\00"
define void @move_d(i32 %0, i32 %1, i32 %2, i8* nocapture writeonly %3) {
%5 = mul nsw i32 %1, %0
%6 = icmp sgt i32 %5, %2
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = sext i32 %2 to i64
%9 = getelementptr inbounds i8, i8* %3, i64 %8
store i8 32, i8* %9
%10 = add nsw i32 %2, %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %3, i64 %11
store i8 42, i8* %12
%13 = tail call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %16
14: ; preds = %4
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %7
ret void
}