#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 int8_t;

/* Variables and functions */
int /*<<< orphan*/ loganon_anonymize(int);
int loganon_init(char *, char *);
int /*<<< orphan*/ loganon_terminate();
int /*<<< orphan*/ usage(char *);
int main(int argc, char *argv[]) {
  int8_t ret;
  if (argc < 3)
    usage(argv[0]);
  ret = loganon_init(argv[1], argv[2]);
  if (ret == -1)
    return -1;
  loganon_anonymize(1);
  loganon_terminate();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    116c <main+0x2c>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1050 <usage@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <loganon_init@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
jne    119a <main+0x5a>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b2 <main+0x72>
mov    $0x1,%edi
call   1060 <loganon_anonymize@plt>
mov    $0x0,%al
call   1030 <loganon_terminate@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x2,%edi
jg     1151 <main+0x11>
mov    (%rbx),%rdi
call   1050 <usage@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1040 <loganon_init@plt>
cmp    $0xffffffff,%eax
je     1178 <main+0x38>
mov    $0x1,%edi
call   1060 <loganon_anonymize@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <loganon_terminate@plt>
jmp    117d <main+0x3d>
mov    $0xffffffff,%ebx
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**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 3
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @usage(i8* %12)
br label %14
14: ; preds = %9, %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 2
%20 = load i8*, i8** %19
%21 = call i32 @loganon_init(i8* %17, i8* %20)
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %25
24: ; preds = %14
store i32 -1, i32* %3
br label %28
25: ; preds = %14
%26 = call i32 @loganon_anonymize(i32 1)
%27 = call i32 (...) @loganon_terminate()
store i32 0, i32* %3
br label %28
28: ; preds = %25, %24
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @usage(i8* %5)
br label %7
7: ; preds = %4, %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds i8*, i8** %1, i64 2
%11 = load i8*, i8** %10
%12 = tail call i32 @loganon_init(i8* %9, i8* %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %17, label %14
14: ; preds = %7
%15 = tail call i32 @loganon_anonymize(i32 1)
%16 = tail call i32 (...) @loganon_terminate()
br label %17
17: ; preds = %7, %14
%18 = phi i32 [ 0, %14 ], [ -1, %7 ]
ret i32 %18
}