#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*/ memset(char *, int /*<<< orphan*/, int);
int send_command_expect_ok(int /*<<< orphan*/, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int netplot_enable_status_messages(int enabled) {
  char buffer[256];
  memset(buffer, 0, 256);
  if (enabled) {
    strncpy(buffer, "enable_status 1\n", 256);
  } else {
    strncpy(buffer, "enable_status 0\n", 256);
  }
  return send_command_expect_ok(0, buffer);
}


x86 assembly (clang, -O0):
<netplot_enable_status_messages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
cmpl   $0x0,-0x4(%rbp)
je     1178 <netplot_enable_status_messages+0x48>
lea    -0x110(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
jmp    1190 <netplot_enable_status_messages+0x60>
lea    -0x110(%rbp),%rdi
lea    0xe8b(%rip),%rsi
mov    $0x100,%edx
call   1030 <strncpy@plt>
lea    -0x110(%rbp),%rsi
xor    %edi,%edi
call   1050 <send_command_expect_ok@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<netplot_enable_status_messages>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %edi,%ebx
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1040 <memset@plt>
test   %ebx,%ebx
lea    0xeba(%rip),%rax
lea    0xea2(%rip),%rsi
cmove  %rax,%rsi
mov    %r14,%rdi
mov    $0x100,%edx
call   1030 <strncpy@plt>
xor    %edi,%edi
mov    %r14,%rsi
call   1050 <send_command_expect_ok@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"enable_status 1\0A\00"
@.str.1 = [17 x i8] c"enable_status 0\0A\00"
define i32 @netplot_enable_status_messages(i32 %0) {
%2 = alloca i32
%3 = alloca [256 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @memset(i8* %4, i32 0, i32 256)
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%10 = call i32 @strncpy(i8* %9, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 256)
br label %14
11: ; preds = %1
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%13 = call i32 @strncpy(i8* %12, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 256)
br label %14
14: ; preds = %11, %8
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%16 = call i32 @send_command_expect_ok(i32 0, i8* %15)
ret i32 %16
}

LLVM IR (-O2):
@.str = [17 x i8] c"enable_status 1\0A\00"
@.str.1 = [17 x i8] c"enable_status 0\0A\00"
define i32 @netplot_enable_status_messages(i32 %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%4 = call i32 @memset(i8* %3, i32 0, i32 256)
%5 = icmp eq i32 %0, 0
%6 = select i1 %5, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0)
%7 = call i32 @strncpy(i8* %3, i8* %6, i32 256)
%8 = call i32 @send_command_expect_ok(i32 0, i8* %3)
ret i32 %8
}