#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int _begx;
  int _maxx;
  int _begy;
  int _maxy;
};
typedef TYPE_1__ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ systemlog(int, char *);
int insidedialogwin(WINDOW *win, int y, int x) {
  int inside = 0;
  systemlog(3, "insidedialogwin?");
  if (x > win->_begx && x < win->_begx + win->_maxx && y > win->_begy &&
      y < win->_begy + win->_maxy)
    inside = 1;
  return inside;
}


x86 assembly (clang, -O0):
<insidedialogwin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    $0x3,%edi
lea    0xecb(%rip),%rsi
call   1030 <systemlog@plt>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jle    1191 <insidedialogwin+0x81>
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%ecx
mov    -0x8(%rbp),%rdx
add    0x4(%rdx),%ecx
cmp    %ecx,%eax
jge    1191 <insidedialogwin+0x81>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%eax
jle    1191 <insidedialogwin+0x81>
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
mov    -0x8(%rbp),%rdx
add    0xc(%rdx),%ecx
cmp    %ecx,%eax
jge    1191 <insidedialogwin+0x81>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<insidedialogwin>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebp
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xedd(%rip),%rsi
mov    $0x3,%edi
call   1030 <systemlog@plt>
mov    (%rbx),%ecx
xor    %eax,%eax
cmp    %ebp,%ecx
jge    114f <insidedialogwin+0x3f>
add    0x4(%rbx),%ecx
cmp    %ebp,%ecx
jle    114f <insidedialogwin+0x3f>
mov    0x8(%rbx),%ecx
cmp    %r14d,%ecx
jge    114f <insidedialogwin+0x3f>
add    0xc(%rbx),%ecx
xor    %eax,%eax
cmp    %r14d,%ecx
setg   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
@.str = [17 x i8] c"insidedialogwin?\00"
define i32 @insidedialogwin(%struct.TYPE_3__* %0, i32 %1, i32 %2) {
%4 = alloca %struct.TYPE_3__*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = call i32 @systemlog(i32 3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %6
%10 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%11 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %10, i32 0, i32 0
%12 = load i32, i32* %11
%13 = icmp sgt i32 %9, %12
br i1 %13, label %14, label %41
14: ; preds = %3
%15 = load i32, i32* %6
%16 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%17 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %16, i32 0, i32 0
%18 = load i32, i32* %17
%19 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%20 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %19, i32 0, i32 1
%21 = load i32, i32* %20
%22 = add nsw i32 %18, %21
%23 = icmp slt i32 %15, %22
br i1 %23, label %24, label %41
24: ; preds = %14
%25 = load i32, i32* %5
%26 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%27 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %26, i32 0, i32 2
%28 = load i32, i32* %27
%29 = icmp sgt i32 %25, %28
br i1 %29, label %30, label %41
30: ; preds = %24
%31 = load i32, i32* %5
%32 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%33 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %32, i32 0, i32 2
%34 = load i32, i32* %33
%35 = load %struct.TYPE_3__*, %struct.TYPE_3__** %4
%36 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %35, i32 0, i32 3
%37 = load i32, i32* %36
%38 = add nsw i32 %34, %37
%39 = icmp slt i32 %31, %38
br i1 %39, label %40, label %41
40: ; preds = %30
store i32 1, i32* %7
br label %41
41: ; preds = %40, %30, %24, %14, %3
%42 = load i32, i32* %7
ret i32 %42
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32, i32, i32, i32 }
@.str = [17 x i8] c"insidedialogwin?\00"
define i32 @insidedialogwin(%struct.TYPE_3__* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 @systemlog(i32 3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, %2
br i1 %7, label %8, label %23
8: ; preds = %3
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%10 = load i32, i32* %9
%11 = add nsw i32 %10, %6
%12 = icmp sgt i32 %11, %2
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 2
%15 = load i32, i32* %14
%16 = icmp slt i32 %15, %1
br i1 %16, label %17, label %23
17: ; preds = %13
%18 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 3
%19 = load i32, i32* %18
%20 = add nsw i32 %19, %15
%21 = icmp sgt i32 %20, %1
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %17, %13, %8, %3
%24 = phi i32 [ 0, %13 ], [ 0, %8 ], [ 0, %3 ], [ %22, %17 ]
ret i32 %24
}