#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*/ row_stride_add_1x2(double const *, int, double *, int);
void row_stride_add_2x2(const double *a, int a_row_stride, double *b,
                        int b_row_stride) {
  row_stride_add_1x2(&a[(0) * a_row_stride + 0], a_row_stride,
                     &b[(0) * b_row_stride + 0], b_row_stride);
  row_stride_add_1x2(&a[(1) * a_row_stride + 0], a_row_stride,
                     &b[(1) * b_row_stride + 0], b_row_stride);
}


x86 assembly (clang, -O0):
<row_stride_add_2x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
imul   $0x0,-0xc(%rbp),%eax
add    $0x0,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
imul   $0x0,-0x1c(%rbp),%eax
add    $0x0,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <row_stride_add_1x2@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
shl    $0x0,%eax
add    $0x0,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%eax
shl    $0x0,%eax
add    $0x0,%eax
cltq
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <row_stride_add_1x2@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<row_stride_add_2x2>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <row_stride_add_1x2@plt>
movslq %ebp,%rsi
lea    (%rbx,%rsi,8),%rdi
movslq %r15d,%rcx
lea    (%r14,%rcx,8),%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <row_stride_add_1x2@plt>

LLVM IR (-O0):
define void @row_stride_add_2x2(double* %0, i32 %1, double* %2, i32 %3) {
%5 = alloca double*
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
store double* %0, double** %5
store i32 %1, i32* %6
store double* %2, double** %7
store i32 %3, i32* %8
%9 = load double*, double** %5
%10 = load i32, i32* %6
%11 = mul nsw i32 0, %10
%12 = add nsw i32 %11, 0
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds double, double* %9, i64 %13
%15 = load i32, i32* %6
%16 = load double*, double** %7
%17 = load i32, i32* %8
%18 = mul nsw i32 0, %17
%19 = add nsw i32 %18, 0
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds double, double* %16, i64 %20
%22 = load i32, i32* %8
%23 = call i32 @row_stride_add_1x2(double* %14, i32 %15, double* %21, i32 %22)
%24 = load double*, double** %5
%25 = load i32, i32* %6
%26 = mul nsw i32 1, %25
%27 = add nsw i32 %26, 0
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds double, double* %24, i64 %28
%30 = load i32, i32* %6
%31 = load double*, double** %7
%32 = load i32, i32* %8
%33 = mul nsw i32 1, %32
%34 = add nsw i32 %33, 0
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds double, double* %31, i64 %35
%37 = load i32, i32* %8
%38 = call i32 @row_stride_add_1x2(double* %29, i32 %30, double* %36, i32 %37)
ret void
}

LLVM IR (-O2):
define void @row_stride_add_2x2(double* %0, i32 %1, double* %2, i32 %3) {
%5 = tail call i32 @row_stride_add_1x2(double* %0, i32 %1, double* %2, i32 %3)
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds double, double* %0, i64 %6
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds double, double* %2, i64 %8
%10 = tail call i32 @row_stride_add_1x2(double* %7, i32 %1, double* %9, i32 %3)
ret void
}