#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*/ error(char *);
int execle(char const *, char const *, char const *, char *,
           int /*<<< orphan*/ *, char **);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  if (argc < 2) {
    fprintf(stderr, "Usage: %s <search phrase>\n", argv[0]);
    return 1;
  }
  const char *PYTHON = "/usr/bin/python2";
  const char *SCRIPT = "rssgossip.py";
  char *feeds[] = {
      "http://www.nytimes.com/services/xml/rss/nyt/Africa.xml",
      "http://www.nytimes.com/services/xml/rss/nyt/Americas.xml",
      "http://www.nytimes.com/services/xml/rss/nyt/MiddleEast.xml",
      "http://www.nytimes.com/services/xml/rss/nyt/Europe.xml",
      "http://www.nytimes.com/services/xml/rss/nyt/AsiaPacific.xml"};
  int num_feeds = 5;
  char *search_phrase = argv[1];
  char var[255];
  for (int i = 0; i < num_feeds; i++) {
    sprintf(var, "RSS_FEED=%s", feeds[i]);
    char *vars[] = {var, NULL};
    int res = execle(PYTHON, PYTHON, SCRIPT, search_phrase, NULL, vars);
    if (res == -1) {
      error("Can't run script.");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    119b <main+0x4b>
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe76(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    12bc <main+0x16c>
lea    0xe79(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe7f(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1030 <memset@plt>
lea    0xe71(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xe9d(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xefb(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xf27(%rip),%rax
mov    %rax,-0x30(%rbp)
movl   $0x5,-0x54(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x164(%rbp)
mov    -0x164(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    12b5 <main+0x165>
lea    -0x160(%rbp),%rdi
movslq -0x164(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdx
lea    0xf19(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x160(%rbp),%rax
mov    %rax,-0x180(%rbp)
movq   $0x0,-0x178(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x60(%rbp),%rcx
lea    -0x180(%rbp),%r9
xor    %eax,%eax
mov    %eax,%r8d
call   1070 <execle@plt>
mov    %eax,-0x184(%rbp)
cmpl   $0xffffffff,-0x184(%rbp)
jne    129c <main+0x14c>
lea    0xecc(%rip),%rdi
call   1050 <error@plt>
jmp    12a1 <main+0x151>
mov    -0x164(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x164(%rbp)
jmp    1215 <main+0xc5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x190,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x110,%rsp
cmp    $0x1,%edi
jg     1173 <main+0x33>
mov    0x2e88(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%ebx
jmp    131d <main+0x1dd>
mov    0x8(%rsi),%r15
lea    0xfd9(%rip),%rsi
lea    0xeb4(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe75(%rip),%rdi
lea    0xe7f(%rip),%rdx
mov    %rsp,%r9
mov    %rdi,%rsi
mov    %r15,%rcx
xor    %r8d,%r8d
call   1060 <execle@plt>
cmp    $0xffffffff,%eax
jne    11cf <main+0x8f>
lea    0xf99(%rip),%rdi
call   1040 <error@plt>
lea    0xf81(%rip),%rsi
lea    0xe93(%rip),%rdx
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xe22(%rip),%rdi
lea    0xe2c(%rip),%rdx
mov    %rsp,%r9
mov    %rdi,%rsi
mov    %r15,%rcx
xor    %r8d,%r8d
call   1060 <execle@plt>
cmp    $0xffffffff,%eax
jne    1222 <main+0xe2>
lea    0xf46(%rip),%rdi
call   1040 <error@plt>
lea    0xf2e(%rip),%rsi
lea    0xe79(%rip),%rdx
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xdcf(%rip),%rdi
lea    0xdd9(%rip),%rdx
mov    %rsp,%r9
mov    %rdi,%rsi
mov    %r15,%rcx
xor    %r8d,%r8d
call   1060 <execle@plt>
cmp    $0xffffffff,%eax
jne    1275 <main+0x135>
lea    0xef3(%rip),%rdi
call   1040 <error@plt>
lea    0xedb(%rip),%rsi
lea    0xe61(%rip),%rdx
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xd7c(%rip),%rdi
lea    0xd86(%rip),%rdx
mov    %rsp,%r9
mov    %rdi,%rsi
mov    %r15,%rcx
xor    %r8d,%r8d
call   1060 <execle@plt>
cmp    $0xffffffff,%eax
jne    12c8 <main+0x188>
lea    0xea0(%rip),%rdi
call   1040 <error@plt>
lea    0xe88(%rip),%rsi
lea    0xe45(%rip),%rdx
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,(%rsp)
movq   $0x0,0x8(%rsp)
lea    0xd29(%rip),%rdi
lea    0xd33(%rip),%rdx
xor    %ebx,%ebx
mov    %rsp,%r9
mov    %rdi,%rsi
mov    %r15,%rcx
xor    %r8d,%r8d
call   1060 <execle@plt>
cmp    $0xffffffff,%eax
jne    131d <main+0x1dd>
lea    0xe4b(%rip),%rdi
call   1040 <error@plt>
mov    %ebx,%eax
add    $0x110,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s <search phrase>\0A\00"
@.str.1 = [17 x i8] c"/usr/bin/python2\00"
@.str.2 = [13 x i8] c"rssgossip.py\00"
@.str.3 = [55 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/Africa.xml\00"
@.str.4 = [57 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/Americas.xml\00"
@.str.5 = [59 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/MiddleEast.xml\00"
@.str.6 = [55 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/Europe.xml\00"
@.str.7 = [60 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/AsiaPacific.xml\00"
@.str.8 = [12 x i8] c"RSS_FEED=%s\00"
@.str.9 = [18 x i8] c"Can't run script.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [5 x i8*]
%9 = alloca i32
%10 = alloca i8*
%11 = alloca [255 x i8]
%12 = alloca i32
%13 = alloca [2 x i8*]
%14 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 2
br i1 %16, label %17, label %23
17: ; preds = %2
%18 = load i32, i32* @stderr
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 1, i32* %3
br label %63
23: ; preds = %2
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8** %6
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8** %7
%24 = bitcast [5 x i8*]* %8 to i8*
%25 = bitcast i8* %24 to [5 x i8*]*
%26 = getelementptr inbounds [5 x i8*], [5 x i8*]* %25, i32 0, i32 0
store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i32 0, i32 0), i8** %26
%27 = getelementptr inbounds [5 x i8*], [5 x i8*]* %25, i32 0, i32 1
store i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i32 0, i32 0), i8** %27
%28 = getelementptr inbounds [5 x i8*], [5 x i8*]* %25, i32 0, i32 2
store i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i32 0, i32 0), i8** %28
%29 = getelementptr inbounds [5 x i8*], [5 x i8*]* %25, i32 0, i32 3
store i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i32 0, i32 0), i8** %29
%30 = getelementptr inbounds [5 x i8*], [5 x i8*]* %25, i32 0, i32 4
store i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i32 0, i32 0), i8** %30
store i32 5, i32* %9
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
store i8* %33, i8** %10
store i32 0, i32* %12
br label %34
34: ; preds = %59, %23
%35 = load i32, i32* %12
%36 = load i32, i32* %9
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %62
38: ; preds = %34
%39 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
%40 = load i32, i32* %12
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [5 x i8*], [5 x i8*]* %8, i64 0, i64 %41
%43 = load i8*, i8** %42
%44 = call i32 @sprintf(i8* %39, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* %43)
%45 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 0
%46 = getelementptr inbounds [255 x i8], [255 x i8]* %11, i64 0, i64 0
store i8* %46, i8** %45
%47 = getelementptr inbounds i8*, i8** %45, i64 1
store i8* null, i8** %47
%48 = load i8*, i8** %6
%49 = load i8*, i8** %6
%50 = load i8*, i8** %7
%51 = load i8*, i8** %10
%52 = getelementptr inbounds [2 x i8*], [2 x i8*]* %13, i64 0, i64 0
%53 = call i32 @execle(i8* %48, i8* %49, i8* %50, i8* %51, i32* null, i8** %52)
store i32 %53, i32* %14
%54 = load i32, i32* %14
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %58
56: ; preds = %38
%57 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %58
58: ; preds = %56, %38
br label %59
59: ; preds = %58
%60 = load i32, i32* %12
%61 = add nsw i32 %60, 1
store i32 %61, i32* %12
br label %34
62: ; preds = %34
store i32 0, i32* %3
br label %63
63: ; preds = %62, %17
%64 = load i32, i32* %3
ret i32 %64
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s <search phrase>\0A\00"
@.str.1 = [17 x i8] c"/usr/bin/python2\00"
@.str.2 = [13 x i8] c"rssgossip.py\00"
@.str.3 = [55 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/Africa.xml\00"
@.str.4 = [57 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/Americas.xml\00"
@.str.5 = [59 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/MiddleEast.xml\00"
@.str.6 = [55 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/Europe.xml\00"
@.str.7 = [60 x i8] c"http://www.nytimes.com/services/xml/rss/nyt/AsiaPacific.xml\00"
@.str.8 = [12 x i8] c"RSS_FEED=%s\00"
@.str.9 = [18 x i8] c"Can't run script.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [255 x i8]
%4 = alloca [2 x i8*]
%5 = icmp slt i32 %0, 2
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = load i8*, i8** %1
%9 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %8)
br label %47
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds [255 x i8], [255 x i8]* %3, i64 0, i64 0
%14 = bitcast [2 x i8*]* %4 to i8*
%15 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
%16 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 1
%17 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.3, i64 0, i64 0))
store i8* %13, i8** %15
store i8* null, i8** %16
%18 = call i32 @execle(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %12, i32* null, i8** %15)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %10
%21 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %22
22: ; preds = %20, %10
%23 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.4, i64 0, i64 0))
store i8* %13, i8** %15
store i8* null, i8** %16
%24 = call i32 @execle(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %12, i32* null, i8** %15)
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.5, i64 0, i64 0))
store i8* %13, i8** %15
store i8* null, i8** %16
%30 = call i32 @execle(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %12, i32* null, i8** %15)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %34
32: ; preds = %28
%33 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %34
34: ; preds = %32, %28
%35 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.6, i64 0, i64 0))
store i8* %13, i8** %15
store i8* null, i8** %16
%36 = call i32 @execle(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %12, i32* null, i8** %15)
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %40
38: ; preds = %34
%39 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %40
40: ; preds = %38, %34
%41 = call i32 @sprintf(i8* %13, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.7, i64 0, i64 0))
store i8* %13, i8** %15
store i8* null, i8** %16
%42 = call i32 @execle(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %12, i32* null, i8** %15)
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %46
44: ; preds = %40
%45 = call i32 @error(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
br label %46
46: ; preds = %44, %40
br label %47
47: ; preds = %46, %6
%48 = phi i32 [ 1, %6 ], [ 0, %46 ]
ret i32 %48
}