#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 */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
scalar_t__ isProduct(int *, int, int);
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int arr[] = {10, 20, 15, 5, 3, 7};
  int n = sizeof(arr) / sizeof(arr[0]);
  int product = 50;
  isProduct(arr, n, product) ? printf("Yes\n") : printf("No\n");
  product = 34;
  isProduct(arr, n, product) ? printf("Yes\n") : printf("No\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xec3(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec0(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xebd(%rip),%rax
mov    %rax,-0x20(%rbp)
movl   $0x6,-0x34(%rbp)
movl   $0x32,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
call   1030 <isProduct@plt>
cmp    $0x0,%rax
je     118f <main+0x6f>
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
jmp    119b <main+0x7b>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
movl   $0x22,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
call   1030 <isProduct@plt>
cmp    $0x0,%rax
je     11cc <main+0xac>
lea    0xe56(%rip),%rdi
call   1040 <printf@plt>
jmp    11d8 <main+0xb8>
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    0xee0(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x6,%esi
mov    $0x32,%edx
call   1030 <isProduct@plt>
test   %rax,%rax
lea    0xeb9(%rip),%r15
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
cmove  %r15,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
mov    $0x6,%esi
mov    $0x22,%edx
call   1030 <isProduct@plt>
test   %rax,%rax
cmove  %r15,%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.arr = [6 x i32] [i32 10, i32 20, i32 15, i32 5, i32 3, i32 7]
@.str = [5 x i8] c"Yes\0A\00"
@.str.1 = [4 x i8] c"No\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x i32]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [6 x i32]* %6 to i8*
store i32 6, i32* %7
store i32 50, i32* %8
%10 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i64 @isProduct(i32* %10, i32 %11, i32 %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %2
%16 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %2
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %15
%20 = phi i32 [ %16, %15 ], [ %18, %17 ]
store i32 34, i32* %8
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %6, i64 0, i64 0
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i64 @isProduct(i32* %21, i32 %22, i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %19
%27 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
br label %30
28: ; preds = %19
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28, %26
%31 = phi i32 [ %27, %26 ], [ %29, %28 ]
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i32] [i32 10, i32 20, i32 15, i32 5, i32 3, i32 7]
@str.2 = [3 x i8] c"No\00"
@str.4 = [4 x i8] c"Yes\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i32]
%4 = bitcast [6 x i32]* %3 to i8*
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 0
%6 = call i64 @isProduct(i32* %5, i32 6, i32 50)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
%10 = call i64 @isProduct(i32* %5, i32 6, i32 34)
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0)
%13 = call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}