#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*/ ordenar_a(char **, int);
int /*<<< orphan*/ ordenar_n(double *, int);
int /*<<< orphan*/ printf(char *, ...);
main() {
  int n_elementos = 5, i = 0;
  double m[] = {3, 2, 1, 5, 4};
  char *s[] = {"ccc", "bbb", "aaa", "eee", "ddd"};
  ordenar_n(m, n_elementos);
  for (i = 0; i < n_elementos; i++)
    printf("%g ", m[i]);
  printf("\n");
  ordenar_a(s, n_elementos);
  for (i = 0; i < n_elementos; i++)
    printf("%s ", s[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe96(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe81(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe6c(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe57(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xe63(%rip),%rax
mov    %rax,-0x70(%rbp)
lea    0xe5c(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    0xe55(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xe4e(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xe47(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1060 <ordenar_n@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    123a <main+0xfa>
movslq -0xc(%rbp),%rax
movsd  -0x40(%rbp,%rax,8),%xmm0
lea    0xe17(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1208 <main+0xc8>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x8(%rbp),%esi
call   1050 <ordenar_a@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    128c <main+0x14c>
movslq -0xc(%rbp),%rax
mov    -0x70(%rbp,%rax,8),%rsi
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    125b <main+0x11b>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movabs $0x4010000000000000,%rax
mov    %rax,0x50(%rsp)
lea    0xead(%rip),%rax
mov    %rax,(%rsp)
lea    0xea6(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe9e(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe96(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe8e(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x5,%esi
call   1060 <ordenar_n@plt>
movsd  0x30(%rsp),%xmm0
lea    0xe71(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x40(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x48(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x50(%rsp),%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rsp,%rdi
mov    $0x5,%esi
call   1050 <ordenar_a@plt>
mov    (%rsp),%rsi
lea    0xe09(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ccc\00"
@.str.1 = [4 x i8] c"bbb\00"
@.str.2 = [4 x i8] c"aaa\00"
@.str.3 = [4 x i8] c"eee\00"
@.str.4 = [4 x i8] c"ddd\00"
@.str.5 = [4 x i8] c"%g \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [4 x i8] c"%s \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [5 x double]
%5 = alloca [5 x i8*]
store i32 0, i32* %1
store i32 5, i32* %2
store i32 0, i32* %3
%6 = bitcast [5 x double]* %4 to i8*
%7 = bitcast i8* %6 to [5 x double]*
%8 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 0
store double 3.000000e+00, double* %8
%9 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 1
store double 2.000000e+00, double* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 2
store double 1.000000e+00, double* %10
%11 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 3
store double 5.000000e+00, double* %11
%12 = getelementptr inbounds [5 x double], [5 x double]* %7, i32 0, i32 4
store double 4.000000e+00, double* %12
%13 = bitcast [5 x i8*]* %5 to i8*
%14 = bitcast i8* %13 to [5 x i8*]*
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %14, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8** %15
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %14, i32 0, i32 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8** %16
%17 = getelementptr inbounds [5 x i8*], [5 x i8*]* %14, i32 0, i32 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8** %17
%18 = getelementptr inbounds [5 x i8*], [5 x i8*]* %14, i32 0, i32 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8** %18
%19 = getelementptr inbounds [5 x i8*], [5 x i8*]* %14, i32 0, i32 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8** %19
%20 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 0
%21 = load i32, i32* %2
%22 = call i32 @ordenar_n(double* %20, i32 %21)
store i32 0, i32* %3
br label %23
23: ; preds = %33, %0
%24 = load i32, i32* %3
%25 = load i32, i32* %2
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %36
27: ; preds = %23
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [5 x double], [5 x double]* %4, i64 0, i64 %29
%31 = load double, double* %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %31)
br label %33
33: ; preds = %27
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %23
36: ; preds = %23
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%38 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 0
%39 = load i32, i32* %2
%40 = call i32 @ordenar_a(i8** %38, i32 %39)
store i32 0, i32* %3
br label %41
41: ; preds = %51, %36
%42 = load i32, i32* %3
%43 = load i32, i32* %2
%44 = icmp slt i32 %42, %43
br i1 %44, label %45, label %54
45: ; preds = %41
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [5 x i8*], [5 x i8*]* %5, i64 0, i64 %47
%49 = load i8*, i8** %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %49)
br label %51
51: ; preds = %45
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
store i32 %53, i32* %3
br label %41
54: ; preds = %41
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
@.str = [4 x i8] c"ccc\00"
@.str.1 = [4 x i8] c"bbb\00"
@.str.2 = [4 x i8] c"aaa\00"
@.str.3 = [4 x i8] c"eee\00"
@.str.4 = [4 x i8] c"ddd\00"
@.str.5 = [4 x i8] c"%g \00"
@.str.7 = [4 x i8] c"%s \00"
define i32 @main() {
%1 = alloca [5 x double]
%2 = alloca [5 x i8*]
%3 = bitcast [5 x double]* %1 to i8*
%4 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 1
%6 = bitcast [5 x double]* %1 to <2 x double>*
store <2 x double> <double 3.000000e+00, double 2.000000e+00>, <2 x double>* %6
%7 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 2
%8 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 3
%9 = bitcast double* %7 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 5.000000e+00>, <2 x double>* %9
%10 = getelementptr inbounds [5 x double], [5 x double]* %1, i64 0, i64 4
store double 4.000000e+00, double* %10
%11 = bitcast [5 x i8*]* %2 to i8*
%12 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [5 x i8*], [5 x i8*]* %2, i64 0, i64 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8** %16
%17 = call i32 @ordenar_n(double* %4, i32 5)
%18 = load double, double* %4
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %18)
%20 = load double, double* %5
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %20)
%22 = load double, double* %7
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %22)
%24 = load double, double* %8
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %24)
%26 = load double, double* %10
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double %26)
%28 = call i32 @putchar(i32 10)
%29 = call i32 @ordenar_a(i8** %12, i32 5)
%30 = load i8*, i8** %12
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %30)
%32 = load i8*, i8** %13
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %32)
%34 = load i8*, i8** %14
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %34)
%36 = load i8*, i8** %15
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %36)
%38 = load i8*, i8** %16
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %38)
%40 = call i32 @putchar(i32 10)
ret i32 0
}