#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 /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void copy() {
  char str1[10], str2[20];
  printf("Enter the I string : ");
  scanf("%s", str1);
  printf("Enter the II string : ");
  scanf("%s", str2);
  strcpy(str2, str1);
  printf("I string is :%s\t\t II string is :%s\n", str1, str2);
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1050 <scanf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xea7(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
lea    -0xa(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xa(%rbp),%rsi
lea    -0x20(%rbp),%rdx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xec0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%r14
lea    0x6(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
lea    0xeb4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
lea    0xea2(%rip),%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter the I string : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [23 x i8] c"Enter the II string : \00"
@.str.3 = [36 x i8] c"I string is :%s\09\09 II string is :%s\0A\00"
define void @copy() {
%1 = alloca [10 x i8]
%2 = alloca [20 x i8]
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %12, i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter the I string : \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [23 x i8] c"Enter the II string : \00"
@.str.3 = [36 x i8] c"I string is :%s\09\09 II string is :%s\0A\00"
define void @copy() {
%1 = alloca [10 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 @strcpy(i8* %4, i8* %3)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i8* %3, i8* %4)
ret void
}