#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*/ scanf(char *, int *);
int main(void) {
  int matriza[2], matrizb[3], matrizc[2 + 3], indice;
  for (indice = 0; indice < 2; indice++) {
    printf("\n digite o valor da matriz A: ");
    scanf("%d", &matriza[indice]);
    matrizc[indice] = matriza[indice];
  }
  for (indice = 0; indice < 3; indice++) {
    printf("\n digite o valor da matriz B: ");
    scanf("%d", &matrizb[indice]);
    matrizc[indice + 2] = matrizb[indice];
  }
  for (indice = 0; indice < 2 + 3; indice++)
    printf("\n Os valores das matrizes A e B sao: %d \n", matrizc[indice]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x2,-0x34(%rbp)
jge    1187 <main+0x67>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x34(%rbp),%rax
lea    -0xc(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xebb(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x34(%rbp),%rax
mov    -0xc(%rbp,%rax,4),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1136 <main+0x16>
movl   $0x0,-0x34(%rbp)
cmpl   $0x3,-0x34(%rbp)
jge    11e3 <main+0xc3>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x34(%rbp),%rax
lea    -0x18(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe63(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x34(%rbp),%rax
mov    -0x18(%rbp,%rax,4),%ecx
mov    -0x34(%rbp),%eax
add    $0x2,%eax
cltq
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    118e <main+0x6e>
movl   $0x0,-0x34(%rbp)
cmpl   $0x5,-0x34(%rbp)
jge    1218 <main+0xf8>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ea <main+0xca>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x10(%rsp),%r14d
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x14(%rsp),%r15d
lea    0xea7(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%r12d
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x8(%rsp),%r13d
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ebx
lea    0xe6c(%rip),%rbp
mov    %rbp,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"\0A digite o valor da matriz A: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"\0A digite o valor da matriz B: \00"
@.str.3 = [42 x i8] c"\0A Os valores das matrizes A e B sao: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [2 x i32]
%3 = alloca [3 x i32]
%4 = alloca [5 x i32]
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
br label %6
6: ; preds = %22, %0
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %25
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %12
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 %16
%18 = load i32, i32* %17
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 %20
store i32 %18, i32* %21
br label %22
22: ; preds = %9
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %6
25: ; preds = %6
store i32 0, i32* %5
br label %26
26: ; preds = %43, %25
%27 = load i32, i32* %5
%28 = icmp slt i32 %27, 3
br i1 %28, label %29, label %46
29: ; preds = %26
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%31 = load i32, i32* %5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %32
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %33)
%35 = load i32, i32* %5
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 2
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 %41
store i32 %38, i32* %42
br label %43
43: ; preds = %29
%44 = load i32, i32* %5
%45 = add nsw i32 %44, 1
store i32 %45, i32* %5
br label %26
46: ; preds = %26
store i32 0, i32* %5
br label %47
47: ; preds = %56, %46
%48 = load i32, i32* %5
%49 = icmp slt i32 %48, 5
br i1 %49, label %50, label %59
50: ; preds = %47
%51 = load i32, i32* %5
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 %52
%54 = load i32, i32* %53
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %54)
br label %56
56: ; preds = %50
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
br label %47
59: ; preds = %47
%60 = load i32, i32* %1
ret i32 %60
}

LLVM IR (-O2):
@.str = [31 x i8] c"\0A digite o valor da matriz A: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"\0A digite o valor da matriz B: \00"
@.str.3 = [42 x i8] c"\0A Os valores das matrizes A e B sao: %d \0A\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca [3 x i32]
%3 = bitcast [2 x i32]* %1 to i8*
%4 = bitcast [3 x i32]* %2 to i8*
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%8 = load i32, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%12 = load i32, i32* %10
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%16 = load i32, i32* %14
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
%20 = load i32, i32* %18
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%22 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %22)
%24 = load i32, i32* %22
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i32 %24)
ret i32 0
}