#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 long time_t;
struct stat {
  long st_mtime;
};
struct passwd {
  scalar_t__ pw_uid;
  int /*<<< orphan*/ pw_gid;
  int /*<<< orphan*/ pw_name;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int LOCK_EX;
int LOCK_NB;
int LOCK_UN;
int O_CREAT;
int /*<<< orphan*/ O_RDONLY;
int O_TRUNC;
int O_WRONLY;
int S_IRUSR;
int S_IWUSR;
int atol(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ execv(char *, char **);
int /*<<< orphan*/ fchown(int, scalar_t__, int /*<<< orphan*/);
int flock(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *,
                           char *);
char *getenv(char *);
struct passwd *getpwnam(char *);
scalar_t__ initgroups(int /*<<< orphan*/, int /*<<< orphan*/);
int open(char *, int, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read(int, char **, int);
int /*<<< orphan*/ setenv(char *, char *, int);
scalar_t__ setgid(int /*<<< orphan*/);
scalar_t__ setuid(scalar_t__);
int /*<<< orphan*/ snprintf(char *, int, char *, char *);
int stat(char *, struct stat *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
char *strlwr(char *);
char *strtok(char *, char *);
long time(int /*<<< orphan*/ *);
int /*<<< orphan*/ unlink(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  struct passwd *pw = NULL;
  char *remote_user = getenv("WEBDAV_USER");
  if (remote_user == NULL)
    remote_user = getenv("REDIRECT_WEBDAV_USER");
  if (remote_user == NULL)
    remote_user = getenv("REMOTE_USER");
  if (remote_user == NULL)
    remote_user = getenv("REDIRECT_REMOTE_USER");
  char *user = NULL;
  if (remote_user != NULL) {
    remote_user = strlwr(remote_user);
    setenv("REMOTE_USER", remote_user, 1);
    char buf[2000];
    snprintf(buf, 2000, "%s", remote_user);
    user = strtok(buf, "@");
    pw = getpwnam(user);
  }
  char dstfilename[2000];
  snprintf(dstfilename, 2000, "/tmp/krb5cc_webdavcgi_afs_%s", remote_user);
  char *krbticket = getenv("KRB5CCNAME");
  char krbenv[2000];
  snprintf(krbenv, 2000, "FILE:%s", dstfilename);
  setenv("KRB5CCNAME", krbenv, 1);
  if (krbticket != NULL && pw != NULL) {
    strtok(krbticket, ":");
    char *srcfilename = strtok(NULL, ":");
    struct stat dststat;
    time_t seconds = time(NULL);
    char *tlt = getenv("TICKET_LIFETIME");
    long ticket_lifetime = tlt != NULL ? atol(tlt) : 82800;
    int exists = stat(dstfilename, &dststat);
    if ((exists == -1) || (seconds - dststat.st_mtime > ticket_lifetime)) {
      if (exists == 0)
        unlink(dstfilename);
      int src, dst, dstmtime;
      if ((src = open(srcfilename, O_RDONLY)) != -1 &&
          (dst = open(dstfilename, O_CREAT | O_WRONLY | O_TRUNC,
                      S_IRUSR | S_IWUSR)) != -1 &&
          flock(dst, LOCK_EX | LOCK_NB) != -1) {
        char buf[2000];
        ssize_t count;
        while ((count = read(src, &buf, 2000)) > 0)
          write(dst, buf, count);
        close(src);
        flock(dst, LOCK_UN);
        fchown(dst, pw->pw_uid, pw->pw_gid);
        close(dst);
      } else {
        fprintf(stderr, "%s: ERROR: Cannot copy %s to %s: %s\n", argv[0],
                srcfilename, dstfilename, strerror(errno));
      }
    }
  }
  if ((pw != NULL) && (pw->pw_uid != 0)) {
    if (initgroups(pw->pw_name, pw->pw_gid) == 0 && setgid(pw->pw_gid) == 0 &&
        setuid(pw->pw_uid) == 0)
      execv("afswrapper", argv);
    else
      printf("Status: 500 Internal Sever Error");
  } else {
    printf("Status: 404 Not Found\r\n");
    printf("Content-Type: text/plain\r\n\r\n");
    printf("404 Not Found - your wrapper %s\n", argv[0]);
    printf("REMOTE_USER: %s\n", remote_user);
    printf("KRB5CCNAME: %s\n", krbticket);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1ff0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    0xd71(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12bc <main+0x4c>
lea    0xd4d(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12d7 <main+0x67>
lea    0xd50(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    12f2 <main+0x82>
lea    0xd2c(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1367 <main+0xf7>
mov    -0x20(%rbp),%rdi
call   1040 <strlwr@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xd01(%rip),%rdi
mov    $0x1,%edx
call   1060 <setenv@plt>
lea    -0x800(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x7d0,%esi
lea    0xd1b(%rip),%rdx
call   1090 <snprintf@plt>
lea    -0x800(%rbp),%rdi
lea    0xcd9(%rip),%rsi
call   1140 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   10c0 <getpwnam@plt>
mov    %rax,-0x18(%rbp)
lea    -0xfd0(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0x7d0,%esi
lea    0xcae(%rip),%rdx
call   1090 <snprintf@plt>
lea    0xcbf(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0xfd8(%rbp)
lea    -0x17b0(%rbp),%rdi
lea    -0xfd0(%rbp),%rcx
mov    $0x7d0,%esi
lea    0xca4(%rip),%rdx
call   1090 <snprintf@plt>
lea    -0x17b0(%rbp),%rsi
lea    0xc86(%rip),%rdi
mov    $0x1,%edx
call   1060 <setenv@plt>
cmpq   $0x0,-0xfd8(%rbp)
je     1672 <main+0x402>
cmpq   $0x0,-0x18(%rbp)
je     1672 <main+0x402>
mov    -0xfd8(%rbp),%rdi
lea    0xc68(%rip),%rsi
call   1140 <strtok@plt>
xor    %eax,%eax
mov    %eax,%edi
lea    0xc58(%rip),%rsi
call   1140 <strtok@plt>
mov    %rax,-0x17b8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10f0 <time@plt>
mov    %rax,-0x17c8(%rbp)
lea    0xc37(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x17d0(%rbp)
cmpq   $0x0,-0x17d0(%rbp)
je     1458 <main+0x1e8>
mov    -0x17d0(%rbp),%rdi
call   1110 <atol@plt>
mov    %eax,-0x1fc8(%rbp)
jmp    1468 <main+0x1f8>
mov    $0x14370,%eax
mov    %eax,-0x1fc8(%rbp)
jmp    1468 <main+0x1f8>
mov    -0x1fc8(%rbp),%eax
cltq
mov    %rax,-0x17d8(%rbp)
lea    -0xfd0(%rbp),%rdi
lea    -0x17c0(%rbp),%rsi
call   10e0 <stat@plt>
mov    %eax,-0x17dc(%rbp)
cmpl   $0xffffffff,-0x17dc(%rbp)
je     14b8 <main+0x248>
mov    -0x17c8(%rbp),%rax
sub    -0x17c0(%rbp),%rax
cmp    -0x17d8(%rbp),%rax
jle    166d <main+0x3fd>
cmpl   $0x0,-0x17dc(%rbp)
jne    14d1 <main+0x261>
lea    -0xfd0(%rbp),%rdi
call   1050 <unlink@plt>
mov    -0x17b8(%rbp),%rdi
mov    0x2af1(%rip),%rax
mov    (%rax),%esi
mov    $0x0,%al
call   1120 <open@plt>
mov    %eax,-0x17e0(%rbp)
cmp    $0xffffffff,%eax
je     15f7 <main+0x387>
lea    -0xfd0(%rbp),%rdi
mov    0x2af3(%rip),%rax
mov    (%rax),%esi
mov    0x2a82(%rip),%rax
or     (%rax),%esi
mov    0x2ad9(%rip),%rax
or     (%rax),%esi
mov    0x2a88(%rip),%rax
mov    (%rax),%edx
mov    0x2a9f(%rip),%rax
or     (%rax),%edx
mov    $0x0,%al
call   1120 <open@plt>
mov    %eax,-0x17e4(%rbp)
cmp    $0xffffffff,%eax
je     15f7 <main+0x387>
mov    -0x17e4(%rbp),%edi
mov    0x2a8a(%rip),%rax
mov    (%rax),%esi
mov    0x2a31(%rip),%rax
or     (%rax),%esi
call   1150 <flock@plt>
cmp    $0xffffffff,%eax
je     15f7 <main+0x387>
jmp    156c <main+0x2fc>
mov    -0x17e0(%rbp),%edi
lea    -0x1fc0(%rbp),%rsi
mov    $0x7d0,%edx
call   10b0 <read@plt>
mov    %eax,-0x1fc4(%rbp)
cmp    $0x0,%eax
jle    15af <main+0x33f>
mov    -0x17e4(%rbp),%edi
lea    -0x1fc0(%rbp),%rsi
mov    -0x1fc4(%rbp),%edx
call   1070 <write@plt>
jmp    156c <main+0x2fc>
mov    -0x17e0(%rbp),%edi
call   10a0 <close@plt>
mov    -0x17e4(%rbp),%edi
mov    0x29d9(%rip),%rax
mov    (%rax),%esi
call   1150 <flock@plt>
mov    -0x17e4(%rbp),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edx
call   1130 <fchown@plt>
mov    -0x17e4(%rbp),%edi
call   10a0 <close@plt>
jmp    1668 <main+0x3f8>
mov    0x29ba(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1fe4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x1fe0(%rbp)
mov    -0x17b8(%rbp),%rax
mov    %rax,-0x1fd8(%rbp)
lea    -0xfd0(%rbp),%rax
mov    %rax,-0x1fd0(%rbp)
mov    0x2979(%rip),%rax
mov    (%rax),%edi
call   1170 <strerror@plt>
mov    -0x1fe4(%rbp),%edi
mov    -0x1fe0(%rbp),%rdx
mov    -0x1fd8(%rbp),%rcx
mov    -0x1fd0(%rbp),%r8
mov    %rax,%r9
lea    0xa0b(%rip),%rsi
call   10d0 <fprintf@plt>
jmp    166d <main+0x3fd>
jmp    1672 <main+0x402>
cmpq   $0x0,-0x18(%rbp)
je     16fc <main+0x48c>
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
je     16fc <main+0x48c>
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%esi
call   1180 <initgroups@plt>
cmp    $0x0,%rax
jne    16e9 <main+0x479>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edi
call   1100 <setgid@plt>
cmp    $0x0,%rax
jne    16e9 <main+0x479>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1160 <setuid@plt>
cmp    $0x0,%rax
jne    16e9 <main+0x479>
mov    -0x10(%rbp),%rsi
lea    0x9b4(%rip),%rdi
call   1190 <execv@plt>
jmp    16f7 <main+0x487>
lea    0x9ae(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1754 <main+0x4e4>
lea    0x9bc(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0x9c6(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0x9ce(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0x9dd(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xfd8(%rbp),%rsi
lea    0x9d9(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1ff0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1798,%rsp
mov    %rsi,0x8(%rsp)
lea    0xd6c(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
jne    12de <main+0x5e>
lea    0xd52(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
jne    12de <main+0x5e>
lea    0xd5f(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
jne    12de <main+0x5e>
lea    0xd45(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     160d <main+0x38d>
mov    %rax,%rdi
call   1040 <strlwr@plt>
mov    %rax,%r15
lea    0xd2e(%rip),%rdi
mov    %rax,%rsi
mov    $0x1,%edx
call   1070 <setenv@plt>
lea    0xd55(%rip),%rdx
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x7d0,%esi
mov    %r15,%rcx
call   10a0 <snprintf@plt>
lea    0xd0a(%rip),%rsi
mov    %rbx,%rdi
call   1150 <strtok@plt>
mov    %rax,%rdi
call   10d0 <getpwnam@plt>
mov    %rax,%r13
lea    0xcf2(%rip),%rdx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    $0x7d0,%esi
mov    %r15,%rcx
call   10a0 <snprintf@plt>
lea    0xcf3(%rip),%rbp
mov    %rbp,%rdi
call   1030 <getenv@plt>
mov    %rax,%r12
lea    0xcec(%rip),%rdx
lea    0xfc0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x7d0,%esi
mov    %r14,%rcx
call   10a0 <snprintf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1070 <setenv@plt>
test   %r13,%r13
je     155f <main+0x2df>
test   %r12,%r12
je     155f <main+0x2df>
lea    0xcb3(%rip),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1150 <strtok@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1150 <strtok@plt>
mov    %rax,%r14
xor    %edi,%edi
call   1100 <time@plt>
mov    %rax,%rbp
lea    0xc8c(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     13e9 <main+0x169>
mov    %rax,%rdi
call   1120 <atol@plt>
movslq %eax,%rbx
jmp    13ee <main+0x16e>
mov    $0x14370,%ebx
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   10f0 <stat@plt>
cmp    $0xffffffff,%eax
je     141e <main+0x19e>
sub    0x18(%rsp),%rbp
cmp    %rbx,%rbp
jle    155f <main+0x2df>
test   %eax,%eax
jne    141e <main+0x19e>
lea    0x20(%rsp),%rdi
call   1050 <unlink@plt>
mov    0x2bab(%rip),%rax
mov    (%rax),%esi
mov    %r14,0x10(%rsp)
mov    %r14,%rdi
xor    %eax,%eax
call   1130 <open@plt>
cmp    $0xffffffff,%eax
je     1522 <main+0x2a2>
mov    %eax,%ebp
mov    0x2bb0(%rip),%rax
mov    0x2b41(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2b96(%rip),%rax
or     (%rax),%esi
mov    0x2b45(%rip),%rax
mov    0x2b5e(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
lea    0x20(%rsp),%rdi
xor    %eax,%eax
call   1130 <open@plt>
cmp    $0xffffffff,%eax
je     1522 <main+0x2a2>
mov    %eax,%r14d
mov    0x2b4b(%rip),%rax
mov    0x2af4(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    %r14d,%edi
call   1160 <flock@plt>
cmp    $0xffffffff,%eax
je     1522 <main+0x2a2>
lea    0x7f0(%rsp),%rsi
mov    %ebp,%edi
mov    $0x7d0,%edx
call   10c0 <read@plt>
test   %eax,%eax
jle    14f0 <main+0x270>
lea    0x7f0(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1080 <write@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x7d0,%edx
call   10c0 <read@plt>
test   %eax,%eax
jg     14d0 <main+0x250>
mov    %ebp,%edi
call   10b0 <close@plt>
mov    0x2aa2(%rip),%rax
mov    (%rax),%esi
mov    %r14d,%edi
call   1160 <flock@plt>
mov    0x0(%r13),%rsi
mov    0x8(%r13),%edx
mov    %r14d,%edi
call   1140 <fchown@plt>
mov    %r14d,%edi
call   10b0 <close@plt>
jmp    155f <main+0x2df>
mov    0x2a8f(%rip),%rax
mov    (%rax),%ebp
mov    0x8(%rsp),%rax
mov    (%rax),%rbx
mov    0x2a76(%rip),%rax
mov    (%rax),%edi
call   1180 <strerror@plt>
lea    0xb26(%rip),%rsi
lea    0x20(%rsp),%r8
mov    %ebp,%edi
mov    %rbx,%rdx
mov    0x10(%rsp),%rcx
mov    %rax,%r9
call   10e0 <fprintf@plt>
test   %r13,%r13
je     15a9 <main+0x329>
cmpq   $0x0,0x0(%r13)
je     15a9 <main+0x329>
mov    0x8(%r13),%esi
mov    0xc(%r13),%edi
call   1190 <initgroups@plt>
test   %rax,%rax
jne    1599 <main+0x319>
mov    0x8(%r13),%edi
call   1110 <setgid@plt>
test   %rax,%rax
jne    1599 <main+0x319>
mov    0x0(%r13),%rdi
call   1170 <setuid@plt>
test   %rax,%rax
je     1618 <main+0x398>
lea    0xafe(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    15f9 <main+0x379>
lea    0xb51(%rip),%rdi
call   1060 <puts@plt>
lea    0xb5c(%rip),%rdi
call   1060 <puts@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%rsi
lea    0xaef(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xb02(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xb02(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
add    $0x1798,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %r15d,%r15d
xor    %r13d,%r13d
jmp    1333 <main+0xb3>
lea    0xa74(%rip),%rdi
mov    0x8(%rsp),%rsi
call   11a0 <execv@plt>
jmp    15f9 <main+0x379>

LLVM IR (-O0):
%struct.passwd = type { i64, i32, i32 }
%struct.stat = type { i64 }
@.str = [12 x i8] c"WEBDAV_USER\00"
@.str.1 = [21 x i8] c"REDIRECT_WEBDAV_USER\00"
@.str.2 = [12 x i8] c"REMOTE_USER\00"
@.str.3 = [21 x i8] c"REDIRECT_REMOTE_USER\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [2 x i8] c"@\00"
@.str.6 = [29 x i8] c"/tmp/krb5cc_webdavcgi_afs_%s\00"
@.str.7 = [11 x i8] c"KRB5CCNAME\00"
@.str.8 = [8 x i8] c"FILE:%s\00"
@.str.9 = [2 x i8] c":\00"
@.str.10 = [16 x i8] c"TICKET_LIFETIME\00"
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@LOCK_EX = global i32 0
@LOCK_NB = global i32 0
@LOCK_UN = global i32 0
@stderr = global i32 0
@.str.11 = [37 x i8] c"%s: ERROR: Cannot copy %s to %s: %s\0A\00"
@errno = global i32 0
@.str.12 = [11 x i8] c"afswrapper\00"
@.str.13 = [33 x i8] c"Status: 500 Internal Sever Error\00"
@.str.14 = [24 x i8] c"Status: 404 Not Found\0D\0A\00"
@.str.15 = [29 x i8] c"Content-Type: text/plain\0D\0A\0D\0A\00"
@.str.16 = [33 x i8] c"404 Not Found - your wrapper %s\0A\00"
@.str.17 = [17 x i8] c"REMOTE_USER: %s\0A\00"
@.str.18 = [16 x i8] c"KRB5CCNAME: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.passwd*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca [2000 x i8]
%10 = alloca [2000 x i8]
%11 = alloca i8*
%12 = alloca [2000 x i8]
%13 = alloca i8*
%14 = alloca %struct.stat
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca [2000 x i8]
%23 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store %struct.passwd* null, %struct.passwd** %6
%24 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i8* %24, i8** %7
%25 = load i8*, i8** %7
%26 = icmp eq i8* %25, null
br i1 %26, label %27, label %29
27: ; preds = %2
%28 = call i8* @getenv(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
store i8* %28, i8** %7
br label %29
29: ; preds = %27, %2
%30 = load i8*, i8** %7
%31 = icmp eq i8* %30, null
br i1 %31, label %32, label %34
32: ; preds = %29
%33 = call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
store i8* %33, i8** %7
br label %34
34: ; preds = %32, %29
%35 = load i8*, i8** %7
%36 = icmp eq i8* %35, null
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i8* @getenv(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
store i8* %38, i8** %7
br label %39
39: ; preds = %37, %34
store i8* null, i8** %8
%40 = load i8*, i8** %7
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %54
42: ; preds = %39
%43 = load i8*, i8** %7
%44 = call i8* @strlwr(i8* %43)
store i8* %44, i8** %7
%45 = load i8*, i8** %7
%46 = call i32 @setenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %45, i32 1)
%47 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%48 = load i8*, i8** %7
%49 = call i32 @snprintf(i8* %47, i32 2000, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %48)
%50 = getelementptr inbounds [2000 x i8], [2000 x i8]* %9, i64 0, i64 0
%51 = call i8* @strtok(i8* %50, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i8* %51, i8** %8
%52 = load i8*, i8** %8
%53 = call %struct.passwd* @getpwnam(i8* %52)
store %struct.passwd* %53, %struct.passwd** %6
br label %54
54: ; preds = %42, %39
%55 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%56 = load i8*, i8** %7
%57 = call i32 @snprintf(i8* %55, i32 2000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %56)
%58 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
store i8* %58, i8** %11
%59 = getelementptr inbounds [2000 x i8], [2000 x i8]* %12, i64 0, i64 0
%60 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%61 = call i32 @snprintf(i8* %59, i32 2000, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %60)
%62 = getelementptr inbounds [2000 x i8], [2000 x i8]* %12, i64 0, i64 0
%63 = call i32 @setenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %62, i32 1)
%64 = load i8*, i8** %11
%65 = icmp ne i8* %64, null
br i1 %65, label %66, label %164
66: ; preds = %54
%67 = load %struct.passwd*, %struct.passwd** %6
%68 = icmp ne %struct.passwd* %67, null
br i1 %68, label %69, label %164
69: ; preds = %66
%70 = load i8*, i8** %11
%71 = call i8* @strtok(i8* %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%72 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i8* %72, i8** %13
%73 = call i64 @time(i32* null)
store i64 %73, i64* %15
%74 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
store i8* %74, i8** %16
%75 = load i8*, i8** %16
%76 = icmp ne i8* %75, null
br i1 %76, label %77, label %80
77: ; preds = %69
%78 = load i8*, i8** %16
%79 = call i32 @atol(i8* %78)
br label %81
80: ; preds = %69
br label %81
81: ; preds = %80, %77
%82 = phi i32 [ %79, %77 ], [ 82800, %80 ]
%83 = sext i32 %82 to i64
store i64 %83, i64* %17
%84 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%85 = call i32 @stat(i8* %84, %struct.stat* %14)
store i32 %85, i32* %18
%86 = load i32, i32* %18
%87 = icmp eq i32 %86, -1
br i1 %87, label %95, label %88
88: ; preds = %81
%89 = load i64, i64* %15
%90 = getelementptr inbounds %struct.stat, %struct.stat* %14, i32 0, i32 0
%91 = load i64, i64* %90
%92 = sub nsw i64 %89, %91
%93 = load i64, i64* %17
%94 = icmp sgt i64 %92, %93
br i1 %94, label %95, label %163
95: ; preds = %88, %81
%96 = load i32, i32* %18
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %101
98: ; preds = %95
%99 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%100 = call i32 @unlink(i8* %99)
br label %101
101: ; preds = %98, %95
%102 = load i8*, i8** %13
%103 = load i32, i32* @O_RDONLY
%104 = call i32 (i8*, i32, ...) @open(i8* %102, i32 %103)
store i32 %104, i32* %19
%105 = icmp ne i32 %104, -1
br i1 %105, label %106, label %152
106: ; preds = %101
%107 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%108 = load i32, i32* @O_CREAT
%109 = load i32, i32* @O_WRONLY
%110 = or i32 %108, %109
%111 = load i32, i32* @O_TRUNC
%112 = or i32 %110, %111
%113 = load i32, i32* @S_IRUSR
%114 = load i32, i32* @S_IWUSR
%115 = or i32 %113, %114
%116 = call i32 (i8*, i32, ...) @open(i8* %107, i32 %112, i32 %115)
store i32 %116, i32* %20
%117 = icmp ne i32 %116, -1
br i1 %117, label %118, label %152
118: ; preds = %106
%119 = load i32, i32* %20
%120 = load i32, i32* @LOCK_EX
%121 = load i32, i32* @LOCK_NB
%122 = or i32 %120, %121
%123 = call i32 @flock(i32 %119, i32 %122)
%124 = icmp ne i32 %123, -1
br i1 %124, label %125, label %152
125: ; preds = %118
br label %126
126: ; preds = %131, %125
%127 = load i32, i32* %19
%128 = bitcast [2000 x i8]* %22 to i8**
%129 = call i32 @read(i32 %127, i8** %128, i32 2000)
store i32 %129, i32* %23
%130 = icmp sgt i32 %129, 0
br i1 %130, label %131, label %136
131: ; preds = %126
%132 = load i32, i32* %20
%133 = getelementptr inbounds [2000 x i8], [2000 x i8]* %22, i64 0, i64 0
%134 = load i32, i32* %23
%135 = call i32 @write(i32 %132, i8* %133, i32 %134)
br label %126
136: ; preds = %126
%137 = load i32, i32* %19
%138 = call i32 @close(i32 %137)
%139 = load i32, i32* %20
%140 = load i32, i32* @LOCK_UN
%141 = call i32 @flock(i32 %139, i32 %140)
%142 = load i32, i32* %20
%143 = load %struct.passwd*, %struct.passwd** %6
%144 = getelementptr inbounds %struct.passwd, %struct.passwd* %143, i32 0, i32 0
%145 = load i64, i64* %144
%146 = load %struct.passwd*, %struct.passwd** %6
%147 = getelementptr inbounds %struct.passwd, %struct.passwd* %146, i32 0, i32 1
%148 = load i32, i32* %147
%149 = call i32 @fchown(i32 %142, i64 %145, i32 %148)
%150 = load i32, i32* %20
%151 = call i32 @close(i32 %150)
br label %162
152: ; preds = %118, %106, %101
%153 = load i32, i32* @stderr
%154 = load i8**, i8*** %5
%155 = getelementptr inbounds i8*, i8** %154, i64 0
%156 = load i8*, i8** %155
%157 = load i8*, i8** %13
%158 = getelementptr inbounds [2000 x i8], [2000 x i8]* %10, i64 0, i64 0
%159 = load i32, i32* @errno
%160 = call i8* @strerror(i32 %159)
%161 = call i32 @fprintf(i32 %153, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i8* %156, i8* %157, i8* %158, i8* %160)
br label %162
162: ; preds = %152, %136
br label %163
163: ; preds = %162, %88
br label %164
164: ; preds = %163, %66, %54
%165 = load %struct.passwd*, %struct.passwd** %6
%166 = icmp ne %struct.passwd* %165, null
br i1 %166, label %167, label %199
167: ; preds = %164
%168 = load %struct.passwd*, %struct.passwd** %6
%169 = getelementptr inbounds %struct.passwd, %struct.passwd* %168, i32 0, i32 0
%170 = load i64, i64* %169
%171 = icmp ne i64 %170, 0
br i1 %171, label %172, label %199
172: ; preds = %167
%173 = load %struct.passwd*, %struct.passwd** %6
%174 = getelementptr inbounds %struct.passwd, %struct.passwd* %173, i32 0, i32 2
%175 = load i32, i32* %174
%176 = load %struct.passwd*, %struct.passwd** %6
%177 = getelementptr inbounds %struct.passwd, %struct.passwd* %176, i32 0, i32 1
%178 = load i32, i32* %177
%179 = call i64 @initgroups(i32 %175, i32 %178)
%180 = icmp eq i64 %179, 0
br i1 %180, label %181, label %196
181: ; preds = %172
%182 = load %struct.passwd*, %struct.passwd** %6
%183 = getelementptr inbounds %struct.passwd, %struct.passwd* %182, i32 0, i32 1
%184 = load i32, i32* %183
%185 = call i64 @setgid(i32 %184)
%186 = icmp eq i64 %185, 0
br i1 %186, label %187, label %196
187: ; preds = %181
%188 = load %struct.passwd*, %struct.passwd** %6
%189 = getelementptr inbounds %struct.passwd, %struct.passwd* %188, i32 0, i32 0
%190 = load i64, i64* %189
%191 = call i64 @setuid(i64 %190)
%192 = icmp eq i64 %191, 0
br i1 %192, label %193, label %196
193: ; preds = %187
%194 = load i8**, i8*** %5
%195 = call i32 @execv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8** %194)
br label %198
196: ; preds = %187, %181, %172
%197 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
br label %198
198: ; preds = %196, %193
br label %210
199: ; preds = %167, %164
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0))
%201 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0))
%202 = load i8**, i8*** %5
%203 = getelementptr inbounds i8*, i8** %202, i64 0
%204 = load i8*, i8** %203
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.16, i64 0, i64 0), i8* %204)
%206 = load i8*, i8** %7
%207 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0), i8* %206)
%208 = load i8*, i8** %11
%209 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0), i8* %208)
br label %210
210: ; preds = %199, %198
%211 = load i32, i32* %3
ret i32 %211
}

LLVM IR (-O2):
%struct.stat = type { i64 }
%struct.passwd = type { i64, i32, i32 }
@.str = [12 x i8] c"WEBDAV_USER\00"
@.str.1 = [21 x i8] c"REDIRECT_WEBDAV_USER\00"
@.str.2 = [12 x i8] c"REMOTE_USER\00"
@.str.3 = [21 x i8] c"REDIRECT_REMOTE_USER\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [2 x i8] c"@\00"
@.str.6 = [29 x i8] c"/tmp/krb5cc_webdavcgi_afs_%s\00"
@.str.7 = [11 x i8] c"KRB5CCNAME\00"
@.str.8 = [8 x i8] c"FILE:%s\00"
@.str.9 = [2 x i8] c":\00"
@.str.10 = [16 x i8] c"TICKET_LIFETIME\00"
@O_RDONLY = global i32 0
@O_CREAT = global i32 0
@O_WRONLY = global i32 0
@O_TRUNC = global i32 0
@S_IRUSR = global i32 0
@S_IWUSR = global i32 0
@LOCK_EX = global i32 0
@LOCK_NB = global i32 0
@LOCK_UN = global i32 0
@stderr = global i32 0
@.str.11 = [37 x i8] c"%s: ERROR: Cannot copy %s to %s: %s\0A\00"
@errno = global i32 0
@.str.12 = [11 x i8] c"afswrapper\00"
@.str.13 = [33 x i8] c"Status: 500 Internal Sever Error\00"
@.str.16 = [33 x i8] c"404 Not Found - your wrapper %s\0A\00"
@.str.17 = [17 x i8] c"REMOTE_USER: %s\0A\00"
@.str.18 = [16 x i8] c"KRB5CCNAME: %s\0A\00"
@str = [23 x i8] c"Status: 404 Not Found\0D\00"
@str.19 = [28 x i8] c"Content-Type: text/plain\0D\0A\0D\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca [2000 x i8]
%4 = alloca [2000 x i8]
%5 = alloca [2000 x i8]
%6 = alloca %struct.stat
%7 = alloca [2000 x i8]
%8 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = tail call i8* @getenv(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = tail call i8* @getenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = tail call i8* @getenv(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%18 = icmp eq i8* %17, null
br i1 %18, label %27, label %19
19: ; preds = %2, %10, %13, %16
%20 = phi i8* [ %17, %16 ], [ %14, %13 ], [ %11, %10 ], [ %8, %2 ]
%21 = tail call i8* @strlwr(i8* %20)
%22 = tail call i32 @setenv(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* %21, i32 1)
%23 = getelementptr inbounds [2000 x i8], [2000 x i8]* %3, i64 0, i64 0
%24 = call i32 @snprintf(i8* %23, i32 2000, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %21)
%25 = call i8* @strtok(i8* %23, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%26 = call %struct.passwd* @getpwnam(i8* %25)
br label %27
27: ; preds = %19, %16
%28 = phi i8* [ %21, %19 ], [ null, %16 ]
%29 = phi %struct.passwd* [ %26, %19 ], [ null, %16 ]
%30 = getelementptr inbounds [2000 x i8], [2000 x i8]* %4, i64 0, i64 0
%31 = call i32 @snprintf(i8* %30, i32 2000, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.6, i64 0, i64 0), i8* %28)
%32 = call i8* @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%33 = getelementptr inbounds [2000 x i8], [2000 x i8]* %5, i64 0, i64 0
%34 = call i32 @snprintf(i8* %33, i32 2000, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %30)
%35 = call i32 @setenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %33, i32 1)
%36 = icmp ne i8* %32, null
%37 = icmp ne %struct.passwd* %29, null
%38 = and i1 %37, %36
br i1 %38, label %39, label %110
39: ; preds = %27
%40 = call i8* @strtok(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%41 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%42 = bitcast %struct.stat* %6 to i8*
%43 = call i64 @time(i32* null)
%44 = call i8* @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
%45 = icmp eq i8* %44, null
br i1 %45, label %49, label %46
46: ; preds = %39
%47 = call i32 @atol(i8* %44)
%48 = sext i32 %47 to i64
br label %49
49: ; preds = %39, %46
%50 = phi i64 [ %48, %46 ], [ 82800, %39 ]
%51 = call i32 @stat(i8* %30, %struct.stat* %6)
%52 = icmp eq i32 %51, -1
br i1 %52, label %62, label %53
53: ; preds = %49
%54 = getelementptr inbounds %struct.stat, %struct.stat* %6, i64 0, i32 0
%55 = load i64, i64* %54
%56 = sub nsw i64 %43, %55
%57 = icmp sgt i64 %56, %50
br i1 %57, label %58, label %109
58: ; preds = %53
%59 = icmp eq i32 %51, 0
br i1 %59, label %60, label %62
60: ; preds = %58
%61 = call i32 @unlink(i8* %30)
br label %62
62: ; preds = %49, %60, %58
%63 = load i32, i32* @O_RDONLY
%64 = call i32 (i8*, i32, ...) @open(i8* %41, i32 %63)
%65 = icmp eq i32 %64, -1
br i1 %65, label %103, label %66
66: ; preds = %62
%67 = load i32, i32* @O_CREAT
%68 = load i32, i32* @O_WRONLY
%69 = or i32 %68, %67
%70 = load i32, i32* @O_TRUNC
%71 = or i32 %69, %70
%72 = load i32, i32* @S_IRUSR
%73 = load i32, i32* @S_IWUSR
%74 = or i32 %73, %72
%75 = call i32 (i8*, i32, ...) @open(i8* %30, i32 %71, i32 %74)
%76 = icmp eq i32 %75, -1
br i1 %76, label %103, label %77
77: ; preds = %66
%78 = load i32, i32* @LOCK_EX
%79 = load i32, i32* @LOCK_NB
%80 = or i32 %79, %78
%81 = call i32 @flock(i32 %75, i32 %80)
%82 = icmp eq i32 %81, -1
br i1 %82, label %103, label %83
83: ; preds = %77
%84 = getelementptr inbounds [2000 x i8], [2000 x i8]* %7, i64 0, i64 0
%85 = bitcast [2000 x i8]* %7 to i8**
%86 = call i32 @read(i32 %64, i8** %85, i32 2000)
%87 = icmp sgt i32 %86, 0
br i1 %87, label %88, label %93
88: ; preds = %83, %88
%89 = phi i32 [ %91, %88 ], [ %86, %83 ]
%90 = call i32 @write(i32 %75, i8* %84, i32 %89)
%91 = call i32 @read(i32 %64, i8** %85, i32 2000)
%92 = icmp sgt i32 %91, 0
br i1 %92, label %88, label %93
93: ; preds = %88, %83
%94 = call i32 @close(i32 %64)
%95 = load i32, i32* @LOCK_UN
%96 = call i32 @flock(i32 %75, i32 %95)
%97 = getelementptr inbounds %struct.passwd, %struct.passwd* %29, i64 0, i32 0
%98 = load i64, i64* %97
%99 = getelementptr inbounds %struct.passwd, %struct.passwd* %29, i64 0, i32 1
%100 = load i32, i32* %99
%101 = call i32 @fchown(i32 %75, i64 %98, i32 %100)
%102 = call i32 @close(i32 %75)
br label %109
103: ; preds = %77, %66, %62
%104 = load i32, i32* @stderr
%105 = load i8*, i8** %1
%106 = load i32, i32* @errno
%107 = call i8* @strerror(i32 %106)
%108 = call i32 @fprintf(i32 %104, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i8* %105, i8* %41, i8* %30, i8* %107)
br label %109
109: ; preds = %93, %103, %53
br label %110
110: ; preds = %109, %27
br i1 %37, label %111, label %134
111: ; preds = %110
%112 = getelementptr inbounds %struct.passwd, %struct.passwd* %29, i64 0, i32 0
%113 = load i64, i64* %112
%114 = icmp eq i64 %113, 0
br i1 %114, label %134, label %115
115: ; preds = %111
%116 = getelementptr inbounds %struct.passwd, %struct.passwd* %29, i64 0, i32 2
%117 = load i32, i32* %116
%118 = getelementptr inbounds %struct.passwd, %struct.passwd* %29, i64 0, i32 1
%119 = load i32, i32* %118
%120 = call i64 @initgroups(i32 %117, i32 %119)
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %132
122: ; preds = %115
%123 = load i32, i32* %118
%124 = call i64 @setgid(i32 %123)
%125 = icmp eq i64 %124, 0
br i1 %125, label %126, label %132
126: ; preds = %122
%127 = load i64, i64* %112
%128 = call i64 @setuid(i64 %127)
%129 = icmp eq i64 %128, 0
br i1 %129, label %130, label %132
130: ; preds = %126
%131 = call i32 @execv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8** %1)
br label %141
132: ; preds = %126, %122, %115
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.13, i64 0, i64 0))
br label %141
134: ; preds = %111, %110
%135 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%136 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.19, i64 0, i64 0))
%137 = load i8*, i8** %1
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.16, i64 0, i64 0), i8* %137)
%139 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.17, i64 0, i64 0), i8* %28)
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0), i8* %32)
br label %141
141: ; preds = %130, %132, %134
ret i32 0
}