#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*/ imprimir(int **);
int multiplo(int);
int /*<<< orphan*/ preenche(int, int, int **);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
void main() {
  int matrix[5][5] = {0}, num, mult, mult5, mult11, mult13;
  printf("Informe o numero mult 5 || 11 || 13 ");
  scanf("%d", &num);
  mult = multiplo(num);
  switch (mult) {
  case 1:
    if (mult5 <= 5)
      preenche(mult, 1, matrix);
    imprimir(matrix);
    break;
  case 2:
    if (mult11 <= 9)
      preenche(mult, 2, matrix);
    imprimir(matrix);
    break;
  case 3:
    if (mult11 <= 9)
      preenche(mult, 2, matrix);
    imprimir(matrix);
    break;
  default:
    printf("Número não é multiplo\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,-0x20(%rbp)
movaps %xmm0,-0x30(%rbp)
movaps %xmm0,-0x40(%rbp)
movaps %xmm0,-0x50(%rbp)
movaps %xmm0,-0x60(%rbp)
movaps %xmm0,-0x70(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
lea    -0x74(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x74(%rbp),%edi
call   1030 <multiplo@plt>
mov    %eax,-0x78(%rbp)
mov    -0x78(%rbp),%eax
mov    %eax,-0x88(%rbp)
sub    $0x1,%eax
je     11e3 <main+0x93>
jmp    11bb <main+0x6b>
mov    -0x88(%rbp),%eax
sub    $0x2,%eax
je     120c <main+0xbc>
jmp    11cf <main+0x7f>
mov    -0x88(%rbp),%eax
sub    $0x3,%eax
je     1235 <main+0xe5>
jmp    125e <main+0x10e>
cmpl   $0x5,-0x7c(%rbp)
jg     11fe <main+0xae>
mov    -0x78(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x1,%esi
call   1070 <preenche@plt>
lea    -0x70(%rbp),%rdi
call   1050 <imprimir@plt>
jmp    126a <main+0x11a>
cmpl   $0x9,-0x80(%rbp)
jg     1227 <main+0xd7>
mov    -0x78(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x2,%esi
call   1070 <preenche@plt>
lea    -0x70(%rbp),%rdi
call   1050 <imprimir@plt>
jmp    126a <main+0x11a>
cmpl   $0x9,-0x80(%rbp)
jg     1250 <main+0x100>
mov    -0x78(%rbp),%edi
lea    -0x70(%rbp),%rdx
mov    $0x2,%esi
call   1070 <preenche@plt>
lea    -0x70(%rbp),%rdi
call   1050 <imprimir@plt>
jmp    126a <main+0x11a>
lea    0xdc3(%rip),%rdi
call   1040 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
lea    0xe68(%rip),%rdi
call   1050 <printf@plt>
lea    0xe81(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0xc(%rsp),%edi
call   1030 <multiplo@plt>
cmp    $0x3,%eax
je     11d7 <main+0x77>
cmp    $0x2,%eax
je     11e3 <main+0x83>
cmp    $0x1,%eax
jne    1204 <main+0xa4>
lea    0x10(%rsp),%rbx
mov    $0x1,%edi
mov    $0x1,%esi
jmp    11f2 <main+0x92>
lea    0x10(%rsp),%rbx
mov    $0x3,%edi
jmp    11ed <main+0x8d>
lea    0x10(%rsp),%rbx
mov    $0x2,%edi
mov    $0x2,%esi
mov    %rbx,%rdx
call   1080 <preenche@plt>
mov    %rbx,%rdi
call   1060 <imprimir@plt>
jmp    1210 <main+0xb0>
lea    0xe1d(%rip),%rdi
call   1040 <puts@plt>
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Informe o numero mult 5 || 11 || 13 \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"N\C3\BAmero n\C3\A3o \C3\A9 multiplo\0A\00"
define void @main() {
%1 = alloca [5 x [5 x i32]]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast [5 x [5 x i32]]* %1 to i8*
%8 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = call i32 @multiplo(i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
switch i32 %12, label %49 [
i32 1, label %13
i32 2, label %25
i32 3, label %37
]
13: ; preds = %0
%14 = load i32, i32* %4
%15 = icmp sle i32 %14, 5
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %3
%18 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0
%19 = bitcast [5 x i32]* %18 to i32**
%20 = call i32 @preenche(i32 %17, i32 1, i32** %19)
br label %21
21: ; preds = %16, %13
%22 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0
%23 = bitcast [5 x i32]* %22 to i32**
%24 = call i32 @imprimir(i32** %23)
br label %51
25: ; preds = %0
%26 = load i32, i32* %5
%27 = icmp sle i32 %26, 9
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load i32, i32* %3
%30 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0
%31 = bitcast [5 x i32]* %30 to i32**
%32 = call i32 @preenche(i32 %29, i32 2, i32** %31)
br label %33
33: ; preds = %28, %25
%34 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0
%35 = bitcast [5 x i32]* %34 to i32**
%36 = call i32 @imprimir(i32** %35)
br label %51
37: ; preds = %0
%38 = load i32, i32* %5
%39 = icmp sle i32 %38, 9
br i1 %39, label %40, label %45
40: ; preds = %37
%41 = load i32, i32* %3
%42 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0
%43 = bitcast [5 x i32]* %42 to i32**
%44 = call i32 @preenche(i32 %41, i32 2, i32** %43)
br label %45
45: ; preds = %40, %37
%46 = getelementptr inbounds [5 x [5 x i32]], [5 x [5 x i32]]* %1, i64 0, i64 0
%47 = bitcast [5 x i32]* %46 to i32**
%48 = call i32 @imprimir(i32** %47)
br label %51
49: ; preds = %0
%50 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
br label %51
51: ; preds = %49, %45, %33, %21
ret void
}

LLVM IR (-O2):
@.str = [37 x i8] c"Informe o numero mult 5 || 11 || 13 \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [25 x i8] c"N\C3\BAmero n\C3\A3o \C3\A9 multiplo\00"
define void @main() {
%1 = alloca [5 x [5 x i32]]
%2 = alloca i32
%3 = bitcast [5 x [5 x i32]]* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 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* %2)
%7 = load i32, i32* %2
%8 = call i32 @multiplo(i32 %7)
switch i32 %8, label %21 [
i32 1, label %9
i32 2, label %13
i32 3, label %17
]
9: ; preds = %0
%10 = bitcast [5 x [5 x i32]]* %1 to i32**
%11 = call i32 @preenche(i32 1, i32 1, i32** %10)
%12 = call i32 @imprimir(i32** %10)
br label %23
13: ; preds = %0
%14 = bitcast [5 x [5 x i32]]* %1 to i32**
%15 = call i32 @preenche(i32 2, i32 2, i32** %14)
%16 = call i32 @imprimir(i32** %14)
br label %23
17: ; preds = %0
%18 = bitcast [5 x [5 x i32]]* %1 to i32**
%19 = call i32 @preenche(i32 3, i32 2, i32** %18)
%20 = call i32 @imprimir(i32** %18)
br label %23
21: ; preds = %0
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %23
23: ; preds = %21, %17, %13, %9
ret void
}