#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 */

/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ w3_compressSaveFile(char *);
int w3_decompressSaveFile(char *);
char *w3_outputFilename(char *);
int main(int argc, char *argv[]) {
  if (argc <= 1) {
    puts("Provide input files.");
    return 1;
  }
  for (int i = 1; i < argc; i++) {
    int s;
    s = w3_decompressSaveFile(argv[i]);
    if (s != 0) {
      continue;
    }
    char *o = w3_outputFilename(argv[i]);
    w3_compressSaveFile(o);
    free(o);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     1188 <main+0x38>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    11fa <main+0xaa>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11f3 <main+0xa3>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <w3_decompressSaveFile@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
je     11be <main+0x6e>
jmp    11e5 <main+0x95>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1070 <w3_outputFilename@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1050 <w3_compressSaveFile@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    118f <main+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jge    1170 <main+0x20>
lea    0xe9c(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
jmp    11b6 <main+0x66>
mov    %rsi,%r14
mov    %edi,%r15d
mov    $0x1,%ebx
jmp    1189 <main+0x39>
nopl   (%rax)
add    $0x1,%rbx
cmp    %rbx,%r15
je     11b4 <main+0x64>
mov    (%r14,%rbx,8),%rdi
call   1060 <w3_decompressSaveFile@plt>
test   %eax,%eax
jne    1180 <main+0x30>
mov    (%r14,%rbx,8),%rdi
call   1070 <w3_outputFilename@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1050 <w3_compressSaveFile@plt>
mov    %r12,%rdi
call   1030 <free@plt>
jmp    1180 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Provide input files.\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 i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp sle i32 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %43
13: ; preds = %2
store i32 1, i32* %6
br label %14
14: ; preds = %39, %13
%15 = load i32, i32* %6
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %42
18: ; preds = %14
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @w3_decompressSaveFile(i8* %23)
store i32 %24, i32* %7
%25 = load i32, i32* %7
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %18
br label %39
28: ; preds = %18
%29 = load i8**, i8*** %5
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = call i8* @w3_outputFilename(i8* %33)
store i8* %34, i8** %8
%35 = load i8*, i8** %8
%36 = call i32 @w3_compressSaveFile(i8* %35)
%37 = load i8*, i8** %8
%38 = call i32 @free(i8* %37)
br label %39
39: ; preds = %28, %27
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %14
42: ; preds = %14
store i32 0, i32* %3
br label %43
43: ; preds = %42, %11
%44 = load i32, i32* %3
ret i32 %44
}

LLVM IR (-O2):
@.str = [21 x i8] c"Provide input files.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %8
6: ; preds = %2
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %22
8: ; preds = %4, %19
%9 = phi i64 [ 1, %4 ], [ %20, %19 ]
%10 = getelementptr inbounds i8*, i8** %1, i64 %9
%11 = load i8*, i8** %10
%12 = tail call i32 @w3_decompressSaveFile(i8* %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %8
%15 = load i8*, i8** %10
%16 = tail call i8* @w3_outputFilename(i8* %15)
%17 = tail call i32 @w3_compressSaveFile(i8* %16)
%18 = tail call i32 @free(i8* %16)
br label %19
19: ; preds = %8, %14
%20 = add nuw nsw i64 %9, 1
%21 = icmp eq i64 %20, %5
br i1 %21, label %22, label %8
22: ; preds = %19, %6
%23 = phi i32 [ 1, %6 ], [ 0, %19 ]
ret i32 %23
}