#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 */
float escalon(float);
float exponencial(float);
float logaritmica(float);
float loglineal(float);
float mrua(int, int, int, float);
float paraboloide(int, int, float);
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
float senoidal(int, int, float, int);
int muestras(int tiempoinicial, int tiempofinal, int numero_muestras,
             int opcion) {
  float s = (tiempofinal - tiempoinicial) / numero_muestras, resultado, t;
  int amplitud, frecuencia, angulo_inicial;
  int pos_inicial, vel_inicial, aceleracion;
  int a, b, i = 0;
  switch (opcion) {
  case 1:
    puts("amplitud:");
    scanf("%d", &amplitud);
    puts("frecuencia:");
    scanf("%d", &frecuencia);
    puts("angulo inicial:");
    scanf("%d", &angulo_inicial);
    for (i = 0; i < numero_muestras; i++) {
      t = tiempoinicial + numero_muestras * i * s;
      resultado = senoidal(amplitud, frecuencia, t, angulo_inicial);
      printf("%lf\n", resultado);
    }
    break;
  case 2:
    for (i = 0; i < numero_muestras; i++) {
      t = tiempoinicial + numero_muestras * i * s;
      resultado = logaritmica(t);
      printf("%lf\n", resultado);
    }
    break;
  case 3:
    for (i = 0; i < numero_muestras; i++) {
      t = tiempoinicial + numero_muestras * i * s;
      resultado = loglineal(t);
      printf("%lf\n", resultado);
    }
    break;
  case 4:
    for (i = 0; i < numero_muestras; i++) {
      t = tiempoinicial + numero_muestras * i * s;
      resultado = exponencial(t);
      printf("%lf\n", resultado);
    }
    break;
  case 5:
    for (i = 0; i < numero_muestras; i++) {
      t = tiempoinicial + numero_muestras * i * s;
      resultado = escalon(t);
      printf("%lf\n", resultado);
    }
    break;
  case 6:
    puts("pos_inicial:");
    scanf("%d", &pos_inicial);
    puts("vel_inicial:");
    scanf("%d", &vel_inicial);
    puts("aceleracion:");
    scanf("%d", &aceleracion);
    for (i = 0; i < numero_muestras; i++) {
      t = tiempoinicial + numero_muestras * i * s;
      resultado = mrua(pos_inicial, vel_inicial, aceleracion, t);
      printf("%lf\n", resultado);
    }
    break;
  case 7:
    puts("a:");
    scanf("%d", &a);
    puts("b:");
    scanf("%d", &b);
    for (i = 0; i < numero_muestras; i++) {
      t = tiempoinicial + numero_muestras * i * s;
      resultado = paraboloide(a, b, t);
      printf("%lf\n", resultado);
    }
    break;
  }
}


x86 assembly (clang, -O0):
<muestras>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    -0x10(%rbp),%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0x6,%eax
ja     15cb <muestras+0x42b>
mov    -0x50(%rbp),%rax
lea    0xe0e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe1a(%rip),%rdi
call   1050 <puts@plt>
lea    0xe18(%rip),%rdi
lea    -0x24(%rbp),%rsi
call   10a0 <scanf@plt>
lea    0xe0b(%rip),%rdi
call   1050 <puts@plt>
lea    0xdfc(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   10a0 <scanf@plt>
lea    0xdfb(%rip),%rdi
call   1050 <puts@plt>
lea    0xde0(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   10a0 <scanf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    12bb <muestras+0x11b>
cvtsi2ssl -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%eax
imul   -0x44(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
movss  -0x20(%rbp),%xmm0
mov    -0x2c(%rbp),%edx
call   1030 <senoidal@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xd9d(%rip),%rdi
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1256 <muestras+0xb6>
jmp    15cb <muestras+0x42b>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1323 <muestras+0x183>
cvtsi2ssl -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%eax
imul   -0x44(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
call   1040 <logaritmica@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xd35(%rip),%rdi
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12c7 <muestras+0x127>
jmp    15cb <muestras+0x42b>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    138b <muestras+0x1eb>
cvtsi2ssl -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%eax
imul   -0x44(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
call   1060 <loglineal@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xccd(%rip),%rdi
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    132f <muestras+0x18f>
jmp    15cb <muestras+0x42b>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    13f3 <muestras+0x253>
cvtsi2ssl -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%eax
imul   -0x44(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
call   1090 <exponencial@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xc65(%rip),%rdi
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1397 <muestras+0x1f7>
jmp    15cb <muestras+0x42b>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    145b <muestras+0x2bb>
cvtsi2ssl -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%eax
imul   -0x44(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
call   10b0 <escalon@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xbfd(%rip),%rdi
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    13ff <muestras+0x25f>
jmp    15cb <muestras+0x42b>
lea    0xbe3(%rip),%rdi
call   1050 <puts@plt>
lea    0xbb3(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   10a0 <scanf@plt>
lea    0xbd4(%rip),%rdi
call   1050 <puts@plt>
lea    0xb97(%rip),%rdi
lea    -0x34(%rbp),%rsi
call   10a0 <scanf@plt>
lea    0xbc5(%rip),%rdi
call   1050 <puts@plt>
lea    0xb7b(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   10a0 <scanf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1520 <muestras+0x380>
cvtsi2ssl -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%eax
imul   -0x44(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x30(%rbp),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
movss  -0x20(%rbp),%xmm0
call   1080 <mrua@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xb38(%rip),%rdi
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    14bb <muestras+0x31b>
jmp    15cb <muestras+0x42b>
lea    0xb06(%rip),%rdi
call   1050 <puts@plt>
lea    0xaee(%rip),%rdi
lea    -0x3c(%rbp),%rsi
call   10a0 <scanf@plt>
lea    0xb29(%rip),%rdi
call   1050 <puts@plt>
lea    0xad2(%rip),%rdi
lea    -0x40(%rbp),%rsi
call   10a0 <scanf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    15c6 <muestras+0x426>
cvtsi2ssl -0x8(%rbp),%xmm1
mov    -0x10(%rbp),%eax
imul   -0x44(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  -0x18(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x20(%rbp)
mov    -0x3c(%rbp),%edi
mov    -0x40(%rbp),%esi
movss  -0x20(%rbp),%xmm0
call   10c0 <paraboloide@plt>
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
lea    0xa92(%rip),%rdi
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1564 <muestras+0x3c4>
jmp    15cb <muestras+0x42b>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<muestras>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edx,%r15d
mov    %esi,%eax
sub    %edi,%eax
cltd
idiv   %r15d
add    $0xffffffff,%ecx
cmp    $0x6,%ecx
ja     1534 <muestras+0x394>
mov    %edi,%ebp
cvtsi2ss %eax,%xmm1
lea    0xe32(%rip),%rax
movslq (%rax,%rcx,4),%rcx
add    %rax,%rcx
movss  %xmm1,0x8(%rsp)
jmp    *%rcx
lea    0xe38(%rip),%rdi
call   1050 <puts@plt>
lea    0xe36(%rip),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
lea    0xe25(%rip),%rdi
call   1050 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
lea    0xe18(%rip),%rdi
call   1050 <puts@plt>
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
movss  0x8(%rsp),%xmm1
test   %r15d,%r15d
jle    1534 <muestras+0x394>
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %ebp,%ebp
lea    0xdf4(%rip),%r14
mov    %r15d,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
mulss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
call   1030 <senoidal@plt>
mov    %r14,%rdi
call   1070 <printf@plt>
movss  0x8(%rsp),%xmm1
add    %r15d,%ebp
add    $0xffffffff,%ebx
jne    1260 <muestras+0xc0>
jmp    1534 <muestras+0x394>
test   %r15d,%r15d
jle    1534 <muestras+0x394>
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %ebx,%ebx
lea    0xd8c(%rip),%r14
mov    %r15d,%ebp
nopl   0x0(%rax)
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mulss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
call   1040 <logaritmica@plt>
mov    %r14,%rdi
call   1070 <printf@plt>
movss  0x8(%rsp),%xmm1
add    %r15d,%ebx
add    $0xffffffff,%ebp
jne    12c0 <muestras+0x120>
jmp    1534 <muestras+0x394>
test   %r15d,%r15d
jle    1534 <muestras+0x394>
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %ebx,%ebx
lea    0xd38(%rip),%r14
mov    %r15d,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mulss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
call   1060 <loglineal@plt>
mov    %r14,%rdi
call   1070 <printf@plt>
movss  0x8(%rsp),%xmm1
add    %r15d,%ebx
add    $0xffffffff,%ebp
jne    1310 <muestras+0x170>
jmp    1534 <muestras+0x394>
test   %r15d,%r15d
jle    1534 <muestras+0x394>
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %ebx,%ebx
lea    0xce8(%rip),%r14
mov    %r15d,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mulss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
call   1090 <exponencial@plt>
mov    %r14,%rdi
call   1070 <printf@plt>
movss  0x8(%rsp),%xmm1
add    %r15d,%ebx
add    $0xffffffff,%ebp
jne    1360 <muestras+0x1c0>
jmp    1534 <muestras+0x394>
test   %r15d,%r15d
jle    1534 <muestras+0x394>
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %ebx,%ebx
lea    0xc98(%rip),%r14
mov    %r15d,%ebp
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
mulss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
call   10b0 <escalon@plt>
mov    %r14,%rdi
call   1070 <printf@plt>
movss  0x8(%rsp),%xmm1
add    %r15d,%ebx
add    $0xffffffff,%ebp
jne    13b0 <muestras+0x210>
jmp    1534 <muestras+0x394>
lea    0xc62(%rip),%rdi
call   1050 <puts@plt>
lea    0xc32(%rip),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
lea    0xc4f(%rip),%rdi
call   1050 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
lea    0xc43(%rip),%rdi
call   1050 <puts@plt>
lea    0x14(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
movss  0x8(%rsp),%xmm1
test   %r15d,%r15d
jle    1534 <muestras+0x394>
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %ebp,%ebp
lea    0xbf0(%rip),%r14
mov    %r15d,%ebx
nopl   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
mulss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
call   1080 <mrua@plt>
mov    %r14,%rdi
call   1070 <printf@plt>
movss  0x8(%rsp),%xmm1
add    %r15d,%ebp
add    $0xffffffff,%ebx
jne    1460 <muestras+0x2c0>
jmp    1534 <muestras+0x394>
lea    0xb8e(%rip),%rdi
call   1050 <puts@plt>
lea    0xb76(%rip),%r14
lea    0x10(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
lea    0xbad(%rip),%rdi
call   1050 <puts@plt>
lea    0xc(%rsp),%rsi
mov    %r14,%rdi
call   10a0 <scanf@plt>
movss  0x8(%rsp),%xmm1
test   %r15d,%r15d
jle    1534 <muestras+0x394>
cvtsi2ss %ebp,%xmm0
movss  %xmm0,0x4(%rsp)
xor    %ebp,%ebp
lea    0xb51(%rip),%r14
mov    %r15d,%ebx
nopw   0x0(%rax,%rax,1)
xorps  %xmm0,%xmm0
cvtsi2ss %ebp,%xmm0
mulss  %xmm1,%xmm0
addss  0x4(%rsp),%xmm0
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
call   10c0 <paraboloide@plt>
mov    %r14,%rdi
call   1070 <printf@plt>
movss  0x8(%rsp),%xmm1
add    %r15d,%ebp
add    $0xffffffff,%ebx
jne    1500 <muestras+0x360>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"amplitud:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"frecuencia:\00"
@.str.3 = [16 x i8] c"angulo inicial:\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
@.str.5 = [13 x i8] c"pos_inicial:\00"
@.str.6 = [13 x i8] c"vel_inicial:\00"
@.str.7 = [13 x i8] c"aceleracion:\00"
@.str.8 = [3 x i8] c"a:\00"
@.str.9 = [3 x i8] c"b:\00"
define i32 @muestras(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%22 = load i32, i32* %7
%23 = load i32, i32* %6
%24 = sub nsw i32 %22, %23
%25 = load i32, i32* %8
%26 = sdiv i32 %24, %25
%27 = sitofp i32 %26 to float
store float %27, float* %10
store i32 0, i32* %21
%28 = load i32, i32* %9
switch i32 %28, label %207 [
i32 1, label %29
i32 2, label %60
i32 3, label %82
i32 4, label %104
i32 5, label %126
i32 6, label %148
i32 7, label %179
]
29: ; preds = %4
%30 = call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%32 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
%34 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%35 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %15)
store i32 0, i32* %21
br label %36
36: ; preds = %56, %29
%37 = load i32, i32* %21
%38 = load i32, i32* %8
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %59
40: ; preds = %36
%41 = load i32, i32* %6
%42 = sitofp i32 %41 to float
%43 = load i32, i32* %8
%44 = load i32, i32* %21
%45 = mul nsw i32 %43, %44
%46 = sitofp i32 %45 to float
%47 = load float, float* %10
%48 = call float @llvm.fmuladd.f32(float %46, float %47, float %42)
store float %48, float* %12
%49 = load i32, i32* %13
%50 = load i32, i32* %14
%51 = load float, float* %12
%52 = load i32, i32* %15
%53 = call float @senoidal(i32 %49, i32 %50, float %51, i32 %52)
store float %53, float* %11
%54 = load float, float* %11
%55 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %54)
br label %56
56: ; preds = %40
%57 = load i32, i32* %21
%58 = add nsw i32 %57, 1
store i32 %58, i32* %21
br label %36
59: ; preds = %36
br label %207
60: ; preds = %4
store i32 0, i32* %21
br label %61
61: ; preds = %78, %60
%62 = load i32, i32* %21
%63 = load i32, i32* %8
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %81
65: ; preds = %61
%66 = load i32, i32* %6
%67 = sitofp i32 %66 to float
%68 = load i32, i32* %8
%69 = load i32, i32* %21
%70 = mul nsw i32 %68, %69
%71 = sitofp i32 %70 to float
%72 = load float, float* %10
%73 = call float @llvm.fmuladd.f32(float %71, float %72, float %67)
store float %73, float* %12
%74 = load float, float* %12
%75 = call float @logaritmica(float %74)
store float %75, float* %11
%76 = load float, float* %11
%77 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %76)
br label %78
78: ; preds = %65
%79 = load i32, i32* %21
%80 = add nsw i32 %79, 1
store i32 %80, i32* %21
br label %61
81: ; preds = %61
br label %207
82: ; preds = %4
store i32 0, i32* %21
br label %83
83: ; preds = %100, %82
%84 = load i32, i32* %21
%85 = load i32, i32* %8
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %103
87: ; preds = %83
%88 = load i32, i32* %6
%89 = sitofp i32 %88 to float
%90 = load i32, i32* %8
%91 = load i32, i32* %21
%92 = mul nsw i32 %90, %91
%93 = sitofp i32 %92 to float
%94 = load float, float* %10
%95 = call float @llvm.fmuladd.f32(float %93, float %94, float %89)
store float %95, float* %12
%96 = load float, float* %12
%97 = call float @loglineal(float %96)
store float %97, float* %11
%98 = load float, float* %11
%99 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %98)
br label %100
100: ; preds = %87
%101 = load i32, i32* %21
%102 = add nsw i32 %101, 1
store i32 %102, i32* %21
br label %83
103: ; preds = %83
br label %207
104: ; preds = %4
store i32 0, i32* %21
br label %105
105: ; preds = %122, %104
%106 = load i32, i32* %21
%107 = load i32, i32* %8
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %125
109: ; preds = %105
%110 = load i32, i32* %6
%111 = sitofp i32 %110 to float
%112 = load i32, i32* %8
%113 = load i32, i32* %21
%114 = mul nsw i32 %112, %113
%115 = sitofp i32 %114 to float
%116 = load float, float* %10
%117 = call float @llvm.fmuladd.f32(float %115, float %116, float %111)
store float %117, float* %12
%118 = load float, float* %12
%119 = call float @exponencial(float %118)
store float %119, float* %11
%120 = load float, float* %11
%121 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %120)
br label %122
122: ; preds = %109
%123 = load i32, i32* %21
%124 = add nsw i32 %123, 1
store i32 %124, i32* %21
br label %105
125: ; preds = %105
br label %207
126: ; preds = %4
store i32 0, i32* %21
br label %127
127: ; preds = %144, %126
%128 = load i32, i32* %21
%129 = load i32, i32* %8
%130 = icmp slt i32 %128, %129
br i1 %130, label %131, label %147
131: ; preds = %127
%132 = load i32, i32* %6
%133 = sitofp i32 %132 to float
%134 = load i32, i32* %8
%135 = load i32, i32* %21
%136 = mul nsw i32 %134, %135
%137 = sitofp i32 %136 to float
%138 = load float, float* %10
%139 = call float @llvm.fmuladd.f32(float %137, float %138, float %133)
store float %139, float* %12
%140 = load float, float* %12
%141 = call float @escalon(float %140)
store float %141, float* %11
%142 = load float, float* %11
%143 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %142)
br label %144
144: ; preds = %131
%145 = load i32, i32* %21
%146 = add nsw i32 %145, 1
store i32 %146, i32* %21
br label %127
147: ; preds = %127
br label %207
148: ; preds = %4
%149 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%150 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %16)
%151 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%152 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %17)
%153 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%154 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %18)
store i32 0, i32* %21
br label %155
155: ; preds = %175, %148
%156 = load i32, i32* %21
%157 = load i32, i32* %8
%158 = icmp slt i32 %156, %157
br i1 %158, label %159, label %178
159: ; preds = %155
%160 = load i32, i32* %6
%161 = sitofp i32 %160 to float
%162 = load i32, i32* %8
%163 = load i32, i32* %21
%164 = mul nsw i32 %162, %163
%165 = sitofp i32 %164 to float
%166 = load float, float* %10
%167 = call float @llvm.fmuladd.f32(float %165, float %166, float %161)
store float %167, float* %12
%168 = load i32, i32* %16
%169 = load i32, i32* %17
%170 = load i32, i32* %18
%171 = load float, float* %12
%172 = call float @mrua(i32 %168, i32 %169, i32 %170, float %171)
store float %172, float* %11
%173 = load float, float* %11
%174 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %173)
br label %175
175: ; preds = %159
%176 = load i32, i32* %21
%177 = add nsw i32 %176, 1
store i32 %177, i32* %21
br label %155
178: ; preds = %155
br label %207
179: ; preds = %4
%180 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%181 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %19)
%182 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%183 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %20)
store i32 0, i32* %21
br label %184
184: ; preds = %203, %179
%185 = load i32, i32* %21
%186 = load i32, i32* %8
%187 = icmp slt i32 %185, %186
br i1 %187, label %188, label %206
188: ; preds = %184
%189 = load i32, i32* %6
%190 = sitofp i32 %189 to float
%191 = load i32, i32* %8
%192 = load i32, i32* %21
%193 = mul nsw i32 %191, %192
%194 = sitofp i32 %193 to float
%195 = load float, float* %10
%196 = call float @llvm.fmuladd.f32(float %194, float %195, float %190)
store float %196, float* %12
%197 = load i32, i32* %19
%198 = load i32, i32* %20
%199 = load float, float* %12
%200 = call float @paraboloide(i32 %197, i32 %198, float %199)
store float %200, float* %11
%201 = load float, float* %11
%202 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %201)
br label %203
203: ; preds = %188
%204 = load i32, i32* %21
%205 = add nsw i32 %204, 1
store i32 %205, i32* %21
br label %184
206: ; preds = %184
br label %207
207: ; preds = %4, %206, %178, %147, %125, %103, %81, %59
%208 = load i32, i32* %5
ret i32 %208
}

LLVM IR (-O2):
@.str = [10 x i8] c"amplitud:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"frecuencia:\00"
@.str.3 = [16 x i8] c"angulo inicial:\00"
@.str.4 = [5 x i8] c"%lf\0A\00"
@.str.5 = [13 x i8] c"pos_inicial:\00"
@.str.6 = [13 x i8] c"vel_inicial:\00"
@.str.7 = [13 x i8] c"aceleracion:\00"
@.str.8 = [3 x i8] c"a:\00"
@.str.9 = [3 x i8] c"b:\00"
define i32 @muestras(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = sub nsw i32 %1, %0
%14 = sdiv i32 %13, %2
%15 = sitofp i32 %14 to float
%16 = bitcast i32* %5 to i8*
%17 = bitcast i32* %6 to i8*
%18 = bitcast i32* %7 to i8*
%19 = bitcast i32* %8 to i8*
%20 = bitcast i32* %9 to i8*
%21 = bitcast i32* %10 to i8*
%22 = bitcast i32* %11 to i8*
%23 = bitcast i32* %12 to i8*
switch i32 %3, label %139 [
i32 1, label %40
i32 2, label %36
i32 3, label %32
i32 4, label %28
i32 5, label %24
i32 6, label %98
i32 7, label %120
]
24: ; preds = %4
%25 = icmp sgt i32 %2, 0
br i1 %25, label %26, label %139
26: ; preds = %24
%27 = sitofp i32 %0 to float
br label %89
28: ; preds = %4
%29 = icmp sgt i32 %2, 0
br i1 %29, label %30, label %139
30: ; preds = %28
%31 = sitofp i32 %0 to float
br label %80
32: ; preds = %4
%33 = icmp sgt i32 %2, 0
br i1 %33, label %34, label %139
34: ; preds = %32
%35 = sitofp i32 %0 to float
br label %71
36: ; preds = %4
%37 = icmp sgt i32 %2, 0
br i1 %37, label %38, label %139
38: ; preds = %36
%39 = sitofp i32 %0 to float
br label %62
40: ; preds = %4
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%43 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%44 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%47 = icmp sgt i32 %2, 0
br i1 %47, label %48, label %139
48: ; preds = %40
%49 = sitofp i32 %0 to float
br label %50
50: ; preds = %48, %50
%51 = phi i32 [ 0, %48 ], [ %60, %50 ]
%52 = mul nsw i32 %51, %2
%53 = sitofp i32 %52 to float
%54 = call float @llvm.fmuladd.f32(float %53, float %15, float %49)
%55 = load i32, i32* %5
%56 = load i32, i32* %6
%57 = load i32, i32* %7
%58 = call float @senoidal(i32 %55, i32 %56, float %54, i32 %57)
%59 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %58)
%60 = add nuw nsw i32 %51, 1
%61 = icmp eq i32 %60, %2
br i1 %61, label %139, label %50
62: ; preds = %38, %62
%63 = phi i32 [ 0, %38 ], [ %69, %62 ]
%64 = mul nsw i32 %63, %2
%65 = sitofp i32 %64 to float
%66 = tail call float @llvm.fmuladd.f32(float %65, float %15, float %39)
%67 = tail call float @logaritmica(float %66)
%68 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %67)
%69 = add nuw nsw i32 %63, 1
%70 = icmp eq i32 %69, %2
br i1 %70, label %139, label %62
71: ; preds = %34, %71
%72 = phi i32 [ 0, %34 ], [ %78, %71 ]
%73 = mul nsw i32 %72, %2
%74 = sitofp i32 %73 to float
%75 = tail call float @llvm.fmuladd.f32(float %74, float %15, float %35)
%76 = tail call float @loglineal(float %75)
%77 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %76)
%78 = add nuw nsw i32 %72, 1
%79 = icmp eq i32 %78, %2
br i1 %79, label %139, label %71
80: ; preds = %30, %80
%81 = phi i32 [ 0, %30 ], [ %87, %80 ]
%82 = mul nsw i32 %81, %2
%83 = sitofp i32 %82 to float
%84 = tail call float @llvm.fmuladd.f32(float %83, float %15, float %31)
%85 = tail call float @exponencial(float %84)
%86 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %85)
%87 = add nuw nsw i32 %81, 1
%88 = icmp eq i32 %87, %2
br i1 %88, label %139, label %80
89: ; preds = %26, %89
%90 = phi i32 [ 0, %26 ], [ %96, %89 ]
%91 = mul nsw i32 %90, %2
%92 = sitofp i32 %91 to float
%93 = tail call float @llvm.fmuladd.f32(float %92, float %15, float %27)
%94 = tail call float @escalon(float %93)
%95 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %94)
%96 = add nuw nsw i32 %90, 1
%97 = icmp eq i32 %96, %2
br i1 %97, label %139, label %89
98: ; preds = %4
%99 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
%100 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%101 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%102 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %9)
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%104 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %10)
%105 = icmp sgt i32 %2, 0
br i1 %105, label %106, label %139
106: ; preds = %98
%107 = sitofp i32 %0 to float
br label %108
108: ; preds = %106, %108
%109 = phi i32 [ 0, %106 ], [ %118, %108 ]
%110 = mul nsw i32 %109, %2
%111 = sitofp i32 %110 to float
%112 = call float @llvm.fmuladd.f32(float %111, float %15, float %107)
%113 = load i32, i32* %8
%114 = load i32, i32* %9
%115 = load i32, i32* %10
%116 = call float @mrua(i32 %113, i32 %114, i32 %115, float %112)
%117 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %116)
%118 = add nuw nsw i32 %109, 1
%119 = icmp eq i32 %118, %2
br i1 %119, label %139, label %108
120: ; preds = %4
%121 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%122 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %11)
%123 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
%124 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %12)
%125 = icmp sgt i32 %2, 0
br i1 %125, label %126, label %139
126: ; preds = %120
%127 = sitofp i32 %0 to float
br label %128
128: ; preds = %126, %128
%129 = phi i32 [ 0, %126 ], [ %137, %128 ]
%130 = mul nsw i32 %129, %2
%131 = sitofp i32 %130 to float
%132 = call float @llvm.fmuladd.f32(float %131, float %15, float %127)
%133 = load i32, i32* %11
%134 = load i32, i32* %12
%135 = call float @paraboloide(i32 %133, i32 %134, float %132)
%136 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), float %135)
%137 = add nuw nsw i32 %129, 1
%138 = icmp eq i32 %137, %2
br i1 %138, label %139, label %128
139: ; preds = %128, %108, %89, %80, %71, %62, %50, %120, %98, %24, %28, %32, %36, %40, %4
ret i32 undef
}