#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 circundantes(int, int, int **);
void matrizEstrellas(int matriz[5][20]) {
  int i, j;
  for (i = 1; i < 5 - 1; i++) {
    for (j = 1; j < 20 - 1; j++) {
      if (((matriz[i][j] + circundantes(i, j, matriz)) / 9) > 4) {
        matriz[i][j] = '*';
      } else {
        matriz[i][j] = ' ';
      }
    }
  }
}


x86 assembly (clang, -O0):
<matrizEstrellas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    11dd <matrizEstrellas+0xcd>
movl   $0x1,-0x10(%rbp)
cmpl   $0x13,-0x10(%rbp)
jge    11ca <matrizEstrellas+0xba>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1030 <circundantes@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    $0x9,%ecx
cltd
idiv   %ecx
cmp    $0x4,%eax
jle    119d <matrizEstrellas+0x8d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x2a,(%rax,%rcx,4)
jmp    11b7 <matrizEstrellas+0xa7>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movl   $0x20,(%rax,%rcx,4)
jmp    11bc <matrizEstrellas+0xac>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <matrizEstrellas+0x24>
jmp    11cf <matrizEstrellas+0xbf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <matrizEstrellas+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrizEstrellas>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
mov    $0x2a,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x54(%r14,%rbx,4),%ebp
lea    0x1(%rbx),%r15
mov    $0x1,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <circundantes@plt>
add    %ebp,%eax
cmp    $0x2d,%eax
mov    $0x20,%eax
cmovge %r12d,%eax
mov    %eax,0x54(%r14,%rbx,4)
mov    %r15,%rbx
cmp    $0x12,%r15
jne    1130 <matrizEstrellas+0x20>
xor    %ebx,%ebx
mov    $0x2a,%r12d
nopl   (%rax)
mov    0xa4(%r14,%rbx,4),%ebp
lea    0x1(%rbx),%r15
mov    $0x2,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <circundantes@plt>
add    %ebp,%eax
cmp    $0x2d,%eax
mov    $0x20,%eax
cmovge %r12d,%eax
mov    %eax,0xa4(%r14,%rbx,4)
mov    %r15,%rbx
cmp    $0x12,%r15
jne    1170 <matrizEstrellas+0x60>
xor    %ebx,%ebx
mov    $0x2a,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xf4(%r14,%rbx,4),%ebp
lea    0x1(%rbx),%r15
mov    $0x3,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <circundantes@plt>
add    %ebp,%eax
cmp    $0x2d,%eax
mov    $0x20,%eax
cmovge %r12d,%eax
mov    %eax,0xf4(%r14,%rbx,4)
mov    %r15,%rbx
cmp    $0x12,%r15
jne    11c0 <matrizEstrellas+0xb0>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @matrizEstrellas([20 x i32]* %0) {
%2 = alloca [20 x i32]*
%3 = alloca i32
%4 = alloca i32
store [20 x i32]* %0, [20 x i32]** %2
store i32 1, i32* %3
br label %5
5: ; preds = %50, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 4
br i1 %7, label %8, label %53
8: ; preds = %5
store i32 1, i32* %4
br label %9
9: ; preds = %46, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 19
br i1 %11, label %12, label %49
12: ; preds = %9
%13 = load [20 x i32]*, [20 x i32]** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [20 x i32], [20 x i32]* %13, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [20 x i32], [20 x i32]* %16, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = load [20 x i32]*, [20 x i32]** %2
%24 = bitcast [20 x i32]* %23 to i32**
%25 = call i32 @circundantes(i32 %21, i32 %22, i32** %24)
%26 = add nsw i32 %20, %25
%27 = sdiv i32 %26, 9
%28 = icmp sgt i32 %27, 4
br i1 %28, label %29, label %37
29: ; preds = %12
%30 = load [20 x i32]*, [20 x i32]** %2
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [20 x i32], [20 x i32]* %30, i64 %32
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [20 x i32], [20 x i32]* %33, i64 0, i64 %35
store i32 42, i32* %36
br label %45
37: ; preds = %12
%38 = load [20 x i32]*, [20 x i32]** %2
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [20 x i32], [20 x i32]* %38, i64 %40
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [20 x i32], [20 x i32]* %41, i64 0, i64 %43
store i32 32, i32* %44
br label %45
45: ; preds = %37, %29
br label %46
46: ; preds = %45
%47 = load i32, i32* %4
%48 = add nsw i32 %47, 1
store i32 %48, i32* %4
br label %9
49: ; preds = %9
br label %50
50: ; preds = %49
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %5
53: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @matrizEstrellas([20 x i32]* %0) {
%2 = bitcast [20 x i32]* %0 to i32**
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 1, %1 ], [ %12, %3 ]
%5 = getelementptr inbounds [20 x i32], [20 x i32]* %0, i64 1, i64 %4
%6 = load i32, i32* %5
%7 = trunc i64 %4 to i32
%8 = tail call i32 @circundantes(i32 1, i32 %7, i32** %2)
%9 = add nsw i32 %8, %6
%10 = icmp sgt i32 %9, 44
%11 = select i1 %10, i32 42, i32 32
store i32 %11, i32* %5
%12 = add nuw nsw i64 %4, 1
%13 = icmp eq i64 %12, 19
br i1 %13, label %14, label %3
14: ; preds = %3, %14
%15 = phi i64 [ %23, %14 ], [ 1, %3 ]
%16 = getelementptr inbounds [20 x i32], [20 x i32]* %0, i64 2, i64 %15
%17 = load i32, i32* %16
%18 = trunc i64 %15 to i32
%19 = tail call i32 @circundantes(i32 2, i32 %18, i32** %2)
%20 = add nsw i32 %19, %17
%21 = icmp sgt i32 %20, 44
%22 = select i1 %21, i32 42, i32 32
store i32 %22, i32* %16
%23 = add nuw nsw i64 %15, 1
%24 = icmp eq i64 %23, 19
br i1 %24, label %25, label %14
25: ; preds = %14, %25
%26 = phi i64 [ %34, %25 ], [ 1, %14 ]
%27 = getelementptr inbounds [20 x i32], [20 x i32]* %0, i64 3, i64 %26
%28 = load i32, i32* %27
%29 = trunc i64 %26 to i32
%30 = tail call i32 @circundantes(i32 3, i32 %29, i32** %2)
%31 = add nsw i32 %30, %28
%32 = icmp sgt i32 %31, 44
%33 = select i1 %32, i32 42, i32 32
store i32 %33, i32* %27
%34 = add nuw nsw i64 %26, 1
%35 = icmp eq i64 %34, 19
br i1 %35, label %36, label %25
36: ; preds = %25
ret void
}