#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*/ cmp(char *, char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int main() {
  char s[5][80], *p[5];
  int i, j;
  printf("ÇëÊäÈë5¸ö×Ö·û´®~Ã´Ã´~:\n");
  for (i = 0; i < 5; i++)
    gets(s[i]);
  printf("======================\n");
  for (i = 0; i < 5; i++)
    p[i] = s[i];
  for (i = 0; i < 5; i++)
    for (j = i + 1; j < 5; j++)
      cmp(p[i], p[j]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x1d4(%rbp)
cmpl   $0x5,-0x1d4(%rbp)
jge    1193 <main+0x63>
movslq -0x1d4(%rbp),%rax
lea    -0x1a0(%rbp),%rdi
imul   $0x50,%rax,%rax
add    %rax,%rdi
call   1050 <gets@plt>
mov    -0x1d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d4(%rbp)
jmp    1158 <main+0x28>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x1d4(%rbp)
cmpl   $0x5,-0x1d4(%rbp)
jge    11ee <main+0xbe>
movslq -0x1d4(%rbp),%rax
lea    -0x1a0(%rbp),%rcx
imul   $0x50,%rax,%rax
add    %rax,%rcx
movslq -0x1d4(%rbp),%rax
mov    %rcx,-0x1d0(%rbp,%rax,8)
ff
mov    -0x1d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d4(%rbp)
jmp    11a9 <main+0x79>
movl   $0x0,-0x1d4(%rbp)
cmpl   $0x5,-0x1d4(%rbp)
jge    1271 <main+0x141>
mov    -0x1d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d8(%rbp)
cmpl   $0x5,-0x1d8(%rbp)
jge    1258 <main+0x128>
movslq -0x1d4(%rbp),%rax
mov    -0x1d0(%rbp,%rax,8),%rdi
ff
movslq -0x1d8(%rbp),%rax
mov    -0x1d0(%rbp,%rax,8),%rsi
ff
call   1040 <cmp@plt>
mov    -0x1d8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d8(%rbp)
jmp    1214 <main+0xe4>
jmp    125d <main+0x12d>
mov    -0x1d4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1d4(%rbp)
jmp    11f8 <main+0xc8>
xor    %eax,%eax
add    $0x1e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x190,%rsp
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
lea    0x50(%rsp),%r13
mov    %r13,%rdi
call   1050 <gets@plt>
lea    0xa0(%rsp),%r15
mov    %r15,%rdi
call   1050 <gets@plt>
lea    0xf0(%rsp),%r14
mov    %r14,%rdi
call   1050 <gets@plt>
lea    0x140(%rsp),%r12
mov    %r12,%rdi
call   1050 <gets@plt>
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <cmp@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <cmp@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <cmp@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <cmp@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1040 <cmp@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   1040 <cmp@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <cmp@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <cmp@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <cmp@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <cmp@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\C3\87\C3\AB\C3\8A\C3\A4\C3\88\C3\AB5\C2\B8\C3\B6\C3\97\C3\96\C2\B7\C3\BB\C2\B4\C2\AE~\C3\83\C2\B4\C3\83\C2\B4~:\0A\00"
@.str.1 = [24 x i8] c"======================\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x [80 x i8]]
%3 = alloca [5 x i8*]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %7
7: ; preds = %16, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 5
br i1 %9, label %10, label %19
10: ; preds = %7
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %2, i64 0, i64 %12
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%15 = call i32 @gets(i8* %14)
br label %16
16: ; preds = %10
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %7
19: ; preds = %7
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %4
br label %21
21: ; preds = %32, %19
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 5
br i1 %23, label %24, label %35
24: ; preds = %21
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %2, i64 0, i64 %26
%28 = getelementptr inbounds [80 x i8], [80 x i8]* %27, i64 0, i64 0
%29 = load i32, i32* %4
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 %30
store i8* %28, i8** %31
br label %32
32: ; preds = %24
%33 = load i32, i32* %4
%34 = add nsw i32 %33, 1
store i32 %34, i32* %4
br label %21
35: ; preds = %21
store i32 0, i32* %4
br label %36
36: ; preds = %59, %35
%37 = load i32, i32* %4
%38 = icmp slt i32 %37, 5
br i1 %38, label %39, label %62
39: ; preds = %36
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %42
42: ; preds = %55, %39
%43 = load i32, i32* %5
%44 = icmp slt i32 %43, 5
br i1 %44, label %45, label %58
45: ; preds = %42
%46 = load i32, i32* %4
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 %47
%49 = load i8*, i8** %48
%50 = load i32, i32* %5
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [5 x i8*], [5 x i8*]* %3, i64 0, i64 %51
%53 = load i8*, i8** %52
%54 = call i32 @cmp(i8* %49, i8* %53)
br label %55
55: ; preds = %45
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %42
58: ; preds = %42
br label %59
59: ; preds = %58
%60 = load i32, i32* %4
%61 = add nsw i32 %60, 1
store i32 %61, i32* %4
br label %36
62: ; preds = %36
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"\C3\87\C3\AB\C3\8A\C3\A4\C3\88\C3\AB5\C2\B8\C3\B6\C3\97\C3\96\C2\B7\C3\BB\C2\B4\C2\AE~\C3\83\C2\B4\C3\83\C2\B4~:\00"
@str.2 = [23 x i8] c"======================\00"
define i32 @main() {
%1 = alloca [5 x [80 x i8]]
%2 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 0, i64 0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%4 = call i32 @gets(i8* %2)
%5 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 1, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 2, i64 0
%8 = call i32 @gets(i8* %7)
%9 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 3, i64 0
%10 = call i32 @gets(i8* %9)
%11 = getelementptr inbounds [5 x [80 x i8]], [5 x [80 x i8]]* %1, i64 0, i64 4, i64 0
%12 = call i32 @gets(i8* %11)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0))
%14 = call i32 @cmp(i8* %2, i8* %5)
%15 = call i32 @cmp(i8* %2, i8* %7)
%16 = call i32 @cmp(i8* %2, i8* %9)
%17 = call i32 @cmp(i8* %2, i8* %11)
%18 = call i32 @cmp(i8* %5, i8* %7)
%19 = call i32 @cmp(i8* %5, i8* %9)
%20 = call i32 @cmp(i8* %5, i8* %11)
%21 = call i32 @cmp(i8* %7, i8* %9)
%22 = call i32 @cmp(i8* %7, i8* %11)
%23 = call i32 @cmp(i8* %9, i8* %11)
ret i32 0
}