#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  int member_0;
  int member_1;
};
struct TYPE_3__ {
  int member_0;
  int member_1;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ lines_intersect(int **, int **);
scalar_t__ point_in_polygon(int, int, int, int *, int *);
scalar_t__ point_in_rectangle(int, int, int, int, int, int);
int collide_polygon_rectangle(int n, int *xs, int *ys, int rx, int ry, int w,
                              int h) {
  assert(n > 0);
  int polygon_line[2][2];
  int rectangle_lines[4][2][2] = {{{rx, ry}, {rx + w, ry}},
                                  {{rx + w, ry}, {rx + w, ry + h}},
                                  {{rx + w, ry + h}, {rx, ry + h}},
                                  {{rx, ry + h}, {rx, ry}}};
  int polygon_index, rectangle_index;
  int old_polygon_index = n - 1;
  for (polygon_index = 0; polygon_index < n; ++polygon_index) {
    polygon_line[0][0] = xs[old_polygon_index];
    polygon_line[0][1] = ys[old_polygon_index];
    polygon_line[1][0] = xs[polygon_index];
    polygon_line[1][1] = ys[polygon_index];
    for (rectangle_index = 0; rectangle_index < 4; ++rectangle_index) {
      if (lines_intersect(polygon_line, rectangle_lines[rectangle_index])) {
        return (1);
      }
    }
    old_polygon_index = polygon_index;
  }
  if (point_in_rectangle(xs[0], ys[0], rx, ry, w, h)) {
    return (1);
  }
  if (point_in_polygon(rx, ry, n, xs, ys)) {
    return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<collide_polygon_rectangle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x80(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x7c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x20(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x20(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x20(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x20(%rbp),%eax
add    0x10(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x8c(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x84(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12d7 <collide_polygon_rectangle+0x197>
mov    -0x10(%rbp),%rax
movslq -0x8c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x8c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x84(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
movl   $0x0,-0x88(%rbp)
cmpl   $0x4,-0x88(%rbp)
jge    12b7 <collide_polygon_rectangle+0x177>
lea    -0x40(%rbp),%rdi
movslq -0x88(%rbp),%rax
lea    -0x80(%rbp),%rsi
shl    $0x4,%rax
add    %rax,%rsi
call   1050 <lines_intersect@plt>
cmp    $0x0,%rax
je     129e <collide_polygon_rectangle+0x15e>
movl   $0x1,-0x4(%rbp)
jmp    133f <collide_polygon_rectangle+0x1ff>
jmp    12a3 <collide_polygon_rectangle+0x163>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    1260 <collide_polygon_rectangle+0x120>
mov    -0x84(%rbp),%eax
mov    %eax,-0x8c(%rbp)
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    1203 <collide_polygon_rectangle+0xc3>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x24(%rbp),%r8d
mov    0x10(%rbp),%r9d
call   1060 <point_in_rectangle@plt>
cmp    $0x0,%rax
je     130c <collide_polygon_rectangle+0x1cc>
movl   $0x1,-0x4(%rbp)
jmp    133f <collide_polygon_rectangle+0x1ff>
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
call   1040 <point_in_polygon@plt>
cmp    $0x0,%rax
je     1338 <collide_polygon_rectangle+0x1f8>
movl   $0x1,-0x4(%rbp)
jmp    133f <collide_polygon_rectangle+0x1ff>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<collide_polygon_rectangle>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %r9d,%r13d
mov    %r8d,%ebp
mov    %ecx,%ebx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %edi,%r12d
xor    %edi,%edi
test   %r12d,%r12d
setg   %dil
call   1030 <assert@plt>
mov    %r13,0x70(%rsp)
lea    (%rbx,%r13,1),%eax
mov    0xb0(%rsp),%ecx
add    %ebp,%ecx
mov    %ebx,0x20(%rsp)
mov    %ebp,0x24(%rsp)
mov    %eax,0x28(%rsp)
mov    %ebp,0x2c(%rsp)
mov    %eax,0x30(%rsp)
mov    %ebp,0x34(%rsp)
mov    %eax,0x38(%rsp)
mov    %ecx,0x3c(%rsp)
mov    %eax,0x40(%rsp)
mov    %ecx,0x44(%rsp)
mov    %ebx,0x48(%rsp)
mov    %ecx,0x4c(%rsp)
mov    %ebx,0x50(%rsp)
mov    %ecx,0x54(%rsp)
mov    %rbx,0x8(%rsp)
mov    %ebx,0x58(%rsp)
mov    %rbp,0x10(%rsp)
mov    %ebp,0x5c(%rsp)
mov    %r12,0x18(%rsp)
test   %r12d,%r12d
jle    1276 <collide_polygon_rectangle+0x136>
mov    0x18(%rsp),%rcx
lea    -0x1(%rcx),%eax
mov    %ecx,%ebx
xor    %r12d,%r12d
lea    0x60(%rsp),%rbp
mov    $0x1,%r13d
nop
cltq
mov    (%r14,%rax,4),%ecx
mov    %ecx,0x60(%rsp)
mov    (%r15,%rax,4),%eax
mov    %eax,0x64(%rsp)
mov    (%r14,%r12,4),%eax
mov    %eax,0x68(%rsp)
mov    (%r15,%r12,4),%eax
mov    %eax,0x6c(%rsp)
mov    %rbp,%rdi
lea    0x20(%rsp),%rsi
call   1050 <lines_intersect@plt>
test   %rax,%rax
jne    12c7 <collide_polygon_rectangle+0x187>
mov    %rbp,%rdi
lea    0x30(%rsp),%rsi
call   1050 <lines_intersect@plt>
test   %rax,%rax
jne    12c7 <collide_polygon_rectangle+0x187>
mov    %rbp,%rdi
lea    0x40(%rsp),%rsi
call   1050 <lines_intersect@plt>
test   %rax,%rax
jne    12c7 <collide_polygon_rectangle+0x187>
mov    %rbp,%rdi
lea    0x50(%rsp),%rsi
call   1050 <lines_intersect@plt>
test   %rax,%rax
jne    12c7 <collide_polygon_rectangle+0x187>
mov    %r12d,%eax
lea    0x1(%r12),%rcx
mov    %rcx,%r12
cmp    %rcx,%rbx
jne    11f0 <collide_polygon_rectangle+0xb0>
mov    (%r14),%edi
mov    (%r15),%esi
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rcx
mov    0x70(%rsp),%r8
mov    0xb0(%rsp),%r9d
call   1060 <point_in_rectangle@plt>
mov    $0x1,%r13d
test   %rax,%rax
jne    12c7 <collide_polygon_rectangle+0x187>
mov    0x8(%rsp),%rdi
mov    0x10(%rsp),%rsi
mov    0x18(%rsp),%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1040 <point_in_polygon@plt>
xor    %r13d,%r13d
test   %rax,%rax
setne  %r13b
mov    %r13d,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @collide_polygon_rectangle(i32 %0, i32* %1, i32* %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca [2 x [2 x i32]]
%17 = alloca [4 x [2 x [2 x i32]]]
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %9
store i32* %1, i32** %10
store i32* %2, i32** %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
%21 = load i32, i32* %9
%22 = icmp sgt i32 %21, 0
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %17, i64 0, i64 0
%26 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %25, i64 0, i64 0
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %26, i64 0, i64 0
%28 = load i32, i32* %12
store i32 %28, i32* %27
%29 = getelementptr inbounds i32, i32* %27, i64 1
%30 = load i32, i32* %13
store i32 %30, i32* %29
%31 = getelementptr inbounds [2 x i32], [2 x i32]* %26, i64 1
%32 = getelementptr inbounds [2 x i32], [2 x i32]* %31, i64 0, i64 0
%33 = load i32, i32* %12
%34 = load i32, i32* %14
%35 = add nsw i32 %33, %34
store i32 %35, i32* %32
%36 = getelementptr inbounds i32, i32* %32, i64 1
%37 = load i32, i32* %13
store i32 %37, i32* %36
%38 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %25, i64 1
%39 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %38, i64 0, i64 0
%40 = getelementptr inbounds [2 x i32], [2 x i32]* %39, i64 0, i64 0
%41 = load i32, i32* %12
%42 = load i32, i32* %14
%43 = add nsw i32 %41, %42
store i32 %43, i32* %40
%44 = getelementptr inbounds i32, i32* %40, i64 1
%45 = load i32, i32* %13
store i32 %45, i32* %44
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %39, i64 1
%47 = getelementptr inbounds [2 x i32], [2 x i32]* %46, i64 0, i64 0
%48 = load i32, i32* %12
%49 = load i32, i32* %14
%50 = add nsw i32 %48, %49
store i32 %50, i32* %47
%51 = getelementptr inbounds i32, i32* %47, i64 1
%52 = load i32, i32* %13
%53 = load i32, i32* %15
%54 = add nsw i32 %52, %53
store i32 %54, i32* %51
%55 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %38, i64 1
%56 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %55, i64 0, i64 0
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %56, i64 0, i64 0
%58 = load i32, i32* %12
%59 = load i32, i32* %14
%60 = add nsw i32 %58, %59
store i32 %60, i32* %57
%61 = getelementptr inbounds i32, i32* %57, i64 1
%62 = load i32, i32* %13
%63 = load i32, i32* %15
%64 = add nsw i32 %62, %63
store i32 %64, i32* %61
%65 = getelementptr inbounds [2 x i32], [2 x i32]* %56, i64 1
%66 = getelementptr inbounds [2 x i32], [2 x i32]* %65, i64 0, i64 0
%67 = load i32, i32* %12
store i32 %67, i32* %66
%68 = getelementptr inbounds i32, i32* %66, i64 1
%69 = load i32, i32* %13
%70 = load i32, i32* %15
%71 = add nsw i32 %69, %70
store i32 %71, i32* %68
%72 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %55, i64 1
%73 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %72, i64 0, i64 0
%74 = getelementptr inbounds [2 x i32], [2 x i32]* %73, i64 0, i64 0
%75 = load i32, i32* %12
store i32 %75, i32* %74
%76 = getelementptr inbounds i32, i32* %74, i64 1
%77 = load i32, i32* %13
%78 = load i32, i32* %15
%79 = add nsw i32 %77, %78
store i32 %79, i32* %76
%80 = getelementptr inbounds [2 x i32], [2 x i32]* %73, i64 1
%81 = getelementptr inbounds [2 x i32], [2 x i32]* %80, i64 0, i64 0
%82 = load i32, i32* %12
store i32 %82, i32* %81
%83 = getelementptr inbounds i32, i32* %81, i64 1
%84 = load i32, i32* %13
store i32 %84, i32* %83
%85 = load i32, i32* %9
%86 = sub nsw i32 %85, 1
store i32 %86, i32* %20
store i32 0, i32* %18
br label %87
87: ; preds = %140, %7
%88 = load i32, i32* %18
%89 = load i32, i32* %9
%90 = icmp slt i32 %88, %89
br i1 %90, label %91, label %143
91: ; preds = %87
%92 = load i32*, i32** %10
%93 = load i32, i32* %20
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds i32, i32* %92, i64 %94
%96 = load i32, i32* %95
%97 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %16, i64 0, i64 0
%98 = getelementptr inbounds [2 x i32], [2 x i32]* %97, i64 0, i64 0
store i32 %96, i32* %98
%99 = load i32*, i32** %11
%100 = load i32, i32* %20
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i32, i32* %99, i64 %101
%103 = load i32, i32* %102
%104 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %16, i64 0, i64 0
%105 = getelementptr inbounds [2 x i32], [2 x i32]* %104, i64 0, i64 1
store i32 %103, i32* %105
%106 = load i32*, i32** %10
%107 = load i32, i32* %18
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i32, i32* %106, i64 %108
%110 = load i32, i32* %109
%111 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %16, i64 0, i64 1
%112 = getelementptr inbounds [2 x i32], [2 x i32]* %111, i64 0, i64 0
store i32 %110, i32* %112
%113 = load i32*, i32** %11
%114 = load i32, i32* %18
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i32, i32* %113, i64 %115
%117 = load i32, i32* %116
%118 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %16, i64 0, i64 1
%119 = getelementptr inbounds [2 x i32], [2 x i32]* %118, i64 0, i64 1
store i32 %117, i32* %119
store i32 0, i32* %19
br label %120
120: ; preds = %135, %91
%121 = load i32, i32* %19
%122 = icmp slt i32 %121, 4
br i1 %122, label %123, label %138
123: ; preds = %120
%124 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %16, i64 0, i64 0
%125 = bitcast [2 x i32]* %124 to i32**
%126 = load i32, i32* %19
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %17, i64 0, i64 %127
%129 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %128, i64 0, i64 0
%130 = bitcast [2 x i32]* %129 to i32**
%131 = call i64 @lines_intersect(i32** %125, i32** %130)
%132 = icmp ne i64 %131, 0
br i1 %132, label %133, label %134
133: ; preds = %123
store i32 1, i32* %8
br label %167
134: ; preds = %123
br label %135
135: ; preds = %134
%136 = load i32, i32* %19
%137 = add nsw i32 %136, 1
store i32 %137, i32* %19
br label %120
138: ; preds = %120
%139 = load i32, i32* %18
store i32 %139, i32* %20
br label %140
140: ; preds = %138
%141 = load i32, i32* %18
%142 = add nsw i32 %141, 1
store i32 %142, i32* %18
br label %87
143: ; preds = %87
%144 = load i32*, i32** %10
%145 = getelementptr inbounds i32, i32* %144, i64 0
%146 = load i32, i32* %145
%147 = load i32*, i32** %11
%148 = getelementptr inbounds i32, i32* %147, i64 0
%149 = load i32, i32* %148
%150 = load i32, i32* %12
%151 = load i32, i32* %13
%152 = load i32, i32* %14
%153 = load i32, i32* %15
%154 = call i64 @point_in_rectangle(i32 %146, i32 %149, i32 %150, i32 %151, i32 %152, i32 %153)
%155 = icmp ne i64 %154, 0
br i1 %155, label %156, label %157
156: ; preds = %143
store i32 1, i32* %8
br label %167
157: ; preds = %143
%158 = load i32, i32* %12
%159 = load i32, i32* %13
%160 = load i32, i32* %9
%161 = load i32*, i32** %10
%162 = load i32*, i32** %11
%163 = call i64 @point_in_polygon(i32 %158, i32 %159, i32 %160, i32* %161, i32* %162)
%164 = icmp ne i64 %163, 0
br i1 %164, label %165, label %166
165: ; preds = %157
store i32 1, i32* %8
br label %167
166: ; preds = %157
store i32 0, i32* %8
br label %167
167: ; preds = %166, %165, %156, %133
%168 = load i32, i32* %8
ret i32 %168
}

LLVM IR (-O2):
define i32 @collide_polygon_rectangle(i32 %0, i32* %1, i32* %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca [2 x [2 x i32]]
%9 = alloca [4 x [2 x [2 x i32]]]
%10 = icmp sgt i32 %0, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = bitcast [2 x [2 x i32]]* %8 to i8*
%14 = bitcast [4 x [2 x [2 x i32]]]* %9 to i8*
%15 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 0, i64 0, i64 0
store i32 %3, i32* %15
%16 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 0, i64 0, i64 1
store i32 %4, i32* %16
%17 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 0, i64 1, i64 0
%18 = add nsw i32 %5, %3
store i32 %18, i32* %17
%19 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 0, i64 1, i64 1
store i32 %4, i32* %19
%20 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 1, i64 0, i64 0
store i32 %18, i32* %20
%21 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 1, i64 0, i64 1
store i32 %4, i32* %21
%22 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 1, i64 1, i64 0
store i32 %18, i32* %22
%23 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 1, i64 1, i64 1
%24 = add nsw i32 %6, %4
store i32 %24, i32* %23
%25 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 2, i64 0, i64 0
store i32 %18, i32* %25
%26 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 2, i64 0, i64 1
store i32 %24, i32* %26
%27 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 2, i64 1, i64 0
store i32 %3, i32* %27
%28 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 2, i64 1, i64 1
store i32 %24, i32* %28
%29 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 3, i64 0, i64 0
store i32 %3, i32* %29
%30 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 3, i64 0, i64 1
store i32 %24, i32* %30
%31 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 3, i64 1, i64 0
store i32 %3, i32* %31
%32 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 3, i64 1, i64 1
store i32 %4, i32* %32
br i1 %10, label %33, label %75
33: ; preds = %7
%34 = add nsw i32 %0, -1
%35 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 0, i64 0
%36 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 0, i64 1
%37 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 1, i64 0
%38 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %8, i64 0, i64 1, i64 1
%39 = bitcast [2 x [2 x i32]]* %8 to i32**
%40 = zext i32 %0 to i64
%41 = bitcast [4 x [2 x [2 x i32]]]* %9 to i32**
%42 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 1, i64 0
%43 = bitcast [2 x i32]* %42 to i32**
%44 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 2, i64 0
%45 = bitcast [2 x i32]* %44 to i32**
%46 = getelementptr inbounds [4 x [2 x [2 x i32]]], [4 x [2 x [2 x i32]]]* %9, i64 0, i64 3, i64 0
%47 = bitcast [2 x i32]* %46 to i32**
br label %48
48: ; preds = %33, %71
%49 = phi i64 [ 0, %33 ], [ %72, %71 ]
%50 = phi i32 [ %34, %33 ], [ %73, %71 ]
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i32, i32* %1, i64 %51
%53 = load i32, i32* %52
store i32 %53, i32* %35
%54 = getelementptr inbounds i32, i32* %2, i64 %51
%55 = load i32, i32* %54
store i32 %55, i32* %36
%56 = getelementptr inbounds i32, i32* %1, i64 %49
%57 = load i32, i32* %56
store i32 %57, i32* %37
%58 = getelementptr inbounds i32, i32* %2, i64 %49
%59 = load i32, i32* %58
store i32 %59, i32* %38
%60 = call i64 @lines_intersect(i32** %39, i32** %41)
%61 = icmp eq i64 %60, 0
br i1 %61, label %62, label %84
62: ; preds = %48
%63 = call i64 @lines_intersect(i32** %39, i32** %43)
%64 = icmp eq i64 %63, 0
br i1 %64, label %65, label %84
65: ; preds = %62
%66 = call i64 @lines_intersect(i32** %39, i32** %45)
%67 = icmp eq i64 %66, 0
br i1 %67, label %68, label %84
68: ; preds = %65
%69 = call i64 @lines_intersect(i32** %39, i32** %47)
%70 = icmp eq i64 %69, 0
br i1 %70, label %71, label %84
71: ; preds = %68
%72 = add nuw nsw i64 %49, 1
%73 = trunc i64 %49 to i32
%74 = icmp eq i64 %72, %40
br i1 %74, label %75, label %48
75: ; preds = %71, %7
%76 = load i32, i32* %1
%77 = load i32, i32* %2
%78 = call i64 @point_in_rectangle(i32 %76, i32 %77, i32 %3, i32 %4, i32 %5, i32 %6)
%79 = icmp eq i64 %78, 0
br i1 %79, label %80, label %84
80: ; preds = %75
%81 = call i64 @point_in_polygon(i32 %3, i32 %4, i32 %0, i32* %1, i32* %2)
%82 = icmp ne i64 %81, 0
%83 = zext i1 %82 to i32
br label %84
84: ; preds = %48, %62, %65, %68, %80, %75
%85 = phi i32 [ 1, %75 ], [ %83, %80 ], [ 1, %68 ], [ 1, %65 ], [ 1, %62 ], [ 1, %48 ]
ret i32 %85
}