#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_POLYGON;
int /*<<< orphan*/ glBegin(int /*<<< orphan*/);
int /*<<< orphan*/ glEnd();
int /*<<< orphan*/ glVertex2f(double, double);
void quad(double x, double y) {
  glBegin(GL_POLYGON);
  glVertex2f(x + 0, y + 0);
  ;
  glVertex2f(x + 1, y + 0);
  ;
  glVertex2f(x + 1, y + 1);
  ;
  glVertex2f(x + 0, y + 1);
  ;
  glEnd();
}


x86 assembly (clang, -O0):
<quad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
xorps  %xmm0,%xmm0
addsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
addsd  -0x10(%rbp),%xmm1
call   1040 <glVertex2f@plt>
movsd  0xe93(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
addsd  -0x10(%rbp),%xmm1
call   1040 <glVertex2f@plt>
movsd  0xe79(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xe6c(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
call   1040 <glVertex2f@plt>
xorps  %xmm0,%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xe52(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
call   1040 <glVertex2f@plt>
mov    $0x0,%al
call   1030 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<quad>:
sub    $0x28,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1050 <glBegin@plt>
xorpd  %xmm1,%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
addsd  0x10(%rsp),%xmm1
movsd  %xmm1,0x18(%rsp)
call   1040 <glVertex2f@plt>
movsd  0x8(%rsp),%xmm0
addsd  0xe7f(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm1
call   1040 <glVertex2f@plt>
movsd  0x10(%rsp),%xmm1
addsd  0xe60(%rip),%xmm1
movsd  %xmm1,0x10(%rsp)
movsd  0x8(%rsp),%xmm0
call   1040 <glVertex2f@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
call   1040 <glVertex2f@plt>
xor    %eax,%eax
add    $0x28,%rsp
jmp    1030 <glEnd@plt>

LLVM IR (-O0):
@GL_POLYGON = global i32 0
define void @quad(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load i32, i32* @GL_POLYGON
%6 = call i32 @glBegin(i32 %5)
%7 = load double, double* %3
%8 = fadd double %7, 0.000000e+00
%9 = load double, double* %4
%10 = fadd double %9, 0.000000e+00
%11 = call i32 @glVertex2f(double %8, double %10)
%12 = load double, double* %3
%13 = fadd double %12, 1.000000e+00
%14 = load double, double* %4
%15 = fadd double %14, 0.000000e+00
%16 = call i32 @glVertex2f(double %13, double %15)
%17 = load double, double* %3
%18 = fadd double %17, 1.000000e+00
%19 = load double, double* %4
%20 = fadd double %19, 1.000000e+00
%21 = call i32 @glVertex2f(double %18, double %20)
%22 = load double, double* %3
%23 = fadd double %22, 0.000000e+00
%24 = load double, double* %4
%25 = fadd double %24, 1.000000e+00
%26 = call i32 @glVertex2f(double %23, double %25)
%27 = call i32 (...) @glEnd()
ret void
}

LLVM IR (-O2):
@GL_POLYGON = global i32 0
define void @quad(double %0, double %1) {
%3 = load i32, i32* @GL_POLYGON
%4 = tail call i32 @glBegin(i32 %3)
%5 = fadd double %0, 0.000000e+00
%6 = fadd double %1, 0.000000e+00
%7 = tail call i32 @glVertex2f(double %5, double %6)
%8 = fadd double %0, 1.000000e+00
%9 = tail call i32 @glVertex2f(double %8, double %6)
%10 = fadd double %1, 1.000000e+00
%11 = tail call i32 @glVertex2f(double %8, double %10)
%12 = tail call i32 @glVertex2f(double %5, double %10)
%13 = tail call i32 (...) @glEnd()
ret void
}