#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 */
scalar_t__ chk_flg_resize_map();
long get_screen_row();
scalar_t__ get_screen_size_message();
scalar_t__ get_stat_bar_row();
long get_map_row(void) {
  if (chk_flg_resize_map()) {
    long n;
    n = get_screen_row();
    n -= 1;
    n -= get_screen_size_message();
    n -= get_stat_bar_row();
    return n;
  } else {
    return (20);
  }
  return 1;
}


x86 assembly (clang, -O0):
<get_map_row>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <chk_flg_resize_map@plt>
cmp    $0x0,%rax
je     11a7 <get_map_row+0x67>
mov    $0x0,%al
call   1030 <get_screen_row@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <get_screen_size_message@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <get_stat_bar_row@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11af <get_map_row+0x6f>
movq   $0x14,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_map_row>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <chk_flg_resize_map@plt>
test   %rax,%rax
je     1176 <get_map_row+0x36>
xor    %eax,%eax
call   1030 <get_screen_row@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <get_screen_size_message@plt>
mov    %rax,%rbx
not    %rbx
add    %r14,%rbx
xor    %eax,%eax
call   1060 <get_stat_bar_row@plt>
sub    %rax,%rbx
jmp    117b <get_map_row+0x3b>
mov    $0x14,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @get_map_row() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @chk_flg_resize_map()
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %0
%6 = call i64 (...) @get_screen_row()
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = sub nsw i64 %7, 1
store i64 %8, i64* %2
%9 = call i64 (...) @get_screen_size_message()
%10 = load i64, i64* %2
%11 = sub nsw i64 %10, %9
store i64 %11, i64* %2
%12 = call i64 (...) @get_stat_bar_row()
%13 = load i64, i64* %2
%14 = sub nsw i64 %13, %12
store i64 %14, i64* %2
%15 = load i64, i64* %2
store i64 %15, i64* %1
br label %17
16: ; preds = %0
store i64 20, i64* %1
br label %17
17: ; preds = %16, %5
%18 = load i64, i64* %1
ret i64 %18
}

LLVM IR (-O2):
define i64 @get_map_row() {
%1 = tail call i64 (...) @chk_flg_resize_map()
%2 = icmp eq i64 %1, 0
br i1 %2, label %10, label %3
3: ; preds = %0
%4 = tail call i64 (...) @get_screen_row()
%5 = tail call i64 (...) @get_screen_size_message()
%6 = xor i64 %5, -1
%7 = add i64 %4, %6
%8 = tail call i64 (...) @get_stat_bar_row()
%9 = sub i64 %7, %8
br label %10
10: ; preds = %0, %3
%11 = phi i64 [ %9, %3 ], [ 20, %0 ]
ret i64 %11
}