#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*/ TIPC_CMD_GET_MAX_PUBL;
int /*<<< orphan*/ TIPC_CMD_SET_MAX_PUBL;
int do_get_unsigned(int /*<<< orphan*/);
int /*<<< orphan*/ do_set_unsigned(char *, int /*<<< orphan*/, char *, char *);
char *for_dest();
int /*<<< orphan*/ printf(char *, char *, int);
void set_max_publ(char *args) {
  if (!*args)
    printf("maximum allowed publications%s: %u\n", for_dest(),
           do_get_unsigned(TIPC_CMD_GET_MAX_PUBL));
  else
    do_set_unsigned(args, TIPC_CMD_SET_MAX_PUBL, "max publications", "");
}


x86 assembly (clang, -O0):
<set_max_publ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1189 <set_max_publ+0x49>
mov    $0x0,%al
call   1040 <for_dest@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1060 <do_get_unsigned@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
jmp    11a9 <set_max_publ+0x69>
mov    -0x8(%rbp),%rdi
mov    0x2e4c(%rip),%rax
mov    (%rax),%esi
lea    0xe87(%rip),%rdx
lea    0xe7f(%rip),%rcx
call   1050 <do_set_unsigned@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_max_publ>:
push   %rbx
cmpb   $0x0,(%rdi)
je     1163 <set_max_publ+0x23>
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
lea    0xece(%rip),%rdx
lea    0xec6(%rip),%rcx
pop    %rbx
jmp    1050 <do_set_unsigned@plt>
xor    %eax,%eax
call   1040 <for_dest@plt>
mov    %rax,%rbx
mov    0x2e74(%rip),%rax
mov    (%rax),%edi
call   1060 <do_get_unsigned@plt>
lea    0xe7e(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"maximum allowed publications%s: %u\0A\00"
@TIPC_CMD_GET_MAX_PUBL = global i32 0
@TIPC_CMD_SET_MAX_PUBL = global i32 0
@.str.1 = [17 x i8] c"max publications\00"
@.str.2 = [1 x i8] zeroinitializer
define void @set_max_publ(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = call i8* (...) @for_dest()
%8 = load i32, i32* @TIPC_CMD_GET_MAX_PUBL
%9 = call i32 @do_get_unsigned(i32 %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %9)
br label %15
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = load i32, i32* @TIPC_CMD_SET_MAX_PUBL
%14 = call i32 @do_set_unsigned(i8* %12, i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %11, %6
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"maximum allowed publications%s: %u\0A\00"
@TIPC_CMD_GET_MAX_PUBL = global i32 0
@TIPC_CMD_SET_MAX_PUBL = global i32 0
@.str.1 = [17 x i8] c"max publications\00"
@.str.2 = [1 x i8] zeroinitializer
define void @set_max_publ(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call i8* (...) @for_dest()
%6 = load i32, i32* @TIPC_CMD_GET_MAX_PUBL
%7 = tail call i32 @do_get_unsigned(i32 %6)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
br label %12
9: ; preds = %1
%10 = load i32, i32* @TIPC_CMD_SET_MAX_PUBL
%11 = tail call i32 @do_set_unsigned(i8* %0, i32 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %9, %4
ret void
}