#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*/ printf(char *, ...);
int strend(char *, char *);
int main(int argc, char **argv) {
  char s[] = "This is a test.";
  char t[] = "a test";
  char u[] = "a test.";
  char v[] = "This is";
  printf("S[] = %s\n", s);
  printf("t[] = %s\n", t);
  printf("u[] = %s\n", u);
  printf("v[] = %s\n", v);
  int ret = strend(s, t);
  printf("t sub string at end of s? %d\n", ret);
  ret = strend(s, u);
  printf("u sub string at end of s? %d\n", ret);
  ret = strend(s, v);
  printf("v sub string at end of s? %d\n", ret);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0x27(%rbp)
mov    0xeb8(%rip),%ax
mov    %ax,-0x23(%rbp)
mov    0xeb0(%rip),%al
mov    %al,-0x21(%rbp)
mov    0xea7(%rip),%rax
mov    %rax,-0x2f(%rbp)
mov    0xea4(%rip),%rax
mov    %rax,-0x37(%rbp)
lea    -0x20(%rbp),%rsi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x27(%rbp),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x2f(%rbp),%rsi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x37(%rbp),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x27(%rbp),%rsi
call   1040 <strend@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x2f(%rbp),%rsi
call   1040 <strend@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x37(%rbp),%rsi
call   1040 <strend@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x38,%rsp
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x747365,0xb(%rsp)
movl   $0x65742061,0x8(%rsp)
65
movabs $0x2e747365742061,%rax
mov    %rax,0x18(%rsp)
movabs $0x73692073696854,%rax
mov    %rax,0x10(%rsp)
lea    0xeab(%rip),%rdi
lea    0x20(%rsp),%r15
mov    %r15,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    0x8(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe93(%rip),%rdi
lea    0x18(%rsp),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe87(%rip),%rdi
lea    0x10(%rsp),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strend@plt>
lea    0xe70(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1040 <strend@plt>
lea    0xe73(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strend@plt>
lea    0xe76(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.s = [16 x i8] c"This is a test.\00"
@__const.main.t = [7 x i8] c"a test\00"
@__const.main.u = [8 x i8] c"a test.\00"
@__const.main.v = [8 x i8] c"This is\00"
@.str = [10 x i8] c"S[] = %s\0A\00"
@.str.1 = [10 x i8] c"t[] = %s\0A\00"
@.str.2 = [10 x i8] c"u[] = %s\0A\00"
@.str.3 = [10 x i8] c"v[] = %s\0A\00"
@.str.4 = [30 x i8] c"t sub string at end of s? %d\0A\00"
@.str.5 = [30 x i8] c"u sub string at end of s? %d\0A\00"
@.str.6 = [30 x i8] c"v sub string at end of s? %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [16 x i8]
%7 = alloca [7 x i8]
%8 = alloca [8 x i8]
%9 = alloca [8 x i8]
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [16 x i8]* %6 to i8*
%12 = bitcast [7 x i8]* %7 to i8*
%13 = bitcast [8 x i8]* %8 to i8*
%14 = bitcast [8 x i8]* %9 to i8*
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %21)
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%24 = getelementptr inbounds [7 x i8], [7 x i8]* %7, i64 0, i64 0
%25 = call i32 @strend(i8* %23, i8* %24)
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%29 = getelementptr inbounds [8 x i8], [8 x i8]* %8, i64 0, i64 0
%30 = call i32 @strend(i8* %28, i8* %29)
store i32 %30, i32* %10
%31 = load i32, i32* %10
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %31)
%33 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%34 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%35 = call i32 @strend(i8* %33, i8* %34)
store i32 %35, i32* %10
%36 = load i32, i32* %10
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %36)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s = [16 x i8] c"This is a test.\00"
@__const.main.t = [7 x i8] c"a test\00"
@.str = [10 x i8] c"S[] = %s\0A\00"
@.str.1 = [10 x i8] c"t[] = %s\0A\00"
@.str.2 = [10 x i8] c"u[] = %s\0A\00"
@.str.3 = [10 x i8] c"v[] = %s\0A\00"
@.str.4 = [30 x i8] c"t sub string at end of s? %d\0A\00"
@.str.5 = [30 x i8] c"u sub string at end of s? %d\0A\00"
@.str.6 = [30 x i8] c"v sub string at end of s? %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [16 x i8]
%4 = alloca [7 x i8]
%5 = alloca i64
%6 = alloca i64
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %4, i64 0, i64 0
%9 = bitcast i64* %5 to i8*
store i64 13075887900860513, i64* %5
%10 = bitcast i64* %6 to i8*
store i64 32485210417883220, i64* %6
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64* %5)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i64* %6)
%15 = call i32 @strend(i8* %7, i8* %8)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i32 %15)
%17 = call i32 @strend(i8* %7, i8* %9)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %17)
%19 = call i32 @strend(i8* %7, i8* %10)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %19)
ret i32 0
}