#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*/ glTexCoord2f(int, int);
int /*<<< orphan*/ glVertex2f(float, float);
void draw_quad(float x1, float y1, float x2, float y2) {
  glBegin(GL_QUADS);
  glTexCoord2f(0, 0);
  glVertex2f(x1, y1);
  glTexCoord2f(1, 0);
  glVertex2f(x2, y1);
  glTexCoord2f(1, 1);
  glVertex2f(x2, y2);
  glTexCoord2f(0, 1);
  glVertex2f(x1, y2);
  glEnd();
}


x86 assembly (clang, -O0):
<draw_quad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1050 <glTexCoord2f@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <glVertex2f@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <glTexCoord2f@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <glVertex2f@plt>
mov    $0x1,%esi
mov    %esi,%edi
call   1050 <glTexCoord2f@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1040 <glVertex2f@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <glTexCoord2f@plt>
movss  -0x4(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
call   1040 <glVertex2f@plt>
mov    $0x0,%al
call   1030 <glEnd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_quad>:
sub    $0x18,%rsp
movss  %xmm3,0x14(%rsp)
movss  %xmm2,0xc(%rsp)
movss  %xmm1,0x8(%rsp)
movss  %xmm0,0x10(%rsp)
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1060 <glBegin@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1050 <glTexCoord2f@plt>
movss  0x10(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1040 <glVertex2f@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <glTexCoord2f@plt>
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
call   1040 <glVertex2f@plt>
mov    $0x1,%edi
mov    $0x1,%esi
call   1050 <glTexCoord2f@plt>
movss  0xc(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
call   1040 <glVertex2f@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1050 <glTexCoord2f@plt>
movss  0x10(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
call   1040 <glVertex2f@plt>
xor    %eax,%eax
add    $0x18,%rsp
jmp    1030 <glEnd@plt>

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

LLVM IR (-O2):
@GL_QUADS = global i32 0
define void @draw_quad(float %0, float %1, float %2, float %3) {
%5 = load i32, i32* @GL_QUADS
%6 = tail call i32 @glBegin(i32 %5)
%7 = tail call i32 @glTexCoord2f(i32 0, i32 0)
%8 = tail call i32 @glVertex2f(float %0, float %1)
%9 = tail call i32 @glTexCoord2f(i32 1, i32 0)
%10 = tail call i32 @glVertex2f(float %2, float %1)
%11 = tail call i32 @glTexCoord2f(i32 1, i32 1)
%12 = tail call i32 @glVertex2f(float %2, float %3)
%13 = tail call i32 @glTexCoord2f(i32 0, i32 1)
%14 = tail call i32 @glVertex2f(float %0, float %3)
%15 = tail call i32 (...) @glEnd()
ret void
}