#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 */
struct timezone {
  int dummy;
};
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int pid_t;

/* Variables and functions */
int atoi(char *);
scalar_t__ execl(char *, char *, char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ getpid();
scalar_t__ getppid();
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ reconstruir(int, char *);
int /*<<< orphan*/ reparto(int *, int *, int, int);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ wait(int /*<<< orphan*/);
main(int argc, char *argv[]) {
  char prefijo[256];
  int nprocesos;
  int resto;
  register int i;
  int finicio, ffin;
  char str_finicio[256], str_ffin[256];
  pid_t pid;
  struct timeval tiempo;
  struct timezone tz;
  unsigned long inicio, fin;
  if (argc != 3) {
    fprintf(stderr, "Usar: producto fichero numero_de_procesos\n");
    exit(-1);
  }
  nprocesos = atoi(argv[2]);
  if (nprocesos < 1 || nprocesos > 512) {
    fprintf(stderr, "numero de procesos erroneo\n");
    exit(-1);
  }
  gettimeofday(&tiempo, &tz);
  inicio = tiempo.tv_sec * 1000000 + tiempo.tv_usec;
  for (i = 1; i <= nprocesos; i++) {
    if ((pid = fork()) == -1)
      fprintf(stderr, "error crear proceso %ld, con padre %ld", (long)getpid(),
              (long)getppid());
    if (pid == 0) {
      reparto(&finicio, &ffin, nprocesos, i);
      sprintf(str_finicio, "%d", finicio);
      sprintf(str_ffin, "%d", ffin);
      printf("subproducto %s %d %d\n", argv[1], finicio, ffin);
      if (execl("subproducto", "subproducto", argv[1], str_finicio, str_ffin,
                NULL) < 0) {
        perror("Fallo en la ejecución de execl.");
        exit(-1);
      }
    }
  }
  printf("procesos  subproducto lanzados %d\n", i - 1);
  for (i--; i >= 0; i--)
    wait(0);
  reconstruir(nprocesos, argv[1]);
  gettimeofday(&tiempo, &tz);
  fin = tiempo.tv_sec * 1000000 + tiempo.tv_usec;
  printf("Segundos empleados para el calculo: %f\n",
         (float)(fin - inicio) / 1000000.0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x370,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1224 <main+0x44>
mov    0x2dd6(%rip),%rax
mov    (%rax),%edi
lea    0xdf5(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10a0 <atoi@plt>
mov    %eax,-0x114(%rbp)
cmpl   $0x1,-0x114(%rbp)
jl     1254 <main+0x74>
cmpl   $0x200,-0x114(%rbp)
jle    1275 <main+0x95>
mov    0x2d85(%rip),%rax
mov    (%rax),%edi
lea    0xdcf(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
lea    -0x340(%rbp),%rdi
lea    -0x348(%rbp),%rsi
call   1060 <gettimeofday@plt>
imul   $0xf4240,-0x340(%rbp),%eax
add    -0x33c(%rbp),%eax
cltq
mov    %rax,-0x350(%rbp)
movl   $0x1,-0x11c(%rbp)
mov    -0x11c(%rbp),%eax
cmp    -0x114(%rbp),%eax
jg     13fd <main+0x21d>
mov    $0x0,%al
call   1100 <fork@plt>
mov    %eax,-0x334(%rbp)
cmp    $0xffffffff,%eax
jne    1315 <main+0x135>
mov    0x2d06(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x364(%rbp)
mov    $0x0,%al
call   1040 <getpid@plt>
mov    %rax,-0x360(%rbp)
mov    $0x0,%al
call   10c0 <getppid@plt>
mov    -0x364(%rbp),%edi
mov    -0x360(%rbp),%rdx
mov    %rax,%rcx
lea    0xd41(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
cmpl   $0x0,-0x334(%rbp)
jne    13e4 <main+0x204>
mov    -0x114(%rbp),%edx
mov    -0x11c(%rbp),%ecx
lea    -0x120(%rbp),%rdi
lea    -0x124(%rbp),%rsi
call   1030 <reparto@plt>
lea    -0x230(%rbp),%rdi
mov    -0x120(%rbp),%edx
lea    0xd21(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x330(%rbp),%rdi
mov    -0x124(%rbp),%edx
lea    0xd08(%rip),%rsi
call   10b0 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x120(%rbp),%edx
mov    -0x124(%rbp),%ecx
lea    0xceb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    -0x230(%rbp),%rcx
lea    -0x330(%rbp),%r8
lea    0xcdd(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r9d
mov    %rsi,%rdi
call   10e0 <execl@plt>
cmp    $0x0,%rax
jge    13df <main+0x1ff>
lea    0xccb(%rip),%rdi
call   1090 <perror@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
jmp    13e4 <main+0x204>
jmp    13e9 <main+0x209>
mov    -0x11c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x11c(%rbp)
jmp    12ab <main+0xcb>
mov    -0x11c(%rbp),%esi
sub    $0x1,%esi
lea    0xcaf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x11c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x11c(%rbp)
cmpl   $0x0,-0x11c(%rbp)
jl     144b <main+0x26b>
xor    %edi,%edi
call   10f0 <wait@plt>
mov    -0x11c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x11c(%rbp)
jmp    1423 <main+0x243>
mov    -0x114(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1070 <reconstruir@plt>
lea    -0x340(%rbp),%rdi
lea    -0x348(%rbp),%rsi
call   1060 <gettimeofday@plt>
mov    -0x340(%rbp),%eax
mov    -0x33c(%rbp),%ecx
imul   $0xf4240,%eax,%eax
add    %ecx,%eax
cltq
mov    %rax,-0x358(%rbp)
mov    -0x358(%rbp),%rax
mov    -0x350(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,%rdx
shr    %rdx
mov    %eax,%ecx
and    $0x1,%ecx
or     %rdx,%rcx
cvtsi2ss %rcx,%xmm0
addss  %xmm0,%xmm0
cvtsi2ss %rax,%xmm1
movss  %xmm1,-0x36c(%rbp)
ff
test   %rax,%rax
movss  %xmm0,-0x368(%rbp)
ff
js     14e4 <main+0x304>
movss  -0x36c(%rbp),%xmm0
ff
movss  %xmm0,-0x368(%rbp)
ff
movss  -0x368(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xb08(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xbdc(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x370,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x238,%rsp
cmp    $0x3,%edi
jne    1413 <main+0x233>
mov    %rsi,0x18(%rsp)
mov    0x10(%rsi),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r12d
lea    -0x201(%r12),%eax
ff
cmp    $0xfffffdff,%eax
jbe    1425 <main+0x245>
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
call   1060 <gettimeofday@plt>
movslq (%rsp),%rax
mov    %rax,0x20(%rsp)
movslq 0x4(%rsp),%rax
mov    %rax,0x28(%rsp)
mov    %r12d,%r14d
neg    %r14d
mov    $0x1,%ebx
jmp    12ed <main+0x10d>
xchg   %ax,%ax
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    %r12d,%edx
mov    %ebx,%ecx
call   1030 <reparto@plt>
mov    0xc(%rsp),%edx
lea    0x130(%rsp),%r13
mov    %r13,%rdi
lea    0xdfc(%rip),%rbp
mov    %rbp,%rsi
call   10b0 <sprintf@plt>
mov    0x8(%rsp),%edx
lea    0x30(%rsp),%r15
mov    %r15,%rdi
mov    %rbp,%rsi
call   10b0 <sprintf@plt>
mov    0x18(%rsp),%rbp
mov    0x8(%rbp),%rsi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0xdcb(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%rbp),%rdx
lea    0xdcf(%rip),%rdi
mov    %rdi,%rsi
mov    %r13,%rcx
mov    %r15,%r8
xor    %r9d,%r9d
call   10e0 <execl@plt>
test   %rax,%rax
js     13fd <main+0x21d>
lea    (%r14,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
je     133b <main+0x15b>
xor    %eax,%eax
call   1100 <fork@plt>
test   %eax,%eax
je     1250 <main+0x70>
cmp    $0xffffffff,%eax
jne    12da <main+0xfa>
mov    %r12,%rbp
mov    0x2cd5(%rip),%rax
mov    (%rax),%r12d
xor    %eax,%eax
call   1040 <getpid@plt>
mov    %rax,%r13
xor    %eax,%eax
call   10c0 <getppid@plt>
mov    %r12d,%edi
mov    %rbp,%r12
lea    0xd23(%rip),%rsi
mov    %r13,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
jmp    12da <main+0xfa>
lea    0xd7a(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12d,%ebx
add    $0x2,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %edi,%edi
call   10f0 <wait@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
jg     1360 <main+0x180>
imul   $0xf4240,0x20(%rsp),%rbx
add    0x28(%rsp),%rbx
mov    0x18(%rsp),%rax
mov    0x8(%rax),%rsi
mov    %r12d,%edi
call   1070 <reconstruir@plt>
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
call   1060 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0xf4240,%rax,%rcx
movslq 0x4(%rsp),%rax
add    %rcx,%rax
sub    %rbx,%rax
js     13ba <main+0x1da>
cvtsi2ss %rax,%xmm0
jmp    13cf <main+0x1ef>
mov    %rax,%rcx
shr    %rcx
and    $0x1,%eax
or     %rcx,%rax
cvtsi2ss %rax,%xmm0
addss  %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
divsd  0xc25(%rip),%xmm0
lea    0xcfd(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x238,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc97(%rip),%rdi
call   1090 <perror@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>
mov    0x2bc6(%rip),%rax
mov    (%rax),%edi
lea    0xbe5(%rip),%rsi
jmp    1435 <main+0x255>
mov    0x2bb4(%rip),%rax
mov    (%rax),%edi
lea    0xbfe(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
@stderr = global i32 0
@.str = [43 x i8] c"Usar: producto fichero numero_de_procesos\0A\00"
@.str.1 = [28 x i8] c"numero de procesos erroneo\0A\00"
@.str.2 = [39 x i8] c"error crear proceso %ld, con padre %ld\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [22 x i8] c"subproducto %s %d %d\0A\00"
@.str.5 = [12 x i8] c"subproducto\00"
@.str.6 = [33 x i8] c"Fallo en la ejecuci\C3\B3n de execl.\00"
@.str.7 = [35 x i8] c"procesos subproducto lanzados %d\0A\00"
@.str.8 = [40 x i8] c"Segundos empleados para el calculo: %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [256 x i8]
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [256 x i8]
%13 = alloca [256 x i8]
%14 = alloca i32
%15 = alloca %struct.timeval
%16 = alloca %struct.timezone
%17 = alloca i64
%18 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 3
br i1 %20, label %21, label %25
21: ; preds = %2
%22 = load i32, i32* @stderr
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %2
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 2
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = icmp slt i32 %30, 1
br i1 %31, label %35, label %32
32: ; preds = %25
%33 = load i32, i32* %7
%34 = icmp sgt i32 %33, 512
br i1 %34, label %35, label %39
35: ; preds = %32, %25
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%38 = call i32 @exit(i32 -1)
unreachable
39: ; preds = %32
%40 = call i32 @gettimeofday(%struct.timeval* %15, %struct.timezone* %16)
%41 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 0
%42 = load i32, i32* %41
%43 = mul nsw i32 %42, 1000000
%44 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%45 = load i32, i32* %44
%46 = add nsw i32 %43, %45
%47 = sext i32 %46 to i64
store i64 %47, i64* %17
store i32 1, i32* %9
br label %48
48: ; preds = %91, %39
%49 = load i32, i32* %9
%50 = load i32, i32* %7
%51 = icmp sle i32 %49, %50
br i1 %51, label %52, label %94
52: ; preds = %48
%53 = call i32 (...) @fork()
store i32 %53, i32* %14
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %60
55: ; preds = %52
%56 = load i32, i32* @stderr
%57 = call i64 (...) @getpid()
%58 = call i64 (...) @getppid()
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %56, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i64 %57, i64 %58)
br label %60
60: ; preds = %55, %52
%61 = load i32, i32* %14
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %90
63: ; preds = %60
%64 = load i32, i32* %7
%65 = load i32, i32* %9
%66 = call i32 @reparto(i32* %10, i32* %11, i32 %64, i32 %65)
%67 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%68 = load i32, i32* %10
%69 = call i32 @sprintf(i8* %67, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %68)
%70 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%71 = load i32, i32* %11
%72 = call i32 @sprintf(i8* %70, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %71)
%73 = load i8**, i8*** %5
%74 = getelementptr inbounds i8*, i8** %73, i64 1
%75 = load i8*, i8** %74
%76 = load i32, i32* %10
%77 = load i32, i32* %11
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %75, i32 %76, i32 %77)
%79 = load i8**, i8*** %5
%80 = getelementptr inbounds i8*, i8** %79, i64 1
%81 = load i8*, i8** %80
%82 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%84 = call i64 @execl(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %81, i8* %82, i8* %83, i32* null)
%85 = icmp slt i64 %84, 0
br i1 %85, label %86, label %89
86: ; preds = %63
%87 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%88 = call i32 @exit(i32 -1)
unreachable
89: ; preds = %63
br label %90
90: ; preds = %89, %60
br label %91
91: ; preds = %90
%92 = load i32, i32* %9
%93 = add nsw i32 %92, 1
store i32 %93, i32* %9
br label %48
94: ; preds = %48
%95 = load i32, i32* %9
%96 = sub nsw i32 %95, 1
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i32 %96)
%98 = load i32, i32* %9
%99 = add nsw i32 %98, -1
store i32 %99, i32* %9
br label %100
100: ; preds = %105, %94
%101 = load i32, i32* %9
%102 = icmp sge i32 %101, 0
br i1 %102, label %103, label %108
103: ; preds = %100
%104 = call i32 @wait(i32 0)
br label %105
105: ; preds = %103
%106 = load i32, i32* %9
%107 = add nsw i32 %106, -1
store i32 %107, i32* %9
br label %100
108: ; preds = %100
%109 = load i32, i32* %7
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 1
%112 = load i8*, i8** %111
%113 = call i32 @reconstruir(i32 %109, i8* %112)
%114 = call i32 @gettimeofday(%struct.timeval* %15, %struct.timezone* %16)
%115 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 0
%116 = load i32, i32* %115
%117 = mul nsw i32 %116, 1000000
%118 = getelementptr inbounds %struct.timeval, %struct.timeval* %15, i32 0, i32 1
%119 = load i32, i32* %118
%120 = add nsw i32 %117, %119
%121 = sext i32 %120 to i64
store i64 %121, i64* %18
%122 = load i64, i64* %18
%123 = load i64, i64* %17
%124 = sub i64 %122, %123
%125 = uitofp i64 %124 to float
%126 = fpext float %125 to double
%127 = fdiv double %126, 1.000000e+06
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), double %127)
%129 = load i32, i32* %3
ret i32 %129
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
%struct.timezone = type { i32 }
@stderr = global i32 0
@.str = [43 x i8] c"Usar: producto fichero numero_de_procesos\0A\00"
@.str.1 = [28 x i8] c"numero de procesos erroneo\0A\00"
@.str.2 = [39 x i8] c"error crear proceso %ld, con padre %ld\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [22 x i8] c"subproducto %s %d %d\0A\00"
@.str.5 = [12 x i8] c"subproducto\00"
@.str.6 = [33 x i8] c"Fallo en la ejecuci\C3\B3n de execl.\00"
@.str.7 = [35 x i8] c"procesos subproducto lanzados %d\0A\00"
@.str.8 = [40 x i8] c"Segundos empleados para el calculo: %f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = alloca [256 x i8]
%7 = alloca %struct.timeval
%8 = alloca %struct.timezone
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%13 = bitcast %struct.timeval* %7 to i8*
%14 = bitcast %struct.timezone* %8 to i8*
%15 = icmp eq i32 %0, 3
br i1 %15, label %20, label %16
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @exit(i32 -1)
unreachable
20: ; preds = %2
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32 @atoi(i8* %22)
%24 = add i32 %23, -513
%25 = icmp ult i32 %24, -512
br i1 %25, label %26, label %30
26: ; preds = %20
%27 = load i32, i32* @stderr
%28 = tail call i32 (i32, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0))
%29 = tail call i32 @exit(i32 -1)
unreachable
30: ; preds = %20
%31 = call i32 @gettimeofday(%struct.timeval* %7, %struct.timezone* %8)
%32 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i64 0, i32 0
%33 = load i32, i32* %32
%34 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i64 0, i32 1
%35 = load i32, i32* %34
%36 = getelementptr inbounds i8*, i8** %1, i64 1
%37 = add nuw nsw i32 %23, 1
br label %38
38: ; preds = %30, %62
%39 = phi i32 [ 1, %30 ], [ %63, %62 ]
%40 = call i32 (...) @fork()
switch i32 %40, label %62 [
i32 -1, label %41
i32 0, label %46
]
41: ; preds = %38
%42 = load i32, i32* @stderr
%43 = call i64 (...) @getpid()
%44 = call i64 (...) @getppid()
%45 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i64 %43, i64 %44)
br label %62
46: ; preds = %38
%47 = call i32 @reparto(i32* %3, i32* %4, i32 %23, i32 %39)
%48 = load i32, i32* %3
%49 = call i32 @sprintf(i8* %11, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %4
%51 = call i32 @sprintf(i8* %12, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %50)
%52 = load i8*, i8** %36
%53 = load i32, i32* %3
%54 = load i32, i32* %4
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i8* %52, i32 %53, i32 %54)
%56 = load i8*, i8** %36
%57 = call i64 @execl(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i8* %56, i8* %11, i8* %12, i32* null)
%58 = icmp slt i64 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %46
%60 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.6, i64 0, i64 0))
%61 = call i32 @exit(i32 -1)
unreachable
62: ; preds = %41, %38, %46
%63 = add nuw i32 %39, 1
%64 = icmp eq i32 %39, %23
br i1 %64, label %65, label %38
65: ; preds = %62
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i32 %23)
br label %67
67: ; preds = %65, %67
%68 = phi i32 [ %69, %67 ], [ %37, %65 ]
%69 = add nsw i32 %68, -1
%70 = call i32 @wait(i32 0)
%71 = icmp sgt i32 %68, 1
br i1 %71, label %67, label %72
72: ; preds = %67
%73 = mul nsw i32 %33, 1000000
%74 = add nsw i32 %73, %35
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds i8*, i8** %1, i64 1
%77 = load i8*, i8** %76
%78 = call i32 @reconstruir(i32 %23, i8* %77)
%79 = call i32 @gettimeofday(%struct.timeval* %7, %struct.timezone* %8)
%80 = load i32, i32* %32
%81 = mul nsw i32 %80, 1000000
%82 = load i32, i32* %34
%83 = add nsw i32 %81, %82
%84 = sext i32 %83 to i64
%85 = sub nsw i64 %84, %75
%86 = uitofp i64 %85 to float
%87 = fpext float %86 to double
%88 = fdiv double %87, 1.000000e+06
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), double %88)
ret i32 0
}