#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 */
scalar_t__ check_settings();
scalar_t__ niscy_auth();
scalar_t__ niscy_connect();
int /*<<< orphan*/ niscy_disconnect();
scalar_t__ niscy_mail();
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char **argv) {
  parse_args(argc, argv);
  if (check_settings() != 0 || (niscy_connect() != 0)) {
    return 1;
  }
  if ((niscy_auth() != 0) || (niscy_mail() != 0)) {
    niscy_disconnect();
    return 1;
  }
  niscy_disconnect();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <parse_args@plt>
mov    $0x0,%al
call   1060 <check_settings@plt>
cmp    $0x0,%rax
jne    11a4 <main+0x44>
mov    $0x0,%al
call   1080 <niscy_connect@plt>
cmp    $0x0,%rax
je     11b0 <main+0x50>
movl   $0x1,-0x4(%rbp)
jmp    11f3 <main+0x93>
mov    $0x0,%al
call   1070 <niscy_auth@plt>
cmp    $0x0,%rax
jne    11d2 <main+0x72>
mov    $0x0,%al
call   1030 <niscy_mail@plt>
cmp    $0x0,%rax
je     11e5 <main+0x85>
mov    $0x0,%al
call   1050 <niscy_disconnect@plt>
movl   $0x1,-0x4(%rbp)
jmp    11f3 <main+0x93>
mov    $0x0,%al
call   1050 <niscy_disconnect@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
call   1040 <parse_args@plt>
xor    %eax,%eax
call   1060 <check_settings@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    11aa <main+0x4a>
xor    %eax,%eax
call   1080 <niscy_connect@plt>
test   %rax,%rax
jne    11aa <main+0x4a>
xor    %eax,%eax
call   1070 <niscy_auth@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    11a3 <main+0x43>
xor    %eax,%eax
call   1030 <niscy_mail@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
xor    %eax,%eax
call   1050 <niscy_disconnect@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_args(i32 %6, i8** %7)
%9 = call i64 (...) @check_settings()
%10 = icmp ne i64 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = call i64 (...) @niscy_connect()
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %11, %2
store i32 1, i32* %3
br label %25
15: ; preds = %11
%16 = call i64 (...) @niscy_auth()
%17 = icmp ne i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = call i64 (...) @niscy_mail()
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18, %15
%22 = call i32 (...) @niscy_disconnect()
store i32 1, i32* %3
br label %25
23: ; preds = %18
%24 = call i32 (...) @niscy_disconnect()
store i32 0, i32* %3
br label %25
25: ; preds = %23, %21, %14
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i64 (...) @check_settings()
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %2
%7 = tail call i64 (...) @niscy_connect()
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6
%10 = tail call i64 (...) @niscy_auth()
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %9
%13 = tail call i64 (...) @niscy_mail()
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %12, %9
%17 = phi i32 [ 1, %9 ], [ %15, %12 ]
%18 = tail call i32 (...) @niscy_disconnect()
br label %19
19: ; preds = %16, %2, %6
%20 = phi i32 [ 1, %6 ], [ 1, %2 ], [ %17, %16 ]
ret i32 %20
}