#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 */
typedef int /*<<< orphan*/ a2;
typedef int /*<<< orphan*/ a1;

/* Variables and functions */
double findMedianSortedArrays(int *, int, int *, int);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char *argv[]) {
  int a1[] = {1, 2, 6};
  int a2[] = {3, 4, 5};
  printf("Result: %.3f",
         findMedianSortedArrays(a1, sizeof(a1) / sizeof(a1[0]), a2,
                                sizeof(a2) / sizeof(a2[0])));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x1c(%rbp)
mov    0xec1(%rip),%eax
mov    %eax,-0x14(%rbp)
mov    0xebb(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xeb9(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x1c(%rbp),%rdi
lea    -0x28(%rbp),%rdx
mov    $0x3,%ecx
mov    %ecx,%esi
call   1040 <findMedianSortedArrays@plt>
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0xed4(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xec1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x18(%rsp),%rdi
lea    0x8(%rsp),%rdx
mov    $0x3,%esi
mov    $0x3,%ecx
call   1040 <findMedianSortedArrays@plt>
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.a1 = [3 x i32] [i32 1, i32 2, i32 6]
@__const.main.a2 = [3 x i32] [i32 3, i32 4, i32 5]
@.str = [13 x i8] c"Result: %.3f\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [3 x i32]
%7 = alloca [3 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [3 x i32]* %6 to i8*
%9 = bitcast [3 x i32]* %7 to i8*
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
%11 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 0, i64 0
%12 = call double @findMedianSortedArrays(i32* %10, i32 3, i32* %11, i32 3)
%13 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %12)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a1 = [3 x i32] [i32 1, i32 2, i32 6]
@__const.main.a2 = [3 x i32] [i32 3, i32 4, i32 5]
@.str = [13 x i8] c"Result: %.3f\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = bitcast [3 x i32]* %3 to i8*
%6 = bitcast [3 x i32]* %4 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%9 = call double @findMedianSortedArrays(i32* %7, i32 3, i32* %8, i32 3)
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}