#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 raster {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setpixel(struct raster *, int, int, int, int, int);
void drawdot(struct raster *ra, int x, int y, int r, int g, int b) {
  setpixel(ra, x, y, r, g, b);
  setpixel(ra, x - 1, y, r, g, b);
  setpixel(ra, x + 1, y, r, g, b);
  setpixel(ra, x, y - 1, r, g, b);
  setpixel(ra, x, y + 1, r, g, b);
}


x86 assembly (clang, -O0):
<drawdot>:
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    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1030 <setpixel@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1030 <setpixel@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1030 <setpixel@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    $0x1,%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1030 <setpixel@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x1,%edx
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
call   1030 <setpixel@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawdot>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%ebp
mov    %esi,%r13d
mov    %rdi,%rbx
call   1030 <setpixel@plt>
lea    -0x1(%r13),%esi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <setpixel@plt>
lea    0x1(%r13),%esi
mov    %rbx,%rdi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <setpixel@plt>
lea    -0x1(%rbp),%edx
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
call   1030 <setpixel@plt>
add    $0x1,%ebp
mov    %rbx,%rdi
mov    %r13d,%esi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r15d,%r8d
mov    %r14d,%r9d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <setpixel@plt>

LLVM IR (-O0):
%struct.raster = type { i32 }
define void @drawdot(%struct.raster* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca %struct.raster*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store %struct.raster* %0, %struct.raster** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
%13 = load %struct.raster*, %struct.raster** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load i32, i32* %12
%19 = call i32 @setpixel(%struct.raster* %13, i32 %14, i32 %15, i32 %16, i32 %17, i32 %18)
%20 = load %struct.raster*, %struct.raster** %7
%21 = load i32, i32* %8
%22 = sub nsw i32 %21, 1
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = load i32, i32* %11
%26 = load i32, i32* %12
%27 = call i32 @setpixel(%struct.raster* %20, i32 %22, i32 %23, i32 %24, i32 %25, i32 %26)
%28 = load %struct.raster*, %struct.raster** %7
%29 = load i32, i32* %8
%30 = add nsw i32 %29, 1
%31 = load i32, i32* %9
%32 = load i32, i32* %10
%33 = load i32, i32* %11
%34 = load i32, i32* %12
%35 = call i32 @setpixel(%struct.raster* %28, i32 %30, i32 %31, i32 %32, i32 %33, i32 %34)
%36 = load %struct.raster*, %struct.raster** %7
%37 = load i32, i32* %8
%38 = load i32, i32* %9
%39 = sub nsw i32 %38, 1
%40 = load i32, i32* %10
%41 = load i32, i32* %11
%42 = load i32, i32* %12
%43 = call i32 @setpixel(%struct.raster* %36, i32 %37, i32 %39, i32 %40, i32 %41, i32 %42)
%44 = load %struct.raster*, %struct.raster** %7
%45 = load i32, i32* %8
%46 = load i32, i32* %9
%47 = add nsw i32 %46, 1
%48 = load i32, i32* %10
%49 = load i32, i32* %11
%50 = load i32, i32* %12
%51 = call i32 @setpixel(%struct.raster* %44, i32 %45, i32 %47, i32 %48, i32 %49, i32 %50)
ret void
}

LLVM IR (-O2):
%struct.raster = type { i32 }
define void @drawdot(%struct.raster* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = tail call i32 @setpixel(%struct.raster* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
%8 = add nsw i32 %1, -1
%9 = tail call i32 @setpixel(%struct.raster* %0, i32 %8, i32 %2, i32 %3, i32 %4, i32 %5)
%10 = add nsw i32 %1, 1
%11 = tail call i32 @setpixel(%struct.raster* %0, i32 %10, i32 %2, i32 %3, i32 %4, i32 %5)
%12 = add nsw i32 %2, -1
%13 = tail call i32 @setpixel(%struct.raster* %0, i32 %1, i32 %12, i32 %3, i32 %4, i32 %5)
%14 = add nsw i32 %2, 1
%15 = tail call i32 @setpixel(%struct.raster* %0, i32 %1, i32 %14, i32 %3, i32 %4, i32 %5)
ret void
}