#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*/ errx(int, char *);
int running_in_jail();
int /*<<< orphan*/ usage();
int main(int argc, char *argv[]) {
  int r;
  argc--;
  argv++;
  if (argc != 0)
    usage();
  if ((r = running_in_jail()) == -1)
    errx(1, "couldn't determine jail status");
  return r ? 0 : 1;
}


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)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     116c <main+0x3c>
mov    $0x0,%al
call   1050 <usage@plt>
mov    $0x0,%al
call   1030 <running_in_jail@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1190 <main+0x60>
mov    $0x1,%edi
lea    0xe75(%rip),%rsi
call   1040 <errx@plt>
mov    -0x14(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
je     113d <main+0xd>
xor    %eax,%eax
call   1050 <usage@plt>
xor    %eax,%eax
call   1030 <running_in_jail@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
jne    115c <main+0x2c>
lea    0xeae(%rip),%rsi
mov    $0x1,%edi
call   1040 <errx@plt>
xor    %eax,%eax
test   %ebx,%ebx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"couldn't determine jail status\00"
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 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i32 1
store i8** %10, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @usage()
br label %15
15: ; preds = %13, %2
%16 = call i32 (...) @running_in_jail()
store i32 %16, i32* %6
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %15
%19 = call i32 @errx(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
%21 = load i32, i32* %6
%22 = icmp ne i32 %21, 0
%23 = zext i1 %22 to i64
%24 = select i1 %22, i32 0, i32 1
ret i32 %24
}

LLVM IR (-O2):
@.str = [31 x i8] c"couldn't determine jail status\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (...) @usage()
br label %6
6: ; preds = %4, %2
%7 = tail call i32 (...) @running_in_jail()
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %6
%12 = icmp eq i32 %7, 0
%13 = zext i1 %12 to i32
ret i32 %13
}