#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*/ maker_matriz(int, int, int **);
int /*<<< orphan*/ print(int, int, int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ troca(int, int, int, int, int **);
int main(int argc, const char *argv[]) {
  int matriz[100][100], m, n, i, j;
  printf("Informe o numero de linhas da matriz:\n");
  scanf("%d", &m);
  printf("Informe o numero de colunas da matriz:\n");
  scanf("%d", &n);
  printf("Informe o numero de linhas que deseja trocar:\n");
  scanf("%d", &i);
  printf("Informe o numero da a outra linhas que deseja trocar:\n");
  scanf("%d", &j);
  maker_matriz(m, n, matriz);
  printf("matriz original:\n");
  print(m, n, matriz);
  printf("matriz com as linhas trocadas:\n");
  troca(i, j, m, n, matriz);
  print(m, n, matriz);
  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    0xe90(%rip),%rdi
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
lea    -0x9c54(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
lea    -0x9c58(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
lea    0xe6d(%rip),%rdi
lea    -0x9c5c(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
lea    0xe4e(%rip),%rdi
lea    -0x9c60(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x9c54(%rbp),%edi
mov    -0x9c58(%rbp),%esi
lea    -0x9c50(%rbp),%rdx
call   1050 <maker_matriz@plt>
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x9c54(%rbp),%edi
mov    -0x9c58(%rbp),%esi
lea    -0x9c50(%rbp),%rdx
call   1040 <print@plt>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x9c5c(%rbp),%edi
mov    -0x9c60(%rbp),%esi
mov    -0x9c54(%rbp),%edx
mov    -0x9c58(%rbp),%ecx
lea    -0x9c50(%rbp),%r8
call   1070 <troca@plt>
mov    -0x9c54(%rbp),%edi
mov    -0x9c58(%rbp),%esi
lea    -0x9c50(%rbp),%rdx
call   1040 <print@plt>
xor    %eax,%eax
add    $0x9c60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x9c50,%rsp
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeaa(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdx
call   1050 <maker_matriz@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %rbx,%rdx
call   1040 <print@plt>
lea    0xece(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%edx
mov    (%rsp),%ecx
mov    %rbx,%r8
call   1070 <troca@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %rbx,%rdx
call   1040 <print@plt>
xor    %eax,%eax
add    $0x9c50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Informe o numero de linhas da matriz:\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"Informe o numero de colunas da matriz:\0A\00"
@.str.3 = [47 x i8] c"Informe o numero de linhas que deseja trocar:\0A\00"
@.str.4 = [55 x i8] c"Informe o numero da a outra linhas que deseja trocar:\0A\00"
@.str.5 = [18 x i8] c"matriz original:\0A\00"
@.str.6 = [32 x i8] c"matriz com as linhas trocadas:\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x [100 x i32]]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, 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 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%15 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%17 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%22 = bitcast [100 x i32]* %21 to i32**
%23 = call i32 @maker_matriz(i32 %19, i32 %20, i32** %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%28 = bitcast [100 x i32]* %27 to i32**
%29 = call i32 @print(i32 %25, i32 %26, i32** %28)
%30 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
%31 = load i32, i32* %9
%32 = load i32, i32* %10
%33 = load i32, i32* %7
%34 = load i32, i32* %8
%35 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%36 = bitcast [100 x i32]* %35 to i32**
%37 = call i32 @troca(i32 %31, i32 %32, i32 %33, i32 %34, i32** %36)
%38 = load i32, i32* %7
%39 = load i32, i32* %8
%40 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %6, i64 0, i64 0
%41 = bitcast [100 x i32]* %40 to i32**
%42 = call i32 @print(i32 %38, i32 %39, i32** %41)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [38 x i8] c"Informe o numero de linhas da matriz:\00"
@str.7 = [39 x i8] c"Informe o numero de colunas da matriz:\00"
@str.8 = [46 x i8] c"Informe o numero de linhas que deseja trocar:\00"
@str.9 = [54 x i8] c"Informe o numero da a outra linhas que deseja trocar:\00"
@str.10 = [17 x i8] c"matriz original:\00"
@str.11 = [31 x i8] c"matriz com as linhas trocadas:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x [100 x i32]]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = bitcast [100 x [100 x i32]]* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.7, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.8, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.9, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = bitcast [100 x [100 x i32]]* %3 to i32**
%24 = call i32 @maker_matriz(i32 %21, i32 %22, i32** %23)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.10, i64 0, i64 0))
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = call i32 @print(i32 %26, i32 %27, i32** %23)
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.11, i64 0, i64 0))
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = call i32 @troca(i32 %30, i32 %31, i32 %32, i32 %33, i32** %23)
%35 = load i32, i32* %4
%36 = load i32, i32* %5
%37 = call i32 @print(i32 %35, i32 %36, i32** %23)
ret i32 0
}