#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*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(unsigned char *, int, long, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(unsigned char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ loadAlu(unsigned char *);
scalar_t__ malloc(long);
int /*<<< orphan*/ openMelApp(unsigned char *);
int /*<<< orphan*/ sendCertificate(int, unsigned char *, long);
int /*<<< orphan*/ snprintf(char *, int, char *);
int multosLoadApp(char *aluFile, char *alcFile, char *error, int errBuffLen) {
  FILE *fp;
  long alcSize, aluSize;
  unsigned char *alc, *alu;
  int status = 1;
  fp = fopen(alcFile, "rb");
  if (fp == NULL) {
    if (error)
      snprintf(error, errBuffLen - 1, "Failed to open ALC\n");
    return (0);
  }
  fseek(fp, 0, 2);
  alcSize = ftell(fp);
  fseek(fp, 0, 0);
  alc = (unsigned char *)malloc(alcSize);
  if (alc == NULL) {
    if (error)
      snprintf(error, errBuffLen - 1, "Failed to read ALC\n");
    return (0);
  }
  fread(alc, 1, alcSize, fp);
  fclose(fp);
  if (!openMelApp(alc)) {
    if (error)
      snprintf(error, errBuffLen - 1, "Open MEL Application failed\n");
    free(alc);
    return (0);
  }
  fp = fopen(aluFile, "rb");
  if (fp == NULL) {
    if (error)
      snprintf(error, errBuffLen - 1, "Failed to open ALU\n");
    free(alc);
    return (0);
  }
  fseek(fp, 0, 2);
  aluSize = ftell(fp);
  fseek(fp, 0, 0);
  alu = (unsigned char *)malloc(aluSize);
  if (alu == NULL) {
    if (error)
      snprintf(error, errBuffLen - 1, "Failed to read ALU\n");
    free(alc);
    return (0);
  }
  fread(alu, 1, aluSize, fp);
  fclose(fp);
  if (!loadAlu(alu)) {
    if (error)
      snprintf(error, errBuffLen - 1, "ALU loading failed\n");
    status = 0;
  }
  if (status && !sendCertificate(1, alc, alcSize)) {
    if (error)
      snprintf(error, errBuffLen - 1, "ALC loading failed\n");
    status = 0;
  }
  free(alc);
  free(alu);
  return (status);
}


x86 assembly (clang, -O0):
<multosLoadApp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    121a <multosLoadApp+0x6a>
cmpq   $0x0,-0x20(%rbp)
je     120e <multosLoadApp+0x5e>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
lea    0xdfa(%rip),%rdx
call   1070 <snprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    147b <multosLoadApp+0x2cb>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   10a0 <fseek@plt>
mov    -0x30(%rbp),%rdi
call   1080 <ftell@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   10a0 <fseek@plt>
mov    -0x38(%rbp),%rdi
call   1090 <malloc@plt>
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1289 <multosLoadApp+0xd9>
cmpq   $0x0,-0x20(%rbp)
je     127d <multosLoadApp+0xcd>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
lea    0xd9f(%rip),%rdx
call   1070 <snprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    147b <multosLoadApp+0x2cb>
mov    -0x48(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x48(%rbp),%rdi
call   10d0 <openMelApp@plt>
cmp    $0x0,%eax
jne    12f0 <multosLoadApp+0x140>
cmpq   $0x0,-0x20(%rbp)
je     12db <multosLoadApp+0x12b>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
lea    0xd55(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    147b <multosLoadApp+0x2cb>
mov    -0x10(%rbp),%rdi
lea    0xd05(%rip),%rsi
call   10b0 <fopen@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    1345 <multosLoadApp+0x195>
cmpq   $0x0,-0x20(%rbp)
je     1330 <multosLoadApp+0x180>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
lea    0xd1d(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    147b <multosLoadApp+0x2cb>
mov    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   10a0 <fseek@plt>
mov    -0x30(%rbp),%rdi
call   1080 <ftell@plt>
mov    %rax,-0x40(%rbp)
mov    -0x30(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   10a0 <fseek@plt>
mov    -0x40(%rbp),%rdi
call   1090 <malloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    13bd <multosLoadApp+0x20d>
cmpq   $0x0,-0x20(%rbp)
je     13a8 <multosLoadApp+0x1f8>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
lea    0xcb9(%rip),%rdx
call   1070 <snprintf@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    147b <multosLoadApp+0x2cb>
mov    -0x50(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fread@plt>
mov    -0x30(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x50(%rbp),%rdi
call   10c0 <loadAlu@plt>
cmp    $0x0,%eax
jne    1416 <multosLoadApp+0x266>
cmpq   $0x0,-0x20(%rbp)
je     140f <multosLoadApp+0x25f>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
lea    0xc66(%rip),%rdx
call   1070 <snprintf@plt>
movl   $0x0,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
je     1463 <multosLoadApp+0x2b3>
mov    -0x48(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    $0x1,%edi
call   1060 <sendCertificate@plt>
cmp    $0x0,%eax
jne    1463 <multosLoadApp+0x2b3>
cmpq   $0x0,-0x20(%rbp)
je     145c <multosLoadApp+0x2ac>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
sub    $0x1,%esi
lea    0xc2d(%rip),%rdx
call   1070 <snprintf@plt>
movl   $0x0,-0x54(%rbp)
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%rdi
call   1030 <free@plt>
mov    -0x54(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multosLoadApp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %ecx,%r12d
mov    %rdx,%rbx
mov    %rsi,%rax
mov    %rdi,%r15
lea    0xe2f(%rip),%rsi
mov    %rax,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1312 <multosLoadApp+0x162>
mov    %rax,%r14
mov    %rbx,0x8(%rsp)
xor    %ebp,%ebp
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   10a0 <fseek@plt>
mov    %r14,%rdi
call   1080 <ftell@plt>
mov    %rax,%r13
mov    %r14,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <fseek@plt>
mov    %r13,%rdi
call   1090 <malloc@plt>
test   %rax,%rax
je     132d <multosLoadApp+0x17d>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r13,%rdx
mov    %r14,%rcx
call   1040 <fread@plt>
mov    %r14,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   10d0 <openMelApp@plt>
test   %eax,%eax
je     1353 <multosLoadApp+0x1a3>
mov    %rbx,0x10(%rsp)
lea    0xda3(%rip),%rsi
mov    %r15,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1375 <multosLoadApp+0x1c5>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   10a0 <fseek@plt>
mov    %rbx,%rdi
call   1080 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10a0 <fseek@plt>
mov    %r14,%rdi
call   1090 <malloc@plt>
test   %rax,%rax
je     138c <multosLoadApp+0x1dc>
mov    %rax,%r15
mov    $0x1,%ebp
mov    %rax,%rdi
mov    $0x1,%esi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1040 <fread@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r15,%rdi
call   10c0 <loadAlu@plt>
test   %eax,%eax
je     13b7 <multosLoadApp+0x207>
mov    $0x1,%edi
mov    0x10(%rsp),%rbx
mov    %rbx,%rsi
mov    %r13,%rdx
call   1060 <sendCertificate@plt>
test   %eax,%eax
jne    13e4 <multosLoadApp+0x234>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13d9 <multosLoadApp+0x229>
lea    0xd77(%rip),%rdx
jmp    13cd <multosLoadApp+0x21d>
xor    %ebp,%ebp
test   %rbx,%rbx
je     13f4 <multosLoadApp+0x244>
add    $0xffffffff,%r12d
lea    0xcdb(%rip),%rdx
mov    %rbx,%rdi
jmp    1346 <multosLoadApp+0x196>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13f4 <multosLoadApp+0x244>
add    $0xffffffff,%r12d
lea    0xcd1(%rip),%rdx
mov    %r12d,%esi
call   1070 <snprintf@plt>
jmp    13f4 <multosLoadApp+0x244>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     1370 <multosLoadApp+0x1c0>
add    $0xffffffff,%r12d
lea    0xcc3(%rip),%rdx
mov    %r12d,%esi
call   1070 <snprintf@plt>
mov    %rbx,%rdi
jmp    13ae <multosLoadApp+0x1fe>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13a9 <multosLoadApp+0x1f9>
add    $0xffffffff,%r12d
lea    0xcbe(%rip),%rdx
jmp    13a1 <multosLoadApp+0x1f1>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13a9 <multosLoadApp+0x1f9>
add    $0xffffffff,%r12d
lea    0xcbb(%rip),%rdx
mov    %r12d,%esi
call   1070 <snprintf@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
xor    %ebp,%ebp
jmp    13f4 <multosLoadApp+0x244>
mov    0x8(%rsp),%rdi
test   %rdi,%rdi
je     13dd <multosLoadApp+0x22d>
lea    0xca8(%rip),%rdx
mov    0x10(%rsp),%rbx
add    $0xffffffff,%r12d
mov    %r12d,%esi
call   1070 <snprintf@plt>
xor    %ebp,%ebp
jmp    13e4 <multosLoadApp+0x234>
xor    %ebp,%ebp
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [20 x i8] c"Failed to open ALC\0A\00"
@.str.2 = [20 x i8] c"Failed to read ALC\0A\00"
@.str.3 = [29 x i8] c"Open MEL Application failed\0A\00"
@.str.4 = [20 x i8] c"Failed to open ALU\0A\00"
@.str.5 = [20 x i8] c"Failed to read ALU\0A\00"
@.str.6 = [20 x i8] c"ALU loading failed\0A\00"
@.str.7 = [20 x i8] c"ALC loading failed\0A\00"
define i32 @multosLoadApp(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i64
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 1, i32* %15
%16 = load i8*, i8** %7
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %17, i32** %10
%18 = load i32*, i32** %10
%19 = icmp eq i32* %18, null
br i1 %19, label %20, label %29
20: ; preds = %4
%21 = load i8*, i8** %8
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i8*, i8** %8
%25 = load i32, i32* %9
%26 = sub nsw i32 %25, 1
%27 = call i32 @snprintf(i8* %24, i32 %26, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %23, %20
store i32 0, i32* %5
br label %152
29: ; preds = %4
%30 = load i32*, i32** %10
%31 = call i32 @fseek(i32* %30, i32 0, i32 2)
%32 = load i32*, i32** %10
%33 = call i64 @ftell(i32* %32)
store i64 %33, i64* %11
%34 = load i32*, i32** %10
%35 = call i32 @fseek(i32* %34, i32 0, i32 0)
%36 = load i64, i64* %11
%37 = call i64 @malloc(i64 %36)
%38 = inttoptr i64 %37 to i8*
store i8* %38, i8** %13
%39 = load i8*, i8** %13
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %50
41: ; preds = %29
%42 = load i8*, i8** %8
%43 = icmp ne i8* %42, null
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = load i8*, i8** %8
%46 = load i32, i32* %9
%47 = sub nsw i32 %46, 1
%48 = call i32 @snprintf(i8* %45, i32 %47, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %49
49: ; preds = %44, %41
store i32 0, i32* %5
br label %152
50: ; preds = %29
%51 = load i8*, i8** %13
%52 = load i64, i64* %11
%53 = load i32*, i32** %10
%54 = call i32 @fread(i8* %51, i32 1, i64 %52, i32* %53)
%55 = load i32*, i32** %10
%56 = call i32 @fclose(i32* %55)
%57 = load i8*, i8** %13
%58 = call i32 @openMelApp(i8* %57)
%59 = icmp ne i32 %58, 0
br i1 %59, label %71, label %60
60: ; preds = %50
%61 = load i8*, i8** %8
%62 = icmp ne i8* %61, null
br i1 %62, label %63, label %68
63: ; preds = %60
%64 = load i8*, i8** %8
%65 = load i32, i32* %9
%66 = sub nsw i32 %65, 1
%67 = call i32 @snprintf(i8* %64, i32 %66, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %68
68: ; preds = %63, %60
%69 = load i8*, i8** %13
%70 = call i32 @free(i8* %69)
store i32 0, i32* %5
br label %152
71: ; preds = %50
%72 = load i8*, i8** %6
%73 = call i32* @fopen(i8* %72, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %73, i32** %10
%74 = load i32*, i32** %10
%75 = icmp eq i32* %74, null
br i1 %75, label %76, label %87
76: ; preds = %71
%77 = load i8*, i8** %8
%78 = icmp ne i8* %77, null
br i1 %78, label %79, label %84
79: ; preds = %76
%80 = load i8*, i8** %8
%81 = load i32, i32* %9
%82 = sub nsw i32 %81, 1
%83 = call i32 @snprintf(i8* %80, i32 %82, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %84
84: ; preds = %79, %76
%85 = load i8*, i8** %13
%86 = call i32 @free(i8* %85)
store i32 0, i32* %5
br label %152
87: ; preds = %71
%88 = load i32*, i32** %10
%89 = call i32 @fseek(i32* %88, i32 0, i32 2)
%90 = load i32*, i32** %10
%91 = call i64 @ftell(i32* %90)
store i64 %91, i64* %12
%92 = load i32*, i32** %10
%93 = call i32 @fseek(i32* %92, i32 0, i32 0)
%94 = load i64, i64* %12
%95 = call i64 @malloc(i64 %94)
%96 = inttoptr i64 %95 to i8*
store i8* %96, i8** %14
%97 = load i8*, i8** %14
%98 = icmp eq i8* %97, null
br i1 %98, label %99, label %110
99: ; preds = %87
%100 = load i8*, i8** %8
%101 = icmp ne i8* %100, null
br i1 %101, label %102, label %107
102: ; preds = %99
%103 = load i8*, i8** %8
%104 = load i32, i32* %9
%105 = sub nsw i32 %104, 1
%106 = call i32 @snprintf(i8* %103, i32 %105, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %107
107: ; preds = %102, %99
%108 = load i8*, i8** %13
%109 = call i32 @free(i8* %108)
store i32 0, i32* %5
br label %152
110: ; preds = %87
%111 = load i8*, i8** %14
%112 = load i64, i64* %12
%113 = load i32*, i32** %10
%114 = call i32 @fread(i8* %111, i32 1, i64 %112, i32* %113)
%115 = load i32*, i32** %10
%116 = call i32 @fclose(i32* %115)
%117 = load i8*, i8** %14
%118 = call i32 @loadAlu(i8* %117)
%119 = icmp ne i32 %118, 0
br i1 %119, label %129, label %120
120: ; preds = %110
%121 = load i8*, i8** %8
%122 = icmp ne i8* %121, null
br i1 %122, label %123, label %128
123: ; preds = %120
%124 = load i8*, i8** %8
%125 = load i32, i32* %9
%126 = sub nsw i32 %125, 1
%127 = call i32 @snprintf(i8* %124, i32 %126, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
br label %128
128: ; preds = %123, %120
store i32 0, i32* %15
br label %129
129: ; preds = %128, %110
%130 = load i32, i32* %15
%131 = icmp ne i32 %130, 0
br i1 %131, label %132, label %146
132: ; preds = %129
%133 = load i8*, i8** %13
%134 = load i64, i64* %11
%135 = call i32 @sendCertificate(i32 1, i8* %133, i64 %134)
%136 = icmp ne i32 %135, 0
br i1 %136, label %146, label %137
137: ; preds = %132
%138 = load i8*, i8** %8
%139 = icmp ne i8* %138, null
br i1 %139, label %140, label %145
140: ; preds = %137
%141 = load i8*, i8** %8
%142 = load i32, i32* %9
%143 = sub nsw i32 %142, 1
%144 = call i32 @snprintf(i8* %141, i32 %143, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
br label %145
145: ; preds = %140, %137
store i32 0, i32* %15
br label %146
146: ; preds = %145, %132, %129
%147 = load i8*, i8** %13
%148 = call i32 @free(i8* %147)
%149 = load i8*, i8** %14
%150 = call i32 @free(i8* %149)
%151 = load i32, i32* %15
store i32 %151, i32* %5
br label %152
152: ; preds = %146, %107, %84, %68, %49, %28
%153 = load i32, i32* %5
ret i32 %153
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [20 x i8] c"Failed to open ALC\0A\00"
@.str.2 = [20 x i8] c"Failed to read ALC\0A\00"
@.str.3 = [29 x i8] c"Open MEL Application failed\0A\00"
@.str.4 = [20 x i8] c"Failed to open ALU\0A\00"
@.str.5 = [20 x i8] c"Failed to read ALU\0A\00"
@.str.6 = [20 x i8] c"ALU loading failed\0A\00"
@.str.7 = [20 x i8] c"ALC loading failed\0A\00"
define i32 @multosLoadApp(i8* nocapture %0, i8* nocapture %1, i8* %2, i32 %3) {
%5 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = icmp eq i8* %2, null
br i1 %8, label %80, label %9
9: ; preds = %7
%10 = add nsw i32 %3, -1
%11 = tail call i32 @snprintf(i8* %2, i32 %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %80
12: ; preds = %4
%13 = tail call i32 @fseek(i32* %5, i32 0, i32 2)
%14 = tail call i64 @ftell(i32* %5)
%15 = tail call i32 @fseek(i32* %5, i32 0, i32 0)
%16 = tail call i64 @malloc(i64 %14)
%17 = inttoptr i64 %16 to i8*
%18 = icmp eq i64 %16, 0
br i1 %18, label %19, label %24
19: ; preds = %12
%20 = icmp eq i8* %2, null
br i1 %20, label %80, label %21
21: ; preds = %19
%22 = add nsw i32 %3, -1
%23 = tail call i32 @snprintf(i8* %2, i32 %22, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %80
24: ; preds = %12
%25 = tail call i32 @fread(i8* %17, i32 1, i64 %14, i32* %5)
%26 = tail call i32 @fclose(i32* %5)
%27 = tail call i32 @openMelApp(i8* %17)
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %36
29: ; preds = %24
%30 = icmp eq i8* %2, null
br i1 %30, label %34, label %31
31: ; preds = %29
%32 = add nsw i32 %3, -1
%33 = tail call i32 @snprintf(i8* %2, i32 %32, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
br label %34
34: ; preds = %31, %29
%35 = tail call i32 @free(i8* %17)
br label %80
36: ; preds = %24
%37 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %46
39: ; preds = %36
%40 = icmp eq i8* %2, null
br i1 %40, label %44, label %41
41: ; preds = %39
%42 = add nsw i32 %3, -1
%43 = tail call i32 @snprintf(i8* %2, i32 %42, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %44
44: ; preds = %41, %39
%45 = tail call i32 @free(i8* %17)
br label %80
46: ; preds = %36
%47 = tail call i32 @fseek(i32* %37, i32 0, i32 2)
%48 = tail call i64 @ftell(i32* %37)
%49 = tail call i32 @fseek(i32* %37, i32 0, i32 0)
%50 = tail call i64 @malloc(i64 %48)
%51 = inttoptr i64 %50 to i8*
%52 = icmp eq i64 %50, 0
br i1 %52, label %53, label %60
53: ; preds = %46
%54 = icmp eq i8* %2, null
br i1 %54, label %58, label %55
55: ; preds = %53
%56 = add nsw i32 %3, -1
%57 = tail call i32 @snprintf(i8* %2, i32 %56, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0))
br label %58
58: ; preds = %55, %53
%59 = tail call i32 @free(i8* %17)
br label %80
60: ; preds = %46
%61 = tail call i32 @fread(i8* %51, i32 1, i64 %48, i32* %37)
%62 = tail call i32 @fclose(i32* %37)
%63 = tail call i32 @loadAlu(i8* %51)
%64 = icmp eq i32 %63, 0
br i1 %64, label %65, label %67
65: ; preds = %60
%66 = icmp eq i8* %2, null
br i1 %66, label %76, label %72
67: ; preds = %60
%68 = tail call i32 @sendCertificate(i32 1, i8* %17, i64 %14)
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %76
70: ; preds = %67
%71 = icmp eq i8* %2, null
br i1 %71, label %76, label %72
72: ; preds = %70, %65
%73 = phi i8* [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), %65 ], [ getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), %70 ]
%74 = add nsw i32 %3, -1
%75 = tail call i32 @snprintf(i8* %2, i32 %74, i8* %73)
br label %76
76: ; preds = %72, %65, %70, %67
%77 = phi i32 [ 1, %67 ], [ 0, %70 ], [ 0, %65 ], [ 0, %72 ]
%78 = tail call i32 @free(i8* %17)
%79 = tail call i32 @free(i8* %51)
br label %80
80: ; preds = %19, %21, %7, %9, %76, %58, %44, %34
%81 = phi i32 [ 0, %44 ], [ 0, %58 ], [ %77, %76 ], [ 0, %34 ], [ 0, %9 ], [ 0, %7 ], [ 0, %21 ], [ 0, %19 ]
ret i32 %81
}