#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*/ limpiar_cadena(char *, int);
int /*<<< orphan*/ menu();
int /*<<< orphan*/ morse(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ system(char *);
int main() {
  char cadena[50];
  char op = 's';
  do {
    limpiar_cadena(cadena, 50);
    system("clear");
    ;
    menu();
    printf("Ingresa una Frase: ");
    scanf("%50s", cadena);
    morse(cadena);
    printf("\nOtra opcion (s - si n -no)\n");
    scanf("%s", &op);
  } while (op != 'n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x73,-0x41(%rbp)
lea    -0x40(%rbp),%rdi
mov    $0x32,%esi
call   1070 <limpiar_cadena@plt>
lea    0xe78(%rip),%rdi
call   1050 <system@plt>
mov    $0x0,%al
call   1040 <menu@plt>
lea    0xe6b(%rip),%rdi
call   1060 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1080 <scanf@plt>
lea    -0x40(%rbp),%rdi
call   1030 <morse@plt>
lea    0xe5f(%rip),%rdi
call   1060 <printf@plt>
lea    0xe70(%rip),%rdi
lea    -0x41(%rbp),%rsi
call   1080 <scanf@plt>
movsbl -0x41(%rbp),%eax
cmp    $0x6e,%eax
jne    1173 <main+0x13>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movb   $0x73,0xf(%rsp)
lea    0x10(%rsp),%rbx
lea    0xe77(%rip),%r15
lea    0xe84(%rip),%r12
lea    0xe85(%rip),%r13
lea    0xe7b(%rip),%rbp
lea    0xf(%rsp),%r14
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    $0x32,%esi
call   1080 <limpiar_cadena@plt>
lea    0xe3c(%rip),%rdi
call   1060 <system@plt>
xor    %eax,%eax
call   1050 <menu@plt>
mov    %r15,%rdi
call   1070 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
mov    %rbx,%rdi
call   1040 <morse@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1090 <scanf@plt>
cmpb   $0x6e,0xf(%rsp)
jne    11b0 <main+0x40>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [20 x i8] c"Ingresa una Frase: \00"
@.str.2 = [5 x i8] c"%50s\00"
@.str.3 = [29 x i8] c"\0AOtra opcion (s - si n -no)\0A\00"
@.str.4 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca i8
store i32 0, i32* %1
store i8 115, i8* %3
br label %4
4: ; preds = %16, %0
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i32 @limpiar_cadena(i8* %5, i32 50)
%7 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (...) @menu()
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%11 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%13 = call i32 @morse(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %3)
br label %16
16: ; preds = %4
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 110
br i1 %19, label %4, label %20
20: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.1 = [20 x i8] c"Ingresa una Frase: \00"
@.str.2 = [5 x i8] c"%50s\00"
@.str.4 = [3 x i8] c"%s\00"
@str = [28 x i8] c"\0AOtra opcion (s - si n -no)\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
store i8 115, i8* %2
br label %4
4: ; preds = %4, %0
%5 = call i32 @limpiar_cadena(i8* %3, i32 50)
%6 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @menu()
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %3)
%10 = call i32 @morse(i8* %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %2)
%13 = load i8, i8* %2
%14 = icmp eq i8 %13, 110
br i1 %14, label %15, label %4
15: ; preds = %4
ret i32 0
}