#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*/ coordinatesAreInsideBoard(int, int);
int /*<<< orphan*/ sb_printStringAndWriteToBuffer(char const *, int, int);
scalar_t__ stringOverRightEdge(char const *, int);
void printStringOnBoardXY(char const s[], int x, int y) {
  if (!coordinatesAreInsideBoard(x, y)) {
    return;
  }
  if (stringOverRightEdge(s, x)) {
    return;
  } else {
    sb_printStringAndWriteToBuffer(s, x, y);
  }
}


x86 assembly (clang, -O0):
<printStringOnBoardXY>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <coordinatesAreInsideBoard@plt>
cmp    $0x0,%eax
jne    115b <printStringOnBoardXY+0x2b>
jmp    1185 <printStringOnBoardXY+0x55>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <stringOverRightEdge@plt>
cmp    $0x0,%rax
je     1176 <printStringOnBoardXY+0x46>
jmp    1185 <printStringOnBoardXY+0x55>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <sb_printStringAndWriteToBuffer@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStringOnBoardXY>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%edi
mov    %edx,%esi
call   1050 <coordinatesAreInsideBoard@plt>
test   %eax,%eax
je     1157 <printStringOnBoardXY+0x27>
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <stringOverRightEdge@plt>
test   %rax,%rax
je     115c <printStringOnBoardXY+0x2c>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <sb_printStringAndWriteToBuffer@plt>

LLVM IR (-O0):
define void @printStringOnBoardXY(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i32 @coordinatesAreInsideBoard(i32 %7, i32 %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %3
br label %23
12: ; preds = %3
%13 = load i8*, i8** %4
%14 = load i32, i32* %5
%15 = call i64 @stringOverRightEdge(i8* %13, i32 %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %12
br label %23
18: ; preds = %12
%19 = load i8*, i8** %4
%20 = load i32, i32* %5
%21 = load i32, i32* %6
%22 = call i32 @sb_printStringAndWriteToBuffer(i8* %19, i32 %20, i32 %21)
br label %23
23: ; preds = %11, %17, %18
ret void
}

LLVM IR (-O2):
define void @printStringOnBoardXY(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @coordinatesAreInsideBoard(i32 %1, i32 %2)
%5 = icmp eq i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i64 @stringOverRightEdge(i8* %0, i32 %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @sb_printStringAndWriteToBuffer(i8* %0, i32 %1, i32 %2)
br label %11
11: ; preds = %6, %3, %9
ret void
}