#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 */
struct window {
  int dummy;
};

/* Variables and functions */
struct window *AddWindow(char const *, int, int, struct window *);
int /*<<< orphan*/ EventLoop();
int /*<<< orphan*/ InitGLstuff(struct window *);
char *XDisplayName(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  const char *dpyName = XDisplayName(NULL);
  struct window *h0;
  h0 = AddWindow(dpyName, 10, 10, NULL);
  (void)AddWindow(dpyName, 330, 10, h0);
  (void)AddWindow(dpyName, 10, 350, h0);
  (void)AddWindow(dpyName, 330, 350, h0);
  InitGLstuff(h0);
  EventLoop();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <XDisplayName@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    $0xa,%edx
xor    %eax,%eax
mov    %eax,%ecx
mov    %edx,%esi
call   1030 <AddWindow@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x14a,%esi
mov    $0xa,%edx
call   1030 <AddWindow@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0xa,%esi
mov    $0x15e,%edx
call   1030 <AddWindow@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x14a,%esi
mov    $0x15e,%edx
call   1030 <AddWindow@plt>
mov    -0x20(%rbp),%rdi
call   1050 <InitGLstuff@plt>
mov    $0x0,%al
call   1060 <EventLoop@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %edi,%edi
call   1040 <XDisplayName@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    $0xa,%esi
mov    $0xa,%edx
xor    %ecx,%ecx
call   1030 <AddWindow@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    $0x14a,%esi
mov    $0xa,%edx
mov    %rax,%rcx
call   1030 <AddWindow@plt>
mov    %r14,%rdi
mov    $0xa,%esi
mov    $0x15e,%edx
mov    %rbx,%rcx
call   1030 <AddWindow@plt>
mov    %r14,%rdi
mov    $0x14a,%esi
mov    $0x15e,%edx
mov    %rbx,%rcx
call   1030 <AddWindow@plt>
mov    %rbx,%rdi
call   1050 <InitGLstuff@plt>
xor    %eax,%eax
call   1060 <EventLoop@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.window = type { i32 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca %struct.window*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i8* @XDisplayName(i32* null)
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call %struct.window* @AddWindow(i8* %9, i32 10, i32 10, %struct.window* null)
store %struct.window* %10, %struct.window** %7
%11 = load i8*, i8** %6
%12 = load %struct.window*, %struct.window** %7
%13 = call %struct.window* @AddWindow(i8* %11, i32 330, i32 10, %struct.window* %12)
%14 = load i8*, i8** %6
%15 = load %struct.window*, %struct.window** %7
%16 = call %struct.window* @AddWindow(i8* %14, i32 10, i32 350, %struct.window* %15)
%17 = load i8*, i8** %6
%18 = load %struct.window*, %struct.window** %7
%19 = call %struct.window* @AddWindow(i8* %17, i32 330, i32 350, %struct.window* %18)
%20 = load %struct.window*, %struct.window** %7
%21 = call i32 @InitGLstuff(%struct.window* %20)
%22 = call i32 (...) @EventLoop()
ret i32 0
}

LLVM IR (-O2):
%struct.window = type { i32 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i8* @XDisplayName(i32* null)
%4 = tail call %struct.window* @AddWindow(i8* %3, i32 10, i32 10, %struct.window* null)
%5 = tail call %struct.window* @AddWindow(i8* %3, i32 330, i32 10, %struct.window* %4)
%6 = tail call %struct.window* @AddWindow(i8* %3, i32 10, i32 350, %struct.window* %4)
%7 = tail call %struct.window* @AddWindow(i8* %3, i32 330, i32 350, %struct.window* %4)
%8 = tail call i32 @InitGLstuff(%struct.window* %4)
%9 = tail call i32 (...) @EventLoop()
ret i32 0
}