#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 */
double findMedianSortedArrays(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int a[3] = {1, 2, 3};
  int b[6] = {1, 2, 3, 4, 5, 6};
  printf("%f\n", findMedianSortedArrays(a, 0, b, 0));
  printf("%f\n", findMedianSortedArrays(a, 0, b, 4));
  printf("%f\n", findMedianSortedArrays(a, 3, b, 6));
  printf("%f\n", findMedianSortedArrays(a, 3, b, 0));
  int c[] = {1, 3};
  int d[] = {2};
  printf("%f\n", findMedianSortedArrays(c, 2, d, 1));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xecf(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x30(%rbp),%rdx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1040 <findMedianSortedArrays@plt>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    -0x30(%rbp),%rdx
xor    %esi,%esi
mov    $0x4,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x3,%esi
mov    $0x6,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc(%rbp),%rdi
lea    -0x30(%rbp),%rdx
mov    $0x3,%esi
xor    %ecx,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xe50(%rip),%rdi
call   1030 <printf@plt>
mov    0xe48(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    0xe46(%rip),%eax
mov    %eax,-0x3c(%rbp)
lea    -0x38(%rbp),%rdi
lea    -0x3c(%rbp),%rdx
mov    $0x2,%esi
mov    $0x1,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    0xed9(%rip),%eax
mov    %eax,0x18(%rsp)
mov    0xec6(%rip),%rax
mov    %rax,0x10(%rsp)
mov    0xeda(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xebe(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x10(%rsp),%rbx
lea    0x20(%rsp),%r15
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
xor    %ecx,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xeb1(%rip),%r14
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %r15,%rdx
mov    $0x4,%ecx
call   1040 <findMedianSortedArrays@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r15,%rdx
mov    $0x6,%ecx
call   1040 <findMedianSortedArrays@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %r15,%rdx
xor    %ecx,%ecx
call   1040 <findMedianSortedArrays@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
movabs $0x300000001,%rax
mov    %rax,0x8(%rsp)
movl   $0x2,0x4(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rdx
mov    $0x2,%esi
mov    $0x1,%ecx
call   1040 <findMedianSortedArrays@plt>
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.b = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@.str = [4 x i8] c"%f\0A\00"
@__const.main.c = [2 x i32] [i32 1, i32 3]
@__const.main.d = [1 x i32] [i32 2]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [6 x i32]
%3 = alloca [2 x i32]
%4 = alloca [1 x i32]
%5 = bitcast [3 x i32]* %1 to i8*
%6 = bitcast [6 x i32]* %2 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%9 = call double @findMedianSortedArrays(i32* %7, i32 0, i32* %8, i32 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%13 = call double @findMedianSortedArrays(i32* %11, i32 0, i32* %12, i32 4)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %13)
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%16 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%17 = call double @findMedianSortedArrays(i32* %15, i32 3, i32* %16, i32 6)
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %17)
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%21 = call double @findMedianSortedArrays(i32* %19, i32 3, i32* %20, i32 0)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %21)
%23 = bitcast [2 x i32]* %3 to i8*
%24 = bitcast [1 x i32]* %4 to i8*
%25 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%26 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
%27 = call double @findMedianSortedArrays(i32* %25, i32 2, i32* %26, i32 1)
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %27)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.b = [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [6 x i32]
%3 = alloca i64
%4 = alloca [1 x i32]
%5 = bitcast [3 x i32]* %1 to i8*
%6 = bitcast [6 x i32]* %2 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%9 = call double @findMedianSortedArrays(i32* %7, i32 0, i32* %8, i32 0)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %9)
%11 = call double @findMedianSortedArrays(i32* %7, i32 0, i32* %8, i32 4)
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %11)
%13 = call double @findMedianSortedArrays(i32* %7, i32 3, i32* %8, i32 6)
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %13)
%15 = call double @findMedianSortedArrays(i32* %7, i32 3, i32* %8, i32 0)
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %15)
%17 = bitcast i64* %3 to i8*
store i64 12884901889, i64* %3
%18 = bitcast [1 x i32]* %4 to i8*
%19 = getelementptr inbounds [1 x i32], [1 x i32]* %4, i64 0, i64 0
store i32 2, i32* %19
%20 = bitcast i64* %3 to i32*
%21 = call double @findMedianSortedArrays(i32* %20, i32 2, i32* %19, i32 1)
%22 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %21)
ret i32 0
}