#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 losango(int x, int y) {
  glBegin(GL_QUADS);
  glVertex2d(x - 2, y);
  glVertex2d(x, y + 2.75);
  glVertex2d(x + 2, y);
  glVertex2d(x, y - 2.75);
  glEnd();
}


x86 assembly (clang, -O0):
<losango>:
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
call   1040 <glVertex2d@plt>
mov    -0x4(%rbp),%edi
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe96(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
call   1040 <glVertex2d@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
call   1040 <glVertex2d@plt>
mov    -0x4(%rbp),%edi
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xe6b(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
call   1040 <glVertex2d@plt>
mov    $0x0,%al
call   1030 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<losango>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
lea    -0x2(%rbx),%edi
mov    %ebp,%esi
call   1040 <glVertex2d@plt>
cvtsi2sd %ebp,%xmm1
movsd  %xmm1,(%rsp)
movsd  0xea0(%rip),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%esi
mov    %ebx,%edi
call   1040 <glVertex2d@plt>
lea    0x2(%rbx),%edi
mov    %ebp,%esi
call   1040 <glVertex2d@plt>
movsd  (%rsp),%xmm0
addsd  0xe82(%rip),%xmm0
cvttsd2si %xmm0,%esi
mov    %ebx,%edi
call   1040 <glVertex2d@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_QUADS = global i32 0
define void @losango(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 = call i32 @glVertex2d(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = sitofp i32 %12 to double
%14 = fadd double %13, 2.750000e+00
%15 = fptosi double %14 to i32
%16 = call i32 @glVertex2d(i32 %11, i32 %15)
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 2
%19 = load i32, i32* %4
%20 = call i32 @glVertex2d(i32 %18, i32 %19)
%21 = load i32, i32* %3
%22 = load i32, i32* %4
%23 = sitofp i32 %22 to double
%24 = fsub double %23, 2.750000e+00
%25 = fptosi double %24 to i32
%26 = call i32 @glVertex2d(i32 %21, i32 %25)
%27 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_QUADS = global i32 0
define void @losango(i32 %0, i32 %1) {
%3 = load i32, i32* @GL_QUADS
%4 = tail call i32 @glBegin(i32 %3)
%5 = add nsw i32 %0, -2
%6 = tail call i32 @glVertex2d(i32 %5, i32 %1)
%7 = sitofp i32 %1 to double
%8 = fadd double %7, 2.750000e+00
%9 = fptosi double %8 to i32
%10 = tail call i32 @glVertex2d(i32 %0, i32 %9)
%11 = add nsw i32 %0, 2
%12 = tail call i32 @glVertex2d(i32 %11, i32 %1)
%13 = fadd double %7, -2.750000e+00
%14 = fptosi double %13 to i32
%15 = tail call i32 @glVertex2d(i32 %0, i32 %14)
%16 = tail call i32 (...) @glEnd()
ret void
}