#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*/ getchar();
int /*<<< orphan*/ puts(char *);
scalar_t__ strcmp(char *, char *);
void main() {
  char *p[6] = {"Trinidad and Tobago", "Zambia", "Itlay",
                "Mauritania",          "France", "Romania"},
       *temp;
  int i, j, k;
  for (i = 0; i < 5; i++) {
    k = i;
    for (j = i + 1; j < 6; j++)
      if (strcmp(p[j], p[k]) < 0)
        k = j;
    temp = p[k];
    p[k] = p[i];
    p[i] = temp;
  }
  for (i = 0; i < 6; i++)
    puts(p[i]);
  getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
lea    0xea1(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xeaa(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xea6(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xea1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea1(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x5,-0x3c(%rbp)
jge    1238 <main+0xf8>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x6,-0x40(%rbp)
jge    11fe <main+0xbe>
movslq -0x40(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rdi
movslq -0x44(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jge    11eb <main+0xab>
mov    -0x40(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    11f0 <main+0xb0>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    11ba <main+0x7a>
movslq -0x44(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rax
mov    %rax,-0x38(%rbp)
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rcx
movslq -0x44(%rbp),%rax
mov    %rcx,-0x30(%rbp,%rax,8)
mov    -0x38(%rbp),%rcx
movslq -0x3c(%rbp),%rax
mov    %rcx,-0x30(%rbp,%rax,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11a1 <main+0x61>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x6,-0x3c(%rbp)
jge    1265 <main+0x125>
movslq -0x3c(%rbp),%rax
mov    -0x30(%rbp,%rax,8),%rdi
call   1030 <puts@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    123f <main+0xff>
mov    $0x0,%al
call   1060 <getchar@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xebb(%rip),%r15
mov    %r15,(%rsp)
lea    0xec4(%rip),%rdi
mov    %rdi,0x8(%rsp)
lea    0xebf(%rip),%rbx
mov    %rbx,0x10(%rsp)
lea    0xeb9(%rip),%r13
mov    %r13,0x18(%rsp)
lea    0xeb8(%rip),%r12
mov    %r12,0x20(%rsp)
lea    0xeb3(%rip),%r14
mov    %r14,0x28(%rsp)
mov    %r15,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rbp
shr    $0x3f,%rbp
mov    (%rsp,%rbp,8),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    $0x2,%ebx
cmovns %ebp,%ebx
mov    (%rsp,%rbx,8),%rsi
mov    %r13,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    $0x3,%ebp
cmovs  %ebp,%ebx
mov    (%rsp,%rbx,8),%rsi
mov    %r12,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    $0x4,%r13d
cmovs  %r13d,%ebx
mov    (%rsp,%rbx,8),%rsi
mov    %r14,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
mov    $0x5,%r12d
cmovs  %r12,%rbx
mov    (%rsp,%rbx,8),%rax
mov    %r15,(%rsp,%rbx,8)
mov    %rax,(%rsp)
mov    0x8(%rsp),%r14
mov    0x10(%rsp),%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rbx
shr    $0x3f,%rbx
add    $0x1,%ebx
mov    0x18(%rsp),%rdi
mov    (%rsp,%rbx,8),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
cmovs  %ebp,%ebx
mov    0x20(%rsp),%rdi
mov    (%rsp,%rbx,8),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
cmovs  %r13d,%ebx
mov    0x28(%rsp),%rdi
mov    (%rsp,%rbx,8),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
cmovs  %r12,%rbx
mov    (%rsp,%rbx,8),%rax
mov    %r14,(%rsp,%rbx,8)
mov    %rax,0x8(%rsp)
mov    0x10(%rsp),%r14
mov    0x18(%rsp),%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rbx
shr    $0x3f,%rbx
or     $0x2,%ebx
mov    0x20(%rsp),%rdi
mov    (%rsp,%rbx,8),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
cmovs  %r13d,%ebx
mov    0x28(%rsp),%rdi
mov    (%rsp,%rbx,8),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
cmovs  %r12,%rbx
mov    (%rsp,%rbx,8),%rax
mov    %r14,(%rsp,%rbx,8)
mov    %rax,0x10(%rsp)
mov    0x18(%rsp),%rbx
mov    0x20(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rbp
shr    $0x3f,%rbp
add    $0x3,%ebp
mov    0x28(%rsp),%rdi
mov    (%rsp,%rbp,8),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
cmovs  %r12,%rbp
mov    (%rsp,%rbp,8),%rax
mov    %rbx,(%rsp,%rbp,8)
mov    %rax,0x18(%rsp)
mov    0x20(%rsp),%rbx
mov    0x28(%rsp),%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
shr    $0x3f,%rax
mov    0x20(%rsp,%rax,8),%rbp
mov    %rbx,0x20(%rsp,%rax,8)
mov    (%rsp),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rdi
call   1030 <puts@plt>
mov    0x10(%rsp),%rdi
call   1030 <puts@plt>
mov    0x18(%rsp),%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    0x28(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <getchar@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Trinidad and Tobago\00"
@.str.1 = [7 x i8] c"Zambia\00"
@.str.2 = [6 x i8] c"Itlay\00"
@.str.3 = [11 x i8] c"Mauritania\00"
@.str.4 = [7 x i8] c"France\00"
@.str.5 = [8 x i8] c"Romania\00"
define void @main() {
%1 = alloca [6 x i8*]
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast [6 x i8*]* %1 to i8*
%7 = bitcast i8* %6 to [6 x i8*]*
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 0
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i32 0, i32 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i32 0, i32 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i32 0, i32 5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i32 0, i32 0), i8** %13
store i32 0, i32* %3
br label %14
14: ; preds = %57, %0
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 5
br i1 %16, label %17, label %60
17: ; preds = %14
%18 = load i32, i32* %3
store i32 %18, i32* %5
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %21
21: ; preds = %38, %17
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 6
br i1 %23, label %24, label %41
24: ; preds = %21
%25 = load i32, i32* %4
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %26
%28 = load i8*, i8** %27
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %30
%32 = load i8*, i8** %31
%33 = call i64 @strcmp(i8* %28, i8* %32)
%34 = icmp slt i64 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %24
%36 = load i32, i32* %4
store i32 %36, i32* %5
br label %37
37: ; preds = %35, %24
br label %38
38: ; preds = %37
%39 = load i32, i32* %4
%40 = add nsw i32 %39, 1
store i32 %40, i32* %4
br label %21
41: ; preds = %21
%42 = load i32, i32* %5
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %43
%45 = load i8*, i8** %44
store i8* %45, i8** %2
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %47
%49 = load i8*, i8** %48
%50 = load i32, i32* %5
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %51
store i8* %49, i8** %52
%53 = load i8*, i8** %2
%54 = load i32, i32* %3
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %55
store i8* %53, i8** %56
br label %57
57: ; preds = %41
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %14
60: ; preds = %14
store i32 0, i32* %3
br label %61
61: ; preds = %70, %60
%62 = load i32, i32* %3
%63 = icmp slt i32 %62, 6
br i1 %63, label %64, label %73
64: ; preds = %61
%65 = load i32, i32* %3
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %66
%68 = load i8*, i8** %67
%69 = call i32 @puts(i8* %68)
br label %70
70: ; preds = %64
%71 = load i32, i32* %3
%72 = add nsw i32 %71, 1
store i32 %72, i32* %3
br label %61
73: ; preds = %61
%74 = call i32 (...) @getchar()
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Trinidad and Tobago\00"
@.str.1 = [7 x i8] c"Zambia\00"
@.str.2 = [6 x i8] c"Itlay\00"
@.str.3 = [11 x i8] c"Mauritania\00"
@.str.4 = [7 x i8] c"France\00"
@.str.5 = [8 x i8] c"Romania\00"
define void @main() {
%1 = alloca [6 x i8*]
%2 = bitcast [6 x i8*]* %1 to i8*
%3 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 0
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %4
%5 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 2
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %5
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 3
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 4
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8** %8
%9 = tail call i64 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = lshr i64 %9, 63
%11 = trunc i64 %10 to i32
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %10
%13 = load i8*, i8** %12
%14 = tail call i64 @strcmp(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = icmp slt i64 %14, 0
%16 = select i1 %15, i32 2, i32 %11
%17 = zext i32 %16 to i64
%18 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %17
%19 = load i8*, i8** %18
%20 = tail call i64 @strcmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = icmp slt i64 %20, 0
%22 = select i1 %21, i32 3, i32 %16
%23 = zext i32 %22 to i64
%24 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %23
%25 = load i8*, i8** %24
%26 = tail call i64 @strcmp(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* %25)
%27 = icmp slt i64 %26, 0
%28 = select i1 %27, i32 4, i32 %22
%29 = zext i32 %28 to i64
%30 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %29
%31 = load i8*, i8** %30
%32 = tail call i64 @strcmp(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i8* %31)
%33 = icmp slt i64 %32, 0
%34 = zext i32 %28 to i64
%35 = select i1 %33, i64 5, i64 %34
%36 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %35
%37 = load i8*, i8** %36
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %36
store i8* %37, i8** %3
%38 = load i8*, i8** %5
%39 = load i8*, i8** %4
%40 = tail call i64 @strcmp(i8* %38, i8* %39)
%41 = icmp slt i64 %40, 0
%42 = select i1 %41, i32 2, i32 1
%43 = load i8*, i8** %6
%44 = zext i32 %42 to i64
%45 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %44
%46 = load i8*, i8** %45
%47 = tail call i64 @strcmp(i8* %43, i8* %46)
%48 = icmp slt i64 %47, 0
%49 = select i1 %48, i32 3, i32 %42
%50 = load i8*, i8** %7
%51 = zext i32 %49 to i64
%52 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %51
%53 = load i8*, i8** %52
%54 = tail call i64 @strcmp(i8* %50, i8* %53)
%55 = icmp slt i64 %54, 0
%56 = select i1 %55, i32 4, i32 %49
%57 = load i8*, i8** %8
%58 = zext i32 %56 to i64
%59 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %58
%60 = load i8*, i8** %59
%61 = tail call i64 @strcmp(i8* %57, i8* %60)
%62 = icmp slt i64 %61, 0
%63 = zext i32 %56 to i64
%64 = select i1 %62, i64 5, i64 %63
%65 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %64
%66 = load i8*, i8** %65
store i8* %39, i8** %65
store i8* %66, i8** %4
%67 = load i8*, i8** %6
%68 = load i8*, i8** %5
%69 = tail call i64 @strcmp(i8* %67, i8* %68)
%70 = icmp slt i64 %69, 0
%71 = select i1 %70, i32 3, i32 2
%72 = load i8*, i8** %7
%73 = zext i32 %71 to i64
%74 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %73
%75 = load i8*, i8** %74
%76 = tail call i64 @strcmp(i8* %72, i8* %75)
%77 = icmp slt i64 %76, 0
%78 = select i1 %77, i32 4, i32 %71
%79 = load i8*, i8** %8
%80 = zext i32 %78 to i64
%81 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %80
%82 = load i8*, i8** %81
%83 = tail call i64 @strcmp(i8* %79, i8* %82)
%84 = icmp slt i64 %83, 0
%85 = zext i32 %78 to i64
%86 = select i1 %84, i64 5, i64 %85
%87 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %86
%88 = load i8*, i8** %87
store i8* %68, i8** %87
store i8* %88, i8** %5
%89 = load i8*, i8** %7
%90 = load i8*, i8** %6
%91 = tail call i64 @strcmp(i8* %89, i8* %90)
%92 = icmp slt i64 %91, 0
%93 = select i1 %92, i32 4, i32 3
%94 = load i8*, i8** %8
%95 = zext i32 %93 to i64
%96 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %95
%97 = load i8*, i8** %96
%98 = tail call i64 @strcmp(i8* %94, i8* %97)
%99 = icmp slt i64 %98, 0
%100 = zext i32 %93 to i64
%101 = select i1 %99, i64 5, i64 %100
%102 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %101
%103 = load i8*, i8** %102
store i8* %90, i8** %102
store i8* %103, i8** %6
%104 = load i8*, i8** %8
%105 = load i8*, i8** %7
%106 = tail call i64 @strcmp(i8* %104, i8* %105)
%107 = icmp slt i64 %106, 0
%108 = select i1 %107, i64 5, i64 4
%109 = getelementptr inbounds [6 x i8*], [6 x i8*]* %1, i64 0, i64 %108
%110 = load i8*, i8** %109
store i8* %105, i8** %109
%111 = load i8*, i8** %3
%112 = tail call i32 @puts(i8* dereferenceable(1) %111)
%113 = load i8*, i8** %4
%114 = tail call i32 @puts(i8* dereferenceable(1) %113)
%115 = load i8*, i8** %5
%116 = tail call i32 @puts(i8* dereferenceable(1) %115)
%117 = load i8*, i8** %6
%118 = tail call i32 @puts(i8* dereferenceable(1) %117)
%119 = tail call i32 @puts(i8* dereferenceable(1) %110)
%120 = load i8*, i8** %8
%121 = tail call i32 @puts(i8* dereferenceable(1) %120)
%122 = tail call i32 (...) @getchar()
ret void
}