#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char **);
int twofactor(char *, char *, char *, char *, char *);
void main() {
  char dname[30];
  char so[5];
  char app[20];
  char username[10];
  char prn[10];
  printf(
      "twofactortest 1.0\n\nEnter server, port, appid, username, and prn\n\n");
  scanf("%s", &dname);
  scanf("%s", &so);
  scanf("%s", &app);
  scanf("%s", &username);
  scanf("%s", &prn);
  printf("Return code is %i\n\n", twofactor(dname, so, app, username, prn));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xef1(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x25(%rbp),%rsi
lea    0xee1(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x40(%rbp),%rsi
lea    0xed1(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x4a(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x54(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rdi
lea    -0x25(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x4a(%rbp),%rcx
lea    -0x54(%rbp),%r8
call   1040 <twofactor@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%rbx
lea    0x40(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0x7(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
lea    0x20(%rsp),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
lea    0x16(%rsp),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <scanf@plt>
lea    0xc(%rsp),%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
call   1050 <twofactor@plt>
lea    0xe37(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [66 x i8] c"twofactortest 1.0\0A\0AEnter server, port, appid, username, and prn\0A\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"Return code is %i\0A\0A\00"
define void @main() {
%1 = alloca [30 x i8]
%2 = alloca [5 x i8]
%3 = alloca [20 x i8]
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0))
%7 = bitcast [30 x i8]* %1 to i8**
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %7)
%9 = bitcast [5 x i8]* %2 to i8**
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %9)
%11 = bitcast [20 x i8]* %3 to i8**
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %11)
%13 = bitcast [10 x i8]* %4 to i8**
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %13)
%15 = bitcast [10 x i8]* %5 to i8**
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %15)
%17 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%19 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%22 = call i32 @twofactor(i8* %17, i8* %18, i8* %19, i8* %20, i8* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %22)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"Return code is %i\0A\0A\00"
@str = [65 x i8] c"twofactortest 1.0\0A\0AEnter server, port, appid, username, and prn\0A\00"
define void @main() {
%1 = alloca [30 x i8]
%2 = alloca [5 x i8]
%3 = alloca [20 x i8]
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @str, i64 0, i64 0))
%12 = bitcast [30 x i8]* %1 to i8**
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %12)
%14 = bitcast [5 x i8]* %2 to i8**
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %14)
%16 = bitcast [20 x i8]* %3 to i8**
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %16)
%18 = bitcast [10 x i8]* %4 to i8**
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %18)
%20 = bitcast [10 x i8]* %5 to i8**
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %20)
%22 = call i32 @twofactor(i8* %6, i8* %7, i8* %8, i8* %9, i8* %10)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %22)
ret void
}