#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*/ glLoadIdentity();
int /*<<< orphan*/ glPopMatrix();
int /*<<< orphan*/ glPushMatrix();
int /*<<< orphan*/ glRotatef(float, double, double, double);
int /*<<< orphan*/ glTranslatef(float, float, int /*<<< orphan*/);
void drawRobot(void (*robot)(), float x, float y, float theta) {
  glPushMatrix();
  glLoadIdentity();
  glTranslatef(x, y, 0);
  glRotatef(-theta, 0.0, 0.0, 1.0);
  robot();
  glPopMatrix();
}


x86 assembly (clang, -O0):
<drawRobot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    $0x0,%al
call   1050 <glPushMatrix@plt>
mov    $0x0,%al
call   1040 <glLoadIdentity@plt>
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
xor    %edi,%edi
call   1060 <glTranslatef@plt>
movss  -0x14(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
xorps  %xmm2,%xmm2
movsd  0xe59(%rip),%xmm3
movaps %xmm2,%xmm1
call   1070 <glRotatef@plt>
mov    $0x0,%al
call   *-0x8(%rbp)
mov    $0x0,%al
call   1030 <glPopMatrix@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawRobot>:
push   %rbx
sub    $0x20,%rsp
movaps %xmm2,0x10(%rsp)
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <glPushMatrix@plt>
xor    %eax,%eax
call   1040 <glLoadIdentity@plt>
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
xor    %edi,%edi
call   1060 <glTranslatef@plt>
movaps 0x10(%rsp),%xmm0
xorps  0xe6a(%rip),%xmm0
movsd  0xe72(%rip),%xmm3
xorps  %xmm1,%xmm1
xorps  %xmm2,%xmm2
call   1070 <glRotatef@plt>
xor    %eax,%eax
call   *%rbx
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1030 <glPopMatrix@plt>

LLVM IR (-O0):
define void @drawRobot(void (...)* %0, float %1, float %2, float %3) {
%5 = alloca void (...)*
%6 = alloca float
%7 = alloca float
%8 = alloca float
store void (...)* %0, void (...)** %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = call i32 (...) @glPushMatrix()
%10 = call i32 (...) @glLoadIdentity()
%11 = load float, float* %6
%12 = load float, float* %7
%13 = call i32 @glTranslatef(float %11, float %12, i32 0)
%14 = load float, float* %8
%15 = fneg float %14
%16 = call i32 @glRotatef(float %15, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
%17 = load void (...)*, void (...)** %5
%18 = call i32 (...) @glPopMatrix()
ret void
}

LLVM IR (-O2):
define void @drawRobot(void (...)* nocapture %0, float %1, float %2, float %3) {
%5 = tail call i32 (...) @glPushMatrix()
%6 = tail call i32 (...) @glLoadIdentity()
%7 = tail call i32 @glTranslatef(float %1, float %2, i32 0)
%8 = fneg float %3
%9 = tail call i32 @glRotatef(float %8, double 0.000000e+00, double 0.000000e+00, double 1.000000e+00)
tail call void (...) %0()
%10 = tail call i32 (...) @glPopMatrix()
ret void
}