#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 *malloc(int);
int *get_result_matrix_size(int *first_matrix_size, int *second_matrix_size) {
  int *size = malloc(2 * sizeof(int));
  size[0] = 0;
  size[1] = 0;
  if (first_matrix_size[1] == second_matrix_size[1]) {
    size[0] = first_matrix_size[0];
    size[1] = second_matrix_size[0];
  }
  return size;
}


x86 assembly (clang, -O0):
<get_result_matrix_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movl   $0x0,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    0x4(%rcx),%eax
jne    1170 <get_result_matrix_size+0x60>
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_result_matrix_size>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x8,%edi
call   1030 <malloc@plt>
movq   $0x0,(%rax)
mov    0x4(%rbx),%ecx
cmp    0x4(%r14),%ecx
jne    113e <get_result_matrix_size+0x2e>
mov    (%rbx),%ecx
mov    %ecx,(%rax)
mov    (%r14),%ecx
mov    %ecx,0x4(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32* @get_result_matrix_size(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = call i32* @malloc(i32 8)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = getelementptr inbounds i32, i32* %7, i64 0
store i32 0, i32* %8
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 1
store i32 0, i32* %10
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = icmp eq i32 %13, %16
br i1 %17, label %18, label %29
18: ; preds = %2
%19 = load i32*, i32** %3
%20 = getelementptr inbounds i32, i32* %19, i64 0
%21 = load i32, i32* %20
%22 = load i32*, i32** %5
%23 = getelementptr inbounds i32, i32* %22, i64 0
store i32 %21, i32* %23
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 0
%26 = load i32, i32* %25
%27 = load i32*, i32** %5
%28 = getelementptr inbounds i32, i32* %27, i64 1
store i32 %26, i32* %28
br label %29
29: ; preds = %18, %2
%30 = load i32*, i32** %5
ret i32* %30
}

LLVM IR (-O2):
define noalias i32* @get_result_matrix_size(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i32* @malloc(i32 8)
store i32 0, i32* %3
%4 = getelementptr inbounds i32, i32* %3, i64 1
store i32 0, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 1
%8 = load i32, i32* %7
%9 = icmp eq i32 %6, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %0
store i32 %11, i32* %3
%12 = load i32, i32* %1
store i32 %12, i32* %4
br label %13
13: ; preds = %10, %2
ret i32* %3
}