#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*/ inter_vet(int **, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ print_matrix(int, int, int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ read_matrix(int **, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, const char *argv[]) {
  int **a, i, j, n, col = 100;
  printf("digite a quantidade de vetores\n");
  scanf("%d", &n);
  a = (int **)(malloc(n + 1 * sizeof(int *)));
  for (i = 0; i < n + 1; i++) {
    a[i] = (int *)(malloc(col * sizeof(int)));
  }
  read_matrix(a, n, col);
  print_matrix(n, col, a);
  printf("calculando a interseção\n");
  inter_vet(a, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x64,-0x28(%rbp)
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   1060 <scanf@plt>
movslq -0x24(%rbp),%rax
add    $0x8,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    11f0 <main+0x90>
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b3 <main+0x53>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
call   1050 <read_matrix@plt>
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1080 <print_matrix@plt>
lea    0xe0e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1070 <inter_vet@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
lea    0xe89(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
add    $0x8,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    0x4(%rsp),%esi
test   %esi,%esi
js     11bd <main+0x5d>
mov    $0xffffffffffffffff,%rbx
nop
mov    $0x190,%edi
call   1040 <malloc@plt>
mov    %rax,0x8(%r14,%rbx,8)
movslq 0x4(%rsp),%rsi
add    $0x1,%rbx
cmp    %rsi,%rbx
jl     11a0 <main+0x40>
mov    %r14,%rdi
mov    $0x64,%edx
call   1050 <read_matrix@plt>
mov    0x4(%rsp),%edi
mov    $0x64,%esi
mov    %r14,%rdx
call   1080 <print_matrix@plt>
lea    0xe40(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%esi
mov    %r14,%rdi
call   1070 <inter_vet@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [32 x i8] c"digite a quantidade de vetores\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"calculando a interse\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 i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 100, i32* %10
%11 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 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* %9)
%13 = load i32, i32* %9
%14 = sext i32 %13 to i64
%15 = add i64 %14, 8
%16 = trunc i64 %15 to i32
%17 = call i64 @malloc(i32 %16)
%18 = inttoptr i64 %17 to i32**
store i32** %18, i32*** %6
store i32 0, i32* %7
br label %19
19: ; preds = %35, %2
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = add nsw i32 %21, 1
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %38
24: ; preds = %19
%25 = load i32, i32* %10
%26 = sext i32 %25 to i64
%27 = mul i64 %26, 4
%28 = trunc i64 %27 to i32
%29 = call i64 @malloc(i32 %28)
%30 = inttoptr i64 %29 to i32*
%31 = load i32**, i32*** %6
%32 = load i32, i32* %7
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32*, i32** %31, i64 %33
store i32* %30, i32** %34
br label %35
35: ; preds = %24
%36 = load i32, i32* %7
%37 = add nsw i32 %36, 1
store i32 %37, i32* %7
br label %19
38: ; preds = %19
%39 = load i32**, i32*** %6
%40 = load i32, i32* %9
%41 = load i32, i32* %10
%42 = call i32 @read_matrix(i32** %39, i32 %40, i32 %41)
%43 = load i32, i32* %9
%44 = load i32, i32* %10
%45 = load i32**, i32*** %6
%46 = call i32 @print_matrix(i32 %43, i32 %44, i32** %45)
%47 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%48 = load i32**, i32*** %6
%49 = load i32, i32* %9
%50 = call i32 @inter_vet(i32** %48, i32 %49)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [31 x i8] c"digite a quantidade de vetores\00"
@str.3 = [26 x i8] c"calculando a interse\C3\A7\C3\A3o\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = add i32 %7, 8
%9 = call i64 @malloc(i32 %8)
%10 = inttoptr i64 %9 to i32**
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %22, label %13
13: ; preds = %2, %13
%14 = phi i64 [ %18, %13 ], [ 0, %2 ]
%15 = call i64 @malloc(i32 400)
%16 = inttoptr i64 %15 to i32*
%17 = getelementptr inbounds i32*, i32** %10, i64 %14
store i32* %16, i32** %17
%18 = add nuw nsw i64 %14, 1
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = icmp slt i64 %14, %20
br i1 %21, label %13, label %22
22: ; preds = %13, %2
%23 = phi i32 [ %11, %2 ], [ %19, %13 ]
%24 = call i32 @read_matrix(i32** %10, i32 %23, i32 100)
%25 = load i32, i32* %3
%26 = call i32 @print_matrix(i32 %25, i32 100, i32** %10)
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.3, i64 0, i64 0))
%28 = load i32, i32* %3
%29 = call i32 @inter_vet(i32** %10, i32 %28)
ret i32 0
}