#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*/ atoi(char *);
int /*<<< orphan*/ dogetdeps(char *, char **, int);
int /*<<< orphan*/ dopkgmirrorpkgs(int, char *, char *, char *, char **, int);
int /*<<< orphan*/ dopkgstanzas(char *, char **, int);
scalar_t__ dotranslatewgetpercent(int /*<<< orphan*/, int /*<<< orphan*/,
                                  int /*<<< orphan*/, char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  if ((argc == 6 || argc == 5) && strcmp(argv[1], "WGET%") == 0) {
    if (dotranslatewgetpercent(atoi(argv[2]), atoi(argv[3]), atoi(argv[4]),
                               argc == 6 ? argv[5] : NULL)) {
      exit(0);
    } else {
      exit(1);
    }
  } else if (argc >= 4 && strcmp(argv[1], "GETDEPS") == 0) {
    int i;
    for (i = 3; argc - i > 100; i += 100) {
      dogetdeps(argv[2], argv + i, 100);
    }
    dogetdeps(argv[2], argv + i, argc - i);
    exit(0);
  } else if (argc >= 5 && strcmp(argv[1], "PKGS") == 0) {
    int i;
    for (i = 4; argc - i > 100; i += 100) {
      dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv + i, 100);
    }
    dopkgmirrorpkgs(1, argv[2], argv[3], "Package:", argv + i, argc - i);
    exit(0);
  } else if (argc >= 6 && strcmp(argv[1], "FIELD") == 0) {
    int i;
    for (i = 5; argc - i > 100; i += 100) {
      dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv + i, 100);
    }
    dopkgmirrorpkgs(0, argv[3], argv[4], argv[2], argv + i, argc - i);
    exit(0);
  } else if (argc >= 4 && strcmp(argv[1], "STANZAS") == 0) {
    int i;
    for (i = 3; argc - i > 100; i += 100) {
      dopkgstanzas(argv[2], argv + i, 100);
    }
    dopkgstanzas(argv[2], argv + i, argc - i);
    exit(0);
  } else {
    fprintf(stderr, "usage: %s PKGS mirror packagesfile pkgs..\n", argv[0]);
    fprintf(stderr, "   or: %s FIELD field mirror packagesfile pkgs..\n",
            argv[0]);
    fprintf(stderr, "   or: %s GETDEPS packagesfile pkgs..\n", argv[0]);
    fprintf(stderr, "   or: %s STANZAS packagesfile pkgs..\n", argv[0]);
    fprintf(stderr, "   or: %s WGET%% low high end reason\n", argv[0]);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
je     11aa <main+0x2a>
cmpl   $0x5,-0x8(%rbp)
jne    124b <main+0xcb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe47(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    124b <main+0xcb>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x6,-0x8(%rbp)
jne    1213 <main+0x93>
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x38(%rbp)
jmp    121e <main+0x9e>
xor    %eax,%eax
mov    %rax,-0x38(%rbp)
jmp    121e <main+0x9e>
mov    -0x24(%rbp),%edx
mov    -0x28(%rbp),%esi
mov    -0x2c(%rbp),%edi
mov    -0x38(%rbp),%rcx
call   10a0 <dotranslatewgetpercent@plt>
cmp    $0x0,%rax
je     1241 <main+0xc1>
xor    %edi,%edi
call   1090 <exit@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
cmpl   $0x4,-0x8(%rbp)
jl     12e1 <main+0x161>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xda2(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    12e1 <main+0x161>
movl   $0x3,-0x14(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x14(%rbp),%eax
cmp    $0x64,%eax
jle    12b8 <main+0x138>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x64,%edx
call   1070 <dogetdeps@plt>
mov    -0x14(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x14(%rbp)
jmp    127a <main+0xfa>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x8(%rbp),%edx
sub    -0x14(%rbp),%edx
call   1070 <dogetdeps@plt>
xor    %edi,%edi
call   1090 <exit@plt>
cmpl   $0x5,-0x8(%rbp)
jl     13a2 <main+0x222>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd14(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    13a2 <main+0x222>
movl   $0x4,-0x18(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x18(%rbp),%eax
cmp    $0x64,%eax
jle    1363 <main+0x1e3>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
mov    -0x10(%rbp),%r8
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r8
mov    $0x1,%edi
lea    0xcc9(%rip),%rcx
mov    $0x64,%r9d
call   1030 <dopkgmirrorpkgs@plt>
mov    -0x18(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x18(%rbp)
jmp    1310 <main+0x190>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
mov    -0x10(%rbp),%r8
movslq -0x18(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r8
mov    -0x8(%rbp),%r9d
sub    -0x18(%rbp),%r9d
mov    $0x1,%edi
lea    0xc7d(%rip),%rcx
call   1030 <dopkgmirrorpkgs@plt>
xor    %edi,%edi
call   1090 <exit@plt>
cmpl   $0x6,-0x8(%rbp)
jl     145f <main+0x2df>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xc61(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    145f <main+0x2df>
movl   $0x5,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x1c(%rbp),%eax
cmp    $0x64,%eax
jle    1422 <main+0x2a2>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%r8
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r8
xor    %edi,%edi
mov    $0x64,%r9d
call   1030 <dopkgmirrorpkgs@plt>
mov    -0x1c(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x1c(%rbp)
jmp    13d1 <main+0x251>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x10(%rbp),%r8
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%r8
mov    -0x8(%rbp),%r9d
sub    -0x1c(%rbp),%r9d
xor    %edi,%edi
call   1030 <dopkgmirrorpkgs@plt>
xor    %edi,%edi
call   1090 <exit@plt>
cmpl   $0x4,-0x8(%rbp)
jl     14f5 <main+0x375>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xbaa(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    14f5 <main+0x375>
movl   $0x3,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x20(%rbp),%eax
cmp    $0x64,%eax
jle    14cc <main+0x34c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    $0x64,%edx
call   1040 <dopkgstanzas@plt>
mov    -0x20(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x20(%rbp)
jmp    148e <main+0x30e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x20(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x8(%rbp),%edx
sub    -0x20(%rbp),%edx
call   1040 <dopkgstanzas@plt>
xor    %edi,%edi
call   1090 <exit@plt>
mov    0x2ae4(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb1e(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2ac8(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb2d(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2aac(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb43(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2a90(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb4e(%rip),%rsi
call   1060 <fprintf@plt>
mov    0x2a74(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xb59(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%r13d
lea    -0x5(%r13),%r15d
cmp    $0x1,%r15d
ja     11e3 <main+0x63>
mov    0x8(%r14),%rdi
lea    0xe5a(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    11ed <main+0x6d>
mov    0x10(%r14),%rdi
call   1080 <atoi@plt>
mov    %eax,%r15d
mov    0x18(%r14),%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
mov    0x20(%r14),%rdi
call   1080 <atoi@plt>
cmp    $0x6,%r13d
jne    12c8 <main+0x148>
mov    0x28(%r14),%rcx
jmp    12ca <main+0x14a>
cmp    $0x4,%r13d
jl     13f8 <main+0x278>
mov    0x8(%r14),%rdi
lea    0xe0e(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    124b <main+0xcb>
cmp    $0x68,%r13d
jb     12e5 <main+0x165>
lea    0x18(%r14),%rbp
add    $0xfffffffd,%r13d
mov    $0x3,%ebx
nopl   0x0(%rax)
mov    0x10(%r14),%rdi
mov    %rbp,%rsi
mov    $0x64,%edx
call   1070 <dogetdeps@plt>
add    $0x64,%rbx
add    $0x320,%rbp
add    $0xffffff9c,%r13d
cmp    $0x64,%r13d
jg     1220 <main+0xa0>
jmp    12ee <main+0x16e>
cmp    $0x5,%r13d
jb     139b <main+0x21b>
mov    0x8(%r14),%rdi
lea    0xdae(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    1305 <main+0x185>
cmp    $0x69,%r13d
jb     147e <main+0x2fe>
lea    0x20(%r14),%rbp
add    $0xfffffffc,%r13d
mov    $0x4,%r12d
lea    0xd86(%rip),%r15
nopl   (%rax)
mov    0x10(%r14),%rsi
mov    0x18(%r14),%rdx
mov    $0x1,%edi
mov    %r15,%rcx
mov    %rbp,%r8
mov    $0x64,%r9d
call   1030 <dopkgmirrorpkgs@plt>
add    $0x64,%r12
add    $0x320,%rbp
add    $0xffffff9c,%r13d
cmp    $0x64,%r13d
jg     1290 <main+0x110>
jmp    1488 <main+0x308>
xor    %ecx,%ecx
mov    %r15d,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   10a0 <dotranslatewgetpercent@plt>
test   %rax,%rax
jne    12fe <main+0x17e>
mov    $0x1,%edi
call   1090 <exit@plt>
add    $0xfffffffd,%r13d
mov    $0x3,%ebx
mov    0x10(%r14),%rdi
lea    (%r14,%rbx,8),%rsi
mov    %r13d,%edx
call   1070 <dogetdeps@plt>
xor    %edi,%edi
call   1090 <exit@plt>
cmp    $0x6,%r13d
jb     139b <main+0x21b>
mov    0x8(%r14),%rdi
lea    0xd02(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    139b <main+0x21b>
mov    $0x5,%r12d
cmp    $0x6a,%r13d
jb     1381 <main+0x201>
lea    0x28(%r14),%rbp
add    $0xfffffffb,%r13d
mov    $0x5,%r12d
mov    %r13d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%r14),%rcx
mov    0x18(%r14),%rsi
mov    0x20(%r14),%rdx
xor    %edi,%edi
mov    %rbp,%r8
mov    $0x64,%r9d
call   1030 <dopkgmirrorpkgs@plt>
add    $0x64,%r12
add    $0x320,%rbp
add    $0xffffff9c,%r15d
cmp    $0x64,%r15d
jg     1350 <main+0x1d0>
mov    0x10(%r14),%rcx
mov    0x18(%r14),%rsi
mov    0x20(%r14),%rdx
lea    (%r14,%r12,8),%r8
xor    %edi,%edi
mov    %r15d,%r9d
jmp    14a3 <main+0x323>
mov    0x8(%r14),%rdi
lea    0xc7c(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    13f8 <main+0x278>
cmp    $0x68,%r13d
jb     145e <main+0x2de>
lea    0x18(%r14),%rbp
add    $0xfffffffd,%r13d
mov    $0x3,%ebx
nopw   0x0(%rax,%rax,1)
mov    0x10(%r14),%rdi
mov    %rbp,%rsi
mov    $0x64,%edx
call   1040 <dopkgstanzas@plt>
add    $0x64,%rbx
add    $0x320,%rbp
add    $0xffffff9c,%r13d
cmp    $0x64,%r13d
jg     13d0 <main+0x250>
jmp    1467 <main+0x2e7>
mov    0x2be1(%rip),%rbx
mov    (%rbx),%edi
mov    (%r14),%rdx
lea    0xc1f(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r14),%rdx
lea    0xc39(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r14),%rdx
lea    0xc5a(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r14),%rdx
lea    0xc70(%rip),%rsi
call   1060 <fprintf@plt>
mov    (%rbx),%edi
mov    (%r14),%rdx
lea    0xc86(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1090 <exit@plt>
add    $0xfffffffd,%r13d
mov    $0x3,%ebx
mov    0x10(%r14),%rdi
lea    (%r14,%rbx,8),%rsi
mov    %r13d,%edx
call   1040 <dopkgstanzas@plt>
xor    %edi,%edi
call   1090 <exit@plt>
add    $0xfffffffc,%r13d
mov    $0x4,%r12d
mov    0x10(%r14),%rsi
mov    0x18(%r14),%rdx
lea    (%r14,%r12,8),%r8
lea    0xb78(%rip),%rcx
mov    $0x1,%edi
mov    %r13d,%r9d
call   1030 <dopkgmirrorpkgs@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"WGET%\00"
@.str.1 = [8 x i8] c"GETDEPS\00"
@.str.2 = [5 x i8] c"PKGS\00"
@.str.3 = [9 x i8] c"Package:\00"
@.str.4 = [6 x i8] c"FIELD\00"
@.str.5 = [8 x i8] c"STANZAS\00"
@stderr = global i32 0
@.str.6 = [43 x i8] c"usage: %s PKGS mirror packagesfile pkgs..\0A\00"
@.str.7 = [50 x i8] c" or: %s FIELD field mirror packagesfile pkgs..\0A\00"
@.str.8 = [39 x i8] c" or: %s GETDEPS packagesfile pkgs..\0A\00"
@.str.9 = [39 x i8] c" or: %s STANZAS packagesfile pkgs..\0A\00"
@.str.10 = [38 x i8] c" or: %s WGET%% low high end reason\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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 6
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 5
br i1 %14, label %15, label %49
15: ; preds = %12, %2
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i64 @strcmp(i8* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%20 = icmp eq i64 %19, 0
br i1 %20, label %21, label %49
21: ; preds = %15
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 3
%28 = load i8*, i8** %27
%29 = call i32 @atoi(i8* %28)
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 4
%32 = load i8*, i8** %31
%33 = call i32 @atoi(i8* %32)
%34 = load i32, i32* %4
%35 = icmp eq i32 %34, 6
br i1 %35, label %36, label %40
36: ; preds = %21
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 5
%39 = load i8*, i8** %38
br label %41
40: ; preds = %21
br label %41
41: ; preds = %40, %36
%42 = phi i8* [ %39, %36 ], [ null, %40 ]
%43 = call i64 @dotranslatewgetpercent(i32 %25, i32 %29, i32 %33, i8* %42)
%44 = icmp ne i64 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 @exit(i32 0)
unreachable
47: ; preds = %41
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %15, %12
%50 = load i32, i32* %4
%51 = icmp sge i32 %50, 4
br i1 %51, label %52, label %89
52: ; preds = %49
%53 = load i8**, i8*** %5
%54 = getelementptr inbounds i8*, i8** %53, i64 1
%55 = load i8*, i8** %54
%56 = call i64 @strcmp(i8* %55, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%57 = icmp eq i64 %56, 0
br i1 %57, label %58, label %89
58: ; preds = %52
store i32 3, i32* %6
br label %59
59: ; preds = %73, %58
%60 = load i32, i32* %4
%61 = load i32, i32* %6
%62 = sub nsw i32 %60, %61
%63 = icmp sgt i32 %62, 100
br i1 %63, label %64, label %76
64: ; preds = %59
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 2
%67 = load i8*, i8** %66
%68 = load i8**, i8*** %5
%69 = load i32, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8*, i8** %68, i64 %70
%72 = call i32 @dogetdeps(i8* %67, i8** %71, i32 100)
br label %73
73: ; preds = %64
%74 = load i32, i32* %6
%75 = add nsw i32 %74, 100
store i32 %75, i32* %6
br label %59
76: ; preds = %59
%77 = load i8**, i8*** %5
%78 = getelementptr inbounds i8*, i8** %77, i64 2
%79 = load i8*, i8** %78
%80 = load i8**, i8*** %5
%81 = load i32, i32* %6
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds i8*, i8** %80, i64 %82
%84 = load i32, i32* %4
%85 = load i32, i32* %6
%86 = sub nsw i32 %84, %85
%87 = call i32 @dogetdeps(i8* %79, i8** %83, i32 %86)
%88 = call i32 @exit(i32 0)
unreachable
89: ; preds = %52, %49
%90 = load i32, i32* %4
%91 = icmp sge i32 %90, 5
br i1 %91, label %92, label %135
92: ; preds = %89
%93 = load i8**, i8*** %5
%94 = getelementptr inbounds i8*, i8** %93, i64 1
%95 = load i8*, i8** %94
%96 = call i64 @strcmp(i8* %95, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%97 = icmp eq i64 %96, 0
br i1 %97, label %98, label %135
98: ; preds = %92
store i32 4, i32* %7
br label %99
99: ; preds = %116, %98
%100 = load i32, i32* %4
%101 = load i32, i32* %7
%102 = sub nsw i32 %100, %101
%103 = icmp sgt i32 %102, 100
br i1 %103, label %104, label %119
104: ; preds = %99
%105 = load i8**, i8*** %5
%106 = getelementptr inbounds i8*, i8** %105, i64 2
%107 = load i8*, i8** %106
%108 = load i8**, i8*** %5
%109 = getelementptr inbounds i8*, i8** %108, i64 3
%110 = load i8*, i8** %109
%111 = load i8**, i8*** %5
%112 = load i32, i32* %7
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8*, i8** %111, i64 %113
%115 = call i32 @dopkgmirrorpkgs(i32 1, i8* %107, i8* %110, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %114, i32 100)
br label %116
116: ; preds = %104
%117 = load i32, i32* %7
%118 = add nsw i32 %117, 100
store i32 %118, i32* %7
br label %99
119: ; preds = %99
%120 = load i8**, i8*** %5
%121 = getelementptr inbounds i8*, i8** %120, i64 2
%122 = load i8*, i8** %121
%123 = load i8**, i8*** %5
%124 = getelementptr inbounds i8*, i8** %123, i64 3
%125 = load i8*, i8** %124
%126 = load i8**, i8*** %5
%127 = load i32, i32* %7
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds i8*, i8** %126, i64 %128
%130 = load i32, i32* %4
%131 = load i32, i32* %7
%132 = sub nsw i32 %130, %131
%133 = call i32 @dopkgmirrorpkgs(i32 1, i8* %122, i8* %125, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %129, i32 %132)
%134 = call i32 @exit(i32 0)
unreachable
135: ; preds = %92, %89
%136 = load i32, i32* %4
%137 = icmp sge i32 %136, 6
br i1 %137, label %138, label %187
138: ; preds = %135
%139 = load i8**, i8*** %5
%140 = getelementptr inbounds i8*, i8** %139, i64 1
%141 = load i8*, i8** %140
%142 = call i64 @strcmp(i8* %141, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%143 = icmp eq i64 %142, 0
br i1 %143, label %144, label %187
144: ; preds = %138
store i32 5, i32* %8
br label %145
145: ; preds = %165, %144
%146 = load i32, i32* %4
%147 = load i32, i32* %8
%148 = sub nsw i32 %146, %147
%149 = icmp sgt i32 %148, 100
br i1 %149, label %150, label %168
150: ; preds = %145
%151 = load i8**, i8*** %5
%152 = getelementptr inbounds i8*, i8** %151, i64 3
%153 = load i8*, i8** %152
%154 = load i8**, i8*** %5
%155 = getelementptr inbounds i8*, i8** %154, i64 4
%156 = load i8*, i8** %155
%157 = load i8**, i8*** %5
%158 = getelementptr inbounds i8*, i8** %157, i64 2
%159 = load i8*, i8** %158
%160 = load i8**, i8*** %5
%161 = load i32, i32* %8
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i8*, i8** %160, i64 %162
%164 = call i32 @dopkgmirrorpkgs(i32 0, i8* %153, i8* %156, i8* %159, i8** %163, i32 100)
br label %165
165: ; preds = %150
%166 = load i32, i32* %8
%167 = add nsw i32 %166, 100
store i32 %167, i32* %8
br label %145
168: ; preds = %145
%169 = load i8**, i8*** %5
%170 = getelementptr inbounds i8*, i8** %169, i64 3
%171 = load i8*, i8** %170
%172 = load i8**, i8*** %5
%173 = getelementptr inbounds i8*, i8** %172, i64 4
%174 = load i8*, i8** %173
%175 = load i8**, i8*** %5
%176 = getelementptr inbounds i8*, i8** %175, i64 2
%177 = load i8*, i8** %176
%178 = load i8**, i8*** %5
%179 = load i32, i32* %8
%180 = sext i32 %179 to i64
%181 = getelementptr inbounds i8*, i8** %178, i64 %180
%182 = load i32, i32* %4
%183 = load i32, i32* %8
%184 = sub nsw i32 %182, %183
%185 = call i32 @dopkgmirrorpkgs(i32 0, i8* %171, i8* %174, i8* %177, i8** %181, i32 %184)
%186 = call i32 @exit(i32 0)
unreachable
187: ; preds = %138, %135
%188 = load i32, i32* %4
%189 = icmp sge i32 %188, 4
br i1 %189, label %190, label %227
190: ; preds = %187
%191 = load i8**, i8*** %5
%192 = getelementptr inbounds i8*, i8** %191, i64 1
%193 = load i8*, i8** %192
%194 = call i64 @strcmp(i8* %193, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%195 = icmp eq i64 %194, 0
br i1 %195, label %196, label %227
196: ; preds = %190
store i32 3, i32* %9
br label %197
197: ; preds = %211, %196
%198 = load i32, i32* %4
%199 = load i32, i32* %9
%200 = sub nsw i32 %198, %199
%201 = icmp sgt i32 %200, 100
br i1 %201, label %202, label %214
202: ; preds = %197
%203 = load i8**, i8*** %5
%204 = getelementptr inbounds i8*, i8** %203, i64 2
%205 = load i8*, i8** %204
%206 = load i8**, i8*** %5
%207 = load i32, i32* %9
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds i8*, i8** %206, i64 %208
%210 = call i32 @dopkgstanzas(i8* %205, i8** %209, i32 100)
br label %211
211: ; preds = %202
%212 = load i32, i32* %9
%213 = add nsw i32 %212, 100
store i32 %213, i32* %9
br label %197
214: ; preds = %197
%215 = load i8**, i8*** %5
%216 = getelementptr inbounds i8*, i8** %215, i64 2
%217 = load i8*, i8** %216
%218 = load i8**, i8*** %5
%219 = load i32, i32* %9
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i8*, i8** %218, i64 %220
%222 = load i32, i32* %4
%223 = load i32, i32* %9
%224 = sub nsw i32 %222, %223
%225 = call i32 @dopkgstanzas(i8* %217, i8** %221, i32 %224)
%226 = call i32 @exit(i32 0)
unreachable
227: ; preds = %190, %187
%228 = load i32, i32* @stderr
%229 = load i8**, i8*** %5
%230 = getelementptr inbounds i8*, i8** %229, i64 0
%231 = load i8*, i8** %230
%232 = call i32 @fprintf(i32 %228, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %231)
%233 = load i32, i32* @stderr
%234 = load i8**, i8*** %5
%235 = getelementptr inbounds i8*, i8** %234, i64 0
%236 = load i8*, i8** %235
%237 = call i32 @fprintf(i32 %233, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8* %236)
%238 = load i32, i32* @stderr
%239 = load i8**, i8*** %5
%240 = getelementptr inbounds i8*, i8** %239, i64 0
%241 = load i8*, i8** %240
%242 = call i32 @fprintf(i32 %238, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %241)
%243 = load i32, i32* @stderr
%244 = load i8**, i8*** %5
%245 = getelementptr inbounds i8*, i8** %244, i64 0
%246 = load i8*, i8** %245
%247 = call i32 @fprintf(i32 %243, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8* %246)
%248 = load i32, i32* @stderr
%249 = load i8**, i8*** %5
%250 = getelementptr inbounds i8*, i8** %249, i64 0
%251 = load i8*, i8** %250
%252 = call i32 @fprintf(i32 %248, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i8* %251)
%253 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"WGET%\00"
@.str.1 = [8 x i8] c"GETDEPS\00"
@.str.2 = [5 x i8] c"PKGS\00"
@.str.3 = [9 x i8] c"Package:\00"
@.str.4 = [6 x i8] c"FIELD\00"
@.str.5 = [8 x i8] c"STANZAS\00"
@stderr = global i32 0
@.str.6 = [43 x i8] c"usage: %s PKGS mirror packagesfile pkgs..\0A\00"
@.str.7 = [50 x i8] c" or: %s FIELD field mirror packagesfile pkgs..\0A\00"
@.str.8 = [39 x i8] c" or: %s GETDEPS packagesfile pkgs..\0A\00"
@.str.9 = [39 x i8] c" or: %s STANZAS packagesfile pkgs..\0A\00"
@.str.10 = [38 x i8] c" or: %s WGET%% low high end reason\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 6
%4 = add i32 %0, -5
%5 = icmp ult i32 %4, 2
br i1 %5, label %6, label %32
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %34
11: ; preds = %6
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 3
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 4
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
br i1 %3, label %21, label %24
21: ; preds = %11
%22 = getelementptr inbounds i8*, i8** %1, i64 5
%23 = load i8*, i8** %22
br label %24
24: ; preds = %11, %21
%25 = phi i8* [ %23, %21 ], [ null, %11 ]
%26 = tail call i64 @dotranslatewgetpercent(i32 %14, i32 %17, i32 %20, i8* %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %30, label %28
28: ; preds = %24
%29 = tail call i32 @exit(i32 0)
unreachable
30: ; preds = %24
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %2
%33 = icmp sgt i32 %0, 3
br i1 %33, label %34, label %162
34: ; preds = %6, %32
%35 = getelementptr inbounds i8*, i8** %1, i64 1
%36 = load i8*, i8** %35
%37 = tail call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %63
39: ; preds = %34
%40 = add nsw i32 %0, -3
%41 = icmp ugt i32 %0, 103
br i1 %41, label %42, label %55
42: ; preds = %39
%43 = getelementptr inbounds i8*, i8** %1, i64 2
br label %44
44: ; preds = %42, %44
%45 = phi i64 [ 3, %42 ], [ %49, %44 ]
%46 = load i8*, i8** %43
%47 = getelementptr inbounds i8*, i8** %1, i64 %45
%48 = tail call i32 @dogetdeps(i8* %46, i8** %47, i32 100)
%49 = add nuw nsw i64 %45, 100
%50 = trunc i64 %49 to i32
%51 = sub nsw i32 %0, %50
%52 = icmp sgt i32 %51, 100
br i1 %52, label %44, label %53
53: ; preds = %44
%54 = and i64 %49, 4294967295
br label %55
55: ; preds = %53, %39
%56 = phi i64 [ 3, %39 ], [ %54, %53 ]
%57 = phi i32 [ %40, %39 ], [ %51, %53 ]
%58 = getelementptr inbounds i8*, i8** %1, i64 2
%59 = load i8*, i8** %58
%60 = getelementptr inbounds i8*, i8** %1, i64 %56
%61 = tail call i32 @dogetdeps(i8* %59, i8** %60, i32 %57)
%62 = tail call i32 @exit(i32 0)
unreachable
63: ; preds = %34
%64 = icmp ugt i32 %0, 4
br i1 %64, label %65, label %134
65: ; preds = %63
%66 = load i8*, i8** %35
%67 = tail call i64 @strcmp(i8* %66, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %97
69: ; preds = %65
%70 = add nsw i32 %0, -4
%71 = icmp ugt i32 %0, 104
br i1 %71, label %72, label %87
72: ; preds = %69
%73 = getelementptr inbounds i8*, i8** %1, i64 2
%74 = getelementptr inbounds i8*, i8** %1, i64 3
br label %75
75: ; preds = %72, %75
%76 = phi i64 [ 4, %72 ], [ %81, %75 ]
%77 = load i8*, i8** %73
%78 = load i8*, i8** %74
%79 = getelementptr inbounds i8*, i8** %1, i64 %76
%80 = tail call i32 @dopkgmirrorpkgs(i32 1, i8* %77, i8* %78, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %79, i32 100)
%81 = add nuw nsw i64 %76, 100
%82 = trunc i64 %81 to i32
%83 = sub nsw i32 %0, %82
%84 = icmp sgt i32 %83, 100
br i1 %84, label %75, label %85
85: ; preds = %75
%86 = and i64 %81, 4294967292
br label %87
87: ; preds = %85, %69
%88 = phi i64 [ 4, %69 ], [ %86, %85 ]
%89 = phi i32 [ %70, %69 ], [ %83, %85 ]
%90 = getelementptr inbounds i8*, i8** %1, i64 2
%91 = load i8*, i8** %90
%92 = getelementptr inbounds i8*, i8** %1, i64 3
%93 = load i8*, i8** %92
%94 = getelementptr inbounds i8*, i8** %1, i64 %88
%95 = tail call i32 @dopkgmirrorpkgs(i32 1, i8* %91, i8* %93, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8** %94, i32 %89)
%96 = tail call i32 @exit(i32 0)
unreachable
97: ; preds = %65
%98 = icmp ugt i32 %0, 5
br i1 %98, label %99, label %134
99: ; preds = %97
%100 = load i8*, i8** %35
%101 = tail call i64 @strcmp(i8* %100, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%102 = icmp eq i64 %101, 0
br i1 %102, label %103, label %134
103: ; preds = %99
%104 = icmp ugt i32 %0, 105
br i1 %104, label %105, label %122
105: ; preds = %103
%106 = getelementptr inbounds i8*, i8** %1, i64 3
%107 = getelementptr inbounds i8*, i8** %1, i64 4
%108 = getelementptr inbounds i8*, i8** %1, i64 2
br label %109
109: ; preds = %105, %109
%110 = phi i64 [ 5, %105 ], [ %116, %109 ]
%111 = load i8*, i8** %106
%112 = load i8*, i8** %107
%113 = load i8*, i8** %108
%114 = getelementptr inbounds i8*, i8** %1, i64 %110
%115 = tail call i32 @dopkgmirrorpkgs(i32 0, i8* %111, i8* %112, i8* %113, i8** %114, i32 100)
%116 = add nuw nsw i64 %110, 100
%117 = trunc i64 %116 to i32
%118 = sub nsw i32 %0, %117
%119 = icmp sgt i32 %118, 100
br i1 %119, label %109, label %120
120: ; preds = %109
%121 = and i64 %116, 4294967295
br label %122
122: ; preds = %120, %103
%123 = phi i64 [ 5, %103 ], [ %121, %120 ]
%124 = phi i32 [ %4, %103 ], [ %118, %120 ]
%125 = getelementptr inbounds i8*, i8** %1, i64 3
%126 = load i8*, i8** %125
%127 = getelementptr inbounds i8*, i8** %1, i64 4
%128 = load i8*, i8** %127
%129 = getelementptr inbounds i8*, i8** %1, i64 2
%130 = load i8*, i8** %129
%131 = getelementptr inbounds i8*, i8** %1, i64 %123
%132 = tail call i32 @dopkgmirrorpkgs(i32 0, i8* %126, i8* %128, i8* %130, i8** %131, i32 %124)
%133 = tail call i32 @exit(i32 0)
unreachable
134: ; preds = %97, %99, %63
%135 = load i8*, i8** %35
%136 = tail call i64 @strcmp(i8* %135, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%137 = icmp eq i64 %136, 0
br i1 %137, label %138, label %162
138: ; preds = %134
%139 = add nsw i32 %0, -3
%140 = icmp ugt i32 %0, 103
br i1 %140, label %141, label %154
141: ; preds = %138
%142 = getelementptr inbounds i8*, i8** %1, i64 2
br label %143
143: ; preds = %141, %143
%144 = phi i64 [ 3, %141 ], [ %148, %143 ]
%145 = load i8*, i8** %142
%146 = getelementptr inbounds i8*, i8** %1, i64 %144
%147 = tail call i32 @dopkgstanzas(i8* %145, i8** %146, i32 100)
%148 = add nuw nsw i64 %144, 100
%149 = trunc i64 %148 to i32
%150 = sub nsw i32 %0, %149
%151 = icmp sgt i32 %150, 100
br i1 %151, label %143, label %152
152: ; preds = %143
%153 = and i64 %148, 4294967295
br label %154
154: ; preds = %152, %138
%155 = phi i64 [ 3, %138 ], [ %153, %152 ]
%156 = phi i32 [ %139, %138 ], [ %150, %152 ]
%157 = getelementptr inbounds i8*, i8** %1, i64 2
%158 = load i8*, i8** %157
%159 = getelementptr inbounds i8*, i8** %1, i64 %155
%160 = tail call i32 @dopkgstanzas(i8* %158, i8** %159, i32 %156)
%161 = tail call i32 @exit(i32 0)
unreachable
162: ; preds = %32, %134
%163 = load i32, i32* @stderr
%164 = load i8*, i8** %1
%165 = tail call i32 @fprintf(i32 %163, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.6, i64 0, i64 0), i8* %164)
%166 = load i32, i32* @stderr
%167 = load i8*, i8** %1
%168 = tail call i32 @fprintf(i32 %166, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0), i8* %167)
%169 = load i32, i32* @stderr
%170 = load i8*, i8** %1
%171 = tail call i32 @fprintf(i32 %169, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0), i8* %170)
%172 = load i32, i32* @stderr
%173 = load i8*, i8** %1
%174 = tail call i32 @fprintf(i32 %172, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.9, i64 0, i64 0), i8* %173)
%175 = load i32, i32* @stderr
%176 = load i8*, i8** %1
%177 = tail call i32 @fprintf(i32 %175, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.10, i64 0, i64 0), i8* %176)
%178 = tail call i32 @exit(i32 1)
unreachable
}