#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int foreground;
  int /*<<< orphan*/ function;
};
typedef TYPE_1__ XGCValues;
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ GC;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int GCForeground;
int GCFunction;
int /*<<< orphan*/ GXxor;
int /*<<< orphan*/ XCreateGC(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                             TYPE_1__ *);
GC create_xor_gc(Display *dpy, Window win) {
  XGCValues xgcv;
  GC gc;
  xgcv.function = GXxor;
  xgcv.foreground = 0xffffff;
  gc = XCreateGC(dpy, win, GCFunction | GCForeground, &xgcv);
  return gc;
}


x86 assembly (clang, -O0):
<create_xor_gc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0xffffff,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    0x2e98(%rip),%rax
mov    (%rax),%edx
mov    0x2e9f(%rip),%rax
or     (%rax),%edx
lea    -0x18(%rbp),%rcx
call   1030 <XCreateGC@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_xor_gc>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x4(%rsp)
movl   $0xffffff,(%rsp)
mov    0x2eac(%rip),%rax
mov    0x2eb5(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    %rsp,%rcx
call   1030 <XCreateGC@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32 }
@GXxor = global i32 0
@GCFunction = global i32 0
@GCForeground = global i32 0
define i32 @create_xor_gc(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca %struct.TYPE_3__
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%7 = load i32, i32* @GXxor
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 1
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
store i32 16777215, i32* %9
%10 = load i32*, i32** %3
%11 = load i32, i32* %4
%12 = load i32, i32* @GCFunction
%13 = load i32, i32* @GCForeground
%14 = or i32 %12, %13
%15 = call i32 @XCreateGC(i32* %10, i32 %11, i32 %14, %struct.TYPE_3__* %5)
store i32 %15, i32* %6
%16 = load i32, i32* %6
ret i32 %16
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32 }
@GXxor = global i32 0
@GCFunction = global i32 0
@GCForeground = global i32 0
define i32 @create_xor_gc(i32* %0, i32 %1) {
%3 = alloca %struct.TYPE_3__
%4 = bitcast %struct.TYPE_3__* %3 to i8*
%5 = load i32, i32* @GXxor
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 1
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %3, i64 0, i32 0
store i32 16777215, i32* %7
%8 = load i32, i32* @GCFunction
%9 = load i32, i32* @GCForeground
%10 = or i32 %9, %8
%11 = call i32 @XCreateGC(i32* %0, i32 %1, i32 %10, %struct.TYPE_3__* %3)
ret i32 %11
}