#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 */
unsigned int atoi(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ vc_exit(int);
int vc_init(unsigned int, int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  unsigned int group;
  int talpa;
  if (argc == 2)
    group = atoi(argv[1]);
  else
    group = 0;
  if ((talpa = vc_init(group, 0)) < 0) {
    fprintf(stderr, "Failed to initialize!\n");
    return -1;
  }
  vc_exit(talpa);
  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   $0x2,-0x8(%rbp)
jne    1175 <main+0x35>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    117c <main+0x3c>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%edi
xor    %esi,%esi
call   1030 <vc_init@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    11b3 <main+0x73>
mov    0x2e47(%rip),%rax
mov    (%rax),%edi
lea    0xe5e(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c2 <main+0x82>
mov    -0x18(%rbp),%edi
call   1060 <vc_exit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%eax
xor    %edi,%edi
cmp    $0x2,%eax
jne    1155 <main+0x15>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%edi
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <vc_init@plt>
test   %eax,%eax
js     116b <main+0x2b>
mov    %eax,%edi
call   1060 <vc_exit@plt>
jmp    1185 <main+0x45>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xe85(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"Failed to initialize!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %6
br label %16
15: ; preds = %2
store i32 0, i32* %6
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %6
%18 = call i32 @vc_init(i32 %17, i32 0)
store i32 %18, i32* %7
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %16
%21 = load i32, i32* @stderr
%22 = call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %26
23: ; preds = %16
%24 = load i32, i32* %7
%25 = call i32 @vc_exit(i32 %24)
store i32 0, i32* %3
br label %26
26: ; preds = %23, %20
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"Failed to initialize!\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 0, %2 ]
%10 = tail call i32 @vc_init(i32 %9, i32 0)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* @stderr
%14 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %8
%16 = tail call i32 @vc_exit(i32 %10)
br label %17
17: ; preds = %15, %12
%18 = phi i32 [ -1, %12 ], [ 0, %15 ]
ret i32 %18
}