#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*/ EX_OK;
int /*<<< orphan*/ R_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ ddb_main(int, char **);
int /*<<< orphan*/ ddb_readfile(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  if (argc == 2 && argv[1][0] == '/' && access(argv[1], R_OK) == 0)
    ddb_readfile(argv[1]);
  else
    ddb_main(argc - 1, argv + 1);
  exit(EX_OK);
}


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)
jne    11a6 <main+0x66>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    11a6 <main+0x66>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e5d(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
cmp    $0x0,%rax
jne    11a6 <main+0x66>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <ddb_readfile@plt>
jmp    11b9 <main+0x79>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
add    $0x8,%rsi
call   1030 <ddb_main@plt>
mov    0x2e18(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
cmp    $0x2,%edi
jne    1174 <main+0x34>
mov    0x8(%rbx),%rdi
cmpb   $0x2f,(%rdi)
jne    1174 <main+0x34>
mov    0x2e83(%rip),%rax
mov    (%rax),%esi
call   1050 <access@plt>
test   %rax,%rax
jne    1174 <main+0x34>
mov    0x8(%rbx),%rdi
call   1040 <ddb_readfile@plt>
jmp    1185 <main+0x45>
add    $0xffffffff,%ebp
add    $0x8,%rbx
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <ddb_main@plt>
mov    0x2e4c(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@R_OK = global i32 0
@EX_OK = global i32 0
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 eq i32 %6, 2
br i1 %7, label %8, label %28
8: ; preds = %2
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 47
br i1 %15, label %16, label %28
16: ; preds = %8
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = load i32, i32* @R_OK
%21 = call i64 @access(i8* %19, i32 %20)
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %28
23: ; preds = %16
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @ddb_readfile(i8* %26)
br label %34
28: ; preds = %16, %8, %2
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 1
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = call i32 @ddb_main(i32 %30, i8** %32)
br label %34
34: ; preds = %28, %23
%35 = load i32, i32* @EX_OK
%36 = call i32 @exit(i32 %35)
unreachable
}

LLVM IR (-O2):
@R_OK = global i32 0
@EX_OK = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 47
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = load i32, i32* @R_OK
%11 = tail call i64 @access(i8* %6, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i8*, i8** %5
%15 = tail call i32 @ddb_readfile(i8* %14)
br label %20
16: ; preds = %9, %4, %2
%17 = add nsw i32 %0, -1
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = tail call i32 @ddb_main(i32 %17, i8** %18)
br label %20
20: ; preds = %16, %13
%21 = load i32, i32* @EX_OK
%22 = tail call i32 @exit(i32 %21)
unreachable
}