#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*/ fprintf(int /*<<< orphan*/, char *, int, int, int, int);
int get_monitor_dims_of_focused_screen(int, int *, int *, int *, int *);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  int lx;
  int rx;
  int ty;
  int by;
  int ret = get_monitor_dims_of_focused_screen(1, &lx, &rx, &ty, &by);
  if (ret == 0) {
    fprintf(stdout, "%d %d %d %d\n", lx, ty, rx - lx, by - ty);
  } else {
    return ret;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1040 <get_monitor_dims_of_focused_screen@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    118d <main+0x6d>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8d
sub    -0x14(%rbp),%r8d
mov    -0x20(%rbp),%r9d
sub    -0x1c(%rbp),%r9d
lea    0xe7d(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1198 <main+0x78>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119f <main+0x7f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %rsp,%r8
mov    $0x1,%edi
call   1040 <get_monitor_dims_of_focused_screen@plt>
mov    %eax,%ebx
test   %eax,%eax
jne    1173 <main+0x53>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
mov    0xc(%rsp),%edx
mov    0x4(%rsp),%ecx
mov    0x8(%rsp),%r8d
sub    %edx,%r8d
mov    (%rsp),%r9d
sub    %ecx,%r9d
lea    0xe92(%rip),%rsi
call   1030 <fprintf@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 @get_monitor_dims_of_focused_screen(i32 1, i32* %6, i32* %7, i32* %8, i32* %9)
store i32 %11, i32* %10
%12 = load i32, i32* %10
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %25
14: ; preds = %2
%15 = load i32, i32* @stdout
%16 = load i32, i32* %6
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = sub nsw i32 %18, %19
%21 = load i32, i32* %9
%22 = load i32, i32* %8
%23 = sub nsw i32 %21, %22
%24 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17, i32 %20, i32 %23)
br label %27
25: ; preds = %2
%26 = load i32, i32* %10
store i32 %26, i32* %3
br label %28
27: ; preds = %14
store i32 0, i32* %3
br label %28
28: ; preds = %27, %25
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [13 x i8] c"%d %d %d %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = call i32 @get_monitor_dims_of_focused_screen(i32 1, i32* %3, i32* %4, i32* %5, i32* %6)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %22
13: ; preds = %2
%14 = load i32, i32* @stdout
%15 = load i32, i32* %3
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = sub nsw i32 %17, %15
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, %16
%21 = call i32 @fprintf(i32 %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %18, i32 %20)
br label %22
22: ; preds = %2, %13
ret i32 %11
}