#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 EXIT_SUCCESS;
int get_ino(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ printpath(int);
int main(int argc, char *argv[]) {
  int ino = get_ino(".");
  if (ino == 2) {
    printf("/\n");
    return EXIT_SUCCESS;
  }
  printpath(ino);
  printf("\n");
  return EXIT_SUCCESS;
}


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)
lea    0xeb3(%rip),%rdi
call   1050 <get_ino@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jne    117c <main+0x4c>
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    119c <main+0x6c>
mov    -0x14(%rbp),%edi
call   1030 <printpath@plt>
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e49(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1060 <get_ino@plt>
cmp    $0x2,%eax
jne    1160 <main+0x20>
lea    0xea9(%rip),%rdi
call   1040 <puts@plt>
jmp    1171 <main+0x31>
mov    %eax,%edi
call   1050 <printpath@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2e68(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"/\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [2 x i8] c"\0A\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 = call i32 @get_ino(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 %7, i32* %6
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @EXIT_SUCCESS
store i32 %12, i32* %3
br label %18
13: ; preds = %2
%14 = load i32, i32* %6
%15 = call i32 @printpath(i32 %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = load i32, i32* @EXIT_SUCCESS
store i32 %17, i32* %3
br label %18
18: ; preds = %13, %10
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@EXIT_SUCCESS = global i32 0
@str = [2 x i8] c"/\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @get_ino(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
br label %10
7: ; preds = %2
%8 = tail call i32 @printpath(i32 %3)
%9 = tail call i32 @putchar(i32 10)
br label %10
10: ; preds = %7, %5
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}