#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*/ bubble(char **, int);
int /*<<< orphan*/ get_array(char **, int);
int /*<<< orphan*/ print_array(char **, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char array[8][15];
  get_array(array, 8);
  printf("\nBefore Sorting\n");
  print_array(array, 8);
  bubble(array, 8);
  printf("\nAfter Sorting\n");
  print_array(array, 8);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x8,%esi
call   1060 <get_array@plt>
lea    0xe99(%rip),%rdi
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x8,%esi
call   1030 <print_array@plt>
lea    -0x80(%rbp),%rdi
mov    $0x8,%esi
call   1040 <bubble@plt>
lea    0xe82(%rip),%rdi
call   1050 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    $0x8,%esi
call   1030 <print_array@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x8,%esi
call   1060 <get_array@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <print_array@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1050 <bubble@plt>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1040 <print_array@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0ABefore Sorting\0A\00"
@.str.1 = [16 x i8] c"\0AAfter Sorting\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x [15 x i8]]
store i32 0, i32* %1
%3 = getelementptr inbounds [8 x [15 x i8]], [8 x [15 x i8]]* %2, i64 0, i64 0
%4 = bitcast [15 x i8]* %3 to i8**
%5 = call i32 @get_array(i8** %4, i32 8)
%6 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [8 x [15 x i8]], [8 x [15 x i8]]* %2, i64 0, i64 0
%8 = bitcast [15 x i8]* %7 to i8**
%9 = call i32 @print_array(i8** %8, i32 8)
%10 = getelementptr inbounds [8 x [15 x i8]], [8 x [15 x i8]]* %2, i64 0, i64 0
%11 = bitcast [15 x i8]* %10 to i8**
%12 = call i32 @bubble(i8** %11, i32 8)
%13 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [8 x [15 x i8]], [8 x [15 x i8]]* %2, i64 0, i64 0
%15 = bitcast [15 x i8]* %14 to i8**
%16 = call i32 @print_array(i8** %15, i32 8)
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"\0ABefore Sorting\00"
@str.2 = [15 x i8] c"\0AAfter Sorting\00"
define i32 @main() {
%1 = alloca [8 x [15 x i8]]
%2 = getelementptr inbounds [8 x [15 x i8]], [8 x [15 x i8]]* %1, i64 0, i64 0, i64 0
%3 = bitcast [8 x [15 x i8]]* %1 to i8**
%4 = call i32 @get_array(i8** %3, i32 8)
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%6 = call i32 @print_array(i8** %3, i32 8)
%7 = call i32 @bubble(i8** %3, i32 8)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.2, i64 0, i64 0))
%9 = call i32 @print_array(i8** %3, i32 8)
ret i32 0
}