#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 */
typedef int /*<<< orphan*/ copiedStr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, ...);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
int main() {
  char arr[] = "Hello!";
  char copiedStr[10];
  strcpy(copiedStr, arr);
  printf("The size and length of copiedStr are: %d , %d", sizeof(copiedStr),
         strlen(copiedStr));
  printf("character-> %c", copiedStr[6]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xebb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xeb5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xead(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x15(%rbp),%rdi
lea    -0xb(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x15(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
lea    0xe8c(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xea7(%rip),%rdi
movsbl -0xf(%rbp),%esi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movl   $0x216f6c,0xf(%rsp)
movl   $0x6c6c6548,0xc(%rsp)
6c
lea    0x16(%rsp),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xea1(%rip),%rdi
mov    $0xa,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
movsbl 0x1c(%rsp),%esi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr = [7 x i8] c"Hello!\00"
@.str = [46 x i8] c"The size and length of copiedStr are: %d , %d\00"
@.str.1 = [15 x i8] c"character-> %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca [10 x i8]
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%9 = call i32 @strlen(i8* %8)
%10 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8 signext 10, i32 %9)
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 6
%12 = load i8, i8* %11
%13 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8 signext %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [7 x i8] c"Hello!\00"
@.str = [46 x i8] c"The size and length of copiedStr are: %d , %d\00"
@.str.1 = [15 x i8] c"character-> %c\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %3)
%6 = call i32 @strlen(i8* %4)
%7 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8 signext 10, i32 %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 6
%9 = load i8, i8* %8
%10 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8 signext %9)
ret i32 0
}