#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*/ SortArPrintMaxtoMin(char const **, int const *, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  const int pop[9] = {12330126, 8405837, 8538689,  1974800, 2928193,
                      1744351,  3490105, 13370198, 7182724};
  const char *cities[] = {"Moscow", "New-York", "London", "Minsk",    "Kiev",
                          "Warsaw", "Berlin",   "Tokio",  "Hong-Kong"};
  printf("\n  Сity      Population\n");
  SortArPrintMaxtoMin(cities, pop, 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0x2c6e(%rip),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x9,%edx
call   1050 <SortArPrintMaxtoMin@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x78,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebf(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    0x2cc4(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0x2ca8(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0x2c8c(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2c70(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2c54(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0x30(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x9,%edx
call   1040 <SortArPrintMaxtoMin@plt>
xor    %eax,%eax
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.main.pop = [9 x i32] [i32 12330126, i32 8405837, i32 8538689, i32 1974800, i32 2928193, i32 1744351, i32 3490105, i32 13370198, i32 7182724]
@.str = [7 x i8] c"Moscow\00"
@.str.1 = [9 x i8] c"New-York\00"
@.str.2 = [7 x i8] c"London\00"
@.str.3 = [6 x i8] c"Minsk\00"
@.str.4 = [5 x i8] c"Kiev\00"
@.str.5 = [7 x i8] c"Warsaw\00"
@.str.6 = [7 x i8] c"Berlin\00"
@.str.7 = [6 x i8] c"Tokio\00"
@.str.8 = [10 x i8] c"Hong-Kong\00"
@__const.main.cities = [9 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0)]
@.str.9 = [26 x i8] c"\0A \D0\A1ity Population\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca [9 x i8*]
store i32 0, i32* %1
%4 = bitcast [9 x i32]* %2 to i8*
%5 = bitcast [9 x i8*]* %3 to i8*
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0))
%7 = getelementptr inbounds [9 x i8*], [9 x i8*]* %3, i64 0, i64 0
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%9 = call i32 @SortArPrintMaxtoMin(i8** %7, i32* %8, i32 9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.pop = [9 x i32] [i32 12330126, i32 8405837, i32 8538689, i32 1974800, i32 2928193, i32 1744351, i32 3490105, i32 13370198, i32 7182724]
@.str = [7 x i8] c"Moscow\00"
@.str.1 = [9 x i8] c"New-York\00"
@.str.2 = [7 x i8] c"London\00"
@.str.3 = [6 x i8] c"Minsk\00"
@.str.4 = [5 x i8] c"Kiev\00"
@.str.5 = [7 x i8] c"Warsaw\00"
@.str.6 = [7 x i8] c"Berlin\00"
@.str.7 = [6 x i8] c"Tokio\00"
@.str.8 = [10 x i8] c"Hong-Kong\00"
@__const.main.cities = [9 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i32 0, i32 0)]
@str = [25 x i8] c"\0A \D0\A1ity Population\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca [9 x i8*]
%3 = bitcast [9 x i32]* %1 to i8*
%4 = bitcast [9 x i8*]* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [9 x i8*], [9 x i8*]* %2, i64 0, i64 0
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%8 = call i32 @SortArPrintMaxtoMin(i8** %6, i32* %7, i32 9)
ret i32 0
}