#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*/ dotest(int *, int, char *);
int main() {
  {
    int d1[2] = {12, 15};
    char *sol1 = "(2 12)(3 27)(5 15)";
    dotest(d1, 2, sol1);
  }
  {
    int d1[5] = {15, 21, 24, 30, 45};
    char *sol1 = "(2 54)(3 135)(5 90)(7 21)";
    dotest(d1, 5, sol1);
  }
  {
    int d1[10] = {107, 158, 204, 100, 118, 123, 126, 110, 116, 100};
    char *sol1 = "(2 1032)(3 453)(5 310)(7 126)(11 110)(17 204)(29 116)(41 "
                 "123)(59 118)(79 158)(107 107)";
    dotest(d1, 10, sol1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xece(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2,%esi
call   1030 <dotest@plt>
mov    0xf39(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xf36(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xf34(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    0xea5(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x5,%esi
call   1030 <dotest@plt>
lea    -0x60(%rbp),%rdi
lea    0xf19(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    0xe8d(%rip),%rax
mov    %rax,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rdx
mov    $0xa,%esi
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0xf0000000c,%rax
mov    %rax,(%rsp)
lea    0xed7(%rip),%rdx
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <dotest@plt>
mov    0xf64(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xf49(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xec1(%rip),%rdx
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <dotest@plt>
mov    0xf6a(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xf4e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xf32(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xea4(%rip),%rdx
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <dotest@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.d1 = [2 x i32] [i32 12, i32 15]
@.str = [19 x i8] c"(2 12)(3 27)(5 15)\00"
@__const.main.d1.1 = [5 x i32] [i32 15, i32 21, i32 24, i32 30, i32 45]
@.str.2 = [26 x i8] c"(2 54)(3 135)(5 90)(7 21)\00"
@__const.main.d1.3 = [10 x i32] [i32 107, i32 158, i32 204, i32 100, i32 118, i32 123, i32 126, i32 110, i32 116, i32 100]
@.str.4 = [87 x i8] c"(2 1032)(3 453)(5 310)(7 126)(11 110)(17 204)(29 116)(41 123)(59 118)(79 158)(107 107)\00"
define i32 @main() {
%1 = alloca [2 x i32]
%2 = alloca i8*
%3 = alloca [5 x i32]
%4 = alloca i8*
%5 = alloca [10 x i32]
%6 = alloca i8*
%7 = bitcast [2 x i32]* %1 to i8*
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %2
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%9 = load i8*, i8** %2
%10 = call i32 @dotest(i32* %8, i32 2, i8* %9)
%11 = bitcast [5 x i32]* %3 to i8*
store i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8** %4
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 0
%13 = load i8*, i8** %4
%14 = call i32 @dotest(i32* %12, i32 5, i8* %13)
%15 = bitcast [10 x i32]* %5 to i8*
store i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.4, i64 0, i64 0), i8** %6
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 0
%17 = load i8*, i8** %6
%18 = call i32 @dotest(i32* %16, i32 10, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"(2 12)(3 27)(5 15)\00"
@__const.main.d1.1 = [5 x i32] [i32 15, i32 21, i32 24, i32 30, i32 45]
@.str.2 = [26 x i8] c"(2 54)(3 135)(5 90)(7 21)\00"
@__const.main.d1.3 = [10 x i32] [i32 107, i32 158, i32 204, i32 100, i32 118, i32 123, i32 126, i32 110, i32 116, i32 100]
@.str.4 = [87 x i8] c"(2 1032)(3 453)(5 310)(7 126)(11 110)(17 204)(29 116)(41 123)(59 118)(79 158)(107 107)\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [5 x i32]
%3 = alloca [10 x i32]
%4 = bitcast i64* %1 to i8*
store i64 64424509452, i64* %1
%5 = bitcast i64* %1 to i32*
%6 = call i32 @dotest(i32* %5, i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%7 = bitcast [5 x i32]* %2 to i8*
%8 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%9 = call i32 @dotest(i32* %8, i32 5, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%10 = bitcast [10 x i32]* %3 to i8*
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 0, i64 0
%12 = call i32 @dotest(i32* %11, i32 10, i8* getelementptr inbounds ([87 x i8], [87 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}