#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*/ workgroup;
typedef int /*<<< orphan*/ username;
typedef int /*<<< orphan*/ temp;
typedef int /*<<< orphan*/ password;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ getenv(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char const *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
void get_auth_data_fn(const char *pServer, const char *pShare, char *pWorkgroup,
                      int maxLenWorkgroup, char *pUsername, int maxLenUsername,
                      char *pPassword, int maxLenPassword) {
  char temp[128];
  char server[256] = {'\0'};
  char share[256] = {'\0'};
  char workgroup[256] = {'\0'};
  char username[256] = {'\0'};
  char password[256] = {'\0'};
  static int krb5_set = 1;
  if (strcmp(server, pServer) == 0 && strcmp(share, pShare) == 0 &&
      *workgroup != '\0' && *username != '\0') {
    strncpy(pWorkgroup, workgroup, maxLenWorkgroup - 1);
    strncpy(pUsername, username, maxLenUsername - 1);
    strncpy(pPassword, password, maxLenPassword - 1);
    return;
  }
  if (krb5_set && getenv("KRB5CCNAME")) {
    krb5_set = 0;
    return;
  }
  fprintf(stdout, "Workgroup: [%s] ", pWorkgroup);
  fgets(temp, sizeof(temp), stdin);
  if (temp[strlen(temp) - 1] == '\n') {
    temp[strlen(temp) - 1] = '\0';
  }
  if (temp[0] != '\0') {
    strncpy(pWorkgroup, temp, maxLenWorkgroup - 1);
  }
  fprintf(stdout, "Username: [%s] ", pUsername);
  fgets(temp, sizeof(temp), stdin);
  if (temp[strlen(temp) - 1] == '\n') {
    temp[strlen(temp) - 1] = '\0';
  }
  if (temp[0] != '\0') {
    strncpy(pUsername, temp, maxLenUsername - 1);
  }
  fprintf(stdout, "Password: ");
  fgets(temp, sizeof(temp), stdin);
  if (temp[strlen(temp) - 1] == '\n') {
    temp[strlen(temp) - 1] = '\0';
  }
  if (temp[0] != '\0') {
    strncpy(pPassword, temp, maxLenPassword - 1);
  }
  strncpy(workgroup, pWorkgroup, sizeof(workgroup) - 1);
  strncpy(username, pUsername, sizeof(username) - 1);
  strncpy(password, pPassword, sizeof(password) - 1);
  krb5_set = 1;
}


x86 assembly (clang, -O0):
<get_auth_data_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5b0,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
lea    -0x1b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
lea    -0x2b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
lea    -0x3b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
lea    -0x4b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
lea    -0x5b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1060 <memset@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1293 <get_auth_data_fn+0x123>
lea    -0x2b0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1293 <get_auth_data_fn+0x123>
movsbl -0x3b0(%rbp),%eax
cmp    $0x0,%eax
je     1293 <get_auth_data_fn+0x123>
movsbl -0x4b0(%rbp),%eax
cmp    $0x0,%eax
je     1293 <get_auth_data_fn+0x123>
mov    -0x18(%rbp),%rdi
lea    -0x3b0(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1040 <strncpy@plt>
mov    -0x28(%rbp),%rdi
lea    -0x4b0(%rbp),%rsi
mov    -0x2c(%rbp),%edx
sub    $0x1,%edx
call   1040 <strncpy@plt>
mov    0x10(%rbp),%rdi
lea    -0x5b0(%rbp),%rsi
mov    0x18(%rbp),%edx
sub    $0x1,%edx
call   1040 <strncpy@plt>
jmp    14cc <get_auth_data_fn+0x35c>
cmpl   $0x0,0x2dbe(%rip)
je     12c5 <get_auth_data_fn+0x155>
lea    0xd59(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     12c5 <get_auth_data_fn+0x155>
movl   $0x0,0x2d98(%rip)
jmp    14cc <get_auth_data_fn+0x35c>
mov    0x2d0c(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd32(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0xb0(%rbp),%rdi
mov    0x2cfa(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1070 <fgets@plt>
lea    -0xb0(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0xb0(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    1335 <get_auth_data_fn+0x1c5>
lea    -0xb0(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xb0(%rbp,%rax,1)
movsbl -0xb0(%rbp),%eax
cmp    $0x0,%eax
je     135b <get_auth_data_fn+0x1eb>
mov    -0x18(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0x1c(%rbp),%edx
sub    $0x1,%edx
call   1040 <strncpy@plt>
mov    0x2c76(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rdx
lea    0xcad(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0xb0(%rbp),%rdi
mov    0x2c64(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1070 <fgets@plt>
lea    -0xb0(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0xb0(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    13cb <get_auth_data_fn+0x25b>
lea    -0xb0(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xb0(%rbp,%rax,1)
movsbl -0xb0(%rbp),%eax
cmp    $0x0,%eax
je     13f1 <get_auth_data_fn+0x281>
mov    -0x28(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0x2c(%rbp),%edx
sub    $0x1,%edx
call   1040 <strncpy@plt>
mov    0x2be0(%rip),%rax
mov    (%rax),%edi
lea    0xc2b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
lea    -0xb0(%rbp),%rdi
mov    0x2bd2(%rip),%rax
mov    (%rax),%edx
mov    $0x80,%esi
call   1070 <fgets@plt>
lea    -0xb0(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movsbl -0xb0(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    145d <get_auth_data_fn+0x2ed>
lea    -0xb0(%rbp),%rdi
call   1050 <strlen@plt>
sub    $0x1,%eax
cltq
movb   $0x0,-0xb0(%rbp,%rax,1)
movsbl -0xb0(%rbp),%eax
cmp    $0x0,%eax
je     1483 <get_auth_data_fn+0x313>
mov    0x10(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    0x18(%rbp),%edx
sub    $0x1,%edx
call   1040 <strncpy@plt>
lea    -0x3b0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
lea    -0x4b0(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
lea    -0x5b0(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
movl   $0x1,0x2b8c(%rip)
add    $0x5b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_auth_data_fn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x598,%rsp
mov    %r9d,%r12d
mov    %r8,0x8(%rsp)
mov    %ecx,%ebx
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rsi
xorps  %xmm0,%xmm0
movaps %xmm0,0x500(%rsp)
movaps %xmm0,0x4f0(%rsp)
movaps %xmm0,0x4e0(%rsp)
movaps %xmm0,0x4d0(%rsp)
movaps %xmm0,0x4c0(%rsp)
movaps %xmm0,0x4b0(%rsp)
movaps %xmm0,0x4a0(%rsp)
movaps %xmm0,0x490(%rsp)
movaps %xmm0,0x480(%rsp)
movaps %xmm0,0x470(%rsp)
movaps %xmm0,0x460(%rsp)
movaps %xmm0,0x450(%rsp)
movaps %xmm0,0x440(%rsp)
movaps %xmm0,0x430(%rsp)
movaps %xmm0,0x420(%rsp)
movaps %xmm0,0x410(%rsp)
movaps %xmm0,0x400(%rsp)
movaps %xmm0,0x3f0(%rsp)
movaps %xmm0,0x3e0(%rsp)
movaps %xmm0,0x3d0(%rsp)
movaps %xmm0,0x3c0(%rsp)
movaps %xmm0,0x3b0(%rsp)
movaps %xmm0,0x3a0(%rsp)
movaps %xmm0,0x390(%rsp)
movaps %xmm0,0x380(%rsp)
movaps %xmm0,0x370(%rsp)
movaps %xmm0,0x360(%rsp)
movaps %xmm0,0x350(%rsp)
movaps %xmm0,0x340(%rsp)
movaps %xmm0,0x330(%rsp)
movaps %xmm0,0x320(%rsp)
movaps %xmm0,0x310(%rsp)
movaps %xmm0,0x300(%rsp)
movaps %xmm0,0x2f0(%rsp)
movaps %xmm0,0x2e0(%rsp)
movaps %xmm0,0x2d0(%rsp)
movaps %xmm0,0x2c0(%rsp)
movaps %xmm0,0x2b0(%rsp)
movaps %xmm0,0x2a0(%rsp)
movaps %xmm0,0x290(%rsp)
movaps %xmm0,0x280(%rsp)
movaps %xmm0,0x270(%rsp)
movaps %xmm0,0x260(%rsp)
movaps %xmm0,0x250(%rsp)
movaps %xmm0,0x240(%rsp)
movaps %xmm0,0x230(%rsp)
movaps %xmm0,0x220(%rsp)
movaps %xmm0,0x210(%rsp)
movaps %xmm0,0x200(%rsp)
movaps %xmm0,0x1f0(%rsp)
movaps %xmm0,0x1e0(%rsp)
movaps %xmm0,0x1d0(%rsp)
movaps %xmm0,0x1c0(%rsp)
movaps %xmm0,0x1b0(%rsp)
movaps %xmm0,0x1a0(%rsp)
movaps %xmm0,0x190(%rsp)
movaps %xmm0,0x180(%rsp)
movaps %xmm0,0x170(%rsp)
movaps %xmm0,0x160(%rsp)
movaps %xmm0,0x150(%rsp)
movaps %xmm0,0x140(%rsp)
movaps %xmm0,0x130(%rsp)
movaps %xmm0,0x120(%rsp)
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
lea    0x410(%rsp),%rdi
call   1070 <strcmp@plt>
test   %rax,%rax
je     140f <get_auth_data_fn+0x2af>
cmpb   $0x0,0x2c49(%rip)
je     1428 <get_auth_data_fn+0x2c8>
jmp    143f <get_auth_data_fn+0x2df>
lea    0x310(%rsp),%rdi
mov    %rbp,%rsi
call   1070 <strcmp@plt>
cmpb   $0x0,0x2c2e(%rip)
jne    143f <get_auth_data_fn+0x2df>
lea    0xbd1(%rip),%rdi
call   1030 <getenv@plt>
mov    $0x1,%cl
test   %rax,%rax
jne    15d1 <get_auth_data_fn+0x471>
mov    0x2b92(%rip),%r13
mov    0x0(%r13),%edi
lea    0xbba(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    0x2b86(%rip),%r14
mov    (%r14),%edx
lea    0x510(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x80,%esi
call   1060 <fgets@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbp,1)
jne    149a <get_auth_data_fn+0x33a>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
cmpb   $0x0,0x510(%rsp)
je     14b9 <get_auth_data_fn+0x359>
add    $0xffffffff,%ebx
lea    0x510(%rsp),%rsi
mov    %r15,%rdi
mov    %ebx,%edx
call   1040 <strncpy@plt>
mov    0x0(%r13),%edi
lea    0xb58(%rip),%rsi
mov    0x8(%rsp),%rdx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0x80,%esi
call   1060 <fgets@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbp,1)
jne    1500 <get_auth_data_fn+0x3a0>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
cmpb   $0x0,0x510(%rsp)
je     1523 <get_auth_data_fn+0x3c3>
add    $0xffffffff,%r12d
lea    0x510(%rsp),%rsi
mov    0x8(%rsp),%rdi
mov    %r12d,%edx
call   1040 <strncpy@plt>
mov    0x0(%r13),%edi
lea    0xafe(%rip),%rsi
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    (%r14),%edx
mov    %rbp,%rdi
mov    $0x80,%esi
call   1060 <fgets@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
cmpb   $0xa,-0x1(%rax,%rbp,1)
jne    1565 <get_auth_data_fn+0x405>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbp,1)
mov    0x5d0(%rsp),%rbx
cmpb   $0x0,0x510(%rsp)
je     1591 <get_auth_data_fn+0x431>
mov    0x5d8(%rsp),%edx
add    $0xffffffff,%edx
lea    0x510(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <strncpy@plt>
lea    0x210(%rsp),%rdi
mov    %r15,%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
lea    0x110(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
lea    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    $0xff,%edx
call   1040 <strncpy@plt>
xor    %ecx,%ecx
mov    %cl,0x2a7d(%rip)
add    $0x598,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@get_auth_data_fn.krb5_set = internal global i32 1
@.str = [11 x i8] c"KRB5CCNAME\00"
@stdout = global i32 0
@.str.1 = [17 x i8] c"Workgroup: [%s] \00"
@stdin = global i32 0
@.str.2 = [16 x i8] c"Username: [%s] \00"
@.str.3 = [11 x i8] c"Password: \00"
define void @get_auth_data_fn(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i32 %5, i8* %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
%17 = alloca [128 x i8]
%18 = alloca [256 x i8]
%19 = alloca [256 x i8]
%20 = alloca [256 x i8]
%21 = alloca [256 x i8]
%22 = alloca [256 x i8]
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i32 %3, i32* %12
store i8* %4, i8** %13
store i32 %5, i32* %14
store i8* %6, i8** %15
store i32 %7, i32* %16
%23 = bitcast [256 x i8]* %18 to i8*
%24 = bitcast [256 x i8]* %19 to i8*
%25 = bitcast [256 x i8]* %20 to i8*
%26 = bitcast [256 x i8]* %21 to i8*
%27 = bitcast [256 x i8]* %22 to i8*
%28 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%29 = load i8*, i8** %9
%30 = call i64 @strcmp(i8* %28, i8* %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %63
32: ; preds = %8
%33 = getelementptr inbounds [256 x i8], [256 x i8]* %19, i64 0, i64 0
%34 = load i8*, i8** %10
%35 = call i64 @strcmp(i8* %33, i8* %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %63
37: ; preds = %32
%38 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %63
42: ; preds = %37
%43 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%44 = load i8, i8* %43
%45 = sext i8 %44 to i32
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %63
47: ; preds = %42
%48 = load i8*, i8** %11
%49 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%50 = load i32, i32* %12
%51 = sub nsw i32 %50, 1
%52 = call i32 @strncpy(i8* %48, i8* %49, i32 %51)
%53 = load i8*, i8** %13
%54 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%55 = load i32, i32* %14
%56 = sub nsw i32 %55, 1
%57 = call i32 @strncpy(i8* %53, i8* %54, i32 %56)
%58 = load i8*, i8** %15
%59 = getelementptr inbounds [256 x i8], [256 x i8]* %22, i64 0, i64 0
%60 = load i32, i32* %16
%61 = sub nsw i32 %60, 1
%62 = call i32 @strncpy(i8* %58, i8* %59, i32 %61)
br label %175
63: ; preds = %42, %37, %32, %8
%64 = load i32, i32* @get_auth_data_fn.krb5_set
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %70
66: ; preds = %63
%67 = call i64 @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%68 = icmp ne i64 %67, 0
br i1 %68, label %69, label %70
69: ; preds = %66
store i32 0, i32* @get_auth_data_fn.krb5_set
br label %175
70: ; preds = %66, %63
%71 = load i32, i32* @stdout
%72 = load i8*, i8** %11
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %71, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %72)
%74 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%75 = load i32, i32* @stdin
%76 = call i32 @fgets(i8* %74, i32 128, i32 %75)
%77 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%78 = call i32 @strlen(i8* %77)
%79 = sub nsw i32 %78, 1
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 %80
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = icmp eq i32 %83, 10
br i1 %84, label %85, label %91
85: ; preds = %70
%86 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%87 = call i32 @strlen(i8* %86)
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 %89
store i8 0, i8* %90
br label %91
91: ; preds = %85, %70
%92 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp ne i32 %94, 0
br i1 %95, label %96, label %102
96: ; preds = %91
%97 = load i8*, i8** %11
%98 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%99 = load i32, i32* %12
%100 = sub nsw i32 %99, 1
%101 = call i32 @strncpy(i8* %97, i8* %98, i32 %100)
br label %102
102: ; preds = %96, %91
%103 = load i32, i32* @stdout
%104 = load i8*, i8** %13
%105 = call i32 (i32, i8*, ...) @fprintf(i32 %103, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %104)
%106 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%107 = load i32, i32* @stdin
%108 = call i32 @fgets(i8* %106, i32 128, i32 %107)
%109 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%110 = call i32 @strlen(i8* %109)
%111 = sub nsw i32 %110, 1
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 10
br i1 %116, label %117, label %123
117: ; preds = %102
%118 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%119 = call i32 @strlen(i8* %118)
%120 = sub nsw i32 %119, 1
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 %121
store i8 0, i8* %122
br label %123
123: ; preds = %117, %102
%124 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%125 = load i8, i8* %124
%126 = sext i8 %125 to i32
%127 = icmp ne i32 %126, 0
br i1 %127, label %128, label %134
128: ; preds = %123
%129 = load i8*, i8** %13
%130 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%131 = load i32, i32* %14
%132 = sub nsw i32 %131, 1
%133 = call i32 @strncpy(i8* %129, i8* %130, i32 %132)
br label %134
134: ; preds = %128, %123
%135 = load i32, i32* @stdout
%136 = call i32 (i32, i8*, ...) @fprintf(i32 %135, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%137 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%138 = load i32, i32* @stdin
%139 = call i32 @fgets(i8* %137, i32 128, i32 %138)
%140 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%141 = call i32 @strlen(i8* %140)
%142 = sub nsw i32 %141, 1
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 %143
%145 = load i8, i8* %144
%146 = sext i8 %145 to i32
%147 = icmp eq i32 %146, 10
br i1 %147, label %148, label %154
148: ; preds = %134
%149 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%150 = call i32 @strlen(i8* %149)
%151 = sub nsw i32 %150, 1
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 %152
store i8 0, i8* %153
br label %154
154: ; preds = %148, %134
%155 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp ne i32 %157, 0
br i1 %158, label %159, label %165
159: ; preds = %154
%160 = load i8*, i8** %15
%161 = getelementptr inbounds [128 x i8], [128 x i8]* %17, i64 0, i64 0
%162 = load i32, i32* %16
%163 = sub nsw i32 %162, 1
%164 = call i32 @strncpy(i8* %160, i8* %161, i32 %163)
br label %165
165: ; preds = %159, %154
%166 = getelementptr inbounds [256 x i8], [256 x i8]* %20, i64 0, i64 0
%167 = load i8*, i8** %11
%168 = call i32 @strncpy(i8* %166, i8* %167, i32 255)
%169 = getelementptr inbounds [256 x i8], [256 x i8]* %21, i64 0, i64 0
%170 = load i8*, i8** %13
%171 = call i32 @strncpy(i8* %169, i8* %170, i32 255)
%172 = getelementptr inbounds [256 x i8], [256 x i8]* %22, i64 0, i64 0
%173 = load i8*, i8** %15
%174 = call i32 @strncpy(i8* %172, i8* %173, i32 255)
store i32 1, i32* @get_auth_data_fn.krb5_set
br label %175
175: ; preds = %165, %69, %47
ret void
}

LLVM IR (-O2):
@get_auth_data_fn.krb5_set = internal unnamed_addr global i1 false
@.str = [11 x i8] c"KRB5CCNAME\00"
@stdout = global i32 0
@.str.1 = [17 x i8] c"Workgroup: [%s] \00"
@stdin = global i32 0
@.str.2 = [16 x i8] c"Username: [%s] \00"
@.str.3 = [11 x i8] c"Password: \00"
define void @get_auth_data_fn(i8* %0, i8* %1, i8* %2, i32 %3, i8* %4, i32 %5, i8* %6, i32 %7) {
%9 = alloca [128 x i8]
%10 = alloca [256 x i8]
%11 = alloca [256 x i8]
%12 = alloca [256 x i8]
%13 = alloca [256 x i8]
%14 = alloca [256 x i8]
%15 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 0
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %10, i64 0, i64 0
%17 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %12, i64 0, i64 0
%19 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%20 = getelementptr inbounds [256 x i8], [256 x i8]* %14, i64 0, i64 0
%21 = call i64 @strcmp(i8* %16, i8* %0)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %8
%24 = call i64 @strcmp(i8* %17, i8* %1)
br label %25
25: ; preds = %23, %8
%26 = load i1, i1* @get_auth_data_fn.krb5_set
br i1 %26, label %30, label %27
27: ; preds = %25
%28 = call i64 @getenv(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %100
30: ; preds = %27, %25
%31 = load i32, i32* @stdout
%32 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%33 = load i32, i32* @stdin
%34 = call i32 @fgets(i8* %15, i32 128, i32 %33)
%35 = call i32 @strlen(i8* %15)
%36 = add nsw i32 %35, -1
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 10
br i1 %40, label %41, label %46
41: ; preds = %30
%42 = call i32 @strlen(i8* %15)
%43 = add nsw i32 %42, -1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %44
store i8 0, i8* %45
br label %46
46: ; preds = %41, %30
%47 = load i8, i8* %15
%48 = icmp eq i8 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = add nsw i32 %3, -1
%51 = call i32 @strncpy(i8* %2, i8* %15, i32 %50)
br label %52
52: ; preds = %49, %46
%53 = load i32, i32* @stdout
%54 = call i32 (i32, i8*, ...) @fprintf(i32 %53, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%55 = load i32, i32* @stdin
%56 = call i32 @fgets(i8* %15, i32 128, i32 %55)
%57 = call i32 @strlen(i8* %15)
%58 = add nsw i32 %57, -1
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = icmp eq i8 %61, 10
br i1 %62, label %63, label %68
63: ; preds = %52
%64 = call i32 @strlen(i8* %15)
%65 = add nsw i32 %64, -1
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %66
store i8 0, i8* %67
br label %68
68: ; preds = %63, %52
%69 = load i8, i8* %15
%70 = icmp eq i8 %69, 0
br i1 %70, label %74, label %71
71: ; preds = %68
%72 = add nsw i32 %5, -1
%73 = call i32 @strncpy(i8* %4, i8* %15, i32 %72)
br label %74
74: ; preds = %71, %68
%75 = load i32, i32* @stdout
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%77 = load i32, i32* @stdin
%78 = call i32 @fgets(i8* %15, i32 128, i32 %77)
%79 = call i32 @strlen(i8* %15)
%80 = add nsw i32 %79, -1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %81
%83 = load i8, i8* %82
%84 = icmp eq i8 %83, 10
br i1 %84, label %85, label %90
85: ; preds = %74
%86 = call i32 @strlen(i8* %15)
%87 = add nsw i32 %86, -1
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [128 x i8], [128 x i8]* %9, i64 0, i64 %88
store i8 0, i8* %89
br label %90
90: ; preds = %85, %74
%91 = load i8, i8* %15
%92 = icmp eq i8 %91, 0
br i1 %92, label %96, label %93
93: ; preds = %90
%94 = add nsw i32 %7, -1
%95 = call i32 @strncpy(i8* %6, i8* %15, i32 %94)
br label %96
96: ; preds = %93, %90
%97 = call i32 @strncpy(i8* %18, i8* %2, i32 255)
%98 = call i32 @strncpy(i8* %19, i8* %4, i32 255)
%99 = call i32 @strncpy(i8* %20, i8* %6, i32 255)
br label %100
100: ; preds = %27, %96
%101 = phi i1 [ false, %96 ], [ true, %27 ]
store i1 %101, i1* @get_auth_data_fn.krb5_set
ret void
}