#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 */
typedef int /*<<< orphan*/ Window;
typedef int /*<<< orphan*/ GC;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XDrawLine(int /*<<< orphan*/ *, int /*<<< orphan*/,
                             int /*<<< orphan*/, int /*<<< orphan*/,
                             int /*<<< orphan*/, int, int);
int /*<<< orphan*/ XDrawPoint(int /*<<< orphan*/ *, int /*<<< orphan*/,
                              int /*<<< orphan*/, int, int);
int /*<<< orphan*/ XFlush(int /*<<< orphan*/ *);
int /*<<< orphan*/ XSetForeground(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                  int);
void dessine(Display *dpy, Window w, GC gc, int col) {
  XSetForeground(dpy, gc, col);
  XDrawLine(dpy, w, gc, 0, 0, 200, 200);
  XDrawPoint(dpy, w, gc, 10, 50);
  XDrawPoint(dpy, w, gc, 10, 51);
  XFlush(dpy);
}


x86 assembly (clang, -O0):
<dessine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1040 <XSetForeground@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
xor    %r8d,%r8d
mov    $0xc8,%r9d
mov    %r8d,%ecx
movl   $0xc8,(%rsp)
call   1060 <XDrawLine@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0xa,%ecx
mov    $0x32,%r8d
call   1030 <XDrawPoint@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0xa,%ecx
mov    $0x33,%r8d
call   1030 <XDrawPoint@plt>
mov    -0x8(%rbp),%rdi
call   1050 <XFlush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dessine>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %edx,%esi
mov    %ecx,%edx
call   1040 <XSetForeground@plt>
movl   $0xc8,(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    $0xc8,%r9d
call   1060 <XDrawLine@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x32,%r8d
call   1030 <XDrawPoint@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    $0xa,%ecx
mov    $0x33,%r8d
call   1030 <XDrawPoint@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <XFlush@plt>

LLVM IR (-O0):
define void @dessine(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %7
%11 = load i32, i32* %8
%12 = call i32 @XSetForeground(i32* %9, i32 %10, i32 %11)
%13 = load i32*, i32** %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = call i32 @XDrawLine(i32* %13, i32 %14, i32 %15, i32 0, i32 0, i32 200, i32 200)
%17 = load i32*, i32** %5
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call i32 @XDrawPoint(i32* %17, i32 %18, i32 %19, i32 10, i32 50)
%21 = load i32*, i32** %5
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = call i32 @XDrawPoint(i32* %21, i32 %22, i32 %23, i32 10, i32 51)
%25 = load i32*, i32** %5
%26 = call i32 @XFlush(i32* %25)
ret void
}

LLVM IR (-O2):
define void @dessine(i32* %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @XSetForeground(i32* %0, i32 %2, i32 %3)
%6 = tail call i32 @XDrawLine(i32* %0, i32 %1, i32 %2, i32 0, i32 0, i32 200, i32 200)
%7 = tail call i32 @XDrawPoint(i32* %0, i32 %1, i32 %2, i32 10, i32 50)
%8 = tail call i32 @XDrawPoint(i32* %0, i32 %1, i32 %2, i32 10, i32 51)
%9 = tail call i32 @XFlush(i32* %0)
ret void
}