#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 *kingdomCards(int k1, int k2, int k3, int k4, int k5, int k6, int k7,
                  int k8, int k9, int k10) {
  int *k = malloc(10 * sizeof(int));
  k[0] = k1;
  k[1] = k2;
  k[2] = k3;
  k[3] = k4;
  k[4] = k5;
  k[5] = k6;
  k[6] = k7;
  k[7] = k8;
  k[8] = k9;
  k[9] = k10;
  return k;
}


x86 assembly (clang, -O0):
<kingdomCards>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    0x10(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    0x18(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    0x20(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x20(%rax)
mov    0x28(%rbp),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x24(%rax)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kingdomCards>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r13d
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x28,%edi
call   1030 <malloc@plt>
mov    %ebp,(%rax)
mov    %ebx,0x4(%rax)
mov    %r13d,0x8(%rax)
mov    %r12d,0xc(%rax)
mov    %r15d,0x10(%rax)
mov    %r14d,0x14(%rax)
mov    0x40(%rsp),%ecx
mov    %ecx,0x18(%rax)
mov    0x48(%rsp),%ecx
mov    %ecx,0x1c(%rax)
mov    0x50(%rsp),%ecx
mov    %ecx,0x20(%rax)
mov    0x58(%rsp),%ecx
mov    %ecx,0x24(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32* @kingdomCards(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32*
store i32 %0, i32* %11
store i32 %1, i32* %12
store i32 %2, i32* %13
store i32 %3, i32* %14
store i32 %4, i32* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%22 = call i32* @malloc(i32 40)
store i32* %22, i32** %21
%23 = load i32, i32* %11
%24 = load i32*, i32** %21
%25 = getelementptr inbounds i32, i32* %24, i64 0
store i32 %23, i32* %25
%26 = load i32, i32* %12
%27 = load i32*, i32** %21
%28 = getelementptr inbounds i32, i32* %27, i64 1
store i32 %26, i32* %28
%29 = load i32, i32* %13
%30 = load i32*, i32** %21
%31 = getelementptr inbounds i32, i32* %30, i64 2
store i32 %29, i32* %31
%32 = load i32, i32* %14
%33 = load i32*, i32** %21
%34 = getelementptr inbounds i32, i32* %33, i64 3
store i32 %32, i32* %34
%35 = load i32, i32* %15
%36 = load i32*, i32** %21
%37 = getelementptr inbounds i32, i32* %36, i64 4
store i32 %35, i32* %37
%38 = load i32, i32* %16
%39 = load i32*, i32** %21
%40 = getelementptr inbounds i32, i32* %39, i64 5
store i32 %38, i32* %40
%41 = load i32, i32* %17
%42 = load i32*, i32** %21
%43 = getelementptr inbounds i32, i32* %42, i64 6
store i32 %41, i32* %43
%44 = load i32, i32* %18
%45 = load i32*, i32** %21
%46 = getelementptr inbounds i32, i32* %45, i64 7
store i32 %44, i32* %46
%47 = load i32, i32* %19
%48 = load i32*, i32** %21
%49 = getelementptr inbounds i32, i32* %48, i64 8
store i32 %47, i32* %49
%50 = load i32, i32* %20
%51 = load i32*, i32** %21
%52 = getelementptr inbounds i32, i32* %51, i64 9
store i32 %50, i32* %52
%53 = load i32*, i32** %21
ret i32* %53
}

LLVM IR (-O2):
define noalias i32* @kingdomCards(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = tail call i32* @malloc(i32 40)
store i32 %0, i32* %11
%12 = getelementptr inbounds i32, i32* %11, i64 1
store i32 %1, i32* %12
%13 = getelementptr inbounds i32, i32* %11, i64 2
store i32 %2, i32* %13
%14 = getelementptr inbounds i32, i32* %11, i64 3
store i32 %3, i32* %14
%15 = getelementptr inbounds i32, i32* %11, i64 4
store i32 %4, i32* %15
%16 = getelementptr inbounds i32, i32* %11, i64 5
store i32 %5, i32* %16
%17 = getelementptr inbounds i32, i32* %11, i64 6
store i32 %6, i32* %17
%18 = getelementptr inbounds i32, i32* %11, i64 7
store i32 %7, i32* %18
%19 = getelementptr inbounds i32, i32* %11, i64 8
store i32 %8, i32* %19
%20 = getelementptr inbounds i32, i32* %11, i64 9
store i32 %9, i32* %20
ret i32* %11
}