#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*/ puts(char *);
void main() {
  char a[] = "abcedf", b[] = "fk";
  char *p, *q;
  p = a;
  for (q = b; *q; p++, q++) {
    *p = *q;
  }
  puts(a);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee2(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xedc(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xed4(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xecb(%rip),%ax
mov    %ax,-0xa(%rbp)
mov    0xec3(%rip),%al
mov    %al,-0x8(%rbp)
lea    -0x7(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xa(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     118f <main+0x7f>
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1159 <main+0x49>
lea    -0x7(%rbp),%rdi
call   1030 <puts@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x666465,0x13(%rsp)
movl   $0x65636261,0x10(%rsp)
65
movb   $0x0,0xe(%rsp)
movw   $0x6b66,0xc(%rsp)
mov    $0x66,%cl
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %cl,0x10(%rsp,%rax,1)
movzbl 0xd(%rsp,%rax,1),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1140 <main+0x30>
lea    0x10(%rsp),%rdi
call   1030 <puts@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [7 x i8] c"abcedf\00"
@__const.main.b = [3 x i8] c"fk\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = alloca [3 x i8]
%3 = alloca i8*
%4 = alloca i8*
%5 = bitcast [7 x i8]* %1 to i8*
%6 = bitcast [3 x i8]* %2 to i8*
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
store i8* %7, i8** %3
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
store i8* %8, i8** %4
br label %9
9: ; preds = %17, %0
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = load i8*, i8** %3
store i8 %15, i8* %16
br label %17
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %3
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
br label %9
22: ; preds = %9
%23 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%24 = call i32 @puts(i8* %23)
ret void
}

LLVM IR (-O2):
@__const.main.a = [7 x i8] c"abcedf\00"
@__const.main.b = [3 x i8] c"fk\00"
define void @main() {
%1 = alloca [7 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
br label %5
5: ; preds = %0, %5
%6 = phi i8 [ %11, %5 ], [ 102, %0 ]
%7 = phi i8* [ %10, %5 ], [ %4, %0 ]
%8 = phi i8* [ %9, %5 ], [ %3, %0 ]
store i8 %6, i8* %8
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = call i32 @puts(i8* %3)
ret void
}