#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 */
scalar_t__ collision(int, int, int, int, int /*<<< orphan*/, int);
int requirements_met(int *known, int number, int *positions, int *directions,
                     int *lengths) {
  int i, j;
  for (i = 0; i < 100; ++i) {
    if (*(known + i) == 2) {
      int found = 0;
      for (j = 0; j < number; ++j) {
        if (collision(*(positions + j), *(directions + j), *(lengths + j), i, 0,
                      1)) {
          found = 1;
          break;
        }
      }
      if (!found) {
        return 0;
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<requirements_met>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x64,-0x34(%rbp)
jge    11f1 <requirements_met+0xe1>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
cmpl   $0x2,(%rax,%rcx,4)
jne    11de <requirements_met+0xce>
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11c3 <requirements_met+0xb3>
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x34(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <collision@plt>
cmp    $0x0,%rax
je     11b0 <requirements_met+0xa0>
movl   $0x1,-0x3c(%rbp)
jmp    11c3 <requirements_met+0xb3>
jmp    11b5 <requirements_met+0xa5>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    115c <requirements_met+0x4c>
cmpl   $0x0,-0x3c(%rbp)
jne    11d9 <requirements_met+0xc9>
movl   $0x0,-0x4(%rbp)
jmp    11f8 <requirements_met+0xe8>
jmp    11de <requirements_met+0xce>
jmp    11e3 <requirements_met+0xd3>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1132 <requirements_met+0x22>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<requirements_met>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%rbx
mov    %rdi,0x10(%rsp)
mov    %esi,0xc(%rsp)
mov    %esi,%r13d
xor    %ebp,%ebp
jmp    114a <requirements_met+0x3a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    $0x64,%rbp
je     11ab <requirements_met+0x9b>
mov    0x10(%rsp),%rax
cmpl   $0x2,(%rax,%rbp,4)
jne    1140 <requirements_met+0x30>
xor    %eax,%eax
cmpl   $0x0,0xc(%rsp)
jle    119c <requirements_met+0x8c>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%r12,4),%edi
mov    (%r15,%r12,4),%esi
mov    (%r14,%r12,4),%edx
mov    %ebp,%ecx
xor    %r8d,%r8d
mov    $0x1,%r9d
call   1030 <collision@plt>
test   %rax,%rax
jne    1140 <requirements_met+0x30>
add    $0x1,%r12
cmp    %r12,%r13
jne    1170 <requirements_met+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
jmp    119c <requirements_met+0x8c>

LLVM IR (-O0):
define i32 @requirements_met(i32* %0, i32 %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %7
store i32 %1, i32* %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32 0, i32* %12
br label %15
15: ; preds = %60, %5
%16 = load i32, i32* %12
%17 = icmp slt i32 %16, 100
br i1 %17, label %18, label %63
18: ; preds = %15
%19 = load i32*, i32** %7
%20 = load i32, i32* %12
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 2
br i1 %24, label %25, label %59
25: ; preds = %18
store i32 0, i32* %14
store i32 0, i32* %13
br label %26
26: ; preds = %51, %25
%27 = load i32, i32* %13
%28 = load i32, i32* %8
%29 = icmp slt i32 %27, %28
br i1 %29, label %30, label %54
30: ; preds = %26
%31 = load i32*, i32** %9
%32 = load i32, i32* %13
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
%35 = load i32, i32* %34
%36 = load i32*, i32** %10
%37 = load i32, i32* %13
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i32, i32* %36, i64 %38
%40 = load i32, i32* %39
%41 = load i32*, i32** %11
%42 = load i32, i32* %13
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32, i32* %41, i64 %43
%45 = load i32, i32* %44
%46 = load i32, i32* %12
%47 = call i64 @collision(i32 %35, i32 %40, i32 %45, i32 %46, i32 0, i32 1)
%48 = icmp ne i64 %47, 0
br i1 %48, label %49, label %50
49: ; preds = %30
store i32 1, i32* %14
br label %54
50: ; preds = %30
br label %51
51: ; preds = %50
%52 = load i32, i32* %13
%53 = add nsw i32 %52, 1
store i32 %53, i32* %13
br label %26
54: ; preds = %49, %26
%55 = load i32, i32* %14
%56 = icmp ne i32 %55, 0
br i1 %56, label %58, label %57
57: ; preds = %54
store i32 0, i32* %6
br label %64
58: ; preds = %54
br label %59
59: ; preds = %58, %18
br label %60
60: ; preds = %59
%61 = load i32, i32* %12
%62 = add nsw i32 %61, 1
store i32 %62, i32* %12
br label %15
63: ; preds = %15
store i32 1, i32* %6
br label %64
64: ; preds = %63, %57
%65 = load i32, i32* %6
ret i32 %65
}

LLVM IR (-O2):
define i32 @requirements_met(i32* nocapture %0, i32 %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = icmp sgt i32 %1, 0
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %5, %29
%9 = phi i64 [ 0, %5 ], [ %30, %29 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 2
br i1 %12, label %13, label %29
13: ; preds = %8
br i1 %6, label %14, label %32
14: ; preds = %13
%15 = trunc i64 %9 to i32
br label %18
16: ; preds = %18
%17 = icmp eq i64 %28, %7
br i1 %17, label %32, label %18
18: ; preds = %14, %16
%19 = phi i64 [ 0, %14 ], [ %28, %16 ]
%20 = getelementptr inbounds i32, i32* %2, i64 %19
%21 = load i32, i32* %20
%22 = getelementptr inbounds i32, i32* %3, i64 %19
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %4, i64 %19
%25 = load i32, i32* %24
%26 = tail call i64 @collision(i32 %21, i32 %23, i32 %25, i32 %15, i32 0, i32 1)
%27 = icmp eq i64 %26, 0
%28 = add nuw nsw i64 %19, 1
br i1 %27, label %16, label %29
29: ; preds = %18, %8
%30 = add nuw nsw i64 %9, 1
%31 = icmp eq i64 %30, 100
br i1 %31, label %32, label %8
32: ; preds = %29, %13, %16
%33 = phi i32 [ 0, %16 ], [ 0, %13 ], [ 1, %29 ]
ret i32 %33
}