#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 check_success(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ *popen(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
size_t strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, size_t);
int /*<<< orphan*/ usage_error(char *);
int main(int argc, char **argv) {
  char *wordlist;
  char *zip_path;
  unsigned short check = 1000;
  int i;
  for (i = 1; i < argc; i++) {
    if ((argc - i) % 2 == 0) {
      if (strcmp(argv[i], "-l") == 0) {
        i++;
        wordlist = argv[i];
        check -= 1;
      } else if (strcmp(argv[i], "-f") == 0) {
        i++;
        zip_path = argv[i];
        check += 10;
      } else {
        fprintf(stderr, "Invalid parameter \"%s\".\n", argv[i]);
        usage_error(argv[0]);
      }
    } else {
      usage_error(argv[0]);
    }
  }
  if (check != 1009) {
    usage_error(argv[0]);
  }
  char password[127];
  int pass_found = 0;
  FILE *fp, *fwl;
  size_t len = 0;
  char resp[1024], pre_command[127 + 256], command[127 + 512];
  char tmp_pwd[127 + 1];
  fwl = fopen(wordlist, "r");
  size_t prec_len = strlen(pre_command);
  if (fwl == NULL) {
    fprintf(stderr, "[!] Unable to open file \"%s\".\n", wordlist);
    exit(1);
  } else {
    sprintf(pre_command, "unzip -P %%s -o %s -d /tmp/ 2>&1", zip_path);
    while (fgets(tmp_pwd, 127, fwl) != NULL) {
      len = strlen(tmp_pwd);
      if (len > 512 - prec_len - 1) {
        fprintf(stderr, "[!] Too large passphrase or zip file path.\n");
      }
      if (len == 127 - 1) {
        fprintf(stderr,
                "[!] ALERT! passphrase could be greater than MAX_PWD_LEN\n");
      } else if (len > 0 && strcmp(" ", tmp_pwd) != 0) {
        strncpy(password, tmp_pwd, len - 1);
        password[len - 1] = '\0';
        sprintf(command, pre_command, password);
        fp = popen(command, "r");
        if (fp == NULL) {
          fprintf(stderr, "[!] Failed to run '%s'.\n", command);
        }
        if (check_success(fp) == 1) {
          pass_found = 1;
          break;
        }
      } else {
        fprintf(stderr, "[!] Empty passphrase found.\n");
      }
    }
  }
  if (pass_found)
    printf("The password is %s\n", password);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x960,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movw   $0x3e8,-0x22(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12f7 <main+0x137>
mov    -0x8(%rbp),%eax
sub    -0x28(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12d8 <main+0x118>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xde4(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1254 <main+0x94>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
movzwl -0x22(%rbp),%eax
sub    $0x1,%eax
mov    %ax,-0x22(%rbp)
jmp    12d3 <main+0x113>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xd9c(%rip),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    129f <main+0xdf>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
movzwl -0x22(%rbp),%eax
add    $0xa,%eax
mov    %ax,-0x22(%rbp)
jmp    12ce <main+0x10e>
mov    0x2d3a(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xd4b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <usage_error@plt>
jmp    12d3 <main+0x113>
jmp    12e4 <main+0x124>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <usage_error@plt>
jmp    12e9 <main+0x129>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e6 <main+0x26>
movzwl -0x22(%rbp),%eax
cmp    $0x3f1,%eax
je     1312 <main+0x152>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <usage_error@plt>
movl   $0x0,-0xb4(%rbp)
movq   $0x0,-0xd0(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xced(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0xc8(%rbp)
lea    -0x650(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x958(%rbp)
cmpq   $0x0,-0xc8(%rbp)
jne    1384 <main+0x1c4>
mov    0x2c7a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xcae(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>
lea    -0x650(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xcaa(%rip),%rsi
call   10d0 <sprintf@plt>
lea    -0x950(%rbp),%rdi
mov    -0xc8(%rbp),%rdx
mov    $0x7f,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1537 <main+0x377>
lea    -0x950(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0xd0(%rbp)
mov    -0xd0(%rbp),%rax
mov    $0x200,%ecx
sub    -0x958(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jbe    1407 <main+0x247>
mov    0x2be9(%rip),%rax
mov    (%rax),%edi
lea    0xc61(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
cmpq   $0x7e,-0xd0(%rbp)
7e
jne    1431 <main+0x271>
mov    0x2bc4(%rip),%rax
mov    (%rax),%edi
lea    0xc68(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1532 <main+0x372>
cmpq   $0x0,-0xd0(%rbp)
jbe    1516 <main+0x356>
lea    -0x950(%rbp),%rsi
lea    0xc79(%rip),%rdi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
je     1516 <main+0x356>
lea    -0xb0(%rbp),%rdi
lea    -0x950(%rbp),%rsi
mov    -0xd0(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0xd0(%rbp),%rax
sub    $0x1,%rax
movb   $0x0,-0xb0(%rbp,%rax,1)
lea    -0x8d0(%rbp),%rdi
lea    -0x650(%rbp),%rsi
lea    -0xb0(%rbp),%rdx
call   10d0 <sprintf@plt>
lea    -0x8d0(%rbp),%rdi
lea    0xb6a(%rip),%rsi
call   10b0 <popen@plt>
mov    %rax,-0xc0(%rbp)
cmpq   $0x0,-0xc0(%rbp)
jne    14ed <main+0x32d>
mov    0x2b0a(%rip),%rax
mov    (%rax),%edi
lea    -0x8d0(%rbp),%rdx
lea    0xbe2(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    -0xc0(%rbp),%rdi
call   10a0 <check_success@plt>
cmp    $0x1,%eax
jne    1511 <main+0x351>
movl   $0x1,-0xb4(%rbp)
jmp    1537 <main+0x377>
jmp    152d <main+0x36d>
mov    0x2ac3(%rip),%rax
mov    (%rax),%edi
lea    0xbbb(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
jmp    1532 <main+0x372>
jmp    139b <main+0x1db>
jmp    153c <main+0x37c>
cmpl   $0x0,-0xb4(%rbp)
je     155c <main+0x39c>
lea    -0xb0(%rbp),%rsi
lea    0xba7(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x960,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x518,%rsp
mov    %rsi,%rbx
cmp    $0x2,%edi
jl     128c <main+0xcc>
mov    %edi,%ebp
mov    $0x1,%r13d
mov    $0x3e8,%r15w
lea    0xe0f(%rip),%r12
jmp    121f <main+0x5f>
mov    0x2de6(%rip),%rax
mov    (%rax),%edi
mov    (%rbx,%r14,8),%rdx
lea    0xdff(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    (%rbx),%rdi
call   1070 <usage_error@plt>
add    $0x1,%r13d
cmp    %ebp,%r13d
jge    1278 <main+0xb8>
mov    %ebp,%eax
sub    %r13d,%eax
test   $0x1,%al
jne    120e <main+0x4e>
movslq %r13d,%r14
mov    (%rbx,%r14,8),%rdi
mov    %r12,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1265 <main+0xa5>
mov    (%rbx,%r14,8),%rdi
lea    0xdbc(%rip),%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    11f3 <main+0x33>
add    $0x1,%r13d
mov    0x8(%rbx,%r14,8),%rax
mov    %rax,0x8(%rsp)
add    $0xa,%r15d
jmp    1216 <main+0x56>
add    $0x1,%r13d
mov    0x8(%rbx,%r14,8),%rax
mov    %rax,(%rsp)
add    $0xffffffff,%r15d
jmp    1216 <main+0x56>
movzwl %r15w,%eax
cmp    $0x3f1,%eax
mov    (%rsp),%r14
mov    0x8(%rsp),%r15
je     1294 <main+0xd4>
mov    (%rbx),%rdi
call   1070 <usage_error@plt>
lea    0xd84(%rip),%rsi
mov    %r14,%rdi
call   10c0 <fopen@plt>
mov    %rax,%rbx
lea    0x110(%rsp),%rdi
call   1040 <strlen@plt>
test   %rbx,%rbx
je     1436 <main+0x276>
mov    %rax,%rbp
lea    0xd7a(%rip),%rsi
lea    0x110(%rsp),%rdi
mov    %r15,%rdx
call   10d0 <sprintf@plt>
lea    0x90(%rsp),%rdi
mov    $0x7f,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1422 <main+0x262>
mov    $0x1ff,%r14d
sub    %rbp,%r14
lea    0x90(%rsp),%r13
mov    0x2cd4(%rip),%rbp
lea    0xd4e(%rip),%r12
mov    %rbx,(%rsp)
jmp    134a <main+0x18a>
nopl   0x0(%rax)
lea    0xdba(%rip),%rsi
mov    0x0(%rbp),%edi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %r13,%rdi
mov    $0x7f,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1422 <main+0x262>
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    %rax,%r15
cmp    %r14,%rax
jbe    1367 <main+0x1a7>
mov    0x0(%rbp),%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
test   %r15,%r15
je     1320 <main+0x160>
lea    0xd1a(%rip),%rsi
cmp    $0x7e,%r15
je     1327 <main+0x167>
lea    0xd46(%rip),%rdi
mov    %r13,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
je     1320 <main+0x160>
mov    %r15,%rdx
add    $0xffffffffffffffff,%rdx
lea    0x10(%rsp),%r12
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <strncpy@plt>
movb   $0x0,0xf(%rsp,%r15,1)
lea    0x290(%rsp),%rbx
mov    %rbx,%rdi
lea    0x110(%rsp),%rsi
mov    %r12,%rdx
call   10d0 <sprintf@plt>
mov    %rbx,%rdi
lea    0xc50(%rip),%rsi
call   10b0 <popen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    13f5 <main+0x235>
mov    0x0(%rbp),%edi
lea    0xce2(%rip),%rsi
lea    0x290(%rsp),%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    %rbx,%rdi
call   10a0 <check_success@plt>
cmp    $0x1,%eax
lea    0xc5a(%rip),%r12
mov    (%rsp),%rbx
jne    1331 <main+0x171>
lea    0xce6(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x518,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2ba3(%rip),%rax
mov    (%rax),%edi
lea    0xbdb(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"-l\00"
@.str.1 = [3 x i8] c"-f\00"
@stderr = global i32 0
@.str.2 = [25 x i8] c"Invalid parameter \22%s\22.\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [31 x i8] c"[!] Unable to open file \22%s\22.\0A\00"
@.str.5 = [33 x i8] c"unzip -P %%s -o %s -d /tmp/ 2>&1\00"
@.str.6 = [44 x i8] c"[!] Too large passphrase or zip file path.\0A\00"
@.str.7 = [57 x i8] c"[!] ALERT! passphrase could be greater than MAX_PWD_LEN\0A\00"
@.str.8 = [2 x i8] c" \00"
@.str.9 = [25 x i8] c"[!] Failed to run '%s'.\0A\00"
@.str.10 = [29 x i8] c"[!] Empty passphrase found.\0A\00"
@.str.11 = [20 x i8] c"The password is %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i16
%9 = alloca i32
%10 = alloca [127 x i8]
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i64
%15 = alloca [1024 x i8]
%16 = alloca [383 x i8]
%17 = alloca [639 x i8]
%18 = alloca [128 x i8]
%19 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i16 1000, i16* %8
store i32 1, i32* %9
br label %20
20: ; preds = %90, %2
%21 = load i32, i32* %9
%22 = load i32, i32* %4
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %93
24: ; preds = %20
%25 = load i32, i32* %4
%26 = load i32, i32* %9
%27 = sub nsw i32 %25, %26
%28 = srem i32 %27, 2
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %84
30: ; preds = %24
%31 = load i8**, i8*** %5
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = call i64 @strcmp(i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%37 = icmp eq i64 %36, 0
br i1 %37, label %38, label %50
38: ; preds = %30
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
%41 = load i8**, i8*** %5
%42 = load i32, i32* %9
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i8*, i8** %41, i64 %43
%45 = load i8*, i8** %44
store i8* %45, i8** %6
%46 = load i16, i16* %8
%47 = zext i16 %46 to i32
%48 = sub nsw i32 %47, 1
%49 = trunc i32 %48 to i16
store i16 %49, i16* %8
br label %83
50: ; preds = %30
%51 = load i8**, i8*** %5
%52 = load i32, i32* %9
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8*, i8** %51, i64 %53
%55 = load i8*, i8** %54
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %70
58: ; preds = %50
%59 = load i32, i32* %9
%60 = add nsw i32 %59, 1
store i32 %60, i32* %9
%61 = load i8**, i8*** %5
%62 = load i32, i32* %9
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i8*, i8** %61, i64 %63
%65 = load i8*, i8** %64
store i8* %65, i8** %7
%66 = load i16, i16* %8
%67 = zext i16 %66 to i32
%68 = add nsw i32 %67, 10
%69 = trunc i32 %68 to i16
store i16 %69, i16* %8
br label %82
70: ; preds = %50
%71 = load i32, i32* @stderr
%72 = load i8**, i8*** %5
%73 = load i32, i32* %9
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8*, i8** %72, i64 %74
%76 = load i8*, i8** %75
%77 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %76)
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 0
%80 = load i8*, i8** %79
%81 = call i32 @usage_error(i8* %80)
br label %82
82: ; preds = %70, %58
br label %83
83: ; preds = %82, %38
br label %89
84: ; preds = %24
%85 = load i8**, i8*** %5
%86 = getelementptr inbounds i8*, i8** %85, i64 0
%87 = load i8*, i8** %86
%88 = call i32 @usage_error(i8* %87)
br label %89
89: ; preds = %84, %83
br label %90
90: ; preds = %89
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
br label %20
93: ; preds = %20
%94 = load i16, i16* %8
%95 = zext i16 %94 to i32
%96 = icmp ne i32 %95, 1009
br i1 %96, label %97, label %102
97: ; preds = %93
%98 = load i8**, i8*** %5
%99 = getelementptr inbounds i8*, i8** %98, i64 0
%100 = load i8*, i8** %99
%101 = call i32 @usage_error(i8* %100)
br label %102
102: ; preds = %97, %93
store i32 0, i32* %11
store i64 0, i64* %14
%103 = load i8*, i8** %6
%104 = call i32* @fopen(i8* %103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %104, i32** %13
%105 = getelementptr inbounds [383 x i8], [383 x i8]* %16, i64 0, i64 0
%106 = call i64 @strlen(i8* %105)
store i64 %106, i64* %19
%107 = load i32*, i32** %13
%108 = icmp eq i32* %107, null
br i1 %108, label %109, label %114
109: ; preds = %102
%110 = load i32, i32* @stderr
%111 = load i8*, i8** %6
%112 = call i32 (i32, i8*, ...) @fprintf(i32 %110, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %111)
%113 = call i32 @exit(i32 1)
unreachable
114: ; preds = %102
%115 = getelementptr inbounds [383 x i8], [383 x i8]* %16, i64 0, i64 0
%116 = load i8*, i8** %7
%117 = call i32 @sprintf(i8* %115, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %116)
br label %118
118: ; preds = %178, %114
%119 = getelementptr inbounds [128 x i8], [128 x i8]* %18, i64 0, i64 0
%120 = load i32*, i32** %13
%121 = call i32* @fgets(i8* %119, i32 127, i32* %120)
%122 = icmp ne i32* %121, null
br i1 %122, label %123, label %179
123: ; preds = %118
%124 = getelementptr inbounds [128 x i8], [128 x i8]* %18, i64 0, i64 0
%125 = call i64 @strlen(i8* %124)
store i64 %125, i64* %14
%126 = load i64, i64* %14
%127 = load i64, i64* %19
%128 = sub i64 512, %127
%129 = sub i64 %128, 1
%130 = icmp ugt i64 %126, %129
br i1 %130, label %131, label %134
131: ; preds = %123
%132 = load i32, i32* @stderr
%133 = call i32 (i32, i8*, ...) @fprintf(i32 %132, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %134
134: ; preds = %131, %123
%135 = load i64, i64* %14
%136 = icmp eq i64 %135, 126
br i1 %136, label %137, label %140
137: ; preds = %134
%138 = load i32, i32* @stderr
%139 = call i32 (i32, i8*, ...) @fprintf(i32 %138, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0))
br label %178
140: ; preds = %134
%141 = load i64, i64* %14
%142 = icmp ugt i64 %141, 0
br i1 %142, label %143, label %174
143: ; preds = %140
%144 = getelementptr inbounds [128 x i8], [128 x i8]* %18, i64 0, i64 0
%145 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* %144)
%146 = icmp ne i64 %145, 0
br i1 %146, label %147, label %174
147: ; preds = %143
%148 = getelementptr inbounds [127 x i8], [127 x i8]* %10, i64 0, i64 0
%149 = getelementptr inbounds [128 x i8], [128 x i8]* %18, i64 0, i64 0
%150 = load i64, i64* %14
%151 = sub i64 %150, 1
%152 = call i32 @strncpy(i8* %148, i8* %149, i64 %151)
%153 = load i64, i64* %14
%154 = sub i64 %153, 1
%155 = getelementptr inbounds [127 x i8], [127 x i8]* %10, i64 0, i64 %154
store i8 0, i8* %155
%156 = getelementptr inbounds [639 x i8], [639 x i8]* %17, i64 0, i64 0
%157 = getelementptr inbounds [383 x i8], [383 x i8]* %16, i64 0, i64 0
%158 = getelementptr inbounds [127 x i8], [127 x i8]* %10, i64 0, i64 0
%159 = call i32 @sprintf(i8* %156, i8* %157, i8* %158)
%160 = getelementptr inbounds [639 x i8], [639 x i8]* %17, i64 0, i64 0
%161 = call i32* @popen(i8* %160, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %161, i32** %12
%162 = load i32*, i32** %12
%163 = icmp eq i32* %162, null
br i1 %163, label %164, label %168
164: ; preds = %147
%165 = load i32, i32* @stderr
%166 = getelementptr inbounds [639 x i8], [639 x i8]* %17, i64 0, i64 0
%167 = call i32 (i32, i8*, ...) @fprintf(i32 %165, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8* %166)
br label %168
168: ; preds = %164, %147
%169 = load i32*, i32** %12
%170 = call i32 @check_success(i32* %169)
%171 = icmp eq i32 %170, 1
br i1 %171, label %172, label %173
172: ; preds = %168
store i32 1, i32* %11
br label %179
173: ; preds = %168
br label %177
174: ; preds = %143, %140
%175 = load i32, i32* @stderr
%176 = call i32 (i32, i8*, ...) @fprintf(i32 %175, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0))
br label %177
177: ; preds = %174, %173
br label %178
178: ; preds = %177, %137
br label %118
179: ; preds = %172, %118
br label %180
180: ; preds = %179
%181 = load i32, i32* %11
%182 = icmp ne i32 %181, 0
br i1 %182, label %183, label %186
183: ; preds = %180
%184 = getelementptr inbounds [127 x i8], [127 x i8]* %10, i64 0, i64 0
%185 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %184)
br label %186
186: ; preds = %183, %180
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"-l\00"
@.str.1 = [3 x i8] c"-f\00"
@stderr = global i32 0
@.str.2 = [25 x i8] c"Invalid parameter \22%s\22.\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [31 x i8] c"[!] Unable to open file \22%s\22.\0A\00"
@.str.5 = [33 x i8] c"unzip -P %%s -o %s -d /tmp/ 2>&1\00"
@.str.6 = [44 x i8] c"[!] Too large passphrase or zip file path.\0A\00"
@.str.7 = [57 x i8] c"[!] ALERT! passphrase could be greater than MAX_PWD_LEN\0A\00"
@.str.8 = [2 x i8] c" \00"
@.str.9 = [25 x i8] c"[!] Failed to run '%s'.\0A\00"
@.str.10 = [29 x i8] c"[!] Empty passphrase found.\0A\00"
@.str.11 = [20 x i8] c"The password is %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [127 x i8]
%4 = alloca [383 x i8]
%5 = alloca [639 x i8]
%6 = alloca [128 x i8]
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %56
8: ; preds = %2, %47
%9 = phi i8* [ %51, %47 ], [ undef, %2 ]
%10 = phi i8* [ %50, %47 ], [ undef, %2 ]
%11 = phi i16 [ %49, %47 ], [ 1000, %2 ]
%12 = phi i32 [ %52, %47 ], [ 1, %2 ]
%13 = sub nsw i32 %0, %12
%14 = and i32 %13, 1
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %44
16: ; preds = %8
%17 = sext i32 %12 to i64
%18 = getelementptr inbounds i8*, i8** %1, i64 %17
%19 = load i8*, i8** %18
%20 = tail call i64 @strcmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %16
%23 = add nsw i32 %12, 1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %1, i64 %24
%26 = load i8*, i8** %25
%27 = add i16 %11, -1
br label %47
28: ; preds = %16
%29 = load i8*, i8** %18
%30 = tail call i64 @strcmp(i8* %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %38
32: ; preds = %28
%33 = add nsw i32 %12, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %1, i64 %34
%36 = load i8*, i8** %35
%37 = add i16 %11, 10
br label %47
38: ; preds = %28
%39 = load i32, i32* @stderr
%40 = load i8*, i8** %18
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** %1
%43 = tail call i32 @usage_error(i8* %42)
br label %47
44: ; preds = %8
%45 = load i8*, i8** %1
%46 = tail call i32 @usage_error(i8* %45)
br label %47
47: ; preds = %44, %32, %38, %22
%48 = phi i32 [ %23, %22 ], [ %33, %32 ], [ %12, %38 ], [ %12, %44 ]
%49 = phi i16 [ %27, %22 ], [ %37, %32 ], [ %11, %38 ], [ %11, %44 ]
%50 = phi i8* [ %10, %22 ], [ %36, %32 ], [ %10, %38 ], [ %10, %44 ]
%51 = phi i8* [ %26, %22 ], [ %9, %32 ], [ %9, %38 ], [ %9, %44 ]
%52 = add nsw i32 %48, 1
%53 = icmp slt i32 %52, %0
br i1 %53, label %8, label %54
54: ; preds = %47
%55 = icmp eq i16 %49, 1009
br i1 %55, label %61, label %56
56: ; preds = %2, %54
%57 = phi i8* [ %51, %54 ], [ undef, %2 ]
%58 = phi i8* [ %50, %54 ], [ undef, %2 ]
%59 = load i8*, i8** %1
%60 = tail call i32 @usage_error(i8* %59)
br label %61
61: ; preds = %56, %54
%62 = phi i8* [ %57, %56 ], [ %51, %54 ]
%63 = phi i8* [ %58, %56 ], [ %50, %54 ]
%64 = getelementptr inbounds [127 x i8], [127 x i8]* %3, i64 0, i64 0
%65 = getelementptr inbounds [383 x i8], [383 x i8]* %4, i64 0, i64 0
%66 = getelementptr inbounds [639 x i8], [639 x i8]* %5, i64 0, i64 0
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %6, i64 0, i64 0
%68 = tail call i32* @fopen(i8* %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%69 = call i64 @strlen(i8* %65)
%70 = icmp eq i32* %68, null
br i1 %70, label %71, label %75
71: ; preds = %61
%72 = load i32, i32* @stderr
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %62)
%74 = tail call i32 @exit(i32 1)
unreachable
75: ; preds = %61
%76 = call i32 @sprintf(i8* %65, i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* %63)
%77 = call i32* @fgets(i8* %67, i32 127, i32* %68)
%78 = icmp eq i32* %77, null
br i1 %78, label %114, label %79
79: ; preds = %75
%80 = sub i64 511, %69
br label %81
81: ; preds = %79, %109
%82 = call i64 @strlen(i8* %67)
%83 = icmp ugt i64 %82, %80
br i1 %83, label %84, label %87
84: ; preds = %81
%85 = load i32, i32* @stderr
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %85, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
br label %87
87: ; preds = %84, %81
switch i64 %82, label %88 [
i64 126, label %105
i64 0, label %104
]
88: ; preds = %87
%89 = call i64 @strcmp(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0), i8* %67)
%90 = icmp eq i64 %89, 0
br i1 %90, label %104, label %91
91: ; preds = %88
%92 = add i64 %82, -1
%93 = call i32 @strncpy(i8* %64, i8* %67, i64 %92)
%94 = getelementptr inbounds [127 x i8], [127 x i8]* %3, i64 0, i64 %92
store i8 0, i8* %94
%95 = call i32 @sprintf(i8* %66, i8* %65, i8* %64)
%96 = call i32* @popen(i8* %66, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%97 = icmp eq i32* %96, null
br i1 %97, label %98, label %101
98: ; preds = %91
%99 = load i32, i32* @stderr
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i8* %66)
br label %101
101: ; preds = %98, %91
%102 = call i32 @check_success(i32* %96)
%103 = icmp eq i32 %102, 1
br i1 %103, label %112, label %109
104: ; preds = %87, %88
br label %105
105: ; preds = %87, %104
%106 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.10, i64 0, i64 0), %104 ], [ getelementptr inbounds ([57 x i8], [57 x i8]* @.str.7, i64 0, i64 0), %87 ]
%107 = load i32, i32* @stderr
%108 = call i32 (i32, i8*, ...) @fprintf(i32 %107, i8* %106)
br label %109
109: ; preds = %105, %101
%110 = call i32* @fgets(i8* %67, i32 127, i32* %68)
%111 = icmp eq i32* %110, null
br i1 %111, label %114, label %81
112: ; preds = %101
%113 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0), i8* %64)
br label %114
114: ; preds = %109, %75, %112
ret i32 0
}