int main() {
  char array_max[1024] = "abc";
  char array_min[100] = "def";
  char *p_max = array_max;
  char *p_min = array_min;
  while ('\0' != *p_max) {
    p_max++;
  }
  while ('\0' != *p_min) {
    *p_max = *p_min;
    p_max++;
    p_min++;
  }
  *p_max = '\0';
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1030 <memset@plt>
movb   $0x61,-0x410(%rbp)
movb   $0x62,-0x40f(%rbp)
movb   $0x63,-0x40e(%rbp)
lea    -0x480(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1030 <memset@plt>
movb   $0x64,-0x480(%rbp)
movb   $0x65,-0x47f(%rbp)
movb   $0x66,-0x47e(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x488(%rbp)
lea    -0x480(%rbp),%rax
mov    %rax,-0x490(%rbp)
mov    -0x488(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     11b9 <main+0xa9>
mov    -0x488(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x488(%rbp)
jmp    118e <main+0x7e>
jmp    11be <main+0xae>
mov    -0x490(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     120d <main+0xfd>
mov    -0x490(%rbp),%rax
mov    (%rax),%cl
mov    -0x488(%rbp),%rax
mov    %cl,(%rax)
mov    -0x488(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x488(%rbp)
mov    -0x490(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x490(%rbp)
jmp    11be <main+0xae>
mov    -0x488(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x490,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x470,%rsp
lea    0x70(%rsp),%rbx
mov    $0x400,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
movw   $0x6261,0x70(%rsp)
movb   $0x63,0x72(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movw   $0x6564,(%rsp)
movb   $0x66,0x2(%rsp)
nopl   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rbx)
lea    0x1(%rbx),%rbx
jne    1170 <main+0x60>
lea    0x1(%rsp),%rax
mov    $0x64,%cl
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rbx)
add    $0x1,%rbx
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1190 <main+0x80>
movb   $0x0,(%rbx)
xor    %eax,%eax
add    $0x470,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca [100 x i8]
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
%6 = bitcast [1024 x i8]* %2 to i8*
%7 = bitcast i8* %6 to [1024 x i8]*
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i32 0, i32 0
store i8 97, i8* %8
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i32 0, i32 1
store i8 98, i8* %9
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i32 0, i32 2
store i8 99, i8* %10
%11 = bitcast [100 x i8]* %3 to i8*
%12 = bitcast i8* %11 to [100 x i8]*
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i32 0, i32 0
store i8 100, i8* %13
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i32 0, i32 1
store i8 101, i8* %14
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i32 0, i32 2
store i8 102, i8* %15
%16 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
store i8* %16, i8** %4
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8* %17, i8** %5
br label %18
18: ; preds = %23, %0
%19 = load i8*, i8** %4
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp ne i32 0, %21
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
br label %18
26: ; preds = %18
br label %27
27: ; preds = %32, %26
%28 = load i8*, i8** %5
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = icmp ne i32 0, %30
br i1 %31, label %32, label %40
32: ; preds = %27
%33 = load i8*, i8** %5
%34 = load i8, i8* %33
%35 = load i8*, i8** %4
store i8 %34, i8* %35
%36 = load i8*, i8** %4
%37 = getelementptr inbounds i8, i8* %36, i32 1
store i8* %37, i8** %4
%38 = load i8*, i8** %5
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %5
br label %27
40: ; preds = %27
%41 = load i8*, i8** %4
store i8 0, i8* %41
%42 = load i32, i32* %1
ret i32 %42
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 1
store i8 98, i8* %4
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 2
store i8 99, i8* %5
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 100, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
store i8 101, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 2
store i8 102, i8* %8
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 1
br label %10
10: ; preds = %0, %10
%11 = phi i8* [ %9, %0 ], [ %14, %10 ]
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
%14 = getelementptr inbounds i8, i8* %11, i64 1
br i1 %13, label %15, label %10
15: ; preds = %10, %15
%16 = phi i8 [ %21, %15 ], [ 100, %10 ]
%17 = phi i8* [ %20, %15 ], [ %6, %10 ]
%18 = phi i8* [ %19, %15 ], [ %11, %10 ]
store i8 %16, i8* %18
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = getelementptr inbounds i8, i8* %17, i64 1
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 0
br i1 %22, label %23, label %15
23: ; preds = %15
store i8 0, i8* %19
ret i32 0
}