#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 *, ...);
int main() {
  char A[5] = "hello";
  char B[5] = "world";
  int C[10];
  int i = 0, j = 0, temp = 0;
  for (j = 0; j < 5; j++) {
    C[j] = A[j];
  }
  for (j = 5; j < 10; j++) {
    C[j] = B[j - 5];
  }
  for (i = 0; i < 10; i++)
    printf("%c", C[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xec9(%rip),%al
mov    %al,-0xa(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x48(%rbp)
cmpl   $0x5,-0x48(%rbp)
jge    1188 <main+0x78>
movslq -0x48(%rbp),%rax
movsbl -0x9(%rbp,%rax,1),%ecx
movslq -0x48(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    115f <main+0x4f>
movl   $0x5,-0x48(%rbp)
cmpl   $0xa,-0x48(%rbp)
jge    11bc <main+0xac>
mov    -0x48(%rbp),%eax
sub    $0x5,%eax
cltq
movsbl -0xe(%rbp,%rax,1),%ecx
movslq -0x48(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    118f <main+0x7f>
movl   $0x0,-0x44(%rbp)
cmpl   $0xa,-0x44(%rbp)
jge    11f1 <main+0xe1>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%esi
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11c3 <main+0xb3>
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x68,%edi
call   1030 <putchar@plt>
mov    $0x65,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x77,%edi
call   1030 <putchar@plt>
mov    $0x6f,%edi
call   1030 <putchar@plt>
mov    $0x72,%edi
call   1030 <putchar@plt>
mov    $0x6c,%edi
call   1030 <putchar@plt>
mov    $0x64,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.A = [5 x i8] c"hello"
@__const.main.B = [5 x i8] c"world"
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = alloca [10 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [5 x i8]* %2 to i8*
%9 = bitcast [5 x i8]* %3 to i8*
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %6
br label %10
10: ; preds = %22, %0
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = load i32, i32* %6
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %20
store i32 %18, i32* %21
br label %22
22: ; preds = %13
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %10
25: ; preds = %10
store i32 5, i32* %6
br label %26
26: ; preds = %39, %25
%27 = load i32, i32* %6
%28 = icmp slt i32 %27, 10
br i1 %28, label %29, label %42
29: ; preds = %26
%30 = load i32, i32* %6
%31 = sub nsw i32 %30, 5
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %37
store i32 %35, i32* %38
br label %39
39: ; preds = %29
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %26
42: ; preds = %26
store i32 0, i32* %5
br label %43
43: ; preds = %52, %42
%44 = load i32, i32* %5
%45 = icmp slt i32 %44, 10
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load i32, i32* %5
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %46
%53 = load i32, i32* %5
%54 = add nsw i32 %53, 1
store i32 %54, i32* %5
br label %43
55: ; preds = %43
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%57 = load i32, i32* %1
ret i32 %57
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 104)
%2 = tail call i32 @putchar(i32 101)
%3 = tail call i32 @putchar(i32 108)
%4 = tail call i32 @putchar(i32 108)
%5 = tail call i32 @putchar(i32 111)
%6 = tail call i32 @putchar(i32 119)
%7 = tail call i32 @putchar(i32 111)
%8 = tail call i32 @putchar(i32 114)
%9 = tail call i32 @putchar(i32 108)
%10 = tail call i32 @putchar(i32 100)
%11 = tail call i32 @putchar(i32 10)
ret i32 0
}