#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*/ printf(char *, char *);
int /*<<< orphan*/ qs(char *, int /*<<< orphan*/, scalar_t__);
scalar_t__ strlen(char *);
int main(void) {
  char aVetor[] = "3490bn09685lnv 3-49580bgojfog39458=9ugkj n098=526yh";
  printf("\nAntes = [%s]", aVetor);
  qs(aVetor, 0, strlen(aVetor) - 1);
  printf("\nDepois = [%s]", aVetor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x34,%edx
call   1060 <memcpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x48(%rbp),%rdi
mov    %rax,%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1050 <qs@plt>
lea    -0x40(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeac(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x687936,0x30(%rsp)
lea    0xecd(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
lea    -0x1(%rax),%rdx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <qs@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.aVetor = [52 x i8] c"3490bn09685lnv 3-49580bgojfog39458=9ugkj n098=526yh\00"
@.str = [14 x i8] c"\0AAntes = [%s]\00"
@.str.1 = [15 x i8] c"\0ADepois = [%s]\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [52 x i8]
store i32 0, i32* %1
%3 = bitcast [52 x i8]* %2 to i8*
%4 = getelementptr inbounds [52 x i8], [52 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [52 x i8], [52 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [52 x i8], [52 x i8]* %2, i64 0, i64 0
%8 = call i64 @strlen(i8* %7)
%9 = sub nsw i64 %8, 1
%10 = call i32 @qs(i8* %6, i32 0, i64 %9)
%11 = getelementptr inbounds [52 x i8], [52 x i8]* %2, i64 0, i64 0
%12 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@__const.main.aVetor = [52 x i8] c"3490bn09685lnv 3-49580bgojfog39458=9ugkj n098=526yh\00"
@.str = [14 x i8] c"\0AAntes = [%s]\00"
@.str.1 = [15 x i8] c"\0ADepois = [%s]\00"
define i32 @main() {
%1 = alloca [52 x i8]
%2 = getelementptr inbounds [52 x i8], [52 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i64 @strlen(i8* %2)
%5 = add nsw i64 %4, -1
%6 = call i32 @qs(i8* %2, i32 0, i64 %5)
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}