#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 */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ errno;
int execle(char *, char *, char *, char *, int /*<<< orphan*/ *, char **);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  char *feeds[] = {"http://conference.scipy.org/feeds/all.atom.xml",
                   "http://maheshakya.github.io/feed.xml"};
  int times = 2;
  char *phrase = argv[1];
  int i;
  for (i = 0; i < times; i++) {
    char var[255];
    sprintf(var, "RSS_FEED=%s", feeds[i]);
    char *vars[] = {var, NULL};
    pid_t pid = fork();
    if (pid == -1) {
      fprintf(stderr, "Could not fork: %s\n", strerror(errno));
      return 1;
    }
    if (!pid) {
      if (execle("/usr/bin/python", "usr/bin/python", "rssgossip.py", phrase,
                 NULL, vars) == -1) {
        fprintf(stderr, "Can't run script: %s\n", strerror(errno));
        return 1;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2c90(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2c8d(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x2,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12c8 <main+0x178>
lea    -0x140(%rbp),%rdi
movslq -0x34(%rbp),%rax
mov    -0x20(%rbp,%rax,8),%rdx
lea    0xe98(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x140(%rbp),%rax
mov    %rax,-0x150(%rbp)
movq   $0x0,-0x148(%rbp)
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x154(%rbp)
cmpl   $0xffffffff,-0x154(%rbp)
jne    1232 <main+0xe2>
mov    0x2de5(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x158(%rbp)
mov    0x2dce(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x158(%rbp),%edi
mov    %rax,%rdx
lea    0xe3f(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12cf <main+0x17f>
cmpl   $0x0,-0x154(%rbp)
jne    12b5 <main+0x165>
mov    -0x30(%rbp),%rcx
lea    -0x150(%rbp),%r9
lea    0xe23(%rip),%rdi
lea    0xe1d(%rip),%rsi
lea    0xe25(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
call   1050 <execle@plt>
cmp    $0xffffffff,%eax
jne    12b0 <main+0x160>
mov    0x2d67(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x15c(%rbp)
mov    0x2d50(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    -0x15c(%rbp),%edi
mov    %rax,%rdx
lea    0xdf2(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12cf <main+0x17f>
jmp    12b5 <main+0x165>
jmp    12ba <main+0x16a>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1199 <main+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
mov    0x8(%rsi),%r14
lea    0xeed(%rip),%rsi
lea    0xe92(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,(%rsp)
movq   $0x0,0x8(%rsp)
xor    %eax,%eax
call   1070 <fork@plt>
lea    0xeca(%rip),%r15
cmp    $0xffffffff,%eax
je     1231 <main+0xe1>
test   %eax,%eax
jne    11cb <main+0x7b>
lea    0xeca(%rip),%rdi
lea    0xec4(%rip),%rsi
lea    0xecc(%rip),%rdx
mov    %rsp,%r9
mov    %r14,%rcx
xor    %r8d,%r8d
call   1050 <execle@plt>
cmp    $0xffffffff,%eax
je     122a <main+0xda>
lea    0xe82(%rip),%rsi
lea    0xe56(%rip),%rdx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,(%rsp)
movq   $0x0,0x8(%rsp)
xor    %eax,%eax
call   1070 <fork@plt>
cmp    $0xffffffff,%eax
je     1231 <main+0xe1>
test   %eax,%eax
jne    1226 <main+0xd6>
lea    0xe6f(%rip),%rdi
lea    0xe69(%rip),%rsi
lea    0xe71(%rip),%rdx
mov    %rsp,%r9
mov    %r14,%rcx
xor    %r8d,%r8d
call   1050 <execle@plt>
cmp    $0xffffffff,%eax
je     122a <main+0xda>
xor    %eax,%eax
jmp    125a <main+0x10a>
lea    0xe60(%rip),%r15
mov    0x2da8(%rip),%rax
mov    (%rax),%ebx
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
call   1060 <strerror@plt>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %rax,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [47 x i8] c"http://conference.scipy.org/feeds/all.atom.xml\00"
@.str.1 = [37 x i8] c"http://maheshakya.github.io/feed.xml\00"
@__const.main.feeds = [2 x i8*] [i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [12 x i8] c"RSS_FEED=%s\00"
@stderr = global i32 0
@.str.3 = [20 x i8] c"Could not fork: %s\0A\00"
@errno = global i32 0
@.str.4 = [16 x i8] c"/usr/bin/python\00"
@.str.5 = [15 x i8] c"usr/bin/python\00"
@.str.6 = [13 x i8] c"rssgossip.py\00"
@.str.7 = [22 x i8] c"Can't run script: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i8*]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca [255 x i8]
%11 = alloca [2 x i8*]
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [2 x i8*]* %6 to i8*
store i32 2, i32* %7
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
store i8* %16, i8** %8
store i32 0, i32* %9
br label %17
17: ; preds = %54, %2
%18 = load i32, i32* %9
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %57
21: ; preds = %17
%22 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
%23 = load i32, i32* %9
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x i8*], [2 x i8*]* %6, i64 0, i64 %24
%26 = load i8*, i8** %25
%27 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 0
%29 = getelementptr inbounds [255 x i8], [255 x i8]* %10, i64 0, i64 0
store i8* %29, i8** %28
%30 = getelementptr inbounds i8*, i8** %28, i64 1
store i8* null, i8** %30
%31 = call i32 (...) @fork()
store i32 %31, i32* %12
%32 = load i32, i32* %12
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %39
34: ; preds = %21
%35 = load i32, i32* @stderr
%36 = load i32, i32* @errno
%37 = call i8* @strerror(i32 %36)
%38 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %37)
store i32 1, i32* %3
br label %58
39: ; preds = %21
%40 = load i32, i32* %12
%41 = icmp ne i32 %40, 0
br i1 %41, label %53, label %42
42: ; preds = %39
%43 = load i8*, i8** %8
%44 = getelementptr inbounds [2 x i8*], [2 x i8*]* %11, i64 0, i64 0
%45 = call i32 @execle(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %43, i32* null, i8** %44)
%46 = icmp eq i32 %45, -1
br i1 %46, label %47, label %52
47: ; preds = %42
%48 = load i32, i32* @stderr
%49 = load i32, i32* @errno
%50 = call i8* @strerror(i32 %49)
%51 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %50)
store i32 1, i32* %3
br label %58
52: ; preds = %42
br label %53
53: ; preds = %52, %39
br label %54
54: ; preds = %53
%55 = load i32, i32* %9
%56 = add nsw i32 %55, 1
store i32 %56, i32* %9
br label %17
57: ; preds = %17
store i32 0, i32* %3
br label %58
58: ; preds = %57, %47, %34
%59 = load i32, i32* %3
ret i32 %59
}

LLVM IR (-O2):
@.str = [47 x i8] c"http://conference.scipy.org/feeds/all.atom.xml\00"
@.str.1 = [37 x i8] c"http://maheshakya.github.io/feed.xml\00"
@.str.2 = [12 x i8] c"RSS_FEED=%s\00"
@stderr = global i32 0
@.str.3 = [20 x i8] c"Could not fork: %s\0A\00"
@errno = global i32 0
@.str.4 = [16 x i8] c"/usr/bin/python\00"
@.str.5 = [15 x i8] c"usr/bin/python\00"
@.str.6 = [13 x i8] c"rssgossip.py\00"
@.str.7 = [22 x i8] c"Can't run script: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8]
%4 = alloca [2 x i8*]
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%8 = bitcast [2 x i8*]* %4 to i8*
%9 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%10 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 1
%11 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
store i8* %7, i8** %9
store i8* null, i8** %10
%12 = call i32 (...) @fork()
switch i32 %12, label %22 [
i32 -1, label %16
i32 0, label %13
]
13: ; preds = %2
%14 = call i32 @execle(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %6, i32* null, i8** %9)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %22
16: ; preds = %13, %25, %2, %22
%17 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), %22 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), %2 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), %25 ], [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), %13 ]
%18 = load i32, i32* @stderr
%19 = load i32, i32* @errno
%20 = call i8* @strerror(i32 %19)
%21 = call i32 @fprintf(i32 %18, i8* %17, i8* %20)
br label %29
22: ; preds = %2, %13
%23 = call i32 @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
store i8* %7, i8** %9
store i8* null, i8** %10
%24 = call i32 (...) @fork()
switch i32 %24, label %28 [
i32 -1, label %16
i32 0, label %25
]
25: ; preds = %22
%26 = call i32 @execle(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i8* %6, i32* null, i8** %9)
%27 = icmp eq i32 %26, -1
br i1 %27, label %16, label %28
28: ; preds = %25, %22
br label %29
29: ; preds = %28, %16
%30 = phi i32 [ 1, %16 ], [ 0, %28 ]
ret i32 %30
}