#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*/ read_array(int, int *);
int /*<<< orphan*/ scanf(char *, int *, ...);
scalar_t__ test_function(int, int, int **, int *, int *);
int main(int argc, char const *argv[]) {
  int i, j, n, m;
  int x[100], b[100], a[100][100], resultado = 0.0;
  printf("Digite os valores de N e M: ");
  scanf("%d%d", &n, &m);
  printf("\n");
  printf("Digite os valores do vetor X\n");
  read_array(n, x);
  printf("\n");
  printf("Digite os valores do vetor B\n");
  read_array(m, b);
  printf("\n");
  printf("Digite os valores da matriz A\n");
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      printf("Digite um valor para %dº linha e %dº coluna da matriz: ", i + 1,
             j + 1);
      scanf("%d", &a[i][j]);
    }
  }
  if (test_function(n, m, a, x, b))
    printf("\nO vetor X é solução\n");
  else
    printf("\nO vetor X não é solução\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9f90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x9f84(%rbp)
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%edi
lea    -0x1b0(%rbp),%rsi
call   1050 <read_array@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%edi
lea    -0x340(%rbp),%rsi
call   1050 <read_array@plt>
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1288 <main+0x148>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1275 <main+0x135>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x18(%rbp),%edx
add    $0x1,%edx
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
lea    -0x9f80(%rbp),%rsi
imul   $0x190,%rax,%rax
add    %rax,%rsi
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1213 <main+0xd3>
jmp    127a <main+0x13a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1200 <main+0xc0>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
lea    -0x9f80(%rbp),%rdx
lea    -0x1b0(%rbp),%rcx
lea    -0x340(%rbp),%r8
call   1060 <test_function@plt>
cmp    $0x0,%rax
je     12c5 <main+0x185>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d3 <main+0x193>
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x9f90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9f78,%rsp
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe97(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%edi
lea    0x1a0(%rsp),%rsi
call   1070 <read_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%edi
lea    0x10(%rsp),%rsi
call   1070 <read_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xea3(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
test   %edi,%edi
jle    1274 <main+0x114>
lea    0x330(%rsp),%rbp
lea    0xe0f(%rip),%r14
lea    0xe05(%rip),%r15
xor    %r12d,%r12d
jmp    122f <main+0xcf>
nop
movslq %edi,%rax
add    $0x190,%rbp
cmp    %rax,%r12
jge    1274 <main+0x114>
add    $0x1,%r12
test   %esi,%esi
jle    1220 <main+0xc0>
mov    %rbp,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
add    $0x1,%rbx
mov    %r14,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movslq 0x8(%rsp),%rsi
add    $0x4,%r13
cmp    %rsi,%rbx
jl     1240 <main+0xe0>
mov    0xc(%rsp),%edi
jmp    1220 <main+0xc0>
lea    0x330(%rsp),%rdx
lea    0x1a0(%rsp),%rcx
lea    0x10(%rsp),%r8
call   1080 <test_function@plt>
test   %rax,%rax
lea    0xe1c(%rip),%rax
lea    0xe32(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x9f78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Digite os valores de N e M: \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [30 x i8] c"Digite os valores do vetor X\0A\00"
@.str.4 = [30 x i8] c"Digite os valores do vetor B\0A\00"
@.str.5 = [31 x i8] c"Digite os valores da matriz A\0A\00"
@.str.6 = [58 x i8] c"Digite um valor para %d\C2\BA linha e %d\C2\BA coluna da matriz: \00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [25 x i8] c"\0AO vetor X \C3\A9 solu\C3\A7\C3\A3o\0A\00"
@.str.9 = [30 x i8] c"\0AO vetor X n\C3\A3o \C3\A9 solu\C3\A7\C3\A3o\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [100 x i32]
%11 = alloca [100 x i32]
%12 = alloca [100 x [100 x i32]]
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %13
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%15 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
%18 = load i32, i32* %8
%19 = getelementptr inbounds [100 x i32], [100 x i32]* %10, i64 0, i64 0
%20 = call i32 @read_array(i32 %18, i32* %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%23 = load i32, i32* %9
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %11, i64 0, i64 0
%25 = call i32 @read_array(i32 %23, i32* %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %6
br label %28
28: ; preds = %54, %2
%29 = load i32, i32* %6
%30 = load i32, i32* %8
%31 = icmp slt i32 %29, %30
br i1 %31, label %32, label %57
32: ; preds = %28
store i32 0, i32* %7
br label %33
33: ; preds = %50, %32
%34 = load i32, i32* %7
%35 = load i32, i32* %9
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %53
37: ; preds = %33
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 1
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), i32 %39, i32 %41)
%43 = load i32, i32* %6
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %12, i64 0, i64 %44
%46 = load i32, i32* %7
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %45, i64 0, i64 %47
%49 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %48)
br label %50
50: ; preds = %37
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
br label %33
53: ; preds = %33
br label %54
54: ; preds = %53
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
br label %28
57: ; preds = %28
%58 = load i32, i32* %8
%59 = load i32, i32* %9
%60 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %12, i64 0, i64 0
%61 = bitcast [100 x i32]* %60 to i32**
%62 = getelementptr inbounds [100 x i32], [100 x i32]* %10, i64 0, i64 0
%63 = getelementptr inbounds [100 x i32], [100 x i32]* %11, i64 0, i64 0
%64 = call i64 @test_function(i32 %58, i32 %59, i32** %61, i32* %62, i32* %63)
%65 = icmp ne i64 %64, 0
br i1 %65, label %66, label %68
66: ; preds = %57
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
br label %70
68: ; preds = %57
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
br label %70
70: ; preds = %68, %66
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"Digite os valores de N e M: \00"
@.str.1 = [5 x i8] c"%d%d\00"
@.str.6 = [58 x i8] c"Digite um valor para %d\C2\BA linha e %d\C2\BA coluna da matriz: \00"
@.str.7 = [3 x i8] c"%d\00"
@str = [29 x i8] c"Digite os valores do vetor X\00"
@str.10 = [29 x i8] c"Digite os valores do vetor B\00"
@str.11 = [30 x i8] c"Digite os valores da matriz A\00"
@str.12 = [29 x i8] c"\0AO vetor X n\C3\A3o \C3\A9 solu\C3\A7\C3\A3o\00"
@str.13 = [24 x i8] c"\0AO vetor X \C3\A9 solu\C3\A7\C3\A3o\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i32]
%6 = alloca [100 x i32]
%7 = alloca [100 x [100 x i32]]
%8 = bitcast i32* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast [100 x i32]* %5 to i8*
%11 = bitcast [100 x i32]* %6 to i8*
%12 = bitcast [100 x [100 x i32]]* %7 to i8*
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%15 = call i32 @putchar(i32 10)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%17 = load i32, i32* %3
%18 = getelementptr inbounds [100 x i32], [100 x i32]* %5, i64 0, i64 0
%19 = call i32 @read_array(i32 %17, i32* %18)
%20 = call i32 @putchar(i32 10)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.10, i64 0, i64 0))
%22 = load i32, i32* %4
%23 = getelementptr inbounds [100 x i32], [100 x i32]* %6, i64 0, i64 0
%24 = call i32 @read_array(i32 %22, i32* %23)
%25 = call i32 @putchar(i32 10)
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.11, i64 0, i64 0))
%27 = load i32, i32* %3
%28 = icmp sgt i32 %27, 0
%29 = load i32, i32* %4
br i1 %28, label %30, label %55
30: ; preds = %2, %50
%31 = phi i32 [ %51, %50 ], [ %27, %2 ]
%32 = phi i32 [ %52, %50 ], [ %29, %2 ]
%33 = phi i64 [ %35, %50 ], [ 0, %2 ]
%34 = icmp sgt i32 %32, 0
%35 = add nuw nsw i64 %33, 1
br i1 %34, label %36, label %50
36: ; preds = %30
%37 = trunc i64 %35 to i32
br label %38
38: ; preds = %36, %38
%39 = phi i64 [ 0, %36 ], [ %40, %38 ]
%40 = add nuw nsw i64 %39, 1
%41 = trunc i64 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.6, i64 0, i64 0), i32 %37, i32 %41)
%43 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %7, i64 0, i64 %33, i64 %39
%44 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %43)
%45 = load i32, i32* %4
%46 = sext i32 %45 to i64
%47 = icmp slt i64 %40, %46
br i1 %47, label %38, label %48
48: ; preds = %38
%49 = load i32, i32* %3
br label %50
50: ; preds = %30, %48
%51 = phi i32 [ %49, %48 ], [ %31, %30 ]
%52 = phi i32 [ %45, %48 ], [ %32, %30 ]
%53 = sext i32 %51 to i64
%54 = icmp slt i64 %35, %53
br i1 %54, label %30, label %55
55: ; preds = %50, %2
%56 = phi i32 [ %29, %2 ], [ %52, %50 ]
%57 = phi i32 [ %27, %2 ], [ %51, %50 ]
%58 = bitcast [100 x [100 x i32]]* %7 to i32**
%59 = call i64 @test_function(i32 %57, i32 %56, i32** %58, i32* %18, i32* %23)
%60 = icmp eq i64 %59, 0
%61 = select i1 %60, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @str.12, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @str.13, i64 0, i64 0)
%62 = call i32 @puts(i8* dereferenceable(1) %61)
ret i32 0
}