#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*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/, char, char);
int /*<<< orphan*/ cbreak();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/, int, int);
int /*<<< orphan*/ getstr(char *);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ mvprintw(int, int, char *, ...);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ stdscr;
int strlen(char *);
void main() {
  char cadena[] = "ESVIERNES";
  int maxx = 0, maxy = 0;
  WINDOW *w;
  initscr();
  cbreak();
  getmaxyx(stdscr, maxy, maxx);
  box(stdscr, '+', '*');
  mvprintw(1, 1, "Introduce tu cadena:\n>>");
  getstr(cadena);
  for (int x = 0; x < strlen(cadena); x++) {
    mvprintw(x + 3, 2, "%c", cadena[x]);
    mvprintw(x + 3, strlen(cadena) + 1, "%c", cadena[strlen(cadena) - (x + 1)]);
  }
  for (int y = 0; y < strlen(cadena); y++) {
    mvprintw(3, y + 2, "%c", cadena[y]);
    mvprintw(strlen(cadena) + 2, y + 2, "%c", cadena[strlen(cadena) - (y + 1)]);
  }
  getch();
  refresh();
  endwin();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xe51(%rip),%rax
mov    %rax,-0xa(%rbp)
mov    0xe4e(%rip),%ax
mov    %ax,-0x2(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x0,%al
call   1050 <initscr@plt>
mov    $0x0,%al
call   1030 <cbreak@plt>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1070 <getmaxyx@plt>
mov    0x2df3(%rip),%rax
mov    (%rax),%edi
mov    $0x2b,%esi
mov    $0x2a,%edx
call   1080 <box@plt>
mov    $0x1,%esi
lea    0xdf8(%rip),%rdx
mov    %esi,%edi
mov    $0x0,%al
call   10c0 <mvprintw@plt>
lea    -0xa(%rbp),%rdi
call   1060 <getstr@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    12bb <main+0x11b>
mov    -0x24(%rbp),%edi
add    $0x3,%edi
movslq -0x24(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%ecx
mov    $0x2,%esi
lea    0xdc0(%rip),%rdx
mov    $0x0,%al
call   10c0 <mvprintw@plt>
mov    -0x24(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x34(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x34(%rbp),%edi
mov    -0x30(%rbp),%esi
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
sub    %ecx,%eax
cltq
movsbl -0xa(%rbp,%rax,1),%ecx
lea    0xd7c(%rip),%rdx
mov    $0x0,%al
call   10c0 <mvprintw@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    122b <main+0x8b>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x38(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
cmp    %ecx,%eax
jge    1352 <main+0x1b2>
mov    -0x28(%rbp),%esi
add    $0x2,%esi
movslq -0x28(%rbp),%rax
movsbl -0xa(%rbp,%rax,1),%ecx
mov    $0x3,%edi
lea    0xd29(%rip),%rdx
mov    $0x0,%al
call   10c0 <mvprintw@plt>
lea    -0xa(%rbp),%rdi
call   1040 <strlen@plt>
add    $0x2,%eax
mov    %eax,-0x40(%rbp)
mov    -0x28(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x3c(%rbp)
lea    -0xa(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x40(%rbp),%edi
mov    -0x3c(%rbp),%esi
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
sub    %ecx,%eax
cltq
movsbl -0xa(%rbp,%rax,1),%ecx
lea    0xce5(%rip),%rdx
mov    $0x0,%al
call   10c0 <mvprintw@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12c2 <main+0x122>
mov    $0x0,%al
call   10a0 <getch@plt>
mov    $0x0,%al
call   1090 <refresh@plt>
mov    $0x0,%al
call   10b0 <endwin@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movabs $0x454e524549565345,%rax
52 4e 45
mov    %rax,0x8(%rsp)
movw   $0x53,0x10(%rsp)
xor    %eax,%eax
call   1050 <initscr@plt>
xor    %eax,%eax
call   1030 <cbreak@plt>
mov    0x2e0f(%rip),%rbx
mov    (%rbx),%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <getmaxyx@plt>
mov    (%rbx),%edi
mov    $0x2b,%esi
mov    $0x2a,%edx
call   1080 <box@plt>
lea    0xe0e(%rip),%rdx
mov    $0x1,%edi
mov    $0x1,%esi
xor    %eax,%eax
call   10c0 <mvprintw@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <getstr@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    12a3 <main+0x103>
mov    $0xffffffffffffffff,%rbx
lea    0xdee(%rip),%r14
lea    0x8(%rsp),%r15
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsbl 0x8(%rsp,%rbp,1),%ecx
lea    0x3(%rbp),%r13d
mov    %r13d,%edi
mov    $0x2,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   10c0 <mvprintw@plt>
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    0x1(%rax),%r12d
mov    %r15,%rdi
call   1040 <strlen@plt>
add    $0x1,%rbp
cltq
add    %rsp,%rax
add    $0x8,%rax
movsbl (%rbx,%rax,1),%ecx
mov    %r13d,%edi
mov    %r12d,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   10c0 <mvprintw@plt>
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
add    $0xffffffffffffffff,%rbx
cmp    %rax,%rbp
jl     1240 <main+0xa0>
lea    0x8(%rsp),%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1333 <main+0x193>
mov    $0xffffffffffffffff,%rbx
lea    0xd5f(%rip),%r14
lea    0x8(%rsp),%r15
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
movsbl 0x8(%rsp,%rbp,1),%ecx
lea    0x2(%rbp),%r13d
mov    $0x3,%edi
mov    %r13d,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   10c0 <mvprintw@plt>
mov    %r15,%rdi
call   1040 <strlen@plt>
lea    0x2(%rax),%r12d
mov    %r15,%rdi
call   1040 <strlen@plt>
add    $0x1,%rbp
cltq
add    %rsp,%rax
add    $0x8,%rax
movsbl (%rbx,%rax,1),%ecx
mov    %r12d,%edi
mov    %r13d,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   10c0 <mvprintw@plt>
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
add    $0xffffffffffffffff,%rbx
cmp    %rax,%rbp
jl     12d0 <main+0x130>
xor    %eax,%eax
call   10a0 <getch@plt>
xor    %eax,%eax
call   1090 <refresh@plt>
xor    %eax,%eax
call   10b0 <endwin@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.cadena = [10 x i8] c"ESVIERNES\00"
@stdscr = global i32 0
@.str = [24 x i8] c"Introduce tu cadena:\0A>>\00"
@.str.1 = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = bitcast [10 x i8]* %1 to i8*
store i32 0, i32* %2
store i32 0, i32* %3
%8 = call i32 (...) @initscr()
%9 = call i32 (...) @cbreak()
%10 = load i32, i32* @stdscr
%11 = load i32, i32* %3
%12 = load i32, i32* %2
%13 = call i32 @getmaxyx(i32 %10, i32 %11, i32 %12)
%14 = load i32, i32* @stdscr
%15 = call i32 @box(i32 %14, i8 signext 43, i8 signext 42)
%16 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 1, i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%18 = call i32 @getstr(i8* %17)
store i32 0, i32* %5
br label %19
19: ; preds = %48, %0
%20 = load i32, i32* %5
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%22 = call i32 @strlen(i8* %21)
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %51
24: ; preds = %19
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 3
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %26, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 3
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%36 = call i32 @strlen(i8* %35)
%37 = add nsw i32 %36, 1
%38 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%39 = call i32 @strlen(i8* %38)
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
%42 = sub nsw i32 %39, %41
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %34, i32 %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %24
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %19
51: ; preds = %19
store i32 0, i32* %6
br label %52
52: ; preds = %81, %51
%53 = load i32, i32* %6
%54 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%55 = call i32 @strlen(i8* %54)
%56 = icmp slt i32 %53, %55
br i1 %56, label %57, label %84
57: ; preds = %52
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 2
%60 = load i32, i32* %6
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 3, i32 %59, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %64)
%66 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%67 = call i32 @strlen(i8* %66)
%68 = add nsw i32 %67, 2
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 2
%71 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%72 = call i32 @strlen(i8* %71)
%73 = load i32, i32* %6
%74 = add nsw i32 %73, 1
%75 = sub nsw i32 %72, %74
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %76
%78 = load i8, i8* %77
%79 = sext i8 %78 to i32
%80 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %68, i32 %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %79)
br label %81
81: ; preds = %57
%82 = load i32, i32* %6
%83 = add nsw i32 %82, 1
store i32 %83, i32* %6
br label %52
84: ; preds = %52
%85 = call i32 (...) @getch()
%86 = call i32 (...) @refresh()
%87 = call i32 (...) @endwin()
ret void
}

LLVM IR (-O2):
@__const.main.cadena = [10 x i8] c"ESVIERNES\00"
@stdscr = global i32 0
@.str = [24 x i8] c"Introduce tu cadena:\0A>>\00"
@.str.1 = [3 x i8] c"%c\00"
define void @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 (...) @cbreak()
%5 = load i32, i32* @stdscr
%6 = tail call i32 @getmaxyx(i32 %5, i32 0, i32 0)
%7 = load i32, i32* @stdscr
%8 = tail call i32 @box(i32 %7, i8 signext 43, i8 signext 42)
%9 = tail call i32 (i32, i32, i8*, ...) @mvprintw(i32 1, i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @getstr(i8* %2)
%11 = call i32 @strlen(i8* %2)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %16, %0
%14 = call i32 @strlen(i8* %2)
%15 = icmp sgt i32 %14, 0
br i1 %15, label %42, label %38
16: ; preds = %0, %16
%17 = phi i64 [ %27, %16 ], [ 0, %0 ]
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = trunc i64 %17 to i32
%22 = add i32 %21, 3
%23 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %22, i32 2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%24 = call i32 @strlen(i8* %2)
%25 = add nsw i32 %24, 1
%26 = call i32 @strlen(i8* %2)
%27 = add nuw nsw i64 %17, 1
%28 = trunc i64 %27 to i32
%29 = sub nsw i32 %26, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %22, i32 %25, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = call i32 @strlen(i8* %2)
%36 = sext i32 %35 to i64
%37 = icmp slt i64 %27, %36
br i1 %37, label %16, label %13
38: ; preds = %42, %13
%39 = call i32 (...) @getch()
%40 = call i32 (...) @refresh()
%41 = call i32 (...) @endwin()
ret void
42: ; preds = %13, %42
%43 = phi i64 [ %53, %42 ], [ 0, %13 ]
%44 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = sext i8 %45 to i32
%47 = trunc i64 %43 to i32
%48 = add i32 %47, 2
%49 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 3, i32 %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%50 = call i32 @strlen(i8* %2)
%51 = add nsw i32 %50, 2
%52 = call i32 @strlen(i8* %2)
%53 = add nuw nsw i64 %43, 1
%54 = trunc i64 %53 to i32
%55 = sub nsw i32 %52, %54
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = call i32 (i32, i32, i8*, ...) @mvprintw(i32 %51, i32 %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %59)
%61 = call i32 @strlen(i8* %2)
%62 = sext i32 %61 to i64
%63 = icmp slt i64 %53, %62
br i1 %63, label %42, label %38
}