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

/* Variables and functions */
struct list *createListFromArray(int *, int);
int /*<<< orphan*/ dotest(int, struct list *, int);
int main() {
  {
    int a[] = {10081, 10071, 10077, 10065, 10060, 10070, 10086, 10083, 10078,
               10076, 10089, 10085, 10063, 10074, 10068, 10073, 10072, 10075};
    struct list *l = createListFromArray(a, 18);
    dotest(2, l, 2);
  }
  {
    int a[] = {10064};
    struct list *l = createListFromArray(a, 1);
    dotest(6, l, 0);
  }
  {
    int a[] = {10054, 10039, 10053, 10051, 10047, 10043, 10037, 10034};
    struct list *l = createListFromArray(a, 8);
    dotest(1, l, 0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0x50(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x48,%edx
call   1050 <memcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x12,%esi
call   1040 <createListFromArray@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rsi
mov    $0x2,%edx
mov    %edx,%edi
call   1030 <dotest@plt>
mov    0xed0(%rip),%eax
mov    %eax,-0x5c(%rbp)
lea    -0x5c(%rbp),%rdi
mov    $0x1,%esi
call   1040 <createListFromArray@plt>
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rsi
mov    $0x6,%edi
xor    %edx,%edx
call   1030 <dotest@plt>
mov    0xeac(%rip),%rax
mov    %rax,-0x90(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x88(%rbp)
mov    0xea0(%rip),%rax
mov    %rax,-0x80(%rbp)
mov    0xe9d(%rip),%rax
mov    %rax,-0x78(%rbp)
lea    -0x90(%rbp),%rdi
mov    $0x8,%esi
call   1040 <createListFromArray@plt>
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rsi
mov    $0x1,%edi
xor    %edx,%edx
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
mov    0xf15(%rip),%rax
mov    %rax,0x40(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xea5(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x12,%esi
call   1040 <createListFromArray@plt>
mov    $0x2,%edi
mov    %rax,%rsi
mov    $0x2,%edx
call   1030 <dotest@plt>
movl   $0x2750,(%rsp)
mov    %rsp,%rdi
mov    $0x1,%esi
call   1040 <createListFromArray@plt>
mov    $0x6,%edi
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <dotest@plt>
movaps 0xeb8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9c(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <createListFromArray@plt>
mov    $0x1,%edi
mov    %rax,%rsi
xor    %edx,%edx
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.list = type { i32 }
@__const.main.a = [18 x i32] [i32 10081, i32 10071, i32 10077, i32 10065, i32 10060, i32 10070, i32 10086, i32 10083, i32 10078, i32 10076, i32 10089, i32 10085, i32 10063, i32 10074, i32 10068, i32 10073, i32 10072, i32 10075]
@__const.main.a.1 = [1 x i32] [i32 10064]
@__const.main.a.2 = [8 x i32] [i32 10054, i32 10039, i32 10053, i32 10051, i32 10047, i32 10043, i32 10037, i32 10034]
define i32 @main() {
%1 = alloca [18 x i32]
%2 = alloca %struct.list*
%3 = alloca [1 x i32]
%4 = alloca %struct.list*
%5 = alloca [8 x i32]
%6 = alloca %struct.list*
%7 = bitcast [18 x i32]* %1 to i8*
%8 = getelementptr inbounds [18 x i32], [18 x i32]* %1, i64 0, i64 0
%9 = call %struct.list* @createListFromArray(i32* %8, i32 18)
store %struct.list* %9, %struct.list** %2
%10 = load %struct.list*, %struct.list** %2
%11 = call i32 @dotest(i32 2, %struct.list* %10, i32 2)
%12 = bitcast [1 x i32]* %3 to i8*
%13 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%14 = call %struct.list* @createListFromArray(i32* %13, i32 1)
store %struct.list* %14, %struct.list** %4
%15 = load %struct.list*, %struct.list** %4
%16 = call i32 @dotest(i32 6, %struct.list* %15, i32 0)
%17 = bitcast [8 x i32]* %5 to i8*
%18 = getelementptr inbounds [8 x i32], [8 x i32]* %5, i64 0, i64 0
%19 = call %struct.list* @createListFromArray(i32* %18, i32 8)
store %struct.list* %19, %struct.list** %6
%20 = load %struct.list*, %struct.list** %6
%21 = call i32 @dotest(i32 1, %struct.list* %20, i32 0)
ret i32 0
}

LLVM IR (-O2):
%struct.list = type { i32 }
@__const.main.a = [18 x i32] [i32 10081, i32 10071, i32 10077, i32 10065, i32 10060, i32 10070, i32 10086, i32 10083, i32 10078, i32 10076, i32 10089, i32 10085, i32 10063, i32 10074, i32 10068, i32 10073, i32 10072, i32 10075]
@__const.main.a.2 = [8 x i32] [i32 10054, i32 10039, i32 10053, i32 10051, i32 10047, i32 10043, i32 10037, i32 10034]
define i32 @main() {
%1 = alloca [18 x i32]
%2 = alloca [1 x i32]
%3 = alloca [8 x i32]
%4 = bitcast [18 x i32]* %1 to i8*
%5 = getelementptr inbounds [18 x i32], [18 x i32]* %1, i64 0, i64 0
%6 = call %struct.list* @createListFromArray(i32* %5, i32 18)
%7 = call i32 @dotest(i32 2, %struct.list* %6, i32 2)
%8 = bitcast [1 x i32]* %2 to i8*
%9 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 10064, i32* %9
%10 = call %struct.list* @createListFromArray(i32* %9, i32 1)
%11 = call i32 @dotest(i32 6, %struct.list* %10, i32 0)
%12 = bitcast [8 x i32]* %3 to i8*
%13 = getelementptr inbounds [8 x i32], [8 x i32]* %3, i64 0, i64 0
%14 = call %struct.list* @createListFromArray(i32* %13, i32 8)
%15 = call i32 @dotest(i32 1, %struct.list* %14, i32 0)
ret i32 0
}