#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 */
int /*<<< orphan*/ close(int /*<<< orphan*/ *);
int dynamic_pipelining(int *, int *, int *, int, int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, int *);
int *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int strlen(char *);
int main(int argc, char *argv[]) {
  int i, m = 0, j = 1, n;
  if (argc != 3) {
    printf("Usage: %s <number_of_processors> <instance_filename>\n", argv[0]);
    exit(0);
  }
  for (i = strlen(argv[1]); i > 0; i--) {
    m += ((*(argv[1] + i - 1)) - '0') * j;
    j = j * 10;
  }
  FILE *fp_in;
  fp_in = fopen(argv[2], "r");
  if (fp_in != NULL) {
    fscanf(fp_in, "%d", &n);
  } else {
    printf("Cant open file %s\n", argv[2]);
    exit(0);
  }
  int P[n], PS[n + 1];
  PS[0] = 0;
  for (i = 0; i < n; i++) {
    if ((fscanf(fp_in, "%d", &P[i])) > 0) {
      PS[i + 1] = PS[i] + P[i];
    } else {
      printf("Not enough arguments in Instance file\n");
      exit(0);
    }
  }
  close(fp_in);
  printf("\nNumber of tasks: %d\n", n);
  printf("Number of processors: %d\n", m);
  printf("Ltotal = %d\n", PS[n]);
  int *L;
  L = malloc(sizeof(int) * m * (n + 1));
  int Ldynamic = dynamic_pipelining(P, PS, L, m, n);
  printf("The max load using dynamic pipelining is %d\n\n", Ldynamic);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11ca <main+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1217 <main+0x97>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x14(%rbp),%rcx
movsbl -0x1(%rax,%rcx,1),%eax
sub    $0x30,%eax
imul   -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
imul   $0xa,-0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11da <main+0x5a>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe10(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1253 <main+0xd3>
mov    -0x28(%rbp),%rdi
lea    0xdf3(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <fscanf@plt>
jmp    1270 <main+0xf0>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    -0x20(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x60(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,%ecx
lea    0xf(,%rcx,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rax
sub    %rdx,%rax
mov    %rax,-0x58(%rbp)
mov    %rax,%rsp
mov    %rcx,-0x40(%rbp)
movl   $0x0,(%rax)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    134d <main+0x1cd>
mov    -0x60(%rbp),%rdx
mov    -0x28(%rbp),%rdi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
lea    0xd49(%rip),%rsi
call   1050 <fscanf@plt>
cmp    $0x0,%rax
jle    1325 <main+0x1a5>
mov    -0x58(%rbp),%rax
mov    -0x60(%rbp),%rcx
movslq -0x14(%rbp),%rdx
mov    (%rax,%rdx,4),%edx
movslq -0x14(%rbp),%rsi
add    (%rcx,%rsi,4),%edx
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    133a <main+0x1ba>
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
jmp    133f <main+0x1bf>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12c9 <main+0x149>
mov    -0x28(%rbp),%rdi
call   1060 <close@plt>
mov    -0x20(%rbp),%esi
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xd1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x58(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd1b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x18(%rbp),%rax
shl    $0x2,%rax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
imul   %rcx,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    -0x60(%rbp),%rdi
mov    -0x58(%rbp),%rsi
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8d
call   1080 <dynamic_pipelining@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%esi
lea    0xcdc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
cmp    $0x3,%edi
jne    13e0 <main+0x250>
mov    0x8(%r14),%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11da <main+0x4a>
mov    0x8(%r14),%r9
mov    %eax,%esi
lea    -0x1(%rsi),%rcx
mov    %esi,%r8d
and    $0x3,%r8d
cmp    $0x3,%rcx
jae    11e1 <main+0x51>
mov    $0x1,%ecx
xor    %ebx,%ebx
jmp    1245 <main+0xb5>
xor    %ebx,%ebx
jmp    127a <main+0xea>
mov    %esi,%edi
and    $0xfffffffc,%edi
mov    $0x1,%ecx
xor    %ebx,%ebx
nopl   (%rax)
movsbl -0x1(%r9,%rsi,1),%eax
add    $0xffffffd0,%eax
imul   %ecx,%eax
add    %ebx,%eax
movsbl -0x2(%r9,%rsi,1),%ebx
add    $0xffffffd0,%ebx
imul   %ecx,%ebx
lea    (%rbx,%rbx,4),%ebx
lea    (%rax,%rbx,2),%eax
movsbl -0x3(%r9,%rsi,1),%ebx
add    $0xffffffd0,%ebx
imul   %ecx,%ebx
imul   $0x64,%ebx,%edx
add    %eax,%edx
movsbl -0x4(%r9,%rsi,1),%eax
add    $0xffffffd0,%eax
imul   %ecx,%eax
imul   $0x3e8,%eax,%ebx
add    %edx,%ebx
imul   $0x2710,%ecx,%ecx
add    $0xfffffffffffffffc,%rsi
add    $0xfffffffffffffffc,%rdi
jne    11f0 <main+0x60>
test   %r8,%r8
je     127a <main+0xea>
lea    (%rsi,%r9,1),%rdx
add    $0xffffffffffffffff,%rdx
neg    %r8
xor    %esi,%esi
nopw   0x0(%rax,%rax,1)
movsbl (%rdx,%rsi,1),%eax
add    $0xffffffd0,%eax
imul   %ecx,%eax
add    %eax,%ebx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
add    $0xffffffffffffffff,%rsi
cmp    %rsi,%r8
jne    1260 <main+0xd0>
mov    0x10(%r14),%rdi
lea    0xdb1(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     13ec <main+0x25c>
lea    0xd9e(%rip),%rsi
lea    -0x2c(%rbp),%rdx
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1060 <fscanf@plt>
mov    -0x38(%rbp),%rdi
mov    %rsp,-0x48(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%rcx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    -0x2c(%rbp),%eax
lea    0x1(%rax),%ecx
mov    %rsp,%rdx
lea    0xf(,%rcx,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rdx,%rsi
sub    %rcx,%rsi
mov    %rsi,%r15
mov    %rsi,%rsp
neg    %rcx
movl   $0x0,(%rdx,%rcx,1)
test   %eax,%eax
jle    1345 <main+0x1b5>
xor    %r13d,%r13d
mov    -0x40(%rbp),%r14
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
lea    0xd21(%rip),%rsi
mov    %r14,%rdx
call   1060 <fscanf@plt>
test   %rax,%rax
jle    13cd <main+0x23d>
add    (%r14),%r13d
mov    %r13d,0x4(%r15,%r12,4)
add    $0x1,%r12
movslq -0x2c(%rbp),%rax
add    $0x4,%r14
cmp    %rax,%r12
mov    -0x38(%rbp),%rdi
jl     1310 <main+0x180>
call   1070 <close@plt>
mov    -0x2c(%rbp),%esi
lea    0xcfa(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd02(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
movslq -0x2c(%rbp),%rax
mov    (%r15,%rax,4),%esi
lea    0xd04(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x2c(%rbp),%r14d
lea    0x1(%r14),%edi
imul   %ebx,%edi
shl    $0x2,%edi
call   1080 <malloc@plt>
mov    -0x40(%rbp),%rdi
mov    %r15,%rsi
mov    %rax,%rdx
mov    %ebx,%ecx
mov    %r14d,%r8d
call   1090 <dynamic_pipelining@plt>
lea    0xcdc(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x48(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xce5(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    (%r14),%rsi
lea    0xc16(%rip),%rdi
jmp    13f7 <main+0x267>
mov    0x10(%r14),%rsi
lea    0xc44(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [54 x i8] c"Usage: %s <number_of_processors> <instance_filename>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c"Cant open file %s\0A\00"
@.str.4 = [39 x i8] c"Not enough arguments in Instance file\0A\00"
@.str.5 = [22 x i8] c"\0ANumber of tasks: %d\0A\00"
@.str.6 = [26 x i8] c"Number of processors: %d\0A\00"
@.str.7 = [13 x i8] c"Ltotal = %d\0A\00"
@.str.8 = [46 x i8] c"The max load using dynamic pipelining is %d\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i64
%14 = alloca i32*
%15 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %7
store i32 1, i32* %8
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 3
br i1 %17, label %18, label %24
18: ; preds = %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 0
%21 = load i8*, i8** %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %21)
%23 = call i32 @exit(i32 0)
unreachable
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 @strlen(i8* %27)
store i32 %28, i32* %6
br label %29
29: ; preds = %49, %24
%30 = load i32, i32* %6
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %52
32: ; preds = %29
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = getelementptr inbounds i8, i8* %38, i64 -1
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = sub nsw i32 %41, 48
%43 = load i32, i32* %8
%44 = mul nsw i32 %42, %43
%45 = load i32, i32* %7
%46 = add nsw i32 %45, %44
store i32 %46, i32* %7
%47 = load i32, i32* %8
%48 = mul nsw i32 %47, 10
store i32 %48, i32* %8
br label %49
49: ; preds = %32
%50 = load i32, i32* %6
%51 = add nsw i32 %50, -1
store i32 %51, i32* %6
br label %29
52: ; preds = %29
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 2
%55 = load i8*, i8** %54
%56 = call i32* @fopen(i8* %55, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %56, i32** %10
%57 = load i32*, i32** %10
%58 = icmp ne i32* %57, null
br i1 %58, label %59, label %62
59: ; preds = %52
%60 = load i32*, i32** %10
%61 = call i64 @fscanf(i32* %60, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %9)
br label %68
62: ; preds = %52
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 2
%65 = load i8*, i8** %64
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %65)
%67 = call i32 @exit(i32 0)
unreachable
68: ; preds = %59
%69 = load i32, i32* %9
%70 = zext i32 %69 to i64
%71 = call i8* @llvm.stacksave()
store i8* %71, i8** %11
%72 = alloca i32, i64 %70
store i64 %70, i64* %12
%73 = load i32, i32* %9
%74 = add nsw i32 %73, 1
%75 = zext i32 %74 to i64
%76 = alloca i32, i64 %75
store i64 %75, i64* %13
%77 = getelementptr inbounds i32, i32* %76, i64 0
store i32 0, i32* %77
store i32 0, i32* %6
br label %78
78: ; preds = %107, %68
%79 = load i32, i32* %6
%80 = load i32, i32* %9
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %110
82: ; preds = %78
%83 = load i32*, i32** %10
%84 = load i32, i32* %6
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds i32, i32* %72, i64 %85
%87 = call i64 @fscanf(i32* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %86)
%88 = icmp sgt i64 %87, 0
br i1 %88, label %89, label %103
89: ; preds = %82
%90 = load i32, i32* %6
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds i32, i32* %76, i64 %91
%93 = load i32, i32* %92
%94 = load i32, i32* %6
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds i32, i32* %72, i64 %95
%97 = load i32, i32* %96
%98 = add nsw i32 %93, %97
%99 = load i32, i32* %6
%100 = add nsw i32 %99, 1
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i32, i32* %76, i64 %101
store i32 %98, i32* %102
br label %106
103: ; preds = %82
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0))
%105 = call i32 @exit(i32 0)
unreachable
106: ; preds = %89
br label %107
107: ; preds = %106
%108 = load i32, i32* %6
%109 = add nsw i32 %108, 1
store i32 %109, i32* %6
br label %78
110: ; preds = %78
%111 = load i32*, i32** %10
%112 = call i32 @close(i32* %111)
%113 = load i32, i32* %9
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %113)
%115 = load i32, i32* %7
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %115)
%117 = load i32, i32* %9
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i32, i32* %76, i64 %118
%120 = load i32, i32* %119
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %120)
%122 = load i32, i32* %7
%123 = sext i32 %122 to i64
%124 = mul i64 4, %123
%125 = load i32, i32* %9
%126 = add nsw i32 %125, 1
%127 = sext i32 %126 to i64
%128 = mul i64 %124, %127
%129 = trunc i64 %128 to i32
%130 = call i32* @malloc(i32 %129)
store i32* %130, i32** %14
%131 = load i32*, i32** %14
%132 = load i32, i32* %7
%133 = load i32, i32* %9
%134 = call i32 @dynamic_pipelining(i32* %72, i32* %76, i32* %131, i32 %132, i32 %133)
store i32 %134, i32* %15
%135 = load i32, i32* %15
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 %135)
%137 = load i8*, i8** %11
%138 = load i32, i32* %3
ret i32 %138
}

LLVM IR (-O2):
@.str = [54 x i8] c"Usage: %s <number_of_processors> <instance_filename>\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c"Cant open file %s\0A\00"
@.str.5 = [22 x i8] c"\0ANumber of tasks: %d\0A\00"
@.str.6 = [26 x i8] c"Number of processors: %d\0A\00"
@.str.7 = [13 x i8] c"Ltotal = %d\0A\00"
@.str.8 = [46 x i8] c"The max load using dynamic pipelining is %d\0A\0A\00"
@str = [38 x i8] c"Not enough arguments in Instance file\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp eq i32 %0, 3
br i1 %5, label %10, label %6
6: ; preds = %2
%7 = load i8*, i8** %1
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = tail call i32 @exit(i32 0)
unreachable
10: ; preds = %2
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @strlen(i8* %12)
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %84
15: ; preds = %10
%16 = load i8*, i8** %11
%17 = zext i32 %13 to i64
%18 = getelementptr inbounds i8, i8* %16, i64 -1
%19 = add nsw i64 %17, -1
%20 = and i64 %17, 3
%21 = icmp ult i64 %19, 3
br i1 %21, label %63, label %22
22: ; preds = %15
%23 = and i64 %17, 4294967292
br label %24
24: ; preds = %24, %22
%25 = phi i64 [ %17, %22 ], [ %60, %24 ]
%26 = phi i32 [ 0, %22 ], [ %58, %24 ]
%27 = phi i32 [ 1, %22 ], [ %59, %24 ]
%28 = phi i64 [ 0, %22 ], [ %61, %24 ]
%29 = getelementptr inbounds i8, i8* %18, i64 %25
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = add nsw i32 %31, -48
%33 = mul nsw i32 %32, %27
%34 = add nsw i32 %33, %26
%35 = mul nsw i32 %27, 10
%36 = add nsw i64 %25, -1
%37 = getelementptr inbounds i8, i8* %18, i64 %36
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = add nsw i32 %39, -48
%41 = mul nsw i32 %40, %35
%42 = add nsw i32 %41, %34
%43 = mul i32 %27, 100
%44 = add nsw i64 %25, -2
%45 = getelementptr inbounds i8, i8* %18, i64 %44
%46 = load i8, i8* %45
%47 = sext i8 %46 to i32
%48 = add nsw i32 %47, -48
%49 = mul nsw i32 %48, %43
%50 = add nsw i32 %49, %42
%51 = mul i32 %27, 1000
%52 = add nsw i64 %25, -3
%53 = getelementptr inbounds i8, i8* %18, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = add nsw i32 %55, -48
%57 = mul nsw i32 %56, %51
%58 = add nsw i32 %57, %50
%59 = mul i32 %27, 10000
%60 = add nsw i64 %25, -4
%61 = add i64 %28, 4
%62 = icmp eq i64 %61, %23
br i1 %62, label %63, label %24
63: ; preds = %24, %15
%64 = phi i32 [ undef, %15 ], [ %58, %24 ]
%65 = phi i64 [ %17, %15 ], [ %60, %24 ]
%66 = phi i32 [ 0, %15 ], [ %58, %24 ]
%67 = phi i32 [ 1, %15 ], [ %59, %24 ]
%68 = icmp eq i64 %20, 0
br i1 %68, label %84, label %69
69: ; preds = %63, %69
%70 = phi i64 [ %81, %69 ], [ %65, %63 ]
%71 = phi i32 [ %79, %69 ], [ %66, %63 ]
%72 = phi i32 [ %80, %69 ], [ %67, %63 ]
%73 = phi i64 [ %82, %69 ], [ 0, %63 ]
%74 = getelementptr inbounds i8, i8* %18, i64 %70
%75 = load i8, i8* %74
%76 = sext i8 %75 to i32
%77 = add nsw i32 %76, -48
%78 = mul nsw i32 %77, %72
%79 = add nsw i32 %78, %71
%80 = mul nsw i32 %72, 10
%81 = add nsw i64 %70, -1
%82 = add i64 %73, 1
%83 = icmp eq i64 %82, %20
br i1 %83, label %84, label %69
84: ; preds = %63, %69, %10
%85 = phi i32 [ 0, %10 ], [ %64, %63 ], [ %79, %69 ]
%86 = getelementptr inbounds i8*, i8** %1, i64 2
%87 = load i8*, i8** %86
%88 = tail call i32* @fopen(i8* %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%89 = icmp eq i32* %88, null
br i1 %89, label %101, label %90
90: ; preds = %84
%91 = call i64 @fscanf(i32* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%92 = load i32, i32* %3
%93 = zext i32 %92 to i64
%94 = call i8* @llvm.stacksave()
%95 = alloca i32, i64 %93
%96 = load i32, i32* %3
%97 = add nsw i32 %96, 1
%98 = zext i32 %97 to i64
%99 = alloca i32, i64 %98
store i32 0, i32* %99
%100 = icmp sgt i32 %96, 0
br i1 %100, label %105, label %122
101: ; preds = %84
%102 = load i8*, i8** %86
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %102)
%104 = tail call i32 @exit(i32 0)
unreachable
105: ; preds = %90, %111
%106 = phi i32 [ %113, %111 ], [ 0, %90 ]
%107 = phi i64 [ %114, %111 ], [ 0, %90 ]
%108 = getelementptr inbounds i32, i32* %95, i64 %107
%109 = call i64 @fscanf(i32* %88, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %108)
%110 = icmp sgt i64 %109, 0
br i1 %110, label %111, label %119
111: ; preds = %105
%112 = load i32, i32* %108
%113 = add nsw i32 %112, %106
%114 = add nuw nsw i64 %107, 1
%115 = getelementptr inbounds i32, i32* %99, i64 %114
store i32 %113, i32* %115
%116 = load i32, i32* %3
%117 = sext i32 %116 to i64
%118 = icmp slt i64 %114, %117
br i1 %118, label %105, label %122
119: ; preds = %105
%120 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%121 = call i32 @exit(i32 0)
unreachable
122: ; preds = %111, %90
%123 = call i32 @close(i32* %88)
%124 = load i32, i32* %3
%125 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %124)
%126 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %85)
%127 = load i32, i32* %3
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i32, i32* %99, i64 %128
%130 = load i32, i32* %129
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %130)
%132 = shl i32 %85, 2
%133 = load i32, i32* %3
%134 = add nsw i32 %133, 1
%135 = mul i32 %132, %134
%136 = call i32* @malloc(i32 %135)
%137 = call i32 @dynamic_pipelining(i32* %95, i32* %99, i32* %136, i32 %85, i32 %133)
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), i32 %137)
ret i32 0
}