#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*/ attrset(int);
int /*<<< orphan*/ mvaddch(int, int, char);
int /*<<< orphan*/ mvaddstr(int, int, char *);
int strlen(char *);
void output_key(int y, int x, char *key, int key_style, char *s, int s_style) {
  int keylen = strlen(key);
  attrset(key_style);
  mvaddstr(y, x + 1, key);
  attrset(s_style);
  mvaddch(y, x, '[');
  mvaddch(y, x + keylen + 1, ']');
  mvaddstr(y, x + keylen + 3, s);
}


x86 assembly (clang, -O0):
<output_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <attrset@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%rdx
call   1060 <mvaddstr@plt>
mov    -0x24(%rbp),%edi
call   1040 <attrset@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x5b,%edx
call   1050 <mvaddch@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x28(%rbp),%esi
add    $0x1,%esi
mov    $0x5d,%edx
call   1050 <mvaddch@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    -0x28(%rbp),%esi
add    $0x3,%esi
mov    -0x20(%rbp),%rdx
call   1060 <mvaddstr@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_key>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9d,%r12d
mov    %r8,(%rsp)
mov    %ecx,%r13d
mov    %rdx,%r14
mov    %esi,%ebx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r13d,%edi
call   1040 <attrset@plt>
lea    0x1(%rbx),%esi
mov    %ebp,%edi
mov    %r14,%rdx
call   1060 <mvaddstr@plt>
mov    %r12d,%edi
call   1040 <attrset@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    $0x5b,%edx
call   1050 <mvaddch@plt>
lea    (%r15,%rbx,1),%esi
add    $0x1,%esi
mov    %ebp,%edi
mov    $0x5d,%edx
call   1050 <mvaddch@plt>
lea    (%r15,%rbx,1),%esi
add    $0x3,%esi
mov    %ebp,%edi
mov    (%rsp),%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <mvaddstr@plt>

LLVM IR (-O0):
define void @output_key(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
store i32 %0, i32* %7
store i32 %1, i32* %8
store i8* %2, i8** %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%14 = load i8*, i8** %9
%15 = call i32 @strlen(i8* %14)
store i32 %15, i32* %13
%16 = load i32, i32* %10
%17 = call i32 @attrset(i32 %16)
%18 = load i32, i32* %7
%19 = load i32, i32* %8
%20 = add nsw i32 %19, 1
%21 = load i8*, i8** %9
%22 = call i32 @mvaddstr(i32 %18, i32 %20, i8* %21)
%23 = load i32, i32* %12
%24 = call i32 @attrset(i32 %23)
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = call i32 @mvaddch(i32 %25, i32 %26, i8 signext 91)
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = load i32, i32* %13
%31 = add nsw i32 %29, %30
%32 = add nsw i32 %31, 1
%33 = call i32 @mvaddch(i32 %28, i32 %32, i8 signext 93)
%34 = load i32, i32* %7
%35 = load i32, i32* %8
%36 = load i32, i32* %13
%37 = add nsw i32 %35, %36
%38 = add nsw i32 %37, 3
%39 = load i8*, i8** %11
%40 = call i32 @mvaddstr(i32 %34, i32 %38, i8* %39)
ret void
}

LLVM IR (-O2):
define void @output_key(i32 %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5) {
%7 = tail call i32 @strlen(i8* %2)
%8 = tail call i32 @attrset(i32 %3)
%9 = add nsw i32 %1, 1
%10 = tail call i32 @mvaddstr(i32 %0, i32 %9, i8* %2)
%11 = tail call i32 @attrset(i32 %5)
%12 = tail call i32 @mvaddch(i32 %0, i32 %1, i8 signext 91)
%13 = add nsw i32 %7, %1
%14 = add nsw i32 %13, 1
%15 = tail call i32 @mvaddch(i32 %0, i32 %14, i8 signext 93)
%16 = add nsw i32 %13, 3
%17 = tail call i32 @mvaddstr(i32 %0, i32 %16, i8* %4)
ret void
}