#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*/ assert(int);
int evaluate_factorisation(int *, int *, int);
void evaluate_factorisation_test(void) {
  int factors[] = {2, 5, 7};
  int powers[] = {0, 0, 0};
  int powers2[] = {2, 3, 1};
  assert(evaluate_factorisation(factors, powers, 0) == 1);
  assert(evaluate_factorisation(factors, powers, 3) == 1);
  assert(evaluate_factorisation(factors, powers2, 3) == 3500);
}


x86 assembly (clang, -O0):
<evaluate_factorisation_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xec1(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xebf(%rip),%eax
mov    %eax,-0x4(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   1030 <memset@plt>
mov    0xea9(%rip),%rax
mov    %rax,-0x24(%rbp)
mov    0xea7(%rip),%eax
mov    %eax,-0x1c(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1050 <evaluate_factorisation@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0xc(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x3,%edx
call   1050 <evaluate_factorisation@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0xc(%rbp),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x3,%edx
call   1050 <evaluate_factorisation@plt>
cmp    $0xdac,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evaluate_factorisation_test>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    0xedb(%rip),%eax
mov    %eax,0x30(%rsp)
mov    0xec8(%rip),%rax
mov    %rax,0x28(%rsp)
movl   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
mov    0xec0(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xead(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x28(%rsp),%r14
lea    0x18(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <evaluate_factorisation@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x3,%edx
call   1040 <evaluate_factorisation@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1030 <assert@plt>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
mov    $0x3,%edx
call   1040 <evaluate_factorisation@plt>
xor    %edi,%edi
cmp    $0xdac,%eax
sete   %dil
call   1030 <assert@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.evaluate_factorisation_test.factors = [3 x i32] [i32 2, i32 5, i32 7]
@__const.evaluate_factorisation_test.powers2 = [3 x i32] [i32 2, i32 3, i32 1]
define void @evaluate_factorisation_test() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %1 to i8*
%5 = bitcast [3 x i32]* %2 to i8*
%6 = bitcast [3 x i32]* %3 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%9 = call i32 @evaluate_factorisation(i32* %7, i32* %8, i32 0)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%15 = call i32 @evaluate_factorisation(i32* %13, i32* %14, i32 3)
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%21 = call i32 @evaluate_factorisation(i32* %19, i32* %20, i32 3)
%22 = icmp eq i32 %21, 3500
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
ret void
}

LLVM IR (-O2):
@__const.evaluate_factorisation_test.factors = [3 x i32] [i32 2, i32 5, i32 7]
@__const.evaluate_factorisation_test.powers2 = [3 x i32] [i32 2, i32 3, i32 1]
define void @evaluate_factorisation_test() {
%1 = alloca [3 x i32]
%2 = alloca [3 x i32]
%3 = alloca [3 x i32]
%4 = bitcast [3 x i32]* %1 to i8*
%5 = bitcast [3 x i32]* %2 to i8*
%6 = bitcast [3 x i32]* %3 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%9 = call i32 @evaluate_factorisation(i32* %7, i32* %8, i32 0)
%10 = icmp eq i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i32 @evaluate_factorisation(i32* %7, i32* %8, i32 3)
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%18 = call i32 @evaluate_factorisation(i32* %7, i32* %17, i32 3)
%19 = icmp eq i32 %18, 3500
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
ret void
}