#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 */
char *cfg_get_string_param(char *, char *);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ log_error(char *, ...);
scalar_t__ system(char *);
void iscsid_startup(void) {
  char *startup_cmd;
  startup_cmd = cfg_get_string_param("/etc/iscsi/"
                                     "iscsid.conf",
                                     "iscsid.startup");
  if (!startup_cmd) {
    log_error("iscsid is not running. Could not start it up "
              "automatically using the startup command in the "
              "/etc/iscsi/iscsid.conf iscsid.startup setting. "
              "Please check that the file exists or that your "
              "init scripts have started iscsid.");
    return;
  }
  if (system(startup_cmd) < 0)
    log_error("Could not execute '%s' (err %d)", startup_cmd, errno);
}


x86 assembly (clang, -O0):
<iscsid_startup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1050 <cfg_get_string_param@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116d <iscsid_startup+0x3d>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <log_error@plt>
jmp    119b <iscsid_startup+0x6b>
mov    -0x8(%rbp),%rdi
call   1040 <system@plt>
cmp    $0x0,%rax
jge    119b <iscsid_startup+0x6b>
mov    -0x8(%rbp),%rsi
mov    0x2e55(%rip),%rax
mov    (%rax),%edx
lea    0xf6e(%rip),%rdi
mov    $0x0,%al
call   1030 <log_error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscsid_startup>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1050 <cfg_get_string_param@plt>
test   %rax,%rax
je     115b <iscsid_startup+0x2b>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <system@plt>
test   %rax,%rax
js     116a <iscsid_startup+0x3a>
pop    %rbx
ret
lea    0xec4(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <log_error@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edx
lea    0xf88(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1030 <log_error@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"/etc/iscsi/iscsid.conf\00"
@.str.1 = [15 x i8] c"iscsid.startup\00"
@.str.2 = [220 x i8] c"iscsid is not running. Could not start it up automatically using the startup command in the /etc/iscsi/iscsid.conf iscsid.startup setting. Please check that the file exists or that your init scripts have started iscsid.\00"
@.str.3 = [32 x i8] c"Could not execute '%s' (err %d)\00"
@errno = global i32 0
define void @iscsid_startup() {
%1 = alloca i8*
%2 = call i8* @cfg_get_string_param(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = icmp ne i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (i8*, ...) @log_error(i8* getelementptr inbounds ([220 x i8], [220 x i8]* @.str.2, i64 0, i64 0))
br label %15
7: ; preds = %0
%8 = load i8*, i8** %1
%9 = call i64 @system(i8* %8)
%10 = icmp slt i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8*, i8** %1
%13 = load i32, i32* @errno
%14 = call i32 (i8*, ...) @log_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %12, i32 %13)
br label %15
15: ; preds = %5, %11, %7
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"/etc/iscsi/iscsid.conf\00"
@.str.1 = [15 x i8] c"iscsid.startup\00"
@.str.2 = [220 x i8] c"iscsid is not running. Could not start it up automatically using the startup command in the /etc/iscsi/iscsid.conf iscsid.startup setting. Please check that the file exists or that your init scripts have started iscsid.\00"
@.str.3 = [32 x i8] c"Could not execute '%s' (err %d)\00"
@errno = global i32 0
define void @iscsid_startup() {
%1 = tail call i8* @cfg_get_string_param(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @log_error(i8* getelementptr inbounds ([220 x i8], [220 x i8]* @.str.2, i64 0, i64 0))
br label %11
5: ; preds = %0
%6 = tail call i64 @system(i8* %1)
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* @errno
%10 = tail call i32 (i8*, ...) @log_error(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %1, i32 %9)
br label %11
11: ; preds = %5, %8, %3
ret void
}