#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(double *, int, double *, int, double *, int);
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  int i;
  double first[] = {-10.5, -1.8, 3.5, 6.3, 7.2};
  double second[] = {-1.8, 3.1, 6.3};
  double result[8];
  merge(result, 8, first, 5, second, 3);
  for (i = 0; i < 8; i++)
    printf("%.1f\n", result[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
movsd  0xec6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xeb1(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe9c(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe87(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe72(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0xe96(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe93(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe90(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    -0x90(%rbp),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%r8
mov    $0x8,%esi
mov    $0x5,%ecx
mov    $0x3,%r9d
call   1050 <merge@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1210 <main+0xe0>
movslq -0x8(%rbp),%rax
movsd  -0x90(%rbp,%rax,8),%xmm0
ff ff
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11df <main+0xaf>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x90,%rsp
movaps 0xed1(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xed5(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movabs $0x401ccccccccccccd,%rax
cc 1c 40
mov    %rax,0x80(%rsp)
mov    0xed7(%rip),%rax
mov    %rax,0x50(%rsp)
movaps 0xebb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rsp,%rdi
lea    0x60(%rsp),%rdx
lea    0x40(%rsp),%r8
mov    $0x8,%esi
mov    $0x5,%ecx
mov    $0x3,%r9d
call   1040 <merge@plt>
movsd  (%rsp),%xmm0
lea    0xea0(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x18(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x20(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x28(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x30(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movsd  0x38(%rsp),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
ret

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

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