#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*/ copy_string(char *, char *);
int /*<<< orphan*/ printf(char *, char *, char *);
void main() {
  char a[] = "I am a teacher.";
  char b[] = "you are a student.";
  printf("string a=%s\nstring b= %s\n", a, b);
  copy_string(a, b);
  printf("\nstring a=%s\nstring b= %s\n", a, b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x20(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x1e(%rbp)
lea    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <copy_string@plt>
lea    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movaps 0xed2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x2e746e,0xf(%rsp)
lea    0xed7(%rip),%rdi
lea    0x20(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <copy_string@plt>
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.a = [16 x i8] c"I am a teacher.\00"
@__const.main.b = [19 x i8] c"you are a student.\00"
@.str = [26 x i8] c"string a=%s\0Astring b= %s\0A\00"
@.str.1 = [27 x i8] c"\0Astring a=%s\0Astring b= %s\0A\00"
define void @main() {
%1 = alloca [16 x i8]
%2 = alloca [19 x i8]
%3 = bitcast [16 x i8]* %1 to i8*
%4 = bitcast [19 x i8]* %2 to i8*
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%7 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%10 = call i32 @copy_string(i8* %8, i8* %9)
%11 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %12)
ret void
}

LLVM IR (-O2):
@__const.main.a = [16 x i8] c"I am a teacher.\00"
@__const.main.b = [19 x i8] c"you are a student.\00"
@.str = [26 x i8] c"string a=%s\0Astring b= %s\0A\00"
@.str.1 = [27 x i8] c"\0Astring a=%s\0Astring b= %s\0A\00"
define void @main() {
%1 = alloca [16 x i8]
%2 = alloca [19 x i8]
%3 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @copy_string(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
ret void
}