#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 SLL {
  int dummy;
};

/* Variables and functions */
struct SLL *SLL_create(int, int **, int *);
int /*<<< orphan*/ SLL_destroy(struct SLL *);
int main() {
  int A0[] = {1, 2, 3};
  int A1[] = {4, 5};
  int A2[] = {6, 7, 8};
  int m[3] = {3, 2, 3};
  int *A[3] = {A0, A1, A2};
  struct SLL *sll = SLL_create(3, A, m);
  SLL_destroy(sll);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb7(%rip),%rax
mov    %rax,-0x24(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x1c(%rbp)
mov    0xeaf(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xead(%rip),%eax
mov    %eax,-0x28(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
lea    -0x24(%rbp),%rax
mov    %rax,-0x40(%rbp)
lea    -0x50(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x3,%edi
call   1040 <SLL_create@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
call   1030 <SLL_destroy@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x38(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x30(%rsp)
movabs $0x500000004,%rax
mov    %rax,0x28(%rsp)
mov    0xec5(%rip),%eax
mov    %eax,0x20(%rsp)
mov    0xeb2(%rip),%rax
mov    %rax,0x18(%rsp)
mov    0xebb(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xea8(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x30(%rsp),%rax
mov    %rax,0x40(%rsp)
lea    0x28(%rsp),%rax
mov    %rax,0x48(%rsp)
lea    0x18(%rsp),%rax
mov    %rax,0x50(%rsp)
lea    0x40(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x3,%edi
call   1040 <SLL_create@plt>
mov    %rax,%rdi
call   1030 <SLL_destroy@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
%struct.SLL = type { i32 }
@__const.main.A0 = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.A1 = [2 x i32] [i32 4, i32 5]
@__const.main.A2 = [3 x i32] [i32 6, i32 7, i32 8]
@__const.main.m = [3 x i32] [i32 3, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [2 x i32]
%4 = alloca [3 x i32]
%5 = alloca [3 x i32]
%6 = alloca [3 x i32*]
%7 = alloca %struct.SLL*
store i32 0, i32* %1
%8 = bitcast [3 x i32]* %2 to i8*
%9 = bitcast [2 x i32]* %3 to i8*
%10 = bitcast [3 x i32]* %4 to i8*
%11 = bitcast [3 x i32]* %5 to i8*
%12 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32* %13, i32** %12
%14 = getelementptr inbounds i32*, i32** %12, i64 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32* %15, i32** %14
%16 = getelementptr inbounds i32*, i32** %14, i64 1
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32* %17, i32** %16
%18 = getelementptr inbounds [3 x i32*], [3 x i32*]* %6, i64 0, i64 0
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%20 = call %struct.SLL* @SLL_create(i32 3, i32** %18, i32* %19)
store %struct.SLL* %20, %struct.SLL** %7
%21 = load %struct.SLL*, %struct.SLL** %7
%22 = call i32 @SLL_destroy(%struct.SLL* %21)
ret i32 0
}

LLVM IR (-O2):
%struct.SLL = type { i32 }
@__const.main.A0 = [3 x i32] [i32 1, i32 2, i32 3]
@__const.main.A2 = [3 x i32] [i32 6, i32 7, i32 8]
@__const.main.m = [3 x i32] [i32 3, i32 2, i32 3]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca i64
%3 = alloca [3 x i32]
%4 = alloca [3 x i32]
%5 = alloca [3 x i32*]
%6 = bitcast [3 x i32]* %1 to i8*
%7 = bitcast i64* %2 to i8*
store i64 21474836484, i64* %2
%8 = bitcast [3 x i32]* %3 to i8*
%9 = bitcast [3 x i32]* %4 to i8*
%10 = bitcast [3 x i32*]* %5 to i8*
%11 = getelementptr inbounds [3 x i32*], [3 x i32*]* %5, i64 0, i64 0
%12 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32* %12, i32** %11
%13 = getelementptr inbounds [3 x i32*], [3 x i32*]* %5, i64 0, i64 1
%14 = bitcast i32** %13 to i64**
store i64* %2, i64** %14
%15 = getelementptr inbounds [3 x i32*], [3 x i32*]* %5, i64 0, i64 2
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
store i32* %16, i32** %15
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%18 = call %struct.SLL* @SLL_create(i32 3, i32** %11, i32* %17)
%19 = call i32 @SLL_destroy(%struct.SLL* %18)
ret i32 0
}