#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*/ _ensure(int, int /*<<< orphan*/);
int /*<<< orphan*/ _ensure_argc(int, int, int);
int /*<<< orphan*/ chain_command(int, int, char **);
int /*<<< orphan*/ chdir(char *);
int /*<<< orphan*/ chroot(char *);
int main(int argc, char *argv[]) {
  _ensure_argc(6, 3, argc);
  _ensure(8, chroot(argv[1]));
  _ensure(9, chdir("/"));
  _ensure(11, chain_command(2, argc, argv));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x6,%edi
mov    $0x3,%esi
call   1040 <_ensure_argc@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <chroot@plt>
mov    %eax,%esi
mov    $0x8,%edi
call   1070 <_ensure@plt>
lea    0xe6f(%rip),%rdi
call   1050 <chdir@plt>
mov    %eax,%esi
mov    $0x9,%edi
call   1070 <_ensure@plt>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x2,%edi
call   1060 <chain_command@plt>
mov    %eax,%esi
mov    $0xb,%edi
call   1070 <_ensure@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x6,%edi
mov    $0x3,%esi
mov    %ebp,%edx
call   1040 <_ensure_argc@plt>
mov    0x8(%rbx),%rdi
call   1030 <chroot@plt>
mov    $0x8,%edi
mov    %eax,%esi
call   1070 <_ensure@plt>
lea    0xe7b(%rip),%rdi
call   1050 <chdir@plt>
mov    $0x9,%edi
mov    %eax,%esi
call   1070 <_ensure@plt>
mov    $0x2,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
call   1060 <chain_command@plt>
mov    $0xb,%edi
mov    %eax,%esi
call   1070 <_ensure@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i32, i32* %3
%6 = call i32 @_ensure_argc(i32 6, i32 3, i32 %5)
%7 = load i8**, i8*** %4
%8 = getelementptr inbounds i8*, i8** %7, i64 1
%9 = load i8*, i8** %8
%10 = call i32 @chroot(i8* %9)
%11 = call i32 @_ensure(i32 8, i32 %10)
%12 = call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @_ensure(i32 9, i32 %12)
%14 = load i32, i32* %3
%15 = load i8**, i8*** %4
%16 = call i32 @chain_command(i32 2, i32 %14, i8** %15)
%17 = call i32 @_ensure(i32 11, i32 %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @_ensure_argc(i32 6, i32 3, i32 %0)
%4 = getelementptr inbounds i8*, i8** %1, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 @chroot(i8* %5)
%7 = tail call i32 @_ensure(i32 8, i32 %6)
%8 = tail call i32 @chdir(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @_ensure(i32 9, i32 %8)
%10 = tail call i32 @chain_command(i32 2, i32 %0, i8** %1)
%11 = tail call i32 @_ensure(i32 11, i32 %10)
ret i32 0
}