#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 *, char *, char *, int);
int strend(char *, char *);
int main(void) {
  char *s0 = "abcdef";
  char *t0 = "def";
  char *s1 = "abcdef";
  char *t1 = "kef";
  printf("strend(%s, %s) = %d\n", s0, t0, strend(s0, t0));
  printf("strend(%s, %s) = %d\n", s1, t1, strend(s1, t1));
  printf("strend(%s, %s) = %d\n", t0, s0, strend(t0, s0));
  printf("strend(%s, %s) = %d\n", t1, s1, strend(t1, s1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec2(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xeb4(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xeb0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x68(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    %eax,%ecx
lea    0xe82(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x58(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    %eax,%ecx
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    %eax,%ecx
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    %eax,%ecx
lea    0xde9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rbx
lea    0xecd(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strend@plt>
lea    0xec3(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xea8(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strend@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strend@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <strend@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c"abcdef\00"
@.str.1 = [4 x i8] c"def\00"
@.str.2 = [4 x i8] c"kef\00"
@.str.3 = [21 x i8] c"strend(%s, %s) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8** %5
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i32 @strend(i8* %8, i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %6, i8* %7, i32 %10)
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = load i8*, i8** %4
%15 = load i8*, i8** %5
%16 = call i32 @strend(i8* %14, i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %12, i8* %13, i32 %16)
%18 = load i8*, i8** %3
%19 = load i8*, i8** %2
%20 = load i8*, i8** %3
%21 = load i8*, i8** %2
%22 = call i32 @strend(i8* %20, i8* %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %18, i8* %19, i32 %22)
%24 = load i8*, i8** %5
%25 = load i8*, i8** %4
%26 = load i8*, i8** %5
%27 = load i8*, i8** %4
%28 = call i32 @strend(i8* %26, i8* %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %24, i8* %25, i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"abcdef\00"
@.str.1 = [4 x i8] c"def\00"
@.str.2 = [4 x i8] c"kef\00"
@.str.3 = [21 x i8] c"strend(%s, %s) = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @strend(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @strend(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = tail call i32 @strend(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 @strend(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}