#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*/ exit(int);
scalar_t__ system(char *);
void exec_script() {
  if (system("/usr/local/pharos/sbin/rndc -c /usr/local/pharos/conf/trndc.conf "
             "stats") < 0) {
    exit(-1);
  }
  if (system("perl /tmp/rndc_tsar.pl > /tmp/rndc_tsar.txt") < 0) {
    exit(-1);
  }
  if (system("echo -n 'badvs,' >> /tmp/rndc_tsar.txt; MYSQL_BIN=`/bin/rpm -ql "
             "mysql|/bin/egrep -e '/bin/mysql$'` && ${MYSQL_BIN} -ss -uroot "
             "-Ddns_config -e 'SELECT COUNT(name) FROM vs WHERE in_use=1 AND "
             "available=0' >> /tmp/rndc_tsar.txt") < 0) {
    exit(-1);
  }
}


x86 assembly (clang, -O0):
<exec_script>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
jge    1144 <exec_script+0x24>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
lea    0xefc(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
jge    1164 <exec_script+0x44>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
lea    0xf08(%rip),%rdi
call   1030 <system@plt>
cmp    $0x0,%rax
jge    1184 <exec_script+0x64>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exec_script>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
js     1156 <exec_script+0x36>
lea    0xf0e(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
js     1156 <exec_script+0x36>
lea    0xf29(%rip),%rdi
call   1030 <system@plt>
test   %rax,%rax
js     1156 <exec_script+0x36>
pop    %rax
ret
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [71 x i8] c"/usr/local/pharos/sbin/rndc -c /usr/local/pharos/conf/trndc.conf stats\00"
@.str.1 = [44 x i8] c"perl /tmp/rndc_tsar.pl > /tmp/rndc_tsar.txt\00"
@.str.2 = [224 x i8] c"echo -n 'badvs,' >> /tmp/rndc_tsar.txt; MYSQL_BIN=`/bin/rpm -ql mysql|/bin/egrep -e '/bin/mysql$'` && ${MYSQL_BIN} -ss -uroot -Ddns_config -e 'SELECT COUNT(name) FROM vs WHERE in_use=1 AND available=0' >> /tmp/rndc_tsar.txt\00"
define void @exec_script() {
%1 = call i64 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 @exit(i32 -1)
unreachable
5: ; preds = %0
%6 = call i64 @system(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @exit(i32 -1)
unreachable
10: ; preds = %5
%11 = call i64 @system(i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 @exit(i32 -1)
unreachable
15: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [71 x i8] c"/usr/local/pharos/sbin/rndc -c /usr/local/pharos/conf/trndc.conf stats\00"
@.str.1 = [44 x i8] c"perl /tmp/rndc_tsar.pl > /tmp/rndc_tsar.txt\00"
@.str.2 = [224 x i8] c"echo -n 'badvs,' >> /tmp/rndc_tsar.txt; MYSQL_BIN=`/bin/rpm -ql mysql|/bin/egrep -e '/bin/mysql$'` && ${MYSQL_BIN} -ss -uroot -Ddns_config -e 'SELECT COUNT(name) FROM vs WHERE in_use=1 AND available=0' >> /tmp/rndc_tsar.txt\00"
define void @exec_script() {
%1 = tail call i64 @system(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str, i64 0, i64 0))
%2 = icmp slt i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @exit(i32 -1)
unreachable
5: ; preds = %0
%6 = tail call i64 @system(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp slt i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @exit(i32 -1)
unreachable
10: ; preds = %5
%11 = tail call i64 @system(i8* getelementptr inbounds ([224 x i8], [224 x i8]* @.str.2, i64 0, i64 0))
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @exit(i32 -1)
unreachable
15: ; preds = %10
ret void
}