#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() {
  char *s;
  char *t;
  s = "";
  t = "s";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  s = "short";
  t = "t";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  s = "short";
  t = "rt";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  s = "longer";
  t = "";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  s = "longer too";
  t = "o";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  s = "longer too";
  t = "z";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  s = "shorter";
  t = "is longer";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  s = "shorter";
  t = "!shorter";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  s = "shorter";
  t = "shorter";
  printf("strend('%s', '%s') returns %i\n", s, t, strend(s, t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee7(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xebc(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0xa8(%rbp),%rsi
mov    -0xa0(%rbp),%rdx
mov    %eax,%ecx
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
lea    0xe93(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe8c(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x98(%rbp),%rsi
mov    -0x90(%rbp),%rdx
mov    %eax,%ecx
lea    0xe2b(%rip),%rdi
call   1030 <printf@plt>
lea    0xe3e(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xe36(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x88(%rbp),%rsi
mov    -0x80(%rbp),%rdx
mov    %eax,%ecx
lea    0xddc(%rip),%rdi
call   1030 <printf@plt>
lea    0xe05(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xde3(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x78(%rbp),%rsi
mov    -0x70(%rbp),%rdx
mov    %eax,%ecx
lea    0xd93(%rip),%rdi
call   1030 <printf@plt>
lea    0xdac(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xdaa(%rip),%rax
mov    %rax,-0x18(%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    0xd4a(%rip),%rdi
call   1030 <printf@plt>
lea    0xd63(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xd63(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x58(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    %eax,%ecx
lea    0xd01(%rip),%rdi
call   1030 <printf@plt>
lea    0xd32(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xd1c(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    %eax,%ecx
lea    0xcb8(%rip),%rdi
call   1030 <printf@plt>
lea    0xce9(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xcdd(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x38(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    %eax,%ecx
lea    0xc6f(%rip),%rdi
call   1030 <printf@plt>
lea    0xca0(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xc95(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strend@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %eax,%ecx
lea    0xc26(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xef1(%rip),%r14
lea    0xeca(%rip),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strend@plt>
lea    0xeba(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xec2(%rip),%rbx
lea    0xebf(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strend@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xe9c(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <strend@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xe8d(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strend@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xe5b(%rip),%rbx
lea    0xe5d(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strend@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xe3d(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strend@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xe28(%rip),%rbx
lea    0xe16(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strend@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
lea    0xdfe(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strend@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
call   1040 <strend@plt>
mov    %r15,%rdi
mov    %rbx,%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 = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"s\00"
@.str.2 = [31 x i8] c"strend('%s', '%s') returns %i\0A\00"
@.str.3 = [6 x i8] c"short\00"
@.str.4 = [2 x i8] c"t\00"
@.str.5 = [3 x i8] c"rt\00"
@.str.6 = [7 x i8] c"longer\00"
@.str.7 = [11 x i8] c"longer too\00"
@.str.8 = [2 x i8] c"o\00"
@.str.9 = [2 x i8] c"z\00"
@.str.10 = [8 x i8] c"shorter\00"
@.str.11 = [10 x i8] c"is longer\00"
@.str.12 = [9 x i8] c"!shorter\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %3
%4 = load i8*, i8** %2
%5 = load i8*, i8** %3
%6 = load i8*, i8** %2
%7 = load i8*, i8** %3
%8 = call i32 @strend(i8* %6, i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %4, i8* %5, i32 %8)
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i8** %3
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = load i8*, i8** %3
%14 = call i32 @strend(i8* %12, i8* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %10, i8* %11, i32 %14)
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8** %3
%16 = load i8*, i8** %2
%17 = load i8*, i8** %3
%18 = load i8*, i8** %2
%19 = load i8*, i8** %3
%20 = call i32 @strend(i8* %18, i8* %19)
%21 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %16, i8* %17, i32 %20)
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
%22 = load i8*, i8** %2
%23 = load i8*, i8** %3
%24 = load i8*, i8** %2
%25 = load i8*, i8** %3
%26 = call i32 @strend(i8* %24, i8* %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %22, i8* %23, i32 %26)
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8** %3
%28 = load i8*, i8** %2
%29 = load i8*, i8** %3
%30 = load i8*, i8** %2
%31 = load i8*, i8** %3
%32 = call i32 @strend(i8* %30, i8* %31)
%33 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %28, i8* %29, i32 %32)
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8** %3
%34 = load i8*, i8** %2
%35 = load i8*, i8** %3
%36 = load i8*, i8** %2
%37 = load i8*, i8** %3
%38 = call i32 @strend(i8* %36, i8* %37)
%39 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %34, i8* %35, i32 %38)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8** %3
%40 = load i8*, i8** %2
%41 = load i8*, i8** %3
%42 = load i8*, i8** %2
%43 = load i8*, i8** %3
%44 = call i32 @strend(i8* %42, i8* %43)
%45 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %40, i8* %41, i32 %44)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i8** %3
%46 = load i8*, i8** %2
%47 = load i8*, i8** %3
%48 = load i8*, i8** %2
%49 = load i8*, i8** %3
%50 = call i32 @strend(i8* %48, i8* %49)
%51 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %46, i8* %47, i32 %50)
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8** %3
%52 = load i8*, i8** %2
%53 = load i8*, i8** %3
%54 = load i8*, i8** %2
%55 = load i8*, i8** %3
%56 = call i32 @strend(i8* %54, i8* %55)
%57 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %52, i8* %53, i32 %56)
ret i32 0
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [2 x i8] c"s\00"
@.str.2 = [31 x i8] c"strend('%s', '%s') returns %i\0A\00"
@.str.3 = [6 x i8] c"short\00"
@.str.4 = [2 x i8] c"t\00"
@.str.5 = [3 x i8] c"rt\00"
@.str.6 = [7 x i8] c"longer\00"
@.str.7 = [11 x i8] c"longer too\00"
@.str.8 = [2 x i8] c"o\00"
@.str.9 = [2 x i8] c"z\00"
@.str.10 = [8 x i8] c"shorter\00"
@.str.11 = [10 x i8] c"is longer\00"
@.str.12 = [9 x i8] c"!shorter\00"
define i32 @main() {
%1 = tail call i32 @strend(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @strend(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 %3)
%5 = tail call i32 @strend(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %5)
%7 = tail call i32 @strend(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @strend(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%10 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i32 %9)
%11 = tail call i32 @strend(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%12 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 %11)
%13 = tail call i32 @strend(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%14 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %13)
%15 = tail call i32 @strend(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
%16 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0), i32 %15)
%17 = tail call i32 @strend(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
%18 = tail call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0), i32 %17)
ret i32 0
}