#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main() {
  int i, j, count;
  char str[25][25], temp[25];
  puts("How many strings u are going to enter?: ");
  scanf("%d", &count);
  puts("Enter Strings one by one: ");
  for (i = 0; i <= count; i++)
    fgets(str[i], 25, stdin);
  for (i = 0; i <= count; i++)
    for (j = i + 1; j <= count; j++) {
      if (strcmp(str[i], str[j]) > 0) {
        strcpy(temp, str[i]);
        strcpy(str[i], str[j]);
        strcpy(str[j], temp);
      }
    }
  printf("Order of Sorted Strings:");
  for (i = 0; i <= count; i++)
    puts(str[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
lea    0xea4(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1080 <scanf@plt>
lea    0xe97(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11e0 <main+0x80>
movslq -0x8(%rbp),%rax
lea    -0x290(%rbp),%rdi
imul   $0x19,%rax,%rax
add    %rax,%rdi
mov    0x2e22(%rip),%rax
mov    (%rax),%edx
mov    $0x19,%esi
call   1060 <fgets@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a1 <main+0x41>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     12c6 <main+0x166>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     12b3 <main+0x153>
movslq -0x8(%rbp),%rax
lea    -0x290(%rbp),%rdi
imul   $0x19,%rax,%rax
add    %rax,%rdi
movslq -0xc(%rbp),%rax
lea    -0x290(%rbp),%rsi
imul   $0x19,%rax,%rax
add    %rax,%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jle    12a0 <main+0x140>
lea    -0x2b0(%rbp),%rdi
movslq -0x8(%rbp),%rax
lea    -0x290(%rbp),%rsi
imul   $0x19,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
movslq -0x8(%rbp),%rax
lea    -0x290(%rbp),%rdi
imul   $0x19,%rax,%rax
add    %rax,%rdi
movslq -0xc(%rbp),%rax
lea    -0x290(%rbp),%rsi
imul   $0x19,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
movslq -0xc(%rbp),%rax
lea    -0x290(%rbp),%rdi
imul   $0x19,%rax,%rax
add    %rax,%rdi
lea    -0x2b0(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    12a5 <main+0x145>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11fc <main+0x9c>
jmp    12b8 <main+0x158>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11e7 <main+0x87>
lea    0xd7a(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     130a <main+0x1aa>
movslq -0x8(%rbp),%rax
lea    -0x290(%rbp),%rdi
imul   $0x19,%rax,%rax
add    %rax,%rdi
call   1040 <puts@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12d9 <main+0x179>
xor    %eax,%eax
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2a8,%rsp
lea    0xe88(%rip),%rdi
call   1040 <puts@plt>
lea    0xea5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
lea    0xe97(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0xc(%rsp)
js     1282 <main+0x122>
mov    $0xffffffffffffffff,%rbp
lea    0x30(%rsp),%rbx
mov    0x2e30(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    (%r14),%edx
mov    %rbx,%rdi
mov    $0x19,%esi
call   1060 <fgets@plt>
movslq 0xc(%rsp),%rax
add    $0x1,%rbp
add    $0x19,%rbx
cmp    %rax,%rbp
jl     11c0 <main+0x60>
test   %eax,%eax
js     1282 <main+0x122>
lea    0x49(%rsp),%r12
xor    %r13d,%r13d
lea    0x10(%rsp),%r14
jmp    1213 <main+0xb3>
nopl   0x0(%rax)
movslq %eax,%rcx
lea    0x1(%r13),%rdx
add    $0x19,%r12
cmp    %rcx,%r13
mov    %rdx,%r13
jge    1282 <main+0x122>
movslq %eax,%rcx
cmp    %rcx,%r13
jge    1203 <main+0xa3>
lea    0x0(,%r13,4),%rax
add    %r13,%rax
lea    (%rax,%rax,4),%rax
lea    (%rsp,%rax,1),%r15
add    $0x30,%r15
mov    %r12,%rbx
mov    %r13d,%ebp
jmp    124f <main+0xef>
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
add    $0x1,%ebp
add    $0x19,%rbx
cmp    %ebp,%eax
jle    1200 <main+0xa0>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jle    1240 <main+0xe0>
mov    %r14,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
jmp    1240 <main+0xe0>
lea    0xdbe(%rip),%rdi
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
js     12ca <main+0x16a>
mov    $0xffffffffffffffff,%rbp
lea    0x30(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <puts@plt>
movslq 0xc(%rsp),%rax
add    $0x1,%rbp
add    $0x19,%rbx
cmp    %rax,%rbp
jl     12b0 <main+0x150>
xor    %eax,%eax
add    $0x2a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [41 x i8] c"How many strings u are going to enter?: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Enter Strings one by one: \00"
@stdin = global i32 0
@.str.3 = [25 x i8] c"Order of Sorted Strings:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [25 x [25 x i8]]
%6 = alloca [25 x i8]
store i32 0, i32* %1
%7 = call i32 @puts(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%9 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %2
br label %10
10: ; preds = %21, %0
%11 = load i32, i32* %2
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i32, i32* %2
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %5, i64 0, i64 %16
%18 = getelementptr inbounds [25 x i8], [25 x i8]* %17, i64 0, i64 0
%19 = load i32, i32* @stdin
%20 = call i32 @fgets(i8* %18, i32 25, i32 %19)
br label %21
21: ; preds = %14
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %10
24: ; preds = %10
store i32 0, i32* %2
br label %25
25: ; preds = %74, %24
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = icmp sle i32 %26, %27
br i1 %28, label %29, label %77
29: ; preds = %25
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %32
32: ; preds = %70, %29
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = icmp sle i32 %33, %34
br i1 %35, label %36, label %73
36: ; preds = %32
%37 = load i32, i32* %2
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %5, i64 0, i64 %38
%40 = getelementptr inbounds [25 x i8], [25 x i8]* %39, i64 0, i64 0
%41 = load i32, i32* %3
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %5, i64 0, i64 %42
%44 = getelementptr inbounds [25 x i8], [25 x i8]* %43, i64 0, i64 0
%45 = call i64 @strcmp(i8* %40, i8* %44)
%46 = icmp sgt i64 %45, 0
br i1 %46, label %47, label %69
47: ; preds = %36
%48 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%49 = load i32, i32* %2
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %5, i64 0, i64 %50
%52 = getelementptr inbounds [25 x i8], [25 x i8]* %51, i64 0, i64 0
%53 = call i32 @strcpy(i8* %48, i8* %52)
%54 = load i32, i32* %2
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %5, i64 0, i64 %55
%57 = getelementptr inbounds [25 x i8], [25 x i8]* %56, i64 0, i64 0
%58 = load i32, i32* %3
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %5, i64 0, i64 %59
%61 = getelementptr inbounds [25 x i8], [25 x i8]* %60, i64 0, i64 0
%62 = call i32 @strcpy(i8* %57, i8* %61)
%63 = load i32, i32* %3
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %5, i64 0, i64 %64
%66 = getelementptr inbounds [25 x i8], [25 x i8]* %65, i64 0, i64 0
%67 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%68 = call i32 @strcpy(i8* %66, i8* %67)
br label %69
69: ; preds = %47, %36
br label %70
70: ; preds = %69
%71 = load i32, i32* %3
%72 = add nsw i32 %71, 1
store i32 %72, i32* %3
br label %32
73: ; preds = %32
br label %74
74: ; preds = %73
%75 = load i32, i32* %2
%76 = add nsw i32 %75, 1
store i32 %76, i32* %2
br label %25
77: ; preds = %25
%78 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %79
79: ; preds = %89, %77
%80 = load i32, i32* %2
%81 = load i32, i32* %4
%82 = icmp sle i32 %80, %81
br i1 %82, label %83, label %92
83: ; preds = %79
%84 = load i32, i32* %2
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %5, i64 0, i64 %85
%87 = getelementptr inbounds [25 x i8], [25 x i8]* %86, i64 0, i64 0
%88 = call i32 @puts(i8* %87)
br label %89
89: ; preds = %83
%90 = load i32, i32* %2
%91 = add nsw i32 %90, 1
store i32 %91, i32* %2
br label %79
92: ; preds = %79
ret i32 0
}

LLVM IR (-O2):
@.str = [41 x i8] c"How many strings u are going to enter?: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"Enter Strings one by one: \00"
@stdin = global i32 0
@.str.3 = [25 x i8] c"Order of Sorted Strings:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x [25 x i8]]
%3 = alloca [25 x i8]
%4 = bitcast i32* %1 to i8*
%5 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %2, i64 0, i64 0, i64 0
%6 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%10 = load i32, i32* %1
%11 = icmp slt i32 %10, 0
br i1 %11, label %53, label %14
12: ; preds = %14
%13 = icmp slt i32 %20, 0
br i1 %13, label %53, label %30
14: ; preds = %0, %14
%15 = phi i64 [ %19, %14 ], [ 0, %0 ]
%16 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %2, i64 0, i64 %15, i64 0
%17 = load i32, i32* @stdin
%18 = call i32 @fgets(i8* %16, i32 25, i32 %17)
%19 = add nuw nsw i64 %15, 1
%20 = load i32, i32* %1
%21 = sext i32 %20 to i64
%22 = icmp slt i64 %15, %21
br i1 %22, label %14, label %12
23: ; preds = %48
%24 = sext i32 %50 to i64
br label %25
25: ; preds = %23, %30
%26 = phi i64 [ %24, %23 ], [ %35, %30 ]
%27 = phi i32 [ %50, %23 ], [ %31, %30 ]
%28 = icmp slt i64 %32, %26
%29 = add nuw nsw i64 %33, 1
br i1 %28, label %30, label %53
30: ; preds = %12, %25
%31 = phi i32 [ %27, %25 ], [ %20, %12 ]
%32 = phi i64 [ %34, %25 ], [ 0, %12 ]
%33 = phi i64 [ %29, %25 ], [ 1, %12 ]
%34 = add nuw nsw i64 %32, 1
%35 = sext i32 %31 to i64
%36 = icmp slt i64 %32, %35
br i1 %36, label %37, label %25
37: ; preds = %30
%38 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %2, i64 0, i64 %32, i64 0
br label %39
39: ; preds = %37, %48
%40 = phi i64 [ %33, %37 ], [ %49, %48 ]
%41 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %2, i64 0, i64 %40, i64 0
%42 = call i64 @strcmp(i8* %38, i8* %41)
%43 = icmp sgt i64 %42, 0
br i1 %43, label %44, label %48
44: ; preds = %39
%45 = call i32 @strcpy(i8* %6, i8* %38)
%46 = call i32 @strcpy(i8* %38, i8* %41)
%47 = call i32 @strcpy(i8* %41, i8* %6)
br label %48
48: ; preds = %39, %44
%49 = add nuw nsw i64 %40, 1
%50 = load i32, i32* %1
%51 = trunc i64 %40 to i32
%52 = icmp sgt i32 %50, %51
br i1 %52, label %39, label %23
53: ; preds = %25, %0, %12
%54 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%55 = load i32, i32* %1
%56 = icmp slt i32 %55, 0
br i1 %56, label %65, label %57
57: ; preds = %53, %57
%58 = phi i64 [ %61, %57 ], [ 0, %53 ]
%59 = getelementptr inbounds [25 x [25 x i8]], [25 x [25 x i8]]* %2, i64 0, i64 %58, i64 0
%60 = call i32 @puts(i8* %59)
%61 = add nuw nsw i64 %58, 1
%62 = load i32, i32* %1
%63 = sext i32 %62 to i64
%64 = icmp slt i64 %58, %63
br i1 %64, label %57, label %65
65: ; preds = %57, %53
ret i32 0
}