#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*/ errno;
scalar_t__ plm_block_signal_worker();
scalar_t__ plm_conf_load();
int /*<<< orphan*/ plm_ctx_destroy();
int /*<<< orphan*/ plm_disp_proc();
int /*<<< orphan*/ plm_log_syslog(char *, ...);
int /*<<< orphan*/ plm_plugin_destroy();
int plm_plugin_init();
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void plm_worker_proc_loop() {
  int rc;
  if (plm_block_signal_worker())
    plm_log_syslog("worker block signal failed: %s", strerror(errno));
  if (plm_conf_load()) {
    plm_log_syslog("plume load configure file failed");
    return;
  }
  rc = plm_plugin_init();
  if (rc < 0) {
    plm_log_syslog("plume init plugin failed");
    return;
  }
  plm_disp_proc();
  plm_plugin_destroy();
  plm_ctx_destroy();
}


x86 assembly (clang, -O0):
<plm_worker_proc_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <plm_block_signal_worker@plt>
cmp    $0x0,%rax
je     11b7 <plm_worker_proc_loop+0x37>
mov    0x2e40(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
mov    %eax,%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <plm_log_syslog@plt>
mov    $0x0,%al
call   1050 <plm_conf_load@plt>
cmp    $0x0,%rax
je     11db <plm_worker_proc_loop+0x5b>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1040 <plm_log_syslog@plt>
jmp    1217 <plm_worker_proc_loop+0x97>
mov    $0x0,%al
call   1030 <plm_plugin_init@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1202 <plm_worker_proc_loop+0x82>
lea    0xe4a(%rip),%rdi
mov    $0x0,%al
call   1040 <plm_log_syslog@plt>
jmp    1217 <plm_worker_proc_loop+0x97>
mov    $0x0,%al
call   1090 <plm_disp_proc@plt>
mov    $0x0,%al
call   1070 <plm_plugin_destroy@plt>
mov    $0x0,%al
call   1080 <plm_ctx_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<plm_worker_proc_loop>:
push   %rax
xor    %eax,%eax
call   1060 <plm_block_signal_worker@plt>
test   %rax,%rax
je     11ab <plm_worker_proc_loop+0x2b>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   10a0 <strerror@plt>
lea    0xe5e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <plm_log_syslog@plt>
xor    %eax,%eax
call   1050 <plm_conf_load@plt>
test   %rax,%rax
je     11c6 <plm_worker_proc_loop+0x46>
lea    0xe61(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1040 <plm_log_syslog@plt>
xor    %eax,%eax
call   1030 <plm_plugin_init@plt>
test   %eax,%eax
js     11e7 <plm_worker_proc_loop+0x67>
xor    %eax,%eax
call   1090 <plm_disp_proc@plt>
xor    %eax,%eax
call   1070 <plm_plugin_destroy@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <plm_ctx_destroy@plt>
lea    0xe52(%rip),%rdi
jmp    11be <plm_worker_proc_loop+0x3e>

LLVM IR (-O0):
@.str = [31 x i8] c"worker block signal failed: %s\00"
@errno = global i32 0
@.str.1 = [33 x i8] c"plume load configure file failed\00"
@.str.2 = [25 x i8] c"plume init plugin failed\00"
define void @plm_worker_proc_loop() {
%1 = alloca i32
%2 = call i64 (...) @plm_block_signal_worker()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = load i32, i32* @errno
%6 = call i32 @strerror(i32 %5)
%7 = call i32 (i8*, ...) @plm_log_syslog(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %4, %0
%9 = call i64 (...) @plm_conf_load()
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (i8*, ...) @plm_log_syslog(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %23
13: ; preds = %8
%14 = call i32 (...) @plm_plugin_init()
store i32 %14, i32* %1
%15 = load i32, i32* %1
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (i8*, ...) @plm_log_syslog(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %23
19: ; preds = %13
%20 = call i32 (...) @plm_disp_proc()
%21 = call i32 (...) @plm_plugin_destroy()
%22 = call i32 (...) @plm_ctx_destroy()
br label %23
23: ; preds = %19, %17, %11
ret void
}

LLVM IR (-O2):
@.str = [31 x i8] c"worker block signal failed: %s\00"
@errno = global i32 0
@.str.1 = [33 x i8] c"plume load configure file failed\00"
@.str.2 = [25 x i8] c"plume init plugin failed\00"
define void @plm_worker_proc_loop() {
%1 = tail call i64 (...) @plm_block_signal_worker()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 (i8*, ...) @plm_log_syslog(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %3, %0
%8 = tail call i64 (...) @plm_conf_load()
%9 = icmp eq i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %7
%11 = tail call i32 (i8*, ...) @plm_log_syslog(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
br label %21
12: ; preds = %7
%13 = tail call i32 (...) @plm_plugin_init()
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = tail call i32 (i8*, ...) @plm_log_syslog(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
br label %21
17: ; preds = %12
%18 = tail call i32 (...) @plm_disp_proc()
%19 = tail call i32 (...) @plm_plugin_destroy()
%20 = tail call i32 (...) @plm_ctx_destroy()
br label %21
21: ; preds = %17, %15, %10
ret void
}