#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*/ merge(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int arr1[9] = {1, 3, 5, 7, 9};
  int arr2[4] = {2, 4, 6, 8};
  merge(arr1, 5, arr2, 4);
  for (int i = 0; i < 9; i++) {
    printf("%d ", arr1[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x24,%edx
call   1040 <memset@plt>
movl   $0x1,-0x30(%rbp)
movl   $0x3,-0x2c(%rbp)
movl   $0x5,-0x28(%rbp)
movl   $0x7,-0x24(%rbp)
movl   $0x9,-0x20(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe84(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rdx
mov    $0x5,%esi
mov    $0x4,%ecx
call   1050 <merge@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x9,-0x44(%rbp)
jge    11d4 <main+0xa4>
movslq -0x44(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11a6 <main+0x76>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x40,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x20(%rsp)
movaps 0xeb4(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x9,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    %rsp,%rdi
lea    0x30(%rsp),%rdx
mov    $0x5,%esi
mov    $0x4,%ecx
call   1050 <merge@plt>
mov    (%rsp),%esi
lea    0xe9b(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.arr2 = [4 x i32] [i32 2, i32 4, i32 6, i32 8]
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i32]
%3 = alloca [4 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [9 x i32]* %2 to i8*
%6 = bitcast i8* %5 to [9 x i32]*
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i32 0, i32 0
store i32 1, i32* %7
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i32 0, i32 1
store i32 3, i32* %8
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i32 0, i32 2
store i32 5, i32* %9
%10 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i32 0, i32 3
store i32 7, i32* %10
%11 = getelementptr inbounds [9 x i32], [9 x i32]* %6, i32 0, i32 4
store i32 9, i32* %11
%12 = bitcast [4 x i32]* %3 to i8*
%13 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 0
%14 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%15 = call i32 @merge(i32* %13, i32 5, i32* %14, i32 4)
store i32 0, i32* %4
br label %16
16: ; preds = %25, %0
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 9
br i1 %18, label %19, label %28
19: ; preds = %16
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [9 x i32], [9 x i32]* %2, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %19
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %16
28: ; preds = %16
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr2 = [4 x i32] [i32 2, i32 4, i32 6, i32 8]
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [9 x i32]* %1 to i8*
%4 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 4
%5 = bitcast i32* %4 to i8*
%6 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%7 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 1
%8 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 2
%9 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 3
%10 = bitcast [9 x i32]* %1 to <4 x i32>*
store <4 x i32> <i32 1, i32 3, i32 5, i32 7>, <4 x i32>* %10
%11 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 4
store i32 9, i32* %11
%12 = bitcast [4 x i32]* %2 to i8*
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%14 = call i32 @merge(i32* %6, i32 5, i32* %13, i32 4)
%15 = load i32, i32* %6
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %7
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %8
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %9
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = load i32, i32* %11
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 5
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
%28 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 6
%29 = load i32, i32* %28
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %29)
%31 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 7
%32 = load i32, i32* %31
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 8
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = call i32 @putchar(i32 10)
ret i32 0
}