#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_BLEND;
int /*<<< orphan*/ GL_FILL;
int /*<<< orphan*/ GL_FRONT_AND_BACK;
int /*<<< orphan*/ GL_LINE;
int /*<<< orphan*/ glDisable(int /*<<< orphan*/);
int /*<<< orphan*/ glEnable(int /*<<< orphan*/);
int /*<<< orphan*/ glPolygonMode(int /*<<< orphan*/, int /*<<< orphan*/);
void wire(void) {
  static int w;
  if (w ^= 1) {
    glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
    glEnable(GL_BLEND);
  } else {
    glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
    glDisable(GL_BLEND);
  }
}


x86 assembly (clang, -O0):
<wire>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f02(%rip),%eax
xor    $0x1,%eax
mov    %eax,0x2ef9(%rip)
cmp    $0x0,%eax
je     1176 <wire+0x46>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
mov    0x2e7c(%rip),%rax
mov    (%rax),%esi
call   1040 <glPolygonMode@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1030 <glEnable@plt>
jmp    119b <wire+0x6b>
mov    0x2e63(%rip),%rax
mov    (%rax),%edi
mov    0x2e42(%rip),%rax
mov    (%rax),%esi
call   1040 <glPolygonMode@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1050 <glDisable@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<wire>:
push   %rax
xorl   $0x1,0x2f04(%rip)
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
je     1160 <wire+0x30>
mov    0x2e8e(%rip),%rax
mov    (%rax),%esi
call   1040 <glPolygonMode@plt>
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1030 <glEnable@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
call   1040 <glPolygonMode@plt>
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1050 <glDisable@plt>

LLVM IR (-O0):
@wire.w = internal global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
@GL_BLEND = global i32 0
@GL_FILL = global i32 0
define void @wire() {
%1 = load i32, i32* @wire.w
%2 = xor i32 %1, 1
store i32 %2, i32* @wire.w
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %10
4: ; preds = %0
%5 = load i32, i32* @GL_FRONT_AND_BACK
%6 = load i32, i32* @GL_LINE
%7 = call i32 @glPolygonMode(i32 %5, i32 %6)
%8 = load i32, i32* @GL_BLEND
%9 = call i32 @glEnable(i32 %8)
br label %16
10: ; preds = %0
%11 = load i32, i32* @GL_FRONT_AND_BACK
%12 = load i32, i32* @GL_FILL
%13 = call i32 @glPolygonMode(i32 %11, i32 %12)
%14 = load i32, i32* @GL_BLEND
%15 = call i32 @glDisable(i32 %14)
br label %16
16: ; preds = %10, %4
ret void
}

LLVM IR (-O2):
@wire.w = internal unnamed_addr global i32 0
@GL_FRONT_AND_BACK = global i32 0
@GL_LINE = global i32 0
@GL_BLEND = global i32 0
@GL_FILL = global i32 0
define void @wire() {
%1 = load i32, i32* @wire.w
%2 = xor i32 %1, 1
store i32 %2, i32* @wire.w
%3 = icmp eq i32 %2, 0
%4 = load i32, i32* @GL_FRONT_AND_BACK
br i1 %3, label %10, label %5
5: ; preds = %0
%6 = load i32, i32* @GL_LINE
%7 = tail call i32 @glPolygonMode(i32 %4, i32 %6)
%8 = load i32, i32* @GL_BLEND
%9 = tail call i32 @glEnable(i32 %8)
br label %15
10: ; preds = %0
%11 = load i32, i32* @GL_FILL
%12 = tail call i32 @glPolygonMode(i32 %4, i32 %11)
%13 = load i32, i32* @GL_BLEND
%14 = tail call i32 @glDisable(i32 %13)
br label %15
15: ; preds = %10, %5
ret void
}