#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_r(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 + 1] = '*';
    system("cls");
  } else {
    printf("error");
  }
}


x86 assembly (clang, -O0):
<move_r>:
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_r+0x58>
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x23,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x2a,(%rax,%rcx,1)
lea    0xe92(%rip),%rdi
call   1030 <system@plt>
jmp    1184 <move_r+0x64>
lea    0xe85(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_r>:
imul   %esi,%edi
cmp    %edx,%edi
jle    113c <move_r+0x1c>
movslq %edx,%rax
movw   $0x2a23,(%rcx,%rax,1)
lea    0xec9(%rip),%rdi
jmp    1030 <system@plt>
lea    0xec1(%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_r(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 %26
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 35, i8* %19
%20 = load i8*, i8** %8
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %20, i64 %23
store i8 42, i8* %24
%25 = call i32 @system(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %28
26: ; preds = %4
%27 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %15
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"cls\00"
@.str.1 = [6 x i8] c"error\00"
define void @move_r(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 35, 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
}