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

/* Variables and functions */
int /*<<< orphan*/ maze_build_one_cell_wall(struct maze *, int, int, int, int,
                                            int, int, int, int);
void maze_build_cell_walls(struct maze *mp, int prevrow, int prevcol,
                           int currow, int curcol, int nextrow, int nextcol) {
  maze_build_one_cell_wall(mp, currow - 1, curcol, prevrow, prevcol, currow,
                           curcol, nextrow, nextcol);
  maze_build_one_cell_wall(mp, currow + 1, curcol, prevrow, prevcol, currow,
                           curcol, nextrow, nextcol);
  maze_build_one_cell_wall(mp, currow, curcol - 1, prevrow, prevcol, currow,
                           curcol, nextrow, nextcol);
  maze_build_one_cell_wall(mp, currow, curcol + 1, prevrow, prevcol, currow,
                           curcol, nextrow, nextcol);
}


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

x86 assembly (clang, -O2):
<maze_build_cell_walls>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r14d
mov    %r8d,%r15d
mov    %ecx,%ebx
mov    %edx,%r12d
mov    %esi,%r13d
mov    %rdi,%rbp
mov    0x40(%rsp),%eax
lea    -0x1(%rbx),%esi
sub    $0x8,%rsp
mov    %r8d,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %ebx,%r9d
push   %rax
push   %r14
push   %r15
call   1030 <maze_build_one_cell_wall@plt>
add    $0x20,%rsp
lea    0x1(%rbx),%esi
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %r15d,%edx
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %ebx,%r9d
mov    0x48(%rsp),%eax
push   %rax
push   %r14
push   %r15
call   1030 <maze_build_one_cell_wall@plt>
add    $0x20,%rsp
lea    -0x1(%r15),%edx
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %ebx,%r9d
mov    0x48(%rsp),%eax
push   %rax
push   %r14
push   %r15
call   1030 <maze_build_one_cell_wall@plt>
add    $0x20,%rsp
lea    0x1(%r15),%edx
sub    $0x8,%rsp
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r13d,%ecx
mov    %r12d,%r8d
mov    %ebx,%r9d
mov    0x48(%rsp),%eax
push   %rax
push   %r14
push   %r15
call   1030 <maze_build_one_cell_wall@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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