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

/* Variables and functions */
int /*<<< orphan*/ print_array(char **, int);
int /*<<< orphan*/ sort_array(char **, int);
void main() {
  char *strs[] = {"aaaa", "bbbb", "eeee", "dddd"};
  int num = sizeof(strs) / sizeof(strs[0]);
  print_array(strs, num);
  sort_array(strs, num);
  print_array(strs, num);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2ccb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cc8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <print_array@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1040 <sort_array@plt>
lea    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1030 <print_array@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movaps 0x2ce4(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cc8(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <print_array@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <sort_array@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <print_array@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"aaaa\00"
@.str.1 = [5 x i8] c"bbbb\00"
@.str.2 = [5 x i8] c"eeee\00"
@.str.3 = [5 x i8] c"dddd\00"
@__const.main.strs = [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
define void @main() {
%1 = alloca [4 x i8*]
%2 = alloca i32
%3 = bitcast [4 x i8*]* %1 to i8*
store i32 4, i32* %2
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @print_array(i8** %4, i32 %5)
%7 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @sort_array(i8** %7, i32 %8)
%10 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%11 = load i32, i32* %2
%12 = call i32 @print_array(i8** %10, i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"aaaa\00"
@.str.1 = [5 x i8] c"bbbb\00"
@.str.2 = [5 x i8] c"eeee\00"
@.str.3 = [5 x i8] c"dddd\00"
@__const.main.strs = [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
define void @main() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @print_array(i8** %3, i32 4)
%5 = call i32 @sort_array(i8** %3, i32 4)
%6 = call i32 @print_array(i8** %3, i32 4)
ret void
}