#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 */

/* Variables and functions */
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ mvaddch(int, int, char);
void printDeadEnds(int startX, int startY, int xIncrement, int yIncrement,
                   int randNum) {
  move((startY), (startX));
  for (int i = 0; i < randNum; i++) {
    startY = startY + yIncrement;
    startX = startX + xIncrement;
    mvaddch((startY), (startX), '#');
  }
}


x86 assembly (clang, -O0):
<printDeadEnds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   1040 <move@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1186 <printDeadEnds+0x66>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    $0x23,%edx
call   1030 <mvaddch@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114a <printDeadEnds+0x2a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDeadEnds>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r12d
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %esi,%edi
mov    %ebx,%esi
call   1040 <move@plt>
test   %r12d,%r12d
jle    116a <printDeadEnds+0x4a>
add    %r15d,%ebx
add    %r14d,%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x23,%edx
call   1030 <mvaddch@plt>
add    %r15d,%ebx
add    %r14d,%ebp
add    $0xffffffff,%r12d
jne    1150 <printDeadEnds+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @printDeadEnds(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = call i32 @move(i32 %12, i32 %13)
store i32 0, i32* %11
br label %15
15: ; preds = %29, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %10
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %32
19: ; preds = %15
%20 = load i32, i32* %7
%21 = load i32, i32* %9
%22 = add nsw i32 %20, %21
store i32 %22, i32* %7
%23 = load i32, i32* %6
%24 = load i32, i32* %8
%25 = add nsw i32 %23, %24
store i32 %25, i32* %6
%26 = load i32, i32* %7
%27 = load i32, i32* %6
%28 = call i32 @mvaddch(i32 %26, i32 %27, i8 signext 35)
br label %29
29: ; preds = %19
%30 = load i32, i32* %11
%31 = add nsw i32 %30, 1
store i32 %31, i32* %11
br label %15
32: ; preds = %15
ret void
}

LLVM IR (-O2):
define void @printDeadEnds(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @move(i32 %1, i32 %0)
%7 = icmp sgt i32 %4, 0
br i1 %7, label %9, label %8
8: ; preds = %9, %5
ret void
9: ; preds = %5, %9
%10 = phi i32 [ %16, %9 ], [ 0, %5 ]
%11 = phi i32 [ %14, %9 ], [ %0, %5 ]
%12 = phi i32 [ %13, %9 ], [ %1, %5 ]
%13 = add nsw i32 %12, %3
%14 = add nsw i32 %11, %2
%15 = tail call i32 @mvaddch(i32 %13, i32 %14, i8 signext 35)
%16 = add nuw nsw i32 %10, 1
%17 = icmp eq i32 %16, %4
br i1 %17, label %8, label %9
}