#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
float calcula(float **, float *, char, int /*<<< orphan*/ **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ inicializa_polinomio(float *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
void derivada(float **polinomio1, float *x, char c, FILE **saida) {
  int i = 0, cont = 0;
  float valor = 0;
  float *polinomio = NULL;
  polinomio = (float *)malloc(10 * sizeof(float));
  inicializa_polinomio(polinomio);
  *(polinomio) = 0.0;
  for (i = 1; i < 10; i++) {
    if (*(*polinomio1 + i) != 0.0) {
      *(polinomio + (i - 1)) = i * (*(*polinomio1 + i));
    }
  }
  printf("Derivada %c=", c);
  fprintf(*saida, "Derivada %c=", c);
  for (i = 1; i < 10; i++) {
    if (*(polinomio + i) != 0.0) {
      if (cont == 0) {
        printf("%.2fx%d", *(polinomio + i), i);
        fprintf(*saida, "%.2fx%d", *(polinomio + i), i);
        cont = 1;
      } else {
        printf("%+.2fx%d", *(polinomio + i), i);
        fprintf(*saida, "%+.2fx%d", *(polinomio + i), i);
      }
    }
  }
  if (*(polinomio + 0) != 0.0) {
    if (cont == 0) {
      printf("%.2f", *(polinomio + 0));
      fprintf(*saida, "%.2f", *(polinomio + 0));
    } else {
      printf("%+.2f", *(polinomio + 0));
      fprintf(*saida, "%+.2f", *(polinomio + 0));
    }
  }
  if (cont == 0) {
    printf("0");
    fprintf(*saida, "0");
  }
  printf("\nDerivada ");
  fprintf(*saida, "\nDerivada ");
  valor = calcula(&polinomio, &*x, c, &*saida);
}


x86 assembly (clang, -O0):
<derivada>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movq   $0x0,-0x38(%rbp)
mov    $0x28,%edi
call   1070 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <inicializa_polinomio@plt>
mov    -0x38(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
movl   $0x1,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    1220 <derivada+0xd0>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11e6 <derivada+0x96>
jp     11e6 <derivada+0x96>
jmp    120d <derivada+0xbd>
cvtsi2ssl -0x24(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x24(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  %xmm0,(%rax,%rcx,4)
jmp    1212 <derivada+0xc2>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11b0 <derivada+0x60>
movsbl -0x11(%rbp),%esi
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
movsbl -0x11(%rbp),%edx
lea    0xdbc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x24(%rbp)
cmpl   $0xa,-0x24(%rbp)
jge    1349 <derivada+0x1f9>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1285 <derivada+0x135>
jp     1285 <derivada+0x135>
jmp    1336 <derivada+0x1e6>
cmpl   $0x0,-0x28(%rbp)
jne    12e6 <derivada+0x196>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x24(%rbp),%esi
lea    0xd63(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x24(%rbp),%edx
lea    0xd3a(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x28(%rbp)
jmp    1331 <derivada+0x1e1>
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x24(%rbp),%esi
lea    0xd14(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x24(%rbp),%edx
lea    0xceb(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    1336 <derivada+0x1e6>
jmp    133b <derivada+0x1eb>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1252 <derivada+0x102>
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    136d <derivada+0x21d>
jp     136d <derivada+0x21d>
jmp    13f7 <derivada+0x2a7>
cmpl   $0x0,-0x28(%rbp)
jne    13b7 <derivada+0x267>
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc94(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc73(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    13f2 <derivada+0x2a2>
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc59(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0x38(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc38(%rip),%rsi
mov    $0x1,%al
call   1060 <fprintf@plt>
jmp    13f7 <derivada+0x2a7>
cmpl   $0x0,-0x28(%rbp)
jne    1424 <derivada+0x2d4>
lea    0xc21(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xc0c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
lea    0xc00(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xbeb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x11(%rbp),%al
mov    -0x20(%rbp),%rcx
lea    -0x38(%rbp),%rdi
movsbl %al,%edx
call   1040 <calcula@plt>
movss  %xmm0,-0x2c(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<derivada>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r12
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x28,%edi
call   1090 <malloc@plt>
mov    %rax,%rbp
mov    %rax,0x10(%rsp)
mov    %rax,%rdi
call   1030 <inicializa_polinomio@plt>
movl   $0x0,0x0(%rbp)
mov    (%rbx),%rax
movss  0x4(%rax),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    11cd <derivada+0x4d>
jnp    11d2 <derivada+0x52>
movss  %xmm1,0x0(%rbp)
movss  0x8(%rax),%xmm1
ucomiss %xmm0,%xmm1
jne    11de <derivada+0x5e>
jnp    11e7 <derivada+0x67>
addss  %xmm1,%xmm1
movss  %xmm1,0x4(%rbp)
movss  0xc(%rax),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    11f6 <derivada+0x76>
jnp    1203 <derivada+0x83>
mulss  0xe02(%rip),%xmm1
movss  %xmm1,0x8(%rbp)
movss  0x10(%rax),%xmm1
ucomiss %xmm0,%xmm1
jne    120f <derivada+0x8f>
jnp    121c <derivada+0x9c>
mulss  0xded(%rip),%xmm1
movss  %xmm1,0xc(%rbp)
movss  0x14(%rax),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    122b <derivada+0xab>
jnp    1238 <derivada+0xb8>
mulss  0xdd5(%rip),%xmm1
movss  %xmm1,0x10(%rbp)
movss  0x18(%rax),%xmm1
ucomiss %xmm0,%xmm1
jne    1244 <derivada+0xc4>
jnp    1251 <derivada+0xd1>
mulss  0xdc0(%rip),%xmm1
movss  %xmm1,0x14(%rbp)
movss  0x1c(%rax),%xmm1
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm1
jne    1260 <derivada+0xe0>
jnp    126d <derivada+0xed>
mulss  0xda8(%rip),%xmm1
movss  %xmm1,0x18(%rbp)
movss  0x20(%rax),%xmm1
ucomiss %xmm0,%xmm1
jne    1279 <derivada+0xf9>
jnp    1286 <derivada+0x106>
mulss  0xd93(%rip),%xmm1
movss  %xmm1,0x1c(%rbp)
movss  0x24(%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1295 <derivada+0x115>
jnp    12a2 <derivada+0x122>
mulss  0xd7b(%rip),%xmm0
movss  %xmm0,0x20(%rbp)
movsbl %r15b,%r15d
lea    0xd73(%rip),%rbp
xor    %ebx,%ebx
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r12),%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x10(%rsp),%rbp
movss  0x4(%rbp),%xmm1
ucomiss 0xd3e(%rip),%xmm1
jne    12e2 <derivada+0x162>
jnp    132c <derivada+0x1ac>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xd3d(%rip),%r13
mov    $0x1,%ebx
mov    %r13,%rdi
mov    $0x1,%esi
mov    $0x1,%al
movss  %xmm1,0xc(%rsp)
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r13,%rsi
mov    $0x1,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
movss  0xc(%rsp),%xmm1
movss  0x8(%rbp),%xmm0
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm0
jne    133b <derivada+0x1bb>
jnp    138b <derivada+0x20b>
ucomiss %xmm2,%xmm1
cvtss2sd %xmm0,%xmm0
lea    0xcec(%rip),%rax
lea    0xcdd(%rip),%rbx
cmovne %rax,%rbx
cmovp  %rax,%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x2,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
xorps  %xmm2,%xmm2
mov    $0x1,%ebx
movss  0xc(%rbp),%xmm0
ucomiss %xmm2,%xmm0
jne    1397 <derivada+0x217>
jnp    13df <derivada+0x25f>
cvtss2sd %xmm0,%xmm0
test   %ebx,%ebx
lea    0xc89(%rip),%rax
lea    0xc8a(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x3,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    $0x1,%ebx
movss  0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    13ee <derivada+0x26e>
jnp    1439 <derivada+0x2b9>
cvtss2sd %xmm0,%xmm0
test   %ebx,%ebx
lea    0xc32(%rip),%rax
lea    0xc33(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x4,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
xorps  %xmm1,%xmm1
mov    $0x1,%ebx
movss  0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jne    1445 <derivada+0x2c5>
jnp    148d <derivada+0x30d>
cvtss2sd %xmm0,%xmm0
test   %ebx,%ebx
lea    0xbdb(%rip),%rax
lea    0xbdc(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x5,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    $0x1,%ebx
movss  0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    149c <derivada+0x31c>
jnp    14e7 <derivada+0x367>
cvtss2sd %xmm0,%xmm0
test   %ebx,%ebx
lea    0xb84(%rip),%rax
lea    0xb85(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x6,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
xorps  %xmm1,%xmm1
mov    $0x1,%ebx
movss  0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jne    14f3 <derivada+0x373>
jnp    153b <derivada+0x3bb>
cvtss2sd %xmm0,%xmm0
test   %ebx,%ebx
lea    0xb2d(%rip),%rax
lea    0xb2e(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x7,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    $0x1,%ebx
movss  0x20(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    154a <derivada+0x3ca>
jnp    1595 <derivada+0x415>
cvtss2sd %xmm0,%xmm0
test   %ebx,%ebx
lea    0xad6(%rip),%rax
lea    0xad7(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x8,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
xorps  %xmm1,%xmm1
mov    $0x1,%ebx
movss  0x24(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jne    15a1 <derivada+0x421>
jnp    15e9 <derivada+0x469>
cvtss2sd %xmm0,%xmm0
test   %ebx,%ebx
lea    0xa7f(%rip),%rax
lea    0xa80(%rip),%rbx
cmove  %rax,%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x9,%edx
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    $0x1,%ebx
movss  0x0(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    15f8 <derivada+0x478>
jnp    162a <derivada+0x4aa>
cvtss2sd %xmm0,%xmm0
test   %ebx,%ebx
je     1630 <derivada+0x4b0>
lea    0xa3c(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x0(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
jmp    1670 <derivada+0x4f0>
test   %ebx,%ebx
jne    1670 <derivada+0x4f0>
jmp    1658 <derivada+0x4d8>
lea    0xa07(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    (%r12),%rdi
movss  0x0(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rsi
mov    $0x1,%al
call   1080 <fprintf@plt>
mov    $0x30,%edi
call   1040 <putchar@plt>
mov    (%r12),%rsi
mov    $0x30,%edi
call   1070 <fputc@plt>
lea    0x9d2(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r12),%rcx
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rdi
call   10a0 <fwrite@plt>
lea    0x10(%rsp),%rdi
mov    %r14,%rsi
mov    %r15d,%edx
mov    %r12,%rcx
call   1050 <calcula@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Derivada %c=\00"
@.str.1 = [8 x i8] c"%.2fx%d\00"
@.str.2 = [9 x i8] c"%+.2fx%d\00"
@.str.3 = [5 x i8] c"%.2f\00"
@.str.4 = [6 x i8] c"%+.2f\00"
@.str.5 = [2 x i8] c"0\00"
@.str.6 = [11 x i8] c"\0ADerivada \00"
define void @derivada(float** %0, float* %1, i8 signext %2, i32** %3) {
%5 = alloca float**
%6 = alloca float*
%7 = alloca i8
%8 = alloca i32**
%9 = alloca i32
%10 = alloca i32
%11 = alloca float
%12 = alloca float*
store float** %0, float*** %5
store float* %1, float** %6
store i8 %2, i8* %7
store i32** %3, i32*** %8
store i32 0, i32* %9
store i32 0, i32* %10
store float 0.000000e+00, float* %11
store float* null, float** %12
%13 = call i64 @malloc(i32 40)
%14 = inttoptr i64 %13 to float*
store float* %14, float** %12
%15 = load float*, float** %12
%16 = call i32 @inicializa_polinomio(float* %15)
%17 = load float*, float** %12
store float 0.000000e+00, float* %17
store i32 1, i32* %9
br label %18
18: ; preds = %46, %4
%19 = load i32, i32* %9
%20 = icmp slt i32 %19, 10
br i1 %20, label %21, label %49
21: ; preds = %18
%22 = load float**, float*** %5
%23 = load float*, float** %22
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds float, float* %23, i64 %25
%27 = load float, float* %26
%28 = fpext float %27 to double
%29 = fcmp une double %28, 0.000000e+00
br i1 %29, label %30, label %45
30: ; preds = %21
%31 = load i32, i32* %9
%32 = sitofp i32 %31 to float
%33 = load float**, float*** %5
%34 = load float*, float** %33
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds float, float* %34, i64 %36
%38 = load float, float* %37
%39 = fmul float %32, %38
%40 = load float*, float** %12
%41 = load i32, i32* %9
%42 = sub nsw i32 %41, 1
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds float, float* %40, i64 %43
store float %39, float* %44
br label %45
45: ; preds = %30, %21
br label %46
46: ; preds = %45
%47 = load i32, i32* %9
%48 = add nsw i32 %47, 1
store i32 %48, i32* %9
br label %18
49: ; preds = %18
%50 = load i8, i8* %7
%51 = sext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = load i32**, i32*** %8
%54 = load i32*, i32** %53
%55 = load i8, i8* %7
%56 = sext i8 %55 to i32
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %54, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %56)
store i32 1, i32* %9
br label %58
58: ; preds = %112, %49
%59 = load i32, i32* %9
%60 = icmp slt i32 %59, 10
br i1 %60, label %61, label %115
61: ; preds = %58
%62 = load float*, float** %12
%63 = load i32, i32* %9
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds float, float* %62, i64 %64
%66 = load float, float* %65
%67 = fpext float %66 to double
%68 = fcmp une double %67, 0.000000e+00
br i1 %68, label %69, label %111
69: ; preds = %61
%70 = load i32, i32* %10
%71 = icmp eq i32 %70, 0
br i1 %71, label %72, label %91
72: ; preds = %69
%73 = load float*, float** %12
%74 = load i32, i32* %9
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds float, float* %73, i64 %75
%77 = load float, float* %76
%78 = fpext float %77 to double
%79 = load i32, i32* %9
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %78, i32 %79)
%81 = load i32**, i32*** %8
%82 = load i32*, i32** %81
%83 = load float*, float** %12
%84 = load i32, i32* %9
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds float, float* %83, i64 %85
%87 = load float, float* %86
%88 = fpext float %87 to double
%89 = load i32, i32* %9
%90 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %88, i32 %89)
store i32 1, i32* %10
br label %110
91: ; preds = %69
%92 = load float*, float** %12
%93 = load i32, i32* %9
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds float, float* %92, i64 %94
%96 = load float, float* %95
%97 = fpext float %96 to double
%98 = load i32, i32* %9
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %97, i32 %98)
%100 = load i32**, i32*** %8
%101 = load i32*, i32** %100
%102 = load float*, float** %12
%103 = load i32, i32* %9
%104 = sext i32 %103 to i64
%105 = getelementptr inbounds float, float* %102, i64 %104
%106 = load float, float* %105
%107 = fpext float %106 to double
%108 = load i32, i32* %9
%109 = call i32 (i32*, i8*, ...) @fprintf(i32* %101, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), double %107, i32 %108)
br label %110
110: ; preds = %91, %72
br label %111
111: ; preds = %110, %61
br label %112
112: ; preds = %111
%113 = load i32, i32* %9
%114 = add nsw i32 %113, 1
store i32 %114, i32* %9
br label %58
115: ; preds = %58
%116 = load float*, float** %12
%117 = getelementptr inbounds float, float* %116, i64 0
%118 = load float, float* %117
%119 = fpext float %118 to double
%120 = fcmp une double %119, 0.000000e+00
br i1 %120, label %121, label %151
121: ; preds = %115
%122 = load i32, i32* %10
%123 = icmp eq i32 %122, 0
br i1 %123, label %124, label %137
124: ; preds = %121
%125 = load float*, float** %12
%126 = getelementptr inbounds float, float* %125, i64 0
%127 = load float, float* %126
%128 = fpext float %127 to double
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %128)
%130 = load i32**, i32*** %8
%131 = load i32*, i32** %130
%132 = load float*, float** %12
%133 = getelementptr inbounds float, float* %132, i64 0
%134 = load float, float* %133
%135 = fpext float %134 to double
%136 = call i32 (i32*, i8*, ...) @fprintf(i32* %131, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %135)
br label %150
137: ; preds = %121
%138 = load float*, float** %12
%139 = getelementptr inbounds float, float* %138, i64 0
%140 = load float, float* %139
%141 = fpext float %140 to double
%142 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %141)
%143 = load i32**, i32*** %8
%144 = load i32*, i32** %143
%145 = load float*, float** %12
%146 = getelementptr inbounds float, float* %145, i64 0
%147 = load float, float* %146
%148 = fpext float %147 to double
%149 = call i32 (i32*, i8*, ...) @fprintf(i32* %144, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %148)
br label %150
150: ; preds = %137, %124
br label %151
151: ; preds = %150, %115
%152 = load i32, i32* %10
%153 = icmp eq i32 %152, 0
br i1 %153, label %154, label %159
154: ; preds = %151
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%156 = load i32**, i32*** %8
%157 = load i32*, i32** %156
%158 = call i32 (i32*, i8*, ...) @fprintf(i32* %157, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %159
159: ; preds = %154, %151
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%161 = load i32**, i32*** %8
%162 = load i32*, i32** %161
%163 = call i32 (i32*, i8*, ...) @fprintf(i32* %162, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%164 = load float*, float** %6
%165 = load i8, i8* %7
%166 = load i32**, i32*** %8
%167 = call float @calcula(float** %12, float* %164, i8 signext %165, i32** %166)
store float %167, float* %11
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"Derivada %c=\00"
@.str.1 = [8 x i8] c"%.2fx%d\00"
@.str.2 = [9 x i8] c"%+.2fx%d\00"
@.str.3 = [5 x i8] c"%.2f\00"
@.str.4 = [6 x i8] c"%+.2f\00"
@.str.6 = [11 x i8] c"\0ADerivada \00"
define void @derivada(float** nocapture %0, float* %1, i8 signext %2, i32** %3) {
%5 = alloca float*
%6 = bitcast float** %5 to i8*
%7 = tail call i64 @malloc(i32 40)
%8 = inttoptr i64 %7 to float*
store float* %8, float** %5
%9 = tail call i32 @inicializa_polinomio(float* %8)
store float 0.000000e+00, float* %8
%10 = load float*, float** %0
%11 = getelementptr inbounds float, float* %10, i64 1
%12 = load float, float* %11
%13 = fcmp une float %12, 0.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %4
store float %12, float* %8
br label %15
15: ; preds = %4, %14
%16 = getelementptr inbounds float, float* %10, i64 2
%17 = load float, float* %16
%18 = fcmp une float %17, 0.000000e+00
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = fmul float %17, 2.000000e+00
%21 = getelementptr inbounds float, float* %8, i64 1
store float %20, float* %21
br label %22
22: ; preds = %19, %15
%23 = getelementptr inbounds float, float* %10, i64 3
%24 = load float, float* %23
%25 = fcmp une float %24, 0.000000e+00
br i1 %25, label %26, label %29
26: ; preds = %22
%27 = fmul float %24, 3.000000e+00
%28 = getelementptr inbounds float, float* %8, i64 2
store float %27, float* %28
br label %29
29: ; preds = %26, %22
%30 = getelementptr inbounds float, float* %10, i64 4
%31 = load float, float* %30
%32 = fcmp une float %31, 0.000000e+00
br i1 %32, label %33, label %36
33: ; preds = %29
%34 = fmul float %31, 4.000000e+00
%35 = getelementptr inbounds float, float* %8, i64 3
store float %34, float* %35
br label %36
36: ; preds = %33, %29
%37 = getelementptr inbounds float, float* %10, i64 5
%38 = load float, float* %37
%39 = fcmp une float %38, 0.000000e+00
br i1 %39, label %40, label %43
40: ; preds = %36
%41 = fmul float %38, 5.000000e+00
%42 = getelementptr inbounds float, float* %8, i64 4
store float %41, float* %42
br label %43
43: ; preds = %40, %36
%44 = getelementptr inbounds float, float* %10, i64 6
%45 = load float, float* %44
%46 = fcmp une float %45, 0.000000e+00
br i1 %46, label %47, label %50
47: ; preds = %43
%48 = fmul float %45, 6.000000e+00
%49 = getelementptr inbounds float, float* %8, i64 5
store float %48, float* %49
br label %50
50: ; preds = %47, %43
%51 = getelementptr inbounds float, float* %10, i64 7
%52 = load float, float* %51
%53 = fcmp une float %52, 0.000000e+00
br i1 %53, label %54, label %57
54: ; preds = %50
%55 = fmul float %52, 7.000000e+00
%56 = getelementptr inbounds float, float* %8, i64 6
store float %55, float* %56
br label %57
57: ; preds = %54, %50
%58 = getelementptr inbounds float, float* %10, i64 8
%59 = load float, float* %58
%60 = fcmp une float %59, 0.000000e+00
br i1 %60, label %61, label %64
61: ; preds = %57
%62 = fmul float %59, 8.000000e+00
%63 = getelementptr inbounds float, float* %8, i64 7
store float %62, float* %63
br label %64
64: ; preds = %61, %57
%65 = getelementptr inbounds float, float* %10, i64 9
%66 = load float, float* %65
%67 = fcmp une float %66, 0.000000e+00
br i1 %67, label %68, label %71
68: ; preds = %64
%69 = fmul float %66, 9.000000e+00
%70 = getelementptr inbounds float, float* %8, i64 8
store float %69, float* %70
br label %71
71: ; preds = %68, %64
%72 = sext i8 %2 to i32
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %72)
%74 = load i32*, i32** %3
%75 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %74, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %72)
%76 = load float*, float** %5
%77 = getelementptr inbounds float, float* %76, i64 1
%78 = load float, float* %77
%79 = fcmp une float %78, 0.000000e+00
br i1 %79, label %80, label %87
80: ; preds = %71
%81 = fpext float %78 to double
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %81, i32 1)
%83 = load i32*, i32** %3
%84 = load float, float* %77
%85 = fpext float %84 to double
%86 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %83, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %85, i32 1)
br label %87
87: ; preds = %80, %71
%88 = phi i32 [ 0, %71 ], [ 1, %80 ]
%89 = getelementptr inbounds float, float* %76, i64 2
%90 = load float, float* %89
%91 = fcmp une float %90, 0.000000e+00
br i1 %91, label %92, label %100
92: ; preds = %87
%93 = fpext float %90 to double
%94 = select i1 %79, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0)
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %94, double %93, i32 2)
%96 = load i32*, i32** %3
%97 = load float, float* %89
%98 = fpext float %97 to double
%99 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %96, i8* %94, double %98, i32 2)
br label %100
100: ; preds = %92, %87
%101 = phi i32 [ %88, %87 ], [ 1, %92 ]
%102 = getelementptr inbounds float, float* %76, i64 3
%103 = load float, float* %102
%104 = fcmp une float %103, 0.000000e+00
br i1 %104, label %105, label %114
105: ; preds = %100
%106 = fpext float %103 to double
%107 = icmp eq i32 %101, 0
%108 = select i1 %107, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %108, double %106, i32 3)
%110 = load i32*, i32** %3
%111 = load float, float* %102
%112 = fpext float %111 to double
%113 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %110, i8* %108, double %112, i32 3)
br label %114
114: ; preds = %105, %100
%115 = phi i32 [ %101, %100 ], [ 1, %105 ]
%116 = getelementptr inbounds float, float* %76, i64 4
%117 = load float, float* %116
%118 = fcmp une float %117, 0.000000e+00
br i1 %118, label %119, label %128
119: ; preds = %114
%120 = fpext float %117 to double
%121 = icmp eq i32 %115, 0
%122 = select i1 %121, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%123 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %122, double %120, i32 4)
%124 = load i32*, i32** %3
%125 = load float, float* %116
%126 = fpext float %125 to double
%127 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %124, i8* %122, double %126, i32 4)
br label %128
128: ; preds = %119, %114
%129 = phi i32 [ %115, %114 ], [ 1, %119 ]
%130 = getelementptr inbounds float, float* %76, i64 5
%131 = load float, float* %130
%132 = fcmp une float %131, 0.000000e+00
br i1 %132, label %133, label %142
133: ; preds = %128
%134 = fpext float %131 to double
%135 = icmp eq i32 %129, 0
%136 = select i1 %135, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%137 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %136, double %134, i32 5)
%138 = load i32*, i32** %3
%139 = load float, float* %130
%140 = fpext float %139 to double
%141 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %138, i8* %136, double %140, i32 5)
br label %142
142: ; preds = %133, %128
%143 = phi i32 [ %129, %128 ], [ 1, %133 ]
%144 = getelementptr inbounds float, float* %76, i64 6
%145 = load float, float* %144
%146 = fcmp une float %145, 0.000000e+00
br i1 %146, label %147, label %156
147: ; preds = %142
%148 = fpext float %145 to double
%149 = icmp eq i32 %143, 0
%150 = select i1 %149, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%151 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %150, double %148, i32 6)
%152 = load i32*, i32** %3
%153 = load float, float* %144
%154 = fpext float %153 to double
%155 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %152, i8* %150, double %154, i32 6)
br label %156
156: ; preds = %147, %142
%157 = phi i32 [ %143, %142 ], [ 1, %147 ]
%158 = getelementptr inbounds float, float* %76, i64 7
%159 = load float, float* %158
%160 = fcmp une float %159, 0.000000e+00
br i1 %160, label %161, label %170
161: ; preds = %156
%162 = fpext float %159 to double
%163 = icmp eq i32 %157, 0
%164 = select i1 %163, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%165 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %164, double %162, i32 7)
%166 = load i32*, i32** %3
%167 = load float, float* %158
%168 = fpext float %167 to double
%169 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* %164, double %168, i32 7)
br label %170
170: ; preds = %161, %156
%171 = phi i32 [ %157, %156 ], [ 1, %161 ]
%172 = getelementptr inbounds float, float* %76, i64 8
%173 = load float, float* %172
%174 = fcmp une float %173, 0.000000e+00
br i1 %174, label %175, label %184
175: ; preds = %170
%176 = fpext float %173 to double
%177 = icmp eq i32 %171, 0
%178 = select i1 %177, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%179 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %178, double %176, i32 8)
%180 = load i32*, i32** %3
%181 = load float, float* %172
%182 = fpext float %181 to double
%183 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %180, i8* %178, double %182, i32 8)
br label %184
184: ; preds = %175, %170
%185 = phi i32 [ %171, %170 ], [ 1, %175 ]
%186 = getelementptr inbounds float, float* %76, i64 9
%187 = load float, float* %186
%188 = fcmp une float %187, 0.000000e+00
br i1 %188, label %189, label %198
189: ; preds = %184
%190 = fpext float %187 to double
%191 = icmp eq i32 %185, 0
%192 = select i1 %191, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0)
%193 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %192, double %190, i32 9)
%194 = load i32*, i32** %3
%195 = load float, float* %186
%196 = fpext float %195 to double
%197 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %194, i8* %192, double %196, i32 9)
br label %198
198: ; preds = %189, %184
%199 = phi i32 [ %185, %184 ], [ 1, %189 ]
%200 = load float, float* %76
%201 = fpext float %200 to double
%202 = fcmp une float %200, 0.000000e+00
%203 = icmp eq i32 %199, 0
br i1 %202, label %204, label %217
204: ; preds = %198
br i1 %203, label %205, label %211
205: ; preds = %204
%206 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %201)
%207 = load i32*, i32** %3
%208 = load float, float* %76
%209 = fpext float %208 to double
%210 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %207, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), double %209)
br label %218
211: ; preds = %204
%212 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %201)
%213 = load i32*, i32** %3
%214 = load float, float* %76
%215 = fpext float %214 to double
%216 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %213, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %215)
br label %222
217: ; preds = %198
br i1 %203, label %218, label %222
218: ; preds = %205, %217
%219 = tail call i32 @putchar(i32 48)
%220 = load i32*, i32** %3
%221 = tail call i32 @fputc(i32 48, i32* %220)
br label %222
222: ; preds = %211, %218, %217
%223 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%224 = load i32*, i32** %3
%225 = tail call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i64 10, i64 1, i32* %224)
%226 = call float @calcula(float** %5, float* %1, i8 signext %2, i32** %3)
ret void
}