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


x86 assembly (clang, -O0):
<matrizEstrellas>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11ce <matrizEstrellas+0xbe>
movl   $0x1,-0x18(%rbp)
cmpl   $0x13,-0x18(%rbp)
jge    11bb <matrizEstrellas+0xab>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1030 <circundantes@plt>
movsd  0xeaf(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xe9b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    118e <matrizEstrellas+0x7e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x2a,(%rax,%rcx,4)
jmp    11a8 <matrizEstrellas+0x98>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
imul   $0x50,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
movl   $0x20,(%rax,%rcx,4)
jmp    11ad <matrizEstrellas+0x9d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1138 <matrizEstrellas+0x28>
jmp    11c0 <matrizEstrellas+0xb0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <matrizEstrellas+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrizEstrellas>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
mov    $0x2a,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbx),%r12
mov    $0x1,%edi
mov    %r12d,%esi
mov    %r15,%rdx
call   1030 <circundantes@plt>
movsd  0xeb4(%rip),%xmm1
divsd  %xmm1,%xmm0
ucomisd 0xeb0(%rip),%xmm0
mov    $0x20,%eax
cmova  %ebp,%eax
mov    %eax,0x54(%r14,%rbx,4)
mov    %r12,%rbx
cmp    $0x12,%r12
jne    1130 <matrizEstrellas+0x20>
xor    %ebx,%ebx
mov    $0x2a,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rbx),%r12
mov    $0x2,%edi
mov    %r12d,%esi
mov    %r15,%rdx
call   1030 <circundantes@plt>
divsd  0xe64(%rip),%xmm0
ucomisd 0xe64(%rip),%xmm0
mov    $0x20,%eax
cmova  %ebp,%eax
mov    %eax,0xa4(%r14,%rbx,4)
mov    %r12,%rbx
cmp    $0x12,%r12
jne    1180 <matrizEstrellas+0x70>
xor    %ebx,%ebx
mov    $0x2a,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
lea    0x1(%rbx),%r12
mov    $0x3,%edi
mov    %r12d,%esi
mov    %r15,%rdx
call   1030 <circundantes@plt>
divsd  0xe14(%rip),%xmm0
ucomisd 0xe14(%rip),%xmm0
mov    $0x20,%eax
cmova  %ebp,%eax
mov    %eax,0xf4(%r14,%rbx,4)
mov    %r12,%rbx
cmp    $0x12,%r12
jne    11d0 <matrizEstrellas+0xc0>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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