#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 drawmark(struct raster *ra, int x, int y) {
  int j;
  for (j = 0; j < 5; j++) {
    setpixel(ra, x - j, y, 255, 255, 255);
    setpixel(ra, x + j, y, 255, 255, 255);
    setpixel(ra, x, y - j, 255, 255, 255);
    setpixel(ra, x, y + j, 255, 255, 255);
  }
}


x86 assembly (clang, -O0):
<drawmark>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x5,-0x14(%rbp)
jge    11b9 <drawmark+0xa9>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0xff,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <setpixel@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0xff,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <setpixel@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
sub    -0x14(%rbp),%edx
mov    $0xff,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <setpixel@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
add    -0x14(%rbp),%edx
mov    $0xff,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <setpixel@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <drawmark+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawmark>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%r12
xor    %ebp,%ebp
mov    %esi,%r13d
mov    %edx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r15,%rbp,1),%esi
mov    %r12,%rdi
mov    %r14d,%edx
mov    $0xff,%ecx
mov    $0xff,%r8d
mov    $0xff,%r9d
call   1030 <setpixel@plt>
mov    %r12,%rdi
mov    %r13d,%esi
mov    %r14d,%edx
mov    $0xff,%ecx
mov    $0xff,%r8d
mov    $0xff,%r9d
call   1030 <setpixel@plt>
lea    (%r14,%rbp,1),%edx
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0xff,%ecx
mov    $0xff,%r8d
mov    $0xff,%r9d
call   1030 <setpixel@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    %ebx,%edx
mov    $0xff,%ecx
mov    $0xff,%r8d
mov    $0xff,%r9d
call   1030 <setpixel@plt>
add    $0xffffffff,%ebp
add    $0x1,%ebx
add    $0x1,%r13d
cmp    $0xfffffffb,%ebp
jne    1130 <drawmark+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.raster = type { i32 }
define void @drawmark(%struct.raster* %0, i32 %1, i32 %2) {
%4 = alloca %struct.raster*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.raster* %0, %struct.raster** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %36, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %39
11: ; preds = %8
%12 = load %struct.raster*, %struct.raster** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %7
%15 = sub nsw i32 %13, %14
%16 = load i32, i32* %6
%17 = call i32 @setpixel(%struct.raster* %12, i32 %15, i32 %16, i32 255, i32 255, i32 255)
%18 = load %struct.raster*, %struct.raster** %4
%19 = load i32, i32* %5
%20 = load i32, i32* %7
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %6
%23 = call i32 @setpixel(%struct.raster* %18, i32 %21, i32 %22, i32 255, i32 255, i32 255)
%24 = load %struct.raster*, %struct.raster** %4
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = load i32, i32* %7
%28 = sub nsw i32 %26, %27
%29 = call i32 @setpixel(%struct.raster* %24, i32 %25, i32 %28, i32 255, i32 255, i32 255)
%30 = load %struct.raster*, %struct.raster** %4
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = load i32, i32* %7
%34 = add nsw i32 %32, %33
%35 = call i32 @setpixel(%struct.raster* %30, i32 %31, i32 %34, i32 255, i32 255, i32 255)
br label %36
36: ; preds = %11
%37 = load i32, i32* %7
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
br label %8
39: ; preds = %8
ret void
}

LLVM IR (-O2):
%struct.raster = type { i32 }
define void @drawmark(%struct.raster* %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %3, %4
%5 = phi i32 [ 0, %3 ], [ %14, %4 ]
%6 = sub nsw i32 %1, %5
%7 = tail call i32 @setpixel(%struct.raster* %0, i32 %6, i32 %2, i32 255, i32 255, i32 255)
%8 = add nsw i32 %5, %1
%9 = tail call i32 @setpixel(%struct.raster* %0, i32 %8, i32 %2, i32 255, i32 255, i32 255)
%10 = sub nsw i32 %2, %5
%11 = tail call i32 @setpixel(%struct.raster* %0, i32 %1, i32 %10, i32 255, i32 255, i32 255)
%12 = add nsw i32 %5, %2
%13 = tail call i32 @setpixel(%struct.raster* %0, i32 %1, i32 %12, i32 255, i32 255, i32 255)
%14 = add nuw nsw i32 %5, 1
%15 = icmp eq i32 %14, 5
br i1 %15, label %16, label %4
16: ; preds = %4
ret void
}