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

/* Variables and functions */
int STDOUT_FILENO;
int /*<<< orphan*/ WEXITSTATUS(int);
scalar_t__ WIFEXITED(int);
int /*<<< orphan*/ WUNTRACED;
int /*<<< orphan*/ abort();
char *alloca(size_t);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ dup2(int, int);
int /*<<< orphan*/ execlp(char *, char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fdopen(int, char *);
scalar_t__ fork();
int fscanf(int /*<<< orphan*/ *, char *, float *, float *);
int /*<<< orphan*/ perror(char *);
scalar_t__ pipe(int *);
int /*<<< orphan*/ report(float, float, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, size_t, char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ waitpid(scalar_t__, int *, int /*<<< orphan*/);
int guess_by_command(int argc, char **args) {
  size_t len = (size_t)argc;
  size_t off = 0;
  size_t i;
  char *command;
  int read_write[2];
  pid_t pid;
  for (i = 0; i < (size_t)argc; i++)
    len += strlen(*(args + i));
  command = alloca(len * sizeof(char));
  for (i = 0; i < (size_t)argc; i++) {
    snprintf(command + off, len, "%s", *(args + i));
    off += strlen(*(args + i));
    *(command + off++) = ' ';
  }
  *(command + len - 1) = '\0';
  if (pipe(read_write)) {
    perror("pipe");
    return 1;
  }
  pid = fork();
  if (pid == (pid_t)-1) {
    perror("fork");
    close(read_write[0]);
    close(read_write[1]);
    return 1;
  }
  if (pid) {
    int rc = 1;
    FILE *ch = NULL;
    int status;
    float latitude;
    float longitude;
    waitpid(pid, &status, WUNTRACED);
    if (WIFEXITED(status) && !WEXITSTATUS(status))
      if ((ch = fdopen(read_write[0], "r")) != NULL)
        if ((rc = fscanf(ch, "%f %f", &latitude, &longitude) == 2))
          report(latitude, longitude, "command", 1, 0);
    if (ch)
      fclose(ch);
    close(read_write[0]);
    close(read_write[1]);
    return rc;
  } else {
    if (read_write[1] != STDOUT_FILENO) {
      close(STDOUT_FILENO);
      dup2(read_write[1], STDOUT_FILENO);
    }
    execlp("sh", "sh", "-c", command, NULL);
    perror("execlp");
    abort();
  }
  return 1;
}


x86 assembly (clang, -O0):
<guess_by_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    1272 <guess_by_command+0x62>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1237 <guess_by_command+0x27>
mov    -0x18(%rbp),%rdi
shl    $0x0,%rdi
call   10b0 <alloca@plt>
mov    %rax,-0x30(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    1301 <guess_by_command+0xf1>
mov    -0x30(%rbp),%rdi
add    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xd45(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1050 <strlen@plt>
add    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x20(%rbp)
movb   $0x20,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    128b <guess_by_command+0x7b>
mov    -0x30(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
lea    -0x38(%rbp),%rdi
call   10a0 <pipe@plt>
cmp    $0x0,%rax
je     1339 <guess_by_command+0x129>
lea    0xcdb(%rip),%rdi
call   10f0 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    14d6 <guess_by_command+0x2c6>
mov    $0x0,%al
call   1130 <fork@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0xffffffffffffffff,-0x40(%rbp)
jne    1377 <guess_by_command+0x167>
lea    0xcb2(%rip),%rdi
call   10f0 <perror@plt>
mov    -0x38(%rbp),%edi
call   1090 <close@plt>
mov    -0x34(%rbp),%edi
call   1090 <close@plt>
movl   $0x1,-0x4(%rbp)
jmp    14d6 <guess_by_command+0x2c6>
cmpq   $0x0,-0x40(%rbp)
je     1473 <guess_by_command+0x263>
movl   $0x1,-0x44(%rbp)
movq   $0x0,-0x50(%rbp)
mov    -0x40(%rbp),%rdi
mov    0x2c3c(%rip),%rax
mov    (%rax),%edx
lea    -0x54(%rbp),%rsi
call   10e0 <waitpid@plt>
mov    -0x54(%rbp),%edi
call   1100 <WIFEXITED@plt>
cmp    $0x0,%rax
je     1444 <guess_by_command+0x234>
mov    -0x54(%rbp),%edi
call   10d0 <WEXITSTATUS@plt>
cmp    $0x0,%eax
jne    1444 <guess_by_command+0x234>
mov    -0x38(%rbp),%edi
lea    0xc39(%rip),%rsi
call   10c0 <fdopen@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
je     143f <guess_by_command+0x22f>
mov    -0x50(%rbp),%rdi
lea    0xc1d(%rip),%rsi
lea    -0x58(%rbp),%rdx
lea    -0x5c(%rbp),%rcx
call   1080 <fscanf@plt>
cmp    $0x2,%eax
sete   %al
mov    %al,%cl
and    $0x1,%cl
movzbl %cl,%ecx
mov    %ecx,-0x44(%rbp)
test   $0x1,%al
jne    141d <guess_by_command+0x20d>
jmp    143a <guess_by_command+0x22a>
movss  -0x58(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm1
lea    0xbe7(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1110 <report@plt>
jmp    143f <guess_by_command+0x22f>
jmp    1444 <guess_by_command+0x234>
cmpq   $0x0,-0x50(%rbp)
je     1458 <guess_by_command+0x248>
mov    -0x50(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x38(%rbp),%edi
call   1090 <close@plt>
mov    -0x34(%rbp),%edi
call   1090 <close@plt>
mov    -0x44(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    14d6 <guess_by_command+0x2c6>
mov    -0x34(%rbp),%eax
mov    0x2b73(%rip),%rcx
cmp    (%rcx),%eax
je     14a4 <guess_by_command+0x294>
mov    0x2b64(%rip),%rax
mov    (%rax),%edi
call   1090 <close@plt>
mov    -0x34(%rbp),%edi
mov    0x2b53(%rip),%rax
mov    (%rax),%esi
call   1060 <dup2@plt>
mov    -0x30(%rbp),%rcx
lea    0xb6e(%rip),%rsi
lea    0xb6a(%rip),%rdx
xor    %eax,%eax
mov    %eax,%r8d
mov    %rsi,%rdi
call   1120 <execlp@plt>
lea    0xb59(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<guess_by_command>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movslq %edi,%r12
test   %r12d,%r12d
je     12cb <guess_by_command+0xbb>
mov    %rsi,%r15
mov    %edi,%r13d
cmp    $0x2,%r12
mov    $0x1,%r14d
cmovae %r12,%r14
xor    %ebp,%ebp
mov    %r12,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r15,%rbp,8),%rdi
call   1050 <strlen@plt>
add    %rax,%rbx
add    $0x1,%rbp
cmp    %rbp,%r14
jne    1250 <guess_by_command+0x40>
mov    %rbx,%rdi
call   10b0 <alloca@plt>
mov    %rax,%r14
test   %r13d,%r13d
je     12d8 <guess_by_command+0xc8>
cmp    $0x2,%r12
mov    $0x1,%r13d
cmovae %r12,%r13
xor    %ebp,%ebp
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
lea    (%r14,%r12,1),%rdi
mov    (%r15,%rbp,8),%rcx
mov    %rbx,%rsi
lea    0xd5e(%rip),%rdx
call   1070 <snprintf@plt>
mov    (%r15,%rbp,8),%rdi
call   1050 <strlen@plt>
lea    (%rax,%r12,1),%rcx
add    %rax,%r12
add    $0x1,%r12
movb   $0x20,(%r14,%rcx,1)
add    $0x1,%rbp
cmp    %rbp,%r13
jne    1290 <guess_by_command+0x80>
jmp    12d8 <guess_by_command+0xc8>
mov    %r12,%rdi
call   10b0 <alloca@plt>
mov    %rax,%r14
xor    %ebx,%ebx
movb   $0x0,-0x1(%r14,%rbx,1)
lea    0x4(%rsp),%rdi
call   10a0 <pipe@plt>
test   %rax,%rax
jne    13cb <guess_by_command+0x1bb>
xor    %eax,%eax
call   1130 <fork@plt>
cmp    $0xffffffffffffffff,%rax
je     13d9 <guess_by_command+0x1c9>
test   %rax,%rax
je     13fe <guess_by_command+0x1ee>
mov    0x2cc6(%rip),%rcx
mov    (%rcx),%edx
lea    0xc(%rsp),%rsi
mov    %rax,%rdi
call   10e0 <waitpid@plt>
mov    0xc(%rsp),%edi
call   1100 <WIFEXITED@plt>
mov    $0x1,%ebx
test   %rax,%rax
je     13a8 <guess_by_command+0x198>
mov    0xc(%rsp),%edi
call   10d0 <WEXITSTATUS@plt>
test   %eax,%eax
jne    13a8 <guess_by_command+0x198>
mov    0x4(%rsp),%edi
lea    0xcc1(%rip),%rsi
call   10c0 <fdopen@plt>
test   %rax,%rax
je     13a8 <guess_by_command+0x198>
mov    %rax,%r14
lea    0xcaf(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rax,%rdi
call   1080 <fscanf@plt>
mov    %eax,%ebp
cmp    $0x2,%eax
jne    1398 <guess_by_command+0x188>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
lea    0xc89(%rip),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1110 <report@plt>
xor    %ebx,%ebx
cmp    $0x2,%ebp
sete   %bl
mov    %r14,%rdi
call   1040 <fclose@plt>
mov    0x4(%rsp),%edi
call   1090 <close@plt>
mov    0x8(%rsp),%edi
call   1090 <close@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc31(%rip),%rdi
call   10f0 <perror@plt>
jmp    13f7 <guess_by_command+0x1e7>
lea    0xc28(%rip),%rdi
call   10f0 <perror@plt>
mov    0x4(%rsp),%edi
call   1090 <close@plt>
mov    0x8(%rsp),%edi
call   1090 <close@plt>
mov    $0x1,%ebx
jmp    13ba <guess_by_command+0x1aa>
mov    0x2beb(%rip),%rbx
mov    (%rbx),%edi
cmp    %edi,0x8(%rsp)
je     141d <guess_by_command+0x20d>
call   1090 <close@plt>
mov    0x8(%rsp),%edi
mov    (%rbx),%esi
call   1060 <dup2@plt>
lea    0xbf9(%rip),%rdi
lea    0xbf5(%rip),%rdx
mov    %rdi,%rsi
mov    %r14,%rcx
xor    %r8d,%r8d
call   1120 <execlp@plt>
lea    0xbe3(%rip),%rdi
call   10f0 <perror@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"pipe\00"
@.str.2 = [5 x i8] c"fork\00"
@WUNTRACED = global i32 0
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [6 x i8] c"%f %f\00"
@.str.5 = [8 x i8] c"command\00"
@STDOUT_FILENO = global i32 0
@.str.6 = [3 x i8] c"sh\00"
@.str.7 = [3 x i8] c"-c\00"
@.str.8 = [7 x i8] c"execlp\00"
define i32 @guess_by_command(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca [2 x i32]
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32
%15 = alloca float
%16 = alloca float
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
store i64 %18, i64* %6
store i64 0, i64* %7
store i64 0, i64* %8
br label %19
19: ; preds = %32, %2
%20 = load i64, i64* %8
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = icmp ult i64 %20, %22
br i1 %23, label %24, label %35
24: ; preds = %19
%25 = load i8**, i8*** %5
%26 = load i64, i64* %8
%27 = getelementptr inbounds i8*, i8** %25, i64 %26
%28 = load i8*, i8** %27
%29 = call i64 @strlen(i8* %28)
%30 = load i64, i64* %6
%31 = add i64 %30, %29
store i64 %31, i64* %6
br label %32
32: ; preds = %24
%33 = load i64, i64* %8
%34 = add i64 %33, 1
store i64 %34, i64* %8
br label %19
35: ; preds = %19
%36 = load i64, i64* %6
%37 = mul i64 %36, 1
%38 = call i8* @alloca(i64 %37)
store i8* %38, i8** %9
store i64 0, i64* %8
br label %39
39: ; preds = %65, %35
%40 = load i64, i64* %8
%41 = load i32, i32* %4
%42 = sext i32 %41 to i64
%43 = icmp ult i64 %40, %42
br i1 %43, label %44, label %68
44: ; preds = %39
%45 = load i8*, i8** %9
%46 = load i64, i64* %7
%47 = getelementptr inbounds i8, i8* %45, i64 %46
%48 = load i64, i64* %6
%49 = load i8**, i8*** %5
%50 = load i64, i64* %8
%51 = getelementptr inbounds i8*, i8** %49, i64 %50
%52 = load i8*, i8** %51
%53 = call i32 @snprintf(i8* %47, i64 %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %52)
%54 = load i8**, i8*** %5
%55 = load i64, i64* %8
%56 = getelementptr inbounds i8*, i8** %54, i64 %55
%57 = load i8*, i8** %56
%58 = call i64 @strlen(i8* %57)
%59 = load i64, i64* %7
%60 = add i64 %59, %58
store i64 %60, i64* %7
%61 = load i8*, i8** %9
%62 = load i64, i64* %7
%63 = add i64 %62, 1
store i64 %63, i64* %7
%64 = getelementptr inbounds i8, i8* %61, i64 %62
store i8 32, i8* %64
br label %65
65: ; preds = %44
%66 = load i64, i64* %8
%67 = add i64 %66, 1
store i64 %67, i64* %8
br label %39
68: ; preds = %39
%69 = load i8*, i8** %9
%70 = load i64, i64* %6
%71 = getelementptr inbounds i8, i8* %69, i64 %70
%72 = getelementptr inbounds i8, i8* %71, i64 -1
store i8 0, i8* %72
%73 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%74 = call i64 @pipe(i32* %73)
%75 = icmp ne i64 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %68
%77 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %151
78: ; preds = %68
%79 = call i64 (...) @fork()
store i64 %79, i64* %11
%80 = load i64, i64* %11
%81 = icmp eq i64 %80, -1
br i1 %81, label %82, label %90
82: ; preds = %78
%83 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%84 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%85 = load i32, i32* %84
%86 = call i32 @close(i32 %85)
%87 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%88 = load i32, i32* %87
%89 = call i32 @close(i32 %88)
store i32 1, i32* %3
br label %151
90: ; preds = %78
%91 = load i64, i64* %11
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %134
93: ; preds = %90
store i32 1, i32* %12
store i32* null, i32** %13
%94 = load i64, i64* %11
%95 = load i32, i32* @WUNTRACED
%96 = call i32 @waitpid(i64 %94, i32* %14, i32 %95)
%97 = load i32, i32* %14
%98 = call i64 @WIFEXITED(i32 %97)
%99 = icmp ne i64 %98, 0
br i1 %99, label %100, label %120
100: ; preds = %93
%101 = load i32, i32* %14
%102 = call i32 @WEXITSTATUS(i32 %101)
%103 = icmp ne i32 %102, 0
br i1 %103, label %120, label %104
104: ; preds = %100
%105 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%106 = load i32, i32* %105
%107 = call i32* @fdopen(i32 %106, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %107, i32** %13
%108 = icmp ne i32* %107, null
br i1 %108, label %109, label %119
109: ; preds = %104
%110 = load i32*, i32** %13
%111 = call i32 @fscanf(i32* %110, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), float* %15, float* %16)
%112 = icmp eq i32 %111, 2
%113 = zext i1 %112 to i32
store i32 %113, i32* %12
br i1 %112, label %114, label %118
114: ; preds = %109
%115 = load float, float* %15
%116 = load float, float* %16
%117 = call i32 @report(float %115, float %116, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 1, i32 0)
br label %118
118: ; preds = %114, %109
br label %119
119: ; preds = %118, %104
br label %120
120: ; preds = %119, %100, %93
%121 = load i32*, i32** %13
%122 = icmp ne i32* %121, null
br i1 %122, label %123, label %126
123: ; preds = %120
%124 = load i32*, i32** %13
%125 = call i32 @fclose(i32* %124)
br label %126
126: ; preds = %123, %120
%127 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%128 = load i32, i32* %127
%129 = call i32 @close(i32 %128)
%130 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%131 = load i32, i32* %130
%132 = call i32 @close(i32 %131)
%133 = load i32, i32* %12
store i32 %133, i32* %3
br label %151
134: ; preds = %90
%135 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%136 = load i32, i32* %135
%137 = load i32, i32* @STDOUT_FILENO
%138 = icmp ne i32 %136, %137
br i1 %138, label %139, label %146
139: ; preds = %134
%140 = load i32, i32* @STDOUT_FILENO
%141 = call i32 @close(i32 %140)
%142 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 1
%143 = load i32, i32* %142
%144 = load i32, i32* @STDOUT_FILENO
%145 = call i32 @dup2(i32 %143, i32 %144)
br label %146
146: ; preds = %139, %134
%147 = load i8*, i8** %9
%148 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %147, i32* null)
%149 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%150 = call i32 (...) @abort()
unreachable
151: ; preds = %126, %82, %76
%152 = load i32, i32* %3
ret i32 %152
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"pipe\00"
@.str.2 = [5 x i8] c"fork\00"
@WUNTRACED = global i32 0
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [6 x i8] c"%f %f\00"
@.str.5 = [8 x i8] c"command\00"
@STDOUT_FILENO = global i32 0
@.str.6 = [3 x i8] c"sh\00"
@.str.7 = [3 x i8] c"-c\00"
@.str.8 = [7 x i8] c"execlp\00"
define i32 @guess_by_command(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32]
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = sext i32 %0 to i64
%8 = bitcast [2 x i32]* %3 to i8*
%9 = icmp eq i32 %0, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = tail call i8* @alloca(i64 %7)
br label %41
12: ; preds = %2
%13 = call i64 @llvm.umax.i64(i64 %7, i64 1)
br label %14
14: ; preds = %12, %14
%15 = phi i64 [ %20, %14 ], [ %7, %12 ]
%16 = phi i64 [ %21, %14 ], [ 0, %12 ]
%17 = getelementptr inbounds i8*, i8** %1, i64 %16
%18 = load i8*, i8** %17
%19 = tail call i64 @strlen(i8* dereferenceable(1) %18)
%20 = add i64 %19, %15
%21 = add nuw i64 %16, 1
%22 = icmp eq i64 %21, %13
br i1 %22, label %23, label %14
23: ; preds = %14
%24 = tail call i8* @alloca(i64 %20)
br i1 %9, label %41, label %25
25: ; preds = %23
%26 = call i64 @llvm.umax.i64(i64 %7, i64 1)
br label %27
27: ; preds = %25, %27
%28 = phi i64 [ %39, %27 ], [ 0, %25 ]
%29 = phi i64 [ %37, %27 ], [ 0, %25 ]
%30 = getelementptr inbounds i8, i8* %24, i64 %29
%31 = getelementptr inbounds i8*, i8** %1, i64 %28
%32 = load i8*, i8** %31
%33 = tail call i32 @snprintf(i8* %30, i64 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %32)
%34 = load i8*, i8** %31
%35 = tail call i64 @strlen(i8* dereferenceable(1) %34)
%36 = add i64 %35, %29
%37 = add i64 %36, 1
%38 = getelementptr inbounds i8, i8* %24, i64 %36
store i8 32, i8* %38
%39 = add nuw i64 %28, 1
%40 = icmp eq i64 %39, %26
br i1 %40, label %41, label %27
41: ; preds = %27, %10, %23
%42 = phi i8* [ %11, %10 ], [ %24, %23 ], [ %24, %27 ]
%43 = phi i64 [ 0, %10 ], [ %20, %23 ], [ %20, %27 ]
%44 = getelementptr inbounds i8, i8* %42, i64 %43
%45 = getelementptr inbounds i8, i8* %44, i64 -1
store i8 0, i8* %45
%46 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%47 = call i64 @pipe(i32* %46)
%48 = icmp eq i64 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %41
%50 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %108
51: ; preds = %41
%52 = call i64 (...) @fork()
switch i64 %52, label %60 [
i64 -1, label %53
i64 0, label %94
]
53: ; preds = %51
%54 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%55 = load i32, i32* %46
%56 = call i32 @close(i32 %55)
%57 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%58 = load i32, i32* %57
%59 = call i32 @close(i32 %58)
br label %108
60: ; preds = %51
%61 = bitcast i32* %4 to i8*
%62 = bitcast float* %5 to i8*
%63 = bitcast float* %6 to i8*
%64 = load i32, i32* @WUNTRACED
%65 = call i32 @waitpid(i64 %52, i32* %4, i32 %64)
%66 = load i32, i32* %4
%67 = call i64 @WIFEXITED(i32 %66)
%68 = icmp eq i64 %67, 0
br i1 %68, label %87, label %69
69: ; preds = %60
%70 = load i32, i32* %4
%71 = call i32 @WEXITSTATUS(i32 %70)
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %87
73: ; preds = %69
%74 = load i32, i32* %46
%75 = call i32* @fdopen(i32 %74, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%76 = icmp eq i32* %75, null
br i1 %76, label %87, label %77
77: ; preds = %73
%78 = call i32 @fscanf(i32* %75, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), float* %5, float* %6)
%79 = icmp eq i32 %78, 2
br i1 %79, label %80, label %84
80: ; preds = %77
%81 = load float, float* %5
%82 = load float, float* %6
%83 = call i32 @report(float %81, float %82, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), i32 1, i32 0)
br label %84
84: ; preds = %77, %80
%85 = zext i1 %79 to i32
%86 = call i32 @fclose(i32* %75)
br label %87
87: ; preds = %60, %73, %69, %84
%88 = phi i32 [ %85, %84 ], [ 1, %69 ], [ 1, %73 ], [ 1, %60 ]
%89 = load i32, i32* %46
%90 = call i32 @close(i32 %89)
%91 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%92 = load i32, i32* %91
%93 = call i32 @close(i32 %92)
br label %108
94: ; preds = %51
%95 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
%96 = load i32, i32* %95
%97 = load i32, i32* @STDOUT_FILENO
%98 = icmp eq i32 %96, %97
br i1 %98, label %104, label %99
99: ; preds = %94
%100 = call i32 @close(i32 %97)
%101 = load i32, i32* %95
%102 = load i32, i32* @STDOUT_FILENO
%103 = call i32 @dup2(i32 %101, i32 %102)
br label %104
104: ; preds = %99, %94
%105 = call i32 @execlp(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %42, i32* null)
%106 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%107 = call i32 (...) @abort()
unreachable
108: ; preds = %87, %53, %49
%109 = phi i32 [ 1, %49 ], [ 1, %53 ], [ %88, %87 ]
ret i32 %109
}