#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*/ insert_array(int, int *);
int /*<<< orphan*/ insert_matrix(int, int, int **);
int /*<<< orphan*/ make_result(int *, int *, int **, int, int);
int **malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int m, n, R[100], V[100], **A, i;
  A = malloc(sizeof(int) * 100);
  printf("Informe o valor de m:");
  scanf("%d", &m);
  printf("Informe o valor de n:");
  scanf("%d", &n);
  putchar('\n');
  puts("Informe os valores de V:");
  insert_array(n, V);
  putchar('\n');
  puts(
      "Informe os valores de A(insira os valores por coluna e nao por linha):");
  insert_matrix(n, m, A);
  putchar('\n');
  make_result(R, V, A, n, m);
  putchar('\n');
  for (i = 0; i < n; i++) {
    printf("%d ", R[i]);
  }
  putchar('\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x190,%edi
call   1080 <malloc@plt>
mov    %rax,-0x338(%rbp)
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe5e(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   10a0 <scanf@plt>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe40(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   10a0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe3f(%rip),%rdi
call   1040 <puts@plt>
mov    -0xc(%rbp),%edi
lea    -0x330(%rbp),%rsi
call   1070 <insert_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe33(%rip),%rdi
call   1040 <puts@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x338(%rbp),%rdx
call   1090 <insert_matrix@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    -0x1a0(%rbp),%rdi
lea    -0x330(%rbp),%rsi
mov    -0x338(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%r8d
call   1060 <make_result@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x33c(%rbp)
mov    -0x33c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12aa <main+0x12a>
movslq -0x33c(%rbp),%rax
mov    -0x1a0(%rbp,%rax,4),%esi
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x33c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x33c(%rbp)
jmp    126b <main+0xeb>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x330,%rsp
mov    $0x190,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe68(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   10a0 <scanf@plt>
lea    0xe57(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   10a0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe48(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%edi
lea    0x1a0(%rsp),%r14
mov    %r14,%rsi
call   1070 <insert_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe37(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
mov    %r15,%rdx
call   1090 <insert_matrix@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%r8d
lea    0x10(%rsp),%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1060 <make_result@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x8(%rsp)
jle    128c <main+0x10c>
lea    0xe2e(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jl     1270 <main+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x330,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Informe o valor de m:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Informe o valor de n:\00"
@.str.3 = [25 x i8] c"Informe os valores de V:\00"
@.str.4 = [71 x i8] c"Informe os valores de A(insira os valores por coluna e nao por linha):\00"
@.str.5 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [100 x i32]
%5 = alloca [100 x i32]
%6 = alloca i32**
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32** @malloc(i32 400)
store i32** %8, i32*** %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%13 = call i32 @putchar(i8 signext 10)
%14 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%15 = load i32, i32* %3
%16 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%17 = call i32 @insert_array(i32 %15, i32* %16)
%18 = call i32 @putchar(i8 signext 10)
%19 = call i32 @puts(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32, i32* %3
%21 = load i32, i32* %2
%22 = load i32**, i32*** %6
%23 = call i32 @insert_matrix(i32 %20, i32 %21, i32** %22)
%24 = call i32 @putchar(i8 signext 10)
%25 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%27 = load i32**, i32*** %6
%28 = load i32, i32* %3
%29 = load i32, i32* %2
%30 = call i32 @make_result(i32* %25, i32* %26, i32** %27, i32 %28, i32 %29)
%31 = call i32 @putchar(i8 signext 10)
store i32 0, i32* %7
br label %32
32: ; preds = %42, %0
%33 = load i32, i32* %7
%34 = load i32, i32* %3
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %45
36: ; preds = %32
%37 = load i32, i32* %7
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %38
%40 = load i32, i32* %39
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %40)
br label %42
42: ; preds = %36
%43 = load i32, i32* %7
%44 = add nsw i32 %43, 1
store i32 %44, i32* %7
br label %32
45: ; preds = %32
%46 = call i32 @putchar(i8 signext 10)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Informe o valor de m:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Informe o valor de n:\00"
@.str.3 = [25 x i8] c"Informe os valores de V:\00"
@.str.4 = [71 x i8] c"Informe os valores de A(insira os valores por coluna e nao por linha):\00"
@.str.5 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i32]
%4 = alloca [100 x i32]
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast [100 x i32]* %3 to i8*
%8 = bitcast [100 x i32]* %4 to i8*
%9 = tail call i32** @malloc(i32 400)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%14 = call i32 @putchar(i8 signext 10)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* %2
%17 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 0
%18 = call i32 @insert_array(i32 %16, i32* %17)
%19 = call i32 @putchar(i8 signext 10)
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.4, i64 0, i64 0))
%21 = load i32, i32* %2
%22 = load i32, i32* %1
%23 = call i32 @insert_matrix(i32 %21, i32 %22, i32** %9)
%24 = call i32 @putchar(i8 signext 10)
%25 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 0
%26 = load i32, i32* %2
%27 = load i32, i32* %1
%28 = call i32 @make_result(i32* %25, i32* %17, i32** %9, i32 %26, i32 %27)
%29 = call i32 @putchar(i8 signext 10)
%30 = load i32, i32* %2
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %41
32: ; preds = %0, %32
%33 = phi i64 [ %37, %32 ], [ 0, %0 ]
%34 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = add nuw nsw i64 %33, 1
%38 = load i32, i32* %2
%39 = sext i32 %38 to i64
%40 = icmp slt i64 %37, %39
br i1 %40, label %32, label %41
41: ; preds = %32, %0
%42 = call i32 @putchar(i8 signext 10)
ret i32 0
}