#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_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int x;
  int y;
};
typedef TYPE_1__ XPoint;

/* Variables and functions */
void appendPoint(XPoint *points, int *pointi, int x, int y) {
  if (*pointi < 10000) {
    points[*pointi].x = x;
    points[*pointi].y = y;
    *pointi += 1;
  }
}


x86 assembly (clang, -O0):
<appendPoint>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x2710,(%rax)
jge    1150 <appendPoint+0x50>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,(%rax,%rcx,8)
mov    -0x18(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    %edx,0x4(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<appendPoint>:
movslq (%rsi),%rax
cmp    $0x270f,%rax
jg     1118 <appendPoint+0x18>
mov    %edx,(%rdi,%rax,8)
movslq (%rsi),%rax
mov    %ecx,0x4(%rdi,%rax,8)
addl   $0x1,(%rsi)
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
define void @appendPoint(%struct.TYPE_3__* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca %struct.TYPE_3__*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
%11 = icmp slt i32 %10, 10000
br i1 %11, label %12, label %30
12: ; preds = %4
%13 = load i32, i32* %7
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%15 = load i32*, i32** %6
%16 = load i32, i32* %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i64 %17
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %18, i32 0, i32 0
store i32 %13, i32* %19
%20 = load i32, i32* %8
%21 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%22 = load i32*, i32** %6
%23 = load i32, i32* %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %21, i64 %24
%26 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %25, i32 0, i32 1
store i32 %20, i32* %26
%27 = load i32*, i32** %6
%28 = load i32, i32* %27
%29 = add nsw i32 %28, 1
store i32 %29, i32* %27
br label %30
30: ; preds = %12, %4
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
define void @appendPoint(%struct.TYPE_3__* nocapture writeonly %0, i32* nocapture %1, i32 %2, i32 %3) {
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 10000
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = sext i32 %5 to i64
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 %8, i32 0
store i32 %2, i32* %9
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 %11, i32 1
store i32 %3, i32* %12
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %15
15: ; preds = %7, %4
ret void
}