#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 /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ strcpy(char *, char *);
main() {
  char source[] = "C program";
  char destination[50];
  strcpy(destination, source);
  printf("Source string: %s\n", source);
  printf("Destination string: %s\n", destination);
  sleep(120);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeba(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xeb7(%rip),%ax
mov    %ax,-0x6(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xe(%rbp),%rsi
lea    0xe9d(%rip),%rdi
call   1040 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
mov    $0x78,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x48,%rsp
movabs $0x6172676f72702043,%rax
67 72 61
mov    %rax,(%rsp)
movw   $0x6d,0x8(%rsp)
lea    0x10(%rsp),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
lea    0xea8(%rip),%rdi
mov    %r14,%rsi
call   1040 <printf@plt>
mov    $0x78,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.source = [10 x i8] c"C program\00"
@.str = [19 x i8] c"Source string: %s\0A\00"
@.str.1 = [24 x i8] c"Destination string: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [50 x i8]
store i32 0, i32* %1
%4 = bitcast [10 x i8]* %2 to i8*
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = call i32 @strcpy(i8* %5, i8* %6)
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%11 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = call i32 @sleep(i32 120)
ret i32 0
}

LLVM IR (-O2):
@__const.main.source = [10 x i8] c"C program\00"
@.str = [19 x i8] c"Source string: %s\0A\00"
@.str.1 = [24 x i8] c"Destination string: %s\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %3)
%6 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%8 = call i32 @sleep(i32 120)
ret i32 0
}