#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 vision {
  int dummy;
};
struct grid {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vmark_safe(struct grid *, struct vision *, int, int, int,
                              int);
void vmark_xynb(struct grid *g, struct vision *v, int i, int j, int k,
                int kminus, int kplus, int value) {
  vmark_safe(g, v, i, j, k, value);
  int dk;
  for (dk = -kminus; dk <= kplus; ++dk) {
    vmark_safe(g, v, i, j, k + dk, value);
  }
}


x86 assembly (clang, -O0):
<vmark_xynb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    0x18(%rbp),%r9d
call   1030 <vmark_safe@plt>
xor    %eax,%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    0x10(%rbp),%eax
jg     1190 <vmark_xynb+0x80>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
add    -0x24(%rbp),%r8d
mov    0x18(%rbp),%r9d
call   1030 <vmark_safe@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <vmark_xynb+0x47>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmark_xynb>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r13d
mov    %r8d,%ebx
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%r12
mov    %rdi,%rbp
mov    0x48(%rsp),%r9d
call   1030 <vmark_safe@plt>
mov    %r13,%rcx
mov    %ecx,%eax
neg    %eax
mov    0x40(%rsp),%edx
cmp    %edx,%eax
jg     1182 <vmark_xynb+0x72>
mov    %rdx,%rax
lea    (%rdx,%rcx,1),%r13d
add    $0x1,%r13d
sub    %ecx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
mov    %r14d,%ecx
mov    %ebx,%r8d
mov    0x48(%rsp),%r9d
call   1030 <vmark_safe@plt>
add    $0x1,%ebx
add    $0xffffffff,%r13d
jne    1160 <vmark_xynb+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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