#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 *);
int strlen(char *);
int main(void) {
  int i, j;
  char str1[80] = "XXXXXXXX XXXXXXXXXXXXXXXXX";
  char str2[80] = "This is a testing program.";
  printf("%s \n", str1);
  for (i = 0, j = strlen(str2); i <= j; i++, j--) {
    str1[i] = str2[i];
    str1[j] = str2[j];
    printf("%s \n", str1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xeb3(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xf26(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
lea    -0xb0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11ee <main+0xbe>
movslq -0x8(%rbp),%rax
mov    -0xb0(%rbp,%rax,1),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
movslq -0xc(%rbp),%rax
mov    -0xb0(%rbp,%rax,1),%cl
movslq -0xc(%rbp),%rax
mov    %cl,-0x60(%rbp,%rax,1)
lea    -0x60(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1195 <main+0x65>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xa8,%rsp
movaps 0xf0b(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xeef(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,(%rsp)
movaps 0xf20(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xf01(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
lea    0xeee(%rip),%rdi
mov    %rsp,%rsi
call   1040 <printf@plt>
lea    0x50(%rsp),%rdi
call   1030 <strlen@plt>
test   %eax,%eax
js     1210 <main+0xf0>
mov    %eax,%r12d
add    $0xffffffffffffffff,%r12
mov    $0xffffffffffffffff,%rbx
lea    0xec3(%rip),%r14
mov    %rsp,%r15
movzbl 0x51(%rsp,%rbx,1),%eax
mov    %al,0x1(%rsp,%rbx,1)
movzbl 0x51(%rsp,%r12,1),%eax
mov    %al,0x1(%rsp,%r12,1)
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <printf@plt>
add    $0x1,%rbx
lea    -0x1(%r12),%rax
cmp    %r12,%rbx
mov    %rax,%r12
jl     11e0 <main+0xc0>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.str1 = [80 x i8] c"XXXXXXXX XXXXXXXXXXXXXXXXX\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\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.str2 = [80 x i8] c"This is a testing program.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\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 = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [80 x i8]
%5 = alloca [80 x i8]
store i32 0, i32* %1
%6 = bitcast [80 x i8]* %4 to i8*
%7 = bitcast [80 x i8]* %5 to i8*
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 0, i32* %2
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %3
br label %12
12: ; preds = %33, %0
%13 = load i32, i32* %2
%14 = load i32, i32* %3
%15 = icmp sle i32 %13, %14
br i1 %15, label %16, label %38
16: ; preds = %12
%17 = load i32, i32* %2
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = load i32, i32* %2
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %22
store i8 %20, i8* %23
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 %29
store i8 %27, i8* %30
%31 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %31)
br label %33
33: ; preds = %16
%34 = load i32, i32* %2
%35 = add nsw i32 %34, 1
store i32 %35, i32* %2
%36 = load i32, i32* %3
%37 = add nsw i32 %36, -1
store i32 %37, i32* %3
br label %12
38: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@__const.main.str1 = [80 x i8] c"XXXXXXXX XXXXXXXXXXXXXXXXX\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\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.str2 = [80 x i8] c"This is a testing program.\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\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 = [5 x i8] c"%s \0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%6 = call i32 @strlen(i8* %4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %23, label %8
8: ; preds = %0
%9 = zext i32 %6 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %20, %10 ]
%12 = phi i64 [ %9, %8 ], [ %21, %10 ]
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %11
%14 = load i8, i8* %13
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %11
store i8 %14, i8* %15
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 %12
%17 = load i8, i8* %16
%18 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 %12
store i8 %17, i8* %18
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3)
%20 = add nuw nsw i64 %11, 1
%21 = add nsw i64 %12, -1
%22 = icmp slt i64 %11, %21
br i1 %22, label %10, label %23
23: ; preds = %10, %0
ret i32 0
}