#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*/ PRIO_PROCESS;
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ setpriority(int /*<<< orphan*/, int /*<<< orphan*/, int);
int /*<<< orphan*/ xs_corosync_fence(int, char **);
int main(int argc, char **argv) {
  setpriority(PRIO_PROCESS, 0, -20);
  if (5 != argc) {
    printf("usage: xs-corosync-fence <block device path> <node ID> <WD "
           "timeout> <main loop frequency> \n");
    return 1;
  }
  xs_corosync_fence(argc, argv);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xffffffec,%edx
call   1040 <setpriority@plt>
mov    $0x5,%eax
cmp    -0x8(%rbp),%eax
je     1181 <main+0x51>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1194 <main+0x64>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1050 <xs_corosync_fence@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0xffffffec,%edx
call   1040 <setpriority@plt>
cmp    $0x5,%ebp
jne    1161 <main+0x31>
mov    $0x5,%edi
mov    %rbx,%rsi
call   1050 <xs_corosync_fence@plt>
jmp    116d <main+0x3d>
lea    0xe98(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@PRIO_PROCESS = global i32 0
@.str = [92 x i8] c"usage: xs-corosync-fence <block device path> <node ID> <WD timeout> <main loop frequency> \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @PRIO_PROCESS
%7 = call i32 @setpriority(i32 %6, i32 0, i32 -20)
%8 = load i32, i32* %4
%9 = icmp ne i32 5, %8
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %16
12: ; preds = %2
%13 = load i32, i32* %4
%14 = load i8**, i8*** %5
%15 = call i32 @xs_corosync_fence(i32 %13, i8** %14)
store i32 1, i32* %3
br label %16
16: ; preds = %12, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@PRIO_PROCESS = global i32 0
@str = [91 x i8] c"usage: xs-corosync-fence <block device path> <node ID> <WD timeout> <main loop frequency> \00"
define i32 @main(i32 %0, i8** %1) {
%3 = load i32, i32* @PRIO_PROCESS
%4 = tail call i32 @setpriority(i32 %3, i32 0, i32 -20)
%5 = icmp eq i32 %0, 5
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @str, i64 0, i64 0))
br label %10
8: ; preds = %2
%9 = tail call i32 @xs_corosync_fence(i32 5, i8** %1)
br label %10
10: ; preds = %8, %6
ret i32 1
}