#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*/ GL_QUADS;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2d(int, int);
void cubo(int x, int y) {
  glBegin(GL_QUADS);
  glVertex2d(x - 2, y - 2);
  glVertex2d(x - 2, y + 2);
  glVertex2d(x + 2, y + 2);
  glVertex2d(x + 2, y - 2);
  glEnd();
}


x86 assembly (clang, -O0):
<cubo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x8(%rbp),%esi
sub    $0x2,%esi
call   1040 <glVertex2d@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
call   1040 <glVertex2d@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
call   1040 <glVertex2d@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
sub    $0x2,%esi
call   1040 <glVertex2d@plt>
mov    $0x0,%al
call   1030 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cubo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%r14d
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
lea    -0x2(%r14),%ebp
lea    -0x2(%rbx),%r15d
mov    %ebp,%edi
mov    %r15d,%esi
call   1040 <glVertex2d@plt>
add    $0x2,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
call   1040 <glVertex2d@plt>
add    $0x2,%r14d
mov    %r14d,%edi
mov    %ebx,%esi
call   1040 <glVertex2d@plt>
mov    %r14d,%edi
mov    %r15d,%esi
call   1040 <glVertex2d@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_QUADS = global i32 0
define void @cubo(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @GL_QUADS
%6 = call i32 @glBegin(i32 %5)
%7 = load i32, i32* %3
%8 = sub nsw i32 %7, 2
%9 = load i32, i32* %4
%10 = sub nsw i32 %9, 2
%11 = call i32 @glVertex2d(i32 %8, i32 %10)
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 2
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 2
%16 = call i32 @glVertex2d(i32 %13, i32 %15)
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 2
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 2
%21 = call i32 @glVertex2d(i32 %18, i32 %20)
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 2
%24 = load i32, i32* %4
%25 = sub nsw i32 %24, 2
%26 = call i32 @glVertex2d(i32 %23, i32 %25)
%27 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_QUADS = global i32 0
define void @cubo(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_QUADS
%4 = tail call i32 @glBegin(i32 %3)
%5 = add nsw i32 %0, -2
%6 = add nsw i32 %1, -2
%7 = tail call i32 @glVertex2d(i32 %5, i32 %6)
%8 = add nsw i32 %1, 2
%9 = tail call i32 @glVertex2d(i32 %5, i32 %8)
%10 = add nsw i32 %0, 2
%11 = tail call i32 @glVertex2d(i32 %10, i32 %8)
%12 = tail call i32 @glVertex2d(i32 %10, i32 %6)
%13 = tail call i32 (...) @glEnd()
ret void
}