void voltea() {
  extern char linea[], linea_max[];
  char *pointer = linea;
  char *target = linea_max;
  int i = 0;
  while (*pointer != '\0') {
    target++;
    pointer++;
    i++;
  }
  pointer = linea;
  *target = '\0';
  target--;
  while (*pointer != '\0') {
    *target = *pointer;
    target--;
    pointer++;
  }
}


x86 assembly (clang, -O0):
<voltea>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ee5(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2ec2(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1157 <voltea+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1121 <voltea+0x21>
mov    0x2e92(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11ae <voltea+0xae>
mov    -0x8(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1175 <voltea+0x75>
pop    %rbp
ret

x86 assembly (clang, -O2):
<voltea>:
mov    0x2ee9(%rip),%rax
mov    (%rax),%cl
test   %cl,%cl
je     1152 <voltea+0x52>
mov    0x2ec4(%rip),%rdx
add    $0xffffffffffffffff,%rdx
lea    0x1(%rax),%rsi
nopl   0x0(%rax)
add    $0x1,%rdx
cmpb   $0x0,(%rsi)
lea    0x1(%rsi),%rsi
jne    1120 <voltea+0x20>
movb   $0x0,0x1(%rdx)
test   %cl,%cl
je     1151 <voltea+0x51>
add    $0x1,%rax
nopl   0x0(%rax)
mov    %cl,(%rdx)
movzbl (%rax),%ecx
add    $0xffffffffffffffff,%rdx
add    $0x1,%rax
test   %cl,%cl
jne    1140 <voltea+0x40>
ret
mov    0x2e7f(%rip),%rax
movb   $0x0,(%rax)
ret

LLVM IR (-O0):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @voltea() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
store i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %0
%5 = load i8*, i8** %1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
%12 = load i8*, i8** %1
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %1
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
store i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), i8** %1
%17 = load i8*, i8** %2
store i8 0, i8* %17
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 -1
store i8* %19, i8** %2
br label %20
20: ; preds = %25, %16
%21 = load i8*, i8** %1
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %20
%26 = load i8*, i8** %1
%27 = load i8, i8* %26
%28 = load i8*, i8** %2
store i8 %27, i8* %28
%29 = load i8*, i8** %2
%30 = getelementptr inbounds i8, i8* %29, i32 -1
store i8* %30, i8** %2
%31 = load i8*, i8** %1
%32 = getelementptr inbounds i8, i8* %31, i32 1
store i8* %32, i8** %1
br label %20
33: ; preds = %20
ret void
}

LLVM IR (-O2):
@linea = external global [0 x i8]
@linea_max = external global [0 x i8]
define void @voltea() {
%1 = load i8, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0)
%2 = icmp eq i8 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
store i8 0, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0)
br label %20
4: ; preds = %0, %4
%5 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @linea_max, i64 0, i64 0), %0 ]
%6 = phi i8* [ %8, %4 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), %0 ]
%7 = getelementptr inbounds i8, i8* %5, i64 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4
store i8 0, i8* %7
br i1 %2, label %20, label %12
12: ; preds = %11, %12
%13 = phi i8 [ %18, %12 ], [ %1, %11 ]
%14 = phi i8* [ %16, %12 ], [ %7, %11 ]
%15 = phi i8* [ %17, %12 ], [ getelementptr inbounds ([0 x i8], [0 x i8]* @linea, i64 0, i64 0), %11 ]
%16 = getelementptr inbounds i8, i8* %14, i64 -1
store i8 %13, i8* %16
%17 = getelementptr inbounds i8, i8* %15, i64 1
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %12
20: ; preds = %12, %3, %11
ret void
}