#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*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *, char *, char *);
int /*<<< orphan*/ puts(char *);
int main() {
  char t[10];
  memset(t, 'x', 10);
  t[10 - 1] = '\0';
  char s[10];
  memset(s, 'y', 10);
  s[10 - 1] = '\0';
  char *ss = s;
  char *tt = t;
  printf("%p %p", s, ss);
  puts("");
  printf("%s\n%s\n", t, s);
  puts("");
  while ((*ss++ = *tt++))
    ;
  printf("%s\n%s\n", t, s);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rdi
mov    $0x78,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
movb   $0x0,-0x5(%rbp)
lea    -0x18(%rbp),%rdi
mov    $0x79,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
movb   $0x0,-0xf(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0xe(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
lea    0xe74(%rip),%rdi
call   1030 <puts@plt>
lea    -0xe(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe54(%rip),%rdi
call   1030 <puts@plt>
mov    -0x28(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x28(%rbp)
mov    (%rax),%al
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     11ec <main+0xbc>
jmp    11bd <main+0x8d>
lea    -0xe(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    0xe0b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xe(%rsp),%r14
mov    %r14,%rdi
mov    $0x78,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
movb   $0x0,0x17(%rsp)
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x79,%esi
mov    $0xa,%edx
call   1050 <memset@plt>
movb   $0x0,0xd(%rsp)
lea    0xe8a(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe74(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
nopl   0x0(%rax)
movzbl 0xe(%rsp,%rax,1),%ecx
mov    %cl,0x4(%rsp,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    11b0 <main+0x80>
lea    0xe3e(%rip),%rdi
lea    0xe(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%p %p\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [7 x i8] c"%s\0A%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i8 signext 120, i32 10)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 9
store i8 0, i8* %8
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%10 = call i32 @memset(i8* %9, i8 signext 121, i32 10)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 9
store i8 0, i8* %11
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
store i8* %12, i8** %4
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
store i8* %13, i8** %5
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%15 = load i8*, i8** %4
%16 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15)
%17 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %18, i8* %19)
%21 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %29, %0
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %5
%25 = load i8, i8* %23
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %4
store i8 %25, i8* %26
%28 = icmp ne i8 %25, 0
br i1 %28, label %29, label %30
29: ; preds = %22
br label %22
30: ; preds = %22
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%32 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%33 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %31, i8* %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%p %p\00"
@.str.2 = [7 x i8] c"%s\0A%s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i8 signext 120, i32 10)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 9
store i8 0, i8* %5
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @memset(i8* %6, i8 signext 121, i32 10)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 9
store i8 0, i8* %8
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %6)
%10 = call i32 @putchar(i32 10)
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %6)
%12 = call i32 @putchar(i32 10)
br label %13
13: ; preds = %13, %0
%14 = phi i8* [ %6, %0 ], [ %18, %13 ]
%15 = phi i8* [ %3, %0 ], [ %16, %13 ]
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %15
%18 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %17, i8* %14
%19 = icmp eq i8 %17, 0
br i1 %19, label %20, label %13
20: ; preds = %13
%21 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %6)
ret i32 0
}