#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 main() {
  char a[] = "I am a boy.i fear about my future.", b[50];
  char *p1, *p2;
  p1 = a;
  p2 = b;
  int i;
  for (; *p1 != '\0'; p1++, p2++) {
    *p2 = *p1;
  }
  *p2 = '\0';
  printf("string a is :%s\n", a);
  printf("string b is :");
  for (i = 0; b[i] != '\0'; i++)
    printf("%c", b[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec3(%rip),%rsi
mov    $0x23,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rax
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x78(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1190 <main+0x70>
mov    -0x78(%rbp),%rax
mov    (%rax),%cl
mov    -0x80(%rbp),%rax
mov    %cl,(%rax)
mov    -0x78(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x78(%rbp)
mov    -0x80(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x80(%rbp)
jmp    1157 <main+0x37>
mov    -0x80(%rbp),%rax
movb   $0x0,(%rax)
lea    -0x30(%rbp),%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x84(%rbp)
movslq -0x84(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1204 <main+0xe4>
movslq -0x84(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    11c1 <main+0xa1>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x68,%rsp
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x2e6572,0x1f(%rsp)
mov    $0x49,%cl
xor    %eax,%eax
nopl   0x0(%rax)
mov    %cl,0x30(%rsp,%rax,1)
movzbl 0x1(%rsp,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1150 <main+0x30>
mov    0x30(%rsp),%bpl
movb   $0x0,0x30(%rsp,%rax,1)
lea    0xeb1(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %bpl,%bpl
je     11b5 <main+0x95>
lea    0x31(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %bpl,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%ebp
add    $0x1,%rbx
test   %bpl,%bpl
jne    11a0 <main+0x80>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.a = [35 x i8] c"I am a boy.i fear about my future.\00"
@.str = [17 x i8] c"string a is :%s\0A\00"
@.str.1 = [14 x i8] c"string b is :\00"
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [35 x i8]
%3 = alloca [50 x i8]
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i32 0, i32* %1
%7 = bitcast [35 x i8]* %2 to i8*
%8 = getelementptr inbounds [35 x i8], [35 x i8]* %2, i64 0, i64 0
store i8* %8, i8** %4
%9 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
store i8* %9, i8** %5
br label %10
10: ; preds = %19, %0
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = load i8*, i8** %5
store i8 %17, i8* %18
br label %19
19: ; preds = %15
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
br label %10
24: ; preds = %10
%25 = load i8*, i8** %5
store i8 0, i8* %25
%26 = getelementptr inbounds [35 x i8], [35 x i8]* %2, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %29
29: ; preds = %43, %24
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %46
36: ; preds = %29
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %41)
br label %43
43: ; preds = %36
%44 = load i32, i32* %6
%45 = add nsw i32 %44, 1
store i32 %45, i32* %6
br label %29
46: ; preds = %29
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [35 x i8] c"I am a boy.i fear about my future.\00"
@.str = [17 x i8] c"string a is :%s\0A\00"
@.str.1 = [14 x i8] c"string b is :\00"
define i32 @main() {
%1 = alloca [35 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [35 x i8], [35 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %0, %5
%6 = phi i8 [ %11, %5 ], [ 73, %0 ]
%7 = phi i8* [ %10, %5 ], [ %4, %0 ]
%8 = phi i8* [ %9, %5 ], [ %3, %0 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = load i8, i8* %4
store i8 0, i8* %10
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp eq i8 %14, 0
br i1 %17, label %27, label %18
18: ; preds = %13, %18
%19 = phi i64 [ %23, %18 ], [ 0, %13 ]
%20 = phi i8 [ %25, %18 ], [ %14, %13 ]
%21 = sext i8 %20 to i32
%22 = call i32 @putchar(i32 %21)
%23 = add nuw i64 %19, 1
%24 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
br i1 %26, label %27, label %18
27: ; preds = %18, %13
%28 = call i32 @putchar(i32 10)
ret i32 0
}