#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 strend(char *, char *);
int main(void) {
  int ret = 0;
  char s[] = "Je veux lui dire,", t[] = "dire,";
  if (strend(s, t) == 1)
    printf("\nThe string \n\t%s\nappears at the end of \n\t%s\n", t, s);
  else
    printf("\nThe string \n\t%s\ndoes not appear at the end of \n\t%s\n", t, s);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xebd(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x26(%rbp)
mov    0xeaf(%rip),%ax
mov    %ax,-0x22(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x26(%rbp),%rsi
call   1040 <strend@plt>
cmp    $0x1,%eax
jne    119a <main+0x7a>
lea    -0x26(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
jmp    11ae <main+0x8e>
lea    -0x26(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x28,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movw   $0x2c,0x20(%rsp)
movw   $0x2c,0xc(%rsp)
movl   $0x65726964,0x8(%rsp)
65
lea    0x10(%rsp),%r14
lea    0x8(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strend@plt>
cmp    $0x1,%eax
lea    0xeb0(%rip),%rax
lea    0xed6(%rip),%rdi
cmove  %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s = [18 x i8] c"Je veux lui dire,\00"
@__const.main.t = [6 x i8] c"dire,\00"
@.str = [45 x i8] c"\0AThe string \0A\09%s\0Aappears at the end of \0A\09%s\0A\00"
@.str.1 = [53 x i8] c"\0AThe string \0A\09%s\0Adoes not appear at the end of \0A\09%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [18 x i8]
%4 = alloca [6 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
%5 = bitcast [18 x i8]* %3 to i8*
%6 = bitcast [6 x i8]* %4 to i8*
%7 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%9 = call i32 @strend(i8* %7, i8* %8)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %15
11: ; preds = %0
%12 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%14 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
br label %19
15: ; preds = %0
%16 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%17 = getelementptr inbounds [18 x i8], [18 x i8]* %3, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0), i8* %16, i8* %17)
br label %19
19: ; preds = %15, %11
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@__const.main.s = [18 x i8] c"Je veux lui dire,\00"
@__const.main.t = [6 x i8] c"dire,\00"
@.str = [45 x i8] c"\0AThe string \0A\09%s\0Aappears at the end of \0A\09%s\0A\00"
@.str.1 = [53 x i8] c"\0AThe string \0A\09%s\0Adoes not appear at the end of \0A\09%s\0A\00"
define i32 @main() {
%1 = alloca [18 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [18 x i8], [18 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = call i32 @strend(i8* %3, i8* %4)
%6 = icmp eq i32 %5, 1
%7 = select i1 %6, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0)
%8 = call i32 @printf(i8* %7, i8* %4, i8* %3)
ret i32 0
}