#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*/ dispName(char **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ sortName(char **);
int main() {
  int i;
  char name[10][20];
  printf("Enter %d Names \n", 10);
  for (i = 0; i < 10; i++)
    scanf("%s", *(name + i) + 0);
  sortName(name);
  printf(" \nSorted Names \n");
  dispName(name);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11a2 <main+0x62>
lea    -0xd0(%rbp),%rsi
movslq -0x8(%rbp),%rax
imul   $0x14,%rax,%rax
add    %rax,%rsi
lea    0xe82(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <main+0x2c>
lea    -0xd0(%rbp),%rdi
call   1050 <sortName@plt>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <dispName@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
lea    0xe9f(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9d(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x3c(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x50(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x64(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x78(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x8c(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xa0(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xb4(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
mov    %r14,%rdi
call   1060 <sortName@plt>
lea    0xe05(%rip),%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
call   1030 <dispName@plt>
xor    %eax,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter %d Names \0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [17 x i8] c" \0ASorted Names \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x [20 x i8]]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 10)
store i32 0, i32* %2
br label %5
5: ; preds = %16, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 0
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %9, i64 %11
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%14 = getelementptr inbounds i8, i8* %13, i64 0
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %14)
br label %16
16: ; preds = %8
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %5
19: ; preds = %5
%20 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 0
%21 = bitcast [20 x i8]* %20 to i8**
%22 = call i32 @sortName(i8** %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%24 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %3, i64 0, i64 0
%25 = bitcast [20 x i8]* %24 to i8**
%26 = call i32 @dispName(i8** %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter %d Names \0A\00"
@.str.1 = [3 x i8] c"%s\00"
@str = [16 x i8] c" \0ASorted Names \00"
define i32 @main() {
%1 = alloca [10 x [20 x i8]]
%2 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 1, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 2, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 3, i64 0
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 4, i64 0
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 5, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 6, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 7, i64 0
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 8, i64 0
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [10 x [20 x i8]], [10 x [20 x i8]]* %1, i64 0, i64 9, i64 0
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %21)
%23 = bitcast [10 x [20 x i8]]* %1 to i8**
%24 = call i32 @sortName(i8** %23)
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%26 = call i32 @dispName(i8** %23)
ret i32 0
}