#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*/ uint32_t;
typedef int /*<<< orphan*/ uint16_t;
struct fgui_rect {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fgui_set_pixel(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/);
scalar_t__ is_in_rect(int /*<<< orphan*/, int /*<<< orphan*/,
                      struct fgui_rect *);
void fgui_draw_point(uint16_t x, uint16_t y, uint32_t color,
                     struct fgui_rect *clip) {
  if (clip == NULL || is_in_rect(x, y, clip)) {
    fgui_set_pixel(x, y, color);
  }
}


x86 assembly (clang, -O0):
<fgui_draw_point>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1159 <fgui_draw_point+0x39>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <is_in_rect@plt>
cmp    $0x0,%rax
je     1167 <fgui_draw_point+0x47>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1040 <fgui_set_pixel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgui_draw_point>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
test   %rcx,%rcx
je     1141 <fgui_draw_point+0x21>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %rcx,%rdx
call   1030 <is_in_rect@plt>
test   %rax,%rax
je     1151 <fgui_draw_point+0x31>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <fgui_set_pixel@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.fgui_rect = type { i32 }
define void @fgui_draw_point(i32 %0, i32 %1, i32 %2, %struct.fgui_rect* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.fgui_rect*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.fgui_rect* %3, %struct.fgui_rect** %8
%9 = load %struct.fgui_rect*, %struct.fgui_rect** %8
%10 = icmp eq %struct.fgui_rect* %9, null
br i1 %10, label %17, label %11
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load %struct.fgui_rect*, %struct.fgui_rect** %8
%15 = call i64 @is_in_rect(i32 %12, i32 %13, %struct.fgui_rect* %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %11, %4
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 @fgui_set_pixel(i32 %18, i32 %19, i32 %20)
br label %22
22: ; preds = %17, %11
ret void
}

LLVM IR (-O2):
%struct.fgui_rect = type { i32 }
define void @fgui_draw_point(i32 %0, i32 %1, i32 %2, %struct.fgui_rect* %3) {
%5 = icmp eq %struct.fgui_rect* %3, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i64 @is_in_rect(i32 %0, i32 %1, %struct.fgui_rect* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6, %4
%10 = tail call i32 @fgui_set_pixel(i32 %0, i32 %1, i32 %2)
br label %11
11: ; preds = %9, %6
ret void
}