#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 get_max_cols();
int get_max_lines();
int outbounds(int y, int x, int nbombs) {
  return y < 0 || get_max_lines() < y || x < 0 || get_max_cols() < x ||
         y * x < nbombs;
}


x86 assembly (clang, -O0):
<outbounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jl     118d <outbounds+0x6d>
mov    $0x0,%al
call   1030 <get_max_lines@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    -0x4(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     118d <outbounds+0x6d>
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jl     118d <outbounds+0x6d>
mov    $0x0,%al
call   1040 <get_max_cols@plt>
mov    %eax,%ecx
mov    $0x1,%al
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jl     118d <outbounds+0x6d>
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outbounds>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r15d
test   %edi,%edi
js     115f <outbounds+0x3f>
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <get_max_lines@plt>
test   %ebp,%ebp
js     115f <outbounds+0x3f>
cmp    %ebx,%eax
jl     115f <outbounds+0x3f>
xor    %eax,%eax
call   1040 <get_max_cols@plt>
cmp    %ebp,%eax
jl     115f <outbounds+0x3f>
imul   %ebx,%ebp
xor    %r15d,%r15d
cmp    %r14d,%ebp
setl   %r15b
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @outbounds(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %26, label %9
9: ; preds = %3
%10 = call i32 (...) @get_max_lines()
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %26, label %13
13: ; preds = %9
%14 = load i32, i32* %5
%15 = icmp slt i32 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %13
%17 = call i32 (...) @get_max_cols()
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %26, label %20
20: ; preds = %16
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %6
%25 = icmp slt i32 %23, %24
br label %26
26: ; preds = %20, %16, %13, %9, %3
%27 = phi i1 [ true, %16 ], [ true, %13 ], [ true, %9 ], [ true, %3 ], [ %25, %20 ]
%28 = zext i1 %27 to i32
ret i32 %28
}

LLVM IR (-O2):
define i32 @outbounds(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, 0
br i1 %4, label %17, label %5
5: ; preds = %3
%6 = tail call i32 (...) @get_max_lines()
%7 = icmp slt i32 %6, %0
%8 = icmp slt i32 %1, 0
%9 = or i1 %8, %7
br i1 %9, label %17, label %10
10: ; preds = %5
%11 = tail call i32 (...) @get_max_cols()
%12 = icmp slt i32 %11, %1
br i1 %12, label %17, label %13
13: ; preds = %10
%14 = mul nsw i32 %1, %0
%15 = icmp slt i32 %14, %2
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %13, %10, %5, %3
%18 = phi i32 [ 1, %10 ], [ 1, %5 ], [ 1, %3 ], [ %16, %13 ]
ret i32 %18
}