// File: tomfunkhouser[P]gaps/apps/confview/confview.cpp
// Function: DrawRubberBox()
static void 
DrawRubberBox(void)
{
  // Set rendering modes
  glDrawBuffer(GL_FRONT);
  glDisable(GL_DEPTH_TEST);
  glDepthMask(0);
  glLineStipple(1, 0xFF00);
  glEnable(GL_LINE_STIPPLE);
  glLogicOp(GL_XOR);
  glEnable(GL_COLOR_LOGIC_OP);

  // Set projection matrix
  glMatrixMode(GL_PROJECTION);  
  glPushMatrix();
  glLoadIdentity();
  gluOrtho2D(0, GLUTwindow_width, 0, GLUTwindow_height);

  // Set model view matrix
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();
  glLoadIdentity();

  // Draw box
  RNGrfxBegin(RN_GRFX_LINE_LOOP);
  RNLoadRgb(1.0, 1.0, 1.0);
  R2LoadPoint(rubber_box_corners[0][0], rubber_box_corners[0][1]);
  R2LoadPoint(rubber_box_corners[0][0], rubber_box_corners[1][1]);
  R2LoadPoint(rubber_box_corners[1][0], rubber_box_corners[1][1]);
  R2LoadPoint(rubber_box_corners[1][0], rubber_box_corners[0][1]);
  RNGrfxEnd();

  // Reset projection matrix
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();

  // Reset model view matrix
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();

  // Reset rendering modes
  glDisable(GL_COLOR_LOGIC_OP);
  glDisable(GL_LINE_STIPPLE);
  glEnable(GL_DEPTH_TEST);
  glDepthMask(1);
  glDrawBuffer(GL_BACK);
  glFlush();
}

// Assembly:
subq $0x28, %rsp
movl $0x404, %edi            # imm = 0x404
callq 0x24f70
movl $0xb71, %edi            # imm = 0xB71
callq 0x24230
xorl %edi, %edi
callq 0x245a0
movl $0x1, %edi
movl $0xff00, %esi           # imm = 0xFF00
callq 0x24c70
movl $0xb24, %edi            # imm = 0xB24
callq 0x24930
movl $0x1506, %edi           # imm = 0x1506
callq 0x25520
movl $0xbf2, %edi            # imm = 0xBF2
callq 0x24930
movl $0x1701, %edi           # imm = 0x1701
callq 0x24e80
callq 0x25140
callq 0x24e00
cvtsi2sdl 0x20b484(%rip), %xmm1 # 0x235adc
cvtsi2sdl 0x20b480(%rip), %xmm3 # 0x235ae0
xorps %xmm2, %xmm2
movaps %xmm2, %xmm0
callq 0x24610
movl $0x1700, %edi           # imm = 0x1700
callq 0x24e80
callq 0x25140
callq 0x24e00
movl $0x2, %edi
callq 0x2f110
movsd 0x19c97f(%rip), %xmm2   # 0x1c7010
movaps %xmm2, %xmm0
movaps %xmm2, %xmm1
callq 0x2f260
leaq 0x2115ed(%rip), %rdi    # 0x23bc90
xorl %esi, %esi
callq 0x2f2c0
movsd (%rax), %xmm0
movsd %xmm0, 0x8(%rsp)
leaq 0x2115d5(%rip), %rdi    # 0x23bc90
movl $0x1, %esi
callq 0x2f2c0
movsd 0x8(%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x2f290
leaq 0x2115b5(%rip), %rdi    # 0x23bc90
xorl %esi, %esi
callq 0x2f2c0
movsd (%rax), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0x21159d(%rip), %rdi    # 0x23bc90
addq $0x10, %rdi
movl $0x1, %esi
callq 0x2f2c0
movsd 0x10(%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x2f290
leaq 0x211579(%rip), %rdi    # 0x23bc90
addq $0x10, %rdi
xorl %esi, %esi
callq 0x2f2c0
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x21155d(%rip), %rdi    # 0x23bc90
addq $0x10, %rdi
movl $0x1, %esi
callq 0x2f2c0
movsd 0x18(%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x2f290
leaq 0x211539(%rip), %rdi    # 0x23bc90
addq $0x10, %rdi
xorl %esi, %esi
callq 0x2f2c0
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
leaq 0x21151d(%rip), %rdi    # 0x23bc90
movl $0x1, %esi
callq 0x2f2c0
movsd 0x20(%rsp), %xmm0
movsd (%rax), %xmm1
callq 0x2f290
callq 0x2f190
movl $0x1701, %edi           # imm = 0x1701
callq 0x24e80
callq 0x253c0
movl $0x1700, %edi           # imm = 0x1700
callq 0x24e80
callq 0x253c0
movl $0xbf2, %edi            # imm = 0xBF2
callq 0x24230
movl $0xb24, %edi            # imm = 0xB24
callq 0x24230
movl $0xb71, %edi            # imm = 0xB71
callq 0x24930
movl $0x1, %edi
callq 0x245a0
movl $0x405, %edi            # imm = 0x405
callq 0x24f70
callq 0x24f80
addq $0x28, %rsp
retq
nopl (%rax,%rax)