#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*/ free(double *);
int /*<<< orphan*/ grosor(double *, double *, int, int, int, int, int, int,
                          double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ pendientes(double *, double *, int, int);
void fibras(double *s, int n, int dim, int xsize, int ysize, int cota_superior,
            int cota_inferior, double *image) {
  double *fcs;
  fcs = (double *)malloc(n * 2 * sizeof(double));
  pendientes(s, (double *)fcs, n, dim);
  grosor(s, (double *)fcs, n, dim, xsize, ysize, cota_superior, cota_inferior,
         image);
  free(fcs);
}


x86 assembly (clang, -O0):
<fibras>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1060 <pendientes@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    0x10(%rbp),%r10d
mov    0x18(%rbp),%rax
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1040 <grosor@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibras>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,0x10(%rsp)
mov    %r8d,0x4(%rsp)
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %rdi,%rbp
mov    0x50(%rsp),%eax
mov    %rax,0x8(%rsp)
mov    0x58(%rsp),%r15
mov    %esi,%edi
shl    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rbp,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
mov    %r13d,%ecx
call   1060 <pendientes@plt>
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    0xc(%rsp),%r9d
push   %r15
push   0x18(%rsp)
push   0x28(%rsp)
call   1040 <grosor@plt>
add    $0x20,%rsp
mov    %r14,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @fibras(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, double* %7) {
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca double*
%17 = alloca double*
store double* %0, double** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store double* %7, double** %16
%18 = load i32, i32* %10
%19 = mul nsw i32 %18, 2
%20 = sext i32 %19 to i64
%21 = mul i64 %20, 8
%22 = trunc i64 %21 to i32
%23 = call i64 @malloc(i32 %22)
%24 = inttoptr i64 %23 to double*
store double* %24, double** %17
%25 = load double*, double** %9
%26 = load double*, double** %17
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = call i32 @pendientes(double* %25, double* %26, i32 %27, i32 %28)
%30 = load double*, double** %9
%31 = load double*, double** %17
%32 = load i32, i32* %10
%33 = load i32, i32* %11
%34 = load i32, i32* %12
%35 = load i32, i32* %13
%36 = load i32, i32* %14
%37 = load i32, i32* %15
%38 = load double*, double** %16
%39 = call i32 @grosor(double* %30, double* %31, i32 %32, i32 %33, i32 %34, i32 %35, i32 %36, i32 %37, double* %38)
%40 = load double*, double** %17
%41 = call i32 @free(double* %40)
ret void
}

LLVM IR (-O2):
define void @fibras(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, double* %7) {
%9 = shl i32 %1, 4
%10 = tail call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to double*
%12 = tail call i32 @pendientes(double* %0, double* %11, i32 %1, i32 %2)
%13 = tail call i32 @grosor(double* %0, double* %11, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, double* %7)
%14 = tail call i32 @free(double* %11)
ret void
}