#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 */
struct const_Multiarray_T {
  int dummy;
};
struct const_Matrix_R {
  int dummy;
};
struct Multiarray_T {
  int dummy;
};

/* Variables and functions */
struct Multiarray_T *
constructor_mm_NN1C_Multiarray_T(struct const_Matrix_R const *const,
                                 struct const_Multiarray_T *);
int /*<<< orphan*/ destructor_Multiarray_T(struct Multiarray_T *);
void mm_NN1C_overwrite_Multiarray_T(const struct const_Matrix_R *const a,
                                    struct Multiarray_T **b) {
  struct Multiarray_T *c =
      constructor_mm_NN1C_Multiarray_T(a, (struct const_Multiarray_T *)*b);
  destructor_Multiarray_T(*b);
  *b = c;
}


x86 assembly (clang, -O0):
<mm_NN1C_overwrite_Multiarray_T>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <constructor_mm_NN1C_Multiarray_T@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <destructor_Multiarray_T@plt>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm_NN1C_overwrite_Multiarray_T>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rsi),%rsi
call   1030 <constructor_mm_NN1C_Multiarray_T@plt>
mov    %rax,%r14
mov    (%rbx),%rdi
call   1040 <destructor_Multiarray_T@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.const_Matrix_R = type { i32 }
%struct.Multiarray_T = type { i32 }
%struct.const_Multiarray_T = type { i32 }
define void @mm_NN1C_overwrite_Multiarray_T(%struct.const_Matrix_R* %0, %struct.Multiarray_T** %1) {
%3 = alloca %struct.const_Matrix_R*
%4 = alloca %struct.Multiarray_T**
%5 = alloca %struct.Multiarray_T*
store %struct.const_Matrix_R* %0, %struct.const_Matrix_R** %3
store %struct.Multiarray_T** %1, %struct.Multiarray_T*** %4
%6 = load %struct.const_Matrix_R*, %struct.const_Matrix_R** %3
%7 = load %struct.Multiarray_T**, %struct.Multiarray_T*** %4
%8 = load %struct.Multiarray_T*, %struct.Multiarray_T** %7
%9 = bitcast %struct.Multiarray_T* %8 to %struct.const_Multiarray_T*
%10 = call %struct.Multiarray_T* @constructor_mm_NN1C_Multiarray_T(%struct.const_Matrix_R* %6, %struct.const_Multiarray_T* %9)
store %struct.Multiarray_T* %10, %struct.Multiarray_T** %5
%11 = load %struct.Multiarray_T**, %struct.Multiarray_T*** %4
%12 = load %struct.Multiarray_T*, %struct.Multiarray_T** %11
%13 = call i32 @destructor_Multiarray_T(%struct.Multiarray_T* %12)
%14 = load %struct.Multiarray_T*, %struct.Multiarray_T** %5
%15 = load %struct.Multiarray_T**, %struct.Multiarray_T*** %4
store %struct.Multiarray_T* %14, %struct.Multiarray_T** %15
ret void
}

LLVM IR (-O2):
%struct.const_Matrix_R = type { i32 }
%struct.Multiarray_T = type { i32 }
%struct.const_Multiarray_T = type { i32 }
define void @mm_NN1C_overwrite_Multiarray_T(%struct.const_Matrix_R* %0, %struct.Multiarray_T** nocapture %1) {
%3 = bitcast %struct.Multiarray_T** %1 to %struct.const_Multiarray_T**
%4 = load %struct.const_Multiarray_T*, %struct.const_Multiarray_T** %3
%5 = tail call %struct.Multiarray_T* @constructor_mm_NN1C_Multiarray_T(%struct.const_Matrix_R* %0, %struct.const_Multiarray_T* %4)
%6 = load %struct.Multiarray_T*, %struct.Multiarray_T** %1
%7 = tail call i32 @destructor_Multiarray_T(%struct.Multiarray_T* %6)
store %struct.Multiarray_T* %5, %struct.Multiarray_T** %1
ret void
}