#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*/ authenticate(int, char *, char *);
int /*<<< orphan*/ connect2server(int *, char *, char *);
int /*<<< orphan*/ hello(int, char *);
int /*<<< orphan*/ print_help();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ send_email(int, char *, char *, char *, char *);
int main(int argc, char *argv[]) {
  char *smtp_host = NULL;
  char smtp_port[32] = {'\0'};
  int socket = -1;
  int step;
  char smtpHost[50], user[50], pass[50], sendto[50], sub[120], body[160];
  char *username = "aurimas.smtp@inbox.lt";
  char *password = "aurimas1";
  char *address = "kaimisx@gmail.com";
  char *subject = "SMTP Client Demo";
  char *content =
      "This is content messaage.\n Now test Lithuanian keybord - ąčęėįšųū!";
  print_help();
  do {
    printf("-- Selection: ");
    scanf("%d", &step);
    switch (step) {
    case 1:
      printf("SMTP server address: ");
      scanf("%s", &smtpHost);
      if (smtpHost) {
        smtp_host = smtpHost;
      } else {
        printf("Empty server address!\n");
      }
      printf("----\n");
      break;
    case 2:
      printf("SMTP server port: ");
      scanf("%d", &smtp_port);
      if (!smtp_port) {
        printf("Empty port. Default port 25!\n");
      }
      printf("----\n");
      break;
    case 3:
      printf("Username: ");
      scanf("%s", &user);
      if (user) {
        username = user;
      } else {
        printf("Please insert username!\n");
      }
      printf("----\n");
      break;
    case 4:
      printf("Password: ");
      scanf("%s", &pass);
      if (pass) {
        password = pass;
      } else {
        printf("Please insert password!\n");
      }
      printf("----\n");
      break;
    case 5:
      printf("Send to: ");
      scanf("%s", &sendto);
      if (sendto) {
        address = sendto;
      } else {
        printf("Please insert email!\n");
      }
      printf("----\n");
      break;
    case 6:
      printf("Subject: ");
      scanf("%s", &sub);
      if (sub) {
        subject = sub;
      } else {
        printf("Please insert subject!\n");
      }
      printf("----\n");
      break;
    case 7:
      printf("Content: ");
      scanf("%s", &body);
      if (body) {
        content = body;
      } else {
        printf("Please insert content!\n");
      }
      printf("----\n");
      break;
    case 8:
      connect2server(&socket, smtp_host, smtp_port);
      hello(socket, "Aurimas-HP-Ubuntu");
      authenticate(socket, username, password);
      send_email(socket, username, address, subject, content);
      printf("----\n");
      break;
    case 9:
      return 1;
      break;
    default:
      printf("Please make selection!\n");
    }
  } while (step != 9);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x290,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
movl   $0xffffffff,-0x44(%rbp)
lea    0xe65(%rip),%rax
mov    %rax,-0x268(%rbp)
lea    0xe6d(%rip),%rax
mov    %rax,-0x270(%rbp)
lea    0xe68(%rip),%rax
mov    %rax,-0x278(%rbp)
lea    0xe6c(%rip),%rax
mov    %rax,-0x280(%rbp)
lea    0xe6f(%rip),%rax
mov    %rax,-0x288(%rbp)
mov    $0x0,%al
call   10a0 <print_help@plt>
lea    0xea5(%rip),%rdi
call   1050 <printf@plt>
lea    0xea8(%rip),%rdi
xor    %eax,%eax
lea    -0x48(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0x48(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x290(%rbp)
sub    $0x8,%eax
ja     1538 <main+0x3b8>
mov    -0x290(%rbp),%rax
lea    0xdb7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe6a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe74(%rip),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    -0x80(%rbp),%rax
cmp    $0x0,%rax
je     128b <main+0x10b>
lea    -0x80(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1297 <main+0x117>
lea    0xe4a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe55(%rip),%rdi
call   1050 <printf@plt>
jmp    1544 <main+0x3c4>
lea    0xe4a(%rip),%rdi
call   1050 <printf@plt>
lea    0xe05(%rip),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    0xe26(%rip),%rdi
call   1050 <printf@plt>
jmp    1544 <main+0x3c4>
lea    0xe2e(%rip),%rdi
call   1050 <printf@plt>
lea    0xdef(%rip),%rdi
lea    -0xc0(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    -0xc0(%rbp),%rax
cmp    $0x0,%rax
je     131c <main+0x19c>
lea    -0xc0(%rbp),%rax
mov    %rax,-0x268(%rbp)
jmp    1328 <main+0x1a8>
lea    0xdf4(%rip),%rdi
call   1050 <printf@plt>
lea    0xdc4(%rip),%rdi
call   1050 <printf@plt>
jmp    1544 <main+0x3c4>
lea    0xdf0(%rip),%rdi
call   1050 <printf@plt>
lea    0xd8d(%rip),%rdi
lea    -0x100(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    -0x100(%rbp),%rax
cmp    $0x0,%rax
je     137e <main+0x1fe>
lea    -0x100(%rbp),%rax
mov    %rax,-0x270(%rbp)
jmp    138a <main+0x20a>
lea    0xdb6(%rip),%rdi
call   1050 <printf@plt>
lea    0xd62(%rip),%rdi
call   1050 <printf@plt>
jmp    1544 <main+0x3c4>
lea    0xdb2(%rip),%rdi
call   1050 <printf@plt>
lea    0xd2b(%rip),%rdi
lea    -0x140(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    -0x140(%rbp),%rax
cmp    $0x0,%rax
je     13e0 <main+0x260>
lea    -0x140(%rbp),%rax
mov    %rax,-0x278(%rbp)
jmp    13ec <main+0x26c>
lea    0xd77(%rip),%rdi
call   1050 <printf@plt>
lea    0xd00(%rip),%rdi
call   1050 <printf@plt>
jmp    1544 <main+0x3c4>
lea    0xd70(%rip),%rdi
call   1050 <printf@plt>
lea    0xcc9(%rip),%rdi
lea    -0x1c0(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    -0x1c0(%rbp),%rax
cmp    $0x0,%rax
je     1442 <main+0x2c2>
lea    -0x1c0(%rbp),%rax
mov    %rax,-0x280(%rbp)
jmp    144e <main+0x2ce>
lea    0xd35(%rip),%rdi
call   1050 <printf@plt>
lea    0xc9e(%rip),%rdi
call   1050 <printf@plt>
jmp    1544 <main+0x3c4>
lea    0xd30(%rip),%rdi
call   1050 <printf@plt>
lea    0xc67(%rip),%rdi
lea    -0x260(%rbp),%rsi
mov    $0x0,%al
call   1090 <scanf@plt>
lea    -0x260(%rbp),%rax
cmp    $0x0,%rax
je     14a4 <main+0x324>
lea    -0x260(%rbp),%rax
mov    %rax,-0x288(%rbp)
jmp    14b0 <main+0x330>
lea    0xcf5(%rip),%rdi
call   1050 <printf@plt>
lea    0xc3c(%rip),%rdi
call   1050 <printf@plt>
jmp    1544 <main+0x3c4>
mov    -0x18(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x44(%rbp),%rdi
call   1040 <connect2server@plt>
mov    -0x44(%rbp),%edi
lea    0xcdc(%rip),%rsi
call   1070 <hello@plt>
mov    -0x44(%rbp),%edi
mov    -0x268(%rbp),%rsi
mov    -0x270(%rbp),%rdx
call   1030 <authenticate@plt>
mov    -0x44(%rbp),%edi
mov    -0x268(%rbp),%rsi
mov    -0x278(%rbp),%rdx
mov    -0x280(%rbp),%rcx
mov    -0x288(%rbp),%r8
call   1080 <send_email@plt>
lea    0xbd1(%rip),%rdi
call   1050 <printf@plt>
jmp    1544 <main+0x3c4>
movl   $0x1,-0x4(%rbp)
jmp    155a <main+0x3da>
lea    0xc8b(%rip),%rdi
call   1050 <printf@plt>
jmp    1549 <main+0x3c9>
cmpl   $0x9,-0x48(%rbp)
jne    1205 <main+0x85>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x290,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x278,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movl   $0xffffffff,(%rsp)
xor    %eax,%eax
call   10a0 <print_help@plt>
lea    0xeb3(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xe96(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xe78(%rip),%rax
mov    %rax,0x20(%rsp)
lea    0xe63(%rip),%rax
mov    %rax,0x28(%rsp)
lea    0xe41(%rip),%rbp
lea    0xec7(%rip),%r12
lea    0xecf(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xe03(%rip),%r13
xor    %eax,%eax
mov    %rax,0x8(%rsp)
jmp    1268 <main+0xe8>
mov    %rsp,%rdi
mov    0x8(%rsp),%rsi
lea    0x30(%rsp),%rdx
call   1040 <connect2server@plt>
mov    (%rsp),%edi
lea    0xf01(%rip),%rsi
call   1070 <hello@plt>
mov    (%rsp),%edi
mov    %rbp,%rsi
mov    0x28(%rsp),%rdx
call   1030 <authenticate@plt>
mov    (%rsp),%edi
mov    %rbp,%rsi
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rcx
mov    0x10(%rsp),%r8
call   1080 <send_email@plt>
lea    0xedd(%rip),%rdi
call   1050 <puts@plt>
cmpl   $0x9,0x4(%rsp)
je     140e <main+0x28e>
mov    %r12,%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x4(%rsp),%ecx
add    $0xffffffff,%ecx
cmp    $0x8,%ecx
ja     12e7 <main+0x167>
mov    $0x1,%eax
movslq 0x0(%r13,%rcx,4),%rcx
add    %r13,%rcx
jmp    *%rcx
lea    0xe24(%rip),%rdi
call   1060 <printf@plt>
lea    0xe2e(%rip),%rdi
mov    %r14,%r13
mov    %r15,%r14
mov    %r12,%r15
lea    0x110(%rsp),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xe68(%rip),%rdi
mov    %r12,0x8(%rsp)
mov    %r15,%r12
mov    %r14,%r15
mov    %r13,%r14
lea    0xd1e(%rip),%r13
jmp    1258 <main+0xd8>
lea    0xe4c(%rip),%rdi
jmp    1258 <main+0xd8>
lea    0xde2(%rip),%rdi
call   1060 <printf@plt>
mov    %r14,%rdi
lea    0x30(%rsp),%rsi
jmp    1327 <main+0x1a7>
lea    0xddf(%rip),%rdi
call   1060 <printf@plt>
lea    0xdbd(%rip),%rdi
lea    0xd0(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
jmp    1251 <main+0xd1>
lea    0xdc0(%rip),%rdi
call   1060 <printf@plt>
lea    0xd93(%rip),%rdi
mov    %rbp,%rbx
lea    0x90(%rsp),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xdd3(%rip),%rdi
mov    %rbp,0x28(%rsp)
mov    %rbx,%rbp
jmp    1258 <main+0xd8>
lea    0xd8f(%rip),%rdi
call   1060 <printf@plt>
lea    0xd57(%rip),%rdi
lea    0x50(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xd9d(%rip),%rdi
mov    %rbx,0x20(%rsp)
jmp    1258 <main+0xd8>
lea    0xd66(%rip),%rdi
call   1060 <printf@plt>
lea    0xd24(%rip),%rdi
lea    0x150(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xd67(%rip),%rdi
mov    %rbx,0x18(%rsp)
jmp    1258 <main+0xd8>
lea    0xd3a(%rip),%rdi
call   1060 <printf@plt>
lea    0xcee(%rip),%rdi
lea    0x1d0(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xd31(%rip),%rdi
mov    %rbx,0x10(%rsp)
jmp    1258 <main+0xd8>
xor    %eax,%eax
add    $0x278,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"aurimas.smtp@inbox.lt\00"
@.str.1 = [9 x i8] c"aurimas1\00"
@.str.2 = [18 x i8] c"kaimisx@gmail.com\00"
@.str.3 = [17 x i8] c"SMTP Client Demo\00"
@.str.4 = [75 x i8] c"This is content messaage.\0A Now test Lithuanian keybord - \C4\85\C4\8D\C4\99\C4\97\C4\AF\C5\A1\C5\B3\C5\AB!\00"
@.str.5 = [15 x i8] c"-- Selection: \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [22 x i8] c"SMTP server address: \00"
@.str.8 = [3 x i8] c"%s\00"
@.str.9 = [23 x i8] c"Empty server address!\0A\00"
@.str.10 = [6 x i8] c"----\0A\00"
@.str.11 = [19 x i8] c"SMTP server port: \00"
@.str.12 = [11 x i8] c"Username: \00"
@.str.13 = [25 x i8] c"Please insert username!\0A\00"
@.str.14 = [11 x i8] c"Password: \00"
@.str.15 = [25 x i8] c"Please insert password!\0A\00"
@.str.16 = [10 x i8] c"Send to: \00"
@.str.17 = [22 x i8] c"Please insert email!\0A\00"
@.str.18 = [10 x i8] c"Subject: \00"
@.str.19 = [24 x i8] c"Please insert subject!\0A\00"
@.str.20 = [10 x i8] c"Content: \00"
@.str.21 = [24 x i8] c"Please insert content!\0A\00"
@.str.22 = [18 x i8] c"Aurimas-HP-Ubuntu\00"
@.str.23 = [24 x i8] c"Please make selection!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [32 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca [50 x i8]
%11 = alloca [50 x i8]
%12 = alloca [50 x i8]
%13 = alloca [50 x i8]
%14 = alloca [120 x i8]
%15 = alloca [160 x i8]
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%21 = bitcast [32 x i8]* %7 to i8*
store i32 -1, i32* %8
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8** %16
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %17
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %18
store i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i8** %19
store i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.4, i64 0, i64 0), i8** %20
%22 = call i32 (...) @print_help()
br label %23
23: ; preds = %118, %2
%24 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %9)
%26 = load i32, i32* %9
switch i32 %26, label %115 [
i32 1, label %27
i32 2, label %38
i32 3, label %42
i32 4, label %53
i32 5, label %64
i32 6, label %75
i32 7, label %86
i32 8, label %97
i32 9, label %114
]
27: ; preds = %23
%28 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [50 x i8]* %10)
%30 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
%31 = icmp ne i8* %30, null
br i1 %31, label %32, label %34
32: ; preds = %27
%33 = getelementptr inbounds [50 x i8], [50 x i8]* %10, i64 0, i64 0
store i8* %33, i8** %6
br label %36
34: ; preds = %27
%35 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
br label %36
36: ; preds = %34, %32
%37 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %117
38: ; preds = %23
%39 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), [32 x i8]* %7)
%41 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %117
42: ; preds = %23
%43 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
%44 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [50 x i8]* %11)
%45 = getelementptr inbounds [50 x i8], [50 x i8]* %11, i64 0, i64 0
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %49
47: ; preds = %42
%48 = getelementptr inbounds [50 x i8], [50 x i8]* %11, i64 0, i64 0
store i8* %48, i8** %16
br label %51
49: ; preds = %42
%50 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
br label %51
51: ; preds = %49, %47
%52 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %117
53: ; preds = %23
%54 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
%55 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [50 x i8]* %12)
%56 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
%57 = icmp ne i8* %56, null
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = getelementptr inbounds [50 x i8], [50 x i8]* %12, i64 0, i64 0
store i8* %59, i8** %17
br label %62
60: ; preds = %53
%61 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.15, i64 0, i64 0))
br label %62
62: ; preds = %60, %58
%63 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %117
64: ; preds = %23
%65 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
%66 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [50 x i8]* %13)
%67 = getelementptr inbounds [50 x i8], [50 x i8]* %13, i64 0, i64 0
%68 = icmp ne i8* %67, null
br i1 %68, label %69, label %71
69: ; preds = %64
%70 = getelementptr inbounds [50 x i8], [50 x i8]* %13, i64 0, i64 0
store i8* %70, i8** %18
br label %73
71: ; preds = %64
%72 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.17, i64 0, i64 0))
br label %73
73: ; preds = %71, %69
%74 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %117
75: ; preds = %23
%76 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
%77 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [120 x i8]* %14)
%78 = getelementptr inbounds [120 x i8], [120 x i8]* %14, i64 0, i64 0
%79 = icmp ne i8* %78, null
br i1 %79, label %80, label %82
80: ; preds = %75
%81 = getelementptr inbounds [120 x i8], [120 x i8]* %14, i64 0, i64 0
store i8* %81, i8** %19
br label %84
82: ; preds = %75
%83 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
br label %84
84: ; preds = %82, %80
%85 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %117
86: ; preds = %23
%87 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%88 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [160 x i8]* %15)
%89 = getelementptr inbounds [160 x i8], [160 x i8]* %15, i64 0, i64 0
%90 = icmp ne i8* %89, null
br i1 %90, label %91, label %93
91: ; preds = %86
%92 = getelementptr inbounds [160 x i8], [160 x i8]* %15, i64 0, i64 0
store i8* %92, i8** %20
br label %95
93: ; preds = %86
%94 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.21, i64 0, i64 0))
br label %95
95: ; preds = %93, %91
%96 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %117
97: ; preds = %23
%98 = load i8*, i8** %6
%99 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%100 = call i32 @connect2server(i32* %8, i8* %98, i8* %99)
%101 = load i32, i32* %8
%102 = call i32 @hello(i32 %101, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%103 = load i32, i32* %8
%104 = load i8*, i8** %16
%105 = load i8*, i8** %17
%106 = call i32 @authenticate(i32 %103, i8* %104, i8* %105)
%107 = load i32, i32* %8
%108 = load i8*, i8** %16
%109 = load i8*, i8** %18
%110 = load i8*, i8** %19
%111 = load i8*, i8** %20
%112 = call i32 @send_email(i32 %107, i8* %108, i8* %109, i8* %110, i8* %111)
%113 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
br label %117
114: ; preds = %23
store i32 1, i32* %3
br label %122
115: ; preds = %23
%116 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.23, i64 0, i64 0))
br label %117
117: ; preds = %115, %97, %95, %84, %73, %62, %51, %38, %36
br label %118
118: ; preds = %117
%119 = load i32, i32* %9
%120 = icmp ne i32 %119, 9
br i1 %120, label %23, label %121
121: ; preds = %118
store i32 0, i32* %3
br label %122
122: ; preds = %121, %114
%123 = load i32, i32* %3
ret i32 %123
}

LLVM IR (-O2):
@.str = [22 x i8] c"aurimas.smtp@inbox.lt\00"
@.str.1 = [9 x i8] c"aurimas1\00"
@.str.2 = [18 x i8] c"kaimisx@gmail.com\00"
@.str.3 = [17 x i8] c"SMTP Client Demo\00"
@.str.4 = [75 x i8] c"This is content messaage.\0A Now test Lithuanian keybord - \C4\85\C4\8D\C4\99\C4\97\C4\AF\C5\A1\C5\B3\C5\AB!\00"
@.str.5 = [15 x i8] c"-- Selection: \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.7 = [22 x i8] c"SMTP server address: \00"
@.str.8 = [3 x i8] c"%s\00"
@.str.11 = [19 x i8] c"SMTP server port: \00"
@.str.12 = [11 x i8] c"Username: \00"
@.str.14 = [11 x i8] c"Password: \00"
@.str.16 = [10 x i8] c"Send to: \00"
@.str.18 = [10 x i8] c"Subject: \00"
@.str.20 = [10 x i8] c"Content: \00"
@.str.22 = [18 x i8] c"Aurimas-HP-Ubuntu\00"
@str.30 = [5 x i8] c"----\00"
@str.31 = [23 x i8] c"Please make selection!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca [50 x i8]
%7 = alloca [50 x i8]
%8 = alloca [50 x i8]
%9 = alloca [50 x i8]
%10 = alloca [120 x i8]
%11 = alloca [160 x i8]
%12 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%13 = bitcast i32* %4 to i8*
store i32 -1, i32* %4
%14 = bitcast i32* %5 to i8*
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%19 = getelementptr inbounds [120 x i8], [120 x i8]* %10, i64 0, i64 0
%20 = getelementptr inbounds [160 x i8], [160 x i8]* %11, i64 0, i64 0
%21 = tail call i32 (...) @print_help()
br label %22
22: ; preds = %61, %2
%23 = phi i8* [ null, %2 ], [ %63, %61 ]
%24 = phi i8* [ getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), %2 ], [ %64, %61 ]
%25 = phi i8* [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %2 ], [ %65, %61 ]
%26 = phi i8* [ getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), %2 ], [ %66, %61 ]
%27 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), %2 ], [ %67, %61 ]
%28 = phi i8* [ getelementptr inbounds ([75 x i8], [75 x i8]* @.str.4, i64 0, i64 0), %2 ], [ %68, %61 ]
%29 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%31 = load i32, i32* %5
switch i32 %31, label %61 [
i32 1, label %32
i32 2, label %35
i32 3, label %38
i32 4, label %41
i32 5, label %44
i32 6, label %47
i32 7, label %50
i32 8, label %53
i32 9, label %72
]
32: ; preds = %22
%33 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [50 x i8]* %6)
br label %61
35: ; preds = %22
%36 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.11, i64 0, i64 0))
%37 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), [32 x i8]* %3)
br label %61
38: ; preds = %22
%39 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [50 x i8]* %7)
br label %61
41: ; preds = %22
%42 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [50 x i8]* %8)
br label %61
44: ; preds = %22
%45 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.16, i64 0, i64 0))
%46 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [50 x i8]* %9)
br label %61
47: ; preds = %22
%48 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [120 x i8]* %10)
br label %61
50: ; preds = %22
%51 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
%52 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), [160 x i8]* %11)
br label %61
53: ; preds = %22
%54 = call i32 @connect2server(i32* %4, i8* %23, i8* %12)
%55 = load i32, i32* %4
%56 = call i32 @hello(i32 %55, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.22, i64 0, i64 0))
%57 = load i32, i32* %4
%58 = call i32 @authenticate(i32 %57, i8* %24, i8* %25)
%59 = load i32, i32* %4
%60 = call i32 @send_email(i32 %59, i8* %24, i8* %26, i8* %27, i8* %28)
br label %61
61: ; preds = %22, %32, %35, %38, %41, %44, %47, %50, %53
%62 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %32 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %35 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %38 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %41 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %44 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %47 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %50 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.30, i64 0, i64 0), %53 ], [ getelementptr inbounds ([23 x i8], [23 x i8]* @str.31, i64 0, i64 0), %22 ]
%63 = phi i8* [ %15, %32 ], [ %23, %35 ], [ %23, %38 ], [ %23, %41 ], [ %23, %44 ], [ %23, %47 ], [ %23, %50 ], [ %23, %53 ], [ %23, %22 ]
%64 = phi i8* [ %24, %32 ], [ %24, %35 ], [ %16, %38 ], [ %24, %41 ], [ %24, %44 ], [ %24, %47 ], [ %24, %50 ], [ %24, %53 ], [ %24, %22 ]
%65 = phi i8* [ %25, %32 ], [ %25, %35 ], [ %25, %38 ], [ %17, %41 ], [ %25, %44 ], [ %25, %47 ], [ %25, %50 ], [ %25, %53 ], [ %25, %22 ]
%66 = phi i8* [ %26, %32 ], [ %26, %35 ], [ %26, %38 ], [ %26, %41 ], [ %18, %44 ], [ %26, %47 ], [ %26, %50 ], [ %26, %53 ], [ %26, %22 ]
%67 = phi i8* [ %27, %32 ], [ %27, %35 ], [ %27, %38 ], [ %27, %41 ], [ %27, %44 ], [ %19, %47 ], [ %27, %50 ], [ %27, %53 ], [ %27, %22 ]
%68 = phi i8* [ %28, %32 ], [ %28, %35 ], [ %28, %38 ], [ %28, %41 ], [ %28, %44 ], [ %28, %47 ], [ %20, %50 ], [ %28, %53 ], [ %28, %22 ]
%69 = call i32 @puts(i8* dereferenceable(1) %62)
%70 = load i32, i32* %5
%71 = icmp eq i32 %70, 9
br i1 %71, label %72, label %22
72: ; preds = %61, %22
%73 = phi i32 [ 1, %22 ], [ 0, %61 ]
ret i32 %73
}