// File: dannycalegari[P]circle_pack/./graphics.cc
// Function: setup_graphics()
void setup_graphics(void){

  display=XOpenDisplay(NULL);
  display_width = DisplayWidth(display, screen_num);
  display_height = DisplayHeight(display, screen_num);
  
  screen_num = DefaultScreen(display);
//  screen_ptr = DefaultScreenOfDisplay(display);
  
  width = 600;
  height = 600;
  
  win = XCreateSimpleWindow(display, RootWindow(display, screen_num),
			    0, 0, width, height, border_width, 
			    BlackPixel(display, screen_num),
			    WhitePixel(display, screen_num));
 
  XSelectInput(display, win, ExposureMask | KeyPressMask);
  
  		//	| ButtonPressMask | StructureNotifyMask ); 


//  gc = XCreateGC(display, RootWindow(display, screen_num), 0, NULL);
  gc = DefaultGC(display, screen_num);
  XSetForeground(display, gc, BlackPixel(display, screen_num));
  XSetBackground(display, gc, WhitePixel(display, screen_num));
  
  XMapWindow(display, win);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
xorl %eax, %eax
movl %eax, %edi
callq 0x22a0
movq %rax, 0x10168(%rip)     # 0x18240
movq 0x10161(%rip), %rax     # 0x18240
movq 0xe8(%rax), %rax
movslq 0x1015b(%rip), %rcx     # 0x18248
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %eax
movl %eax, 0x1014f(%rip)     # 0x1824c
movq 0x1013c(%rip), %rax     # 0x18240
movq 0xe8(%rax), %rax
movslq 0x10136(%rip), %rcx     # 0x18248
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %eax
movl %eax, 0x1012e(%rip)     # 0x18250
movq 0x10117(%rip), %rax     # 0x18240
movl 0xe0(%rax), %eax
movl %eax, 0x10113(%rip)     # 0x18248
movl $0x258, 0x101e9(%rip)   # imm = 0x258
movl $0x258, 0x101e3(%rip)   # imm = 0x258
movq 0x100f0(%rip), %rdi     # 0x18240
movq 0x100e9(%rip), %rax     # 0x18240
movq 0xe8(%rax), %rax
movslq 0x100e3(%rip), %rcx     # 0x18248
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rsi
movl 0x101b1(%rip), %r8d     # 0x18328
movl 0x101ae(%rip), %r9d     # 0x1832c
movl 0x1009b(%rip), %r11d    # 0x18220
movq 0x100b4(%rip), %rax     # 0x18240
movq 0xe8(%rax), %rax
movslq 0x100ae(%rip), %rcx     # 0x18248
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %r10
movq 0x10094(%rip), %rax     # 0x18240
movq 0xe8(%rax), %rax
movslq 0x1008e(%rip), %rcx     # 0x18248
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x58(%rax), %rax
xorl %ecx, %ecx
movl %ecx, %edx
movl %r11d, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
callq 0x20a0
movq %rax, 0x1013d(%rip)     # 0x18320
movq 0x10056(%rip), %rdi     # 0x18240
movq 0x1012f(%rip), %rsi     # 0x18320
movl $0x8001, %edx           # imm = 0x8001
callq 0x2120
movq 0x1003e(%rip), %rax     # 0x18240
movq 0xe8(%rax), %rax
movslq 0x10038(%rip), %rcx     # 0x18248
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x48(%rax), %rax
movq %rax, 0x100f6(%rip)     # 0x18318
movq 0x10017(%rip), %rdi     # 0x18240
movq 0x100e8(%rip), %rsi     # 0x18318
movq 0x10009(%rip), %rax     # 0x18240
movq 0xe8(%rax), %rax
movslq 0x10003(%rip), %rcx     # 0x18248
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x60(%rax), %rdx
callq 0x20b0
movq 0xffe4(%rip), %rdi      # 0x18240
movq 0x100b5(%rip), %rsi     # 0x18318
movq 0xffd6(%rip), %rax      # 0x18240
movq 0xe8(%rax), %rax
movslq 0xffd0(%rip), %rcx      # 0x18248
shlq $0x7, %rcx
addq %rcx, %rax
movq 0x58(%rax), %rdx
callq 0x2270
movq 0xffb1(%rip), %rdi      # 0x18240
movq 0x1008a(%rip), %rsi     # 0x18320
callq 0x2220
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)