#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 */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int LINES;
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
int /*<<< orphan*/ attron(int /*<<< orphan*/);
int /*<<< orphan*/ mvaddstr(int, int /*<<< orphan*/, char *);
int scroll_line();
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, int);
void drawmodeline(char *filename, char *mode) {
  int r = LINES - 1;
  char buf[8192];
  attron(COLOR_PAIR(1));
  snprintf(buf, sizeof(buf), "[F: %-32.32s][M: %-24s][L: %8d]", filename, mode,
           scroll_line());
  mvaddstr(r, 0, buf);
  attroff(COLOR_PAIR(1));
}


x86 assembly (clang, -O0):
<drawmodeline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2040,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
sub    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
lea    -0x2020(%rbp),%rax
mov    %rax,-0x2038(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x2030(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x2028(%rbp)
mov    $0x0,%al
call   1070 <scroll_line@plt>
mov    -0x2038(%rbp),%rdi
mov    -0x2030(%rbp),%rcx
mov    -0x2028(%rbp),%r8
mov    %eax,%r9d
mov    $0x2000,%esi
lea    0xe1e(%rip),%rdx
call   1040 <snprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x2020(%rbp),%rdx
xor    %esi,%esi
call   1080 <mvaddstr@plt>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x2040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawmodeline>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x2008,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
mov    0x2e6d(%rip),%rax
mov    (%rax),%ebx
add    $0xffffffff,%ebx
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1050 <attron@plt>
xor    %eax,%eax
call   1070 <scroll_line@plt>
lea    0xe61(%rip),%rdx
mov    %rsp,%r12
mov    %r12,%rdi
mov    $0x2000,%esi
mov    %r15,%rcx
mov    %r14,%r8
mov    %eax,%r9d
call   1040 <snprintf@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    %r12,%rdx
call   1080 <mvaddstr@plt>
mov    $0x1,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x2008,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@LINES = global i32 0
@.str = [32 x i8] c"[F: %-32.32s][M: %-24s][L: %8d]\00"
define void @drawmodeline(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca [8192 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i32, i32* @LINES
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
%9 = call i32 @COLOR_PAIR(i32 1)
%10 = call i32 @attron(i32 %9)
%11 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = call i32 (...) @scroll_line()
%15 = call i32 @snprintf(i8* %11, i32 8192, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13, i32 %14)
%16 = load i32, i32* %5
%17 = getelementptr inbounds [8192 x i8], [8192 x i8]* %6, i64 0, i64 0
%18 = call i32 @mvaddstr(i32 %16, i32 0, i8* %17)
%19 = call i32 @COLOR_PAIR(i32 1)
%20 = call i32 @attroff(i32 %19)
ret void
}

LLVM IR (-O2):
@LINES = global i32 0
@.str = [32 x i8] c"[F: %-32.32s][M: %-24s][L: %8d]\00"
define void @drawmodeline(i8* %0, i8* %1) {
%3 = alloca [8192 x i8]
%4 = load i32, i32* @LINES
%5 = add nsw i32 %4, -1
%6 = getelementptr inbounds [8192 x i8], [8192 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @COLOR_PAIR(i32 1)
%8 = tail call i32 @attron(i32 %7)
%9 = tail call i32 (...) @scroll_line()
%10 = call i32 @snprintf(i8* %6, i32 8192, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i32 %9)
%11 = call i32 @mvaddstr(i32 %5, i32 0, i8* %6)
%12 = call i32 @COLOR_PAIR(i32 1)
%13 = call i32 @attroff(i32 %12)
ret void
}