#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 *);
scalar_t__ register_me(char *, int);
int main(int argc, char *argv[]) {
  if (argc != 2)
    return -1;
  if (register_me(argv[1], 0x02) == 0) {
    printf("SUCCESSFULLY REGISTERED!");
    return 0;
  } else {
    printf("PROBLEM WHILE REGISTERING!");
    return 1;
  }
}


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)
cmpl   $0x2,-0x8(%rbp)
je     114c <main+0x2c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1193 <main+0x73>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x2,%esi
call   1040 <register_me@plt>
cmp    $0x0,%rax
jne    1180 <main+0x60>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1193 <main+0x73>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cmp    $0x2,%edi
jne    1158 <main+0x38>
mov    0x8(%rsi),%rdi
mov    $0x2,%esi
call   1040 <register_me@plt>
xor    %ebx,%ebx
test   %rax,%rax
setne  %bl
lea    0xeb8(%rip),%rax
lea    0xeca(%rip),%rdi
cmove  %rax,%rdi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"SUCCESSFULLY REGISTERED!\00"
@.str.1 = [27 x i8] c"PROBLEM WHILE REGISTERING!\00"
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 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 -1, i32* %3
br label %19
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i64 @register_me(i8* %12, i32 2)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %19
17: ; preds = %9
%18 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %19
19: ; preds = %17, %15, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [25 x i8] c"SUCCESSFULLY REGISTERED!\00"
@.str.1 = [27 x i8] c"PROBLEM WHILE REGISTERING!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i64 @register_me(i8* %6, i32 2)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0)
%10 = xor i1 %8, true
%11 = zext i1 %10 to i32
%12 = tail call i32 @printf(i8* dereferenceable(1) %9)
br label %13
13: ; preds = %4, %2
%14 = phi i32 [ -1, %2 ], [ %11, %4 ]
ret i32 %14
}