#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*/ assert(int);
int /*<<< orphan*/ bwt_get_last_column(char **, char *, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ strcmp(char *, char *);
void test_bwt_get_last_column() {
  char *strings[4] = {"abcl", "bsja", "dahs", "jsit"};
  char last_column[5];
  bwt_get_last_column(strings, last_column, 4);
  assert(!strcmp(last_column, "last"));
  printf("\tLast column test passed\n");
}


x86 assembly (clang, -O0):
<test_bwt_get_last_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x2cb1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cae(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cab(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2ca8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x25(%rbp),%rsi
mov    $0x4,%edx
call   1030 <bwt_get_last_column@plt>
lea    -0x25(%rbp),%rdi
lea    0xe83(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe6a(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bwt_get_last_column>:
sub    $0x38,%rsp
movaps 0x2cd5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2cb9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
lea    0xb(%rsp),%rsi
mov    $0x4,%edx
call   1040 <bwt_get_last_column@plt>
mov    $0x7473616c,%eax
xor    0xb(%rsp),%eax
movzbl 0xf(%rsp),%ecx
xor    %edi,%edi
or     %eax,%ecx
sete   %dil
call   1050 <assert@plt>
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"abcl\00"
@.str.1 = [5 x i8] c"bsja\00"
@.str.2 = [5 x i8] c"dahs\00"
@.str.3 = [5 x i8] c"jsit\00"
@__const.test_bwt_get_last_column.strings = [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [5 x i8] c"last\00"
@.str.5 = [26 x i8] c"\09Last column test passed\0A\00"
define void @test_bwt_get_last_column() {
%1 = alloca [4 x i8*]
%2 = alloca [5 x i8]
%3 = bitcast [4 x i8*]* %1 to i8*
%4 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%6 = call i32 @bwt_get_last_column(i8** %4, i8* %5, i32 4)
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = call i32 @strcmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcl\00"
@.str.1 = [5 x i8] c"bsja\00"
@.str.2 = [5 x i8] c"dahs\00"
@.str.3 = [5 x i8] c"jsit\00"
@__const.test_bwt_get_last_column.strings = [4 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0)]
@.str.4 = [5 x i8] c"last\00"
@str = [25 x i8] c"\09Last column test passed\00"
define void @test_bwt_get_last_column() {
%1 = alloca [4 x i8*]
%2 = alloca [5 x i8]
%3 = bitcast [4 x i8*]* %1 to i8*
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%6 = call i32 @bwt_get_last_column(i8** %5, i8* %4, i32 4)
%7 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5)
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}