#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*/ concat(char *, char *);
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ system(char *);
void main() {
  char a[255] = "Hello";
  char b[255] = "World";
  int i = 0;
  concat(a, b);
  while (a[i] != '\0')
    printf("%c", a[i++]);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x210,%rsp
lea    -0x100(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1060 <memset@plt>
movb   $0x48,-0x100(%rbp)
movb   $0x65,-0xff(%rbp)
movb   $0x6c,-0xfe(%rbp)
movb   $0x6c,-0xfd(%rbp)
movb   $0x6f,-0xfc(%rbp)
lea    -0x200(%rbp),%rdi
xor    %esi,%esi
mov    $0xff,%edx
call   1060 <memset@plt>
movb   $0x57,-0x200(%rbp)
movb   $0x6f,-0x1ff(%rbp)
movb   $0x72,-0x1fe(%rbp)
movb   $0x6c,-0x1fd(%rbp)
movb   $0x64,-0x1fc(%rbp)
movl   $0x0,-0x204(%rbp)
lea    -0x100(%rbp),%rdi
lea    -0x200(%rbp),%rsi
call   1050 <concat@plt>
movslq -0x204(%rbp),%rax
movsbl -0x100(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1218 <main+0xd8>
mov    -0x204(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x204(%rbp)
cltq
lea    0xdfa(%rip),%rdi
movsbl -0x100(%rbp,%rax,1),%esi
ff
call   1040 <printf@plt>
jmp    11d4 <main+0x94>
lea    0xde4(%rip),%rdi
call   1030 <system@plt>
add    $0x210,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x208,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movups %xmm0,0xef(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x6c6c6548,(%rsp)
movb   $0x6f,0x4(%rsp)
movaps %xmm0,0x100(%rsp)
movups %xmm0,0x1ef(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movl   $0x6c726f57,0x100(%rsp)
57 6f 72 6c
movb   $0x64,0x104(%rsp)
64
mov    %rsp,%rdi
lea    0x100(%rsp),%rsi
call   1050 <concat@plt>
mov    (%rsp),%al
test   %al,%al
je     1286 <main+0x156>
lea    0x1(%rsp),%rbx
lea    0xd9a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1270 <main+0x140>
lea    0xd76(%rip),%rdi
call   1030 <system@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [6 x i8] c"pause\00"
define void @main() {
%1 = alloca [255 x i8]
%2 = alloca [255 x i8]
%3 = alloca i32
%4 = bitcast [255 x i8]* %1 to i8*
%5 = bitcast i8* %4 to [255 x i8]*
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i32 0, i32 0
store i8 72, i8* %6
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i32 0, i32 1
store i8 101, i8* %7
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i32 0, i32 2
store i8 108, i8* %8
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i32 0, i32 3
store i8 108, i8* %9
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %5, i32 0, i32 4
store i8 111, i8* %10
%11 = bitcast [255 x i8]* %2 to i8*
%12 = bitcast i8* %11 to [255 x i8]*
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i32 0, i32 0
store i8 87, i8* %13
%14 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i32 0, i32 1
store i8 111, i8* %14
%15 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i32 0, i32 2
store i8 114, i8* %15
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i32 0, i32 3
store i8 108, i8* %16
%17 = getelementptr inbounds [255 x i8], [255 x i8]* %12, i32 0, i32 4
store i8 100, i8* %17
store i32 0, i32* %3
%18 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%19 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
%20 = call i32 @concat(i8* %18, i8* %19)
br label %21
21: ; preds = %28, %0
%22 = load i32, i32* %3
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = icmp ne i32 %26, 0
br i1 %27, label %28, label %35
28: ; preds = %21
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %33)
br label %21
35: ; preds = %21
%36 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
@.str.1 = [6 x i8] c"pause\00"
define void @main() {
%1 = alloca [255 x i8]
%2 = alloca [255 x i8]
%3 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
store i8 72, i8* %3
%4 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 1
store i8 101, i8* %4
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 2
store i8 108, i8* %5
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 3
store i8 108, i8* %6
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 4
store i8 111, i8* %7
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 0
store i8 87, i8* %8
%9 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 1
store i8 111, i8* %9
%10 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 2
store i8 114, i8* %10
%11 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 3
store i8 108, i8* %11
%12 = getelementptr inbounds [255 x i8], [255 x i8]* %2, i64 0, i64 4
store i8 100, i8* %12
%13 = call i32 @concat(i8* %3, i8* %8)
%14 = load i8, i8* %3
%15 = icmp eq i8 %14, 0
br i1 %15, label %24, label %16
16: ; preds = %0, %16
%17 = phi i64 [ %19, %16 ], [ 0, %0 ]
%18 = phi i8 [ %22, %16 ], [ %14, %0 ]
%19 = add nuw i64 %17, 1
%20 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %18)
%21 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 %19
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %16
24: ; preds = %16, %0
%25 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret void
}