#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 strcmp(char *, char *);
int /*<<< orphan*/ swapStrings(char *, char *);
void sortStrings(char strings[5][32]) {
  for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 5; j++) {
      do {
        break;
      } while (j == 4);
      int compareValue = strcmp(strings[j], strings[i]);
      if (compareValue > 0) {
        swapStrings(strings[j], strings[i]);
      } else {
      }
    }
  }
}


x86 assembly (clang, -O0):
<sortStrings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11db <sortStrings+0xbb>
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11c8 <sortStrings+0xa8>
jmp    1153 <sortStrings+0x33>
jmp    1158 <sortStrings+0x38>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rsi
call   1030 <strcmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11b0 <sortStrings+0x90>
mov    -0x8(%rbp),%rdi
movslq -0x10(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x5,%rax
add    %rax,%rsi
call   1040 <swapStrings@plt>
jmp    11b5 <sortStrings+0x95>
jmp    11b5 <sortStrings+0x95>
jmp    11ba <sortStrings+0x9a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <sortStrings+0x24>
jmp    11cd <sortStrings+0xad>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <sortStrings+0x13>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortStrings>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0x20(%rdi),%rax
mov    %rax,(%rsp)
lea    0x40(%rdi),%r15
lea    0x60(%rdi),%r12
lea    0x80(%rdi),%r13
xor    %r14d,%r14d
jmp    1161 <sortStrings+0x41>
nopw   0x0(%rax,%rax,1)
add    $0x20,%r14
cmp    $0xa0,%r14
je     11f2 <sortStrings+0xd2>
lea    (%rbx,%r14,1),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jle    117f <sortStrings+0x5f>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <swapStrings@plt>
mov    (%rsp),%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jle    119b <sortStrings+0x7b>
mov    (%rsp),%rdi
mov    %rbp,%rsi
call   1040 <swapStrings@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jle    11b5 <sortStrings+0x95>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1040 <swapStrings@plt>
mov    %r12,%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jle    11cf <sortStrings+0xaf>
mov    %r12,%rdi
mov    %rbp,%rsi
call   1040 <swapStrings@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
test   %eax,%eax
jle    1150 <sortStrings+0x30>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1040 <swapStrings@plt>
jmp    1150 <sortStrings+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @sortStrings([32 x i8]* %0) {
%2 = alloca [32 x i8]*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store [32 x i8]* %0, [32 x i8]** %2
store i32 0, i32* %3
br label %6
6: ; preds = %50, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 5
br i1 %8, label %9, label %53
9: ; preds = %6
store i32 0, i32* %4
br label %10
10: ; preds = %46, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %49
13: ; preds = %10
br label %14
14: ; preds = %15, %13
br label %18
15: ; No predecessors!
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 4
br i1 %17, label %14, label %18
18: ; preds = %15, %14
%19 = load [32 x i8]*, [32 x i8]** %2
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %19, i64 %21
%23 = getelementptr inbounds [32 x i8], [32 x i8]* %22, i64 0, i64 0
%24 = load [32 x i8]*, [32 x i8]** %2
%25 = load i32, i32* %3
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [32 x i8], [32 x i8]* %24, i64 %26
%28 = getelementptr inbounds [32 x i8], [32 x i8]* %27, i64 0, i64 0
%29 = call i32 @strcmp(i8* %23, i8* %28)
store i32 %29, i32* %5
%30 = load i32, i32* %5
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %44
32: ; preds = %18
%33 = load [32 x i8]*, [32 x i8]** %2
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [32 x i8], [32 x i8]* %33, i64 %35
%37 = getelementptr inbounds [32 x i8], [32 x i8]* %36, i64 0, i64 0
%38 = load [32 x i8]*, [32 x i8]** %2
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [32 x i8], [32 x i8]* %38, i64 %40
%42 = getelementptr inbounds [32 x i8], [32 x i8]* %41, i64 0, i64 0
%43 = call i32 @swapStrings(i8* %37, i8* %42)
br label %45
44: ; preds = %18
br label %45
45: ; preds = %44, %32
br label %46
46: ; preds = %45
%47 = load i32, i32* %4
%48 = add nsw i32 %47, 1
store i32 %48, i32* %4
br label %10
49: ; preds = %10
br label %50
50: ; preds = %49
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %6
53: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @sortStrings([32 x i8]* %0) {
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %0, i64 0, i64 0
%3 = getelementptr inbounds [32 x i8], [32 x i8]* %0, i64 1, i64 0
%4 = getelementptr inbounds [32 x i8], [32 x i8]* %0, i64 2, i64 0
%5 = getelementptr inbounds [32 x i8], [32 x i8]* %0, i64 3, i64 0
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %0, i64 4, i64 0
br label %7
7: ; preds = %1, %35
%8 = phi i64 [ 0, %1 ], [ %36, %35 ]
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %0, i64 %8, i64 0
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %2, i8* dereferenceable(1) %9)
%11 = icmp sgt i32 %10, 0
br i1 %11, label %13, label %15
12: ; preds = %35
ret void
13: ; preds = %7
%14 = tail call i32 @swapStrings(i8* %2, i8* %9)
br label %15
15: ; preds = %7, %13
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(1) %9)
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = tail call i32 @swapStrings(i8* %3, i8* %9)
br label %20
20: ; preds = %18, %15
%21 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %9)
%22 = icmp sgt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = tail call i32 @swapStrings(i8* %4, i8* %9)
br label %25
25: ; preds = %23, %20
%26 = tail call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %9)
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = tail call i32 @swapStrings(i8* %5, i8* %9)
br label %30
30: ; preds = %28, %25
%31 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(1) %9)
%32 = icmp sgt i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = tail call i32 @swapStrings(i8* %6, i8* %9)
br label %35
35: ; preds = %33, %30
%36 = add nuw nsw i64 %8, 1
%37 = icmp eq i64 %36, 5
br i1 %37, label %12, label %7
}