#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 *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  void sort(char(*p)[6]);
  int i;
  char str[10][6];
  char(*p)[6];
  printf("input 10 strings:\n");
  for (i = 0; i < 10; i++)
    scanf("%s", str[i]);
  p = str;
  sort(p);
  printf("now,the sequence is:\n");
  for (i = 0; i < 10; i++)
    printf("%s\n", str[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1187 <main+0x57>
movslq -0x8(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x6,%rax,%rax
add    %rax,%rsi
lea    0xe9f(%rip),%rdi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x24>
lea    -0x50(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
call   1040 <sort@plt>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    11e2 <main+0xb2>
movslq -0x8(%rbp),%rax
lea    -0x50(%rbp),%rsi
imul   $0x6,%rax,%rax
add    %rax,%rsi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ad <main+0x7d>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xebe(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaf(%rip),%r15
mov    %rsp,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0x6(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
lea    0x12(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
lea    0x1e(%rsp),%rsi
mov    %r15,%rdi
call   1050 <scanf@plt>
lea    0x24(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <scanf@plt>
lea    0x2a(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
lea    0x30(%rsp),%r13
mov    %r15,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
lea    0x36(%rsp),%rbp
mov    %r15,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <sort@plt>
lea    0xe26(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x6(%rsp),%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1030 <puts@plt>
lea    0x12(%rsp),%rdi
call   1030 <puts@plt>
lea    0x18(%rsp),%rdi
call   1030 <puts@plt>
lea    0x1e(%rsp),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"input 10 strings:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [22 x i8] c"now,the sequence is:\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x [6 x i8]]
%4 = alloca [6 x i8]*
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %6
6: ; preds = %15, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %18
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %3, i64 0, i64 %11
%13 = getelementptr inbounds [6 x i8], [6 x i8]* %12, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
br label %15
15: ; preds = %9
%16 = load i32, i32* %2
%17 = add nsw i32 %16, 1
store i32 %17, i32* %2
br label %6
18: ; preds = %6
%19 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %3, i64 0, i64 0
store [6 x i8]* %19, [6 x i8]** %4
%20 = load [6 x i8]*, [6 x i8]** %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %22
22: ; preds = %31, %18
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 10
br i1 %24, label %25, label %34
25: ; preds = %22
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %3, i64 0, i64 %27
%29 = getelementptr inbounds [6 x i8], [6 x i8]* %28, i64 0, i64 0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %29)
br label %31
31: ; preds = %25
%32 = load i32, i32* %2
%33 = add nsw i32 %32, 1
store i32 %33, i32* %2
br label %22
34: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@str = [18 x i8] c"input 10 strings:\00"
@str.4 = [21 x i8] c"now,the sequence is:\00"
define i32 @main() {
%1 = alloca [10 x [6 x i8]]
%2 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %1, i64 0, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%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 [6 x i8]], [10 x [6 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 [6 x i8]], [10 x [6 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 [6 x i8]], [10 x [6 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 [6 x i8]], [10 x [6 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 [6 x i8]], [10 x [6 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 [6 x i8]], [10 x [6 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 [6 x i8]], [10 x [6 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 [6 x i8]], [10 x [6 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 [6 x i8]], [10 x [6 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 = getelementptr inbounds [10 x [6 x i8]], [10 x [6 x i8]]* %1, i64 0, i64 0
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.4, i64 0, i64 0))
%25 = call i32 @puts(i8* %2)
%26 = call i32 @puts(i8* %5)
%27 = call i32 @puts(i8* %7)
%28 = call i32 @puts(i8* %9)
%29 = call i32 @puts(i8* %11)
%30 = call i32 @puts(i8* %13)
%31 = call i32 @puts(i8* %15)
%32 = call i32 @puts(i8* %17)
%33 = call i32 @puts(i8* %19)
%34 = call i32 @puts(i8* %21)
ret i32 0
}