#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*/ preencher(int **, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ teste_permutacao(int **, int, int);
int main(int argc, const char *argv[]) {
  int m, n;
  int A[100][100];
  printf("Digite a quantidade de linhas da matriz A:\n");
  scanf("%d", &m);
  printf("Digite a quantidade de colunas da matriz A:\n");
  scanf("%d", &n);
  preencher(A, m, n);
  if (teste_permutacao(A, m, n)) {
    printf("Permutação\n");
  } else {
    printf("Noh permutação");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x9c60(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1040 <preencher@plt>
lea    -0x9c60(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <teste_permutacao@plt>
cmp    $0x0,%rax
je     11d0 <main+0x90>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
jmp    11dc <main+0x9c>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x9c50,%rsp
lea    0xeb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xec0(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <preencher@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1060 <teste_permutacao@plt>
test   %rax,%rax
je     11c9 <main+0x79>
lea    0xea9(%rip),%rdi
call   1030 <puts@plt>
jmp    11d5 <main+0x85>
lea    0xe33(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x9c50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Digite a quantidade de linhas da matriz A:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [45 x i8] c"Digite a quantidade de colunas da matriz A:\0A\00"
@.str.3 = [14 x i8] c"Permuta\C3\A7\C3\A3o\0A\00"
@.str.4 = [17 x i8] c"Noh permuta\C3\A7\C3\A3o\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 [100 x [100 x i32]]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 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* %6)
%11 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 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* %7)
%13 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %8, i64 0, i64 0
%14 = bitcast [100 x i32]* %13 to i32**
%15 = load i32, i32* %6
%16 = load i32, i32* %7
%17 = call i32 @preencher(i32** %14, i32 %15, i32 %16)
%18 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %8, i64 0, i64 0
%19 = bitcast [100 x i32]* %18 to i32**
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = call i64 @teste_permutacao(i32** %19, i32 %20, i32 %21)
%23 = icmp ne i64 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %2
%25 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
br label %28
26: ; preds = %2
%27 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %28
28: ; preds = %26, %24
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [17 x i8] c"Noh permuta\C3\A7\C3\A3o\00"
@str = [43 x i8] c"Digite a quantidade de linhas da matriz A:\00"
@str.5 = [44 x i8] c"Digite a quantidade de colunas da matriz A:\00"
@str.6 = [13 x i8] c"Permuta\C3\A7\C3\A3o\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x [100 x i32]]
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast [100 x [100 x i32]]* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 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* %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.5, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%13 = bitcast [100 x [100 x i32]]* %5 to i32**
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @preencher(i32** %13, i32 %14, i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i64 @teste_permutacao(i32** %13, i32 %17, i32 %18)
%20 = icmp eq i64 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %2
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.6, i64 0, i64 0))
br label %25
23: ; preds = %2
%24 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
ret i32 0
}