#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*/ arrayParams(short *, char *);
scalar_t__ malloc(int);
int main() {
  short stack_shorts[10];
  stack_shorts[1] = 1;
  stack_shorts[3] = 3;
  stack_shorts[5] = 5;
  stack_shorts[7] = 7;
  stack_shorts[9] = 9;
  char *heap_str = (char *)malloc(7);
  heap_str[0] = 'B';
  heap_str[1] = 'o';
  heap_str[2] = 'b';
  heap_str[3] = '\0';
  arrayParams(stack_shorts, heap_str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x1,-0x1e(%rbp)
movw   $0x3,-0x1a(%rbp)
movw   $0x5,-0x16(%rbp)
movw   $0x7,-0x12(%rbp)
movw   $0x9,-0xe(%rbp)
mov    $0x7,%edi
call   1030 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x42,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x6f,0x1(%rax)
mov    -0x28(%rbp),%rax
movb   $0x62,0x2(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,0x3(%rax)
lea    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <arrayParams@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movw   $0x1,0x2(%rsp)
movw   $0x3,0x6(%rsp)
movw   $0x5,0xa(%rsp)
movw   $0x7,0xe(%rsp)
movw   $0x9,0x12(%rsp)
mov    $0x7,%edi
call   1030 <malloc@plt>
movl   $0x626f42,(%rax)
mov    %rsp,%rdi
mov    %rax,%rsi
call   1040 <arrayParams@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i16]
%3 = alloca i8*
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x i16], [10 x i16]* %2, i64 0, i64 1
store i16 1, i16* %4
%5 = getelementptr inbounds [10 x i16], [10 x i16]* %2, i64 0, i64 3
store i16 3, i16* %5
%6 = getelementptr inbounds [10 x i16], [10 x i16]* %2, i64 0, i64 5
store i16 5, i16* %6
%7 = getelementptr inbounds [10 x i16], [10 x i16]* %2, i64 0, i64 7
store i16 7, i16* %7
%8 = getelementptr inbounds [10 x i16], [10 x i16]* %2, i64 0, i64 9
store i16 9, i16* %8
%9 = call i64 @malloc(i32 7)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %3
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
store i8 66, i8* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 1
store i8 111, i8* %14
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 98, i8* %16
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i64 3
store i8 0, i8* %18
%19 = getelementptr inbounds [10 x i16], [10 x i16]* %2, i64 0, i64 0
%20 = load i8*, i8** %3
%21 = call i32 @arrayParams(i16* %19, i8* %20)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x i16]
%2 = bitcast [10 x i16]* %1 to i8*
%3 = getelementptr inbounds [10 x i16], [10 x i16]* %1, i64 0, i64 1
store i16 1, i16* %3
%4 = getelementptr inbounds [10 x i16], [10 x i16]* %1, i64 0, i64 3
store i16 3, i16* %4
%5 = getelementptr inbounds [10 x i16], [10 x i16]* %1, i64 0, i64 5
store i16 5, i16* %5
%6 = getelementptr inbounds [10 x i16], [10 x i16]* %1, i64 0, i64 7
store i16 7, i16* %6
%7 = getelementptr inbounds [10 x i16], [10 x i16]* %1, i64 0, i64 9
store i16 9, i16* %7
%8 = tail call i64 @malloc(i32 7)
%9 = inttoptr i64 %8 to i8*
store i8 66, i8* %9
%10 = getelementptr inbounds i8, i8* %9, i64 1
store i8 111, i8* %10
%11 = getelementptr inbounds i8, i8* %9, i64 2
store i8 98, i8* %11
%12 = getelementptr inbounds i8, i8* %9, i64 3
store i8 0, i8* %12
%13 = getelementptr inbounds [10 x i16], [10 x i16]* %1, i64 0, i64 0
%14 = call i32 @arrayParams(i16* %13, i8* %9)
ret i32 0
}