#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*/ subset(int *, int, int *, int);
int test_subset_bigger() {
  int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
  int b[20] = {0};
  subset(a, 10, b, 20);
  for (int i = 0; i < 20; i++) {
    if (b[i] != 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<test_subset_bigger>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x30(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1030 <memset@plt>
lea    -0x30(%rbp),%rdi
lea    -0x80(%rbp),%rdx
mov    $0xa,%esi
mov    $0x14,%ecx
call   1040 <subset@plt>
movl   $0x0,-0x84(%rbp)
cmpl   $0x14,-0x84(%rbp)
jge    11c5 <test_subset_bigger+0x95>
movslq -0x84(%rbp),%rax
cmpl   $0x0,-0x80(%rbp,%rax,4)
je     11ac <test_subset_bigger+0x7c>
movl   $0x0,-0x4(%rbp)
jmp    11cc <test_subset_bigger+0x9c>
jmp    11b1 <test_subset_bigger+0x81>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1181 <test_subset_bigger+0x51>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_subset_bigger>:
sub    $0x78,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x70(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
lea    0x50(%rsp),%rdi
mov    %rsp,%rdx
mov    $0xa,%esi
mov    $0x14,%ecx
call   1030 <subset@plt>
movdqa 0x30(%rsp),%xmm0
pxor   %xmm3,%xmm3
pcmpeqd %xmm3,%xmm0
pcmpeqd %xmm1,%xmm1
pxor   %xmm1,%xmm0
movdqa 0x20(%rsp),%xmm2
pcmpeqd %xmm3,%xmm2
pxor   %xmm1,%xmm2
packssdw %xmm0,%xmm2
movdqa 0x10(%rsp),%xmm0
pcmpeqd %xmm3,%xmm0
pxor   %xmm1,%xmm0
pcmpeqd (%rsp),%xmm3
pxor   %xmm1,%xmm3
packssdw %xmm0,%xmm3
packsswb %xmm2,%xmm3
pmovmskb %xmm3,%ecx
or     0x40(%rsp),%ecx
or     0x44(%rsp),%ecx
or     0x48(%rsp),%ecx
xor    %eax,%eax
or     0x4c(%rsp),%ecx
sete   %al
add    $0x78,%rsp
ret

LLVM IR (-O0):
@__const.test_subset_bigger.a = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @test_subset_bigger() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca [20 x i32]
%4 = alloca i32
%5 = bitcast [10 x i32]* %2 to i8*
%6 = bitcast [20 x i32]* %3 to i8*
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%8 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%9 = call i32 @subset(i32* %7, i32 10, i32* %8, i32 20)
store i32 0, i32* %4
br label %10
10: ; preds = %21, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 20
br i1 %12, label %13, label %24
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %13
store i32 0, i32* %1
br label %25
20: ; preds = %13
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %10
24: ; preds = %10
store i32 1, i32* %1
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %1
ret i32 %26
}

LLVM IR (-O2):
@__const.test_subset_bigger.a = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
define i32 @test_subset_bigger() {
%1 = alloca [10 x i32]
%2 = alloca [20 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [20 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%7 = call i32 @subset(i32* %5, i32 10, i32* %6, i32 20)
%8 = bitcast [20 x i32]* %2 to <16 x i32>*
%9 = load <16 x i32>, <16 x i32>* %8
%10 = freeze <16 x i32> %9
%11 = icmp ne <16 x i32> %10, zeroinitializer
%12 = bitcast <16 x i1> %11 to i16
%13 = icmp eq i16 %12, 0
%14 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 16
%15 = load i32, i32* %14
%16 = icmp eq i32 %15, 0
%17 = select i1 %13, i1 %16, i1 false
%18 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, 0
%21 = select i1 %17, i1 %20, i1 false
%22 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 18
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 0
%25 = select i1 %21, i1 %24, i1 false
%26 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 19
%27 = load i32, i32* %26
%28 = icmp eq i32 %27, 0
%29 = select i1 %25, i1 %28, i1 false
%30 = zext i1 %29 to i32
ret i32 %30
}