#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() {
  char test_string1[100] = "bacon";
  char test_string2[100] = "I love bacon";
  printf("\n%s", test_string1);
  printf("\n%s", test_string2);
  printf("\n%d", strend(test_string2, test_string1));
  char test_string3[100] = "peanut butter";
  char test_string4[100] = "peanut butter and jelly";
  printf("\n%s", test_string3);
  printf("\n%s", test_string4);
  printf("\n%d", strend(test_string4, test_string3));
  printf("\n\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1040 <memset@plt>
movb   $0x62,-0x70(%rbp)
movb   $0x61,-0x6f(%rbp)
movb   $0x63,-0x6e(%rbp)
movb   $0x6f,-0x6d(%rbp)
movb   $0x6e,-0x6c(%rbp)
lea    -0xe0(%rbp),%rdi
lea    0xe83(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x70(%rbp),%rsi
lea    0xfb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xf9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xe0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
call   1060 <strend@plt>
mov    %eax,%esi
lea    0xf81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x150(%rbp),%rdi
lea    0xe94(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x1c0(%rbp),%rdi
lea    0xeec(%rip),%rsi
mov    $0x64,%edx
call   1050 <memcpy@plt>
lea    -0x150(%rbp),%rsi
lea    0xf38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1c0(%rbp),%rsi
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1c0(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1060 <strend@plt>
mov    %eax,%esi
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1b8,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movl   $0x6f636162,(%rsp)
movb   $0x6e,0x4(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x190(%rsp)
movaps 0xe99(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movaps 0xe7a(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
movaps 0xe5b(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movaps 0xe3c(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
movl   $0x0,0x1b0(%rsp)
lea    0xf66(%rip),%r15
mov    %rsp,%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x150(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strend@plt>
lea    0xf33(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movaps 0xe98(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xe79(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xe5a(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xe3b(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xe1c(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xdfd(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movl   $0x0,0x140(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xe84(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xe65(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xe46(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe27(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe08(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
lea    0xe0(%rsp),%r12
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x70(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <strend@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe1f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x1b8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.test_string2 = [100 x i8] c"I love bacon\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [4 x i8] c"\0A%d\00"
@__const.main.test_string3 = [100 x i8] c"peanut butter\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.test_string4 = [100 x i8] c"peanut butter and jelly\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = bitcast [100 x i8]* %1 to i8*
%6 = bitcast i8* %5 to [100 x i8]*
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i32 0, i32 0
store i8 98, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i32 0, i32 1
store i8 97, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i32 0, i32 2
store i8 99, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i32 0, i32 3
store i8 111, i8* %10
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i32 0, i32 4
store i8 110, i8* %11
%12 = bitcast [100 x i8]* %2 to i8*
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%19 = call i32 @strend(i8* %17, i8* %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = bitcast [100 x i8]* %3 to i8*
%22 = bitcast [100 x i8]* %4 to i8*
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%29 = call i32 @strend(i8* %27, i8* %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.test_string2 = [100 x i8] c"I love bacon\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [4 x i8] c"\0A%s\00"
@.str.1 = [4 x i8] c"\0A%d\00"
@__const.main.test_string3 = [100 x i8] c"peanut butter\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.test_string4 = [100 x i8] c"peanut butter and jelly\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 98, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
store i8 97, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 2
store i8 99, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 3
store i8 111, i8* %8
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 4
store i8 110, i8* %9
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10)
%13 = call i32 @strend(i8* %10, i8* %5)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %15)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
%19 = call i32 @strend(i8* %16, i8* %15)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}