#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 short attr_t;

/* Variables and functions */
int attr_get(short *, short *, int /*<<< orphan*/ *);
int check_arg_count(int, int /*<<< orphan*/);
int /*<<< orphan*/ report_count(int);
int /*<<< orphan*/ report_int(short);
int /*<<< orphan*/ report_return(int);
void cmd_attr_get(int nargs, char **args) {
  attr_t attrs;
  short colours;
  int retval;
  if (check_arg_count(nargs, 0) == 1)
    return;
  retval = attr_get(&attrs, &colours, NULL);
  report_count(3);
  report_return(retval);
  report_int(attrs);
  report_int(colours);
}


x86 assembly (clang, -O0):
<cmd_attr_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
jne    1177 <cmd_attr_get+0x27>
jmp    11af <cmd_attr_get+0x5f>
lea    -0x12(%rbp),%rdi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <attr_get@plt>
mov    %eax,-0x18(%rbp)
mov    $0x3,%edi
call   1060 <report_count@plt>
mov    -0x18(%rbp),%edi
call   1030 <report_return@plt>
movswl -0x12(%rbp),%edi
call   1070 <report_int@plt>
movswl -0x14(%rbp),%edi
call   1070 <report_int@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_attr_get>:
push   %rbx
sub    $0x10,%rsp
xor    %esi,%esi
call   1050 <check_arg_count@plt>
cmp    $0x1,%eax
je     1199 <cmd_attr_get+0x49>
lea    0xe(%rsp),%rdi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
call   1040 <attr_get@plt>
mov    %eax,%ebx
mov    $0x3,%edi
call   1060 <report_count@plt>
mov    %ebx,%edi
call   1030 <report_return@plt>
movswl 0xe(%rsp),%edi
call   1070 <report_int@plt>
movswl 0xc(%rsp),%edi
call   1070 <report_int@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @cmd_attr_get(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i16
%6 = alloca i16
%7 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%8 = load i32, i32* %3
%9 = call i32 @check_arg_count(i32 %8, i32 0)
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %2
br label %21
12: ; preds = %2
%13 = call i32 @attr_get(i16* %5, i16* %6, i32* null)
store i32 %13, i32* %7
%14 = call i32 @report_count(i32 3)
%15 = load i32, i32* %7
%16 = call i32 @report_return(i32 %15)
%17 = load i16, i16* %5
%18 = call i32 @report_int(i16 signext %17)
%19 = load i16, i16* %6
%20 = call i32 @report_int(i16 signext %19)
br label %21
21: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @cmd_attr_get(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i16
%4 = alloca i16
%5 = bitcast i16* %3 to i8*
%6 = bitcast i16* %4 to i8*
%7 = tail call i32 @check_arg_count(i32 %0, i32 0)
%8 = icmp eq i32 %7, 1
br i1 %8, label %17, label %9
9: ; preds = %2
%10 = call i32 @attr_get(i16* %3, i16* %4, i32* null)
%11 = call i32 @report_count(i32 3)
%12 = call i32 @report_return(i32 %10)
%13 = load i16, i16* %3
%14 = call i32 @report_int(i16 signext %13)
%15 = load i16, i16* %4
%16 = call i32 @report_int(i16 signext %15)
br label %17
17: ; preds = %2, %9
ret void
}