#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 /*<<< orphan*/ FILE;

/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  FILE *pp;
  pp = popen("exec python getGesture.py", "r");
  long ret;
  char *ptr;
  if (pp != NULL) {
    char *line;
    char buf[100000];
    line = fgets(buf, sizeof buf, pp);
    printf("%s", line);
    pclose(pp);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186d0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xea7(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1060 <popen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11a6 <main+0x66>
lea    -0x186d0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x186a0,%esi
call   1050 <fgets@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <pclose@plt>
xor    %eax,%eax
add    $0x186d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x186a0,%rsp
lea    0xeb1(%rip),%rdi
lea    0xec4(%rip),%rsi
call   1060 <popen@plt>
test   %rax,%rax
je     118a <main+0x4a>
mov    %rax,%rbx
mov    %rsp,%rdi
mov    $0x186a0,%esi
mov    %rax,%rdx
call   1050 <fgets@plt>
lea    0xea2(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <pclose@plt>
xor    %eax,%eax
add    $0x186a0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"exec python getGesture.py\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i64
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [100000 x i8]
store i32 0, i32* %1
%7 = call i32* @popen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %18
10: ; preds = %0
%11 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 0
%12 = load i32*, i32** %2
%13 = call i8* @fgets(i8* %11, i32 100000, i32* %12)
store i8* %13, i8** %5
%14 = load i8*, i8** %5
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = load i32*, i32** %2
%17 = call i32 @pclose(i32* %16)
br label %18
18: ; preds = %10, %0
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"exec python getGesture.py\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [100000 x i8]
%2 = tail call i32* @popen(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %9, label %4
4: ; preds = %0
%5 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 0
%6 = call i8* @fgets(i8* %5, i32 100000, i32* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 @pclose(i32* %2)
br label %9
9: ; preds = %4, %0
ret i32 0
}